EIP-7778: Prevent Block Gas Smuggling

Exclude Discounts & Refunds for Block GasLimit Enforcement

Complementary to to

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.

Link:
https://github.com/ethereum/EIPs/pull/8918

Regarding receipt encoding, what should be encoded in the receipt of the tx? We have a cumulative gas used field there. I think the encoded cumulative gas used here should reflect what gas was used in the block, i.e. evm_gas_used?

It should be the gas used without refunds (i.e. the value used for the block gaslimit/target check); so would be higher than the sum of the gas charged per tx

I think that receipts should have both value, as both are useful:

  • higher value (before refund) - when calculating/validating total gas used in the block
  • lower value (after refund) - block explorers when showing how much user paid for transaction

When it comes to naming, I suggest:

  • keep cumulativeGasUsed and gasUsed be the values used for block limit calculations (keep consistent naming)
  • add new field for gas after refund, e.g.: gasPaid

Right now, even though this is not very clearly spec’d in the EIP, the gas_used in the receipt would represent the gas used after applying the refund.
For validating the block gas limit using the receipts, you would need to keep track of the refund of each transaction during execution and when doing the cumulative sum, add every refund to the gas used of the respective transaction.

Thanks for bringing this up. I’ll make a PR to clarify that in the EIP.

EDIT: PR as promised:

1 Like