Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(transition_tool): Support EELS resolver in daemon mode #792

Merged
merged 55 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
847f34b
feat(transition_tool): Use execution-specs daemon
marioevz Feb 22, 2024
a0de397
fix: remove pipe subprocess
marioevz Feb 22, 2024
5c812f0
changelog
marioevz Feb 22, 2024
d8ab772
Update docs/CHANGELOG.md
marioevz Feb 28, 2024
7b924ff
feat(fw): eels daemon rebase.
spencer-tb Aug 12, 2024
b0eb91f
chore(fw): add t8n evaluate server method.
spencer-tb Aug 12, 2024
4b2b658
chore: tweak.
spencer-tb Aug 13, 2024
d831783
Fix unsupported fork handling
petertdavies Sep 6, 2024
c324919
Add requests-unixsocket2 dependency
petertdavies Sep 6, 2024
7e0cc95
Send `SIGTERM` rather than `SIGKILL` so daemon can do cleanup
petertdavies Sep 6, 2024
1c23c59
Reformat with black
petertdavies Sep 6, 2024
2c02f48
feat: extra tweaks & additions to eels-e-r.
spencer-tb Sep 6, 2024
6886286
docs: update changelog, to correct version.
spencer-tb Sep 6, 2024
d888f30
Merge pull request #1 from spencer-tb/eels-daemon-new-tweaks
petertdavies Sep 6, 2024
6f9a4ba
Bump ethereum package version in uv.lock
petertdavies Sep 18, 2024
63cab9e
chore: add uv lock.
spencer-tb Sep 9, 2024
31968b4
chore: make EELS the default filler.
spencer-tb Sep 9, 2024
2c10913
chore: add EELS evm resolver as dependency.
spencer-tb Sep 9, 2024
e1496c8
ci: use EELS for default fixture releases.
spencer-tb Sep 9, 2024
ba1d0a0
chore: more tweaks.
spencer-tb Sep 9, 2024
83dee27
chore: fix github actions.
spencer-tb Sep 9, 2024
14ce7f9
Bump ethereum-spec-evm-resolver package version in uv.lock
petertdavies Sep 18, 2024
77d7fea
Make --evm-bin default be a command name rather than a path
petertdavies Sep 18, 2024
e3256a6
tests(fw): fix pytester tests with ethereum-spec-evm-resolver
danceratopz Sep 18, 2024
14cc1eb
tests(fw): update fork pytester test - eels doesn't support constanti…
danceratopz Sep 18, 2024
09bc3df
Apply Dan's suggestions from code review
petertdavies Sep 19, 2024
dbfe125
Don't swallow messages from the EELS daemon
petertdavies Sep 19, 2024
3e9636a
Bump ethereum-spec-evm-resolver version in uv.lock
petertdavies Sep 19, 2024
667b997
Bump ethereum-spec-evm-resolver version in uv.lock
petertdavies Sep 19, 2024
5367fd5
chore(ci): use ubuntu-24.04 for ripemd #264
danceratopz Sep 19, 2024
494fb2c
fix(tests): remove xfail due to missing ripemd support, fixes #264
danceratopz Sep 19, 2024
ae9e528
fix(ci): run tox with uvx to avoid venvs in 24.04
danceratopz Sep 19, 2024
6d5958f
fix(ci): also remove pip install tox
danceratopz Sep 19, 2024
30211a4
chore: bump ethereum-spec-evm-resolver in uv.lock
danceratopz Sep 19, 2024
b39d74e
fix(ci): make execution-specs the default t8n (again)
danceratopz Sep 19, 2024
6bcda04
docs: update readme and getting started for eels as default
danceratopz Sep 20, 2024
0402820
docs: small improvements to quick start (make eels more prominent)
danceratopz Sep 20, 2024
62cb34b
docs: small fix to quick start
danceratopz Sep 20, 2024
9419920
docs: update readme for eels as default
danceratopz Sep 23, 2024
1b6cccf
docs: fix screenshot inclusion in readme
danceratopz Sep 23, 2024
5f6d6e4
docs: remove spurious html from readme
danceratopz Sep 23, 2024
c7132c9
Merge branch 'main' into eels-daemon-new
danceratopz Sep 23, 2024
42a3c50
docs: remove speed-up comment from changelog
danceratopz Sep 23, 2024
ef83cea
tests(fw,ci): execute tests that call `fill` or `generate()` in serial
danceratopz Sep 23, 2024
746ce99
chore: fix socket path fix from resolver fork branch
danceratopz Sep 27, 2024
802e495
Revert "tests(fw,ci): execute tests that call `fill` or `generate()` …
danceratopz Sep 27, 2024
753adc0
fix: add uv.lock forgotten in 746ce99
danceratopz Sep 27, 2024
9a250b3
refactor(fw-tests): don't run fw tests that call t8n in parallel
danceratopz Sep 27, 2024
b4cac3f
feat(docs): add link to troubleshooting in install section
danceratopz Sep 27, 2024
57c2f6d
Merge branch 'main' into eels-daemon-new
danceratopz Sep 27, 2024
ba11198
Bump ethereum-spec-evm-resolver in uv.lock
petertdavies Sep 27, 2024
9642316
Revert "chore: fix socket path fix from resolver fork branch"
danceratopz Sep 27, 2024
007eee8
chore: change resolver in uv.lock back to petertdavies
danceratopz Sep 27, 2024
bf7d6ae
chore(fw,tests): run test_filler tests in serial
danceratopz Sep 27, 2024
2759542
chore(fw,tests): run cli filler tests in serial
danceratopz Sep 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/actions/build-evm-base/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ runs:
echo "Reference: ${{ steps.config-evm-reader.outputs.ref }}"
echo "EVM Binary: ${{ steps.config-evm-impl-config-reader.outputs.evm-bin }}"
echo "X-Dist parameter: ${{ steps.config-evm-impl-config-reader.outputs.x-dist }}"
- name: Skip building for EELS
if: steps.config-evm-reader.outputs.impl == 'eels'
shell: bash
run: echo "Skipping build for EELS"
- name: Build the EVM using Geth action
if: steps.config-evm-reader.outputs.impl == 'geth'
uses: ./.github/actions/build-evm-client/geth
Expand Down
3 changes: 3 additions & 0 deletions .github/configs/evm-impl.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
eels:
evm-bin: ethereum-spec-evm-resolver
x-dist: auto
danceratopz marked this conversation as resolved.
Show resolved Hide resolved
geth:
evm-bin: evm
x-dist: auto
Expand Down
6 changes: 3 additions & 3 deletions .github/configs/evm.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
stable:
impl: geth
repo: ethereum/go-ethereum
ref: master
impl: eels
repo: null
ref: null
danceratopz marked this conversation as resolved.
Show resolved Hide resolved
develop:
impl: geth
repo: lightclient/go-ethereum
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
evmone-coverage-diff:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
strategy:
matrix:
driver: [retesteth, native]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs_main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
deploy:
if: github.repository_owner == 'ethereum' # don't run on forks
runs-on: ubuntu-latest
runs-on: ubuntu-24.04

steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs_tags.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
deploy:
if: github.repository_owner == 'ethereum' # don't run on forks
runs-on: ubuntu-latest
runs-on: ubuntu-24.04

steps:
- name: Checkout
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/fixtures.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
features:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
outputs:
features: ${{ steps.parse.outputs.features }}
steps:
Expand All @@ -20,7 +20,7 @@ jobs:
echo "features=$(grep -Po "^[0-9a-zA-Z_\-]+" ./.github/configs/feature.yaml | jq -R . | jq -cs .)" >> "$GITHUB_OUTPUT"
build:
needs: features
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
strategy:
matrix:
name: ${{ fromJson(needs.features.outputs.features) }}
Expand All @@ -32,7 +32,7 @@ jobs:
with:
release_name: ${{ matrix.name }}
release:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs: build
if: startsWith(github.ref, 'refs/tags/')
steps:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/fixtures_feature.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
feature-names:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
outputs:
names: ${{ steps.feature-name.outputs.names }}
steps:
Expand All @@ -23,7 +23,7 @@ jobs:
echo names=${names}
echo names=${names} >> "$GITHUB_OUTPUT"
build:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs: feature-names
strategy:
matrix:
Expand All @@ -36,7 +36,7 @@ jobs:
with:
release_name: ${{ matrix.feature }}
release:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs: build
if: startsWith(github.ref, 'refs/tags/')
steps:
Expand Down
16 changes: 7 additions & 9 deletions .github/workflows/tox_verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,28 @@ jobs:
strategy:
matrix:
include:
- os: ubuntu-latest
- os: ubuntu-24.04
python: "3.10"
evm-type: "stable"
tox-cmd: "tox" # run-parallel --parallel-no-spinner" # TODO: disable parallelisation for uv testing
- os: ubuntu-latest
tox-cmd: "uvx --with=tox-uv tox" # run-parallel --parallel-no-spinner" # TODO: disable parallelisation for uv testing
- os: ubuntu-24.04
python: "3.12"
evm-type: "stable"
tox-cmd: "tox" # run-parallel --parallel-no-spinner"
tox-cmd: "uvx --with=tox-uv tox" # run-parallel --parallel-no-spinner"
# Disabled due to unavailable evm implementation for devnet-1
# - os: ubuntu-latest
# - os: ubuntu-24.04
# python: '3.11'
# evm-type: 'develop'
# tox-cmd: 'tox -e tests-develop'
# Disabled to not be gated by evmone implementation
# - os: ubuntu-latest
# - os: ubuntu-24.04
# python: '3.11'
# evm-type: 'eip7692'
# tox-cmd: 'tox -e tests-eip7692'
- os: macos-latest
python: "3.11"
evm-type: "stable"
tox-cmd: "tox" # run-parallel --parallel-no-spinner"
tox-cmd: "uvx --with=tox-uv tox" # run-parallel --parallel-no-spinner"
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -52,8 +52,6 @@ jobs:
brew install aspell
# Add additional packages on 3.11: https://github.com/ethereum/execution-spec-tests/issues/274
if [ ${{ matrix.python }} == '3.11' ]; then brew install autoconf automake libtool; fi
- name: Install Tox and any other packages
run: pip install tox-uv
- name: Run Tox (CPython)
run: ${{ matrix.tox-cmd }}
- uses: DavidAnson/markdownlint-cli2-action@v16
Expand Down
91 changes: 54 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,62 +79,79 @@ All current tags, their t8n implementation and branch they point to, are listed

