EIP-8445: Common Computational Gas Scaling Factor

Discussion topic for EIP-8445

Abstract

This EIP introduces a common scaling factor, CPCU (cost per computational unit), for pricing computational opcodes in the Ethereum Virtual Machine (EVM). The factor decouples the relative gas costs of computational operations from their absolute gas prices, allowing the latter to be adjusted collectively at hard fork boundaries without individually repricing each opcode.

At activation, CPCU is set to 1 gas/CU, preserving the existing gas costs of the covered computational opcodes. Future EIPs MAY adjust CPCU to change their absolute costs while preserving their relative pricing. The factor remains fixed within each hard fork and does not automatically change in response to network conditions or changes to the block gas limit.

Motivation

As the block gas limit increases, resources that do not scale sufficiently well with transaction throughput may need to be repriced to keep worst-case execution and validation costs bounded. Such repricing can introduce several challenges:

  • Compatibility: Contracts that hardcode gas limits may fail because the available gas is no longer sufficient to execute their intended operations.
  • User experience: Increasing absolute gas costs may increase transaction fees denominated in ETH, particularly during periods of network congestion.
  • Implementation complexity: Different resources may have different scaling characteristics. If multiple resources require repricing as the block gas limit increases, coordinating these changes can complicate hard fork implementation and testing.

By introducing a common scaling factor for computational opcodes, this proposal provides several benefits:

  • Reduced implementation complexity: A single parameter can be selected and updated at hard fork boundaries to adjust the prices of all covered computational opcodes. This is particularly useful when scaling efforts focus on computation, as it simplifies the process of adjusting computational prices across hard forks.
  • Avoidance of additional computational repricing costs: Keeping computational gas prices unchanged or reducing them avoids introducing an additional increase in the gas required for computation, thereby preserving gas-sensitive contract compatibility and reducing upward pressure on transaction costs caused by computational repricing.
  • More scaling options: Rather than relying exclusively on increasing the block gas limit, which may require increasing the prices of bottleneck resources, the protocol can also explore increasing computational capacity relative to gas by reducing computational gas costs. This provides an additional scaling option without requiring a corresponding increase in the block gas limit.
  • Consistency with common pricing parameters: EIP-8037 introduces CPSB as a common parameter for pricing state creation costs. This proposal applies a similar approach to computational resources by introducing CPCU, allowing their relative prices to be preserved while their absolute gas costs are adjusted according to the network’s scaling requirements.