Repository navigation
3.x.x: answer a share refused by the payout-revision fence stale-job, not ledger-confirmation-failed (#675) - #698
Conversation
… not ledger-confirmation-failed (#675) A share whose payout revision moves between its submit check and the append's read under ORDER_LOCK is refused by the append's fence before any write. Since #674 the refusal is a typed PayoutRevisionChanged, but it still reached the generic Failed arm and was answered ledger-confirmation-failed ("share was not confirmed by the database"), with a "share persistence failed" WARN. Its work was superseded, which the submit check itself answers stale-job a moment later; the ledger is healthy. persist_share_pass now maps that refusal to Superseded(PayoutRevision), beside the existing stale-authority gate mapping. The miner is answered stale-job (code 21, "stale job"), still never credited, and the payout_revision stale-job cause is counted once. A plain share's refusal is counted, not logged, like the submit check's. With capture off, a block-bearing share is refused the same way, and its found block is never offered, so a WARN names the lost block. The refusal no longer feeds PrismShareAppendFailures, which fired around every revision bump at production share rates. The load harness classes these refusals as expected landing races instead of backend refusals. The tests that pinned the old answer now pin stale-job, the cause count, and the absence of a persistence WARN. The rejection, metric and PayoutRevisionChanged docs say where the refusal is counted. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…e offer, unrelated to this diff Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Shard 0 of the first run (job 112083675126) failed Both miners found a block in that drill, and the node answered the held offer The same test passes locally at |
…y: its capacity budgets stop failing the suite (#695) ## Problem The scheduled weekly L3 (`prism-load-l3.yml`, suite `l3-reduced`) has failed three weeks running: 2026-10-26 (run 40326852601), 11-02 (run 41475045229) and 11-09 (run 42652897646). Each time only `mainnet-shape-2600-addresses-r1` failed, #695's known capacity ceiling: about 420/s against its 1,000/s target, tip-to-last-notify p99 above its 5 s budget, with harness exit 0 and exact reconciliation. "Collate the suite" then failed, so the weekly run could not flag a new regression. #555 decision 5 says the decision-7 points and the mainnet shapes in the reduced L3 are capacity-envelope points, not D1 verdicts. ## Change A suite may now name presets in `report_only` (`crates/qbit-prism-load/presets/suites.toml`); `l3-reduced` names one, `mainnet-shape-2600-addresses`. The preset's own gates and budgets are unchanged, and every other preset still gates. **What report-only exempts:** only the run's capacity budgets, which are its shortfall and every latency budget the preset sets (tip-to-last-notify p99 and median, churn tip delivery, new sessions' first job). **What it does not exempt:** everything else. A report-only run still fails the suite unless: - it reached its gate, meaning an artifact of this build's run of this preset from a clean tree, and a gate exit of 0 or 1; - the harness exited 0, meaning the run completed and reconciled exactly; - it has no durability finding; - every gated phase ran; - every tip was measured (a tip some session never got work on still fails); - unanswered submits are within the preset's budget; - refused valid shares in a gated phase are within the preset's budget, except refusals answered `share was not confirmed by the database` in a phase short of its rate (see below). **Refused valid shares and unanswered submits (follow-up to an independent verify).** The 20x preset first set both budgets to null, so the gate added neither check, and a valid-share refusal regression (the #716/#779 class) on it would have left the suite green. Now: - `mainnet-shape-2600-addresses` budgets both at 0. - History, read from each run's `gate.md` and `load-harness-report.json`: unanswered submits were 0 in all five runs of the preset (#695's dispatches 37403127199 and 37410760555 on 10-06, and the weekly runs 40326852601, 41475045229 and 42652897646). Refused valid shares in its gated phases were 34,670 and 2 on 10-06, 11,513 on 10-26, and 0 on 11-02 and 11-09. - On 10-26 every one was the server's answer when a share's commit deadline passes before COMMIT: `ledger-confirmation-failed`, `share was not confirmed by the database`. The frontend logs show `share commit deadline passed before COMMIT was sent` for each, bar three lock timeouts. That is how the append sheds load past its capacity, so a flat 0 would make the weekly run red on capacity again. - So, in a report-only run only, the collation sets aside exactly that answer, and only in a gated phase whose shortfall exceeds the preset's budget. Every other refused valid share stays gated at 0: that answer in a phase that kept its rate, `current chain state is unavailable` (the #716 class), `share outcome is not yet known`, `share was not committed because its commit gate closed`, and any refusal the phase counts that its rejection table doesn't explain. A phase with no shortfall, refusal count, rejection table or row count fails. - How many refusals were set aside is shown in the report-only line and the PASS verdict, and recorded per run as `refusals_set_aside` in `verdict.json`. - The matrix and the collation refuse a report-only preset with no budget (null, missing, not a u64) for refused valid shares or unanswered submits. - **What this cannot see:** the server sends the same answer for any failed ledger write. A ledger failure in a phase that is also short of its rate is therefore not gated on this point, and the shortfall is evidence of overload, not proof. The first 10-06 dispatch is an example: most of its refusals were #675's payout-revision fence answered as a ledger failure, fixed by #698. A distinct server answer for the commit deadline (qbit-prism-server) would close this. Among the gated presets in `l3-reduced`, only the three 400k points budget refused valid shares (0, `steady_state` only); the other mainnet shapes, session points and rental churn leave them unbudgeted, as before this PR. A run that loses or double-counts an acknowledged share, aborts, skips a phase or leaves no report fails the suite like any other. How each piece carries it: - **`scripts/prism_load_matrix.py`:** - Validates `report_only`: it names only the suite's own presets, each once, and leaves at least one preset gated. It never names a soak preset or a D1 cell, and `l3-full`, the suite a tag runs or promotes, takes none. - Every suite matrix entry carries `gated: true|false`. Non-suite selections (the nightly, a dispatch naming the preset) carry no `gated`, so the preset run on its own is held to its gates as before. - **`.github/workflows/prism-load-l3.yml`:** - Only the "Run and gate the preset" step is `continue-on-error` for a report-only entry. The test is `toJSON(matrix.gated) == 'false'`, because Actions' loose equality makes a missing `gated` equal `false`. - The next step leaves the job green only when the harness exited 0 and the gate gave a verdict of fail, and then adds a `::warning::` and a summary line. A harness failure or a gate with no verdict fails the job. - Checkout, install, download, upload and timeout failures still fail the job. - **`crates/qbit-prism-load/src/collate.rs`** (the `qbit-prism-load-compare --collate` summarizer): - `PlanEntry.gated` defaults to true, so older plans and verdicts parse unchanged. A plan that gates no run, gates some repeats of a preset and not others, or runs a soak or D1 preset report-only is refused. - A report-only run is re-evaluated with `capacity_exempt` budgets: shortfall unbounded, any latency budget the preset sets made infinite, every other budget the preset's. A budget added to the gate later is not opened until it is listed, so the default fails closed. Refused valid shares are judged by `refused_beyond_overload` (above). The run fails the suite on any check that still fails. - In the Markdown, the report-only run stays in every table with its numbers and shortfall. It is labelled `report-only, not gated` in its preset cell, its runs-table gate cell, its D1 cell (which keeps its own text behind the label) and the gates table. A line above the tables says plainly what is and is not exempt. It is never shown as a pass. - `verdict.json` keeps schema v1 and adds `gated_runs` plus, per run, `gated` and `holds_suite`. `complete` is again every planned run reaching its gate. `passed` means every gated run passed and every report-only run held every check but its capacity budgets. - **`scripts/prism_l3_promote.py`:** refuses to promote a verdict whose `gated_runs` is not `planned`, so a tag never carries a partly report-only suite. - **Docs:** `docs/prism-e2e-load-ci.md`, `crates/qbit-prism-load/README.md`, `docs/prism-release-benchmark.md`, the suites.toml header, the `compare_main.rs` doc comment, and the `mainnet-shapes-reduced-l3` scenario in `test/e2e-scenarios.toml`. **Rollout:** schedules run from `main`'s copy of the workflow. Once this lands on `3.x.x`, the weekly "Collate the suite" job passes, because the plan and the collator come from `3.x.x`. But `main`'s workflow has no `continue-on-error`, so the 20x job, and with it the run's overall conclusion, stays red until this workflow change reaches `main`. Main's old final step also prints "every planned run reached its gate and passed it" on that interim run. Both are documented in docs/prism-e2e-load-ci.md. ## Tests run - `cargo test --locked --offline -p qbit-prism-load --test collate`: 14 passed. New in the follow-up: `a_report_only_run_sets_aside_only_its_commit_deadlines_refusals`. The 10-26 shape passes the suite and records 11,513 set aside. The suite fails on the #716 class, a closed commit gate, a refusal the table doesn't explain or the phase doesn't count, the answer in a phase that kept up, a missing shortfall, a missing rejection table, a row with no count, and an unanswered submit. `a_malformed_plan_is_refused` also refuses a report-only preset with null budgets. Earlier cases: - a report-only run's failed budgets are shown and labelled but don't fail the suite; - a gated failure still fails a suite that has a report-only point; - a report-only run fails the suite on harness exit 4 with a durability finding, on a missing gated phase, on an unmeasured tip, and when it never reached its gate (no artifact, or gate exit 2); - a report-only failure is named even when a gated run never ran; - plan validation: no `gated` reads as gated; zero gated runs, mixed gating within a preset, and soak or D1 report-only presets are refused, by both `read_plan` and `collate`. - `cargo test --locked --offline -p qbit-prism-load --test realism`: 24 passed. - `python3 -m unittest tests.test_prism_load_matrix tests.test_prism_l3_promote tests.test_check_e2e_scenarios`: 58 passed. The follow-up adds: the 20x preset budgets both at 0, and a report-only preset whose correctness budget is null, missing, negative, above u64, a bool, a float or a string is refused. Earlier cases: - only the 20x shape is report-only in `l3-reduced`, and `l3-full` gates every run; - a preset run on its own carries no `gated`; - malformed `report_only` is refused: not a list, outside the suite, repeated, nothing left gated, a soak, a D1 cell, or in `l3-full`; - promotion accepts a fully gated verdict and refuses a partly report-only one. - `python3 scripts/check_e2e_scenarios.py`: passes. - `python3 scripts/prism_load_matrix.py suite:l3-reduced`: only `mainnet-shape-2600-addresses-r1` has `gated: false`. - `cargo fmt --all -- --check`: clean. - `cargo clippy --locked -p qbit-prism-load --all-targets -- -D warnings`: clean apart from the three known vendored sqlx-core warnings. - The workflow YAML parses. actionlint was not available locally. ## What CI must cover - actionlint and shellcheck on `prism-load-l3.yml`. - The workspace and Python suites. This PR changes no VERSION, so L3 itself won't run here. A dispatch of the L3 workflow from this branch (`--ref` this branch, `suite` `l3-reduced`, `ref` this branch) would exercise the report-only path end to end, at about $13 of runner time; it is the operator's call. Otherwise the first weekly run after this reaches `main` shows it. Refs #695. Refs #555 (decision 5). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Squashed commits: 255a075 3.x.x: the weekly reduced L3 measures the 20x growth shape report-only, outside the suite verdict (#695) 0d8b00e 3.x.x: a report-only L3 run is exempt from its budgets only, never from completing and reconciling (#695) c4588de 3.x.x: a report-only L3 run is held to every check but its capacity budgets (#695) b65c215 3.x.x: report_only never names a soak preset or a D1 cell, and l3-full takes none (#695) 86c1fdd Merge remote-tracking branch 'origin/3.x.x' into orca/695-l3-capacity-point-report-only 891a5a4 3.x.x: a report-only L3 point still gates refused valid shares and unanswered submits (#695) 79ad501 3.x.x: set aside a report-only point's ledger refusals only in a phase short of its rate (#695) fcbc9e3 3.x.x: say and record how many refusals a report-only point set aside (#695) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Fixes #675 (close by hand: the base is not the default branch).
What changes
A share whose payout revision moves between its submit check and the append's read under
ORDER_LOCKis refused by the append's fence before any write. Since #674 that refusal is a typedPayoutRevisionChanged. It still fell through to the genericFailedarm, so it was answeredledger-confirmation-failed("share was not confirmed by the database") with ashare persistence failedWARN, even though the ledger is healthy and the share's work was simply superseded.persist_share_passnow maps that refusal toSaveOutcome::Superseded(StaleJobCause::PayoutRevision). It sits beside the existing mapping of a stale-authority commit gate toStale, sosubmit_shareanswers it through the arm it already has for superseded work.Miners: the answer is code 21
stale-job("stale job") instead of code 20ledger-confirmation-failed. It is the same answer the submit check gives superseded work a moment later. The share is still never credited, and nothing is written either way.Metrics:
qbit_prism_stale_job_rejections_total{cause="payout_revision"}counts the refusal once.qbit_prism_rejections_totalcounts it understale-job.docs/prism-rejections.md: rejections are counted, never logged per share).Capture off (
PRISM_CAPTURE_OVERPAY_CEILING_BPS=0): a block-bearing share is refused the same way, as the submit check refuses one, and its found block is never offered. A WARN names the lost block, since the old persistence WARN was its only trace.PrismShareAppendFailures(warning, anyledger-confirmation-failed|ledger-outcome-unknownin 5 min) no longer sees these refusals. Every revision bump refuses the shares in flight: each network tip change, own-block landing and maturity. At production share rates the rule would otherwise fire almost continuously and hide real append failures (3.x.x: the clock-jump nightly fails when a held landing's payout-revision bump races the next phase's first share (ledger-confirmation-failed) #656, 3.x.x: transcript replay fails when a payout-revision change refuses a share mid-commit (ledger-confirmation-failed) #632 and the clock-jump nightly all saw it).The stale-job ratio rules gain only the shares in flight between the submit check and the fence at each bump:
PrismRejectRatioByReasonHigh(5% per reason);PrismPoolResubmissionRejectRatioHigh(5% of the pool, which already countsstale-job).That is well under 1% of decisions even with a 2 s
ORDER_LOCKhold during a landing, and those refusals are the "work superseded after a stall" rejections the pool rule exists for. No threshold changes.Load harness: it already classes
stale-job/stale jobas an expected race and as the landing's cost, so these refusals leaverejected_valid_sharesand the backend-refusal counts in D1 and soak reports. The live transcript replay already re-solves astale-jobrefusal (STALE_RETRIES), so 3.x.x: transcript replay fails when a payout-revision change refuses a share mid-commit (ledger-confirmation-failed) #632's race no longer fails it outright.Not changed
The fence still refuses before the append's duplicate probe, as on the base. So an identical share that is already credited and races a bump is answered
stale-jobhere, where the base answeredledger-confirmation-failed. It was neverduplicate-share. Both labels sit inPrismPoolResubmissionRejectRatioHigh's numerator, and nothing is credited either way.Tests
payout_revisioncause, and the absence of the persistence WARN (and, for a block-bearing share with capture off, the lost-block WARN naming its hash):miner_tests::fence_capture: the plain share and the capture-off block;miner_tests::interleavings::cross_frontend_revision_change_before_append_cannot_ack_or_credit;miner_tests::admission_races::newer_same_parent_publication_cannot_lend_its_lease_to_an_older_payout;commit_reconcile_testsfor the plain share and the capture-off block.tests/live_regtest.rsandtests/candidate_window_qualification.rs, which describe this refusal.docs/prism-rejections.md: thestale-jobandledger-confirmation-failedrows, and thepayout_revisioncause;docs/prism-native-metrics.mdand its metadata, regenerated withscripts/generate_prism_metrics.py;PayoutRevisionChangeddoc comment.Local runs, at 3.x.x
c95febb3plus this change, against PostgreSQL 16.10:cargo test -p qbit-prism-server --lib: 674 passed, withPRISM_TEST_REQUIRE_INTEGRATION=1.tools::configuration_testsfailed once withcurrent_exeNotFound, because the test binary was rebuilt under them mid-run. Both pass on rerun.cargo clippy -p qbit-prism-server --all-targets -- -D warnings,cargo fmt --all --checkandscripts/generate_prism_metrics.py --check: clean.This is product code. It adds no migration and no setting.
🤖 Generated with Claude Code