Skip to content

Commit

Permalink
feat: run decoder integration tests payloads in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
Nashtare committed May 29, 2024
1 parent e48f8e9 commit b066b72
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
1 change: 1 addition & 0 deletions trace_decoder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ evm_arithmetization = { version = "0.1.3", path = "../evm_arithmetization" }

[dev-dependencies]
plonky2 = { workspace = true }
plonky2_maybe_rayon = { workspace = true }
pretty_env_logger = "0.5.0"
serde_json = { workspace = true }
26 changes: 15 additions & 11 deletions trace_decoder/tests/test_parsing_and_proving.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use std::time::Duration;
use evm_arithmetization::prover::testing::simulate_execution;
use plonky2::field::goldilocks_field::GoldilocksField;
use plonky2::util::timing::TimingTree;
use plonky2_maybe_rayon::{MaybeIntoParIter, ParallelIterator};
use pretty_env_logger::env_logger::{try_init_from_env, Env, DEFAULT_FILTER_ENV};
use serde::{Deserialize, Serialize};
use trace_decoder::{
Expand Down Expand Up @@ -45,17 +46,20 @@ fn test_block(path: &str) {
)
.unwrap();

for tx_input in tx_inputs {
let timing = TimingTree::new(
&format!(
"Simulating zkEVM CPU for txn {:?}",
tx_input.txn_number_before
),
log::Level::Info,
);
simulate_execution::<F>(tx_input).unwrap();
timing.filter(Duration::from_millis(100)).print();
}
let _ = tx_inputs
.into_par_iter()
.map(|tx_input| {
let timing = TimingTree::new(
&format!(
"Simulating zkEVM CPU for txn {:?}",
tx_input.txn_number_before
),
log::Level::Info,
);
simulate_execution::<F>(tx_input).unwrap();
timing.filter(Duration::from_millis(100)).print();
})
.collect::<Vec<_>>();
}

/// Tests a small block with withdrawals: <https://etherscan.io/block/19807080>.
Expand Down

0 comments on commit b066b72

Please sign in to comment.