Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add some extra logging to try and debug sync issues #4486

Merged
merged 1 commit into from
Oct 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions chain/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
1 change: 1 addition & 0 deletions chain/sync_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down