Skip to content

Commit

Permalink
Update ethereum/tests to v13.1; Merge -> Paris
Browse files Browse the repository at this point in the history
  • Loading branch information
fselmo committed Mar 9, 2024
1 parent 8a07976 commit 0ac74f6
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,12 @@ jobs:
- image: cimg/python:3.11
environment:
TOXENV: py311-native-blockchain-london
py311-native-blockchain-merge:
py311-native-blockchain-paris:
<<: *common
docker:
- image: cimg/python:3.11
environment:
TOXENV: py311-native-blockchain-merge
TOXENV: py311-native-blockchain-paris
py311-native-blockchain-petersburg:
<<: *common
docker:
Expand Down Expand Up @@ -375,7 +375,7 @@ workflows:
- py311-native-blockchain-homestead
- py311-native-blockchain-istanbul
- py311-native-blockchain-london
- py311-native-blockchain-merge
- py311-native-blockchain-paris
- py311-native-blockchain-petersburg
- py311-native-blockchain-shanghai
- py311-native-blockchain-spurious_dragon
Expand Down
2 changes: 1 addition & 1 deletion eth/tools/fixtures/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def chain_vm_configuration(
return ((0, BerlinVM),)
elif network == "London":
return ((0, LondonVM),)
elif network == "Merge":
elif network == "Paris":
return ((0, ParisVM),)
elif network == "Shanghai":
return ((0, ShanghaiVM),)
Expand Down
34 changes: 32 additions & 2 deletions tests/json-fixtures/blockchain/test_blockchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -1071,6 +1071,13 @@
"GeneralStateTests/stRevertTest/RevertInCreateInInit.json",
"RevertInCreateInInit_d0g0v0_Shanghai",
),
*(
(
"GeneralStateTests/stRevertTest/RevertInCreateInInit_Paris.json",
f"RevertInCreateInInit_Paris_d0g0v0_{fork}",
)
for fork in ["Istanbul", "Berlin", "London", "Shanghai"]
),
# The CREATE2 variant seems to have been derived from the one above - it, too,
# has a "synthetic" state, on which py-evm flips.
# * https://github.com/ethereum/py-evm/pull/1181#issuecomment-446330609
Expand Down Expand Up @@ -1102,6 +1109,13 @@
"GeneralStateTests/stCreate2/RevertInCreateInInitCreate2.json",
"RevertInCreateInInitCreate2_d0g0v0_Shanghai",
),
*(
(
"GeneralStateTests/stCreate2/RevertInCreateInInitCreate2Paris.json",
f"RevertInCreateInInitCreate2Paris_d0g0v0_{fork}",
)
for fork in ["Istanbul", "Berlin", "London", "Shanghai"]
),
# Four variants have been specifically added to test a collision type
# like the above; therefore, they fail in the same manner.
# * https://github.com/ethereum/py-evm/pull/1579#issuecomment-446591118
Expand Down Expand Up @@ -1141,16 +1155,32 @@
f"InitCollision_d{i}g0v0_{fork}",
)
for i in range(4)
for fork in ["Istanbul", "Berlin", "London", "Merge", "Shanghai"]
for fork in ["Istanbul", "Berlin", "London", "Paris", "Shanghai"]
),
# TODO: Investigate if these are still unaddressed and supposed to be off or not
*(
(
"GeneralStateTests/stSStoreTest/InitCollisionParis.json",
f"InitCollisionParis_d{i}g0v0_{fork}",
)
for i in range(4)
for fork in ["Istanbul", "Berlin", "London", "Shanghai"]
),
}


def blockchain_fixture_mark_fn(fixture_path, fixture_name, fixture_fork):
fixture_id = (fixture_path, fixture_name)

# -- failures unaccounted for -- #
if ("ExpectedOutput_call_return_code_0x01-returned_data_0x0001") in fixture_name:
# TODO: look into newly failing modexp tests in v13.1
return pytest.mark.skip("New modexp tests that fail since v13.1")
elif ("ExpectedOutput_call_return_code_0x01-returned_data_0x01") in fixture_name:
return pytest.mark.skip("New modexp tests that fail since v13.1")

# -- expected skips and failures -- #
if "bcExploitTest/" in fixture_path:
elif "bcExploitTest/" in fixture_path:
return pytest.mark.skip("Exploit tests are slow")
elif fixture_path.startswith("bcForkStressTest/ForkStressTest.json"):
return pytest.mark.skip("Fork stress tests are slow.")
Expand Down
3 changes: 1 addition & 2 deletions tests/json-fixtures/test_transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,7 @@ def fixture_transaction_class(fixture_data):
return LondonTransactionBuilder
elif fork_name == ForkName.Metropolis:
pytest.skip("Metropolis Transaction class has not been implemented")
elif fork_name == "Merge":
# EL fork name is Paris, `ethereum/tests` calls the Network "Merge"
elif fork_name == ForkName.Paris:
return ParisTransactionBuilder
elif fork_name == ForkName.Shanghai:
return ShanghaiTransactionBuilder
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ envlist=
py311-native-blockchain-{ \
metropolis, transition, frontier, homestead, tangerine_whistle, \
spurious_dragon, byzantium, constantinople, petersburg, istanbul, \
berlin, london, merge, shanghai \
berlin, london, paris, shanghai \
}

[flake8]
Expand Down Expand Up @@ -41,7 +41,7 @@ commands=
native-blockchain-istanbul: pytest {posargs:tests/json-fixtures/blockchain/test_blockchain.py --fork Istanbul}
native-blockchain-berlin: pytest {posargs:tests/json-fixtures/blockchain/test_blockchain.py --fork Berlin}
native-blockchain-london: pytest {posargs:tests/json-fixtures/blockchain/test_blockchain.py --fork London}
native-blockchain-merge: pytest {posargs:tests/json-fixtures/blockchain/test_blockchain.py --fork Merge}
native-blockchain-paris: pytest {posargs:tests/json-fixtures/blockchain/test_blockchain.py --fork Paris}
native-blockchain-shanghai: pytest {posargs:tests/json-fixtures/blockchain/test_blockchain.py --fork Shanghai}
basepython =
docs: python
Expand Down

0 comments on commit 0ac74f6

Please sign in to comment.