Function descendant_range

Source
pub fn descendant_range(
    node_index: usize,
    target_layer: usize,
    height: usize,
) -> (usize, usize)
Expand description

Return the (start, count) range of descendant indices of node_index located at target_layer (leaves = 0, root = height) in a perfect binary Merkle tree indexed by layer left→right as in the prompt.

Same-layer query returns (node_index, 1).