Repository navigation
3.x.x: run #521's chain-event scenarios under 2,000 Stratum sessions, and add tip-disagreement, peer-loss and external-tip scenarios (#553) - #618
Conversation
… and add tip-disagreement, peer-loss and external-tip scenarios (#553) #487 S15 (L4). #521's fixtures run unchanged under load: each case opens the fixture as its own test does, starts a session load against its frontends, and calls the scenario's own function (decision 12). - live_session_load.rs: 2,000 Stratum sessions that fail over between frontends and submit share-only proofs at a fixed rate, so the load never finds a block. It stamps every node tip with a waitfornewblock long-poll and checks three things: every acknowledged share is a durable row and no refused share is; no refusal a correct miner cannot earn; every session gets work on every lasting tip within 15 s while its node answers and its frontend is ready. It reports #481's time to usable work per frontend and per tip. - live_chain_events_load.rs, nightly: scenarios 1 and 2, scenario 4's crash after acceptance, and three new scenarios with their criteria. Two frontends on two nodes disagree about the tip: the ledger takes one side, and the other frontend stands down with no work on its node's tip. The pool's node loses its only peer: regtest exempts the peer floor, so the isolated own block is deactivated and credited once. External tips come at the 60 s target spacing. Weekly: the other scenario-4 cases, the soak, 45 minutes of external tips at 400 shares/s, and two expected failures: 2,000 sessions on one frontend at a 1 s reanchor (#598) and scenario 7 at 2,000 wallets (#604). - Load frontends use the production 60 s reanchor. At the fixture's 1 s, 2,000 sessions on one frontend get no work (#598). - check_e2e_scenarios.py: ids in test/prism-weekly-gated-tests.txt run in the weekly lane, which now also needs the live-weekly job's schedule and gate-manifest step, and every weekly id must be named by a running scenario, as for the nightly list. The manifest cites every weekly id, #545's and #575's included, and each expected failure has its own scenario owned by its issue. - live-weekly's timeout goes from 120 to 180 min for the long set, about 85 minutes. - Shared support changes: pub(super) on scenario functions, outage_case_on, solve_share, the 2,000-wallet connection limit, and assert_no_duplicate_headers reading its two counts in one statement (under load, shares landed between them). Refs #553 Co-Authored-By: Claude Opus 5.5 <[email protected]>
… of expecting its failure weekly (#553) Review of the first commit found checks weaker than the manifest claims, and #616 has since fixed #598. - Scenarios 1, 2 and 4 now reach their first event under the whole load. #521's server_ready waits on a ready gate that the load installs (99% of sessions holding work), and scenario 4's case takes a `ready` hook before its first block. Before this, scenario 1's race came with 42 of 2,000 sessions connected and scenario 4's fault with about 1,350. - Sessions spread their first connections from the first ready frontend, not from the load's start. - The load records every notify, so work on a parent a session held before still serves that tip after a reorg back. - Refusals are an allow-list (the harness's expected and backend classes). An impossible or unclassified refusal fails, and ledger-outcome-unknown counts as unanswered, since its share may land. - External tips and the weekly soak hold at least one tip per frontend to the bound. The peer-loss case holds the isolated block itself to it on every session. - The 1 s-reanchor case becomes #598's nightly guard at 5 shares/s, #598's reproducer rate: each of three tips must reach all 2,000 sessions on the one frontend within 15 s. It fails before #616 and passes after it. It runs nightly because live-nightly builds debug; in release the fan-out outruns a 1 s reanchor even without the fix. - The 2,000-wallet case leaves the weekly list, since in release (the weekly job's build) it fails on #622 rather than #604. It stays an ignored case for running by hand, counting as #604 only once at least 100 sessions opened; the wallet fixture's error now says how many had. wallets-2000-cap stays unexercised, naming #604 and #622, and the expected-failure scenarios go. - The load soak validates its duration and budget as #521's does, and the load settings reuse the soak's env reader. - live-nightly's and live-weekly's comments name the jobs they run. Refs #553 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…he bound, and match the untyped refusal exactly (#553) Review of the second commit found two checks that could pass without holding what they claim. - Since the load records every notify, a republication on a parent after the next tip's stamp could count as work on that parent when the node returned to it, although the session had moved to the next tip's work in between. Work before a stamp now counts only while the session still held it at the stamp: its last run of notifies on the tip, from after the node's previous tip. A new unit test fails on the old lookup. - "At least one tip held to the bound" counted gated tips, and a gated tip replaced within 15 s can only count sessions as replaced. The report adds held_tips (gated and lasting the bound), which the external-tips, soak, scenario 1, 2 and 4 checks and #598's guard now use; the soak ends on a closing tip, since its own blocks come seconds apart. - The one refusal without a reason_id a correct load can earn is the unknown-job budget, now matched on its code and exact message as the harness does. "too many connections" is an authorize-time error and never reaches the submit counts. - The manifest's criteria say what the load checks: the refusal allow-list, and every session holding work in #598's guard. Stale comments are fixed, and until_connected reuses holding. Refs #553 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Resolves live_weighted_recipients.rs against #607: its Policy, Payees and the ctv and wallets fields stay, with #553's visibility, the opened-count context and the connection-limit raise. The raise moves to start_servers_for, so #607's 1,001-recipient case keeps start_servers as it was, and #553's 2,000-wallet shape takes ctv and 8 wallets like the other CTV shapes.
Review ledger: commit 2 (5fdcf6d) and its review fixes (b6ad808)Two local lanes reviewed the second commit:
After the fixes, all seven nightly chain-event cases passed again in debug (guard 84 s, deep reorg 85 s, external tips 331 s, lost race 71 s, killed after accepting 43 s, peer loss 67 s, two frontends 100 s), as did the soak at 60 s. Since then, 3.x.x is merged in (c9e371a), resolving |
#551, #553, #554, #582) The file is 3.x.x's copy byte for byte again, as of 3.x.x c95febb; the last change to it there is bd1ddeb (#663). Since 1932cb3 (#597), five 3.x.x changes landed in it: - #552 (#613): the `bridging` job runs the short plan on the fake and the real node on one runner, nightly, on the run-load label and on a dispatch with the new `bridging` input. - #551 (#606): every preset job builds a trend row; on a schedule the `evidence` job (the one job with `contents: write`) appends the rows to the orphan `ci-evidence` branch, applies the report-only regression rule, promotes the soak's and flagged runs' bundles to the rolling `ci-evidence/YYYY-MM` pre-release, and keeps one `prism-load-regression` issue. PR and dispatch runs get the read-only `evidence-preview` instead. - #553 (#618): the live nightly and weekly lists gain the chain-event scenarios under 2,000 sessions; the workflow's comments say so. - #554 (#635): the run job installs fuse2fs and fuse3 for a preset whose faults fill the WAL volume (faults-long-real-node, Saturday). - #582 (#663): comment only. Without this, main's scheduled copy (#595) still has no qbitd install step, so every `--node qbitd` preset fails with "--node qbitd needs --qbitd-bin or QBITD_BIN" (scheduled runs 37188928798 and 37287515779). Co-Authored-By: Claude Opus 5.5 <[email protected]>
(#590, #596, #588, #597, #552, #551, #553, #554) (#601) * main: sync the PRISM load-harness nightly workflow from 3.x.x (#590, #596) Co-Authored-By: Claude Opus 5.5 <[email protected]> * main: sync the PRISM load-harness nightly workflow from 3.x.x (#590, #596, #588, #597) Adds #588's Saturday 5.5 h soak schedule and its live-nightly step that runs every listed test binary, so qbit-prism-load::soak_smoke runs beside the live_regtest variants, and #597's L6 shipped-images lane on the Sunday schedule. Byte-identical to 3.x.x at 1932cb3. Co-Authored-By: Claude Opus 5.5 <[email protected]> * main: re-sync the PRISM load-harness nightly workflow from 3.x.x (#552, #551, #553, #554, #582) The file is 3.x.x's copy byte for byte again, as of 3.x.x c95febb; the last change to it there is bd1ddeb (#663). Since 1932cb3 (#597), five 3.x.x changes landed in it: - #552 (#613): the `bridging` job runs the short plan on the fake and the real node on one runner, nightly, on the run-load label and on a dispatch with the new `bridging` input. - #551 (#606): every preset job builds a trend row; on a schedule the `evidence` job (the one job with `contents: write`) appends the rows to the orphan `ci-evidence` branch, applies the report-only regression rule, promotes the soak's and flagged runs' bundles to the rolling `ci-evidence/YYYY-MM` pre-release, and keeps one `prism-load-regression` issue. PR and dispatch runs get the read-only `evidence-preview` instead. - #553 (#618): the live nightly and weekly lists gain the chain-event scenarios under 2,000 sessions; the workflow's comments say so. - #554 (#635): the run job installs fuse2fs and fuse3 for a preset whose faults fill the WAL volume (faults-long-real-node, Saturday). - #582 (#663): comment only. Without this, main's scheduled copy (#595) still has no qbitd install step, so every `--node qbitd` preset fails with "--node qbitd needs --qbitd-bin or QBITD_BIN" (scheduled runs 37188928798 and 37287515779). Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Robert Clarke <[email protected]>
Refs #553 (#487 S15, L4). Test-only: no server or harness code changes.
What
#521's fixtures run unchanged under session load (#487 decision 12). Each case opens the fixture as its own test does, starts a session load against the fixture's frontends, and calls the scenario's own function. The
live_regtestsupport files change only in visibility and in the additive support listed below.The load,
tests/support/live_session_load.rswaitfornewblocklong-poll, and each frontend's/healthzis sampled.The load adds three checks of its own:
ledger-outcome-unknowncounts as unknown, because its share may still land;invalid-*) fails, and so does one nobody has classified yet;NOTIFY_BOUND). This applies when the frontend's node answered throughout and the frontend reported itself ready when the bound expired. A frontend fences its health for about 2 s after each tip, so readiness is read at expiry.It reports #481's time to usable work per frontend and per tip, from the node's stamp to each session's first notify on that parent. A tip replaced before a session got it is counted as replaced, not as zero. Every notify is recorded, so work on a parent a session held before still serves that tip after a reorg back. The report is one
live-load <case>: {json}line in the test log.The whole load is present at each scenario's first event. #521's scenarios start their own servers, and their first events follow within seconds. So
server_readywaits on a ready gate that the load installs while it runs (99% of sessions holding work), and scenario 4's case takes areadyhook before its first block. Before this, scenario 1's race came with 42 of 2,000 sessions connected, and scenario 4's fault with about 1,350.The cases,
tests/support/live_chain_events_load.rsreadiness.rs;readiness_rpc.rspins both sides), so the case is an isolated node. The pool's own block there is deactivated when the node reorganizes onto its peer's chain and credited exactly once, with no divergence or duplicate header. Every session gets work on the isolated block within 15 s, and on the healed chainAfter scenarios 1, 2 and 4, one more tip is mined and the bound is waited out, so every frontend still serving sessions is held to the bound at least once. A scenario often ends seconds after its last tip.
Not in a lane: #521 scenario 7 at 2,000 wallets.
wallets_2000_share_to_spend_starves_first_jobs_until_604_is_fixedstays as an#[ignore]case for running by hand, andwallets-2000-capstays unexercised. In debug it is #604's expected failure: the fixture opens its ~3,000 worker sessions one at a time, and at its 1 s reanchor first jobs queue behind same-tip rebuilds. It counts as #604 only once at least 100 sessions opened, and the wallet fixture's error now says how many had. In release, which the weekly job builds, every session opens, and then a later round's new tip reaches some worker late while both frontends defer job preparation withtip polling stale(#622, 3 of 3 runs).Found
live-nightlybuilds debug. In release the fan-out outruns a 1 s reanchor even without the fix: every tip reached all 2,000 sessions in 0.45–0.71 s, 4 of 4 runs.assert_no_duplicate_headersread the accepted-row count and the header count in two statements, so under load shares landed between them. It now reads both in one statement. The assertion is the same.Shared support touched (additive or visibility only)
live_two_node.rs,live_dense_soak.rs,live_weighted_recipients.rs:pub(super)on the scenario functions and helpers used here; the atomic header count above.live_two_node.rs:READY_GATE, whichserver_readywaits on once the server is ready, and only while a load installs one. It isNoneotherwise, so every existing caller behaves as before.live_node_outage.rs:outage_case_on. It isoutage_caseon a caller's fixture, with areadyhook before the first block and anafterhook while the servers still reach the node through the proxy;outage_casepasses no-ops.live_share_client.rs:solve_share, the existing solver fixed to a share-only proof.live_weighted_recipients.rs: the connection limit is raised above the default only when a case has more workers than it (the 2,000-wallet case), and a session that fails to open says how many had opened. The per-PR and nightly cases start with exactly the settings they had.Tests and mutants
Local runs used a private PostgreSQL 16 (fsync on) and the pinned qbit, on this code over current 3.x.x (with #616 and #617).
All seven passed, about 13 minutes in total, and
check_gate_manifest.pyproved each executed. After merging 3.x.x into this branch, the guard, scenario 1, scenario 4's crash case and the peer-loss case passed again (78, 73, 48 and 67 s), again proven executed.The weekly set ran in release, as
live-weeklybuilds it: scenario 4's other four cases passed (40–57 s each), and the soak passed at 5 minutes rather than 20 to fit the shared test host. The 45-minute external tips were not rerun in full locally (the first commit's 8-minute run passed); the full-length soak and external tips run first in CI.Mutants and negative checks, local only:
coordinator.rsandtip_observation.rschanges reverted) fails: once with 565, 1,394 and 1,261 of 2,000 sessions late on its three tips, and once earlier, with only 1,697 of 2,000 sessions holding any work after 120 s.load*worker failed 10 of 12 load cases on the load's own checks. The 3.x.x: pre-mainnet end-to-end scenarios on regtest, plus a nightly load-harness job #521 fixtures' own assertions still passed.acknowledged share … is not in the ledger.live_regtestbinary (<10 ms) fail when a missing acknowledged share is ignored, when a late session is counted as replaced, when node outages are ignored by the gate, when an impossible or unclassified refusal is allowed, or when an unknown outcome is read as a refusal.check_e2e_scenarios.py(weekly ids not mapped to the weekly lane, uncited weekly ids not reported, the live-weekly gate step dropped from the weekly lane's wiring) each fail its unit tests.cargo fmt --all --checkandcargo clippy -p qbit-prism-server --all-targets -- -D warningsare clean.scripts/check_e2e_scenarios.pypasses, and so dotests.test_check_e2e_scenariosandtests.test_check_gate_manifest.Review fixes
Review of the second commit (the ledger comment lists every finding) led to a third:
held_tips: gated tips that lasted the bound, so a session can't be counted as replaced on them. The "at least one tip held to the bound" checks and 3.x.x: job delivery starves when publications outpace one fan-out (payout snapshot stale livelock) #598's guard use it, and the weekly soak ends on a closing tip.reason_ida correct load can earn, the unknown-job budget, is matched on its code and exact message, as the harness does.After it, all seven nightly cases and a 60 s soak passed again, each proven executed. After merging 3.x.x (#607's direct-settlement recipients), the weighted-recipients per-PR, nightly and 1,001-recipient cases and #598's guard passed. The CI lane guide (#612) now describes L4 under session load.
CI cost
test/prism-nightly-gated-tests.txt, whichlive-nightly(8 vCPU, debug) already runs. That adds about 13 minutes locally on 22 cores, likely more on 8 vCPU, to a job that took 21 minutes on 09-30 and has a 60-minute timeout.test/prism-weekly-gated-tests.txtand add about 75 minutes (45 of external tips, a 20-minute soak, four shorter cases) tolive-weekly. This PR raises that job's timeout from 120 to 180 minutes.Manifest
scripts/check_e2e_scenarios.pynow readstest/prism-weekly-gated-tests.txt. An id there runs in theweeklylane (#588's), whose wiring now also needs the live-weekly schedule and its gate-manifest step. Every weekly id must be named by a running scenario, as for the nightly list, and each rule has unit tests.test/e2e-scenarios.toml:chain-events-under-load,two-frontends-disagree-on-tip,node-loses-peerandexternal-tips-time-to-usable-worknow run, citing their nightly and weekly ids;one-frontend-fast-reanchor(3.x.x: job delivery starves when publications outpace one fan-out (payout snapshot stale livelock) #598) is new and runs nightly.wallets-2000-capstays unexercised, with its reason naming 3.x.x: first jobs queue behind same-tip rebuild storms (sequential opening grows with the square of the sessions at a fast reanchor) #604 and 3.x.x: new-tip job delivery misses a 30 s bound with ~3,000 sessions at a 1 s reanchor in release ('tip polling stale' deferrals) #622.migration-lifecycle, still marked "Not built") and 3.x.x: pre-release test gaps (cutover rehearsal, soak, real miners, fuzzing, resource exhaustion) #575's weekly cutover variant (cutover-rehearsal) now cite their weekly ids, which only their notes named before.Not merge-blocking: nothing here runs per PR.
🤖 Generated with Claude Code