Skip to content

3.x.x: remove Config::block_only_ack_timeout, share the mature-CTV-fanout fixture, and stop the load tests rebuilding the server's dependencies (#579, #580) - #617

Merged
djh58 merged 2 commits into
3.x.xfrom
djh58/prism-cleanup-579-580
Sep 30, 2026
Merged

djh58 merged 2 commits into
3.x.xfrom
djh58/prism-cleanup-579-580

Conversation

@djh58

@djh58 djh58 commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Closes #579, closes #580.

A cleanup with no production behaviour change. It covers three things.

#580: remove Config::block_only_ack_timeout

Since #574 the field always equalled share_commit_timeout. persist_block_only now reads share_commit_timeout directly, and the field and config::block_only_ack_timeout are removed. A restored 60 s floor would now have to go into persist_block_only itself, where b574_ack_cap and the commit_reconcile_block_only_* tests catch it (see the mutants below).

  • The 13 fixtures that set the field drop it. Most set it to 60 s next to a 15 s share deadline.
  • Tests that shortened the block-only bound now shorten share_commit_timeout instead:
    • commit_reconcile_tests (5 cases)
    • miner_submit_acquire_tests
    • readiness_rpc
    • b574_ack_cap
  • Tests that depended on the block-only bound being longer than the share deadline:
    • commit_reconcile_block_only_confirmed_after_the_share_deadline_is_accepted covered only that gap. It is now …_confirmed_before_its_bound_is_accepted: a 10 s share deadline, still not answered at 1.5 s, accepted once its candidate is driven, and without the late-confirmation assertion, which can no longer fire. The gated list is renamed to match.
    • commit_reconcile_candidate_bearing_append_is_never_refused: the held-before-COMMIT case keeps its < 1 s ceiling. The ceiling now separates the answer from the 5 s grace instead of from a 1 s block-only bound.
    • block_only_work_block_never_takes_the_credited_share_path runs on the miner-test fixture's offline ledger. There the duplicate probe fails at the pool's 30 s acquire timeout, which used to fall inside the 60 s block-only bound. The test now sets a 60 s share deadline, so the answer is still ledger-confirmation-failed and the runtime is unchanged at about 30 s.
  • The docs that named the field now name the share deadline:
  • The WARN detail for a block-only proof capped at its bound now reads "…no disposition by share_commit_timeout". It used to name the removed field.

#579: share the mature-CTV-fanout fixture

seed_candidate and one parameterised mature_fanouts(f, observed) move into tests/support/compact_runtime_e2e/ctv_fanout.rs, which is a new file with one additive mod line. refresh_liveness and ctv_fanout_bookkeeping now both use it, which removes about 250 duplicated lines. The gated list does not change.

The load tests no longer rebuild the server's dependencies

load_smoke, real_node and soak_smoke build the server binary from inside the test. cargo test sets CARGO_PKG_NAME, CARGO_MANIFEST_DIR and similar variables for the test process, and ring's build script tracks them. So every nested build recompiled ring, rustls, sqlx and the server library. The next cargo invocation then recompiled them back.

The nested build now matches the test binary's own build: qbit-prism-load is selected beside the server, and those variables are removed. #554's fault test does the same.

Nested server build
Before, per-PR CI on the 3.x.x head real_node 11.9 s, load_smoke 13.2 s
Before, reproduced locally 26 s, then 31 s for the next cargo test build to recompile back
After, locally 1.0 s cold, 0.10–0.12 s warm

Per-PR CI: no tests added, about 24 s saved (roughly 12 s on each of the two shards that run load_smoke and real_node), plus the recompile in whatever step follows on those shards. soak_smoke is nightly-only.

Verification

