zkevm-circuits
zkevm-circuits copied to clipboard
proposal: using Block<Fr> returned by witness::block_convert as the only single source of witness
currently different circuits needs witness from different sources/structs. Eg: https://github.com/privacy-scaling-explorations/zkevm-chain/blob/68982510b93fd34e06f5d2f444a3807b90668b40/prover/src/compute_proof.rs#L122
witness::Block and geth_types::{Transaction, Block} are all needed. I think we'd better unify all the procedure, so we post-process geth trace uniformly, and all the information needed is in Block<Fr>, and all circuits assign witness from Block<Fr> to avoid pass a long tuple like (block, txs, gas_used, keccak_inputs) all the way.
The only con is some circuits only need simple data so the full post processing of bus-mapping -> witness::convert can be avoided for performance, such as keccak circuit. But both bus-mapping::build_block and witness::convert are fast compared to proving, so i think it is ok.