Skip to content

Commit 308299f

Browse files
authored
remove outOfData variable (ethereum-optimism#10405)
1 parent 6620231 commit 308299f

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

op-node/rollup/derive/engine_queue.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ func (eq *EngineQueue) Step(ctx context.Context) error {
316316
if eq.safeAttributes != nil {
317317
return eq.tryNextSafeAttributes(ctx)
318318
}
319-
outOfData := false
319+
320320
newOrigin := eq.prev.Origin()
321321
// Check if the L2 unsafe head origin is consistent with the new origin
322322
if err := eq.verifyNewL1Origin(ctx, newOrigin); err != nil {
@@ -332,7 +332,7 @@ func (eq *EngineQueue) Step(ctx context.Context) error {
332332
return err
333333
}
334334
if next, err := eq.prev.NextAttributes(ctx, eq.ec.PendingSafeL2Head()); err == io.EOF {
335-
outOfData = true
335+
return io.EOF
336336
} else if err != nil {
337337
return err
338338
} else {
@@ -341,12 +341,6 @@ func (eq *EngineQueue) Step(ctx context.Context) error {
341341
"pending_safe_head", eq.ec.PendingSafeL2Head(), "next", next)
342342
return NotEnoughData
343343
}
344-
345-
if outOfData {
346-
return io.EOF
347-
} else {
348-
return nil
349-
}
350344
}
351345

352346
// verifyNewL1Origin checks that the L2 unsafe head still has a L1 origin that is on the canonical chain.

0 commit comments

Comments
 (0)