Skip to content

Comments

[pull] forks/amsterdam from ethereum:forks/amsterdam#72

Merged
pull[bot] merged 4 commits intoLuckQuack:forks/amsterdamfrom
ethereum:forks/amsterdam
Feb 21, 2026
Merged

[pull] forks/amsterdam from ethereum:forks/amsterdam#72
pull[bot] merged 4 commits intoLuckQuack:forks/amsterdamfrom
ethereum:forks/amsterdam

Conversation

@pull
Copy link

@pull pull bot commented Feb 21, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

marioevz and others added 4 commits February 20, 2026 21:19
…k checks (#2203)

* feat(testing): Add check to verify no benchmark test exceeds limit

refactor(testing/specs): Abstract and reuse logic

refactor(testing/specs): Remove `tag` field

fix(test-filler): Wrapper test classes overwriting `BaseTest.spec_types`

refactor(tests): Kill unused `tag` from every test

fix(test-execute): Fix execute

fix: tox

* fix: review comments

* fix: upstream merge issue

* Apply suggestion from @marioevz

* fix: Bug and typing

Co-authored-by: spencer-tb <spencer.tb@ethereum.org>

---------

Co-authored-by: spencer-tb <spencer.tb@ethereum.org>
#2207)

Introduce a shared `PreState` protocol (`src/ethereum/state.py`) that
defines the read-only interface any pre-execution state provider must
support: `get_account_optional`, `get_storage`, `account_has_storage`,
and `compute_state_root_and_trie_changes`.

Move `Account`, `Address`, `Root`, and trie internal node types to the
shared module so they can be referenced by the protocol without
circular imports.

Add `DictPreState` in amsterdam's `state.py` as an in-memory
implementation backed by `Trie` dicts, along with helper functions
`dict_pre_state_set_account` and `dict_pre_state_set_storage` for
populating it.

feat(amsterdam): replace mutable State with BlockStateTracker/TxStateTracker

Replace the mutable `State` class (with in-memory tries, snapshots,
and rollback) with lightweight state trackers that record diffs on top
of a read-only `PreState`.

Add `state_tracking.py` with `BlockStateTracker` (block-level
accumulator) and `TxStateTracker` (per-transaction tracker). All state
read/write operations now go through these trackers with the read
chain: TxStateTracker -> BlockStateTracker -> PreState.

Snapshot/rollback is replaced by copy-on-write via
`copy_tx_state_tracker`/`restore_tx_state_tracker`. Transient storage
moves from a separate `Trie`-based class to a simple dict on the
tracker.

At block end, `extract_block_diffs` produces the accumulated changes
and `PreState.compute_state_root_and_trie_changes` computes the state
root. `apply_diffs_to_state` advances `chain.state` for subsequent
blocks.

Simplify `State` to just hold tries (no snapshots/created_accounts).
Remove all mutable state operations from `state.py` (moved to
`state_tracking.py`). Update all consumer modules (fork.py, VM,
interpreter, instructions, eoa_delegation, message utils).

Co-authored-by: Peter Miller <ultratwo@gmail.com>

feat(t8n): update tooling to support BlockStateTracker forks

Update the t8n tool and fork loader to work with forks that use
`BlockStateTracker` instead of the mutable `State`.

In `fork_loader.py`, add `has_block_tracker` detection and
conditionally return `DictPreState`, `dict_pre_state_set_account`, and
`dict_pre_state_set_storage` for Amsterdam.

In `t8n/__init__.py`, create a `BlockStateTracker` wrapping the
`DictPreState` alloc when `has_block_tracker` is true, and pass
`block_tracker=` instead of `state=` to `BlockEnvironment`.

In `t8n_types.py`, compute the state root from block tracker diffs via
`extract_block_diffs` + `compute_state_root_and_trie_changes`, then
apply diffs back to the `DictPreState` for alloc output.

refactor(amsterdam): consolidate DictPreState into State

Make State implement the PreState protocol directly instead of
maintaining a separate DictPreState wrapper class. This eliminates
duplication since both had identical _main_trie and _storage_tries
fields. Simplifies fork_loader.py by removing has_block_tracker
conditionals from State/set_account/set_storage properties.

replace BAL with state tracker

fix(spec): clean-up code

fix(specs): remove tracker suffix from names

fix(specs): post-review updates

fix(specs): fix docstring references

fix(tool): fix EMPTY_ACCOUNT in fork loader

add state_root to amsterdam

fix(ci): remove optimized ci run

The optimized run is no longer compatible with the state tracker and will have to be refactored/redesigned. The commit takes it out of the CI with the aim of adding it back once ready
* chore(ai): ask user to fill new tests after impl; check against JSON

* feat(test): add more invalid BAL tests for duplicate entries within accounts

* chore: add unit tests for BAL modifiers

* chore: add modifier and test for duplicated code changes
* refactor(test-execute): Use batch rpc requests

Add skip_code option, batch worker seed fundings

save

fix: Chain builder EthRPC

fix: tox

Add deterministic deploy contract to hive's pre

Handle invalid transaction tests

tox

tox

refactor(tests-benchmark): fewer post checks

* Update packages/testing/src/execution_testing/rpc/rpc.py

Co-authored-by: spencer <spencer.tb@ethereum.org>

* fix: review comments

* fix: tox

* fix: remove unused code

---------

Co-authored-by: spencer <spencer.tb@ethereum.org>
@pull pull bot locked and limited conversation to collaborators Feb 21, 2026
@pull pull bot added the ⤵️ pull label Feb 21, 2026
@pull pull bot merged commit fa39bdc into LuckQuack:forks/amsterdam Feb 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants