forked from ethereum/execution-spec-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: extra tweaks & additions to eels-e-r.
- Loading branch information
1 parent
1c23c59
commit 2c02f48
Showing
3 changed files
with
63 additions
and
74 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
""" | ||
Ethereum Specs EVM Transition tool interface. | ||
Ethereum Specs EVM Resolver Transition Tool Interface. | ||
https://github.com/ethereum/execution-specs | ||
https://github.com/petertdavies/ethereum-spec-evm-resolver | ||
""" | ||
|
||
import subprocess | ||
|
@@ -20,76 +20,23 @@ | |
|
||
class ExecutionSpecsTransitionTool(TransitionTool): | ||
""" | ||
Ethereum Specs `ethereum-spec-evm` Transition tool interface wrapper class. | ||
The behavior of this tool is almost identical to go-ethereum's `evm t8n` command. | ||
note: Using the latest version of the `ethereum-spec-evm` tool: | ||
As the `ethereum` package provided by `execution-specs` is a requirement of | ||
`execution-spec-tests`, the `ethereum-spec-evm` is already installed in the | ||
virtual environment where `execution-spec-tests` is installed | ||
(via `pip install -e .`). Therefore, the `ethereum-spec-evm` transition tool | ||
can be used to fill tests via: | ||
```console | ||
fill --evm-bin=ethereum-spec-evm | ||
``` | ||
To ensure you're using the latest version of `ethereum-spec-evm` you can run: | ||
``` | ||
pip install --force-reinstall -e . | ||
``` | ||
or | ||
``` | ||
pip install --force-reinstall -e .[docs,lint,tests] | ||
``` | ||
as appropriate. | ||
note: Using a specific version of the `ethereum-spec-evm` tool: | ||
1. Create a virtual environment and activate it: | ||
``` | ||
python -m venv venv-execution-specs | ||
source venv-execution-specs/bin/activate | ||
``` | ||
2. Clone the ethereum/execution-specs repository, change working directory to it and | ||
retrieve the desired version of the repository: | ||
``` | ||
git clone [email protected]:ethereum/execution-specs.git | ||
cd execution-specs | ||
git checkout <version> | ||
``` | ||
3. Install the packages provided by the repository: | ||
``` | ||
pip install -e . | ||
``` | ||
Check that the `ethereum-spec-evm` command is available: | ||
``` | ||
ethereum-spec-evm --help | ||
``` | ||
4. Clone the ethereum/execution-specs-tests repository and change working directory to it: | ||
``` | ||
cd .. | ||
git clone [email protected]:ethereum/execution-spec-tests.git | ||
cd execution-spec-tests | ||
``` | ||
5. Install the packages provided by the ethereum/execution-spec-tests repository: | ||
``` | ||
pip install -e . | ||
``` | ||
6. Run the tests, specifying the `ethereum-spec-evm` command as the transition tool: | ||
``` | ||
fill --evm-bin=path/to/venv-execution-specs/ethereum-spec-evm | ||
``` | ||
Ethereum Specs EVM Resolver `ethereum-spec-evm-resolver` Transition Tool wrapper class. | ||
`ethereum-spec-evm-resolver` is installed by default for `execution-spec-tests`: | ||
```console | ||
uv run fill --evm-bin=ethereum-spec-evm | ||
``` | ||
To use a specific version of the `ethereum-spec-evm-resolver` tool, update it to the | ||
desired version in `pyproject.toml`. | ||
The `ethereum-spec-evm-resolver` tool essentially wraps around the EELS evm daemon. It can | ||
handle requests for different EVM forks, even when those forks are implemented by different | ||
versions of EELS hosted in different places. | ||
""" | ||
|
||
default_binary = Path("ethereum-spec-evm") | ||
detect_binary_pattern = compile(r"^ethereum-spec-evm\b") | ||
default_binary = Path("ethereum-spec-evm-resolver") | ||
detect_binary_pattern = compile(r"^ethereum-spec-evm-resolver\b") | ||
t8n_use_server: bool = True | ||
server_dir: Optional[TemporaryDirectory] = None | ||
|
||
|
@@ -105,7 +52,8 @@ def __init__( | |
result = subprocess.run(args, capture_output=True, text=True) | ||
except subprocess.CalledProcessError as e: | ||
raise Exception( | ||
"ethereum-spec-evm process unexpectedly returned a non-zero status code: " f"{e}." | ||
"ethereum-spec-evm-resolver process unexpectedly returned a non-zero status code: " | ||
f"{e}." | ||
) | ||
except Exception as e: | ||
raise Exception(f"Unexpected exception calling ethereum-spec-evm: {e}.") | ||
|
@@ -126,6 +74,8 @@ def start_server(self): | |
"--uds", | ||
self.server_file_path, | ||
], | ||
stdout=subprocess.PIPE, | ||
stderr=subprocess.PIPE, | ||
) | ||
start = time.time() | ||
while True: | ||
|
This file contains 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
This file contains 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