Run against a private PostgreSQL 16 (fsync on, PRISM_TEST_REQUIRE_INTEGRATION=1, no gated test skipped):

  • cargo fmt --check and cargo clippy -p qbit-prism-server -p qbit-prism-load --all-targets -D warnings
  • qbit-prism-server --lib: 590 passed; the 2 ignored are pre-existing.
  • Every integration binary that sets the field or includes a changed fixture, including the gated live highdiff and compact-runtime tests (23): refresh_liveness 38, ctv_fanout_bookkeeping 22, b574_ack_cap 22, readiness_rpc 11, b478_capture_overpay 29, b478_payout_integrity 21, b478_stale_revision_block 20, landing_metrics 41, refresh_window_split 27, compact_runtime_e2e 34, candidate_window_qualification 7, offer_latency 1, lost_race_pin 8, checkout_probe_delivery 1, compact_runtime_observer 25, compact_runtime_scale 19, equal_work_scheduler 6, equal_work_tip 10, fanout_revision_bump 1, jsonb_ceiling_gate 15, signing_transition 14, work_refresh_metric 1, b275_persistence_measure 11, ledger_postgres 183, candidate_storm 20 (3,120 candidates)
  • load_smoke, real_node and soak_smoke --ignored, each run twice

Mutants in persist_block_only:

  • bound = start + max(share_commit_timeout, 60 s) (the restored floor):
    • b574_ack_cap fails 2: a_captured_proof_is_answered_at_the_cap… and …whose_probe_outlasts_the_cap….
    • commit_reconcile_tests fails 3: …still_pending_at_its_bound_is_unknown, …enqueue_past_the_bound_is_unknown and …poll_errors_are_retried_then_unknown.
  • bound = start fails the renamed …confirmed_before_its_bound_is_accepted with "a block-only proof was answered before its candidate's disposition".

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

…nout fixture, and stop the load tests rebuilding the server's dependencies (#579, #580)

#580: after #574 the block-only acknowledgement bound always equalled
share_commit_timeout, so the field and config::block_only_ack_timeout are
gone and persist_block_only reads share_commit_timeout. Production behaviour
is unchanged. The 13 fixtures that set the field (60 s next to a 15 s share
deadline) drop it. Tests that shortened the block-only bound now shorten
share_commit_timeout instead. Tests that relied on the longer bound:
- commit_reconcile_block_only_confirmed_after_the_share_deadline_is_accepted
  only covered a bound longer than the share deadline. It is now
  ..._confirmed_before_its_bound_is_accepted, with a 10 s share deadline and
  without the late-confirmation assertion. The gated list is renamed to match.
- The held-before-COMMIT case in
  commit_reconcile_candidate_bearing_append_is_never_refused keeps its < 1 s
  ceiling, which now bounds the 5 s grace.
- block_only_work_block_never_takes_the_credited_share_path runs on an
  offline ledger whose probe fails at the pool's 30 s acquire timeout. It
  now sets a 60 s share deadline so that failure is still its answer.
The docs that named the field now name the share deadline.

#579: seed_candidate and one parameterised mature_fanouts(f, observed) move
into tests/support/compact_runtime_e2e/ctv_fanout.rs. refresh_liveness and
ctv_fanout_bookkeeping both use it.

load_smoke, real_node and soak_smoke build the server as #554's faults test
does: qbit-prism-load is selected beside it, and the CARGO_PKG_* and
CARGO_MANIFEST_* variables that cargo test sets are removed, because ring's
build script tracks them. The nested build no longer recompiles ring,
rustls, sqlx and the server library on every run, and the next cargo
invocation no longer recompiles them back.

Closes #579, closes #580.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@djh58
djh58 requested a review from kiwidream September 30, 2026 18:41
…are deadline

The share deadline in commit_reconcile_block_only_enqueue_behind_the_order_lock_is_not_cut_off
is now 10 s, so the 1.5 s checkpoint no longer falls past it. The comment
and failure message now say what the checkpoint still proves: the proof is
not answered while its enqueue waits behind ORDER_LOCK.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@djh58

djh58 commented Sep 30, 2026

Copy link
Copy Markdown
Member Author

