@@ -76,7 +76,7 @@ func newTesterWithNotification(t *testing.T, success func()) *downloadTester {
7676 chain : chain ,
7777 peers : make (map [string ]* downloadTesterPeer ),
7878 }
79- tester .downloader = New (db , new (event.TypeMux ), tester .chain , nil , tester .dropPeer , success )
79+ tester .downloader = New (db , new (event.TypeMux ), tester .chain , tester .dropPeer , success )
8080 return tester
8181}
8282
@@ -384,9 +384,6 @@ func assertOwnChain(t *testing.T, tester *downloadTester, length int) {
384384 t .Helper ()
385385
386386 headers , blocks , receipts := length , length , length
387- if tester .downloader .getMode () == LightSync {
388- blocks , receipts = 1 , 1
389- }
390387 if hs := int (tester .chain .CurrentHeader ().Number .Uint64 ()) + 1 ; hs != headers {
391388 t .Fatalf ("synchronised headers mismatch: have %v, want %v" , hs , headers )
392389 }
@@ -398,9 +395,8 @@ func assertOwnChain(t *testing.T, tester *downloadTester, length int) {
398395 }
399396}
400397
401- func TestCanonicalSynchronisation68Full (t * testing.T ) { testCanonSync (t , eth .ETH68 , FullSync ) }
402- func TestCanonicalSynchronisation68Snap (t * testing.T ) { testCanonSync (t , eth .ETH68 , SnapSync ) }
403- func TestCanonicalSynchronisation68Light (t * testing.T ) { testCanonSync (t , eth .ETH68 , LightSync ) }
398+ func TestCanonicalSynchronisation68Full (t * testing.T ) { testCanonSync (t , eth .ETH68 , FullSync ) }
399+ func TestCanonicalSynchronisation68Snap (t * testing.T ) { testCanonSync (t , eth .ETH68 , SnapSync ) }
404400
405401func testCanonSync (t * testing.T , protocol uint , mode SyncMode ) {
406402 success := make (chan struct {})
@@ -505,9 +501,8 @@ func testThrottling(t *testing.T, protocol uint, mode SyncMode) {
505501}
506502
507503// Tests that a canceled download wipes all previously accumulated state.
508- func TestCancel68Full (t * testing.T ) { testCancel (t , eth .ETH68 , FullSync ) }
509- func TestCancel68Snap (t * testing.T ) { testCancel (t , eth .ETH68 , SnapSync ) }
510- func TestCancel68Light (t * testing.T ) { testCancel (t , eth .ETH68 , LightSync ) }
504+ func TestCancel68Full (t * testing.T ) { testCancel (t , eth .ETH68 , FullSync ) }
505+ func TestCancel68Snap (t * testing.T ) { testCancel (t , eth .ETH68 , SnapSync ) }
511506
512507func testCancel (t * testing.T , protocol uint , mode SyncMode ) {
513508 complete := make (chan struct {})
@@ -538,9 +533,8 @@ func testCancel(t *testing.T, protocol uint, mode SyncMode) {
538533
539534// Tests that synchronisations behave well in multi-version protocol environments
540535// and not wreak havoc on other nodes in the network.
541- func TestMultiProtoSynchronisation68Full (t * testing.T ) { testMultiProtoSync (t , eth .ETH68 , FullSync ) }
542- func TestMultiProtoSynchronisation68Snap (t * testing.T ) { testMultiProtoSync (t , eth .ETH68 , SnapSync ) }
543- func TestMultiProtoSynchronisation68Light (t * testing.T ) { testMultiProtoSync (t , eth .ETH68 , LightSync ) }
536+ func TestMultiProtoSynchronisation68Full (t * testing.T ) { testMultiProtoSync (t , eth .ETH68 , FullSync ) }
537+ func TestMultiProtoSynchronisation68Snap (t * testing.T ) { testMultiProtoSync (t , eth .ETH68 , SnapSync ) }
544538
545539func testMultiProtoSync (t * testing.T , protocol uint , mode SyncMode ) {
546540 complete := make (chan struct {})
@@ -578,9 +572,8 @@ func testMultiProtoSync(t *testing.T, protocol uint, mode SyncMode) {
578572
579573// Tests that if a block is empty (e.g. header only), no body request should be
580574// made, and instead the header should be assembled into a whole block in itself.
581- func TestEmptyShortCircuit68Full (t * testing.T ) { testEmptyShortCircuit (t , eth .ETH68 , FullSync ) }
582- func TestEmptyShortCircuit68Snap (t * testing.T ) { testEmptyShortCircuit (t , eth .ETH68 , SnapSync ) }
583- func TestEmptyShortCircuit68Light (t * testing.T ) { testEmptyShortCircuit (t , eth .ETH68 , LightSync ) }
575+ func TestEmptyShortCircuit68Full (t * testing.T ) { testEmptyShortCircuit (t , eth .ETH68 , FullSync ) }
576+ func TestEmptyShortCircuit68Snap (t * testing.T ) { testEmptyShortCircuit (t , eth .ETH68 , SnapSync ) }
584577
585578func testEmptyShortCircuit (t * testing.T , protocol uint , mode SyncMode ) {
586579 success := make (chan struct {})
@@ -619,7 +612,7 @@ func testEmptyShortCircuit(t *testing.T, protocol uint, mode SyncMode) {
619612 // Validate the number of block bodies that should have been requested
620613 bodiesNeeded , receiptsNeeded := 0 , 0
621614 for _ , block := range chain .blocks [1 :] {
622- if mode != LightSync && ( len (block .Transactions ()) > 0 || len (block .Uncles ()) > 0 ) {
615+ if len (block .Transactions ()) > 0 || len (block .Uncles ()) > 0 {
623616 bodiesNeeded ++
624617 }
625618 }
@@ -694,9 +687,8 @@ func testBeaconSync(t *testing.T, protocol uint, mode SyncMode) {
694687
695688// Tests that synchronisation progress (origin block number, current block number
696689// and highest block number) is tracked and updated correctly.
697- func TestSyncProgress68Full (t * testing.T ) { testSyncProgress (t , eth .ETH68 , FullSync ) }
698- func TestSyncProgress68Snap (t * testing.T ) { testSyncProgress (t , eth .ETH68 , SnapSync ) }
699- func TestSyncProgress68Light (t * testing.T ) { testSyncProgress (t , eth .ETH68 , LightSync ) }
690+ func TestSyncProgress68Full (t * testing.T ) { testSyncProgress (t , eth .ETH68 , FullSync ) }
691+ func TestSyncProgress68Snap (t * testing.T ) { testSyncProgress (t , eth .ETH68 , SnapSync ) }
700692
701693func testSyncProgress (t * testing.T , protocol uint , mode SyncMode ) {
702694 success := make (chan struct {})
@@ -734,17 +726,7 @@ func testSyncProgress(t *testing.T, protocol uint, mode SyncMode) {
734726 if err := tester .downloader .BeaconSync (mode , chain .blocks [len (chain .blocks )- 1 ].Header (), nil ); err != nil {
735727 t .Fatalf ("failed to beacon-sync chain: %v" , err )
736728 }
737- var startingBlock uint64
738- if mode == LightSync {
739- // in light-sync mode:
740- // * the starting block is 0 on the second sync cycle because blocks
741- // are never downloaded.
742- // * The current/highest blocks reported in the progress reflect the
743- // current/highest header.
744- startingBlock = 0
745- } else {
746- startingBlock = uint64 (len (chain .blocks )/ 2 - 1 )
747- }
729+ startingBlock := uint64 (len (chain .blocks )/ 2 - 1 )
748730
749731 select {
750732 case <- success :
0 commit comments