From 2d75deda4694de3ae6c21a7f37277993a56896a7 Mon Sep 17 00:00:00 2001 From: Sunny Date: Fri, 30 Aug 2024 09:50:33 +0800 Subject: [PATCH] disable parallel if parallel.num is low --- core/blockchain.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/blockchain.go b/core/blockchain.go index 98ae94d906..31efef4fba 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -1951,7 +1951,7 @@ func (bc *BlockChain) insertChain(chain types.Blocks, setHead bool) (int, error) bc.parseTxDAG(block) txsCount := block.Transactions().Len() threshold := min(bc.vmConfig.ParallelTxNum/2+2, 4) - if txsCount < threshold || bc.isEmptyTxDAG() { + if bc.vmConfig.ParallelTxNum < 2 || txsCount < threshold || bc.isEmptyTxDAG() { bc.UseSerialProcessor() log.Debug("Disable Parallel Tx execution", "block", block.NumberU64(), "transactions", txsCount, "parallelTxNum", bc.vmConfig.ParallelTxNum) } else {