ethereum / ethereum/execution-specs

fix(test-fill): Engine X fixtures never emit `postStateDiff`

Closed
#3,160 1 comment 0 reactions 1 assignee Claimed by @danceratopz View on GitHub
A-test-fill C-bug stale
Dominant language
Python
Stars
1.2k
Forks
505
Avg merge
2d 14h
Merged PRs (30d)
116

Description

## Problem

`BlockchainEngineXFixture` was designed to carry a `postStateDiff`: the accounts a test's execution changed relative to its pre-allocation group's genesis, as the format's small substitute for the full `postState` that `blockchain_test` and `blockchain_test_engine` fixtures carry. It has never been emitted: every Engine X fixture ever filled contains no post-state data at all (no `postState`, no `postStateDiff`, no `postStateHash`).

The wiring has been dead since the format was introduced in a404f8a16f1, hidden by three independent layers:

1. The filler computes the diff behind `hasattr(fixture, "post_state")`, but `BlockchainEngineXFixture` has no `post_state` field and its `extra: "ignore"` config silently drops the value that `make_hive_fixture` passes in, so `calculate_post_state_diff` is unreachable.
2. `post_state_validator` (which enforces that exactly one post-state field is provided, and would have raised on every Engine X fixture) never attaches its validator: the decorator defines it and then just does `return cls`.
3. Nothing on the consume side reads the field, so no consumer ever failed. Only the format docs describe it (`docs/running_tests/test_formats/blockchain_test_engine_x.md`).

Omitting the full `postState` from Engine X is deliberate (size, same reason `pre` is a `preHash` reference); omitting the diff is not: the field, the compute function, the docs, and the validator were all built for it.

## Impact

- The consume-side post-state verification the format docs describe is impossible.
- Fixing this enables the follow-up fill-time post-state drift check for pre-alloc group packing (#3122), which silently no-ops without it (#3161).

## Proposed fix

- Compute the diff in `make_hive_fixture` for the Engine X format, where the post-state `alloc` and the genesis baseline `pre` are both in scope (in phase 2, `pre` is the group's pre-allocation, so it is the correct diff baseline by construction); move `calculate_post_state_diff` out of the filler plugin and delete the dead post-processing block.
- Reimplement `post_state_validator` so it actually runs, with a test that it fires. Care: already-released Engine X fixtures legitimately contain neither field and must keep parsing on consume.

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.