Repository navigation
execution/state: preserve seeded Done flags on in-flight removal flush - #26297
Closed
Amirhosein wants to merge 1 commit into
Closed
Amirhosein wants to merge 1 commit into
Amirhosein wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The condition accepts ordinary BAL-seeded cells, allowing an equal-value write alongside unseeded SelfDestruct=true to retain a stale Done incarnation instead of becoming Estimate; the exception must be limited to seeded BalancePath cells with matching ValueDeleted status.
1 open issue
What changed in this PR
This PR addresses #26286 by preserving resolved removal cells during matching in-flight flushes, reducing unnecessary dependencies in versioned state reads.
Changes:
- Mark cells written by
SeedEmptyRemovalsas seeded. - Reuse matching seeded Done cells during flushes.
- Add regression coverage for matching removals and mismatched writes.
| File | Description |
|---|---|
execution/state/versionmap.go |
Adds removal-seeding support and preserves matching seeded Done cells. |
execution/state/versionmap_seed_removal_test.go |
Tests Done preservation through flush, validation, and completion, plus mismatch fallback. |
execution/state/versionmap_access.go |
Marks removal cells as seeded after flushing them. |
Review effort: Balanced
| ci.accSource = AccountFromBase | ||
| vw.bind(e, ci) | ||
| return cells | ||
| keepSeededRemoval := destructed && ci.seeded() && ci.loadFlag() == FlagDone && ci.valStatus == vw.valStatus |
Comment on lines
+1544
to
+1547
| if ci, ok := e.SelfDestruct.Get(vw.Version.TxIndex); ok && ci.seeded() && ci.loadFlag() == FlagDone && ci.Value == vw.Val && ci.valStatus == vw.valStatus { | ||
| ci.accSource = AccountFromBase | ||
| cell = ci | ||
| } |
Contributor
Author
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.


Summary
Keep the
FlagDonestate ofSelfDestructPathandBalancePathcells seeded bySeedEmptyRemovalswhen a destroying transaction subsequently runs an in-flight flush (complete = false) with matching values, while leaving unseeded in-flight destructs unchanged.SelfDestructPathandBalancePathcells flushed bySeedEmptyRemovalsas seeded viaseedRemovalWrites.seeded() && FlagDonecells for equalSelfDestructPathandBalancePathwrites inFlushVersionedWrites/flushCellinstead of overwriting them withFlagEstimate.TestInFlightFlushOfSeededRemovalKeepsDoneFlagscovering both matching removals (remainingMVReadResultDonethrough in-flight flush, validation, and completion) and mismatched flushes (falling back toMVReadResultDependency).Closes #26286
Testing
go test -count=1 ./execution/stateERIGON_ASSERT=true go test -count=1 ./execution/stategolangci-lint run ./execution/state/...