From f3b3ff0dd285e773cb6459e7c1390c64a3ea3778 Mon Sep 17 00:00:00 2001 From: Aayush Date: Thu, 31 Aug 2023 10:28:38 -0400 Subject: [PATCH] feat: miner: log detailed timing breakdown when mining takes longer than the block's timestamp --- miner/miner.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/miner/miner.go b/miner/miner.go index 104cf35fc93..ff3898c7af7 100644 --- a/miner/miner.go +++ b/miner/miner.go @@ -576,8 +576,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),