Skip to content
This repository was archived by the owner on Apr 18, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
505 changes: 278 additions & 227 deletions Cargo.lock

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ ark-std = "0.3"
ctor = "0.1"
env_logger = "0.10"
ethers = { version = "=2.0.7", features = ["ethers-solc"] }
ethers-core = { git = "https://github.com/scroll-tech/ethers-rs.git", branch = "v2.0.7", features = ["scroll"] }
ethers-core = { git = "https://github.com/scroll-tech/ethers-rs.git", branch = "v2.0.7-patch-tungstenite", features = ["scroll"] }
ethers-providers = "=2.0.7"
ethers-signers = "=2.0.7"
ff = "0.13"
Expand Down Expand Up @@ -62,11 +62,11 @@ tokio = { version = "1.13", features = ["macros", "rt-multi-thread"] }
url = "2.2"

[patch.crates-io]
ethers-core = { git = "https://github.com/scroll-tech/ethers-rs.git", branch = "v2.0.7" }
ethers-providers = { git = "https://github.com/scroll-tech/ethers-rs.git", branch = "v2.0.7" }
ethers = { git = "https://github.com/scroll-tech/ethers-rs.git", branch = "v2.0.7" }
ethers-etherscan = { git = "https://github.com/scroll-tech/ethers-rs.git", branch = "v2.0.7" }
ethers-signers = { git = "https://github.com/scroll-tech/ethers-rs.git", branch = "v2.0.7" }
ethers-core = { git = "https://github.com/scroll-tech/ethers-rs.git", branch = "v2.0.7-patch-tungstenite" }
ethers-providers = { git = "https://github.com/scroll-tech/ethers-rs.git", branch = "v2.0.7-patch-tungstenite" }
ethers = { git = "https://github.com/scroll-tech/ethers-rs.git", branch = "v2.0.7-patch-tungstenite" }
ethers-etherscan = { git = "https://github.com/scroll-tech/ethers-rs.git", branch = "v2.0.7-patch-tungstenite" }
ethers-signers = { git = "https://github.com/scroll-tech/ethers-rs.git", branch = "v2.0.7-patch-tungstenite" }
gobuild = { git = "https://github.com/scroll-tech/gobuild.git" }
[patch."https://github.com/privacy-scaling-explorations/halo2.git"]
halo2_proofs = { git = "https://github.com/scroll-tech/halo2.git", branch = "v1.1" }
Expand Down
4 changes: 2 additions & 2 deletions testool/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license.workspace = true
[dependencies]
anyhow.workspace = true
bus-mapping = { path = "../bus-mapping" }
clap = { version = "3.1", features = ["derive"] }
clap = { version = "4.5", features = ["derive"] }
env_logger.workspace = true
eth-types = { path="../eth-types" }
ethers-core.workspace = true
Expand Down Expand Up @@ -52,4 +52,4 @@ chunk-prove = ["prover/test", "parallel_syn", "scroll", "shanghai"]

enable-stack = ["zkevm-circuits/enable-stack"]
enable-memory = ["zkevm-circuits/enable-memory"]
enable-storage = ["zkevm-circuits/enable-storage"]
enable-storage = ["zkevm-circuits/enable-storage"]
2 changes: 1 addition & 1 deletion testool/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const TEST_IDS_FILE: &str = "./test_ids.txt";
extern crate prettytable;

