From af0eb34ec62c97b96c70f7183e1fa1315de7b3ec Mon Sep 17 00:00:00 2001 From: whyrusleeping Date: Thu, 26 Sep 2019 00:22:45 -0700 Subject: [PATCH] make chain sync faster by turning up blocksync window --- chain/sync.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/chain/sync.go b/chain/sync.go index 4688911d2..2beee9baa 100644 --- a/chain/sync.go +++ b/chain/sync.go @@ -516,7 +516,7 @@ loop: // NB: GetBlocks validates that the blocks are in-fact the ones we // requested, and that they are correctly linked to eachother. It does // not validate any state transitions - window := 10 + window := 500 if gap := int(blockSet[len(blockSet)-1].Height() - untilHeight); gap < window { window = gap } @@ -530,6 +530,7 @@ loop: // This error will only be logged above, return nil, xerrors.Errorf("failed to get blocks: %w", err) } + log.Info("Got blocks: ", blks[0].Height(), len(blks)) for _, b := range blks { if b.Height() < untilHeight { @@ -588,7 +589,7 @@ func (syncer *Syncer) iterFullTipsets(headers []*types.TipSet, cb func(*store.Fu } headers = headers[:beg+1] - windowSize := 10 + windowSize := 200 for i := len(headers) - 1; i >= 0; i -= windowSize {