Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[actpool] fix typo for worker queue #4028

Merged
merged 3 commits into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading