diff --git a/.github/scripts/generate_eip_report.py b/.github/scripts/generate_eip_report.py new file mode 100644 index 00000000000..66ff8534c53 --- /dev/null +++ b/.github/scripts/generate_eip_report.py @@ -0,0 +1,147 @@ +"""Generate a markdown report of outdated EIP references from the EIP version checker output.""" + +import os +import re +import sys +import textwrap +from string import Template + +# Report template using textwrap.dedent for clean multiline strings +REPORT_TEMPLATE = Template( + textwrap.dedent("""\ + # EIP Version Check Report + + This automated check has detected that some EIP references in test files are outdated. This means that the EIPs have been updated in the [ethereum/EIPs](https://github.com/ethereum/EIPs) repository since our tests were last updated. + + ## Outdated EIP References + + ### Summary Table + + | File | EIP Link | Referenced Version | Latest Version | + | ---- | -------- | ------------------ | -------------- | + $summary_table + + ### Verbatim Failures + + ``` + $fail_messages + ``` + + ### Verbatim Errors + + ``` + $error_messages + ``` + + ## Action Required + + 1. Please verify whether the affected tests need updating based on changes in the EIP spec. + 2. Update the `REFERENCE_SPEC_VERSION` in each file with the latest version shown above. + 3. For detailed instructions, see the [reference specification documentation](https://eest.ethereum.org/main/writing_tests/reference_specification/). + + ## Workflow Information + + For more details, see the [workflow run](https://github.com/ethereum/execution-spec-tests/actions/runs/$run_id). +""") # noqa: E501 +) + + +def extract_failures(output): + """Extract failure information from the output using regex.""" + failures = [] + + for line in output.split("\n"): + if not line.startswith("FAILED"): + continue + + # Extract test file path + file_match = re.search(r"FAILED (tests/[^:]+\.py)", line) + if not file_match: + continue + file_path = file_match.group(1) + + # Extract EIP number + eip_match = re.search(r"eip(\d+)", file_path, re.IGNORECASE) + eip_num = f"EIP-{eip_match.group(1)}" if eip_match else "Unknown" + + # Extract full path + full_path_match = re.search(r"from '([^']+)'", line) + full_path = full_path_match.group(1) if full_path_match else "Unknown" + + # Extract EIP link + eip_link_match = re.search(r"Spec: (https://[^ ]+)\.", line) + eip_link = eip_link_match.group(1) if eip_link_match else "" + eip_link = eip_link.replace("blob/", "commits/") if eip_link else "" + + # Extract versions + ref_version_match = re.search(r"Referenced version: ([a-f0-9]+)", line) + ref_version = ref_version_match.group(1) if ref_version_match else "Unknown" + + latest_version_match = re.search(r"Latest version: ([a-f0-9]+)", line) + latest_version = latest_version_match.group(1) if latest_version_match else "Unknown" + + failures.append((file_path, eip_num, full_path, eip_link, ref_version, latest_version)) + + return failures + + +def generate_summary_table(failures): + """Generate a markdown summary table from the failures.""" + rows = [] + for file_path, eip_num, _, eip_link, ref_version, latest_version in failures: + rows.append( + f"| `{file_path}` | [{eip_num}]({eip_link}) | `{ref_version}` | `{latest_version}` |" + ) + return "\n".join(rows) + + +def main(): + """Generate the report.""" + if len(sys.argv) < 2: + print("Usage: uv run python generate_eip_report.py [output_file]") + sys.exit(1) + + input_file = sys.argv[1] + output_file = sys.argv[2] if len(sys.argv) > 2 else "./reports/outdated_eips.md" + + try: + with open(input_file, "r") as f: + output = f.read() + except Exception as e: + print(f"Error reading input file: {e}") + sys.exit(1) + + failures = extract_failures(output) + + fail_messages = "\n".join(line for line in output.split("\n") if line.startswith("FAILED")) + if not fail_messages: + fail_messages = ( + "No test failures were found in the pytest output: No lines start with 'FAILED'." + ) + + error_messages = "\n".join(line for line in output.split("\n") if line.startswith("ERROR")) + if not error_messages: + error_messages = ( + "No test errors were found in the pytest output: No lines start with 'ERROR'." + ) + + report_content = REPORT_TEMPLATE.substitute( + summary_table=generate_summary_table(failures), + fail_messages=fail_messages, + error_messages=error_messages, + run_id=os.environ.get("GITHUB_RUN_ID", ""), + ) + + try: + with open(output_file, "w") as report: + report.write(report_content) + except Exception as e: + print(f"Error writing output file: {e}") + sys.exit(1) + + print(f"Report generated successfully: {output_file}") + print(f"Found {len(failures)} outdated EIP references") + + +if __name__ == "__main__": + main() diff --git a/.github/workflows/check_eip_versions.yaml b/.github/workflows/check_eip_versions.yaml new file mode 100644 index 00000000000..2f3a0758e9d --- /dev/null +++ b/.github/workflows/check_eip_versions.yaml @@ -0,0 +1,61 @@ +name: Check EIP Versions + +on: + repository_dispatch: + workflow_dispatch: + schedule: + - cron: "00 12 * * 1" # Run weekly on Mondays at 12:00 UTC + +jobs: + check_eip_versions: + runs-on: ubuntu-latest + permissions: + issues: write # required for peter-evans/create-issue-from-file + contents: read # needed for API access to GitHub + steps: + - name: Checkout ethereum/execution-spec-tests + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + + - name: Install uv ${{ vars.UV_VERSION }} and python ${{ matrix.python }} + uses: astral-sh/setup-uv@0c5e2b8115b80b4c7c5ddf6ffdd634974642d182 + with: + enable-cache: true + cache-dependency-glob: "uv.lock" + version: ${{ vars.UV_VERSION }} + python-version: ${{ matrix.python }} + + - name: Run EIP Version Checker + id: check-eip + continue-on-error: true + env: + # GitHub token provides API access for EIP version checking + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + mkdir -p ./reports + uv run check_eip_versions 2>&1 | tee ./reports/eip_check_output.txt + # Save the exit code but don't fail the workflow + exit_code=${PIPESTATUS[0]} + echo "exit_code=$exit_code" >> $GITHUB_OUTPUT + # Always return success to GitHub Actions + exit 0 + + - name: Generate report file + if: steps.check-eip.outputs.exit_code != 0 + run: | + uv run python .github/scripts/generate_eip_report.py ./reports/eip_check_output.txt ./reports/outdated_eips.md + + - name: Create Issue From File + if: steps.check-eip.outputs.exit_code != 0 + uses: peter-evans/create-issue-from-file@e8ef132d6df98ed982188e460ebb3b5d4ef3a9cd + with: + title: "chore(tests): eip spec references outdated" + content-filepath: ./reports/outdated_eips.md + labels: report, automated issue, scope:tests, type:chore + + - name: Upload test report as artifact + if: always() + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 + with: + name: eip-check-report + path: ./reports/ + retention-days: 30 diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index e459a8beac3..3e7588b152f 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -19,6 +19,7 @@ Test fixtures for use by clients are available for each release on the [Github r ### 📋 Misc - ✨ Engine API updates for Osaka, add `get_blobs` rpc method ([#1510](https://github.com/ethereum/execution-spec-tests/pull/1510)). +- ✨ The EIP Version checker has been moved from `fill` and `execute` to it's own command-line tool `check_eip_versions` that gets ran daily as a Github Action ([#1537](https://github.com/ethereum/execution-spec-tests/pull/1537)). ### 🧪 Test Cases diff --git a/docs/gen_test_case_reference.py b/docs/gen_test_case_reference.py index b002828eae9..b3f43ae901d 100644 --- a/docs/gen_test_case_reference.py +++ b/docs/gen_test_case_reference.py @@ -48,7 +48,7 @@ f"--until={GENERATE_UNTIL_FORK}", "--skip-index", "-m", - "(not blockchain_test_engine) and (not eip_version_check)", + "not blockchain_test_engine", "-s", test_arg, ] diff --git a/docs/library/cli/index.md b/docs/library/cli/index.md index 459f8d6eedf..7d39dd59929 100644 --- a/docs/library/cli/index.md +++ b/docs/library/cli/index.md @@ -1,4 +1,5 @@ # EEST CLI Tools +- [`check_eip_versions`](../../writing_tests/reference_specification.md) - A CLI tool to check the SHA values specified in EIP tests match the latest version from ethereum/EIPs. - [`eest`](eest.md) - A CLI tool that helps with routine tasks in ethereum/execution-spec-tests. - [`evm_bytes`](evm_bytes.md) - Convert the given EVM bytes from a binary file or a hex string to EEST's python opcodes. diff --git a/docs/writing_tests/img/eip_reference_spec_console_output.png b/docs/writing_tests/img/eip_reference_spec_console_output.png index 1f3bfc64693..f043ed2fef4 100644 Binary files a/docs/writing_tests/img/eip_reference_spec_console_output.png and b/docs/writing_tests/img/eip_reference_spec_console_output.png differ diff --git a/docs/writing_tests/img/eip_reference_spec_console_output_fail.png b/docs/writing_tests/img/eip_reference_spec_console_output_fail.png index 52e78e5316a..2c36f0dfbaf 100644 Binary files a/docs/writing_tests/img/eip_reference_spec_console_output_fail.png and b/docs/writing_tests/img/eip_reference_spec_console_output_fail.png differ diff --git a/docs/writing_tests/reference_specification.md b/docs/writing_tests/reference_specification.md index cc4d95d814c..22cbc321e55 100644 --- a/docs/writing_tests/reference_specification.md +++ b/docs/writing_tests/reference_specification.md @@ -1,14 +1,21 @@ # Referencing an EIP Spec Version -An Ethereum Improvement Proposal ([ethereum/EIPs](https://github.com/ethereum/EIPs/tree/master/EIPS)) and its SHA digest can be directly referenced within a python test module in order to check whether the test implementation could be out-dated. The test framework automatically generates tests for every module that defines a spec version. If the spec is out-of-date because the SHA of the specified file in the remote repo changes, the corresponding `test_eip_spec_version()` test fails. +Tests that implement features from an Ethereum Improvement Proposal ([ethereum/EIPs](https://github.com/ethereum/EIPs/tree/master/EIPS)) must define the EIP's markdown SHA digest within the test's Python module. This ensures our tests stay up-to-date with any changes to the EIP specifications. + +The `check_eip_versions` command-line utility automatically verifies that all EIP references in the codebase are current. It works by comparing the SHA specified in the test against the latest version in the ethereum/EIPs repository. This utility uses pytest to generate test cases for every module that includes "eip" in its path.
![Test framework summary for a failing EIP spec version test](./img/eip_reference_spec_console_output.png){ width=auto align=center} - `<-snip->` - ![EIP spec version test fail](./img/eip_reference_spec_console_output_fail.png){ width=auto align=center}
-!!! info "" +!!! note "The SHA digest value is provided in the failure message of the corresponding test" + +
+ ![EIP spec version test fail](./img/eip_reference_spec_console_output_fail.png){ width=auto align=center} +
+ +!!! info "Understanding and Retrieving the EIP Markdown's SHA Digest" + The SHA value is the output from git's `hash-object` command, for example: ```console @@ -18,7 +25,7 @@ An Ethereum Improvement Proposal ([ethereum/EIPs](https://github.com/ethereum/EI ``` and can be retrieved from the remote repo via the Github API on the command-line as following: - + ```console sudo apt install jq curl -s -H "Accept: application/vnd.github.v3+json" \ @@ -31,10 +38,34 @@ An Ethereum Improvement Proposal ([ethereum/EIPs](https://github.com/ethereum/EI This check accomplished by adding the following two global variables anywhere in the Python source file: -| Variable Name | Explanation | -|-----------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `REFERENCE_SPEC_GIT_PATH` | The relative path of the EIP markdown file in the [ethereum/EIPs](https://github.com/ethereum/EIPs/) repository, e.g. "`EIPS/eip-1234.md`" | -| `REFERENCE_SPEC_VERSION` | The SHA hash of the latest version of the file retrieved from the Github API:
`https://api.github.com/repos/ethereum/EIPs/contents/EIPS/eip-.md` | +| Variable Name | Explanation | +| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `REFERENCE_SPEC_GIT_PATH` | The relative path of the EIP markdown file in the [ethereum/EIPs](https://github.com/ethereum/EIPs/) repository, e.g. "`EIPS/eip-1234.md`" | +| `REFERENCE_SPEC_VERSION` | The SHA hash of the latest version of the file retrieved from the Github API:
`https://api.github.com/repos/ethereum/EIPs/contents/EIPS/eip-.md` | + +## Running the `check_eip_versions` Command Locally + +A Github Personal Access Token (PAT) is required to avoid rate-limiting issues when using the Github API. The token can be specified via an environment variable or via the command-line. For example, the Github CLI can be used to obtain a token: + +```bash +uv run check_eip_versions --github-token=$(gh auth token) +``` + +or a PAT can be created at: https://github.com/settings/personal-access-tokens/new. + +By default, only tests up to and including the current fork under development will be checked. This is controlled by the `UNTIL_FORK` setting in the `src/config/check_eip_versions.py` configuration file. You can also pass a specific test path to limit the scope: + +```shell +uv run check_eip_versions --github-token=$(gh auth token) tests/shanghai/eip3651_warm_coinbase/ +``` + +This would only check EIP versions for the EIP-3651 tests in the `shanghai/eip3651_warm_coinbase` sub-directory. + +## Automated Checks via GitHub Actions + +The repository includes a [GitHub Actions workflow](https://github.com/ethereum/execution-spec-tests/actions/workflows/check_eip_versions.yaml) that automatically runs `check_eip_versions` on a daily schedule. If any outdated EIP references are detected, the workflow creates an issue in the repository with details about which references need to be updated. + +This workflow uses GitHub's built-in token for authentication, so there's no need to configure personal access tokens for the automated checks. The issue will include links to the relevant workflow run and details about which tests need updating. ## Example diff --git a/pyproject.toml b/pyproject.toml index 32ebd502c5b..7df323139c9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -95,6 +95,7 @@ phil = "cli.pytest_commands.fill:phil" execute = "cli.pytest_commands.execute:execute" attac = "cli.pytest_commands.execute:execute" checkfixtures = "cli.check_fixtures:check_fixtures" +check_eip_versions = "cli.pytest_commands.check_eip_versions:check_eip_versions" consume = "cli.pytest_commands.consume:consume" protec = "cli.pytest_commands.consume:consume" genindex = "cli.gen_index:generate_fixtures_index_cli" diff --git a/pytest-check-eip-versions.ini b/pytest-check-eip-versions.ini new file mode 100644 index 00000000000..dc3c3e52ac9 --- /dev/null +++ b/pytest-check-eip-versions.ini @@ -0,0 +1,20 @@ +[pytest] +console_output_style = count +minversion = 7.0 +python_files = *.py +testpaths = tests/ +markers = + slow + pre_alloc_modify + eip_version_check +addopts = + -p pytest_plugins.spec_version_checker.spec_version_checker + -p pytest_plugins.concurrency + -p pytest_plugins.filler.pre_alloc + -p pytest_plugins.solc.solc + -p pytest_plugins.filler.filler + -p pytest_plugins.shared.execute_fill + -p pytest_plugins.forks.forks + -p pytest_plugins.help.help + -m eip_version_check + --tb short \ No newline at end of file diff --git a/pytest-execute-hive.ini b/pytest-execute-hive.ini index 05f156d99df..e88c496baed 100644 --- a/pytest-execute-hive.ini +++ b/pytest-execute-hive.ini @@ -15,10 +15,8 @@ addopts = -p pytest_plugins.execute.execute -p pytest_plugins.shared.execute_fill -p pytest_plugins.forks.forks - -p pytest_plugins.spec_version_checker.spec_version_checker -p pytest_plugins.pytest_hive.pytest_hive -p pytest_plugins.help.help - -m "not eip_version_check" --tb short --dist loadscope --ignore tests/cancun/eip4844_blobs/point_evaluation_vectors/ diff --git a/pytest-execute.ini b/pytest-execute.ini index 984f836f1bb..2852ec78726 100644 --- a/pytest-execute.ini +++ b/pytest-execute.ini @@ -16,9 +16,7 @@ addopts = -p pytest_plugins.execute.rpc.remote_seed_sender -p pytest_plugins.execute.rpc.remote -p pytest_plugins.forks.forks - -p pytest_plugins.spec_version_checker.spec_version_checker -p pytest_plugins.help.help - -m "not eip_version_check" --tb short --dist loadscope --ignore tests/cancun/eip4844_blobs/point_evaluation_vectors/ diff --git a/pytest.ini b/pytest.ini index 682b9f56570..bf100a7345d 100644 --- a/pytest.ini +++ b/pytest.ini @@ -14,10 +14,8 @@ addopts = -p pytest_plugins.filler.static_filler -p pytest_plugins.shared.execute_fill -p pytest_plugins.forks.forks - -p pytest_plugins.spec_version_checker.spec_version_checker -p pytest_plugins.eels_resolver -p pytest_plugins.help.help - -m "not eip_version_check" --tb short --ignore tests/cancun/eip4844_blobs/point_evaluation_vectors/ # these customizations require the pytest-custom-report plugin diff --git a/src/cli/pytest_commands/check_eip_versions.py b/src/cli/pytest_commands/check_eip_versions.py new file mode 100644 index 00000000000..8f95af58a48 --- /dev/null +++ b/src/cli/pytest_commands/check_eip_versions.py @@ -0,0 +1,22 @@ +"""CLI entry point for the EIP version checker pytest-based command.""" + +import sys +from typing import List + +import click +import pytest + +from config.check_eip_versions import CheckEipVersionsConfig + +from .common import common_click_options, handle_help_flags + + +@click.command(context_settings={"ignore_unknown_options": True}) +@common_click_options +def check_eip_versions(pytest_args: List[str], **kwargs) -> None: + """Run pytest with the `spec_version_checker` plugin.""" + args = ["-c", "pytest-check-eip-versions.ini"] + args += ["--until", CheckEipVersionsConfig().UNTIL_FORK] + args += handle_help_flags(list(pytest_args), pytest_type="check-eip-versions") + result = pytest.main(args) + sys.exit(result) diff --git a/src/cli/pytest_commands/common.py b/src/cli/pytest_commands/common.py index 69959c0ea78..84dee0b16ed 100644 --- a/src/cli/pytest_commands/common.py +++ b/src/cli/pytest_commands/common.py @@ -37,6 +37,7 @@ def common_click_options(func: Callable[..., Any]) -> Decorator: REQUIRED_FLAGS: Dict[str, List] = { + "check-eip-versions": [], "fill": [], "consume": [], "execute": [ @@ -74,7 +75,15 @@ def handle_help_flags(pytest_args: List[str], pytest_type: str) -> List[str]: if ctx.params.get("help_flag"): return ( [f"--{pytest_type}-help", *REQUIRED_FLAGS[pytest_type]] - if pytest_type in {"consume", "fill", "execute", "execute-hive", "execute-recover"} + if pytest_type + in { + "check-eip-versions", + "consume", + "fill", + "execute", + "execute-hive", + "execute-recover", + } else pytest_args ) elif ctx.params.get("pytest_help_flag"): diff --git a/src/config/check_eip_versions.py b/src/config/check_eip_versions.py new file mode 100644 index 00000000000..30302666088 --- /dev/null +++ b/src/config/check_eip_versions.py @@ -0,0 +1,10 @@ +"""A module for managing configuration for the `check_eip_version` utility.""" + +from pydantic import BaseModel + + +class CheckEipVersionsConfig(BaseModel): + """A class for accessing configurations for `check_eip_version`.""" + + UNTIL_FORK: str = "Prague" + """The target fork to check eip versions until.""" diff --git a/src/ethereum_test_base_types/reference_spec/git_reference_spec.py b/src/ethereum_test_base_types/reference_spec/git_reference_spec.py index a74fd9fc91e..7142f91c832 100644 --- a/src/ethereum_test_base_types/reference_spec/git_reference_spec.py +++ b/src/ethereum_test_base_types/reference_spec/git_reference_spec.py @@ -2,9 +2,10 @@ import base64 import json +import os import warnings from dataclasses import dataclass -from typing import Any, Dict +from typing import Any, Dict, Optional import requests @@ -25,6 +26,7 @@ class GitReferenceSpec(ReferenceSpec): BranchName: str = "master" SpecVersion: str = "" _latest_spec: Dict | None = None + _github_token: Optional[str] = None def name(self) -> str: """Return the name of the spec.""" @@ -44,8 +46,17 @@ def api_url(self) -> str: f"{self.RepositoryName}/contents/{self.SpecPath}" ) + def _get_request_headers(self) -> Dict[str, str]: + """Get headers for GitHub API request, including token if available.""" + headers = {} + token = self._github_token or os.environ.get("GITHUB_TOKEN") + if token: + headers["Authorization"] = f"token {token}" + return headers + def _get_latest_known_spec(self) -> Dict | None: - response = requests.get(self.api_url()) + headers = self._get_request_headers() + response = requests.get(self.api_url(), headers=headers) if response.status_code != 200: return None content = json.loads(response.content) @@ -55,7 +66,10 @@ def _get_latest_known_spec(self) -> Dict | None: def _get_latest_spec(self) -> Dict | None: if self._latest_spec is not None: return self._latest_spec - response = requests.get(self.api_url()) + + headers = self._get_request_headers() + response = requests.get(self.api_url(), headers=headers) + if response.status_code != 200: warnings.warn( f"Unable to get latest version, status code: {response.status_code} - " @@ -110,13 +124,22 @@ def parseable_from_module(module_dict: Dict[str, Any]) -> bool: return "REFERENCE_SPEC_GIT_PATH" in module_dict @staticmethod - def parse_from_module(module_dict: Dict[str, Any]) -> "ReferenceSpec": - """Parse the module's dict into a reference spec.""" + def parse_from_module( + module_dict: Dict[str, Any], github_token: Optional[str] = None + ) -> "ReferenceSpec": + """ + Parse the module's dict into a reference spec. + + Args: + module_dict: Dictionary containing module information + github_token: Optional GitHub token for API authentication + + """ if "REFERENCE_SPEC_GIT_PATH" not in module_dict: raise ParseModuleError spec_path = module_dict["REFERENCE_SPEC_GIT_PATH"] - spec = GitReferenceSpec(SpecPath=spec_path) + spec = GitReferenceSpec(SpecPath=spec_path, _github_token=github_token) if "REFERENCE_SPEC_VERSION" in module_dict: spec.SpecVersion = module_dict["REFERENCE_SPEC_VERSION"] return spec diff --git a/src/ethereum_test_base_types/reference_spec/reference_spec.py b/src/ethereum_test_base_types/reference_spec/reference_spec.py index 1da8820cec8..96a0f493926 100644 --- a/src/ethereum_test_base_types/reference_spec/reference_spec.py +++ b/src/ethereum_test_base_types/reference_spec/reference_spec.py @@ -4,7 +4,7 @@ """ from abc import abstractmethod -from typing import Any, Dict +from typing import Any, Dict, Optional # Exceptions @@ -75,6 +75,15 @@ def parseable_from_module(module_dict: Dict[str, Any]) -> bool: @staticmethod @abstractmethod - def parse_from_module(module_dict: Dict[str, Any]) -> "ReferenceSpec": - """Parse the module's dict into a reference spec.""" + def parse_from_module( + module_dict: Dict[str, Any], github_token: Optional[str] = None + ) -> "ReferenceSpec": + """ + Parse the module's dict into a reference spec. + + Args: + module_dict: Dictionary containing module information + github_token: Optional GitHub token for API authentication + + """ pass diff --git a/src/ethereum_test_base_types/tests/test_reference_spec.py b/src/ethereum_test_base_types/tests/test_reference_spec.py index 403e007ee86..c7aedbc5fbc 100644 --- a/src/ethereum_test_base_types/tests/test_reference_spec.py +++ b/src/ethereum_test_base_types/tests/test_reference_spec.py @@ -62,7 +62,7 @@ def test_git_reference_spec(monkeypatch): """Test Git reference spec.""" - def mock_get(self): + def mock_get(self, headers=None): class Response: content = ( '{"content": "' diff --git a/src/pytest_plugins/consume/tests/test_consume_args.py b/src/pytest_plugins/consume/tests/test_consume_args.py index 0dc38142dcc..af96f1b4d33 100644 --- a/src/pytest_plugins/consume/tests/test_consume_args.py +++ b/src/pytest_plugins/consume/tests/test_consume_args.py @@ -63,7 +63,7 @@ def fill_tests( "pytest.ini", "--skip-evm-dump", "-m", - "(not blockchain_test_engine) and (not eip_version_check)", + "not blockchain_test_engine", f"--from={fill_fork_from}", f"--until={fill_fork_until}", f"--output={str(fixtures_dir)}", diff --git a/src/pytest_plugins/filler/filler.py b/src/pytest_plugins/filler/filler.py index 75badb18640..9646a147d0c 100644 --- a/src/pytest_plugins/filler/filler.py +++ b/src/pytest_plugins/filler/filler.py @@ -33,6 +33,7 @@ ) from ..shared.helpers import get_spec_format_for_item, labeled_format_parameter_set +from ..spec_version_checker.spec_version_checker import get_ref_spec_from_module def default_output_directory() -> str: @@ -601,6 +602,18 @@ def get_fixture_collection_scope(fixture_name, config): return "module" +@pytest.fixture(autouse=True, scope="module") +def reference_spec(request) -> None | ReferenceSpec: + """ + Pytest fixture that returns the reference spec defined in a module. + + See `get_ref_spec_from_module`. + """ + if hasattr(request, "module"): + return get_ref_spec_from_module(request.module) + return None + + @pytest.fixture(scope=get_fixture_collection_scope) def fixture_collector( request: pytest.FixtureRequest, diff --git a/src/pytest_plugins/help/help.py b/src/pytest_plugins/help/help.py index bb3be45956c..1960a93abdc 100644 --- a/src/pytest_plugins/help/help.py +++ b/src/pytest_plugins/help/help.py @@ -12,6 +12,13 @@ def pytest_addoption(parser): """Add command-line options to pytest for specific help commands.""" help_group = parser.getgroup("help_options", "Help options for different commands") + help_group.addoption( + "--check-eip-versions-help", + action="store_true", + dest="show_check_eip_versions_help", + default=False, + help="Show help options only for the check_eip_versions command and exit.", + ) help_group.addoption( "--fill-help", action="store_true", @@ -52,7 +59,16 @@ def pytest_addoption(parser): @pytest.hookimpl(tryfirst=True) def pytest_configure(config): """Handle specific help flags by displaying the corresponding help message.""" - if config.getoption("show_fill_help"): + if config.getoption("show_check_eip_versions_help"): + show_specific_help( + config, + "pytest-check-eip-versions.ini", + [ + "spec_version_checker", + "EIP spec version", + ], + ) + elif config.getoption("show_fill_help"): show_specific_help( config, "pytest.ini", diff --git a/src/pytest_plugins/spec_version_checker/spec_version_checker.py b/src/pytest_plugins/spec_version_checker/spec_version_checker.py index 06bbafc6d64..c5344e0882b 100644 --- a/src/pytest_plugins/spec_version_checker/spec_version_checker.py +++ b/src/pytest_plugins/spec_version_checker/spec_version_checker.py @@ -3,16 +3,41 @@ modules matches that of https://github.com/ethereum/EIPs. """ +import os import re +import textwrap from types import ModuleType -from typing import List, Set +from typing import Any, List, Optional, Set import pytest -from _pytest.nodes import Item +from _pytest.nodes import Item, Node from _pytest.python import Module from ethereum_test_tools import ReferenceSpec, ReferenceSpecTypes +GITHUB_TOKEN_HELP = textwrap.dedent( + "Either set the GITHUB_TOKEN environment variable or specify one via --github-token. " + "The Github CLI can be used: `--github-token $(gh auth token)` (https://cli.github.com/) " + "or a PAT can be generated at https://github.com/settings/personal-access-tokens/new." +) + + +def pytest_addoption(parser): + """Add Github token option to pytest command line options.""" + group = parser.getgroup( + "spec_version_checker", "Arguments defining the EIP spec version checker" + ) + group.addoption( + "--github-token", + action="store", + dest="github_token", + default=None, + help=( + "Specify a Github API personal access token (PAT) to avoid rate limiting. " + f"{GITHUB_TOKEN_HELP}" + ), + ) + @pytest.hookimpl(tryfirst=True) def pytest_configure(config): @@ -27,11 +52,27 @@ def pytest_configure(config): "eip_version_check: a test that tests the reference spec defined in an EIP test module.", ) + github_token = config.getoption("github_token") or os.environ.get("GITHUB_TOKEN") + + if not github_token: + pytest.exit( + "A Github personal access token (PAT) is required but has not been provided. " + f"{GITHUB_TOKEN_HELP}" + ) + + config.github_token = github_token + -def get_ref_spec_from_module(module: ModuleType) -> None | ReferenceSpec: +def get_ref_spec_from_module( + module: ModuleType, github_token: Optional[str] = None +) -> None | ReferenceSpec: """ Return the reference spec object defined in a module. + Args: + module: The module to extract reference spec from + github_token: Optional GitHub token for API authentication + Raises: Exception: If the module path contains "eip" and the module does not define a reference spec. @@ -54,7 +95,9 @@ def get_ref_spec_from_module(module: ModuleType) -> None | ReferenceSpec: if len(parseable_ref_specs) > 0: module_dict = module.__dict__ try: - spec_obj = parseable_ref_specs[0].parse_from_module(module_dict) + spec_obj = parseable_ref_specs[0].parse_from_module( + module_dict, github_token=github_token + ) except Exception as e: raise Exception(f"Error in spec_version_checker: {e} (this test is generated).") from e else: @@ -62,18 +105,6 @@ def get_ref_spec_from_module(module: ModuleType) -> None | ReferenceSpec: return spec_obj -@pytest.fixture(autouse=True, scope="module") -def reference_spec(request) -> None | ReferenceSpec: - """ - Pytest fixture that returns the reference spec defined in a module. - - See `get_ref_spec_from_module`. - """ - if hasattr(request, "module"): - return get_ref_spec_from_module(request.module) - return None - - def is_test_for_an_eip(input_string: str) -> bool: """Return True if `input_string` contains an EIP number, i.e., eipNNNN.""" pattern = re.compile(r".*eip\d{1,4}", re.IGNORECASE) @@ -82,13 +113,18 @@ def is_test_for_an_eip(input_string: str) -> bool: return False -def test_eip_spec_version(module: ModuleType): +def test_eip_spec_version(module: ModuleType, github_token: Optional[str] = None): """ Test that the ReferenceSpec object as defined in the test module is not outdated when compared to the remote hash from ethereum/EIPs. + + Args: + module: Module to test + github_token: Optional GitHub token for API authentication + """ - ref_spec = get_ref_spec_from_module(module) + ref_spec = get_ref_spec_from_module(module, github_token=github_token) assert ref_spec, "No reference spec object defined" message = ( @@ -113,38 +149,68 @@ def test_eip_spec_version(module: ModuleType): class EIPSpecTestItem(Item): """Custom pytest test item to test EIP spec versions.""" - def __init__(self, name, parent, module): - """Initialize the test item.""" + module: ModuleType + github_token: Optional[str] + + def __init__(self, name: str, parent: Node, **kwargs: Any): + """ + Initialize the test item. + + Args: + name: Name of the test + parent: Parent node + **kwargs: Additional keyword arguments + + """ super().__init__(name, parent) - self.module = module + self.module = None # type: ignore + self.github_token = None @classmethod - def from_parent(cls, parent, module): + def from_parent(cls, parent: Node, **kw: Any) -> "EIPSpecTestItem": """ Public constructor to define new tests. https://docs.pytest.org/en/latest/reference/reference.html#pytest.nodes.Node.from_parent. + + Args: + parent: The parent Node + kw: Additional keyword arguments (module, github_token) + """ - return super().from_parent(parent=parent, name="test_eip_spec_version", module=module) + module = kw.pop("module", None) + github_token = kw.pop("github_token", None) + + kw["name"] = "test_eip_spec_version" + item = super(EIPSpecTestItem, cls).from_parent(parent, **kw) - def runtest(self): + item.module = module + item.github_token = github_token + return item + + def runtest(self) -> None: """Define the test to execute for this item.""" - test_eip_spec_version(self.module) + test_eip_spec_version(self.module, github_token=self.github_token) + + def reportinfo(self) -> tuple[str, int, str]: + """ + Get location information for this test item to use test reports. + + Returns: + A tuple of (path, line_number, description) - def reportinfo(self): - """Get location information for this test item to use test reports.""" + """ return "spec_version_checker", 0, f"{self.name}" def pytest_collection_modifyitems( session: pytest.Session, config: pytest.Config, items: List[Item] ): - """ - Insert a new test EIPSpecTestItem for every test modules that - contains 'eip' in its path. - """ + """Insert a new test EIPSpecTestItem for every test module with 'eip' in its path.""" + github_token = config.github_token if hasattr(config, "github_token") else None + modules: Set[Module] = {item.parent for item in items if isinstance(item.parent, Module)} new_test_eip_spec_version_items = [ - EIPSpecTestItem.from_parent(module, module.obj) + EIPSpecTestItem.from_parent(parent=module, module=module.obj, github_token=github_token) for module in sorted(modules, key=lambda module: module.path) if is_test_for_an_eip(str(module.path)) ] diff --git a/tests/byzantium/eip198_modexp_precompile/test_modexp.py b/tests/byzantium/eip198_modexp_precompile/test_modexp.py index 1bd68bd8617..a097ea66887 100644 --- a/tests/byzantium/eip198_modexp_precompile/test_modexp.py +++ b/tests/byzantium/eip198_modexp_precompile/test_modexp.py @@ -20,7 +20,7 @@ from ethereum_test_tools.vm.opcode import Opcodes as Op REFERENCE_SPEC_GIT_PATH = "EIPS/eip-198.md" -REFERENCE_SPEC_VERSION = "9e393a79d9937f579acbdcb234a67869259d5a96" +REFERENCE_SPEC_VERSION = "5c8f066acb210c704ef80c1033a941aa5374aac5" @dataclass(kw_only=True, frozen=True, repr=False) diff --git a/tests/cancun/eip1153_tstore/spec.py b/tests/cancun/eip1153_tstore/spec.py index 4df5d29b4e6..4a3a9b62986 100644 --- a/tests/cancun/eip1153_tstore/spec.py +++ b/tests/cancun/eip1153_tstore/spec.py @@ -11,7 +11,7 @@ class ReferenceSpec: version: str -ref_spec_1153 = ReferenceSpec("EIPS/eip-1153.md", "6f0be621c76a05a7b3aaf0e9297afd425c26e9d0") +ref_spec_1153 = ReferenceSpec("EIPS/eip-1153.md", "1eb863b534a5a3e19e9c196ab2a7f3db4bb9da17") @dataclass(frozen=True) diff --git a/tests/cancun/eip1153_tstore/test_tload_calls.py b/tests/cancun/eip1153_tstore/test_tload_calls.py index 1baeee66c2d..0a79d3554ff 100644 --- a/tests/cancun/eip1153_tstore/test_tload_calls.py +++ b/tests/cancun/eip1153_tstore/test_tload_calls.py @@ -10,7 +10,7 @@ from ethereum_test_tools.vm.opcode import Opcodes as Op REFERENCE_SPEC_GIT_PATH = "EIPS/eip-1153.md" -REFERENCE_SPEC_VERSION = "2f8299df31bb8173618901a03a8366a3183479b0" +REFERENCE_SPEC_VERSION = "1eb863b534a5a3e19e9c196ab2a7f3db4bb9da17" @pytest.mark.valid_from("Cancun") diff --git a/tests/cancun/eip1153_tstore/test_tload_reentrancy.py b/tests/cancun/eip1153_tstore/test_tload_reentrancy.py index f97c8a84821..75d11c95e99 100644 --- a/tests/cancun/eip1153_tstore/test_tload_reentrancy.py +++ b/tests/cancun/eip1153_tstore/test_tload_reentrancy.py @@ -23,7 +23,7 @@ from ethereum_test_tools.vm.opcode import Opcodes as Op REFERENCE_SPEC_GIT_PATH = "EIPS/eip-1153.md" -REFERENCE_SPEC_VERSION = "2f8299df31bb8173618901a03a8366a3183479b0" +REFERENCE_SPEC_VERSION = "1eb863b534a5a3e19e9c196ab2a7f3db4bb9da17" class CallDestType(Enum): diff --git a/tests/cancun/eip1153_tstore/test_tstore_reentrancy.py b/tests/cancun/eip1153_tstore/test_tstore_reentrancy.py index 6b3e73bf9a3..9aa72ccb142 100644 --- a/tests/cancun/eip1153_tstore/test_tstore_reentrancy.py +++ b/tests/cancun/eip1153_tstore/test_tstore_reentrancy.py @@ -23,7 +23,7 @@ from ethereum_test_tools.vm.opcode import Opcodes as Op REFERENCE_SPEC_GIT_PATH = "EIPS/eip-1153.md" -REFERENCE_SPEC_VERSION = "2f8299df31bb8173618901a03a8366a3183479b0" +REFERENCE_SPEC_VERSION = "1eb863b534a5a3e19e9c196ab2a7f3db4bb9da17" class CallDestType(Enum): diff --git a/tests/cancun/eip4788_beacon_root/spec.py b/tests/cancun/eip4788_beacon_root/spec.py index d2832bcc8e1..9a4c4ba99fe 100644 --- a/tests/cancun/eip4788_beacon_root/spec.py +++ b/tests/cancun/eip4788_beacon_root/spec.py @@ -13,7 +13,7 @@ class ReferenceSpec: version: str -ref_spec_4788 = ReferenceSpec("EIPS/eip-4788.md", "e7608fe8ac8a60934ca874f5aab7d5c1f4ff7782") +ref_spec_4788 = ReferenceSpec("EIPS/eip-4788.md", "efcac43ef9aadd87dd4e0a2fbd14d5d1317eddf3") # Constants diff --git a/tests/cancun/eip5656_mcopy/common.py b/tests/cancun/eip5656_mcopy/common.py index 729b2e98cbc..1c975f4f840 100644 --- a/tests/cancun/eip5656_mcopy/common.py +++ b/tests/cancun/eip5656_mcopy/common.py @@ -6,7 +6,7 @@ from copy import copy REFERENCE_SPEC_GIT_PATH = "EIPS/eip-5656.md" -REFERENCE_SPEC_VERSION = "2ade0452efe8124378f35284676ddfd16dd56ecd" +REFERENCE_SPEC_VERSION = "d0cd8902e2243b66e2b9a858b691bc106cebddfc" def mcopy(*, src: int, dest: int, length: int, memory: bytes) -> bytes: diff --git a/tests/cancun/eip6780_selfdestruct/test_dynamic_create2_selfdestruct_collision.py b/tests/cancun/eip6780_selfdestruct/test_dynamic_create2_selfdestruct_collision.py index 6e61b901b74..61be6886318 100644 --- a/tests/cancun/eip6780_selfdestruct/test_dynamic_create2_selfdestruct_collision.py +++ b/tests/cancun/eip6780_selfdestruct/test_dynamic_create2_selfdestruct_collision.py @@ -26,7 +26,7 @@ from ethereum_test_tools.vm.opcode import Opcodes as Op REFERENCE_SPEC_GIT_PATH = "EIPS/eip-6780.md" -REFERENCE_SPEC_VERSION = "2f8299df31bb8173618901a03a8366a3183479b0" +REFERENCE_SPEC_VERSION = "1b6a0e94cc47e859b9866e570391cf37dc55059a" @pytest.fixture diff --git a/tests/cancun/eip6780_selfdestruct/test_reentrancy_selfdestruct_revert.py b/tests/cancun/eip6780_selfdestruct/test_reentrancy_selfdestruct_revert.py index b45021ab8ec..0aef5375bb2 100644 --- a/tests/cancun/eip6780_selfdestruct/test_reentrancy_selfdestruct_revert.py +++ b/tests/cancun/eip6780_selfdestruct/test_reentrancy_selfdestruct_revert.py @@ -21,7 +21,7 @@ from ethereum_test_tools.vm.opcode import Opcodes as Op REFERENCE_SPEC_GIT_PATH = "EIPS/eip-6780.md" -REFERENCE_SPEC_VERSION = "2f8299df31bb8173618901a03a8366a3183479b0" +REFERENCE_SPEC_VERSION = "1b6a0e94cc47e859b9866e570391cf37dc55059a" @pytest.fixture diff --git a/tests/cancun/eip6780_selfdestruct/test_selfdestruct.py b/tests/cancun/eip6780_selfdestruct/test_selfdestruct.py index af269bacf9d..4232cd7a9a9 100644 --- a/tests/cancun/eip6780_selfdestruct/test_selfdestruct.py +++ b/tests/cancun/eip6780_selfdestruct/test_selfdestruct.py @@ -30,7 +30,7 @@ from ethereum_test_tools.vm.opcode import Opcodes as Op REFERENCE_SPEC_GIT_PATH = "EIPS/eip-6780.md" -REFERENCE_SPEC_VERSION = "2f8299df31bb8173618901a03a8366a3183479b0" +REFERENCE_SPEC_VERSION = "1b6a0e94cc47e859b9866e570391cf37dc55059a" SELFDESTRUCT_DISABLE_FORK = Cancun diff --git a/tests/cancun/eip6780_selfdestruct/test_selfdestruct_revert.py b/tests/cancun/eip6780_selfdestruct/test_selfdestruct_revert.py index 2eff5a5f807..e67383e38b1 100644 --- a/tests/cancun/eip6780_selfdestruct/test_selfdestruct_revert.py +++ b/tests/cancun/eip6780_selfdestruct/test_selfdestruct_revert.py @@ -22,7 +22,7 @@ from ethereum_test_tools.vm.opcode import Opcodes as Op REFERENCE_SPEC_GIT_PATH = "EIPS/eip-6780.md" -REFERENCE_SPEC_VERSION = "2f8299df31bb8173618901a03a8366a3183479b0" +REFERENCE_SPEC_VERSION = "1b6a0e94cc47e859b9866e570391cf37dc55059a" SELFDESTRUCT_ENABLE_FORK = Cancun diff --git a/tests/cancun/eip7516_blobgasfee/test_blobgasfee_opcode.py b/tests/cancun/eip7516_blobgasfee/test_blobgasfee_opcode.py index 539a9cc87b0..6f1f170ed80 100644 --- a/tests/cancun/eip7516_blobgasfee/test_blobgasfee_opcode.py +++ b/tests/cancun/eip7516_blobgasfee/test_blobgasfee_opcode.py @@ -23,7 +23,7 @@ from ethereum_test_tools import Opcodes as Op REFERENCE_SPEC_GIT_PATH = "EIPS/eip-7516.md" -REFERENCE_SPEC_VERSION = "2ade0452efe8124378f35284676ddfd16dd56ecd" +REFERENCE_SPEC_VERSION = "dcd2f4ede58a6ed908acd3cc2c198e9f605cbf3b" BLOBBASEFEE_GAS = 2 diff --git a/tests/constantinople/eip1014_create2/spec.py b/tests/constantinople/eip1014_create2/spec.py index 29c342a33f4..6c0c630e0df 100644 --- a/tests/constantinople/eip1014_create2/spec.py +++ b/tests/constantinople/eip1014_create2/spec.py @@ -11,7 +11,7 @@ class ReferenceSpec: version: str -ref_spec_1014 = ReferenceSpec("EIPS/eip-1014.md", "0a3c1015a07958523bb3ef48c2f230c9ba9605d9") +ref_spec_1014 = ReferenceSpec("EIPS/eip-1014.md", "31d4d62ec1dfc9f2bb26ca648f05d4cc2f47da09") @dataclass(frozen=True) diff --git a/tests/prague/eip2537_bls_12_381_precompiles/spec.py b/tests/prague/eip2537_bls_12_381_precompiles/spec.py index 0c7d067cf8b..b434330af24 100644 --- a/tests/prague/eip2537_bls_12_381_precompiles/spec.py +++ b/tests/prague/eip2537_bls_12_381_precompiles/spec.py @@ -13,7 +13,7 @@ class ReferenceSpec: version: str -ref_spec_2537 = ReferenceSpec("EIPS/eip-2537.md", "cd0f016ad0c4c68b8b1f5c502ef61ab9353b6e5e") +ref_spec_2537 = ReferenceSpec("EIPS/eip-2537.md", "c561ec1426fe5ec470eade499a0bd4174f270583") class BytesConcatenation(SupportsBytes, Sized): diff --git a/tests/prague/eip2935_historical_block_hashes_from_state/spec.py b/tests/prague/eip2935_historical_block_hashes_from_state/spec.py index 6a447c0f6d7..fec641e749d 100644 --- a/tests/prague/eip2935_historical_block_hashes_from_state/spec.py +++ b/tests/prague/eip2935_historical_block_hashes_from_state/spec.py @@ -11,7 +11,7 @@ class ReferenceSpec: version: str -ref_spec_2935 = ReferenceSpec("EIPS/eip-2935.md", "a04da454a5a6ba86a87bb9e15f811feaff3c849a") +ref_spec_2935 = ReferenceSpec("EIPS/eip-2935.md", "06aadd458ee04ede80498db55927b052eb5bef38") @dataclass(frozen=True) diff --git a/tests/prague/eip6110_deposits/spec.py b/tests/prague/eip6110_deposits/spec.py index 8f483821e89..60187f02ad7 100644 --- a/tests/prague/eip6110_deposits/spec.py +++ b/tests/prague/eip6110_deposits/spec.py @@ -11,7 +11,7 @@ class ReferenceSpec: version: str -ref_spec_6110 = ReferenceSpec("EIPS/eip-6110.md", "70a6ec21f62937caf665d98db2b41633e9287871") +ref_spec_6110 = ReferenceSpec("EIPS/eip-6110.md", "cbe8bf6a28fa1d096f9756af3513675849c4158e") @dataclass(frozen=True) diff --git a/tests/prague/eip7002_el_triggerable_withdrawals/spec.py b/tests/prague/eip7002_el_triggerable_withdrawals/spec.py index 36409aff4d3..e30a15011be 100644 --- a/tests/prague/eip7002_el_triggerable_withdrawals/spec.py +++ b/tests/prague/eip7002_el_triggerable_withdrawals/spec.py @@ -16,7 +16,7 @@ class ReferenceSpec: version: str -ref_spec_7002 = ReferenceSpec("EIPS/eip-7002.md", "25cca6506df8370157513e4e864fd174cafd3562") +ref_spec_7002 = ReferenceSpec("EIPS/eip-7002.md", "695ac757472b9bbbdcbc88a020ba15c1ac782869") # Constants diff --git a/tests/prague/eip7251_consolidations/spec.py b/tests/prague/eip7251_consolidations/spec.py index 7af93825b07..ceee58cba9c 100644 --- a/tests/prague/eip7251_consolidations/spec.py +++ b/tests/prague/eip7251_consolidations/spec.py @@ -13,7 +13,7 @@ class ReferenceSpec: version: str -ref_spec_7251 = ReferenceSpec("EIPS/eip-7251.md", "cc6ed420006c13b6ef64b7987badc2966ad4508f") +ref_spec_7251 = ReferenceSpec("EIPS/eip-7251.md", "f29c0eda1e7495c071ef5b25fbd850dc3ef6bfdf") # Constants diff --git a/tests/prague/eip7623_increase_calldata_cost/spec.py b/tests/prague/eip7623_increase_calldata_cost/spec.py index 38432e708d6..ba3e8c12e06 100644 --- a/tests/prague/eip7623_increase_calldata_cost/spec.py +++ b/tests/prague/eip7623_increase_calldata_cost/spec.py @@ -11,7 +11,7 @@ class ReferenceSpec: version: str -ref_spec_7623 = ReferenceSpec("EIPS/eip-7623.md", "9104d079c04737b1fec5f7150715f024d8028558") +ref_spec_7623 = ReferenceSpec("EIPS/eip-7623.md", "744f2075ba5deee9c1040eb089104d55bd89960d") # Constants diff --git a/tests/prague/eip7685_general_purpose_el_requests/spec.py b/tests/prague/eip7685_general_purpose_el_requests/spec.py index 8d86d824b3f..414e47d290c 100644 --- a/tests/prague/eip7685_general_purpose_el_requests/spec.py +++ b/tests/prague/eip7685_general_purpose_el_requests/spec.py @@ -14,4 +14,4 @@ class ReferenceSpec: version: str -ref_spec_7685 = ReferenceSpec("EIPS/eip-7685.md", "52a260582376476e658b1dda60864bcac3cf5e1a") +ref_spec_7685 = ReferenceSpec("EIPS/eip-7685.md", "67ecb425d78f1d40c4f1cb957f3214afd0ece945") diff --git a/tests/prague/eip7702_set_code_tx/spec.py b/tests/prague/eip7702_set_code_tx/spec.py index 70af73dba02..d5c74159152 100644 --- a/tests/prague/eip7702_set_code_tx/spec.py +++ b/tests/prague/eip7702_set_code_tx/spec.py @@ -13,7 +13,7 @@ class ReferenceSpec: version: str -ref_spec_7702 = ReferenceSpec("EIPS/eip-7702.md", "4334df83395693dc3f629bb43c18320d9e22e8c9") +ref_spec_7702 = ReferenceSpec("EIPS/eip-7702.md", "99f1be49f37c034bdd5c082946f5968710dbfc87") @dataclass(frozen=True) diff --git a/tests/prague/eip7702_set_code_tx/test_calls.py b/tests/prague/eip7702_set_code_tx/test_calls.py index 91f08073da6..6cc4891378d 100644 --- a/tests/prague/eip7702_set_code_tx/test_calls.py +++ b/tests/prague/eip7702_set_code_tx/test_calls.py @@ -18,7 +18,7 @@ pytestmark = pytest.mark.valid_from("Prague") REFERENCE_SPEC_GIT_PATH = "EIPS/eip-7702.md" -REFERENCE_SPEC_VERSION = "37ce65b354756ac51c6a6f114e15de4a523a7f2e" +REFERENCE_SPEC_VERSION = "99f1be49f37c034bdd5c082946f5968710dbfc87" LEGACY_CALL_FAILURE = 0 LEGACY_CALL_SUCCESS = 1 diff --git a/tests/shanghai/eip3855_push0/spec.py b/tests/shanghai/eip3855_push0/spec.py index f84fed71a11..ed210a18801 100644 --- a/tests/shanghai/eip3855_push0/spec.py +++ b/tests/shanghai/eip3855_push0/spec.py @@ -11,4 +11,4 @@ class ReferenceSpec: version: str -ref_spec_3855 = ReferenceSpec("EIPS/eip-3855.md", "42034250ae8dd4b21fdc6795773893c6f1e74d3a") +ref_spec_3855 = ReferenceSpec("EIPS/eip-3855.md", "6f85bd73336de4aacfad7ac3bb3a7e1ba2d68f51") diff --git a/tests/shanghai/eip3860_initcode/spec.py b/tests/shanghai/eip3860_initcode/spec.py index cbea66f3d1b..65dad3fcea3 100644 --- a/tests/shanghai/eip3860_initcode/spec.py +++ b/tests/shanghai/eip3860_initcode/spec.py @@ -11,7 +11,7 @@ class ReferenceSpec: version: str -ref_spec_3860 = ReferenceSpec("EIPS/eip-3860.md", "5f8151e19ad1c99da4bafd514ce0e8ab89783c8f") +ref_spec_3860 = ReferenceSpec("EIPS/eip-3860.md", "9ee005834d488e381455cf86a56c741a2e854a17") @dataclass(frozen=True) diff --git a/whitelist.txt b/whitelist.txt index ac3e7000545..ed149d44c98 100644 --- a/whitelist.txt +++ b/whitelist.txt @@ -137,6 +137,7 @@ P7692 eip7251 eips EIPs +EIP's el endianness EngineAPI