1use alloc::string::String;
4use alloy_evm::block::BlockExecutionError;
5use kona_mpt::TrieNodeError;
6use revm::context::DBErrorMarker;
7use thiserror::Error;
8
9#[derive(Error, Debug)]
13pub enum ExecutorError {
14 #[error("Gas limit not provided in payload attributes")]
16 MissingGasLimit,
17 #[error("Transactions not provided in payload attributes")]
19 MissingTransactions,
20 #[error("Missing EIP-1559 parameters in execution payload post-Holocene")]
22 MissingEIP1559Params,
23 #[error("Parent beacon block root not provided in payload attributes")]
25 MissingParentBeaconBlockRoot,
26 #[error("Invalid `extraData` field in the block header")]
28 InvalidExtraData,
29 #[error("Block gas limit exceeded")]
31 BlockGasLimitExceeded,
32 #[error("Unsupported transaction type: {0}")]
34 UnsupportedTransactionType(u8),
35 #[error("Trie error: {0}")]
37 TrieDBError(#[from] TrieDBError),
38 #[error("Execution error: {0}")]
40 ExecutionError(#[from] BlockExecutionError),
41 #[error("sender recovery error: {0}")]
43 Recovery(#[from] alloy_consensus::crypto::RecoveryError),
44 #[error("RLP error: {0}")]
46 RLPError(alloy_eips::eip2718::Eip2718Error),
47 #[error("Missing the executor")]
49 MissingExecutor,
50}
51
52pub type ExecutorResult<T> = Result<T, ExecutorError>;
54
55pub type TrieDBResult<T> = Result<T, TrieDBError>;
57
58#[derive(Error, Debug, PartialEq, Eq)]
62pub enum TrieDBError {
63 #[error("Trie root node has not been blinded")]
65 RootNotBlinded,
66 #[error("Missing account info for bundle account.")]
68 MissingAccountInfo,
69 #[error("Trie node error: {0}")]
71 TrieNode(#[from] TrieNodeError),
72 #[error("Trie provider error: {0}")]
74 Provider(String),
75}
76
77impl DBErrorMarker for TrieDBError {}