fn lookup_patch(&self, key: &NodeKey, is_leaf: bool) -> (Option<Node>, bool) {
        let Some(patch) = &self.patch else {
            return (None, false);
        };
        if patch.is_new_version(key.version) {
            return (patch.tree_node(key, is_leaf), true);
        }
        let could_be_in_updated_patch = patch.updated_version == Some(key.version);
        if could_be_in_updated_patch {
            // Unlike with new versions, we must look both in the update patch and in the original DB.
            if let Some(node) = patch.tree_node(key, is_leaf) {
                return (Some(node), true);
            }
        }
        (None, false)
    }
Returns the value from the patch and a flag whether this value is final (i.e., a DB lookup
is not required).
core/lib/merkle_tree/src/storage/database.rs