diff --git a/miner/worker.go b/miner/worker.go index a2ceed37a4..6315c8de60 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -689,7 +689,7 @@ func (w *worker) mainLoop() { tcount := w.current.tcount - w.commitTransactions(w.current, plainTxs, blobTxs, nil, new(uint256.Int)) + w.commitTransactions(w.current, plainTxs, blobTxs, nil) stopFn() // Only update the snapshot if any new transactons were added @@ -959,11 +959,12 @@ func (w *worker) commitTransaction(env *environment, tx *types.Transaction) ([]* } env.txs = append(env.txs, tx) env.receipts = append(env.receipts, receipt) + env.tcount++ return receipt.Logs, nil } -func (w *worker) commitTransactions(env *environment, plainTxs, blobTxs *transactionsByPriceAndNonce, interrupt *atomic.Int32, minTip *uint256.Int) error { +func (w *worker) commitTransactions(env *environment, plainTxs, blobTxs *transactionsByPriceAndNonce, interrupt *atomic.Int32) error { defer func(t0 time.Time) { commitTransactionsTimer.Update(time.Since(t0)) }(time.Now()) @@ -1072,11 +1073,6 @@ mainloop: continue } - // If we don't receive enough tip for the next transaction, skip the account - if ptip.Cmp(minTip) < 0 { - log.Trace("Not enough tip for transaction", "hash", ltx.Hash, "tip", ptip, "needed", minTip) - break // If the next-best is too low, surely no better will be available - } // Transaction seems to fit, pull it up from the pool tx := ltx.Resolve() if tx == nil { @@ -1155,7 +1151,6 @@ mainloop: case errors.Is(err, nil): // Everything ok, collect the logs and shift in the next transaction from the same account coalescedLogs = append(coalescedLogs, logs...) - env.tcount++ if EnableMVHashMap && w.IsRunning() { env.depsMVFullWriteList = append(env.depsMVFullWriteList, env.state.MVFullWriteList()) @@ -1455,8 +1450,7 @@ func (w *worker) fillTransactions(interrupt *atomic.Int32, env *environment) err if len(prioPlainTxs) > 0 || len(prioBlobTxs) > 0 { plainTxs := newTransactionsByPriceAndNonce(env.signer, prioPlainTxs, env.header.BaseFee, &w.interruptBlockBuilding) blobTxs := newTransactionsByPriceAndNonce(env.signer, prioBlobTxs, env.header.BaseFee, &w.interruptBlockBuilding) - - if err := w.commitTransactions(env, plainTxs, blobTxs, interrupt, new(uint256.Int)); err != nil { + if err := w.commitTransactions(env, plainTxs, blobTxs, interrupt); err != nil { return err } } @@ -1466,7 +1460,7 @@ func (w *worker) fillTransactions(interrupt *atomic.Int32, env *environment) err blobTxs := newTransactionsByPriceAndNonce(env.signer, normalBlobTxs, env.header.BaseFee, &w.interruptBlockBuilding) txHeapInitTimer.Update(time.Since(heapInitTime)) - if err := w.commitTransactions(env, plainTxs, blobTxs, interrupt, new(uint256.Int)); err != nil { + if err := w.commitTransactions(env, plainTxs, blobTxs, interrupt); err != nil { return err } }