-
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
Enable secp256r1 #8786
Merged
Merged
Enable secp256r1 #8786
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
ecd3852
enable secp256r1 in antehandlers
robert-zaremba 67947e5
Add sig verification benchamrk to find a sigverify fee
robert-zaremba adac3de
adjust the gas fee
robert-zaremba abd89d5
enable secp256r1 in antehandlers
robert-zaremba d51f61e
Add sig verification benchamrk to find a sigverify fee
robert-zaremba 7fdfba9
adjust the gas fee
robert-zaremba 65e8083
Update the secp256r1 fee factor
robert-zaremba de74258
Update changelog
robert-zaremba a0ec291
Merge remote-tracking branch 'refs/remotes/origin/robert/enable-secp2…
robert-zaremba b00799b
Merge branch 'master' into robert/enable-secp256r1
robert-zaremba 458b83b
regenerate docs
robert-zaremba File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package ante_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
tmcrypto "github.com/tendermint/tendermint/crypto" | ||
|
||
"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" | ||
"github.com/cosmos/cosmos-sdk/crypto/keys/secp256r1" | ||
) | ||
|
||
// This benchmark is used to asses the ante.Secp256k1ToR1GasFactor value | ||
func BenchmarkSig(b *testing.B) { | ||
require := require.New(b) | ||
msg := tmcrypto.CRandBytes(1000) | ||
|
||
skK := secp256k1.GenPrivKey() | ||
pkK := skK.PubKey() | ||
skR, _ := secp256r1.GenPrivKey() | ||
pkR := skR.PubKey() | ||
|
||
sigK, err := skK.Sign(msg) | ||
require.NoError(err) | ||
sigR, err := skR.Sign(msg) | ||
require.NoError(err) | ||
b.ResetTimer() | ||
|
||
b.Run("secp256k1", func(b *testing.B) { | ||
for i := 0; i < b.N; i++ { | ||
ok := pkK.VerifySignature(msg, sigK) | ||
require.True(ok) | ||
} | ||
}) | ||
|
||
b.Run("secp256r1", func(b *testing.B) { | ||
for i := 0; i < b.N; i++ { | ||
ok := pkR.VerifySignature(msg, sigR) | ||
require.True(ok) | ||
} | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Let's discuss the fee adjustment in #8515