Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
16ccbee2
Commit
16ccbee2
authored
Jun 09, 2023
by
Will Cory
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(fault-detector): Change expected error to a warning
parent
57855e8b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
7 deletions
+12
-7
few-shoes-deny.md
.changeset/few-shoes-deny.md
+5
-0
helpers.ts
packages/fault-detector/src/helpers.ts
+7
-7
No files found.
.changeset/few-shoes-deny.md
0 → 100644
View file @
16ccbee2
---
'
@eth-optimism/fault-detector'
:
patch
---
Fix false error to warning
packages/fault-detector/src/helpers.ts
View file @
16ccbee2
...
@@ -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
'
,
{
err
ors
:
failures
})
throw
new
Error
(
'
failed to update event cache
'
)
throw
new
Error
(
'
failed to update event cache
'
)
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment