Skip to content

Commit 2d0c581

Browse files
committed
fair: less debug log
1 parent e1719b7 commit 2d0c581

1 file changed

Lines changed: 10 additions & 13 deletions

File tree

miner/worker.go

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ func (w *worker) newWorkLoop(recommit time.Duration) {
383383
close(interruptCh)
384384
}
385385
interruptCh = make(chan int32, 1)
386-
log.Info("newWorkLoop commit", "reason", reason)
386+
log.Debug("newWorkLoop commit", "reason", reason)
387387
select {
388388
case w.newWorkCh <- &newWorkReq{interruptCh: interruptCh, timestamp: timestamp}:
389389
case <-w.exitCh:
@@ -408,11 +408,9 @@ func (w *worker) newWorkLoop(recommit time.Duration) {
408408
case <-w.startCh:
409409
clearPending(w.chain.CurrentBlock().NumberU64())
410410
timestamp = time.Now().Unix()
411-
log.Info("newWorkLoop commit on start")
412411
commit(commitInterruptNewHead)
413412

414413
case head := <-w.chainHeadCh:
415-
log.Info("newWorkLoop chainHeadCh", "block number", head.Block.NumberU64())
416414
if !w.isRunning() {
417415
continue
418416
}
@@ -483,7 +481,6 @@ func (w *worker) mainLoop() {
483481
for {
484482
select {
485483
case req := <-w.newWorkCh:
486-
log.Info("mainLoop newWorkCh")
487484
w.commitWork(req.interruptCh, req.timestamp)
488485

489486
case req := <-w.getWorkCh:
@@ -1091,7 +1088,7 @@ LOOP:
10911088
return
10921089
}
10931090

1094-
log.Info("commitWork for", "block", work.header.Number,
1091+
log.Debug("commitWork for", "block", work.header.Number,
10951092
"until header time", time.Until(time.Unix(int64(work.header.Time), 0)))
10961093
workList = append(workList, work)
10971094

@@ -1100,10 +1097,10 @@ LOOP:
11001097
log.Warn("commitWork delay is nil, something is wrong")
11011098
stopTimer = nil
11021099
} else if *delay <= 0 {
1103-
log.Info("Not enough time for commitWork")
1100+
log.Debug("Not enough time for commitWork")
11041101
break
11051102
} else {
1106-
log.Info("commitWork stopTimer", "delay", *delay, "DelayLeftOver", w.config.DelayLeftOver)
1103+
log.Debug("commitWork stopTimer", "delay", *delay, "DelayLeftOver", w.config.DelayLeftOver)
11071104
stopTimer.Reset(*delay)
11081105
}
11091106

@@ -1119,15 +1116,15 @@ LOOP:
11191116
case errors.Is(err, errBlockInterruptedByNewHead):
11201117
// For Parlia, it will drop the work on receiving new block if it is not inturn.
11211118
if w.engine.DropOnNewBlock(work.header) {
1122-
log.Info("drop the block, when new block is imported")
1119+
log.Debug("drop the block, when new block is imported")
11231120
return
11241121
}
11251122
case errors.Is(err, errBlockInterruptedByTimeout):
11261123
// break the loop to get the best work
1127-
log.Info("commitWork timeout")
1124+
log.Debug("commitWork timeout")
11281125
break LOOP
11291126
case errors.Is(err, errBlockInterruptedByOutOfGas):
1130-
log.Info("commitWork out of gas")
1127+
log.Debug("commitWork out of gas")
11311128
break LOOP
11321129
}
11331130

@@ -1140,16 +1137,16 @@ LOOP:
11401137
select {
11411138
case <-txsCh:
11421139
delay := w.engine.Delay(w.chain, work.header, &w.config.DelayLeftOver)
1143-
log.Info("commitWork txsCh arrived", "fillDuration", fillDuration.String(), "delay", delay.String())
1140+
log.Debug("commitWork txsCh arrived", "fillDuration", fillDuration.String(), "delay", delay.String())
11441141
if fillDuration > *delay {
11451142
// there may not have enough time for another fillTransactions
11461143
break LOOP
11471144
}
11481145
case <-stopTimer.C:
1149-
log.Info("commitWork stopTimer expired")
1146+
log.Debug("commitWork stopTimer expired")
11501147
break LOOP
11511148
case <-interruptCh:
1152-
log.Info("commitWork interruptChan closed, new block imported or resubmit triggered")
1149+
log.Debug("commitWork interruptChan closed, new block imported or resubmit triggered")
11531150
return
11541151
}
11551152
}

0 commit comments

Comments
 (0)