Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

finish last block in batch based on block timing #1248

Merged
merged 1 commit into from
Sep 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions zk/stages/stage_sequence_execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,14 @@ func sequencingBatchStep(

log.Info(fmt.Sprintf("[%s] Starting batch %d...", logPrefix, batchState.batchNumber))

// once the batch ticker has ticked we need a signal to close the batch after the next block is done
batchTimedOut := false

for blockNumber := executionAt + 1; runLoopBlocks; blockNumber++ {
if batchTimedOut {
log.Debug(fmt.Sprintf("[%s] Closing batch due to timeout", logPrefix))
break
}
log.Info(fmt.Sprintf("[%s] Starting block %d (forkid %v)...", logPrefix, blockNumber, batchState.forkId))
logTicker.Reset(10 * time.Second)
blockTicker.Reset(cfg.zk.SequencerBlockSealTime)
Expand Down Expand Up @@ -314,8 +321,8 @@ func sequencingBatchStep(
}
case <-batchTicker.C:
if !batchState.isAnyRecovery() {
runLoopBlocks = false
break LOOP_TRANSACTIONS
log.Debug(fmt.Sprintf("[%s] Batch timeout reached", logPrefix))
batchTimedOut = true
}
default:
if batchState.isLimboRecovery() {
Expand Down
Loading