diff --git a/crates/rpc/rpc/src/debug.rs b/crates/rpc/rpc/src/debug.rs index a8d4459350..15f0d8a1db 100644 --- a/crates/rpc/rpc/src/debug.rs +++ b/crates/rpc/rpc/src/debug.rs @@ -79,6 +79,11 @@ where block_env: BlockEnv, opts: GethDebugTracingOptions, ) -> EthResult> { + if transactions.is_empty() { + // nothing to trace + return Ok(Vec::new()); + } + // replay all transactions of the block let this = self.clone(); self.inner diff --git a/crates/rpc/rpc/src/eth/api/transactions.rs b/crates/rpc/rpc/src/eth/api/transactions.rs index f375f72bac..207de3017a 100644 --- a/crates/rpc/rpc/src/eth/api/transactions.rs +++ b/crates/rpc/rpc/src/eth/api/transactions.rs @@ -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