Skip to content

Commit

Permalink
Merge pull request #1761 from OffchainLabs/dont-log-transient-das-syn…
Browse files Browse the repository at this point in the history
…c-errs

das: Don't log l1SyncService l1 errs until >5
  • Loading branch information
Tristan-Wilson committed Jul 13, 2023
2 parents fb66a15 + dd4cdd7 commit 6d613c4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions das/syncing_fallback_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,20 +370,25 @@ func (s *l1SyncService) readMore(ctx context.Context) error {
func (s *l1SyncService) mainThread(ctx context.Context) {
headerChan, unsubscribe := s.l1Reader.Subscribe(false)
defer unsubscribe()
errCount := 0
for {
err := s.readMore(ctx)
if err != nil {
if ctx.Err() != nil {
return
}
log.Error("error trying to sync from L1", "err", err)
errCount++
if errCount > 5 {
log.Error("error trying to sync from L1", "err", err)
}
select {
case <-ctx.Done():
return
case <-time.After(s.config.DelayOnError):
case <-time.After(s.config.DelayOnError * time.Duration(errCount)):
}
continue
}
errCount = 0
if s.catchingUp {
// we're behind. Don't wait.
continue
Expand Down

0 comments on commit 6d613c4

Please sign in to comment.