diff --git a/zk/legacy_executor_verifier/legacy_executor_verifier.go b/zk/legacy_executor_verifier/legacy_executor_verifier.go index 7084d33aefe..b7392822d1a 100644 --- a/zk/legacy_executor_verifier/legacy_executor_verifier.go +++ b/zk/legacy_executor_verifier/legacy_executor_verifier.go @@ -227,20 +227,6 @@ func (v *LegacyExecutorVerifier) VerifyAsync(request *VerifierRequest) *Promise[ verifierBundle := NewVerifierBundle(request, nil, false) blockNumbers := verifierBundle.Request.BlockNumbers - e := v.GetNextOnlineAvailableExecutor() - if e == nil { - return verifierBundle, ErrNoExecutorAvailable - } - - t := utils.StartTimer("legacy-executor-verifier", "verify-async") - defer t.LogTimer() - - e.AquireAccess() - defer e.ReleaseAccess() - if v.cancelAllVerifications.Load() { - return nil, ErrPromiseCancelled - } - var err error ctx := context.Background() // mapmutation has some issue with us not having a quit channel on the context call to `Done` so @@ -300,6 +286,20 @@ func (v *LegacyExecutorVerifier) VerifyAsync(request *VerifierRequest) *Promise[ verifierBundle.markAsreadyForSendingRequest() + e := v.GetNextOnlineAvailableExecutor() + if e == nil { + return verifierBundle, ErrNoExecutorAvailable + } + + t := utils.StartTimer("legacy-executor-verifier", "verify-async") + defer t.LogTimer() + + e.AquireAccess() + defer e.ReleaseAccess() + if v.cancelAllVerifications.Load() { + return nil, ErrPromiseCancelled + } + ok, executorResponse, executorErr, generalErr := e.Verify(payload, request, previousBlock.Root()) if generalErr != nil { return verifierBundle, generalErr