From 51d0f9fbe85e2dcf09ba73e2d3df955d9f65f312 Mon Sep 17 00:00:00 2001 From: Kamen Stoykov <24619432+kstoykov@users.noreply.github.com> Date: Mon, 26 Aug 2024 13:26:28 +0300 Subject: [PATCH] force not using executors in l1recovery mode (#1020) * 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 <70711990+hexoscott@users.noreply.github.com> Co-authored-by: Scott Fairclough --- zk/stages/stage_sequence_execute.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/zk/stages/stage_sequence_execute.go b/zk/stages/stage_sequence_execute.go index bc51041c734..361d43dc123 100644 --- a/zk/stages/stage_sequence_execute.go +++ b/zk/stages/stage_sequence_execute.go @@ -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)