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

source

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

source

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

source

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

source§

fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>

Generate an arbitrary value of Self from the given unstructured data. Read more
source§

fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>

Generate an arbitrary value of Self from the entirety of the given unstructured data. Read more
source§

fn size_hint(depth: usize) -> (usize, Option<usize>)

Get a size hint for how many bytes out of an Unstructured this type needs to construct itself. Read more
source§

impl Clone for Header

source§

fn clone(&self) -> Header

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Header

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Header

source§

fn default() -> Header

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for Header

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<Header> for RichHeader

source§

fn from(inner: Header) -> Self

Converts to this type from the input type.
source§

impl Hash for Header

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for Header

source§

fn eq(&self, other: &Header) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Header

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for Header

source§

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for T
where 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