alloy_consensus

Trait BlockHeader

Source
pub trait BlockHeader {
Show 23 methods // Required methods fn parent_hash(&self) -> B256; fn ommers_hash(&self) -> B256; fn beneficiary(&self) -> Address; fn state_root(&self) -> B256; fn transactions_root(&self) -> B256; fn receipts_root(&self) -> B256; fn withdrawals_root(&self) -> Option<B256>; fn logs_bloom(&self) -> Bloom; fn difficulty(&self) -> U256; fn number(&self) -> BlockNumber; fn gas_limit(&self) -> u64; fn gas_used(&self) -> u64; fn timestamp(&self) -> u64; fn mix_hash(&self) -> Option<B256>; fn nonce(&self) -> Option<B64>; fn base_fee_per_gas(&self) -> Option<u64>; fn blob_gas_used(&self) -> Option<u64>; fn excess_blob_gas(&self) -> Option<u64>; fn parent_beacon_block_root(&self) -> Option<B256>; fn requests_hash(&self) -> Option<B256>; fn extra_data(&self) -> &Bytes; // Provided methods fn next_block_excess_blob_gas(&self) -> Option<u64> { ... } fn next_block_blob_fee(&self) -> Option<u128> { ... }
}
Expand description

Trait for extracting specific Ethereum block data from a header

Required Methods§

Source

fn parent_hash(&self) -> B256

Retrieves the parent hash of the block

Source

fn ommers_hash(&self) -> B256

Retrieves the ommers hash of the block

Source

fn beneficiary(&self) -> Address

Retrieves the beneficiary (miner) of the block

Source

fn state_root(&self) -> B256

Retrieves the state root hash of the block

Source

fn transactions_root(&self) -> B256

Retrieves the transactions root hash of the block

Source

fn receipts_root(&self) -> B256

Retrieves the receipts root hash of the block

Source

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

Retrieves the withdrawals root hash of the block, if available

Source

fn logs_bloom(&self) -> Bloom

Retrieves the logs bloom filter of the block

Source

fn difficulty(&self) -> U256

Retrieves the difficulty of the block

Source

fn number(&self) -> BlockNumber

Retrieves the block number

Source

fn gas_limit(&self) -> u64

Retrieves the gas limit of the block

Source

fn gas_used(&self) -> u64

Retrieves the gas used by the block

Source

fn timestamp(&self) -> u64

Retrieves the timestamp of the block

Source

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

Retrieves the mix hash of the block, if available

Source

fn nonce(&self) -> Option<B64>

Retrieves the nonce of the block, if avaialble

Source

fn base_fee_per_gas(&self) -> Option<u64>

Retrieves the base fee per gas of the block, if available

Source

fn blob_gas_used(&self) -> Option<u64>

Retrieves the blob gas used by the block, if available

Source

fn excess_blob_gas(&self) -> Option<u64>

Retrieves the excess blob gas of the block, if available

Source

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

Retrieves the parent beacon block root of the block, if available

Source

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

Retrieves the requests hash of the block, if available

Source

fn extra_data(&self) -> &Bytes

Retrieves the block’s extra data field

Provided Methods§

Source

fn next_block_excess_blob_gas(&self) -> Option<u64>

Calculate excess blob gas for the next block according to the EIP-4844 spec.

Returns a None if no excess blob gas is set, no EIP-4844 support

Source

fn next_block_blob_fee(&self) -> Option<u128>

Returns the blob fee for the next block according to the EIP-4844 spec.

Returns None if excess_blob_gas is None.

See also Self::next_block_excess_blob_gas

Implementations on Foreign Types§

Source§

impl<T: BlockHeader> BlockHeader for WithOtherFields<T>

Available on crate feature serde only.

Implementors§