From d81d9f75ccf1d8c966739cd5a11ae42d8f97a73a Mon Sep 17 00:00:00 2001 From: Kamen Stoykov Date: Tue, 20 Aug 2024 11:24:46 +0000 Subject: [PATCH] 824-handing-of-sequencer-restarts-during-l1-recovery --- zk/stages/stage_sequence_execute.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/zk/stages/stage_sequence_execute.go b/zk/stages/stage_sequence_execute.go index 2aa293410e1..842e3423ca2 100644 --- a/zk/stages/stage_sequence_execute.go +++ b/zk/stages/stage_sequence_execute.go @@ -142,7 +142,12 @@ func SpawnSequencingStage( blockTicker.Reset(cfg.zk.SequencerBlockSealTime) if batchState.isL1Recovery() { - didLoadedAnyDataForRecovery := batchState.loadBlockL1RecoveryData(blockNumber - (executionAt + 1)) + blockNumbersInBatchSoFar, err := batchContext.sdb.hermezDb.GetL2BlockNosByBatch(batchState.batchNumber) + if err != nil { + return err + } + + didLoadedAnyDataForRecovery := batchState.loadBlockL1RecoveryData(uint64(len(blockNumbersInBatchSoFar))) if !didLoadedAnyDataForRecovery { break }