From d2d9e581a6d72d8b5a075926180acba2af90602c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20R=C3=B3=C5=BCa=C5=84ski?= Date: Thu, 1 Aug 2024 10:55:06 +0000 Subject: [PATCH] configure poet /v1/info cache ttl in presets (#6198) ## Motivation For the cache to work, it needs to have non-zero TTL set --- config/mainnet.go | 1 + config/presets/fastnet.go | 2 ++ config/presets/standalone.go | 1 + config/presets/testnet.go | 2 ++ 4 files changed, 6 insertions(+) diff --git a/config/mainnet.go b/config/mainnet.go index 8bd0effac4..299c0bb402 100644 --- a/config/mainnet.go +++ b/config/mainnet.go @@ -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, diff --git a/config/presets/fastnet.go b/config/presets/fastnet.go index de09ac0d19..dc7059b157 100644 --- a/config/presets/fastnet.go +++ b/config/presets/fastnet.go @@ -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 } diff --git a/config/presets/standalone.go b/config/presets/standalone.go index 290b615971..87b413e4bc 100644 --- a/config/presets/standalone.go +++ b/config/presets/standalone.go @@ -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 diff --git a/config/presets/testnet.go b/config/presets/testnet.go index 892d924aaf..2c56fc0284 100644 --- a/config/presets/testnet.go +++ b/config/presets/testnet.go @@ -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,