Skip to content
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

Update ante handlers to use SignatureV2 #6428

Merged
merged 31 commits into from
Jun 29, 2020
Merged

Conversation

aaronc
Copy link
Member

@aaronc aaronc commented Jun 12, 2020

This is one of several bite-size PR's that are being pulled out of #6216 to implement #6213.

This PR:

  • SigVerificationDecorator and SigGasConsumeDecorator now work with the SignatureV2 infrastructure introduced in Add SignatureV2 infrastructure #6373 .
  • SignatureVerificationGasConsumer now has the signature: func(meter sdk.GasMeter, sig signing.SignatureV2, params types.Params) error.
  • NewAnteHandler and NewSigVerificationDecorator both now take a SignModeHandler parameter.
  • The SigVerifiableTx interface now has a GetSignaturesV2() ([]signing.SignatureV2, error) method and no longer has GetSignatures and GetSignBytes methods.

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.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer

@codecov
Copy link

codecov bot commented Jun 12, 2020

Codecov Report

Merging #6428 into master will decrease coverage by 5.94%.
The diff coverage is 69.13%.

@@            Coverage Diff             @@
##           master    #6428      +/-   ##
==========================================
- Coverage   62.79%   56.85%   -5.95%     
==========================================
  Files         251      479     +228     
  Lines       16306    28796   +12490     
==========================================
+ Hits        10240    16371    +6131     
- Misses       5361    11268    +5907     
- Partials      705     1157     +452     

@aaronc aaronc marked this pull request as ready for review June 15, 2020 19:58
simapp/app.go Outdated Show resolved Hide resolved
x/auth/ante/ante_test.go Outdated Show resolved Hide resolved
x/auth/signing/verify.go Show resolved Hide resolved
x/auth/types/stdtx.go Show resolved Hide resolved
x/auth/ante/sigverify.go Show resolved Hide resolved
x/auth/ante/sigverify.go Outdated Show resolved Hide resolved
@sahith-narahari sahith-narahari mentioned this pull request Jun 17, 2020
8 tasks
@clevinson clevinson added this to the v0.39 milestone Jun 17, 2020
@sahith-narahari sahith-narahari added R4R and removed WIP labels Jun 25, 2020
x/auth/types/stdtx.go Outdated Show resolved Hide resolved
@aaronc aaronc added the A:automerge Automatically merge PR once all prerequisites pass. label Jun 26, 2020
@aaronc
Copy link
Member Author

aaronc commented Jun 29, 2020

It would be great if someone else familiar with the ante handler stack could take a look at this @alexanderbez @alessio @jgimeno. It’s in the critical path for the proto migration

Copy link
Member

@AdityaSripal AdityaSripal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The decorators all look correct to me. Is this intended to be a backwards-compatible change?

If so, would it make more sense to implement these as separate decorators SigVerificationV2Decorator, so that people could use the old versions if they wish?

would prefer an approval from one of the SDK code owners before merging

@aaronc
Copy link
Member Author

aaronc commented Jun 29, 2020

The decorators all look correct to me. Is this intended to be a backwards-compatible change?

If so, would it make more sense to implement these as separate decorators SigVerificationV2Decorator, so that people could use the old versions if they wish?

It should be backwards compatible as is. i.e. these decorators are doing the exact same thing they were before except using an API that also supports proto tx’s. So l don’t think making them separate decorators is actually necessary.

Thanks for reviewing the logic!

Copy link
Contributor

@alexanderbez alexanderbez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

CHANGELOG.md Outdated Show resolved Hide resolved
@aaronc aaronc removed the A:automerge Automatically merge PR once all prerequisites pass. label Jun 29, 2020
@aaronc aaronc added the A:automerge Automatically merge PR once all prerequisites pass. label Jun 29, 2020
@mergify mergify bot merged commit c0e48e1 into master Jun 29, 2020
@mergify mergify bot deleted the aaronc/6213-ante-sig-verify branch June 29, 2020 20:48
larry0x pushed a commit to larry0x/cosmos-sdk that referenced this pull request May 22, 2023
* Update ante handlers to use SignatureV2

* WIP on test fixes

* WIP on test fixes

* Debugging CLI Tests

* CHANGELOG.md

* CHANGELOG

* Add missing tests for ante

* Add tests for verify signatures

* Update verify tests

* Fix register codec issue

* debug

* Cleanup

* Fix verify signature tests

* Remove viper

* remove keyring usage

* Fix review changes

* Fix simapp

* Fix ante tests

* Add reference issue

* Add test for multisignature

* Wrap sign error with sig

* Fix verify sign test

* Fix CHANGELOG.md

Co-authored-by: sahith-narahari <sahithnarahari@gmail.com>
Co-authored-by: anilCSE <anil@vitwit.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:automerge Automatically merge PR once all prerequisites pass. C:x/auth
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants