Skip to content

Commit b5f1d95

Browse files
feat(fill,tests): add ported_from pytest marker (#1590)
* add ported_from test marker to converted from json tests * chore: fix test in md link in `converted-ethereum-tests.txt` * docs: update changelog * Update docs/CHANGELOG.md --------- Co-authored-by: danceratopz <danceratopz@gmail.com>
1 parent 147e4d2 commit b5f1d95

15 files changed

+156
-1
lines changed

converted-ethereum-tests.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ GeneralStateTests/VMTests/vmTests/push.json
252252
([#1067](https://github.com/ethereum/execution-spec-tests/pull/1067))
253253
GeneralStateTests/stPreCompiledContracts/blake2B.json
254254

255-
([#1067](https://github.com/ethereum/execution-spec-tests/pull/1120))
255+
([#1120](https://github.com/ethereum/execution-spec-tests/pull/1120))
256256
GeneralStateTests/stPreCompiledContracts/idPrecomps.json
257257

258258
([#1244](https://github.com/ethereum/execution-spec-tests/pull/1244))

docs/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ The output behavior of `fill` has changed ([#1608](https://github.com/ethereum/e
1919

2020
#### `fill`
2121

22+
- ✨ Add `ported_from` test marker to track Python test cases that were converted from static fillers in [ethereum/tests](https://github.com/ethereum/tests) repository [#1590](https://github.com/ethereum/execution-spec-tests/pull/1590).
2223
- 🔀 Refactor: Encapsulate `fill`'s fixture output options (`--output`, `--flat-output`, `--single-fixture-per-file`) into a `FixtureOutput` class ([#1471](https://github.com/ethereum/execution-spec-tests/pull/1471),[#1612](https://github.com/ethereum/execution-spec-tests/pull/1612)).
2324
- ✨ Don't warn about a "high Transaction gas_limit" for `zkevm` tests ([#1598](https://github.com/ethereum/execution-spec-tests/pull/1598)).
2425
- 🐞 `fill` no longer writes generated fixtures into an existing, non-empty output directory; it must now be empty or `--clean` must be used to delete it first ([#1608](https://github.com/ethereum/execution-spec-tests/pull/1608)).

pytest.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ testpaths = tests/
66
markers =
77
slow
88
pre_alloc_modify
9+
ported_from
910
addopts =
1011
-p pytest_plugins.concurrency
1112
-p pytest_plugins.filler.pre_alloc

tests/cancun/eip1153_tstore/test_basic_tload.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@
1616
REFERENCE_SPEC_VERSION = ref_spec_1153.version
1717

1818

19+
@pytest.mark.ported_from(
20+
[
21+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/01_tloadBeginningTxnFiller.yml",
22+
],
23+
pr=["https://github.com/ethereum/execution-spec-tests/pull/440"],
24+
)
1925
@pytest.mark.valid_from("Cancun")
2026
def test_basic_tload_transaction_begin(
2127
state_test: StateTestFiller,
@@ -61,6 +67,12 @@ def test_basic_tload_transaction_begin(
6167
state_test(env=Environment(), pre=pre, post=post, tx=tx)
6268

6369

70+
@pytest.mark.ported_from(
71+
[
72+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/02_tloadAfterTstoreFiller.yml",
73+
],
74+
pr=["https://github.com/ethereum/execution-spec-tests/pull/440"],
75+
)
6476
@pytest.mark.valid_from("Cancun")
6577
def test_basic_tload_works(
6678
state_test: StateTestFiller,
@@ -113,6 +125,12 @@ def test_basic_tload_works(
113125
state_test(env=Environment(), pre=pre, post=post, tx=tx)
114126

115127

128+
@pytest.mark.ported_from(
129+
[
130+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/03_tloadAfterStoreIs0Filler.yml",
131+
],
132+
pr=["https://github.com/ethereum/execution-spec-tests/pull/440"],
133+
)
116134
@pytest.mark.valid_from("Cancun")
117135
def test_basic_tload_other_after_tstore(
118136
state_test: StateTestFiller,
@@ -161,6 +179,12 @@ def test_basic_tload_other_after_tstore(
161179
state_test(env=Environment(), pre=pre, post=post, tx=tx)
162180

163181

182+
@pytest.mark.ported_from(
183+
[
184+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/16_tloadGasFiller.yml",
185+
],
186+
pr=["https://github.com/ethereum/execution-spec-tests/pull/440"],
187+
)
164188
@pytest.mark.valid_from("Cancun")
165189
def test_basic_tload_gasprice(
166190
state_test: StateTestFiller,
@@ -239,6 +263,12 @@ def test_basic_tload_gasprice(
239263
state_test(env=Environment(), pre=pre, post=post, tx=tx)
240264

241265

266+
@pytest.mark.ported_from(
267+
[
268+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/18_tloadAfterStoreFiller.yml",
269+
],
270+
pr=["https://github.com/ethereum/execution-spec-tests/pull/440"],
271+
)
242272
@pytest.mark.valid_from("Cancun")
243273
def test_basic_tload_after_store(
244274
state_test: StateTestFiller,

tests/cancun/eip1153_tstore/test_tload_calls.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@
1313
REFERENCE_SPEC_VERSION = "1eb863b534a5a3e19e9c196ab2a7f3db4bb9da17"
1414

1515

16+
@pytest.mark.ported_from(
17+
[
18+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/04_tloadAfterCallFiller.yml",
19+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/12_tloadDelegateCallFiller.yml",
20+
],
21+
pr=["https://github.com/ethereum/execution-spec-tests/pull/440"],
22+
)
1623
@pytest.mark.valid_from("Cancun")
1724
@pytest.mark.parametrize("call_type", [Op.CALL, Op.CALLCODE, Op.DELEGATECALL])
1825
def test_tload_calls(state_test: StateTestFiller, pre: Alloc, call_type: Op):

tests/cancun/eip1153_tstore/test_tload_reentrancy.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ class CallDestType(Enum):
3333
EXTERNAL_CALL = 2
3434

3535

36+
@pytest.mark.ported_from(
37+
[
38+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/05_tloadReentrancyFiller.yml",
39+
],
40+
pr=["https://github.com/ethereum/execution-spec-tests/pull/440"],
41+
)
3642
@pytest.mark.valid_from("Cancun")
3743
@pytest.mark.parametrize("call_type", [Op.CALL, Op.CALLCODE, Op.DELEGATECALL, Op.STATICCALL])
3844
@pytest.mark.parametrize("call_return", [Op.RETURN, Op.REVERT, Om.OOG])

tests/cancun/eip1153_tstore/test_tstore_reentrancy.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,18 @@ class CallDestType(Enum):
3333
EXTERNAL_CALL = 2
3434

3535

36+
@pytest.mark.ported_from(
37+
[
38+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/06_tstoreInReentrancyCallFiller.yml",
39+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/07_tloadAfterReentrancyStoreFiller.yml",
40+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/08_revertUndoesTransientStoreFiller.yml",
41+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/09_revertUndoesAllFiller.yml",
42+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/11_tstoreDelegateCallFiller.yml",
43+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/13_tloadStaticCallFiller.yml",
44+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/20_oogUndoesTransientStoreInCallFiller.yml",
45+
],
46+
pr=["https://github.com/ethereum/execution-spec-tests/pull/440"],
47+
)
3648
@pytest.mark.valid_from("Cancun")
3749
@pytest.mark.parametrize("call_type", [Op.CALL, Op.CALLCODE, Op.DELEGATECALL, Op.STATICCALL])
3850
@pytest.mark.parametrize("call_return", [Op.RETURN, Op.REVERT, Om.OOG])

tests/constantinople/eip1014_create2/test_create_returndata.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@
1515
REFERENCE_SPEC_VERSION = ref_spec_1014.version
1616

1717

18+
@pytest.mark.ported_from(
19+
[
20+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stCreate2/call_outsize_then_create2_successful_then_returndatasizeFiller.json",
21+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stCreate2/call_then_create2_successful_then_returndatasizeFiller.json",
22+
],
23+
pr=["https://github.com/ethereum/execution-spec-tests/pull/497"],
24+
)
1825
@pytest.mark.valid_from("Istanbul")
1926
@pytest.mark.parametrize("call_return_size", [35, 32, 0])
2027
@pytest.mark.parametrize("create_type", [Op.CREATE, Op.CREATE2])

tests/frontier/opcodes/test_all_opcodes.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ def prepare_suffix(opcode: Opcode) -> Bytecode:
4646
return Op.STOP
4747

4848

49+
@pytest.mark.ported_from(
50+
[
51+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stBadOpcode/badOpcodesFiller.json",
52+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stBugs/evmBytecodeFiller.json",
53+
],
54+
pr=["https://github.com/ethereum/execution-spec-tests/pull/748"],
55+
)
4956
@pytest.mark.valid_from("Frontier")
5057
def test_all_opcodes(state_test: StateTestFiller, pre: Alloc, fork: Fork):
5158
"""

tests/frontier/opcodes/test_calldatacopy.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
from ethereum_test_tools.vm.opcode import Opcodes as Op
88

99

10+
@pytest.mark.ported_from(
11+
[
12+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/VMTests/vmTests/calldatacopyFiller.yml",
13+
],
14+
pr=["https://github.com/ethereum/execution-spec-tests/pull/1056"],
15+
)
1016
@pytest.mark.parametrize(
1117
"code,tx_data,code_address_storage,to_address_storage",
1218
[

tests/frontier/opcodes/test_calldataload.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
from ethereum_test_tools.vm.opcode import Opcodes as Op
99

1010

11+
@pytest.mark.ported_from(
12+
[
13+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/VMTests/vmTests/calldataloadFiller.yml",
14+
],
15+
pr=["https://github.com/ethereum/execution-spec-tests/pull/1236"],
16+
)
1117
@pytest.mark.parametrize(
1218
"calldata,calldata_offset,expected_storage",
1319
[

tests/frontier/opcodes/test_calldatasize.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
from ethereum_test_tools.vm.opcode import Opcodes as Op
99

1010

11+
@pytest.mark.ported_from(
12+
[
13+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/VMTests/vmTests/calldatasizeFiller.yml",
14+
],
15+
pr=["https://github.com/ethereum/execution-spec-tests/pull/1236"],
16+
)
1117
@pytest.mark.parametrize(
1218
"args_size",
1319
[0, 2, 16, 33, 257],

tests/frontier/opcodes/test_push.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ def get_input_for_push_opcode(opcode: Op) -> bytes:
2121
return ethereum_state_machine[0:input_size]
2222

2323

24+
@pytest.mark.ported_from(
25+
[
26+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/VMTests/vmTests/pushFiller.yml",
27+
],
28+
pr=["https://github.com/ethereum/execution-spec-tests/pull/975"],
29+
)
2430
@pytest.mark.parametrize(
2531
"push_opcode",
2632
[getattr(Op, f"PUSH{i}") for i in range(1, 33)], # Dynamically parametrize PUSH opcodes
@@ -67,6 +73,12 @@ def test_push(state_test: StateTestFiller, fork: Fork, pre: Alloc, push_opcode:
6773
state_test(env=env, pre=pre, post=post, tx=tx)
6874

6975

76+
@pytest.mark.ported_from(
77+
[
78+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/VMTests/vmTests/pushFiller.yml",
79+
],
80+
pr=["https://github.com/ethereum/execution-spec-tests/pull/975"],
81+
)
7082
@pytest.mark.parametrize(
7183
"push_opcode",
7284
[getattr(Op, f"PUSH{i}") for i in range(1, 33)],

tests/frontier/precompiles/test_precompiles.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ def precompile_addresses(fork: Fork) -> Iterator[Tuple[str, bool]]:
4242
num_unsupported -= 1
4343

4444

45+
@pytest.mark.ported_from(
46+
[
47+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stPreCompiledContracts/idPrecompsFiller.yml"
48+
],
49+
pr=["https://github.com/ethereum/execution-spec-tests/pull/1120"],
50+
)
4551
@pytest.mark.valid_from("Berlin")
4652
@pytest.mark.parametrize_by_fork("address,precompile_exists", precompile_addresses)
4753
def test_precompiles(

tests/istanbul/eip152_blake2/test_blake2.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,18 @@
2424
REFERENCE_SPEC_VERSION = ref_spec_152.version
2525

2626

27+
@pytest.mark.ported_from(
28+
[
29+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stPreCompiledContracts/blake2BFiller.yml",
30+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stPreCompiledContracts2/CALLBlake2fFiller.json",
31+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stPreCompiledContracts2/CALLCODEBlake2fFiller.json",
32+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stPreCompiledContracts/delegatecall09UndefinedFiller.yml",
33+
],
34+
pr=[
35+
"https://github.com/ethereum/execution-spec-tests/pull/1244",
36+
"https://github.com/ethereum/execution-spec-tests/pull/1067",
37+
],
38+
)
2739
@pytest.mark.valid_from("Istanbul")
2840
@pytest.mark.parametrize("call_opcode", [Op.CALL])
2941
@pytest.mark.parametrize(
@@ -417,6 +429,18 @@ def test_blake2b(
417429
state_test(env=env, pre=pre, post=post, tx=tx)
418430

419431

432+
@pytest.mark.ported_from(
433+
[
434+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stPreCompiledContracts/blake2BFiller.yml",
435+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stPreCompiledContracts2/CALLBlake2fFiller.json",
436+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stPreCompiledContracts2/CALLCODEBlake2fFiller.json",
437+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stPreCompiledContracts/delegatecall09UndefinedFiller.yml",
438+
],
439+
pr=[
440+
"https://github.com/ethereum/execution-spec-tests/pull/1244",
441+
"https://github.com/ethereum/execution-spec-tests/pull/1067",
442+
],
443+
)
420444
@pytest.mark.valid_from("Istanbul")
421445
@pytest.mark.parametrize("call_opcode", [Op.CALL, Op.CALLCODE])
422446
@pytest.mark.parametrize("gas_limit", [90_000, 110_000, 200_000])
@@ -530,6 +554,18 @@ def test_blake2b_invalid_gas(
530554
state_test(env=env, pre=pre, post=post, tx=tx)
531555

532556

557+
@pytest.mark.ported_from(
558+
[
559+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stPreCompiledContracts/blake2BFiller.yml",
560+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stPreCompiledContracts2/CALLBlake2fFiller.json",
561+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stPreCompiledContracts2/CALLCODEBlake2fFiller.json",
562+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stPreCompiledContracts/delegatecall09UndefinedFiller.yml",
563+
],
564+
pr=[
565+
"https://github.com/ethereum/execution-spec-tests/pull/1244",
566+
"https://github.com/ethereum/execution-spec-tests/pull/1067",
567+
],
568+
)
533569
@pytest.mark.valid_from("Istanbul")
534570
@pytest.mark.parametrize("call_opcode", [Op.CALL, Op.CALLCODE])
535571
@pytest.mark.parametrize("gas_limit", [Environment().gas_limit, 90_000, 110_000, 200_000])
@@ -640,6 +676,18 @@ def test_blake2b_gas_limit(
640676
)
641677

642678

679+
@pytest.mark.ported_from(
680+
[
681+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stPreCompiledContracts/blake2BFiller.yml",
682+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stPreCompiledContracts2/CALLBlake2fFiller.json",
683+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stPreCompiledContracts2/CALLCODEBlake2fFiller.json",
684+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stPreCompiledContracts/delegatecall09UndefinedFiller.yml",
685+
],
686+
pr=[
687+
"https://github.com/ethereum/execution-spec-tests/pull/1244",
688+
"https://github.com/ethereum/execution-spec-tests/pull/1067",
689+
],
690+
)
643691
@pytest.mark.valid_from("Istanbul")
644692
@pytest.mark.parametrize("call_opcode", [Op.CALL, Op.CALLCODE])
645693
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)