From 5b5cacb0277771fdda856a8547ce6741785875b5 Mon Sep 17 00:00:00 2001 From: Kamen Stoykov <24619432+kstoykov@users.noreply.github.com> Date: Fri, 27 Sep 2024 18:04:09 +0300 Subject: [PATCH] refactor(sequencer): organize ifs in the sequencer loop (#1244) --- zk/stages/stage_sequence_execute.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/zk/stages/stage_sequence_execute.go b/zk/stages/stage_sequence_execute.go index bad1c5efb65..a200d888e2b 100644 --- a/zk/stages/stage_sequence_execute.go +++ b/zk/stages/stage_sequence_execute.go @@ -325,7 +325,12 @@ func sequencingStageStep( if err != nil { return err } - } else if !batchState.isL1Recovery() && !batchState.isResequence() { + } else if batchState.isResequence() { + batchState.blockState.transactionsForInclusion, err = batchState.resequenceBatchJob.YieldNextBlockTransactions(zktx.DecodeTx) + if err != nil { + 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 { @@ -341,11 +346,6 @@ func sequencingStageStep( } else { log.Trace(fmt.Sprintf("[%s] Yielded transactions from the pool", logPrefix), "txCount", len(batchState.blockState.transactionsForInclusion)) } - } else if batchState.isResequence() { - batchState.blockState.transactionsForInclusion, err = batchState.resequenceBatchJob.YieldNextBlockTransactions(zktx.DecodeTx) - if err != nil { - return err - } } if len(batchState.blockState.transactionsForInclusion) == 0 {