execution-spec-tests
execution-spec-tests copied to clipboard
zkevm: add remaining precompiles
This PR adds coverage for all remaining precompiles:
- bn128_add
- bn128_mul
- bn128_pairing
- blake2f
- point_evaluation
- All seven new BLS precompiles activated in Pectra.
I created a generic setup, so adding other precompile cases (if anyone thinks other inputs create even worse-case scenarios) is very simple.
I ran this in the SP1 for counting cycles:
- bls12_fp_to_g1 -> 2.3 billion cycles
- bls12_fp_to_g2 -> 2.4 billion cycles
- bls12_g1add -> 2.4 billion cycles
- bls12_g1msm -> Crash
- bls12_g2add -> 2.5 billion cycles
- bls12_g2msm -> Crash
- bls12_pairing -> 2.4 billion cycles
- bn128_add -> 18.5 billion cycles
- bn128_mul -> 28.5 billion cycles
- bn128_pairing -> 18.6 billion cycles
- point_evaluation -> 6.8 billion cycles
- blake2f -> 21 billion cycles
@chfast, I applied your suggestions if you'd like to take another look. Cycles remained the same for everything, but now both MSM make the SP1 RISCV emulator crash :)