mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 21:38:05 -05:00
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:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user