Skip to content

Commit 7cc1b8c

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. Conflicts merge for wemix Co-authored-by: Felix Lange <fjl@twurst.com> Co-authored-by: Martin Holst Swende <martin@swende.se>
1 parent 209c275 commit 7cc1b8c

File tree

5 files changed

+104
-7
lines changed

5 files changed

+104
-7
lines changed

eth/downloader/downloader_test.go

Lines changed: 71 additions & 1 deletion
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)
@@ -459,6 +462,8 @@ func TestThrottling65Full(t *testing.T) { testThrottling(t, eth.ETH65, FullSync)
459462
func TestThrottling65Snap(t *testing.T) { testThrottling(t, eth.ETH65, SnapSync) }
460463
func TestThrottling66Full(t *testing.T) { testThrottling(t, eth.ETH66, FullSync) }
461464
func TestThrottling66Snap(t *testing.T) { testThrottling(t, eth.ETH66, SnapSync) }
465+
func TestThrottling67Full(t *testing.T) { testThrottling(t, eth.ETH67, FullSync) }
466+
func TestThrottling67Snap(t *testing.T) { testThrottling(t, eth.ETH67, SnapSync) }
462467

463468
func testThrottling(t *testing.T, protocol uint, mode SyncMode) {
464469
tester := newTester(t)
@@ -542,6 +547,9 @@ func TestForkedSync65Light(t *testing.T) { testForkedSync(t, eth.ETH65, LightSyn
542547
func TestForkedSync66Full(t *testing.T) { testForkedSync(t, eth.ETH66, FullSync) }
543548
func TestForkedSync66Snap(t *testing.T) { testForkedSync(t, eth.ETH66, SnapSync) }
544549
func TestForkedSync66Light(t *testing.T) { testForkedSync(t, eth.ETH66, LightSync) }
550+
func TestForkedSync67Full(t *testing.T) { testForkedSync(t, eth.ETH67, FullSync) }
551+
func TestForkedSync67Snap(t *testing.T) { testForkedSync(t, eth.ETH67, SnapSync) }
552+
func TestForkedSync67Light(t *testing.T) { testForkedSync(t, eth.ETH67, LightSync) }
545553

546554
func testForkedSync(t *testing.T, protocol uint, mode SyncMode) {
547555
if testing.Short() {
@@ -576,6 +584,9 @@ func TestHeavyForkedSync65Light(t *testing.T) { testHeavyForkedSync(t, eth.ETH65
576584
func TestHeavyForkedSync66Full(t *testing.T) { testHeavyForkedSync(t, eth.ETH66, FullSync) }
577585
func TestHeavyForkedSync66Snap(t *testing.T) { testHeavyForkedSync(t, eth.ETH66, SnapSync) }
578586
func TestHeavyForkedSync66Light(t *testing.T) { testHeavyForkedSync(t, eth.ETH66, LightSync) }
587+
func TestHeavyForkedSync67Full(t *testing.T) { testHeavyForkedSync(t, eth.ETH67, FullSync) }
588+
func TestHeavyForkedSync67Snap(t *testing.T) { testHeavyForkedSync(t, eth.ETH67, SnapSync) }
589+
func TestHeavyForkedSync67Light(t *testing.T) { testHeavyForkedSync(t, eth.ETH67, LightSync) }
579590

580591
func testHeavyForkedSync(t *testing.T, protocol uint, mode SyncMode) {
581592
if testing.Short() {
@@ -612,6 +623,9 @@ func TestBoundedForkedSync65Light(t *testing.T) { testBoundedForkedSync(t, eth.E
612623
func TestBoundedForkedSync66Full(t *testing.T) { testBoundedForkedSync(t, eth.ETH66, FullSync) }
613624
func TestBoundedForkedSync66Snap(t *testing.T) { testBoundedForkedSync(t, eth.ETH66, SnapSync) }
614625
func TestBoundedForkedSync66Light(t *testing.T) { testBoundedForkedSync(t, eth.ETH66, LightSync) }
626+
func TestBoundedForkedSync67Full(t *testing.T) { testBoundedForkedSync(t, eth.ETH67, FullSync) }
627+
func TestBoundedForkedSync67Snap(t *testing.T) { testBoundedForkedSync(t, eth.ETH67, SnapSync) }
628+
func TestBoundedForkedSync67Light(t *testing.T) { testBoundedForkedSync(t, eth.ETH67, LightSync) }
615629

616630
func testBoundedForkedSync(t *testing.T, protocol uint, mode SyncMode) {
617631
if testing.Short() {
@@ -659,6 +673,15 @@ func TestBoundedHeavyForkedSync66Snap(t *testing.T) {
659673
func TestBoundedHeavyForkedSync66Light(t *testing.T) {
660674
testBoundedHeavyForkedSync(t, eth.ETH66, LightSync)
661675
}
676+
func TestBoundedHeavyForkedSync67Full(t *testing.T) {
677+
testBoundedHeavyForkedSync(t, eth.ETH67, FullSync)
678+
}
679+
func TestBoundedHeavyForkedSync67Snap(t *testing.T) {
680+
testBoundedHeavyForkedSync(t, eth.ETH67, SnapSync)
681+
}
682+
func TestBoundedHeavyForkedSync67Light(t *testing.T) {
683+
testBoundedHeavyForkedSync(t, eth.ETH67, LightSync)
684+
}
662685

663686
func testBoundedHeavyForkedSync(t *testing.T, protocol uint, mode SyncMode) {
664687
if testing.Short() {
@@ -693,6 +716,9 @@ func TestCancel65Light(t *testing.T) { testCancel(t, eth.ETH65, LightSync) }
693716
func TestCancel66Full(t *testing.T) { testCancel(t, eth.ETH66, FullSync) }
694717
func TestCancel66Snap(t *testing.T) { testCancel(t, eth.ETH66, SnapSync) }
695718
func TestCancel66Light(t *testing.T) { testCancel(t, eth.ETH66, LightSync) }
719+
func TestCancel67Full(t *testing.T) { testCancel(t, eth.ETH67, FullSync) }
720+
func TestCancel67Snap(t *testing.T) { testCancel(t, eth.ETH67, SnapSync) }
721+
func TestCancel67Light(t *testing.T) { testCancel(t, eth.ETH67, LightSync) }
696722

697723
func testCancel(t *testing.T, protocol uint, mode SyncMode) {
698724
tester := newTester(t)
@@ -723,6 +749,9 @@ func TestMultiSynchronisation65Light(t *testing.T) { testMultiSynchronisation(t,
723749
func TestMultiSynchronisation66Full(t *testing.T) { testMultiSynchronisation(t, eth.ETH66, FullSync) }
724750
func TestMultiSynchronisation66Snap(t *testing.T) { testMultiSynchronisation(t, eth.ETH66, SnapSync) }
725751
func TestMultiSynchronisation66Light(t *testing.T) { testMultiSynchronisation(t, eth.ETH66, LightSync) }
752+
func TestMultiSynchronisation67Full(t *testing.T) { testMultiSynchronisation(t, eth.ETH67, FullSync) }
753+
func TestMultiSynchronisation67Snap(t *testing.T) { testMultiSynchronisation(t, eth.ETH67, SnapSync) }
754+
func TestMultiSynchronisation67Light(t *testing.T) { testMultiSynchronisation(t, eth.ETH67, LightSync) }
726755

727756
func testMultiSynchronisation(t *testing.T, protocol uint, mode SyncMode) {
728757
tester := newTester(t)
@@ -750,6 +779,9 @@ func TestMultiProtoSynchronisation65Light(t *testing.T) { testMultiProtoSync(t,
750779
func TestMultiProtoSynchronisation66Full(t *testing.T) { testMultiProtoSync(t, eth.ETH66, FullSync) }
751780
func TestMultiProtoSynchronisation66Snap(t *testing.T) { testMultiProtoSync(t, eth.ETH66, SnapSync) }
752781
func TestMultiProtoSynchronisation66Light(t *testing.T) { testMultiProtoSync(t, eth.ETH66, LightSync) }
782+
func TestMultiProtoSynchronisation67Full(t *testing.T) { testMultiProtoSync(t, eth.ETH67, FullSync) }
783+
func TestMultiProtoSynchronisation67Snap(t *testing.T) { testMultiProtoSync(t, eth.ETH67, SnapSync) }
784+
func TestMultiProtoSynchronisation67Light(t *testing.T) { testMultiProtoSync(t, eth.ETH67, LightSync) }
753785

754786
func testMultiProtoSync(t *testing.T, protocol uint, mode SyncMode) {
755787
tester := newTester(t)
@@ -761,6 +793,7 @@ func testMultiProtoSync(t *testing.T, protocol uint, mode SyncMode) {
761793
// Create peers of every type
762794
tester.newPeer("peer 65", eth.ETH65, chain.blocks[1:])
763795
tester.newPeer("peer 66", eth.ETH66, chain.blocks[1:])
796+
tester.newPeer("peer 67", eth.ETH67, chain.blocks[1:])
764797

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

771804
// Check that no peers have been dropped off
772-
for _, version := range []int{65, 66} {
805+
for _, version := range []int{65, 66, 67} {
773806
peer := fmt.Sprintf("peer %d", version)
774807
if _, ok := tester.peers[peer]; !ok {
775808
t.Errorf("%s dropped", peer)
@@ -785,6 +818,9 @@ func TestEmptyShortCircuit65Light(t *testing.T) { testEmptyShortCircuit(t, eth.E
785818
func TestEmptyShortCircuit66Full(t *testing.T) { testEmptyShortCircuit(t, eth.ETH66, FullSync) }
786819
func TestEmptyShortCircuit66Snap(t *testing.T) { testEmptyShortCircuit(t, eth.ETH66, SnapSync) }
787820
func TestEmptyShortCircuit66Light(t *testing.T) { testEmptyShortCircuit(t, eth.ETH66, LightSync) }
821+
func TestEmptyShortCircuit67Full(t *testing.T) { testEmptyShortCircuit(t, eth.ETH67, FullSync) }
822+
func TestEmptyShortCircuit67Snap(t *testing.T) { testEmptyShortCircuit(t, eth.ETH67, SnapSync) }
823+
func TestEmptyShortCircuit67Light(t *testing.T) { testEmptyShortCircuit(t, eth.ETH67, LightSync) }
788824

789825
func testEmptyShortCircuit(t *testing.T, protocol uint, mode SyncMode) {
790826
tester := newTester(t)
@@ -836,6 +872,9 @@ func TestMissingHeaderAttack65Light(t *testing.T) { testMissingHeaderAttack(t, e
836872
func TestMissingHeaderAttack66Full(t *testing.T) { testMissingHeaderAttack(t, eth.ETH66, FullSync) }
837873
func TestMissingHeaderAttack66Snap(t *testing.T) { testMissingHeaderAttack(t, eth.ETH66, SnapSync) }
838874
func TestMissingHeaderAttack66Light(t *testing.T) { testMissingHeaderAttack(t, eth.ETH66, LightSync) }
875+
func TestMissingHeaderAttack67Full(t *testing.T) { testMissingHeaderAttack(t, eth.ETH67, FullSync) }
876+
func TestMissingHeaderAttack67Snap(t *testing.T) { testMissingHeaderAttack(t, eth.ETH67, SnapSync) }
877+
func TestMissingHeaderAttack67Light(t *testing.T) { testMissingHeaderAttack(t, eth.ETH67, LightSync) }
839878

840879
func testMissingHeaderAttack(t *testing.T, protocol uint, mode SyncMode) {
841880
tester := newTester(t)
@@ -865,6 +904,9 @@ func TestShiftedHeaderAttack65Light(t *testing.T) { testShiftedHeaderAttack(t, e
865904
func TestShiftedHeaderAttack66Full(t *testing.T) { testShiftedHeaderAttack(t, eth.ETH66, FullSync) }
866905
func TestShiftedHeaderAttack66Snap(t *testing.T) { testShiftedHeaderAttack(t, eth.ETH66, SnapSync) }
867906
func TestShiftedHeaderAttack66Light(t *testing.T) { testShiftedHeaderAttack(t, eth.ETH66, LightSync) }
907+
func TestShiftedHeaderAttack67Full(t *testing.T) { testShiftedHeaderAttack(t, eth.ETH67, FullSync) }
908+
func TestShiftedHeaderAttack67Snap(t *testing.T) { testShiftedHeaderAttack(t, eth.ETH67, SnapSync) }
909+
func TestShiftedHeaderAttack67Light(t *testing.T) { testShiftedHeaderAttack(t, eth.ETH67, LightSync) }
868910

869911
func testShiftedHeaderAttack(t *testing.T, protocol uint, mode SyncMode) {
870912
tester := newTester(t)
@@ -892,6 +934,7 @@ func testShiftedHeaderAttack(t *testing.T, protocol uint, mode SyncMode) {
892934
// sure no state was corrupted.
893935
func TestInvalidHeaderRollback65Snap(t *testing.T) { testInvalidHeaderRollback(t, eth.ETH65, SnapSync) }
894936
func TestInvalidHeaderRollback66Snap(t *testing.T) { testInvalidHeaderRollback(t, eth.ETH66, SnapSync) }
937+
func TestInvalidHeaderRollback67Snap(t *testing.T) { testInvalidHeaderRollback(t, eth.ETH67, SnapSync) }
895938

896939
func testInvalidHeaderRollback(t *testing.T, protocol uint, mode SyncMode) {
897940
tester := newTester(t)
@@ -987,6 +1030,15 @@ func TestHighTDStarvationAttack66Snap(t *testing.T) {
9871030
func TestHighTDStarvationAttack66Light(t *testing.T) {
9881031
testHighTDStarvationAttack(t, eth.ETH66, LightSync)
9891032
}
1033+
func TestHighTDStarvationAttack67Full(t *testing.T) {
1034+
testHighTDStarvationAttack(t, eth.ETH67, FullSync)
1035+
}
1036+
func TestHighTDStarvationAttack67Snap(t *testing.T) {
1037+
testHighTDStarvationAttack(t, eth.ETH67, SnapSync)
1038+
}
1039+
func TestHighTDStarvationAttack67Light(t *testing.T) {
1040+
testHighTDStarvationAttack(t, eth.ETH67, LightSync)
1041+
}
9901042

9911043
func testHighTDStarvationAttack(t *testing.T, protocol uint, mode SyncMode) {
9921044
tester := newTester(t)
@@ -1002,6 +1054,7 @@ func testHighTDStarvationAttack(t *testing.T, protocol uint, mode SyncMode) {
10021054
// Tests that misbehaving peers are disconnected, whilst behaving ones are not.
10031055
func TestBlockHeaderAttackerDropping65(t *testing.T) { testBlockHeaderAttackerDropping(t, eth.ETH65) }
10041056
func TestBlockHeaderAttackerDropping66(t *testing.T) { testBlockHeaderAttackerDropping(t, eth.ETH66) }
1057+
func TestBlockHeaderAttackerDropping67(t *testing.T) { testBlockHeaderAttackerDropping(t, eth.ETH67) }
10051058

10061059
func testBlockHeaderAttackerDropping(t *testing.T, protocol uint) {
10071060
// Define the disconnection requirement for individual hash fetch errors
@@ -1055,6 +1108,9 @@ func TestSyncProgress65Light(t *testing.T) { testSyncProgress(t, eth.ETH65, Ligh
10551108
func TestSyncProgress66Full(t *testing.T) { testSyncProgress(t, eth.ETH66, FullSync) }
10561109
func TestSyncProgress66Snap(t *testing.T) { testSyncProgress(t, eth.ETH66, SnapSync) }
10571110
func TestSyncProgress66Light(t *testing.T) { testSyncProgress(t, eth.ETH66, LightSync) }
1111+
func TestSyncProgress67Full(t *testing.T) { testSyncProgress(t, eth.ETH67, FullSync) }
1112+
func TestSyncProgress67Snap(t *testing.T) { testSyncProgress(t, eth.ETH67, SnapSync) }
1113+
func TestSyncProgress67Light(t *testing.T) { testSyncProgress(t, eth.ETH67, LightSync) }
10581114

10591115
func testSyncProgress(t *testing.T, protocol uint, mode SyncMode) {
10601116
if testing.Short() {
@@ -1139,6 +1195,9 @@ func TestForkedSyncProgress65Light(t *testing.T) { testForkedSyncProgress(t, eth
11391195
func TestForkedSyncProgress66Full(t *testing.T) { testForkedSyncProgress(t, eth.ETH66, FullSync) }
11401196
func TestForkedSyncProgress66Snap(t *testing.T) { testForkedSyncProgress(t, eth.ETH66, SnapSync) }
11411197
func TestForkedSyncProgress66Light(t *testing.T) { testForkedSyncProgress(t, eth.ETH66, LightSync) }
1198+
func TestForkedSyncProgress67Full(t *testing.T) { testForkedSyncProgress(t, eth.ETH67, FullSync) }
1199+
func TestForkedSyncProgress67Snap(t *testing.T) { testForkedSyncProgress(t, eth.ETH67, SnapSync) }
1200+
func TestForkedSyncProgress67Light(t *testing.T) { testForkedSyncProgress(t, eth.ETH67, LightSync) }
11421201

11431202
func testForkedSyncProgress(t *testing.T, protocol uint, mode SyncMode) {
11441203
if testing.Short() {
@@ -1217,6 +1276,9 @@ func TestFailedSyncProgress65Light(t *testing.T) { testFailedSyncProgress(t, eth
12171276
func TestFailedSyncProgress66Full(t *testing.T) { testFailedSyncProgress(t, eth.ETH66, FullSync) }
12181277
func TestFailedSyncProgress66Snap(t *testing.T) { testFailedSyncProgress(t, eth.ETH66, SnapSync) }
12191278
func TestFailedSyncProgress66Light(t *testing.T) { testFailedSyncProgress(t, eth.ETH66, LightSync) }
1279+
func TestFailedSyncProgress67Full(t *testing.T) { testFailedSyncProgress(t, eth.ETH67, FullSync) }
1280+
func TestFailedSyncProgress67Snap(t *testing.T) { testFailedSyncProgress(t, eth.ETH67, SnapSync) }
1281+
func TestFailedSyncProgress67Light(t *testing.T) { testFailedSyncProgress(t, eth.ETH67, LightSync) }
12201282

12211283
func testFailedSyncProgress(t *testing.T, protocol uint, mode SyncMode) {
12221284
tester := newTester(t)
@@ -1286,6 +1348,9 @@ func TestFakedSyncProgress65Light(t *testing.T) { testFakedSyncProgress(t, eth.E
12861348
func TestFakedSyncProgress66Full(t *testing.T) { testFakedSyncProgress(t, eth.ETH66, FullSync) }
12871349
func TestFakedSyncProgress66Snap(t *testing.T) { testFakedSyncProgress(t, eth.ETH66, SnapSync) }
12881350
func TestFakedSyncProgress66Light(t *testing.T) { testFakedSyncProgress(t, eth.ETH66, LightSync) }
1351+
func TestFakedSyncProgress67Full(t *testing.T) { testFakedSyncProgress(t, eth.ETH67, FullSync) }
1352+
func TestFakedSyncProgress67Snap(t *testing.T) { testFakedSyncProgress(t, eth.ETH67, SnapSync) }
1353+
func TestFakedSyncProgress67Light(t *testing.T) { testFakedSyncProgress(t, eth.ETH67, LightSync) }
12891354

12901355
func testFakedSyncProgress(t *testing.T, protocol uint, mode SyncMode) {
12911356
if testing.Short() {
@@ -1441,6 +1506,11 @@ func TestCheckpointEnforcement66Snap(t *testing.T) { testCheckpointEnforcement(t
14411506
func TestCheckpointEnforcement66Light(t *testing.T) {
14421507
testCheckpointEnforcement(t, eth.ETH66, LightSync)
14431508
}
1509+
func TestCheckpointEnforcement67Full(t *testing.T) { testCheckpointEnforcement(t, eth.ETH67, FullSync) }
1510+
func TestCheckpointEnforcement67Snap(t *testing.T) { testCheckpointEnforcement(t, eth.ETH67, SnapSync) }
1511+
func TestCheckpointEnforcement67Light(t *testing.T) {
1512+
testCheckpointEnforcement(t, eth.ETH67, LightSync)
1513+
}
14441514

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

eth/protocols/eth/handler.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,28 @@ var eth66 = map[uint64]msgHandler{
216216
TransactionsExMsg: handleTransactionsEx,
217217
}
218218

219+
var eth67 = map[uint64]msgHandler{
220+
NewBlockHashesMsg: handleNewBlockhashes,
221+
NewBlockMsg: handleNewBlock,
222+
TransactionsMsg: handleTransactions,
223+
NewPooledTransactionHashesMsg: handleNewPooledTransactionHashes,
224+
GetBlockHeadersMsg: handleGetBlockHeaders66,
225+
BlockHeadersMsg: handleBlockHeaders66,
226+
GetBlockBodiesMsg: handleGetBlockBodies66,
227+
BlockBodiesMsg: handleBlockBodies66,
228+
GetReceiptsMsg: handleGetReceipts66,
229+
ReceiptsMsg: handleReceipts66,
230+
GetPooledTransactionsMsg: handleGetPooledTransactions66,
231+
PooledTransactionsMsg: handlePooledTransactions66,
232+
// wemix message handlers - not eth/66 yet
233+
GetPendingTxsMsg: handleGetPendingTxs,
234+
GetStatusExMsg: handleGetStatusEx,
235+
StatusExMsg: handleStatusEx,
236+
EtcdAddMemberMsg: handleEtcdAddMember,
237+
EtcdClusterMsg: handleEtcdCluster,
238+
TransactionsExMsg: handleTransactionsEx,
239+
}
240+
219241
// handleMessage is invoked whenever an inbound message is received from a remote
220242
// peer. The remote connection is torn down upon returning any error.
221243
func handleMessage(backend Backend, peer *Peer) error {
@@ -233,6 +255,9 @@ func handleMessage(backend Backend, peer *Peer) error {
233255
if peer.Version() >= ETH66 {
234256
handlers = eth66
235257
}
258+
if peer.Version() >= ETH67 {
259+
handlers = eth67
260+
}
236261

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

eth/protocols/eth/protocol.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import (
3333
const (
3434
ETH65 = 65
3535
ETH66 = 66
36+
ETH67 = 67
3637
)
3738

3839
// ProtocolName is the official short name of the `eth` protocol used during
@@ -41,11 +42,11 @@ const ProtocolName = "mir"
4142

4243
// ProtocolVersions are the supported versions of the `eth` protocol (first
4344
// is primary).
44-
var ProtocolVersions = []uint{ETH66, ETH65}
45+
var ProtocolVersions = []uint{ETH67, ETH66, ETH65}
4546

4647
// protocolLengths are the number of implemented message corresponding to
4748
// different protocol versions.
48-
var protocolLengths = map[uint]uint64{ETH66: 23, ETH65: 23}
49+
var protocolLengths = map[uint]uint64{ETH67: 23, ETH66: 23, ETH65: 23}
4950

5051
// maxMessageSize is the maximum cap on the size of a protocol message.
5152
const maxMessageSize = 100 * 1024 * 1024

eth/sync_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import (
3131
// Tests that snap sync is disabled after a successful sync cycle.
3232
func TestSnapSyncDisabling65(t *testing.T) { testSnapSyncDisabling(t, eth.ETH65, snap.SNAP1) }
3333
func TestSnapSyncDisabling66(t *testing.T) { testSnapSyncDisabling(t, eth.ETH66, snap.SNAP1) }
34+
func TestSnapSyncDisabling67(t *testing.T) { testSnapSyncDisabling(t, eth.ETH67, snap.SNAP1) }
3435

3536
// Tests that snap sync gets disabled as soon as a real block is successfully
3637
// 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)