Skip to content

Commit

Permalink
[actpool] fix typo for worker queue (#4028)
Browse files Browse the repository at this point in the history
Co-authored-by: dustinxie <dahuaxie@gmail.com>
  • Loading branch information
Liuhaai and dustinxie authored Jan 2, 2024
1 parent 40da6e9 commit d1ec200
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion actpool/actpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions actpool/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ var (
MaxNumActsPerPool: 32000,
MaxGasLimitPerPool: 320000000,
MaxNumActsPerAcct: 2000,
WorkerBufferSize: 2000,
ActionExpiry: 10 * time.Minute,
MinGasPriceStr: big.NewInt(unit.Qev).String(),
BlackList: []string{},
Expand All @@ -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
Expand Down

0 comments on commit d1ec200

Please sign in to comment.