EIP-8053 Milli-gas for high-precision gas metering

No call decision · Fees & gas · EIP status Draft · created 2025-10-17

Changes the internal EVM gas computation unit to milli-gas, one-thousandth of 1 gas. This allows fractional costs to be charged for cheap operations while leaving the gas units seen by fees and contracts unchanged.

Why it is needed

In the EVM today, pure computation (compute) opcodes such as addition are significantly underpriced relative to state operations that read and write storage. This is because client optimization and hardware advances have made computation faster, while the growing size of Ethereum's state has made state operations slower. This has led to proposals that lower compute costs and raise state costs, but there is a dilemma here. Lowering compute cost causes any operation that should cost less than 1 gas to be rounded up to 1 gas, reducing the number of operations that fit in a block. According to the source's analysis, the average rounding error reaches 59.3% against a 50Mgas/s anchor. Conversely, pegging the fastest opcode at 1 gas and repricing everything else upward would inflate gas costs and limits roughly a hundredfold, forcing users to relearn the concept of gas itself. This proposal avoids both problems by splitting only the internal EVM computation into thousandths.

What changes

Today

After EIP-8053

Who is affected

In depth

Replacing the internal counter: gas_left to milli_gas_left

The gas_left variable in the EVM's internal state is changed to a Uint-typed milli_gas_left, and every reference to evm.gas_left is replaced with evm.milli_gas_left. Gas costs are defined in milli_gas, and all internal EVM gas accounting is done in milli_gas. Transaction fees, transaction gas limits, and block gas limits, on the other hand, are still calculated and validated using the existing gas_used counter. There is no change to blob gas accounting, refunds, or calldata gas accounting. An alternative of changing the variable type to a float or fraction was considered, but since that would require large changes to the EVM implementation and complicate zkEVM implementation, the original text explains that introducing a new counter is the approach that disturbs the current EVM implementation least while allowing expressive gas costs.

Conversion at the start and end of a transaction

The top-level frame starts with milli_gas_left = gas_left * 1000. Here, gas_left is the execution gas budget computed by EIP-8037 at the start of the transaction, which for a transaction without a reservoir is (tx.gas - intrinsic_gas) * 1000. Transaction-level quantities such as intrinsic gas and the calldata floor remain in gas units. At the end of a transaction, tx_output.gas_left = evm.milli_gas_left // 1000 rounds the remaining gas down, so the gas spent is rounded up. The gas used before refunds is tx.gas - tx_output.gas_left as before, and the refund cap is computed from this rounded usage. The cost a single transaction pays due to rounding is less than 1 gas. As a test case, a transaction that ends with milli_gas_left = 1,999 has a tx_output.gas_left of 1 gas.

Opcode costs: existing values multiplied by 1000, formulas and refunds stay in gas units

Existing gas parameters that are not updated concurrently with or after this proposal are multiplied by 1000 when charged against milli_gas_left, via GAS_PARAM = GAS_PARAM * 1000. This includes memory expansion, precompile costs, and GAS_CALL_STIPEND. Formulas involving division, such as the memory expansion cost 3 x words + words^2 // 512, or MODEXP, are computed in gas units as before and then multiplied by 1000 for the result. This yields the same integer gas value. For example, a 100-word expansion is (3 x 100 + 100^2 // 512) x 1000 = 319,000 milli-gas, not 300,000 + 100^2 x 1000 // 512 = 319,531. The refund counter remains in gas units, so refund parameters are not multiplied, and refunds derived from milli-gas costs are recorded in rounded-down gas units.

Contract boundaries stay in gas units: GAS, calls, stipend

Deployed contracts spend gas through three channels: reading GAS, the gas argument to a call, and the 2,300 gas stipend, and all three remain in gas units. If the units did not match, a contract passing gasleft() - 5000 would end up leaving only 5 gas instead of 5,000 gas, among other problems. GAS rounds milli_gas_left // 1000 up after flooring, so a contract never sees more gas than it actually has. The gas argument to CALL, CALLCODE, DELEGATECALL, and STATICCALL is in gas units, and the EIP-150 rule is applied to whole = available // 1000, passing message_call_milli_gas = min(gas, max_gas) * 1000. The remainder below 1 gas stays with the calling frame, and when the child returns, the unused milli-gas is returned exactly, without rounding. EIP-2200's SSTORE check compares milli_gas_left against GAS_CALL_STIPEND * 1000, so a frame holding only the stipend still cannot execute SSTORE.

Why a factor of 1000, why round at the transaction level

The factor of 1000 sets the smallest unit of cost to 1 milli-gas. In the original analysis, anchored on 50 Mgas/s, JUMPDEST, the cheapest opcode, comes out exactly to 90 milli-gas (0.09 gas), and the error is at most 1% for every price of 50 milli-gas or more. A fee schedule that needs cheaper prices would require a larger factor such as 10,000, but even then, at EIP-7825's transaction gas limit this is about 1.7 x 10^11 units, which still fits in a 64-bit counter. Changing the factor changes every gas table, so the factor should be set together with the fee schedule that first introduces fractional pricing. Converting at the block level would produce less error but would require converting fee and limit calculations to milli-gas as well, a much larger change. In a sample of 1,000 mainnet blocks, transaction-level conversion alone reduced the average rounding error from 4% to 0.05%, so the original text concludes that transaction-level rounding is sufficient.

Interaction with EIP-8037 state gas and EIP-8141 frames

milli_gas_left replaces EIP-8037's gas_left. state_gas_reservoir, evm_state_gas_used, and their snapshots remain in gas units, because state gas costs are integer multiples of a per-byte cost and milli-gas adds no precision there. Amounts that EIP-8037 subtracts from or compares against gas_left are multiplied by 1000 before being applied to milli_gas_left, and refills and revert credits go only into the reservoir in gas units, not into milli_gas_left. System calls start with milli_gas_left = 30,000,000 * 1000. When EIP-8141 is active, each frame of a frame transaction starts with milli_gas_left = frame.limits.execution * 1000, and on completion rounds gas_left down, rounding execution gas usage up once per frame. Receipts, FRAMEPARAM, and settlement use this integer gas.

Security considerations: observable effects of cost reductions

The cost reductions this proposal enables have observable effects. Computation-heavy failure-handling code becomes cheaper, so handling that previously ran out of gas may now complete, and loops that run until gasleft() falls below some value will iterate more times. Code whose control flow branches on a read gas value may take a different path after the reduction and then run out of gas. A callee receiving only the 2,300 gas stipend can perform more computation, but still cannot write to storage because of the EIP-2200 check. As computation gets cheaper, more transactions fit in a block, increasing the share of block gas spent on state growth, but this proposal itself does not limit state growth; that role belongs to EIP-8037's state gas dimension. Also, costs below 1 gas must correctly include measurement of fixed, computation-independent costs such as dispatch, gas metering, and tracing, and execution-time-based costs do not track proving costs.

Current status: Draft

This is a Draft-status core standards track EIP created on October 17, 2025, that requires EIP-150, 2200, 2780, and 8037 as prerequisites. It is a backwards-incompatible gas repricing requiring a scheduled network upgrade, but applying this proposal alone, without changing any costs, means every cost is 1000 times an integer gas value, so milli_gas_left is always a multiple of 1000, and transaction outcomes and gas usage remain unchanged. Because it is in Draft status, the details of the specification may still change, and there has been no core developer call decision yet to include it in a specific fork.

Original EIP · ← EIPs