Skip to content
Open
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
44 changes: 4 additions & 40 deletions tests/ported_static/amsterdam_skip_list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# Entries are substring-matched against each pytest nodeid (after
# stripping the fixture-format suffix in conftest.py).
#
# Total entries: 5469
# Total entries: 5433

# stAttackTest (2)
stAttackTest/test_contract_creation_spam.py::test_contract_creation_spam[fork_Amsterdam]
Expand Down Expand Up @@ -90,30 +90,12 @@ stCodeSizeLimit/test_codesize_valid.py::test_codesize_valid[fork_Amsterdam-d1]
stCodeSizeLimit/test_create2_code_size_limit.py::test_create2_code_size_limit[fork_Amsterdam-valid]
stCodeSizeLimit/test_create_code_size_limit.py::test_create_code_size_limit[fork_Amsterdam-valid]

# stCreate2 (41)
# stCreate2 (23)
stCreate2/test_create2_contract_suicide_during_init_then_store_then_return.py::test_create2_contract_suicide_during_init_then_store_then_return[fork_Amsterdam]
stCreate2/test_create2_first_byte_loop.py::test_create2_first_byte_loop[fork_Amsterdam-firstHalf]
stCreate2/test_create2_oo_gafter_init_code.py::test_create2_oo_gafter_init_code[fork_Amsterdam--g1]
stCreate2/test_create2_oo_gafter_init_code_returndata2.py::test_create2_oo_gafter_init_code_returndata2[fork_Amsterdam--g1]
stCreate2/test_create2_oo_gafter_init_code_revert2.py::test_create2_oo_gafter_init_code_revert2[fork_Amsterdam]
stCreate2/test_create2_oog_from_call_refunds.py::test_create2_oog_from_call_refunds[fork_Amsterdam-LogOp_OoG0]
stCreate2/test_create2_oog_from_call_refunds.py::test_create2_oog_from_call_refunds[fork_Amsterdam-LogOp_OoG1]
stCreate2/test_create2_oog_from_call_refunds.py::test_create2_oog_from_call_refunds[fork_Amsterdam-SStore_CallCode_Refund_NoOoG]
stCreate2/test_create2_oog_from_call_refunds.py::test_create2_oog_from_call_refunds[fork_Amsterdam-SStore_Create2_Refund_OoG0]
stCreate2/test_create2_oog_from_call_refunds.py::test_create2_oog_from_call_refunds[fork_Amsterdam-SStore_Create2_Refund_OoG1]
stCreate2/test_create2_oog_from_call_refunds.py::test_create2_oog_from_call_refunds[fork_Amsterdam-SStore_Create_Refund_OoG0]
stCreate2/test_create2_oog_from_call_refunds.py::test_create2_oog_from_call_refunds[fork_Amsterdam-SStore_Create_Refund_OoG1]
stCreate2/test_create2_oog_from_call_refunds.py::test_create2_oog_from_call_refunds[fork_Amsterdam-SStore_DelegateCall_Refund_NoOoG]
stCreate2/test_create2_oog_from_call_refunds.py::test_create2_oog_from_call_refunds[fork_Amsterdam-SStore_Refund_OoG0]
stCreate2/test_create2_oog_from_call_refunds.py::test_create2_oog_from_call_refunds[fork_Amsterdam-SStore_Refund_OoG1]
stCreate2/test_create2_oog_from_call_refunds.py::test_create2_oog_from_call_refunds[fork_Amsterdam-SStore_Refund_OoG2]
stCreate2/test_create2_oog_from_call_refunds.py::test_create2_oog_from_call_refunds[fork_Amsterdam-SStore_Refund_OoG3]
stCreate2/test_create2_oog_from_call_refunds.py::test_create2_oog_from_call_refunds[fork_Amsterdam-SStore_Refund_OoG4]
stCreate2/test_create2_oog_from_call_refunds.py::test_create2_oog_from_call_refunds[fork_Amsterdam-SStore_Refund_OoG5]
stCreate2/test_create2_oog_from_call_refunds.py::test_create2_oog_from_call_refunds[fork_Amsterdam-SStore_Refund_OoG6]
stCreate2/test_create2_oog_from_call_refunds.py::test_create2_oog_from_call_refunds[fork_Amsterdam-SStore_Refund_OoG7]
stCreate2/test_create2_oog_from_call_refunds.py::test_create2_oog_from_call_refunds[fork_Amsterdam-SelfDestruct_Refund_OoG0]
stCreate2/test_create2_oog_from_call_refunds.py::test_create2_oog_from_call_refunds[fork_Amsterdam-SelfDestruct_Refund_OoG1]
stCreate2/test_create2_smart_init_code.py::test_create2_smart_init_code[fork_Amsterdam-d0]
stCreate2/test_create2_smart_init_code.py::test_create2_smart_init_code[fork_Amsterdam-d1]
stCreate2/test_create2collision_selfdestructed.py::test_create2collision_selfdestructed[fork_Amsterdam-d0]
Expand All @@ -133,7 +115,7 @@ stCreate2/test_revert_depth_create_address_collision.py::test_revert_depth_creat
stCreate2/test_revert_depth_create_address_collision_berlin.py::test_revert_depth_create_address_collision_berlin[fork_Amsterdam-d1-g1-v0]
stCreate2/test_revert_depth_create_address_collision_berlin.py::test_revert_depth_create_address_collision_berlin[fork_Amsterdam-d1-g1-v1]

