mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -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:
3
changelog/kaloyantanev_dv-aggregate-send-all.md
Normal file
3
changelog/kaloyantanev_dv-aggregate-send-all.md
Normal file
@@ -0,0 +1,3 @@
|
||||
### Fixed
|
||||
|
||||
- When using a DV, send all aggregations for a slot and committee.
|
||||
@@ -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