Skip to content

feat(forks,ci,tox): Create future feature #1385

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/configs/evm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ develop:
impl: eels
repo: null
ref: null
eip7692:
future:
impl: evmone
repo: ethereum/evmone
ref: master
Expand Down
4 changes: 2 additions & 2 deletions .github/configs/feature.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ develop:
evm-type: develop
fill-params: --until=Prague
solc: 0.8.21
eip7692:
evm-type: eip7692
future:
evm-type: future
fill-params: --fork=Osaka ./tests/osaka
solc: 0.8.21
eofwrap: true
8 changes: 8 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ consume cache --help

### 💥 Breaking Change

Fixtures release tarballs naming convention has been updated to follow the following scheme ([#1385](https://github.com/ethereum/execution-spec-tests/pull/1385)):

- `stable`: All tests up to and including the current mainnet hardfork; Cancun: N
- `develop`: All tests up to and including the current mainnet hardfork and its successor; Prague: N+1
- `future`: Only tests for the hardfork after develop; Osaka: N+2

`fixtures_eip7692.tar.gz` has been deprecated in favor of `fixtures_future.tar.gz` which now contains the Osaka tests.

### 🛠️ Framework

#### `consume`
Expand Down
68 changes: 11 additions & 57 deletions src/ethereum_test_forks/forks/forks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1287,81 +1287,35 @@ def engine_forkchoice_updated_version(
return 3


class CancunEIP7692( # noqa: SC200
Cancun,
transition_tool_name="Prague", # Evmone enables (only) EOF at Prague
blockchain_test_network_name="Prague", # Evmone enables (only) EOF at Prague
solc_name="cancun",
):
"""Cancun + EIP-7692 (EOF) fork (Deprecated)."""
class Osaka(Prague, solc_name="cancun"):
"""Osaka fork."""

@classmethod
def evm_code_types(cls, block_number: int = 0, timestamp: int = 0) -> List[EVMCodeType]:
"""EOF V1 is supported starting from this fork."""
return super(CancunEIP7692, cls).evm_code_types( # noqa: SC200
block_number,
timestamp,
) + [EVMCodeType.EOF_V1]
"""EOF V1 is supported starting from Osaka."""
return super(Osaka, cls).evm_code_types(block_number, timestamp) + [
EVMCodeType.EOF_V1,
]

@classmethod
def call_opcodes(
cls, block_number: int = 0, timestamp: int = 0
) -> List[Tuple[Opcodes, EVMCodeType]]:
"""EOF V1 introduces EXTCALL, EXTSTATICCALL, EXTDELEGATECALL."""
return [
return super(Osaka, cls).call_opcodes(block_number, timestamp) + [
(Opcodes.EXTCALL, EVMCodeType.EOF_V1),
(Opcodes.EXTSTATICCALL, EVMCodeType.EOF_V1),
(Opcodes.EXTDELEGATECALL, EVMCodeType.EOF_V1),
] + super(
CancunEIP7692,
cls, # noqa: SC200
).call_opcodes(block_number, timestamp)
]

@classmethod
def create_opcodes(
cls, block_number: int = 0, timestamp: int = 0
) -> List[Tuple[Opcodes, EVMCodeType]]:
"""EOF V1 introduces `EOFCREATE`."""
return [(Opcodes.EOFCREATE, EVMCodeType.EOF_V1)] + super(
CancunEIP7692,
cls, # noqa: SC200
).create_opcodes(block_number, timestamp)

@classmethod
def is_deployed(cls) -> bool:
"""
Flag that the fork has not been deployed to mainnet; it is under active
development.
"""
return False

@classmethod
def solc_min_version(cls) -> Version:
"""Return minimum version of solc that supports this fork."""
return Version.parse("1.0.0") # set a high version; currently unknown


class Osaka(Prague, solc_name="cancun"):
"""Osaka fork."""

@classmethod
def evm_code_types(cls, block_number: int = 0, timestamp: int = 0) -> List[EVMCodeType]:
"""EOF V1 is supported starting from Osaka."""
return super(Osaka, cls).evm_code_types(
block_number,
timestamp,
) + [EVMCodeType.EOF_V1]

@classmethod
def call_opcodes(
cls, block_number: int = 0, timestamp: int = 0
) -> List[Tuple[Opcodes, EVMCodeType]]:
"""EOF V1 introduces EXTCALL, EXTSTATICCALL, EXTDELEGATECALL."""
return [
(Opcodes.EXTCALL, EVMCodeType.EOF_V1),
(Opcodes.EXTSTATICCALL, EVMCodeType.EOF_V1),
(Opcodes.EXTDELEGATECALL, EVMCodeType.EOF_V1),
] + super(Osaka, cls).call_opcodes(block_number, timestamp)
return super(Osaka, cls).create_opcodes(block_number, timestamp) + [
(Opcodes.EOFCREATE, EVMCodeType.EOF_V1),
]

@classmethod
def is_deployed(cls) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion tests/osaka/eip7692_eof_v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
- [ethpandaops/eof-devnet-0](https://notes.ethereum.org/@ethpandaops/eof-devnet-0).
""" # noqa: E501

EOF_FORK_NAME = "CancunEIP7692,Osaka"
EOF_FORK_NAME = "Osaka"
10 changes: 5 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ commands =

[forks]
develop = Prague
eip7692 = Osaka
future = Osaka

[testenv:tests-deployed]
description = Fill test cases in ./tests/ for deployed mainnet forks.
Expand All @@ -75,20 +75,20 @@ commands_pre = solc-select use {[testenv]solc_version} --always-install
commands = pytest -n auto -k "not slow" --skip-evm-dump

[testenv:tests-develop]
description = Fill test cases in ./tests/ for deployed and development mainnet forks
description = Fill test cases in ./tests/ for deployed and deployed+1 mainnet forks
setenv =
# Use custom EELS_RESOLUTIONS_FILE if it is set via the environment (eg, in CI)
EELS_RESOLUTIONS_FILE = {env:EELS_RESOLUTIONS_FILE:}
commands_pre = solc-select use {[testenv]solc_version} --always-install
commands = pytest -n auto --until={[forks]develop} -k "not slow" --skip-evm-dump

[testenv:tests-eip7692]
description = Fill test cases in ./tests/ for EIP-7692 (EOF) on Osaka
[testenv:tests-future]
description = Fill test cases in ./tests/ for the deployed+2 mainnet fork
setenv =
# Use custom EELS_RESOLUTIONS_FILE if it is set via the environment (eg, in CI)
EELS_RESOLUTIONS_FILE = {env:EELS_RESOLUTIONS_FILE:}
commands_pre = solc-select use {[testenv]solc_version} --always-install
commands = pytest -n auto --evm-bin=evmone-t8n --fork={[forks]eip7692} -k "not slow" ./tests/osaka --skip-evm-dump
commands = pytest -n auto --evm-bin=evmone-t8n --fork={[forks]future} -k "not slow" ./tests/osaka --skip-evm-dump

# ----------------------------------------------------------------------------------------------
# ALIAS ENVIRONMENTS
Expand Down