Merge pull request #6359 from filecoin-project/chore/better_winning_log_harderer
Remove few useless variable assignments
This commit is contained in:
commit
20d1523c81
@ -419,7 +419,7 @@ func (m *Miner) GetBestMiningCandidate(ctx context.Context) (*MiningBase, error)
|
||||
// 1.
|
||||
func (m *Miner) mineOne(ctx context.Context, base *MiningBase) (minedBlock *types.BlockMsg, err error) {
|
||||
log.Debugw("attempting to mine a block", "tipset", types.LogCids(base.TipSet.Cids()))
|
||||
start := build.Clock.Now()
|
||||
tStart := build.Clock.Now()
|
||||
|
||||
round := base.TipSet.Height() + base.NullRounds + 1
|
||||
|
||||
@ -439,13 +439,13 @@ func (m *Miner) mineOne(ctx context.Context, base *MiningBase) (minedBlock *type
|
||||
}
|
||||
}
|
||||
|
||||
isLate := uint64(start.Unix()) > (base.TipSet.MinTimestamp() + uint64(base.NullRounds*builtin.EpochDurationSeconds) + build.PropagationDelaySecs)
|
||||
isLate := uint64(tStart.Unix()) > (base.TipSet.MinTimestamp() + uint64(base.NullRounds*builtin.EpochDurationSeconds) + build.PropagationDelaySecs)
|
||||
|
||||
logStruct := []interface{}{
|
||||
"tookMilliseconds", (build.Clock.Now().UnixNano() - start.UnixNano()) / 1_000_000,
|
||||
"tookMilliseconds", (build.Clock.Now().UnixNano() - tStart.UnixNano()) / 1_000_000,
|
||||
"forRound", int64(round),
|
||||
"baseEpoch", int64(base.TipSet.Height()),
|
||||
"baseDeltaSeconds", uint64(start.Unix()) - base.TipSet.MinTimestamp(),
|
||||
"baseDeltaSeconds", uint64(tStart.Unix()) - base.TipSet.MinTimestamp(),
|
||||
"nullRounds", int64(base.NullRounds),
|
||||
"lateStart", isLate,
|
||||
"beaconEpoch", rbase.Round,
|
||||
@ -480,16 +480,10 @@ func (m *Miner) mineOne(ctx context.Context, base *MiningBase) (minedBlock *type
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
tMBI := build.Clock.Now()
|
||||
|
||||
beaconPrev := mbi.PrevBeaconEntry
|
||||
|
||||
tDrand := build.Clock.Now()
|
||||
bvals := mbi.BeaconEntries
|
||||
|
||||
tPowercheck := build.Clock.Now()
|
||||
|
||||
rbase = beaconPrev
|
||||
bvals := mbi.BeaconEntries
|
||||
rbase = mbi.PrevBeaconEntry
|
||||
if len(bvals) > 0 {
|
||||
rbase = bvals[len(bvals)-1]
|
||||
}
|
||||
@ -553,7 +547,7 @@ func (m *Miner) mineOne(ctx context.Context, base *MiningBase) (minedBlock *type
|
||||
}
|
||||
|
||||
tCreateBlock := build.Clock.Now()
|
||||
dur := tCreateBlock.Sub(start)
|
||||
dur := tCreateBlock.Sub(tStart)
|
||||
parentMiners := make([]address.Address, len(base.TipSet.Blocks()))
|
||||
for i, header := range base.TipSet.Blocks() {
|
||||
parentMiners[i] = header.Miner
|
||||
@ -561,9 +555,7 @@ func (m *Miner) mineOne(ctx context.Context, base *MiningBase) (minedBlock *type
|
||||
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",
|
||||
"tMinerBaseInfo ", tMBI.Sub(start),
|
||||
"tDrand ", tDrand.Sub(tMBI),
|
||||
"tPowercheck ", tPowercheck.Sub(tDrand),
|
||||
"tPowercheck ", tPowercheck.Sub(tStart),
|
||||
"tTicket ", tTicket.Sub(tPowercheck),
|
||||
"tSeed ", tSeed.Sub(tTicket),
|
||||
"tProof ", tProof.Sub(tSeed),
|
||||
|
Loading…
Reference in New Issue
Block a user