Skip to content

Commit

Permalink
refactor(beacon): remove sync checks based on sync state and head slot
Browse files Browse the repository at this point in the history
The checks were removed because they were not reliable and caused
false negatives. The services' readiness is now the only criteria
for determining if the beacon node is synced.
  • Loading branch information
samcm committed Feb 25, 2025
1 parent c7cc224 commit fa324c3
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions pkg/sentry/ethereum/beacon.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,26 +177,11 @@ func (b *BeaconNode) Synced(ctx context.Context) error {
return errors.New("missing beacon status")
}

syncState := status.SyncState()
if syncState == nil {
return errors.New("missing beacon node status sync state")
}

if syncState.SyncDistance > 3 {
return errors.New("beacon node is not synced")
}

wallclock := b.Metadata().Wallclock()
if wallclock == nil {
return errors.New("missing wallclock")
}

currentSlot := wallclock.Slots().Current()

if currentSlot.Number()-uint64(syncState.HeadSlot) > 32 {
return fmt.Errorf("beacon node is too far behind head, head slot is %d, current slot is %d", syncState.HeadSlot, currentSlot.Number())
}

for _, service := range b.services {
if err := service.Ready(ctx); err != nil {
return errors.Wrapf(err, "service %s is not ready", service.Name())
Expand Down

0 comments on commit fa324c3

Please sign in to comment.