execution/state: an existence read at a seeded destruct stays valid once a re-run removes the account
Maintainers usually reply within 1 day
@mh0lt is already working on this.
Since Nov 18, 2026.
Assessment
This issue has not been assessed yet.
Description
On a block with an access list, a read of an account's existence can stay valid at the seal although a re-run finds the account absent. It is the existence version of #26463.
- The access list seeds a removal of
xat tx 3, as a Done destruct at incarnation 0. - The first run of tx 3 creates
xat (3, 0). tx 4 callsExist(x)and gets true. InversionedAccountBase, an account cell at the destruct's tx that does not come from the access list makes the read return the committed record ("Only a re-creation by the destroying tx itself is left to the committed reader"), and nothing records that decision. tx 4 records only the destruct and the wiped fields at the destruct's version. - The re-run of tx 3 removes
x, as the access list says. The drop deletes the create's cells, and the flush keeps the seeded destruct at its version (#26326), so every read of tx 4 stays valid, while a freshExist(x)returns false.
tx 4 is then committed as if x existed, for example with the gas of a call to an existing account. The trigger is a tx that runs at least twice with different results, and a later tx validated in between. A harness of 144 run sequences over a seeded removal finds 34 such reads on main.
Repro
In execution/state (uses accountStateReader from versionmap_seed_removal_test.go). It fails on main (3e201075dc) at the last assertion.
func TestExistenceReadAtASeededDestructIsStaleOnceTheRemovalReturns(t *testing.T) {
x := accounts.InternAddress(common.HexToAddress("0xd6"))
acc := accounts.NewAccount()
acc.Balance = *uint256.NewInt(5)
base := &accountStateReader{accounts: map[accounts.Address]*accounts.Account{x: &acc}}
// The access list seeds a removal of x at tx 3.
vm := NewVersionMap(types.BlockAccessList{{Address: x.Value(), BalanceChanges: []*types.BalanceChange{{Index: 4, Value: uint256.Int{}}}}})
vm.SeedAddresses()
require.NoError(t, vm.SeedEmptyRemovals(true, false, base))
exists := func() (bool, ReadSet) {
ibs := NewWithVersionMap(base, vm)
defer ibs.Close()
ibs.SetTxContext(1, 4)
ok, err := ibs.Exist(x)
require.NoError(t, err)
require.False(t, ibs.HadInvalidRead())
return ok, ibs.VersionedReads()
}
// The first run of tx 3 creates x.
run := NewWithVersionMap(base, vm)
run.SetTxContext(1, 3)
require.NoError(t, run.CreateAccount(x, true))
require.NoError(t, run.SetNonce(x, 1, tracing.NonceChangeUnspecified))
require.NoError(t, run.SetBalance(x, uint256.Int{}, tracing.BalanceChangeUnspecified))
require.NoError(t, run.MakeWriteSet(&chain.Rules{IsAmsterdam: true}, NewNoopWriter()))
create := run.VersionedWrites()
run.Close()
vm.FlushVersionedWrites(create, false)
vm.MarkWritesValidated(create, nil)
existed, reads := exists()
require.True(t, existed)
// The re-run of tx 3 removes x, as the access list says.
rerun := Version{TxIndex: 3, Incarnation: 1}
removal := &WriteSet{}
removal.SetEmptyRemoval(x, rerun)
for h := range create.AllHeaders() {
if !removal.Has(h) {
vm.DropWrite(h.Address, h.Path, h.Key, rerun)
}
}
vm.FlushVersionedWrites(removal, false)
vm.MarkWritesValidated(removal, nil)
vm.MarkWritesComplete(removal)
vm.SealUpTo(3)
existsAtSeal, _ := exists()
require.False(t, existsAtSeal)
require.Equal(t, VersionInvalid, vm.ValidateReadSet(4, reads, validateEqualVersion, false, ""), "tx 4 read x as existing")
}
Found in the review of #26447.
- Dominant language
- Go
- Stars
- 3.6k
- Forks
- 1.6k
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 820
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from erigontech/erigon
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
erigontech/erigon#26523 ·
Maintainers usually reply within 1 day
-
flaky test
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
erigontech/erigon#26230 ·
Maintainers usually reply within 1 day
-
txnprovider/txpool: pending nonce counts past gaps in the poolPossibly taken @yperbasis claimed this 7 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
erigontech/erigon#26014 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
tracing: expose custom error selector and raw payload in callTracer revertReasonPossibly taken @lupin012 claimed this 9 days ago. OpenRPC
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
erigontech/erigon#25928 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
txnprovider/txpool: remove redundant blob/commitment length checkPossibly taken @yperbasis claimed this 14 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
erigontech/erigon#25432 ·
Maintainers usually reply within 1 day
All issues in erigontech/erigon
Similar issues
-
enhancement exporter/awskinesis needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
open-telemetry/opentelemetry-collector-contrib#53334 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 83/100
SocialGouv/iterion#3376 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
seaweedfs/seaweedfs#12740 · 2 comments ·
Maintainers usually reply within 1 day
-
area:indexer bug needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
seanb4t/codegraph-go#385 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day