Skip to content

Commit

Permalink
Merge branch 'resequence' into banana
Browse files Browse the repository at this point in the history
  • Loading branch information
cffls committed Sep 13, 2024
2 parents 802afd4 + ed27ecc commit 7cef229
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions zk/legacy_executor_verifier/legacy_executor_verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,13 @@ func (v *LegacyExecutorVerifier) VerifyWithoutExecutor(request *VerifierRequest)
return promise
}

func (v *LegacyExecutorVerifier) HasPendingVerifications() bool {
v.mtxPromises.Lock()
defer v.mtxPromises.Unlock()

return len(v.promises) > 0
}

func (v *LegacyExecutorVerifier) ProcessResultsSequentially(logPrefix string) ([]*VerifierBundle, error) {
v.mtxPromises.Lock()
defer v.mtxPromises.Unlock()
Expand Down
5 changes: 5 additions & 0 deletions zk/stages/stage_sequence_execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,11 @@ func sequencingStageStep(

if batchState.isResequence() {
if !batchState.resequenceBatchJob.HasMoreBlockToProcess() {
for streamWriter.legacyVerifier.HasPendingVerifications() {
streamWriter.CommitNewUpdates()
time.Sleep(1 * time.Second)
}

runLoopBlocks = false
break
}
Expand Down

0 comments on commit 7cef229

Please sign in to comment.