Skip to content

Commit

Permalink
feat(forks,tests): Osaka (#869)
Browse files Browse the repository at this point in the history
* refactor(forks): Rename `PragueEIP7692` -> `Osaka`

* refactor(docs): Rename `PragueEIP7692` -> `Osaka`

* refactor(github): Rename `PragueEIP7692` -> `Osaka`

* fix(tox.ini): Osaka

* refactor(tests): Move EOF to Osaka

* fix(plugins): typo

* fix(docs): changelog

* fix(tests): create `tests/osaka/__init__.py`

* fix(forks): Export `Osaka`

* Update tests/osaka/__init__.py

Co-authored-by: Danno Ferrin <[email protected]>

* fix(docs): tox

* Update src/pytest_plugins/filler/gen_test_doc/page_props.py

Co-authored-by: danceratopz <[email protected]>

* Update src/pytest_plugins/filler/gen_test_doc/gen_test_doc.py

Co-authored-by: danceratopz <[email protected]>

* Apply suggestions from code review

Co-authored-by: danceratopz <[email protected]>

* Update tests/osaka/eip7692_eof_v1/eof_tracker.md

Co-authored-by: danceratopz <[email protected]>

* fix(forks): tox

---------

Co-authored-by: Danno Ferrin <[email protected]>
Co-authored-by: danceratopz <[email protected]>
  • Loading branch information
3 people authored Oct 8, 2024
1 parent ef3fcd4 commit b69e696
Show file tree
Hide file tree
Showing 73 changed files with 164 additions and 166 deletions.
2 changes: 1 addition & 1 deletion .github/configs/evm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ eip7692:
impl: evmone
repo: ethereum/evmone
ref: master
eip7692-prague:
eip7692-osaka:
impl: besu
repo: hyperledger/besu
ref: main
Expand Down
8 changes: 4 additions & 4 deletions .github/configs/feature.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ develop:
solc: 0.8.21
eip7692:
evm-type: eip7692
fill-params: --fork=CancunEIP7692 ./tests/prague
fill-params: --fork=CancunEIP7692 ./tests/osaka
solc: 0.8.21
eip7692-prague:
evm-type: eip7692-prague
fill-params: --fork=PragueEIP7692 ./tests/prague -k "not slow"
eip7692-osaka:
evm-type: eip7692-osaka
fill-params: --fork=Osaka ./tests/osaka -k "not slow"
solc: 0.8.21
pectra-devnet-3:
evm-type: pectra-devnet-3
Expand Down
2 changes: 2 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Test fixtures for use by clients are available for each release on the [Github r
- ✨ Convert all opcodes validation test `tests/frontier/opcodes/test_all_opcodes.py` ([#748](https://github.com/ethereum/execution-spec-tests/pull/748)).
- ✨ Update [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) tests for Devnet-3 ([#733](https://github.com/ethereum/execution-spec-tests/pull/733))
- 🐞 Fix [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702)+EOF tests due to incorrect test expectations and faulty `Conditional` test generator in EOF mode ([#821](https://github.com/ethereum/execution-spec-tests/pull/821))
- 💥 `PragueEIP7692` fork in tests has been updated to `Osaka` ([#869](https://github.com/ethereum/execution-spec-tests/pull/869))

### 🛠️ Framework

Expand Down Expand Up @@ -45,6 +46,7 @@ Test fixtures for use by clients are available for each release on the [Github r
- ✨ Add `Wei` type to `ethereum_test_base_types` which allows parsing wei amounts from strings like "1 ether", "1000 wei", "10**2 gwei", etc ([#825](https://github.com/ethereum/execution-spec-tests/pull/825)).
- ✨ Pin EELS versions in `eels_resolutions.json` and include this file in fixture releases ([#872](https://github.com/ethereum/execution-spec-tests/pull/872)).
- 🔀 Replace `ethereum.base_types` with `ethereum-types` ([#850](https://github.com/ethereum/execution-spec-tests/pull/850)).
- 💥 `PragueEIP7692` fork has been renamed to `Osaka` ([#869](https://github.com/ethereum/execution-spec-tests/pull/869))

### 🔧 EVM Tools

Expand Down
4 changes: 2 additions & 2 deletions docs/gen_test_case_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
importlib.reload(gen_test_doc) # get changes in plugin for use with `mkdocs serve`

logger = logging.getLogger("mkdocs")
dev_fork = "PragueEIP7692"
dev_fork = "Osaka"
args = [
"--override-ini",
"filterwarnings=ignore::pytest.PytestAssertRewriteWarning", # suppress warnings due to reload
Expand All @@ -31,7 +31,7 @@
"-s",
"tests",
# "tests/shanghai",
# "tests/prague/eip7692_eof_v1", # noqa: SC100
# "tests/osaka/eip7692_eof_v1", # noqa: SC100
# "tests/prague/eip2537_bls_12_381_precompiles", # noqa: SC100
]

Expand Down
2 changes: 2 additions & 0 deletions src/ethereum_test_forks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
Istanbul,
London,
MuirGlacier,
Osaka,
Paris,
Prague,
Shanghai,
Expand Down Expand Up @@ -66,6 +67,7 @@
"ShanghaiToCancunAtTime15k",
"Cancun",
"Prague",
"Osaka",
"get_transition_forks",
"forks_from",
"forks_from_until",
Expand Down
21 changes: 6 additions & 15 deletions src/ethereum_test_forks/forks/forks.py
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,7 @@ class CancunEIP7692( # noqa: SC200
solc_name="cancun",
):
"""
Cancun + EIP-7692 (EOF) fork
Cancun + EIP-7692 (EOF) fork (Deprecated)
"""

@classmethod
Expand Down Expand Up @@ -1000,22 +1000,17 @@ def solc_min_version(cls) -> Version:
return Version.parse("1.0.0") # set a high version; currently unknown


class PragueEIP7692( # noqa: SC200
Prague,
transition_tool_name="Prague", # Besu enables EOF at Prague
blockchain_test_network_name="Prague", # Besu enables EOF at Prague
solc_name="cancun",
):
class Osaka(Prague, solc_name="cancun"):
"""
Prague + EIP-7692 (EOF) fork
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.
EOF V1 is supported starting from Osaka.
"""
return super(PragueEIP7692, cls,).evm_code_types( # noqa: SC200
return super(Osaka, cls,).evm_code_types(
block_number,
timestamp,
) + [EVMCodeType.EOF_V1]
Expand All @@ -1031,11 +1026,7 @@ def call_opcodes(
(Opcodes.EXTCALL, EVMCodeType.EOF_V1),
(Opcodes.EXTSTATICCALL, EVMCodeType.EOF_V1),
(Opcodes.EXTDELEGATECALL, EVMCodeType.EOF_V1),
] + super(
PragueEIP7692, cls # noqa: SC200
).call_opcodes(
block_number, timestamp
)
] + super(Osaka, cls).call_opcodes(block_number, timestamp)

@classmethod
def is_deployed(cls) -> bool:
Expand Down
6 changes: 3 additions & 3 deletions src/pytest_plugins/filler/gen_test_doc/gen_test_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ def add_directory_page_props(self) -> None:
pytest_node_id=str(directory),
source_code_url=generate_github_url(directory, branch_or_commit_or_tag=self.ref),
# TODO: This won't work in all cases; should be from the development fork
# Currently breaks for `test/prague/eip7692_eof_v1/index.md` # noqa: SC100
# Currently breaks for `tests/osaka/eip7692_eof_v1/index.md` # noqa: SC100
valid_from_fork=fork,
package_name=get_import_path(directory), # init.py will be used for docstrings
)
Expand Down Expand Up @@ -514,8 +514,8 @@ def sort_by_fork_deployment_and_path(x: PageProps) -> Tuple[Any, ...]:
- ("Test Case Reference",) -> tests/index.md
- ("Test Case Reference", "Berlin") -> tests/berlin/index.md
- ("Test Case Reference", "Prague", "EIP-7692 EOF V1", tracker.md")
tests/prague/eip7692_eof_v1/tracker.md
- ("Test Case Reference", "Osaka", "EIP-7692 EOF V1", tracker.md")
tests/osaka/eip7692_eof_v1/tracker.md
- ("Test Case Reference", "Shanghai", "EIP-3855 PUSH0", "Spec") ->
tests/shanghai/eip3855_push0/spec.py
Expand Down
2 changes: 1 addition & 1 deletion src/pytest_plugins/filler/gen_test_doc/page_props.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def apply_name_filters(input_string: str):
"""
Apply a list of capitalizations/regexes to names used in titles & nav menus.
Note: As of PragueEIP7692 With 634 doc pages, this function constitutes ~2.0s
Note: As of 2024-10-08, with 634 doc pages, this function constitutes ~2.0s
of the total runtime (~5.5s). This seems to be insignificant with the time
taken by mkdocstrings to include the docstrings in the final output (which)
is a separate mkdocs "build-step" occurs outside the scope of this plugin.
Expand Down
3 changes: 3 additions & 0 deletions tests/osaka/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""
Test cases for EVM functionality introduced in Osaka, [EIP-7607: Hardfork Meta - Fusaka](https://eip.directory/eips/eip-7607).
""" # noqa: E501
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
Test cases for all EIPs mentioned in the EOF V1 meta-EIP.
"""

EOF_FORK_NAME = "CancunEIP7692,PragueEIP7692"
EOF_FORK_NAME = "CancunEIP7692,Osaka"
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
eofcreate_extcall_returncontract - per the new initcode mode tests you cannot have RETURNCONTRACT
in a deployed contract
eofcreate_dataloadn_referring_to_auxdata - covered by
tests.prague.eip7480_data_section.test_data_opcodes.test_data_section_succeed
tests.osaka.eip7480_data_section.test_data_opcodes.test_data_section_succeed
eofcreate_initcontainer_return - RETURN is banned in initcode containers
eofcreate_initcontainer_stop - STOP is banned in initcode containers
All TXCREATE tests - TXCREATE has been removed from Prague
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ def test_eof_eofcreate_msg_depth(
Test EOFCREATE handles msg depth limit correctly (1024).
NOTE: due to block gas limit and the 63/64th rule this limit is unlikely to be hit
on mainnet.
NOTE: See `tests/prague/eip7692_eof_v1/eip7069_extcall/test_calls.py::test_eof_calls_msg_depth`
NOTE: See `tests/osaka/eip7692_eof_v1/eip7069_extcall/test_calls.py::test_eof_calls_msg_depth`
for more explanations and comments. Most notable deviation from that test is that here
calls and `EOFCREATE`s alternate in order to reach the max depth. `who_fails` decides
whether the failing depth 1024 will be on a call or on an `EOFCREATE` to happen.
Expand Down
Loading

0 comments on commit b69e696

Please sign in to comment.