Update EIP-2537: Remove MUL precompiles
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.
The adjustment of the MSM implementation for single input in evmone PR#1046.
✅ All reviewers have approved.
I think we have historically preferred to not overload precompiles like this, but I'd love to hear what others think
not sure as well, it's kind of matter of taste here. At this point we could even remove BLS12_G1ADD and BLS12_G2ADD because they are trivially replaceable by corresponding MSM precompiles......
not sure as well, it's kind of matter of taste here. At this point we could even remove
BLS12_G1ADDandBLS12_G2ADDbecause they are trivially replaceable by corresponding MSM precompiles......
The ADD situation is different because: semantic (no subgroup check), ABI (no scalar input), and gas costs differ.
We could actually extend ADD to MULTI_ADD in the future upgrade in (almost) backward compatible manner.
I'd like to rebase this on the merged gas cost changes and proof read it.
I'd like to rebase this on the merged gas cost changes and proof read it.
ah ok, sounds good
it looks like EIP bot is not responding anyway so I think you can do this in this PR