Specification
Motivation
Precompiled modexp
- The precompiled modexp is enabled: modexp
- some fixes regarding the previous version have been added
- after a few discussions, it is decided to set the maximum input length of the base, modulus and exponent to 32 chunks of 256 bits. See link for more details
- if input length > %MAX_SIZE_MODEXP --> zkEVM does a revert returning all the gas consumed
RIP7212: p256verify
A precompiled contract that perfoms signature verifications in the secp256r1
elliptic curve have been added: rip7212
Tags
- zkevm-rom:
v9.0.0-rc.2-fork.13
- zkevm-testvectors:
v9.0.0-rc.3-fork.13
- zkevm-commonjs:
v9.0.0-rc.3-fork.13
- zkevm-proverjs:
git diff
- zkevm-rom: PR develop-durian
- zkevm-testvectors: PR develop-durian
- zkevm-commonjs: PR develop-durian
- zkevm-proverjs:
Code changes
zkevm-rom
- Update constant
forkId
:CONST %FORK_ID = 13
Modexp
- Update selector precompiled:
A - 6 :JMPN(funcModexp)
- Update pre-modexp with fixes: pre-modexp changes + fix
- Modexp Update: PR modexp durian
p256verify
- Add new address precompiled:
process-tx.zkasm
:; Check zero address since zero address is not a precompiled contract 0 => B $ :EQ, JMPC(callContract) 0x100 => B $ :EQ, JMPC(selectorPrecompiledP256Verify) 10 => B $ :LT,JMPC(selectorPrecompiled, callContract) $ :LT, JMPC(selectorPrecompiled, callContract)
precompiled/selector.zkasm
:selectorPrecompiledP256Verify: :JMP(funcP256VERIFY)
- Add pre-p256verify:
constants.zkasm
:CONST %P256VERIFY_GAS = 3450 ; p256verify gas price
precompiled/pre-p256verify.zkasm
: file- Update
isColdAddress
(touched.zkasm
):; if address is a precompiled considered as warm address 10 => B $ :LT, JMPC(finishColdPrecompiled) 0x100 => B $ :EQ, JMPC(finishColdPrecompiled)
- Update counters: commit counters
- Add
p256verify
: PR p256verify
zkevm-proverjs
zkevm-testvectors
- Update tests forkId = 13
- Update pre-revert tests (delete modexp)
- Add tests modexp
- Add tests p256verify
- Update tests with 0x100 address in
pre-state
(ethereum-tests) - Update virtual counters