{"eip":2464,"title":"eth/65: transaction announcements and retrievals","description":"Introduces `NewPooledTransactionHashes`, `GetPooledTransactions`, and `PooledTransactions`.","authors":["Péter Szilágyi \u003cpeterke@gmail.com\u003e","Péter Szilágyi (@karalabe)","Gary Rong \u003cgaryrong0905@gmail.com\u003e","Tim Beiko (@timbeiko)"],"status":"Final","type":"Standards Track","category":"Networking","created":"2020-01-13","requires":[2364],"discussionsTo":"https://github.com/ethereum/EIPs/issues/2465","repo":"EIPs","label":"EIP-2464","officialUrl":"https://eips.ethereum.org/EIPS/eip-2464","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2464.md","url":"https://eips.huatuo.xyz/eip-2464/","tldr":{"en":"Introduced eth/65, which lets nodes announce new transactions by hash and fetch only the ones they lack, cutting the bandwidth wasted on gossiping the same transactions to every peer.","ja":"eth/65 を導入し、ノードが新しいトランザクションをハッシュで通知し、持っていないものだけを取得できるようにした。同じトランザクションをすべてのピアに配信するために無駄になる帯域を削減する。","ko":"eth/65를 도입해 노드가 새 트랜잭션을 해시로 알리고 자신에게 없는 것만 가져오게 함으로써, 같은 트랜잭션을 모든 피어에게 퍼뜨리느라 낭비되는 대역폭을 줄인다.","zh":"引入 eth/65，让节点通过哈希来宣告新交易，只获取自己缺少的交易，减少向每个对等节点广播相同交易所浪费的带宽。"},"tags":["networking","devp2p","mempool","transactions","protocol"],"explainers":{"en":{"lang":"en","tldr":"Introduced eth/65, which lets nodes announce new transactions by hash and fetch only the ones they lack, cutting the bandwidth wasted on gossiping the same transactions to every peer.","tags":["networking","devp2p","mempool","transactions","protocol"],"related":[2364,2481,5793],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-2464/","markdown":"## What problem does it solve?\n\nFor blocks, the `eth` wire protocol already had two ways to propagate: send the full block to a small (square root) number of peers, and only *announce* its hash to the rest. Transactions had no such split. Up to `eth/64`, a node could only push complete transactions with the `Transactions (0x02)` message, so to reach every corner of the network it had to send each transaction to all of its peers. With N peers, the same transaction crossed each connection, wasting bandwidth N times over.\n\nConnecting to a new peer was worse: the two nodes had no way to tell which pending transactions the other already had, so they exchanged their entire pools, which the spec estimates at tens to hundreds of MB.\n\n## How it works\n\nEIP-2464 adds three messages and bumps the protocol to `eth/65`:\n\n| Message | Code | Payload | Purpose |\n| --- | --- | --- | --- |\n| `NewPooledTransactionHashes` | `0x08` | list of 32-byte hashes | \"I have these pending transactions\" |\n| `GetPooledTransactions` | `0x09` | list of 32-byte hashes | \"Send me these from your pool\" |\n| `PooledTransactions` | `0x0a` | list of transactions | Reply to a `GetPooledTransactions` request |\n\nThe flow is: announce hashes to most peers, let each peer request only what it is missing, then answer with the full transactions. Full broadcast can be limited to a small subset of peers, as is already done for blocks. Syncing pools with a new peer drops to roughly `len(pool) × 32 bytes`.\n\nKey rules:\n\n- Only transactions in the **pool** (not yet in a block) are announced or served. Nodes never read the database to answer, which avoids a cheap denial-of-service vector.\n- There is no protocol-level cap on list length beyond the 10 MB devp2p packet limit, but the spec suggests about 4096 hashes per announcement and 256 per request.\n- Replies keep the request order and may skip unavailable items, so the requester can tell which hashes to retry (everything after the last returned one) and which to treat as unavailable (gaps before it).\n- A separate reply message (rather than reusing `0x02`) makes it easy to match responses to requests.\n\n## Sample code\n\nMessage shapes in RLP-style pseudocode:\n\n```text\nNewPooledTransactionHashes (0x08): [txhash_0: B_32, txhash_1: B_32, ...]\nGetPooledTransactions      (0x09): [txhash_0: B_32, txhash_1: B_32, ...]\nPooledTransactions         (0x0a): [tx_0, tx_1, ...]   # same order as requested, gaps allowed\n```\n\nA simplified handler for incoming announcements:\n\n```python\ndef on_new_pooled_hashes(peer, hashes):\n    missing = [h for h in hashes if h not in txpool and h not in in_flight]\n    for chunk in batches(missing, 256):           # suggested request size\n        in_flight.update(chunk)\n        peer.send(GetPooledTransactions(chunk))\n\ndef on_pooled_transactions(peer, requested, txs):\n    for tx in txs:\n        txpool.add(tx)\n    # hashes after the last returned tx can be re-requested;\n    # gaps before it are treated as unavailable\n```\n\n## Things to know\n\n- This is a networking change only. It does not touch consensus and needed no hard fork; devp2p runs several `eth` versions side by side, so upgraded and old clients kept talking over `eth/64`.\n- Later versions build on it: [eth/66](/eip-2481/) added request IDs, and [eth/68](/eip-5793/) added transaction types and sizes to the hash announcements.\n- A peer may announce a transaction and later fail to serve it if it was included in a block in the meantime; this is not a protocol violation.\n"},"ja":{"lang":"ja","tldr":"eth/65 を導入し、ノードが新しいトランザクションをハッシュで通知し、持っていないものだけを取得できるようにした。同じトランザクションをすべてのピアに配信するために無駄になる帯域を削減する。","tags":["networking","devp2p","mempool","transactions","protocol"],"related":[2364,2481,5793],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-2464/","markdown":"## 何を解決するのか\n\nブロックについては、`eth` ワイヤプロトコルにはすでに 2 つの伝播方法がありました。少数（平方根個）のピアには完全なブロックを送り、残りにはそのハッシュを*通知*するだけ、というものです。トランザクションにはこのような使い分けがありませんでした。`eth/64` までは、ノードは `Transactions (0x02)` メッセージで完全なトランザクションを送るしかなく、ネットワークの隅々まで届けるには、各トランザクションをすべてのピアに送る必要がありました。ピアが N 個なら、同じトランザクションがすべての接続を通り、帯域が N 倍無駄になります。\n\n新しいピアへの接続はさらに非効率でした。2 つのノードは、相手がどの保留中トランザクションをすでに持っているかを知る手段がなく、プール全体を交換していました。仕様はこれを数十～数百 MB と見積もっています。\n\n## 仕組み\n\nEIP-2464 は 3 つのメッセージを追加し、プロトコルを `eth/65` に引き上げます。\n\n| メッセージ | コード | ペイロード | 目的 |\n| --- | --- | --- | --- |\n| `NewPooledTransactionHashes` | `0x08` | 32 バイトのハッシュのリスト | 「これらの保留中トランザクションを持っています」 |\n| `GetPooledTransactions` | `0x09` | 32 バイトのハッシュのリスト | 「あなたのプールからこれらを送ってください」 |\n| `PooledTransactions` | `0x0a` | トランザクションのリスト | `GetPooledTransactions` リクエストへの返信 |\n\n流れは次のとおりです。ほとんどのピアにハッシュを通知し、各ピアが足りないものだけをリクエストし、それに完全なトランザクションで応答します。完全なブロードキャストは、ブロックですでに行われているように、少数のピアに限定できます。新しいピアとのプール同期は、おおよそ `len(pool) × 32 bytes` まで減ります。\n\n主なルール:\n\n- 通知または提供されるのは、**プール**内（まだブロックに含まれていない）のトランザクションだけです。ノードは応答のためにデータベースを読むことはなく、これにより安価なサービス拒否攻撃の経路を避けられます。\n- リストの長さには、devp2p のパケット上限 10 MB 以外にプロトコルレベルの上限はありませんが、仕様は 1 回の通知あたり約 4096 ハッシュ、1 回のリクエストあたり 256 ハッシュを提案しています。\n- 返信はリクエストの順序を保ち、取得できない項目を飛ばしてもかまいません。これにより、リクエスト側は再試行すべきハッシュ（最後に返されたものより後のすべて）と、取得不能として扱うべきハッシュ（それより前の抜け）を判別できます。\n- 返信用に別のメッセージを用意する（`0x02` を再利用しない）ことで、レスポンスとリクエストの対応付けが容易になります。\n\n## サンプルコード\n\nRLP 風の疑似コードによるメッセージの形:\n\n```text\nNewPooledTransactionHashes (0x08): [txhash_0: B_32, txhash_1: B_32, ...]\nGetPooledTransactions      (0x09): [txhash_0: B_32, txhash_1: B_32, ...]\nPooledTransactions         (0x0a): [tx_0, tx_1, ...]   # same order as requested, gaps allowed\n```\n\n受信した通知を処理する簡略化したハンドラー:\n\n```python\ndef on_new_pooled_hashes(peer, hashes):\n    missing = [h for h in hashes if h not in txpool and h not in in_flight]\n    for chunk in batches(missing, 256):           # suggested request size\n        in_flight.update(chunk)\n        peer.send(GetPooledTransactions(chunk))\n\ndef on_pooled_transactions(peer, requested, txs):\n    for tx in txs:\n        txpool.add(tx)\n    # hashes after the last returned tx can be re-requested;\n    # gaps before it are treated as unavailable\n```\n\n## 知っておくべきこと\n\n- これはネットワークの変更だけです。コンセンサスには触れず、ハードフォークも不要でした。devp2p は複数の `eth` バージョンを並行して動かすため、アップグレード済みのクライアントと古いクライアントは `eth/64` で通信を続けました。\n- その後のバージョンがこれを土台にしています。[eth/66](/eip-2481/) はリクエスト ID を追加し、[eth/68](/eip-5793/) はハッシュの通知にトランザクションのタイプとサイズを追加しました。\n- ピアがトランザクションを通知した後、その間にブロックに含まれたために提供できなくなることがあります。これはプロトコル違反ではありません。\n"},"ko":{"lang":"ko","tldr":"eth/65를 도입해 노드가 새 트랜잭션을 해시로 알리고 자신에게 없는 것만 가져오게 함으로써, 같은 트랜잭션을 모든 피어에게 퍼뜨리느라 낭비되는 대역폭을 줄인다.","tags":["networking","devp2p","mempool","transactions","protocol"],"related":[2364,2481,5793],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-2464/","markdown":"## 어떤 문제를 해결하나요?\n\n블록의 경우 `eth` 와이어 프로토콜에는 이미 두 가지 전파 방식이 있었습니다. 소수(제곱근 개)의 피어에게는 전체 블록을 보내고, 나머지에게는 해시만 *알리는* 방식입니다. 트랜잭션에는 이런 구분이 없었습니다. `eth/64`까지 노드는 `Transactions (0x02)` 메시지로 완전한 트랜잭션만 보낼 수 있었기 때문에, 네트워크 구석구석까지 닿으려면 각 트랜잭션을 모든 피어에게 보내야 했습니다. 피어가 N개라면 같은 트랜잭션이 모든 연결을 지나가 대역폭이 N배 낭비됩니다.\n\n새 피어에 연결할 때는 더 심했습니다. 두 노드는 상대가 어떤 대기 중 트랜잭션을 이미 갖고 있는지 알 방법이 없어서 풀 전체를 교환했고, 명세는 이를 수십~수백 MB로 추정합니다.\n\n## 어떻게 동작하나요?\n\nEIP-2464는 메시지 세 개를 추가하고 프로토콜을 `eth/65`로 올립니다.\n\n| 메시지 | 코드 | 페이로드 | 목적 |\n| --- | --- | --- | --- |\n| `NewPooledTransactionHashes` | `0x08` | 32바이트 해시 목록 | \"이 대기 중 트랜잭션들을 갖고 있어요\" |\n| `GetPooledTransactions` | `0x09` | 32바이트 해시 목록 | \"당신 풀에서 이것들을 보내 주세요\" |\n| `PooledTransactions` | `0x0a` | 트랜잭션 목록 | `GetPooledTransactions` 요청에 대한 응답 |\n\n흐름은 이렇습니다. 대부분의 피어에게 해시를 알리고, 각 피어가 자신에게 없는 것만 요청하게 한 뒤, 전체 트랜잭션으로 응답합니다. 전체 브로드캐스트는 블록에서 이미 하듯이 소수의 피어로 제한할 수 있습니다. 새 피어와의 풀 동기화는 대략 `len(pool) × 32 bytes`로 줄어듭니다.\n\n주요 규칙:\n\n- **풀**에 있는(아직 블록에 포함되지 않은) 트랜잭션만 알리거나 제공합니다. 노드는 응답하려고 데이터베이스를 읽지 않으며, 이는 저렴한 서비스 거부 공격 경로를 막아 줍니다.\n- 10 MB의 devp2p 패킷 한도 외에는 목록 길이에 프로토콜 수준의 상한이 없지만, 명세는 알림 한 번에 약 4096개 해시, 요청 한 번에 256개를 권장합니다.\n- 응답은 요청 순서를 유지하며 제공할 수 없는 항목은 건너뛸 수 있으므로, 요청한 쪽은 어떤 해시를 재시도해야 하는지(마지막으로 반환된 것 이후 전부)와 어떤 해시를 사용 불가로 취급할지(그 앞의 빈 곳)를 알 수 있습니다.\n- 응답용 메시지를 따로 두면(`0x02`를 재사용하지 않고) 응답을 요청에 맞춰 보기가 쉽습니다.\n\n## 샘플 코드\n\nRLP 스타일 의사 코드로 나타낸 메시지 형태:\n\n```text\nNewPooledTransactionHashes (0x08): [txhash_0: B_32, txhash_1: B_32, ...]\nGetPooledTransactions      (0x09): [txhash_0: B_32, txhash_1: B_32, ...]\nPooledTransactions         (0x0a): [tx_0, tx_1, ...]   # same order as requested, gaps allowed\n```\n\n수신한 알림을 처리하는 단순화된 핸들러:\n\n```python\ndef on_new_pooled_hashes(peer, hashes):\n    missing = [h for h in hashes if h not in txpool and h not in in_flight]\n    for chunk in batches(missing, 256):           # suggested request size\n        in_flight.update(chunk)\n        peer.send(GetPooledTransactions(chunk))\n\ndef on_pooled_transactions(peer, requested, txs):\n    for tx in txs:\n        txpool.add(tx)\n    # hashes after the last returned tx can be re-requested;\n    # gaps before it are treated as unavailable\n```\n\n## 알아둘 점\n\n- 네트워킹만 바꾸는 변경입니다. 합의에는 영향을 주지 않으며 하드 포크도 필요 없었습니다. devp2p는 여러 `eth` 버전을 나란히 실행하므로, 업그레이드된 클라이언트와 이전 클라이언트는 `eth/64`로 계속 통신했습니다.\n- 이후 버전들이 이를 기반으로 합니다. [eth/66](/eip-2481/)은 요청 ID를 추가했고, [eth/68](/eip-5793/)은 해시 알림에 트랜잭션 타입과 크기를 추가했습니다.\n- 피어가 트랜잭션을 알린 뒤, 그사이 블록에 포함되어 제공하지 못하게 될 수 있습니다. 이는 프로토콜 위반이 아닙니다.\n"},"zh":{"lang":"zh","tldr":"引入 eth/65，让节点通过哈希来宣告新交易，只获取自己缺少的交易，减少向每个对等节点广播相同交易所浪费的带宽。","tags":["networking","devp2p","mempool","transactions","protocol"],"related":[2364,2481,5793],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-2464/","markdown":"## 它解决什么问题？\n\n对于区块，`eth` 线路协议已经有两种传播方式：把完整区块发给少量（平方根数量）的对等节点，只向其余节点*宣告*它的哈希。交易却没有这种区分。在 `eth/64` 及之前，节点只能通过 `Transactions (0x02)` 消息推送完整的交易，所以要让交易传遍网络的每个角落，就得把每笔交易发给所有对等节点。有 N 个对等节点时，同一笔交易会经过每一条连接，带宽被浪费了 N 倍。\n\n连接新对等节点时更糟：两个节点无法知道对方已经有哪些待处理交易，只能交换整个交易池，规范估计其大小为数十到数百 MB。\n\n## 它如何运作\n\nEIP-2464 增加了三种消息，并把协议升级为 `eth/65`：\n\n| 消息 | 代码 | 载荷 | 用途 |\n| --- | --- | --- | --- |\n| `NewPooledTransactionHashes` | `0x08` | 32 字节哈希的列表 | “我有这些待处理交易” |\n| `GetPooledTransactions` | `0x09` | 32 字节哈希的列表 | “请把这些从你的池里发给我” |\n| `PooledTransactions` | `0x0a` | 交易列表 | 对 `GetPooledTransactions` 请求的回复 |\n\n流程是：向大多数对等节点宣告哈希，让每个对等节点只请求自己缺少的，然后用完整交易作答。完整广播可以限制在一小部分对等节点上，就像区块已经做的那样。与新对等节点同步交易池的开销降到大约 `len(pool) × 32 bytes`。\n\n关键规则：\n\n- 只有**交易池**中（尚未进入区块）的交易才会被宣告或提供。节点绝不会为了应答而读取数据库，这避免了一个廉价的拒绝服务攻击途径。\n- 除了 10 MB 的 devp2p 数据包上限外，协议层面没有对列表长度设上限，但规范建议每次宣告约 4096 个哈希，每次请求 256 个。\n- 回复保持请求的顺序，可以跳过不可用的项目，这样请求方就能分辨哪些哈希需要重试（最后一个返回项之后的全部），哪些视为不可用（它之前的空缺）。\n- 使用单独的回复消息（而不是复用 `0x02`）便于把响应与请求对应起来。\n\n## 示例代码\n\n用类 RLP 伪代码表示的消息格式：\n\n```text\nNewPooledTransactionHashes (0x08): [txhash_0: B_32, txhash_1: B_32, ...]\nGetPooledTransactions      (0x09): [txhash_0: B_32, txhash_1: B_32, ...]\nPooledTransactions         (0x0a): [tx_0, tx_1, ...]   # same order as requested, gaps allowed\n```\n\n处理收到的宣告的简化处理函数：\n\n```python\ndef on_new_pooled_hashes(peer, hashes):\n    missing = [h for h in hashes if h not in txpool and h not in in_flight]\n    for chunk in batches(missing, 256):           # suggested request size\n        in_flight.update(chunk)\n        peer.send(GetPooledTransactions(chunk))\n\ndef on_pooled_transactions(peer, requested, txs):\n    for tx in txs:\n        txpool.add(tx)\n    # hashes after the last returned tx can be re-requested;\n    # gaps before it are treated as unavailable\n```\n\n## 需要注意\n\n- 这只是网络层的变更。它不涉及共识，也不需要硬分叉；devp2p 可以并行运行多个 `eth` 版本，所以升级后的客户端和旧客户端仍通过 `eth/64` 通信。\n- 后续版本都建立在它之上：[eth/66](/eip-2481/) 增加了请求 ID，[eth/68](/eip-5793/) 在哈希宣告中加入了交易类型和大小。\n- 对等节点可能宣告了某笔交易，之后却无法提供，因为它在此期间已被打包进区块；这不算违反协议。\n"}},"requiredBy":[2481,4938,5793]}
