Skip to content

Commit

Permalink
fix not do sequence action instantly
Browse files Browse the repository at this point in the history
  • Loading branch information
bnoieh committed Dec 1, 2023
1 parent 73574aa commit 038159e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
4 changes: 2 additions & 2 deletions op-node/rollup/driver/sequencer.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ func (d *Sequencer) PlanNextSequencerAction() time.Duration {
buildingOnto, buildingID, _ := d.engine.BuildingPayload()

// We may have to wait till the next sequencing action, e.g. upon an error.
// Delay when sequencer action failed
if delay := d.nextAction.Sub(now); delay > 0 {
// 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 {
return delay
}

Expand Down
12 changes: 1 addition & 11 deletions op-node/rollup/driver/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,17 +269,7 @@ func (s *Driver) eventLoop() {
// This may adjust at any time based on fork-choice changes or previous errors.
//
// update sequencer time if the head changed
delay := s.sequencer.PlanNextSequencerAction()
if delay == 0 {
// immediately do sequencerStep if time is ready
if err := sequencerStep(); err != nil {
return
}
// sequencerStep was already done, so we continue to next round
continue
} else {
planSequencerAction()
}
planSequencerAction()
}
} else {
sequencerCh = nil
Expand Down

0 comments on commit 038159e

Please sign in to comment.