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

fix(precompile): BLS G2 MSM #1428

Merged
merged 9 commits into from
May 17, 2024
Merged

fix(precompile): BLS G2 MSM #1428

merged 9 commits into from
May 17, 2024

Conversation

shekhirin
Copy link
Collaborator

@shekhirin shekhirin commented May 16, 2024

  • Adds back the BLS Test Vectors from AlphaNet
  • Fixes bug introduced by the newer test vectors from the EIP which involved a BLST footgun in the API that took us multiple hours to identify. This behavior MUST be clearly documented as it's dangerous for broader usage of BLST.

This was a process failure from our side:

  1. We shipped 2537 in AlphaNet ~1 mo ago, and thought the EIP was "done"
  2. We did not look at the updated test vectors, this would've surfaced this 2-3 weeks ago

Makes me think we may want to subscribe to specific EIP updates in an internal channel to ensure we don't miss anything.

Copy link
Contributor

github-actions bot commented May 16, 2024

Valgrind Results:

==3811== Cachegrind, a cache and branch-prediction profiler
==3811== Copyright (C) 2002-2017, and GNU GPL'd, by Nicholas Nethercote et al.
==3811== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info
==3811== Command: target/release/snailtracer
==3811== 
--3811-- warning: L3 cache found, using its data for the LL simulation.
Running snailtracer example!
elapsed: 1.810957493s
==3811== 
==3811== I   refs:      429,370,134
==3811== I1  misses:          3,130
==3811== LLi misses:          2,793
==3811== I1  miss rate:        0.00%
==3811== LLi miss rate:        0.00%
==3811== 
==3811== D   refs:      206,204,554  (133,650,291 rd   + 72,554,263 wr)
==3811== D1  misses:        344,322  (    204,238 rd   +    140,084 wr)
==3811== LLd misses:        137,640  (      4,278 rd   +    133,362 wr)
==3811== D1  miss rate:         0.2% (        0.2%     +        0.2%  )
==3811== LLd miss rate:         0.1% (        0.0%     +        0.2%  )
==3811== 
==3811== LL refs:           347,452  (    207,368 rd   +    140,084 wr)
==3811== LL misses:         140,433  (      7,071 rd   +    133,362 wr)
==3811== LL miss rate:          0.0% (        0.0%     +        0.2%  )

@gakonst gakonst marked this pull request as ready for review May 17, 2024 00:20
gakonst added a commit to paradigmxyz/reth that referenced this pull request May 17, 2024
@gakonst
Copy link
Collaborator

gakonst commented May 17, 2024

Found & fixed the bug and updated PR description. Feel free to improve on my code (esp the empty slice check is ugly but it's 330am). This should be functional for Devnet-0. There might be better ways to work around this massive BLST footgun but don't have the time for this rn.

Copy link
Member

@rakita rakita left a comment

Choose a reason for hiding this comment

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

Pending some discussion, PR lgtm

rakita and others added 3 commits May 17, 2024 12:44
these should be added again at some point
@shekhirin shekhirin changed the title test(precompile): add BLS test vectors fix(precompile): BLS G2 MSM May 17, 2024
Copy link
Member

@rakita rakita left a comment

Choose a reason for hiding this comment

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

lgtm

@rakita rakita merged commit 8fd85f1 into main May 17, 2024
25 checks passed
@github-actions github-actions bot mentioned this pull request May 17, 2024
@DaniPopes DaniPopes deleted the alexey/bls-test-vectors branch May 17, 2024 13:19
This was referenced May 31, 2024
This was referenced Jun 6, 2024
This was referenced Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants