From 608010c35deffb4e82b1928c8b4e1c70fe2273be Mon Sep 17 00:00:00 2001 From: whyrusleeping Date: Mon, 19 Oct 2020 19:09:49 -0700 Subject: [PATCH] add some extra logging to try and debug sync issues --- chain/sync.go | 5 +++-- chain/sync_manager.go | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/chain/sync.go b/chain/sync.go index 97915d8df..2c7408113 100644 --- a/chain/sync.go +++ b/chain/sync.go @@ -268,14 +268,15 @@ func (syncer *Syncer) InformNewHead(from peer.ID, fts *store.FullTipSet) bool { syncer.Exchange.AddPeer(from) - bestPweight := syncer.store.GetHeaviestTipSet().ParentWeight() + hts := syncer.store.GetHeaviestTipSet() + bestPweight := hts.ParentWeight() targetWeight := fts.TipSet().ParentWeight() if targetWeight.LessThan(bestPweight) { var miners []string for _, blk := range fts.TipSet().Blocks() { miners = append(miners, blk.Miner.String()) } - log.Infof("incoming tipset from %s does not appear to be better than our best chain, ignoring for now", miners) + log.Infow("incoming tipset does not appear to be better than our best chain, ignoring for now", "miners", miners, "bestPweight", bestPweight, "bestTS", hts.Cids(), "incomingWeight", targetWeight, "incomingTS", fts.TipSet().Cids()) return false } diff --git a/chain/sync_manager.go b/chain/sync_manager.go index c7fdea726..17cec78d7 100644 --- a/chain/sync_manager.go +++ b/chain/sync_manager.go @@ -257,6 +257,7 @@ func (stb *syncTargetBucket) add(ts *types.TipSet) { func (stb *syncTargetBucket) heaviestTipSet() *types.TipSet { if stb == nil { + log.Warn("sync target bucket was nil when heaviestTipSet got called on it") return nil }