fix(prover-node): do not abort in-flight proving jobs on a clean shutdown#24579
Draft
AztecBot wants to merge 1 commit into
Draft
fix(prover-node): do not abort in-flight proving jobs on a clean shutdown#24579AztecBot wants to merge 1 commit into
AztecBot wants to merge 1 commit into
Conversation
…down On a clean shutdown SessionManager cancels sessions with abortJobs=false, so the in-flight top-tree broker jobs are left in the broker for the restarted node to reuse instead of being aborted and re-proven. Reorg/supersede/deadline cancels still abort (their inputs are stale).
640550b to
41a8f66
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
v5 version of #24562 (based on
merge-train/spartan-v5). Stacked on #24578 — review/merge that first.Note: this is a fresh implementation, not a port — the v5 prover-node architecture differs from
next(it usesEpochSession/TopTreeJobrather thanEpochProvingJob/ProvingOrchestrator), which is the structure actually running on testnet.Problem
On a clean shutdown,
SessionManager.stop()cancels every live session with reason'prover-node stopping'. That flowsEpochSession.cancel→TopTreeJob.cancel()→topTree.cancel({ abortJobs: true })— theabortJobs: truewas hardcoded, so a deploy/restart aborted the in-flight top-tree broker jobs. Aborting on a clean restart is wasteful: the proofs are still valid, agents are mid-flight, and a restarted node re-orchestrating the same epoch produces the same deterministically-hashed job ids, so it re-proves from scratch.Fix
Thread an
abortJobsdecision from the cancel reason down to the broker:SessionManager.stop()cancels with{ abortJobs: false }— a clean shutdown preserves the jobs.EpochSession.cancel(reason, { abortJobs })forwards it toTopTreeJob.cancel(abortJobs)→topTree.cancel({ abortJobs }).abortJobs: true, since their inputs are stale.Composes with #24578: a clean redeploy mid-epoch neither cancels the in-flight jobs nor (if one ever were aborted) poisons them, so the epoch keeps proving across the restart.
Tests
session-manager.test.ts:stop()cancels every session withabortJobs: false.epoch-session.test.ts: a normal cancel forwardsabortJobs: trueto the top-tree orchestrator; a clean-shutdown cancel forwardsabortJobs: false.Note: not run locally in this session — the prover-node suite needs a full noir/wasm bootstrap that wasn't available here — so relied on CI.
Created by claudebox · group:
slackbot