diff --git a/.changelog/tidy-stars-cry.md b/.changelog/tidy-stars-cry.md new file mode 100644 index 0000000000..6746e1d308 --- /dev/null +++ b/.changelog/tidy-stars-cry.md @@ -0,0 +1,5 @@ +--- +reth-trie-sparse: patch +--- + +Fixed a bug where trie nodes could appear in both `updated_nodes` and `removed_nodes` simultaneously by removing entries from `removed_nodes` when a node is inserted as updated. diff --git a/crates/trie/sparse/src/parallel.rs b/crates/trie/sparse/src/parallel.rs index b8d413fb9d..23c02defc6 100644 --- a/crates/trie/sparse/src/parallel.rs +++ b/crates/trie/sparse/src/parallel.rs @@ -1869,6 +1869,7 @@ impl ParallelSparseTrie { } SparseTrieUpdatesAction::InsertUpdated(path, branch_node) => { updates.updated_nodes.insert(path, branch_node); + updates.removed_nodes.remove(&path); } } }