kona_protocol/batch/
errors.rs1#[derive(Debug, thiserror::Error, Clone, PartialEq, Eq)]
5pub enum SpanBatchError {
6 #[error("The span batch is too big.")]
8 TooBigSpanBatchSize,
9 #[error("The bit field is too long")]
11 BitfieldTooLong,
12 #[error("Empty span batch")]
14 EmptySpanBatch,
15 #[error("Missing L1 origin")]
17 MissingL1Origin,
18 #[error("Span batch decoding error: {0}")]
20 Decoding(#[from] SpanDecodingError),
21}
22
23#[derive(Debug, thiserror::Error, Clone, PartialEq, Eq)]
25pub enum BatchEncodingError {
26 #[error("Error encoding an Alloy RLP: {0}")]
28 AlloyRlpError(alloy_rlp::Error),
29 #[error("Error encoding a span batch: {0}")]
31 SpanBatchError(#[from] SpanBatchError),
32}
33
34#[derive(Debug, thiserror::Error, Clone, PartialEq, Eq)]
36pub enum BatchDecodingError {
37 #[error("Empty buffer")]
39 EmptyBuffer,
40 #[error("Error decoding an Alloy RLP: {0}")]
42 AlloyRlpError(alloy_rlp::Error),
43 #[error("Error decoding a span batch: {0}")]
45 SpanBatchError(#[from] SpanBatchError),
46}
47
48#[derive(Debug, thiserror::Error, Clone, PartialEq, Eq)]
50pub enum SpanDecodingError {
51 #[error("Failed to decode relative timestamp")]
53 RelativeTimestamp,
54 #[error("Failed to decode L1 origin number")]
56 L1OriginNumber,
57 #[error("Failed to decode parent check")]
59 ParentCheck,
60 #[error("Failed to decode L1 origin check")]
62 L1OriginCheck,
63 #[error("Failed to decode block count")]
65 BlockCount,
66 #[error("Failed to decode block tx counts")]
68 BlockTxCounts,
69 #[error("Failed to decode transaction nonces")]
71 TxNonces,
72 #[error("Mismatch in length between the transaction type and signature arrays")]
75 TypeSignatureLenMismatch,
76 #[error("Invalid transaction type")]
78 InvalidTransactionType,
79 #[error("Invalid transaction data")]
81 InvalidTransactionData,
82 #[error("Invalid transaction signature")]
84 InvalidTransactionSignature,
85}