Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions crates/op-revm/src/transaction/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@ pub enum OpTransactionError {
/// 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 [OpHaltReason::FailedDeposit][crate::OpHaltReason::FailedDeposit] error
/// In addition, this error is internal, and bubbles up into an [OpHaltReason::FailedDeposit][crate::OpHaltReason::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 [OpHaltReason][crate::OpHaltReason] variant was introduced to handle this
/// case for failed deposit transactions.
DepositSystemTxPostRegolith,
/// Deposit transaction haults bubble up to the global main return handler, wiping state and
/// Deposit transaction halts 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 [OpHaltReason][crate::OpHaltReason] error
/// This is a catch-all error for any deposit transaction that results in an [OpHaltReason][crate::OpHaltReason] 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 [OpHaltReason::FailedDeposit][crate::OpHaltReason::FailedDeposit] error
/// In addition, this error is internal, and bubbles up into an [OpHaltReason::FailedDeposit][crate::OpHaltReason::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
Expand Down Expand Up @@ -86,6 +86,11 @@ mod test {

#[test]
fn test_display_op_errors() {
assert_eq!(
OpTransactionError::Base(InvalidTransaction::NonceTooHigh { tx: 2, state: 1 })
.to_string(),
"nonce 2 too high, expected 1"
);
assert_eq!(
OpTransactionError::DepositSystemTxPostRegolith.to_string(),
"deposit system transactions post regolith hardfork are not supported"
Expand Down
Loading