diff --git a/crates/trie/sparse/src/trie.rs b/crates/trie/sparse/src/trie.rs index 04f034e1c8a5..8f54d9454022 100644 --- a/crates/trie/sparse/src/trie.rs +++ b/crates/trie/sparse/src/trie.rs @@ -282,6 +282,11 @@ impl

RevealedSparseTrie

{ node: TrieNode, hash_mask: Option, ) -> 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); }