Skip to content

Commit

Permalink
chore: added time
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikelle committed Jun 11, 2024
1 parent ff085c4 commit 376149b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions miner/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -804,13 +804,22 @@ func (w *worker) applyTransaction(env *environment, tx *types.Transaction) (*typ
}

func (w *worker) commitTransactions(env *environment, txs *transactionsByPriceAndNonce, interrupt *atomic.Int32, minTip *big.Int) error {
var c int
for _, ttxs := range txs.txs {
for range ttxs {
c++
}
}
log.Info("committing transactions", "count", c)

gasLimit := env.header.GasLimit
if env.gasPool == nil {
env.gasPool = new(core.GasPool).AddGas(gasLimit)
}
var coalescedLogs []*types.Log

for {
start := time.Now()
// Check interruption signal and abort building if it's fired.
if interrupt != nil {
if signal := interrupt.Load(); signal != commitInterruptNone {
Expand Down Expand Up @@ -883,6 +892,7 @@ func (w *worker) commitTransactions(env *environment, txs *transactionsByPriceAn
log.Debug("Transaction failed, account skipped", "hash", ltx.Hash, "err", err)
txs.Pop()
}
log.Info("transaction processing time", "hash", tx.Hash(), "txProcessingTime", time.Since(start).Milliseconds())
}
if !w.isRunning() && len(coalescedLogs) > 0 {
// We don't push the pendingLogsEvent while we are sealing. The reason is that
Expand Down

0 comments on commit 376149b

Please sign in to comment.