1use alloc::string::String;
4use kona_mpt::TrieNodeError;
5use revm::primitives::EVMError;
6use thiserror::Error;
7
8#[derive(Error, Debug)]
12pub enum ExecutorError {
13 #[error("Gas limit not provided in payload attributes")]
15 MissingGasLimit,
16 #[error("Transactions not provided in payload attributes")]
18 MissingTransactions,
19 #[error("Missing EIP-1559 parameters in execution payload post-Holocene")]
21 MissingEIP1559Params,
22 #[error("Parent beacon block root not provided in payload attributes")]
24 MissingParentBeaconBlockRoot,
25 #[error("Invalid `extraData` field in the block header")]
27 InvalidExtraData,
28 #[error("Block gas limit exceeded")]
30 BlockGasLimitExceeded,
31 #[error("Unsupported transaction type: {0}")]
33 UnsupportedTransactionType(u8),
34 #[error("Trie error: {0}")]
36 TrieDBError(#[from] TrieDBError),
37 #[error("Execution error: {0}")]
39 ExecutionError(EVMError<TrieDBError>),
40 #[error("Signature error: {0}")]
42 SignatureError(alloy_primitives::SignatureError),
43 #[error("RLP error: {0}")]
45 RLPError(alloy_eips::eip2718::Eip2718Error),
46 #[error("Missing the executor")]
48 MissingExecutor,
49}
50
51pub type ExecutorResult<T> = Result<T, ExecutorError>;
53
54pub type TrieDBResult<T> = Result<T, TrieDBError>;
56
57#[derive(Error, Debug, PartialEq, Eq)]
61pub enum TrieDBError {
62 #[error("Trie root node has not been blinded")]
64 RootNotBlinded,
65 #[error("Missing account info for bundle account.")]
67 MissingAccountInfo,
68 #[error("Trie node error: {0}")]
70 TrieNode(#[from] TrieNodeError),
71 #[error("Trie provider error: {0}")]
73 Provider(String),
74}