Skip to content

Commit

Permalink
refactor(sequencer): organize ifs in the sequencer loop (#1244)
Browse files Browse the repository at this point in the history
  • Loading branch information
kstoykov authored Sep 27, 2024
1 parent b650ff6 commit 5b5cacb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions zk/stages/stage_sequence_execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down

0 comments on commit 5b5cacb

Please sign in to comment.