Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the name of the balancer proto service from Msg -> BalancerMsg #1208

Closed
wants to merge 1 commit into from

Conversation

ValarDragon
Copy link
Member

This previously was causing problems for typescript proto generation,
because we have Balancer's proto Msg service and gamm's proto Msg service
existing at the same proto import path.

They existed at the same import path, because due to interface serialization
depending on the amino route (which depended on the proto import path),
changing the import path requires a state migration thats a bit cumbersome to
do.

Closes: #1185


For contributor use:

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer

This previously was causing problems for typescript proto generation,
because we have Balancer's proto Msg service and gamm's proto Msg service
existing at the same proto import path.

They existed at the same import path, because due to interface serialization
depending on the amino route (which depended on the proto import path),
changing the import path requires a state migration thats a bit cumbersome to
do.
@ValarDragon ValarDragon added the A:backport/v7.x Do not use. backport patches to v7.x branch label Apr 6, 2022
Comment on lines +22 to +23
option (google.api.http).get =
"/osmosis/txfees/v1beta1/spot_price_by_denom";
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done by proto formatting automatically

ServiceName: "osmosis.gamm.v1beta1.Msg",
HandlerType: (*MsgServer)(nil),
var _BalancerMsg_serviceDesc = grpc.ServiceDesc{
ServiceName: "osmosis.gamm.v1beta1.BalancerMsg",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this service name at all important?

an alternative approach to fixing this problem entirely, is to migrate the balancer pools and not deal with this duplicate import situation

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is still it creating BalancerMsg under v1beta1? I was assuming it should be created as something like osmosis.gamm.pool-models.BalacerMsg

Wdym by migrating balancer pools?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh thats a good point, we could make txs under the correct package, but just leave the pool proto definition under the legacy wrong one

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think your proposal is a better approach

Copy link
Member

@mattverse mattverse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Funny I just came across the same problem while I was working on #1209

Anyways, is x/gamm/pool-models/balancer/tx.pb.go's ServiceName the main concern we have and the main reason we can't push foward on simply chagning to BalancerMsg?

@@ -6,7 +6,7 @@ import "osmosis/gamm/pool-models/balancer/balancerPool.proto";

option go_package = "github.com/osmosis-labs/osmosis/v7/x/gamm/pool-models/balancer";

service Msg {
service BalancerMsg {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain how/where this service is used? Does this actually process on-chain messages?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should process on-chain messages at least, I have not confirmed on a testnet. The service name as far as I can tell is just for generated protobuf structs, we have methods to register the proto service, linking the go struct to the proto message

Copy link
Contributor

@alexanderbez alexanderbez Apr 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry if this is obvious, but why are they not all under a single service?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ValarDragon
Copy link
Member Author

Going to close this as stale for now. Lets update with the fix matt pointed out

@ValarDragon ValarDragon closed this May 3, 2022
mergify bot pushed a commit that referenced this pull request May 16, 2022
Closes: [#1185](#1185)

## What is the purpose of the change

With proto Msg service defined twice(both in Balancer proto and gamm package proto), this is currently causing problems in typescript proto generation. 

As @ValarDragon mentioned in #1208,
> They existed at the same import path, because due to interface serialization
depending on the amino route (which depended on the proto import path),
changing the import path requires a state migration thats a bit cumbersome to
do.

This PR solves this by making txs under the correct package, but leaving balacner pool proto definition under the legacy wrong one, `package osmosis.gamm.v1beta1`. Solving the problem this way allows us to solve without having to need state breaking changes or additional migration for existing pools.

In addition to solving the exisitng problem of duplicated Msg in one package, this PR also changes stableswap pool proto package to the correct package.

## Brief Changelog
- Change proto package for balancer msg


## Documentation and Release Note

  - Does this pull request introduce a new feature or user-facing behavior changes? maybe
  - Is a relevant changelog entry added to the `Unreleased` section in `CHANGELOG.md`? yes
  - How is the feature or change documented? not applicable
xla pushed a commit to meka-dev/osmosis that referenced this pull request May 17, 2022
Closes: [osmosis-labs#1185](osmosis-labs#1185)

With proto Msg service defined twice(both in Balancer proto and gamm package proto), this is currently causing problems in typescript proto generation.

As @ValarDragon mentioned in osmosis-labs#1208,
> They existed at the same import path, because due to interface serialization
depending on the amino route (which depended on the proto import path),
changing the import path requires a state migration thats a bit cumbersome to
do.

This PR solves this by making txs under the correct package, but leaving balacner pool proto definition under the legacy wrong one, `package osmosis.gamm.v1beta1`. Solving the problem this way allows us to solve without having to need state breaking changes or additional migration for existing pools.

In addition to solving the exisitng problem of duplicated Msg in one package, this PR also changes stableswap pool proto package to the correct package.

- Change proto package for balancer msg

  - Does this pull request introduce a new feature or user-facing behavior changes? maybe
  - Is a relevant changelog entry added to the `Unreleased` section in `CHANGELOG.md`? yes
  - How is the feature or change documented? not applicable
mergify bot pushed a commit that referenced this pull request Jun 5, 2022
## What is the purpose of the change

This fix is necessary in order to support ORM.

The legacy problem with proto package for balancer has been a problem for a long time, which has been fixed and addressed over multiple PRs(#1208, #1469). The latest decision that has been made upon this legacy package issue was to change the `tx.proto`(https://github.com/osmosis-labs/osmosis/blob/main/proto/osmosis/gamm/pool-models/balancer/tx.proto) to the correct package while leaving `balacerPool.proto` under the legacy wrong package so that we wouldn't have to deal with migration logic. 

Even though such decision has fixed duplicate package issue that has been a blocker for typescript proto generation, it is now an issue with orm support, as protoc does not allow one package path to have different packages within the protofiles(ex. protoc-gen-go-grpc: Go package "github.com/osmosis-labs/osmosis/api/osmosis/gamm/pool-models/balancer" has inconsistent names gammv1beta1 (osmosis/gamm/pool-models/balancer/balancerPool.proto) and balancerv1beta1 (osmosis/gamm/pool-models/balancer/tx.proto)).

There would be multiple ways to fix this problem, open to other ways of fixing this as well.  

The way this PR solves it is physically creating a new folder for the `tx.proto` file under the `proto/gamm/pool-models/balancer` folder to avoid the problem stated above. 

---

As for the superfluid module, we have had inconsistency with the packages as well proto package for `gov.proto` set to `osmosis.superfluid.v1beta`, while the other proto packages have the proto package of `osmosis.superfluid`. The suggested fix in this PR is creating a new folder under `proto/superfluid` to fix the duplicate proto package path issue. 


## Brief Changelog

- Change proto package for `proto/gamm/pool-models/balancer/tx.proto` and `proto/superfluid/gov.proto`

## Testing and Verifying

Additional testing needed that this fix does not break unknown unknowns in the state side.

## Documentation and Release Note

  - Does this pull request introduce a new feature or user-facing behavior changes? yes
  - Is a relevant changelog entry added to the `Unreleased` section in `CHANGELOG.md`?no
  - How is the feature or change documented? (not applicable   /   specification (`x/<module>/spec/`)  /  [Osmosis docs repo](https://github.com/osmosis-labs/docs)   /   not documented)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:backport/v7.x Do not use. backport patches to v7.x branch
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[x/gamm][Misc improvements] Msg defined twice in different proto files
3 participants