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§
sourcefn hash(&self) -> FixedBytes<32>
fn hash(&self) -> FixedBytes<32>
Block hash
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<FixedBytes<32>>
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
sourcefn difficulty(&self) -> Uint<256, 4>
fn difficulty(&self) -> Uint<256, 4>
Difficulty of the block
Unused after the Paris (AKA the merge) upgrade, and replaced by prevrandao
.