EIP-8123 · Draft · Interface · 2026-01-11
EIP-8123: RPC Method for Transaction Gas Limit Cap
Adds an eth_txGasLimitCap JSON-RPC method so wallets and tools can ask a node for the maximum gas a single transaction may use, instead of hardcoding it or learning it from failed submissions.
What problem does it solve?
EIP-7825 put a protocol-level cap on how much gas one transaction may request (2^24 = 16,777,216 on Ethereum mainnet). That is good for bounding worst-case work, but EIP-7825 gives no way to ask a node what the cap is.
So today tools have to guess: hardcode a number per network, read client source, or discover the limit when a transaction is rejected. That breaks easily, because the cap can change in a future upgrade, other EVM chains pick different values (the spec mentions 32,000,000 on Arbitrum and Polygon), and there are proposals to make the cap dynamic.
EIP-8123 adds one small read-only RPC method so wallets, SDKs and bundlers can discover the effective cap at runtime.
How it works
A new method, eth_txGasLimitCap, takes no parameters and returns either a hex QUANTITY or null.
protocolCapis the maximumtx.gasallowed by the fork rules active at the node's current head (for example, the EIP-7825 cap).policyCapis any stricter local limit the node applies when admitting transactions (for example, a txpool setting). If none is configured it is unbounded.- The node returns
min(protocolCap, policyCap). If both are unbounded, it returnsnull, meaning "no finite per-transaction cap is enforced".
A node must never report a value higher than the protocol cap. Returning the effective cap (protocol rules plus local policy) is deliberate: it is the number that actually decides whether a transaction you submit to that node is accepted.
Sample code
Raw JSON-RPC exchange on Ethereum mainnet (0x1000000 = 16,777,216):
{ "jsonrpc": "2.0", "id": 1, "method": "eth_txGasLimitCap", "params": [] }
{ "jsonrpc": "2.0", "id": 1, "result": "0x1000000" }
Clamping an estimate before sending (ethers v6), with a fallback for nodes that don't support the method yet:
import { JsonRpcProvider } from "ethers";
const provider = new JsonRpcProvider(process.env.RPC_URL);
async function txGasCap(): Promise<bigint | null> {
try {
const cap: string | null = await provider.send("eth_txGasLimitCap", []);
return cap === null ? null : BigInt(cap);
} catch {
return null; // method not implemented: treat as unknown
}
}
const estimate = await provider.estimateGas(txRequest);
const cap = await txGasCap();
if (cap !== null && estimate > cap) {
throw new Error(`needs ${estimate} gas, but this node caps transactions at ${cap}`);
}
Things to know
- Status: Draft. The method name and semantics may still change, and nodes are not required to implement it yet. Always handle "method not found".
nullmeans the node enforces no finite cap; it does not mean "unknown". A node that lacks the method will return a JSON-RPC error instead.- The value reflects the node you query, including its local policy. Another node on the same chain may report a lower number.
- The cap limits a single transaction's
gasfield. It is separate from the block gas limit and from fee settings under EIP-1559. - The method exposes only information that could already be learned by probing, so the spec sees no new security risk.