{"eip":8374,"title":"Persist Warm Access Sets Across Reverts","description":"Accessed addresses and storage keys stay warm when a call frame reverts, as the data is already loaded by the client","authors":["Dragan Rakita (@rakita)"],"status":"Draft","type":"Standards Track","category":"Core","created":"2026-08-06","requires":[2929],"discussionsTo":"https://ethereum-magicians.org/t/eip-8374-persist-warm-access-sets-across-reverts/29341","repo":"EIPs","label":"EIP-8374","officialUrl":"https://eips.ethereum.org/EIPS/eip-8374","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-8374.md","url":"https://eips.huatuo.xyz/eip-8374/","tldr":{"en":"Proposes that addresses and storage slots stay warm for the rest of a transaction even if the call frame that touched them reverts, since the client has already loaded the data.","ja":"アドレスとストレージスロットは、それらに触れた呼び出しフレームがリバートしても、クライアントがすでにデータをロード済みであるため、トランザクションの残りの間ウォームのままにすることを提案する。","ko":"주소와 스토리지 슬롯에 접근한 호출 프레임이 리버트되더라도, 클라이언트가 이미 데이터를 로드했으므로 트랜잭션의 나머지 동안 웜(warm) 상태로 유지하자고 제안한다.","zh":"提出让地址和存储槽在交易的剩余过程中保持\"热\"（warm）状态，即使触及它们的调用帧发生回滚也是如此，因为客户端已经加载了这些数据。"},"tags":["gas","evm","access-lists","core"],"explainers":{"en":{"lang":"en","tldr":"Proposes that addresses and storage slots stay warm for the rest of a transaction even if the call frame that touched them reverts, since the client has already loaded the data.","tags":["gas","evm","access-lists","core"],"related":[2929,2930,8038],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-8374/","markdown":"## What problem does it solve?\n\n[EIP-2929](/eip-2929/) made the first access to an account or storage slot in a transaction \"cold\" and expensive, and later accesses \"warm\" and cheap. The point is to charge for the real cost of reading state from disk.\n\nBut EIP-2929 also rolls the warm sets back whenever a call frame reverts or runs out of gas. If a subcall reads slot `s` and reverts, the caller pays the cold price again when it reads `s`. In reality the client still has that data in its cache: a revert undoes state *changes*, it does not unload data. So the current rule overcharges, and it forces clients to journal the access sets alongside real state.\n\n## How it works\n\nAfter the fork:\n\n- When a call frame ends in anything other than success (revert, exceptional halt, out of gas), `accessed_addresses` and `accessed_storage_keys` are **not** rolled back. Entries added by the frame and its subcalls stay for the rest of the transaction.\n- An entry is only added once its cold access charge has actually been paid. If the frame cannot afford the cold charge, nothing is added. Once paid, the entry stays even if a later check in the same operation fails.\n- Everything else from EIP-2929 is unchanged: the sets pre-filled at transaction start (sender, recipient, precompiles, access list) and addresses added by `CREATE` / `CREATE2`.\n- State changes made in a reverted frame are still reverted. Only warmth persists.\n\nAccess sets become append-only for the transaction, which simplifies client implementations.\n\n## Sample code\n\nThe spec's test cases, illustrated in Solidity:\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ncontract Inner {\n    function touchAndRevert(address a) external view {\n        uint256 b = a.balance; // cold BALANCE: cold account access charge paid\n        b;\n        revert(\"undo\");\n    }\n}\n\ncontract Outer {\n    Inner immutable inner = new Inner();\n\n    function run(address a) external view returns (uint256) {\n        try inner.touchAndRevert(a) {} catch {}\n        // Before this EIP: `a` was rolled back to cold, so this costs the cold price again.\n        // After this EIP:  `a` stays warm, so this costs the warm access price.\n        return a.balance;\n    }\n}\n```\n\nClient-side pseudocode for the rule change:\n\n```python\ndef on_frame_exit(frame, success):\n    if success:\n        commit(frame.state_changes)\n    else:\n        revert(frame.state_changes)\n        # EIP-2929: also restore accessed_addresses / accessed_storage_keys\n        # EIP-8374: leave them as they are\n```\n\n## Things to know\n\n- Status is **Draft**: details may change and it is not scheduled for any fork.\n- Requires a hard fork. No transaction becomes more expensive; some become cheaper. Contracts that depend on exact gas used after a reverted subcall may see different numbers.\n- Warming entries in a reverted frame and using them later is not a new capability: an [EIP-2930](/eip-2930/) access list already lets a transaction warm arbitrary entries up front. Each entry's cold cost is still paid once per transaction.\n- If [EIP-8038](/eip-8038/) is active, the cost constants have different names (`WARM_ACCESS`, `COLD_STORAGE_ACCESS`, `COLD_ACCOUNT_ACCESS`), but the rule is the same.\n"},"ja":{"lang":"ja","tldr":"アドレスとストレージスロットは、それらに触れた呼び出しフレームがリバートしても、クライアントがすでにデータをロード済みであるため、トランザクションの残りの間ウォームのままにすることを提案する。","tags":["gas","evm","access-lists","core"],"related":[2929,2930,8038],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-8374/","markdown":"## 何を解決するのか\n\n[EIP-2929](/eip-2929/) は、トランザクション内でのアカウントやストレージスロットへの最初のアクセスを「コールド」で高コストに、以降のアクセスを「ウォーム」で低コストにしました。その狙いは、ディスクからステートを読むという実際のコストを課金することです。\n\nしかし EIP-2929 は、呼び出しフレームがリバートしたりガス切れになったりするたびに、ウォームセットもロールバックします。サブコールがスロット `s` を読んでリバートすると、呼び出し元が `s` を読むときに、再びコールドの価格を支払います。実際には、クライアントはそのデータをまだキャッシュに持っています。リバートが取り消すのはステートの*変更*であり、データをアンロードするわけではありません。したがって現在のルールは過剰に課金しており、クライアントに、実際のステートと並べてアクセスセットもジャーナリングさせています。\n\n## 仕組み\n\nフォーク後:\n\n- 呼び出しフレームが成功以外（リバート、例外的な停止、ガス切れ）で終了しても、`accessed_addresses` と `accessed_storage_keys` は**ロールバックされません**。フレームとそのサブコールが追加したエントリは、トランザクションの残りの間、残り続けます。\n- エントリは、そのコールドアクセスの料金が実際に支払われた時点でのみ追加されます。フレームがコールドの料金を払えない場合、何も追加されません。いったん支払われれば、同じ操作内の後のチェックが失敗しても、エントリは残ります。\n- EIP-2929 のそれ以外はすべて変わりません。トランザクション開始時に事前に埋められるセット（送信者、宛先、プリコンパイル、アクセスリスト）と、`CREATE` / `CREATE2` が追加するアドレスです。\n- リバートされたフレームで行われたステートの変更は、引き続きリバートされます。残るのはウォームさだけです。\n\nアクセスセットはトランザクションの間は追記専用になり、クライアントの実装が簡単になります。\n\n## サンプルコード\n\n仕様のテストケースを Solidity で示したもの:\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ncontract Inner {\n    function touchAndRevert(address a) external view {\n        uint256 b = a.balance; // cold BALANCE: cold account access charge paid\n        b;\n        revert(\"undo\");\n    }\n}\n\ncontract Outer {\n    Inner immutable inner = new Inner();\n\n    function run(address a) external view returns (uint256) {\n        try inner.touchAndRevert(a) {} catch {}\n        // Before this EIP: `a` was rolled back to cold, so this costs the cold price again.\n        // After this EIP:  `a` stays warm, so this costs the warm access price.\n        return a.balance;\n    }\n}\n```\n\nこのルール変更に関するクライアント側の擬似コード:\n\n```python\ndef on_frame_exit(frame, success):\n    if success:\n        commit(frame.state_changes)\n    else:\n        revert(frame.state_changes)\n        # EIP-2929: also restore accessed_addresses / accessed_storage_keys\n        # EIP-8374: leave them as they are\n```\n\n## 知っておくべきこと\n\n- ステータスは **Draft** です。詳細は変更される可能性があり、どのフォークにも予定されていません。\n- ハードフォークが必要です。コストが高くなるトランザクションはなく、安くなるものがあります。リバートしたサブコールの後の正確なガス使用量に依存するコントラクトは、異なる数値を目にするかもしれません。\n- リバートされたフレームでエントリをウォームにして、後でそれを使うことは、新しい機能ではありません。[EIP-2930](/eip-2930/) のアクセスリストを使えば、トランザクションはすでに任意のエントリを事前にウォームにできます。各エントリのコールドコストは、依然としてトランザクションごとに 1 回だけ支払われます。\n- [EIP-8038](/eip-8038/) が有効な場合、コスト定数は異なる名前（`WARM_ACCESS`、`COLD_STORAGE_ACCESS`、`COLD_ACCOUNT_ACCESS`）になりますが、ルールは同じです。\n"},"ko":{"lang":"ko","tldr":"주소와 스토리지 슬롯에 접근한 호출 프레임이 리버트되더라도, 클라이언트가 이미 데이터를 로드했으므로 트랜잭션의 나머지 동안 웜(warm) 상태로 유지하자고 제안한다.","tags":["gas","evm","access-lists","core"],"related":[2929,2930,8038],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-8374/","markdown":"## 어떤 문제를 해결하나요?\n\n[EIP-2929](/eip-2929/)는 트랜잭션에서 계정이나 스토리지 슬롯에 대한 첫 접근을 \"콜드\"로 만들어 비싸게 하고, 이후 접근은 \"웜\"으로 싸게 했습니다. 디스크에서 상태를 읽는 실제 비용에 대해 요금을 매기려는 것입니다.\n\n하지만 EIP-2929는 호출 프레임이 리버트되거나 가스가 바닥날 때마다 웜 집합도 함께 롤백합니다. 서브콜이 슬롯 `s`를 읽고 리버트되면, 호출자가 `s`를 읽을 때 다시 콜드 가격을 냅니다. 실제로 클라이언트는 그 데이터를 여전히 캐시에 가지고 있습니다. 리버트는 상태 *변경*을 되돌릴 뿐 데이터를 내리지는 않습니다. 그래서 현재 규칙은 과다 청구이며, 클라이언트가 실제 상태와 함께 접근 집합도 저널링하게 만듭니다.\n\n## 어떻게 동작하나요?\n\n포크 이후:\n\n- 호출 프레임이 성공이 아닌 방식(리버트, 예외적 중단, 가스 소진)으로 끝나더라도 `accessed_addresses`와 `accessed_storage_keys`는 **롤백되지 않습니다**. 프레임과 그 서브콜이 추가한 항목은 트랜잭션의 나머지 동안 남습니다.\n- 항목은 콜드 접근 요금이 실제로 지불된 뒤에만 추가됩니다. 프레임이 콜드 요금을 감당할 수 없으면 아무것도 추가되지 않습니다. 일단 지불되면 같은 연산 안에서 이후 검사가 실패하더라도 항목은 남습니다.\n- EIP-2929의 나머지는 모두 그대로입니다. 트랜잭션 시작 시 미리 채워지는 집합(발신자, 수신자, 프리컴파일, 접근 목록)과 `CREATE` / `CREATE2`가 추가하는 주소입니다.\n- 리버트된 프레임에서 이루어진 상태 변경은 여전히 되돌려집니다. 유지되는 것은 웜 상태뿐입니다.\n\n접근 집합은 트랜잭션 동안 추가 전용이 되어 클라이언트 구현이 단순해집니다.\n\n## 샘플 코드\n\n명세의 테스트 케이스를 Solidity로 나타낸 것:\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ncontract Inner {\n    function touchAndRevert(address a) external view {\n        uint256 b = a.balance; // cold BALANCE: cold account access charge paid\n        b;\n        revert(\"undo\");\n    }\n}\n\ncontract Outer {\n    Inner immutable inner = new Inner();\n\n    function run(address a) external view returns (uint256) {\n        try inner.touchAndRevert(a) {} catch {}\n        // Before this EIP: `a` was rolled back to cold, so this costs the cold price again.\n        // After this EIP:  `a` stays warm, so this costs the warm access price.\n        return a.balance;\n    }\n}\n```\n\n이 규칙 변경에 대한 클라이언트 측 의사코드:\n\n```python\ndef on_frame_exit(frame, success):\n    if success:\n        commit(frame.state_changes)\n    else:\n        revert(frame.state_changes)\n        # EIP-2929: also restore accessed_addresses / accessed_storage_keys\n        # EIP-8374: leave them as they are\n```\n\n## 알아둘 점\n\n- 상태는 **Draft**입니다. 세부 사항은 바뀔 수 있으며 어떤 포크에도 예정되어 있지 않습니다.\n- 하드포크가 필요합니다. 더 비싸지는 트랜잭션은 없고 일부는 더 싸집니다. 리버트된 서브콜 이후의 정확한 가스 사용량에 의존하는 컨트랙트는 다른 수치를 볼 수 있습니다.\n- 리버트된 프레임에서 항목을 웜으로 만들고 나중에 쓰는 것은 새로운 능력이 아닙니다. [EIP-2930](/eip-2930/) 접근 목록으로 트랜잭션이 이미 임의의 항목을 미리 웜으로 만들 수 있습니다. 각 항목의 콜드 비용은 여전히 트랜잭션당 한 번만 지불됩니다.\n- [EIP-8038](/eip-8038/)이 활성화되어 있으면 비용 상수의 이름이 다르지만(`WARM_ACCESS`, `COLD_STORAGE_ACCESS`, `COLD_ACCOUNT_ACCESS`) 규칙은 같습니다.\n"},"zh":{"lang":"zh","tldr":"提出让地址和存储槽在交易的剩余过程中保持\"热\"（warm）状态，即使触及它们的调用帧发生回滚也是如此，因为客户端已经加载了这些数据。","tags":["gas","evm","access-lists","core"],"related":[2929,2930,8038],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-8374/","markdown":"## 它解决什么问题？\n\n[EIP-2929](/eip-2929/) 使交易中对某个账户或存储槽的首次访问变得\"冷\"（cold）而昂贵，之后的访问则\"热\"而便宜。其目的是为从磁盘读取状态的真实成本收费。\n\n但 EIP-2929 同样会在调用帧回滚或 gas 耗尽时，把热集合一并回滚。如果某个子调用读取了槽 `s` 然后回滚，调用者在读取 `s` 时就要再次支付冷价格。实际上，客户端的缓存中仍然有那份数据：回滚撤销的是状态*变更*，并不会卸载数据。因此现行规则多收了费，还迫使客户端在记录真实状态的同时，也为访问集合维护日志。\n\n## 它如何运作\n\n分叉之后：\n\n- 当调用帧以成功之外的任何方式结束（回滚、异常中止、gas 耗尽）时，`accessed_addresses` 和 `accessed_storage_keys` **不会**被回滚。该帧及其子调用所添加的条目会在交易的剩余过程中一直保留。\n- 只有在其冷访问费用确实已经支付之后，才会添加条目。如果该帧付不起冷访问费用，就不会添加任何内容。一旦支付，即使同一操作中后面的检查失败，条目仍会保留。\n- EIP-2929 的其余部分都不变：交易开始时预先填充的集合（发送者、接收者、预编译、访问列表），以及由 `CREATE` / `CREATE2` 添加的地址。\n- 在被回滚的帧中所做的状态变更依然会被回滚。持续存在的只有\"热\"状态。\n\n访问集合在整个交易期间变为仅追加，这简化了客户端的实现。\n\n## 示例代码\n\n用 Solidity 演示规范中的测试用例：\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ncontract Inner {\n    function touchAndRevert(address a) external view {\n        uint256 b = a.balance; // cold BALANCE: cold account access charge paid\n        b;\n        revert(\"undo\");\n    }\n}\n\ncontract Outer {\n    Inner immutable inner = new Inner();\n\n    function run(address a) external view returns (uint256) {\n        try inner.touchAndRevert(a) {} catch {}\n        // Before this EIP: `a` was rolled back to cold, so this costs the cold price again.\n        // After this EIP:  `a` stays warm, so this costs the warm access price.\n        return a.balance;\n    }\n}\n```\n\n关于这一规则变更的客户端伪代码：\n\n```python\ndef on_frame_exit(frame, success):\n    if success:\n        commit(frame.state_changes)\n    else:\n        revert(frame.state_changes)\n        # EIP-2929: also restore accessed_addresses / accessed_storage_keys\n        # EIP-8374: leave them as they are\n```\n\n## 需要注意\n\n- 状态为 **Draft**：细节可能变化，并且没有被安排进任何分叉。\n- 需要硬分叉。没有任何交易会变得更贵；有些会变得更便宜。依赖于回滚的子调用之后精确 gas 消耗量的合约，可能会看到不同的数字。\n- 在被回滚的帧中把条目变\"热\"并在之后使用，并不是新的能力：[EIP-2930](/eip-2930/) 访问列表已经允许交易预先把任意条目变\"热\"。每个条目的冷访问成本在每笔交易中仍然只需支付一次。\n- 如果 [EIP-8038](/eip-8038/) 已激活，成本常量的名称会不同（`WARM_ACCESS`、`COLD_STORAGE_ACCESS`、`COLD_ACCOUNT_ACCESS`），但规则相同。\n"}}}
