From d58101e8e51af2da1993d7e259747bd3070d0772 Mon Sep 17 00:00:00 2001 From: Liuhaai Date: Wed, 20 Dec 2023 12:16:22 -0800 Subject: [PATCH 1/2] [actpool] fix typo for worker queue --- actpool/actpool.go | 2 +- actpool/config.go | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/actpool/actpool.go b/actpool/actpool.go index c524d86c74..0a3b33d6a9 100644 --- a/actpool/actpool.go +++ b/actpool/actpool.go @@ -141,7 +141,7 @@ func NewActPool(g genesis.Genesis, sf protocol.StateReader, cfg Config, opts ... ap.timerFactory = timerFactory for i := 0; i < _numWorker; i++ { - ap.jobQueue[i] = make(chan workerJob, ap.cfg.MaxNumActsPerAcct) + ap.jobQueue[i] = make(chan workerJob, ap.cfg.WorkerBufferSize) ap.worker[i] = newQueueWorker(ap, ap.jobQueue[i]) if err := ap.worker[i].Start(); err != nil { return nil, err diff --git a/actpool/config.go b/actpool/config.go index 4ee79675ef..b7bd223a62 100644 --- a/actpool/config.go +++ b/actpool/config.go @@ -13,7 +13,8 @@ var ( DefaultConfig = Config{ MaxNumActsPerPool: 32000, MaxGasLimitPerPool: 320000000, - MaxNumActsPerAcct: 2000, + MaxNumActsPerAcct: 500, + WorkerBufferSize: 2000, ActionExpiry: 10 * time.Minute, MinGasPriceStr: big.NewInt(unit.Qev).String(), BlackList: []string{}, @@ -28,6 +29,8 @@ type Config struct { MaxGasLimitPerPool uint64 `yaml:"maxGasLimitPerPool"` // MaxNumActsPerAcct indicates maximum number of actions an account queue can hold MaxNumActsPerAcct uint64 `yaml:"maxNumActsPerAcct"` + // WorkerBufferSize indicates the buffer size for each worker's job queue + WorkerBufferSize uint64 `yaml:"bufferPerAcct"` // ActionExpiry defines how long an action will be kept in action pool. ActionExpiry time.Duration `yaml:"actionExpiry"` // MinGasPriceStr defines the minimal gas price the delegate will accept for an action From cf09a33d0fb88d36a86581a47b739453f61761d5 Mon Sep 17 00:00:00 2001 From: Haaai <55118568+Liuhaai@users.noreply.github.com> Date: Tue, 2 Jan 2024 11:00:52 -0800 Subject: [PATCH 2/2] Update config.go --- actpool/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actpool/config.go b/actpool/config.go index b7bd223a62..453f8d3efc 100644 --- a/actpool/config.go +++ b/actpool/config.go @@ -13,7 +13,7 @@ var ( DefaultConfig = Config{ MaxNumActsPerPool: 32000, MaxGasLimitPerPool: 320000000, - MaxNumActsPerAcct: 500, + MaxNumActsPerAcct: 2000, WorkerBufferSize: 2000, ActionExpiry: 10 * time.Minute, MinGasPriceStr: big.NewInt(unit.Qev).String(),