Skip to content

Commit

Permalink
fix(sentry): capture finalized checkpoint events
Browse files Browse the repository at this point in the history
  • Loading branch information
Savid committed Aug 24, 2023
1 parent fb25eae commit 57b1258
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions pkg/sentry/sentry.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,33 @@ func (s *Sentry) Start(ctx context.Context) error {
return s.handleNewDecoratedEvent(ctx, decoratedEvent)
})

s.beacon.Node().OnFinalizedCheckpoint(ctx, func(ctx context.Context, finalizedCheckpoint *eth2v1.FinalizedCheckpointEvent) error {
now := time.Now().Add(s.clockDrift)

meta, err := s.createNewClientMeta(ctx)
if err != nil {
return err
}

event := v1.NewEventsFinalizedCheckpoint(s.log, finalizedCheckpoint, now, s.beacon, s.duplicateCache.BeaconETHV1EventsFinalizedCheckpoint, meta)

ignore, err := event.ShouldIgnore(ctx)
if err != nil {
return err
}

if ignore {
return nil
}

decoratedEvent, err := event.Decorate(ctx)
if err != nil {
return err
}

return s.handleNewDecoratedEvent(ctx, decoratedEvent)
})

if err := s.startForkChoiceSchedule(ctx); err != nil {
return err
}
Expand Down

0 comments on commit 57b1258

Please sign in to comment.