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

BLS multiplication precompiles interoperability #1042

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chfast
Copy link
Member

@chfast chfast commented Oct 4, 2024

Show that MSM precompile works as simple MUL and also that MSM with single input can fallback to simpler MUL API.

Show that MSM precompile works as simple MUL and also that MSM with
single input can fallback to simpler MUL API.
@chfast chfast added the precompiles Related to EVM precompiles label Oct 4, 2024
@chfast chfast requested a review from rodiazet October 4, 2024 09:46
Copy link

codecov bot commented Oct 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.21%. Comparing base (8e4a055) to head (066ceff).
Report is 8 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1042   +/-   ##
=======================================
  Coverage   94.21%   94.21%           
=======================================
  Files         153      153           
  Lines       15934    15940    +6     
=======================================
+ Hits        15012    15018    +6     
  Misses        922      922           
Flag Coverage Δ
eof_execution_spec_tests 17.53% <0.00%> (-0.01%) ⬇️
ethereum_tests 27.33% <0.00%> (-0.02%) ⬇️
ethereum_tests_silkpre 19.14% <0.00%> (-0.01%) ⬇️
execution_spec_tests 20.48% <100.00%> (+0.03%) ⬆️
unittests 88.97% <0.00%> (-0.04%) ⬇️

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

Files with missing lines Coverage Δ
test/state/precompiles.cpp 98.95% <100.00%> (+0.02%) ⬆️

chfast added a commit to ipsilon/EIPs that referenced this pull request Oct 9, 2024
This removes `BLS12_G1MUL` and `BLS12_G2MUL` precompiles because
they are trivially replaceable by corresponding MSM precompiles.

This reduces the number of precompile's addresses defined in this EIP
from 9 to 7. The addresses of remaining 7 precompiles are changed
to be continues.

The Rationale entry describes why this change make sense.
Additionally, the cost of MSM for single input (`k==1`) has been
corrected to match the original MUL cost. The specification now
suggests how this case should be implemented.
Morever, because of the ABI compatibility between MUL and MSM
all existing tests for MULs can be easily converted to tests for MSMs.

The PoC of MUL and MSM precompiles equivalence is provided in
[evmone PR#1042](ethereum/evmone#1042).
chfast added a commit to ipsilon/EIPs that referenced this pull request Oct 9, 2024
This removes `BLS12_G1MUL` and `BLS12_G2MUL` precompiles because
they are trivially replaceable by corresponding MSM precompiles.

This reduces the number of precompile's addresses defined in this EIP
from 9 to 7. The addresses of remaining 7 precompiles are changed
to be continues.

The Rationale entry describes why this change make sense.
Additionally, the cost of MSM for single input (`k==1`) has been
corrected to match the original MUL cost. The specification now
suggests how this case should be implemented.
Morever, because of the ABI compatibility between MUL and MSM
all existing tests for MULs can be easily converted to tests for MSMs.

The PoC of MUL and MSM precompiles equivalence is provided in
[evmone PR#1042](ethereum/evmone#1042).
chfast added a commit to ipsilon/EIPs that referenced this pull request Dec 18, 2024
This removes `BLS12_G1MUL` and `BLS12_G2MUL` precompiles because
they are trivially replaceable by corresponding MSM precompiles.

This reduces the number of precompile's addresses defined in this EIP
from 9 to 7. The addresses of remaining 7 precompiles are changed
to be continues.

The Rationale entry describes why this change make sense.
Additionally, the cost of MSM for single input (`k==1`) has been
corrected to match the original MUL cost. The specification now
suggests how this case should be implemented.
Moreover, because of the ABI compatibility between MUL and MSM
all existing tests for MULs can be easily converted to tests for MSMs.

The PoC of MUL and MSM precompiles equivalence is provided in
[evmone PR#1042](ethereum/evmone#1042).
chfast added a commit to ipsilon/EIPs that referenced this pull request Dec 19, 2024
This removes `BLS12_G1MUL` and `BLS12_G2MUL` precompiles because
they are trivially replaceable by corresponding MSM precompiles.

This reduces the number of precompile's addresses defined in this EIP
from 9 to 7. The addresses of remaining 7 precompiles are changed
to be continues.

The Rationale entry describes why this change make sense.
Additionally, the cost of MSM for single input (`k==1`) has been
corrected to match the original MUL cost. The specification now
suggests how this case should be implemented.
Moreover, because of the ABI compatibility between MUL and MSM
all existing tests for MULs can be easily converted to tests for MSMs.

The PoC of MUL and MSM precompiles equivalence is provided in
[evmone PR#1042](ethereum/evmone#1042).
chfast added a commit to ipsilon/EIPs that referenced this pull request Dec 19, 2024
This removes `BLS12_G1MUL` and `BLS12_G2MUL` precompiles because
they are trivially replaceable by corresponding MSM precompiles.

This reduces the number of precompile's addresses defined in this EIP
from 9 to 7. The addresses of remaining 7 precompiles are changed
to be continues.

The Rationale entry describes why this change make sense.
Additionally, the cost of MSM for single input (`k==1`) has been
corrected to match the original MUL cost. The specification now
suggests how this case should be implemented.
Moreover, because of the ABI compatibility between MUL and MSM
all existing tests for MULs can be easily converted to tests for MSMs.

The PoC of MUL and MSM precompiles equivalence is provided in
[evmone PR#1042](ethereum/evmone#1042).
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.

1 participant