From 66025d2e7e665965ba32bf09e8184ae445b25380 Mon Sep 17 00:00:00 2001 From: terence tsao Date: Tue, 24 May 2022 08:24:08 -0700 Subject: [PATCH] Sync: use copied bits for seen cache --- beacon-chain/sync/validate_beacon_attestation.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/beacon-chain/sync/validate_beacon_attestation.go b/beacon-chain/sync/validate_beacon_attestation.go index ff6e4ebb3798..af9f658a58ba 100644 --- a/beacon-chain/sync/validate_beacon_attestation.go +++ b/beacon-chain/sync/validate_beacon_attestation.go @@ -252,7 +252,9 @@ func (s *Service) setSeenCommitteeIndicesSlot(slot types.Slot, committeeID types s.seenUnAggregatedAttestationLock.Lock() defer s.seenUnAggregatedAttestationLock.Unlock() b := append(bytesutil.Bytes32(uint64(slot)), bytesutil.Bytes32(uint64(committeeID))...) - b = append(b, aggregateBits...) + var bits []byte + copy(bits, aggregateBits) + b = append(b, bits...) s.seenUnAggregatedAttestationCache.Add(string(b), true) }