-
Notifications
You must be signed in to change notification settings - Fork 597
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
add annotations for client tooling and codegen #3782
add annotations for client tooling and codegen #3782
Conversation
This reverts commit 72b34ce.
I'm of the opinion that it is important to make Larry happy! You mentioned that this would be aided by adding annotations to the osmosis-sdk, right? |
yep! this depends on importing |
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.
Looks great to me! I'll do the proto builds
ah wait no, we need to update our SDK to have |
yep, issue documented here, will comment over there now osmosis-labs/cosmos-sdk#400 |
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.
Do we have any test that has been done to ensure that this way of amino encoding / decoding ensures compatibility with the old way of handling amino?
Otherwise LGTM, but lets hold merging until osmosis-labs/cosmos-sdk#400 has been pushed forward
There is not a test, but as far as I understand it, this is only annotations for fields,
Cool! |
this will not effect go code since the generator doesn't account for it. It will be part of the proto descriptor that clients can use though |
This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. Thank you! |
let's not mark this as stale or old, thanks! |
This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. Thank you! |
This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. Thank you! |
let me know if we can make this PR happen, or if I need to rebase and make a new one, thanks! |
This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. Thank you! |
hey @mattverse — the last PR adds the amino file, right? Which means we likely can add this PR soon. |
hey @pyramation yeah! working on porting your changes over right now |
@pyramation Would you mind if I close this PR and open a new PR that includes these changes? Need some additional updates in go.mod and compile protobuf files as well |
This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. Thank you! |
whatever works! sounds good! |
@pyramation sweet! Closing this in favor of #4629 |
What is the purpose of the change
This adds new annotations used by codegen tools to create encoders/decoders that can manage the
google.protobuf.Any
types. This change has many (positive) implications:RPC calls get properly decoded
Currently, when you do an RPC call, for example,
In the current system, you get back results that just have a bunch of encoded bytes (not very useful for FE devs):
Leveraging the
implements_interface
andaccepts_interface
, we can now derive and generate decoders, in this case, the pools:This will now give us the expected API result when fetching pools (and will also close issues like this one and make people like Larry0x happy)
Messages with nested messages/protos and their amino encoders for ledger support
Additionally, we can create encoders for toAmino/fromAmino that leverage interfaces with proper annotations. Here is an example for proposals that multiplex on
content
using theContent
interface:fromAmino
encodertoAmino
encoderThis can enable a new class of dApps built on osmosis. Currently developers have to manually construct all of these encodings.
Changes required
importing
amino/amino.proto
amino/amino.proto
which currently exists in the cosmos/cosmos-sdkNotes (and nice to haves)
Missing codec registrations
These are missing amino registrations (via
RegisterConcrete
):MsgExtendLockup
MsgForceUnlock
MsgRedelegateValidatorSet
These are missing amino registration (via
RegisterConcrete
), but registered viaRegisterProposalTypeCodec
:ReplacePoolIncentivesProposal
(osmosis/ReplacePoolIncentivesProposal)SetProtoRevAdminAccountProposal
SetProtoRevEnabledProposal
Conventions
convention for
Register*
names (amino/proposal/etc)should we have a convention for
Register*
names? I noticed some discrepancies:osmosis/SetSuperfluidAssetsProposal
forRegisterProposalTypeCodec
vsosmosis/set-superfluid-assets-proposal
forRegisterConcrete
osmosis/UpdatePoolIncentivesProposal
is used for BOTHRegisterProposalTypeCodec
andRegisterConcrete
interface conventions
Once we resolve that conversation, we can determine if we need to do this
Brief Changelog
amino/amino.proto
(which means this PR needs to be rebased BEFORE merge, issue here)Testing and Verifying
This change added tests and can be verified as follows:
Documentation and Release Note