zkevm-circuits
zkevm-circuits copied to clipboard
Circuit for opcode `BALANCE`
Spec: https://github.com/privacy-scaling-explorations/zkevm-specs/pull/248
Summary
- Update
BALANCEbus-mapping and add circuit. - Fix to lookup
Balanceif account exists, otherwise lookupNonExisting. - Add a
HashSetto save non-existent account addresses in both bus-mapping and circuitExeSteps.
~~Not confirm if necessary to constrain "If the given account doesn't exist, then it will push 0 onto the stack instead." in the circuit. And is there a method (could be used in circuit) to lookup if account is existing? Thanks.~~
~~Blocked by PR https://github.com/privacy-scaling-explorations/zkevm-circuits/pull/907~~
Blocked by https://github.com/privacy-scaling-explorations/zkevm-specs/pull/248 which is at the same time blocked by https://github.com/privacy-scaling-explorations/zkevm-specs/issues/249
Will try to update this PR since https://github.com/privacy-scaling-explorations/zkevm-circuits/pull/907 has been merged.
Hi @CPerezz , I updated this BALANCE circuit with non-existing proofs. Could you help review again when you have time? Thanks.
LGTM! I'd want another review from someone at Scroll before merging this! @icemelon or @silathdiir could you ping someone? 😄
Yes. I will ping others to help review. Thanks a lot.
need to modify https://github.com/privacy-scaling-explorations/zkevm-circuits/blob/3da1888cfdea1f05062477279d9c5088e01fac19/zkevm-circuits/src/witness/step.rs#L184
need to modify
https://github.com/privacy-scaling-explorations/zkevm-circuits/blob/3da1888cfdea1f05062477279d9c5088e01fac19/zkevm-circuits/src/witness/step.rs#L184
Sorry for the wrong revert. Fixed to OpcodeId::BALANCE => ExecutionState::BALANCE and moved to next one of ADDRESS.