Appearance
Abstract
This EIP specifies a new Ethereum JSON-RPC method, eth_txGasLimitCap, which returns the maximum transaction gas limit (tx.gas) that the node will accept under the current fork rules (and any stricter local policy). This enables wallets, SDKs, bundlers, and tooling to discover the effective per-transaction gas limit cap without simulation or out-of-band knowledge.
Motivation
EIP-7825 introduces a protocol-level per-transaction gas limit cap (e.g. 2^24 = 16,777,216 on Ethereum) to bound worst-case single-transaction work. However, it does not specify any way to query this cap.
As a consequence, users and tools must:
- infer it from failed transaction submissions,
- hardcode network assumptions,
- read client source code,
- or rely on Internet documentation.
This is brittle because:
- the cap may change in future upgrades,
- different chains intentionally set different cap values (e.g. Arbitrum and Polygon both use
32,000,000), - and there already are some proposals to make the transaction gas limit cap dynamic, rather than hardcoded, based on new fee calculation rules
Specification
The key words “MUST", “MUST NOT", “SHOULD", and “MAY" are to be interpreted as described in RFC 2119.
New method: eth_txGasLimitCap
Request
- Method:
eth_txGasLimitCap - Params:
[](no parameters)
Response
- Result:
QUANTITYornull- If the node enforces a finite transaction gas limit cap, it MUST return that cap as a
QUANTITY. - If the node does not enforce a finite cap, it MUST return
null.
- If the node enforces a finite transaction gas limit cap, it MUST return that cap as a
Returning null indicates that no finite per-transaction gas limit is enforced by the node.
Semantics
Let:
protocolCapbe the maximumtx.gaspermitted by the active protocol rules at the node's current head (e.g. from EIP-7825 when enabled).policyCapbe any stricter local cap applied by the node to transaction acceptance (e.g. txpool admission), if configured; otherwise, unbounded.
Then the node MUST return:
min(protocolCap, policyCap)if finite, elsenull.
A node MUST NOT return a value higher than the protocol cap when the protocol cap is finite.
Example
Ethereum (EIP-7825 cap = 2^24):
json
{ "jsonrpc": "2.0", "id": 1, "method": "eth_txGasLimitCap", "params": [] }json
{ "jsonrpc": "2.0", "id": 1, "result": "0x1000000" }A chain with a 32,000,000 cap:
json
{ "jsonrpc": "2.0", "id": 1, "result": "0x1e84800" }Rationale
A dedicated method is needed because there is currently no way to query the maximum allowed tx.gas without simulation or out-of-band knowledge.
Returning the effective cap (min(protocolCap, policyCap)) matches what users need when constructing transactions to submit.
Backwards Compatibility
This EIP adds a new JSON-RPC method and does not modify existing methods. Existing clients and applications remain compatible.
Reference Implementation
Pseudo code:
text
if protocol has finite tx gas cap at head:
protocolCap = that value
else:
protocolCap = +infinity
if protocol has policy cap:
policyCap = that value
else:
policyCap = +infinity
cap = min(protocolCap, policyCap)
if cap is finite:
return cap
else:
return nullSecurity Considerations
This EIP only exposes information that is already public or otherwise observable by probing. It does not expose secrets or user data.
Copyright
Copyright and related rights waived via CC0.