Conversation
… proposer duties cache
There was a problem hiding this comment.
Pull request overview
Implements a duties caching refactor intended to reduce duplicate BN duties requests (issue #4009) and CPU/load by consolidating duties caching behavior behind eth2wrap.DutiesCache, with a safety feature flag to disable caching.
Changes:
- Add
featureset.DisableDutiesCachebranching to optionally bypass duties cache and call upstream BN duties endpoints directly. - Refactor
eth2wrap.DutiesCacheinternal storage/locking and removeUpdateCacheIndicesplumbing. - Update scheduler/tracker/validatorapi call sites and wiring to match the new cache behavior and feature-flag gating.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| core/validatorapi/validatorapi.go | Adds feature-flag branch for duties cache usage and adjusts duty pubkey substitution. |
| core/tracker/inclusion.go | Skips inclusion checks when feature is disabled; adds feature-flag branch for attester duties cache usage. |
| core/scheduler/scheduler.go | Adds feature-flag branch to use cached vs upstream duties calls for attester/proposer/sync duties. |
| app/vmock.go | Updates duties cache constructor usage to new signature. |
| app/featureset/featureset.go | Switches feature state guard to RWMutex and uses read locks for readers. |
| app/eth2wrap/multi_test.go | Removes tests for UpdateCacheIndices forwarding. |
| app/eth2wrap/multi.go | Removes UpdateCacheIndices forwarding implementation. |
| app/eth2wrap/lazy_test.go | Removes tests for UpdateCacheIndices forwarding. |
| app/eth2wrap/lazy.go | Removes UpdateCacheIndices forwarding implementation. |
| app/eth2wrap/httpwrap.go | Splits cache locking into separate mutexes for validator and duties caches; removes no-op UpdateCacheIndices. |
| app/eth2wrap/cache_test.go | Updates duties cache constructor usage to new signature. |
| app/eth2wrap/cache.go | Major refactor of duties cache storage/locking and cache trim/invalidation behavior. |
| app/app.go | Wires duties cache only when enabled; removes UpdateCacheIndices update path; trims duties cache on epoch boundary. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4295 +/- ##
==========================================
- Coverage 56.61% 56.60% -0.01%
==========================================
Files 237 237
Lines 31360 31446 +86
==========================================
+ Hits 17753 17799 +46
- Misses 11333 11370 +37
- Partials 2274 2277 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: kalo <24719519+KaloyanTanev@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: kalo <24719519+KaloyanTanev@users.noreply.github.com>
|



WIP
category: bug
ticket: #4009