From 90e15d096d3ec53a84d5ffe071002e4042f5586c Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Thu, 12 Feb 2026 00:32:50 +0100 Subject: [PATCH] perf: reduce tracing span noise in prewarm and proof workers (#22101) --- .../tree/src/tree/payload_processor/prewarm.rs | 15 +-------------- crates/engine/tree/src/tree/payload_validator.rs | 13 ++++--------- crates/trie/parallel/src/proof_task.rs | 8 -------- crates/trie/trie/src/hashed_cursor/metrics.rs | 4 ++-- crates/trie/trie/src/trie_cursor/metrics.rs | 4 ++-- 5 files changed, 9 insertions(+), 35 deletions(-) diff --git a/crates/engine/tree/src/tree/payload_processor/prewarm.rs b/crates/engine/tree/src/tree/payload_processor/prewarm.rs index c0828d5c7d..8e64721f2e 100644 --- a/crates/engine/tree/src/tree/payload_processor/prewarm.rs +++ b/crates/engine/tree/src/tree/payload_processor/prewarm.rs @@ -598,13 +598,10 @@ where }; while let Ok(IndexedTransaction { index, tx }) = txs.recv() { - let enter = debug_span!( + let _enter = debug_span!( target: "engine::tree::payload_processor::prewarm", "prewarm tx", index, - tx_hash = %tx.tx().tx_hash(), - is_success = tracing::field::Empty, - gas_used = tracing::field::Empty, ) .entered(); @@ -635,12 +632,6 @@ where }; metrics.execution_duration.record(start.elapsed()); - // record some basic information about the transactions - enter.record("gas_used", res.result.gas_used()); - enter.record("is_success", res.result.is_success()); - - drop(enter); - // If the task was cancelled, stop execution, and exit. if terminate_execution.load(Ordering::Relaxed) { break @@ -649,16 +640,12 @@ where // Only send outcome for transactions after the first txn // as the main execution will be just as fast if index > 0 { - let _enter = - debug_span!(target: "engine::tree::payload_processor::prewarm", "prewarm outcome", index, tx_hash=%tx.tx().tx_hash()) - .entered(); let (targets, storage_targets) = multiproof_targets_from_state(res.state, v2_proofs_enabled); metrics.prefetch_storage_targets.record(storage_targets as f64); if let Some(to_multi_proof) = &to_multi_proof { let _ = to_multi_proof.send(MultiProofMessage::PrefetchProofs(targets)); } - drop(_enter); } metrics.total_runtime.record(start.elapsed()); diff --git a/crates/engine/tree/src/tree/payload_validator.rs b/crates/engine/tree/src/tree/payload_validator.rs index 4e7aa7aafe..e0dcec4205 100644 --- a/crates/engine/tree/src/tree/payload_validator.rs +++ b/crates/engine/tree/src/tree/payload_validator.rs @@ -832,21 +832,18 @@ where let tx = tx_result.map_err(BlockExecutionError::other)?; let tx_signer = *>::signer(&tx); - let tx_hash = >::tx(&tx).tx_hash(); senders.push(tx_signer); - let span = debug_span!( + let _enter = debug_span!( target: "engine::tree", "execute tx", - ?tx_hash, - gas_used = tracing::field::Empty, - ); - let enter = span.entered(); + ) + .entered(); trace!(target: "engine::tree", "Executing transaction"); let tx_start = Instant::now(); - let gas_used = executor.execute_transaction(tx)?; + executor.execute_transaction(tx)?; self.metrics.record_transaction_execution(tx_start.elapsed()); let current_len = executor.receipts().len(); @@ -858,8 +855,6 @@ where let _ = receipt_tx.send(IndexedReceipt::new(tx_index, receipt.clone())); } } - - enter.record("gas_used", gas_used); } drop(exec_span); diff --git a/crates/trie/parallel/src/proof_task.rs b/crates/trie/parallel/src/proof_task.rs index 990c17117e..ae512d5989 100644 --- a/crates/trie/parallel/src/proof_task.rs +++ b/crates/trie/parallel/src/proof_task.rs @@ -463,9 +463,7 @@ where let span = debug_span!( target: "trie::proof_task", "Storage proof calculation", - ?hashed_address, target_slots = ?target_slots.len(), - worker_id = self.id, ); let _span_guard = span.enter(); @@ -513,9 +511,7 @@ where let span = debug_span!( target: "trie::proof_task", "V2 Storage proof calculation", - ?hashed_address, targets = ?targets.len(), - worker_id = self.id, ); let _span_guard = span.enter(); @@ -1297,7 +1293,6 @@ where "Account multiproof calculation", targets = targets.len(), num_slots = targets.values().map(|slots| slots.len()).sum::(), - worker_id=self.worker_id, ); let _span_guard = span.enter(); @@ -1363,7 +1358,6 @@ where "Account V2 multiproof calculation", account_targets = account_targets.len(), storage_targets = storage_targets.values().map(|t| t.len()).sum::(), - worker_id = self.worker_id, ); let _span_guard = span.enter(); @@ -1512,7 +1506,6 @@ where target: "trie::proof_task", "Blinded account node calculation", ?path, - worker_id, ); let _span_guard = span.enter(); @@ -1620,7 +1613,6 @@ where let _guard = debug_span!( target: "trie::proof_task", "Waiting for storage proof", - ?hashed_address, ); // Block on this specific storage proof receiver - enables interleaved // parallelism diff --git a/crates/trie/trie/src/hashed_cursor/metrics.rs b/crates/trie/trie/src/hashed_cursor/metrics.rs index 71de95eab1..c8089e8943 100644 --- a/crates/trie/trie/src/hashed_cursor/metrics.rs +++ b/crates/trie/trie/src/hashed_cursor/metrics.rs @@ -2,7 +2,7 @@ use super::{HashedCursor, HashedStorageCursor}; use alloy_primitives::B256; use reth_storage_errors::db::DatabaseError; use std::time::{Duration, Instant}; -use tracing::debug_span; +use tracing::trace_span; #[cfg(feature = "metrics")] use crate::TrieType; @@ -112,7 +112,7 @@ impl HashedCursorMetricsCache { /// Record the span for metrics. pub fn record_span(&self, name: &'static str) { - let _span = debug_span!( + let _span = trace_span!( target: "trie::trie_cursor", "Hashed cursor metrics", name, diff --git a/crates/trie/trie/src/trie_cursor/metrics.rs b/crates/trie/trie/src/trie_cursor/metrics.rs index ebbe75002c..f1ec81f88f 100644 --- a/crates/trie/trie/src/trie_cursor/metrics.rs +++ b/crates/trie/trie/src/trie_cursor/metrics.rs @@ -3,7 +3,7 @@ use crate::{BranchNodeCompact, Nibbles}; use alloy_primitives::B256; use reth_storage_errors::db::DatabaseError; use std::time::{Duration, Instant}; -use tracing::debug_span; +use tracing::trace_span; #[cfg(feature = "metrics")] use crate::TrieType; @@ -108,7 +108,7 @@ impl TrieCursorMetricsCache { /// Record the span for metrics. pub fn record_span(&self, name: &'static str) { - let _span = debug_span!( + let _span = trace_span!( target: "trie::trie_cursor", "Trie cursor metrics", name,