diff --git a/crates/primitives/src/env.rs b/crates/primitives/src/env.rs index 13cb040888..37f12fbab4 100644 --- a/crates/primitives/src/env.rs +++ b/crates/primitives/src/env.rs @@ -355,11 +355,7 @@ impl Env { /// Validate transaction against state. #[inline] - pub fn validate_tx_against_state( - &self, - account: &Account, - #[cfg(feature = "optimism")] is_deposit: bool, - ) -> Result<(), InvalidTransaction> { + pub fn validate_tx_against_state(&self, account: &Account) -> Result<(), InvalidTransaction> { // EIP-3607: Reject transactions from senders with deployed code // This EIP is introduced after london but there was no collision in past // so we can leave it enabled always @@ -370,7 +366,7 @@ impl Env { // On Optimism, deposit transactions do not have verification on the nonce // nor the balance of the account. #[cfg(feature = "optimism")] - if self.cfg.optimism && is_deposit { + if self.cfg.optimism && self.tx.source_hash.is_some() { return Ok(()); } diff --git a/crates/revm/src/evm_impl.rs b/crates/revm/src/evm_impl.rs index cc03329ce5..45c1b05556 100644 --- a/crates/revm/src/evm_impl.rs +++ b/crates/revm/src/evm_impl.rs @@ -142,11 +142,7 @@ impl<'a, GSPEC: Spec, DB: Database, const INSPECT: bool> Transact .load_account(tx_caller, self.data.db) .map_err(EVMError::Database)?; - self.data.env.validate_tx_against_state( - caller_account, - #[cfg(feature = "optimism")] - is_deposit, - )?; + self.data.env.validate_tx_against_state(caller_account)?; Ok(()) }