### Prerequisites

The following requires a Python 3.10, 3.11 or 3.12 installation.
The tools provided by ethereum/execution-spec-tests use `uv` ([docs.astral.sh/uv](https://docs.astral.sh/uv/)) to manage their dependencies and virtual environment. `uv` downloads Python for your target platform if one of the required versions (Python 3.10, 3.11 or 3.12) is not available natively.

### Quick Start
`uv` can be installed via curl (recommended; can self-update):

This guide installs stable versions of the external (go-ethereum) `evm` executable and will only enable generation of test fixtures for features deployed to mainnet. In order to generate fixtures for features under active development, you can follow the steps below and then follow the [additional steps in the online doc](https://ethereum.github.io/execution-spec-tests/getting_started/executing_tests_dev_fork/).
```console
curl -LsSf https://astral.sh/uv/install.sh | sh
```

or pip (requires Python, can't self-update):

```console
pip install uv
```

### Installation

Clone [execution-spec-tests](https://github.com/ethereum/execution-spec-tests) and install its dependencies:

```console
git clone https://github.com/ethereum/execution-spec-tests
cd execution-spec-tests
uv sync --all-extras
uv run solc-select use 0.8.24 --always-install
```

See [Installation Troubleshooting](./installation_troubleshooting.md) in the online docs if you encounter issues.

1. Ensure go-ethereum's `evm` tool is in your path. Either build the required version, or alternatively:
### Exploring and Filling Test Cases

By default, JSON test fixtures are generated from this repository's Python test cases using the [Ethereum Execution Layer Specification](https://github.com/ethereum/execution-specs) (EELS) reference implementation. The resulting JSON fixtures can be executed against execution clients to verify consensus. The process of generating fixtures is often referred to as "filling".

1. Explore test cases via `--collect-only` and search for test cases that combine `PUSH0` and `DELEGATECALL` in the EVM functionality introduced in the Shanghai hard fork:

```console
sudo add-apt-repository -y ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install ethereum
uv run fill --collect-only -k "push0 and delegatecall" tests/shanghai/
```

More help:
The `fill` command is based on [`pytest`](https://docs.pytest.org/en/stable/). The above command uses the [optional pytest arguments](https://docs.pytest.org/en/stable/how-to/usage.html):

- [geth installation doc](https://geth.ethereum.org/docs/getting-started/installing-geth#ubuntu-via-ppas).
- `--collect-only` only collect test cases; don't execute them.
- `-k <expression>` filter test cases by their test case ID based on the given expression.
- `tests/shanghai` the directory containing the test cases (tells `fill` to only discover test cases in this directory; default: `tests/`).

Help for other platforms is available in the [online doc](https://ethereum.github.io/execution-spec-tests/getting_started/quick_start/).
Expected console output:
![Screenshot of pytest test collection console output](./docs/getting_started/img/pytest_collect_only.png)

2. Clone the [execution-spec-tests](https://github.com/ethereum/execution-spec-tests) repo and install its dependencies ([`uv`](https://docs.astral.sh/uv/) will create and manage a virtual environment for its installation):
2. Fill `state_test` fixtures for these test cases:

```console
git clone https://github.com/ethereum/execution-spec-tests
cd execution-spec-tests
pip install uv # or curl -LsSf https://astral.sh/uv/install.sh | sh
uv sync --all-extras
source .venv/bin/activate # or run `uv run fill ...`
```
```console
uv run fill -k "push0 and delegatecall" tests/shanghai/ -m state_test -v
```

3. Verify the installation:
1. Explore test cases:
where:

```console
fill --collect-only
```
- `-m state_test` only fills test cases marked as a `state_test` (see all available markers via `uv run fill --markers`).
- `-v` enables verbose output.

Expected console output:
![Screenshot of pytest test collection console output](docs/getting_started/img/pytest_collect_only.png)
Expected console output:
![Screenshot of fill test collection console output](./docs/getting_started/img/pytest_run_example.png)

2. Execute the test cases (verbosely) in the `./tests/berlin/eip2930_access_list/test_acl.py` module:
3. Verify the generated fixtures:

```console
fill -v tests/berlin/eip2930_access_list/test_acl.py
```
a. Check the corresponding fixture file has been generated:

Expected console output:
![Screenshot of pytest test collection console output](docs/getting_started/img/pytest_run_example.png)
Check:
```console
head fixtures/state_tests/shanghai/eip3855_push0/push0/push0_contract_during_call_contexts.json
```

1. The versions of the `evm` tool is as expected (your versions may differ from those in the highlighted box).
2. The corresponding fixture file has been generated:
b. Open the generated HTML test using the link provided at the bottom of the console output. This is written to the output directory at:

```console
head fixtures/blockchain_tests/berlin/eip2930_access_list/acl/access_list.json
```
```console
./fixtures/.meta/report_fill.html
```

## Usage

Expand Down
4 changes: 2 additions & 2 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ Test fixtures for use by clients are available for each release on the [Github r

### πŸ”§ EVM Tools

- ✨ Fill test fixtures using EELS by default. EEST now uses the [`ethereum-specs-evm-resolver`](https://github.com/petertdavies/ethereum-spec-evm-resolver) with the EELS daemon ([#792](https://github.com/ethereum/execution-spec-tests/pull/792)).

### πŸ“‹ Misc

- ✨ Feature releases can now include multiple types of fixture tarball files from different releases that start with the same prefix ([#736](https://github.com/ethereum/execution-spec-tests/pull/736)).
Expand Down Expand Up @@ -159,8 +161,6 @@ Test fixtures for use by clients are available for each release on the [Github r
- ✨ Adds an optional `verify_sync` field to hive blockchain tests (EngineAPI). When set to true a second client attempts to sync to the first client that executed the tests ([#431](https://github.com/ethereum/execution-spec-tests/pull/431)).
- 🐞 Fix manually setting the gas limit in the genesis test env for post genesis blocks in blockchain tests ([#472](https://github.com/ethereum/execution-spec-tests/pull/472)).

### πŸ”§ EVM Tools

### πŸ“‹ Misc

- 🐞 Fix deprecation warnings due to outdated config in recommended VS Code project settings ([#420](https://github.com/ethereum/execution-spec-tests/pull/420)).
Expand Down
Binary file modified docs/getting_started/img/pytest_collect_only.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/getting_started/img/pytest_run_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading