Repository navigation
3.x.x: settle load runs through CTV fanout with --ctv-settlement, and count each landed block's direct, fanout and carried recipients (#548) - #644
Merged
Conversation
… count each landed block's direct, fanout and carried recipients (#548) The harness launched every frontend with PRISM_CTV_SETTLEMENT_ENABLED=0, so no load run ever built a CTV fanout and the direct-to-fanout split mainnet runs was never exercised under load. #555's 10,000-recipient point (ten fanout chunks per block) waits on it. --ctv-settlement sets the three CTV keys mainnet-compose.env pins (settlement on, an explicit 1,000 bits/1,000 weight market rate, the 1.2x premium) through the one launch composition, leaves the broadcaster off and the settlement shape at the server's defaults. Off, the environment is byte-for-byte what it was (the pr-smoke golden is unchanged). The explicit rate means no frontend needs estimatesmartfee, which a regtest node cannot answer; the fake node's relay floor is the same rate. Every checked-in preset pins the flag false, so each preset's sha256 changes once. The side report gains a settlement block, flag on or off: for every block the node accepted, the miner recipients the server's landing paid directly, through fanout, and carried, read from qbit_payout_carry_forward and the fanout artifacts' manifest outputs, which the landing writes in one transaction. A landed block with no fanout is a measured 0; an accepted block with no landing, or with fanout chunks whose outputs cannot be read, is listed as unmeasured; a failed read leaves the counts null. A block with any fanout chunk whose manifest lists no readable output is unmeasured, not only one whose chunks list none between them, and the totals break the measured blocks down by chain_state, since a block landed and later reorged still settled. #554's two new fault presets pin the flag false too. A new gated test runs the fake node with 400 addresses, no pool fee and the flag on, and checks 12 direct recipients (with a fee, the fee holds a direct slot) and the rest in one chunk. 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. |
This was referenced Oct 1, 2026
kiwidream
added a commit
that referenced
this pull request
Oct 1, 2026
…offer, and stop issuing that work after an async promotion (#619) Rebased onto 3.x.x 3f1fba6 (#642, #644) as one commit. It squashes the series that was PR #645's head 60efddd: - 263e4cd reproduce blocks on gap-issued work after an async promotion without qbitd, and weigh the options - 37b1af7 require the mode 2 reproduction's new session to be issued readable work, not just any refusal - 2fa8c80 refuse a block on work from a lost replication gap before its offer, and stop issuing that work after an async promotion - 850547e document the refusal: the accepted D3 loss, the runbook for an already-offered block, and the decided design - 7d229ac assert each test's outcome before its metric checks - e7468f4 record the before/after runs in the design note - c0a8018 tag work with the scan's timeline, name window_not_held in deferrals, count late refusals once, and pin the probe-error, out-of-order and clock cases - 60efddd state the clock precondition and correct the runbook Before a candidate is enqueued, the enqueue transaction checks that the writer still holds the candidate's PPLNS window: the window's last share row must exist and must be the window's own row. If it does not, the block is refused as stale-job (window_not_held) and is never offered. Prepared work is tagged with the writer timeline (#466's expression, read in the scan transaction), so a promotion retires it, and issuance authority refuses a window the promoted writer no longer holds. The repair path and save_compact_prepared now require the endpoint to be the window's own row, not just any row with that share_seq. Every b619 reproduction now passes and is gated. The only conflict was the cardinality pins: they become 77 families, 305 startup series and 956 populated series. These are 3.x.x's new families and series plus this series' own. Co-Authored-By: Claude Opus 5.5 <[email protected]>
kiwidream
added a commit
that referenced
this pull request
Oct 1, 2026
…offer, and stop issuing that work after an async promotion (#619) (#645) * 3.x.x: refuse a block on work from a lost replication gap before its offer, and stop issuing that work after an async promotion (#619) Rebased onto 3.x.x 3f1fba6 (#642, #644) as one commit. It squashes the series that was PR #645's head 60efddd: - 263e4cd reproduce blocks on gap-issued work after an async promotion without qbitd, and weigh the options - 37b1af7 require the mode 2 reproduction's new session to be issued readable work, not just any refusal - 2fa8c80 refuse a block on work from a lost replication gap before its offer, and stop issuing that work after an async promotion - 850547e document the refusal: the accepted D3 loss, the runbook for an already-offered block, and the decided design - 7d229ac assert each test's outcome before its metric checks - e7468f4 record the before/after runs in the design note - c0a8018 tag work with the scan's timeline, name window_not_held in deferrals, count late refusals once, and pin the probe-error, out-of-order and clock cases - 60efddd state the clock precondition and correct the runbook Before a candidate is enqueued, the enqueue transaction checks that the writer still holds the candidate's PPLNS window: the window's last share row must exist and must be the window's own row. If it does not, the block is refused as stale-job (window_not_held) and is never offered. Prepared work is tagged with the writer timeline (#466's expression, read in the scan transaction), so a promotion retires it, and issuance authority refuses a window the promoted writer no longer holds. The repair path and save_compact_prepared now require the endpoint to be the window's own row, not just any row with that share_seq. Every b619 reproduction now passes and is gated. The only conflict was the cardinality pins: they become 77 families, 305 startup series and 956 populated series. These are 3.x.x's new families and series plus this series' own. Co-Authored-By: Claude Opus 5.5 <[email protected]> * 3.x.x: classify #619's two pool checkouts, and pin the refusal at enqueue of a window that reaches past its anchor (#619) CI on 384eb2a failed two checks for this PR's own reasons. - The pool-acquire guard needs every checkout classified. Two new sites are classified "ledger" (delegated), like the existing Ledger::acquire sites: the landing's window probe in coordinator.rs::rebuild_claim_parts, and WorkLedger::window_held. - audit_body_normalization's durable-range test built a window that ends with a share accepted after the anchor. It expected the landing's proof to refuse that window. The enqueue's #619 check now refuses it first, because the last row is not held at the anchor. The case now asserts that refusal: it is typed WindowNotHeld for the block and its last share_seq, nothing is pending, and no block or audit row is written. The other three cases still reach the landing's proof. Share history is immutable, so a candidate enqueued before this check existed cannot be built to reach the proof's final count. Co-Authored-By: Claude Opus 5.5 <[email protected]> * 3.x.x: list #619's two gated lib tests in the expected gate list (#619) The gate proof on 5c261ad found two gated tests that ran but are not in test/prism-gated-tests.txt. Both are lib tests from the #619 review round: - coordinator::miner_submit::acquire_tests:: a_failed_window_probe_is_unknown_never_stale_and_enqueues_nothing - ledger::window::payout_state::tests:: a_snapshot_reads_its_writer_timeline_in_the_transaction_that_reads_its_rows The list now holds 804 tests, the same number the proof saw run. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
2 tasks
RobertClarke
added a commit
that referenced
this pull request
Oct 6, 2026
…count to the distinct sessions holding work, refuse a phase reported incomplete, and let a build older than #548 run with CTV settlement off (#511) Addresses Codex's three open findings on 146f601, and the merge of 3.x.x. A pinned count is now a count of distinct entries. The external tips (`time_to_usable_work.tips`, by `tip`), the churn tips delivered (`churn.tip_delivery.tips`, by `tip`) and the own blocks landed (accepted `node.submissions`, by `block_hash`) each count an entry once, by its name. A list padded with one tip repeated to the pinned length fails, as does an entry that names nothing. Genuine reports list distinct entries: each tip is a new block, and a node answers a block it already holds as a duplicate, never accepted again. The harness now reports the distinct count its start-up gate read, `client.sessions_holding_work_at_start`. The comparator holds every run that reports it to the pinned `--sessions`. `client.connects` counts reconnects and rentals too, so 1,988 sessions and the D1 plan's 12 reconnects reached 2,000. It stands in only for a harness older than the count, and tests/load_smoke.rs pins the count so a newer harness cannot drop it unnoticed. A planned phase must report `completed: true` (every harness since #271 does). A phase an abort cut in its last 5% was within the length tolerance, and a run whose exit code missed the abort still counted. #644 pinned `--ctv-settlement: false` in every preset, and 5d0042f's harness has no such flag. legacy-flags.json now records that builds before #548 (3f1fba6) launched every frontend with CTV settlement off, so the release presets still resolve against 5d0042f. Co-Authored-By: Claude Opus 5.5 <[email protected]>
RobertClarke
added a commit
that referenced
this pull request
Oct 6, 2026
… preset flags, and document L3 in the lanes page (#550) #608 was stacked on an earlier #564. Since then #564's `compare::Build` gained `predates_report_fields`. A collation summarizes one build, the plan's commit, which predates no report field, so the list is empty. 3.x.x added two result flags every checked-in preset must pin: `--ctv-settlement` (#644) and `--faults` (#623). The three new presets pin `false` and `null`, as the presets they derive from do, so each differs from its source only in `--cadence` and `--scheduled-blocks` (and the dense 1-frontend cell in its runner and schedule). docs/prism-e2e-load-ci.md did not exist on #608's base. It now has #626's L3 section: the lane table's row, the suites and triggers, what L3 proves and does not, the dispatch commands and the evidence rows. One correction to the draft: dispatch, like the weekly schedule, needs the workflow file on `main`, so the status says L3 runs on pull requests and tags until the file is mirrored there. Co-Authored-By: Claude Opus 5.5 <[email protected]>
RobertClarke
added a commit
that referenced
this pull request
Oct 6, 2026
… them in the lanes page, and note that #548 has landed (#555) 3.x.x added two result flags every checked-in preset must pin: `--ctv-settlement` (#644) and `--faults` (#623). The two session points pin `false` and `null`, as `throughput-400k-window-2fe-async` does, so they still differ from it only in `--sessions` and `--stratum-max-pending-initial-jobs`. #548 (CTV fanout settlement in the harness) landed as #644. The 10,000-recipient point still has no preset, but the README, the suite comment and the scenario manifest now say it can be written with `--ctv-settlement` on, rather than that it waits on #548. The 50,000-recipient trigger is evaluated once that preset runs. docs/prism-e2e-load-ci.md gets #626's parts for this change: the `l3-reduced` row's nine presets, its cost of about 200 runner-minutes a week, and the capacity-envelope paragraph. Co-Authored-By: Claude Opus 5.5 <[email protected]>
RobertClarke
added a commit
that referenced
this pull request
Oct 6, 2026
… preset flags, and document L3 in the lanes page (#550) #608 was stacked on an earlier #564. Since then #564's `compare::Build` gained `predates_report_fields`. A collation summarizes one build, the plan's commit, which predates no report field, so the list is empty. 3.x.x added two result flags every checked-in preset must pin: `--ctv-settlement` (#644) and `--faults` (#623). The three new presets pin `false` and `null`, as the presets they derive from do, so each differs from its source only in `--cadence` and `--scheduled-blocks` (and the dense 1-frontend cell in its runner and schedule). docs/prism-e2e-load-ci.md did not exist on #608's base. It now has #626's L3 section: the lane table's row, the suites and triggers, what L3 proves and does not, the dispatch commands and the evidence rows. One correction to the draft: dispatch, like the weekly schedule, needs the workflow file on `main`, so the status says L3 runs on pull requests and tags until the file is mirrored there. Co-Authored-By: Claude Opus 5.5 <[email protected]>
RobertClarke
pushed a commit
that referenced
this pull request
Oct 6, 2026
…didate, v* tags and weekly (#550) (#608) Refs #550 (S5 of #487). prism-load-l3.yml runs #447's production-window matrix as checked-in suites (crates/qbit-prism-load/presets/suites.toml): - l3-full: 11 cells x 3 repeats on the 32 vCPU class. It runs on a same-repository PR that changes VERSION, on the release-candidate label, on a v* tag and on dispatch. - l3-reduced: 400k at 1, 2 and 4 frontends, weekly on 3.x.x. #473's found-block and dense-cadence cells become presets. qbit-prism-load-compare --collate renders one build's suite into #473's tables with #511's summarizer. It writes a complete/passed verdict, and lists any missing, foreign or edited run as failing the suite rather than dropping it. A tag promotes the newest finished same-repository PR run of l3-full whose verdict is complete for the tagged tree (scripts/prism_l3_promote.py), and carries that verdict; otherwise it runs the suite. check_e2e_scenarios.py gains a suites evidence key beside 3.x.x's lane_checks. Taken over per #626 and restacked onto 3.x.x after #564. The new presets pin --ctv-settlement false and --faults null, as every preset must since #644 and #623. collate fills #564's predates_report_fields. docs/prism-e2e-load-ci.md gets #626's L3 section, which notes that dispatch and the weekly run need the file on main. Spend: once this is on 3.x.x, a v* tag or a VERSION-changing PR starts l3-full (about $42); the coordinator accepted that for the release-candidate bump. Co-Authored-By: Claude Opus 5.5 <[email protected]>
RobertClarke
added a commit
that referenced
this pull request
Oct 6, 2026
… them in the lanes page, and note that #548 has landed (#555) 3.x.x added two result flags every checked-in preset must pin: `--ctv-settlement` (#644) and `--faults` (#623). The two session points pin `false` and `null`, as `throughput-400k-window-2fe-async` does, so they still differ from it only in `--sessions` and `--stratum-max-pending-initial-jobs`. #548 (CTV fanout settlement in the harness) landed as #644. The 10,000-recipient point still has no preset, but the README, the suite comment and the scenario manifest now say it can be written with `--ctv-settlement` on, rather than that it waits on #548. The 50,000-recipient trigger is evaluated once that preset runs. docs/prism-e2e-load-ci.md gets #626's parts for this change: the `l3-reduced` row's nine presets, its cost of about 200 runner-minutes a week, and the capacity-envelope paragraph. Co-Authored-By: Claude Opus 5.5 <[email protected]>
RobertClarke
pushed a commit
that referenced
this pull request
Oct 6, 2026
…reduced L3 (#555) (#614) Refs #555 (S17 of #487), part a. The weekly l3-reduced suite now also runs #555's session points and #521's mainnet shapes, nine jobs a week on the 32 vCPU class: - session-point-5000- and session-point-10000-sessions-400k-2fe-async: throughput-400k-window-2fe-async at 5,000 and 10,000 sessions, with admission at sessions per frontend + 16. A test holds them to differ in exactly those two flags. They are capacity-envelope points, not D1 verdicts: they gate reconciliation and steady_state shortfall. Refused and unanswered shares are reported, not gated. - mainnet-shape-{130,650,2600}-addresses and rental-churn-bursts-and-storms. The manifest marks session-points and mainnet-shapes-reduced-l3 as running. The 50,000-recipient trigger is written down in the README: the 10,000-recipient point costing more than 25% more per recipient than the 1,000-recipient run. That point still has no preset; since #548 (#644) it can be written with --ctv-settlement on. Taken over per #626 and restacked onto 3.x.x after #608. Both presets pin --ctv-settlement false and --faults null. docs/prism-e2e-load-ci.md gets #626's l3-reduced row, cost and capacity-envelope paragraph. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Closes #548.
Problem
The load harness launched every frontend with
PRISM_CTV_SETTLEMENT_ENABLED=0. So every load run paid miners directly in the coinbase and never built a CTV fanout, while mainnet (tests/fixtures/mainnet-compose.env) runs with CTV on. #555's 10,000-recipient point (ten fanout chunks per block) needs the direct-to-fanout split under load.Change
--ctv-settlement. Every frontend getsPRISM_CTV_SETTLEMENT_ENABLED=1and the fanout fee policy mainnet pins: an explicit market rate of 1,000 bits per 1,000 weight and a 12,000 bps premium. The broadcaster stays off, and the settlement shape (PRISM_MAX_DIRECT_COINBASE_OUTPUTSand the rest) stays at the server's defaults. The keys go through the one launch composition (run::launch_environment), so the recorded environment is what ran.estimatesmartfee, which a regtest node cannot answer. The fake node'sgetmempoolinforelay floor is the same rate."--ctv-settlement": false(all 28, including 3.x.x: Fault injection under load (L4/L5) (#487 S16) #554's two new fault presets). Turning it on for the mainnet-shape presets is a separate decision, per the issue.settlementblock, flag on or off. It is read after the frontends stop, from the rows the server's landing writes in the block's own transaction:qbit_payout_carry_forward(miner accounts,onchainoraccrued) and the outputs listed inqbit_ctv_fanout_artifacts' manifests.settlement_mode,direct_recipients,fanout_recipients,carried_recipients,fanout_chunks,fanout_outputs. Totals across blocks, withblocks_by_chain_state. A block landed and later reorged still settled, so it is counted, and the breakdown shows how many there were.unmeasured_blocksand into no count. A failed read leaves the countsnull, with the error redacted.docs/prism-e2e-load-ci.md,test/e2e-scenarios.toml(r548-ctv-fanout-settlement-under-load) andtest/prism-gated-tests.txtare updated.Tests
qbit-prism-load::ctv_settlement: a fake node with 100 sessions over 400 Zipf-weighted addresses, one scheduled block,--ctv-settlement,--pool-fee-bps 0. It checks that the run reconciles exactly (exit 0) and that the CTV keys are on and the broadcaster is off. Each landed block must behybrid_coinbase_ctv_fanout, with 12 direct recipients (the server's default cap; with no pool fee, every slot is a miner's), one chunk, and fanout plus carried accounting for the rest. Passed in 43.9 s against PostgreSQL 16 withPRISM_TEST_REQUIRE_INTEGRATION=1.tests/harness.rs:ctv_settlement_sets_mainnets_ctv_keys_and_leaves_the_broadcaster_off: exactly three keys change, each to the value mainnet-compose pins, and each is read byconfig.rs.the_fake_nodes_relay_floor_admits_the_pinned_ctv_fee_rate.the_settlement_block_keeps_unmeasured_apart_from_zero: zero, unlanded, unreadable, partly unreadable (one of two chunks), reorged, failed and redacted cases.cargo test -p qbit-prism-load --locked, one binary at a time, after rebasing onto the current3.x.x: lib 43,harness142,ctv_settlement1,churn6,faults1,load_smoke1,quorum_replication1,realism21,soak_plan5 andsoak_sampling1 passed. Gated binaries ran against a private PostgreSQL 16 withPRISM_TEST_REQUIRE_INTEGRATION=1.real_nodepassed its fake-node golden but needsQBITD_BINfor its real-node test; see below.cargo fmt --checkandcargo clippy -p qbit-prism-load --all-targets --locked -- -D warnings: clean.scripts/check_e2e_scenarios.py: ok.python3 -m unittest tests.test_prism_load_matrix tests.test_prism_load_trend tests.test_prism_load_regress: 78 OK.hybrid_coinbase_ctv_fanout, with 12 direct, 388 fanout and 0 carried;Not run here and why
--node qbitd --ctv-settlement): the build host has noqbitdor docker, soreal_node::real_node_smoke_reconciles_against_postgres_and_the_chaindid not run. 3.x.x: pre-mainnet end-to-end scenarios on regtest, plus a nightly load-harness job #521 scenario 7 keeps the economic assertions on spent fanout outputs on the real node.Merge notes
docs/prism-e2e-load-ci.md, a changed preset starts a new series.--ctv-settlement:dense-cadence-400k-*-async×2,throughput-400k-window-2fe-async-3-blocks,session-point-5000andsession-point-10000. Whichever PR merges second must add"--ctv-settlement": falseto them. Otherwisecheck_completefails, with no textual conflict to warn first.true.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.