Skip to content

fix(trie): cleanup branch_node_masks on reveal_node failure#21913

Closed
gancerlory wants to merge 1 commit intoparadigmxyz:mainfrom
gancerlory:cleanmask
Closed

fix(trie): cleanup branch_node_masks on reveal_node failure#21913
gancerlory wants to merge 1 commit intoparadigmxyz:mainfrom
gancerlory:cleanmask

Conversation

@gancerlory
Copy link
Contributor

@gancerlory gancerlory commented Feb 6, 2026

SerialSparseTrie::reveal_node inserts into branch_node_masks at the start of the method, but if any subsequent operation fails (like reveal_node_or_hash or node type conflicts), the method returns early without cleaning up. This leaves the trie in an inconsistent state.

Fixed by tracking whether we inserted new masks and removing them on error.

-Extract core logic into reveal_node_inner
-Add rollback for branch_node_masks on error

@Rjected
Copy link
Member

Rjected commented Feb 6, 2026

we're actually going to remove SerialSparseTrie: #21808

@Rjected Rjected closed this Feb 6, 2026
@github-project-automation github-project-automation bot moved this from Backlog to Done in Reth Tracker Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants