Skip to content

Commit

Permalink
op-node/rollup/sequencing: Fix temporary engine error handling (#12258)
Browse files Browse the repository at this point in the history
Do schedule a next sequencer action even if the building state is empty
in `onEngineTemporaryError`.
This can happen if the previous successful payload cleared the building
state and then when `startBuildingBlock` is entered, it hits a temp
error but never modified the cleared building state, so the temp error
handler would never schedule the next action.

Towards #12240 #12041
  • Loading branch information
sebastianst authored Oct 16, 2024
1 parent c93c972 commit 86e5f63
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions op-node/rollup/sequencing/sequencer.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ type AsyncGossiper interface {
// This event is used to prioritize sequencer work over derivation work,
// by emitting it before e.g. a derivation-pipeline step.
// A future sequencer in an async world may manage its own execution.
type SequencerActionEvent struct {
}
type SequencerActionEvent struct{}

func (ev SequencerActionEvent) String() string {
return "sequencer-action"
Expand Down Expand Up @@ -129,7 +128,8 @@ func NewSequencer(driverCtx context.Context, log log.Logger, rollupCfg *rollup.C
listener SequencerStateListener,
conductor conductor.SequencerConductor,
asyncGossip AsyncGossiper,
metrics Metrics) *Sequencer {
metrics Metrics,
) *Sequencer {
return &Sequencer{
ctx: driverCtx,
log: log,
Expand Down Expand Up @@ -270,7 +270,8 @@ func (d *Sequencer) onBuildSealed(x engine.BuildSealedEvent) {
defer cancel()
if err := d.conductor.CommitUnsafePayload(ctx, x.Envelope); err != nil {
d.emitter.Emit(rollup.EngineTemporaryErrorEvent{
Err: fmt.Errorf("failed to commit unsafe payload to conductor: %w", err)})
Err: fmt.Errorf("failed to commit unsafe payload to conductor: %w", err),
})
return
}

Expand Down Expand Up @@ -382,8 +383,7 @@ func (d *Sequencer) onSequencerAction(x SequencerActionEvent) {

func (d *Sequencer) onEngineTemporaryError(x rollup.EngineTemporaryErrorEvent) {
if d.latest == (BuildingState{}) {
d.log.Debug("Engine reported temporary error, but sequencer is not using engine", "err", x.Err)
return
d.log.Debug("Engine reported temporary error while building state is empty", "err", x.Err)
}
d.log.Error("Engine failed temporarily, backing off sequencer", "err", x.Err)
if errors.Is(x.Err, engine.ErrEngineSyncing) { // if it is syncing we can back off by more
Expand Down

0 comments on commit 86e5f63

Please sign in to comment.