pub(super) fn copied_hashes_count(&self) -> u64 {
        let copied_hashes = self.patches_by_version.iter().map(|(&version, patch)| {
            let copied_hashes = patch.nodes.values().map(|node| {
                let Node::Internal(node) = node else {
                    return 0;
                };
                let copied_hashes = node.child_refs().filter(|r| r.version < version).count();
                copied_hashes as u64
            });
            copied_hashes.sum::<u64>()
        });
        copied_hashes.sum()
    }
Calculates the number of hashes in `ChildRef`s copied from the previous versions
of the tree. This allows to estimate redundancy of this `PatchSet`.
core/lib/merkle_tree/src/storage/patch.rs