Review ledger (#579, #580, load-test server build)

There's no production behaviour change here, so under the current policy this PR got a proportionate check rather than a full deep review: one /code-review medium pass over the PR, the touched suites run against a private PostgreSQL 16, and mutant evidence.

Review findings

# Finding Disposition
1 The 1.5 s checkpoint in commit_reconcile_block_only_enqueue_behind_the_order_lock_is_not_cut_off now comes before the test's 10 s share deadline. Its comment ("Past the share deadline") and failure message ("cut off at the share deadline") were therefore stale. The checkpoint still proves the proof isn't answered while its enqueue waits behind ORDER_LOCK, and the test goes on to show it is accepted after the release. Fixed in 8e7f934: the comment and message now describe exactly that.

The review also checked the following and found them sound:

  • Config::from_env already set the block-only bound to share_commit_timeout, so production behaviour is unchanged.
  • Every fixture that lost the 60 s block-only bound either waits at most 5 s on the block-only path, asserts on database state, or answers within 15 s. The one test that depended on the longer bound (block_only_work_block_never_takes_the_credited_share_path, whose offline ledger fails its probe at the pool's 30 s acquire timeout) now sets a 60 s share deadline itself.
  • The moved CTV-fanout fixture matches both originals. The only difference is the candidate's job id, which nothing reads.
  • The three build_server copies are consistent. Selecting qbit-prism-load beside the server doesn't change any crate's resolved features in the server's dependency tree: cargo tree gives the same feature set for every crate either way. So the binary under test matches a standalone build.
  • The renamed gated test is updated in test/prism-gated-tests.txt and stays sorted.
  • The metrics metadata and the generated inventory agree.

Mutant evidence

Each mutant was applied to persist_block_only, built, run against the unchanged tests, and then reverted.

Mutant Tests Failure
bound = start + max(share_commit_timeout, 60 s) (the old floor restored) b574_ack_cap a_captured_proof_is_answered_at_the_cap_and_credited_after_its_landing and a_captured_proof_whose_probe_outlasts_the_cap_is_still_enqueued_and_credited fail
the same commit_reconcile_tests …block_only_still_pending_at_its_bound_is_unknown, …block_only_enqueue_past_the_bound_is_unknown and …block_only_poll_errors_are_retried_then_unknown fail
bound = start commit_reconcile_block_only_confirmed_before_its_bound_is_accepted fails with "a block-only proof was answered before its candidate's disposition"

Local runs (private PostgreSQL 16, fsync on, required-integration mode, nothing skipped)

  • fmt and clippy (-D warnings, server and load, all targets) pass.
  • qbit-prism-server --lib: 590 passed; the 2 ignored are pre-existing.
  • 25 integration binaries that set the field or include a changed fixture all pass. They include refresh_liveness (38), ctv_fanout_bookkeeping (22), b574_ack_cap (22), readiness_rpc (11), the three b478 binaries, landing_metrics (41), ledger_postgres (183) and candidate_storm (20, with 3,120 candidates).
  • The gated live highdiff and compact-runtime tests pass (23).
  • load_smoke, real_node and soak_smoke --ignored passed twice each.
  • The nested server build now takes 0.10–0.15 s warm and 1.0–1.3 s cold. It took 11.9 s (real_node) and 13.2 s (load_smoke) in per-PR CI on the previous 3.x.x head.

One full parallel lib run under host load had a lock-timeout flake in two rollups::tests cases, which this PR doesn't touch; that's #603.

CI

All checks are green on head 8e7f934: 21 passed and 9 skipped.

The first head, 9328bdf, failed only in real_node_smoke_reconciles_against_postgres_and_the_chain. The harness passed its gates and reconciled exactly, but the chain report had 3 external blocks and no own block, so the assertion that the preset lands one own block failed. The two jobs that aggregate that shard failed with it. That head's server binary was built from the same resolved features as before this PR, and the test passed on 8e7f934 and 4 of 4 times locally, so this looks like an intermittent miss of the scheduled own block, independent of this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant