From 36b9cc29829a3e6d62131964de7b200777a08568 Mon Sep 17 00:00:00 2001 From: Alex Sharov Date: Tue, 22 Mar 2022 10:33:15 +0700 Subject: [PATCH] Snapshots: initial sync fix (#3750) --- eth/stagedsync/stage_headers.go | 2 +- ethdb/privateapi/mining.go | 2 +- turbo/snapshotsync/block_reader.go | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/eth/stagedsync/stage_headers.go b/eth/stagedsync/stage_headers.go index f4957b3ff..8cf57ccc5 100644 --- a/eth/stagedsync/stage_headers.go +++ b/eth/stagedsync/stage_headers.go @@ -992,7 +992,7 @@ func DownloadAndIndexSnapshotsIfNeed(s *StageState, ctx context.Context, tx kv.R return nil } - if !initialCycle { + if initialCycle { if err := WaitForDownloader(ctx, tx, cfg); err != nil { return err } diff --git a/ethdb/privateapi/mining.go b/ethdb/privateapi/mining.go index ed480e17b..883673a44 100644 --- a/ethdb/privateapi/mining.go +++ b/ethdb/privateapi/mining.go @@ -17,7 +17,7 @@ import ( "google.golang.org/protobuf/types/known/emptypb" ) -// EthBackendServiceAPIVersion +// MiningAPIVersion // 2.0.0 - move all mining-related methods to 'txpool/mining' server var MiningAPIVersion = &types2.VersionReply{Major: 1, Minor: 0, Patch: 0} diff --git a/turbo/snapshotsync/block_reader.go b/turbo/snapshotsync/block_reader.go index 575a174ea..30580a5f4 100644 --- a/turbo/snapshotsync/block_reader.go +++ b/turbo/snapshotsync/block_reader.go @@ -202,7 +202,6 @@ func (back *BlockReaderWithSnapshots) HeaderByNumber(ctx context.Context, tx kv. if ok { return h, nil } - return rawdb.ReadHeaderByNumber(tx, blockHeight), nil }