{"eip":8123,"title":"RPC Method for Transaction Gas Limit Cap","description":"Add an RPC method to query the EIP-7825 transaction gas limit cap","authors":["Paul Razvan Berg (@PaulRBerg)"],"status":"Draft","type":"Standards Track","category":"Interface","created":"2026-01-11","requires":[7825],"discussionsTo":"https://ethereum-magicians.org/t/eip-8123-json-rpc-method-for-transaction-gas-limit-cap/27417","repo":"EIPs","label":"EIP-8123","officialUrl":"https://eips.ethereum.org/EIPS/eip-8123","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-8123.md","url":"https://eips.huatuo.xyz/eip-8123/","tldr":{"en":"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.","ja":"JSON-RPC メソッド eth_txGasLimitCap を追加する。ウォレットやツールは、値をハードコードしたり送信失敗から知ったりする代わりに、1 トランザクションが使える最大ガスをノードに問い合わせられる。","ko":"eth_txGasLimitCap JSON-RPC 메서드를 추가해, 지갑과 도구가 값을 하드코딩하거나 실패한 제출을 통해 알아내는 대신 노드에게 단일 트랜잭션이 쓸 수 있는 최대 가스를 물어볼 수 있게 한다.","zh":"新增 eth_txGasLimitCap JSON-RPC 方法，使钱包和工具可以向节点询问单笔交易可使用的最大 gas，而不必硬编码，也不必从失败的提交中得知。"},"tags":["rpc","gas","json-rpc","tooling","interface"],"explainers":{"en":{"lang":"en","tldr":"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.","tags":["rpc","gas","json-rpc","tooling","interface"],"related":[7825,1559],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-8123/","markdown":"## What problem does it solve?\n\n[EIP-7825](/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.\n\nSo 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.\n\nEIP-8123 adds one small read-only RPC method so wallets, SDKs and bundlers can discover the effective cap at runtime.\n\n## How it works\n\nA new method, `eth_txGasLimitCap`, takes no parameters and returns either a hex `QUANTITY` or `null`.\n\n- `protocolCap` is the maximum `tx.gas` allowed by the fork rules active at the node's current head (for example, the EIP-7825 cap).\n- `policyCap` is any stricter local limit the node applies when admitting transactions (for example, a txpool setting). If none is configured it is unbounded.\n- The node returns `min(protocolCap, policyCap)`. If both are unbounded, it returns `null`, meaning \"no finite per-transaction cap is enforced\".\n\nA 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.\n\n## Sample code\n\nRaw JSON-RPC exchange on Ethereum mainnet (`0x1000000` = 16,777,216):\n\n```json\n{ \"jsonrpc\": \"2.0\", \"id\": 1, \"method\": \"eth_txGasLimitCap\", \"params\": [] }\n{ \"jsonrpc\": \"2.0\", \"id\": 1, \"result\": \"0x1000000\" }\n```\n\nClamping an estimate before sending (ethers v6), with a fallback for nodes that don't support the method yet:\n\n```ts\nimport { JsonRpcProvider } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\n\nasync function txGasCap(): Promise\u003cbigint | null\u003e {\n  try {\n    const cap: string | null = await provider.send(\"eth_txGasLimitCap\", []);\n    return cap === null ? null : BigInt(cap);\n  } catch {\n    return null; // method not implemented: treat as unknown\n  }\n}\n\nconst estimate = await provider.estimateGas(txRequest);\nconst cap = await txGasCap();\nif (cap !== null \u0026\u0026 estimate \u003e cap) {\n  throw new Error(`needs ${estimate} gas, but this node caps transactions at ${cap}`);\n}\n```\n\n## Things to know\n\n- **Status: Draft.** The method name and semantics may still change, and nodes are not required to implement it yet. Always handle \"method not found\".\n- `null` means the node enforces no finite cap; it does not mean \"unknown\". A node that lacks the method will return a JSON-RPC error instead.\n- The value reflects the node you query, including its local policy. Another node on the same chain may report a lower number.\n- The cap limits a single transaction's `gas` field. It is separate from the block gas limit and from fee settings under [EIP-1559](/eip-1559/).\n- The method exposes only information that could already be learned by probing, so the spec sees no new security risk.\n"},"ja":{"lang":"ja","tldr":"JSON-RPC メソッド eth_txGasLimitCap を追加する。ウォレットやツールは、値をハードコードしたり送信失敗から知ったりする代わりに、1 トランザクションが使える最大ガスをノードに問い合わせられる。","tags":["rpc","gas","json-rpc","tooling","interface"],"related":[7825,1559],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-8123/","markdown":"## 何を解決するのか\n\n[EIP-7825](/eip-7825/) は、1 つのトランザクションが要求できるガスにプロトコルレベルの上限（Ethereum メインネットでは `2^24 = 16,777,216`）を設けました。最悪ケースの作業量に上限をかける点では良いのですが、EIP-7825 には、その上限がいくつなのかをノードに*問い合わせる*方法がありません。\n\nそのため現状、ツールは推測するしかありません。ネットワークごとに数値をハードコードする、クライアントのソースを読む、トランザクションが拒否されて初めて上限を知る、といった具合です。これは簡単に壊れます。将来のアップグレードで上限が変わる可能性があり、他の EVM チェーンは異なる値を選んでいて（仕様は Arbitrum と Polygon の `32,000,000` に言及しています）、上限を動的にする提案もあるからです。\n\nEIP-8123 は、ウォレット、SDK、バンドラーが実行時に有効な上限を知れるよう、読み取り専用の小さな RPC メソッドを 1 つ追加します。\n\n## 仕組み\n\n新しいメソッド `eth_txGasLimitCap` は、パラメータを取らず、16 進の `QUANTITY` または `null` を返します。\n\n- `protocolCap` は、ノードの現在のヘッドで有効なフォークルール（たとえば EIP-7825 の上限）が許す `tx.gas` の最大値です。\n- `policyCap` は、ノードがトランザクションを受け入れる際に適用する、より厳しいローカルの制限（たとえば txpool の設定）です。何も設定されていなければ無制限です。\n- ノードは `min(protocolCap, policyCap)` を返します。両方が無制限なら `null` を返し、これは「トランザクションごとの有限の上限は強制されていない」ことを意味します。\n\nノードは、プロトコルの上限より高い値を報告してはいけません。*有効な*上限（プロトコルルールにローカルポリシーを加えたもの）を返すのは意図的です。それこそが、そのノードに送ったトランザクションが受理されるかどうかを実際に決める数値だからです。\n\n## サンプルコード\n\nEthereum メインネットでの生の JSON-RPC のやり取り（`0x1000000` = 16,777,216）:\n\n```json\n{ \"jsonrpc\": \"2.0\", \"id\": 1, \"method\": \"eth_txGasLimitCap\", \"params\": [] }\n{ \"jsonrpc\": \"2.0\", \"id\": 1, \"result\": \"0x1000000\" }\n```\n\n送信前に見積もりを上限に収める（ethers v6）。このメソッドにまだ対応していないノード向けのフォールバック付き:\n\n```ts\nimport { JsonRpcProvider } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\n\nasync function txGasCap(): Promise\u003cbigint | null\u003e {\n  try {\n    const cap: string | null = await provider.send(\"eth_txGasLimitCap\", []);\n    return cap === null ? null : BigInt(cap);\n  } catch {\n    return null; // method not implemented: treat as unknown\n  }\n}\n\nconst estimate = await provider.estimateGas(txRequest);\nconst cap = await txGasCap();\nif (cap !== null \u0026\u0026 estimate \u003e cap) {\n  throw new Error(`needs ${estimate} gas, but this node caps transactions at ${cap}`);\n}\n```\n\n## 知っておくべきこと\n\n- **ステータス: Draft。** メソッド名と意味はまだ変わる可能性があり、ノードがまだ実装する必要はありません。常に「method not found」を処理してください。\n- `null` は、ノードが有限の上限を強制していないことを意味し、「不明」という意味ではありません。このメソッドを持たないノードは、代わりに JSON-RPC エラーを返します。\n- この値は、問い合わせたノードのローカルポリシーも含めて、そのノードを反映します。同じチェーン上の別のノードは、より低い値を報告するかもしれません。\n- 上限が制限するのは 1 トランザクションの `gas` フィールドです。ブロックのガスリミットや、[EIP-1559](/eip-1559/) の手数料設定とは別物です。\n- このメソッドが公開するのは、プロービングによってすでに知り得る情報だけなので、仕様は新たなセキュリティリスクはないと見ています。\n"},"ko":{"lang":"ko","tldr":"eth_txGasLimitCap JSON-RPC 메서드를 추가해, 지갑과 도구가 값을 하드코딩하거나 실패한 제출을 통해 알아내는 대신 노드에게 단일 트랜잭션이 쓸 수 있는 최대 가스를 물어볼 수 있게 한다.","tags":["rpc","gas","json-rpc","tooling","interface"],"related":[7825,1559],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-8123/","markdown":"## 어떤 문제를 해결하나요?\n\n[EIP-7825](/eip-7825/)는 트랜잭션 하나가 요청할 수 있는 가스에 프로토콜 수준의 상한(이더리움 메인넷에서는 `2^24 = 16,777,216`)을 두었습니다. 최악의 경우의 작업량을 제한한다는 점에서는 좋지만, EIP-7825에는 노드에게 그 상한이 얼마인지 *물어볼* 방법이 없습니다.\n\n그래서 지금은 도구가 추측해야 합니다. 네트워크마다 숫자를 하드코딩하거나, 클라이언트 소스를 읽거나, 트랜잭션이 거부될 때 비로소 한도를 알게 됩니다. 이는 쉽게 깨집니다. 상한이 향후 업그레이드에서 바뀔 수 있고, 다른 EVM 체인은 다른 값을 고르며(명세는 Arbitrum과 Polygon의 `32,000,000`을 언급합니다), 상한을 동적으로 만들자는 제안도 있기 때문입니다.\n\nEIP-8123은 지갑, SDK, 번들러가 런타임에 실제 적용되는 상한을 알아낼 수 있도록 읽기 전용 RPC 메서드를 하나 추가합니다.\n\n## 어떻게 동작하나요?\n\n새 메서드 `eth_txGasLimitCap`은 파라미터를 받지 않으며 16진수 `QUANTITY` 또는 `null`을 반환합니다.\n\n- `protocolCap`은 노드의 현재 헤드에서 활성화된 포크 규칙(예: EIP-7825의 상한)이 허용하는 최대 `tx.gas`입니다.\n- `policyCap`은 노드가 트랜잭션을 받아들일 때 적용하는 더 엄격한 로컬 제한(예: txpool 설정)입니다. 설정된 것이 없으면 무제한입니다.\n- 노드는 `min(protocolCap, policyCap)`을 반환합니다. 둘 다 무제한이면 `null`을 반환하며, 이는 \"트랜잭션당 유한한 상한이 강제되지 않는다\"는 뜻입니다.\n\n노드는 프로토콜 상한보다 높은 값을 보고해서는 안 됩니다. *실효* 상한(프로토콜 규칙에 로컬 정책을 더한 것)을 반환하는 것은 의도적입니다. 그 노드에 제출한 트랜잭션이 받아들여질지를 실제로 결정하는 숫자이기 때문입니다.\n\n## 샘플 코드\n\n이더리움 메인넷에서의 원시 JSON-RPC 교환(`0x1000000` = 16,777,216):\n\n```json\n{ \"jsonrpc\": \"2.0\", \"id\": 1, \"method\": \"eth_txGasLimitCap\", \"params\": [] }\n{ \"jsonrpc\": \"2.0\", \"id\": 1, \"result\": \"0x1000000\" }\n```\n\n전송 전에 추정값을 상한으로 제한하기(ethers v6). 이 메서드를 아직 지원하지 않는 노드를 위한 폴백 포함:\n\n```ts\nimport { JsonRpcProvider } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\n\nasync function txGasCap(): Promise\u003cbigint | null\u003e {\n  try {\n    const cap: string | null = await provider.send(\"eth_txGasLimitCap\", []);\n    return cap === null ? null : BigInt(cap);\n  } catch {\n    return null; // method not implemented: treat as unknown\n  }\n}\n\nconst estimate = await provider.estimateGas(txRequest);\nconst cap = await txGasCap();\nif (cap !== null \u0026\u0026 estimate \u003e cap) {\n  throw new Error(`needs ${estimate} gas, but this node caps transactions at ${cap}`);\n}\n```\n\n## 알아둘 점\n\n- **상태: Draft.** 메서드 이름과 의미가 아직 바뀔 수 있으며, 노드가 아직 이를 구현할 필요는 없습니다. 항상 \"method not found\"를 처리하세요.\n- `null`은 노드가 유한한 상한을 강제하지 않는다는 뜻이며 \"알 수 없음\"을 뜻하지 않습니다. 이 메서드가 없는 노드는 대신 JSON-RPC 오류를 반환합니다.\n- 이 값은 질의한 노드의 로컬 정책을 포함해 그 노드를 반영합니다. 같은 체인의 다른 노드는 더 낮은 숫자를 보고할 수 있습니다.\n- 상한은 단일 트랜잭션의 `gas` 필드를 제한합니다. 블록 가스 한도나 [EIP-1559](/eip-1559/)의 수수료 설정과는 별개입니다.\n- 이 메서드는 프로빙으로 이미 알아낼 수 있는 정보만 노출하므로, 명세는 새로운 보안 위험이 없다고 봅니다.\n"},"zh":{"lang":"zh","tldr":"新增 eth_txGasLimitCap JSON-RPC 方法，使钱包和工具可以向节点询问单笔交易可使用的最大 gas，而不必硬编码，也不必从失败的提交中得知。","tags":["rpc","gas","json-rpc","tooling","interface"],"related":[7825,1559],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-8123/","markdown":"## 它解决什么问题？\n\n[EIP-7825](/eip-7825/) 在协议层对单笔交易可请求的 gas 设置了上限（以太坊主网为 `2^24 = 16,777,216`）。这有利于限制最坏情况下的工作量，但 EIP-7825 没有提供*询问*节点上限是多少的方法。\n\n因此如今工具只能猜测：为每个网络硬编码一个数字、阅读客户端源码，或者在交易被拒绝时才发现这个限制。这很容易出问题，因为上限可能在未来的升级中改变，其他 EVM 链选择了不同的值（规范提到 Arbitrum 和 Polygon 上为 `32,000,000`），而且还有让上限动态变化的提案。\n\nEIP-8123 增加了一个小的只读 RPC 方法，让钱包、SDK 和 bundler 可以在运行时发现实际生效的上限。\n\n## 它如何运作\n\n新方法 `eth_txGasLimitCap` 不接受参数，返回十六进制的 `QUANTITY` 或 `null`。\n\n- `protocolCap` 是节点当前链头所处分叉规则允许的最大 `tx.gas`（例如 EIP-7825 的上限）。\n- `policyCap` 是节点在接纳交易时应用的任何更严格的本地限制（例如 txpool 的设置）。如果没有配置，则不设上限。\n- 节点返回 `min(protocolCap, policyCap)`。如果两者都不设上限，则返回 `null`，表示\"没有强制执行有限的单笔交易上限\"。\n\n节点绝不能报告高于协议上限的值。返回*有效*上限（协议规则加本地策略）是有意为之：正是这个数字，实际决定了你提交给该节点的交易会不会被接受。\n\n## 示例代码\n\n以太坊主网上的原始 JSON-RPC 交互（`0x1000000` = 16,777,216）：\n\n```json\n{ \"jsonrpc\": \"2.0\", \"id\": 1, \"method\": \"eth_txGasLimitCap\", \"params\": [] }\n{ \"jsonrpc\": \"2.0\", \"id\": 1, \"result\": \"0x1000000\" }\n```\n\n在发送前对估算值进行限幅（ethers v6），并为尚不支持该方法的节点提供回退：\n\n```ts\nimport { JsonRpcProvider } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\n\nasync function txGasCap(): Promise\u003cbigint | null\u003e {\n  try {\n    const cap: string | null = await provider.send(\"eth_txGasLimitCap\", []);\n    return cap === null ? null : BigInt(cap);\n  } catch {\n    return null; // method not implemented: treat as unknown\n  }\n}\n\nconst estimate = await provider.estimateGas(txRequest);\nconst cap = await txGasCap();\nif (cap !== null \u0026\u0026 estimate \u003e cap) {\n  throw new Error(`needs ${estimate} gas, but this node caps transactions at ${cap}`);\n}\n```\n\n## 需要注意\n\n- **状态：Draft。** 方法名和语义仍可能变化，节点目前也不要求实现它。请务必处理\"method not found\"。\n- `null` 表示节点没有强制执行有限的上限；并不表示\"未知\"。不具备该方法的节点会返回 JSON-RPC 错误。\n- 该值反映的是你所查询的节点，包括它的本地策略。同一条链上的另一个节点可能报告更低的数字。\n- 该上限限制的是单笔交易的 `gas` 字段。它与区块 gas 上限以及 [EIP-1559](/eip-1559/) 下的费用设置无关。\n- 该方法只暴露通过探测本来就能得知的信息，因此规范认为不会带来新的安全风险。\n"}}}
