Skip to content

Do not cache slot committee aggregations for DVs #15110

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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions changelog/kaloyantanev_dv-aggregate-send-all.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Fixed

- When using a DV, send all aggregations for a slot and committee.
20 changes: 10 additions & 10 deletions validator/client/aggregate.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,6 @@ func (v *validator) SubmitAggregateAndProof(ctx context.Context, slot primitives
return
}

// Avoid sending beacon node duplicated aggregation requests.
k := validatorSubnetSubscriptionKey(slot, duty.CommitteeIndex)
v.aggregatedSlotCommitteeIDCacheLock.Lock()
if v.aggregatedSlotCommitteeIDCache.Contains(k) {
v.aggregatedSlotCommitteeIDCacheLock.Unlock()
return
}
v.aggregatedSlotCommitteeIDCache.Add(k, true)
v.aggregatedSlotCommitteeIDCacheLock.Unlock()

var slotSig []byte
if v.distributed {
slotSig, err = v.attSelection(attSelectionKey{slot: slot, index: duty.ValidatorIndex})
Expand All @@ -65,6 +55,16 @@ func (v *validator) SubmitAggregateAndProof(ctx context.Context, slot primitives
return
}
} else {
// Avoid sending beacon node duplicated aggregation requests.
k := validatorSubnetSubscriptionKey(slot, duty.CommitteeIndex)
v.aggregatedSlotCommitteeIDCacheLock.Lock()
if v.aggregatedSlotCommitteeIDCache.Contains(k) {
v.aggregatedSlotCommitteeIDCacheLock.Unlock()
return
}
v.aggregatedSlotCommitteeIDCache.Add(k, true)
v.aggregatedSlotCommitteeIDCacheLock.Unlock()

slotSig, err = v.signSlotWithSelectionProof(ctx, pubKey, slot)
if err != nil {
log.WithError(err).Error("Could not sign slot")
Expand Down
Loading