Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SuperCircuit (privacy-scaling-explorations#622)
* WIP * Join EVM + TxCircuit * WIP clean * WIP add bytecode circuit * Fix tx_circuit compat with EVM * Add bytecode circuit to super circuit * WIP * Fix bytecode assignment * Harmonize tables * Reuse keccak table between TxCircuit and BytecodeCircuit * WIP * WIP * WIP * Do some clean ups * WIP * Move cross-circuit table stuff to src/table.rs * cargo fmt * Document pub stuff * Fix merge * Pass clippy * WIP * Abstract CopyTable from CopyCircuit * Mark super circuit test as serial * Introduce Super Circuit and adapt existing circuits for it The SuperCircuit is a new circuit that will contain all the circuits of the zkEVM in order to achieve two things: - Check the correct integration between circuits via the shared lookup tables - Allow having a single circuit setup for which a proof can be generated that would be verified under a single aggregation circuit for the first milestone Summary of changes: - general: - Addapt the circuits so that the shared tables can be assigned outside of the circuit's assign functions. - evm_circuit.rs - load table functions moved to `table.rs` - bytecode_circuit/bytecode_unroller.rs - Rename `hash_length` to `code_length` in `Config` - Rename `r` to `randomness` - Add `is_enabled` expression to the keccak lookup - Move `load_keccaks` to `table.rs` - Fix endianness in keccak hash output - Add function to obtain all the keccak inputs required by the `SignVerifyChip` - table.rs - Move table definitions from `evm_circuit/table.rs` and `rw_table.rs` to here - Move all shared table load functions to here - Add BytecodeTable to help reusing the table config with other - Rename `hash` to `code_hash` in `BytecodeTable` - Use `RLC(reversed(input))` in keccak table assignment for `input_rlc`. - tx_circuit.rs - Add function to obtain all the keccak inputs required by the `TxCircuit` - Fix `Gas` encoding: remove RLC - Add missing field `TxFieldTag::CallDataGasCost` - tx_circuit/sign_verify.rs - Move `load_keccak` to `table.rs` - Add function to obtain all the keccak inputs required by the `SignVerifyChip` - Reverse the `pk_hash` used in the lookup so that the RLC is calculated as if it was a hash in an Ethereum Word. * Reset our halo2 fork * Address comments from @han0110 and @lispc
- Loading branch information