fix(tree): do not reveal nodes twice in sparse trie (#13674)

This commit is contained in:
Alexey Shekhirin
2025-01-06 20:20:50 +00:00
committed by GitHub
parent 50f8c6d93e
commit 721a581180

View File

@ -282,6 +282,11 @@ impl<P> RevealedSparseTrie<P> {
node: TrieNode,
hash_mask: Option<TrieMask>,
) -> SparseTrieResult<()> {
// If the node is already revealed and it's not a hash node, do nothing.
if self.nodes.get(&path).is_some_and(|node| !node.is_hash()) {
return Ok(())
}
if let Some(hash_mask) = hash_mask {
self.branch_node_hash_masks.insert(path.clone(), hash_mask);
}