Skip to content

Commit

Permalink
configure poet /v1/info cache ttl in presets (#6198)
Browse files Browse the repository at this point in the history
## Motivation

For the cache to work, it needs to have non-zero TTL set
  • Loading branch information
poszu committed Aug 1, 2024
1 parent 13dfb49 commit 867a674
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/mainnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ func MainnetConfig() Config {
CycleGap: 12 * time.Hour,
GracePeriod: 1 * time.Hour,
PositioningATXSelectionTimeout: 50 * time.Minute,
CertifierInfoCacheTTL: 5 * time.Minute,
// RequestTimeout = RequestRetryDelay * 2 * MaxRequestRetries*(MaxRequestRetries+1)/2
RequestTimeout: 1100 * time.Second,
RequestRetryDelay: 10 * time.Second,
Expand Down
2 changes: 2 additions & 0 deletions config/presets/fastnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,7 @@ func fastnet() config.Config {
conf.POET.RequestTimeout = 12 * time.Second // RequestRetryDelay * 2 * MaxRequestRetries*(MaxRequestRetries+1)/2
conf.POET.RequestRetryDelay = 1 * time.Second
conf.POET.MaxRequestRetries = 3
conf.POET.CertifierInfoCacheTTL = time.Minute

return conf
}
1 change: 1 addition & 0 deletions config/presets/standalone.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ func standalone() config.Config {
conf.POET.RequestTimeout = 12 * time.Second // RequestRetryDelay * 2 * MaxRequestRetries*(MaxRequestRetries+1)/2
conf.POET.RequestRetryDelay = 1 * time.Second
conf.POET.MaxRequestRetries = 3
conf.POET.CertifierInfoCacheTTL = time.Minute

conf.P2P.DisableNatPort = true

Expand Down
2 changes: 2 additions & 0 deletions config/presets/testnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ func testnet() config.Config {
RequestTimeout: 550 * time.Second, // RequestRetryDelay * 2 * MaxRequestRetries*(MaxRequestRetries+1)/2
RequestRetryDelay: 5 * time.Second,
MaxRequestRetries: 10,

CertifierInfoCacheTTL: 5 * time.Minute,
},
POST: activation.PostConfig{
MinNumUnits: 2,
Expand Down

0 comments on commit 867a674

Please sign in to comment.