From 664b3a20c6dff6d50b6a3e7e776fce3904c67bbd Mon Sep 17 00:00:00 2001 From: zeroXbrock <2791467+zeroXbrock@users.noreply.github.com> Date: Thu, 16 Apr 2026 15:25:11 -0700 Subject: [PATCH 1/2] improve campaign/spam logs - shutdown scenario when spam_inner finishes work to stop TxActor logs - print an info log to let user know system is working before running time-consuming ops --- crates/cli/src/commands/spam.rs | 4 +++- crates/core/src/test_scenario.rs | 2 +- crates/report/src/command.rs | 10 ++++++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/crates/cli/src/commands/spam.rs b/crates/cli/src/commands/spam.rs index f2cc73fc..fa338062 100644 --- a/crates/cli/src/commands/spam.rs +++ b/crates/cli/src/commands/spam.rs @@ -958,10 +958,12 @@ where _ = tokio::signal::ctrl_c() => { info!("CTRL-C received, stopping result collection."); - test_scenario.shutdown().await; } } + // Shut down the TxActor so its flush loop stops logging + test_scenario.shutdown().await; + // Stop background tasks and print final summary if let Some(cancel) = funding_cancel { cancel.cancel(); diff --git a/crates/core/src/test_scenario.rs b/crates/core/src/test_scenario.rs index 5be71a69..6145c3e2 100644 --- a/crates/core/src/test_scenario.rs +++ b/crates/core/src/test_scenario.rs @@ -417,7 +417,7 @@ where /// Otherwise do nothing. pub async fn sync_nonces(&mut self) -> Result<()> { if self.should_sync_nonces { - println!("syncing nonces..."); + info!("syncing nonces from RPC..."); return sync_nonces( &self.signer_map, &mut self.nonces, diff --git a/crates/report/src/command.rs b/crates/report/src/command.rs index 9a2e307e..e2a0c78f 100644 --- a/crates/report/src/command.rs +++ b/crates/report/src/command.rs @@ -273,6 +273,8 @@ pub async fn report( .map(|w| w[1] - w[0]) .collect::>(), ); + let start_block = blocks.first().map(|b| b.header.number).unwrap_or(0); + let end_block = blocks.last().map(|b| b.header.number).unwrap_or(0); // cache data to file let cache_data = CacheFile::new(trace_data, blocks, data_dir); @@ -385,14 +387,18 @@ pub async fn report( .collect(); // compile report + info!( + "Generating report (run_ids: {start_run_id}-{end_run_id}) (blocks {} to {})", + start_block, end_block + ); let mut blocks = cache_data.blocks; blocks.sort_by_key(|a| a.header.number); let report_metadata = ReportMetadata { scenario_name: scenario_title, start_run_id, end_run_id, - start_block: blocks.first().unwrap().header.number, - end_block: blocks.last().unwrap().header.number, + start_block, + end_block, rpc_url: rpc_url.to_string(), metrics, chart_data: ChartData { From db08775ef723fd0203a57c085ae25f7dbc4241e1 Mon Sep 17 00:00:00 2001 From: zeroXbrock <2791467+zeroXbrock@users.noreply.github.com> Date: Thu, 16 Apr 2026 15:30:48 -0700 Subject: [PATCH 2/2] chore: update changelogs --- CHANGELOG.md | 1 + crates/cli/CHANGELOG.md | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 68008c90..5c672322 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +- improve campaign/spam logs (particularly when `--report` is passed) ([#508](https://github.com/flashbots/contender/pull/508)) - refactored `Contender` orchestrator to a typestate-based lifecycle — `Contender` vs `Contender` — eliminating all runtime lifecycle checks and enforcing correct usage at compile time ([#507](https://github.com/flashbots/contender/pull/507)) - custom spam callbacks can now wrap a `LogCallback` via `LogCallback::with_callback` to inherit the tx-caching and FCU behavior that `contender report` depends on, removing the boilerplate that previously caused custom callbacks to silently break reporting ([#326](https://github.com/flashbots/contender/issues/326)) - added contender server + some supporting (and internally-breaking) changes ([#494](https://github.com/flashbots/contender/pull/494/)) diff --git a/crates/cli/CHANGELOG.md b/crates/cli/CHANGELOG.md index 043f6c08..a003da15 100644 --- a/crates/cli/CHANGELOG.md +++ b/crates/cli/CHANGELOG.md @@ -7,7 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased -- updated session management to support typestate-based `Contender` lifecycle ([#507](https://github.com/flashbots/contender/pull/507)) +- improve campaign/spam logs (particularly when `--report` is passed) ([#508](https://github.com/flashbots/contender/pull/508/changes)) +- updated session management to support typestate-based `Contender` lifecycle ([#507](https://github.com/flashbots/contender/pull/507/changes)) - `ContenderSession.contender` now wraps a `SessionContender` enum (`Uninit` / `Init`) - `take_contender` / `put_contender` replaced by typed `take_uninitialized` / `take_initialized` / `put_initialized` - contender API ([#494](https://github.com/flashbots/contender/pull/494/changes))