Skip to content

Commit 2de37f2

Browse files
authored
downloader: add eth65 tests (#21383)
* eth65 tests linted * remove non-latest eth light tests
1 parent 5a88a7c commit 2de37f2

File tree

1 file changed

+62
-20
lines changed

1 file changed

+62
-20
lines changed

eth/downloader/downloader_test.go

Lines changed: 62 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -504,8 +504,10 @@ func TestCanonicalSynchronisation63Full(t *testing.T) { testCanonicalSynchronisa
504504
func TestCanonicalSynchronisation63Fast(t *testing.T) { testCanonicalSynchronisation(t, 63, FastSync) }
505505
func TestCanonicalSynchronisation64Full(t *testing.T) { testCanonicalSynchronisation(t, 64, FullSync) }
506506
func TestCanonicalSynchronisation64Fast(t *testing.T) { testCanonicalSynchronisation(t, 64, FastSync) }
507-
func TestCanonicalSynchronisation64Light(t *testing.T) {
508-
testCanonicalSynchronisation(t, 64, LightSync)
507+
func TestCanonicalSynchronisation65Full(t *testing.T) { testCanonicalSynchronisation(t, 65, FullSync) }
508+
func TestCanonicalSynchronisation65Fast(t *testing.T) { testCanonicalSynchronisation(t, 65, FastSync) }
509+
func TestCanonicalSynchronisation65Light(t *testing.T) {
510+
testCanonicalSynchronisation(t, 65, LightSync)
509511
}
510512

511513
func testCanonicalSynchronisation(t *testing.T, protocol int, mode SyncMode) {
@@ -531,6 +533,8 @@ func TestThrottling63Full(t *testing.T) { testThrottling(t, 63, FullSync) }
531533
func TestThrottling63Fast(t *testing.T) { testThrottling(t, 63, FastSync) }
532534
func TestThrottling64Full(t *testing.T) { testThrottling(t, 64, FullSync) }
533535
func TestThrottling64Fast(t *testing.T) { testThrottling(t, 64, FastSync) }
536+
func TestThrottling65Full(t *testing.T) { testThrottling(t, 65, FullSync) }
537+
func TestThrottling65Fast(t *testing.T) { testThrottling(t, 65, FastSync) }
534538

535539
func testThrottling(t *testing.T, protocol int, mode SyncMode) {
536540
t.Parallel()
@@ -614,7 +618,9 @@ func TestForkedSync63Full(t *testing.T) { testForkedSync(t, 63, FullSync) }
614618
func TestForkedSync63Fast(t *testing.T) { testForkedSync(t, 63, FastSync) }
615619
func TestForkedSync64Full(t *testing.T) { testForkedSync(t, 64, FullSync) }
616620
func TestForkedSync64Fast(t *testing.T) { testForkedSync(t, 64, FastSync) }
617-
func TestForkedSync64Light(t *testing.T) { testForkedSync(t, 64, LightSync) }
621+
func TestForkedSync65Full(t *testing.T) { testForkedSync(t, 65, FullSync) }
622+
func TestForkedSync65Fast(t *testing.T) { testForkedSync(t, 65, FastSync) }
623+
func TestForkedSync65Light(t *testing.T) { testForkedSync(t, 65, LightSync) }
618624

619625
func testForkedSync(t *testing.T, protocol int, mode SyncMode) {
620626
t.Parallel()
@@ -645,7 +651,9 @@ func TestHeavyForkedSync63Full(t *testing.T) { testHeavyForkedSync(t, 63, FullS
645651
func TestHeavyForkedSync63Fast(t *testing.T) { testHeavyForkedSync(t, 63, FastSync) }
646652
func TestHeavyForkedSync64Full(t *testing.T) { testHeavyForkedSync(t, 64, FullSync) }
647653
func TestHeavyForkedSync64Fast(t *testing.T) { testHeavyForkedSync(t, 64, FastSync) }
648-
func TestHeavyForkedSync64Light(t *testing.T) { testHeavyForkedSync(t, 64, LightSync) }
654+
func TestHeavyForkedSync65Full(t *testing.T) { testHeavyForkedSync(t, 65, FullSync) }
655+
func TestHeavyForkedSync65Fast(t *testing.T) { testHeavyForkedSync(t, 65, FastSync) }
656+
func TestHeavyForkedSync65Light(t *testing.T) { testHeavyForkedSync(t, 65, LightSync) }
649657

650658
func testHeavyForkedSync(t *testing.T, protocol int, mode SyncMode) {
651659
t.Parallel()
@@ -678,7 +686,9 @@ func TestBoundedForkedSync63Full(t *testing.T) { testBoundedForkedSync(t, 63, F
678686
func TestBoundedForkedSync63Fast(t *testing.T) { testBoundedForkedSync(t, 63, FastSync) }
679687
func TestBoundedForkedSync64Full(t *testing.T) { testBoundedForkedSync(t, 64, FullSync) }
680688
func TestBoundedForkedSync64Fast(t *testing.T) { testBoundedForkedSync(t, 64, FastSync) }
681-
func TestBoundedForkedSync64Light(t *testing.T) { testBoundedForkedSync(t, 64, LightSync) }
689+
func TestBoundedForkedSync65Full(t *testing.T) { testBoundedForkedSync(t, 65, FullSync) }
690+
func TestBoundedForkedSync65Fast(t *testing.T) { testBoundedForkedSync(t, 65, FastSync) }
691+
func TestBoundedForkedSync65Light(t *testing.T) { testBoundedForkedSync(t, 65, LightSync) }
682692

683693
func testBoundedForkedSync(t *testing.T, protocol int, mode SyncMode) {
684694
t.Parallel()
@@ -710,7 +720,9 @@ func TestBoundedHeavyForkedSync63Full(t *testing.T) { testBoundedHeavyForkedSyn
710720
func TestBoundedHeavyForkedSync63Fast(t *testing.T) { testBoundedHeavyForkedSync(t, 63, FastSync) }
711721
func TestBoundedHeavyForkedSync64Full(t *testing.T) { testBoundedHeavyForkedSync(t, 64, FullSync) }
712722
func TestBoundedHeavyForkedSync64Fast(t *testing.T) { testBoundedHeavyForkedSync(t, 64, FastSync) }
713-
func TestBoundedHeavyForkedSync64Light(t *testing.T) { testBoundedHeavyForkedSync(t, 64, LightSync) }
723+
func TestBoundedHeavyForkedSync65Full(t *testing.T) { testBoundedHeavyForkedSync(t, 65, FullSync) }
724+
func TestBoundedHeavyForkedSync65Fast(t *testing.T) { testBoundedHeavyForkedSync(t, 65, FastSync) }
725+
func TestBoundedHeavyForkedSync65Light(t *testing.T) { testBoundedHeavyForkedSync(t, 65, LightSync) }
714726

715727
func testBoundedHeavyForkedSync(t *testing.T, protocol int, mode SyncMode) {
716728
t.Parallel()
@@ -760,7 +772,9 @@ func TestCancel63Full(t *testing.T) { testCancel(t, 63, FullSync) }
760772
func TestCancel63Fast(t *testing.T) { testCancel(t, 63, FastSync) }
761773
func TestCancel64Full(t *testing.T) { testCancel(t, 64, FullSync) }
762774
func TestCancel64Fast(t *testing.T) { testCancel(t, 64, FastSync) }
763-
func TestCancel64Light(t *testing.T) { testCancel(t, 64, LightSync) }
775+
func TestCancel65Full(t *testing.T) { testCancel(t, 65, FullSync) }
776+
func TestCancel65Fast(t *testing.T) { testCancel(t, 65, FastSync) }
777+
func TestCancel65Light(t *testing.T) { testCancel(t, 65, LightSync) }
764778

765779
func testCancel(t *testing.T, protocol int, mode SyncMode) {
766780
t.Parallel()
@@ -791,7 +805,9 @@ func TestMultiSynchronisation63Full(t *testing.T) { testMultiSynchronisation(t,
791805
func TestMultiSynchronisation63Fast(t *testing.T) { testMultiSynchronisation(t, 63, FastSync) }
792806
func TestMultiSynchronisation64Full(t *testing.T) { testMultiSynchronisation(t, 64, FullSync) }
793807
func TestMultiSynchronisation64Fast(t *testing.T) { testMultiSynchronisation(t, 64, FastSync) }
794-
func TestMultiSynchronisation64Light(t *testing.T) { testMultiSynchronisation(t, 64, LightSync) }
808+
func TestMultiSynchronisation65Full(t *testing.T) { testMultiSynchronisation(t, 65, FullSync) }
809+
func TestMultiSynchronisation65Fast(t *testing.T) { testMultiSynchronisation(t, 65, FastSync) }
810+
func TestMultiSynchronisation65Light(t *testing.T) { testMultiSynchronisation(t, 65, LightSync) }
795811

796812
func testMultiSynchronisation(t *testing.T, protocol int, mode SyncMode) {
797813
t.Parallel()
@@ -819,7 +835,9 @@ func TestMultiProtoSynchronisation63Full(t *testing.T) { testMultiProtoSync(t,
819835
func TestMultiProtoSynchronisation63Fast(t *testing.T) { testMultiProtoSync(t, 63, FastSync) }
820836
func TestMultiProtoSynchronisation64Full(t *testing.T) { testMultiProtoSync(t, 64, FullSync) }
821837
func TestMultiProtoSynchronisation64Fast(t *testing.T) { testMultiProtoSync(t, 64, FastSync) }
822-
func TestMultiProtoSynchronisation64Light(t *testing.T) { testMultiProtoSync(t, 64, LightSync) }
838+
func TestMultiProtoSynchronisation65Full(t *testing.T) { testMultiProtoSync(t, 65, FullSync) }
839+
func TestMultiProtoSynchronisation65Fast(t *testing.T) { testMultiProtoSync(t, 65, FastSync) }
840+
func TestMultiProtoSynchronisation65Light(t *testing.T) { testMultiProtoSync(t, 65, LightSync) }
823841

824842
func testMultiProtoSync(t *testing.T, protocol int, mode SyncMode) {
825843
t.Parallel()
@@ -833,6 +851,7 @@ func testMultiProtoSync(t *testing.T, protocol int, mode SyncMode) {
833851
// Create peers of every type
834852
tester.newPeer("peer 63", 63, chain)
835853
tester.newPeer("peer 64", 64, chain)
854+
tester.newPeer("peer 65", 65, chain)
836855

837856
// Synchronise with the requested peer and make sure all blocks were retrieved
838857
if err := tester.sync(fmt.Sprintf("peer %d", protocol), nil, mode); err != nil {
@@ -841,7 +860,7 @@ func testMultiProtoSync(t *testing.T, protocol int, mode SyncMode) {
841860
assertOwnChain(t, tester, chain.len())
842861

843862
// Check that no peers have been dropped off
844-
for _, version := range []int{63, 64} {
863+
for _, version := range []int{63, 64, 65} {
845864
peer := fmt.Sprintf("peer %d", version)
846865
if _, ok := tester.peers[peer]; !ok {
847866
t.Errorf("%s dropped", peer)
@@ -855,7 +874,9 @@ func TestEmptyShortCircuit63Full(t *testing.T) { testEmptyShortCircuit(t, 63, F
855874
func TestEmptyShortCircuit63Fast(t *testing.T) { testEmptyShortCircuit(t, 63, FastSync) }
856875
func TestEmptyShortCircuit64Full(t *testing.T) { testEmptyShortCircuit(t, 64, FullSync) }
857876
func TestEmptyShortCircuit64Fast(t *testing.T) { testEmptyShortCircuit(t, 64, FastSync) }
858-
func TestEmptyShortCircuit64Light(t *testing.T) { testEmptyShortCircuit(t, 64, LightSync) }
877+
func TestEmptyShortCircuit65Full(t *testing.T) { testEmptyShortCircuit(t, 65, FullSync) }
878+
func TestEmptyShortCircuit65Fast(t *testing.T) { testEmptyShortCircuit(t, 65, FastSync) }
879+
func TestEmptyShortCircuit65Light(t *testing.T) { testEmptyShortCircuit(t, 65, LightSync) }
859880

860881
func testEmptyShortCircuit(t *testing.T, protocol int, mode SyncMode) {
861882
t.Parallel()
@@ -907,7 +928,9 @@ func TestMissingHeaderAttack63Full(t *testing.T) { testMissingHeaderAttack(t, 6
907928
func TestMissingHeaderAttack63Fast(t *testing.T) { testMissingHeaderAttack(t, 63, FastSync) }
908929
func TestMissingHeaderAttack64Full(t *testing.T) { testMissingHeaderAttack(t, 64, FullSync) }
909930
func TestMissingHeaderAttack64Fast(t *testing.T) { testMissingHeaderAttack(t, 64, FastSync) }
910-
func TestMissingHeaderAttack64Light(t *testing.T) { testMissingHeaderAttack(t, 64, LightSync) }
931+
func TestMissingHeaderAttack65Full(t *testing.T) { testMissingHeaderAttack(t, 65, FullSync) }
932+
func TestMissingHeaderAttack65Fast(t *testing.T) { testMissingHeaderAttack(t, 65, FastSync) }
933+
func TestMissingHeaderAttack65Light(t *testing.T) { testMissingHeaderAttack(t, 65, LightSync) }
911934

912935
func testMissingHeaderAttack(t *testing.T, protocol int, mode SyncMode) {
913936
t.Parallel()
@@ -937,7 +960,9 @@ func TestShiftedHeaderAttack63Full(t *testing.T) { testShiftedHeaderAttack(t, 6
937960
func TestShiftedHeaderAttack63Fast(t *testing.T) { testShiftedHeaderAttack(t, 63, FastSync) }
938961
func TestShiftedHeaderAttack64Full(t *testing.T) { testShiftedHeaderAttack(t, 64, FullSync) }
939962
func TestShiftedHeaderAttack64Fast(t *testing.T) { testShiftedHeaderAttack(t, 64, FastSync) }
940-
func TestShiftedHeaderAttack64Light(t *testing.T) { testShiftedHeaderAttack(t, 64, LightSync) }
963+
func TestShiftedHeaderAttack65Full(t *testing.T) { testShiftedHeaderAttack(t, 65, FullSync) }
964+
func TestShiftedHeaderAttack65Fast(t *testing.T) { testShiftedHeaderAttack(t, 65, FastSync) }
965+
func TestShiftedHeaderAttack65Light(t *testing.T) { testShiftedHeaderAttack(t, 65, LightSync) }
941966

942967
func testShiftedHeaderAttack(t *testing.T, protocol int, mode SyncMode) {
943968
t.Parallel()
@@ -970,7 +995,8 @@ func testShiftedHeaderAttack(t *testing.T, protocol int, mode SyncMode) {
970995
// sure no state was corrupted.
971996
func TestInvalidHeaderRollback63Fast(t *testing.T) { testInvalidHeaderRollback(t, 63, FastSync) }
972997
func TestInvalidHeaderRollback64Fast(t *testing.T) { testInvalidHeaderRollback(t, 64, FastSync) }
973-
func TestInvalidHeaderRollback64Light(t *testing.T) { testInvalidHeaderRollback(t, 64, LightSync) }
998+
func TestInvalidHeaderRollback65Fast(t *testing.T) { testInvalidHeaderRollback(t, 65, FastSync) }
999+
func TestInvalidHeaderRollback65Light(t *testing.T) { testInvalidHeaderRollback(t, 65, LightSync) }
9741000

9751001
func testInvalidHeaderRollback(t *testing.T, protocol int, mode SyncMode) {
9761002
t.Parallel()
@@ -1064,7 +1090,9 @@ func TestHighTDStarvationAttack63Full(t *testing.T) { testHighTDStarvationAttac
10641090
func TestHighTDStarvationAttack63Fast(t *testing.T) { testHighTDStarvationAttack(t, 63, FastSync) }
10651091
func TestHighTDStarvationAttack64Full(t *testing.T) { testHighTDStarvationAttack(t, 64, FullSync) }
10661092
func TestHighTDStarvationAttack64Fast(t *testing.T) { testHighTDStarvationAttack(t, 64, FastSync) }
1067-
func TestHighTDStarvationAttack64Light(t *testing.T) { testHighTDStarvationAttack(t, 64, LightSync) }
1093+
func TestHighTDStarvationAttack65Full(t *testing.T) { testHighTDStarvationAttack(t, 65, FullSync) }
1094+
func TestHighTDStarvationAttack65Fast(t *testing.T) { testHighTDStarvationAttack(t, 65, FastSync) }
1095+
func TestHighTDStarvationAttack65Light(t *testing.T) { testHighTDStarvationAttack(t, 65, LightSync) }
10681096

10691097
func testHighTDStarvationAttack(t *testing.T, protocol int, mode SyncMode) {
10701098
t.Parallel()
@@ -1082,6 +1110,7 @@ func testHighTDStarvationAttack(t *testing.T, protocol int, mode SyncMode) {
10821110
// Tests that misbehaving peers are disconnected, whilst behaving ones are not.
10831111
func TestBlockHeaderAttackerDropping63(t *testing.T) { testBlockHeaderAttackerDropping(t, 63) }
10841112
func TestBlockHeaderAttackerDropping64(t *testing.T) { testBlockHeaderAttackerDropping(t, 64) }
1113+
func TestBlockHeaderAttackerDropping65(t *testing.T) { testBlockHeaderAttackerDropping(t, 65) }
10851114

10861115
func testBlockHeaderAttackerDropping(t *testing.T, protocol int) {
10871116
t.Parallel()
@@ -1137,7 +1166,9 @@ func TestSyncProgress63Full(t *testing.T) { testSyncProgress(t, 63, FullSync) }
11371166
func TestSyncProgress63Fast(t *testing.T) { testSyncProgress(t, 63, FastSync) }
11381167
func TestSyncProgress64Full(t *testing.T) { testSyncProgress(t, 64, FullSync) }
11391168
func TestSyncProgress64Fast(t *testing.T) { testSyncProgress(t, 64, FastSync) }
1140-
func TestSyncProgress64Light(t *testing.T) { testSyncProgress(t, 64, LightSync) }
1169+
func TestSyncProgress65Full(t *testing.T) { testSyncProgress(t, 65, FullSync) }
1170+
func TestSyncProgress65Fast(t *testing.T) { testSyncProgress(t, 65, FastSync) }
1171+
func TestSyncProgress65Light(t *testing.T) { testSyncProgress(t, 65, LightSync) }
11411172

11421173
func testSyncProgress(t *testing.T, protocol int, mode SyncMode) {
11431174
t.Parallel()
@@ -1219,7 +1250,9 @@ func TestForkedSyncProgress63Full(t *testing.T) { testForkedSyncProgress(t, 63,
12191250
func TestForkedSyncProgress63Fast(t *testing.T) { testForkedSyncProgress(t, 63, FastSync) }
12201251
func TestForkedSyncProgress64Full(t *testing.T) { testForkedSyncProgress(t, 64, FullSync) }
12211252
func TestForkedSyncProgress64Fast(t *testing.T) { testForkedSyncProgress(t, 64, FastSync) }
1222-
func TestForkedSyncProgress64Light(t *testing.T) { testForkedSyncProgress(t, 64, LightSync) }
1253+
func TestForkedSyncProgress65Full(t *testing.T) { testForkedSyncProgress(t, 65, FullSync) }
1254+
func TestForkedSyncProgress65Fast(t *testing.T) { testForkedSyncProgress(t, 65, FastSync) }
1255+
func TestForkedSyncProgress65Light(t *testing.T) { testForkedSyncProgress(t, 65, LightSync) }
12231256

12241257
func testForkedSyncProgress(t *testing.T, protocol int, mode SyncMode) {
12251258
t.Parallel()
@@ -1293,7 +1326,9 @@ func TestFailedSyncProgress63Full(t *testing.T) { testFailedSyncProgress(t, 63,
12931326
func TestFailedSyncProgress63Fast(t *testing.T) { testFailedSyncProgress(t, 63, FastSync) }
12941327
func TestFailedSyncProgress64Full(t *testing.T) { testFailedSyncProgress(t, 64, FullSync) }
12951328
func TestFailedSyncProgress64Fast(t *testing.T) { testFailedSyncProgress(t, 64, FastSync) }
1296-
func TestFailedSyncProgress64Light(t *testing.T) { testFailedSyncProgress(t, 64, LightSync) }
1329+
func TestFailedSyncProgress65Full(t *testing.T) { testFailedSyncProgress(t, 65, FullSync) }
1330+
func TestFailedSyncProgress65Fast(t *testing.T) { testFailedSyncProgress(t, 65, FastSync) }
1331+
func TestFailedSyncProgress65Light(t *testing.T) { testFailedSyncProgress(t, 65, LightSync) }
12971332

12981333
func testFailedSyncProgress(t *testing.T, protocol int, mode SyncMode) {
12991334
t.Parallel()
@@ -1364,7 +1399,9 @@ func TestFakedSyncProgress63Full(t *testing.T) { testFakedSyncProgress(t, 63, F
13641399
func TestFakedSyncProgress63Fast(t *testing.T) { testFakedSyncProgress(t, 63, FastSync) }
13651400
func TestFakedSyncProgress64Full(t *testing.T) { testFakedSyncProgress(t, 64, FullSync) }
13661401
func TestFakedSyncProgress64Fast(t *testing.T) { testFakedSyncProgress(t, 64, FastSync) }
1367-
func TestFakedSyncProgress64Light(t *testing.T) { testFakedSyncProgress(t, 64, LightSync) }
1402+
func TestFakedSyncProgress65Full(t *testing.T) { testFakedSyncProgress(t, 65, FullSync) }
1403+
func TestFakedSyncProgress65Fast(t *testing.T) { testFakedSyncProgress(t, 65, FastSync) }
1404+
func TestFakedSyncProgress65Light(t *testing.T) { testFakedSyncProgress(t, 65, LightSync) }
13681405

13691406
func testFakedSyncProgress(t *testing.T, protocol int, mode SyncMode) {
13701407
t.Parallel()
@@ -1447,6 +1484,9 @@ func TestDeliverHeadersHang(t *testing.T) {
14471484
{64, FullSync},
14481485
{64, FastSync},
14491486
{64, LightSync},
1487+
{65, FullSync},
1488+
{65, FastSync},
1489+
{65, LightSync},
14501490
}
14511491
for _, tc := range testCases {
14521492
t.Run(fmt.Sprintf("protocol %d mode %v", tc.protocol, tc.syncMode), func(t *testing.T) {
@@ -1611,7 +1651,9 @@ func TestCheckpointEnforcement63Full(t *testing.T) { testCheckpointEnforcement(
16111651
func TestCheckpointEnforcement63Fast(t *testing.T) { testCheckpointEnforcement(t, 63, FastSync) }
16121652
func TestCheckpointEnforcement64Full(t *testing.T) { testCheckpointEnforcement(t, 64, FullSync) }
16131653
func TestCheckpointEnforcement64Fast(t *testing.T) { testCheckpointEnforcement(t, 64, FastSync) }
1614-
func TestCheckpointEnforcement64Light(t *testing.T) { testCheckpointEnforcement(t, 64, LightSync) }
1654+
func TestCheckpointEnforcement65Full(t *testing.T) { testCheckpointEnforcement(t, 65, FullSync) }
1655+
func TestCheckpointEnforcement65Fast(t *testing.T) { testCheckpointEnforcement(t, 65, FastSync) }
1656+
func TestCheckpointEnforcement65Light(t *testing.T) { testCheckpointEnforcement(t, 65, LightSync) }
16151657

16161658
func testCheckpointEnforcement(t *testing.T, protocol int, mode SyncMode) {
16171659
t.Parallel()

0 commit comments

Comments
 (0)