reth_optimism_evm/
error.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//! Error types for the Optimism EVM module.

use alloc::string::String;
use reth_evm::execute::BlockExecutionError;

/// Optimism Block Executor Errors
#[derive(Debug, Clone, PartialEq, Eq, derive_more::Display)]
pub enum OptimismBlockExecutionError {
    /// Error when trying to parse L1 block info
    #[display("could not get L1 block info from L2 block: {message}")]
    L1BlockInfoError {
        /// The inner error message
        message: String,
    },
    /// Thrown when force deploy of create2deployer code fails.
    #[display("failed to force create2deployer account code")]
    ForceCreate2DeployerFail,
    /// Thrown when a blob transaction is included in a sequencer's block.
    #[display("blob transaction included in sequencer block")]
    BlobTransactionRejected,
    /// Thrown when a database account could not be loaded.
    #[display("failed to load account {_0}")]
    AccountLoadFailed(alloy_primitives::Address),
}

impl core::error::Error for OptimismBlockExecutionError {}

impl From<OptimismBlockExecutionError> for BlockExecutionError {
    fn from(err: OptimismBlockExecutionError) -> Self {
        Self::other(err)
    }
}