Skip to content
Merged
Changes from all commits
Commits
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
19 changes: 15 additions & 4 deletions crates/engine/tree/src/tree/payload_processor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,13 @@ use reth_trie_sparse::{
ClearedSparseStateTrie, SparseStateTrie, SparseTrie,
};
use reth_trie_sparse_parallel::{ParallelSparseTrie, ParallelismThresholds};
use std::sync::{
atomic::AtomicBool,
mpsc::{self, channel, Sender},
Arc,
use std::{
sync::{
atomic::AtomicBool,
mpsc::{self, channel, Sender},
Arc,
},
time::Instant,
};
use tracing::{debug, debug_span, instrument, warn};

Expand Down Expand Up @@ -596,8 +599,16 @@ impl ExecutionCache {
/// A cache is considered available when:
/// - It exists and matches the requested parent hash
/// - No other tasks are currently using it (checked via Arc reference count)
#[instrument(level = "debug", target = "engine::tree::payload_processor", skip(self))]
pub(crate) fn get_cache_for(&self, parent_hash: B256) -> Option<SavedCache> {
let start = Instant::now();
let cache = self.inner.read();

let elapsed = start.elapsed();
if elapsed.as_millis() > 5 {
warn!(blocked_for=?elapsed, "Blocked waiting for execution cache mutex");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs a target, events don't inherit the span target afaik

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, maybe it's fine here, because it's going to be in stdout?

}

cache
.as_ref()
.filter(|c| c.executed_block_hash() == parent_hash && c.is_available())
Expand Down
Loading