Struct substreams_ethereum_core::pb::eth::v2::BlockHeader
source · pub struct BlockHeader {Show 20 fields
pub parent_hash: Vec<u8>,
pub uncle_hash: Vec<u8>,
pub coinbase: Vec<u8>,
pub state_root: Vec<u8>,
pub transactions_root: Vec<u8>,
pub receipt_root: Vec<u8>,
pub logs_bloom: Vec<u8>,
pub difficulty: Option<BigInt>,
pub total_difficulty: Option<BigInt>,
pub number: u64,
pub gas_limit: u64,
pub gas_used: u64,
pub timestamp: Option<Timestamp>,
pub extra_data: Vec<u8>,
pub mix_hash: Vec<u8>,
pub nonce: u64,
pub hash: Vec<u8>,
pub base_fee_per_gas: Option<BigInt>,
pub withdrawals_root: Vec<u8>,
pub tx_dependency: Option<Uint64NestedArray>,
}Fields§
§parent_hash: Vec<u8>§uncle_hash: Vec<u8>Uncle hash of the block, some reference it as sha3Uncles, but sha3`` is badly worded, so we prefer uncle_hash, also referred as ommers` in EIP specification.
If the Block containing this BlockHeader has been produced using the Proof of Stake
consensus algorithm, this field will actually be constant and set to 0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347.
coinbase: Vec<u8>§state_root: Vec<u8>§transactions_root: Vec<u8>§receipt_root: Vec<u8>§logs_bloom: Vec<u8>§difficulty: Option<BigInt>Difficulty is the difficulty of the Proof of Work algorithm that was required to compute a solution.
If the Block containing this BlockHeader has been produced using the Proof of Stake
consensus algorithm, this field will actually be constant and set to 0x00.
total_difficulty: Option<BigInt>TotalDifficulty is the sum of all previous blocks difficulty including this block difficulty.
If the Block containing this BlockHeader has been produced using the Proof of Stake
consensus algorithm, this field will actually be constant and set to the terminal total difficulty
that was required to transition to Proof of Stake algorithm, which varies per network. It is set to
58 750 000 000 000 000 000 000 on Ethereum Mainnet and to 10 790 000 on Ethereum Testnet Goerli.
number: u64§gas_limit: u64§gas_used: u64§timestamp: Option<Timestamp>§extra_data: Vec<u8>ExtraData is free-form bytes included in the block by the “miner”. While on Yellow paper of Ethereum this value is maxed to 32 bytes, other consensus algorithm like Clique and some other forks are using bigger values to carry special consensus data.
If the Block containing this BlockHeader has been produced using the Proof of Stake
consensus algorithm, this field is strictly enforced to be <= 32 bytes.
mix_hash: Vec<u8>MixHash is used to prove, when combined with the nonce that sufficient amount of computation has been
achieved and that the solution found is valid.
nonce: u64Nonce is used to prove, when combined with the mix_hash that sufficient amount of computation has been
achieved and that the solution found is valid.
If the Block containing this BlockHeader has been produced using the Proof of Stake
consensus algorithm, this field will actually be constant and set to 0.
hash: Vec<u8>Hash is the hash of the block which is actually the computation:
Keccak256(rlp([ parent_hash, uncle_hash, coinbase, state_root, transactions_root, receipt_root, logs_bloom, difficulty, number, gas_limit, gas_used, timestamp, extra_data, mix_hash, nonce, base_fee_per_gas (to be included, only if London Fork is active) withdrawals_root (to be included, only if Shangai Fork is active) ]))
base_fee_per_gas: Option<BigInt>Base fee per gas according to EIP-1559 (e.g. London Fork) rules, only set if London is present/active on the chain.
withdrawals_root: Vec<u8>Withdrawals root hash according to EIP-4895 (e.g. Shangai Fork) rules, only set if Shangai is present/active on the chain.
Only available in DetailLevel: EXTENDED
tx_dependency: Option<Uint64NestedArray>Only available in DetailLevel: EXTENDED
Trait Implementations§
source§impl Clone for BlockHeader
impl Clone for BlockHeader
source§fn clone(&self) -> BlockHeader
fn clone(&self) -> BlockHeader
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for BlockHeader
impl Debug for BlockHeader
source§impl Default for BlockHeader
impl Default for BlockHeader
source§impl Message for BlockHeader
impl Message for BlockHeader
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn decode<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
fn decode<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
self. Read moresource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
self.source§impl PartialEq for BlockHeader
impl PartialEq for BlockHeader
source§fn eq(&self, other: &BlockHeader) -> bool
fn eq(&self, other: &BlockHeader) -> bool
self and other values to be equal, and is used
by ==.