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§
Auto Trait Implementations§
impl Freeze for BlockHeader
impl RefUnwindSafe for BlockHeader
impl Send for BlockHeader
impl Sync for BlockHeader
impl Unpin for BlockHeader
impl UnwindSafe for BlockHeader
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
Mutably borrows from an owned value. Read more