pub enum ConsensusError {
Show 43 variants
HeaderGasUsedExceedsGasLimit {
gas_used: u64,
gas_limit: u64,
},
BlockGasUsed {
gas: GotExpected<u64>,
gas_spent_by_tx: Vec<(u64, u64)>,
},
BodyOmmersHashDiff(GotExpectedBoxed<B256>),
BodyStateRootDiff(GotExpectedBoxed<B256>),
BodyTransactionRootDiff(GotExpectedBoxed<B256>),
BodyReceiptRootDiff(GotExpectedBoxed<B256>),
BodyBloomLogDiff(GotExpectedBoxed<Bloom>),
BodyWithdrawalsRootDiff(GotExpectedBoxed<B256>),
BodyRequestsHashDiff(GotExpectedBoxed<B256>),
BlockKnown {
hash: BlockHash,
number: BlockNumber,
},
ParentUnknown {
hash: BlockHash,
},
ParentBlockNumberMismatch {
parent_block_number: BlockNumber,
block_number: BlockNumber,
},
ParentHashMismatch(GotExpectedBoxed<B256>),
TimestampIsInFuture {
timestamp: u64,
present_timestamp: u64,
},
BaseFeeMissing,
TransactionSignerRecoveryError,
ExtraDataExceedsMax {
len: usize,
},
TheMergeDifficultyIsNotZero,
TheMergeNonceIsNotZero,
TheMergeOmmerRootIsNotEmpty,
WithdrawalsRootMissing,
RequestsHashMissing,
WithdrawalsRootUnexpected,
RequestsHashUnexpected,
BodyWithdrawalsMissing,
BodyRequestsMissing,
BlobGasUsedMissing,
BlobGasUsedUnexpected,
ExcessBlobGasMissing,
ExcessBlobGasUnexpected,
ParentBeaconBlockRootMissing,
ParentBeaconBlockRootUnexpected,
BlobGasUsedExceedsMaxBlobGasPerBlock {
blob_gas_used: u64,
max_blob_gas_per_block: u64,
},
BlobGasUsedNotMultipleOfBlobGasPerBlob {
blob_gas_used: u64,
blob_gas_per_blob: u64,
},
ExcessBlobGasNotMultipleOfBlobGasPerBlob {
excess_blob_gas: u64,
blob_gas_per_blob: u64,
},
BlobGasUsedDiff(GotExpected<u64>),
InvalidTransaction(InvalidTransactionError),
BaseFeeDiff(GotExpected<u64>),
ExcessBlobGasDiff {
diff: GotExpected<u64>,
parent_excess_blob_gas: u64,
parent_blob_gas_used: u64,
},
GasLimitInvalidIncrease {
parent_gas_limit: u64,
child_gas_limit: u64,
},
GasLimitInvalidMinimum {
child_gas_limit: u64,
},
GasLimitInvalidDecrease {
parent_gas_limit: u64,
child_gas_limit: u64,
},
TimestampIsInPast {
parent_timestamp: u64,
timestamp: u64,
},
}
Expand description
Consensus Errors
Variants§
HeaderGasUsedExceedsGasLimit
Error when the gas used in the header exceeds the gas limit.
Fields
BlockGasUsed
Error when block gas used doesn’t match expected value
Fields
BodyOmmersHashDiff(GotExpectedBoxed<B256>)
Error when the hash of block ommer is different from the expected hash.
BodyStateRootDiff(GotExpectedBoxed<B256>)
Error when the state root in the block is different from the expected state root.
BodyTransactionRootDiff(GotExpectedBoxed<B256>)
Error when the transaction root in the block is different from the expected transaction root.
BodyReceiptRootDiff(GotExpectedBoxed<B256>)
Error when the receipt root in the block is different from the expected receipt root.
BodyBloomLogDiff(GotExpectedBoxed<Bloom>)
Error when header bloom filter is different from the expected bloom filter.
BodyWithdrawalsRootDiff(GotExpectedBoxed<B256>)
Error when the withdrawals root in the block is different from the expected withdrawals root.
BodyRequestsHashDiff(GotExpectedBoxed<B256>)
Error when the requests hash in the block is different from the expected requests hash.
BlockKnown
Error when a block with a specific hash and number is already known.
Fields
hash: BlockHash
The hash of the known block.
number: BlockNumber
The block number of the known block.
ParentUnknown
Error when the parent hash of a block is not known.
Fields
hash: BlockHash
The hash of the unknown parent block.
ParentBlockNumberMismatch
Error when the block number does not match the parent block number.
Fields
parent_block_number: BlockNumber
The parent block number.
block_number: BlockNumber
The block number.
ParentHashMismatch(GotExpectedBoxed<B256>)
Error when the parent hash does not match the expected parent hash.
TimestampIsInFuture
Error when the block timestamp is in the future compared to our clock time.
BaseFeeMissing
Error when the base fee is missing.
TransactionSignerRecoveryError
Error when there is a transaction signer recovery error.
ExtraDataExceedsMax
Error when the extra data length exceeds the maximum allowed.
TheMergeDifficultyIsNotZero
Error when the difficulty after a merge is not zero.
TheMergeNonceIsNotZero
Error when the nonce after a merge is not zero.
TheMergeOmmerRootIsNotEmpty
Error when the ommer root after a merge is not empty.
WithdrawalsRootMissing
Error when the withdrawals root is missing.
RequestsHashMissing
Error when the requests hash is missing.
WithdrawalsRootUnexpected
Error when an unexpected withdrawals root is encountered.
RequestsHashUnexpected
Error when an unexpected requests hash is encountered.
BodyWithdrawalsMissing
Error when withdrawals are missing.
BodyRequestsMissing
Error when requests are missing.
BlobGasUsedMissing
Error when blob gas used is missing.
BlobGasUsedUnexpected
Error when unexpected blob gas used is encountered.
ExcessBlobGasMissing
Error when excess blob gas is missing.
ExcessBlobGasUnexpected
Error when unexpected excess blob gas is encountered.
ParentBeaconBlockRootMissing
Error when the parent beacon block root is missing.
ParentBeaconBlockRootUnexpected
Error when an unexpected parent beacon block root is encountered.
BlobGasUsedExceedsMaxBlobGasPerBlock
Error when blob gas used exceeds the maximum allowed.
Fields
BlobGasUsedNotMultipleOfBlobGasPerBlob
Error when blob gas used is not a multiple of blob gas per blob.
ExcessBlobGasNotMultipleOfBlobGasPerBlob
Error when excess blob gas is not a multiple of blob gas per blob.
Fields
BlobGasUsedDiff(GotExpected<u64>)
Error when the blob gas used in the header does not match the expected blob gas used.
InvalidTransaction(InvalidTransactionError)
Error for a transaction that violates consensus.
BaseFeeDiff(GotExpected<u64>)
Error when the block’s base fee is different from the expected base fee.
ExcessBlobGasDiff
Error when there is an invalid excess blob gas.
Fields
GasLimitInvalidIncrease
Error when the child gas limit exceeds the maximum allowed increase.
GasLimitInvalidMinimum
Error indicating that the child gas limit is below the minimum allowed limit.
This error occurs when the child gas limit is less than the specified minimum gas limit.
GasLimitInvalidDecrease
Error when the child gas limit exceeds the maximum allowed decrease.
TimestampIsInPast
Error when the block timestamp is in the past compared to the parent timestamp.
Implementations§
Source§impl ConsensusError
impl ConsensusError
Sourcepub const fn is_state_root_error(&self) -> bool
pub const fn is_state_root_error(&self) -> bool
Returns true
if the error is a state root error.
Trait Implementations§
Source§impl Clone for ConsensusError
impl Clone for ConsensusError
Source§fn clone(&self) -> ConsensusError
fn clone(&self) -> ConsensusError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ConsensusError
impl Debug for ConsensusError
Source§impl Display for ConsensusError
impl Display for ConsensusError
Source§impl Error for ConsensusError
impl Error for ConsensusError
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<InvalidTransactionError> for ConsensusError
impl From<InvalidTransactionError> for ConsensusError
Source§impl PartialEq for ConsensusError
impl PartialEq for ConsensusError
impl Eq for ConsensusError
impl StructuralPartialEq for ConsensusError
Auto Trait Implementations§
impl Freeze for ConsensusError
impl RefUnwindSafe for ConsensusError
impl Send for ConsensusError
impl Sync for ConsensusError
impl Unpin for ConsensusError
impl UnwindSafe for ConsensusError
Blanket Implementations§
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Conv for T
impl<T> Conv for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.§impl<T> TryConv for T
impl<T> TryConv for T
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 48 bytes
Size for each variant:
HeaderGasUsedExceedsGasLimit
: 23 bytesBlockGasUsed
: 47 bytesBodyOmmersHashDiff
: 15 bytesBodyStateRootDiff
: 15 bytesBodyTransactionRootDiff
: 15 bytesBodyReceiptRootDiff
: 15 bytesBodyBloomLogDiff
: 15 bytesBodyWithdrawalsRootDiff
: 15 bytesBodyRequestsHashDiff
: 15 bytesBlockKnown
: 47 bytesParentUnknown
: 32 bytesParentBlockNumberMismatch
: 23 bytesParentHashMismatch
: 15 bytesTimestampIsInFuture
: 23 bytesBaseFeeMissing
: 0 bytesTransactionSignerRecoveryError
: 0 bytesExtraDataExceedsMax
: 15 bytesTheMergeDifficultyIsNotZero
: 0 bytesTheMergeNonceIsNotZero
: 0 bytesTheMergeOmmerRootIsNotEmpty
: 0 bytesWithdrawalsRootMissing
: 0 bytesRequestsHashMissing
: 0 bytesWithdrawalsRootUnexpected
: 0 bytesRequestsHashUnexpected
: 0 bytesBodyWithdrawalsMissing
: 0 bytesBodyRequestsMissing
: 0 bytesBlobGasUsedMissing
: 0 bytesBlobGasUsedUnexpected
: 0 bytesExcessBlobGasMissing
: 0 bytesExcessBlobGasUnexpected
: 0 bytesParentBeaconBlockRootMissing
: 0 bytesParentBeaconBlockRootUnexpected
: 0 bytesBlobGasUsedExceedsMaxBlobGasPerBlock
: 23 bytesBlobGasUsedNotMultipleOfBlobGasPerBlob
: 23 bytesExcessBlobGasNotMultipleOfBlobGasPerBlob
: 23 bytesBlobGasUsedDiff
: 23 bytesInvalidTransaction
: 31 bytesBaseFeeDiff
: 23 bytesExcessBlobGasDiff
: 39 bytesGasLimitInvalidIncrease
: 23 bytesGasLimitInvalidMinimum
: 15 bytesGasLimitInvalidDecrease
: 23 bytesTimestampIsInPast
: 23 bytes