Skip to content
This repository has been archived by the owner on May 11, 2024. It is now read-only.

Commit

Permalink
feat(driver): improve error messages (#289)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha committed Jun 16, 2023
1 parent 45d73b9 commit 90e365a
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion driver/chain_syncer/beaconsync/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,19 @@ func (s *Syncer) TriggerBeaconSync() error {
)
}

// Keep the heartbeat with L2 execution engine.
fcRes, err := s.rpc.L2Engine.ForkchoiceUpdate(s.ctx, &engine.ForkchoiceStateV1{
HeadBlockHash: s.progressTracker.LastSyncedVerifiedBlockHash(),
SafeBlockHash: s.progressTracker.LastSyncedVerifiedBlockHash(),
FinalizedBlockHash: s.progressTracker.LastSyncedVerifiedBlockHash(),
}, nil)
if err != nil {
return err
}
if fcRes.PayloadStatus.Status != engine.SYNCING {
return fmt.Errorf("unexpected ForkchoiceUpdate response status: %s", fcRes.PayloadStatus.Status)
}

return nil
}

Expand All @@ -76,7 +89,7 @@ func (s *Syncer) TriggerBeaconSync() error {
return err
}
if fcRes.PayloadStatus.Status != engine.SYNCING {
return fmt.Errorf("unexpected ForkchoiceUpdate response status: %s", status.Status)
return fmt.Errorf("unexpected ForkchoiceUpdate response status: %s", fcRes.PayloadStatus.Status)
}

// Update sync status.
Expand Down

0 comments on commit 90e365a

Please sign in to comment.