Commit 16ccbee2 authored by Will Cory's avatar Will Cory

fix(fault-detector): Change expected error to a warning

parent 57855e8b
---
'@eth-optimism/fault-detector': patch
---
Fix false error to warning
...@@ -66,7 +66,7 @@ export const updateOracleCache = async <TSubmissionEventArgs>( ...@@ -66,7 +66,7 @@ export const updateOracleCache = async <TSubmissionEventArgs>(
latestBlock: endBlock, latestBlock: endBlock,
}) })
let failures = 0 let failures = []
let currentBlock = cache.highestBlock + 1 let currentBlock = cache.highestBlock + 1
let step = endBlock - currentBlock let step = endBlock - currentBlock
while (currentBlock < endBlock) { while (currentBlock < endBlock) {
...@@ -98,7 +98,7 @@ export const updateOracleCache = async <TSubmissionEventArgs>( ...@@ -98,7 +98,7 @@ export const updateOracleCache = async <TSubmissionEventArgs>(
currentBlock += step currentBlock += step
step = Math.ceil(step * 2) step = Math.ceil(step * 2)
} catch (err) { } catch (err) {
logger?.error('error fetching events', { logger?.warn('error fetching events', {
err, err,
node: 'l1', node: 'l1',
section: 'getLogs', section: 'getLogs',
...@@ -110,14 +110,14 @@ export const updateOracleCache = async <TSubmissionEventArgs>( ...@@ -110,14 +110,14 @@ export const updateOracleCache = async <TSubmissionEventArgs>(
// When the step gets down to zero, we're pretty much guaranteed that range size isn't the // When the step gets down to zero, we're pretty much guaranteed that range size isn't the
// problem. If we get three failures like this in a row then we should just give up. // problem. If we get three failures like this in a row then we should just give up.
if (step === 0) { if (step === 0) {
failures++ failures.push(err)
} else { } else {
failures = 0 failures = []
} }
// We've failed 3 times in a row, we're probably stuck. // We've failed 5 times in a row, we're probably stuck.
if (failures >= 3) { if (failures.length >= 5) {
logger?.fatal('unable to fetch oracle events', { err }) logger?.fatal('unable to fetch oracle events', { errors: failures })
throw new Error('failed to update event cache') throw new Error('failed to update event cache')
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment