-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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 SignDocJSON for proto JSON signing #8476
Conversation
Hello, I'll try to be short :)
I didn't follow the proto development here a lot, is there a place where we can find the proto files currently used by the chain ? Or even an endpoint that serves proto files, so that as a wallet, I can double check my formats during "proto format negotiation" before broadcasting ? I guess those questions are more for cosmos/gaia than this, no idea how getting the correct proto should happen basically, so that wallets can fetch and/or ensure a source of truth for serialization (and avoiding sign verification error on broadcast) |
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.
Nice.
I think it would be very helpful to see an example JSON dump of this, including one or two messages as well as the hash.
The only annoyance I see with this is that we are back to depending on protobuf field names, enforcing code generators to preserve the original casing even in camelCase dominated ecosystems like JavaScript or Swift. This can only be prevented if there are strict casing rules, like all proto message fields must use snake_case. Then we could let the code generator do its preferred transformation making the linters happy, and auto-convert to snake_case in a signing library when creating a SignDocTextual. Maybe https://github.com/regen-network/canonical-proto3/blob/master/README.md#do-not-use-lowercamelcase-names could be adjusted to enforce snake_case instead of disallowing lowerCamelCase.
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Co-authored-by: Simon Warta <[email protected]>
@aaronc is this targeted for v0.43? |
No unfortunately not. For 0.44 yes. |
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.
SignDoc proto def looks good.
I only have questions about naming:
- what did "DIRECT" mean in
SIGN_MODE_DIRECT
? - since this is JSON, why are we still calling it "Textual"?
As discussed during our standup, @ruhatch will push commits to this PR to address the few remaining review comments. |
Visit https://dashboard.github.orijtech.com?pr=8476&repo=cosmos%2Fcosmos-sdk to see benchmark details. |
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.
lgtm
ref: #9320
After our call today, it feels like this is may be the simplest way forward for now.
Canonical proto signing would be done using this spec: https://github.com/regen-network/canonical-proto3/blob/master/README.md#json
@jleni @gagbo the JSON would look like this:
Also proto messages will use
@type
instead oftype
.Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerCodecov Report
in the comment section below once CI passes