-
Notifications
You must be signed in to change notification settings - Fork 201
Expand file tree
/
Copy patherrors.rs
More file actions
38 lines (37 loc) · 1.84 KB
/
errors.rs
File metadata and controls
38 lines (37 loc) · 1.84 KB
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
use crate::types::{InvalidBlockBodyError, InvalidBlockHeaderError};
/// Errors that occur during block validation.
///
/// These are validation errors that don't require storage access to detect.
#[derive(Debug, thiserror::Error)]
pub enum InvalidBlockError {
#[error("Requests hash does not match the one in the header after executing")]
RequestsHashMismatch,
#[error("Block access list hash does not match the one in the header after executing")]
BlockAccessListHashMismatch,
#[error("Block access list contains index {index} exceeding max valid index {max}")]
BlockAccessListIndexOutOfBounds { index: u32, max: u32 },
#[error("Block access list exceeds gas limit, {items} items exceeds limit of {max_items}")]
BlockAccessListSizeExceeded { items: u64, max_items: u64 },
#[error("World State Root does not match the one in the header after executing")]
StateRootMismatch,
#[error("Receipts Root does not match the one in the header after executing")]
ReceiptsRootMismatch,
#[error("Invalid Header, validation failed pre-execution: {0}")]
InvalidHeader(#[from] InvalidBlockHeaderError),
#[error("Invalid Body, validation failed pre-execution: {0}")]
InvalidBody(#[from] InvalidBlockBodyError),
#[error("Exceeded MAX_BLOB_GAS_PER_BLOCK")]
ExceededMaxBlobGasPerBlock,
#[error("Exceeded MAX_BLOB_NUMBER_PER_BLOCK")]
ExceededMaxBlobNumberPerBlock,
#[error("Gas used doesn't match value in header. Used: {0}, Expected: {1}")]
GasUsedMismatch(u64, u64),
#[error("Blob gas used doesn't match value in header")]
BlobGasUsedMismatch,
#[error("Invalid transaction: {0}")]
InvalidTransaction(String),
#[error("Maximum block size exceeded: Maximum is {0} MiB, but block was {1} MiB")]
MaximumRlpSizeExceeded(u64, u64),
#[error("Invalid block fork")]
InvalidBlockFork,
}