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
b6c52d72
Commit
b6c52d72
authored
Mar 09, 2023
by
s7v7nislands
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename variable
parent
b00a0be4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
engine_queue.go
op-node/rollup/derive/engine_queue.go
+9
-9
No files found.
op-node/rollup/derive/engine_queue.go
View file @
b6c52d72
...
@@ -104,7 +104,7 @@ type EngineQueue struct {
...
@@ -104,7 +104,7 @@ type EngineQueue struct {
finalizedL1
eth
.
L1BlockRef
finalizedL1
eth
.
L1BlockRef
safeAttribute
*
eth
.
PayloadAttributes
safeAttribute
s
*
eth
.
PayloadAttributes
unsafePayloads
PayloadsQueue
// queue of unsafe payloads, ordered by ascending block number, may have gaps
unsafePayloads
PayloadsQueue
// queue of unsafe payloads, ordered by ascending block number, may have gaps
// Tracks which L2 blocks where last derived from which L1 block. At most finalityLookback large.
// Tracks which L2 blocks where last derived from which L1 block. At most finalityLookback large.
...
@@ -207,7 +207,7 @@ func (eq *EngineQueue) Step(ctx context.Context) error {
...
@@ -207,7 +207,7 @@ func (eq *EngineQueue) Step(ctx context.Context) error {
if
eq
.
needForkchoiceUpdate
{
if
eq
.
needForkchoiceUpdate
{
return
eq
.
tryUpdateEngine
(
ctx
)
return
eq
.
tryUpdateEngine
(
ctx
)
}
}
if
eq
.
safeAttribute
!=
nil
{
if
eq
.
safeAttribute
s
!=
nil
{
return
eq
.
tryNextSafeAttributes
(
ctx
)
return
eq
.
tryNextSafeAttributes
(
ctx
)
}
}
outOfData
:=
false
outOfData
:=
false
...
@@ -223,7 +223,7 @@ func (eq *EngineQueue) Step(ctx context.Context) error {
...
@@ -223,7 +223,7 @@ func (eq *EngineQueue) Step(ctx context.Context) error {
}
else
if
err
!=
nil
{
}
else
if
err
!=
nil
{
return
err
return
err
}
else
{
}
else
{
eq
.
safeAttribute
=
next
eq
.
safeAttribute
s
=
next
return
NotEnoughData
return
NotEnoughData
}
}
...
@@ -453,7 +453,7 @@ func (eq *EngineQueue) consolidateNextSafeAttributes(ctx context.Context) error
...
@@ -453,7 +453,7 @@ func (eq *EngineQueue) consolidateNextSafeAttributes(ctx context.Context) error
}
}
return
NewTemporaryError
(
fmt
.
Errorf
(
"failed to get existing unsafe payload to compare against derived attributes from L1: %w"
,
err
))
return
NewTemporaryError
(
fmt
.
Errorf
(
"failed to get existing unsafe payload to compare against derived attributes from L1: %w"
,
err
))
}
}
if
err
:=
AttributesMatchBlock
(
eq
.
safeAttribute
,
eq
.
safeHead
.
Hash
,
payload
,
eq
.
log
);
err
!=
nil
{
if
err
:=
AttributesMatchBlock
(
eq
.
safeAttribute
s
,
eq
.
safeHead
.
Hash
,
payload
,
eq
.
log
);
err
!=
nil
{
eq
.
log
.
Warn
(
"L2 reorg: existing unsafe block does not match derived attributes from L1"
,
"err"
,
err
)
eq
.
log
.
Warn
(
"L2 reorg: existing unsafe block does not match derived attributes from L1"
,
"err"
,
err
)
// geth cannot wind back a chain without reorging to a new, previously non-canonical, block
// geth cannot wind back a chain without reorging to a new, previously non-canonical, block
return
eq
.
forceNextSafeAttributes
(
ctx
)
return
eq
.
forceNextSafeAttributes
(
ctx
)
...
@@ -466,7 +466,7 @@ func (eq *EngineQueue) consolidateNextSafeAttributes(ctx context.Context) error
...
@@ -466,7 +466,7 @@ func (eq *EngineQueue) consolidateNextSafeAttributes(ctx context.Context) error
eq
.
needForkchoiceUpdate
=
true
eq
.
needForkchoiceUpdate
=
true
eq
.
metrics
.
RecordL2Ref
(
"l2_safe"
,
ref
)
eq
.
metrics
.
RecordL2Ref
(
"l2_safe"
,
ref
)
// unsafe head stays the same, we did not reorg the chain.
// unsafe head stays the same, we did not reorg the chain.
eq
.
safeAttribute
=
nil
eq
.
safeAttribute
s
=
nil
eq
.
postProcessSafeL2
()
eq
.
postProcessSafeL2
()
eq
.
logSyncProgress
(
"reconciled with L1"
)
eq
.
logSyncProgress
(
"reconciled with L1"
)
...
@@ -475,10 +475,10 @@ func (eq *EngineQueue) consolidateNextSafeAttributes(ctx context.Context) error
...
@@ -475,10 +475,10 @@ func (eq *EngineQueue) consolidateNextSafeAttributes(ctx context.Context) error
// forceNextSafeAttributes inserts the provided attributes, reorging away any conflicting unsafe chain.
// forceNextSafeAttributes inserts the provided attributes, reorging away any conflicting unsafe chain.
func
(
eq
*
EngineQueue
)
forceNextSafeAttributes
(
ctx
context
.
Context
)
error
{
func
(
eq
*
EngineQueue
)
forceNextSafeAttributes
(
ctx
context
.
Context
)
error
{
if
eq
.
safeAttribute
==
nil
{
if
eq
.
safeAttribute
s
==
nil
{
return
nil
return
nil
}
}
attrs
:=
eq
.
safeAttribute
attrs
:=
eq
.
safeAttribute
s
errType
,
err
:=
eq
.
StartPayload
(
ctx
,
eq
.
safeHead
,
attrs
,
true
)
errType
,
err
:=
eq
.
StartPayload
(
ctx
,
eq
.
safeHead
,
attrs
,
true
)
if
err
==
nil
{
if
err
==
nil
{
_
,
errType
,
err
=
eq
.
ConfirmPayload
(
ctx
)
_
,
errType
,
err
=
eq
.
ConfirmPayload
(
ctx
)
...
@@ -507,7 +507,7 @@ func (eq *EngineQueue) forceNextSafeAttributes(ctx context.Context) error {
...
@@ -507,7 +507,7 @@ func (eq *EngineQueue) forceNextSafeAttributes(ctx context.Context) error {
return
NewCriticalError
(
fmt
.
Errorf
(
"failed to process block with only deposit transactions: %w"
,
err
))
return
NewCriticalError
(
fmt
.
Errorf
(
"failed to process block with only deposit transactions: %w"
,
err
))
}
}
// drop the payload without inserting it
// drop the payload without inserting it
eq
.
safeAttribute
=
nil
eq
.
safeAttribute
s
=
nil
// suppress the error b/c we want to retry with the next batch from the batch queue
// suppress the error b/c we want to retry with the next batch from the batch queue
// If there is no valid batch the node will eventually force a deposit only block. If
// If there is no valid batch the node will eventually force a deposit only block. If
// the deposit only block fails, this will return the critical error above.
// the deposit only block fails, this will return the critical error above.
...
@@ -517,7 +517,7 @@ func (eq *EngineQueue) forceNextSafeAttributes(ctx context.Context) error {
...
@@ -517,7 +517,7 @@ func (eq *EngineQueue) forceNextSafeAttributes(ctx context.Context) error {
return
NewCriticalError
(
fmt
.
Errorf
(
"unknown InsertHeadBlock error type %d: %w"
,
errType
,
err
))
return
NewCriticalError
(
fmt
.
Errorf
(
"unknown InsertHeadBlock error type %d: %w"
,
errType
,
err
))
}
}
}
}
eq
.
safeAttribute
=
nil
eq
.
safeAttribute
s
=
nil
eq
.
logSyncProgress
(
"processed safe block derived from L1"
)
eq
.
logSyncProgress
(
"processed safe block derived from L1"
)
return
nil
return
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