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): consider all intermediate nodes invalidated for wiped storage #10476

Merged
merged 4 commits into from
Aug 26, 2024

Conversation

rkrasiuk
Copy link
Member

@rkrasiuk rkrasiuk commented Aug 23, 2024

Description

For overlay root, we construct prefix set based on bundle state. When the storage gets wiped, the prefix set contains only the slots modified in the block. This means that if the storage trie for account already has intermediate nodes in the database that would not be updated during recomputation, they will be picked up by the storage root calculator and considered part of the trie.

Fix this behavior by introducing all flag on the prefix set which invalidates all intermediate nodes.

@rkrasiuk rkrasiuk added C-bug An unexpected or incorrect behavior A-trie Related to Merkle Patricia Trie implementation labels Aug 23, 2024
@rkrasiuk rkrasiuk marked this pull request as ready for review August 23, 2024 07:08
@rkrasiuk rkrasiuk requested a review from mattsse August 23, 2024 07:08
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

naming bikeshed

crates/trie/trie/src/prefix_set.rs Show resolved Hide resolved
Copy link
Member

@Rjected Rjected left a comment

Choose a reason for hiding this comment

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

I'm ok with the naming, but would also like some more doc comments on the struct

crates/trie/trie/src/prefix_set.rs Show resolved Hide resolved
@rkrasiuk rkrasiuk added this pull request to the merge queue Aug 26, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 26, 2024
@rkrasiuk rkrasiuk force-pushed the rkrasiuk/fix-wiped-storage-prefix-set branch from 6a67f53 to db0ff1e Compare August 26, 2024 07:46
@rkrasiuk rkrasiuk added this pull request to the merge queue Aug 26, 2024
Merged via the queue into main with commit cb6e5ed Aug 26, 2024
35 checks passed
@rkrasiuk rkrasiuk deleted the rkrasiuk/fix-wiped-storage-prefix-set branch August 26, 2024 08:16
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.

4 participants