From b55fa7ddd74a70efd2dc3ea5d260e775188118b3 Mon Sep 17 00:00:00 2001 From: Zhang Zhuo Date: Wed, 26 Apr 2023 15:46:00 +0800 Subject: [PATCH] fix ConstrainBuilderCommon --- circuit-benchmarks/src/tx_circuit.rs | 2 +- rust-toolchain | 2 +- .../src/bytecode_circuit/circuit/to_poseidon_hash.rs | 6 +++++- zkevm-circuits/src/evm_circuit/execution/create.rs | 4 ++-- .../src/evm_circuit/execution/end_inner_block.rs | 6 ++++-- .../src/evm_circuit/execution/error_code_store.rs | 4 ++-- .../execution/error_invalid_creation_code.rs | 4 ++-- .../evm_circuit/execution/error_oog_account_access.rs | 9 ++++++--- .../src/evm_circuit/execution/error_oog_create2.rs | 4 ++-- .../evm_circuit/execution/error_oog_dynamic_memory.rs | 4 ++-- .../evm_circuit/execution/error_oog_memory_copy.rs | 4 ++-- .../src/evm_circuit/execution/error_oog_sha3.rs | 4 ++-- .../evm_circuit/execution/error_oog_static_memory.rs | 2 +- .../evm_circuit/execution/error_precompile_failed.rs | 4 ++-- .../evm_circuit/execution/error_write_protection.rs | 2 +- zkevm-circuits/src/evm_circuit/execution/jumpi.rs | 2 +- zkevm-circuits/src/evm_circuit/util/common_gadget.rs | 6 +++--- .../src/evm_circuit/util/constraint_builder.rs | 2 +- .../src/evm_circuit/util/math_gadget/rlp.rs | 11 +++++++---- zkevm-circuits/src/evm_circuit/util/memory_gadget.rs | 8 ++++---- zkevm-circuits/src/pi_circuit.rs | 5 ++++- zkevm-circuits/src/rlp_circuit.rs | 6 +++++- zkevm-circuits/src/tx_circuit.rs | 2 +- 23 files changed, 61 insertions(+), 42 deletions(-) diff --git a/circuit-benchmarks/src/tx_circuit.rs b/circuit-benchmarks/src/tx_circuit.rs index e53cf04acc..53a21d2bb0 100644 --- a/circuit-benchmarks/src/tx_circuit.rs +++ b/circuit-benchmarks/src/tx_circuit.rs @@ -107,7 +107,7 @@ mod tests { // Bench setup generation let setup_message = format!("{} {} with degree = {}", BENCHMARK_ID, setup_prfx, degree); let start1 = start_timer!(|| setup_message); - let general_params = ParamsKZG::::setup(degree, &mut rng); + let general_params = ParamsKZG::::setup(degree as u32, &mut rng); let verifier_params: ParamsVerifierKZG = general_params.verifier_params().clone(); end_timer!(start1); diff --git a/rust-toolchain b/rust-toolchain index b6ce6a50ba..44b874bfca 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2023-04-24 +nightly-2022-12-10 diff --git a/zkevm-circuits/src/bytecode_circuit/circuit/to_poseidon_hash.rs b/zkevm-circuits/src/bytecode_circuit/circuit/to_poseidon_hash.rs index 5a6d056c50..d2825cd2bc 100644 --- a/zkevm-circuits/src/bytecode_circuit/circuit/to_poseidon_hash.rs +++ b/zkevm-circuits/src/bytecode_circuit/circuit/to_poseidon_hash.rs @@ -1,5 +1,9 @@ use crate::{ - evm_circuit::util::{and, constraint_builder::BaseConstraintBuilder, not, or, select}, + evm_circuit::util::{ + and, + constraint_builder::{BaseConstraintBuilder, ConstrainBuilderCommon}, + not, or, select, + }, table::{BytecodeFieldTag, KeccakTable, PoseidonTable}, util::{Challenges, Expr, SubCircuitConfig}, }; diff --git a/zkevm-circuits/src/evm_circuit/execution/create.rs b/zkevm-circuits/src/evm_circuit/execution/create.rs index 7bd8c81933..2f58ded24e 100644 --- a/zkevm-circuits/src/evm_circuit/execution/create.rs +++ b/zkevm-circuits/src/evm_circuit/execution/create.rs @@ -9,7 +9,7 @@ use crate::{ util::{ common_gadget::TransferGadget, constraint_builder::{ - ConstraintBuilder, ReversionInfo, StepStateTransition, + ConstrainBuilderCommon, EVMConstraintBuilder, ReversionInfo, StepStateTransition, Transition::{Delta, To}, }, math_gadget::{ @@ -70,7 +70,7 @@ impl ExecutionGadget< const EXECUTION_STATE: ExecutionState = S; - fn configure(cb: &mut ConstraintBuilder) -> Self { + fn configure(cb: &mut EVMConstraintBuilder) -> Self { // Use rw_counter of the step which triggers next call as its call_id. let callee_call_id = cb.curr.state.rw_counter.clone(); let code_hash_previous = cb.query_cell(); diff --git a/zkevm-circuits/src/evm_circuit/execution/end_inner_block.rs b/zkevm-circuits/src/evm_circuit/execution/end_inner_block.rs index 453a1bbe4f..89fdc4c3b8 100644 --- a/zkevm-circuits/src/evm_circuit/execution/end_inner_block.rs +++ b/zkevm-circuits/src/evm_circuit/execution/end_inner_block.rs @@ -3,7 +3,9 @@ use crate::{ execution::ExecutionGadget, step::ExecutionState, util::{ - constraint_builder::ConstraintBuilder, math_gadget::IsZeroGadget, CachedRegion, Cell, + constraint_builder::{ConstrainBuilderCommon, EVMConstraintBuilder}, + math_gadget::IsZeroGadget, + CachedRegion, Cell, }, witness::{Block, Call, ExecStep, Transaction}, }, @@ -36,7 +38,7 @@ impl ExecutionGadget for EndInnerBlockGadget { const EXECUTION_STATE: ExecutionState = ExecutionState::EndInnerBlock; - fn configure(cb: &mut ConstraintBuilder) -> Self { + fn configure(cb: &mut EVMConstraintBuilder) -> Self { // The number of txs in the inner block is also the ID of the last tx in the // block. let last_tx_id = cb.query_cell(); diff --git a/zkevm-circuits/src/evm_circuit/execution/error_code_store.rs b/zkevm-circuits/src/evm_circuit/execution/error_code_store.rs index ae1a128ec0..9d130ba8ad 100644 --- a/zkevm-circuits/src/evm_circuit/execution/error_code_store.rs +++ b/zkevm-circuits/src/evm_circuit/execution/error_code_store.rs @@ -5,7 +5,7 @@ use crate::{ step::ExecutionState, util::{ common_gadget::CommonErrorGadget, - constraint_builder::ConstraintBuilder, + constraint_builder::{ConstrainBuilderCommon, EVMConstraintBuilder}, math_gadget::LtGadget, memory_gadget::{CommonMemoryAddressGadget, MemoryAddressGadget}, CachedRegion, Cell, @@ -38,7 +38,7 @@ impl ExecutionGadget for ErrorCodeStoreGadget { const EXECUTION_STATE: ExecutionState = ExecutionState::ErrorCodeStore; - fn configure(cb: &mut ConstraintBuilder) -> Self { + fn configure(cb: &mut EVMConstraintBuilder) -> Self { let opcode = cb.query_cell(); let offset = cb.query_cell_phase2(); diff --git a/zkevm-circuits/src/evm_circuit/execution/error_invalid_creation_code.rs b/zkevm-circuits/src/evm_circuit/execution/error_invalid_creation_code.rs index d824f2682b..aa10bf7f34 100644 --- a/zkevm-circuits/src/evm_circuit/execution/error_invalid_creation_code.rs +++ b/zkevm-circuits/src/evm_circuit/execution/error_invalid_creation_code.rs @@ -4,7 +4,7 @@ use crate::{ step::ExecutionState, util::{ common_gadget::CommonErrorGadget, - constraint_builder::ConstraintBuilder, + constraint_builder::EVMConstraintBuilder, math_gadget::IsEqualGadget, memory_gadget::{CommonMemoryAddressGadget, MemoryAddressGadget}, CachedRegion, Cell, @@ -32,7 +32,7 @@ impl ExecutionGadget for ErrorInvalidCreationCodeGadget { const EXECUTION_STATE: ExecutionState = ExecutionState::ErrorInvalidCreationCode; - fn configure(cb: &mut ConstraintBuilder) -> Self { + fn configure(cb: &mut EVMConstraintBuilder) -> Self { let opcode = cb.query_cell(); let first_byte = cb.query_cell(); diff --git a/zkevm-circuits/src/evm_circuit/execution/error_oog_account_access.rs b/zkevm-circuits/src/evm_circuit/execution/error_oog_account_access.rs index 5fff18a561..0671ee6bd5 100644 --- a/zkevm-circuits/src/evm_circuit/execution/error_oog_account_access.rs +++ b/zkevm-circuits/src/evm_circuit/execution/error_oog_account_access.rs @@ -4,8 +4,11 @@ use crate::{ param::{N_BYTES_ACCOUNT_ADDRESS, N_BYTES_GAS}, step::ExecutionState, util::{ - common_gadget::CommonErrorGadget, constraint_builder::ConstraintBuilder, from_bytes, - math_gadget::LtGadget, select, CachedRegion, Cell, Word, + common_gadget::CommonErrorGadget, + constraint_builder::{ConstrainBuilderCommon, EVMConstraintBuilder}, + from_bytes, + math_gadget::LtGadget, + select, CachedRegion, Cell, Word, }, witness::{Block, Call, ExecStep, Transaction}, }, @@ -35,7 +38,7 @@ impl ExecutionGadget for ErrorOOGAccountAccessGadget { const EXECUTION_STATE: ExecutionState = ExecutionState::ErrorOutOfGasAccountAccess; - fn configure(cb: &mut ConstraintBuilder) -> Self { + fn configure(cb: &mut EVMConstraintBuilder) -> Self { let opcode = cb.query_cell(); cb.require_in_set( "ErrorOutOfGasAccountAccess happens for BALANCE | EXTCODESIZE | EXTCODEHASH ", diff --git a/zkevm-circuits/src/evm_circuit/execution/error_oog_create2.rs b/zkevm-circuits/src/evm_circuit/execution/error_oog_create2.rs index b8c7d4e99d..fca4746cf7 100644 --- a/zkevm-circuits/src/evm_circuit/execution/error_oog_create2.rs +++ b/zkevm-circuits/src/evm_circuit/execution/error_oog_create2.rs @@ -5,7 +5,7 @@ use crate::{ step::ExecutionState, util::{ common_gadget::CommonErrorGadget, - constraint_builder::ConstraintBuilder, + constraint_builder::{ConstrainBuilderCommon, EVMConstraintBuilder}, math_gadget::LtGadget, memory_gadget::{ CommonMemoryAddressGadget, MemoryExpandedAddressGadget, MemoryExpansionGadget, @@ -37,7 +37,7 @@ impl ExecutionGadget for ErrorOOGCreate2Gadget { const EXECUTION_STATE: ExecutionState = ExecutionState::ErrorOutOfGasCREATE2; - fn configure(cb: &mut ConstraintBuilder) -> Self { + fn configure(cb: &mut EVMConstraintBuilder) -> Self { let opcode = cb.query_cell(); cb.require_equal( diff --git a/zkevm-circuits/src/evm_circuit/execution/error_oog_dynamic_memory.rs b/zkevm-circuits/src/evm_circuit/execution/error_oog_dynamic_memory.rs index 585e9b31bd..932ef74500 100644 --- a/zkevm-circuits/src/evm_circuit/execution/error_oog_dynamic_memory.rs +++ b/zkevm-circuits/src/evm_circuit/execution/error_oog_dynamic_memory.rs @@ -6,7 +6,7 @@ use crate::{ util::{ common_gadget::RestoreContextGadget, constraint_builder::{ - ConstraintBuilder, StepStateTransition, + ConstrainBuilderCommon, EVMConstraintBuilder, StepStateTransition, Transition::{Delta, Same}, }, math_gadget::{IsEqualGadget, LtGadget}, @@ -41,7 +41,7 @@ impl ExecutionGadget for ErrorOOGDynamicMemoryGadget { const EXECUTION_STATE: ExecutionState = ExecutionState::ErrorOutOfGasDynamicMemoryExpansion; // Support other OOG due to pure memory including CREATE, RETURN and REVERT - fn configure(cb: &mut ConstraintBuilder) -> Self { + fn configure(cb: &mut EVMConstraintBuilder) -> Self { let opcode = cb.query_cell(); cb.opcode_lookup(opcode.expr(), 1.expr()); diff --git a/zkevm-circuits/src/evm_circuit/execution/error_oog_memory_copy.rs b/zkevm-circuits/src/evm_circuit/execution/error_oog_memory_copy.rs index ea75656615..c33b99bd31 100644 --- a/zkevm-circuits/src/evm_circuit/execution/error_oog_memory_copy.rs +++ b/zkevm-circuits/src/evm_circuit/execution/error_oog_memory_copy.rs @@ -5,7 +5,7 @@ use crate::{ step::ExecutionState, util::{ common_gadget::CommonErrorGadget, - constraint_builder::ConstraintBuilder, + constraint_builder::{ConstrainBuilderCommon, EVMConstraintBuilder}, from_bytes, math_gadget::{IsZeroGadget, LtGadget}, memory_gadget::{ @@ -52,7 +52,7 @@ impl ExecutionGadget for ErrorOOGMemoryCopyGadget { const EXECUTION_STATE: ExecutionState = ExecutionState::ErrorOutOfGasMemoryCopy; - fn configure(cb: &mut ConstraintBuilder) -> Self { + fn configure(cb: &mut EVMConstraintBuilder) -> Self { let opcode = cb.query_cell(); cb.require_in_set( "ErrorOutOfGasMemoryCopy opcode must be CALLDATACOPY, CODECOPY, EXTCODECOPY or RETURNDATACOPY", diff --git a/zkevm-circuits/src/evm_circuit/execution/error_oog_sha3.rs b/zkevm-circuits/src/evm_circuit/execution/error_oog_sha3.rs index 02761117bd..327c5d8a8d 100644 --- a/zkevm-circuits/src/evm_circuit/execution/error_oog_sha3.rs +++ b/zkevm-circuits/src/evm_circuit/execution/error_oog_sha3.rs @@ -5,7 +5,7 @@ use crate::{ step::ExecutionState, util::{ common_gadget::CommonErrorGadget, - constraint_builder::ConstraintBuilder, + constraint_builder::{ConstrainBuilderCommon, EVMConstraintBuilder}, math_gadget::LtGadget, memory_gadget::{ CommonMemoryAddressGadget, MemoryCopierGasGadget, MemoryExpandedAddressGadget, @@ -40,7 +40,7 @@ impl ExecutionGadget for ErrorOOGSha3Gadget { const EXECUTION_STATE: ExecutionState = ExecutionState::ErrorOutOfGasSHA3; - fn configure(cb: &mut ConstraintBuilder) -> Self { + fn configure(cb: &mut EVMConstraintBuilder) -> Self { let opcode = cb.query_cell(); cb.require_equal( "ErrorOutOfGasSHA3 opcode must be SHA3", diff --git a/zkevm-circuits/src/evm_circuit/execution/error_oog_static_memory.rs b/zkevm-circuits/src/evm_circuit/execution/error_oog_static_memory.rs index c4b71cf3b1..3f8ebde558 100644 --- a/zkevm-circuits/src/evm_circuit/execution/error_oog_static_memory.rs +++ b/zkevm-circuits/src/evm_circuit/execution/error_oog_static_memory.rs @@ -6,7 +6,7 @@ use crate::{ util::{ common_gadget::RestoreContextGadget, constraint_builder::{ - ConstraintBuilder, EVMConstraintBuilder, StepStateTransition, + ConstrainBuilderCommon, EVMConstraintBuilder, StepStateTransition, Transition::{Delta, Same}, }, math_gadget::{IsEqualGadget, LtGadget}, diff --git a/zkevm-circuits/src/evm_circuit/execution/error_precompile_failed.rs b/zkevm-circuits/src/evm_circuit/execution/error_precompile_failed.rs index 9d075b3809..16bc41c0aa 100644 --- a/zkevm-circuits/src/evm_circuit/execution/error_precompile_failed.rs +++ b/zkevm-circuits/src/evm_circuit/execution/error_precompile_failed.rs @@ -3,7 +3,7 @@ use crate::{ execution::ExecutionGadget, step::ExecutionState, util::{ - constraint_builder::ConstraintBuilder, + constraint_builder::EVMConstraintBuilder, math_gadget::IsZeroGadget, memory_gadget::{CommonMemoryAddressGadget, MemoryAddressGadget}, CachedRegion, Cell, Word, @@ -35,7 +35,7 @@ impl ExecutionGadget for ErrorPrecompileFailedGadget { const EXECUTION_STATE: ExecutionState = ExecutionState::ErrorPrecompileFailed; - fn configure(cb: &mut ConstraintBuilder) -> Self { + fn configure(cb: &mut EVMConstraintBuilder) -> Self { let opcode = cb.query_cell(); cb.opcode_lookup(opcode.expr(), 1.expr()); diff --git a/zkevm-circuits/src/evm_circuit/execution/error_write_protection.rs b/zkevm-circuits/src/evm_circuit/execution/error_write_protection.rs index 381cb3534d..8ba1620693 100644 --- a/zkevm-circuits/src/evm_circuit/execution/error_write_protection.rs +++ b/zkevm-circuits/src/evm_circuit/execution/error_write_protection.rs @@ -6,7 +6,7 @@ use crate::{ common_gadget::CommonErrorGadget, constraint_builder::{ConstrainBuilderCommon, EVMConstraintBuilder}, math_gadget::IsZeroGadget, - sum, CachedRegion, Cell, Word as RLCWord, + CachedRegion, Cell, Word as RLCWord, }, witness::{Block, Call, ExecStep, Transaction}, }, diff --git a/zkevm-circuits/src/evm_circuit/execution/jumpi.rs b/zkevm-circuits/src/evm_circuit/execution/jumpi.rs index 8275357349..557412731a 100644 --- a/zkevm-circuits/src/evm_circuit/execution/jumpi.rs +++ b/zkevm-circuits/src/evm_circuit/execution/jumpi.rs @@ -6,7 +6,7 @@ use crate::{ util::{ common_gadget::{SameContextGadget, WordByteRangeGadget}, constraint_builder::{ - EVMConstraintBuilder, StepStateTransition, + ConstrainBuilderCommon, EVMConstraintBuilder, StepStateTransition, Transition::{Delta, To}, }, math_gadget::IsZeroGadget, diff --git a/zkevm-circuits/src/evm_circuit/util/common_gadget.rs b/zkevm-circuits/src/evm_circuit/util/common_gadget.rs index a0ec5670f0..a8cdb2194f 100644 --- a/zkevm-circuits/src/evm_circuit/util/common_gadget.rs +++ b/zkevm-circuits/src/evm_circuit/util/common_gadget.rs @@ -1015,7 +1015,7 @@ impl CommonErrorGadget { } pub(crate) fn construct_with_lastcallee_return_data( - cb: &mut ConstraintBuilder, + cb: &mut EVMConstraintBuilder, opcode: Expression, rw_counter_delta: Expression, return_data_offset: Expression, @@ -1114,7 +1114,7 @@ pub(crate) struct WordByteCapGadget { } impl WordByteCapGadget { - pub(crate) fn construct(cb: &mut ConstraintBuilder, cap: Expression) -> Self { + pub(crate) fn construct(cb: &mut EVMConstraintBuilder, cap: Expression) -> Self { let word = WordByteRangeGadget::construct(cb); let value = select::expr(word.within_range(), word.valid_value(), cap.expr()); let lt_cap = LtGadget::construct(cb, value, cap); @@ -1175,7 +1175,7 @@ pub(crate) struct WordByteRangeGadget { } impl WordByteRangeGadget { - pub(crate) fn construct(cb: &mut ConstraintBuilder) -> Self { + pub(crate) fn construct(cb: &mut EVMConstraintBuilder) -> Self { debug_assert!(VALID_BYTES < 32); let original = cb.query_word_rlc(); diff --git a/zkevm-circuits/src/evm_circuit/util/constraint_builder.rs b/zkevm-circuits/src/evm_circuit/util/constraint_builder.rs index 060a3bd199..230ab610c1 100644 --- a/zkevm-circuits/src/evm_circuit/util/constraint_builder.rs +++ b/zkevm-circuits/src/evm_circuit/util/constraint_builder.rs @@ -108,7 +108,7 @@ pub(crate) struct ReversionInfo { impl ReversionInfo { pub(crate) fn from_caller( - cb: &mut ConstraintBuilder, + cb: &mut EVMConstraintBuilder, caller: &mut ReversionInfo, callee_is_success: Expression, ) -> Self { diff --git a/zkevm-circuits/src/evm_circuit/util/math_gadget/rlp.rs b/zkevm-circuits/src/evm_circuit/util/math_gadget/rlp.rs index 10478e30de..8bc049c59f 100644 --- a/zkevm-circuits/src/evm_circuit/util/math_gadget/rlp.rs +++ b/zkevm-circuits/src/evm_circuit/util/math_gadget/rlp.rs @@ -301,7 +301,7 @@ impl ContractCreateGadget { } /// Init Code's keccak hash word RLC. - pub(crate) fn keccak_code_hash_word_rlc(&self, cb: &ConstraintBuilder) -> Expression { + pub(crate) fn keccak_code_hash_word_rlc(&self, cb: &EVMConstraintBuilder) -> Expression { cb.word_rlc::( self.keccak_code_hash .iter() @@ -313,7 +313,10 @@ impl ContractCreateGadget { } /// Init Code's keccak hash keccak RLC. - pub(crate) fn keccak_code_hash_keccak_rlc(&self, cb: &ConstraintBuilder) -> Expression { + pub(crate) fn keccak_code_hash_keccak_rlc( + &self, + cb: &EVMConstraintBuilder, + ) -> Expression { cb.keccak_rlc::( self.keccak_code_hash .iter() @@ -325,7 +328,7 @@ impl ContractCreateGadget { } /// Salt EVM word RLC. - pub(crate) fn salt_word_rlc(&self, cb: &ConstraintBuilder) -> Expression { + pub(crate) fn salt_word_rlc(&self, cb: &EVMConstraintBuilder) -> Expression { cb.word_rlc::( self.salt .iter() @@ -337,7 +340,7 @@ impl ContractCreateGadget { } /// Salt keccak RLC. - pub(crate) fn salt_keccak_rlc(&self, cb: &ConstraintBuilder) -> Expression { + pub(crate) fn salt_keccak_rlc(&self, cb: &EVMConstraintBuilder) -> Expression { cb.keccak_rlc::( self.salt .iter() diff --git a/zkevm-circuits/src/evm_circuit/util/memory_gadget.rs b/zkevm-circuits/src/evm_circuit/util/memory_gadget.rs index 778a978dc4..49ba183ad6 100644 --- a/zkevm-circuits/src/evm_circuit/util/memory_gadget.rs +++ b/zkevm-circuits/src/evm_circuit/util/memory_gadget.rs @@ -67,7 +67,7 @@ pub(crate) mod address_high { /// Memory address trait to adapt for right and Uint overflow cases. pub(crate) trait CommonMemoryAddressGadget { - fn construct_self(cb: &mut ConstraintBuilder) -> Self; + fn construct_self(cb: &mut EVMConstraintBuilder) -> Self; /// Return the memory address (offset + length). fn assign( @@ -104,7 +104,7 @@ pub(crate) struct MemoryAddressGadget { } impl CommonMemoryAddressGadget for MemoryAddressGadget { - fn construct_self(cb: &mut ConstraintBuilder) -> Self { + fn construct_self(cb: &mut EVMConstraintBuilder) -> Self { let offset = cb.query_cell_phase2(); let length = cb.query_word_rlc(); Self::construct(cb, offset, length) @@ -173,7 +173,7 @@ impl CommonMemoryAddressGadget for MemoryAddressGadget { impl MemoryAddressGadget { pub(crate) fn construct( - cb: &mut ConstraintBuilder, + cb: &mut EVMConstraintBuilder, memory_offset: Cell, memory_length: MemoryAddress, ) -> Self { @@ -226,7 +226,7 @@ pub(crate) struct MemoryExpandedAddressGadget { } impl CommonMemoryAddressGadget for MemoryExpandedAddressGadget { - fn construct_self(cb: &mut ConstraintBuilder) -> Self { + fn construct_self(cb: &mut EVMConstraintBuilder) -> Self { let offset = cb.query_word_rlc(); let length = cb.query_word_rlc(); let sum = cb.query_word_rlc(); diff --git a/zkevm-circuits/src/pi_circuit.rs b/zkevm-circuits/src/pi_circuit.rs index e11d051803..07691111a7 100644 --- a/zkevm-circuits/src/pi_circuit.rs +++ b/zkevm-circuits/src/pi_circuit.rs @@ -2,7 +2,10 @@ use std::{iter, marker::PhantomData}; -use crate::table::{BlockContextFieldTag, KeccakTable}; +use crate::{ + evm_circuit::util::constraint_builder::ConstrainBuilderCommon, + table::{BlockContextFieldTag, KeccakTable}, +}; use bus_mapping::circuit_input_builder::get_dummy_tx_hash; use eth_types::{Address, Field, Hash, ToBigEndian, Word, H256}; use ethers_core::utils::keccak256; diff --git a/zkevm-circuits/src/rlp_circuit.rs b/zkevm-circuits/src/rlp_circuit.rs index f63bbe93cb..3427f2d709 100644 --- a/zkevm-circuits/src/rlp_circuit.rs +++ b/zkevm-circuits/src/rlp_circuit.rs @@ -27,7 +27,11 @@ use halo2_proofs::{ // use crate::evm_circuit::table::FixedTableTag; use crate::{ evm_circuit::{ - util::{and, constraint_builder::BaseConstraintBuilder, not, or}, + util::{ + and, + constraint_builder::{BaseConstraintBuilder, ConstrainBuilderCommon}, + not, or, + }, witness::{RlpTxTag, RlpWitnessGen}, }, table::RlpTable, diff --git a/zkevm-circuits/src/tx_circuit.rs b/zkevm-circuits/src/tx_circuit.rs index 80cc44dc09..2e8e8d47d2 100644 --- a/zkevm-circuits/src/tx_circuit.rs +++ b/zkevm-circuits/src/tx_circuit.rs @@ -16,7 +16,7 @@ mod test; pub use dev::TxCircuit as TestTxCircuit; use crate::{ - evm_circuit::util::constraint_builder::BaseConstraintBuilder, + evm_circuit::util::constraint_builder::{BaseConstraintBuilder, ConstrainBuilderCommon}, table::{BlockTable, KeccakTable, LookupTable, RlpTable, TxFieldTag, TxTable}, util::{keccak, random_linear_combine_word as rlc, SubCircuit, SubCircuitConfig}, witness,