Skip to content

Commit

Permalink
Merge pull request #11228 from filecoin-project/asr/log-slow-block
Browse files Browse the repository at this point in the history
feat: miner: log detailed timing breakdown when mining takes longer than the block's timestamp
  • Loading branch information
arajasek authored Sep 5, 2023
2 parents 70895af + f3b3ff0 commit 9567dee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions miner/miner.go
Original file line number Diff line number Diff line change
Expand Up @@ -637,8 +637,8 @@ func (m *Miner) mineOne(ctx context.Context, base *MiningBase) (minedBlock *type
parentMiners[i] = header.Miner
}
log.Infow("mined new block", "cid", minedBlock.Cid(), "height", int64(minedBlock.Header.Height), "miner", minedBlock.Header.Miner, "parents", parentMiners, "parentTipset", base.TipSet.Key().String(), "took", dur)
if dur > time.Second*time.Duration(build.BlockDelaySecs) {
log.Warnw("CAUTION: block production took longer than the block delay. Your computer may not be fast enough to keep up",
if dur > time.Second*time.Duration(build.BlockDelaySecs) || time.Now().Compare(time.Unix(int64(minedBlock.Header.Timestamp), 0)) >= 0 {
log.Warnw("CAUTION: block production took us past the block time. Your computer may not be fast enough to keep up",
"tPowercheck ", tPowercheck.Sub(tStart),
"tTicket ", tTicket.Sub(tPowercheck),
"tSeed ", tSeed.Sub(tTicket),
Expand Down

0 comments on commit 9567dee

Please sign in to comment.