Function insert_subtree_root_to_snapshot_with_hasher
pub fn insert_subtree_root_to_snapshot_with_hasher<let TreeHeight: u32, let SubtreeHeight: u32>(
snapshot: AppendOnlyTreeSnapshot,
sibling_path: [Field; TreeHeight - SubtreeHeight],
subtree_root_to_insert: Field,
hasher: fn(Field, Field) -> Field,
) -> AppendOnlyTreeSnapshot
Inserts a subtree root into an append-only tree snapshot.
SubtreeHeightmust be strictly less than 64: the leaf index is shifted right bySubtreeHeightas au64(and the subtree leaf count is computed as1 << SubtreeHeight), and a u64 shift amount of 64 or more is out of range. As a consequence the whole tree cannot be replaced in a single call (that would requireSubtreeHeight == TreeHeight). SupportingSubtreeHeight >= 64would require wider integer types and is out of scope; in practice every protocol tree uses a far smaller subtree height.