From 6dafce59dfb048237537b2b33e5211e7b4ff7146 Mon Sep 17 00:00:00 2001 From: rkapka Date: Fri, 28 Feb 2025 17:53:01 +0100 Subject: [PATCH] Ignore errors from `hasSeenBit` and don't pack unaggregated attestations --- beacon-chain/operations/attestations/kv/aggregated.go | 2 +- .../operations/attestations/kv/unaggregated.go | 11 ++++++++--- .../prysm/v1alpha1/validator/proposer_attestations.go | 7 ------- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/beacon-chain/operations/attestations/kv/aggregated.go b/beacon-chain/operations/attestations/kv/aggregated.go index 32d329dd1f4f..e89922745bcf 100644 --- a/beacon-chain/operations/attestations/kv/aggregated.go +++ b/beacon-chain/operations/attestations/kv/aggregated.go @@ -135,7 +135,7 @@ func (c *AttCaches) SaveAggregatedAttestation(att ethpb.Att) error { seen, err := c.hasSeenBit(att) if err != nil { - return err + log.WithError(err).Debug("Could not check if attestations bits have been seen") } if seen { return nil diff --git a/beacon-chain/operations/attestations/kv/unaggregated.go b/beacon-chain/operations/attestations/kv/unaggregated.go index bbaabbd306c8..75b23f81e6aa 100644 --- a/beacon-chain/operations/attestations/kv/unaggregated.go +++ b/beacon-chain/operations/attestations/kv/unaggregated.go @@ -9,6 +9,7 @@ import ( ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation" "github.com/prysmaticlabs/prysm/v5/runtime/version" + log "github.com/sirupsen/logrus" ) // SaveUnaggregatedAttestation saves an unaggregated attestation in cache. @@ -22,7 +23,7 @@ func (c *AttCaches) SaveUnaggregatedAttestation(att ethpb.Att) error { seen, err := c.hasSeenBit(att) if err != nil { - return err + log.WithError(err).Debug("Could not check if attestations bits have been seen") } if seen { return nil @@ -60,7 +61,7 @@ func (c *AttCaches) UnaggregatedAttestations() ([]ethpb.Att, error) { for _, att := range unAggregatedAtts { seen, err := c.hasSeenBit(att) if err != nil { - return nil, err + log.WithError(err).Debug("Could not check if attestations bits have been seen") } if !seen { atts = append(atts, att.Clone()) @@ -163,7 +164,11 @@ func (c *AttCaches) DeleteSeenUnaggregatedAttestations() (int, error) { if att == nil || att.IsNil() || att.IsAggregated() { continue } - if seen, err := c.hasSeenBit(att); err == nil && seen { + seen, err := c.hasSeenBit(att) + if err != nil { + log.WithError(err).Debug("Could not check if attestations bits have been seen") + } + if seen { delete(c.unAggregatedAtt, r) count++ } diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations.go index c1f16310a850..b762c844113c 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations.go @@ -39,13 +39,6 @@ func (vs *Server) packAttestations(ctx context.Context, latestState state.Beacon } else { atts = vs.AttPool.AggregatedAttestations() atts = vs.validateAndDeleteAttsInPool(ctx, latestState, atts) - - uAtts, err := vs.AttPool.UnaggregatedAttestations() - if err != nil { - return nil, errors.Wrap(err, "could not get unaggregated attestations") - } - uAtts = vs.validateAndDeleteAttsInPool(ctx, latestState, uAtts) - atts = append(atts, uAtts...) } // Checking the state's version here will give the wrong result if the last slot of Deneb is missed.