From 8163c8aa2e53e252ce9b3a599f18f4fc4141d116 Mon Sep 17 00:00:00 2001 From: Zhang Zhuo Date: Wed, 23 Aug 2023 15:39:57 +0800 Subject: [PATCH] remove outdated sub circuits --- prover/src/zkevm/circuit/evm_circuit.rs | 28 ---------- prover/src/zkevm/circuit/poseidon_circuit.rs | 29 ---------- prover/src/zkevm/circuit/state_circuit.rs | 36 ------------- prover/src/zkevm/circuit/zktrie_circuit.rs | 57 -------------------- 4 files changed, 150 deletions(-) delete mode 100644 prover/src/zkevm/circuit/evm_circuit.rs delete mode 100644 prover/src/zkevm/circuit/poseidon_circuit.rs delete mode 100644 prover/src/zkevm/circuit/state_circuit.rs delete mode 100644 prover/src/zkevm/circuit/zktrie_circuit.rs diff --git a/prover/src/zkevm/circuit/evm_circuit.rs b/prover/src/zkevm/circuit/evm_circuit.rs deleted file mode 100644 index 8b20ffb75..000000000 --- a/prover/src/zkevm/circuit/evm_circuit.rs +++ /dev/null @@ -1,28 +0,0 @@ - -use super::{TargetCircuit, DEGREE}; - -use anyhow::bail; -use halo2_proofs::halo2curves::bn256::Fr; -use zkevm_circuits::witness; -use zkevm_circuits::util::SubCircuit; - -pub struct EvmCircuit {} - -impl TargetCircuit for EvmCircuit { - type Inner = EvmCircuitImpl; - - fn name() -> String { - "evm".to_string() - } - - fn from_witness_block( - witness_block: &witness::Block, - ) -> anyhow::Result<(Self::Inner, Vec>)> - where - Self: Sized, - { - let inner = EvmCircuitImpl::::new(witness_block.clone()); - let instance = vec![]; - Ok((inner, instance)) - } -} \ No newline at end of file diff --git a/prover/src/zkevm/circuit/poseidon_circuit.rs b/prover/src/zkevm/circuit/poseidon_circuit.rs deleted file mode 100644 index 8a0506fa7..000000000 --- a/prover/src/zkevm/circuit/poseidon_circuit.rs +++ /dev/null @@ -1,29 +0,0 @@ - - -use super::{TargetCircuit, DEGREE}; - -use anyhow::bail; -use halo2_proofs::halo2curves::bn256::Fr; -use zkevm_circuits::witness; -use zkevm_circuits::util::SubCircuit; - -pub struct PoseidonCircuit {} - -impl TargetCircuit for PoseidonCircuit { - type Inner = PoseidonCircuitImpl; - - fn name() -> String { - "poseidon".to_string() - } - - fn from_witness_block( - witness_block: &witness::Block, - ) -> anyhow::Result<(Self::Inner, Vec>)> - where - Self: Sized, - { - let inner = PoseidonCircuitImpl::new_from_block(witness_block); - let instance = vec![]; - Ok((inner, instance)) - } -} \ No newline at end of file diff --git a/prover/src/zkevm/circuit/state_circuit.rs b/prover/src/zkevm/circuit/state_circuit.rs deleted file mode 100644 index 1c233bef8..000000000 --- a/prover/src/zkevm/circuit/state_circuit.rs +++ /dev/null @@ -1,36 +0,0 @@ - -use super::{TargetCircuit, DEGREE}; - -use anyhow::bail; -use halo2_proofs::halo2curves::bn256::Fr; -use zkevm_circuits::witness; -use zkevm_circuits::util::SubCircuit; - -pub struct StateCircuit {} -impl TargetCircuit for StateCircuit { - type Inner = StateCircuitImpl; - - fn name() -> String { - "state".to_string() - } - - // TODO: use from_block_trace(&Default::default()) ? - fn dummy_inner_circuit() -> Self::Inner { - StateCircuitImpl::::default() - } - - fn from_witness_block( - witness_block: &witness::Block, - ) -> anyhow::Result<(Self::Inner, Vec>)> - where - Self: Sized, - { - let inner = StateCircuitImpl::::new( - witness_block.rws.clone(), - // TODO: put it into CircuitParams? - (1 << *DEGREE) - 64, - ); - let instance = vec![]; - Ok((inner, instance)) - } -} diff --git a/prover/src/zkevm/circuit/zktrie_circuit.rs b/prover/src/zkevm/circuit/zktrie_circuit.rs deleted file mode 100644 index a0841c75f..000000000 --- a/prover/src/zkevm/circuit/zktrie_circuit.rs +++ /dev/null @@ -1,57 +0,0 @@ - -use super::{TargetCircuit, DEGREE}; - -use anyhow::bail; -use halo2_proofs::halo2curves::bn256::Fr; -use zkevm_circuits::witness; -use zkevm_circuits::util::SubCircuit; - -pub struct ZktrieCircuit {} - -impl TargetCircuit for ZktrieCircuit { - type Inner = ZktrieCircuitImpl; - - fn name() -> String { - "zktrie".to_string() - } - - fn from_witness_block( - witness_block: &witness::Block, - ) -> anyhow::Result<(Self::Inner, Vec>)> - where - Self: Sized, - { - let inner = ZktrieCircuitImpl::new_from_block(witness_block); - let instance = vec![]; - Ok((inner, instance)) - } -} - -/* -fn trie_data_from_blocks<'d>( - block_traces: impl IntoIterator, -) -> EthTrie { - let mut trie_data: EthTrie = Default::default(); - let mut total_tx_num = 0usize; - for (idx, block_trace) in block_traces.into_iter().enumerate() { - let storage_ops: Vec> = block_trace - .mpt_witness - .iter() - .map(|tr| tr.try_into().unwrap()) - .collect(); - trie_data.add_ops(storage_ops); - total_tx_num += block_trace.execution_results.len(); - log::debug!( - "after {}th block(tx num: {}), total tx num: {}, zktrie row num: {:?}", - idx, - block_trace.transactions.len(), - total_tx_num, - trie_data.use_rows() - ); - } - - trie_data -} -*/ - -