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
d6441e6c
Unverified
Commit
d6441e6c
authored
Mar 23, 2023
by
mergify[bot]
Committed by
GitHub
Mar 23, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5235 from ethereum-optimism/jg/sync_start_logging
op-node: More logging in FindL2Heads
parents
ef5c1f77
e2c16e90
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
start.go
op-node/rollup/sync/start.go
+8
-1
No files found.
op-node/rollup/sync/start.go
View file @
d6441e6c
...
@@ -109,6 +109,9 @@ func FindL2Heads(ctx context.Context, cfg *rollup.Config, l1 L1Chain, l2 L2Chain
...
@@ -109,6 +109,9 @@ func FindL2Heads(ctx context.Context, cfg *rollup.Config, l1 L1Chain, l2 L2Chain
return
nil
,
fmt
.
Errorf
(
"failed to fetch current L2 forkchoice state: %w"
,
err
)
return
nil
,
fmt
.
Errorf
(
"failed to fetch current L2 forkchoice state: %w"
,
err
)
}
}
lgr
.
Info
(
"Loaded current L2 heads"
,
"unsafe"
,
result
.
Unsafe
,
"safe"
,
result
.
Safe
,
"finalized"
,
result
.
Finalized
,
"unsafe_origin"
,
result
.
Unsafe
.
L1Origin
,
"unsafe_origin"
,
result
.
Safe
.
L1Origin
)
// Remember original unsafe block to determine reorg depth
// Remember original unsafe block to determine reorg depth
prevUnsafe
:=
result
.
Unsafe
prevUnsafe
:=
result
.
Unsafe
...
@@ -134,6 +137,7 @@ func FindL2Heads(ctx context.Context, cfg *rollup.Config, l1 L1Chain, l2 L2Chain
...
@@ -134,6 +137,7 @@ func FindL2Heads(ctx context.Context, cfg *rollup.Config, l1 L1Chain, l2 L2Chain
// Exit, find-sync start should start over, to move to an available L1 chain with block-by-number / not-found case.
// Exit, find-sync start should start over, to move to an available L1 chain with block-by-number / not-found case.
return
nil
,
fmt
.
Errorf
(
"failed to retrieve L1 block: %w"
,
err
)
return
nil
,
fmt
.
Errorf
(
"failed to retrieve L1 block: %w"
,
err
)
}
}
lgr
.
Info
(
"Walking back L1Block by hash"
,
"curr"
,
l1Block
,
"next"
,
b
,
"l2block"
,
n
)
l1Block
=
b
l1Block
=
b
ahead
=
false
ahead
=
false
}
else
if
l1Block
==
(
eth
.
L1BlockRef
{})
||
n
.
L1Origin
.
Hash
!=
l1Block
.
Hash
{
}
else
if
l1Block
==
(
eth
.
L1BlockRef
{})
||
n
.
L1Origin
.
Hash
!=
l1Block
.
Hash
{
...
@@ -145,9 +149,10 @@ func FindL2Heads(ctx context.Context, cfg *rollup.Config, l1 L1Chain, l2 L2Chain
...
@@ -145,9 +149,10 @@ func FindL2Heads(ctx context.Context, cfg *rollup.Config, l1 L1Chain, l2 L2Chain
}
}
l1Block
=
b
l1Block
=
b
ahead
=
notFound
ahead
=
notFound
lgr
.
Info
(
"Walking back L1Block by number"
,
"curr"
,
l1Block
,
"next"
,
b
,
"l2block"
,
n
)
}
}
lgr
.
Trace
(
"walking sync start"
,
"
number"
,
n
.
Number
)
lgr
.
Trace
(
"walking sync start"
,
"
l2block"
,
n
)
// Don't walk past genesis. If we were at the L2 genesis, but could not find its L1 origin,
// Don't walk past genesis. If we were at the L2 genesis, but could not find its L1 origin,
// the L2 chain is building on the wrong L1 branch.
// the L2 chain is building on the wrong L1 branch.
...
@@ -201,6 +206,8 @@ func FindL2Heads(ctx context.Context, cfg *rollup.Config, l1 L1Chain, l2 L2Chain
...
@@ -201,6 +206,8 @@ func FindL2Heads(ctx context.Context, cfg *rollup.Config, l1 L1Chain, l2 L2Chain
// Don't traverse further than the finalized head to find a safe head
// Don't traverse further than the finalized head to find a safe head
if
n
.
Number
==
result
.
Finalized
.
Number
{
if
n
.
Number
==
result
.
Finalized
.
Number
{
lgr
.
Info
(
"Hit finalized L2 head, returning immediately"
,
"unsafe"
,
result
.
Unsafe
,
"safe"
,
result
.
Safe
,
"finalized"
,
result
.
Finalized
,
"unsafe_origin"
,
result
.
Unsafe
.
L1Origin
,
"unsafe_origin"
,
result
.
Safe
.
L1Origin
)
result
.
Safe
=
n
result
.
Safe
=
n
return
result
,
nil
return
result
,
nil
}
}
...
...
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