From ef292ffa00e7d9a9bfee4062dd731bca9d85373d Mon Sep 17 00:00:00 2001 From: Arsenii Kulikov Date: Tue, 24 Feb 2026 14:36:34 +0400 Subject: [PATCH] fix: don't produce both updates and removals for trie nodes (#22507) Co-authored-by: Brian Picciano --- .changelog/tidy-stars-cry.md | 5 +++++ crates/trie/sparse/src/parallel.rs | 1 + 2 files changed, 6 insertions(+) create mode 100644 .changelog/tidy-stars-cry.md 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); } } }