Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(trie): do not persist root branch nodes in sparse trie #13071

Merged
merged 3 commits into from
Dec 3, 2024

Conversation

shekhirin
Copy link
Collaborator

@shekhirin shekhirin commented Dec 2, 2024

We need to mirror the TrieUpdates behavior, and we can skip the root nodes altogether when persisting the branch nodes

self.account_nodes.extend(exclude_empty_from_pair(other.account_nodes));
self.removed_nodes.extend(exclude_empty(other.removed_nodes));

@shekhirin shekhirin added C-bug An unexpected or incorrect behavior A-trie Related to Merkle Patricia Trie implementation labels Dec 2, 2024
@shekhirin shekhirin marked this pull request as ready for review December 2, 2024 18:50
crates/trie/sparse/src/trie.rs Outdated Show resolved Hide resolved
@shekhirin shekhirin enabled auto-merge December 3, 2024 13:27
Co-authored-by: Roman Krasiuk <rokrassyuk@gmail.com>
@shekhirin shekhirin force-pushed the alexey/sparse-trie-updates-empty branch from 98a9de8 to 5a99b39 Compare December 3, 2024 13:38
@shekhirin shekhirin added this pull request to the merge queue Dec 3, 2024
Merged via the queue into main with commit 61cb3de Dec 3, 2024
41 checks passed
@shekhirin shekhirin deleted the alexey/sparse-trie-updates-empty branch December 3, 2024 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-trie Related to Merkle Patricia Trie implementation C-bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants