Skip to main content

solana_ledger/
block_error.rs

1use thiserror::Error;
2
3#[derive(Error, Debug, PartialEq, Eq)]
4pub enum BlockError {
5    /// Block did not have enough ticks was not marked full
6    /// and no shred with is_last was seen.
7    #[error("incomplete block")]
8    Incomplete,
9
10    /// Block entries hashes must all be valid
11    #[error("invalid entry hash")]
12    InvalidEntryHash,
13
14    /// Blocks must end in a tick that has been marked as the last tick.
15    #[error("invalid last tick")]
16    InvalidLastTick,
17
18    /// Blocks can not have missing ticks
19    /// Usually indicates that the node was interrupted with a more valuable block during
20    /// production and abandoned it for that more-favorable block. Leader sent data to indicate
21    /// the end of the block.
22    #[error("too few ticks")]
23    TooFewTicks,
24
25    /// Blocks can not have extra ticks
26    #[error("too many ticks")]
27    TooManyTicks,
28
29    /// All ticks must contain the same number of hashes within a block
30    #[error("invalid tick hash count")]
31    InvalidTickHashCount,
32
33    /// Blocks must end in a tick entry, trailing transaction entries are not allowed to guarantee
34    /// that each block has the same number of hashes
35    #[error("trailing entry")]
36    TrailingEntry,
37
38    #[error("duplicate block")]
39    DuplicateBlock,
40}