erigontech / erigontech/erigon
Remove ExecV3: Varied block scenarios (execution-spec-test style)
- Dominant language
- Go
- Stars
- 3.6k
- Forks
- 1.5k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 455
Description
## Sub-task of #19318
### Phase 1e: Varied block scenarios
**File**: `execution/engineapi/engine_api_builder_test.go`
The execution-spec-tests cover diverse transaction patterns that stress different parts of the state write path. Builder tests should exercise the same variety to ensure the single-pass writer handles all cases correctly.
Available test contracts from `execution/state/contracts/`:
- `contracts.DeployChanger` — simple state change
- `contracts.DeployPoly` — polymorphic deploy + event emission
- `contracts.DeploySelfdestruct` — self-destruct testing
- `contracts.DeployPhoenix` — self-destruct and revival
- `contracts.DeployRevive` / `DeployRevive2` — account revival after self-destruct
Contract deployment uses `bind.TransactOpts` + `eat.ContractBackend` (pattern from `engine_api_reorg_test.go`).
**Scenario matrix:**
| Scenario | State write path exercised |
|----------|---------------------------|
| Simple transfers | `UpdateAccountData` (balance, nonce) |
| Contract creation | `UpdateAccountCode`, `CreateContract` |
| Storage writes | `WriteAccountStorage` |
| Self-destruct | `DeleteAccount`, balance transfer |
| Multi-tx same sender | Sequential nonce, cumulative balance |
| Multi-sender block | Interleaved account updates |
| Failing tx (revert) | Gas consumed but state reverted |
| Withdrawal processing | Balance increase via `BalanceInc` |
| Mixed block | All write paths combined |
Each scenario builds blocks via `MockCl.BuildCanonicalBlock()` and verifies the block is accepted by validation (which re-executes via ExecV3 and checks the state root matches).
For `ExecModuleTester` scenarios, use `blockgen.GenerateChain` with custom tx callbacks for contract creation, storage writes, etc.
Contributor guide
Assessment
This issue has not been assessed yet.