-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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(x/tx): support bytes field as signer #21850
Conversation
should be harmless to support bytes field, and bytes fields are more efficient than string,
WalkthroughWalkthroughThe pull request introduces several changes to the Changes
Possibly related PRs
Suggested reviewers
Recent review detailsConfiguration used: .coderabbit.yml Files selected for processing (4)
Additional context usedPath-based instructions (3)
Additional comments not posted (16)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
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.
ACK
cc @kocubinski, would be great to have your ACK on this. |
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.
should be harmless to support bytes field, and bytes fields are more efficient than string,
I'm OK with this change, but we should understand (and document) that a string
field and bytes
fields offer different support. string
are expected to be encoded (e.g. bech32) and the signing context uses the passed in address decoder to do that.
This bytes
implementation does no decoding.
Do you think we should use the address codec on |
What kind of error would we expect here? Do we want any kind of special support in sign modes to render this as bech32? |
In our use case, we happen to store the sender using |
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 seems like a necessary modification for performance improvement.
It would depend on the address codec of the chain, doesn't have to be per se bech32.
So maybe we should ensure bytes -> string is valid too, even if we don't care about the string result. |
I created an open issue on this years ago: #15740. We should see what amino json output will look like and if there's anything we can do to make it user friendly. |
devs can use the DefineFieldEncoding API for that, maybe we can close that issue @aaronc ? |
Can we backport this to |
(cherry picked from commit dbf6cdb)
✅ Backports have been created
|
Hey, discussed with the team, we've discussed not to backport to a compatible v0.50 x/tx version, as that change is consensus breaking and we are not a great way to convey that for 0ver extracted modules. |
(cherry picked from commit dbf6cdb)
* reset to upstream * feat(x/tx): support bytes field as signer (cosmos#21850) (cherry picked from commit dbf6cdb) * fix(x/tx): fix amino json drift from legacy spec (cosmos#21825) (cherry picked from commit 2d40cc1) fix half conflicts and revert tests conflicts * changelog
* feat(x/tx): support bytes field as signer (cosmos#21850) * Problem: multisig account failed on threshold encode after send tx (cosmos#808) * fix(x/tx): don't shadow Amino marshalling error messages (cosmos#19955) * use directly instead of cast --------- Co-authored-by: Antonio Pitasi <[email protected]> * feat: Fix datarace --------- Co-authored-by: mmsqe <[email protected]> Co-authored-by: Antonio Pitasi <[email protected]>
should be harmless to support bytes field, and bytes fields are more efficient than string,
Description
Closes: #XXXX
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...
!
in 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.
Please see Pull Request Reviewer section in the contributing guide for more information on how to review a pull request.
I have...
Summary by CodeRabbit
x/tx
module.signer
field type inBadSigner
frombytes
toint32
, affecting data representation and processing.protoreflect.BytesKind
in the signing context, improving field processing capabilities.