8000 precompiles: Use classic EC point add formula by chfast · Pull Request #1165 · ethereum/evmone · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

precompiles: Use classic EC point add formula #1165

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
merged 1 commit into from
Mar 14, 2025
Merged

Conversation

chfast
Copy link
Member
@chfast chfast commented Mar 13, 2025

This makes the BN254 ecadd precompile 30% faster.

@chfast chfast requested a review from rodiazet March 13, 2025 08:45
@chfast chfast added the precompiles Related to EVM precompiles label Mar 13, 2025
@chfast chfast force-pushed the precompiles/ecadd branch from 8277d57 to c1912b0 Compare March 13, 2025 08:46
Copy link
codecov bot commented Mar 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.48%. Comparing base (3e96b52) to head (3abbcc7).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1165   +/-   ##
=======================================
  Coverage   94.48%   94.48%           
=======================================
  Files         169      169           
  Lines       18004    18020   +16     
=======================================
+ Hits        17011    17027   +16     
  Misses        993      993           
Flag Coverage Δ
eof_execution_spec_tests 20.88% <21.73%> (-0.01%) ⬇️
ethereum_tests 27.09% <100.00%> (+0.06%) ⬆️
ethereum_tests_silkpre 19.55% <100.00%> (+0.08%) ⬆️
execution_spec_tests 21.24% <21.73%> (-0.01%) ⬇️
unittests 91.66% <100.00%> (+<0.01%) ⬆️

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

Files with missing lines Coverage Δ
lib/evmone_precompiles/bn254.cpp 100.00% <100.00%> (ø)
lib/evmone_precompiles/ecc.hpp 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 requested review from gumb0 and pdobacz March 14, 2025 10:07
Copy link
Contributor
@rodiazet rodiazet left a comment

Choose a reason for hiding this comment

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

Looks good. I left one comment?

Comment on lines 131 to 133
template <typename IntT, int A = 0>
ProjPoint<IntT> add(const evmmax::ModArith<IntT>& s, const ProjPoint<IntT>& p,
const ProjPoint<IntT>& q, const IntT& b3) noexcept
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not drop it if we have general formula?

Copy link
Member Author

Choose a reason for hiding this comment

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

Still needed for multiplication where projective coordinates are used.

@chfast chfast force-pushed the precompiles/ecadd branch from c1912b0 to 3abbcc7 Compare March 14, 2025 14:08
@chfast chfast enabled auto-merge (squash) March 14, 2025 14:09
@chfast chfast merged commit 07f1fd7 into master Mar 14, 2025
23 checks passed
@chfast chfast deleted the precompiles/ecadd branch March 14, 2025 14:29
gumb0 pushed a commit that referenced this pull request Mar 20, 2025
This makes the BN254 `ecadd` precompile 30% faster.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
precompiles Related to EVM precompiles
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0