Skip to content

Commit

Permalink
remove outOfData variable
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiqiangxu committed May 5, 2024
1 parent 0f11f2a commit e4892ee
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions op-node/rollup/derive/engine_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ func (eq *EngineQueue) Step(ctx context.Context) error {
if eq.safeAttributes != nil {
return eq.tryNextSafeAttributes(ctx)
}
outOfData := false

newOrigin := eq.prev.Origin()
// Check if the L2 unsafe head origin is consistent with the new origin
if err := eq.verifyNewL1Origin(ctx, newOrigin); err != nil {
Expand All @@ -332,7 +332,7 @@ func (eq *EngineQueue) Step(ctx context.Context) error {
return err
}
if next, err := eq.prev.NextAttributes(ctx, eq.ec.PendingSafeL2Head()); err == io.EOF {
outOfData = true
return io.EOF
} else if err != nil {
return err
} else {
Expand All @@ -341,12 +341,6 @@ func (eq *EngineQueue) Step(ctx context.Context) error {
"pending_safe_head", eq.ec.PendingSafeL2Head(), "next", next)
return NotEnoughData
}

if outOfData {
return io.EOF
} else {
return nil
}
}

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

0 comments on commit e4892ee

Please sign in to comment.