pub struct EthBeaconConsensus<ChainSpec> { /* private fields */ }Expand description
Ethereum beacon consensus
This consensus engine does basic checks as outlined in the execution specs.
Implementations§
Source§impl<ChainSpec: EthChainSpec + EthereumHardforks> EthBeaconConsensus<ChainSpec>
impl<ChainSpec: EthChainSpec + EthereumHardforks> EthBeaconConsensus<ChainSpec>
Sourcepub const fn new(chain_spec: Arc<ChainSpec>) -> Self
pub const fn new(chain_spec: Arc<ChainSpec>) -> Self
Create a new instance of EthBeaconConsensus
Sourcepub const fn max_extra_data_size(&self) -> usize
pub const fn max_extra_data_size(&self) -> usize
Returns the maximum allowed extra data size.
Sourcepub const fn with_max_extra_data_size(self, size: usize) -> Self
pub const fn with_max_extra_data_size(self, size: usize) -> Self
Sets the maximum allowed extra data size and returns the updated instance.
Sourcepub const fn with_skip_gas_limit_ramp_check(self, skip: bool) -> Self
pub const fn with_skip_gas_limit_ramp_check(self, skip: bool) -> Self
Disables the gas limit change validation between parent and child blocks.
Sourcepub const fn with_skip_blob_gas_used_check(self, skip: bool) -> Self
pub const fn with_skip_blob_gas_used_check(self, skip: bool) -> Self
Disables the blob gas used check in header validation.
Sourcepub const fn with_skip_requests_hash_check(self, skip: bool) -> Self
pub const fn with_skip_requests_hash_check(self, skip: bool) -> Self
Disables the requests hash check in post-execution validation.
Sourcepub const fn with_allow_bal_hashes(self, allow: bool) -> Self
pub const fn with_allow_bal_hashes(self, allow: bool) -> Self
Allows BAL hashes before Amsterdam activation.
Sourcepub const fn chain_spec(&self) -> &Arc<ChainSpec> ⓘ
pub const fn chain_spec(&self) -> &Arc<ChainSpec> ⓘ
Returns the chain spec associated with this consensus engine.
Trait Implementations§
Source§impl<ChainSpec: Clone> Clone for EthBeaconConsensus<ChainSpec>
impl<ChainSpec: Clone> Clone for EthBeaconConsensus<ChainSpec>
Source§impl<B, ChainSpec> Consensus<B> for EthBeaconConsensus<ChainSpec>where
B: Block,
ChainSpec: EthChainSpec<Header = B::Header> + EthereumHardforks,
impl<B, ChainSpec> Consensus<B> for EthBeaconConsensus<ChainSpec>where
B: Block,
ChainSpec: EthChainSpec<Header = B::Header> + EthereumHardforks,
Source§fn validate_body_against_header(
&self,
body: &B::Body,
header: &SealedHeader<B::Header>,
) -> Result<(), ConsensusError>
fn validate_body_against_header( &self, body: &B::Body, header: &SealedHeader<B::Header>, ) -> Result<(), ConsensusError>
Source§fn validate_block_pre_execution(
&self,
block: &SealedBlock<B>,
) -> Result<(), ConsensusError>
fn validate_block_pre_execution( &self, block: &SealedBlock<B>, ) -> Result<(), ConsensusError>
Source§fn validate_block_pre_execution_with_tx_root(
&self,
block: &SealedBlock<B>,
transaction_root: Option<TransactionRoot>,
) -> Result<(), ConsensusError>
fn validate_block_pre_execution_with_tx_root( &self, block: &SealedBlock<B>, transaction_root: Option<TransactionRoot>, ) -> Result<(), ConsensusError>
§fn is_transient_error(&self, _error: &ConsensusError) -> bool
fn is_transient_error(&self, _error: &ConsensusError) -> bool
true if the given consensus error is transient and may resolve on its own. Read moreSource§impl<ChainSpec: Debug> Debug for EthBeaconConsensus<ChainSpec>
impl<ChainSpec: Debug> Debug for EthBeaconConsensus<ChainSpec>
Source§impl<ChainSpec, N> FullConsensus<N> for EthBeaconConsensus<ChainSpec>where
ChainSpec: Send + EthChainSpec<Header = N::BlockHeader> + EthereumHardforks,
N: NodePrimitives,
impl<ChainSpec, N> FullConsensus<N> for EthBeaconConsensus<ChainSpec>where
ChainSpec: Send + EthChainSpec<Header = N::BlockHeader> + EthereumHardforks,
N: NodePrimitives,
Source§fn validate_block_post_execution(
&self,
block: &RecoveredBlock<N::Block>,
result: &BlockExecutionResult<N::Receipt>,
receipt_root_bloom: Option<ReceiptRootBloom>,
block_access_list_hash: Option<B256>,
) -> Result<(), ConsensusError>
fn validate_block_post_execution( &self, block: &RecoveredBlock<N::Block>, result: &BlockExecutionResult<N::Receipt>, receipt_root_bloom: Option<ReceiptRootBloom>, block_access_list_hash: Option<B256>, ) -> Result<(), ConsensusError>
Source§impl<H, ChainSpec> HeaderValidator<H> for EthBeaconConsensus<ChainSpec>where
H: BlockHeader,
ChainSpec: EthChainSpec<Header = H> + EthereumHardforks,
impl<H, ChainSpec> HeaderValidator<H> for EthBeaconConsensus<ChainSpec>where
H: BlockHeader,
ChainSpec: EthChainSpec<Header = H> + EthereumHardforks,
Source§fn validate_header(
&self,
header: &SealedHeader<H>,
) -> Result<(), ConsensusError>
fn validate_header( &self, header: &SealedHeader<H>, ) -> Result<(), ConsensusError>
Auto Trait Implementations§
impl<ChainSpec> Freeze for EthBeaconConsensus<ChainSpec>
impl<ChainSpec> RefUnwindSafe for EthBeaconConsensus<ChainSpec>where
Arc<ChainSpec>: RefUnwindSafe,
impl<ChainSpec> Send for EthBeaconConsensus<ChainSpec>
impl<ChainSpec> Sync for EthBeaconConsensus<ChainSpec>
impl<ChainSpec> Unpin for EthBeaconConsensus<ChainSpec>
impl<ChainSpec> UnsafeUnpin for EthBeaconConsensus<ChainSpec>where
Arc<ChainSpec>: UnsafeUnpin,
impl<ChainSpec> UnwindSafe for EthBeaconConsensus<ChainSpec>where
Arc<ChainSpec>: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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 moreimpl<T> MaybeDebug for Twhere
T: Debug,
§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§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: 24 bytes