EIP-7783 - Add Controlled Gas Limit Increase Strategy

Created 2024-10-06
Status Draft
Type Informational
Authors

This proposal describes the introduction in clients of a controlled gas limit increase strategy to determine the gas limit of a specific block and set as default with conservative parameters, while keeping the possibility to change it in the future to a fixed value.

Abstract

The EIP proposes the introduction of a new gas limit management mechanism that automatically increases the block gas limit over time. The incremental growth is controlled by a fixed rate, ensuring predictable network scaling while preventing sudden surges in block sizes. This strategy is meant to be used as a default setting, with the option to switch to a fixed gas limit if needed (or different parameters).

Motivation

Predictable Gas Limit Growth

Gradual Increase with Deactivation Safeguard

Specification

There are different approaches to implement a controlled gas limit increase strategy. The following are three possible strategies that can be used:

Linear Gas Limit Increase Strategy

Add a new "Gas Limit" selection strategy that takes in Block Number N and spits out the Gas Limit GL for that block. The strategy is as follows:

def compute_gas_limit(blockNum: int, blockNumStart: int, initialGasLimit: int, r: int, gasLimitCap: int) -> int:
  if blockNum < blockNumStart:
    return initialGasLimit
  else:
    return min(gasLimitCap, initialGasLimit + r * (blockNum - blockNumStart))

Where:

If we set blockNumStart to the current block number, initialGasLimit to the current gas limit (30_000_000), r to 6, and gasLimitCap to 60_000_000, the gas limit will increase by 6 gas per block for two years, reaching 30 million gas at the end of a $\approx$ 2 years period. The result of compute_gas_limit will be the gas limit aimed by the proposer for the block blockNum. none of this is enforced at the protocol level, and the proposer needs to still follow protocol rules related to the gas limit.

Stepwise Linear Gas Limit Increase Strategy

Add a new "Gas Limit" selection strategy that takes in Block Number N and spits out the Gas Limit GL for that block. The strategy is as follows:

def compute_gas_limit(blockNum: int, blockNumStart: int, r: int, step_blocks_interval: int, gasLimitCap: int) -> int:
  if blockNum < blockNumStart:
    return initialGasLimit
  else:
    return min(gasLimitCap, initialGasLimit + r * ((blockNum - blockNumStart) // step_blocks_interval))

Where:

This strategy has three main advantages:

Exponential Gas Limit Increase Strategy

Add a new "Gas Limit" selection strategy that takes in Block Number N and spits out the Gas Limit GL for that block. The strategy is as follows:

def compute_gas_limit(blockNum: int, blockNumStart: int, doubling_blocks_interval: int) -> int:
  if blockNum < blockNumStart:
    return initialGasLimit
  else:
    return min(gasLimitCap, initialGasLimit * (2 ** ((blockNum - blockNumStart) / doubling_interval)))

Where:

Rationale

Predictable Growth

Controlled Limit with Deactivation Block

Backwards Compatibility

No Hard Fork Required

Security Considerations

Copyright

Copyright and related rights waived via CC0 1.0 Universal.