-
Notifications
You must be signed in to change notification settings - Fork 215
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
[Merged by Bors] - cache poet's /v1/pow_params with TTL #6199
Conversation
CertifierInfoCacheTTL: 5 * time.Minute, | ||
PowParamsCacheTTL: 5 * time.Minute, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to make this just one parameter instead of 2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe 🤷. Giving extra flexibility doesn't hurt and it is useful in systests where certifier doesn't change at all (and can be cached for long time) but the pow_params change every epoch (1 minute)
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #6199 +/- ##
=========================================
- Coverage 81.9% 81.8% -0.1%
=========================================
Files 301 301
Lines 32406 32426 +20
=========================================
+ Hits 26548 26555 +7
- Misses 4135 4146 +11
- Partials 1723 1725 +2 ☔ View full report in Codecov by Sentry. |
bors merge |
## Motivation Similarly to /v1/info, we query /v1/pow_params very often (once per submit per node ID). As the contents returned from this endpoint change rarely (once per epoch), it makes sense to cache the result.
Pull request successfully merged into develop. Build succeeded:
|
## Motivation Similarly to /v1/info, we query /v1/pow_params very often (once per submit per node ID). As the contents returned from this endpoint change rarely (once per epoch), it makes sense to cache the result.
* configure poet /v1/info cache ttl in presets (#6198) ## Motivation For the cache to work, it needs to have non-zero TTL set * cache poet's /v1/pow_params with TTL (#6199) ## Motivation Similarly to /v1/info, we query /v1/pow_params very often (once per submit per node ID). As the contents returned from this endpoint change rarely (once per epoch), it makes sense to cache the result. * update changelog
Motivation
Similarly to /v1/info, we query /v1/pow_params very often (once per submit per node ID). As the contents returned from this endpoint change rarely (once per epoch), it makes sense to cache the result.
Description
cachedData struct
Test Plan
added a test, will also test on testnet-13 where we observe lots of requests to /v1/pow_params on 1:n nodes.
TODO