Skip to content

crypto/secp256k1: update libsecp256k1 (#31242) #194

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

Merged

Conversation

ARR4N
Copy link
Collaborator

@ARR4N ARR4N commented Jun 23, 2025

Warning

DO NOT squash merge. I will fast-forward merge into main.

Why this should be merged

Cherry-picks ethereum#31242

How this works

Tracked in #128 to be reverted when included by an upgrade (avoids merge conflicts).

The only merge conflict in the pick was due to a comment being updated to fix a typo.

How this was tested

Existing tests.

@ARR4N ARR4N force-pushed the arr4n/cherry-pick-5606cbc710ffcf327740e4db54776eb8a3c1a2fc branch 2 times, most recently from f8ead0f to 9146c25 Compare June 23, 2025 15:29
@ARR4N ARR4N marked this pull request as draft June 23, 2025 15:40
@ARR4N ARR4N force-pushed the arr4n/cherry-pick-5606cbc710ffcf327740e4db54776eb8a3c1a2fc branch from 9146c25 to c3a3a9e Compare June 23, 2025 15:40
ARR4N and others added 2 commits June 23, 2025 16:52
Updates the libsecp256k1 dependency to commit:
c0d9480fbbf8eccbd4be23ed27f6f2af6f3b211e

PR:
```
BenchmarkSign-24    	   57756	     21214 ns/op	     164 B/op	       3 allocs/op
BenchmarkRecover-24    	   37156	     33044 ns/op	      80 B/op	       1 allocs/op
BenchmarkEcrecoverSignature-24    	   36889	     32935 ns/op	      80 B/op	       1 allocs/op
BenchmarkVerifySignature-24    	   41163	     29207 ns/op	       0 B/op	       0 allocs/op
BenchmarkDecompressPubkey-24    	  318624	      4062 ns/op	     304 B/op	       6 allocs/op
```

Master:
```
BenchmarkSign-24    	   34509	     35330 ns/op	     164 B/op	       3 allocs/op
BenchmarkRecover-24    	   25418	     47725 ns/op	      80 B/op	       1 allocs/op
BenchmarkEcrecoverSignature-24    	   25735	     47591 ns/op	      80 B/op	       1 allocs/op
BenchmarkVerifySignature-24    	   29108	     41097 ns/op	       0 B/op	       0 allocs/op
BenchmarkDecompressPubkey-24    	  294747	      4143 ns/op	     304 B/op	       6 allocs/op
```

Performance seems to be improved significantly:
```
Sign-24      34.86µ ± 3%   21.66µ ± 2%  -37.86% (p=0.000 n=10)
Recover-24   46.14µ ± 3%   33.24µ ± 2%  -27.95% (p=0.000 n=10)
```
@ARR4N ARR4N force-pushed the arr4n/cherry-pick-5606cbc710ffcf327740e4db54776eb8a3c1a2fc branch from c3a3a9e to 8ae4631 Compare June 23, 2025 15:53
@ARR4N ARR4N marked this pull request as ready for review June 23, 2025 16:05
@ARR4N ARR4N added the Status: 🔴 DO NOT MERGE This PR is not meant to be merged in its current state label Jun 23, 2025
Copy link

@chriselbring-avalabs chriselbring-avalabs left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

@ceyonur ceyonur left a comment

Choose a reason for hiding this comment

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

left a comment about formatting, otherwise lgtm

@ARR4N ARR4N merged commit 8ae4631 into main Jun 25, 2025
12 checks passed
@ARR4N ARR4N deleted the arr4n/cherry-pick-5606cbc710ffcf327740e4db54776eb8a3c1a2fc branch June 25, 2025 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: 🔴 DO NOT MERGE This PR is not meant to be merged in its current state
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants