This repository has been archived by the owner on Nov 5, 2023. It is now read-only.
forked from paradigmxyz/reth
-
Notifications
You must be signed in to change notification settings - Fork 3
/
error.rs
48 lines (44 loc) · 1.81 KB
/
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//! Error types emitted by types or implementations of this crate.
use reth_primitives::H256;
use revm_primitives::EVMError;
use tokio::sync::oneshot;
#[cfg(feature = "optimism")]
use revm_primitives::B160;
/// Possible error variants during payload building.
#[derive(Debug, thiserror::Error)]
pub enum PayloadBuilderError {
/// Thrown whe the parent block is missing.
#[error("missing parent block {0:?}")]
MissingParentBlock(H256),
/// An oneshot channels has been closed.
#[error("sender has been dropped")]
ChannelClosed,
/// Other internal error
#[error(transparent)]
Internal(#[from] reth_interfaces::Error),
/// Unrecoverable error during evm execution.
#[error("evm execution error: {0:?}")]
EvmExecutionError(EVMError<reth_interfaces::Error>),
/// Thrown if the payload requests withdrawals before Shanghai activation.
#[error("withdrawals set before Shanghai activation")]
WithdrawalsBeforeShanghai,
/// Thrown when a transaction fails to convert to a
/// [reth_primitives::TransactionSignedEcRecovered].
#[cfg(feature = "optimism")]
#[error("failed to convert deposit transaction to TransactionSignedEcRecovered")]
TransactionEcRecoverFailed,
/// Thrown when the L1 block info could not be parsed from the calldata of the
/// first transaction supplied in the payload attributes.
#[cfg(feature = "optimism")]
#[error("failed to parse L1 block info from L1 info tx calldata")]
L1BlockInfoParseFailed,
/// Thrown when a database account could not be loaded.
#[error("failed to load account {0:?}")]
#[cfg(feature = "optimism")]
AccountLoadFailed(B160),
}
impl From<oneshot::error::RecvError> for PayloadBuilderError {
fn from(_: oneshot::error::RecvError) -> Self {
PayloadBuilderError::ChannelClosed
}
}