op_alloy_network::primitives

Trait HeaderResponse

pub trait HeaderResponse {
    // Required methods
    fn hash(&self) -> FixedBytes<32>;
    fn number(&self) -> u64;
    fn timestamp(&self) -> u64;
    fn extra_data(&self) -> &Bytes;
    fn base_fee_per_gas(&self) -> Option<u64>;
    fn next_block_blob_fee(&self) -> Option<u128>;
    fn coinbase(&self) -> Address;
    fn gas_limit(&self) -> u64;
    fn mix_hash(&self) -> Option<FixedBytes<32>>;
    fn difficulty(&self) -> Uint<256, 4>;
}
Expand description

Header JSON-RPC response.

Required Methods§

fn hash(&self) -> FixedBytes<32>

Block hash

fn number(&self) -> u64

Block number

fn timestamp(&self) -> u64

Block timestamp

fn extra_data(&self) -> &Bytes

Extra data

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

Base fee per unit of gas (If EIP-1559 is supported)

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

Blob fee for the next block (if EIP-4844 is supported)

fn coinbase(&self) -> Address

Coinbase/Miner of the block

fn gas_limit(&self) -> u64

Gas limit of the block

fn mix_hash(&self) -> Option<FixedBytes<32>>

Mix hash of the block

Before the merge this proves, combined with the nonce, that a sufficient amount of computation has been carried out on this block: the Proof-of-Work (PoW).

After the merge this is prevRandao: Randomness value for the generated payload.

This is an Option because it is not always set by non-ethereum networks.

See also https://eips.ethereum.org/EIPS/eip-4399 And https://github.com/ethereum/execution-apis/issues/328

fn difficulty(&self) -> Uint<256, 4>

Difficulty of the block

Unused after the Paris (AKA the merge) upgrade, and replaced by prevrandao.

Implementations on Foreign Types§

§

impl HeaderResponse for Header

§

fn hash(&self) -> FixedBytes<32>

§

fn number(&self) -> u64

§

fn timestamp(&self) -> u64

§

fn extra_data(&self) -> &Bytes

§

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

§

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

§

fn coinbase(&self) -> Address

§

fn gas_limit(&self) -> u64

§

fn mix_hash(&self) -> Option<FixedBytes<32>>

§

fn difficulty(&self) -> Uint<256, 4>

§

impl<T> HeaderResponse for WithOtherFields<T>
where T: HeaderResponse,

§

fn hash(&self) -> FixedBytes<32>

§

fn number(&self) -> u64

§

fn timestamp(&self) -> u64

§

fn extra_data(&self) -> &Bytes

§

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

§

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

§

fn coinbase(&self) -> Address

§

fn gas_limit(&self) -> u64

§

fn mix_hash(&self) -> Option<FixedBytes<32>>

§

fn difficulty(&self) -> Uint<256, 4>

Implementors§