Skip to content

Commit 656ca32

Browse files
committed
fix(tests): 8037 add receipt cumulative check to child-failure refund test
1 parent f8b8ad2 commit 656ca32

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

tests/amsterdam/eip8037_state_creation_gas_cost_increase/test_state_gas_call.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
StateTestFiller,
3030
Storage,
3131
Transaction,
32+
TransactionReceipt,
3233
compute_create2_address,
3334
compute_create_address,
3435
)
@@ -1542,10 +1543,22 @@ def test_child_failure_refunds_state_gas_to_reservoir_not_gas_left(
15421543
),
15431544
)
15441545

1546+
# Empirical per-tx cumulative. Pinning this catches a mutation
1547+
# that correctly restores the reservoir but also double-refunds
1548+
# to regular gas (or otherwise leaks extra gas to the sender),
1549+
# which the storage probe alone cannot discriminate.
1550+
expected_cumulative = {
1551+
Op.CALL: 73_831,
1552+
Op.DELEGATECALL: 73_825,
1553+
}[call_opcode]
1554+
15451555
tx = Transaction(
15461556
to=parent,
15471557
gas_limit=gas_limit_cap + sstore_state_gas,
15481558
sender=pre.fund_eoa(),
1559+
expected_receipt=TransactionReceipt(
1560+
cumulative_gas_used=expected_cumulative,
1561+
),
15491562
)
15501563

15511564
# DELEGATECALL executes the callee in the caller's storage

0 commit comments

Comments
 (0)