Skip to content

Commit

Permalink
fix: CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Wodann committed Jul 29, 2024
1 parent da8175a commit fa066f4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 56 deletions.
55 changes: 0 additions & 55 deletions crates/primitives/src/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,45 +223,6 @@ impl<DBError, TransactionValidationErrorT> From<InvalidHeader>
}
}

/// 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))]
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion crates/revm/src/optimism/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ impl OptimismTransaction for TxEnv {
}

fn is_system_transaction(&self) -> Option<bool> {
self.is_system_transaction.clone()
self.is_system_transaction
}

fn enveloped_tx(&self) -> Option<Bytes> {
Expand Down

0 comments on commit fa066f4

Please sign in to comment.