chunk

To Share and +4 nLEARNs

import Tabs from ‘@theme/Tabs’;
import TabItem from ‘@theme/TabItem’;

Chunk Structure

Definition

Chunk of a Block is a part of a Block from a Shard. The collection of Chunks of the Block forms the NEAR Protocol Block

Chunk contains all the structures that make the Block:

IndexerChunkView


“`rust links=1
pub struct ChunkView {
pub author: AccountId,
pub header: ChunkHeaderView,
pub transactions: Vec,
pub receipts: Vec,
}
“`


“`ts links=1
export interface Chunk {
author: string;
header: ChunkHeader;
transactions: IndexerTransactionWithOutcome[];
receipts: Receipt[],
}
“`


ChunkHeaderView


“`rust links=1
pub struct ChunkHeaderView {
pub chunk_hash: CryptoHash,
pub prev_block_hash: CryptoHash,
pub outcome_root: CryptoHash,
pub prev_state_root: StateRoot,
pub encoded_merkle_root: CryptoHash,
pub encoded_length: u64,
pub height_created: BlockHeight,
pub height_included: BlockHeight,
pub shard_id: ShardId,
pub gas_used: Gas,
pub gas_limit: Gas,
/// TODO(2271): deprecated.
#[serde(with = “u128_dec_format”)]
pub rent_paid: Balance,
/// TODO(2271): deprecated.
#[serde(with = “u128_dec_format”)]
pub validator_reward: Balance,
#[serde(with = “u128_dec_format”)]
pub balance_burnt: Balance,
pub outgoing_receipts_root: CryptoHash,
pub tx_root: CryptoHash,
pub validator_proposals: Vec,
pub signature: Signature,
}
“`


“`ts links=1
export interface ChunkHeader {
balanceBurnt: number;
chunkHash: string;
encodedLength: number;
encodedMerkleRoot: string;
gasLimit: number;
gasUsed: number;
heightCreated: number;
heightIncluded: number;
outcomeRoot: string;
outgoingReceiptsRoot: string;
prevBlockHash: string;
prevStateRoot: string;
rentPaid: string;
shardId: number;
signature: string;
txRoot: string;
validatorProposals: ValidatorProposal[];
validatorReward: string;
};
“`


Generate comment with AI 2 nL
Scroll to Top
Report a bug👀