Skip to content

Commit

Permalink
force not using executors in l1recovery mode (#1020)
Browse files Browse the repository at this point in the history
* speed up L1 recovery process (#1017)

* ensure batch isn't sealed early for any type of recovery

* force not using executors in l1recovery mode

---------

Co-authored-by: hexoscott <[email protected]>
Co-authored-by: Scott Fairclough <[email protected]>
  • Loading branch information
3 people authored Aug 26, 2024
1 parent 76eb1d3 commit 9ea1a4b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions zk/stages/stage_sequence_execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,15 +338,18 @@ func SpawnSequencingStage(
// add a check to the verifier and also check for responses
batchState.onBuiltBlock(blockNumber)

// commit block data here so it is accessible in other threads
if !batchState.isL1Recovery() {
// commit block data here so it is accessible in other threads
if errCommitAndStart := sdb.CommitAndStart(); errCommitAndStart != nil {
return errCommitAndStart
}
defer sdb.tx.Rollback()
}

cfg.legacyVerifier.StartAsyncVerification(batchState.forkId, batchState.batchNumber, block.Root(), batchCounters.CombineCollectorsNoChanges().UsedAsMap(), batchState.builtBlocks, batchState.hasExecutorForThisBatch, batchContext.cfg.zk.SequencerBatchVerificationTimeout)
// do not use remote executor in l1recovery mode
// if we need remote executor in l1 recovery then we must allow commit/start DB transactions
useExecutorForVerification := !batchState.isL1Recovery() && batchState.hasExecutorForThisBatch
cfg.legacyVerifier.StartAsyncVerification(batchState.forkId, batchState.batchNumber, block.Root(), batchCounters.CombineCollectorsNoChanges().UsedAsMap(), batchState.builtBlocks, useExecutorForVerification, batchContext.cfg.zk.SequencerBatchVerificationTimeout)

// check for new responses from the verifier
needsUnwind, err := updateStreamAndCheckRollback(batchContext, batchState, streamWriter, u)
Expand Down

0 comments on commit 9ea1a4b

Please sign in to comment.