From 89d8d54cddfaff1e7cfa3fbf5078694ced4f7cb4 Mon Sep 17 00:00:00 2001 From: bnoieh <135800952+bnoieh@users.noreply.github.com> Date: Fri, 27 Dec 2024 13:50:08 +0800 Subject: [PATCH] Revert "make the number of p2p parallel enqueue routines fixable (#4)" This reverts commit 13b41d4f7b8504fe4109eee90f769109e1b55636. --- eth/handler_eth.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/eth/handler_eth.go b/eth/handler_eth.go index 9b38fbb255..7f36ae722d 100644 --- a/eth/handler_eth.go +++ b/eth/handler_eth.go @@ -20,7 +20,6 @@ import ( "errors" "fmt" "math/big" - "runtime" "time" "github.com/ethereum/go-ethereum/common" @@ -28,13 +27,12 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/eth/fetcher" "github.com/ethereum/go-ethereum/eth/protocols/eth" - "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/p2p/enode" ) // TxQueueSize is the size of the transaction queue used to enqueue transactions -var ( - TxQueueSize = runtime.NumCPU() +const ( + TxQueueSize = 16 ) // enqueueTx is a channel to enqueue transactions in parallel. @@ -42,7 +40,6 @@ var ( var enqueueTx = make(chan func(), TxQueueSize) func init() { - log.Info("P2P euqneue parallel thread number", "threadNum", TxQueueSize) // run the transaction enqueuing loop for i := 0; i < TxQueueSize; i++ { go func() {