{"eip":4938,"title":"eth/67 - Removal of GetNodeData","description":"Remove GetNodeData and NodeData messages from the wire protocol","authors":["Marius van der Wijden (@MariusVanDerWijden)","Felix Lange \u003cfjl@ethereum.org\u003e","Gary Rong \u003cgaryrong@ethereum.org\u003e"],"status":"Final","type":"Standards Track","category":"Networking","created":"2022-03-23","requires":[2464,2481],"discussionsTo":"https://ethereum-magicians.org/t/eip-4938-removal-of-getnodedata/8893","repo":"EIPs","label":"EIP-4938","officialUrl":"https://eips.ethereum.org/EIPS/eip-4938","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-4938.md","url":"https://eips.huatuo.xyz/eip-4938/","tldr":{"en":"Defines eth/67, the version of Ethereum's peer-to-peer wire protocol that removes the GetNodeData and NodeData messages, because modern clients no longer store state in a way that can serve them.","ja":"eth/67 を定義する。Ethereum の P2P ワイヤプロトコルのバージョンで、現代のクライアントはもうそれに応えられる形でステートを保存していないため、GetNodeData と NodeData メッセージを削除する。","ko":"eth/67을 정의한다. 이더리움 P2P 와이어 프로토콜의 버전으로, 최신 클라이언트는 더 이상 이에 응답할 수 있는 방식으로 상태를 저장하지 않으므로 GetNodeData와 NodeData 메시지를 제거한다.","zh":"定义 eth/67，即以太坊点对点网络协议的一个版本，移除 GetNodeData 和 NodeData 消息，因为现代客户端存储状态的方式已无法响应这些消息。"},"tags":["networking","devp2p","sync","wire-protocol"],"explainers":{"en":{"lang":"en","tldr":"Defines eth/67, the version of Ethereum's peer-to-peer wire protocol that removes the GetNodeData and NodeData messages, because modern clients no longer store state in a way that can serve them.","tags":["networking","devp2p","sync","wire-protocol"],"related":[2464,2481,5793],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-4938/","markdown":"## What problem does it solve?\n\nEthereum clients talk to each other over the `eth` wire protocol. Since `eth/63`, it included `GetNodeData` / `NodeData`: ask a peer for any state trie node or contract code by its hash. This powered \"fast sync\", which downloads state node by node instead of executing every historical block.\n\nTo answer such a request, a client must keep a database that maps every trie node hash to the node itself. Newer storage designs keep state in a different layout (for example, flat or path-based storage) and simply cannot look nodes up by hash. Some clients therefore could not serve `GetNodeData` at all. The protocol should only contain messages every client can implement.\n\n## How it works\n\n`eth/67` is `eth/66` minus two messages:\n\n| Message | Code | eth/66 shape |\n| --- | --- | --- |\n| `GetNodeData` | `0x0d` | `[request_id, [hash_0, hash_1, ...]]` |\n| `NodeData` | `0x0e` | `[request_id, [value_0, value_1, ...]]` |\n\nNothing else changes. The replacement lives in the separate **snap** protocol: `GetByteCodes` fetches contract code and `GetTrieNodes` fetches trie nodes by path. Snap can implement fast sync, though the spec recommends using it for snap sync.\n\nBecause devp2p negotiates protocol versions per connection, peers can support `eth/66` and `eth/67` side by side. Older clients are not cut off immediately; they keep talking `eth/66`.\n\n## Sample code\n\nCapability negotiation as a client might advertise it during the devp2p `Hello` handshake (illustrative):\n\n```json\n{\n  \"capabilities\": [\n    { \"name\": \"eth\",  \"version\": 66 },\n    { \"name\": \"eth\",  \"version\": 67 },\n    { \"name\": \"snap\", \"version\": 1 }\n  ]\n}\n```\n\nHandling an incoming message on an `eth/67` session (illustrative pseudocode; exact peer handling is client-specific):\n\n```python\nGET_NODE_DATA = 0x0d\nNODE_DATA     = 0x0e\n\ndef on_eth_message(session, code, payload):\n    if session.eth_version \u003e= 67 and code in (GET_NODE_DATA, NODE_DATA):\n        session.disconnect(\"invalid message for eth/67\")\n        return\n    dispatch(code, payload)\n```\n\n## Things to know\n\n- Status: **Final**. It is a networking change only: no consensus rules change and no hard fork is required.\n- It builds on [EIP-2464](/eip-2464/) (eth/65) and [EIP-2481](/eip-2481/) (eth/66 request IDs). The next version, eth/68 ([EIP-5793](/eip-5793/)), adds transaction types to transaction announcements.\n- Any tooling that fetched state with `GetNodeData` needs to switch to the snap protocol or to RPC.\n- The `eth` protocol specification itself lives in the devp2p repository; the EIP records the change.\n"},"ja":{"lang":"ja","tldr":"eth/67 を定義する。Ethereum の P2P ワイヤプロトコルのバージョンで、現代のクライアントはもうそれに応えられる形でステートを保存していないため、GetNodeData と NodeData メッセージを削除する。","tags":["networking","devp2p","sync","wire-protocol"],"related":[2464,2481,5793],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-4938/","markdown":"## 何を解決するのか\n\nEthereum クライアントは `eth` ワイヤプロトコルで互いに通信します。`eth/63` 以降、これには `GetNodeData` / `NodeData` が含まれていました。ピアに、ハッシュを指定して任意のステートトライのノードやコントラクトコードを要求するものです。これは「fast sync」を支えていました。過去のブロックをすべて実行する代わりに、ステートをノードごとにダウンロードする方式です。\n\nこのような要求に答えるには、クライアントはトライのノードのハッシュからノード本体への対応をすべて持つデータベースを保持しなければなりません。新しいストレージ設計はステートを別の形（たとえばフラットやパスベースのストレージ）で保持しており、ハッシュによるノードの検索ができません。そのため、`GetNodeData` にまったく対応できないクライアントもありました。プロトコルには、すべてのクライアントが実装できるメッセージだけを含めるべきです。\n\n## 仕組み\n\n`eth/67` は、`eth/66` から 2 つのメッセージを除いたものです。\n\n| メッセージ | コード | eth/66 での形式 |\n| --- | --- | --- |\n| `GetNodeData` | `0x0d` | `[request_id, [hash_0, hash_1, ...]]` |\n| `NodeData` | `0x0e` | `[request_id, [value_0, value_1, ...]]` |\n\nそれ以外は何も変わりません。代替手段は別の **snap** プロトコルにあります。`GetByteCodes` がコントラクトコードを、`GetTrieNodes` がパスによるトライのノードを取得します。snap で fast sync を実装することもできますが、仕様は snap sync に使うことを推奨しています。\n\ndevp2p はプロトコルバージョンを接続ごとにネゴシエートするため、ピアは `eth/66` と `eth/67` を並行してサポートできます。古いクライアントがすぐに切り離されることはなく、`eth/66` で通信を続けます。\n\n## サンプルコード\n\ndevp2p の `Hello` ハンドシェイク中に、クライアントが広告する可能性のある capability のネゴシエーション（説明用）:\n\n```json\n{\n  \"capabilities\": [\n    { \"name\": \"eth\",  \"version\": 66 },\n    { \"name\": \"eth\",  \"version\": 67 },\n    { \"name\": \"snap\", \"version\": 1 }\n  ]\n}\n```\n\n`eth/67` セッションでの受信メッセージの処理（説明用の疑似コード。実際のピア処理はクライアント固有）:\n\n```python\nGET_NODE_DATA = 0x0d\nNODE_DATA     = 0x0e\n\ndef on_eth_message(session, code, payload):\n    if session.eth_version \u003e= 67 and code in (GET_NODE_DATA, NODE_DATA):\n        session.disconnect(\"invalid message for eth/67\")\n        return\n    dispatch(code, payload)\n```\n\n## 知っておくべきこと\n\n- ステータス: **Final**。ネットワークのみの変更で、コンセンサスルールは変わらず、ハードフォークも不要です。\n- [EIP-2464](/eip-2464/)（eth/65）と [EIP-2481](/eip-2481/)（eth/66 のリクエスト ID）の上に成り立っています。次のバージョンである eth/68（[EIP-5793](/eip-5793/)）は、トランザクションのアナウンスにトランザクションタイプを追加します。\n- `GetNodeData` でステートを取得していたツールは、snap プロトコルか RPC に切り替える必要があります。\n- `eth` プロトコルの仕様そのものは devp2p リポジトリにあり、この EIP は変更を記録するものです。\n"},"ko":{"lang":"ko","tldr":"eth/67을 정의한다. 이더리움 P2P 와이어 프로토콜의 버전으로, 최신 클라이언트는 더 이상 이에 응답할 수 있는 방식으로 상태를 저장하지 않으므로 GetNodeData와 NodeData 메시지를 제거한다.","tags":["networking","devp2p","sync","wire-protocol"],"related":[2464,2481,5793],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-4938/","markdown":"## 어떤 문제를 해결하나요?\n\n이더리움 클라이언트는 `eth` 와이어 프로토콜로 서로 통신합니다. `eth/63`부터 여기에는 `GetNodeData` / `NodeData`가 있었습니다. 피어에게 해시로 임의의 상태 트라이 노드나 컨트랙트 코드를 요청하는 메시지입니다. 이것이 \"fast sync\"를 가능하게 했는데, 과거 블록을 모두 실행하는 대신 상태를 노드 단위로 내려받는 방식입니다.\n\n이런 요청에 응답하려면 클라이언트는 모든 트라이 노드 해시를 노드 자체로 매핑하는 데이터베이스를 유지해야 합니다. 새로운 스토리지 설계는 상태를 다른 레이아웃(예: 플랫 또는 경로 기반 스토리지)으로 저장하므로 해시로 노드를 조회할 수 없습니다. 그래서 일부 클라이언트는 `GetNodeData`를 아예 제공하지 못했습니다. 프로토콜에는 모든 클라이언트가 구현할 수 있는 메시지만 있어야 합니다.\n\n## 어떻게 동작하나요?\n\n`eth/67`은 `eth/66`에서 메시지 두 개를 뺀 것입니다.\n\n| 메시지 | 코드 | eth/66 형식 |\n| --- | --- | --- |\n| `GetNodeData` | `0x0d` | `[request_id, [hash_0, hash_1, ...]]` |\n| `NodeData` | `0x0e` | `[request_id, [value_0, value_1, ...]]` |\n\n그 외에는 아무것도 바뀌지 않습니다. 대체 수단은 별도의 **snap** 프로토콜에 있습니다. `GetByteCodes`는 컨트랙트 코드를, `GetTrieNodes`는 경로로 트라이 노드를 가져옵니다. snap으로 fast sync를 구현할 수도 있지만, 명세는 snap sync에 쓰도록 권장합니다.\n\ndevp2p는 연결마다 프로토콜 버전을 협상하므로 피어는 `eth/66`과 `eth/67`을 나란히 지원할 수 있습니다. 오래된 클라이언트도 바로 차단되지 않고 계속 `eth/66`으로 통신합니다.\n\n## 샘플 코드\n\n클라이언트가 devp2p `Hello` 핸드셰이크 중에 알릴 수 있는 capability 협상(설명용):\n\n```json\n{\n  \"capabilities\": [\n    { \"name\": \"eth\",  \"version\": 66 },\n    { \"name\": \"eth\",  \"version\": 67 },\n    { \"name\": \"snap\", \"version\": 1 }\n  ]\n}\n```\n\n`eth/67` 세션에서 들어오는 메시지 처리(설명용 의사 코드이며, 실제 피어 처리는 클라이언트마다 다름):\n\n```python\nGET_NODE_DATA = 0x0d\nNODE_DATA     = 0x0e\n\ndef on_eth_message(session, code, payload):\n    if session.eth_version \u003e= 67 and code in (GET_NODE_DATA, NODE_DATA):\n        session.disconnect(\"invalid message for eth/67\")\n        return\n    dispatch(code, payload)\n```\n\n## 알아둘 점\n\n- 상태: **Final**. 네트워킹만 바뀌는 변경입니다. 합의 규칙은 바뀌지 않고 하드포크도 필요하지 않습니다.\n- [EIP-2464](/eip-2464/)(eth/65)와 [EIP-2481](/eip-2481/)(eth/66 요청 ID)을 기반으로 합니다. 다음 버전인 eth/68([EIP-5793](/eip-5793/))은 트랜잭션 공지에 트랜잭션 타입을 추가합니다.\n- `GetNodeData`로 상태를 가져오던 도구는 snap 프로토콜이나 RPC로 전환해야 합니다.\n- `eth` 프로토콜 명세 자체는 devp2p 저장소에 있고, 이 EIP는 변경 사항을 기록합니다.\n"},"zh":{"lang":"zh","tldr":"定义 eth/67，即以太坊点对点网络协议的一个版本，移除 GetNodeData 和 NodeData 消息，因为现代客户端存储状态的方式已无法响应这些消息。","tags":["networking","devp2p","sync","wire-protocol"],"related":[2464,2481,5793],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-4938/","markdown":"## 它解决什么问题？\n\n以太坊客户端通过 `eth` 线路协议相互通信。自 `eth/63` 起，它包含了 `GetNodeData` / `NodeData`：向对等节点按哈希请求任意状态 trie 节点或合约代码。这支撑了\"快速同步\"（fast sync），即逐个节点下载状态，而不是执行每个历史区块。\n\n要响应这类请求，客户端必须维护一个把每个 trie 节点哈希映射到节点本身的数据库。较新的存储设计以不同的布局保存状态（例如扁平存储或基于路径的存储），根本无法按哈希查找节点。因此一些客户端完全无法提供 `GetNodeData`。协议中应该只包含每个客户端都能实现的消息。\n\n## 它如何运作\n\n`eth/67` 就是 `eth/66` 去掉两条消息：\n\n| 消息 | 代码 | eth/66 的格式 |\n| --- | --- | --- |\n| `GetNodeData` | `0x0d` | `[request_id, [hash_0, hash_1, ...]]` |\n| `NodeData` | `0x0e` | `[request_id, [value_0, value_1, ...]]` |\n\n其他一切不变。替代方案在独立的 **snap** 协议中：`GetByteCodes` 获取合约代码，`GetTrieNodes` 按路径获取 trie 节点。snap 可以实现快速同步，不过规范建议将其用于 snap sync。\n\n由于 devp2p 按连接协商协议版本，对等节点可以同时支持 `eth/66` 和 `eth/67`。旧客户端不会被立即切断，它们会继续使用 `eth/66` 通信。\n\n## 示例代码\n\n客户端在 devp2p `Hello` 握手期间可能广播的能力（capability）协商（示意）：\n\n```json\n{\n  \"capabilities\": [\n    { \"name\": \"eth\",  \"version\": 66 },\n    { \"name\": \"eth\",  \"version\": 67 },\n    { \"name\": \"snap\", \"version\": 1 }\n  ]\n}\n```\n\n在 `eth/67` 会话上处理收到的消息（示意性伪代码；具体的对等节点处理方式取决于客户端）：\n\n```python\nGET_NODE_DATA = 0x0d\nNODE_DATA     = 0x0e\n\ndef on_eth_message(session, code, payload):\n    if session.eth_version \u003e= 67 and code in (GET_NODE_DATA, NODE_DATA):\n        session.disconnect(\"invalid message for eth/67\")\n        return\n    dispatch(code, payload)\n```\n\n## 需要注意\n\n- 状态：**Final**。这只是一项网络层改动：不改变共识规则，也不需要硬分叉。\n- 它建立在 [EIP-2464](/eip-2464/)（eth/65）和 [EIP-2481](/eip-2481/)（eth/66 的请求 ID）之上。下一个版本 eth/68（[EIP-5793](/eip-5793/)）为交易公告增加了交易类型。\n- 任何使用 `GetNodeData` 获取状态的工具都需要改用 snap 协议或 RPC。\n- `eth` 协议规范本身位于 devp2p 仓库中，该 EIP 只记录这项变更。\n"}},"requiredBy":[5793]}
