optimism icon indicating copy to clipboard operation
optimism copied to clipboard

Holocene-D: op-batcher: Periodically check sync status

Open sebastianst opened this issue 1 year ago • 1 comments

In calculateL2BlockRangeToStore, the batcher loads the sync status of the node it is connected to, to determine the unsafe block range to batch-submit. It does some checks, like whether the safe head unexpectedly jumped forward (which may happen if this is a restarted batcher and old transactions from a previous instance just got included L1). Then later, when adding the blocks to the channel manager, reorgs are detected.

However, what is not checked yet is whether the node made the expected progress. If a channel is fully submitted on L1, and that L1 inclusion block has been visited according to the sync status, we should check that the safe head has moved accordingly to the highest block in that channel. And if that's not the case, we should reset the batch submitter state (l.lastStoredBlock and possibly others) so that it starts batching again from the oldest non-safe unsafe head in the hope of repairing the situation.

We should make this behavior of resetting and reattempting batching optional. The alternative should be to just halt after printing an error message about the detected unexpected non-advancement of the safe chain.

This will improve the likelihood that the batcher can self-heal from any unexpected situations that arise from the stricter ordering rules in Holocene.

sebastianst avatar Sep 25 '24 19:09 sebastianst