#[allow(non_camel_case_types)]
#[derive(PartialEq, Parser, EnumString, Debug)]
#[derive(PartialEq, Parser, EnumString, Debug, Clone, Copy)]
enum Circuits {
basic,
sc,
Expand Down
2 changes: 1 addition & 1 deletion zkevm-circuits/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ rayon.workspace = true

[dev-dependencies]
bus-mapping = { path = "../bus-mapping", features = ["test"] }
criterion = "0.3"
criterion = "0.5"
ctor.workspace = true
mock = { path = "../mock" }
pretty_assertions.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion zkevm-circuits/src/copy_circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -569,10 +569,10 @@ impl<F: Field> SubCircuitConfig<F> for CopyCircuitConfig<F> {
is_access_list_address,
is_access_list_storage_key,
q_enable,
copy_table,
is_src_end,
is_word_end,
non_pad_non_mask,
copy_table,
tx_table,
rw_table,
bytecode_table,
Expand Down
10 changes: 5 additions & 5 deletions zkevm-circuits/src/evm_circuit/execution/addmod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,21 +120,21 @@ impl<F: Field> ExecutionGadget<F> for AddModGadget<F> {
let same_context = SameContextGadget::construct(cb, opcode, step_state_transition);

Self {
same_context,
a,
b,
r,
n,
k,
d,
a_reduced,
muladd_d_n_r,
muladd_k_n_areduced,
same_context,
cmp_r_n,
cmp_areduced_n,
n_is_zero,
sum_areduced_b,
sum_areduced_b_overflow,
muladd_d_n_r,
n_is_zero,
cmp_r_n,
cmp_areduced_n,
}
}

Expand Down
6 changes: 3 additions & 3 deletions zkevm-circuits/src/evm_circuit/execution/begin_tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -790,8 +790,8 @@ impl<F: Field> ExecutionGadget<F> for BeginTxGadget<F> {
Self {
tx_id,
tx_type,
tx_nonce,
sender_nonce,
tx_nonce,
tx_gas,
tx_gas_price,
mul_gas_fee_by_gas,
Expand All @@ -809,6 +809,7 @@ impl<F: Field> ExecutionGadget<F> for BeginTxGadget<F> {
tx_call_data_gas_cost,
tx_data_gas_cost,
reversion_info,
intrinsic_gas_cost,
sufficient_gas_left,
transfer_with_gas_fee,
account_code_hash,
Expand All @@ -819,14 +820,13 @@ impl<F: Field> ExecutionGadget<F> for BeginTxGadget<F> {
call_code_hash,
call_code_hash_is_empty,
call_code_hash_is_zero,
intrinsic_gas_cost,
is_precompile_lt,
precompile_gadget,
precompile_input_len,
precompile_input_bytes_rlc,
caller_nonce_hash_bytes,
init_code_rlc,
keccak_code_hash,
init_code_rlc,
create,
is_caller_warm,
is_callee_warm,
Expand Down
26 changes: 13 additions & 13 deletions zkevm-circuits/src/evm_circuit/execution/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -534,31 +534,31 @@ impl<F: Field, const IS_CREATE2: bool, const S: ExecutionState> ExecutionGadget<

Self {
opcode,
reversion_info,
tx_id,
reversion_info,
depth,
is_success,
was_warm,
value,
depth,
caller_balance,
callee_reversion_info,
callee_nonce,
prev_code_hash,
prev_code_hash_is_zero,
transfer,
create,
init_code,
init_code_rlc,
memory_expansion,
gas_left,
init_code_word_size,
init_code_size_not_overflow,
create,
caller_balance,
init_code_rlc,
keccak_output,
is_depth_in_range,
is_insufficient_balance,
is_nonce_in_range,
callee_nonce,
keccak_code_hash,
keccak_output,
not_address_collision,
is_success,
prev_code_hash,
prev_code_hash_is_zero,
memory_expansion,
gas_left,
keccak_code_hash,
#[cfg(feature = "scroll")]
prev_keccak_code_hash,
copy_rw_increase,
Expand Down
2 changes: 1 addition & 1 deletion zkevm-circuits/src/evm_circuit/execution/error_oog_log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ impl<F: Field> ExecutionGadget<F> for ErrorOOGLogGadget<F> {

Self {
opcode,
memory_address,
is_static_call,
is_opcode_logn,
memory_address,
memory_expansion,
insufficient_gas,
common_error_gadget,
Expand Down
10 changes: 5 additions & 5 deletions zkevm-circuits/src/evm_circuit/execution/error_oog_precompile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,13 @@ impl<F: Field> ExecutionGadget<F> for ErrorOOGPrecompileGadget<F> {

Self {
precompile_addr,
required_gas,
insufficient_gas,
n_pairs,
n_words,
addr_bits,
is_root,
call_data_length,
is_root,
n_pairs,
n_words,
required_gas,
insufficient_gas,
restore_context,
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,8 @@ mod test {
}

Self {
bytecode,
gas_cost,
bytecode,
..Default::default()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ impl<F: Field> ExecutionGadget<F> for ErrorReturnDataOutOfBoundGadget<F> {
Self {
opcode,
memory_offset,
overflow_gadget,
return_data_length,
overflow_gadget,
common_error_gadget,
}
}
Expand Down
2 changes: 1 addition & 1 deletion zkevm-circuits/src/evm_circuit/execution/extcodecopy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ impl<F: Field> ExecutionGadget<F> for ExtcodecopyGadget<F> {
memory_address,
code_offset,
tx_id,
is_warm,
reversion_info,
is_warm,
code_hash,
not_exists,
code_size,
Expand Down
2 changes: 1 addition & 1 deletion zkevm-circuits/src/evm_circuit/execution/extcodesize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ impl<F: Field> ExecutionGadget<F> for ExtcodesizeGadget<F> {
Self {
same_context,
address_word,
tx_id,
reversion_info,
tx_id,
is_warm,
code_hash,
not_exists,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ impl<F: Field, const BIT_LIMIT: usize> RandPowRepresent<F, BIT_LIMIT> {
};

Self {
pow_lookup,
bits,
pow,
pow_lookup,
cache_for_degree,
pow,
}
}

Expand Down Expand Up @@ -524,8 +524,8 @@ impl<F: Field> Limbs<F> {
];

Self {
byte14_split_hi,
byte14_split_lo,
byte14_split_hi,
limbs,
}
}
Expand Down Expand Up @@ -627,8 +627,8 @@ impl<F: Field> ModExpGasCost<F> {
words,
exp_is_zero,
exp_byte_size,
exp_msb,
exp_msb_bit_length,
exp_msb,
calc_gas,
dynamic_gas,
}
Expand Down
4 changes: 2 additions & 2 deletions zkevm-circuits/src/evm_circuit/execution/return_revert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,20 +328,20 @@ impl<F: Field> ExecutionGadget<F> for ReturnRevertGadget<F> {
range,
deployed_bytecode_rlc,
is_success,
restore_context,
copy_length,
copy_rw_increase,
copy_rw_increase_is_zero,
return_data_offset,
return_data_length,
restore_context,
memory_expansion,
code_hash,
prev_code_hash,
keccak_code_hash,
prev_keccak_code_hash,
code_size,
address,
caller_id,
address,
reversion_info,
}
}
Expand Down
2 changes: 1 addition & 1 deletion zkevm-circuits/src/evm_circuit/execution/selfbalance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ impl<F: Field> ExecutionGadget<F> for SelfbalanceGadget<F> {

Self {
same_context,
phase2_self_balance,
callee_address,
phase2_self_balance,
}
}

Expand Down
4 changes: 2 additions & 2 deletions zkevm-circuits/src/evm_circuit/execution/sstore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,11 +308,11 @@ impl<F: Field> SstoreTxRefundGadget<F> {
- recreate_slot * (GasCost::SSTORE_CLEARS_SCHEDULE.expr());

Self {
tx_refund_old,
tx_refund_new,
value,
value_prev,
original_value,
tx_refund_old,
tx_refund_new,
value_prev_is_zero_gadget,
value_is_zero_gadget,
original_is_zero_gadget,
Expand Down
2 changes: 1 addition & 1 deletion zkevm-circuits/src/evm_circuit/step.rs
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,8 @@ impl<F: Field> DynamicSelectorHalf<F> {
let target_odd = cell_manager.query_cell(CellType::StoragePhase1);
Self {
count,
target_pairs,
target_odd,
target_pairs,
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ impl<F: Field> TxL1MsgGadget<F> {

Self {
tx_is_l1msg,
caller_codehash,
is_caller_empty,
caller_codehash,
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ impl<F: Field> CmpWordsGadget<F> {
Self {
comparison_lo,
comparison_hi,
lt,
eq,
lt,
}
}

Expand Down
2 changes: 1 addition & 1 deletion zkevm-circuits/src/evm_circuit/util/math_gadget/min_max.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use halo2_proofs::{
circuit::Value,
plonk::{Error, Expression},
};
/// Returns `rhs` when `lhs < rhs`, and returns `lhs` otherwise.

/// lhs and rhs `< 256**N_BYTES`
/// `N_BYTES` is required to be `<= MAX_N_BYTES_INTEGER`.
#[derive(Clone, Debug)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ mod tests {

PairSelectionTestContainer {
select_gadget,
v,
a,
b,
v,
}
}

Expand Down
1 change: 1 addition & 0 deletions zkevm-circuits/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#![deny(missing_docs)]
#![deny(unsafe_code)]
#![deny(clippy::debug_assert_with_mut_call)]
#![deny(clippy::inconsistent_struct_constructor)]
// We have too many cast between `usize` and `u64`,
// we'd better ensure usize is 64-bit on target arch.
#[cfg(not(target_pointer_width = "64"))]
Expand Down
2 changes: 1 addition & 1 deletion zkevm-circuits/src/modexp_circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ impl<F: Field> SubCircuitConfig<F> for ModExpCircuitConfig {
let rangecheck_config = RangeCheckChip::configure(meta);
let modexp_config = ModExpChip::configure(meta, &rangecheck_config);
Self {
rangecheck_config,
modexp_config,
rangecheck_config,
modexp_table,
}
}
Expand Down
Loading