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
e7946239
Commit
e7946239
authored
Jul 24, 2023
by
Maurelian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(chain-mon): Default wd-mon scan from start of FPW
parent
f30fdd3f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
service.ts
packages/chain-mon/src/wd-mon/service.ts
+11
-3
No files found.
packages/chain-mon/src/wd-mon/service.ts
View file @
e7946239
...
...
@@ -30,7 +30,7 @@ type Metrics = {
type
State
=
{
messenger
:
CrossChainMessenger
highestUncheckedBlockNumber
:
number
f
inalization
Window
:
number
f
aultProof
Window
:
number
forgeryDetected
:
boolean
}
...
...
@@ -109,10 +109,18 @@ export class WithdrawalMonitor extends BaseServiceV2<Options, Metrics, State> {
// Not detected by default.
this
.
state
.
forgeryDetected
=
false
// For now we'll just start take it from the env or the tip of the chain
this
.
state
.
faultProofWindow
=
await
this
.
state
.
messenger
.
getChallengePeriodSeconds
()
this
.
logger
.
info
(
`fault proof window is
${
this
.
state
.
faultProofWindow
}
seconds`
)
// Set the start block number.
if
(
this
.
options
.
startBlockNumber
===
-
1
)
{
// We default to starting from the earliest block still in the fault proof window.
const
l1BlockNumber
=
await
this
.
options
.
l1RpcProvider
.
getBlockNumber
()
this
.
state
.
highestUncheckedBlockNumber
=
await
this
.
options
.
l1RpcProvider
.
getBlockNumber
()
l1BlockNumber
-
this
.
state
.
faultProofWindow
/
12
}
else
{
this
.
state
.
highestUncheckedBlockNumber
=
this
.
options
.
startBlockNumber
}
...
...
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