fix: check hashed state for loading TriePrefixSets::destroyed_accounts
#12235
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.
During a pipeline unwind, the
MerkleUnwind
stage will deal with an unwound hashed state and a non-unwound plain state. On normal execution,destroyed_accounts
are populated if accounts are no longer present onPlainState
. This will eventually delete any existing storage tries.However, on a unwind to a block where an address is no longer present and used to have storage tries, this does not happen, since we only unwind
PlainState
after theMerkleUnwind
. Resulting in forgotten storage tries. Leading to the the following failure case on holesky:2631791 → unwind 2631774 ✅ → 2631775 state root error ❌
By looking at hashed state instead, this can be solved
edit:
Performance wise I don't know if this has an impact actually. We're searching a table with 32byte key instead of 20byte. Should additional logic be added?
if _unwind_ { check hashed_state } else { check plain_state }