Skip to content
Merged
Show file tree
Hide file tree
Changes from 58 commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
9365188
Add more logs in cache
KaloyanTanev Feb 3, 2026
ee73377
Trim duties cache
KaloyanTanev Feb 3, 2026
2660789
Wrap all cache duties with feature flag, add more debug logging
KaloyanTanev Feb 3, 2026
a57b569
Move chain reorg cache invalidation outside of feature flag
KaloyanTanev Feb 3, 2026
5296fd2
Move set duties cache outside of feature flag
KaloyanTanev Feb 3, 2026
6fae703
Remove feature flag gating at app.go, more logging at private functions
KaloyanTanev Feb 3, 2026
ae340cb
Repurpose logging
KaloyanTanev Feb 3, 2026
8747bad
Fix proposer duties cache
KaloyanTanev Feb 3, 2026
24af918
Use len for duties logs
KaloyanTanev Feb 3, 2026
86b1834
Flatten collected duties
KaloyanTanev Feb 3, 2026
1b344e3
Add more trimming logs
KaloyanTanev Feb 3, 2026
4ccf22e
Disable more aggressively
KaloyanTanev Feb 4, 2026
c066c97
Add capacity to slices
KaloyanTanev Feb 4, 2026
b867fe8
Keep proposer duties vapi as in main
KaloyanTanev Feb 4, 2026
43b7022
Use slice length for iteration
KaloyanTanev Feb 4, 2026
af83392
Use the same slice in proposer duties
KaloyanTanev Feb 4, 2026
dc4814f
Add more logs
KaloyanTanev Feb 4, 2026
eabb1ec
Use sync.map; remove validator indices from struct
KaloyanTanev Feb 4, 2026
fca5721
Skip trimming and invalidating
KaloyanTanev Feb 4, 2026
39726ea
Back to default state, test new sync map
KaloyanTanev Feb 4, 2026
7791970
Log right before cachedProposerDuties function
KaloyanTanev Feb 4, 2026
91c1a41
Cleanup of logs
KaloyanTanev Feb 4, 2026
4ebffee
Try not calling separate function
KaloyanTanev Feb 4, 2026
57538a1
Always enable proposer duties cache
KaloyanTanev Feb 4, 2026
d3b9441
Extract sync.map in separate struct
KaloyanTanev Feb 4, 2026
1e222be
Bring back internal function call in cache.ProposerDutiesCache
KaloyanTanev Feb 4, 2026
0607e2f
Copy proposer logic to sync comm duties
KaloyanTanev Feb 4, 2026
ed4681f
Rework cache to use regular map and lock per duty; always enable only…
KaloyanTanev Feb 5, 2026
8a61bc1
Fix NewDutiesCache map initialization
KaloyanTanev Feb 5, 2026
1c27e9b
Test with disabling proposer duties inside cache; refactor
KaloyanTanev Feb 5, 2026
7ef522b
Always use proposer duties cache
KaloyanTanev Feb 5, 2026
5e58671
Log amount of cached epochs
KaloyanTanev Feb 5, 2026
c18eb66
Copy the returned duty
KaloyanTanev Feb 5, 2026
bf8edc4
Copy the stored duty
KaloyanTanev Feb 5, 2026
2285c6a
Add more logs to vapi proposer duties
KaloyanTanev Feb 5, 2026
c321b9f
Use literals in cache and not references
KaloyanTanev Feb 6, 2026
ca8c8f2
Refactor, cleanup, production ready version
KaloyanTanev Feb 6, 2026
22cf23d
Remove debug logging
KaloyanTanev Feb 6, 2026
0b9cda7
Use feature flag for proposer duties as well
KaloyanTanev Feb 6, 2026
a8cae05
Disable trimming if disable cache feature flag is on
KaloyanTanev Feb 6, 2026
615bab3
Disable reorg cache invalidation if disable cache feature flag is on
KaloyanTanev Feb 6, 2026
db37d04
Disable cache initialisation if disable cache feature flag is on
KaloyanTanev Feb 6, 2026
c314a11
Add multiple cache mutexes in httpAdapter
KaloyanTanev Feb 6, 2026
18e146c
Wrap inclusion checker with disable duties feature flag
KaloyanTanev Feb 6, 2026
dd992fa
Inclusion call attester duties only if feature flag is enabled
KaloyanTanev Feb 6, 2026
ab56c39
Use RW mutex for feature flags
KaloyanTanev Feb 6, 2026
a518c26
Linter
KaloyanTanev Feb 6, 2026
b3ea996
Add better log and fix cache hit for loop
KaloyanTanev Feb 6, 2026
6a075b8
Apply suggestion from @Copilot
KaloyanTanev Feb 6, 2026
ee78816
Update core/validatorapi/validatorapi.go
KaloyanTanev Feb 6, 2026
51b9c3f
Return error on nil duty
KaloyanTanev Feb 6, 2026
3982067
Keep metadata in cache as well
KaloyanTanev Feb 8, 2026
de48825
Fix lazy test
KaloyanTanev Feb 9, 2026
52cc556
Fix integration test
KaloyanTanev Feb 9, 2026
9c65d73
Fix multi test
KaloyanTanev Feb 9, 2026
0e9220b
Fix linting
KaloyanTanev Feb 9, 2026
da6ef60
Misc linters
KaloyanTanev Feb 9, 2026
a31050c
Simplify locking
KaloyanTanev Feb 9, 2026
f233d9a
Fix linting
KaloyanTanev Feb 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 15 additions & 11 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ import (
"bytes"
"context"
"encoding/hex"
"maps"
"net/http"
"slices"
"strings"
"sync"
"time"
Expand Down Expand Up @@ -508,10 +506,12 @@ func wireCoreWorkflow(ctx context.Context, life *lifecycle.Manager, conf Config,
refreshedBySlot := true

// Setup duties cache, refreshing it every epoch.
dutiesCache := eth2wrap.NewDutiesCache(eth2Cl, []eth2p0.ValidatorIndex{})
eth2Cl.SetDutiesCache(dutiesCache.ProposerDutiesCache, dutiesCache.AttesterDutiesCache, dutiesCache.SyncCommDutiesCache)

sseListener.SubscribeChainReorgEvent(dutiesCache.InvalidateCache)
var dutiesCache *eth2wrap.DutiesCache
if !featureset.Enabled(featureset.DisableDutiesCache) {
dutiesCache = eth2wrap.NewDutiesCache(eth2Cl)
eth2Cl.SetDutiesCache(dutiesCache.ProposerDutiesCache, dutiesCache.AttesterDutiesCache, dutiesCache.SyncCommDutiesCache)
sseListener.SubscribeChainReorgEvent(dutiesCache.InvalidateCache)
}

var fvcrLock sync.RWMutex

Expand Down Expand Up @@ -548,16 +548,16 @@ func wireCoreWorkflow(ctx context.Context, life *lifecycle.Manager, conf Config,

valCache.Trim()

activeValidators, _, refresh, err := valCache.GetBySlot(ctx, slotToFetch)
if !featureset.Enabled(featureset.DisableDutiesCache) {
dutiesCache.Trim(eth2p0.Epoch(slot.Epoch()))
}

_, _, refresh, err := valCache.GetBySlot(ctx, slotToFetch)
if err != nil {
log.Error(ctx, "Failed to refresh validator cache", err)
return err
}

vIdxs := slices.Collect(maps.Keys(activeValidators))

dutiesCache.UpdateCacheIndices(ctx, vIdxs)

refreshedBySlot = refresh
firstCacheRefresh = false

Expand Down Expand Up @@ -655,6 +655,10 @@ func wireCoreWorkflow(ctx context.Context, life *lifecycle.Manager, conf Config,

submissionEth2Cl.SetValidatorCache(valCache.GetByHead)

if !featureset.Enabled(featureset.DisableDutiesCache) {
submissionEth2Cl.SetDutiesCache(dutiesCache.ProposerDutiesCache, dutiesCache.AttesterDutiesCache, dutiesCache.SyncCommDutiesCache)
}

broadcaster, err := bcast.New(ctx, submissionEth2Cl)
if err != nil {
return err
Expand Down
Loading
Loading