pub struct AnyHeader {Show 22 fields
pub parent_hash: FixedBytes<32>,
pub ommers_hash: FixedBytes<32>,
pub beneficiary: Address,
pub state_root: FixedBytes<32>,
pub transactions_root: FixedBytes<32>,
pub receipts_root: FixedBytes<32>,
pub logs_bloom: Bloom,
pub difficulty: Uint<256, 4>,
pub number: u64,
pub gas_limit: u64,
pub gas_used: u64,
pub timestamp: u64,
pub extra_data: Bytes,
pub mix_hash: Option<FixedBytes<32>>,
pub nonce: Option<FixedBytes<8>>,
pub base_fee_per_gas: Option<u64>,
pub withdrawals_root: Option<FixedBytes<32>>,
pub blob_gas_used: Option<u64>,
pub excess_blob_gas: Option<u64>,
pub parent_beacon_block_root: Option<FixedBytes<32>>,
pub requests_hash: Option<FixedBytes<32>>,
pub target_blobs_per_block: Option<u64>,
}Expand description
Block header representation with certain fields made optional to account for possible differencies in network implementations.
Fields§
§parent_hash: FixedBytes<32>Hash of the parent
ommers_hash: FixedBytes<32>Hash of the uncles
beneficiary: AddressAlias of author
state_root: FixedBytes<32>State root hash
transactions_root: FixedBytes<32>Transactions root hash
receipts_root: FixedBytes<32>Transactions receipts root hash
logs_bloom: BloomLogs bloom
difficulty: Uint<256, 4>Difficulty
number: u64Block number
gas_limit: u64Gas Limit
gas_used: u64Gas Used
timestamp: u64Timestamp
extra_data: BytesExtra data
mix_hash: Option<FixedBytes<32>>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<FixedBytes<8>>Nonce
base_fee_per_gas: Option<u64>Base fee per unit of gas (if past London)
withdrawals_root: Option<FixedBytes<32>>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<FixedBytes<32>>EIP-4788 parent beacon block root
requests_hash: Option<FixedBytes<32>>EIP-7685 requests hash.
target_blobs_per_block: Option<u64>EIP-7744 target blob count.
Trait Implementations§
Source§impl BlockHeader for AnyHeader
impl BlockHeader for AnyHeader
Source§fn parent_hash(&self) -> FixedBytes<32>
fn parent_hash(&self) -> FixedBytes<32>
Source§fn ommers_hash(&self) -> FixedBytes<32>
fn ommers_hash(&self) -> FixedBytes<32>
Source§fn beneficiary(&self) -> Address
fn beneficiary(&self) -> Address
Source§fn state_root(&self) -> FixedBytes<32>
fn state_root(&self) -> FixedBytes<32>
Source§fn transactions_root(&self) -> FixedBytes<32>
fn transactions_root(&self) -> FixedBytes<32>
Source§fn receipts_root(&self) -> FixedBytes<32>
fn receipts_root(&self) -> FixedBytes<32>
Source§fn withdrawals_root(&self) -> Option<FixedBytes<32>>
fn withdrawals_root(&self) -> Option<FixedBytes<32>>
Source§fn logs_bloom(&self) -> Bloom
fn logs_bloom(&self) -> Bloom
Source§fn difficulty(&self) -> Uint<256, 4>
fn difficulty(&self) -> Uint<256, 4>
Source§fn mix_hash(&self) -> Option<FixedBytes<32>>
fn mix_hash(&self) -> Option<FixedBytes<32>>
Source§fn nonce(&self) -> Option<FixedBytes<8>>
fn nonce(&self) -> Option<FixedBytes<8>>
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<FixedBytes<32>>
fn parent_beacon_block_root(&self) -> Option<FixedBytes<32>>
Source§fn requests_hash(&self) -> Option<FixedBytes<32>>
fn requests_hash(&self) -> Option<FixedBytes<32>>
Source§fn target_blobs_per_block(&self) -> Option<u64>
fn target_blobs_per_block(&self) -> Option<u64>
Source§fn extra_data(&self) -> &Bytes
fn extra_data(&self) -> &Bytes
Source§fn blob_fee(&self) -> Option<u128>
fn blob_fee(&self) -> Option<u128>
Source§fn next_block_excess_blob_gas(&self) -> Option<u64>
fn next_block_excess_blob_gas(&self) -> Option<u64>
Source§fn next_block_blob_fee(&self) -> Option<u128>
fn next_block_blob_fee(&self) -> Option<u128>
Source§fn next_block_base_fee(&self, base_fee_params: BaseFeeParams) -> Option<u64>
fn next_block_base_fee(&self, base_fee_params: BaseFeeParams) -> Option<u64>
Source§fn parent_num_hash(&self) -> NumHash
fn parent_num_hash(&self) -> NumHash
Source§impl<'de> Deserialize<'de> for AnyHeader
impl<'de> Deserialize<'de> for AnyHeader
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<AnyHeader, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<AnyHeader, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for AnyHeader
impl Serialize for AnyHeader
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more