2022-02-28 22:07:48 +00:00
|
|
|
use types::{Checkpoint, Epoch, ExecutionBlockHash, Hash256};
|
2020-01-29 04:05:00 +00:00
|
|
|
|
|
|
|
#[derive(Clone, PartialEq, Debug)]
|
|
|
|
pub enum Error {
|
|
|
|
FinalizedNodeUnknown(Hash256),
|
|
|
|
JustifiedNodeUnknown(Hash256),
|
2022-02-28 22:07:48 +00:00
|
|
|
NodeUnknown(Hash256),
|
2020-01-29 04:05:00 +00:00
|
|
|
InvalidFinalizedRootChange,
|
|
|
|
InvalidNodeIndex(usize),
|
|
|
|
InvalidParentIndex(usize),
|
|
|
|
InvalidBestChildIndex(usize),
|
|
|
|
InvalidJustifiedIndex(usize),
|
|
|
|
InvalidBestDescendant(usize),
|
|
|
|
InvalidParentDelta(usize),
|
|
|
|
InvalidNodeDelta(usize),
|
|
|
|
DeltaOverflow(usize),
|
2021-12-13 20:43:22 +00:00
|
|
|
ProposerBoostOverflow(usize),
|
2020-01-29 04:05:00 +00:00
|
|
|
IndexOverflow(&'static str),
|
2022-02-28 22:07:48 +00:00
|
|
|
InvalidExecutionDeltaOverflow(usize),
|
2020-01-29 04:05:00 +00:00
|
|
|
InvalidDeltaLen {
|
|
|
|
deltas: usize,
|
|
|
|
indices: usize,
|
|
|
|
},
|
|
|
|
RevertedFinalizedEpoch {
|
|
|
|
current_finalized_epoch: Epoch,
|
|
|
|
new_finalized_epoch: Epoch,
|
|
|
|
},
|
2021-12-13 20:43:22 +00:00
|
|
|
InvalidBestNode(Box<InvalidBestNodeInfo>),
|
2021-10-07 11:24:57 +00:00
|
|
|
InvalidAncestorOfValidPayload {
|
|
|
|
ancestor_block_root: Hash256,
|
2022-02-28 22:07:48 +00:00
|
|
|
ancestor_payload_block_hash: ExecutionBlockHash,
|
|
|
|
},
|
|
|
|
ValidExecutionStatusBecameInvalid {
|
|
|
|
block_root: Hash256,
|
|
|
|
payload_block_hash: ExecutionBlockHash,
|
|
|
|
},
|
|
|
|
InvalidJustifiedCheckpointExecutionStatus {
|
|
|
|
justified_root: Hash256,
|
|
|
|
},
|
|
|
|
UnknownLatestValidAncestorHash {
|
|
|
|
block_root: Hash256,
|
|
|
|
latest_valid_ancestor_hash: Option<ExecutionBlockHash>,
|
|
|
|
},
|
|
|
|
IrrelevantDescendant {
|
|
|
|
block_root: Hash256,
|
2021-10-07 11:24:57 +00:00
|
|
|
},
|
2022-04-05 20:58:16 +00:00
|
|
|
ParentExecutionStatusIsInvalid {
|
|
|
|
block_root: Hash256,
|
|
|
|
parent_root: Hash256,
|
|
|
|
},
|
2020-01-29 04:05:00 +00:00
|
|
|
}
|
2021-12-13 20:43:22 +00:00
|
|
|
|
|
|
|
#[derive(Clone, PartialEq, Debug)]
|
|
|
|
pub struct InvalidBestNodeInfo {
|
|
|
|
pub start_root: Hash256,
|
|
|
|
pub justified_checkpoint: Checkpoint,
|
|
|
|
pub finalized_checkpoint: Checkpoint,
|
|
|
|
pub head_root: Hash256,
|
|
|
|
pub head_justified_checkpoint: Option<Checkpoint>,
|
|
|
|
pub head_finalized_checkpoint: Option<Checkpoint>,
|
|
|
|
}
|