Skip to content

Commit

Permalink
add logs in miner
Browse files Browse the repository at this point in the history
  • Loading branch information
manav2401 committed Feb 7, 2025
1 parent 13f2a3b commit 2f99744
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions miner/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@ func (w *worker) mainLoop(ctx context.Context) {
case req := <-w.newWorkCh:
if w.chainConfig.ChainID.Cmp(params.BorMainnetChainConfig.ChainID) == 0 || w.chainConfig.ChainID.Cmp(params.MumbaiChainConfig.ChainID) == 0 || w.chainConfig.ChainID.Cmp(params.AmoyChainConfig.ChainID) == 0 {
if w.eth.PeerCount() > 0 {
log.Info("[debug] commitWork called from newWorkCh")
//nolint:contextcheck
w.commitWork(req.ctx, req.interrupt, req.noempty, req.timestamp)
}
Expand All @@ -621,15 +622,13 @@ func (w *worker) mainLoop(ctx context.Context) {
req.result <- w.generateWork(ctx, req.params)

case ev := <-w.txsCh:
log.Info("[debug] received new tx event", "w.current != nil", w.current != nil, "w.IsRunning", w.IsRunning())
// Apply transactions to the pending state if we're not sealing
//
// Note all transactions received may not be continuous with transactions
// already included in the current sealing block. These transactions will
// be automatically eliminated.
// nolint : nestif
if !w.IsRunning() && w.current != nil {
log.Info("[debug] commiting new txs")
// If block is already full, abort
if gp := w.current.gasPool; gp != nil && gp.Gas() < params.TxGas {
continue
Expand Down Expand Up @@ -1709,6 +1708,7 @@ func (w *worker) commitWork(ctx context.Context, interrupt *atomic.Int32, noempt
}

w.current = work
log.Info("[debug] assigning work to w.current in commit work")
}

func getInterruptTimer(ctx context.Context, work *environment, current *types.Block) (context.Context, func()) {
Expand Down

0 comments on commit 2f99744

Please sign in to comment.