feature: Use service context and continue on slasher attestation errors (#15803)

* feature: Use service context and continue on slasher attestation errors

* Create Galoretka_feature-slasher-feed-use-service-ctx

* Rename Galoretka_feature-slasher-feed-use-service-ctx to Galoretka_feature-slasher-feed-use-service-ctx.md

---------

Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
This commit is contained in:
Galoretka
2025-10-08 18:47:11 +03:00
committed by GitHub
parent 38955fd08c
commit d5ca327c30
2 changed files with 6 additions and 3 deletions

View File

@@ -585,17 +585,17 @@ func (s *Service) sendNewFinalizedEvent(ctx context.Context, postState state.Bea
func (s *Service) sendBlockAttestationsToSlasher(signed interfaces.ReadOnlySignedBeaconBlock, preState state.BeaconState) {
// Feed the indexed attestation to slasher if enabled. This action
// is done in the background to avoid adding more load to this critical code path.
ctx := context.TODO()
ctx := s.ctx
for _, att := range signed.Block().Body().Attestations() {
committees, err := helpers.AttestationCommitteesFromState(ctx, preState, att)
if err != nil {
log.WithError(err).Error("Could not get attestation committees")
return
continue
}
indexedAtt, err := attestation.ConvertToIndexed(ctx, att, committees...)
if err != nil {
log.WithError(err).Error("Could not convert to indexed attestation")
return
continue
}
s.cfg.SlasherAttestationsFeed.Send(&types.WrappedIndexedAtt{IndexedAtt: indexedAtt})
}

View File

@@ -0,0 +1,3 @@
### Fixed
- Use service context and continue on slasher attestation errors (#15803).