Struct alloy_rpc_types_eth::block::Header
source · pub struct Header {Show 23 fields
pub hash: Option<BlockHash>,
pub parent_hash: B256,
pub uncles_hash: B256,
pub miner: Address,
pub state_root: B256,
pub transactions_root: B256,
pub receipts_root: B256,
pub logs_bloom: Bloom,
pub difficulty: U256,
pub number: Option<u64>,
pub gas_limit: u128,
pub gas_used: u128,
pub timestamp: u64,
pub total_difficulty: Option<U256>,
pub extra_data: Bytes,
pub mix_hash: Option<B256>,
pub nonce: Option<B64>,
pub base_fee_per_gas: Option<u128>,
pub withdrawals_root: Option<B256>,
pub blob_gas_used: Option<u128>,
pub excess_blob_gas: Option<u128>,
pub parent_beacon_block_root: Option<B256>,
pub requests_root: Option<B256>,
}
Expand description
Block header representation.
Fields§
§hash: Option<BlockHash>
Hash of the block
parent_hash: B256
Hash of the parent
uncles_hash: B256
Hash of the uncles
miner: 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: Option<u64>
Block number
gas_limit: u128
Gas Limit
gas_used: u128
Gas Used
timestamp: u64
Timestamp
total_difficulty: Option<U256>
Total difficulty
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<u128>
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<u128>
Blob gas used
excess_blob_gas: Option<u128>
Excess blob gas
parent_beacon_block_root: Option<B256>
EIP-4788 parent beacon block root
requests_root: Option<B256>
EIP-7685 requests root.
Implementations§
source§impl Header
impl Header
sourcepub fn blob_fee(&self) -> Option<u128>
pub fn blob_fee(&self) -> Option<u128>
Returns the blob fee for this block according to the EIP-4844 spec.
Returns None
if excess_blob_gas
is None
sourcepub fn next_block_blob_fee(&self) -> Option<u128>
pub fn next_block_blob_fee(&self) -> Option<u128>
Returns the blob fee for the next block according to the EIP-4844 spec.
Returns None
if excess_blob_gas
is None.
See also Self::next_block_excess_blob_gas
sourcepub fn next_block_excess_blob_gas(&self) -> Option<u128>
pub fn next_block_excess_blob_gas(&self) -> Option<u128>
Calculate excess blob gas for the next block according to the EIP-4844 spec.
Returns a None
if no excess blob gas is set, no EIP-4844 support
Trait Implementations§
source§impl<'arbitrary> Arbitrary<'arbitrary> for Header
impl<'arbitrary> Arbitrary<'arbitrary> for Header
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§impl<'de> Deserialize<'de> for Header
impl<'de> Deserialize<'de> for Header
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>,
source§impl From<Header> for RichHeader
impl From<Header> for RichHeader
source§impl PartialEq for Header
impl PartialEq for Header
impl Eq for Header
impl StructuralPartialEq for Header
Auto Trait Implementations§
impl !Freeze for Header
impl RefUnwindSafe for Header
impl Send for Header
impl Sync for Header
impl Unpin for Header
impl UnwindSafe for Header
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> 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 moreimpl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 880 bytes