Merge pull request #4486 from filecoin-project/feat/better-sync-logs

add some extra logging to try and debug sync issues
This commit is contained in:
Łukasz Magiera 2020-10-20 13:29:20 +02:00 committed by GitHub
commit da044d8b00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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
}