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
- TypeScript
pub struct ChunkView {
pub author: AccountId,
pub header: ChunkHeaderView,
pub transactions: Vec<IndexerTransactionWithOutcome>,
pub receipts: Vec<ReceiptView>,
}
export interface Chunk {
author: string;
header: ChunkHeader;
transactions: IndexerTransactionWithOutcome[];
receipts: Receipt[],
}
ChunkHeaderView
- value
- TypeScript
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<ValidatorStakeView>,
pub signature: Signature,
}
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;
};