fix: skip block tracing if empty (#7251)

This commit is contained in:
Matthias Seitz
2024-03-20 16:58:00 +01:00
committed by GitHub
parent 0a803c49a9
commit 6b28fa4300
2 changed files with 10 additions and 0 deletions

View File

@ -79,6 +79,11 @@ where
block_env: BlockEnv,
opts: GethDebugTracingOptions,
) -> EthResult<Vec<TraceResult>> {
if transactions.is_empty() {
// nothing to trace
return Ok(Vec::new());
}
// replay all transactions of the block
let this = self.clone();
self.inner

View File

@ -1058,6 +1058,11 @@ where
let Some(block) = block else { return Ok(None) };
if block.body.is_empty() {
// nothing to trace
return Ok(Some(Vec::new()));
}
// replay all transactions of the block
self.spawn_tracing_task_with(move |this| {
// we need to get the state of the parent block because we're replaying this block on