Skip to content

Commit

Permalink
fix(x/auth): check if simulation in verifyIsOnCurve (#19099)
Browse files Browse the repository at this point in the history
Co-authored-by: Marko <[email protected]>
Co-authored-by: Aleksandr Bezobchuk <[email protected]>
  • Loading branch information
3 people authored Jan 24, 2024
1 parent 3c4a91e commit 38d56db
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions x/auth/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,8 @@ Ref: https://keepachangelog.com/en/1.0.0/

* [#18817](https://github.com/cosmos/cosmos-sdk/pull/18817) SigVerification, GasConsumption, IncreaseSequence ante decorators have all been joined into one SigVerification decorator. Gas consumption during TX validation flow has reduced.
* [#19093](https://github.com/cosmos/cosmos-sdk/pull/19093) SetPubKeyDecorator was merged into SigVerification, gas consumption is almost halved for a simple tx.

### Bug Fixes

* [#19099](https://github.com/cosmos/cosmos-sdk/pull/19099) `verifyIsOnCurve` now checks if we are simulating to avoid malformed public key error.

5 changes: 5 additions & 0 deletions x/auth/ante/sigverify.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ func OnlyLegacyAminoSigners(sigData signing.SignatureData) bool {
}

func verifyIsOnCurve(pubKey cryptotypes.PubKey) (err error) {
// when simulating pubKey.Key will always be nil
if pubKey.Bytes() == nil {
return nil
}

switch typedPubKey := pubKey.(type) {
case *secp256k1.PubKey:
pubKeyObject, err := secp256k1dcrd.ParsePubKey(typedPubKey.Bytes())
Expand Down

0 comments on commit 38d56db

Please sign in to comment.