Do not cache slot committee aggregations for DVs (#15110)

* Do not cache slot committee for DV agggregations

* Add changelog

---------

Co-authored-by: Radosław Kapka <rkapka@wp.pl>
This commit is contained in:
Kaloyan Tanev
2025-04-02 17:54:47 +02:00
committed by GitHub
parent 0c22d91a55
commit 785fefa3f1
2 changed files with 13 additions and 10 deletions

View File

@@ -0,0 +1,3 @@
### Fixed
- When using a DV, send all aggregations for a slot and committee.

View File

@@ -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})
@@ -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")