add some extra logging to try and debug sync issues

This commit is contained in:
whyrusleeping 2020-10-19 19:09:49 -07:00
parent 0f5aa9ba5c
commit 608010c35d
2 changed files with 4 additions and 2 deletions

View File

@ -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
}

View File

@ -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
}