Skip to main content

build_subtrees

Function build_subtrees 

Source
pub fn build_subtrees<H, const SHARD_HEIGHT: u8>(
    start_position: Position,
    commitments: &mut [Option<(H, Retention<BlockHeight>)>],
    chunk_size: usize,
) -> Vec<(LocatedPrunableTree<H>, BTreeMap<BlockHeight, Position>)>
where H: Clone + PartialEq + Hashable + Send + Sync,
Expand description

Creates subtrees from note commitments in parallel.

commitments is an &mut [Option<_>] to emulate move semantics inside a rayon parallel iterator; every entry must be Some on entry, and every entry will have been taken on return.

Returns each located subtree together with the map from checkpointed block height to note commitment tree position within that subtree.