diff --git a/op-node/rollup/derive/batch_queue.go b/op-node/rollup/derive/batch_queue.go index 18a987661af22..d94f542e6a55c 100644 --- a/op-node/rollup/derive/batch_queue.go +++ b/op-node/rollup/derive/batch_queue.go @@ -59,7 +59,11 @@ func (bq *BatchQueue) Origin() eth.L1BlockRef { } func (bq *BatchQueue) NextBatch(ctx context.Context, safeL2Head eth.L2BlockRef) (*BatchData, error) { - originBehind := bq.origin.Number < safeL2Head.L1Origin.Number + // Note: We use the origin that we will have to determine if it's behind. This is important + // because it's the future origin that gets saved into the l1Blocks array. + // We always update the origin of this stage if it is not the same so after the update code + // runs, this is consistent. + originBehind := bq.prev.Origin().Number < safeL2Head.L1Origin.Number // Advance origin if needed // Note: The entire pipeline has the same origin