ethereum / ethereum/execution-specs
chore(test-fill): make pre-alloc grouping safe for `ported_static` and remove the Engine X drift
- Dominant language
- Python
- Stars
- 1.2k
- Forks
- 505
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 116
Description
### Background
`fill` packs Engine X fixtures into shared pre-alloc groups (optimistic grouping). Tests ported from static fillers keep raw hardcoded addresses, so one packed test's contracts can land at addresses another test blindly touches. Today we defend against this after the fact:
- `engine_x_checks.py` re-runs the phase 2 output against the group genesis and compares fixtures, masking expected `blockAccessList` differences caused by the group genesis hash (#3219, superseded by #3265).
- Leaky tests are isolated one by one with `pre_alloc_group("separate")` (#3176, #3219).
- #3390 adds `--disable-optimistic-pre-alloc-grouping` as an escape hatch for releases.
This machinery is brittle. It produced 18k false positives in the `glamsterdam-devnet@v7.2.1` release before the mask fix, and the review discussion on #3219 flagged the check as hard to maintain. It only exists because packing is not safe by construction. #3265 now carries all of it as one PR: the #3219 drift-check fixes plus a typed rebuild of the check with causal diagnostics (#3219 is closed in its favour). That makes the interim machinery safer to operate but does not change the end state here: packing safe by construction, then the check deleted.
### Action items
- [x] Land #3390 (optimistic grouping flag).
- [x] Follow-ups or additions from the #3390 review:
- [x] Make `hasher compare` skip `pre_alloc/`.
- [x] ~~Add pytester coverage for the new flag.~~ WON'T FIX
- [x] Create new release due to breaking changes in #3390.
- [x] Bump generic hive workflow to use new release: https://github.com/ethpandaops/hive-tests/pull/91
- [x] Rebase the #3219 drift check fixes on top of #3390.
- [ ] Land #3265: the rebased #3219 fixes plus the typed rebuild of the check per its review feedback (urgent as blocks releases).
- [ ] Migrate `tests/ported_static/` off hardcoded addresses to dynamically allocated ones (`pre.deploy_contract`, `pre.fund_eoa`). Blind calls to raw addresses like `0x1000` are the leak surface. The reserved-address logic only protects addresses below `0x100`, precompiles, and multi-group system contracts.
- [ ] Remove the drift-check machinery once the migration is complete:
- [ ] `engine_x_checks.py`, its BAL parent-hash masking, and its unit tests.
- [ ] The phase 2 verification hook in `filler.py`.
- [ ] The `pre_alloc_group("separate")` markers that exist only to dodge leaks (the ones with a real semantic reason stay).
- [ ] Reassess whether the #3390 flag is still worth keeping once packing is safe by construction.
Contributor guide
Assessment
This issue has not been assessed yet.