1
1
# Ethereum Wire Protocol (ETH)
2
2
3
3
'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
5
5
of document for a list of changes in past protocol versions.
6
6
7
7
### Basic Operation
@@ -270,6 +270,10 @@ this specification.
270
270
271
271
## Protocol Messages
272
272
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
+
273
277
### Status (0x00)
274
278
275
279
` [version: P, networkid: P, td: P, blockhash: B_32, genesis: B_32, forkid] `
@@ -328,38 +332,36 @@ have already been sent or received.
328
332
329
333
### GetBlockHeaders (0x03)
330
334
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}] ] `
332
336
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
334
338
headers, of rising number when ` reverse ` is ` 0 ` , falling when ` 1 ` , ` skip ` blocks apart,
335
339
beginning at block ` startblock ` (denoted by either number or hash) in the canonical chain,
336
340
and with at most ` limit ` items.
337
341
338
342
### BlockHeaders (0x04)
339
343
340
- ` [header₁, header₂, ...] `
344
+ ` [request-id: P, [ header₁, header₂, ...] ] `
341
345
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.
346
349
347
350
The recommended soft limit for BlockHeaders responses is 2 MiB.
348
351
349
352
### GetBlockBodies (0x05)
350
353
351
- ` [blockhash₁: B_32, blockhash₂: B_32, ...] `
354
+ ` [request-id: P, [ blockhash₁: B_32, blockhash₂: B_32, ...] ] `
352
355
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.
356
358
357
359
### BlockBodies (0x06)
358
360
359
- ` [block-body₁, block-body₂, ...] `
361
+ ` [request-id: P, [ block-body₁, block-body₂, ...] ] `
360
362
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.
363
365
364
366
The recommended soft limit for BlockBodies responses is 2 MiB.
365
367
@@ -387,7 +389,7 @@ gap in the pool.
387
389
388
390
### GetPooledTransactions (0x09)
389
391
390
- ` [txhash₁: B_32, txhash₂: B_32, ...] `
392
+ ` [request-id: P, [ txhash₁: B_32, txhash₂: B_32, ...] ] `
391
393
392
394
This message requests transactions from the recipient's transaction pool by hash.
393
395
@@ -397,7 +399,7 @@ must not be considered a protocol violation.
397
399
398
400
### PooledTransactions (0x0a)
399
401
400
- ` [tx₁, tx₂...] `
402
+ ` [request-id: P, [ tx₁, tx₂...] ] `
401
403
402
404
This is the response to GetPooledTransactions, returning the requested transactions from
403
405
the local pool. The items in the list are transactions in the format described in the main
@@ -419,14 +421,14 @@ pool.
419
421
420
422
### GetNodeData (0x0d)
421
423
422
- ` [hash₁: B_32, hash₂: B_32, ...] `
424
+ ` [request-id: P, [ hash₁: B_32, hash₂: B_32, ...] ] `
423
425
424
426
Require peer to return a [ NodeData] message containing state tree nodes or contract code
425
427
matching the requested hashes.
426
428
427
429
### NodeData (0x0e)
428
430
429
- ` [value₁: B, value₂: B, ...] `
431
+ ` [request-id: P, [ value₁: B, value₂: B, ...] ] `
430
432
431
433
Provide a set of state tree nodes or contract code blobs which correspond to previously
432
434
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.
438
440
439
441
### GetReceipts (0x0f)
440
442
441
- ` [blockhash₁: B_32, blockhash₂: B_32, ...] `
443
+ ` [request-id: P, [ blockhash₁: B_32, blockhash₂: B_32, ...] ] `
442
444
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
444
446
hashes. The number of receipts that can be requested in a single message may be subject to
445
447
implementation-defined limits.
446
448
447
449
### Receipts (0x10)
448
450
449
- ` [[ receipt₁, receipt₂], ...] `
451
+ ` [request-id: P, [[ receipt₁, receipt₂], ...] ] `
450
452
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.
453
456
454
457
The recommended soft limit for Receipts responses is 2 MiB.
455
458
456
459
## Change Log
457
460
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
+
458
467
### eth/65 with typed transactions ([ EIP-2976] , April 2021)
459
468
460
469
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.
539
548
[ EIP-2124 ] : https://eips.ethereum.org/EIPS/eip-2124
540
549
[ EIP-2364 ] : https://eips.ethereum.org/EIPS/eip-2364
541
550
[ EIP-2464 ] : https://eips.ethereum.org/EIPS/eip-2464
551
+ [ EIP-2481 ] : https://eips.ethereum.org/EIPS/eip-2481
542
552
[ EIP-2718 ] : https://eips.ethereum.org/EIPS/eip-2718
543
553
[ EIP-2976 ] : https://eips.ethereum.org/EIPS/eip-2976
544
554
[ Yellow Paper ] : https://ethereum.github.io/yellowpaper/paper.pdf
0 commit comments