-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Update EIP-2537: Remove MUL precompiles #8945
base: master
Are you sure you want to change the base?
Conversation
File
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment, some line got deleted which likely should not be deleted
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).
bfa6096
to
40cc72d
Compare
I think we have historically preferred to not overload precompiles like this, but I'd love to hear what others think |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| BLS12_G2MSM | 0x0e | precompile address | | ||
| BLS12_PAIRING_CHECK | 0x0f | precompile address | | ||
| BLS12_MAP_FP_TO_G1 | 0x10 | precompile address | | ||
| BLS12_MAP_FP2_TO_G2 | 0x11 | precompile address | | ||
|
||
If `block.timestamp >= FORK_TIMESTAMP` we introduce *nine* separate precompiles to perform the following operations: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If `block.timestamp >= FORK_TIMESTAMP` we introduce *nine* separate precompiles to perform the following operations: | |
If `block.timestamp >= FORK_TIMESTAMP` we introduce *seven* separate precompiles to perform the following operations: |
not sure as well, it's kind of matter of taste here. At this point we could even remove |
This removes
BLS12_G1MUL
andBLS12_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.
The adjustment of the MSM implementation for single input in evmone PR#1046.