From 1a4887bd43efd09f663a371a00365452e600c3cb Mon Sep 17 00:00:00 2001 From: Jared Wasinger Date: Tue, 26 Mar 2024 17:40:21 -0700 Subject: [PATCH] fix --- eth/downloader/downloader_test.go | 4 +--- eth/downloader/testchain_test.go | 7 +------ 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/eth/downloader/downloader_test.go b/eth/downloader/downloader_test.go index 9d9e2886dc..5f39f4ee49 100644 --- a/eth/downloader/downloader_test.go +++ b/eth/downloader/downloader_test.go @@ -1332,14 +1332,13 @@ func testBeaconForkedSyncProgress(t *testing.T, protocol uint, mode SyncMode) { defer tester.terminate() chainA := testChainForkLightA.shorten(len(testChainBase.blocks) + MaxHeaderFetch) - chainB := testChainForkHigher.shorten(len(testChainBase.blocks) + MaxHeaderFetch) + chainB := testChainForkLightB.shorten(len(testChainBase.blocks) + MaxHeaderFetch) // Set a sync init hook to catch progress changes starting := make(chan struct{}) progress := make(chan struct{}) tester.downloader.syncInitHook = func(origin, latest uint64) { - fmt.Println("sync init") starting <- struct{}{} <-progress } @@ -1368,7 +1367,6 @@ func testBeaconForkedSyncProgress(t *testing.T, protocol uint, mode SyncMode) { t.Fatalf("Failed to sync chain in three seconds") } - fmt.Println("jump in") log.SetDefault(log.NewLogger(log.NewTerminalHandlerWithLevel(os.Stdout, log.LevelInfo, false))) // Set the head to a second fork (which forks after the origin of the last sync cycle tester.newPeer("fork B", protocol, chainB.blocks[1:]) diff --git a/eth/downloader/testchain_test.go b/eth/downloader/testchain_test.go index d9582bcd63..46f3febd8b 100644 --- a/eth/downloader/testchain_test.go +++ b/eth/downloader/testchain_test.go @@ -53,9 +53,6 @@ var testChainBase *testChain // Different forks on top of the base chain: var testChainForkLightA, testChainForkLightB, testChainForkHeavy *testChain -// Fork from base chain, fork occurs 10 blocks later than other forks -var testChainForkHigher *testChain - var pregenerated bool func init() { @@ -72,11 +69,10 @@ func init() { var wg sync.WaitGroup // Generate the test chains to seed the peers with - wg.Add(4) + wg.Add(3) go func() { testChainForkLightA = testChainBase.makeFork(forkLen, false, 1); wg.Done() }() go func() { testChainForkLightB = testChainBase.makeFork(forkLen, false, 2); wg.Done() }() go func() { testChainForkHeavy = testChainBase.makeFork(forkLen, true, 3); wg.Done() }() - go func() { testChainForkHigher = testChainBase.makeFork(forkLen-10, false, 3); wg.Done() }() wg.Wait() // Generate the test peers used by the tests to avoid overloading during testing. @@ -107,7 +103,6 @@ func init() { testChainForkLightA.shorten(len(testChainBase.blocks) + MaxHeaderFetch), testChainForkLightB.shorten(len(testChainBase.blocks) + MaxHeaderFetch), testChainForkHeavy.shorten(len(testChainBase.blocks) + 79), - testChainForkHigher.shorten(len(testChainBase.blocks) + MaxHeaderFetch), } wg.Add(len(chains)) for _, chain := range chains {