fix(poststate): ignore old changed storage values after selfdestruct#4199
Closed
fix(poststate): ignore old changed storage values after selfdestruct#4199
Conversation
Codecov Report
... and 16 files with indirect coverage changes
Flags with carried forward coverage won't be shown. Click here to find out more.
|
rakita
reviewed
Aug 15, 2023
| let mut post_state = PostState::new(); | ||
| post_state.destroy_account(1, address1, Account::default()); | ||
| post_state.create_account(1, address1, Account::default()); | ||
| post_state.change_storage( |
Collaborator
There was a problem hiding this comment.
Change storage here to some other slot 0x100 for example and check if changeset is set to zero value for that slot
Contributor
Author
|
closing yet again in favor of #3512 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
If the storage entry was changed after a primary selfdestruct within the same block, during history write its value would be written as
0because its plain state value would be ignored bystorage.storage.contains_key(..)checks below:reth/crates/storage/provider/src/post_state/mod.rs
Lines 555 to 564 in afea377
Solution
Do not write old storage values for the block storage change, if this account was previously wiped within the same block.