mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-18 21:38:31 +00:00
Implement tree states & hierarchical state DB
This commit is contained in:
@@ -1,16 +1,15 @@
|
||||
use crate::chunked_vector::ChunkError;
|
||||
use crate::config::StoreConfigError;
|
||||
use crate::hdiff;
|
||||
use crate::hot_cold_store::HotColdDBError;
|
||||
use ssz::DecodeError;
|
||||
use state_processing::BlockReplayError;
|
||||
use types::{BeaconStateError, Hash256, InconsistentFork, Slot};
|
||||
use types::{milhouse, BeaconStateError, Epoch, Hash256, InconsistentFork, Slot};
|
||||
|
||||
pub type Result<T> = std::result::Result<T, Error>;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum Error {
|
||||
SszDecodeError(DecodeError),
|
||||
VectorChunkError(ChunkError),
|
||||
BeaconStateError(BeaconStateError),
|
||||
PartialBeaconStateError,
|
||||
HotColdDBError(HotColdDBError),
|
||||
@@ -40,11 +39,38 @@ pub enum Error {
|
||||
expected: Hash256,
|
||||
computed: Hash256,
|
||||
},
|
||||
MissingStateRoot(Slot),
|
||||
MissingState(Hash256),
|
||||
MissingSnapshot(Epoch),
|
||||
MissingDiff(Epoch),
|
||||
NoBaseStateFound(Hash256),
|
||||
BlockReplayError(BlockReplayError),
|
||||
MilhouseError(milhouse::Error),
|
||||
Compression(std::io::Error),
|
||||
MissingPersistedBeaconChain,
|
||||
SlotIsBeforeSplit {
|
||||
slot: Slot,
|
||||
},
|
||||
FinalizedStateDecreasingSlot,
|
||||
FinalizedStateUnaligned,
|
||||
StateForCacheHasPendingUpdates {
|
||||
state_root: Hash256,
|
||||
slot: Slot,
|
||||
},
|
||||
AddPayloadLogicError,
|
||||
SlotClockUnavailableForMigration,
|
||||
MissingImmutableValidator(usize),
|
||||
MissingValidator(usize),
|
||||
V9MigrationFailure(Hash256),
|
||||
ValidatorPubkeyCacheError(String),
|
||||
DuplicateValidatorPublicKey,
|
||||
InvalidValidatorPubkeyBytes(bls::Error),
|
||||
ValidatorPubkeyCacheUninitialized,
|
||||
InvalidKey,
|
||||
UnableToDowngrade,
|
||||
Hdiff(hdiff::Error),
|
||||
InconsistentFork(InconsistentFork),
|
||||
ZeroCacheSize,
|
||||
}
|
||||
|
||||
pub trait HandleUnavailable<T> {
|
||||
@@ -67,12 +93,6 @@ impl From<DecodeError> for Error {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<ChunkError> for Error {
|
||||
fn from(e: ChunkError) -> Error {
|
||||
Error::VectorChunkError(e)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<HotColdDBError> for Error {
|
||||
fn from(e: HotColdDBError) -> Error {
|
||||
Error::HotColdDBError(e)
|
||||
@@ -97,6 +117,18 @@ impl From<StoreConfigError> for Error {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<milhouse::Error> for Error {
|
||||
fn from(e: milhouse::Error) -> Self {
|
||||
Self::MilhouseError(e)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<hdiff::Error> for Error {
|
||||
fn from(e: hdiff::Error) -> Self {
|
||||
Self::Hdiff(e)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<BlockReplayError> for Error {
|
||||
fn from(e: BlockReplayError) -> Error {
|
||||
Error::BlockReplayError(e)
|
||||
|
||||
Reference in New Issue
Block a user