From 1104ea7b4d2fda4963542630be784b6dac6e4cf3 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Thu, 1 Feb 2024 18:12:02 +0100 Subject: [PATCH] fix: use ecrevored transaction for tracing (#6327) --- crates/rpc/rpc/src/debug.rs | 2 +- crates/rpc/rpc/src/eth/api/transactions.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/rpc/rpc/src/debug.rs b/crates/rpc/rpc/src/debug.rs index f393ecf6f7..46f8efc24e 100644 --- a/crates/rpc/rpc/src/debug.rs +++ b/crates/rpc/rpc/src/debug.rs @@ -213,7 +213,7 @@ where // block the transaction is included in let state_at: BlockId = block.parent_hash.into(); let block_hash = block.hash; - let block_txs = block.body; + let block_txs = block.into_transactions_ecrecovered(); 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 ccab9dbd98..83ea5560e8 100644 --- a/crates/rpc/rpc/src/eth/api/transactions.rs +++ b/crates/rpc/rpc/src/eth/api/transactions.rs @@ -249,7 +249,7 @@ pub trait EthTransactions: Send + Sync { async fn transaction_and_block( &self, hash: B256, - ) -> EthResult>; + ) -> EthResult>; /// Retrieves the transaction if it exists and returns its trace. /// @@ -727,7 +727,7 @@ where async fn transaction_and_block( &self, hash: B256, - ) -> EthResult> { + ) -> EthResult> { let (transaction, at) = match self.transaction_by_hash_at(hash).await? { None => return Ok(None), Some(res) => res, @@ -738,7 +738,7 @@ where BlockId::Hash(hash) => hash.block_hash, _ => return Ok(None), }; - let block = self.cache().get_block(block_hash).await?; + let block = self.cache().get_block_with_senders(block_hash).await?; Ok(block.map(|block| (transaction, block.seal(block_hash)))) } @@ -765,7 +765,7 @@ where // we need to get the state of the parent block because we're essentially replaying the // block the transaction is included in let parent_block = block.parent_hash; - let block_txs = block.body; + let block_txs = block.into_transactions_ecrecovered(); self.spawn_with_state_at_block(parent_block.into(), move |state| { let mut db = CacheDB::new(StateProviderDatabase::new(state));