-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
feat: add message option extension to signal msg signers in a language agnostic way #10977
Conversation
This PR includes only proto changes and generated code changes. I have already written the code that does runtime check but I haven't pushed it yet. The runtime code asserted that every signer is correctly formed. The only thing I'd need right now for the review is to make sure that I mean I've checked it multiple times but an extra pair of eyes helps. |
Codecov Report
@@ Coverage Diff @@
## master #10977 +/- ##
==========================================
- Coverage 65.95% 65.84% -0.12%
==========================================
Files 647 644 -3
Lines 65873 65630 -243
==========================================
- Hits 43444 43211 -233
+ Misses 19941 19939 -2
+ Partials 2488 2480 -8
|
Anyone knows why this test might be failing? First time seeing this. https://github.com/cosmos/cosmos-sdk/runs/4868894745?check_suite_focus=true |
proto/cosmos/msg/v1beta1/msg.proto
Outdated
// The field must either be of string kind, or of message | ||
// kind in case the signer information is contained within | ||
// a message inside the cosmos message. | ||
repeated string signers = 11110000; |
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.
repeated string signers = 11110000; | |
repeated string signer = 11110000; |
This is more intuitive naming given how repeated options are declared
proto/cosmos/msg/v1beta1/msg.proto
Outdated
@@ -0,0 +1,22 @@ | |||
syntax="proto3"; | |||
|
|||
package cosmos.msg.v1beta1; |
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.
package cosmos.msg.v1beta1; | |
package cosmos.msg.v1beta1; |
Let's change this to v1 before release (or change it now)
Tests added, and added more docs. We have no real way to test the protoregistry part due to how gogoproto registry works. The policy in case of missing/malformed signers is a panic. I was wondering if we should relax it or use a global to set it from panic to warning, reason being unexpected panics due to some unforeseen errors in the registry. |
Putting on draft again in order to try to resolve protobuf filenames conflicts in a more elegant way. |
What if we just merge the annotations in this PR and deal with the validation in a follow up? |
# Conflicts: # x/gov/types/v1beta2/tx.pb.go
Opening this again for review, removed the validation part as doing the gogoproto registry fix alongside this PR requires too much dependency synchronisation. cc: @aaronc, @AmauryM, @marbar3778 |
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.
utACK
storetypes "github.com/cosmos/cosmos-sdk/store/types" | ||
|
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.
storetypes "github.com/cosmos/cosmos-sdk/store/types" | |
storetypes "github.com/cosmos/cosmos-sdk/store/types" |
Co-authored-by: Marko <marbar3778@yahoo.com>
// if validator_address == delegator_address then only one | ||
// is expected to sign, otherwise both are. | ||
option (cosmos.msg.v1.signer) = "delegator_address"; | ||
option (cosmos.msg.v1.signer) = "validator_address"; |
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.
What do you think of option (cosmos.msg.v1.signer) = "delegator_address,validator_address";
which would be similar to e.g. the orm indices syntax
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.
Considering the instances in which we have multiple signers, I'd keep it this way, also because the decision to rename the field signers
to signer
was mainly driven by the most common use case.
But no strong opinion otherwise, let me know.
I'd like to take some time in today's architecture call to present this and other pulsar/app wiring related changes that are coming |
Description
Closes: #10933
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change