erigontech / erigontech/erigon

core/state: no need to delete storage slots in CreateContract since we now have EIP-7610 implemented

Open
#15,443 1 comment 0 reactions 1 assignee Claimed by @yperbasis View on GitHub
tech debt reduction
Dominant language
Go
Stars
3.6k
Forks
1.5k
Avg merge
1d 16h
Merged PRs (30d)
455

Description

work to remove `w.tx.DomainDelPrefix(kv.StorageDomain, address[:], w.txNum)` in `StateWriter.CreateContract` (`state.Writer` implementation is the main one but also check others)

after EIP-7610 (applied retrospectively for all blocks from block 0) we no longer need to do this since if any transaction at any block tries to create a contract which has storage then execution will return a collision error (as per spec) and that happens before we reach the call to `StateWriter.CreateContract` - so we are guarded and calling `DomainDelPrefix(kv.StorageDomain, address[:], w.txNum)` is pointless

when I tried removing it 1 month ago 2 tests failed:
- TestDeleteRecreateSlots
- TestDeleteRecreateSlotsAcrossManyBlocks

they are legit test cases that should pass without `DomainDelPrefix(kv.StorageDomain, address[:], w.txNum)` but I think we have some bug in how we instantiate these tests - something weird happening when initiating the initial state - will debug further

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.