mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-02-19 03:04:27 -05:00
perf: reduce tracing span noise in prewarm and proof workers (#22101)
This commit is contained in:
@@ -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());
|
||||
|
||||
@@ -832,21 +832,18 @@ where
|
||||
|
||||
let tx = tx_result.map_err(BlockExecutionError::other)?;
|
||||
let tx_signer = *<Tx as alloy_evm::RecoveredTx<InnerTx>>::signer(&tx);
|
||||
let tx_hash = <Tx as alloy_evm::RecoveredTx<InnerTx>>::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);
|
||||
|
||||
|
||||
@@ -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::<usize>(),
|
||||
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::<usize>(),
|
||||
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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user