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

feat(driver): improve error messages #289

Merged
merged 1 commit into from
Jun 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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