Skip to content

Commit

Permalink
chore: remove backtrace log
Browse files Browse the repository at this point in the history
  • Loading branch information
Rjected committed Jan 31, 2025
1 parent c354c57 commit 942900f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
13 changes: 9 additions & 4 deletions crates/engine/tree/src/tree/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1763,15 +1763,15 @@ where
/// Returns an error if we failed to fetch the state from the database.
fn state_provider(&self, hash: B256) -> ProviderResult<Option<StateProviderBox>> {
if let Some((historical, blocks)) = self.state.tree_state.blocks_by_hash(hash) {
debug!(target: "engine::tree", %hash, %historical, "found canonical state for block in memory");
debug!(target: "engine::tree", ?hash, ?historical, "found canonical state for block in memory");
// the block leads back to the canonical chain
let historical = self.provider.state_by_block_hash(historical)?;
return Ok(Some(Box::new(MemoryOverlayStateProvider::new(historical, blocks))))
}

// the hash could belong to an unknown block or a persisted block
if let Some(header) = self.provider.header(&hash)? {
debug!(target: "engine::tree", %hash, number = %header.number(), "found canonical state for block in database");
debug!(target: "engine::tree", ?hash, number = ?header.number(), "found canonical state for block in database");
// the block is known and persisted
let historical = self.provider.state_by_block_hash(hash)?;
return Ok(Some(historical))
Expand Down Expand Up @@ -2425,6 +2425,7 @@ where
);

info!(target: "engine::tree", "Spawning prewarm threads");
let prewarm_start = Instant::now();

// Prewarm transactions
for (tx_idx, (tx, sender)) in
Expand All @@ -2447,8 +2448,9 @@ where
}

drop(state_root_sender);
let elapsed = prewarm_start.elapsed();

info!(target: "engine::tree", "Done spawning prewarm threads");
info!(target: "engine::tree", ?elapsed, "Done spawning prewarm threads");
trace!(target: "engine::tree", block=?block_num_hash, "Executing block");

let executor = self.executor_provider.executor(StateProviderDatabase::new(&state_provider));
Expand Down Expand Up @@ -2622,7 +2624,7 @@ where
Ok(input)
}

/// Runs execution for a single transaction, spawning it in th eprewarm threadpool.
/// Runs execution for a single transaction, spawning it in the prewarm threadpool.
#[allow(clippy::too_many_arguments)]
fn prewarm_transaction(
&self,
Expand All @@ -2634,10 +2636,13 @@ where
state_root_sender: Option<Sender<StateRootMessage>>,
execution_finished: Arc<AtomicBool>,
) -> Result<(), InsertBlockErrorKind> {
let provider_latency = Instant::now();
let Some(state_provider) = self.state_provider(block.parent_hash())? else {
error!(target: "engine::tree", parent=?block.parent_hash(), "Could not get state provider for prewarm");
return Ok(())
};
let provider_latency = provider_latency.elapsed();
info!(target: "engine::tree", ?provider_latency, "Got state provider for prewarm");

// Use the caches to create a new executor
let state_provider =
Expand Down
1 change: 1 addition & 0 deletions crates/storage/libmdbx-rs/src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,7 @@ impl TransactionPtr {
if let Some(lock) = self.lock.try_lock() {
lock
} else {
#[cfg(debug_assertions)]
tracing::debug!(
target: "libmdbx",
txn = %self.txn as usize,
Expand Down

0 comments on commit 942900f

Please sign in to comment.