Skip to content

Commit 842ed75

Browse files
rjl493456442fjlholiman
authored andcommitted
eth: introduce eth67 protocol (ethereum#24093)
The new protocol version removes support for GetNodeData. See https://eips.ethereum.org/EIPS/eip-4938 for more information. Co-authored-by: Felix Lange <fjl@twurst.com> Co-authored-by: Martin Holst Swende <martin@swende.se>
1 parent 5702dff commit 842ed75

File tree

5 files changed

+97
-11
lines changed

5 files changed

+97
-11
lines changed

eth/downloader/downloader_test.go

Lines changed: 71 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,9 @@ func assertOwnChain(t *testing.T, tester *downloadTester, length int) {
437437
func TestCanonicalSynchronisation66Full(t *testing.T) { testCanonSync(t, eth.ETH66, FullSync) }
438438
func TestCanonicalSynchronisation66Snap(t *testing.T) { testCanonSync(t, eth.ETH66, SnapSync) }
439439
func TestCanonicalSynchronisation66Light(t *testing.T) { testCanonSync(t, eth.ETH66, LightSync) }
440+
func TestCanonicalSynchronisation67Full(t *testing.T) { testCanonSync(t, eth.ETH67, FullSync) }
441+
func TestCanonicalSynchronisation67Snap(t *testing.T) { testCanonSync(t, eth.ETH67, SnapSync) }
442+
func TestCanonicalSynchronisation67Light(t *testing.T) { testCanonSync(t, eth.ETH67, LightSync) }
440443

441444
func testCanonSync(t *testing.T, protocol uint, mode SyncMode) {
442445
tester := newTester(t)
@@ -457,6 +460,8 @@ func testCanonSync(t *testing.T, protocol uint, mode SyncMode) {
457460
// until the cached blocks are retrieved.
458461
func TestThrottling66Full(t *testing.T) { testThrottling(t, eth.ETH66, FullSync) }
459462
func TestThrottling66Snap(t *testing.T) { testThrottling(t, eth.ETH66, SnapSync) }
463+
func TestThrottling67Full(t *testing.T) { testThrottling(t, eth.ETH67, FullSync) }
464+
func TestThrottling67Snap(t *testing.T) { testThrottling(t, eth.ETH67, SnapSync) }
460465

461466
func testThrottling(t *testing.T, protocol uint, mode SyncMode) {
462467
tester := newTester(t)
@@ -537,6 +542,9 @@ func testThrottling(t *testing.T, protocol uint, mode SyncMode) {
537542
func TestForkedSync66Full(t *testing.T) { testForkedSync(t, eth.ETH66, FullSync) }
538543
func TestForkedSync66Snap(t *testing.T) { testForkedSync(t, eth.ETH66, SnapSync) }
539544
func TestForkedSync66Light(t *testing.T) { testForkedSync(t, eth.ETH66, LightSync) }
545+
func TestForkedSync67Full(t *testing.T) { testForkedSync(t, eth.ETH67, FullSync) }
546+
func TestForkedSync67Snap(t *testing.T) { testForkedSync(t, eth.ETH67, SnapSync) }
547+
func TestForkedSync67Light(t *testing.T) { testForkedSync(t, eth.ETH67, LightSync) }
540548

541549
func testForkedSync(t *testing.T, protocol uint, mode SyncMode) {
542550
tester := newTester(t)
@@ -564,6 +572,9 @@ func testForkedSync(t *testing.T, protocol uint, mode SyncMode) {
564572
func TestHeavyForkedSync66Full(t *testing.T) { testHeavyForkedSync(t, eth.ETH66, FullSync) }
565573
func TestHeavyForkedSync66Snap(t *testing.T) { testHeavyForkedSync(t, eth.ETH66, SnapSync) }
566574
func TestHeavyForkedSync66Light(t *testing.T) { testHeavyForkedSync(t, eth.ETH66, LightSync) }
575+
func TestHeavyForkedSync67Full(t *testing.T) { testHeavyForkedSync(t, eth.ETH67, FullSync) }
576+
func TestHeavyForkedSync67Snap(t *testing.T) { testHeavyForkedSync(t, eth.ETH67, SnapSync) }
577+
func TestHeavyForkedSync67Light(t *testing.T) { testHeavyForkedSync(t, eth.ETH67, LightSync) }
567578

568579
func testHeavyForkedSync(t *testing.T, protocol uint, mode SyncMode) {
569580
tester := newTester(t)
@@ -593,6 +604,9 @@ func testHeavyForkedSync(t *testing.T, protocol uint, mode SyncMode) {
593604
func TestBoundedForkedSync66Full(t *testing.T) { testBoundedForkedSync(t, eth.ETH66, FullSync) }
594605
func TestBoundedForkedSync66Snap(t *testing.T) { testBoundedForkedSync(t, eth.ETH66, SnapSync) }
595606
func TestBoundedForkedSync66Light(t *testing.T) { testBoundedForkedSync(t, eth.ETH66, LightSync) }
607+
func TestBoundedForkedSync67Full(t *testing.T) { testBoundedForkedSync(t, eth.ETH67, FullSync) }
608+
func TestBoundedForkedSync67Snap(t *testing.T) { testBoundedForkedSync(t, eth.ETH67, SnapSync) }
609+
func TestBoundedForkedSync67Light(t *testing.T) { testBoundedForkedSync(t, eth.ETH67, LightSync) }
596610

597611
func testBoundedForkedSync(t *testing.T, protocol uint, mode SyncMode) {
598612
tester := newTester(t)
@@ -627,6 +641,15 @@ func TestBoundedHeavyForkedSync66Snap(t *testing.T) {
627641
func TestBoundedHeavyForkedSync66Light(t *testing.T) {
628642
testBoundedHeavyForkedSync(t, eth.ETH66, LightSync)
629643
}
644+
func TestBoundedHeavyForkedSync67Full(t *testing.T) {
645+
testBoundedHeavyForkedSync(t, eth.ETH67, FullSync)
646+
}
647+
func TestBoundedHeavyForkedSync67Snap(t *testing.T) {
648+
testBoundedHeavyForkedSync(t, eth.ETH67, SnapSync)
649+
}
650+
func TestBoundedHeavyForkedSync67Light(t *testing.T) {
651+
testBoundedHeavyForkedSync(t, eth.ETH67, LightSync)
652+
}
630653

631654
func testBoundedHeavyForkedSync(t *testing.T, protocol uint, mode SyncMode) {
632655
tester := newTester(t)
@@ -654,6 +677,9 @@ func testBoundedHeavyForkedSync(t *testing.T, protocol uint, mode SyncMode) {
654677
func TestCancel66Full(t *testing.T) { testCancel(t, eth.ETH66, FullSync) }
655678
func TestCancel66Snap(t *testing.T) { testCancel(t, eth.ETH66, SnapSync) }
656679
func TestCancel66Light(t *testing.T) { testCancel(t, eth.ETH66, LightSync) }
680+
func TestCancel67Full(t *testing.T) { testCancel(t, eth.ETH67, FullSync) }
681+
func TestCancel67Snap(t *testing.T) { testCancel(t, eth.ETH67, SnapSync) }
682+
func TestCancel67Light(t *testing.T) { testCancel(t, eth.ETH67, LightSync) }
657683

658684
func testCancel(t *testing.T, protocol uint, mode SyncMode) {
659685
tester := newTester(t)
@@ -681,6 +707,9 @@ func testCancel(t *testing.T, protocol uint, mode SyncMode) {
681707
func TestMultiSynchronisation66Full(t *testing.T) { testMultiSynchronisation(t, eth.ETH66, FullSync) }
682708
func TestMultiSynchronisation66Snap(t *testing.T) { testMultiSynchronisation(t, eth.ETH66, SnapSync) }
683709
func TestMultiSynchronisation66Light(t *testing.T) { testMultiSynchronisation(t, eth.ETH66, LightSync) }
710+
func TestMultiSynchronisation67Full(t *testing.T) { testMultiSynchronisation(t, eth.ETH67, FullSync) }
711+
func TestMultiSynchronisation67Snap(t *testing.T) { testMultiSynchronisation(t, eth.ETH67, SnapSync) }
712+
func TestMultiSynchronisation67Light(t *testing.T) { testMultiSynchronisation(t, eth.ETH67, LightSync) }
684713

685714
func testMultiSynchronisation(t *testing.T, protocol uint, mode SyncMode) {
686715
tester := newTester(t)
@@ -705,6 +734,9 @@ func testMultiSynchronisation(t *testing.T, protocol uint, mode SyncMode) {
705734
func TestMultiProtoSynchronisation66Full(t *testing.T) { testMultiProtoSync(t, eth.ETH66, FullSync) }
706735
func TestMultiProtoSynchronisation66Snap(t *testing.T) { testMultiProtoSync(t, eth.ETH66, SnapSync) }
707736
func TestMultiProtoSynchronisation66Light(t *testing.T) { testMultiProtoSync(t, eth.ETH66, LightSync) }
737+
func TestMultiProtoSynchronisation67Full(t *testing.T) { testMultiProtoSync(t, eth.ETH67, FullSync) }
738+
func TestMultiProtoSynchronisation67Snap(t *testing.T) { testMultiProtoSync(t, eth.ETH67, SnapSync) }
739+
func TestMultiProtoSynchronisation67Light(t *testing.T) { testMultiProtoSync(t, eth.ETH67, LightSync) }
708740

709741
func testMultiProtoSync(t *testing.T, protocol uint, mode SyncMode) {
710742
tester := newTester(t)
@@ -715,7 +747,7 @@ func testMultiProtoSync(t *testing.T, protocol uint, mode SyncMode) {
715747

716748
// Create peers of every type
717749
tester.newPeer("peer 66", eth.ETH66, chain.blocks[1:])
718-
//tester.newPeer("peer 65", eth.ETH67, chain.blocks[1:)
750+
tester.newPeer("peer 67", eth.ETH67, chain.blocks[1:])
719751

720752
// Synchronise with the requested peer and make sure all blocks were retrieved
721753
if err := tester.sync(fmt.Sprintf("peer %d", protocol), nil, mode); err != nil {
@@ -724,7 +756,7 @@ func testMultiProtoSync(t *testing.T, protocol uint, mode SyncMode) {
724756
assertOwnChain(t, tester, len(chain.blocks))
725757

726758
// Check that no peers have been dropped off
727-
for _, version := range []int{66} {
759+
for _, version := range []int{66, 67} {
728760
peer := fmt.Sprintf("peer %d", version)
729761
if _, ok := tester.peers[peer]; !ok {
730762
t.Errorf("%s dropped", peer)
@@ -737,6 +769,9 @@ func testMultiProtoSync(t *testing.T, protocol uint, mode SyncMode) {
737769
func TestEmptyShortCircuit66Full(t *testing.T) { testEmptyShortCircuit(t, eth.ETH66, FullSync) }
738770
func TestEmptyShortCircuit66Snap(t *testing.T) { testEmptyShortCircuit(t, eth.ETH66, SnapSync) }
739771
func TestEmptyShortCircuit66Light(t *testing.T) { testEmptyShortCircuit(t, eth.ETH66, LightSync) }
772+
func TestEmptyShortCircuit67Full(t *testing.T) { testEmptyShortCircuit(t, eth.ETH67, FullSync) }
773+
func TestEmptyShortCircuit67Snap(t *testing.T) { testEmptyShortCircuit(t, eth.ETH67, SnapSync) }
774+
func TestEmptyShortCircuit67Light(t *testing.T) { testEmptyShortCircuit(t, eth.ETH67, LightSync) }
740775

741776
func testEmptyShortCircuit(t *testing.T, protocol uint, mode SyncMode) {
742777
tester := newTester(t)
@@ -785,6 +820,9 @@ func testEmptyShortCircuit(t *testing.T, protocol uint, mode SyncMode) {
785820
func TestMissingHeaderAttack66Full(t *testing.T) { testMissingHeaderAttack(t, eth.ETH66, FullSync) }
786821
func TestMissingHeaderAttack66Snap(t *testing.T) { testMissingHeaderAttack(t, eth.ETH66, SnapSync) }
787822
func TestMissingHeaderAttack66Light(t *testing.T) { testMissingHeaderAttack(t, eth.ETH66, LightSync) }
823+
func TestMissingHeaderAttack67Full(t *testing.T) { testMissingHeaderAttack(t, eth.ETH67, FullSync) }
824+
func TestMissingHeaderAttack67Snap(t *testing.T) { testMissingHeaderAttack(t, eth.ETH67, SnapSync) }
825+
func TestMissingHeaderAttack67Light(t *testing.T) { testMissingHeaderAttack(t, eth.ETH67, LightSync) }
788826

789827
func testMissingHeaderAttack(t *testing.T, protocol uint, mode SyncMode) {
790828
tester := newTester(t)
@@ -811,6 +849,9 @@ func testMissingHeaderAttack(t *testing.T, protocol uint, mode SyncMode) {
811849
func TestShiftedHeaderAttack66Full(t *testing.T) { testShiftedHeaderAttack(t, eth.ETH66, FullSync) }
812850
func TestShiftedHeaderAttack66Snap(t *testing.T) { testShiftedHeaderAttack(t, eth.ETH66, SnapSync) }
813851
func TestShiftedHeaderAttack66Light(t *testing.T) { testShiftedHeaderAttack(t, eth.ETH66, LightSync) }
852+
func TestShiftedHeaderAttack67Full(t *testing.T) { testShiftedHeaderAttack(t, eth.ETH67, FullSync) }
853+
func TestShiftedHeaderAttack67Snap(t *testing.T) { testShiftedHeaderAttack(t, eth.ETH67, SnapSync) }
854+
func TestShiftedHeaderAttack67Light(t *testing.T) { testShiftedHeaderAttack(t, eth.ETH67, LightSync) }
814855

815856
func testShiftedHeaderAttack(t *testing.T, protocol uint, mode SyncMode) {
816857
tester := newTester(t)
@@ -837,6 +878,7 @@ func testShiftedHeaderAttack(t *testing.T, protocol uint, mode SyncMode) {
837878
// for various failure scenarios. Afterwards a full sync is attempted to make
838879
// sure no state was corrupted.
839880
func TestInvalidHeaderRollback66Snap(t *testing.T) { testInvalidHeaderRollback(t, eth.ETH66, SnapSync) }
881+
func TestInvalidHeaderRollback67Snap(t *testing.T) { testInvalidHeaderRollback(t, eth.ETH67, SnapSync) }
840882

841883
func testInvalidHeaderRollback(t *testing.T, protocol uint, mode SyncMode) {
842884
tester := newTester(t)
@@ -923,6 +965,15 @@ func TestHighTDStarvationAttack66Snap(t *testing.T) {
923965
func TestHighTDStarvationAttack66Light(t *testing.T) {
924966
testHighTDStarvationAttack(t, eth.ETH66, LightSync)
925967
}
968+
func TestHighTDStarvationAttack67Full(t *testing.T) {
969+
testHighTDStarvationAttack(t, eth.ETH67, FullSync)
970+
}
971+
func TestHighTDStarvationAttack67Snap(t *testing.T) {
972+
testHighTDStarvationAttack(t, eth.ETH67, SnapSync)
973+
}
974+
func TestHighTDStarvationAttack67Light(t *testing.T) {
975+
testHighTDStarvationAttack(t, eth.ETH67, LightSync)
976+
}
926977

927978
func testHighTDStarvationAttack(t *testing.T, protocol uint, mode SyncMode) {
928979
tester := newTester(t)
@@ -937,6 +988,7 @@ func testHighTDStarvationAttack(t *testing.T, protocol uint, mode SyncMode) {
937988

938989
// Tests that misbehaving peers are disconnected, whilst behaving ones are not.
939990
func TestBlockHeaderAttackerDropping66(t *testing.T) { testBlockHeaderAttackerDropping(t, eth.ETH66) }
991+
func TestBlockHeaderAttackerDropping67(t *testing.T) { testBlockHeaderAttackerDropping(t, eth.ETH67) }
940992

941993
func testBlockHeaderAttackerDropping(t *testing.T, protocol uint) {
942994
// Define the disconnection requirement for individual hash fetch errors
@@ -987,6 +1039,9 @@ func testBlockHeaderAttackerDropping(t *testing.T, protocol uint) {
9871039
func TestSyncProgress66Full(t *testing.T) { testSyncProgress(t, eth.ETH66, FullSync) }
9881040
func TestSyncProgress66Snap(t *testing.T) { testSyncProgress(t, eth.ETH66, SnapSync) }
9891041
func TestSyncProgress66Light(t *testing.T) { testSyncProgress(t, eth.ETH66, LightSync) }
1042+
func TestSyncProgress67Full(t *testing.T) { testSyncProgress(t, eth.ETH67, FullSync) }
1043+
func TestSyncProgress67Snap(t *testing.T) { testSyncProgress(t, eth.ETH67, SnapSync) }
1044+
func TestSyncProgress67Light(t *testing.T) { testSyncProgress(t, eth.ETH67, LightSync) }
9901045

9911046
func testSyncProgress(t *testing.T, protocol uint, mode SyncMode) {
9921047
tester := newTester(t)
@@ -1064,6 +1119,9 @@ func checkProgress(t *testing.T, d *Downloader, stage string, want ethereum.Sync
10641119
func TestForkedSyncProgress66Full(t *testing.T) { testForkedSyncProgress(t, eth.ETH66, FullSync) }
10651120
func TestForkedSyncProgress66Snap(t *testing.T) { testForkedSyncProgress(t, eth.ETH66, SnapSync) }
10661121
func TestForkedSyncProgress66Light(t *testing.T) { testForkedSyncProgress(t, eth.ETH66, LightSync) }
1122+
func TestForkedSyncProgress67Full(t *testing.T) { testForkedSyncProgress(t, eth.ETH67, FullSync) }
1123+
func TestForkedSyncProgress67Snap(t *testing.T) { testForkedSyncProgress(t, eth.ETH67, SnapSync) }
1124+
func TestForkedSyncProgress67Light(t *testing.T) { testForkedSyncProgress(t, eth.ETH67, LightSync) }
10671125

10681126
func testForkedSyncProgress(t *testing.T, protocol uint, mode SyncMode) {
10691127
tester := newTester(t)
@@ -1135,6 +1193,9 @@ func testForkedSyncProgress(t *testing.T, protocol uint, mode SyncMode) {
11351193
func TestFailedSyncProgress66Full(t *testing.T) { testFailedSyncProgress(t, eth.ETH66, FullSync) }
11361194
func TestFailedSyncProgress66Snap(t *testing.T) { testFailedSyncProgress(t, eth.ETH66, SnapSync) }
11371195
func TestFailedSyncProgress66Light(t *testing.T) { testFailedSyncProgress(t, eth.ETH66, LightSync) }
1196+
func TestFailedSyncProgress67Full(t *testing.T) { testFailedSyncProgress(t, eth.ETH67, FullSync) }
1197+
func TestFailedSyncProgress67Snap(t *testing.T) { testFailedSyncProgress(t, eth.ETH67, SnapSync) }
1198+
func TestFailedSyncProgress67Light(t *testing.T) { testFailedSyncProgress(t, eth.ETH67, LightSync) }
11381199

11391200
func testFailedSyncProgress(t *testing.T, protocol uint, mode SyncMode) {
11401201
tester := newTester(t)
@@ -1201,6 +1262,9 @@ func testFailedSyncProgress(t *testing.T, protocol uint, mode SyncMode) {
12011262
func TestFakedSyncProgress66Full(t *testing.T) { testFakedSyncProgress(t, eth.ETH66, FullSync) }
12021263
func TestFakedSyncProgress66Snap(t *testing.T) { testFakedSyncProgress(t, eth.ETH66, SnapSync) }
12031264
func TestFakedSyncProgress66Light(t *testing.T) { testFakedSyncProgress(t, eth.ETH66, LightSync) }
1265+
func TestFakedSyncProgress67Full(t *testing.T) { testFakedSyncProgress(t, eth.ETH67, FullSync) }
1266+
func TestFakedSyncProgress67Snap(t *testing.T) { testFakedSyncProgress(t, eth.ETH67, SnapSync) }
1267+
func TestFakedSyncProgress67Light(t *testing.T) { testFakedSyncProgress(t, eth.ETH67, LightSync) }
12041268

12051269
func testFakedSyncProgress(t *testing.T, protocol uint, mode SyncMode) {
12061270
tester := newTester(t)
@@ -1347,6 +1411,11 @@ func TestCheckpointEnforcement66Snap(t *testing.T) { testCheckpointEnforcement(t
13471411
func TestCheckpointEnforcement66Light(t *testing.T) {
13481412
testCheckpointEnforcement(t, eth.ETH66, LightSync)
13491413
}
1414+
func TestCheckpointEnforcement67Full(t *testing.T) { testCheckpointEnforcement(t, eth.ETH67, FullSync) }
1415+
func TestCheckpointEnforcement67Snap(t *testing.T) { testCheckpointEnforcement(t, eth.ETH67, SnapSync) }
1416+
func TestCheckpointEnforcement67Light(t *testing.T) {
1417+
testCheckpointEnforcement(t, eth.ETH67, LightSync)
1418+
}
13501419

13511420
func testCheckpointEnforcement(t *testing.T, protocol uint, mode SyncMode) {
13521421
// Create a new tester with a particular hard coded checkpoint block

eth/protocols/eth/handler.go

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,21 @@ var eth66 = map[uint64]msgHandler{
181181
PooledTransactionsMsg: handlePooledTransactions66,
182182
}
183183

184+
var eth67 = map[uint64]msgHandler{
185+
NewBlockHashesMsg: handleNewBlockhashes,
186+
NewBlockMsg: handleNewBlock,
187+
TransactionsMsg: handleTransactions,
188+
NewPooledTransactionHashesMsg: handleNewPooledTransactionHashes,
189+
GetBlockHeadersMsg: handleGetBlockHeaders66,
190+
BlockHeadersMsg: handleBlockHeaders66,
191+
GetBlockBodiesMsg: handleGetBlockBodies66,
192+
BlockBodiesMsg: handleBlockBodies66,
193+
GetReceiptsMsg: handleGetReceipts66,
194+
ReceiptsMsg: handleReceipts66,
195+
GetPooledTransactionsMsg: handleGetPooledTransactions66,
196+
PooledTransactionsMsg: handlePooledTransactions66,
197+
}
198+
184199
// handleMessage is invoked whenever an inbound message is received from a remote
185200
// peer. The remote connection is torn down upon returning any error.
186201
func handleMessage(backend Backend, peer *Peer) error {
@@ -195,9 +210,9 @@ func handleMessage(backend Backend, peer *Peer) error {
195210
defer msg.Discard()
196211

197212
var handlers = eth66
198-
//if peer.Version() >= ETH67 { // Left in as a sample when new protocol is added
199-
// handlers = eth67
200-
//}
213+
if peer.Version() >= ETH67 {
214+
handlers = eth67
215+
}
201216

202217
// Track the amount of time it takes to serve the request and run the handler
203218
if metrics.Enabled {

eth/protocols/eth/protocol.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import (
3131
// Constants to match up protocol versions and messages
3232
const (
3333
ETH66 = 66
34+
ETH67 = 67
3435
)
3536

3637
// ProtocolName is the official short name of the `eth` protocol used during
@@ -39,11 +40,11 @@ const ProtocolName = "eth"
3940

4041
// ProtocolVersions are the supported versions of the `eth` protocol (first
4142
// is primary).
42-
var ProtocolVersions = []uint{ETH66}
43+
var ProtocolVersions = []uint{ETH67, ETH66}
4344

4445
// protocolLengths are the number of implemented message corresponding to
4546
// different protocol versions.
46-
var protocolLengths = map[uint]uint64{ETH66: 17}
47+
var protocolLengths = map[uint]uint64{ETH67: 17, ETH66: 17}
4748

4849
// maxMessageSize is the maximum cap on the size of a protocol message.
4950
const maxMessageSize = 10 * 1024 * 1024

eth/sync_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import (
3030

3131
// Tests that snap sync is disabled after a successful sync cycle.
3232
func TestSnapSyncDisabling66(t *testing.T) { testSnapSyncDisabling(t, eth.ETH66, snap.SNAP1) }
33+
func TestSnapSyncDisabling67(t *testing.T) { testSnapSyncDisabling(t, eth.ETH67, snap.SNAP1) }
3334

3435
// Tests that snap sync gets disabled as soon as a real block is successfully
3536
// imported into the blockchain.

les/downloader/peer.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ func (ps *peerSet) HeaderIdlePeers() ([]*peerConnection, int) {
413413
throughput := func(p *peerConnection) int {
414414
return p.rates.Capacity(eth.BlockHeadersMsg, time.Second)
415415
}
416-
return ps.idlePeers(eth.ETH66, eth.ETH66, idle, throughput)
416+
return ps.idlePeers(eth.ETH66, eth.ETH67, idle, throughput)
417417
}
418418

419419
// BodyIdlePeers retrieves a flat list of all the currently body-idle peers within
@@ -425,7 +425,7 @@ func (ps *peerSet) BodyIdlePeers() ([]*peerConnection, int) {
425425
throughput := func(p *peerConnection) int {
426426
return p.rates.Capacity(eth.BlockBodiesMsg, time.Second)
427427
}
428-
return ps.idlePeers(eth.ETH66, eth.ETH66, idle, throughput)
428+
return ps.idlePeers(eth.ETH66, eth.ETH67, idle, throughput)
429429
}
430430

431431
// ReceiptIdlePeers retrieves a flat list of all the currently receipt-idle peers
@@ -437,7 +437,7 @@ func (ps *peerSet) ReceiptIdlePeers() ([]*peerConnection, int) {
437437
throughput := func(p *peerConnection) int {
438438
return p.rates.Capacity(eth.ReceiptsMsg, time.Second)
439439
}
440-
return ps.idlePeers(eth.ETH66, eth.ETH66, idle, throughput)
440+
return ps.idlePeers(eth.ETH66, eth.ETH67, idle, throughput)
441441
}
442442

443443
// NodeDataIdlePeers retrieves a flat list of all the currently node-data-idle
@@ -449,7 +449,7 @@ func (ps *peerSet) NodeDataIdlePeers() ([]*peerConnection, int) {
449449
throughput := func(p *peerConnection) int {
450450
return p.rates.Capacity(eth.NodeDataMsg, time.Second)
451451
}
452-
return ps.idlePeers(eth.ETH66, eth.ETH66, idle, throughput)
452+
return ps.idlePeers(eth.ETH66, eth.ETH67, idle, throughput)
453453
}
454454

455455
// idlePeers retrieves a flat list of all currently idle peers satisfying the

0 commit comments

Comments
 (0)