From 321774ca1aacc5c5ecba7a5d0d763e1b740ffd35 Mon Sep 17 00:00:00 2001 From: Bui Quang Minh Date: Thu, 22 Feb 2024 16:56:26 +0700 Subject: [PATCH] miner/worker: skip resubmit logic in Consortium Currently, after 3 seconds, worker tries to create another block, optimistically thinks that it can get more transactions and earns more fee as a result. However, this causes overhead to the main block creating flow, so skip this logic in Consortium. --- miner/worker.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/miner/worker.go b/miner/worker.go index 4b8a31d9b1..a0f7b1739e 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -448,6 +448,10 @@ func (w *worker) newWorkLoop(recommit time.Duration) { commit(false, commitInterruptNewHead) case <-timer.C: + if w.chainConfig.Consortium != nil { + continue + } + // If mining is running resubmit a new work cycle periodically to pull in // higher priced transactions. Disable this overhead for pending blocks. if w.isRunning() && (w.chainConfig.Clique == nil || w.chainConfig.Clique.Period > 0) {