Skip to main content

EthBeaconConsensus

Struct EthBeaconConsensus 

Source
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>

Source

pub const fn new(chain_spec: Arc<ChainSpec>) -> Self

Create a new instance of EthBeaconConsensus

Source

pub const fn max_extra_data_size(&self) -> usize

Returns the maximum allowed extra data size.

Source

pub const fn with_max_extra_data_size(self, size: usize) -> Self

Sets the maximum allowed extra data size and returns the updated instance.

Source

pub const fn with_skip_gas_limit_ramp_check(self, skip: bool) -> Self

Disables the gas limit change validation between parent and child blocks.

Source

pub const fn with_skip_blob_gas_used_check(self, skip: bool) -> Self

Disables the blob gas used check in header validation.

Source

pub const fn with_skip_requests_hash_check(self, skip: bool) -> Self

Disables the requests hash check in post-execution validation.

Source

pub const fn with_allow_bal_hashes(self, allow: bool) -> Self

Allows BAL hashes before Amsterdam activation.

Source

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>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

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>

Ensures that body field values match the header.
Source§

fn validate_block_pre_execution( &self, block: &SealedBlock<B>, ) -> Result<(), ConsensusError>

Validate a block disregarding world state, i.e. things that can be checked before sender recovery and execution. Read more
Source§

fn validate_block_pre_execution_with_tx_root( &self, block: &SealedBlock<B>, transaction_root: Option<TransactionRoot>, ) -> Result<(), ConsensusError>

Validate a block disregarding world state using an optional pre-computed transaction root. Read more
§

fn is_transient_error(&self, _error: &ConsensusError) -> bool

Returns true if the given consensus error is transient and may resolve on its own. Read more
Source§

impl<ChainSpec: Debug> Debug for EthBeaconConsensus<ChainSpec>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

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>

Validate a block considering world state, i.e. things that can not be checked before execution. Read more
Source§

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>

Validate if header is correct and follows consensus specification. Read more
Source§

fn validate_header_against_parent( &self, header: &SealedHeader<H>, parent: &SealedHeader<H>, ) -> Result<(), ConsensusError>

Validate that the header information regarding parent are correct. This checks the block number, timestamp, basefee and gas limit increment. Read more
§

fn validate_header_range( &self, headers: &[SealedHeader<H>], ) -> Result<(), HeaderConsensusError<H>>
where H: Clone,

Validates the given headers Read more

Auto Trait Implementations§

§

impl<ChainSpec> Freeze for EthBeaconConsensus<ChainSpec>
where Arc<ChainSpec>: Freeze,

§

impl<ChainSpec> RefUnwindSafe for EthBeaconConsensus<ChainSpec>
where Arc<ChainSpec>: RefUnwindSafe,

§

impl<ChainSpec> Send for EthBeaconConsensus<ChainSpec>
where Arc<ChainSpec>: Send,

§

impl<ChainSpec> Sync for EthBeaconConsensus<ChainSpec>
where Arc<ChainSpec>: Sync,

§

impl<ChainSpec> Unpin for EthBeaconConsensus<ChainSpec>
where Arc<ChainSpec>: Unpin,

§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit #126799)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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> MaybeDebug for T
where T: Debug,

§

impl<T> NonStaticAny for T
where T: ?Sized,

§

fn type_id(&self) -> TypeId

Returns the lifetime-erased type ID of self.
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more

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