Skip to content

Commit

Permalink
Add tx-pool-lifetime config (10m) (#504)
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenButtolph authored Feb 29, 2024
1 parent b9ebf9d commit 6d77aa9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion core/txpool/txpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ var DefaultConfig = Config{
AccountQueue: 64,
GlobalQueue: 1024,

Lifetime: 3 * time.Hour,
Lifetime: 10 * time.Minute,
}

// sanitize checks the provided user configurations and changes anything that's
Expand Down
14 changes: 8 additions & 6 deletions plugin/evm/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,13 @@ type Config struct {
// API Settings
LocalTxsEnabled bool `json:"local-txs-enabled"`

TxPoolPriceLimit uint64 `json:"tx-pool-price-limit"`
TxPoolPriceBump uint64 `json:"tx-pool-price-bump"`
TxPoolAccountSlots uint64 `json:"tx-pool-account-slots"`
TxPoolGlobalSlots uint64 `json:"tx-pool-global-slots"`
TxPoolAccountQueue uint64 `json:"tx-pool-account-queue"`
TxPoolGlobalQueue uint64 `json:"tx-pool-global-queue"`
TxPoolPriceLimit uint64 `json:"tx-pool-price-limit"`
TxPoolPriceBump uint64 `json:"tx-pool-price-bump"`
TxPoolAccountSlots uint64 `json:"tx-pool-account-slots"`
TxPoolGlobalSlots uint64 `json:"tx-pool-global-slots"`
TxPoolAccountQueue uint64 `json:"tx-pool-account-queue"`
TxPoolGlobalQueue uint64 `json:"tx-pool-global-queue"`
TxPoolLifetime Duration `json:"tx-pool-lifetime"`

APIMaxDuration Duration `json:"api-max-duration"`
WSCPURefillRate Duration `json:"ws-cpu-refill-rate"`
Expand Down Expand Up @@ -240,6 +241,7 @@ func (c *Config) SetDefaults() {
c.TxPoolGlobalSlots = txpool.DefaultConfig.GlobalSlots
c.TxPoolAccountQueue = txpool.DefaultConfig.AccountQueue
c.TxPoolGlobalQueue = txpool.DefaultConfig.GlobalQueue
c.TxPoolLifetime.Duration = txpool.DefaultConfig.Lifetime

c.APIMaxDuration.Duration = defaultApiMaxDuration
c.WSCPURefillRate.Duration = defaultWsCpuRefillRate
Expand Down
1 change: 1 addition & 0 deletions plugin/evm/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,7 @@ func (vm *VM) Initialize(
vm.ethConfig.TxPool.GlobalSlots = vm.config.TxPoolGlobalSlots
vm.ethConfig.TxPool.AccountQueue = vm.config.TxPoolAccountQueue
vm.ethConfig.TxPool.GlobalQueue = vm.config.TxPoolGlobalQueue
vm.ethConfig.TxPool.Lifetime = vm.config.TxPoolLifetime.Duration

vm.ethConfig.AllowUnfinalizedQueries = vm.config.AllowUnfinalizedQueries
vm.ethConfig.AllowUnprotectedTxs = vm.config.AllowUnprotectedTxs
Expand Down

0 comments on commit 6d77aa9

Please sign in to comment.