BlockHeader

Struct BlockHeader 

Source
pub struct BlockHeader {
Show 23 fields pub block_hash: String, pub number: i64, pub gas_limit: i64, pub gas_used: i64, pub nonce: String, pub transaction_root: Option<String>, pub receipts_root: Option<String>, pub state_root: Option<String>, pub base_fee_per_gas: Option<String>, pub parent_hash: Option<String>, pub ommers_hash: Option<String>, pub miner: Option<String>, pub logs_bloom: Option<String>, pub difficulty: Option<String>, pub total_difficulty: Option<String>, pub sha3_uncles: Option<String>, pub timestamp: Option<String>, pub extra_data: Option<String>, pub mix_hash: Option<String>, pub withdrawals_root: Option<String>, pub blob_gas_used: Option<String>, pub excess_blob_gas: Option<String>, pub parent_beacon_block_root: Option<String>,
}
Expand description

Represents an Ethereum block header with various properties like block hash, gas limits, and more.

This struct provides a way to store and manipulate data related to an Ethereum block header, including cryptographic information (like the block hash and state root), as well as metadata about the block (such as gas usage and the miner address). It supports fields with optional values, as certain block headers may lack specific information, depending on their context in the chain.

§Fields

  • block_hash: The unique identifier for the block, as a 66-character hexadecimal string (not null).
  • number: The block number, a sequential integer starting from 0 (not null).
  • gas_limit: The maximum amount of gas that can be spent on transactions in this block (not null).
  • gas_used: The actual amount of gas used by transactions within the block (not null).
  • nonce: A 78-character string representing the proof-of-work nonce (not null).
  • transaction_root: The Merkle root of the transactions in the block, if available (optional).
  • receipts_root: The Merkle root of the transaction receipts in the block, if available (optional).
  • state_root: The root of the state trie after transactions in the block are processed (optional).
  • base_fee_per_gas: The base fee per gas for the block in the new fee market mechanism (optional).
  • parent_hash: The hash of the previous block, which this block references (optional).
  • ommers_hash: The hash of the ommers (or uncles), which are alternative blocks that could have been part of the chain (optional).
  • miner: The address of the miner that mined the block (optional).
  • logs_bloom: The bloom filter for logs included in the block, useful for filtering logs efficiently (optional).
  • difficulty: The difficulty level required to mine the block (optional).
  • total_difficulty: The total difficulty of the chain up to this block (optional).
  • sha3_uncles: The SHA3 hash of the uncles (ommers) included in the block (optional).
  • timestamp: The time at which the block was mined, as a string (optional).
  • extra_data: Extra data included in the block, up to 1024 bytes (optional).
  • mix_hash: A hash used to verify the proof of work, ensuring that the mining process was valid (optional).
  • withdrawals_root: The Merkle root of withdrawal data for withdrawals included in the block, if any (optional).
  • blob_gas_used: The amount of blob gas used, specific to blob transactions (optional).
  • excess_blob_gas: The excess blob gas present in the block (optional).
  • parent_beacon_block_root: The root of the parent beacon block, used in Ethereum’s proof-of-stake chain (optional).

Fields§

§block_hash: String§number: i64§gas_limit: i64§gas_used: i64§nonce: String§transaction_root: Option<String>§receipts_root: Option<String>§state_root: Option<String>§base_fee_per_gas: Option<String>§parent_hash: Option<String>§ommers_hash: Option<String>§miner: Option<String>§logs_bloom: Option<String>§difficulty: Option<String>§total_difficulty: Option<String>§sha3_uncles: Option<String>§timestamp: Option<String>§extra_data: Option<String>§mix_hash: Option<String>§withdrawals_root: Option<String>§blob_gas_used: Option<String>§excess_blob_gas: Option<String>§parent_beacon_block_root: Option<String>

Trait Implementations§

Source§

impl Debug for BlockHeader

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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>,

Source§

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.
Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more