Skip to content

Commit c5a49eb

Browse files
authored
caps/eth.md: update for protocol version eth/66 (#178)
1 parent 249d032 commit c5a49eb

File tree

1 file changed

+34
-24
lines changed

1 file changed

+34
-24
lines changed

caps/eth.md

Lines changed: 34 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Ethereum Wire Protocol (ETH)
22

33
'eth' is a protocol on the [RLPx] transport that facilitates exchange of Ethereum
4-
blockchain information between peers. The current protocol version is **eth/65**. See end
4+
blockchain information between peers. The current protocol version is **eth/66**. See end
55
of document for a list of changes in past protocol versions.
66

77
### Basic Operation
@@ -270,6 +270,10 @@ this specification.
270270

271271
## Protocol Messages
272272

273+
In most messages, the first element of the message data list is the `request-id`. For
274+
requests, this is a 64-bit integer value chosen by the requesting peer. The responding
275+
peer must mirror the value in the `request-id` element of the response message.
276+
273277
### Status (0x00)
274278

275279
`[version: P, networkid: P, td: P, blockhash: B_32, genesis: B_32, forkid]`
@@ -328,38 +332,36 @@ have already been sent or received.
328332

329333
### GetBlockHeaders (0x03)
330334

331-
`[startblock: {P, B_32}, limit: P, skip: P, reverse: {0, 1}]`
335+
`[request-id: P, [startblock: {P, B_32}, limit: P, skip: P, reverse: {0, 1}]]`
332336

333-
Require peer to return a [BlockHeaders] message. Reply must contain a number of block
337+
Require peer to return a BlockHeaders message. The response must contain a number of block
334338
headers, of rising number when `reverse` is `0`, falling when `1`, `skip` blocks apart,
335339
beginning at block `startblock` (denoted by either number or hash) in the canonical chain,
336340
and with at most `limit` items.
337341

338342
### BlockHeaders (0x04)
339343

340-
`[header₁, header₂, ...]`
344+
`[request-id: P, [header₁, header₂, ...]]`
341345

342-
Reply to [GetBlockHeaders]. The items in the list are block headers, previously asked for
343-
in a GetBlockHeaders message. The list may contain no block headers if none of the
344-
requested block headers were found. The number of headers that can be requested in a
345-
single message may be subject to implementation-defined limits.
346+
This is the response to GetBlockHeaders, containing the requested headers. The header list
347+
may be empty if none of the requested block headers were found. The number of headers that
348+
can be requested in a single message may be subject to implementation-defined limits.
346349

347350
The recommended soft limit for BlockHeaders responses is 2 MiB.
348351

349352
### GetBlockBodies (0x05)
350353

351-
`[blockhash₁: B_32, blockhash₂: B_32, ...]`
354+
`[request-id: P, [blockhash₁: B_32, blockhash₂: B_32, ...]]`
352355

353-
Require peer to return a [BlockBodies] message. Specify the set of blocks that we're
354-
interested in with the hashes. The number of blocks that can be requested in a single
355-
message may be subject to implementation-defined limits.
356+
This message requests block body data by hash. The number of blocks that can be requested
357+
in a single message may be subject to implementation-defined limits.
356358

357359
### BlockBodies (0x06)
358360

359-
`[block-body₁, block-body₂, ...]`
361+
`[request-id: P, [block-body₁, block-body₂, ...]]`
360362

361-
Reply to [GetBlockBodies]. The items in the list contain the block bodies of the requested
362-
blocks. The list may be empty if none of the requested blocks were available.
363+
This is the response to GetBlockBodies. The items in the list contain the body data of the
364+
requested blocks. The list may be empty if none of the requested blocks were available.
363365

364366
The recommended soft limit for BlockBodies responses is 2 MiB.
365367

@@ -387,7 +389,7 @@ gap in the pool.
387389

388390
### GetPooledTransactions (0x09)
389391

390-
`[txhash₁: B_32, txhash₂: B_32, ...]`
392+
`[request-id: P, [txhash₁: B_32, txhash₂: B_32, ...]]`
391393

392394
This message requests transactions from the recipient's transaction pool by hash.
393395

@@ -397,7 +399,7 @@ must not be considered a protocol violation.
397399

398400
### PooledTransactions (0x0a)
399401

400-
`[tx₁, tx₂...]`
402+
`[request-id: P, [tx₁, tx₂...]]`
401403

402404
This is the response to GetPooledTransactions, returning the requested transactions from
403405
the local pool. The items in the list are transactions in the format described in the main
@@ -419,14 +421,14 @@ pool.
419421

420422
### GetNodeData (0x0d)
421423

422-
`[hash₁: B_32, hash₂: B_32, ...]`
424+
`[request-id: P, [hash₁: B_32, hash₂: B_32, ...]]`
423425

424426
Require peer to return a [NodeData] message containing state tree nodes or contract code
425427
matching the requested hashes.
426428

427429
### NodeData (0x0e)
428430

429-
`[value₁: B, value₂: B, ...]`
431+
`[request-id: P, [value₁: B, value₂: B, ...]]`
430432

431433
Provide a set of state tree nodes or contract code blobs which correspond to previously
432434
requested hashes from [GetNodeData]. Does not need to contain all; best effort is fine.
@@ -438,23 +440,30 @@ The recommended soft limit for NodeData responses is 2 MiB.
438440

439441
### GetReceipts (0x0f)
440442

441-
`[blockhash₁: B_32, blockhash₂: B_32, ...]`
443+
`[request-id: P, [blockhash₁: B_32, blockhash₂: B_32, ...]]`
442444

443-
Require peer to return a [Receipts] message containing the receipts of the given block
445+
Require peer to return a Receipts message containing the receipts of the given block
444446
hashes. The number of receipts that can be requested in a single message may be subject to
445447
implementation-defined limits.
446448

447449
### Receipts (0x10)
448450

449-
`[[receipt₁, receipt₂], ...]`
451+
`[request-id: P, [[receipt₁, receipt₂], ...]]`
450452

451-
Provide a set of receipts which correspond to block hashes in a previous [GetReceipts]
452-
message.
453+
This is the response to GetReceipts, providing the requested block receipts. Each element
454+
in the response list corresponds to a block hash of the GetReceipts request, and must
455+
contain the complete list of receipts of the block.
453456

454457
The recommended soft limit for Receipts responses is 2 MiB.
455458

456459
## Change Log
457460

461+
### eth/66 ([EIP-2481], April 2021)
462+
463+
Version 66 added the `request-id` element in messages [GetBlockHeaders], [BlockHeaders],
464+
[GetBlockBodies], [BlockBodies], [GetPooledTransactions], [PooledTransactions],
465+
[GetNodeData], [NodeData], [GetReceipts], [Receipts].
466+
458467
### eth/65 with typed transactions ([EIP-2976], April 2021)
459468

460469
When typed transactions were introduced by [EIP-2718], client implementers decided to
@@ -539,6 +548,7 @@ Version numbers below 60 were used during the Ethereum PoC development phase.
539548
[EIP-2124]: https://eips.ethereum.org/EIPS/eip-2124
540549
[EIP-2364]: https://eips.ethereum.org/EIPS/eip-2364
541550
[EIP-2464]: https://eips.ethereum.org/EIPS/eip-2464
551+
[EIP-2481]: https://eips.ethereum.org/EIPS/eip-2481
542552
[EIP-2718]: https://eips.ethereum.org/EIPS/eip-2718
543553
[EIP-2976]: https://eips.ethereum.org/EIPS/eip-2976
544554
[Yellow Paper]: https://ethereum.github.io/yellowpaper/paper.pdf

0 commit comments

Comments
 (0)