fix(prover-node): report awaiting-root and publishing-proof phases in EpochSession (A-1212)#24216
Draft
PhilWindle wants to merge 2 commits into
Conversation
… EpochSession (A-1212) EpochSession only ever set initialized, awaiting-checkpoints and terminal states, so prover_getJobs showed a session as awaiting-checkpoints continuously while it was actually proving the top tree or publishing to L1 — a regression vs the old EpochProvingJob, which advanced through distinct phases. - Add a new non-terminal awaiting-root state to EpochProvingJobState. - Set awaiting-root when the top-tree (root) prove begins, via the TopTreeJob beforeProve hook (fires once the sub-tree block proofs are ready). toTopTreeHooks now always wires this, layering any test-provided hooks on top. - Set publishing-proof at the top of submitProof, before the L1 submit. Both transitions are guarded by isTerminal() so a concurrent cancel() still wins. Phase progression is now initialized -> awaiting-checkpoints -> awaiting-root -> publishing-proof -> terminal. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…chSession lifecycle (A-1212) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Fixes A-1212.
Problem
prover_getJobsexposes eachEpochSession's state, butEpochSessiononly ever assignedinitialized,awaiting-checkpoints, and the terminal states. The intermediate phases that exist to describe active work were never set, so a session readawaiting-checkpointscontinuously while it was actually (a) proving the top tree or (b) publishing to L1. Observed on staging-internal: everystartProofsession sat inawaiting-checkpointseven with logs showingStarting top-tree prove…. This is a regression vs the oldEpochProvingJob, which advanced through distinct phases.Fix
awaiting-rootstate toEpochProvingJobState(the zod schema is derived from the same array, so it updates automatically). Not added toEpochProvingJobTerminalState.awaiting-rootwhen the top-tree (root) prove begins, via theTopTreeJobbeforeProvehook — which fires once the sub-tree (checkpoint block) proofs are ready and the root prove is about to start.toTopTreeHooks()now always wires this transition and layers any test-provided hooks on top (previously it returnedundefinedwhen no test hooks were set).publishing-proofat the top ofsubmitProof(), before the L1 submit.Both transitions are guarded by
isTerminal()so a concurrentcancel()still wins (the post-submitisTerminal()check relies on this).Phase progression is now:
initialized → awaiting-checkpoints → awaiting-root → publishing-proof → terminal.Tests
epoch-session.test.ts: new "state reporting" test assertsgetState()isawaiting-rootduring the prove andpublishing-proofduring the submit, thencompleted. Existing hook-ordering test (before/prove/after) still holds.prover-node.test.ts: the JSON-RPC schema round-trip mock now includes anawaiting-rootjob.Targets the v5 line — the
EpochSession/TopTreeJob/awaiting-checkpointscode (post-#23552) exists only onmerge-train/spartan-v5.