Trait PayloadValidator

pub trait PayloadValidator:
    Send
    + Sync
    + Unpin
    + 'static {
    type Block: Block;
    type ExecutionData;

    // Required method
    fn ensure_well_formed_payload(
        &self,
        payload: Self::ExecutionData,
    ) -> Result<RecoveredBlock<Self::Block>, NewPayloadError>;

    // Provided method
    fn validate_block_post_execution_with_hashed_state(
        &self,
        _state_updates: &HashedPostState,
        _block: &RecoveredBlock<Self::Block>,
    ) -> Result<(), ConsensusError> { ... }
}
Expand description

Type that validates an ExecutionPayload.

Required Associated Types§

type Block: Block

The block type used by the engine.

type ExecutionData

The execution payload type used by the engine.

Required Methods§

fn ensure_well_formed_payload( &self, payload: Self::ExecutionData, ) -> Result<RecoveredBlock<Self::Block>, NewPayloadError>

Ensures that the given payload does not violate any consensus rules that concern the block’s layout.

This function must convert the payload into the executable block and pre-validate its fields.

Implementers should ensure that the checks are done in the order that conforms with the engine-API specification.

Provided Methods§

fn validate_block_post_execution_with_hashed_state( &self, _state_updates: &HashedPostState, _block: &RecoveredBlock<Self::Block>, ) -> Result<(), ConsensusError>

Verifies payload post-execution w.r.t. hashed state updates.

Implementations on Foreign Types§

§

impl PayloadValidator for EthereumEngineValidator

§

impl<'a, T> PayloadValidator for &'a T
where T: 'a + PayloadValidator + ?Sized, &'a T: Send + Sync + Unpin + 'static,

§

impl<T> PayloadValidator for Arc<T>
where T: PayloadValidator + ?Sized, Arc<T>: Send + Sync + Unpin + 'static,

Implementors§

impl<P> PayloadValidator for OpEngineValidator<P>
where P: StateProviderFactory + Unpin + 'static,