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

[x/gamm][Misc improvements] Msg defined twice in different proto files #1185

Closed
Tracked by #1453
pyramation opened this issue Mar 31, 2022 · 4 comments · Fixed by #1469
Closed
Tracked by #1453

[x/gamm][Misc improvements] Msg defined twice in different proto files #1185

pyramation opened this issue Mar 31, 2022 · 4 comments · Fixed by #1469
Assignees
Labels
C:x/gamm Changes, features and bugs related to the gamm module. T:task ⚙️ A task belongs to a story

Comments

@pyramation
Copy link

I'm working on a workflow to produce TS definitions and using protoc to generate them. In this process, I'm getting an error

osmosis/gamm/v1beta1/tx.proto:9:9: "osmosis.gamm.v1beta1.Msg" is already defined in file "osmosis/gamm/pool-models/balancer/tx.proto".

https://github.com/osmosis-labs/osmosis/blob/main/proto/osmosis/gamm/pool-models/balancer/tx.proto#L9

https://github.com/osmosis-labs/osmosis/blob/main/proto/osmosis/gamm/v1beta1/tx.proto#L9

Seems that the Msg identifier is being used twice. Maybe not an issue in go, but in generating via ts-proto it seems to not be happy.

@pyramation
Copy link
Author

for more context, here is the command I'm running in the repo w all protobufs: https://github.com/pyramation/osmosis-protobufs/blob/master/bin/run-proto.sh

@pyramation
Copy link
Author

I saw the progress on the PR and tested out the protoc gen — the current PR works 🙌🏻

@ValarDragon
Copy link
Member

Matt had a good point: #1208 (comment)

We should change the txs to be defined under the correct package, and just leave the balancer pool defined under the wrong proto package (which won't cause conflicts)

@pyramation
Copy link
Author

great, I like the idea of osmosis.gamm.pool-models.BalacerMsg or a path that makes sense 🙌🏻

@xBalbinus xBalbinus self-assigned this May 5, 2022
@p0mvn p0mvn changed the title Msg defined twice in different proto files [x/gamm] Msg defined twice in different proto files May 9, 2022
@p0mvn p0mvn mentioned this issue May 9, 2022
6 tasks
@p0mvn p0mvn changed the title [x/gamm] Msg defined twice in different proto files [x/gamm][Misc improvements] Msg defined twice in different proto files May 9, 2022
@mattverse mattverse self-assigned this May 10, 2022
@mergify mergify bot closed this as completed in #1469 May 16, 2022
mergify bot pushed a commit that referenced this issue 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 issue 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:x/gamm Changes, features and bugs related to the gamm module. T:task ⚙️ A task belongs to a story
Projects
Archived in project
5 participants