[pull] forks/amsterdam from ethereum:forks/amsterdam#71
Merged
pull[bot] merged 6 commits intoLuckQuack:forks/amsterdamfrom Feb 20, 2026
Merged
[pull] forks/amsterdam from ethereum:forks/amsterdam#71pull[bot] merged 6 commits intoLuckQuack:forks/amsterdamfrom
pull[bot] merged 6 commits intoLuckQuack:forks/amsterdamfrom
Conversation
* feat(tests): port EXTCODEHASH self-reference static test Port extCodeHashSelfFiller.json: EXTCODEHASH/EXTCODESIZE of the currently executing account (Op.ADDRESS). * Apply suggestions from code review Co-authored-by: Mario Vega <marioevz@gmail.com> --------- Co-authored-by: Mario Vega <marioevz@gmail.com>
* feat(fill): Add --dist loadgroup for xdist test grouping
- Enable pytest-xdist loadgroup distribution mode by default.
- Required for xdist_group markers to control worker assignment.
* feat(fixtures): Add nodeid helpers for cache keys and xdist grouping
- Add strip_fixture_format_from_nodeid() to extract base nodeid.
- Add get_all_fixture_format_names() for format name lookup.
- Used to ensure related fixture formats share cache keys.
* feat(fill): Add T8nOutputCache and xdist grouping for cache locality
- Add T8nOutputCache LRU cache class for storing t8n outputs.
- Add t8n_output_cache field to FillingSession.
- Add xdist_group markers during collection for --dist=loadgroup.
- Use t8n-cache-{hash} prefix to distinguish from user-defined groups.
- Strip cache-specific @t8n-cache-* suffix from nodeids in TestInfo.
* feat(specs): Integrate t8n output cache in BlockchainTest
- Add cache key helpers to BaseTest (_get_base_nodeid, _get_t8n_cache_key).
- Add _get_filling_session() to access cache from test instances.
- Cache t8n outputs in _generate_block_data() for reuse across formats.
- Skip caching for engine_x and engine_sync variants (different execution).
* test(fill): Add unit tests for t8n output cache
- Test T8nOutputCache LRU behavior, eviction, and hit/miss tracking.
- Test strip_fixture_format_from_nodeid for various nodeid patterns.
- Test get_all_fixture_format_names ordering and contents.
- Test cache key consistency across fixture format variants.
- Test _strip_xdist_group_suffix preserves non-cache group markers.
* test(fill): Add tests for xdist collection sorting behavior
Add tests to verify that test items are sorted during collection
to ensure deterministic cache hits. The tests demonstrate:
- Sorting groups related fixture formats by base nodeid.
- Without xdist, items are correctly sorted.
- With xdist, items are NOT sorted (BUG causing high variance).
- Expected vs actual behavior comparison.
The xfail test `test_xdist_sorting_required_for_cache_hits` asserts
the correct behavior (sorting with xdist) and fails until the fix
is applied.
* refactor(fill): Keep xdist grouping without sorting for cache testing
* refactor(testing): Use fixture format directly
* refactor(testing): Move properties
* fix(testing): Remove fixture_format as property of the spec
* fix(testing): Fill always count opcodes
* fix: typo
* feat(test-fill): Add xdist cache stats aggregation for terminal display
- Add helper methods to TransitionToolCacheStats for serialization.
- Initialize aggregated stats on xdist controller in pytest_configure.
- Send worker stats via workeroutput in fixture teardown.
- Add pytest_testnodedown hook to aggregate stats from workers.
- Update pytest_terminal_summary to display aggregated stats.
* fix(testing): reset cache counters to avoid double-counting stats
* fix(testing): use hash for xdist_group name to fix loadgroup scheduling
* refactor(testing): Simplify OutputCache to single-key design
* fix(testing): Clear cache data when test doesn't use caching
- Clear `_cache` in `remove_cache()` to prevent stale data leakage.
- Tests without `transition_tool_cache_key` (e.g., state_test) could
previously retrieve cached results from prior tests via matching
`call_counter` subkeys.
* feat(testing): Add cache-friendly sorting with slow-first grouping
Sort test items by (is_slow, base_nodeid, nodeid) to optimize execution:
- Slow tests first (LPT scheduling for xdist load balance).
- Related fixture formats grouped together (cache locality).
- Deterministic order within groups.
If ANY fixture format variant of a test is marked slow, ALL variants
are treated as slow to keep them grouped together for cache hits.
Reuses the base_nodeid cache for xdist marker generation to avoid
redundant strip_fixture_format_from_node calls.
* fix(testing): Clear cache data when test doesn't use caching
BlockchainEngineXFixture and BlockchainEngineSyncFixture had
can_use_cache=False which was dead code (never checked anywhere).
Replace with transition_tool_cache_key="" which is the actual mechanism
that controls caching — empty string means no caching.
* feat(testing): Add cache-friendly sorting with slow-first grouping
For StateTest specs with --generate-all-formats, the _from_state_test
label suffixes cause alphabetical sort to interleave cacheable and
non-cacheable formats: blockchain_test_engine_from_state_test (cacheable)
→ blockchain_test_engine_x_from_state_test (non-cacheable, clears cache)
→ blockchain_test_from_state_test (cacheable, but cache is gone).
Add has_cache_key to the sort key so cacheable formats cluster together
within each base nodeid group, ensuring the second cacheable format hits
the warm cache before any non-cacheable format clears it.
* fix(testing): Strip xdist group suffix from address entropy
node_id_for_entropy strips fixture format and fork names from the node
ID before hashing it for deterministic address generation. However, it
did not strip the xdist @group_name suffix (e.g., @t8n-cache-abc12345),
causing different addresses when running with vs without xdist workers.
Strip the suffix so addresses are deterministic regardless of whether
xdist is active.
* feat(testing): Improve t8n cache stats to show expected hit rate
Replace the raw hit/miss counts with an efficiency metric where 100%
means all tests that could have hit the cache did hit it. Track unique
cache keys to compute expected hits (total cacheable - unique keys).
Also filter subkey stats to only count cacheable tests, eliminating
phantom misses from non-cacheable tests that still interact with the
OutputCache after remove_cache().
Before: T8n cache: key_hits=6, key_misses=6 (50.0%), subkey_hits=6, subkey_misses=18 (25.0%)
After: T8n cache: 100% hit rate (6/6 expected), 6 t8n calls saved
* fix(testing): Use subprocess mode for benchmark pytester fill tests.
Pydantic's ModelMetaclass caches __init__ wrappers for dynamically
created classes. When pytester runs multiple fill sessions in-process,
cached wrappers from an earlier session re-invoke __init__ re-entrantly
in later sessions, causing generate() to run twice per test and
doubling the opcode count.
- Switch fill tests to runpytest_subprocess() for process isolation.
- Normal `fill` runs are unaffected (each invocation is a fresh process).
* fix(testing): Merge duplicate pytest_testnodedown hooks.
The rebase introduced a second pytest_testnodedown definition for cache
stats aggregation, shadowing the existing timing logs hook. Extract the
cache stats logic into _aggregate_cache_stats() and call it from the
single hook.
* fix(testing): Remove unused methods and imports from BaseTest.
Remove dead code that was never called: _get_base_nodeid(),
_get_t8n_cache_key(), _get_filling_session() from BaseTest and
remove_opcode_count() from TransitionTool. Also remove the
now-unused strip_fixture_format_from_node import, TYPE_CHECKING
import, and guarded FillingSession import block from base.py.
* fix(testing): Add clear() method to OutputCache and fix docstrings.
Add a clear() method to OutputCache to encapsulate clearing the
internal _cache dict and resetting the key, instead of having
TransitionTool.remove_cache() reach into private members directly.
Also fix the set_cache docstring ("LRU behavior" → "single-key
eviction"), fix the cached_result truthiness check to use
`is not None` for defensive correctness, and fix the node()
docstring to say "pytest node" instead of "node ID".
* fix(testing): Strip xdist group suffix from pre-alloc group test IDs.
The @t8n-cache-* xdist group suffix was leaking into the test_id and
group_salt stored in pre-alloc groups, causing fixture output to differ
from runs without xdist. Use _strip_xdist_group_suffix() (already used
by node_to_test_info) on both the group_salt fallback and the test_id
passed to add_test_pre.
* test(testing): Add unit tests for OutputCache.
Test set_key eviction, get/set round-trip, hit/miss counter
accuracy, clear() behavior, and state across key changes.
Uses sentinel objects as lightweight stand-ins for
TransitionToolOutput.
* fix: typing
---------
Co-authored-by: Mario Vega <marioevz@gmail.com>
* chore(ci): switch benchmark fill from evmone to geth * chore: remove duplicate benchmark tox environment * chore: remove unnecessary comment that is now outdated * chore: add PREVRANDAO as synonym for DIFFICULTY --------- Co-authored-by: fselmo <fselmo2@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 : )