This EIP modifies the block gas accounting mechanism to prevent the circumvention of block gas limits. It proposes that gas refunds, particularly those from SSTORE operations setting storage slots to zero, should not reduce the gas counted toward the block gas limit, while still being applied to transaction gas costs for users.
Currently, gas refunds from operations like clearing storage slots (setting to zero) reduce both the transaction gas cost for users and the gas counted toward the block gas limit. This creates a discrepancy between the computational work performed and the gas accounted for in the block.
Example: Block 20878522 shows a net usage of 28.5 MGas, but contains 4.01 MGas of refunds, bringing the gross usage to 32.51 MGas—exceeding the block gas limit by 2.51 MGas.
This mechanism can be exploited to perform more operations in a block than the gas limit intends to allow, potentially leading to:
User Gas Accounting (Unchanged):
Users continue to receive gas refunds for operations that qualify (e.g., setting storage to zero)
Transaction gas: gas_spent = max(tx_gas_used - gas_refund, calldata_floor_gas_cost)
Block Gas Accounting (Modified):
When calculating gas for block gas limit enforcement, refunds are not subtracted
block.gas_used += max(tx_gas_used, calldata_floor_gas_cost) (incorporating the calldata floor from EIP-7623)The block gas limit is designed to constrain the computational load per block. Gas refunds were introduced to incentivize "cleaning up" the state, not to allow exceeding computational limits. By excluding refunds from block gas accounting, we ensure the block gas limit effectively constrains computational load
Users still receive gas refunds, maintaining incentives for efficient state management. Only the accounting for block-level constraints changes, not the economics for individual users
Verify blocks containing many storage-clearing operations still adhere to gas limits
Block Gas Limit Edge Cases:
Ensure blocks cannot exceed gas limits through refund mechanisms
Transaction Gas vs Block Gas:
Copyright and related rights waived via CC0.