Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
chores: code clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
hero78119 committed Mar 1, 2024
1 parent 2fb87b0 commit 5142f64
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 40 deletions.
2 changes: 1 addition & 1 deletion bus-mapping/src/circuit_input_builder/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use std::collections::HashMap;
pub struct BlockContext {
/// Used to track the global counter in every operation in the block.
/// Contains the next available value.
pub rwc: RWCounter,
pub(crate) rwc: RWCounter,
/// Map call_id to (tx_index, call_index) (where tx_index is the index used
/// in Block.txs and call_index is the index used in Transaction.
/// calls).
Expand Down
2 changes: 1 addition & 1 deletion circuit-benchmarks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"

[features]
default = ["benches"]
default = []
benches = []
25 changes: 12 additions & 13 deletions circuit-benchmarks/src/exp_circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#[cfg(test)]
mod tests {
use ark_std::{end_timer, start_timer};
use bus_mapping::mock::BlockData;
use bus_mapping::{circuit_input_builder::FixedCParams, mock::BlockData};
use env_logger::Env;
use eth_types::{bytecode, geth_types::GethData, Word};
use halo2_proofs::{
Expand Down Expand Up @@ -119,7 +119,7 @@ mod tests {
}

fn generate_full_events_block(
_degree: u32,
degree: u32,
base: Word,
exponent: Word,
) -> (Block<Fr>, Chunk<Fr>) {
Expand All @@ -138,17 +138,16 @@ mod tests {
)
.unwrap();
let block: GethData = test_ctx.into();
// let mut builder = BlockData::new_from_geth_data_with_params(
// block.clone(),
// FixedCParams {
// max_rws: 1 << (degree - 1),
// ..Default::default()
// },
// )
let builder = BlockData::new_from_geth_data(block.clone())
.new_circuit_input_builder()
.handle_block(&block.eth_block, &block.geth_traces)
.unwrap();
let builder = BlockData::new_from_geth_data_with_params(
block.clone(),
FixedCParams {
max_rws: 1 << (degree - 1),
..Default::default()
},
)
.new_circuit_input_builder()
.handle_block(&block.eth_block, &block.geth_traces)
.unwrap();
let block = block_convert(&builder).unwrap();
let chunk = chunk_convert(&block, &builder).unwrap().remove(0);
(block, chunk)
Expand Down
4 changes: 0 additions & 4 deletions zkevm-circuits/src/evm_circuit/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1180,10 +1180,6 @@ impl<F: Field> ExecutionConfig<F> {
.chain(std::iter::once((&dummy_tx, &cur_chunk_last_call, padding)))
.peekable();

tx_call_steps
.clone()
.for_each(|step| println!("assigned_step step {:?}", step.2));

let evm_rows = chunk.fixed_param.max_evm_rows;

let mut assign_padding_or_step = |cur_tx_call_step: TxCallStep,
Expand Down
19 changes: 1 addition & 18 deletions zkevm-circuits/src/evm_circuit/execution/begin_chunk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,5 @@ impl<F: Field> ExecutionGadget<F> for BeginChunkGadget<F> {

#[cfg(test)]
mod test {
use crate::test_util::CircuitTestBuilder;
use eth_types::bytecode;
use mock::TestContext;

fn test_ok(bytecode: bytecode::Bytecode) {
CircuitTestBuilder::new_from_test_ctx(
TestContext::<2, 1>::simple_ctx_with_bytecode(bytecode).unwrap(),
)
.run()
}

#[test]
fn begin_chunk_test() {
let bytecode = bytecode! {
STOP
};
test_ok(bytecode);
}
// begin_chunk unittest covered by end_chunk
}
6 changes: 3 additions & 3 deletions zkevm-circuits/src/state_circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,9 @@ impl<F: Field> StateCircuitConfig<F> {
assert_eq!(state_root, old_root);
state_root = new_root;
}
// if matches!(row.tag(), Target::CallContext) && !row.is_write() {
// assert_eq!(row.value_assignment(), 0.into(), "{:?}", row);
// }
if matches!(row.tag(), Target::CallContext) && !row.is_write() {
assert_eq!(row.value_assignment(), 0.into(), "{:?}", row);
}
}
}

Expand Down

0 comments on commit 5142f64

Please sign in to comment.