Skip to content

Commit

Permalink
feat: add basic engine2 exec and root perf logs (#10188)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rjected authored Aug 7, 2024
1 parent d62ce79 commit 0bf35ab
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions crates/engine/tree/src/tree/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1706,14 +1706,19 @@ where
let block_hash = block.hash();
let sealed_block = Arc::new(block.block.clone());
let block = block.unseal();

let exec_time = Instant::now();
let output = executor.execute((&block, U256::MAX).into())?;
debug!(target: "engine", elapsed=?exec_time.elapsed(), ?block_number, "Executed block");

self.consensus.validate_block_post_execution(
&block,
PostExecutionInput::new(&output.receipts, &output.requests),
)?;

let hashed_state = HashedPostState::from_bundle_state(&output.state.state);

let root_time = Instant::now();
let (state_root, trie_output) =
state_provider.hashed_state_root_with_updates(hashed_state.clone())?;
if state_root != block.state_root {
Expand All @@ -1723,6 +1728,8 @@ where
.into())
}

debug!(target: "engine", elapsed=?root_time.elapsed(), ?block_number, "Calculated state root");

let executed = ExecutedBlock {
block: sealed_block.clone(),
senders: Arc::new(block.senders),
Expand Down

0 comments on commit 0bf35ab

Please sign in to comment.