Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ testpaths = tests/
markers =
slow
pre_alloc_modify
ported_from
addopts =
-p pytest_plugins.concurrency
-p pytest_plugins.filler.pre_alloc
Expand Down
30 changes: 30 additions & 0 deletions tests/cancun/eip1153_tstore/test_basic_tload.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
REFERENCE_SPEC_VERSION = ref_spec_1153.version


@pytest.mark.ported_from(
[
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/01_tloadBeginningTxnFiller.yml",
],
pr=["https://github.com/ethereum/execution-spec-tests/pull/440"],
)
@pytest.mark.valid_from("Cancun")
def test_basic_tload_transaction_begin(
state_test: StateTestFiller,
Expand Down Expand Up @@ -61,6 +67,12 @@ def test_basic_tload_transaction_begin(
state_test(env=Environment(), pre=pre, post=post, tx=tx)


@pytest.mark.ported_from(
[
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/02_tloadAfterTstoreFiller.yml",
],
pr=["https://github.com/ethereum/execution-spec-tests/pull/440"],
)
@pytest.mark.valid_from("Cancun")
def test_basic_tload_works(
state_test: StateTestFiller,
Expand Down Expand Up @@ -113,6 +125,12 @@ def test_basic_tload_works(
state_test(env=Environment(), pre=pre, post=post, tx=tx)


@pytest.mark.ported_from(
[
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/03_tloadAfterStoreIs0Filler.yml",
],
pr=["https://github.com/ethereum/execution-spec-tests/pull/440"],
)
@pytest.mark.valid_from("Cancun")
def test_basic_tload_other_after_tstore(
state_test: StateTestFiller,
Expand Down Expand Up @@ -161,6 +179,12 @@ def test_basic_tload_other_after_tstore(
state_test(env=Environment(), pre=pre, post=post, tx=tx)


@pytest.mark.ported_from(
[
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/16_tloadGasFiller.yml",
],
pr=["https://github.com/ethereum/execution-spec-tests/pull/440"],
)
@pytest.mark.valid_from("Cancun")
def test_basic_tload_gasprice(
state_test: StateTestFiller,
Expand Down Expand Up @@ -239,6 +263,12 @@ def test_basic_tload_gasprice(
state_test(env=Environment(), pre=pre, post=post, tx=tx)


@pytest.mark.ported_from(
[
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/18_tloadAfterStoreFiller.yml",
],
pr=["https://github.com/ethereum/execution-spec-tests/pull/440"],
)
@pytest.mark.valid_from("Cancun")
def test_basic_tload_after_store(
state_test: StateTestFiller,
Expand Down
7 changes: 7 additions & 0 deletions tests/cancun/eip1153_tstore/test_tload_calls.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@
REFERENCE_SPEC_VERSION = "1eb863b534a5a3e19e9c196ab2a7f3db4bb9da17"


@pytest.mark.ported_from(
[
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/04_tloadAfterCallFiller.yml",
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/12_tloadDelegateCallFiller.yml",
],
pr=["https://github.com/ethereum/execution-spec-tests/pull/440"],
)
@pytest.mark.valid_from("Cancun")
@pytest.mark.parametrize("call_type", [Op.CALL, Op.CALLCODE, Op.DELEGATECALL])
def test_tload_calls(state_test: StateTestFiller, pre: Alloc, call_type: Op):
Expand Down
6 changes: 6 additions & 0 deletions tests/cancun/eip1153_tstore/test_tload_reentrancy.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ class CallDestType(Enum):
EXTERNAL_CALL = 2


@pytest.mark.ported_from(
[
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/05_tloadReentrancyFiller.yml",
],
pr=["https://github.com/ethereum/execution-spec-tests/pull/440"],
)
@pytest.mark.valid_from("Cancun")
@pytest.mark.parametrize("call_type", [Op.CALL, Op.CALLCODE, Op.DELEGATECALL, Op.STATICCALL])
@pytest.mark.parametrize("call_return", [Op.RETURN, Op.REVERT, Om.OOG])
Expand Down
12 changes: 12 additions & 0 deletions tests/cancun/eip1153_tstore/test_tstore_reentrancy.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@ class CallDestType(Enum):
EXTERNAL_CALL = 2


@pytest.mark.ported_from(
[
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/06_tstoreInReentrancyCallFiller.yml",
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/07_tloadAfterReentrancyStoreFiller.yml",
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/08_revertUndoesTransientStoreFiller.yml",
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/09_revertUndoesAllFiller.yml",
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/11_tstoreDelegateCallFiller.yml",
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/13_tloadStaticCallFiller.yml",
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/20_oogUndoesTransientStoreInCallFiller.yml",
],
pr=["https://github.com/ethereum/execution-spec-tests/pull/440"],
)
@pytest.mark.valid_from("Cancun")
@pytest.mark.parametrize("call_type", [Op.CALL, Op.CALLCODE, Op.DELEGATECALL, Op.STATICCALL])
@pytest.mark.parametrize("call_return", [Op.RETURN, Op.REVERT, Om.OOG])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@
REFERENCE_SPEC_VERSION = ref_spec_1014.version


@pytest.mark.ported_from(
[
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stCreate2/call_outsize_then_create2_successful_then_returndatasizeFiller.json",
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stCreate2/call_then_create2_successful_then_returndatasizeFiller.json",
],
pr=["https://github.com/ethereum/execution-spec-tests/pull/497"],
)
@pytest.mark.valid_from("Istanbul")
@pytest.mark.parametrize("call_return_size", [35, 32, 0])
@pytest.mark.parametrize("create_type", [Op.CREATE, Op.CREATE2])
Expand Down
7 changes: 7 additions & 0 deletions tests/frontier/opcodes/test_all_opcodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ def prepare_suffix(opcode: Opcode) -> Bytecode:
return Op.STOP


@pytest.mark.ported_from(
[
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stBadOpcode/badOpcodesFiller.json",
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stBugs/evmBytecodeFiller.json",
],
pr=["https://github.com/ethereum/execution-spec-tests/pull/748"],
)
@pytest.mark.valid_from("Frontier")
def test_all_opcodes(state_test: StateTestFiller, pre: Alloc, fork: Fork):
"""
Expand Down
6 changes: 6 additions & 0 deletions tests/frontier/opcodes/test_calldatacopy.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
from ethereum_test_tools.vm.opcode import Opcodes as Op


@pytest.mark.ported_from(
[
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/VMTests/vmTests/calldatacopyFiller.yml",
],
pr=["https://github.com/ethereum/execution-spec-tests/pull/1056"],
)
@pytest.mark.parametrize(
"code,tx_data,code_address_storage,to_address_storage",
[
Expand Down
6 changes: 6 additions & 0 deletions tests/frontier/opcodes/test_calldataload.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
from ethereum_test_tools.vm.opcode import Opcodes as Op


@pytest.mark.ported_from(
[
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/VMTests/vmTests/calldataloadFiller.yml",
],
pr=["https://github.com/ethereum/execution-spec-tests/pull/1236"],
)
@pytest.mark.parametrize(
"calldata,calldata_offset,expected_storage",
[
Expand Down
6 changes: 6 additions & 0 deletions tests/frontier/opcodes/test_calldatasize.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
from ethereum_test_tools.vm.opcode import Opcodes as Op


@pytest.mark.ported_from(
[
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/VMTests/vmTests/calldatasizeFiller.yml",
],
pr=["https://github.com/ethereum/execution-spec-tests/pull/1236"],
)
@pytest.mark.parametrize(
"args_size",
[0, 2, 16, 33, 257],
Expand Down
12 changes: 12 additions & 0 deletions tests/frontier/opcodes/test_push.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ def get_input_for_push_opcode(opcode: Op) -> bytes:
return ethereum_state_machine[0:input_size]


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


@pytest.mark.ported_from(
[
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/VMTests/vmTests/pushFiller.yml",
],
pr=["https://github.com/ethereum/execution-spec-tests/pull/975"],
)
@pytest.mark.parametrize(
"push_opcode",
[getattr(Op, f"PUSH{i}") for i in range(1, 33)],
Expand Down
6 changes: 6 additions & 0 deletions tests/frontier/precompiles/test_precompiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ def precompile_addresses(fork: Fork) -> Iterator[Tuple[str, bool]]:
num_unsupported -= 1


@pytest.mark.ported_from(
[
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stPreCompiledContracts/idPrecompsFiller.yml"
],
pr=["https://github.com/ethereum/execution-spec-tests/pull/1120"],
)
@pytest.mark.valid_from("Berlin")
@pytest.mark.parametrize_by_fork("address,precompile_exists", precompile_addresses)
def test_precompiles(
Expand Down
48 changes: 48 additions & 0 deletions tests/istanbul/eip152_blake2/test_blake2.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@
REFERENCE_SPEC_VERSION = ref_spec_152.version


@pytest.mark.ported_from(
[
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stPreCompiledContracts/blake2BFiller.yml",
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stPreCompiledContracts2/CALLBlake2fFiller.json",
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stPreCompiledContracts2/CALLCODEBlake2fFiller.json",
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stPreCompiledContracts/delegatecall09UndefinedFiller.yml",
],
pr=[
"https://github.com/ethereum/execution-spec-tests/pull/1244",
"https://github.com/ethereum/execution-spec-tests/pull/1067",
],
)
@pytest.mark.valid_from("Istanbul")
@pytest.mark.parametrize("call_opcode", [Op.CALL])
@pytest.mark.parametrize(
Expand Down Expand Up @@ -417,6 +429,18 @@ def test_blake2b(
state_test(env=env, pre=pre, post=post, tx=tx)


@pytest.mark.ported_from(
[
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stPreCompiledContracts/blake2BFiller.yml",
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stPreCompiledContracts2/CALLBlake2fFiller.json",
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stPreCompiledContracts2/CALLCODEBlake2fFiller.json",
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stPreCompiledContracts/delegatecall09UndefinedFiller.yml",
],
pr=[
"https://github.com/ethereum/execution-spec-tests/pull/1244",
"https://github.com/ethereum/execution-spec-tests/pull/1067",
],
)
@pytest.mark.valid_from("Istanbul")
@pytest.mark.parametrize("call_opcode", [Op.CALL, Op.CALLCODE])
@pytest.mark.parametrize("gas_limit", [90_000, 110_000, 200_000])
Expand Down Expand Up @@ -530,6 +554,18 @@ def test_blake2b_invalid_gas(
state_test(env=env, pre=pre, post=post, tx=tx)


@pytest.mark.ported_from(
[
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stPreCompiledContracts/blake2BFiller.yml",
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stPreCompiledContracts2/CALLBlake2fFiller.json",
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stPreCompiledContracts2/CALLCODEBlake2fFiller.json",
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stPreCompiledContracts/delegatecall09UndefinedFiller.yml",
],
pr=[
"https://github.com/ethereum/execution-spec-tests/pull/1244",
"https://github.com/ethereum/execution-spec-tests/pull/1067",
],
)
@pytest.mark.valid_from("Istanbul")
@pytest.mark.parametrize("call_opcode", [Op.CALL, Op.CALLCODE])
@pytest.mark.parametrize("gas_limit", [Environment().gas_limit, 90_000, 110_000, 200_000])
Expand Down Expand Up @@ -640,6 +676,18 @@ def test_blake2b_gas_limit(
)


@pytest.mark.ported_from(
[
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stPreCompiledContracts/blake2BFiller.yml",
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stPreCompiledContracts2/CALLBlake2fFiller.json",
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stPreCompiledContracts2/CALLCODEBlake2fFiller.json",
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stPreCompiledContracts/delegatecall09UndefinedFiller.yml",
],
pr=[
"https://github.com/ethereum/execution-spec-tests/pull/1244",
"https://github.com/ethereum/execution-spec-tests/pull/1067",
],
)
@pytest.mark.valid_from("Istanbul")
@pytest.mark.parametrize("call_opcode", [Op.CALL, Op.CALLCODE])
@pytest.mark.parametrize(
Expand Down
Loading