Skip to content

Commit

Permalink
disable parallel if parallel.num is low
Browse files Browse the repository at this point in the history
  • Loading branch information
sunny2022da committed Aug 30, 2024
1 parent ee95f8c commit 2d75ded
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 2d75ded

Please sign in to comment.