ExecutionPayload

Trait ExecutionPayload 

Source
pub trait ExecutionPayload:
    Serialize
    + DeserializeOwned
    + Debug
    + Clone
    + Send
    + Sync
    + 'static {
    // Required methods
    fn parent_hash(&self) -> B256;
    fn block_hash(&self) -> B256;
    fn block_number(&self) -> u64;
    fn withdrawals(&self) -> Option<&Vec<Withdrawal>>;
    fn parent_beacon_block_root(&self) -> Option<B256>;
    fn timestamp(&self) -> u64;
    fn gas_used(&self) -> u64;

    // Provided methods
    fn num_hash(&self) -> BlockNumHash { ... }
    fn block_with_parent(&self) -> BlockWithParent { ... }
}
Expand description

Represents the core data structure of an execution payload.

Contains all necessary information to execute and validate a block, including headers, transactions, and consensus fields. Provides a unified interface regardless of protocol version.

Required Methods§

Source

fn parent_hash(&self) -> B256

Returns the hash of this block’s parent.

Source

fn block_hash(&self) -> B256

Returns this block’s hash.

Source

fn block_number(&self) -> u64

Returns this block’s number (height).

Source

fn withdrawals(&self) -> Option<&Vec<Withdrawal>>

Returns the withdrawals included in this payload.

Returns None for pre-Shanghai blocks.

Source

fn parent_beacon_block_root(&self) -> Option<B256>

Returns the beacon block root associated with this payload.

Returns None for pre-merge payloads.

Source

fn timestamp(&self) -> u64

Returns this block’s timestamp (seconds since Unix epoch).

Source

fn gas_used(&self) -> u64

Returns the total gas consumed by all transactions in this block.

Provided Methods§

Source

fn num_hash(&self) -> BlockNumHash

Returns this block’s number hash.

Source

fn block_with_parent(&self) -> BlockWithParent

Returns a [BlockWithParent] for this block.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl ExecutionPayload for ExecutionData

Source§

fn parent_hash(&self) -> B256

Source§

fn block_hash(&self) -> B256

Source§

fn block_number(&self) -> u64

Source§

fn withdrawals(&self) -> Option<&Vec<Withdrawal>>

Source§

fn parent_beacon_block_root(&self) -> Option<B256>

Source§

fn timestamp(&self) -> u64

Source§

fn gas_used(&self) -> u64

Source§

impl ExecutionPayload for OpExecutionData

Available on crate feature op only.
Source§

fn parent_hash(&self) -> B256

Source§

fn block_hash(&self) -> B256

Source§

fn block_number(&self) -> u64

Source§

fn withdrawals(&self) -> Option<&Vec<Withdrawal>>

Source§

fn parent_beacon_block_root(&self) -> Option<B256>

Source§

fn timestamp(&self) -> u64

Source§

fn gas_used(&self) -> u64

Implementors§