Skip to content
Merged
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
118 changes: 118 additions & 0 deletions converted-ethereum-tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,124 @@ BlockchainTests/InvalidBlocks/bcEIP1559/intrinsicOrFailCancun.json
GeneralStateTests/VMTests/vmTests/calldataload.json
GeneralStateTests/VMTests/vmTests/calldatasize.json

([#808](https://github.com/ethereum/execution-spec-tests/pull/808))
GeneralStateTests/stBadOpcode/invalidDiffPlaces.json
GeneralStateTests/stBadOpcode/opc0CDiffPlaces.json
GeneralStateTests/stBadOpcode/opc0DDiffPlaces.json
GeneralStateTests/stBadOpcode/opc0EDiffPlaces.json
GeneralStateTests/stBadOpcode/opc0FDiffPlaces.json
GeneralStateTests/stBadOpcode/opc1EDiffPlaces.json
GeneralStateTests/stBadOpcode/opc1FDiffPlaces.json
GeneralStateTests/stBadOpcode/opc2ADiffPlaces.json
GeneralStateTests/stBadOpcode/opc2BDiffPlaces.json
GeneralStateTests/stBadOpcode/opc2CDiffPlaces.json
GeneralStateTests/stBadOpcode/opc2DDiffPlaces.json
GeneralStateTests/stBadOpcode/opc2EDiffPlaces.json
GeneralStateTests/stBadOpcode/opc2FDiffPlaces.json
GeneralStateTests/stBadOpcode/opc4ADiffPlaces.json
GeneralStateTests/stBadOpcode/opc4BDiffPlaces.json
GeneralStateTests/stBadOpcode/opc4CDiffPlaces.json
GeneralStateTests/stBadOpcode/opc4DDiffPlaces.json
GeneralStateTests/stBadOpcode/opc4EDiffPlaces.json
GeneralStateTests/stBadOpcode/opc4FDiffPlaces.json
GeneralStateTests/stBadOpcode/opc5CDiffPlaces.json
GeneralStateTests/stBadOpcode/opc5DDiffPlaces.json
GeneralStateTests/stBadOpcode/opc5EDiffPlaces.json
GeneralStateTests/stBadOpcode/opc5FDiffPlaces.json
GeneralStateTests/stBadOpcode/opc21DiffPlaces.json
GeneralStateTests/stBadOpcode/opc22DiffPlaces.json
GeneralStateTests/stBadOpcode/opc23DiffPlaces.json
GeneralStateTests/stBadOpcode/opc24DiffPlaces.json
GeneralStateTests/stBadOpcode/opc25DiffPlaces.json
GeneralStateTests/stBadOpcode/opc26DiffPlaces.json
GeneralStateTests/stBadOpcode/opc27DiffPlaces.json
GeneralStateTests/stBadOpcode/opc28DiffPlaces.json
GeneralStateTests/stBadOpcode/opc29DiffPlaces.json
GeneralStateTests/stBadOpcode/opc49DiffPlaces.json
GeneralStateTests/stBadOpcode/opcA5DiffPlaces.json
GeneralStateTests/stBadOpcode/opcA6DiffPlaces.json
GeneralStateTests/stBadOpcode/opcA7DiffPlaces.json
GeneralStateTests/stBadOpcode/opcA8DiffPlaces.json
GeneralStateTests/stBadOpcode/opcA9DiffPlaces.json
GeneralStateTests/stBadOpcode/opcAADiffPlaces.json
GeneralStateTests/stBadOpcode/opcABDiffPlaces.json
GeneralStateTests/stBadOpcode/opcACDiffPlaces.json
GeneralStateTests/stBadOpcode/opcADDiffPlaces.json
GeneralStateTests/stBadOpcode/opcAEDiffPlaces.json
GeneralStateTests/stBadOpcode/opcAFDiffPlaces.json
GeneralStateTests/stBadOpcode/opcB0DiffPlaces.json
GeneralStateTests/stBadOpcode/opcB1DiffPlaces.json
GeneralStateTests/stBadOpcode/opcB2DiffPlaces.json
GeneralStateTests/stBadOpcode/opcB3DiffPlaces.json
GeneralStateTests/stBadOpcode/opcB4DiffPlaces.json
GeneralStateTests/stBadOpcode/opcB5DiffPlaces.json
GeneralStateTests/stBadOpcode/opcB6DiffPlaces.json
GeneralStateTests/stBadOpcode/opcB7DiffPlaces.json
GeneralStateTests/stBadOpcode/opcB8DiffPlaces.json
GeneralStateTests/stBadOpcode/opcB9DiffPlaces.json
GeneralStateTests/stBadOpcode/opcBADiffPlaces.json
GeneralStateTests/stBadOpcode/opcBBDiffPlaces.json
GeneralStateTests/stBadOpcode/opcBCDiffPlaces.json
GeneralStateTests/stBadOpcode/opcBDDiffPlaces.json
GeneralStateTests/stBadOpcode/opcBEDiffPlaces.json
GeneralStateTests/stBadOpcode/opcBFDiffPlaces.json
GeneralStateTests/stBadOpcode/opcC0DiffPlaces.json
GeneralStateTests/stBadOpcode/opcC1DiffPlaces.json
GeneralStateTests/stBadOpcode/opcC2DiffPlaces.json
GeneralStateTests/stBadOpcode/opcC3DiffPlaces.json
GeneralStateTests/stBadOpcode/opcC4DiffPlaces.json
GeneralStateTests/stBadOpcode/opcC5DiffPlaces.json
GeneralStateTests/stBadOpcode/opcC6DiffPlaces.json
GeneralStateTests/stBadOpcode/opcC7DiffPlaces.json
GeneralStateTests/stBadOpcode/opcC8DiffPlaces.json
GeneralStateTests/stBadOpcode/opcC9DiffPlaces.json
GeneralStateTests/stBadOpcode/opcCADiffPlaces.json
GeneralStateTests/stBadOpcode/opcCBDiffPlaces.json
GeneralStateTests/stBadOpcode/opcCCDiffPlaces.json
GeneralStateTests/stBadOpcode/opcCDDiffPlaces.json
GeneralStateTests/stBadOpcode/opcCEDiffPlaces.json
GeneralStateTests/stBadOpcode/opcCFDiffPlaces.json
GeneralStateTests/stBadOpcode/opcD0DiffPlaces.json
GeneralStateTests/stBadOpcode/opcD1DiffPlaces.json
GeneralStateTests/stBadOpcode/opcD2DiffPlaces.json
GeneralStateTests/stBadOpcode/opcD3DiffPlaces.json
GeneralStateTests/stBadOpcode/opcD4DiffPlaces.json
GeneralStateTests/stBadOpcode/opcD5DiffPlaces.json
GeneralStateTests/stBadOpcode/opcD6DiffPlaces.json
GeneralStateTests/stBadOpcode/opcD7DiffPlaces.json
GeneralStateTests/stBadOpcode/opcD8DiffPlaces.json
GeneralStateTests/stBadOpcode/opcD9DiffPlaces.json
GeneralStateTests/stBadOpcode/opcDADiffPlaces.json
GeneralStateTests/stBadOpcode/opcDBDiffPlaces.json
GeneralStateTests/stBadOpcode/opcDCDiffPlaces.json
GeneralStateTests/stBadOpcode/opcDDDiffPlaces.json
GeneralStateTests/stBadOpcode/opcDEDiffPlaces.json
GeneralStateTests/stBadOpcode/opcDFDiffPlaces.json
GeneralStateTests/stBadOpcode/opcE0DiffPlaces.json
GeneralStateTests/stBadOpcode/opcE1DiffPlaces.json
GeneralStateTests/stBadOpcode/opcE2DiffPlaces.json
GeneralStateTests/stBadOpcode/opcE3DiffPlaces.json
GeneralStateTests/stBadOpcode/opcE4DiffPlaces.json
GeneralStateTests/stBadOpcode/opcE5DiffPlaces.json
GeneralStateTests/stBadOpcode/opcE6DiffPlaces.json
GeneralStateTests/stBadOpcode/opcE7DiffPlaces.json
GeneralStateTests/stBadOpcode/opcE8DiffPlaces.json
GeneralStateTests/stBadOpcode/opcE9DiffPlaces.json
GeneralStateTests/stBadOpcode/opcEADiffPlaces.json
GeneralStateTests/stBadOpcode/opcEBDiffPlaces.json
GeneralStateTests/stBadOpcode/opcECDiffPlaces.json
GeneralStateTests/stBadOpcode/opcEDDiffPlaces.json
GeneralStateTests/stBadOpcode/opcEEDiffPlaces.json
GeneralStateTests/stBadOpcode/opcEFDiffPlaces.json
GeneralStateTests/stBadOpcode/opcF6DiffPlaces.json
GeneralStateTests/stBadOpcode/opcF7DiffPlaces.json
GeneralStateTests/stBadOpcode/opcF8DiffPlaces.json
GeneralStateTests/stBadOpcode/opcF9DiffPlaces.json
GeneralStateTests/stBadOpcode/opcFBDiffPlaces.json
GeneralStateTests/stBadOpcode/opcFCDiffPlaces.json
GeneralStateTests/stBadOpcode/opcFEDiffPlaces.json


([#1056](https://github.com/ethereum/execution-spec-tests/pull/1056))
GeneralStateTests/VMTests/vmTests/calldatacopy.json

Expand Down
8 changes: 7 additions & 1 deletion src/ethereum_test_forks/forks/forks.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ def fn(
assert authorization_list_or_count is None, (
f"Authorizations are not supported in {cls.name()}"
)

intrinsic_cost: int = gas_costs.G_TRANSACTION

if contract_creation:
Expand Down Expand Up @@ -642,7 +643,12 @@ def valid_opcodes(
cls,
) -> List[Opcodes]:
"""Return list of Opcodes that are valid to work on this fork."""
return [Opcodes.RETURNDATASIZE, Opcodes.STATICCALL] + super(Byzantium, cls).valid_opcodes()
return [
Opcodes.REVERT,
Opcodes.RETURNDATASIZE,
Opcodes.RETURNDATACOPY,
Opcodes.STATICCALL,
] + super(Byzantium, cls).valid_opcodes()


class Constantinople(Byzantium):
Expand Down
2 changes: 1 addition & 1 deletion src/ethereum_test_vm/opcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def __new__(
instance.lambda_operation = lambda_operation
return instance

def __call__(self, *args_t: OpcodeCallArg) -> Bytecode:
def __call__(self, *args_t: OpcodeCallArg, **kwargs) -> Bytecode:
"""Perform macro operation if any. Otherwise is a no-op."""
if self.lambda_operation is not None:
return self.lambda_operation(*args_t)
Expand Down
14 changes: 11 additions & 3 deletions tests/frontier/opcodes/test_all_opcodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ def prepare_stack(opcode: Opcode) -> Bytecode:
return Op.PUSH1(1) + Op.PUSH1(5)
if opcode == Op.JUMP:
return Op.PUSH1(3)
if opcode == Op.RETURNDATACOPY:
return Op.PUSH1(0) * 3
return Op.PUSH1(0x01) * 32


Expand Down Expand Up @@ -68,7 +70,7 @@ def test_all_opcodes(state_test: StateTestFiller, pre: Alloc, fork: Fork):
Op.PUSH1(opcode.int()),
# Limit gas to limit the gas consumed by the exceptional aborts in each
# subcall that uses an undefined opcode.
Op.CALL(50_000, opcode_address, 0, 0, 0, 0, 0),
Op.CALL(35_000, opcode_address, 0, 0, 0, 0, 0),
)
for opcode, opcode_address in code_contract.items()
)
Expand All @@ -78,13 +80,19 @@ def test_all_opcodes(state_test: StateTestFiller, pre: Alloc, fork: Fork):

post = {
contract_address: Account(
storage={**{opcode.int(): 1 for opcode in fork.valid_opcodes()}, code_worked: 1}
storage={
**{
opcode.int(): 1 if opcode != Op.REVERT else 0
for opcode in fork.valid_opcodes()
},
code_worked: 1,
}
),
}

tx = Transaction(
sender=pre.fund_eoa(),
gas_limit=15_000_000,
gas_limit=9_000_000,
to=contract_address,
data=b"",
value=0,
Expand Down
1 change: 1 addition & 0 deletions tests/frontier/scenarios/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Scenarios common import."""
Loading
Loading