From 7875f058c41b20252fc334e761830e6f9127c968 Mon Sep 17 00:00:00 2001 From: Edgar Date: Wed, 13 May 2026 16:46:21 +0200 Subject: [PATCH] fix(consume): add ethereum/execution-specs to SUPPORTED_REPOS `FixtureDownloader.get_cache_path` versions the on-disk cache directory by release tag only when the release URL's owner/repo appears in `SUPPORTED_REPOS`. Otherwise it falls through to the unversioned `cache_folder / "other" / ` path. When the BAL fixture release was moved from `ethereum/execution-spec-tests` to `ethereum/execution-specs` for `tests-bal@v7.1.0`, the new URL stopped being recognized as a release URL. A v7.0.0 download from a prior session, cached at `other/fixtures_bal/`, kept satisfying every subsequent request, including ones for v7.1.0. Consumers got stale fixtures with no warning. Add `ethereum/execution-specs` to `SUPPORTED_REPOS` so its release URLs hit the versioned cache path. Add regression tests covering `is_release_url` against every supported repo and asserting the new entry is present. Discovered while validating ethrex against tests-bal@v7.1.0: 76 SD-related ef-tests appeared to fail due to a spec mismatch, but the client was actually executing v7.1.0 semantics against v7.0.0 fixtures served by the stale cache. After clearing `~/.cache/ethereum-execution-spec-tests/cached_downloads/` all 2145 amsterdam tests pass. --- .../plugins/consume/releases.py | 1 + .../plugins/consume/tests/test_releases.py | 61 +++++++++++++++++++ 2 files changed, 62 insertions(+) diff --git a/packages/testing/src/execution_testing/cli/pytest_commands/plugins/consume/releases.py b/packages/testing/src/execution_testing/cli/pytest_commands/plugins/consume/releases.py index 159d7d467d1..556fa7fe2c3 100644 --- a/packages/testing/src/execution_testing/cli/pytest_commands/plugins/consume/releases.py +++ b/packages/testing/src/execution_testing/cli/pytest_commands/plugins/consume/releases.py @@ -20,6 +20,7 @@ SUPPORTED_REPOS = [ "ethereum/execution-spec-tests", + "ethereum/execution-specs", "ethereum/tests", "ethereum/legacytests", ] diff --git a/packages/testing/src/execution_testing/cli/pytest_commands/plugins/consume/tests/test_releases.py b/packages/testing/src/execution_testing/cli/pytest_commands/plugins/consume/tests/test_releases.py index f34479b1dff..0b36da6228b 100644 --- a/packages/testing/src/execution_testing/cli/pytest_commands/plugins/consume/tests/test_releases.py +++ b/packages/testing/src/execution_testing/cli/pytest_commands/plugins/consume/tests/test_releases.py @@ -7,8 +7,10 @@ import pytest from ..releases import ( + SUPPORTED_REPOS, ReleaseInformation, get_release_url_from_release_information, + is_release_url, parse_release_information_from_file, ) @@ -61,3 +63,62 @@ def test_release_parsing( ) == get_release_url_from_release_information( release_name, release_information ) + + +@pytest.mark.parametrize( + "url,expected", + [ + # All currently supported release-hosting repos must be recognized so + # `FixtureDownloader.get_cache_path` versions the cache directory by + # release tag. A repo missing from `SUPPORTED_REPOS` falls through to + # the unversioned `cache_folder / "other" / archive_name` path, which + # silently shadows newer releases with the same archive filename. + ( + "https://github.com/ethereum/execution-spec-tests/releases/download/v3.0.0/fixtures_stable.tar.gz", + True, + ), + ( + "https://github.com/ethereum/execution-specs/releases/download/tests-bal%40v7.1.0/fixtures_bal.tar.gz", + True, + ), + ( + "https://github.com/ethereum/tests/releases/download/v14.0/some.tar.gz", + True, + ), + ( + "https://github.com/ethereum/legacytests/releases/download/v1.0/some.tar.gz", + True, + ), + ( + # Not a recognized repo; must NOT match. + "https://github.com/some-fork/execution-spec-tests/releases/download/v1/foo.tar.gz", + False, + ), + ( + # Local path, not a URL. + "./fixtures", + False, + ), + ], +) +def test_is_release_url_covers_supported_repos( + url: str, expected: bool +) -> None: + """ + All entries in `SUPPORTED_REPOS` must be matched by `is_release_url`. + + Regression test for bal-devnet-7: when the BAL fixture URL moved from + `execution-spec-tests` to `execution-specs`, the new URL stopped being + recognized as a release URL, so the cache key dropped the version tag and + a `tests-bal@v7.0.0` download from a prior session silently shadowed + `tests-bal@v7.1.0`. + """ + assert is_release_url(url) is expected + + +def test_supported_repos_contains_execution_specs() -> None: + """ + `ethereum/execution-specs` hosts the BAL fixture releases (from + `tests-bal@v7.1.0` onward) and must be in `SUPPORTED_REPOS`. + """ + assert "ethereum/execution-specs" in SUPPORTED_REPOS