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
Original file line number Diff line number Diff line change
Expand Up @@ -1602,10 +1602,9 @@ def test_child_failure_refunds_state_gas_to_reservoir_not_gas_left(
child_state_charge = sstore_state_gas
else:
fresh_target = pre.fund_eoa(amount=0)
child_code = (
Op.POP(Op.CALL(gas=Op.GAS, address=fresh_target, value=1))
+ Op.REVERT(0, 0)
)
child_code = Op.POP(
Op.CALL(gas=Op.GAS, address=fresh_target, value=1)
) + Op.REVERT(0, 0)
child_balance = 1
child_state_charge = gas_costs.NEW_ACCOUNT

Expand Down
215 changes: 25 additions & 190 deletions tests/ported_static/amsterdam_skip_list.txt

Large diffs are not rendered by default.

25 changes: 23 additions & 2 deletions tests/ported_static/stCallCodes/test_callcall_00.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@

Ported from:
state_tests/stCallCodes/callcall_00Filler.json


@manually-enhanced: Do not overwrite. The hardcoded inner-CALL gas
values from the original filler (250k / 300k / 350k) were tuned to
the pre-EIP-8037 gas budget. On Amsterdam each SSTORE in the
innermost callee adds the EIP-8037 per-storage state-gas (37 568 wei
of regular gas), and the inner CALL OoGs before the test's SSTORE
markers fire. Bumped uniformly to 1M / 1.2M / 1.4M so the inner CALL
chain has headroom on Amsterdam; older forks are unaffected because
only the requested gas changes, the actual consumption is identical.
"""

import pytest
Expand All @@ -15,6 +25,7 @@
StateTestFiller,
Transaction,
)
from execution_testing.forks import Fork
from execution_testing.vm import Op

REFERENCE_SPEC_GIT_PATH = "N/A"
Expand All @@ -29,8 +40,18 @@
def test_callcall_00(
state_test: StateTestFiller,
pre: Alloc,
fork: Fork,
) -> None:
"""Call -> call -> code, params check."""
# EIP-8037 inner-CALL gas bumps (original gas values restored for
# pre-EIP-8037 forks; bumped values cover the per-storage state-gas
# spill into regular gas on Amsterdam).
inner_call_gas = 0x3D090
outer_call_gas = 0x55730
if fork.is_eip_enabled(8037):
inner_call_gas = 0xF4240
outer_call_gas = 0x155CC0

coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA)
sender = pre.fund_eoa(amount=0xDE0B6B3A7640000)

Expand Down Expand Up @@ -63,7 +84,7 @@ def test_callcall_00(
code=Op.SSTORE(
key=0x1,
value=Op.CALL(
gas=0x3D090,
gas=inner_call_gas,
address=addr_2,
value=0x2,
args_offset=0x0,
Expand All @@ -82,7 +103,7 @@ def test_callcall_00(
code=Op.SSTORE(
key=0x0,
value=Op.CALL(
gas=0x55730,
gas=outer_call_gas,
address=addr,
value=0x1,
args_offset=0x0,
Expand Down
29 changes: 26 additions & 3 deletions tests/ported_static/stCallCodes/test_callcallcall_000.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@

Ported from:
state_tests/stCallCodes/callcallcall_000Filler.json


@manually-enhanced: Do not overwrite. The hardcoded inner-CALL gas
values from the original filler (250k / 300k / 350k) were tuned to
the pre-EIP-8037 gas budget. On Amsterdam each SSTORE in the
innermost callee adds the EIP-8037 per-storage state-gas (37 568 wei
of regular gas), and the inner CALL OoGs before the test's SSTORE
markers fire. Bumped uniformly to 1M / 1.2M / 1.4M so the inner CALL
chain has headroom on Amsterdam; older forks are unaffected because
only the requested gas changes, the actual consumption is identical.
"""

import pytest
Expand All @@ -15,6 +25,7 @@
StateTestFiller,
Transaction,
)
from execution_testing.forks import Fork
from execution_testing.vm import Op

REFERENCE_SPEC_GIT_PATH = "N/A"
Expand All @@ -29,8 +40,20 @@
def test_callcallcall_000(
state_test: StateTestFiller,
pre: Alloc,
fork: Fork,
) -> None:
"""Call -> call -> call -> code, params check."""
# EIP-8037 inner-CALL gas bumps (original gas values restored for
# pre-EIP-8037 forks; bumped values cover the per-storage state-gas
# spill into regular gas on Amsterdam).
inner_call_gas = 0x3D090
middle_call_gas = 0x493E0
outer_call_gas = 0x55730
if fork.is_eip_enabled(8037):
inner_call_gas = 0xF4240
middle_call_gas = 0x124F80
outer_call_gas = 0x155CC0

coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA)
sender = pre.fund_eoa(amount=0xDE0B6B3A7640000)

Expand Down Expand Up @@ -63,7 +86,7 @@ def test_callcallcall_000(
code=Op.SSTORE(
key=0x2,
value=Op.CALL(
gas=0x3D090,
gas=inner_call_gas,
address=addr_3,
value=0x3,
args_offset=0x0,
Expand All @@ -82,7 +105,7 @@ def test_callcallcall_000(
code=Op.SSTORE(
key=0x1,
value=Op.CALL(
gas=0x493E0,
gas=middle_call_gas,
address=addr_2,
value=0x2,
args_offset=0x0,
Expand All @@ -101,7 +124,7 @@ def test_callcallcall_000(
code=Op.SSTORE(
key=0x0,
value=Op.CALL(
gas=0x55730,
gas=outer_call_gas,
address=addr,
value=0x1,
args_offset=0x0,
Expand Down
29 changes: 26 additions & 3 deletions tests/ported_static/stCallCodes/test_callcallcallcode_001.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@

Ported from:
state_tests/stCallCodes/callcallcallcode_001Filler.json


@manually-enhanced: Do not overwrite. The hardcoded inner-CALL gas
values from the original filler (250k / 300k / 350k) were tuned to
the pre-EIP-8037 gas budget. On Amsterdam each SSTORE in the
innermost callee adds the EIP-8037 per-storage state-gas (37 568 wei
of regular gas), and the inner CALL OoGs before the test's SSTORE
markers fire. Bumped uniformly to 1M / 1.2M / 1.4M so the inner CALL
chain has headroom on Amsterdam; older forks are unaffected because
only the requested gas changes, the actual consumption is identical.
"""

import pytest
Expand All @@ -15,6 +25,7 @@
StateTestFiller,
Transaction,
)
from execution_testing.forks import Fork
from execution_testing.vm import Op

REFERENCE_SPEC_GIT_PATH = "N/A"
Expand All @@ -29,8 +40,20 @@
def test_callcallcallcode_001(
state_test: StateTestFiller,
pre: Alloc,
fork: Fork,
) -> None:
"""Call -> call -> callcode - > code, params check."""
# EIP-8037 inner-CALL gas bumps (original gas values restored for
# pre-EIP-8037 forks; bumped values cover the per-storage state-gas
# spill into regular gas on Amsterdam).
inner_call_gas = 0x3D090
middle_call_gas = 0x493E0
outer_call_gas = 0x55730
if fork.is_eip_enabled(8037):
inner_call_gas = 0xF4240
middle_call_gas = 0x124F80
outer_call_gas = 0x155CC0

coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA)
sender = pre.fund_eoa(amount=0xDE0B6B3A7640000)

Expand Down Expand Up @@ -63,7 +86,7 @@ def test_callcallcallcode_001(
code=Op.SSTORE(
key=0x2,
value=Op.CALLCODE(
gas=0x3D090,
gas=inner_call_gas,
address=addr_3,
value=0x3,
args_offset=0x0,
Expand All @@ -82,7 +105,7 @@ def test_callcallcallcode_001(
code=Op.SSTORE(
key=0x1,
value=Op.CALL(
gas=0x493E0,
gas=middle_call_gas,
address=addr_2,
value=0x2,
args_offset=0x0,
Expand All @@ -101,7 +124,7 @@ def test_callcallcallcode_001(
code=Op.SSTORE(
key=0x0,
value=Op.CALL(
gas=0x55730,
gas=outer_call_gas,
address=addr,
value=0x1,
args_offset=0x0,
Expand Down
25 changes: 23 additions & 2 deletions tests/ported_static/stCallCodes/test_callcallcode_01.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@

Ported from:
state_tests/stCallCodes/callcallcode_01Filler.json


@manually-enhanced: Do not overwrite. The hardcoded inner-CALL gas
values from the original filler (250k / 300k / 350k) were tuned to
the pre-EIP-8037 gas budget. On Amsterdam each SSTORE in the
innermost callee adds the EIP-8037 per-storage state-gas (37 568 wei
of regular gas), and the inner CALL OoGs before the test's SSTORE
markers fire. Bumped uniformly to 1M / 1.2M / 1.4M so the inner CALL
chain has headroom on Amsterdam; older forks are unaffected because
only the requested gas changes, the actual consumption is identical.
"""

import pytest
Expand All @@ -15,6 +25,7 @@
StateTestFiller,
Transaction,
)
from execution_testing.forks import Fork
from execution_testing.vm import Op

REFERENCE_SPEC_GIT_PATH = "N/A"
Expand All @@ -29,8 +40,18 @@
def test_callcallcode_01(
state_test: StateTestFiller,
pre: Alloc,
fork: Fork,
) -> None:
"""Call -> callcode -> code, params check."""
# EIP-8037 inner-CALL gas bumps (original gas values restored for
# pre-EIP-8037 forks; bumped values cover the per-storage state-gas
# spill into regular gas on Amsterdam).
inner_call_gas = 0x3D090
outer_call_gas = 0x55730
if fork.is_eip_enabled(8037):
inner_call_gas = 0xF4240
outer_call_gas = 0x155CC0

coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA)
sender = pre.fund_eoa(amount=0xDE0B6B3A7640000)

Expand Down Expand Up @@ -63,7 +84,7 @@ def test_callcallcode_01(
code=Op.SSTORE(
key=0x1,
value=Op.CALLCODE(
gas=0x3D090,
gas=inner_call_gas,
address=addr_2,
value=0x2,
args_offset=0x0,
Expand All @@ -82,7 +103,7 @@ def test_callcallcode_01(
code=Op.SSTORE(
key=0x0,
value=Op.CALL(
gas=0x55730,
gas=outer_call_gas,
address=addr,
value=0x1,
args_offset=0x0,
Expand Down
29 changes: 26 additions & 3 deletions tests/ported_static/stCallCodes/test_callcallcodecall_010.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@

Ported from:
state_tests/stCallCodes/callcallcodecall_010Filler.json


@manually-enhanced: Do not overwrite. The hardcoded inner-CALL gas
values from the original filler (250k / 300k / 350k) were tuned to
the pre-EIP-8037 gas budget. On Amsterdam each SSTORE in the
innermost callee adds the EIP-8037 per-storage state-gas (37 568 wei
of regular gas), and the inner CALL OoGs before the test's SSTORE
markers fire. Bumped uniformly to 1M / 1.2M / 1.4M so the inner CALL
chain has headroom on Amsterdam; older forks are unaffected because
only the requested gas changes, the actual consumption is identical.
"""

import pytest
Expand All @@ -15,6 +25,7 @@
StateTestFiller,
Transaction,
)
from execution_testing.forks import Fork
from execution_testing.vm import Op

REFERENCE_SPEC_GIT_PATH = "N/A"
Expand All @@ -29,8 +40,20 @@
def test_callcallcodecall_010(
state_test: StateTestFiller,
pre: Alloc,
fork: Fork,
) -> None:
"""Call -> callcode -> call -> code, params check."""
# EIP-8037 inner-CALL gas bumps (original gas values restored for
# pre-EIP-8037 forks; bumped values cover the per-storage state-gas
# spill into regular gas on Amsterdam).
inner_call_gas = 0x3D090
middle_call_gas = 0x493E0
outer_call_gas = 0x55730
if fork.is_eip_enabled(8037):
inner_call_gas = 0xF4240
middle_call_gas = 0x124F80
outer_call_gas = 0x155CC0

coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA)
sender = pre.fund_eoa(amount=0xDE0B6B3A7640000)

Expand Down Expand Up @@ -63,7 +86,7 @@ def test_callcallcodecall_010(
code=Op.SSTORE(
key=0x2,
value=Op.CALL(
gas=0x3D090,
gas=inner_call_gas,
address=addr_3,
value=0x3,
args_offset=0x0,
Expand All @@ -82,7 +105,7 @@ def test_callcallcodecall_010(
code=Op.SSTORE(
key=0x1,
value=Op.CALLCODE(
gas=0x493E0,
gas=middle_call_gas,
address=addr_2,
value=0x2,
args_offset=0x0,
Expand All @@ -101,7 +124,7 @@ def test_callcallcodecall_010(
code=Op.SSTORE(
key=0x0,
value=Op.CALL(
gas=0x55730,
gas=outer_call_gas,
address=addr,
value=0x1,
args_offset=0x0,
Expand Down
Loading
Loading