Skip to content

Commit

Permalink
Update header_reader.go
Browse files Browse the repository at this point in the history
  • Loading branch information
ganeshvanahalli authored Sep 28, 2023
1 parent 3e8bc37 commit 520bdb9
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions util/headerreader/header_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,18 +312,10 @@ func (s *HeaderReader) logIfHeaderIsOld() {
headerTime := time.Since(l1Timetamp)
if headerTime >= s.config().OldHeaderTimeout {
s.setError(fmt.Errorf("latest header is at least %v old", headerTime))
// Upgrade the log level from warn to error when losing connection to L1 for too long
if headerTime >= DefaultConfig.OldHeaderTimeout {
log.Error(
"latest L1 block is old", "l1Block", storedHeader.Number,
"l1Timestamp", l1Timetamp, "age", headerTime,
)
} else {
log.Warn(
"latest L1 block is old", "l1Block", storedHeader.Number,
"l1Timestamp", l1Timetamp, "age", headerTime,
)
}
log.Error(
"latest L1 block is old", "l1Block", storedHeader.Number,
"l1Timestamp", l1Timetamp, "age", headerTime,
)
}
}

Expand Down

0 comments on commit 520bdb9

Please sign in to comment.