From f99080f505181a9578704f1f52e53e002c6dad74 Mon Sep 17 00:00:00 2001 From: Sam Calder-Mason Date: Tue, 2 Apr 2024 17:46:14 +1000 Subject: [PATCH] fix(sentry): Forward all proposer duty events (#294) * fix: duties logging * feat(sentry): Fetch proposer duties * feat(sentry): Fetch proposer duties * feat(sentry): Fetch proposer duties * refactor: Simplify proposer duty event creation --- pkg/sentry/proposer_duty.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pkg/sentry/proposer_duty.go b/pkg/sentry/proposer_duty.go index bd40de85..0d5c2ced 100644 --- a/pkg/sentry/proposer_duty.go +++ b/pkg/sentry/proposer_duty.go @@ -10,20 +10,20 @@ import ( ) func (s *Sentry) startProposerDutyWatcher(ctx context.Context) error { - if !s.Config.BeaconCommittees.Enabled { + if !s.Config.ProposerDuty.Enabled { return nil } - s.beacon.OnReady(ctx, func(ctx context.Context) error { - // Subscribe to future proposer duty events. - s.beacon.Duties().OnProposerDuties(func(epoch phase0.Epoch, duties []*eth2v1.ProposerDuty) error { - if err := s.createNewProposerDutyEvent(ctx, epoch, duties); err != nil { - s.log.WithError(err).Error("Failed to create new proposer duties event") - } + // Subscribe to future proposer duty events. + s.beacon.Duties().OnProposerDuties(func(epoch phase0.Epoch, duties []*eth2v1.ProposerDuty) error { + if err := s.createNewProposerDutyEvent(ctx, epoch, duties); err != nil { + s.log.WithError(err).Error("Failed to create new proposer duties event") + } - return nil - }) + return nil + }) + s.beacon.OnReady(ctx, func(ctx context.Context) error { // Grab the current epoch duties. now := s.beacon.Metadata().Wallclock().Epochs().Current() epochs := []phase0.Epoch{