EIP-4803 Capping the transaction gas limit upper bound (Limit transaction gas to a maximum of 2^63-1)

No call decision · Fees & gas · EIP status Stagnant · created 2022-02-02

A proposal that defines a transaction as invalid and unable to be included in a block if its gas limit exceeds 2^63-1.

Why it is needed

While the transaction gas limit field allows an arbitrarily long integer by specification, the clients that actually process it each impose their own internal limits. For example, implementations like geth handle gas values as 64-bit integers. When such practical limits are not explicitly fixed in Ethereum's consensus rules, different clients may handle things slightly differently. This is a potential risk to consensus safety, where the entire network must agree on the same result. This proposal pins the gas limit's upper bound at 2^63-1, bringing this implicit discrepancy into the consensus rules.

What changes

Today

After EIP-4803

Who is affected

In depth

Specification details

Adds one new constraint applied retroactively from genesis. A transaction whose gas limit exceeds 2^63-1 is invalid and cannot be included in a block. In other words, the range of valid gas limit values is fixed between 0 and 2^63-1.

Why 2^63-1

The reason 2^63-1 was chosen instead of another value like 2^64-1 is that it is the maximum value representable as a signed integer. Treating gas values as signed integers allows the logic for checking whether gas has been exhausted to be implemented simply by subtracting and comparing whether the result is below zero.

Why a lower bound of 2^31-1 was not used

A lower value such as 2^31-1 was also considered as an alternative. Since JavaScript handles numbers as floating point and can only represent values exactly up to 2^53-1, a lower value would have had the advantage of being easier to handle in JavaScript environments, but it was not adopted.

The actual state of current implementations

RLP encoding itself does not impose a fixed upper bound, but in practice most implementations only handle values up to 256 bits. In addition, major client implementations including geth internally treat gas values as 64-bit integers. This proposal codifies this de facto standard practice as a consensus rule.

Backward compatibility

This change is technically a breaking change, but it is explained that it should have no visible impact in practice. Before EIP-1559, for transactions with gasPrice of 0, the condition gasLimit × gasPrice ≤ account balance alone could not constrain the gasLimit value, so in theory an arbitrarily large gasLimit could be allowed. However, because of the rule that a transaction list cannot exceed the block gas limit, and the strict rules on how much the block gas limit itself can change, no arbitrarily large gasLimit value has actually existed in past chain state.

Security considerations and current status

The source does not specify separate security considerations and states only "None." This proposal is currently in Stagnant status, halted without active discussion or a fork-inclusion decision.

Original EIP · ← EIPs