pub struct AnyHeader {Show 21 fields
pub parent_hash: B256,
pub ommers_hash: B256,
pub beneficiary: Address,
pub state_root: B256,
pub transactions_root: B256,
pub receipts_root: B256,
pub logs_bloom: Bloom,
pub difficulty: U256,
pub number: u64,
pub gas_limit: u64,
pub gas_used: u64,
pub timestamp: u64,
pub extra_data: Bytes,
pub mix_hash: Option<B256>,
pub nonce: Option<B64>,
pub base_fee_per_gas: Option<u64>,
pub withdrawals_root: Option<B256>,
pub blob_gas_used: Option<u64>,
pub excess_blob_gas: Option<u64>,
pub parent_beacon_block_root: Option<B256>,
pub requests_hash: Option<B256>,
}
Expand description
Block header representation with certain fields made optional to account for possible differencies in network implementations.
Fields§
§parent_hash: B256
Hash of the parent
ommers_hash: B256
Hash of the uncles
beneficiary: Address
Alias of author
state_root: B256
State root hash
transactions_root: B256
Transactions root hash
receipts_root: B256
Transactions receipts root hash
logs_bloom: Bloom
Logs bloom
difficulty: U256
Difficulty
number: u64
Block number
gas_limit: u64
Gas Limit
gas_used: u64
Gas Used
timestamp: u64
Timestamp
extra_data: Bytes
Extra data
mix_hash: Option<B256>
Mix Hash
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 (PoF).
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
nonce: Option<B64>
Nonce
base_fee_per_gas: Option<u64>
Base fee per unit of gas (if past London)
withdrawals_root: Option<B256>
Withdrawals root hash added by EIP-4895 and is ignored in legacy headers.
blob_gas_used: Option<u64>
Blob gas used
excess_blob_gas: Option<u64>
Excess blob gas
parent_beacon_block_root: Option<B256>
EIP-4788 parent beacon block root
requests_hash: Option<B256>
EIP-7685 requests hash.
Trait Implementations§
Source§impl<'arbitrary> Arbitrary<'arbitrary> for AnyHeader
impl<'arbitrary> Arbitrary<'arbitrary> for AnyHeader
Source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Self
from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
Self
from the entirety of the given
unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Unstructured
this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Unstructured
this type
needs to construct itself. Read moreSource§impl BlockHeader for AnyHeader
impl BlockHeader for AnyHeader
Source§fn parent_hash(&self) -> B256
fn parent_hash(&self) -> B256
Source§fn ommers_hash(&self) -> B256
fn ommers_hash(&self) -> B256
Source§fn beneficiary(&self) -> Address
fn beneficiary(&self) -> Address
Source§fn state_root(&self) -> B256
fn state_root(&self) -> B256
Source§fn transactions_root(&self) -> B256
fn transactions_root(&self) -> B256
Source§fn receipts_root(&self) -> B256
fn receipts_root(&self) -> B256
Source§fn withdrawals_root(&self) -> Option<B256>
fn withdrawals_root(&self) -> Option<B256>
Source§fn logs_bloom(&self) -> Bloom
fn logs_bloom(&self) -> Bloom
Source§fn difficulty(&self) -> U256
fn difficulty(&self) -> U256
Source§fn number(&self) -> BlockNumber
fn number(&self) -> BlockNumber
Source§fn base_fee_per_gas(&self) -> Option<u64>
fn base_fee_per_gas(&self) -> Option<u64>
Source§fn blob_gas_used(&self) -> Option<u64>
fn blob_gas_used(&self) -> Option<u64>
Source§fn excess_blob_gas(&self) -> Option<u64>
fn excess_blob_gas(&self) -> Option<u64>
Source§fn parent_beacon_block_root(&self) -> Option<B256>
fn parent_beacon_block_root(&self) -> Option<B256>
Source§fn requests_hash(&self) -> Option<B256>
fn requests_hash(&self) -> Option<B256>
Source§fn extra_data(&self) -> &Bytes
fn extra_data(&self) -> &Bytes
Source§impl<'de> Deserialize<'de> for AnyHeader
impl<'de> Deserialize<'de> for AnyHeader
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for AnyHeader
impl StructuralPartialEq for AnyHeader
Auto Trait Implementations§
impl !Freeze for AnyHeader
impl RefUnwindSafe for AnyHeader
impl Send for AnyHeader
impl Sync for AnyHeader
impl Unpin for AnyHeader
impl UnwindSafe for AnyHeader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)