Determine whether an OP batch channel has all its frames

A batcher transaction can carry only part of a compressed channel. Seeing a frame with its last flag set does not make earlier frame numbers optional.

Index the accepted frames

Decode the batcher transaction wire format for the active fork. Group accepted frames by channel ID and track frame number, payload and last flag. Keep the L1 inclusion origin for timeout handling.

channel C: frame 0, frame 2 (last)
missing:   frame 1

In the example, frame 2 announces the end, but bytes from frame 1 are missing. Feed the channel to the batch decompressor only when the derivation rules consider it complete. Reassembling in transaction arrival order can scramble the byte stream.

Use the channel rules for the observed fork

Frame order and channel handling changed across protocol upgrades. Reproduce acceptance and timeout decisions for the chain’s fork at the observed L1 origin. An incomplete or discarded channel cannot establish that its L2 batches were derived. specs.optimism.io OP Stack specification