Skip to content

Commit

Permalink
fix(trie): clear all deleted storage nodes on extend (#10411)
Browse files Browse the repository at this point in the history
  • Loading branch information
rkrasiuk authored Aug 21, 2024
1 parent e2ea8ac commit 457439e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/trie/trie/src/updates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ impl StorageTrieUpdates {

/// Extends storage trie updates.
pub fn extend(&mut self, other: Self) {
if other.is_deleted {
self.storage_nodes.clear();
self.removed_nodes.clear();
}
self.is_deleted |= other.is_deleted;
self.storage_nodes.extend(ExcludeEmptyFromPair::from_iter(other.storage_nodes));
self.removed_nodes.extend(ExcludeEmpty::from_iter(other.removed_nodes));
Expand Down

0 comments on commit 457439e

Please sign in to comment.