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): empty sparse trie branch node masks #13825

Merged
merged 1 commit into from
Jan 16, 2025

Conversation

shekhirin
Copy link
Collaborator

@shekhirin shekhirin commented Jan 16, 2025

Another branch node updates case wasn't covered

// If new tree and hash masks are empty, and they were previously empty
// as well, we need to remove the node update.
updates.updated_nodes.remove(&path);

Comment on lines +840 to +846
} else if self
.branch_node_hash_masks
.get(&path)
.is_none_or(|mask| mask.is_empty()) &&
self.branch_node_hash_masks
.get(&path)
.is_none_or(|mask| mask.is_empty())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extract is_empty to vars pls

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's just an always inlined comparison of u16 to 0

@shekhirin shekhirin added C-bug An unexpected or incorrect behavior A-trie Related to Merkle Patricia Trie implementation labels Jan 16, 2025
@shekhirin shekhirin marked this pull request as ready for review January 16, 2025 15:03
@shekhirin shekhirin requested a review from Rjected as a code owner January 16, 2025 15:03
@shekhirin shekhirin added this pull request to the merge queue Jan 16, 2025
Merged via the queue into main with commit 2c21edf Jan 16, 2025
44 checks passed
@shekhirin shekhirin deleted the alexey/sparse-branch-node-masks-empty branch January 16, 2025 15:24
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