Skip to content

precompiles: Precompute Miller loop lines for KZG trusted setup point#1537

Merged
chfast merged 1 commit into
masterfrom
kzg/precompute-lines
May 25, 2026
Merged

precompiles: Precompute Miller loop lines for KZG trusted setup point#1537
chfast merged 1 commit into
masterfrom
kzg/precompute-lines

Conversation

@chfast

@chfast chfast commented May 22, 2026

Copy link
Copy Markdown
Member

Precompute the Miller-loop lines for the trusted-setup point [s]₂
and use these (instead of the point) for faster KZG pairing check.
The precomputation has been done outside and only the result is stored.
The static data size is ~19 KB.

@codecov

codecov Bot commented May 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.97%. Comparing base (49f7e65) to head (cffbd87).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1537   +/-   ##
=======================================
  Coverage   96.97%   96.97%           
=======================================
  Files         162      163    +1     
  Lines       14436    14450   +14     
  Branches     3383     3384    +1     
=======================================
+ Hits        13999    14013   +14     
  Misses        307      307           
  Partials      130      130           
Flag Coverage Δ
eest-develop 91.93% <100.00%> (+<0.01%) ⬆️
eest-develop-gmp 26.51% <18.75%> (-0.02%) ⬇️
eest-legacy 17.56% <0.00%> (-0.02%) ⬇️
eest-libsecp256k1 28.15% <18.75%> (-0.03%) ⬇️
eest-stable 91.85% <100.00%> (+<0.01%) ⬆️
evmone-unittests 92.63% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
core 96.02% <100.00%> (+<0.01%) ⬆️
tooling 86.71% <ø> (ø)
tests 99.79% <100.00%> (+<0.01%) ⬆️
Files with missing lines Coverage Δ
lib/evmone_precompiles/kzg.cpp 100.00% <100.00%> (ø)
lib/evmone_precompiles/kzg_setup_g2_1_lines.cpp 100.00% <100.00%> (ø)
test/unittests/precompiles_kzg_test.cpp 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@chfast chfast force-pushed the kzg/precompute-lines branch from 2077394 to 487a42c Compare May 25, 2026 10:50
@chfast chfast marked this pull request as ready for review May 25, 2026 10:51
@chfast chfast requested a review from Copilot May 25, 2026 10:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

test/unittests/precompiles_kzg_test.cpp:12

  • std::memcmp is used in this test, but <cstring> is not included. Relying on indirect includes can break builds depending on toolchain/standard library; add #include <cstring> (or <string.h>) near the other includes.
#include <evmc/evmc.hpp>
#include <evmone_precompiles/kzg.hpp>
#include <evmone_precompiles/kzg_setup_g2_1_lines.hpp>
#include <evmone_precompiles/sha256.hpp>
#include <gtest/gtest.h>
#include <intx/intx.hpp>
#include <span>

Comment thread lib/evmone_precompiles/kzg_setup_g2_1_lines.cpp Outdated
Precompute the Miller-loop lines for the trusted-setup point [s]₂
and use these (instead of the point) for faster KZG pairing check.
The precomputation has been done outside and only the result is stored.
The static data size is ~19 KB.
@chfast chfast force-pushed the kzg/precompute-lines branch from 487a42c to cffbd87 Compare May 25, 2026 13:33
@chfast

chfast commented May 25, 2026

Copy link
Copy Markdown
Member Author
                                                           │ /proc/self/fd/11 │          /proc/self/fd/16          │
                                                           │      gas/s       │    gas/s     vs base               │
precompile<PrecompileId::point_evaluation,_evmone_blst>-14        50.75M ± 0%   54.25M ± 1%  +6.89% (p=0.000 n=11)

@chfast chfast merged commit 6539fcf into master May 25, 2026
23 checks passed
@chfast chfast deleted the kzg/precompute-lines branch May 25, 2026 13:57
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.

2 participants