Skip to main content

build_shard

Function build_shard 

Source
pub fn build_shard(
    chunks: &[Chunk],
) -> (MdbShardBuilder, MerkleHash, Vec<(MerkleHash, Vec<u8>)>)
Expand description

Build an MdbShardBuilder (plus, per xorb, its hash and concatenated raw bytes) from a chunk list, packing chunks into xorbs that respect the XET MAX_XORB_BYTES (64 MiB) and MAX_XORB_CHUNKS (8192) limits.

Chunk → xorb aggregation, xorb hashing (merklehash::xorb_hash), and file hashing (merklehash::file_hash) all match xet-core’s RawXorbData::from_chunks, so the hashes embedded in the produced shard are identical to an upstream client’s.