pub enum Error {
Show 57 variants
BlockKnown(BlockKnownError),
TooManyProcessingBlocks,
Orphan,
ChunkMissing(ChunkHash),
ChunksMissing(Vec<ShardChunkHeader>),
InvalidBlockPastTime(DateTime<Utc>, DateTime<Utc>),
InvalidBlockFutureTime(DateTime<Utc>),
InvalidBlockHeight(BlockHeight),
InvalidBlockProposer,
InvalidStateRoot,
InvalidTxRoot,
InvalidChunkReceiptsRoot,
InvalidChunkHeadersRoot,
InvalidChunkTxRoot,
InvalidReceiptsProof,
InvalidOutcomesProof,
InvalidStatePayload,
InvalidTransactions,
InvalidChallengeRoot,
InvalidChallenge,
MaliciousChallenge,
IncorrectNumberOfChunkHeaders,
InvalidChunk,
InvalidChunkProofs(Box<ChunkProofs>),
InvalidChunkState(Box<ChunkState>),
InvalidChunkStateWitness(String),
InvalidChunkMask,
InvalidChunkHeight,
InvalidEpochHash,
InvalidNextBPHash,
InvalidProtocolVersion,
NotEnoughApprovals,
InvalidFinalityInfo,
InvalidValidatorProposals,
InvalidSignature,
InvalidApprovals,
InvalidGasLimit,
InvalidGasPrice,
InvalidGasUsed,
InvalidBalanceBurnt,
InvalidShardId(ShardId),
InvalidStateRequest(String),
InvalidRandomnessBeaconOutput,
InvalidBlockMerkleRoot,
InvalidSplitShardsIds(u64, u64),
NotAValidator,
NotAChunkValidator,
ValidatorError(String),
BlockOutOfBounds(CryptoHash),
EpochOutOfBounds(EpochId),
ChallengedBlockOnChain,
CannotBeFinalized,
IOErr(Error),
DBNotFoundErr(String),
StorageError(StorageError),
GCError(String),
Other(String),
}
Variants§
BlockKnown(BlockKnownError)
The block is already known
TooManyProcessingBlocks
Orphan
Orphan block.
ChunkMissing(ChunkHash)
Chunk is missing.
ChunksMissing(Vec<ShardChunkHeader>)
Chunks missing with header info.
InvalidBlockPastTime(DateTime<Utc>, DateTime<Utc>)
Block time is before parent block time.
InvalidBlockFutureTime(DateTime<Utc>)
Block time is from too much in the future.
InvalidBlockHeight(BlockHeight)
Block height is invalid (not previous + 1).
InvalidBlockProposer
Invalid block proposed signature.
InvalidStateRoot
Invalid state root hash.
InvalidTxRoot
Invalid block tx root hash.
InvalidChunkReceiptsRoot
Invalid chunk receipts root hash.
InvalidChunkHeadersRoot
Invalid chunk headers root hash.
InvalidChunkTxRoot
Invalid chunk tx root hash.
InvalidReceiptsProof
Invalid receipts proof.
InvalidOutcomesProof
Invalid outcomes proof.
InvalidStatePayload
Invalid state payload on state sync.
InvalidTransactions
Invalid transactions in the block.
InvalidChallengeRoot
Invalid Challenge Root (doesn’t match actual challenge)
InvalidChallenge
Invalid challenge (wrong signature or format).
MaliciousChallenge
Incorrect (malicious) challenge (slash the sender).
IncorrectNumberOfChunkHeaders
Incorrect number of chunk headers
InvalidChunk
Invalid chunk.
InvalidChunkProofs(Box<ChunkProofs>)
One of the chunks has invalid proofs
InvalidChunkState(Box<ChunkState>)
Invalid chunk state.
InvalidChunkStateWitness(String)
InvalidChunkMask
Invalid chunk mask
InvalidChunkHeight
The chunk height is outside of the horizon
InvalidEpochHash
Invalid epoch hash
InvalidNextBPHash
next_bps_hash
doens’t correspond to the actual next block producers set
InvalidProtocolVersion
The block has a protocol version that’s outdated
NotEnoughApprovals
The block doesn’t have approvals from 50% of the block producers
InvalidFinalityInfo
The information about the last final block is incorrect
InvalidValidatorProposals
Invalid validator proposals in the block.
InvalidSignature
Invalid Signature
InvalidApprovals
Invalid Approvals
InvalidGasLimit
Invalid Gas Limit
InvalidGasPrice
Invalid Gas Price
InvalidGasUsed
Invalid Gas Used
InvalidBalanceBurnt
Invalid Balance Burnt
InvalidShardId(ShardId)
Invalid shard id
InvalidStateRequest(String)
Invalid shard id
InvalidRandomnessBeaconOutput
Invalid VRF proof, or incorrect random_output in the header
InvalidBlockMerkleRoot
Invalid block merkle root.
InvalidSplitShardsIds(u64, u64)
Invalid split shard ids.
NotAValidator
Someone is not a validator. Usually happens in signature verification
NotAChunkValidator
Someone is not a chunk validator. Happens if we’re asked to validate a chunk we’re not supposed to validate, or to verify a chunk approval signed by a validator that isn’t supposed to validate the chunk.
ValidatorError(String)
Validator error.
BlockOutOfBounds(CryptoHash)
Block out of bounds. Usually if received block is too far in the future or alternative fork.
EpochOutOfBounds(EpochId)
Epoch out of bounds. Usually if received block is too far in the future or alternative fork.
ChallengedBlockOnChain
A challenged block is on the chain that was attempted to become the head
CannotBeFinalized
Block cannot be finalized.
IOErr(Error)
IO Error.
DBNotFoundErr(String)
Not found record in the DB.
StorageError(StorageError)
Storage error. Used for internal passing the error.
GCError(String)
GC error.
Other(String)
Anything else
Implementations§
Source§impl Error
impl Error
pub fn is_bad_data(&self) -> bool
pub fn is_error(&self) -> bool
Sourcepub fn prometheus_label_value(&self) -> &'static str
pub fn prometheus_label_value(&self) -> &'static str
Some blockchain errors are reported in the prometheus metrics. In such cases a report might
contain a label that specifies the type of error that has occured. For example when the node
receives a block with an invalid signature this would be reported as:
unc_num_invalid_blocks{error="invalid_signature"}
.
This function returns the value of the error label for a specific instance of Error.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<BlockError> for Error
impl From<BlockError> for Error
Source§fn from(error: BlockError) -> Self
fn from(error: BlockError) -> Self
Source§impl From<BlockKnownError> for Error
impl From<BlockKnownError> for Error
Source§fn from(source: BlockKnownError) -> Self
fn from(source: BlockKnownError) -> Self
Source§impl From<BlockValidityError> for Error
impl From<BlockValidityError> for Error
Source§fn from(error: BlockValidityError) -> Self
fn from(error: BlockValidityError) -> Self
Source§impl From<EpochError> for Error
impl From<EpochError> for Error
Source§fn from(error: EpochError) -> Self
fn from(error: EpochError) -> Self
Source§impl From<ShardLayoutError> for Error
impl From<ShardLayoutError> for Error
Source§fn from(error: ShardLayoutError) -> Self
fn from(error: ShardLayoutError) -> Self
Source§impl From<StorageError> for Error
impl From<StorageError> for Error
Source§fn from(source: StorageError) -> Self
fn from(source: StorageError) -> Self
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more