-
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 SIGN_MODE_DIRECT_AUX and tx Tip proto definitions #9405
Conversation
proto/cosmos/tx/v1beta1/tx.proto
Outdated
google.protobuf.Any public_key = 2; | ||
string chain_id = 3; | ||
uint64 account_number = 4; | ||
|
||
// tip should be left empty if the signer is not the tipper for this transaction | ||
Tip tip = 5; |
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.
note that we need to have deterministic encoding for public_key
and tip
Visit https://dashboard.github.orijtech.com?pr=9405&repo=cosmos%2Fcosmos-sdk to see benchmark details. |
Codecov Report
@@ Coverage Diff @@
## master #9405 +/- ##
==========================================
- Coverage 63.60% 63.46% -0.14%
==========================================
Files 568 568
Lines 53509 53256 -253
==========================================
- Hits 34034 33799 -235
+ Misses 17550 17533 -17
+ Partials 1925 1924 -1
|
Co-authored-by: Aaron Craelius <[email protected]>
…nto aaronc/tx-tips
@@ -96,6 +96,32 @@ message SignDocJSON { | |||
bytes sign_doc_sha256_hash = 5; | |||
} | |||
|
|||
// SignDocDirectAux is the type used for generating sign bytes for | |||
// SIGN_MODE_DIRECT_AUX. | |||
message SignDocDirectAux { |
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.
renamed from SignDocAux
to SignDocDirectAux
for consistency with SIGN_MODE_ namings
proto/cosmos/tx/v1beta1/tx.proto
Outdated
// primary signer and the one which pays the fee. The fee can be calculated | ||
// based on the cost of evaluating the body and doing signature verification | ||
// of the signers. This can be estimated via simulation. | ||
Fee fee = 6; |
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.
@aaronc I added Fee on top of your version of SignDocAux. Now everything that was in the signer's AuthInfo is in SignDoc too (for 0 malleability surface)
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.
SignDocAux
can't contain Fee
. That defeats the whole purpose of aux - if they knew the fee, they wouldn't be using SIGN_MODE_AUX. Basically fee payers should always use SIGN_MODE_DIRECT and non-fee payers can use SIGN_MODE_AUX and then they don't need to sign over the fee or any of the rest of AuthInfo
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.
Got it, thanks. I reverted Fee
should we add tests here? |
This PR only changes the proto definitions. We should add tests when we do the implementation of this sign mode |
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
closes: #9406
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