diff --git a/tests/amsterdam/eip8037_state_creation_gas_cost_increase/test_state_gas_call.py b/tests/amsterdam/eip8037_state_creation_gas_cost_increase/test_state_gas_call.py index 8a265124d4..2113107fb5 100644 --- a/tests/amsterdam/eip8037_state_creation_gas_cost_increase/test_state_gas_call.py +++ b/tests/amsterdam/eip8037_state_creation_gas_cost_increase/test_state_gas_call.py @@ -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 diff --git a/tests/ported_static/amsterdam_skip_list.txt b/tests/ported_static/amsterdam_skip_list.txt index 3e6e0faed5..230134e5f1 100644 --- a/tests/ported_static/amsterdam_skip_list.txt +++ b/tests/ported_static/amsterdam_skip_list.txt @@ -8,7 +8,7 @@ # Entries are substring-matched against each pytest nodeid (after # stripping the fixture-format suffix in conftest.py). # -# Total entries: 944 +# Total entries: 897 # stAttackTest (1) stAttackTest/test_crashing_transaction.py::test_crashing_transaction[fork_Amsterdam] @@ -20,23 +20,6 @@ stBadOpcode/test_operation_diff_gas.py::test_operation_diff_gas[fork_Amsterdam-C stBadOpcode/test_operation_diff_gas.py::test_operation_diff_gas[fork_Amsterdam-CREATE] # stCallCodes (17) -stCallCodes/test_callcall_00.py::test_callcall_00[fork_Amsterdam] -stCallCodes/test_callcallcall_000.py::test_callcallcall_000[fork_Amsterdam] -stCallCodes/test_callcallcallcode_001.py::test_callcallcallcode_001[fork_Amsterdam] -stCallCodes/test_callcallcode_01.py::test_callcallcode_01[fork_Amsterdam] -stCallCodes/test_callcallcodecall_010.py::test_callcallcodecall_010[fork_Amsterdam] -stCallCodes/test_callcallcodecallcode_011.py::test_callcallcodecallcode_011[fork_Amsterdam] -stCallCodes/test_callcode_dynamic_code.py::test_callcode_dynamic_code[fork_Amsterdam-d0] -stCallCodes/test_callcode_dynamic_code.py::test_callcode_dynamic_code[fork_Amsterdam-d1] -stCallCodes/test_callcode_dynamic_code.py::test_callcode_dynamic_code[fork_Amsterdam-d2] -stCallCodes/test_callcode_dynamic_code.py::test_callcode_dynamic_code[fork_Amsterdam-d3] -stCallCodes/test_callcode_dynamic_code2_self_call.py::test_callcode_dynamic_code2_self_call[fork_Amsterdam-d1] -stCallCodes/test_callcodecall_10.py::test_callcodecall_10[fork_Amsterdam] -stCallCodes/test_callcodecallcall_100.py::test_callcodecallcall_100[fork_Amsterdam] -stCallCodes/test_callcodecallcallcode_101.py::test_callcodecallcallcode_101[fork_Amsterdam] -stCallCodes/test_callcodecallcode_11.py::test_callcodecallcode_11[fork_Amsterdam] -stCallCodes/test_callcodecallcodecall_110.py::test_callcodecallcodecall_110[fork_Amsterdam] -stCallCodes/test_callcodecallcodecallcode_111.py::test_callcodecallcodecallcode_111[fork_Amsterdam] # stCallCreateCallCodeTest (12) stCallCreateCallCodeTest/test_call1024_oog.py::test_call1024_oog[fork_Amsterdam--g0] @@ -53,49 +36,18 @@ stCallCreateCallCodeTest/test_create_name_registrator_per_txs_not_enough_gas.py: stCallCreateCallCodeTest/test_create_name_registrator_pre_store1_not_enough_gas.py::test_create_name_registrator_pre_store1_not_enough_gas[fork_Amsterdam] # stCallDelegateCodesCallCodeHomestead (11) -stCallDelegateCodesCallCodeHomestead/test_callcallcallcode_001.py::test_callcallcallcode_001[fork_Amsterdam] -stCallDelegateCodesCallCodeHomestead/test_callcallcode_01.py::test_callcallcode_01[fork_Amsterdam] -stCallDelegateCodesCallCodeHomestead/test_callcallcodecall_010.py::test_callcallcodecall_010[fork_Amsterdam] -stCallDelegateCodesCallCodeHomestead/test_callcallcodecallcode_011.py::test_callcallcodecallcode_011[fork_Amsterdam] -stCallDelegateCodesCallCodeHomestead/test_callcodecall_10.py::test_callcodecall_10[fork_Amsterdam] -stCallDelegateCodesCallCodeHomestead/test_callcodecallcall_100.py::test_callcodecallcall_100[fork_Amsterdam] -stCallDelegateCodesCallCodeHomestead/test_callcodecallcallcode_101.py::test_callcodecallcallcode_101[fork_Amsterdam] -stCallDelegateCodesCallCodeHomestead/test_callcodecallcode_11.py::test_callcodecallcode_11[fork_Amsterdam] -stCallDelegateCodesCallCodeHomestead/test_callcodecallcodecall_110.py::test_callcodecallcodecall_110[fork_Amsterdam] -stCallDelegateCodesCallCodeHomestead/test_callcodecallcodecallcode_111.py::test_callcodecallcodecallcode_111[fork_Amsterdam] -stCallDelegateCodesCallCodeHomestead/test_callcodecallcodecallcode_111_suicide_end.py::test_callcodecallcodecallcode_111_suicide_end[fork_Amsterdam] # stCallDelegateCodesHomestead (10) -stCallDelegateCodesHomestead/test_callcallcallcode_001.py::test_callcallcallcode_001[fork_Amsterdam] -stCallDelegateCodesHomestead/test_callcallcode_01.py::test_callcallcode_01[fork_Amsterdam] -stCallDelegateCodesHomestead/test_callcallcodecall_010.py::test_callcallcodecall_010[fork_Amsterdam] -stCallDelegateCodesHomestead/test_callcallcodecallcode_011.py::test_callcallcodecallcode_011[fork_Amsterdam] -stCallDelegateCodesHomestead/test_callcodecall_10.py::test_callcodecall_10[fork_Amsterdam] -stCallDelegateCodesHomestead/test_callcodecallcall_100.py::test_callcodecallcall_100[fork_Amsterdam] -stCallDelegateCodesHomestead/test_callcodecallcallcode_101.py::test_callcodecallcallcode_101[fork_Amsterdam] -stCallDelegateCodesHomestead/test_callcodecallcode_11.py::test_callcodecallcode_11[fork_Amsterdam] -stCallDelegateCodesHomestead/test_callcodecallcodecall_110.py::test_callcodecallcodecall_110[fork_Amsterdam] -stCallDelegateCodesHomestead/test_callcodecallcodecallcode_111.py::test_callcodecallcodecallcode_111[fork_Amsterdam] - -# stCodeSizeLimit (4) -stCodeSizeLimit/test_codesize_valid.py::test_codesize_valid[fork_Amsterdam-d0] -stCodeSizeLimit/test_codesize_valid.py::test_codesize_valid[fork_Amsterdam-d1] + +# stCodeSizeLimit (2) 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 (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_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] -stCreate2/test_create2collision_selfdestructed.py::test_create2collision_selfdestructed[fork_Amsterdam-d1] -stCreate2/test_create2collision_selfdestructed.py::test_create2collision_selfdestructed[fork_Amsterdam-d2] -stCreate2/test_create2collision_selfdestructed2.py::test_create2collision_selfdestructed2[fork_Amsterdam-d0] -stCreate2/test_create2collision_selfdestructed2.py::test_create2collision_selfdestructed2[fork_Amsterdam-d1] stCreate2/test_create_message_reverted.py::test_create_message_reverted[fork_Amsterdam--g1] stCreate2/test_create_message_reverted_oog_in_init2.py::test_create_message_reverted_oog_in_init2[fork_Amsterdam--g0] stCreate2/test_create_message_reverted_oog_in_init2.py::test_create_message_reverted_oog_in_init2[fork_Amsterdam--g1] @@ -145,11 +97,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_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] -stCreateTest/test_create_transaction_high_nonce.py::test_create_transaction_high_nonce[fork_Amsterdam--v0] -stCreateTest/test_create_transaction_high_nonce.py::test_create_transaction_high_nonce[fork_Amsterdam--v1] stCreateTest/test_transaction_collision_to_empty2.py::test_transaction_collision_to_empty2[fork_Amsterdam--g1-v0] stCreateTest/test_transaction_collision_to_empty2.py::test_transaction_collision_to_empty2[fork_Amsterdam--g1-v1] stCreateTest/test_transaction_collision_to_empty_but_code.py::test_transaction_collision_to_empty_but_code[fork_Amsterdam--g1-v0] @@ -208,47 +155,6 @@ stEIP1559/test_sender_balance.py::test_sender_balance[fork_Amsterdam] stEIP158Specific/test_exp_empty.py::test_exp_empty[fork_Amsterdam] # stEIP2930 (41) -stEIP2930/test_manual_create.py::test_manual_create[fork_Amsterdam-addrGoodCellBad] -stEIP2930/test_manual_create.py::test_manual_create[fork_Amsterdam-allBad] -stEIP2930/test_manual_create.py::test_manual_create[fork_Amsterdam-allGood] -stEIP2930/test_storage_costs.py::test_storage_costs[fork_Amsterdam-declaredKeyWrite0] -stEIP2930/test_storage_costs.py::test_storage_costs[fork_Amsterdam-declaredKeyWrite1] -stEIP2930/test_storage_costs.py::test_storage_costs[fork_Amsterdam-declaredKeyWrite_postSLOAD] -stEIP2930/test_storage_costs.py::test_storage_costs[fork_Amsterdam-declaredTo] -stEIP2930/test_storage_costs.py::test_storage_costs[fork_Amsterdam-undeclaredKeyWrite0] -stEIP2930/test_storage_costs.py::test_storage_costs[fork_Amsterdam-undeclaredKeyWrite1] -stEIP2930/test_storage_costs.py::test_storage_costs[fork_Amsterdam-undeclaredKeyWrite2] -stEIP2930/test_storage_costs.py::test_storage_costs[fork_Amsterdam-undeclaredKeyWrite_postSLOAD] -stEIP2930/test_storage_costs.py::test_storage_costs[fork_Amsterdam-undeclaredTo0] -stEIP2930/test_storage_costs.py::test_storage_costs[fork_Amsterdam-undeclaredTo1] -stEIP2930/test_varied_context.py::test_varied_context[fork_Amsterdam-callCalleeInAccessList] -stEIP2930/test_varied_context.py::test_varied_context[fork_Amsterdam-callCallerInAccessList] -stEIP2930/test_varied_context.py::test_varied_context[fork_Amsterdam-callCreate2edInvalid] -stEIP2930/test_varied_context.py::test_varied_context[fork_Amsterdam-callCreate2edValid] -stEIP2930/test_varied_context.py::test_varied_context[fork_Amsterdam-callCreatedInvalid] -stEIP2930/test_varied_context.py::test_varied_context[fork_Amsterdam-callCreatedValid] -stEIP2930/test_varied_context.py::test_varied_context[fork_Amsterdam-callReadSuicideInvalid] -stEIP2930/test_varied_context.py::test_varied_context[fork_Amsterdam-callReadSuicideValid] -stEIP2930/test_varied_context.py::test_varied_context[fork_Amsterdam-callRevertCalleeInAccessList] -stEIP2930/test_varied_context.py::test_varied_context[fork_Amsterdam-callRevertCallerInAccessList] -stEIP2930/test_varied_context.py::test_varied_context[fork_Amsterdam-callTwiceInvalid] -stEIP2930/test_varied_context.py::test_varied_context[fork_Amsterdam-callTwiceValid] -stEIP2930/test_varied_context.py::test_varied_context[fork_Amsterdam-callWriteSuicideInvalid] -stEIP2930/test_varied_context.py::test_varied_context[fork_Amsterdam-callWriteSuicideValid] -stEIP2930/test_varied_context.py::test_varied_context[fork_Amsterdam-callcodeCalleeInAccessList] -stEIP2930/test_varied_context.py::test_varied_context[fork_Amsterdam-callcodeCallerInAccessList] -stEIP2930/test_varied_context.py::test_varied_context[fork_Amsterdam-create2AndCallInvalid] -stEIP2930/test_varied_context.py::test_varied_context[fork_Amsterdam-create2AndCallValid] -stEIP2930/test_varied_context.py::test_varied_context[fork_Amsterdam-create2Invalid] -stEIP2930/test_varied_context.py::test_varied_context[fork_Amsterdam-create2Valid] -stEIP2930/test_varied_context.py::test_varied_context[fork_Amsterdam-createAndCallInvalid] -stEIP2930/test_varied_context.py::test_varied_context[fork_Amsterdam-createAndCallValid] -stEIP2930/test_varied_context.py::test_varied_context[fork_Amsterdam-createInvalid] -stEIP2930/test_varied_context.py::test_varied_context[fork_Amsterdam-createValid] -stEIP2930/test_varied_context.py::test_varied_context[fork_Amsterdam-delegateCalleeInAccessList] -stEIP2930/test_varied_context.py::test_varied_context[fork_Amsterdam-delegateCallerInAccessList] -stEIP2930/test_varied_context.py::test_varied_context[fork_Amsterdam-recurseInvalid] -stEIP2930/test_varied_context.py::test_varied_context[fork_Amsterdam-recurseValid] # stEIP3855_push0 (2) stEIP3855_push0/test_push0.py::test_push0[fork_Amsterdam-push0_upd_storage_sc] @@ -287,13 +193,11 @@ stEIP5656_MCOPY/test_mcopy_copy_cost.py::test_mcopy_copy_cost[fork_Amsterdam-src stEIP5656_MCOPY/test_mcopy_copy_cost.py::test_mcopy_copy_cost[fork_Amsterdam-src32_size32-g1] stEIP5656_MCOPY/test_mcopy_copy_cost.py::test_mcopy_copy_cost[fork_Amsterdam-src32_size33-g1] -# stHomesteadSpecific (2) +# stHomesteadSpecific (1) stHomesteadSpecific/test_contract_creation_oo_gdont_leave_empty_contract_via_transaction.py::test_contract_creation_oo_gdont_leave_empty_contract_via_transaction[fork_Amsterdam] -stHomesteadSpecific/test_create_contract_via_transaction_cost53000.py::test_create_contract_via_transaction_cost53000[fork_Amsterdam] -# stInitCodeTest (11) +# stInitCodeTest (10) stInitCodeTest/test_call_contract_to_create_contract_which_would_create_contract_if_called.py::test_call_contract_to_create_contract_which_would_create_contract_if_called[fork_Amsterdam] -stInitCodeTest/test_call_the_contract_to_create_empty_contract.py::test_call_the_contract_to_create_empty_contract[fork_Amsterdam] stInitCodeTest/test_out_of_gas_contract_creation.py::test_out_of_gas_contract_creation[fork_Amsterdam-d0-g0] stInitCodeTest/test_out_of_gas_contract_creation.py::test_out_of_gas_contract_creation[fork_Amsterdam-d0-g1] stInitCodeTest/test_out_of_gas_contract_creation.py::test_out_of_gas_contract_creation[fork_Amsterdam-d1-g0] @@ -329,41 +233,9 @@ stNonZeroCallsTest/test_non_zero_value_delegatecall_to_empty_paris.py::test_non_ stNonZeroCallsTest/test_non_zero_value_delegatecall_to_non_non_zero_balance.py::test_non_zero_value_delegatecall_to_non_non_zero_balance[fork_Amsterdam] stNonZeroCallsTest/test_non_zero_value_delegatecall_to_one_storage_key_paris.py::test_non_zero_value_delegatecall_to_one_storage_key_paris[fork_Amsterdam] -# stPreCompiledContracts (29) -stPreCompiledContracts/test_precomps_eip2929_cancun.py::test_precomps_eip2929_cancun[fork_Amsterdam-all0] -stPreCompiledContracts/test_precomps_eip2929_cancun.py::test_precomps_eip2929_cancun[fork_Amsterdam-all1] -stPreCompiledContracts/test_precomps_eip2929_cancun.py::test_precomps_eip2929_cancun[fork_Amsterdam-all2] -stPreCompiledContracts/test_precomps_eip2929_cancun.py::test_precomps_eip2929_cancun[fork_Amsterdam-all3] -stPreCompiledContracts/test_precomps_eip2929_cancun.py::test_precomps_eip2929_cancun[fork_Amsterdam-all4] -stPreCompiledContracts/test_precomps_eip2929_cancun.py::test_precomps_eip2929_cancun[fork_Amsterdam-all5] -stPreCompiledContracts/test_precomps_eip2929_cancun.py::test_precomps_eip2929_cancun[fork_Amsterdam-new0] -stPreCompiledContracts/test_precomps_eip2929_cancun.py::test_precomps_eip2929_cancun[fork_Amsterdam-new10] -stPreCompiledContracts/test_precomps_eip2929_cancun.py::test_precomps_eip2929_cancun[fork_Amsterdam-new11] -stPreCompiledContracts/test_precomps_eip2929_cancun.py::test_precomps_eip2929_cancun[fork_Amsterdam-new12] -stPreCompiledContracts/test_precomps_eip2929_cancun.py::test_precomps_eip2929_cancun[fork_Amsterdam-new13] -stPreCompiledContracts/test_precomps_eip2929_cancun.py::test_precomps_eip2929_cancun[fork_Amsterdam-new14] -stPreCompiledContracts/test_precomps_eip2929_cancun.py::test_precomps_eip2929_cancun[fork_Amsterdam-new15] -stPreCompiledContracts/test_precomps_eip2929_cancun.py::test_precomps_eip2929_cancun[fork_Amsterdam-new16] -stPreCompiledContracts/test_precomps_eip2929_cancun.py::test_precomps_eip2929_cancun[fork_Amsterdam-new17] -stPreCompiledContracts/test_precomps_eip2929_cancun.py::test_precomps_eip2929_cancun[fork_Amsterdam-new18] -stPreCompiledContracts/test_precomps_eip2929_cancun.py::test_precomps_eip2929_cancun[fork_Amsterdam-new19] -stPreCompiledContracts/test_precomps_eip2929_cancun.py::test_precomps_eip2929_cancun[fork_Amsterdam-new1] -stPreCompiledContracts/test_precomps_eip2929_cancun.py::test_precomps_eip2929_cancun[fork_Amsterdam-new20] -stPreCompiledContracts/test_precomps_eip2929_cancun.py::test_precomps_eip2929_cancun[fork_Amsterdam-new21] -stPreCompiledContracts/test_precomps_eip2929_cancun.py::test_precomps_eip2929_cancun[fork_Amsterdam-new22] -stPreCompiledContracts/test_precomps_eip2929_cancun.py::test_precomps_eip2929_cancun[fork_Amsterdam-new2] -stPreCompiledContracts/test_precomps_eip2929_cancun.py::test_precomps_eip2929_cancun[fork_Amsterdam-new3] -stPreCompiledContracts/test_precomps_eip2929_cancun.py::test_precomps_eip2929_cancun[fork_Amsterdam-new4] -stPreCompiledContracts/test_precomps_eip2929_cancun.py::test_precomps_eip2929_cancun[fork_Amsterdam-new5] -stPreCompiledContracts/test_precomps_eip2929_cancun.py::test_precomps_eip2929_cancun[fork_Amsterdam-new6] -stPreCompiledContracts/test_precomps_eip2929_cancun.py::test_precomps_eip2929_cancun[fork_Amsterdam-new7] -stPreCompiledContracts/test_precomps_eip2929_cancun.py::test_precomps_eip2929_cancun[fork_Amsterdam-new8] -stPreCompiledContracts/test_precomps_eip2929_cancun.py::test_precomps_eip2929_cancun[fork_Amsterdam-new9] +# stPreCompiledContracts (0) # stPreCompiledContracts2 (7) -stPreCompiledContracts2/test_call_ecrecover_overflow.py::test_call_ecrecover_overflow[fork_Amsterdam-pass01] -stPreCompiledContracts2/test_call_ecrecover_overflow.py::test_call_ecrecover_overflow[fork_Amsterdam-pass02] -stPreCompiledContracts2/test_call_ecrecover_overflow.py::test_call_ecrecover_overflow[fork_Amsterdam-pass03] stPreCompiledContracts2/test_ecrecover_short_buff.py::test_ecrecover_short_buff[fork_Amsterdam] stPreCompiledContracts2/test_modexp_0_0_0_22000.py::test_modexp_0_0_0_22000[fork_Amsterdam--g0] stPreCompiledContracts2/test_modexp_0_0_0_25000.py::test_modexp_0_0_0_25000[fork_Amsterdam--g0] @@ -387,8 +259,6 @@ stRevertTest/test_revert_depth_create_address_collision.py::test_revert_depth_cr stRevertTest/test_revert_depth_create_address_collision.py::test_revert_depth_create_address_collision[fork_Amsterdam-d1-g1-v1] stRevertTest/test_revert_depth_create_oog.py::test_revert_depth_create_oog[fork_Amsterdam-d1-g1-v0] stRevertTest/test_revert_depth_create_oog.py::test_revert_depth_create_oog[fork_Amsterdam-d1-g1-v1] -stRevertTest/test_revert_opcode_in_init.py::test_revert_opcode_in_init[fork_Amsterdam--v0] -stRevertTest/test_revert_opcode_in_init.py::test_revert_opcode_in_init[fork_Amsterdam--v1] # stSStoreTest (76) stSStoreTest/test_sstore_0to0.py::test_sstore_0to0[fork_Amsterdam-d0-g1] @@ -483,13 +353,9 @@ stTransactionTest/test_internal_call_hitting_gas_limit_success.py::test_internal stTransactionTest/test_store_gas_on_create.py::test_store_gas_on_create[fork_Amsterdam] stTransactionTest/test_suicides_and_internal_call_suicides_success.py::test_suicides_and_internal_call_suicides_success[fork_Amsterdam-d1] -# stWalletTest (8) -stWalletTest/test_day_limit_construction.py::test_day_limit_construction[fork_Amsterdam--g0] -stWalletTest/test_day_limit_construction.py::test_day_limit_construction[fork_Amsterdam--g1] +# stWalletTest (4) stWalletTest/test_day_limit_construction_partial.py::test_day_limit_construction_partial[fork_Amsterdam] stWalletTest/test_multi_owned_construction_not_enough_gas_partial.py::test_multi_owned_construction_not_enough_gas_partial[fork_Amsterdam--g1] -stWalletTest/test_wallet_construction.py::test_wallet_construction[fork_Amsterdam--g0] -stWalletTest/test_wallet_construction.py::test_wallet_construction[fork_Amsterdam--g1] 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] @@ -527,7 +393,7 @@ stCallCodes/test_callcodecall_10_suicide_end.py::test_callcodecall_10_suicide_en stCallCodes/test_callcodecallcall_100_suicide_end.py::test_callcodecallcall_100_suicide_end[fork_Amsterdam] stCallCodes/test_callcodecallcodecall_110_suicide_end.py::test_callcodecallcodecall_110_suicide_end[fork_Amsterdam] -# stCallCreateCallCodeTest (2) +# stCallCreateCallCodeTest (14) stCallCreateCallCodeTest/test_create_fail_balance_too_low.py::test_create_fail_balance_too_low[fork_Amsterdam--v1] stCallCreateCallCodeTest/test_create_init_fail_undefined_instruction.py::test_create_init_fail_undefined_instruction[fork_Amsterdam] @@ -594,10 +460,6 @@ stDelegatecallTestHomestead/test_delegatecall_in_initcode_to_existing_contract.p stDelegatecallTestHomestead/test_delegatecode_dynamic_code.py::test_delegatecode_dynamic_code[fork_Amsterdam] # stEIP2930 (4) -stEIP2930/test_storage_costs.py::test_storage_costs[fork_Amsterdam-declaredKeyRead_postSSTORE] -stEIP2930/test_storage_costs.py::test_storage_costs[fork_Amsterdam-declaredKeyWrite_postSSTORE] -stEIP2930/test_storage_costs.py::test_storage_costs[fork_Amsterdam-undeclaredKeyRead_postSSTORE] -stEIP2930/test_storage_costs.py::test_storage_costs[fork_Amsterdam-undeclaredKeyWrite_postSSTORE] # stEIP3651_warmcoinbase (12) stEIP3651_warmcoinbase/test_coinbase_warm_account_call_gas.py::test_coinbase_warm_account_call_gas[fork_Amsterdam-d0] @@ -613,7 +475,7 @@ stEIP3651_warmcoinbase/test_coinbase_warm_account_call_gas_fail.py::test_coinbas stEIP3651_warmcoinbase/test_coinbase_warm_account_call_gas_fail.py::test_coinbase_warm_account_call_gas_fail[fork_Amsterdam-d2] stEIP3651_warmcoinbase/test_coinbase_warm_account_call_gas_fail.py::test_coinbase_warm_account_call_gas_fail[fork_Amsterdam-d3] -# stEIP5656_MCOPY (32) +# stEIP5656_MCOPY (55) stEIP5656_MCOPY/test_mcopy_copy_cost.py::test_mcopy_copy_cost[fork_Amsterdam-src0_size0-g0] stEIP5656_MCOPY/test_mcopy_copy_cost.py::test_mcopy_copy_cost[fork_Amsterdam-src0_size1-g0] stEIP5656_MCOPY/test_mcopy_copy_cost.py::test_mcopy_copy_cost[fork_Amsterdam-src0_size31-g0] @@ -647,7 +509,7 @@ stEIP5656_MCOPY/test_mcopy_copy_cost.py::test_mcopy_copy_cost[fork_Amsterdam-src stEIP5656_MCOPY/test_mcopy_copy_cost.py::test_mcopy_copy_cost[fork_Amsterdam-src32_size44768-g0] stEIP5656_MCOPY/test_mcopy_copy_cost.py::test_mcopy_copy_cost[fork_Amsterdam-src32_size44769-g0] -# stMemoryTest (25) +# stMemoryTest (27) stMemoryTest/test_call_data_copy_offset.py::test_call_data_copy_offset[fork_Amsterdam] stMemoryTest/test_calldatacopy_dejavu2.py::test_calldatacopy_dejavu2[fork_Amsterdam] stMemoryTest/test_code_copy_offset.py::test_code_copy_offset[fork_Amsterdam] @@ -675,11 +537,6 @@ stMemoryTest/test_mem64kb_single_byte_plus_32.py::test_mem64kb_single_byte_plus_ stMemoryTest/test_mem64kb_single_byte_plus_33.py::test_mem64kb_single_byte_plus_33[fork_Amsterdam] # stPreCompiledContracts2 (9) -stPreCompiledContracts2/test_call_ecrecover_overflow.py::test_call_ecrecover_overflow[fork_Amsterdam-fail0] -stPreCompiledContracts2/test_call_ecrecover_overflow.py::test_call_ecrecover_overflow[fork_Amsterdam-fail1] -stPreCompiledContracts2/test_call_ecrecover_overflow.py::test_call_ecrecover_overflow[fork_Amsterdam-fail2] -stPreCompiledContracts2/test_call_ecrecover_overflow.py::test_call_ecrecover_overflow[fork_Amsterdam-fail3] -stPreCompiledContracts2/test_call_ecrecover_overflow.py::test_call_ecrecover_overflow[fork_Amsterdam-fail4] stPreCompiledContracts2/test_modexp_0_0_0_20500.py::test_modexp_0_0_0_20500[fork_Amsterdam--g1] stPreCompiledContracts2/test_modexp_0_0_0_22000.py::test_modexp_0_0_0_22000[fork_Amsterdam--g1] stPreCompiledContracts2/test_modexp_0_0_0_25000.py::test_modexp_0_0_0_25000[fork_Amsterdam--g1] @@ -996,7 +853,7 @@ stSelfBalance/test_self_balance.py::test_self_balance[fork_Amsterdam] stSelfBalance/test_self_balance_equals_balance.py::test_self_balance_equals_balance[fork_Amsterdam] stSelfBalance/test_self_balance_gas_cost.py::test_self_balance_gas_cost[fork_Amsterdam] -# stSolidityTest (4) +# stSolidityTest (5) stSolidityTest/test_test_contract_interaction.py::test_test_contract_interaction[fork_Amsterdam] stSolidityTest/test_test_contract_suicide.py::test_test_contract_suicide[fork_Amsterdam] stSolidityTest/test_test_overflow.py::test_test_overflow[fork_Amsterdam] @@ -1071,7 +928,7 @@ stSystemOperationsTest/test_double_selfdestruct_touch_paris.py::test_double_self # stTransactionTest (1) stTransactionTest/test_opcodes_transaction_init.py::test_opcodes_transaction_init[fork_Amsterdam-side_effects] -# vmArithmeticTest (1) +# vmArithmeticTest (2) vmArithmeticTest/test_exp_power256_of256.py::test_exp_power256_of256[fork_Amsterdam] # ----------------------------------------------------------------------------- @@ -1082,7 +939,7 @@ vmArithmeticTest/test_exp_power256_of256.py::test_exp_power256_of256[fork_Amster # CPSB recalibration work. # ----------------------------------------------------------------------------- -# stCallCodes (6) +# stCallCodes (14) stCallCodes/test_callcallcallcode_001_suicide_end.py::test_callcallcallcode_001_suicide_end[fork_Amsterdam] stCallCodes/test_callcode_in_initcode_to_empty_contract.py::test_callcode_in_initcode_to_empty_contract[fork_Amsterdam-d0] stCallCodes/test_callcode_in_initcode_to_empty_contract.py::test_callcode_in_initcode_to_empty_contract[fork_Amsterdam-d1] @@ -1090,7 +947,7 @@ stCallCodes/test_callcode_in_initcode_to_existing_contract_with_value_transfer.p stCallCodes/test_callcodecallcallcode_101_suicide_end.py::test_callcodecallcallcode_101_suicide_end[fork_Amsterdam] stCallCodes/test_callcodecallcodecallcode_111_suicide_end.py::test_callcodecallcodecallcode_111_suicide_end[fork_Amsterdam] -# stCreate2 (18) +# stCreate2 (51) 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_DelegateCall_Refund_NoOoG] stCreate2/test_create2_suicide.py::test_create2_suicide[fork_Amsterdam-d3] @@ -1110,57 +967,35 @@ stCreate2/test_create2collision_selfdestructed_oog.py::test_create2collision_sel stCreate2/test_create2collision_selfdestructed_oog.py::test_create2collision_selfdestructed_oog[fork_Amsterdam-d2] stCreate2/test_create2no_cash.py::test_create2no_cash[fork_Amsterdam-d1] -# stCreateTest (4) +# stCreateTest (57) stCreateTest/test_create_collision_results.py::test_create_collision_results[fork_Amsterdam-d0] stCreateTest/test_create_collision_results.py::test_create_collision_results[fork_Amsterdam-d1] 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] -# stDelegatecallTestHomestead (1) +# stDelegatecallTestHomestead (7) stDelegatecallTestHomestead/test_delegatecall_emptycontract.py::test_delegatecall_emptycontract[fork_Amsterdam] -# stEIP2930 (22) -stEIP2930/test_storage_costs.py::test_storage_costs[fork_Amsterdam-declaredKeyDel] -stEIP2930/test_storage_costs.py::test_storage_costs[fork_Amsterdam-declaredKeyNOP0] -stEIP2930/test_storage_costs.py::test_storage_costs[fork_Amsterdam-declaredKeyNOP] -stEIP2930/test_storage_costs.py::test_storage_costs[fork_Amsterdam-declaredKeyRead] -stEIP2930/test_storage_costs.py::test_storage_costs[fork_Amsterdam-declaredKeyRead_postSLOAD] -stEIP2930/test_storage_costs.py::test_storage_costs[fork_Amsterdam-declaredKeyUpdate] -stEIP2930/test_storage_costs.py::test_storage_costs[fork_Amsterdam-undeclaredKeyDel0] -stEIP2930/test_storage_costs.py::test_storage_costs[fork_Amsterdam-undeclaredKeyDel1] -stEIP2930/test_storage_costs.py::test_storage_costs[fork_Amsterdam-undeclaredKeyDel2] -stEIP2930/test_storage_costs.py::test_storage_costs[fork_Amsterdam-undeclaredKeyNOP0_0] -stEIP2930/test_storage_costs.py::test_storage_costs[fork_Amsterdam-undeclaredKeyNOP0_1] -stEIP2930/test_storage_costs.py::test_storage_costs[fork_Amsterdam-undeclaredKeyNOP0_2] -stEIP2930/test_storage_costs.py::test_storage_costs[fork_Amsterdam-undeclaredKeyNOP1] -stEIP2930/test_storage_costs.py::test_storage_costs[fork_Amsterdam-undeclaredKeyNOP2] -stEIP2930/test_storage_costs.py::test_storage_costs[fork_Amsterdam-undeclaredKeyNOP3] -stEIP2930/test_storage_costs.py::test_storage_costs[fork_Amsterdam-undeclaredKeyRead0] -stEIP2930/test_storage_costs.py::test_storage_costs[fork_Amsterdam-undeclaredKeyRead1] -stEIP2930/test_storage_costs.py::test_storage_costs[fork_Amsterdam-undeclaredKeyRead2] -stEIP2930/test_storage_costs.py::test_storage_costs[fork_Amsterdam-undeclaredKeyRead_postSLOAD] -stEIP2930/test_storage_costs.py::test_storage_costs[fork_Amsterdam-undeclaredKeyUpdate0] -stEIP2930/test_storage_costs.py::test_storage_costs[fork_Amsterdam-undeclaredKeyUpdate1] -stEIP2930/test_storage_costs.py::test_storage_costs[fork_Amsterdam-undeclaredKeyUpdate2] - -# stEIP3855_push0 (5) +# stEIP2930 (0) + +# stEIP3855_push0 (7) stEIP3855_push0/test_push0.py::test_push0[fork_Amsterdam-1024_push0] stEIP3855_push0/test_push0.py::test_push0[fork_Amsterdam-jumpdest] stEIP3855_push0/test_push0.py::test_push0[fork_Amsterdam-single_push0] stEIP3855_push0/test_push0_gas2.py::test_push0_gas2[fork_Amsterdam-use_push0] stEIP3855_push0/test_push0_gas2.py::test_push0_gas2[fork_Amsterdam-use_push1_00] -# stPreCompiledContracts2 (5) +# stPreCompiledContracts2 (13) stPreCompiledContracts2/test_call_sha256_1_nonzero_value.py::test_call_sha256_1_nonzero_value[fork_Amsterdam] stPreCompiledContracts2/test_modexp_0_0_0_20500.py::test_modexp_0_0_0_20500[fork_Amsterdam--g2] stPreCompiledContracts2/test_modexp_0_0_0_22000.py::test_modexp_0_0_0_22000[fork_Amsterdam--g2] stPreCompiledContracts2/test_modexp_0_0_0_25000.py::test_modexp_0_0_0_25000[fork_Amsterdam--g2] stPreCompiledContracts2/test_modexp_0_0_0_35000.py::test_modexp_0_0_0_35000[fork_Amsterdam--g2] -# stRevertTest (1) +# stRevertTest (33) stRevertTest/test_revert_in_create_in_init_paris.py::test_revert_in_create_in_init_paris[fork_Amsterdam] -# stStaticCall (31) +# stStaticCall (81) stStaticCall/test_static_call_ask_more_gas_on_depth2_then_transaction_has.py::test_static_call_ask_more_gas_on_depth2_then_transaction_has[fork_Amsterdam-d0] stStaticCall/test_static_call_sha256_1_nonzero_value.py::test_static_call_sha256_1_nonzero_value[fork_Amsterdam] stStaticCall/test_static_call_value_inherit_from_call.py::test_static_call_value_inherit_from_call[fork_Amsterdam] @@ -1193,11 +1028,11 @@ stStaticCall/test_static_check_opcodes5.py::test_static_check_opcodes5[fork_Amst stStaticCall/test_static_check_opcodes5.py::test_static_check_opcodes5[fork_Amsterdam-d4-g1-v1] stStaticCall/test_static_create_empty_contract_and_call_it_0wei.py::test_static_create_empty_contract_and_call_it_0wei[fork_Amsterdam] -# stStaticFlagEnabled (2) +# stStaticFlagEnabled (6) stStaticFlagEnabled/test_callcode_to_precompile_from_called_contract.py::test_callcode_to_precompile_from_called_contract[fork_Amsterdam] stStaticFlagEnabled/test_callcode_to_precompile_from_transaction.py::test_callcode_to_precompile_from_transaction[fork_Amsterdam] -# stSystemOperationsTest (6) +# stSystemOperationsTest (14) stSystemOperationsTest/test_call_to_name_registrator0.py::test_call_to_name_registrator0[fork_Amsterdam] stSystemOperationsTest/test_call_to_name_registrator_address_too_big_right.py::test_call_to_name_registrator_address_too_big_right[fork_Amsterdam] stSystemOperationsTest/test_create_name_registrator.py::test_create_name_registrator[fork_Amsterdam] @@ -1205,7 +1040,7 @@ stSystemOperationsTest/test_create_name_registrator_zero_mem.py::test_create_nam stSystemOperationsTest/test_create_name_registrator_zero_mem2.py::test_create_name_registrator_zero_mem2[fork_Amsterdam] stSystemOperationsTest/test_create_name_registrator_zero_mem_expansion.py::test_create_name_registrator_zero_mem_expansion[fork_Amsterdam] -# stTransactionTest (17) +# stTransactionTest (21) stTransactionTest/test_no_src_account_create.py::test_no_src_account_create[fork_Amsterdam-d0-g1-v0] stTransactionTest/test_no_src_account_create.py::test_no_src_account_create[fork_Amsterdam-d0-g1-v1] stTransactionTest/test_no_src_account_create.py::test_no_src_account_create[fork_Amsterdam-d1-g1-v0] diff --git a/tests/ported_static/stCallCodes/test_callcall_00.py b/tests/ported_static/stCallCodes/test_callcall_00.py index b373855268..668dd94809 100644 --- a/tests/ported_static/stCallCodes/test_callcall_00.py +++ b/tests/ported_static/stCallCodes/test_callcall_00.py @@ -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 @@ -15,6 +25,7 @@ StateTestFiller, Transaction, ) +from execution_testing.forks import Fork from execution_testing.vm import Op REFERENCE_SPEC_GIT_PATH = "N/A" @@ -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) @@ -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, @@ -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, diff --git a/tests/ported_static/stCallCodes/test_callcallcall_000.py b/tests/ported_static/stCallCodes/test_callcallcall_000.py index e4289de543..1026e276d3 100644 --- a/tests/ported_static/stCallCodes/test_callcallcall_000.py +++ b/tests/ported_static/stCallCodes/test_callcallcall_000.py @@ -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 @@ -15,6 +25,7 @@ StateTestFiller, Transaction, ) +from execution_testing.forks import Fork from execution_testing.vm import Op REFERENCE_SPEC_GIT_PATH = "N/A" @@ -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) @@ -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, @@ -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, @@ -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, diff --git a/tests/ported_static/stCallCodes/test_callcallcallcode_001.py b/tests/ported_static/stCallCodes/test_callcallcallcode_001.py index ca7c0a3198..f1a4178583 100644 --- a/tests/ported_static/stCallCodes/test_callcallcallcode_001.py +++ b/tests/ported_static/stCallCodes/test_callcallcallcode_001.py @@ -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 @@ -15,6 +25,7 @@ StateTestFiller, Transaction, ) +from execution_testing.forks import Fork from execution_testing.vm import Op REFERENCE_SPEC_GIT_PATH = "N/A" @@ -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) @@ -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, @@ -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, @@ -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, diff --git a/tests/ported_static/stCallCodes/test_callcallcode_01.py b/tests/ported_static/stCallCodes/test_callcallcode_01.py index f57fa53ef1..08d4604648 100644 --- a/tests/ported_static/stCallCodes/test_callcallcode_01.py +++ b/tests/ported_static/stCallCodes/test_callcallcode_01.py @@ -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 @@ -15,6 +25,7 @@ StateTestFiller, Transaction, ) +from execution_testing.forks import Fork from execution_testing.vm import Op REFERENCE_SPEC_GIT_PATH = "N/A" @@ -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) @@ -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, @@ -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, diff --git a/tests/ported_static/stCallCodes/test_callcallcodecall_010.py b/tests/ported_static/stCallCodes/test_callcallcodecall_010.py index ba39016c1c..51ab4615cc 100644 --- a/tests/ported_static/stCallCodes/test_callcallcodecall_010.py +++ b/tests/ported_static/stCallCodes/test_callcallcodecall_010.py @@ -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 @@ -15,6 +25,7 @@ StateTestFiller, Transaction, ) +from execution_testing.forks import Fork from execution_testing.vm import Op REFERENCE_SPEC_GIT_PATH = "N/A" @@ -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) @@ -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, @@ -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, @@ -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, diff --git a/tests/ported_static/stCallCodes/test_callcallcodecallcode_011.py b/tests/ported_static/stCallCodes/test_callcallcodecallcode_011.py index f9b66fda98..dd5241029a 100644 --- a/tests/ported_static/stCallCodes/test_callcallcodecallcode_011.py +++ b/tests/ported_static/stCallCodes/test_callcallcodecallcode_011.py @@ -3,6 +3,16 @@ Ported from: state_tests/stCallCodes/callcallcodecallcode_011Filler.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 @@ -15,6 +25,7 @@ StateTestFiller, Transaction, ) +from execution_testing.forks import Fork from execution_testing.vm import Op REFERENCE_SPEC_GIT_PATH = "N/A" @@ -29,8 +40,20 @@ def test_callcallcodecallcode_011( state_test: StateTestFiller, pre: Alloc, + fork: Fork, ) -> None: """Call -> callcode -> callcode -> code, check params.""" + # 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) @@ -63,7 +86,7 @@ def test_callcallcodecallcode_011( code=Op.SSTORE( key=0x2, value=Op.CALLCODE( - gas=0x3D090, + gas=inner_call_gas, address=addr_3, value=0x3, args_offset=0x0, @@ -82,7 +105,7 @@ def test_callcallcodecallcode_011( code=Op.SSTORE( key=0x1, value=Op.CALLCODE( - gas=0x493E0, + gas=middle_call_gas, address=addr_2, value=0x2, args_offset=0x0, @@ -101,7 +124,7 @@ def test_callcallcodecallcode_011( code=Op.SSTORE( key=0x0, value=Op.CALL( - gas=0x55730, + gas=outer_call_gas, address=addr, value=0x1, args_offset=0x0, diff --git a/tests/ported_static/stCallCodes/test_callcode_dynamic_code.py b/tests/ported_static/stCallCodes/test_callcode_dynamic_code.py index b9d711740a..516596f089 100644 --- a/tests/ported_static/stCallCodes/test_callcode_dynamic_code.py +++ b/tests/ported_static/stCallCodes/test_callcode_dynamic_code.py @@ -3,6 +3,16 @@ Ported from: state_tests/stCallCodes/callcodeDynamicCodeFiller.json + + +@manually-enhanced: Do not overwrite. Hardcoded inner-CALL gas values +from the original filler (100k / 800k / 150k / 50k) were tuned to the +pre-EIP-8037 gas budget. On Amsterdam each SSTORE in the inner +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 with extra headroom; older forks are +unaffected because only the requested gas changes, the actual +consumption is identical. """ import pytest @@ -70,6 +80,15 @@ def test_callcode_dynamic_code( v: int, ) -> None: """Callcode to a contract that is being created in the same transaction.""" + # 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 = 0x186A0 + outer_call_gas = 0xC3500 + if fork.is_eip_enabled(8037): + inner_call_gas = 0x2DC6C0 + outer_call_gas = 0x4C4B40 + coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) contract_0 = Address(0x1100000000000000000000000000000000000000) contract_1 = Address(0x1000000000000000000000000000000000000000) @@ -86,7 +105,7 @@ def test_callcode_dynamic_code( timestamp=1000, prev_randao=0x20000, base_fee_per_gas=10, - gas_limit=1000000, + gas_limit=10000000, ) pre[sender] = Account(balance=0x2386F26FC10000) @@ -94,7 +113,7 @@ def test_callcode_dynamic_code( # { (CALL 800000 (CALLDATALOAD 0) 0 0 0 0 0) } contract_0 = pre.deploy_contract( # noqa: F841 code=Op.CALL( - gas=0xC3500, + gas=outer_call_gas, address=Op.CALLDATALOAD(offset=0x0), value=0x0, args_offset=0x0, @@ -116,7 +135,7 @@ def test_callcode_dynamic_code( + Op.SSTORE( key=0xB, value=Op.CALLCODE( - gas=0x186A0, + gas=inner_call_gas, address=Op.SLOAD(key=0xA), value=0x0, args_offset=0x0, @@ -153,7 +172,7 @@ def test_callcode_dynamic_code( + Op.SSTORE( key=0xB, value=Op.CALLCODE( - gas=0x186A0, + gas=inner_call_gas, address=Op.SLOAD(key=0xA), value=0x0, args_offset=0x0, @@ -195,7 +214,7 @@ def test_callcode_dynamic_code( + Op.SSTORE( key=0xB, value=Op.CALLCODE( - gas=0x186A0, + gas=inner_call_gas, address=Op.SLOAD(key=0xA), value=0x0, args_offset=0x0, @@ -238,7 +257,7 @@ def test_callcode_dynamic_code( + Op.SSTORE( key=0xB, value=Op.CALLCODE( - gas=0x186A0, + gas=inner_call_gas, address=Op.SLOAD(key=0xA), value=0x0, args_offset=0x0, @@ -356,7 +375,13 @@ def test_callcode_dynamic_code( Hash(contract_3, left_padding=True), Hash(contract_4, left_padding=True), ] - tx_gas = [1000000] + # d2/d3 parametrizations do double-nested CREATE chains; EIP-8037 + # NEW_ACCOUNT state-gas spill on Amsterdam exceeds the original + # 1 000 000 budget. + outer_tx_gas = 1_000_000 + if fork.is_eip_enabled(8037): + outer_tx_gas = 6_000_000 + tx_gas = [outer_tx_gas] tx = Transaction( sender=sender, diff --git a/tests/ported_static/stCallCodes/test_callcode_dynamic_code2_self_call.py b/tests/ported_static/stCallCodes/test_callcode_dynamic_code2_self_call.py index 258217d6fa..0f5363e7c6 100644 --- a/tests/ported_static/stCallCodes/test_callcode_dynamic_code2_self_call.py +++ b/tests/ported_static/stCallCodes/test_callcode_dynamic_code2_self_call.py @@ -3,6 +3,16 @@ Ported from: state_tests/stCallCodes/callcodeDynamicCode2SelfCallFiller.json + + +@manually-enhanced: Do not overwrite. Hardcoded inner-CALL gas values +from the original filler (100k / 800k / 150k / 50k) were tuned to the +pre-EIP-8037 gas budget. On Amsterdam each SSTORE in the inner +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 with extra headroom; older forks are +unaffected because only the requested gas changes, the actual +consumption is identical. """ import pytest @@ -58,6 +68,15 @@ def test_callcode_dynamic_code2_self_call( v: int, ) -> None: """Callcode happen to a contract that is dynamically created from...""" + # 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 = 0x186A0 + outer_call_gas = 0xC3500 + if fork.is_eip_enabled(8037): + inner_call_gas = 0xF4240 + outer_call_gas = 0x1E8480 + coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) contract_0 = Address(0x1100000000000000000000000000000000000000) contract_1 = Address(0xA000000000000000000000000000000000000000) @@ -80,7 +99,7 @@ def test_callcode_dynamic_code2_self_call( # { (CALL 800000 (CALLDATALOAD 0) 0 0 0 0 0) } contract_0 = pre.deploy_contract( # noqa: F841 code=Op.CALL( - gas=0xC3500, + gas=outer_call_gas, address=Op.CALLDATALOAD(offset=0x0), value=0x0, args_offset=0x0, @@ -119,7 +138,7 @@ def test_callcode_dynamic_code2_self_call( + Op.SSTORE( key=0xB, value=Op.CALLCODE( - gas=0x186A0, + gas=inner_call_gas, address=Op.SLOAD(key=0xA), value=0x0, args_offset=0x0, @@ -133,7 +152,7 @@ def test_callcode_dynamic_code2_self_call( + Op.SSTORE( key=0x7A, value=Op.CALLCODE( - gas=0x186A0, + gas=inner_call_gas, address=0x13136008B64FF592819B2FA6D43F2835C452020E, value=0x0, args_offset=0x0, diff --git a/tests/ported_static/stCallCodes/test_callcodecall_10.py b/tests/ported_static/stCallCodes/test_callcodecall_10.py index d35ec4f4c3..2e2a3bc2ae 100644 --- a/tests/ported_static/stCallCodes/test_callcodecall_10.py +++ b/tests/ported_static/stCallCodes/test_callcodecall_10.py @@ -3,6 +3,16 @@ Ported from: state_tests/stCallCodes/callcodecall_10Filler.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 @@ -15,6 +25,7 @@ StateTestFiller, Transaction, ) +from execution_testing.forks import Fork from execution_testing.vm import Op REFERENCE_SPEC_GIT_PATH = "N/A" @@ -29,8 +40,18 @@ def test_callcodecall_10( state_test: StateTestFiller, pre: Alloc, + fork: Fork, ) -> None: """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 + 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) @@ -63,7 +84,7 @@ def test_callcodecall_10( code=Op.SSTORE( key=0x1, value=Op.CALL( - gas=0x3D090, + gas=inner_call_gas, address=addr_2, value=0x2, args_offset=0x0, @@ -82,7 +103,7 @@ def test_callcodecall_10( code=Op.SSTORE( key=0x0, value=Op.CALLCODE( - gas=0x55730, + gas=outer_call_gas, address=addr, value=0x1, args_offset=0x0, diff --git a/tests/ported_static/stCallCodes/test_callcodecallcall_100.py b/tests/ported_static/stCallCodes/test_callcodecallcall_100.py index ae6e5485b2..7d15c2b1f8 100644 --- a/tests/ported_static/stCallCodes/test_callcodecallcall_100.py +++ b/tests/ported_static/stCallCodes/test_callcodecallcall_100.py @@ -3,6 +3,16 @@ Ported from: state_tests/stCallCodes/callcodecallcall_100Filler.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 @@ -15,6 +25,7 @@ StateTestFiller, Transaction, ) +from execution_testing.forks import Fork from execution_testing.vm import Op REFERENCE_SPEC_GIT_PATH = "N/A" @@ -29,8 +40,20 @@ def test_callcodecallcall_100( state_test: StateTestFiller, pre: Alloc, + fork: Fork, ) -> None: """CALLCODE -> 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) @@ -63,7 +86,7 @@ def test_callcodecallcall_100( code=Op.SSTORE( key=0x2, value=Op.CALL( - gas=0x3D090, + gas=inner_call_gas, address=addr_3, value=0x3, args_offset=0x0, @@ -82,7 +105,7 @@ def test_callcodecallcall_100( code=Op.SSTORE( key=0x1, value=Op.CALL( - gas=0x493E0, + gas=middle_call_gas, address=addr_2, value=0x2, args_offset=0x0, @@ -101,7 +124,7 @@ def test_callcodecallcall_100( code=Op.SSTORE( key=0x0, value=Op.CALLCODE( - gas=0x55730, + gas=outer_call_gas, address=addr, value=0x1, args_offset=0x0, diff --git a/tests/ported_static/stCallCodes/test_callcodecallcallcode_101.py b/tests/ported_static/stCallCodes/test_callcodecallcallcode_101.py index ed62019847..ef876653da 100644 --- a/tests/ported_static/stCallCodes/test_callcodecallcallcode_101.py +++ b/tests/ported_static/stCallCodes/test_callcodecallcallcode_101.py @@ -3,6 +3,16 @@ Ported from: state_tests/stCallCodes/callcodecallcallcode_101Filler.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 @@ -15,6 +25,7 @@ StateTestFiller, Transaction, ) +from execution_testing.forks import Fork from execution_testing.vm import Op REFERENCE_SPEC_GIT_PATH = "N/A" @@ -29,8 +40,20 @@ def test_callcodecallcallcode_101( state_test: StateTestFiller, pre: Alloc, + fork: Fork, ) -> None: """CALLCODE -> CALL -> CALLCODE -> code parameters 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) @@ -63,7 +86,7 @@ def test_callcodecallcallcode_101( code=Op.SSTORE( key=0x2, value=Op.CALLCODE( - gas=0x3D090, + gas=inner_call_gas, address=addr_3, value=0x3, args_offset=0x0, @@ -82,7 +105,7 @@ def test_callcodecallcallcode_101( code=Op.SSTORE( key=0x1, value=Op.CALL( - gas=0x493E0, + gas=middle_call_gas, address=addr_2, value=0x2, args_offset=0x0, @@ -101,7 +124,7 @@ def test_callcodecallcallcode_101( code=Op.SSTORE( key=0x0, value=Op.CALLCODE( - gas=0x55730, + gas=outer_call_gas, address=addr, value=0x1, args_offset=0x0, diff --git a/tests/ported_static/stCallCodes/test_callcodecallcode_11.py b/tests/ported_static/stCallCodes/test_callcodecallcode_11.py index ae4f560154..8383a42511 100644 --- a/tests/ported_static/stCallCodes/test_callcodecallcode_11.py +++ b/tests/ported_static/stCallCodes/test_callcodecallcode_11.py @@ -3,6 +3,16 @@ Ported from: state_tests/stCallCodes/callcodecallcode_11Filler.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 @@ -15,6 +25,7 @@ StateTestFiller, Transaction, ) +from execution_testing.forks import Fork from execution_testing.vm import Op REFERENCE_SPEC_GIT_PATH = "N/A" @@ -29,8 +40,18 @@ def test_callcodecallcode_11( state_test: StateTestFiller, pre: Alloc, + fork: Fork, ) -> None: """CALLCODE -> CALLCODE -> code, check parameters.""" + # 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) @@ -63,7 +84,7 @@ def test_callcodecallcode_11( code=Op.SSTORE( key=0x1, value=Op.CALLCODE( - gas=0x3D090, + gas=inner_call_gas, address=addr_2, value=0x2, args_offset=0x0, @@ -82,7 +103,7 @@ def test_callcodecallcode_11( code=Op.SSTORE( key=0x0, value=Op.CALLCODE( - gas=0x55730, + gas=outer_call_gas, address=addr, value=0x1, args_offset=0x0, diff --git a/tests/ported_static/stCallCodes/test_callcodecallcodecall_110.py b/tests/ported_static/stCallCodes/test_callcodecallcodecall_110.py index 554208349a..5c057849d0 100644 --- a/tests/ported_static/stCallCodes/test_callcodecallcodecall_110.py +++ b/tests/ported_static/stCallCodes/test_callcodecallcodecall_110.py @@ -3,6 +3,16 @@ Ported from: state_tests/stCallCodes/callcodecallcodecall_110Filler.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 @@ -15,6 +25,7 @@ StateTestFiller, Transaction, ) +from execution_testing.forks import Fork from execution_testing.vm import Op REFERENCE_SPEC_GIT_PATH = "N/A" @@ -29,8 +40,20 @@ def test_callcodecallcodecall_110( state_test: StateTestFiller, pre: Alloc, + fork: Fork, ) -> None: """CALLCODE -> CALLCODE -> CALL -> code, check parameters.""" + # 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) @@ -63,7 +86,7 @@ def test_callcodecallcodecall_110( code=Op.SSTORE( key=0x2, value=Op.CALL( - gas=0x3D090, + gas=inner_call_gas, address=addr_3, value=0x3, args_offset=0x0, @@ -82,7 +105,7 @@ def test_callcodecallcodecall_110( code=Op.SSTORE( key=0x1, value=Op.CALLCODE( - gas=0x493E0, + gas=middle_call_gas, address=addr_2, value=0x2, args_offset=0x0, @@ -101,7 +124,7 @@ def test_callcodecallcodecall_110( code=Op.SSTORE( key=0x0, value=Op.CALLCODE( - gas=0x55730, + gas=outer_call_gas, address=addr, value=0x1, args_offset=0x0, diff --git a/tests/ported_static/stCallCodes/test_callcodecallcodecallcode_111.py b/tests/ported_static/stCallCodes/test_callcodecallcodecallcode_111.py index 3eecfb1455..397d7fff51 100644 --- a/tests/ported_static/stCallCodes/test_callcodecallcodecallcode_111.py +++ b/tests/ported_static/stCallCodes/test_callcodecallcodecallcode_111.py @@ -3,6 +3,16 @@ Ported from: state_tests/stCallCodes/callcodecallcodecallcode_111Filler.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 @@ -15,6 +25,7 @@ StateTestFiller, Transaction, ) +from execution_testing.forks import Fork from execution_testing.vm import Op REFERENCE_SPEC_GIT_PATH = "N/A" @@ -29,8 +40,20 @@ def test_callcodecallcodecallcode_111( state_test: StateTestFiller, pre: Alloc, + fork: Fork, ) -> None: """CALLCODE -> CALLCODE -> CALLCODE -> code check parameter opcodes.""" + # 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) @@ -63,7 +86,7 @@ def test_callcodecallcodecallcode_111( code=Op.SSTORE( key=0x2, value=Op.CALLCODE( - gas=0x3D090, + gas=inner_call_gas, address=addr_3, value=0x3, args_offset=0x0, @@ -82,7 +105,7 @@ def test_callcodecallcodecallcode_111( code=Op.SSTORE( key=0x1, value=Op.CALLCODE( - gas=0x493E0, + gas=middle_call_gas, address=addr_2, value=0x2, args_offset=0x0, @@ -101,7 +124,7 @@ def test_callcodecallcodecallcode_111( code=Op.SSTORE( key=0x0, value=Op.CALLCODE( - gas=0x55730, + gas=outer_call_gas, address=addr, value=0x1, args_offset=0x0, diff --git a/tests/ported_static/stCallDelegateCodesCallCodeHomestead/test_callcallcallcode_001.py b/tests/ported_static/stCallDelegateCodesCallCodeHomestead/test_callcallcallcode_001.py index 34843e7be6..17ac54a792 100644 --- a/tests/ported_static/stCallDelegateCodesCallCodeHomestead/test_callcallcallcode_001.py +++ b/tests/ported_static/stCallDelegateCodesCallCodeHomestead/test_callcallcallcode_001.py @@ -3,6 +3,16 @@ Ported from: state_tests/stCallDelegateCodesCallCodeHomestead/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 @@ -15,6 +25,7 @@ StateTestFiller, Transaction, ) +from execution_testing.forks import Fork from execution_testing.vm import Op REFERENCE_SPEC_GIT_PATH = "N/A" @@ -31,8 +42,20 @@ def test_callcallcallcode_001( state_test: StateTestFiller, pre: Alloc, + fork: Fork, ) -> None: """Test_callcallcallcode_001.""" + # 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) @@ -65,7 +88,7 @@ def test_callcallcallcode_001( code=Op.SSTORE( key=0x2, value=Op.DELEGATECALL( - gas=0x3D090, + gas=inner_call_gas, address=addr_3, args_offset=0x0, args_size=0x40, @@ -83,7 +106,7 @@ def test_callcallcallcode_001( code=Op.SSTORE( key=0x1, value=Op.CALLCODE( - gas=0x493E0, + gas=middle_call_gas, address=addr_2, value=0x2, args_offset=0x0, @@ -102,7 +125,7 @@ def test_callcallcallcode_001( code=Op.SSTORE( key=0x0, value=Op.CALLCODE( - gas=0x55730, + gas=outer_call_gas, address=addr, value=0x1, args_offset=0x0, diff --git a/tests/ported_static/stCallDelegateCodesCallCodeHomestead/test_callcallcode_01.py b/tests/ported_static/stCallDelegateCodesCallCodeHomestead/test_callcallcode_01.py index 6228135964..4ec0e0470d 100644 --- a/tests/ported_static/stCallDelegateCodesCallCodeHomestead/test_callcallcode_01.py +++ b/tests/ported_static/stCallDelegateCodesCallCodeHomestead/test_callcallcode_01.py @@ -3,6 +3,16 @@ Ported from: state_tests/stCallDelegateCodesCallCodeHomestead/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 @@ -15,6 +25,7 @@ StateTestFiller, Transaction, ) +from execution_testing.forks import Fork from execution_testing.vm import Op REFERENCE_SPEC_GIT_PATH = "N/A" @@ -31,8 +42,18 @@ def test_callcallcode_01( state_test: StateTestFiller, pre: Alloc, + fork: Fork, ) -> None: """Test_callcallcode_01.""" + # 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) @@ -65,7 +86,7 @@ def test_callcallcode_01( code=Op.SSTORE( key=0x1, value=Op.DELEGATECALL( - gas=0x3D090, + gas=inner_call_gas, address=addr_2, args_offset=0x0, args_size=0x40, @@ -83,7 +104,7 @@ def test_callcallcode_01( code=Op.SSTORE( key=0x0, value=Op.CALLCODE( - gas=0x55730, + gas=outer_call_gas, address=addr, value=0x1, args_offset=0x0, diff --git a/tests/ported_static/stCallDelegateCodesCallCodeHomestead/test_callcallcodecall_010.py b/tests/ported_static/stCallDelegateCodesCallCodeHomestead/test_callcallcodecall_010.py index 1b71c97c2c..58e1eef442 100644 --- a/tests/ported_static/stCallDelegateCodesCallCodeHomestead/test_callcallcodecall_010.py +++ b/tests/ported_static/stCallDelegateCodesCallCodeHomestead/test_callcallcodecall_010.py @@ -3,6 +3,16 @@ Ported from: state_tests/stCallDelegateCodesCallCodeHomestead/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 @@ -15,6 +25,7 @@ StateTestFiller, Transaction, ) +from execution_testing.forks import Fork from execution_testing.vm import Op REFERENCE_SPEC_GIT_PATH = "N/A" @@ -31,8 +42,20 @@ def test_callcallcodecall_010( state_test: StateTestFiller, pre: Alloc, + fork: Fork, ) -> None: """Test_callcallcodecall_010.""" + # 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) @@ -65,7 +88,7 @@ def test_callcallcodecall_010( code=Op.SSTORE( key=0x2, value=Op.CALLCODE( - gas=0x3D090, + gas=inner_call_gas, address=addr_3, value=0x2, args_offset=0x0, @@ -85,7 +108,7 @@ def test_callcallcodecall_010( code=Op.SSTORE( key=0x1, value=Op.DELEGATECALL( - gas=0x493E0, + gas=middle_call_gas, address=addr_2, args_offset=0x0, args_size=0x40, @@ -103,7 +126,7 @@ def test_callcallcodecall_010( code=Op.SSTORE( key=0x0, value=Op.CALLCODE( - gas=0x55730, + gas=outer_call_gas, address=addr, value=0x1, args_offset=0x0, diff --git a/tests/ported_static/stCallDelegateCodesCallCodeHomestead/test_callcallcodecallcode_011.py b/tests/ported_static/stCallDelegateCodesCallCodeHomestead/test_callcallcodecallcode_011.py index 48ad74e3fd..fb05c8d060 100644 --- a/tests/ported_static/stCallDelegateCodesCallCodeHomestead/test_callcallcodecallcode_011.py +++ b/tests/ported_static/stCallDelegateCodesCallCodeHomestead/test_callcallcodecallcode_011.py @@ -3,6 +3,16 @@ Ported from: state_tests/stCallDelegateCodesCallCodeHomestead/callcallcodecallcode_011Filler.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 @@ -15,6 +25,7 @@ StateTestFiller, Transaction, ) +from execution_testing.forks import Fork from execution_testing.vm import Op REFERENCE_SPEC_GIT_PATH = "N/A" @@ -31,8 +42,20 @@ def test_callcallcodecallcode_011( state_test: StateTestFiller, pre: Alloc, + fork: Fork, ) -> None: """Test_callcallcodecallcode_011.""" + # 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) @@ -65,7 +88,7 @@ def test_callcallcodecallcode_011( code=Op.SSTORE( key=0x2, value=Op.DELEGATECALL( - gas=0x30D40, + gas=inner_call_gas, address=addr_3, args_offset=0x0, args_size=0x40, @@ -82,7 +105,7 @@ def test_callcallcodecallcode_011( code=Op.SSTORE( key=0x1, value=Op.DELEGATECALL( - gas=0x493E0, + gas=middle_call_gas, address=addr_2, args_offset=0x0, args_size=0x40, @@ -99,7 +122,7 @@ def test_callcallcodecallcode_011( code=Op.SSTORE( key=0x0, value=Op.CALLCODE( - gas=0x55730, + gas=outer_call_gas, address=addr, value=0x1, args_offset=0x0, diff --git a/tests/ported_static/stCallDelegateCodesCallCodeHomestead/test_callcodecall_10.py b/tests/ported_static/stCallDelegateCodesCallCodeHomestead/test_callcodecall_10.py index 89451d3841..85607a610a 100644 --- a/tests/ported_static/stCallDelegateCodesCallCodeHomestead/test_callcodecall_10.py +++ b/tests/ported_static/stCallDelegateCodesCallCodeHomestead/test_callcodecall_10.py @@ -3,6 +3,16 @@ Ported from: state_tests/stCallDelegateCodesCallCodeHomestead/callcodecall_10Filler.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 @@ -15,6 +25,7 @@ StateTestFiller, Transaction, ) +from execution_testing.forks import Fork from execution_testing.vm import Op REFERENCE_SPEC_GIT_PATH = "N/A" @@ -31,8 +42,18 @@ def test_callcodecall_10( state_test: StateTestFiller, pre: Alloc, + fork: Fork, ) -> None: """Test_callcodecall_10.""" + # 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) @@ -65,7 +86,7 @@ def test_callcodecall_10( code=Op.SSTORE( key=0x1, value=Op.CALLCODE( - gas=0x3D090, + gas=inner_call_gas, address=addr_2, value=0x2, args_offset=0x0, @@ -84,7 +105,7 @@ def test_callcodecall_10( code=Op.SSTORE( key=0x0, value=Op.DELEGATECALL( - gas=0x55730, + gas=outer_call_gas, address=addr, args_offset=0x0, args_size=0x40, diff --git a/tests/ported_static/stCallDelegateCodesCallCodeHomestead/test_callcodecallcall_100.py b/tests/ported_static/stCallDelegateCodesCallCodeHomestead/test_callcodecallcall_100.py index 571626d265..b6072d270e 100644 --- a/tests/ported_static/stCallDelegateCodesCallCodeHomestead/test_callcodecallcall_100.py +++ b/tests/ported_static/stCallDelegateCodesCallCodeHomestead/test_callcodecallcall_100.py @@ -3,6 +3,16 @@ Ported from: state_tests/stCallDelegateCodesCallCodeHomestead/callcodecallcall_100Filler.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 @@ -15,6 +25,7 @@ StateTestFiller, Transaction, ) +from execution_testing.forks import Fork from execution_testing.vm import Op REFERENCE_SPEC_GIT_PATH = "N/A" @@ -31,8 +42,20 @@ def test_callcodecallcall_100( state_test: StateTestFiller, pre: Alloc, + fork: Fork, ) -> None: """Test_callcodecallcall_100.""" + # 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) @@ -65,7 +88,7 @@ def test_callcodecallcall_100( code=Op.SSTORE( key=0x2, value=Op.CALLCODE( - gas=0x3D090, + gas=inner_call_gas, address=addr_3, value=0x2, args_offset=0x0, @@ -84,7 +107,7 @@ def test_callcodecallcall_100( code=Op.SSTORE( key=0x1, value=Op.CALLCODE( - gas=0x493E0, + gas=middle_call_gas, address=addr_2, value=0x1, args_offset=0x0, @@ -104,7 +127,7 @@ def test_callcodecallcall_100( code=Op.SSTORE( key=0x0, value=Op.DELEGATECALL( - gas=0x55730, + gas=outer_call_gas, address=addr, args_offset=0x0, args_size=0x40, diff --git a/tests/ported_static/stCallDelegateCodesCallCodeHomestead/test_callcodecallcallcode_101.py b/tests/ported_static/stCallDelegateCodesCallCodeHomestead/test_callcodecallcallcode_101.py index 9104aa608e..f85f6c39c2 100644 --- a/tests/ported_static/stCallDelegateCodesCallCodeHomestead/test_callcodecallcallcode_101.py +++ b/tests/ported_static/stCallDelegateCodesCallCodeHomestead/test_callcodecallcallcode_101.py @@ -3,6 +3,16 @@ Ported from: state_tests/stCallDelegateCodesCallCodeHomestead/callcodecallcallcode_101Filler.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 @@ -15,6 +25,7 @@ StateTestFiller, Transaction, ) +from execution_testing.forks import Fork from execution_testing.vm import Op REFERENCE_SPEC_GIT_PATH = "N/A" @@ -31,8 +42,20 @@ def test_callcodecallcallcode_101( state_test: StateTestFiller, pre: Alloc, + fork: Fork, ) -> None: """Test_callcodecallcallcode_101.""" + # 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) @@ -65,7 +88,7 @@ def test_callcodecallcallcode_101( code=Op.SSTORE( key=0x2, value=Op.DELEGATECALL( - gas=0x3D090, + gas=inner_call_gas, address=addr_3, args_offset=0x0, args_size=0x40, @@ -84,7 +107,7 @@ def test_callcodecallcallcode_101( code=Op.SSTORE( key=0x1, value=Op.CALLCODE( - gas=0x493E0, + gas=middle_call_gas, address=addr_2, value=0x1, args_offset=0x0, @@ -104,7 +127,7 @@ def test_callcodecallcallcode_101( code=Op.SSTORE( key=0x0, value=Op.DELEGATECALL( - gas=0x55730, + gas=outer_call_gas, address=addr, args_offset=0x0, args_size=0x40, diff --git a/tests/ported_static/stCallDelegateCodesCallCodeHomestead/test_callcodecallcode_11.py b/tests/ported_static/stCallDelegateCodesCallCodeHomestead/test_callcodecallcode_11.py index b9187af14a..9e2c24e09e 100644 --- a/tests/ported_static/stCallDelegateCodesCallCodeHomestead/test_callcodecallcode_11.py +++ b/tests/ported_static/stCallDelegateCodesCallCodeHomestead/test_callcodecallcode_11.py @@ -3,6 +3,16 @@ Ported from: state_tests/stCallDelegateCodesCallCodeHomestead/callcodecallcode_11Filler.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 @@ -15,6 +25,7 @@ StateTestFiller, Transaction, ) +from execution_testing.forks import Fork from execution_testing.vm import Op REFERENCE_SPEC_GIT_PATH = "N/A" @@ -31,8 +42,18 @@ def test_callcodecallcode_11( state_test: StateTestFiller, pre: Alloc, + fork: Fork, ) -> None: """Test_callcodecallcode_11.""" + # 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) @@ -65,7 +86,7 @@ def test_callcodecallcode_11( code=Op.SSTORE( key=0x1, value=Op.DELEGATECALL( - gas=0x3D090, + gas=inner_call_gas, address=addr_2, args_offset=0x0, args_size=0x40, @@ -82,7 +103,7 @@ def test_callcodecallcode_11( code=Op.SSTORE( key=0x0, value=Op.DELEGATECALL( - gas=0x55730, + gas=outer_call_gas, address=addr, args_offset=0x0, args_size=0x40, diff --git a/tests/ported_static/stCallDelegateCodesCallCodeHomestead/test_callcodecallcodecall_110.py b/tests/ported_static/stCallDelegateCodesCallCodeHomestead/test_callcodecallcodecall_110.py index 7329364f7f..32061749e5 100644 --- a/tests/ported_static/stCallDelegateCodesCallCodeHomestead/test_callcodecallcodecall_110.py +++ b/tests/ported_static/stCallDelegateCodesCallCodeHomestead/test_callcodecallcodecall_110.py @@ -3,6 +3,16 @@ Ported from: state_tests/stCallDelegateCodesCallCodeHomestead/callcodecallcodecall_110Filler.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 @@ -15,6 +25,7 @@ StateTestFiller, Transaction, ) +from execution_testing.forks import Fork from execution_testing.vm import Op REFERENCE_SPEC_GIT_PATH = "N/A" @@ -31,8 +42,20 @@ def test_callcodecallcodecall_110( state_test: StateTestFiller, pre: Alloc, + fork: Fork, ) -> None: """Test_callcodecallcodecall_110.""" + # 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) @@ -65,7 +88,7 @@ def test_callcodecallcodecall_110( code=Op.SSTORE( key=0x2, value=Op.CALLCODE( - gas=0x3D090, + gas=inner_call_gas, address=addr_3, value=0x1, args_offset=0x0, @@ -85,7 +108,7 @@ def test_callcodecallcodecall_110( code=Op.SSTORE( key=0x1, value=Op.DELEGATECALL( - gas=0x493E0, + gas=middle_call_gas, address=addr_2, args_offset=0x0, args_size=0x40, @@ -104,7 +127,7 @@ def test_callcodecallcodecall_110( code=Op.SSTORE( key=0x0, value=Op.DELEGATECALL( - gas=0x55730, + gas=outer_call_gas, address=addr, args_offset=0x0, args_size=0x40, diff --git a/tests/ported_static/stCallDelegateCodesCallCodeHomestead/test_callcodecallcodecallcode_111.py b/tests/ported_static/stCallDelegateCodesCallCodeHomestead/test_callcodecallcodecallcode_111.py index 4c12782ba7..284d284ade 100644 --- a/tests/ported_static/stCallDelegateCodesCallCodeHomestead/test_callcodecallcodecallcode_111.py +++ b/tests/ported_static/stCallDelegateCodesCallCodeHomestead/test_callcodecallcodecallcode_111.py @@ -3,6 +3,16 @@ Ported from: state_tests/stCallDelegateCodesCallCodeHomestead/callcodecallcodecallcode_111Filler.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 @@ -15,6 +25,7 @@ StateTestFiller, Transaction, ) +from execution_testing.forks import Fork from execution_testing.vm import Op REFERENCE_SPEC_GIT_PATH = "N/A" @@ -31,8 +42,20 @@ def test_callcodecallcodecallcode_111( state_test: StateTestFiller, pre: Alloc, + fork: Fork, ) -> None: """Test_callcodecallcodecallcode_111.""" + # 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) @@ -65,7 +88,7 @@ def test_callcodecallcodecallcode_111( code=Op.SSTORE( key=0x2, value=Op.DELEGATECALL( - gas=0x3D090, + gas=inner_call_gas, address=addr_3, args_offset=0x0, args_size=0x40, @@ -82,7 +105,7 @@ def test_callcodecallcodecallcode_111( code=Op.SSTORE( key=0x1, value=Op.DELEGATECALL( - gas=0x493E0, + gas=middle_call_gas, address=addr_2, args_offset=0x0, args_size=0x40, @@ -99,7 +122,7 @@ def test_callcodecallcodecallcode_111( code=Op.SSTORE( key=0x0, value=Op.DELEGATECALL( - gas=0x55730, + gas=outer_call_gas, address=addr, args_offset=0x0, args_size=0x40, diff --git a/tests/ported_static/stCallDelegateCodesCallCodeHomestead/test_callcodecallcodecallcode_111_suicide_end.py b/tests/ported_static/stCallDelegateCodesCallCodeHomestead/test_callcodecallcodecallcode_111_suicide_end.py index de51b0fb32..d47d3c95ed 100644 --- a/tests/ported_static/stCallDelegateCodesCallCodeHomestead/test_callcodecallcodecallcode_111_suicide_end.py +++ b/tests/ported_static/stCallDelegateCodesCallCodeHomestead/test_callcodecallcodecallcode_111_suicide_end.py @@ -3,6 +3,16 @@ Ported from: state_tests/stCallDelegateCodesCallCodeHomestead/callcodecallcodecallcode_111_SuicideEndFiller.json + + +@manually-enhanced: Do not overwrite. Hardcoded inner-CALL gas values +from the original filler (100k / 800k / 150k / 50k) were tuned to the +pre-EIP-8037 gas budget. On Amsterdam each SSTORE in the inner +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 with extra headroom; older forks are +unaffected because only the requested gas changes, the actual +consumption is identical. """ import pytest @@ -15,6 +25,7 @@ StateTestFiller, Transaction, ) +from execution_testing.forks import Fork from execution_testing.vm import Op REFERENCE_SPEC_GIT_PATH = "N/A" @@ -31,8 +42,20 @@ def test_callcodecallcodecallcode_111_suicide_end( state_test: StateTestFiller, pre: Alloc, + fork: Fork, ) -> None: """Test_callcodecallcodecallcode_111_suicide_end.""" + # 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 = 0x186A0 + middle_call_gas = 0x249F0 + inner_call_gas_b = 0xC350 + if fork.is_eip_enabled(8037): + inner_call_gas = 0x1E8480 + middle_call_gas = 0x1E8480 + inner_call_gas_b = 0x1E8480 + coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) sender = pre.fund_eoa(amount=0xDE0B6B3A7640000) @@ -59,7 +82,7 @@ def test_callcodecallcodecallcode_111_suicide_end( code=Op.SSTORE( key=0x0, value=Op.DELEGATECALL( - gas=0x249F0, + gas=middle_call_gas, address=0x9CFF7A3C9C90A301C47982DC2C4399C93700F0FD, args_offset=0x0, args_size=0x40, @@ -78,7 +101,7 @@ def test_callcodecallcodecallcode_111_suicide_end( code=Op.SSTORE( key=0x1, value=Op.CALL( - gas=0x186A0, + gas=inner_call_gas, address=0xB207980945728D64A3C9F905932314C8F130EE38, value=0x1, args_offset=0x0, @@ -98,7 +121,7 @@ def test_callcodecallcodecallcode_111_suicide_end( code=Op.SSTORE( key=0x2, value=Op.CALLCODE( - gas=0xC350, + gas=inner_call_gas_b, address=0x73B954EBC05BB0FF4A0F6A13A054D50AD1584099, value=0x2, args_offset=0x0, diff --git a/tests/ported_static/stCallDelegateCodesHomestead/test_callcallcallcode_001.py b/tests/ported_static/stCallDelegateCodesHomestead/test_callcallcallcode_001.py index 521fce6999..c848128015 100644 --- a/tests/ported_static/stCallDelegateCodesHomestead/test_callcallcallcode_001.py +++ b/tests/ported_static/stCallDelegateCodesHomestead/test_callcallcallcode_001.py @@ -3,6 +3,16 @@ Ported from: state_tests/stCallDelegateCodesHomestead/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 @@ -15,6 +25,7 @@ StateTestFiller, Transaction, ) +from execution_testing.forks import Fork from execution_testing.vm import Op REFERENCE_SPEC_GIT_PATH = "N/A" @@ -31,8 +42,20 @@ def test_callcallcallcode_001( state_test: StateTestFiller, pre: Alloc, + fork: Fork, ) -> None: """Test_callcallcallcode_001.""" + # 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) @@ -65,7 +88,7 @@ def test_callcallcallcode_001( code=Op.SSTORE( key=0x2, value=Op.DELEGATECALL( - gas=0x3D090, + gas=inner_call_gas, address=addr_3, args_offset=0x0, args_size=0x40, @@ -83,7 +106,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, @@ -102,7 +125,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, diff --git a/tests/ported_static/stCallDelegateCodesHomestead/test_callcallcode_01.py b/tests/ported_static/stCallDelegateCodesHomestead/test_callcallcode_01.py index b507415274..539d0d35cd 100644 --- a/tests/ported_static/stCallDelegateCodesHomestead/test_callcallcode_01.py +++ b/tests/ported_static/stCallDelegateCodesHomestead/test_callcallcode_01.py @@ -3,6 +3,16 @@ Ported from: state_tests/stCallDelegateCodesHomestead/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 @@ -15,6 +25,7 @@ StateTestFiller, Transaction, ) +from execution_testing.forks import Fork from execution_testing.vm import Op REFERENCE_SPEC_GIT_PATH = "N/A" @@ -29,8 +40,18 @@ def test_callcallcode_01( state_test: StateTestFiller, pre: Alloc, + fork: Fork, ) -> None: """Test_callcallcode_01.""" + # 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) @@ -63,7 +84,7 @@ def test_callcallcode_01( code=Op.SSTORE( key=0x1, value=Op.DELEGATECALL( - gas=0x3D090, + gas=inner_call_gas, address=addr_2, args_offset=0x0, args_size=0x40, @@ -80,7 +101,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, diff --git a/tests/ported_static/stCallDelegateCodesHomestead/test_callcallcodecall_010.py b/tests/ported_static/stCallDelegateCodesHomestead/test_callcallcodecall_010.py index 2887e55659..e62a62820a 100644 --- a/tests/ported_static/stCallDelegateCodesHomestead/test_callcallcodecall_010.py +++ b/tests/ported_static/stCallDelegateCodesHomestead/test_callcallcodecall_010.py @@ -3,6 +3,16 @@ Ported from: state_tests/stCallDelegateCodesHomestead/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 @@ -15,6 +25,7 @@ StateTestFiller, Transaction, ) +from execution_testing.forks import Fork from execution_testing.vm import Op REFERENCE_SPEC_GIT_PATH = "N/A" @@ -31,8 +42,20 @@ def test_callcallcodecall_010( state_test: StateTestFiller, pre: Alloc, + fork: Fork, ) -> None: """Test_callcallcodecall_010.""" + # 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) @@ -65,7 +88,7 @@ def test_callcallcodecall_010( code=Op.SSTORE( key=0x2, value=Op.CALL( - gas=0x3D090, + gas=inner_call_gas, address=addr_3, value=0x2, args_offset=0x0, @@ -85,7 +108,7 @@ def test_callcallcodecall_010( code=Op.SSTORE( key=0x1, value=Op.DELEGATECALL( - gas=0x493E0, + gas=middle_call_gas, address=addr_2, args_offset=0x0, args_size=0x40, @@ -103,7 +126,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, diff --git a/tests/ported_static/stCallDelegateCodesHomestead/test_callcallcodecallcode_011.py b/tests/ported_static/stCallDelegateCodesHomestead/test_callcallcodecallcode_011.py index 2230e5e131..d41418e40d 100644 --- a/tests/ported_static/stCallDelegateCodesHomestead/test_callcallcodecallcode_011.py +++ b/tests/ported_static/stCallDelegateCodesHomestead/test_callcallcodecallcode_011.py @@ -3,6 +3,16 @@ Ported from: state_tests/stCallDelegateCodesHomestead/callcallcodecallcode_011Filler.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 @@ -15,6 +25,7 @@ StateTestFiller, Transaction, ) +from execution_testing.forks import Fork from execution_testing.vm import Op REFERENCE_SPEC_GIT_PATH = "N/A" @@ -31,8 +42,20 @@ def test_callcallcodecallcode_011( state_test: StateTestFiller, pre: Alloc, + fork: Fork, ) -> None: """Test_callcallcodecallcode_011.""" + # 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) @@ -65,7 +88,7 @@ def test_callcallcodecallcode_011( code=Op.SSTORE( key=0x2, value=Op.DELEGATECALL( - gas=0x3D090, + gas=inner_call_gas, address=addr_3, args_offset=0x0, args_size=0x40, @@ -83,7 +106,7 @@ def test_callcallcodecallcode_011( code=Op.SSTORE( key=0x1, value=Op.DELEGATECALL( - gas=0x493E0, + gas=middle_call_gas, address=addr_2, args_offset=0x0, args_size=0x40, @@ -101,7 +124,7 @@ def test_callcallcodecallcode_011( code=Op.SSTORE( key=0x0, value=Op.CALL( - gas=0x55730, + gas=outer_call_gas, address=addr, value=0x1, args_offset=0x0, diff --git a/tests/ported_static/stCallDelegateCodesHomestead/test_callcodecall_10.py b/tests/ported_static/stCallDelegateCodesHomestead/test_callcodecall_10.py index b689ffd226..944c9b6ca4 100644 --- a/tests/ported_static/stCallDelegateCodesHomestead/test_callcodecall_10.py +++ b/tests/ported_static/stCallDelegateCodesHomestead/test_callcodecall_10.py @@ -3,6 +3,16 @@ Ported from: state_tests/stCallDelegateCodesHomestead/callcodecall_10Filler.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 @@ -15,6 +25,7 @@ StateTestFiller, Transaction, ) +from execution_testing.forks import Fork from execution_testing.vm import Op REFERENCE_SPEC_GIT_PATH = "N/A" @@ -29,8 +40,18 @@ def test_callcodecall_10( state_test: StateTestFiller, pre: Alloc, + fork: Fork, ) -> None: """Test_callcodecall_10.""" + # 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) @@ -63,7 +84,7 @@ def test_callcodecall_10( code=Op.SSTORE( key=0x1, value=Op.CALL( - gas=0x3D090, + gas=inner_call_gas, address=addr_2, value=0x1, args_offset=0x0, @@ -82,7 +103,7 @@ def test_callcodecall_10( code=Op.SSTORE( key=0x0, value=Op.DELEGATECALL( - gas=0x55730, + gas=outer_call_gas, address=addr, args_offset=0x0, args_size=0x40, diff --git a/tests/ported_static/stCallDelegateCodesHomestead/test_callcodecallcall_100.py b/tests/ported_static/stCallDelegateCodesHomestead/test_callcodecallcall_100.py index ce2dc3a924..f5e7137363 100644 --- a/tests/ported_static/stCallDelegateCodesHomestead/test_callcodecallcall_100.py +++ b/tests/ported_static/stCallDelegateCodesHomestead/test_callcodecallcall_100.py @@ -3,6 +3,16 @@ Ported from: state_tests/stCallDelegateCodesHomestead/callcodecallcall_100Filler.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 @@ -15,6 +25,7 @@ StateTestFiller, Transaction, ) +from execution_testing.forks import Fork from execution_testing.vm import Op REFERENCE_SPEC_GIT_PATH = "N/A" @@ -31,8 +42,20 @@ def test_callcodecallcall_100( state_test: StateTestFiller, pre: Alloc, + fork: Fork, ) -> None: """Test_callcodecallcall_100.""" + # 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) @@ -65,7 +88,7 @@ def test_callcodecallcall_100( code=Op.SSTORE( key=0x2, value=Op.CALL( - gas=0x3D090, + gas=inner_call_gas, address=addr_3, value=0x2, args_offset=0x0, @@ -84,7 +107,7 @@ def test_callcodecallcall_100( code=Op.SSTORE( key=0x1, value=Op.CALL( - gas=0x493E0, + gas=middle_call_gas, address=addr_2, value=0x1, args_offset=0x0, @@ -104,7 +127,7 @@ def test_callcodecallcall_100( code=Op.SSTORE( key=0x0, value=Op.DELEGATECALL( - gas=0x55730, + gas=outer_call_gas, address=addr, args_offset=0x0, args_size=0x40, diff --git a/tests/ported_static/stCallDelegateCodesHomestead/test_callcodecallcallcode_101.py b/tests/ported_static/stCallDelegateCodesHomestead/test_callcodecallcallcode_101.py index 626025ac0f..3bac074bbd 100644 --- a/tests/ported_static/stCallDelegateCodesHomestead/test_callcodecallcallcode_101.py +++ b/tests/ported_static/stCallDelegateCodesHomestead/test_callcodecallcallcode_101.py @@ -3,6 +3,16 @@ Ported from: state_tests/stCallDelegateCodesHomestead/callcodecallcallcode_101Filler.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 @@ -15,6 +25,7 @@ StateTestFiller, Transaction, ) +from execution_testing.forks import Fork from execution_testing.vm import Op REFERENCE_SPEC_GIT_PATH = "N/A" @@ -31,8 +42,20 @@ def test_callcodecallcallcode_101( state_test: StateTestFiller, pre: Alloc, + fork: Fork, ) -> None: """Test_callcodecallcallcode_101.""" + # 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) @@ -65,7 +88,7 @@ def test_callcodecallcallcode_101( code=Op.SSTORE( key=0x2, value=Op.DELEGATECALL( - gas=0x3D090, + gas=inner_call_gas, address=addr_3, args_offset=0x0, args_size=0x40, @@ -84,7 +107,7 @@ def test_callcodecallcallcode_101( code=Op.SSTORE( key=0x1, value=Op.CALL( - gas=0x493E0, + gas=middle_call_gas, address=addr_2, value=0x1, args_offset=0x0, @@ -104,7 +127,7 @@ def test_callcodecallcallcode_101( code=Op.SSTORE( key=0x0, value=Op.DELEGATECALL( - gas=0x55730, + gas=outer_call_gas, address=addr, args_offset=0x0, args_size=0x40, diff --git a/tests/ported_static/stCallDelegateCodesHomestead/test_callcodecallcode_11.py b/tests/ported_static/stCallDelegateCodesHomestead/test_callcodecallcode_11.py index bc8e57b410..055d2ccfe0 100644 --- a/tests/ported_static/stCallDelegateCodesHomestead/test_callcodecallcode_11.py +++ b/tests/ported_static/stCallDelegateCodesHomestead/test_callcodecallcode_11.py @@ -3,6 +3,16 @@ Ported from: state_tests/stCallDelegateCodesHomestead/callcodecallcode_11Filler.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 @@ -15,6 +25,7 @@ StateTestFiller, Transaction, ) +from execution_testing.forks import Fork from execution_testing.vm import Op REFERENCE_SPEC_GIT_PATH = "N/A" @@ -31,8 +42,18 @@ def test_callcodecallcode_11( state_test: StateTestFiller, pre: Alloc, + fork: Fork, ) -> None: """Test_callcodecallcode_11.""" + # 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) @@ -65,7 +86,7 @@ def test_callcodecallcode_11( code=Op.SSTORE( key=0x1, value=Op.DELEGATECALL( - gas=0x3D090, + gas=inner_call_gas, address=addr_2, args_offset=0x0, args_size=0x40, @@ -82,7 +103,7 @@ def test_callcodecallcode_11( code=Op.SSTORE( key=0x0, value=Op.DELEGATECALL( - gas=0x55730, + gas=outer_call_gas, address=addr, args_offset=0x0, args_size=0x40, diff --git a/tests/ported_static/stCallDelegateCodesHomestead/test_callcodecallcodecall_110.py b/tests/ported_static/stCallDelegateCodesHomestead/test_callcodecallcodecall_110.py index 6ff719a5e6..0d66c6d33f 100644 --- a/tests/ported_static/stCallDelegateCodesHomestead/test_callcodecallcodecall_110.py +++ b/tests/ported_static/stCallDelegateCodesHomestead/test_callcodecallcodecall_110.py @@ -3,6 +3,16 @@ Ported from: state_tests/stCallDelegateCodesHomestead/callcodecallcodecall_110Filler.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 @@ -15,6 +25,7 @@ StateTestFiller, Transaction, ) +from execution_testing.forks import Fork from execution_testing.vm import Op REFERENCE_SPEC_GIT_PATH = "N/A" @@ -31,8 +42,20 @@ def test_callcodecallcodecall_110( state_test: StateTestFiller, pre: Alloc, + fork: Fork, ) -> None: """Test_callcodecallcodecall_110.""" + # 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) @@ -65,7 +88,7 @@ def test_callcodecallcodecall_110( code=Op.SSTORE( key=0x2, value=Op.CALL( - gas=0x3D090, + gas=inner_call_gas, address=addr_3, value=0x1, args_offset=0x0, @@ -85,7 +108,7 @@ def test_callcodecallcodecall_110( code=Op.SSTORE( key=0x1, value=Op.DELEGATECALL( - gas=0x493E0, + gas=middle_call_gas, address=addr_2, args_offset=0x0, args_size=0x40, @@ -104,7 +127,7 @@ def test_callcodecallcodecall_110( code=Op.SSTORE( key=0x0, value=Op.DELEGATECALL( - gas=0x55730, + gas=outer_call_gas, address=addr, args_offset=0x0, args_size=0x40, diff --git a/tests/ported_static/stCallDelegateCodesHomestead/test_callcodecallcodecallcode_111.py b/tests/ported_static/stCallDelegateCodesHomestead/test_callcodecallcodecallcode_111.py index 79b74221b0..f270f4c6af 100644 --- a/tests/ported_static/stCallDelegateCodesHomestead/test_callcodecallcodecallcode_111.py +++ b/tests/ported_static/stCallDelegateCodesHomestead/test_callcodecallcodecallcode_111.py @@ -3,6 +3,16 @@ Ported from: state_tests/stCallDelegateCodesHomestead/callcodecallcodecallcode_111Filler.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 @@ -15,6 +25,7 @@ StateTestFiller, Transaction, ) +from execution_testing.forks import Fork from execution_testing.vm import Op REFERENCE_SPEC_GIT_PATH = "N/A" @@ -31,8 +42,20 @@ def test_callcodecallcodecallcode_111( state_test: StateTestFiller, pre: Alloc, + fork: Fork, ) -> None: """Test_callcodecallcodecallcode_111.""" + # 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) @@ -65,7 +88,7 @@ def test_callcodecallcodecallcode_111( code=Op.SSTORE( key=0x2, value=Op.DELEGATECALL( - gas=0x3D090, + gas=inner_call_gas, address=addr_3, args_offset=0x0, args_size=0x40, @@ -83,7 +106,7 @@ def test_callcodecallcodecallcode_111( code=Op.SSTORE( key=0x1, value=Op.DELEGATECALL( - gas=0x493E0, + gas=middle_call_gas, address=addr_2, args_offset=0x0, args_size=0x40, @@ -101,7 +124,7 @@ def test_callcodecallcodecallcode_111( code=Op.SSTORE( key=0x0, value=Op.DELEGATECALL( - gas=0x55730, + gas=outer_call_gas, address=addr, args_offset=0x0, args_size=0x40, diff --git a/tests/ported_static/stCodeSizeLimit/test_codesize_valid.py b/tests/ported_static/stCodeSizeLimit/test_codesize_valid.py index b0a4a1fd5f..6ac356a7b8 100644 --- a/tests/ported_static/stCodeSizeLimit/test_codesize_valid.py +++ b/tests/ported_static/stCodeSizeLimit/test_codesize_valid.py @@ -3,6 +3,15 @@ Ported from: state_tests/stCodeSizeLimit/codesizeValidFiller.json + +@manually-enhanced: Do not overwrite. On Amsterdam (EIP-8037) the +contract-creation tx — which deploys ~24 KiB of code — needs extra +state-gas headroom on top of the 15 000 000 regular-gas budget that +suffices on earlier forks. Bump `tx.gas` to 30 000 000 fork- +conditionally; pre-Amsterdam keeps the original 15 000 000 (Osaka +caps `tx.gas` at `TX_MAX_GAS_LIMIT = 16 777 216`, so the bump must be +gated). `env.gas_limit` widened so the larger tx fits in the block. +Post-state expectations are unchanged on all forks. """ import pytest @@ -61,7 +70,7 @@ def test_codesize_valid( timestamp=1000, prev_randao=0x20000, base_fee_per_gas=10, - gas_limit=20000000, + gas_limit=45000000, ) tx_data = [ @@ -70,7 +79,7 @@ def test_codesize_valid( Op.CODECOPY(dest_offset=0x0, offset=0xD, size=0x6000) + Op.RETURN(offset=0x0, size=0x6000), ] - tx_gas = [15000000] + tx_gas = [40000000 if fork.is_eip_enabled(8037) else 15000000] tx_value = [1] tx = Transaction( diff --git a/tests/ported_static/stCreate2/test_create2_contract_suicide_during_init_then_store_then_return.py b/tests/ported_static/stCreate2/test_create2_contract_suicide_during_init_then_store_then_return.py index faa8f7c9a0..57e81b5a8c 100644 --- a/tests/ported_static/stCreate2/test_create2_contract_suicide_during_init_then_store_then_return.py +++ b/tests/ported_static/stCreate2/test_create2_contract_suicide_during_init_then_store_then_return.py @@ -3,6 +3,12 @@ Ported from: state_tests/stCreate2/CREATE2_ContractSuicideDuringInit_ThenStoreThenReturnFiller.json + +@manually-enhanced: Do not overwrite. The inner CALL gas was raised +from 0x249F0 to 0x100000 and the tx gas_limit from 600 000 to +5 000 000 so the nested CREATE2 + init-code SELFDESTRUCT to address +0x01 can afford its EIP-8037 NEW_ACCOUNT state gas on Amsterdam +(post-state expectations are unchanged on all forks). """ import pytest @@ -16,6 +22,7 @@ StateTestFiller, Transaction, ) +from execution_testing.forks import Fork from execution_testing.vm import Op REFERENCE_SPEC_GIT_PATH = "N/A" @@ -32,6 +39,7 @@ def test_create2_contract_suicide_during_init_then_store_then_return( state_test: StateTestFiller, pre: Alloc, + fork: Fork, ) -> None: """Test_create2_contract_suicide_during_init_then_store_then_return.""" coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) @@ -51,6 +59,14 @@ def test_create2_contract_suicide_during_init_then_store_then_return( ) pre[sender] = Account(balance=0xE8D4A51000) + # EIP-8037 NEW_ACCOUNT state-gas on Amsterdam pushes both the inner + # CALL and the outer tx over the original budgets; pre-EIP-8037 + # forks keep the values the original filler was tuned for. + inner_call_gas = 0x249F0 + tx_gas_limit = 600_000 + if fork.is_eip_enabled(8037): + inner_call_gas = 0x100000 + tx_gas_limit = 5_000_000 # Source: lll # { (MSTORE 0 0x6d64600c6000556000526005601bf36000526001ff) (CREATE2 1 11 21 0) [[0]] 11 (RETURN 18 14) } # noqa: E501 contract_1 = pre.deploy_contract( # noqa: F841 @@ -70,7 +86,7 @@ def test_create2_contract_suicide_during_init_then_store_then_return( contract_0 = pre.deploy_contract( # noqa: F841 code=Op.POP( Op.CALL( - gas=0x249F0, + gas=inner_call_gas, address=contract_1, value=0x1, args_offset=0x0, @@ -90,7 +106,7 @@ def test_create2_contract_suicide_during_init_then_store_then_return( sender=sender, to=contract_0, data=Bytes(""), - gas_limit=600000, + gas_limit=tx_gas_limit, value=10, ) diff --git a/tests/ported_static/stCreate2/test_create2_smart_init_code.py b/tests/ported_static/stCreate2/test_create2_smart_init_code.py index 0d5a967638..09b7313462 100644 --- a/tests/ported_static/stCreate2/test_create2_smart_init_code.py +++ b/tests/ported_static/stCreate2/test_create2_smart_init_code.py @@ -3,6 +3,10 @@ Ported from: state_tests/stCreate2/create2SmartInitCodeFiller.json + +@manually-enhanced: Do not overwrite. tx_gas was raised from 400 000 to +1 000 000 so the CREATE2 path can afford its EIP-8037 NEW_ACCOUNT state +gas on Amsterdam (post-state expectations are unchanged on all forks). """ import pytest @@ -169,7 +173,12 @@ def test_create2_smart_init_code( Hash(contract_0, left_padding=True), Hash(contract_1, left_padding=True), ] - tx_gas = [400000] + # EIP-8037 NEW_ACCOUNT + per-byte state-gas spill into the regular + # budget on Amsterdam; pre-EIP-8037 forks keep the original 400 000. + outer_tx_gas = 400_000 + if fork.is_eip_enabled(8037): + outer_tx_gas = 1_000_000 + tx_gas = [outer_tx_gas] tx = Transaction( sender=sender, diff --git a/tests/ported_static/stCreate2/test_create2collision_selfdestructed.py b/tests/ported_static/stCreate2/test_create2collision_selfdestructed.py index e3a2e1ae02..16263ba244 100644 --- a/tests/ported_static/stCreate2/test_create2collision_selfdestructed.py +++ b/tests/ported_static/stCreate2/test_create2collision_selfdestructed.py @@ -3,6 +3,13 @@ Ported from: state_tests/stCreate2/create2collisionSelfdestructedFiller.json + +@manually-enhanced: Do not overwrite. The inner CALL's gas budget was +raised from 0xC350 to 0x40000 and the outer tx gas from 400 000 to +1 000 000 so the SELFDESTRUCT-to-empty path can afford its EIP-8037 +NEW_ACCOUNT state gas on Amsterdam (the test's intent — exercising +CREATE2 collision against a freshly self-destructed address — is +preserved on all forks). """ import pytest @@ -153,10 +160,19 @@ def test_create2collision_selfdestructed( post, _exc = resolve_expect_post(expect_entries_, d, g, v, fork) + # EIP-8037 NEW_ACCOUNT state-gas pushes both the outer tx and the + # inner CALL over their original budgets on Amsterdam. Pre-EIP-8037 + # forks keep the original tuned values. + inner_call_gas = 0xC350 + outer_tx_gas = 400_000 + if fork.is_eip_enabled(8037): + inner_call_gas = 0x40000 + outer_tx_gas = 1_000_000 + tx_data = [ Op.POP( Op.CALL( - gas=0xC350, + gas=inner_call_gas, address=contract_0, value=0x0, args_offset=0x0, @@ -169,7 +185,7 @@ def test_create2collision_selfdestructed( + Op.STOP, Op.POP( Op.CALL( - gas=0xC350, + gas=inner_call_gas, address=contract_1, value=0x0, args_offset=0x0, @@ -183,7 +199,7 @@ def test_create2collision_selfdestructed( + Op.STOP, Op.POP( Op.CALL( - gas=0xC350, + gas=inner_call_gas, address=contract_2, value=0x0, args_offset=0x0, @@ -196,7 +212,7 @@ def test_create2collision_selfdestructed( + Op.CREATE2(value=0x0, offset=0x12, size=0xE, salt=0x0) + Op.STOP, ] - tx_gas = [400000] + tx_gas = [outer_tx_gas] tx_value = [1] tx = Transaction( diff --git a/tests/ported_static/stCreate2/test_create2collision_selfdestructed2.py b/tests/ported_static/stCreate2/test_create2collision_selfdestructed2.py index c55ec9f9d5..cc5a26cde9 100644 --- a/tests/ported_static/stCreate2/test_create2collision_selfdestructed2.py +++ b/tests/ported_static/stCreate2/test_create2collision_selfdestructed2.py @@ -3,6 +3,13 @@ Ported from: state_tests/stCreate2/create2collisionSelfdestructed2Filler.json + +@manually-enhanced: Do not overwrite. The inner CALL's gas budget was +raised from 0xC350 to 0x40000 and the outer tx gas from 400 000 to +1 000 000 so the SELFDESTRUCT-to-empty path can afford its EIP-8037 +NEW_ACCOUNT state gas on Amsterdam (the test's intent — exercising +CREATE2 collision against a freshly self-destructed address — is +preserved on all forks). """ import pytest @@ -122,10 +129,19 @@ def test_create2collision_selfdestructed2( post, _exc = resolve_expect_post(expect_entries_, d, g, v, fork) + # EIP-8037 NEW_ACCOUNT state-gas pushes both the outer tx and the + # inner CALL over their original budgets on Amsterdam. Pre-EIP-8037 + # forks keep the original tuned values. + inner_call_gas = 0xC350 + outer_tx_gas = 400_000 + if fork.is_eip_enabled(8037): + inner_call_gas = 0x40000 + outer_tx_gas = 1_000_000 + tx_data = [ Op.POP( Op.CALL( - gas=0xC350, + gas=inner_call_gas, address=contract_0, value=0x0, args_offset=0x0, @@ -139,7 +155,7 @@ def test_create2collision_selfdestructed2( + Op.STOP, Op.POP( Op.CALL( - gas=0xC350, + gas=inner_call_gas, address=contract_1, value=0x0, args_offset=0x0, @@ -152,7 +168,7 @@ def test_create2collision_selfdestructed2( + Op.CREATE2(value=0x0, offset=0x14, size=0xC, salt=0x0) + Op.STOP, ] - tx_gas = [400000] + tx_gas = [outer_tx_gas] tx = Transaction( sender=sender, diff --git a/tests/ported_static/stCreateTest/test_create_transaction_call_data.py b/tests/ported_static/stCreateTest/test_create_transaction_call_data.py index e30600d6af..7c5810b665 100644 --- a/tests/ported_static/stCreateTest/test_create_transaction_call_data.py +++ b/tests/ported_static/stCreateTest/test_create_transaction_call_data.py @@ -5,6 +5,10 @@ Ported from: state_tests/stCreateTest/CreateTransactionCallDataFiller.yml + +@manually-enhanced: Do not overwrite. tx_gas was raised from 100 000 to +500 000 so the CREATE path can afford its EIP-8037 NEW_ACCOUNT state +gas on Amsterdam (post-state expectations are unchanged on all forks). """ import pytest @@ -111,7 +115,12 @@ def test_create_transaction_call_data( Op.CODECOPY(dest_offset=Op.DUP1, offset=0x0, size=Op.CODESIZE) + Op.RETURN(offset=0x0, size=Op.CODESIZE), ] - tx_gas = [100000] + # EIP-8037 NEW_ACCOUNT + per-byte state-gas spill on Amsterdam; + # pre-EIP-8037 keeps the original 100 000 budget. + outer_tx_gas = 100_000 + if fork.is_eip_enabled(8037): + outer_tx_gas = 500_000 + tx_gas = [outer_tx_gas] tx = Transaction( sender=sender, diff --git a/tests/ported_static/stCreateTest/test_create_transaction_high_nonce.py b/tests/ported_static/stCreateTest/test_create_transaction_high_nonce.py index 6ba82dc452..da3ad39d2b 100644 --- a/tests/ported_static/stCreateTest/test_create_transaction_high_nonce.py +++ b/tests/ported_static/stCreateTest/test_create_transaction_high_nonce.py @@ -5,6 +5,12 @@ Ported from: state_tests/stCreateTest/CreateTransactionHighNonceFiller.yml + +@manually-enhanced: Do not overwrite. `tx_gas` was raised from 90 000 +to 500 000 so the transaction clears the EIP-8037 intrinsic-gas floor +on Amsterdam and the validator can actually reach the NONCE_IS_MAX +check the test asserts. Pre-Amsterdam the floor is lower, so the same +budget still triggers the same exception path. """ import pytest @@ -85,7 +91,15 @@ def test_create_transaction_high_nonce( tx_data = [ Op.RETURN(offset=0x0, size=0x1), ] - tx_gas = [90000] + # Original budget (90 000) is below the EIP-8037 intrinsic-gas + # floor for a create tx on Amsterdam, so the tx is rejected for + # `INTRINSIC_GAS_TOO_LOW` before the NONCE_IS_MAX check this test + # asserts ever runs. Bump on Amsterdam to clear the floor; pre- + # EIP-8037 forks keep the original. + nonce_check_tx_gas = 90000 + if fork.is_eip_enabled(8037): + nonce_check_tx_gas = 500000 + tx_gas = [nonce_check_tx_gas] tx_value = [0, 1] tx = Transaction( diff --git a/tests/ported_static/stEIP2930/test_manual_create.py b/tests/ported_static/stEIP2930/test_manual_create.py index 057b623c7e..94126fa135 100644 --- a/tests/ported_static/stEIP2930/test_manual_create.py +++ b/tests/ported_static/stEIP2930/test_manual_create.py @@ -3,6 +3,15 @@ Ported from: state_tests/stEIP2930/manualCreateFiller.yml + +@manually-enhanced: Do not overwrite. The three parametrizations of +this test measure regular gas around a fresh SSTORE-set inside a +CREATE-deployed contract. EIP-8037 splits the Cancun-era SSTORE-set +base into a smaller regular portion plus 37 568 state-gas; with an +empty reservoir the full state-gas spills into regular gas and +`Op.GAS` reads +20 468 = 37 568 - 17 100 compared to Cancun. Bake +that delta into both `[">=Cancun"]` expect entries fork-conditionally +via `fork.sstore_state_gas() - 17100`. """ import pytest @@ -81,13 +90,19 @@ def test_manual_create( pre[sender] = Account(balance=0x1000000000000000000, nonce=1) + # EIP-8037 SSTORE-set spillover: +20 468 regular gas per fresh set + # when the reservoir is empty. + sstore_set_delta = ( + (fork.sstore_state_gas() - 17100) if fork.is_eip_enabled(8037) else 0 + ) + expect_entries_: list[dict] = [ { "indexes": {"data": [2], "gas": -1, "value": -1}, "network": [">=Cancun"], "result": { compute_create_address(address=sender, nonce=1): Account( - storage={0: 20008, 1: 106} + storage={0: 20008 + sstore_set_delta, 1: 106} ), }, }, @@ -96,7 +111,7 @@ def test_manual_create( "network": [">=Cancun"], "result": { compute_create_address(address=sender, nonce=1): Account( - storage={0: 22108, 1: 106} + storage={0: 22108 + sstore_set_delta, 1: 106} ), }, }, @@ -139,7 +154,13 @@ def test_manual_create( + Op.SSTORE(key=0x0, value=Op.SUB) + Op.STOP, ] - tx_gas = [400000] + # EIP-8037 NEW_ACCOUNT state-gas spill into regular gas on + # Amsterdam exceeds the original 400 000 budget. Pre-EIP-8037 + # keeps the original value. + outer_tx_gas = 400_000 + if fork.is_eip_enabled(8037): + outer_tx_gas = 1_000_000 + tx_gas = [outer_tx_gas] tx_access_lists: dict[int, list] = { 0: [ AccessList( diff --git a/tests/ported_static/stEIP2930/test_storage_costs.py b/tests/ported_static/stEIP2930/test_storage_costs.py index f344bc82fa..2b8e103909 100644 --- a/tests/ported_static/stEIP2930/test_storage_costs.py +++ b/tests/ported_static/stEIP2930/test_storage_costs.py @@ -3,6 +3,20 @@ Ported from: state_tests/stEIP2930/storageCostsFiller.yml + +@manually-enhanced: Do not overwrite. The SSTORE gas measurements in +this test were authored against the Cancun-era SSTORE-set base cost +of 20 000 (per EIP-2200). EIP-8037 splits that cost into a smaller +regular portion (~2 900) plus a per-storage state-gas charge of +`STATE_BYTES_PER_STORAGE_SET (32) * COST_PER_STATE_BYTE (1174) = +37 568`. When the state-gas reservoir is empty — as it is here, since +the tests don't pre-allocate state-gas budget — the full state-gas +spills back into regular gas, so `Op.GAS` observes +`+37 568 - 17 100 = +20 468` regular gas per fresh SSTORE-set +compared to Cancun. Bake that fork-conditional delta into the +expected post-state values for the 10 parametrizations whose measured +SSTORE writes triggered the spill; the remaining entries (SLOAD-only, +no-op SSTOREs) are unaffected. """ import pytest @@ -647,16 +661,36 @@ def test_storage_costs( address=Address(0xCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC), # noqa: E501 ) + # EIP-8037 splits the SSTORE-set base cost (Cancun: 20 000 regular) + # into a smaller regular portion plus per-storage state-gas. When + # the state-gas reservoir is empty for these tests, the full state + # gas spills into regular gas, so Op.GAS sees +20 468 per fresh + # SSTORE-set compared to Cancun (=37 568 state-gas - 17 100 base + # regular drop). Apply that delta to the 10 measurements that + # trigger a fresh-set spill; the SLOAD-only and no-op SSTORE + # entries below are unchanged. + sstore_set_delta = ( + (fork.sstore_state_gas() - 17100) if fork.is_eip_enabled(8037) else 0 + ) + expect_entries_: list[dict] = [ { "indexes": {"data": [0, 35], "gas": -1, "value": -1}, "network": [">=Cancun"], - "result": {contract_0: Account(storage={0: 2, 1: 20003})}, + "result": { + contract_0: Account( + storage={0: 2, 1: 20003 + sstore_set_delta} + ) + }, }, { "indexes": {"data": [6, 12, 18], "gas": -1, "value": -1}, "network": [">=Cancun"], - "result": {contract_0: Account(storage={0: 2, 1: 22103})}, + "result": { + contract_0: Account( + storage={0: 2, 1: 22103 + sstore_set_delta} + ) + }, }, { "indexes": {"data": [3], "gas": -1, "value": -1}, @@ -721,7 +755,11 @@ def test_storage_costs( { "indexes": {"data": [28, 29], "gas": -1, "value": -1}, "network": [">=Cancun"], - "result": {contract_8: Account(storage={0: 2, 1: 20000})}, + "result": { + contract_8: Account( + storage={0: 2, 1: 20000 + sstore_set_delta} + ) + }, }, { "indexes": {"data": [30, 31], "gas": -1, "value": -1}, @@ -733,7 +771,12 @@ def test_storage_costs( "network": [">=Cancun"], "result": { contract_10: Account( - storage={0: 2, 1: 100, 2: 20000, 24743: 57005} + storage={ + 0: 2, + 1: 100, + 2: 20000 + sstore_set_delta, + 24743: 57005, + } ) }, }, @@ -742,7 +785,12 @@ def test_storage_costs( "network": [">=Cancun"], "result": { contract_10: Account( - storage={0: 2, 1: 2100, 2: 22100, 24743: 57005} + storage={ + 0: 2, + 1: 2100, + 2: 22100 + sstore_set_delta, + 24743: 57005, + } ), }, }, @@ -788,7 +836,15 @@ def test_storage_costs( Bytes("693c6139") + Hash(0xFFF), Bytes("693c6139") + Hash(0x0), ] - tx_gas = [400000] + # The test's CALL chain does two SSTORE-sets in each measured + # contract; EIP-8037 spills both state-gas charges into regular gas + # when the reservoir is empty, pushing total consumption over the + # original 400 000 budget. Bump on EIP-8037; pre-EIP-8037 keeps the + # original value. + outer_tx_gas = 400_000 + if fork.is_eip_enabled(8037): + outer_tx_gas = 1_000_000 + tx_gas = [outer_tx_gas] tx_value = [100000] tx_access_lists: dict[int, list] = { 0: [ diff --git a/tests/ported_static/stEIP2930/test_varied_context.py b/tests/ported_static/stEIP2930/test_varied_context.py index 2f64e28ca3..66972b76d8 100644 --- a/tests/ported_static/stEIP2930/test_varied_context.py +++ b/tests/ported_static/stEIP2930/test_varied_context.py @@ -3,6 +3,22 @@ Ported from: state_tests/stEIP2930/variedContextFiller.yml + +@manually-enhanced: Do not overwrite. 28 parametrizations of this +test measure gas consumption around SSTORE/CALL/SELFDESTRUCT in +various access-list contexts. EIP-8037 splits the Cancun-era base +costs (SSTORE-set 20 000, CALL-new-account 25 000, SELFDESTRUCT-new- +beneficiary 25 000) into smaller regular portions plus per-storage +or per-new-account state-gas charges. When the reservoir is empty — +the case here, since no state-gas budget is pre-allocated — the +full state-gas spills back into regular gas and Op.GAS reads three +distinct deltas: + +20 468 per fresh SSTORE-set + +106 488 per NEW_ACCOUNT (CALL with value or SELFDESTRUCT) + +126 956 = both, for SELFDESTRUCT-with-write paths +Each affected post-state literal is bumped by the appropriate +delta fork-conditionally; pre-EIP-8037 forks use the original +values. """ import pytest @@ -1321,33 +1337,71 @@ def test_varied_context( address=Address(0x0000000000000000000000000000000000001016), # noqa: E501 ) + # EIP-8037 splits SSTORE-set, NEW_ACCOUNT call value transfer, and + # SELFDESTRUCT new-beneficiary base costs into state-gas portions. + # With an empty reservoir (the case here), the full state-gas + # spills into regular gas, which Op.GAS observes. + # sstore-set spill: +37 568 - 17 100 = +20 468 per fresh set + # new-account spill: +131 488 - 25 000 = +106 488 per CALL + # with value to a non-alive account, and + # per SELFDESTRUCT to non-alive beneficiary + # suicide-write spill: +126 956 = both deltas combined + sstore_set_delta = ( + (fork.sstore_state_gas() - 17100) if fork.is_eip_enabled(8037) else 0 + ) + new_account_delta = ( + (fork.create_state_gas() - 25000) if fork.is_eip_enabled(8037) else 0 + ) + suicide_write_delta = sstore_set_delta + new_account_delta + expect_entries_: list[dict] = [ { "indexes": {"data": [0], "gas": -1, "value": -1}, "network": [">=Cancun"], - "result": {contract_0: Account(storage={0: 2, 1: 20003, 2: 107})}, + "result": { + contract_0: Account( + storage={0: 2, 1: (20003 + sstore_set_delta), 2: 107} + ) + }, }, { "indexes": {"data": [1], "gas": -1, "value": -1}, "network": [">=Cancun"], - "result": {contract_0: Account(storage={0: 2, 1: 22103, 2: 2107})}, + "result": { + contract_0: Account( + storage={0: 2, 1: (22103 + sstore_set_delta), 2: 2107} + ) + }, }, { "indexes": {"data": [2], "gas": -1, "value": -1}, "network": [">=Cancun"], - "result": {contract_2: Account(storage={0: 2, 1: 20003, 2: 107})}, + "result": { + contract_2: Account( + storage={0: 2, 1: (20003 + sstore_set_delta), 2: 107} + ) + }, }, { "indexes": {"data": [3], "gas": -1, "value": -1}, "network": [">=Cancun"], - "result": {contract_2: Account(storage={0: 2, 1: 22103, 2: 2107})}, + "result": { + contract_2: Account( + storage={0: 2, 1: (22103 + sstore_set_delta), 2: 2107} + ) + }, }, { "indexes": {"data": [4], "gas": -1, "value": -1}, "network": [">=Cancun"], "result": { contract_3: Account( - storage={0: 2, 1: 22103, 2: 2107, 24743: 57005} + storage={ + 0: 2, + 1: (22103 + sstore_set_delta), + 2: 2107, + 24743: 57005, + } ) }, }, @@ -1356,7 +1410,12 @@ def test_varied_context( "network": [">=Cancun"], "result": { contract_3: Account( - storage={0: 2, 1: 20003, 2: 107, 24743: 57005} + storage={ + 0: 2, + 1: (20003 + sstore_set_delta), + 2: 107, + 24743: 57005, + } ) }, }, @@ -1373,32 +1432,48 @@ def test_varied_context( { "indexes": {"data": [8], "gas": -1, "value": -1}, "network": [">=Cancun"], - "result": {contract_26: Account(storage={0: 20003, 1: 100})}, + "result": { + contract_26: Account( + storage={0: (20003 + sstore_set_delta), 1: 100} + ) + }, }, { "indexes": {"data": [9], "gas": -1, "value": -1}, "network": [">=Cancun"], - "result": {contract_26: Account(storage={0: 22103, 1: 2100})}, + "result": { + contract_26: Account( + storage={0: (22103 + sstore_set_delta), 1: 2100} + ) + }, }, { "indexes": {"data": [10], "gas": -1, "value": -1}, "network": [">=Cancun"], - "result": {contract_7: Account(storage={0: 20001})}, + "result": { + contract_7: Account(storage={0: (20001 + suicide_write_delta)}) + }, }, { "indexes": {"data": [11], "gas": -1, "value": -1}, "network": [">=Cancun"], - "result": {contract_7: Account(storage={0: 24601})}, + "result": { + contract_7: Account(storage={0: (24601 + suicide_write_delta)}) + }, }, { "indexes": {"data": [12], "gas": -1, "value": -1}, "network": [">=Cancun"], - "result": {contract_9: Account(storage={0: 100})}, + "result": { + contract_9: Account(storage={0: 100 + new_account_delta}) + }, }, { "indexes": {"data": [13], "gas": -1, "value": -1}, "network": [">=Cancun"], - "result": {contract_9: Account(storage={0: 4600})}, + "result": { + contract_9: Account(storage={0: 4600 + new_account_delta}) + }, }, { "indexes": {"data": [14, 15], "gas": -1, "value": -1}, @@ -1447,7 +1522,7 @@ def test_varied_context( 268: 103, 269: 103, 270: 103, - 271: 20003, + 271: (20003 + sstore_set_delta), 512: 100, 513: 100, 514: 100, @@ -1464,22 +1539,22 @@ def test_varied_context( 525: 100, 526: 100, 527: 100, - 768: 20003, - 769: 20003, - 770: 20003, - 771: 20003, - 772: 20003, - 773: 20003, - 774: 20003, - 775: 20003, - 776: 20003, - 777: 20003, - 778: 20003, - 779: 20003, - 780: 20003, - 781: 20003, - 782: 20003, - 783: 20003, + 768: (20003 + sstore_set_delta), + 769: (20003 + sstore_set_delta), + 770: (20003 + sstore_set_delta), + 771: (20003 + sstore_set_delta), + 772: (20003 + sstore_set_delta), + 773: (20003 + sstore_set_delta), + 774: (20003 + sstore_set_delta), + 775: (20003 + sstore_set_delta), + 776: (20003 + sstore_set_delta), + 777: (20003 + sstore_set_delta), + 778: (20003 + sstore_set_delta), + 779: (20003 + sstore_set_delta), + 780: (20003 + sstore_set_delta), + 781: (20003 + sstore_set_delta), + 782: (20003 + sstore_set_delta), + 783: (20003 + sstore_set_delta), 1024: 100, 1025: 100, 1026: 100, @@ -1540,7 +1615,7 @@ def test_varied_context( 268: 103, 269: 103, 270: 103, - 271: 22103, + 271: (22103 + sstore_set_delta), 512: 100, 513: 100, 514: 100, @@ -1557,22 +1632,22 @@ def test_varied_context( 525: 100, 526: 100, 527: 2100, - 768: 22103, - 769: 22103, - 770: 22103, - 771: 22103, - 772: 22103, - 773: 22103, - 774: 22103, - 775: 22103, - 776: 22103, - 777: 22103, - 778: 22103, - 779: 22103, - 780: 22103, - 781: 22103, - 782: 22103, - 783: 22103, + 768: (22103 + sstore_set_delta), + 769: (22103 + sstore_set_delta), + 770: (22103 + sstore_set_delta), + 771: (22103 + sstore_set_delta), + 772: (22103 + sstore_set_delta), + 773: (22103 + sstore_set_delta), + 774: (22103 + sstore_set_delta), + 775: (22103 + sstore_set_delta), + 776: (22103 + sstore_set_delta), + 777: (22103 + sstore_set_delta), + 778: (22103 + sstore_set_delta), + 779: (22103 + sstore_set_delta), + 780: (22103 + sstore_set_delta), + 781: (22103 + sstore_set_delta), + 782: (22103 + sstore_set_delta), + 783: (22103 + sstore_set_delta), 1024: 2100, 1025: 2100, 1026: 2100, @@ -1616,7 +1691,7 @@ def test_varied_context( "network": [">=Cancun"], "result": { compute_create_address(address=contract_18, nonce=0): Account( - storage={0: 65535, 1: 20017} + storage={0: 65535, 1: (20017 + sstore_set_delta)} ), }, }, @@ -1625,7 +1700,7 @@ def test_varied_context( "network": [">=Cancun"], "result": { compute_create_address(address=contract_18, nonce=0): Account( - storage={0: 65535, 1: 22117} + storage={0: 65535, 1: (22117 + sstore_set_delta)} ), }, }, @@ -1634,7 +1709,7 @@ def test_varied_context( "network": [">=Cancun"], "result": { Address(0xD82F21135ED7D7D833A9F2A0F1CF6C3DA214B8E3): Account( - storage={0: 65535, 1: 20017} + storage={0: 65535, 1: (20017 + sstore_set_delta)} ), }, }, @@ -1643,7 +1718,7 @@ def test_varied_context( "network": [">=Cancun"], "result": { Address(0xD82F21135ED7D7D833A9F2A0F1CF6C3DA214B8E3): Account( - storage={0: 65535, 1: 22117} + storage={0: 65535, 1: (22117 + sstore_set_delta)} ), }, }, @@ -1652,7 +1727,7 @@ def test_varied_context( "network": [">=Cancun"], "result": { compute_create_address(address=contract_20, nonce=0): Account( - storage={0: 65535, 1: 20017} + storage={0: 65535, 1: (20017 + sstore_set_delta)} ), }, }, @@ -1661,7 +1736,7 @@ def test_varied_context( "network": [">=Cancun"], "result": { compute_create_address(address=contract_20, nonce=0): Account( - storage={0: 65535, 1: 22117} + storage={0: 65535, 1: (22117 + sstore_set_delta)} ), }, }, @@ -1670,7 +1745,7 @@ def test_varied_context( "network": [">=Cancun"], "result": { Address(0x530508498D2AA75D8E591612809FEC3D37A45615): Account( - storage={0: 65535, 1: 20017} + storage={0: 65535, 1: (20017 + sstore_set_delta)} ), }, }, @@ -1679,7 +1754,7 @@ def test_varied_context( "network": [">=Cancun"], "result": { Address(0x530508498D2AA75D8E591612809FEC3D37A45615): Account( - storage={0: 65535, 1: 22117} + storage={0: 65535, 1: (22117 + sstore_set_delta)} ), }, }, @@ -1688,7 +1763,7 @@ def test_varied_context( "network": [">=Cancun"], "result": { compute_create_address(address=contract_22, nonce=0): Account( - storage={0: 65535, 1: 20017, 2: 117} + storage={0: 65535, 1: (20017 + sstore_set_delta), 2: 117} ), }, }, @@ -1697,7 +1772,7 @@ def test_varied_context( "network": [">=Cancun"], "result": { compute_create_address(address=contract_22, nonce=0): Account( - storage={0: 65535, 1: 22117, 2: 117} + storage={0: 65535, 1: (22117 + sstore_set_delta), 2: 117} ), }, }, @@ -1706,7 +1781,7 @@ def test_varied_context( "network": [">=Cancun"], "result": { Address(0x83FBDAE70258AC0FA837B701CC63CEDF48D4B6BF): Account( - storage={0: 65535, 1: 20017, 2: 117} + storage={0: 65535, 1: (20017 + sstore_set_delta), 2: 117} ), }, }, @@ -1715,7 +1790,7 @@ def test_varied_context( "network": [">=Cancun"], "result": { Address(0x83FBDAE70258AC0FA837B701CC63CEDF48D4B6BF): Account( - storage={0: 65535, 1: 22117, 2: 117} + storage={0: 65535, 1: (22117 + sstore_set_delta), 2: 117} ), }, }, @@ -1723,14 +1798,18 @@ def test_varied_context( "indexes": {"data": [34], "gas": -1, "value": -1}, "network": [">=Cancun"], "result": { - contract_25: Account(storage={0: 24743, 1: 20017, 2: 117}) + contract_25: Account( + storage={0: 24743, 1: (20017 + sstore_set_delta), 2: 117} + ) }, }, { "indexes": {"data": [35], "gas": -1, "value": -1}, "network": [">=Cancun"], "result": { - contract_25: Account(storage={0: 24743, 1: 22117, 2: 117}) + contract_25: Account( + storage={0: 24743, 1: (22117 + sstore_set_delta), 2: 117} + ) }, }, ] diff --git a/tests/ported_static/stHomesteadSpecific/test_create_contract_via_transaction_cost53000.py b/tests/ported_static/stHomesteadSpecific/test_create_contract_via_transaction_cost53000.py index aaa0ab8e85..6468bb554b 100644 --- a/tests/ported_static/stHomesteadSpecific/test_create_contract_via_transaction_cost53000.py +++ b/tests/ported_static/stHomesteadSpecific/test_create_contract_via_transaction_cost53000.py @@ -3,6 +3,12 @@ Ported from: state_tests/stHomesteadSpecific/createContractViaTransactionCost53000Filler.json + +@manually-enhanced: Do not overwrite. `tx.gas_limit` was raised from +100 000 to 500 000 (and sender funding bumped accordingly) so the +contract-creation tx clears the EIP-8037 intrinsic-gas floor on +Amsterdam. The test only asserts that the tx ran (sender.nonce == 1); +the higher gas budget doesn't change that post-state on any fork. """ import pytest @@ -15,6 +21,7 @@ StateTestFiller, Transaction, ) +from execution_testing.forks import Fork REFERENCE_SPEC_GIT_PATH = "N/A" REFERENCE_SPEC_VERSION = "N/A" @@ -29,10 +36,19 @@ def test_create_contract_via_transaction_cost53000( state_test: StateTestFiller, pre: Alloc, + fork: Fork, ) -> None: """Trigger transaction creating gasPrice in the state.""" coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - sender = pre.fund_eoa(amount=0xF4240) + # On EIP-8037 the contract-creation tx needs more gas to clear the + # intrinsic floor, and the sender therefore needs more balance to + # afford the upfront cost. Pre-EIP-8037 keeps the original values. + tx_gas_limit = 100000 + sender_amount = 0xF4240 + if fork.is_eip_enabled(8037): + tx_gas_limit = 500000 + sender_amount = 0x4C4B40 + sender = pre.fund_eoa(amount=sender_amount) env = Environment( fee_recipient=coinbase, @@ -47,7 +63,7 @@ def test_create_contract_via_transaction_cost53000( sender=sender, to=None, data=Bytes(""), - gas_limit=100000, + gas_limit=tx_gas_limit, ) post = {sender: Account(nonce=1)} diff --git a/tests/ported_static/stInitCodeTest/test_call_the_contract_to_create_empty_contract.py b/tests/ported_static/stInitCodeTest/test_call_the_contract_to_create_empty_contract.py index 08cb3cc54f..45c06cfb5f 100644 --- a/tests/ported_static/stInitCodeTest/test_call_the_contract_to_create_empty_contract.py +++ b/tests/ported_static/stInitCodeTest/test_call_the_contract_to_create_empty_contract.py @@ -3,6 +3,10 @@ Ported from: state_tests/stInitCodeTest/CallTheContractToCreateEmptyContractFiller.json + +@manually-enhanced: Do not overwrite. tx gas budget bumped +for EIP-8037 NEW_ACCOUNT state-gas headroom on Amsterdam (post-state +expectations are unchanged on all forks). """ import pytest @@ -16,6 +20,7 @@ Transaction, compute_create_address, ) +from execution_testing.forks import Fork from execution_testing.vm import Op REFERENCE_SPEC_GIT_PATH = "N/A" @@ -32,6 +37,7 @@ def test_call_the_contract_to_create_empty_contract( state_test: StateTestFiller, pre: Alloc, + fork: Fork, ) -> None: """Test_call_the_contract_to_create_empty_contract.""" coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) @@ -54,11 +60,16 @@ def test_call_the_contract_to_create_empty_contract( nonce=0, ) + # EIP-8037 NEW_ACCOUNT state-gas spill on Amsterdam; pre-EIP-8037 + # keeps the original 100 000 budget. + tx_gas_limit = 100_000 + if fork.is_eip_enabled(8037): + tx_gas_limit = 500_000 tx = Transaction( sender=sender, to=contract_0, data=Bytes("00"), - gas_limit=100000, + gas_limit=tx_gas_limit, value=1, ) diff --git a/tests/ported_static/stPreCompiledContracts/test_precomps_eip2929_cancun.py b/tests/ported_static/stPreCompiledContracts/test_precomps_eip2929_cancun.py index 1a3ac8c28c..27dbb54b3a 100644 --- a/tests/ported_static/stPreCompiledContracts/test_precomps_eip2929_cancun.py +++ b/tests/ported_static/stPreCompiledContracts/test_precomps_eip2929_cancun.py @@ -3,6 +3,17 @@ Ported from: state_tests/stPreCompiledContracts/precompsEIP2929CancunFiller.yml + +@manually-enhanced: Do not overwrite. 87 parametrizations of this +test measure the regular gas consumed by a CALL with value to an +inactive precompile address. EIP-8037 replaces the Cancun-era +CALL_NEW_ACCOUNT cost of 25 000 with a per-new-account state-gas +charge of `STATE_BYTES_PER_NEW_ACCOUNT (112) * COST_PER_STATE_BYTE +(1174) = 131 488`. With an empty reservoir (the case here), the +full state-gas spills back into regular gas, so `Op.GAS` reads ++106 488 (= 131 488 - 25 000) compared to Cancun. Bake that delta +into the two affected `[">=Cancun"]` expect-entries fork-condition- +ally; the third entry is gated to `["Cancun"]` only and unchanged. """ import pytest @@ -3580,6 +3591,13 @@ def test_precomps_eip2929_cancun( nonce=1, ) + # EIP-8037 replaces the 25 000 CALL_NEW_ACCOUNT base cost with a + # 131 488 state-gas charge. With an empty reservoir the full + # state-gas spills into regular gas, so Op.GAS reads +106 488. + new_account_delta = ( + (fork.create_state_gas() - 25000) if fork.is_eip_enabled(8037) else 0 + ) + expect_entries_: list[dict] = [ { "indexes": { @@ -4218,7 +4236,9 @@ def test_precomps_eip2929_cancun( "value": -1, }, "network": [">=Cancun"], - "result": {target: Account(storage={0: 0, 1: 25000})}, + "result": { + target: Account(storage={0: 0, 1: 25000 + new_account_delta}) + }, }, { "indexes": { @@ -4227,7 +4247,9 @@ def test_precomps_eip2929_cancun( "value": -1, }, "network": [">=Cancun"], - "result": {target: Account(storage={0: 0, 1: 27500})}, + "result": { + target: Account(storage={0: 0, 1: 27500 + new_account_delta}) + }, }, { "indexes": { diff --git a/tests/ported_static/stPreCompiledContracts2/test_call_ecrecover_overflow.py b/tests/ported_static/stPreCompiledContracts2/test_call_ecrecover_overflow.py index 2ab57c9a76..f88c2d7b05 100644 --- a/tests/ported_static/stPreCompiledContracts2/test_call_ecrecover_overflow.py +++ b/tests/ported_static/stPreCompiledContracts2/test_call_ecrecover_overflow.py @@ -3,6 +3,13 @@ Ported from: state_tests/stPreCompiledContracts2/CallEcrecover_OverflowFiller.yml + +@manually-enhanced: Do not overwrite. `tx_gas` raised from 100 000 to +500 000 so the two outer SSTOREs that wrap the ecrecover precompile +CALL have headroom for EIP-8037 per-storage state-gas on Amsterdam. +The inner CALL still passes exactly 3 000 gas (the ecrecover precompile +cost — that's the test premise); only the outer tx budget grew. Post- +state expectations are unchanged on all forks. """ import pytest @@ -274,7 +281,15 @@ def test_call_ecrecover_overflow( 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD036413F ), ] - tx_gas = [100000] + # On Amsterdam the two outer SSTOREs that wrap the inner ecrecover + # CALL each accumulate EIP-8037 per-storage state-gas (37 568) that + # spills back into regular gas once the empty reservoir is drained, + # pushing the tx over the original 100 000 budget. Bump on EIP-8037 + # only; pre-EIP-8037 forks keep the original. + outer_tx_gas = 100000 + if fork.is_eip_enabled(8037): + outer_tx_gas = 500000 + tx_gas = [outer_tx_gas] tx_value = [100000] tx = Transaction( diff --git a/tests/ported_static/stRevertTest/test_revert_opcode_in_init.py b/tests/ported_static/stRevertTest/test_revert_opcode_in_init.py index c5c7e8af07..ffd62a548e 100644 --- a/tests/ported_static/stRevertTest/test_revert_opcode_in_init.py +++ b/tests/ported_static/stRevertTest/test_revert_opcode_in_init.py @@ -3,6 +3,10 @@ Ported from: state_tests/stRevertTest/RevertOpcodeInInitFiller.json + +@manually-enhanced: Do not overwrite. tx gas budget bumped +for EIP-8037 NEW_ACCOUNT state-gas headroom on Amsterdam (post-state +expectations are unchanged on all forks). """ import pytest @@ -69,7 +73,12 @@ def test_revert_opcode_in_init( + Op.REVERT(offset=0x0, size=0x1) + Op.SSTORE(key=0x1, value=0x11), ] - tx_gas = [160000] + # EIP-8037 NEW_ACCOUNT + init-code state-gas spill on Amsterdam; + # pre-EIP-8037 keeps the original 160 000 budget. + outer_tx_gas = 160_000 + if fork.is_eip_enabled(8037): + outer_tx_gas = 800_000 + tx_gas = [outer_tx_gas] tx_value = [0, 10] tx = Transaction( diff --git a/tests/ported_static/stWalletTest/test_day_limit_construction.py b/tests/ported_static/stWalletTest/test_day_limit_construction.py index 4206fa7b77..f2795bb1d5 100644 --- a/tests/ported_static/stWalletTest/test_day_limit_construction.py +++ b/tests/ported_static/stWalletTest/test_day_limit_construction.py @@ -3,6 +3,10 @@ Ported from: state_tests/stWalletTest/dayLimitConstructionFiller.json + +@manually-enhanced: Do not overwrite. Both `tx_gas` values bumped for +EIP-8037 NEW_ACCOUNT state-gas headroom on Amsterdam (the test has the +same post-state for both g indexes — both are 'should succeed' paths). """ import pytest @@ -75,7 +79,14 @@ def test_day_limit_construction( "606060409081526001600081815581805533600160a060020a0316600381905581526101026020529190912055620151804204610107556109b4806100456000396000f300606060405236156100985760e060020a6000350463173825d9811461009a5780632f54bf6e146100f65780634123cb6b1461011a5780635c52c2f5146101235780637065cb4814610154578063746c917114610188578063b20d30a914610191578063b75c7dc6146101c5578063ba51a6df146101f5578063c2cf732614610229578063f00d4b5d14610269578063f1736d86146102a2575b005b6100986004356000600036436040518084848082843750505090910190815260405190819003602001902090506105b9815b600160a060020a0333166000908152610102602052604081205481808083811415610719576108b0565b6102ac6004355b600160a060020a0316600090815261010260205260408120541190565b6102ac60015481565b6100986000364360405180848480828437505050909101908152604051908190036020019020905061070b816100cc565b61009860043560003643604051808484808284375050509091019081526040519081900360200190209050610531816100cc565b6102ac60005481565b610098600435600036436040518084848082843750505090910190815260405190819003602001902090506106ff816100cc565b610098600435600160a060020a03331660009081526101026020526040812054908080838114156102be57610340565b61009860043560003643604051808484808284375050509091019081526040519081900360200190209050610678816100cc565b6102ac600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156106d1576106f5565b6100986004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506103ca816100cc565b6102ac6101055481565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156103405781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156103c3576103d8836100fd565b156103e357506103c5565b600160a060020a03841660009081526101026020526040812054925082141561040c57506103c5565b6103475b6101045460005b8181101561085f576101048054829081101561000257600091825260008051602061099483398151915201541461048a5761010480546101039160009184908110156100025760008051602061099483398151915201548252506020919091526040812081815560018101829055600201555b600101610417565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561052c5761053f826100fd565b1561054a575061052e565b610552610410565b60015460fa90106105675761056561057c565b505b60015460fa9010610492575061052e565b6106365b600060015b600154811015610899575b600154811080156105ac5750600281610100811015610002570154600014155b156108b95760010161058c565b156103c557600160a060020a0383166000908152610102602052604081205492508214156105e7575061052c565b6001600160005054036000600050541115610602575061052c565b600060028361010081101561000257508301819055600160a060020a03841681526101026020526040812055610578610410565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561052c5760015482111561068d575061052e565b600082905561069a610410565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106f057600094506106f5565b600194505b5050505092915050565b1561052c575061010555565b1561052e5760006101065550565b60008681526101036020526040812080549094509092508214156107a2578154835560018381018390556101048054918201808255828015829011610771578183600052602060002091820191016107719190610885565b5050506002840181905561010480548892908110156100025760009190915260008051602061099483398151915201555b506001820154600284900a908116600014156108b05760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a182546001901161089d57600086815261010360205260409020600201546101048054909190811015610002576040600090812060008051602061099483398151915292909201819055808255600180830182905560029092015595506108b09050565b61010480546000808355919091526103c590600080516020610994833981519152908101905b808211156108995760008155600101610885565b5090565b8254600019018355600183018054821790555b50505050919050565b5b600180541180156108dc57506001546002906101008110156100025701546000145b156108f057600180546000190190556108ba565b600154811080156109135750600154600290610100811015610002570154600014155b801561092d57506002816101008110156100025701546000145b1561098e57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61058156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 ), ] - tx_gas = [817083, 1217083] + # The deployed wallet contract does ~14 fresh SSTOREs during + # construction; EIP-8037 per-storage state-gas spills into regular + # gas on Amsterdam, exceeding the original 817 083 / 1 217 083 + # budgets. Pre-EIP-8037 keeps the original values. + construction_tx_gas = [817_083, 1_217_083] + if fork.is_eip_enabled(8037): + construction_tx_gas = [5_000_000, 7_000_000] + tx_gas = construction_tx_gas tx_value = [100] tx = Transaction( diff --git a/tests/ported_static/stWalletTest/test_wallet_construction.py b/tests/ported_static/stWalletTest/test_wallet_construction.py index 3127da7cf6..63ffd58136 100644 --- a/tests/ported_static/stWalletTest/test_wallet_construction.py +++ b/tests/ported_static/stWalletTest/test_wallet_construction.py @@ -3,6 +3,10 @@ Ported from: state_tests/stWalletTest/walletConstructionFiller.json + +@manually-enhanced: Do not overwrite. Both `tx_gas` values bumped for +EIP-8037 NEW_ACCOUNT state-gas headroom on Amsterdam (the test has the +same post-state for both g indexes — both are 'should succeed' paths). """ import pytest @@ -75,7 +79,14 @@ def test_wallet_construction( "6060604052604051602080611014833960806040818152925160016000818155818055600160a060020a03331660038190558152610102909452938320939093556201518042046101075582917f102d25c49d33fcdb8976a3f2744e0785c98d9e43b88364859e6aec4ae82eff5c91a250610f958061007f6000396000f300606060405236156100b95760e060020a6000350463173825d9811461010b5780632f54bf6e146101675780634123cb6b1461018f5780635c52c2f5146101985780637065cb48146101c9578063746c9171146101fd578063797af62714610206578063b20d30a914610219578063b61d27f61461024d578063b75c7dc61461026e578063ba51a6df1461029e578063c2cf7326146102d2578063cbf0b0c014610312578063f00d4b5d14610346578063f1736d861461037f575b61038960003411156101095760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b565b610389600435600060003643604051808484808284375050509091019081526040519081900360200190209050610693815b600160a060020a0333166000908152610102602052604081205481808083811415610c1357610d6c565b61038b6004355b600160a060020a03811660009081526101026020526040812054115b919050565b61038b60015481565b610389600036436040518084848082843750505090910190815260405190819003602001902090506107e58161013d565b6103896004356000364360405180848480828437505050909101908152604051908190036020019020905061060b8161013d565b61038b60005481565b61038b6004355b600081610a4b8161013d565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107d98161013d565b61038b6004803590602480359160443591820191013560006108043361016e565b610389600435600160a060020a033316600090815261010260205260408120549080808381141561039d5761041f565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107528161013d565b61038b600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156107ab576107cf565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107f38161013d565b6103896004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506104ac8161013d565b61038b6101055481565b005b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a929083168190111561041f5781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a03831660028361010081101561000257508301819055600160a060020a03851660008181526101026020908152604080832083905584835291829020869055815192835282019290925281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156104a5576104ba8361016e565b156104c557506104a7565b600160a060020a0384166000908152610102602052604081205492508214156104ee57506104a7565b6104265b6101045460005b81811015610eba57610104805461010891600091849081101561000257600080516020610f7583398151915201548252506020918252604081208054600160a060020a0319168155600181018290556002810180548382559083528383209193610f3f92601f9290920104810190610a33565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b15610606576106198261016e565b156106245750610608565b61062c6104f2565b60015460fa90106106415761063f610656565b505b60015460fa901061056c5750610608565b6107105b600060015b600154811015610a47575b600154811080156106865750600281610100811015610002570154600014155b15610d7557600101610666565b156104a757600160a060020a0383166000908152610102602052604081205492508214156106c15750610606565b60016001600050540360006000505411156106dc5750610606565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556106526104f2565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b15610606576001548211156107675750610608565b60008290556107746104f2565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156107ca57600094506107cf565b600194505b5050505092915050565b15610606575061010555565b156106085760006101065550565b156106065781600160a060020a0316ff5b15610a2357610818846000610e4f3361016e565b156108d4577f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd00433858786866040518086600160a060020a0316815260200185815260200184600160a060020a031681526020018060200182810382528484828181526020019250808284378201915050965050505050505060405180910390a184600160a060020a03168484846040518083838082843750505090810191506000908083038185876185025a03f15060009350610a2392505050565b6000364360405180848480828437505050909101908152604051908190036020019020915061090490508161020d565b158015610927575060008181526101086020526040812054600160a060020a0316145b15610a235760008181526101086020908152604082208054600160a060020a03191688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610a2b579182015b82811115610a2b57823582600050559160200191906001019061097c565b50600050507f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf328133868887876040518087815260200186600160a060020a0316815260200185815260200184600160a060020a03168152602001806020018281038252848482818152602001925080828437820191505097505050505050505060405180910390a15b949350505050565b5061099a9291505b80821115610a475760008155600101610a33565b5090565b15610c005760008381526101086020526040812054600160a060020a031614610c0057604080516000918220805460018201546002929092018054600160a060020a0392909216949293909291819084908015610acd57820191906000526020600020905b815481529060010190602001808311610ab057829003601f168201915b50509250505060006040518083038185876185025a03f1505050600084815261010860209081526040805181842080546001820154600160a060020a033381811686529685018c905294840181905293166060830181905260a06080840181815260029390930180549185018290527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a985095968b969294929390929160c083019085908015610ba257820191906000526020600020905b815481529060010190602001808311610b8557829003601f168201915b505097505050505050505060405180910390a160008381526101086020908152604082208054600160a060020a031916815560018101839055600281018054848255908452828420919392610c0692601f9290920104810190610a33565b50919050565b505050600191505061018a565b6000868152610103602052604081208054909450909250821415610c9c578154835560018381018390556101048054918201808255828015829011610c6b57818360005260206000209182019101610c6b9190610a33565b50505060028401819055610104805488929081101561000257600091909152600080516020610f7583398151915201555b506001820154600284900a90811660001415610d6c5760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1825460019011610d59576000868152610103602052604090206002015461010480549091908110156100025760406000908120600080516020610f758339815191529290920181905580825560018083018290556002909201559550610d6c9050565b8254600019018355600183018054821790555b50505050919050565b5b60018054118015610d9857506001546002906101008110156100025701546000145b15610dac5760018054600019019055610d76565b60015481108015610dcf5750600154600290610100811015610002570154600014155b8015610de957506002816101008110156100025701546000145b15610e4a57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61065b565b1561018a5761010754610e655b62015180420490565b1115610e7e57600061010655610e79610e5c565b610107555b6101065480830110801590610e9c5750610106546101055490830111155b15610eb25750610106805482019055600161018a565b50600061018a565b6106066101045460005b81811015610f4a5761010480548290811015610002576000918252600080516020610f75833981519152015414610f3757610104805461010391600091849081101561000257600080516020610f7583398151915201548252506020919091526040812081815560018101829055600201555b600101610ec4565b5050506001016104f9565b61010480546000808355919091526104a790600080516020610f7583398151915290810190610a3356004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 ), ] - tx_gas = [1225023, 1825023] + # The deployed wallet contract does ~21 fresh SSTOREs during + # construction; EIP-8037 per-storage state-gas spills into regular + # gas on Amsterdam, exceeding the original 1 225 023 / 1 825 023 + # budgets. Pre-EIP-8037 keeps the original values. + construction_tx_gas = [1_225_023, 1_825_023] + if fork.is_eip_enabled(8037): + construction_tx_gas = [8_000_000, 10_000_000] + tx_gas = construction_tx_gas tx_value = [100] tx = Transaction(