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

questions about the protobuf definitions of MsgSubmitProposal #130

Closed
pyramation opened this issue Jul 19, 2022 · 2 comments
Closed

questions about the protobuf definitions of MsgSubmitProposal #130

pyramation opened this issue Jul 19, 2022 · 2 comments

Comments

@pyramation
Copy link
Collaborator

pyramation commented Jul 19, 2022

(Thanks @assafmo for researching these definitions)

questions about the protobuf definitions of MsgSubmitProposal

In MsgSubmitProposal (https://github.com/scrtlabs/cosmos-sdk/blob/ac08f6c7e0/proto/cosmos/gov/v1beta1/tx.proto#L29-L44) content is (cosmos_proto.accepts_interface) = "Content", but only TextProposal (https://github.com/scrtlabs/cosmos-sdk/blob/ac08f6c7e0/proto/cosmos/gov/v1beta1/gov.proto#L44-L53) is (cosmos_proto.implements_interface) = "Content".

In practice there are at least 7 proposal types that I managed to find by hand, so my question is how can client library effectively find them?

  1. SoftwareUpgradeProposal (https://github.com/scrtlabs/cosmos-sdk/blob/ac08f6c7e0/proto/cosmos/upgrade/v1beta1/upgrade.proto#L45-L54)
  2. CancelSoftwareUpgradeProposal (https://github.com/scrtlabs/cosmos-sdk/blob/ac08f6c7e0/proto/cosmos/upgrade/v1beta1/upgrade.proto#L56-L64)
  3. TextProposal (https://github.com/scrtlabs/cosmos-sdk/blob/ac08f6c7e0/proto/cosmos/gov/v1beta1/gov.proto#L44-L53)
  4. ParameterChangeProposal (https://github.com/scrtlabs/cosmos-sdk/blob/ac08f6c7e0/proto/cosmos/params/v1beta1/params.proto#L9-L17)
  5. CommunityPoolSpendProposal (https://github.com/scrtlabs/cosmos-sdk/blob/ac08f6c7e0/proto/cosmos/distribution/v1beta1/distribution.proto#L111-L124)

And two more in ibc-go:
6. ClientUpdateProposal (https://github.com/cosmos/ibc-go/blob/46e02064/proto/ibc/core/client/v1/client.proto#L39-L54)
7. UpgradeProposal (https://github.com/cosmos/ibc-go/blob/46e02064/proto/ibc/core/client/v1/client.proto#L56-L74)

Seems to me that they're all manually implementing the Content (https://github.com/scrtlabs/cosmos-sdk/blob/ac08f6c7e0/x/gov/legacy/v036/types.go#L40-L47) interface in Go after being derived from protobuf, and that's what ultimately decides if it's a valid proposal type or not.

Also seems like CommunityPoolSpendProposalWithDeposit (https://github.com/enigmampc/cosmos-sdk/blob/ac08f6c7e0/proto/cosmos/distribution/v1beta1/distribution.proto#L154-L165) is defined but doesn't implement the Content interface.

Would love to get some feedback and more info on this. 🙏

tagging this issue for tracking #118

@pyramation
Copy link
Collaborator Author

@ValarDragon can you help us out here?

The goal is to be able to parse the .proto files and be able to determine who to aggregate which messages are of type Content to properly serialize MsgSubmitProposal.content.

However, it looks like only TextProposal is using the (cosmos_proto.implements_interface) = "Content"

@pyramation
Copy link
Collaborator Author

@ValarDragon I moved this convo over to #118

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant