Commit 86e5f636 authored by Sebastian Stammler's avatar Sebastian Stammler Committed by GitHub

op-node/rollup/sequencing: Fix temporary engine error handling (#12258)

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
parent c93c972a
...@@ -55,8 +55,7 @@ type AsyncGossiper interface { ...@@ -55,8 +55,7 @@ type AsyncGossiper interface {
// This event is used to prioritize sequencer work over derivation work, // This event is used to prioritize sequencer work over derivation work,
// by emitting it before e.g. a derivation-pipeline step. // by emitting it before e.g. a derivation-pipeline step.
// A future sequencer in an async world may manage its own execution. // A future sequencer in an async world may manage its own execution.
type SequencerActionEvent struct { type SequencerActionEvent struct{}
}
func (ev SequencerActionEvent) String() string { func (ev SequencerActionEvent) String() string {
return "sequencer-action" return "sequencer-action"
...@@ -129,7 +128,8 @@ func NewSequencer(driverCtx context.Context, log log.Logger, rollupCfg *rollup.C ...@@ -129,7 +128,8 @@ func NewSequencer(driverCtx context.Context, log log.Logger, rollupCfg *rollup.C
listener SequencerStateListener, listener SequencerStateListener,
conductor conductor.SequencerConductor, conductor conductor.SequencerConductor,
asyncGossip AsyncGossiper, asyncGossip AsyncGossiper,
metrics Metrics) *Sequencer { metrics Metrics,
) *Sequencer {
return &Sequencer{ return &Sequencer{
ctx: driverCtx, ctx: driverCtx,
log: log, log: log,
...@@ -270,7 +270,8 @@ func (d *Sequencer) onBuildSealed(x engine.BuildSealedEvent) { ...@@ -270,7 +270,8 @@ func (d *Sequencer) onBuildSealed(x engine.BuildSealedEvent) {
defer cancel() defer cancel()
if err := d.conductor.CommitUnsafePayload(ctx, x.Envelope); err != nil { if err := d.conductor.CommitUnsafePayload(ctx, x.Envelope); err != nil {
d.emitter.Emit(rollup.EngineTemporaryErrorEvent{ 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 return
} }
...@@ -382,8 +383,7 @@ func (d *Sequencer) onSequencerAction(x SequencerActionEvent) { ...@@ -382,8 +383,7 @@ func (d *Sequencer) onSequencerAction(x SequencerActionEvent) {
func (d *Sequencer) onEngineTemporaryError(x rollup.EngineTemporaryErrorEvent) { func (d *Sequencer) onEngineTemporaryError(x rollup.EngineTemporaryErrorEvent) {
if d.latest == (BuildingState{}) { if d.latest == (BuildingState{}) {
d.log.Debug("Engine reported temporary error, but sequencer is not using engine", "err", x.Err) d.log.Debug("Engine reported temporary error while building state is empty", "err", x.Err)
return
} }
d.log.Error("Engine failed temporarily, backing off sequencer", "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 if errors.Is(x.Err, engine.ErrEngineSyncing) { // if it is syncing we can back off by more
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment