From 1598d6ce9eec99e34de621aa97bbc5c840eba830 Mon Sep 17 00:00:00 2001 From: "sm.wu" Date: Thu, 6 Apr 2023 20:13:44 +0800 Subject: [PATCH] super circuit keccak dev_load --- zkevm-circuits/src/pi_circuit.rs | 9 +++++++-- zkevm-circuits/src/super_circuit.rs | 12 +++++++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/zkevm-circuits/src/pi_circuit.rs b/zkevm-circuits/src/pi_circuit.rs index 41a8e971f2e..bbca564c28e 100644 --- a/zkevm-circuits/src/pi_circuit.rs +++ b/zkevm-circuits/src/pi_circuit.rs @@ -187,7 +187,8 @@ impl PublicData { .collect_vec() } - fn get_pi_bytes(&self, max_txs: usize, max_calldata: usize) -> Vec { + /// get the serialized public data bytes + pub fn get_pi_bytes(&self, max_txs: usize, max_calldata: usize) -> Vec { // Assign block table let block_values = self.get_block_table_values(); let result = iter::empty() @@ -2260,6 +2261,8 @@ mod pi_circuit_test { #[test] fn test_1tx_1maxtx() { + const MAX_TXS: usize = 1; + const MAX_CALLDATA: usize = 32; let mut rng = ChaChaRng::seed_from_u64(2); let wallet_a = LocalWallet::new(&mut rng).with_chain_id(MOCK_CHAIN_ID.as_u64()); @@ -2296,6 +2299,8 @@ mod pi_circuit_test { let mut builder = BlockData::new_from_geth_data_with_params( block.clone(), CircuitsParams { + max_txs: MAX_TXS, + max_calldata: MAX_CALLDATA, max_rws: 1 << (degree - 1), ..Default::default() }, @@ -2311,7 +2316,7 @@ mod pi_circuit_test { builder.block.eth_block = block.eth_block.clone(); let block = block_convert(&builder.block, &builder.code_db).unwrap(); // MAX_TXS, MAX_TXS align with `CircuitsParams` - let circuit = PiTestCircuit::::new_from_block(&block); + let circuit = PiTestCircuit::::new_from_block(&block); let public_inputs = circuit.0.instance(); let prover = match MockProver::run(degree, &circuit, public_inputs) { diff --git a/zkevm-circuits/src/super_circuit.rs b/zkevm-circuits/src/super_circuit.rs index 7114447b27f..a893c2adc9e 100644 --- a/zkevm-circuits/src/super_circuit.rs +++ b/zkevm-circuits/src/super_circuit.rs @@ -84,6 +84,7 @@ use std::array; pub struct SuperCircuitConfig { block_table: BlockTable, mpt_table: MptTable, + keccak_table: KeccakTable, evm_circuit: EvmCircuitConfig, state_circuit: StateCircuitConfig, tx_circuit: TxCircuitConfig, @@ -202,7 +203,7 @@ impl SubCircuitConfig for SuperCircuitConfig { bytecode_table, block_table: block_table.clone(), copy_table, - keccak_table, + keccak_table: keccak_table.clone(), exp_table, }, ); @@ -210,6 +211,7 @@ impl SubCircuitConfig for SuperCircuitConfig { Self { block_table, mpt_table, + keccak_table, evm_circuit, state_circuit, copy_circuit, @@ -399,6 +401,14 @@ impl