Skip to content

Commit

Permalink
feat: recover aggregator on l1 sync failure
Browse files Browse the repository at this point in the history
  • Loading branch information
ToniRamirezM committed Feb 7, 2025
1 parent c4ff9bb commit bc498e4
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions aggregator/aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,17 +298,24 @@ func (a *Aggregator) handleRollbackBatches(rollbackData synchronizer.RollbackBat
// Start starts the aggregator
func (a *Aggregator) Start() error {
// Initial L1 Sync blocking
err := a.l1Syncr.Sync(true)
if err != nil {
a.logger.Fatalf("Failed to synchronize from L1: %v", err)
return err
for {
err := a.l1Syncr.Sync(true)
if err != nil {
a.logger.Errorf("Failed to synchronize from L1: %v", err)
continue
}
break
}

// Keep syncing L1
go func() {
err := a.l1Syncr.Sync(false)
if err != nil {
a.logger.Fatalf("Failed to synchronize from L1: %v", err)
for {
err := a.l1Syncr.Sync(false)
if err != nil {
a.logger.Fatalf("Failed to synchronize from L1: %v", err)
time.Sleep(a.cfg.RetryTime.Duration)
continue
}
}
}()

Expand Down

0 comments on commit bc498e4

Please sign in to comment.