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): dangling storage hashes #4108

Merged
merged 2 commits into from
Aug 8, 2023

Conversation

rkrasiuk
Copy link
Member

@rkrasiuk rkrasiuk commented Aug 8, 2023

Description

If we compute the state root incrementally for a block range where the account got self-destructed, there is a possibility that the intermediate hashes of its storage trie would not be deleted. If the account is re-created later, its previous intermediate hashes might be considered a part of the current storage trie. This is addressed by always removing the storage nodes for any account that has been destroyed.

Should close #4107

@rkrasiuk rkrasiuk added C-bug An unexpected or incorrect behavior A-trie Related to Merkle Patricia Trie implementation labels Aug 8, 2023
@codecov
Copy link

codecov bot commented Aug 8, 2023

Codecov Report

Merging #4108 (818b1ee) into main (aaf2d2c) will decrease coverage by 0.11%.
Report is 7 commits behind head on main.
The diff coverage is 93.84%.

Impacted file tree graph

Files Changed Coverage Δ
crates/storage/provider/src/traits/hashing.rs 0.00% <ø> (ø)
crates/trie/src/prefix_set/mod.rs 83.11% <ø> (ø)
...torage/provider/src/providers/database/provider.rs 79.58% <89.65%> (-0.02%) ⬇️
crates/trie/src/prefix_set/loader.rs 97.05% <93.75%> (-2.95%) ⬇️
crates/trie/src/trie.rs 96.68% <100.00%> (+0.04%) ⬆️
crates/trie/src/updates.rs 90.24% <100.00%> (+0.37%) ⬆️

... and 37 files with indirect coverage changes

Flag Coverage Δ
integration-tests 16.51% <0.00%> (+0.01%) ⬆️
unit-tests 63.93% <93.84%> (-0.09%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
reth binary 25.52% <ø> (+<0.01%) ⬆️
blockchain tree 83.04% <ø> (ø)
pipeline 90.07% <ø> (ø)
storage (db) 74.59% <89.65%> (+0.03%) ⬆️
trie 94.71% <97.22%> (+<0.01%) ⬆️
txpool 47.59% <ø> (-0.78%) ⬇️
networking 77.41% <ø> (-0.04%) ⬇️
rpc 57.47% <ø> (+0.01%) ⬆️
consensus 63.76% <ø> (-0.32%) ⬇️
revm 32.26% <ø> (-0.28%) ⬇️
payload builder 6.57% <ø> (-0.02%) ⬇️
primitives 87.76% <ø> (-0.26%) ⬇️

@rkrasiuk rkrasiuk added P-critical This must be fixed immediately or contributors or users will be severely impacted M-changelog This change should be included in the changelog labels Aug 8, 2023
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.

always selfdestruct

@rkrasiuk
Copy link
Member Author

rkrasiuk commented Aug 8, 2023

always!!!

@rkrasiuk rkrasiuk added this pull request to the merge queue Aug 8, 2023
Merged via the queue into main with commit 9175129 Aug 8, 2023
24 checks passed
@rkrasiuk rkrasiuk deleted the rkrasiuk/fix-dangling-storage-hashes branch August 8, 2023 09:05
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 M-changelog This change should be included in the changelog P-critical This must be fixed immediately or contributors or users will be severely impacted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stopped Syncing at Block 17867060
2 participants