Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
35f46b0
feat(types): SharedFuzzState and FuzzWorker
yash-atreya Sep 26, 2025
431cc06
basic run_worker in FuzzExecutor
yash-atreya Sep 26, 2025
e4c6060
rename found_counterexample to found_failure in SharedFuzzState and s…
yash-atreya Sep 26, 2025
40263fd
feat: track total_rejects in SharedFuzzState
yash-atreya Sep 26, 2025
d1990ec
shared_state.increment_runs + only worker0 replays persisted failure …
yash-atreya Sep 29, 2025
ed234d8
feat: basic staggered corpus sync in run_worker
yash-atreya Sep 29, 2025
67c96a7
feat: parallelize fuzz runs + aggregate results
yash-atreya Sep 29, 2025
0cdccd9
fix: derive seeds per worker
yash-atreya Sep 30, 2025
f7310d0
fix: only increment runs for success cases + try_increment_runs atomi…
yash-atreya Sep 30, 2025
e5b00bc
fix: run only 1 worker if replaying persisted failure
yash-atreya Sep 30, 2025
1d6363b
fix: timed campaigns - introduce per worker timer
yash-atreya Sep 30, 2025
dde52cc
fix: flaky try_increment_runs
yash-atreya Oct 1, 2025
63ca2bf
fix: expect_emit_test_should_fail - identify events only using cache …
yash-atreya Oct 1, 2025
1aa39ed
fix: expect_emit_tests_should_fail
yash-atreya Oct 1, 2025
349b5ee
fix: timer should be global to fit as many runs as possible
yash-atreya Oct 1, 2025
33a294c
fix: worker_runs = config.runs/ num_workers
yash-atreya Oct 1, 2025
e8fde6f
fix: should_not_shrink_fuzz_failure
yash-atreya Oct 1, 2025
e991826
feat: propagate --jobs / threads to FuzzConfig to determine number of…
yash-atreya Oct 1, 2025
47bd12d
optimize aggregate results
yash-atreya Oct 1, 2025
e77fe5b
nit
yash-atreya Oct 1, 2025
0cca8e1
fix
yash-atreya Oct 1, 2025
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
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/cheatcodes/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ revm-inspectors.workspace = true
semver.workspace = true
serde_json.workspace = true
thiserror.workspace = true
tokio.workspace = true
toml = { workspace = true, features = ["preserve_order"] }
tracing.workspace = true
walkdir.workspace = true
Expand Down
8 changes: 6 additions & 2 deletions crates/cheatcodes/src/test/expect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1094,8 +1094,12 @@ fn decode_event(
return None;
}
let t0 = topics[0]; // event sig
// Try to identify the event
let event = foundry_common::block_on(identifier.identify_event(t0))?;
// Try to identify the event - detect if we're in a Tokio runtime and use appropriate method
let event = if tokio::runtime::Handle::try_current().is_ok() {
foundry_common::block_on(identifier.identify_event(t0))?
} else {
identifier.identify_event_sync(t0)?
};

// Check if event already has indexed information from signatures
let has_indexed_info = event.inputs.iter().any(|p| p.indexed);
Expand Down
5 changes: 5 additions & 0 deletions crates/config/src/fuzz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ pub struct FuzzConfig {
pub show_logs: bool,
/// Optional timeout (in seconds) for each property test
pub timeout: Option<u32>,
/// Number of threads to use for parallel fuzz runs
///
/// This is set by passing `-j` or `--jobs`
pub threads: Option<usize>,
}

impl Default for FuzzConfig {
Expand All @@ -49,6 +53,7 @@ impl Default for FuzzConfig {
failure_persist_dir: None,
show_logs: false,
timeout: None,
threads: None,
}
}
}
Expand Down
1 change: 1 addition & 0 deletions crates/evm/evm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,4 @@ indicatif.workspace = true
serde_json.workspace = true
serde.workspace = true
uuid.workspace = true
rayon.workspace = true
5 changes: 2 additions & 3 deletions crates/evm/evm/src/executors/corpus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,6 @@ impl WorkerCorpus {
};

if timestamp <= self.last_sync_timestamp {
// TODO: Delete synced file
continue;
}

Expand Down Expand Up @@ -891,7 +890,7 @@ impl WorkerCorpus {

/// To be run by the master worker (id = 0) to distribute the global corpus to sync/ directories
/// of other workers.
fn distribute(&mut self, num_workers: usize) -> eyre::Result<()> {
fn distribute(&mut self, num_workers: u32) -> eyre::Result<()> {
if self.id != 0 || self.worker_dir.is_none() {
return Ok(());
}
Expand Down Expand Up @@ -946,7 +945,7 @@ impl WorkerCorpus {
/// Syncs the workers in_memory_corpus and history_map with the findings from other workers.
pub fn sync(
&mut self,
num_workers: usize,
num_workers: u32,
executor: &Executor,
fuzzed_function: Option<&Function>,
fuzzed_contracts: Option<&FuzzRunIdentifiedContracts>,
Expand Down
Loading
Loading