feat(proof): continuous leaf emitter with ChallengeInternal cover - #256
Merged
Conversation
Wire ProofEmitter at the bounty 120s cadence so D24 can seal without weights-smoke NoScore pre-cover for challenge-id proof. Co-authored-by: Mathis <echobt@users.noreply.github.com>
Co-authored-by: Mathis <echobt@users.noreply.github.com>
Greptile SummaryThis PR wires continuous Proof leaf emission into the running challenge service and adds defense-in-depth against replacing earned scores with burn leaves.
Confidence Score: 5/5Safe to merge. No outstanding findings remain. The previously reported restart behavior is fully fixed: the scored-epoch watermark is persisted after scoring and restored at startup, and the gateway rejects a ChallengeInternal burn that would replace a positive leaf. Reviews (5): Last reviewed commit: "Merge branch 'main' into cursor/proof-le..." | Re-trigger Greptile |
Contributor
Author
Hold scored leaves across proof-challenge restarts via PROOF_SCORED_EPOCH_FILE, and refuse ChallengeInternal from replacing a positive raw-weight leaf at the gateway store. Co-authored-by: Mathis <echobt@users.noreply.github.com>
1 similar comment
Contributor
Author
Contributor
Author
echobt
marked this pull request as ready for review
September 9, 2026 22:40
7 tasks
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.
Summary
Adds a continuous Proof leaf emitter so D24 seal no longer depends on
prod-real-seal.shweights-smokeNoScorepre-cover for challenge-idproof.ProofEmittermirrors bounty emit cadence (120s,PROOF_EMIT_POLL_SECS/--emit-poll-secs):Eviagather_schedule_state+expected_set_at_chainat the last epoch block.emission_scores→emit_signed_leaf_set(..., b\"proof\", ...)→submit_signed_leaf_set.scored_epoch < epoch: cover all ofEwithNoScore(ChallengeInternal)(notNotAttempted) so the 8000 bps burns to uid 0 while D24 completeness still holds.scored_epoch >= epochand this tick would burn: Held — do not overwrite scored leaves.P1 (restart must not burn):
scored_epochis persisted toPROOF_SCORED_EPOCH_FILE(/var/lib/proof/scored_epochon the artefacts volume). Independently, the gateway store refuses aChallengeInternalburn from replacing a positive leaf for the same(challenge_id, epoch, miner_hotkey)(409, original kept; race-safe in both memory andupsert_raw_weight_tip). Score-to-score and burn-to-score supersede are unchanged.Missing
BASE_CHALLENGE_SK_FILEwarns and skips the loop (/healthstill comes up).prod-real-seal.shpre-cover is not removed.Greptile
@greptileaiTest plan
cargo test -p proof-challenge --all-targets(scored / burn / held / restart-with-watermark / ChallengeInternal-not-NotAttempted)cargo test -p proof-challenge-bin(no SK → None; with SK → Some; scored-epoch file default; existing bin tests)cargo test -p gateway --test raw_weights(S6: ChallengeInternal over score → 409)cargo clippy -p proof-challenge -p proof-challenge-bin -p gateway -p gateway-core -p gateway-store-pg -p db --all-targets -- -D warningscargo run -p xtask -- loc-cap(crates/proof-challenge442,bins/proof-challenge700)cargo run -p xtask -- spec-check design-check external-docs-checkRisk
Emission impact: Proof now posts exact-
Eleaves on its own. An empty store coversEwithChallengeInternal(same D24-complete burn bounty uses when the feed is down). A restart after a scored epoch holds instead of burning. Bounty code is unchanged. Challenge signing domain staysb\"proof\".BASE_*names andprod-real-seal.share untouched.Naming
I did not rename
BASE_*environment variables, deployed host paths(
/opt/base,/run/base, …), GHCRbaseintelligence/basepackage names, orbase-*-v1cryptographic domain tags, unless this PR’s purpose is a coordinatedcutover documented in
docs/NAMING.md.