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 1 commit
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
5 changes: 4 additions & 1 deletion actpool/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ var (
DefaultConfig = Config{
MaxNumActsPerPool: 32000,
MaxGasLimitPerPool: 320000000,
MaxNumActsPerAcct: 2000,
MaxNumActsPerAcct: 500,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is 500 the current default value used on mainnet nodes?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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