Struct pchain_types::blockchain::BlockHeader
source · pub struct BlockHeader {Show 13 fields
pub hash: Sha256Hash,
pub height: u64,
pub justify: QuorumCertificate,
pub data_hash: CryptoHash,
pub chain_id: ChainID,
pub proposer: PublicAddress,
pub timestamp: u32,
pub base_fee: u64,
pub gas_used: u64,
pub txs_hash: Sha256Hash,
pub receipts_hash: Sha256Hash,
pub state_hash: Sha256Hash,
pub log_bloom: BloomFilter,
}Expand description
Block header defines meta information of a block, including evidence for verifying validity of the block.
Fields§
§hash: Sha256HashBlock hash of this block
height: u64The number of Justify-links between this Block and the Genesis Block. 0 for the Genesis Block
justify: QuorumCertificateA QuorumCertificate that points to the Block’s parent
data_hash: CryptoHashThe SHA256 Hash over content inside the block header
chain_id: ChainIDA number unique to a particular ParallelChain Mainnet-based blockchain. This prevents, for example, Blocks from one chain from being published in another chain as evidence of malfeasance.
proposer: PublicAddressThe Public Address of the Validator that is the Leader of the View this Block was proposed in
timestamp: u32A Unix timestamp
base_fee: u64The (inclusive) minimum number of Grays that a Transaction included in this Block must pay for every Gas used.
gas_used: u64The total gas used for producing the block.
txs_hash: Sha256HashTransactions Hash, the Binary Merkle Tree root hash over the Block’s Transactions
receipts_hash: Sha256HashReceipts Hash, the Binary Merkle Tree root hash over the Block’s Receipts
state_hash: Sha256HashState Hash, the SHA256 root hash of the blockchain’s World State Merkle Patricia Trie (MPT) after executing all of this Block’s Transactions
log_bloom: BloomFilterLog Bloom, the 256-byte Block-level Bloom Filter union of all the Bloom Filters of each Log topic from the Block’s Receipts
Trait Implementations§
source§impl BorshDeserialize for BlockHeaderwhere
Sha256Hash: BorshDeserialize,
u64: BorshDeserialize,
QuorumCertificate: BorshDeserialize,
CryptoHash: BorshDeserialize,
ChainID: BorshDeserialize,
PublicAddress: BorshDeserialize,
u32: BorshDeserialize,
BloomFilter: BorshDeserialize,
impl BorshDeserialize for BlockHeaderwhere Sha256Hash: BorshDeserialize, u64: BorshDeserialize, QuorumCertificate: BorshDeserialize, CryptoHash: BorshDeserialize, ChainID: BorshDeserialize, PublicAddress: BorshDeserialize, u32: BorshDeserialize, BloomFilter: BorshDeserialize,
fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self, Error>
source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where R: Read,
source§impl BorshSerialize for BlockHeaderwhere
Sha256Hash: BorshSerialize,
u64: BorshSerialize,
QuorumCertificate: BorshSerialize,
CryptoHash: BorshSerialize,
ChainID: BorshSerialize,
PublicAddress: BorshSerialize,
u32: BorshSerialize,
BloomFilter: BorshSerialize,
impl BorshSerialize for BlockHeaderwhere Sha256Hash: BorshSerialize, u64: BorshSerialize, QuorumCertificate: BorshSerialize, CryptoHash: BorshSerialize, ChainID: BorshSerialize, PublicAddress: BorshSerialize, u32: BorshSerialize, BloomFilter: BorshSerialize,
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 more