{"eip":7825,"title":"Transaction Gas Limit Cap","description":"Introduce a protocol-level cap on the maximum gas used by a transaction to 16,777,216 (2^24).","authors":["Giulio Rebuffo (@Giulio2002)","Toni Wahrstätter (@nerolation)"],"status":"Final","type":"Standards Track","category":"Core","created":"2024-11-23","discussionsTo":"https://ethereum-magicians.org/t/eip-7825-transaction-gas-limit-cap/21848","repo":"EIPs","label":"EIP-7825","officialUrl":"https://eips.ethereum.org/EIPS/eip-7825","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7825.md","url":"https://eips.huatuo.xyz/eip-7825/","tldr":{"en":"Caps the gas limit of any single transaction at 16,777,216 (2^24), independent of the block gas limit, so no one transaction can monopolize a block as block limits rise.","ja":"ブロックのガスリミットとは無関係に、1 つのトランザクションのガスリミットを 16,777,216（2^24）に制限する。ブロックのリミットが上がっても、1 つのトランザクションがブロックを独占できないようにする。","ko":"블록 가스 한도와 무관하게 단일 트랜잭션의 가스 한도를 16,777,216(2^24)으로 제한한다. 블록 한도가 올라가도 하나의 트랜잭션이 블록을 독점하지 못하게 한다.","zh":"将任何单笔交易的 gas 上限限制为 16,777,216（2^24），与区块 gas 上限无关，这样随着区块上限提高，也没有哪一笔交易能独占整个区块。"},"tags":["gas","transactions","dos","core","fusaka"],"explainers":{"en":{"lang":"en","tldr":"Caps the gas limit of any single transaction at 16,777,216 (2^24), independent of the block gas limit, so no one transaction can monopolize a block as block limits rise.","tags":["gas","transactions","dos","core","fusaka"],"related":[7607,7935,1559],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-7825/","markdown":"## What problem does it solve?\n\nBefore this change, a transaction could set its gas limit as high as the whole block gas limit. As Ethereum raises block gas limits, that means one transaction could consume an ever larger, unbounded amount of work. The spec highlights three risks:\n\n- **DoS:** a single huge transaction concentrates load and can stall block validation.\n- **State growth:** very large transactions tend to make large state changes.\n- **Validation time:** long-running transactions slow block verification, which hurts smaller nodes and decentralization.\n\nPutting a fixed ceiling on each transaction keeps worst-case per-transaction work predictable even as block gas limits are raised.\n\n## How it works\n\n- There is a protocol-level maximum of **16,777,216 gas (2^24)** per transaction.\n- **Mempool:** a transaction whose `gasLimit` exceeds the cap is invalid and is not accepted into the txpool.\n- **Blocks:** a block containing any transaction with `gasLimit` above the cap is invalid.\n- The cap is independent of the block gas limit, which stays well above it. Blocks still hold many transactions; each one is simply bounded.\n\nThe value was chosen as a clean power of two that is still large enough for contract deployments and complex DeFi interactions. The check is on the declared `gasLimit`, not on gas actually used, so a transaction that would use only 1M gas but declares 20M is rejected.\n\nEIP-7825 shipped in the Fusaka upgrade ([EIP-7607](/eip-7607/)), which activated on mainnet on 2025-12-03.\n\n## Sample code\n\nClamp gas limits in your own tooling so transactions are not rejected (ethers v6):\n\n```ts\nimport { JsonRpcProvider, Wallet } from \"ethers\";\n\nconst TX_GAS_LIMIT_CAP = 16_777_216n; // 2^24, EIP-7825\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst wallet = new Wallet(process.env.PRIVATE_KEY!, provider);\n\nconst req = { to: target, data: calldata };\nconst estimate = await provider.estimateGas({ ...req, from: wallet.address });\nconst padded = (estimate * 12n) / 10n;   // 20% headroom\n\nif (estimate \u003e TX_GAS_LIMIT_CAP) {\n  throw new Error(\"Operation too large for one transaction; split it up\");\n}\nconst gasLimit = padded \u003e TX_GAS_LIMIT_CAP ? TX_GAS_LIMIT_CAP : padded;\n\nawait wallet.sendTransaction({ ...req, gasLimit });\n```\n\n## Things to know\n\n- Status is **Final** and the rule is live on mainnet.\n- Most transactions are far below the cap, but very large contract deployments, big batch operations or heavy one-shot migrations may need to be split across several transactions.\n- Watch for tools that set a fixed high default gas limit (for example 30M): those transactions are now rejected even if they would use little gas.\n- Contract code size limits still apply separately; this cap only bounds gas.\n- Fusaka also raised the default block gas limit to 60M ([EIP-7935](/eip-7935/)), more than three times the per-transaction cap.\n"},"ja":{"lang":"ja","tldr":"ブロックのガスリミットとは無関係に、1 つのトランザクションのガスリミットを 16,777,216（2^24）に制限する。ブロックのリミットが上がっても、1 つのトランザクションがブロックを独占できないようにする。","tags":["gas","transactions","dos","core","fusaka"],"related":[7607,7935,1559],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-7825/","markdown":"## 何を解決するのか\n\nこの変更の前は、トランザクションのガスリミットをブロックのガスリミット全体まで高く設定できました。Ethereum がブロックのガスリミットを引き上げるにつれ、1 つのトランザクションがますます大きく、上限のない量の処理を消費しうることになります。仕様は 3 つのリスクを挙げています。\n\n- **DoS:** 巨大なトランザクションが 1 つあると負荷が集中し、ブロックの検証が止まることがある。\n- **ステートの肥大化:** 非常に大きなトランザクションは、大きなステート変更を引き起こしがち。\n- **検証時間:** 長時間かかるトランザクションはブロック検証を遅くし、小規模なノードや分散性に悪影響を与える。\n\n各トランザクションに固定の上限を設けることで、ブロックのガスリミットが引き上げられても、トランザクションあたりの最悪ケースの処理量を予測可能に保てます。\n\n## 仕組み\n\n- トランザクションあたり **16,777,216 gas（2^24）** というプロトコルレベルの上限があります。\n- **mempool:** `gasLimit` が上限を超えるトランザクションは無効で、txpool に受け入れられません。\n- **ブロック:** 上限を超える `gasLimit` のトランザクションを 1 つでも含むブロックは無効です。\n- 上限はブロックのガスリミットとは独立しており、ブロックのガスリミットはそれをはるかに上回ったままです。ブロックは引き続き多くのトランザクションを含められ、各トランザクションに上限がかかるだけです。\n\nこの値は、コントラクトのデプロイや複雑な DeFi のやり取りに十分な大きさを保ちつつ、切りのよい 2 のべき乗として選ばれました。チェックは実際に使われたガスではなく、宣言された `gasLimit` に対して行われるため、実際には 100 万 gas しか使わないのに 2,000 万 gas と宣言したトランザクションは拒否されます。\n\nEIP-7825 は Fusaka アップグレード（[EIP-7607](/eip-7607/)）に含まれてリリースされ、2025-12-03 にメインネットで有効化されました。\n\n## サンプルコード\n\nトランザクションが拒否されないよう、自分のツールでガスリミットを上限内に収める例（ethers v6）:\n\n```ts\nimport { JsonRpcProvider, Wallet } from \"ethers\";\n\nconst TX_GAS_LIMIT_CAP = 16_777_216n; // 2^24, EIP-7825\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst wallet = new Wallet(process.env.PRIVATE_KEY!, provider);\n\nconst req = { to: target, data: calldata };\nconst estimate = await provider.estimateGas({ ...req, from: wallet.address });\nconst padded = (estimate * 12n) / 10n;   // 20% headroom\n\nif (estimate \u003e TX_GAS_LIMIT_CAP) {\n  throw new Error(\"Operation too large for one transaction; split it up\");\n}\nconst gasLimit = padded \u003e TX_GAS_LIMIT_CAP ? TX_GAS_LIMIT_CAP : padded;\n\nawait wallet.sendTransaction({ ...req, gasLimit });\n```\n\n## 知っておくべきこと\n\n- ステータスは **Final** で、このルールはメインネットで有効です。\n- ほとんどのトランザクションは上限をはるかに下回りますが、非常に大きなコントラクトのデプロイ、大きなバッチ処理、重い一括マイグレーションは、複数のトランザクションに分割する必要があるかもしれません。\n- 固定の高いデフォルトのガスリミット（たとえば 3,000 万）を設定するツールに注意してください。そうしたトランザクションは、実際の消費ガスが少なくても拒否されます。\n- コントラクトコードのサイズ制限は引き続き別途適用されます。この上限が制限するのはガスだけです。\n- Fusaka ではデフォルトのブロックガスリミットも 6,000 万に引き上げられ（[EIP-7935](/eip-7935/)）、トランザクションあたりの上限の 3 倍以上になりました。\n"},"ko":{"lang":"ko","tldr":"블록 가스 한도와 무관하게 단일 트랜잭션의 가스 한도를 16,777,216(2^24)으로 제한한다. 블록 한도가 올라가도 하나의 트랜잭션이 블록을 독점하지 못하게 한다.","tags":["gas","transactions","dos","core","fusaka"],"related":[7607,7935,1559],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-7825/","markdown":"## 어떤 문제를 해결하나요?\n\n이 변경 전에는 트랜잭션이 가스 한도를 블록 가스 한도 전체만큼 높게 설정할 수 있었습니다. 이더리움이 블록 가스 한도를 올릴수록, 하나의 트랜잭션이 점점 더 크고 상한 없는 양의 작업을 소비할 수 있다는 뜻입니다. 스펙은 세 가지 위험을 강조합니다.\n\n- **DoS:** 거대한 트랜잭션 하나가 부하를 집중시켜 블록 검증을 멈추게 할 수 있다.\n- **상태 증가:** 매우 큰 트랜잭션은 큰 상태 변경을 일으키는 경향이 있다.\n- **검증 시간:** 오래 걸리는 트랜잭션은 블록 검증을 늦춰 소규모 노드와 탈중앙화에 해가 된다.\n\n각 트랜잭션에 고정된 상한을 두면 블록 가스 한도가 올라가도 트랜잭션당 최악의 작업량을 예측 가능하게 유지할 수 있습니다.\n\n## 어떻게 동작하나요?\n\n- 트랜잭션당 **16,777,216 gas(2^24)**라는 프로토콜 수준의 최댓값이 있습니다.\n- **멤풀:** `gasLimit`가 상한을 넘는 트랜잭션은 유효하지 않으며 txpool에 받아들여지지 않습니다.\n- **블록:** 상한을 넘는 `gasLimit`의 트랜잭션이 하나라도 들어 있는 블록은 유효하지 않습니다.\n- 이 상한은 블록 가스 한도와 무관하며, 블록 가스 한도는 이보다 훨씬 높게 유지됩니다. 블록은 여전히 많은 트랜잭션을 담을 수 있고, 각각이 제한될 뿐입니다.\n\n이 값은 컨트랙트 배포와 복잡한 DeFi 상호작용에 충분히 큰 크기를 유지하면서 깔끔한 2의 거듭제곱으로 선택되었습니다. 검사는 실제 사용된 가스가 아니라 선언된 `gasLimit`에 대해 이루어지므로, 실제로는 100만 gas만 쓰지만 2,000만을 선언한 트랜잭션은 거부됩니다.\n\nEIP-7825는 Fusaka 업그레이드([EIP-7607](/eip-7607/))에 포함되어 출시되었으며, 이 업그레이드는 2025-12-03에 메인넷에서 활성화되었습니다.\n\n## 샘플 코드\n\n트랜잭션이 거부되지 않도록 자체 도구에서 가스 한도를 제한하기(ethers v6):\n\n```ts\nimport { JsonRpcProvider, Wallet } from \"ethers\";\n\nconst TX_GAS_LIMIT_CAP = 16_777_216n; // 2^24, EIP-7825\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst wallet = new Wallet(process.env.PRIVATE_KEY!, provider);\n\nconst req = { to: target, data: calldata };\nconst estimate = await provider.estimateGas({ ...req, from: wallet.address });\nconst padded = (estimate * 12n) / 10n;   // 20% headroom\n\nif (estimate \u003e TX_GAS_LIMIT_CAP) {\n  throw new Error(\"Operation too large for one transaction; split it up\");\n}\nconst gasLimit = padded \u003e TX_GAS_LIMIT_CAP ? TX_GAS_LIMIT_CAP : padded;\n\nawait wallet.sendTransaction({ ...req, gasLimit });\n```\n\n## 알아둘 점\n\n- 상태는 **Final**이며 이 규칙은 메인넷에 적용되어 있습니다.\n- 대부분의 트랜잭션은 상한보다 훨씬 낮지만, 매우 큰 컨트랙트 배포, 대규모 배치 작업, 무거운 일회성 마이그레이션은 여러 트랜잭션으로 나누어야 할 수 있습니다.\n- 고정된 높은 기본 가스 한도(예: 3,000만)를 설정하는 도구를 주의하세요. 그런 트랜잭션은 실제로 가스를 적게 쓰더라도 이제 거부됩니다.\n- 컨트랙트 코드 크기 제한은 여전히 별도로 적용됩니다. 이 상한은 가스만 제한합니다.\n- Fusaka는 기본 블록 가스 한도도 6,000만으로 올렸으며([EIP-7935](/eip-7935/)), 이는 트랜잭션당 상한의 세 배가 넘습니다.\n"},"zh":{"lang":"zh","tldr":"将任何单笔交易的 gas 上限限制为 16,777,216（2^24），与区块 gas 上限无关，这样随着区块上限提高，也没有哪一笔交易能独占整个区块。","tags":["gas","transactions","dos","core","fusaka"],"related":[7607,7935,1559],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-7825/","markdown":"## 它解决什么问题？\n\n在这项变更之前，交易可以把 gas 上限设得和整个区块的 gas 上限一样高。随着以太坊不断提高区块 gas 上限，这意味着单笔交易可能消耗越来越多、没有上界的计算量。规范强调了三个风险：\n\n- **DoS：** 单笔巨大的交易会集中负载，可能使区块验证停滞。\n- **状态增长：** 非常大的交易往往会造成大规模的状态变更。\n- **验证时间：** 运行时间很长的交易会拖慢区块验证，对较小的节点和去中心化不利。\n\n为每笔交易设置固定上限，即使区块 gas 上限被提高，也能让单笔交易最坏情况下的工作量保持可预测。\n\n## 它如何运作\n\n- 协议层面规定每笔交易的上限为 **16,777,216 gas（2^24）**。\n- **内存池：** `gasLimit` 超过上限的交易无效，不会被交易池接受。\n- **区块：** 包含任何 `gasLimit` 超过上限的交易的区块无效。\n- 该上限与区块 gas 上限无关，区块 gas 上限仍远高于它。区块依然可以容纳许多交易，只是每一笔都有界。\n\n这个值被选为一个整齐的 2 的幂，同时仍足以支持合约部署和复杂的 DeFi 交互。检查针对的是声明的 `gasLimit`，而非实际使用的 gas，因此一笔实际只会用 100 万 gas、却声明 2,000 万的交易会被拒绝。\n\nEIP-7825 随 Fusaka 升级（[EIP-7607](/eip-7607/)）上线，该升级于 2025-12-03 在主网激活。\n\n## 示例代码\n\n在你自己的工具中限制 gas 上限，以免交易被拒绝（ethers v6）：\n\n```ts\nimport { JsonRpcProvider, Wallet } from \"ethers\";\n\nconst TX_GAS_LIMIT_CAP = 16_777_216n; // 2^24, EIP-7825\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst wallet = new Wallet(process.env.PRIVATE_KEY!, provider);\n\nconst req = { to: target, data: calldata };\nconst estimate = await provider.estimateGas({ ...req, from: wallet.address });\nconst padded = (estimate * 12n) / 10n;   // 20% headroom\n\nif (estimate \u003e TX_GAS_LIMIT_CAP) {\n  throw new Error(\"Operation too large for one transaction; split it up\");\n}\nconst gasLimit = padded \u003e TX_GAS_LIMIT_CAP ? TX_GAS_LIMIT_CAP : padded;\n\nawait wallet.sendTransaction({ ...req, gasLimit });\n```\n\n## 需要注意\n\n- 状态为 **Final**，该规则已在主网生效。\n- 大多数交易远低于上限，但非常大的合约部署、大型批量操作或繁重的一次性迁移，可能需要拆分为多笔交易。\n- 注意那些设置了固定较高默认 gas 上限（例如 3,000 万）的工具：这些交易现在会被拒绝，即使它们实际消耗的 gas 很少。\n- 合约代码大小限制仍然单独适用；这个上限只限制 gas。\n- Fusaka 还把默认区块 gas 上限提高到 6,000 万（[EIP-7935](/eip-7935/)），是单笔交易上限的三倍多。\n"}},"requiredBy":[7607,7975,8037,8101,8123,8141,8295,8296]}
