diff --git a/crates/executor/src/executor.rs b/crates/executor/src/executor.rs index 7b682b65f4..01a291b3d9 100644 --- a/crates/executor/src/executor.rs +++ b/crates/executor/src/executor.rs @@ -376,12 +376,13 @@ where // Fill revm structure. fill_tx_env(&mut self.evm.env.tx, transaction, sender); - let out = if self.stack.should_inspect(&self.evm.env, transaction.hash()) { + let hash = transaction.hash(); + let out = if self.stack.should_inspect(&self.evm.env, hash) { // execution with inspector. let output = self.evm.inspect(&mut self.stack); tracing::trace!( target: "evm", - hash = ?transaction.hash(), ?output, ?transaction, env = ?self.evm.env, + ?hash, ?output, ?transaction, env = ?self.evm.env, "Executed transaction" ); output @@ -389,7 +390,7 @@ where // main execution. self.evm.transact() }; - out.map_err(|e| Error::EVM(format!("{e:?}"))) + out.map_err(|e| Error::EVM { hash, message: format!("{e:?}") }) } /// Runs the provided transactions and commits their state. Will proceed diff --git a/crates/interfaces/src/executor.rs b/crates/interfaces/src/executor.rs index 0165708da3..ad5f4e000b 100644 --- a/crates/interfaces/src/executor.rs +++ b/crates/interfaces/src/executor.rs @@ -5,8 +5,8 @@ use thiserror::Error; #[allow(missing_docs)] #[derive(Error, Debug, Clone, PartialEq, Eq)] pub enum Error { - #[error("EVM reported invalid transaction:{0}")] - EVM(String), + #[error("EVM reported invalid transaction ({hash:?}): {message}")] + EVM { hash: H256, message: String }, #[error("Example of error.")] VerificationFailed, #[error("Fatal internal error")]