reth_optimism_consensus/
error.rs

1//! Optimism consensus errors
2
3use alloy_primitives::B256;
4use reth_consensus::ConsensusError;
5use reth_storage_errors::provider::ProviderError;
6
7/// Optimism consensus error.
8#[derive(Debug, Clone, thiserror::Error)]
9pub enum OpConsensusError {
10    /// Block body has non-empty withdrawals list (l1 withdrawals).
11    #[error("non-empty block body withdrawals list")]
12    WithdrawalsNonEmpty,
13    /// Failed to compute L2 withdrawals storage root.
14    #[error("compute L2 withdrawals root failed: {_0}")]
15    L2WithdrawalsRootCalculationFail(#[from] ProviderError),
16    /// L2 withdrawals root missing in block header.
17    #[error("L2 withdrawals root missing from block header")]
18    L2WithdrawalsRootMissing,
19    /// L2 withdrawals root in block header, doesn't match local storage root of predeploy.
20    #[error("L2 withdrawals root mismatch, header: {header}, exec_res: {exec_res}")]
21    L2WithdrawalsRootMismatch {
22        /// Storage root of pre-deploy in block.
23        header: B256,
24        /// Storage root of pre-deploy loaded from local state.
25        exec_res: B256,
26    },
27    /// L1 [`ConsensusError`], that also occurs on L2.
28    #[error(transparent)]
29    Eth(#[from] ConsensusError),
30}