Prevent the circumvention of the block gas limit by excluding certain gas discounts and refunds from block gas accounting, except for those reflecting actual reductions in computational work.
This proposal aims to align the block gas usage with the Ethereum Virtual Machine's (EVM) real workload, preventing "block gas smuggling." It complements EIP-7623 by further reducing the maximum block size and its variance, enhancing network stability and efficiency.
Example block 20878522
"uses" 28.5 MGas, but also in that net figure is 4.01 MGas of refunds for a total of 32.51 MGas gross; which is 2.51MGas above the current mainnet block gaslimit.
This EIP modifies the gas accounting mechanism to prevent block gas smuggling — situations where transactions include more gas-consuming operations than the block gas limit intends due to gas discounts and refunds.
By excluding these discounts and refunds from block gas limit calculations, except for those corresponding to actual workload reductions (e.g., warm storage accesses, SSTORE
reverting to original values), the proposal ensures that the block gas limit accurately reflects the EVM's computational and storage workload.
It complements EIP-7623, which increases calldata costs for data availability (DA) transactions, by further reducing maximum block sizes and over-the-wire data.
This "smuggling" allows for oversized blocks, leading to network instability and potential denial-of-service (DoS) vectors.
Need for Change:
Encourage the adoption of more efficient data availability solutions (e.g., blobs from EIP-4844).
Complementary Approach:
User Gas Costs:
SSTORE
Operations:
Warm vs. Cold Storage Access Costs:
Block Gas Accounting:
SSTORE
Operations:
With EIP-7623 for transactions, the gas used (tx.gasUsed
) is calculated as:
tx.gasUsed = {
21000 \
+
max (
STANDARD_TOKEN_COST * tokens_in_calldata \
+ evm_gas_used \
+ isContractCreation * (32000 + InitCodeWordGas * words(calldata)),
TOTAL_COST_FLOOR_PER_TOKEN * tokens_in_calldata
)
With this eip for evm_gas_used
the user tx price the gas used remains the same:
tx.evm_gas_used = evm_gas_used - evm_gas_refund
However when calculating the block gas used, the refund is not considered
block.evm_gas_used += evm_gas_used
DA-Heavy Transactions:
Transactions with large calldata used for DA are charged higher costs.
Verify that such transactions cannot cause the block gas usage to exceed limits.
Regular Transactions:
Transactions with typical calldata and EVM usage are processed as usual.
Ensure that user costs and block gas accounting reflect minimal changes.
SSTORE
Operations:
Reset to Zero:
Revert to Original Value:
Warm vs. Cold Storage Accesses:
Discounts for warm accesses are preserved in both user costs and block gas accounting.
Verify accurate representation of computational effort.
Blocks Near Gas Limit:
Construct blocks to test the new gas limit enforcement.
Copyright and related rights waived via CC0 1.0 Universal.