pub trait HeaderResponse {
// Required methods
fn hash(&self) -> BlockHash;
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<B256>;
fn difficulty(&self) -> U256;
}
Expand description
Header JSON-RPC response.
Required Methods§
sourcefn extra_data(&self) -> &Bytes
fn extra_data(&self) -> &Bytes
Extra data
sourcefn base_fee_per_gas(&self) -> Option<u64>
fn base_fee_per_gas(&self) -> Option<u64>
Base fee per unit of gas (If EIP-1559 is supported)
sourcefn next_block_blob_fee(&self) -> Option<u128>
fn next_block_blob_fee(&self) -> Option<u128>
Blob fee for the next block (if EIP-4844 is supported)
sourcefn mix_hash(&self) -> Option<B256>
fn mix_hash(&self) -> Option<B256>
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
sourcefn difficulty(&self) -> U256
fn difficulty(&self) -> U256
Difficulty of the block
Unused after the Paris (AKA the merge) upgrade, and replaced by prevrandao
.