-
Notifications
You must be signed in to change notification settings - Fork 602
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
Conversation
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.
option (google.api.http).get = | ||
"/osmosis/txfees/v1beta1/spot_price_by_denom"; |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this 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 { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going to close this as stale for now. Lets update with the fix matt pointed out |
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
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
## 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)
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:
docs/
) or specification (x/<module>/spec/
)Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorer