From 8dc5dd5f1f7320885d64db19f08286eb1803346d Mon Sep 17 00:00:00 2001 From: Kamen Stoykov Date: Thu, 29 Aug 2024 07:00:06 +0000 Subject: [PATCH] handing-unwinds-on-seq-restart-2 --- zk/stages/stage_sequence_execute.go | 3 +-- zk/stages/stage_sequence_execute_data_stream.go | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/zk/stages/stage_sequence_execute.go b/zk/stages/stage_sequence_execute.go index 9b32d75eb76..2ef81887c49 100644 --- a/zk/stages/stage_sequence_execute.go +++ b/zk/stages/stage_sequence_execute.go @@ -140,7 +140,6 @@ func SpawnSequencingStage( log.Info(fmt.Sprintf("[%s] Starting batch %d...", logPrefix, batchState.batchNumber)) - var allConditionsOK bool for blockNumber := executionAt + 1; runLoopBlocks; blockNumber++ { log.Info(fmt.Sprintf("[%s] Starting block %d (forkid %v)...", logPrefix, blockNumber, batchState.forkId)) logTicker.Reset(10 * time.Second) @@ -227,6 +226,7 @@ func SpawnSequencingStage( return err } } else if !batchState.isL1Recovery() { + var allConditionsOK bool batchState.blockState.transactionsForInclusion, allConditionsOK, err = getNextPoolTransactions(ctx, cfg, executionAt, batchState.forkId, batchState.yieldedTransactions) if err != nil { return err @@ -238,7 +238,6 @@ func SpawnSequencingStage( } else { time.Sleep(batchContext.cfg.zk.SequencerTimeoutOnEmptyTxPool / 5) // we do not need to sleep too long for txpool not ready } - } else { log.Trace(fmt.Sprintf("[%s] Yielded transactions from the pool", logPrefix), "txCount", len(batchState.blockState.transactionsForInclusion)) } diff --git a/zk/stages/stage_sequence_execute_data_stream.go b/zk/stages/stage_sequence_execute_data_stream.go index 6c04ce7be8b..20b59890797 100644 --- a/zk/stages/stage_sequence_execute_data_stream.go +++ b/zk/stages/stage_sequence_execute_data_stream.go @@ -107,7 +107,7 @@ func alignExecutionToDatastream(batchContext *BatchContext, batchState *BatchSta block, err := rawdb.ReadBlockByNumber(batchContext.sdb.tx, lastDatastreamBlock) if err != nil { - return true, err + return false, err } log.Warn(fmt.Sprintf("[%s] Unwinding due to a datastream gap", batchContext.s.LogPrefix()), "streamHeight", lastDatastreamBlock, "sequencerHeight", lastExecutedBlock)