From 7771d278b7aa754e9a26368554cd01ebc479d6c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Wed, 3 Jun 2026 14:49:10 +0200 Subject: [PATCH] fix(tests): accept tx- or block-level exception for over-budget block (EIP-7778) (#2949) In test_multi_transaction_gas_accounting, a block whose included transaction exceeds the remaining block gas was expected to fail only with the block-level BlockException.GAS_USED_OVERFLOW. A client may legitimately report the same condition at the transaction level: EELS raises GasUsedExceedsLimitError (an InvalidTransaction subclass) when `tx.gas > gas_available`, and evmone reports it as a rejected transaction (GAS_LIMIT_REACHED). List both BlockException.GAS_USED_OVERFLOW and TransactionException.GAS_ALLOWANCE_EXCEEDED as acceptable so either categorization passes. --- .../test_gas_accounting.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/amsterdam/eip7778_block_gas_accounting_without_refunds/test_gas_accounting.py b/tests/amsterdam/eip7778_block_gas_accounting_without_refunds/test_gas_accounting.py index d1b9f9121af..dfead7f5006 100644 --- a/tests/amsterdam/eip7778_block_gas_accounting_without_refunds/test_gas_accounting.py +++ b/tests/amsterdam/eip7778_block_gas_accounting_without_refunds/test_gas_accounting.py @@ -327,7 +327,10 @@ def test_multi_transaction_gas_accounting( blocks=[ Block( txs=txs, - exception=BlockException.GAS_USED_OVERFLOW + exception=[ + BlockException.GAS_USED_OVERFLOW, + TransactionException.GAS_ALLOWANCE_EXCEEDED, + ] if exceed_block_gas_limit else None, expected_gas_used=total_block_gas_used