diff --git a/crates/primitives/src/result.rs b/crates/primitives/src/result.rs index f3de017438..cf6e608c48 100644 --- a/crates/primitives/src/result.rs +++ b/crates/primitives/src/result.rs @@ -223,45 +223,6 @@ impl From } } -/// Transaction validation error for Optimism. -#[cfg(feature = "optimism")] -#[derive(Debug, Clone, PartialEq, Eq, Hash)] -#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] -pub enum OptimismInvalidTransaction { - /// System transactions are not supported post-regolith hardfork. - /// - /// Before the Regolith hardfork, there was a special field in the `Deposit` transaction - /// type that differentiated between `system` and `user` deposit transactions. This field - /// was deprecated in the Regolith hardfork, and this error is thrown if a `Deposit` transaction - /// is found with this field set to `true` after the hardfork activation. - /// - /// In addition, this error is internal, and bubbles up into a [HaltReason::FailedDeposit] error - /// in the `revm` handler for the consumer to easily handle. This is due to a state transition - /// rule on OP Stack chains where, if for any reason a deposit transaction fails, the transaction - /// must still be included in the block, the sender nonce is bumped, the `mint` value persists, and - /// special gas accounting rules are applied. Normally on L1, [EVMError::Transaction] errors - /// are cause for non-inclusion, so a special [HaltReason] variant was introduced to handle this - /// case for failed deposit transactions. - #[cfg(feature = "optimism")] - DepositSystemTxPostRegolith, - /// Deposit transaction haults bubble up to the global main return handler, wiping state and - /// only increasing the nonce + persisting the mint value. - /// - /// This is a catch-all error for any deposit transaction that is results in a [HaltReason] error - /// post-regolith hardfork. This allows for a consumer to easily handle special cases where - /// a deposit transaction fails during validation, but must still be included in the block. - /// - /// In addition, this error is internal, and bubbles up into a [HaltReason::FailedDeposit] error - /// in the `revm` handler for the consumer to easily handle. This is due to a state transition - /// rule on OP Stack chains where, if for any reason a deposit transaction fails, the transaction - /// must still be included in the block, the sender nonce is bumped, the `mint` value persists, and - /// special gas accounting rules are applied. Normally on L1, [EVMError::Transaction] errors - /// are cause for non-inclusion, so a special [HaltReason] variant was introduced to handle this - /// case for failed deposit transactions. - #[cfg(feature = "optimism")] - HaltedDepositPostRegolith, -} - /// Transaction validation error. #[derive(Debug, Clone, PartialEq, Eq, Hash)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] @@ -336,22 +297,6 @@ pub enum InvalidTransaction { #[cfg(feature = "std")] impl std::error::Error for InvalidTransaction {} -#[cfg(feature = "optimism")] -impl fmt::Display for OptimismInvalidTransaction { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - match self { - Self::DepositSystemTxPostRegolith => write!( - f, - "deposit system transactions post regolith hardfork are not supported" - ), - Self::HaltedDepositPostRegolith => write!( - f, - "deposit transaction halted post-regolith; error will be bubbled up to main return handler" - ), - } - } -} - impl fmt::Display for InvalidTransaction { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { diff --git a/crates/revm/src/optimism/env.rs b/crates/revm/src/optimism/env.rs index 7a155a2a11..32863938aa 100644 --- a/crates/revm/src/optimism/env.rs +++ b/crates/revm/src/optimism/env.rs @@ -102,7 +102,7 @@ impl OptimismTransaction for TxEnv { } fn is_system_transaction(&self) -> Option { - self.is_system_transaction.clone() + self.is_system_transaction } fn enveloped_tx(&self) -> Option {