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
901d20aa
Unverified
Commit
901d20aa
authored
Mar 26, 2024
by
zhiqiangxu
Committed by
GitHub
Mar 25, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
call BuildingPayload once (#9884)
parent
763fda7f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
sequencer.go
op-node/rollup/driver/sequencer.go
+3
-4
No files found.
op-node/rollup/driver/sequencer.go
View file @
901d20aa
...
@@ -132,10 +132,11 @@ func (d *Sequencer) CancelBuildingBlock(ctx context.Context) {
...
@@ -132,10 +132,11 @@ func (d *Sequencer) CancelBuildingBlock(ctx context.Context) {
// PlanNextSequencerAction returns a desired delay till the RunNextSequencerAction call.
// PlanNextSequencerAction returns a desired delay till the RunNextSequencerAction call.
func
(
d
*
Sequencer
)
PlanNextSequencerAction
()
time
.
Duration
{
func
(
d
*
Sequencer
)
PlanNextSequencerAction
()
time
.
Duration
{
buildingOnto
,
buildingID
,
safe
:=
d
.
engine
.
BuildingPayload
()
// If the engine is busy building safe blocks (and thus changing the head that we would sync on top of),
// If the engine is busy building safe blocks (and thus changing the head that we would sync on top of),
// then give it time to sync up.
// then give it time to sync up.
if
onto
,
_
,
safe
:=
d
.
engine
.
BuildingPayload
();
safe
{
if
safe
{
d
.
log
.
Warn
(
"delaying sequencing to not interrupt safe-head changes"
,
"onto"
,
onto
,
"onto_time"
,
o
nto
.
Time
)
d
.
log
.
Warn
(
"delaying sequencing to not interrupt safe-head changes"
,
"onto"
,
buildingOnto
,
"onto_time"
,
buildingO
nto
.
Time
)
// approximates the worst-case time it takes to build a block, to reattempt sequencing after.
// approximates the worst-case time it takes to build a block, to reattempt sequencing after.
return
time
.
Second
*
time
.
Duration
(
d
.
rollupCfg
.
BlockTime
)
return
time
.
Second
*
time
.
Duration
(
d
.
rollupCfg
.
BlockTime
)
}
}
...
@@ -143,8 +144,6 @@ func (d *Sequencer) PlanNextSequencerAction() time.Duration {
...
@@ -143,8 +144,6 @@ func (d *Sequencer) PlanNextSequencerAction() time.Duration {
head
:=
d
.
engine
.
UnsafeL2Head
()
head
:=
d
.
engine
.
UnsafeL2Head
()
now
:=
d
.
timeNow
()
now
:=
d
.
timeNow
()
buildingOnto
,
buildingID
,
_
:=
d
.
engine
.
BuildingPayload
()
// We may have to wait till the next sequencing action, e.g. upon an error.
// We may have to wait till the next sequencing action, e.g. upon an error.
// If the head changed we need to respond and will not delay the sequencing.
// If the head changed we need to respond and will not delay the sequencing.
if
delay
:=
d
.
nextAction
.
Sub
(
now
);
delay
>
0
&&
buildingOnto
.
Hash
==
head
.
Hash
{
if
delay
:=
d
.
nextAction
.
Sub
(
now
);
delay
>
0
&&
buildingOnto
.
Hash
==
head
.
Hash
{
...
...
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