# stCreateTest (61)
# stCreateTest (43)
stCreateTest/test_create_address_warm_after_fail.py::test_create_address_warm_after_fail[fork_Amsterdam-create-0xef-v1]
stCreateTest/test_create_address_warm_after_fail.py::test_create_address_warm_after_fail[fork_Amsterdam-create-code-too-big-v1]
stCreateTest/test_create_address_warm_after_fail.py::test_create_address_warm_after_fail[fork_Amsterdam-create-contructor-revert-v1]
Expand Down Expand Up @@ -166,24 +148,6 @@ stCreateTest/test_create_oo_gafter_init_code.py::test_create_oo_gafter_init_code
stCreateTest/test_create_oo_gafter_init_code_returndata2.py::test_create_oo_gafter_init_code_returndata2[fork_Amsterdam--g1]
stCreateTest/test_create_oo_gafter_init_code_returndata_size.py::test_create_oo_gafter_init_code_returndata_size[fork_Amsterdam]
stCreateTest/test_create_oo_gafter_init_code_revert2.py::test_create_oo_gafter_init_code_revert2[fork_Amsterdam-d0]
stCreateTest/test_create_oog_from_call_refunds.py::test_create_oog_from_call_refunds[fork_Amsterdam-LogOp_OoG0]
stCreateTest/test_create_oog_from_call_refunds.py::test_create_oog_from_call_refunds[fork_Amsterdam-LogOp_OoG1]
stCreateTest/test_create_oog_from_call_refunds.py::test_create_oog_from_call_refunds[fork_Amsterdam-SStore_Create2_Refund_OoG0]
stCreateTest/test_create_oog_from_call_refunds.py::test_create_oog_from_call_refunds[fork_Amsterdam-SStore_Create2_Refund_OoG1]
stCreateTest/test_create_oog_from_call_refunds.py::test_create_oog_from_call_refunds[fork_Amsterdam-SStore_Create_Refund_OoG0]
stCreateTest/test_create_oog_from_call_refunds.py::test_create_oog_from_call_refunds[fork_Amsterdam-SStore_Create_Refund_OoG1]
stCreateTest/test_create_oog_from_call_refunds.py::test_create_oog_from_call_refunds[fork_Amsterdam-SStore_Refund_NoOoG2]
stCreateTest/test_create_oog_from_call_refunds.py::test_create_oog_from_call_refunds[fork_Amsterdam-SStore_Refund_NoOoG3]
stCreateTest/test_create_oog_from_call_refunds.py::test_create_oog_from_call_refunds[fork_Amsterdam-SStore_Refund_OoG0]
stCreateTest/test_create_oog_from_call_refunds.py::test_create_oog_from_call_refunds[fork_Amsterdam-SStore_Refund_OoG1]
stCreateTest/test_create_oog_from_call_refunds.py::test_create_oog_from_call_refunds[fork_Amsterdam-SStore_Refund_OoG2]
stCreateTest/test_create_oog_from_call_refunds.py::test_create_oog_from_call_refunds[fork_Amsterdam-SStore_Refund_OoG3]
stCreateTest/test_create_oog_from_call_refunds.py::test_create_oog_from_call_refunds[fork_Amsterdam-SStore_Refund_OoG4]
stCreateTest/test_create_oog_from_call_refunds.py::test_create_oog_from_call_refunds[fork_Amsterdam-SStore_Refund_OoG5]
stCreateTest/test_create_oog_from_call_refunds.py::test_create_oog_from_call_refunds[fork_Amsterdam-SStore_Refund_OoG6]
stCreateTest/test_create_oog_from_call_refunds.py::test_create_oog_from_call_refunds[fork_Amsterdam-SStore_Refund_OoG7]
stCreateTest/test_create_oog_from_call_refunds.py::test_create_oog_from_call_refunds[fork_Amsterdam-SelfDestruct_Refund_OoG0]
stCreateTest/test_create_oog_from_call_refunds.py::test_create_oog_from_call_refunds[fork_Amsterdam-SelfDestruct_Refund_OoG1]
stCreateTest/test_create_transaction_call_data.py::test_create_transaction_call_data[fork_Amsterdam-calldatacopy]
stCreateTest/test_create_transaction_call_data.py::test_create_transaction_call_data[fork_Amsterdam-calldataload]
stCreateTest/test_create_transaction_call_data.py::test_create_transaction_call_data[fork_Amsterdam-codecopy]
Expand Down Expand Up @@ -5529,7 +5493,7 @@ stWalletTest/test_wallet_construction.py::test_wallet_construction[fork_Amsterda
stWalletTest/test_wallet_construction_oog.py::test_wallet_construction_oog[fork_Amsterdam--g1]
stWalletTest/test_wallet_construction_partial.py::test_wallet_construction_partial[fork_Amsterdam]

# stZeroKnowledge (19)
# stZeroKnowledge (20)
stZeroKnowledge/test_point_mul_add.py::test_point_mul_add[fork_Amsterdam-d2-g3]
stZeroKnowledge/test_point_mul_add.py::test_point_mul_add[fork_Amsterdam-d7-g3]
stZeroKnowledge/test_point_mul_add.py::test_point_mul_add[fork_Amsterdam-d8-g3]
Expand Down
115 changes: 115 additions & 0 deletions tests/ported_static/stCreate2/test_create2_oog_from_call_refunds.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

Ported from:
state_tests/stCreate2/Create2OOGFromCallRefundsFiller.yml

@manually-enhanced: Do not overwrite. Post-state expectations include
fork-specific overrides for Amsterdam (EIP-8037 changes the OoG refund
arithmetic; sender keeps a non-zero residue).
"""

import pytest
Expand Down Expand Up @@ -979,6 +983,45 @@ def test_create2_oog_from_call_refunds(
),
},
},
{
# EIP-8037 (Amsterdam) two-dimensional gas model changes the
# OoG refund — sender keeps a non-zero residue. Listed before
# the >=Cancun entry so resolve_expect_post matches Amsterdam
# specifically (first-match wins).
"indexes": {
"data": [1, 2, 4, 5, 7, 8, 10, 11],
"gas": -1,
"value": -1,
},
"network": [">=Amsterdam"],
"result": {
sender: Account(balance=0x19CBC0, nonce=2),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is manually-enhanced anyway, I wonder if it's worth making a couple helpers to do this calculation instead of hard coding so that when cpsb inevitably changes, this test (and the create test below) will automatically pick it up. I think we also won't need this >=Amsterdam branch because these helpers will return 0 before Amsterdam. Maybe something like:

  residue_sstore = (
      fork.create_state_gas(code_size=0)
      + fork.sstore_state_gas()
  ) * gas_price

Then this line becomes something like:

Suggested change
sender: Account(balance=0x19CBC0, nonce=2),
sender: Account(balance=residue_sstore, nonce=2),

Address(
0x95E88628C53B5C0E40FF6DE65A3CF8CDC3B477F7
): Account.NONEXISTENT,
Address(
0x66E1CC2616A273450621C8CC5E91D8CFD92494FA
): Account.NONEXISTENT,
Address(
0x6175BA9976476425B1CDA8E1DA479768FB429542
): Account.NONEXISTENT,
Address(
0x8DFF0E448F1E078E9B8A7FCF0BF6C291F167AAEF
): Account.NONEXISTENT,
Address(
0xA2C4270800A5DBEEA48464E5F2420EFB1747725A
): Account.NONEXISTENT,
Address(
0x4D80F1150EE236ADFAAB47C70DF90E757CEF1141
): Account.NONEXISTENT,
Address(
0x0566DC8DABC80FAD3ED9AB2B4309EBFD98894F44
): Account.NONEXISTENT,
Address(
0x55305CC46BDAF1E755A05A771D55CFEC3FEDEF90
): Account.NONEXISTENT,
},
},
{
"indexes": {
"data": [1, 2, 4, 5, 7, 8, 10, 11],
Expand Down Expand Up @@ -1025,6 +1068,23 @@ def test_create2_oog_from_call_refunds(
contract_26: Account(balance=0, nonce=1),
},
},
{
# Amsterdam refund residue (see SStore_Refund_OoG comment).
"indexes": {"data": [13, 14], "gas": -1, "value": -1},
"network": [">=Amsterdam"],
"result": {
sender: Account(balance=0x19CBC0, nonce=2),
Address(
0x8F6E6C741AC95C1A9109850EA1A3FFC722DC3BF8
): Account.NONEXISTENT,
Address(
0x1F5D187BB3A48DBB2C011D0A6E731AC8131799AD
): Account.NONEXISTENT,
contract_26: Account(
storage={1: 1}, code=bytes.fromhex("32ff"), nonce=1
),
},
},
{
"indexes": {"data": [13, 14], "gas": -1, "value": -1},
"network": [">=Cancun"],
Expand All @@ -1051,6 +1111,20 @@ def test_create2_oog_from_call_refunds(
),
},
},
{
# Amsterdam refund residue (see SStore_Refund_OoG comment).
"indexes": {"data": [16, 17], "gas": -1, "value": -1},
"network": [">=Amsterdam"],
"result": {
sender: Account(balance=0x19CBC0, nonce=2),
Address(
0x74B39291DFC237C0D42FD15457754778F51C6DE8
): Account.NONEXISTENT,
Address(
0x3399C78929EAB89C673A8986FF7CA9CCC49DB454
): Account.NONEXISTENT,
},
},
{
"indexes": {"data": [16, 17], "gas": -1, "value": -1},
"network": [">=Cancun"],
Expand All @@ -1077,6 +1151,27 @@ def test_create2_oog_from_call_refunds(
),
},
},
{
# Amsterdam refund residue is larger for the SStore+Create
# paths (see SStore_Refund_OoG comment).
"indexes": {"data": [19, 20], "gas": -1, "value": -1},
"network": [">=Amsterdam"],
"result": {
sender: Account(balance=0x284E5C, nonce=2),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, you could have another helper like:

  residue_sstore_create = (
      fork.create_state_gas(code_size=0)
      + fork.create_state_gas(code_size=1)
  ) * gas_price

and then this line becomes:

Suggested change
sender: Account(balance=0x284E5C, nonce=2),
sender: Account(balance=residue_sstore_create, nonce=2),

Address(
0xF922B2F70110C83F8EC7DF512B41BAC5627E8E59
): Account.NONEXISTENT,
Address(
0x2CA788D22E21134AB1909266ED3B6C352E2A07CB
): Account.NONEXISTENT,
Address(
0x398426E736801FE712DF1EF078A3B6CA3C6F063B
): Account.NONEXISTENT,
Address(
0xB520686759CED3BC9D8898E02EE41623032FF47F
): Account.NONEXISTENT,
},
},
{
"indexes": {"data": [19, 20], "gas": -1, "value": -1},
"network": [">=Cancun"],
Expand Down Expand Up @@ -1109,6 +1204,26 @@ def test_create2_oog_from_call_refunds(
),
},
},
{
# Amsterdam refund residue (see SStore_Create_Refund_OoG).
"indexes": {"data": [22, 23], "gas": -1, "value": -1},
"network": [">=Amsterdam"],
"result": {
sender: Account(balance=0x284E5C, nonce=2),
Address(
0xDD2C53BFCAF5C1D698A2B21C0908F15F7FBFD635
): Account.NONEXISTENT,
Address(
0x2D556BDBCC37C7A021879A21ABE25D1850D4FD36
): Account.NONEXISTENT,
Address(
0xA99DA4EA490335C986D52B0CC9E3F78B286AC5FC
): Account.NONEXISTENT,
Address(
0xB4AB8AB0D363765586925E35C715E342E4AE3C63
): Account.NONEXISTENT,
},
},
{
"indexes": {"data": [22, 23], "gas": -1, "value": -1},
"network": [">=Cancun"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

Ported from:
state_tests/stCreateTest/CreateOOGFromCallRefundsFiller.yml

@manually-enhanced: Do not overwrite. Post-state expectations include
fork-specific overrides for Amsterdam (EIP-8037 changes the OoG refund
arithmetic; sender keeps a non-zero residue).
"""

import pytest
Expand Down Expand Up @@ -946,6 +950,24 @@ def test_create_oog_from_call_refunds(
),
},
},
{
# EIP-8037 (Amsterdam) two-dimensional gas model changes the
# OoG refund — sender keeps a non-zero residue. Listed before
# the >=Cancun entry so resolve_expect_post matches Amsterdam
# specifically (first-match wins).
"indexes": {
"data": [1, 2, 4, 5, 7, 8, 10, 11],
"gas": -1,
"value": -1,
},
"network": [">=Amsterdam"],
"result": {
sender: Account(balance=0x19CBC0, nonce=2),
compute_create_address(
address=contract_0, nonce=1
): Account.NONEXISTENT,
},
},
{
"indexes": {
"data": [1, 2, 4, 5, 7, 8, 10, 11],
Expand All @@ -971,6 +993,20 @@ def test_create_oog_from_call_refunds(
contract_26: Account(balance=0, nonce=1),
},
},
{
# Amsterdam refund residue (see SStore_Refund_OoG comment).
"indexes": {"data": [13, 14], "gas": -1, "value": -1},
"network": [">=Amsterdam"],
"result": {
sender: Account(balance=0x19CBC0, nonce=2),
compute_create_address(
address=contract_0, nonce=1
): Account.NONEXISTENT,
contract_26: Account(
storage={1: 1}, code=bytes.fromhex("32ff"), nonce=1
),
},
},
{
"indexes": {"data": [13, 14], "gas": -1, "value": -1},
"network": [">=Cancun"],
Expand All @@ -994,6 +1030,17 @@ def test_create_oog_from_call_refunds(
),
},
},
{
# Amsterdam refund residue (see SStore_Refund_OoG comment).
"indexes": {"data": [16, 17], "gas": -1, "value": -1},
"network": [">=Amsterdam"],
"result": {
sender: Account(balance=0x19CBC0, nonce=2),
compute_create_address(
address=contract_0, nonce=1
): Account.NONEXISTENT,
},
},
{
"indexes": {"data": [16, 17], "gas": -1, "value": -1},
"network": [">=Cancun"],
Expand All @@ -1017,6 +1064,21 @@ def test_create_oog_from_call_refunds(
),
},
},
{
# Amsterdam refund residue is larger for the SStore+Create
# paths (see SStore_Refund_OoG comment).
"indexes": {"data": [19, 20], "gas": -1, "value": -1},
"network": [">=Amsterdam"],
"result": {
sender: Account(balance=0x284E5C, nonce=2),
compute_create_address(
address=contract_0, nonce=1
): Account.NONEXISTENT,
Address(
0x522C2E1C5DA65010908EF9929E327FE8B6CC86DA
): Account.NONEXISTENT,
},
},
{
"indexes": {"data": [19, 20], "gas": -1, "value": -1},
"network": [">=Cancun"],
Expand All @@ -1043,6 +1105,20 @@ def test_create_oog_from_call_refunds(
),
},
},
{
# Amsterdam refund residue (see SStore_Create_Refund_OoG).
"indexes": {"data": [22, 23], "gas": -1, "value": -1},
"network": [">=Amsterdam"],
"result": {
sender: Account(balance=0x284E5C, nonce=2),
compute_create_address(
address=contract_0, nonce=1
): Account.NONEXISTENT,
Address(
0x06019547B6E360ABDAFEADE158A9667CC6106C17
): Account.NONEXISTENT,
},
},
{
"indexes": {"data": [22, 23], "gas": -1, "value": -1},
"network": [">=Cancun"],
Expand Down
Loading