fn load_ancestors<DB: Database + ?Sized>(
        &mut self,
        sorted_keys: &SortedKeys,
        db: &DB,
    ) -> Vec<Nibbles> {
        let _profiling_guard = db.start_profiling(ProfiledTreeOperation::LoadAncestors);
        let LoadAncestorsResult {
            longest_prefixes,
            db_reads,
        } = self.patch_set.load_ancestors(sorted_keys, db);

        self.metrics.db_reads += db_reads;
        longest_prefixes
    }
Loads ancestor nodes for all keys in `key_value_pairs`. Returns the longest prefix
present in the tree currently for each inserted / updated key.

# Implementation notes

It may seem that the loaded leaf nodes may just increase the patch size. However,
each leaf node will actually be modified by [`Self::insert()`], either by changing
its `value_hash` (on full key match), or by moving the leaf node down the tree
(in which case the node in the patch will be overwritten by an `InternalNode`).
core/lib/merkle_tree/src/storage/mod.rs