Repository navigation
3.x.x: mine each clock-jump phase on settled work, so a held block's landing cannot race the phase's first share (#656) - #659
Merged
Conversation
…landing cannot race the phase's first share (#656) The 10-04 nightly failed phase 3 of the wall-clock jump test. Server 0 refused the phase's first share as ledger-confirmation-failed and logged "payout revision changed before share commit" in the same second the node took the held block. held_landing returned as soon as the held block was the node's tip, and the phase mined at once, on work from before two payout-revision moves: the landing's and the servers' observation of the new tip. The share passed its submit check and met the moved revision at the append's fence (#632). Since #581 the holder lands its held block itself as soon as it is released, so phase 3 now has phase 4's shape. Phase 4's refusals were the same race (10-02 and 10-05 nightlies). The test allowed them as REFUSED_AFTER_STEP_BACK and blamed the clock stepping back. Fixture::settled is #640's wait from the transcript replay's current(), now shared. It waits until no candidate is unfinished and the server's /healthz shows the node's tip with payout_state_generation at qbit_prism_cluster.payout_revision. The replay calls it with the same conditions as before. The clock-jump test waits on it before every serving mine and before each held block, and REFUSED_AFTER_STEP_BACK is removed: phases 3 and 4 must accept every share, like every other phase. 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. |
…so waiting for settled work does not double a server's serving budget (#656) The settle wait added before each mine had its own 30 s, ahead of the 30 s work_on still gave a miner. A corrected server therefore had up to 60 s to serve again, where the test's WORK_SECONDS documents 30 s. Run::mine and held_landing now set one WORK_SECONDS deadline, settle within it and give work_on what remains. The ahead phase's no-work check keeps its own WORK_SECONDS. Fixture::settled takes its time limit, and the transcript replay passes its 30 s as before. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…meout failure (#656) Shard 2 failed authorization_rpc's authorization_fallback_requires_a_definitive_address_result with "canceling statement due to statement timeout". That test is outside this change, and the same shard passed on 26a866f. The token cannot rerun a job, so this empty commit runs CI again. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 5, 2026
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 #656. Refs #632, #640, #581, #646, #657.
Test-only: no server code changes.
Cause
The 10-04 nightly failed phase 3 of the wall-clock jump test. Server 0 answered the phase's first share
ledger-confirmation-failedand loggedpayout revision changed before share commitin the same second the node took the held block.held_landingreturns as soon as the held block is the node's tip, and the phase mines at once. Its work predates two payout-revision moves: the held block's landing, and the servers' observation of the new tip. The share passes its submit check, then meets the moved revision at the append's fence. This is #632's race.Since #581 (#646), the holder lands its held block itself as soon as it is released, so phase 3 now has phase 4's shape. Phase 4's refusals were the same race (10-02 and 10-05 nightlies). The test allowed them as
REFUSED_AFTER_STEP_BACKand blamed the clock stepping back. Full diagnosis on #656.Change
live_regtest.rs: addsFixture::settled(index). It is 3.x.x: pause the session load's shares around scenario 2's own blocks, and start each replayed transcript after earlier blocks land (#631, #632) #640's wait from the transcript replay'scurrent(), now shared. It waits until no candidate is unfinished and the server's/healthzshows the node's tip withpayout_state_generationequal toqbit_prism_cluster.payout_revision.live_transcript_replay.rs:current()calls it, with the same conditions and the same 30 s as before.live_clock_jump.rs:Run::mine(every phase where a server must serve) andheld_landingwait on it first.REFUSED_AFTER_STEP_BACKand therefusableparameter are removed, so phases 3 and 4 must accept every share like every other phase. The module doc explains why.WORK_SECONDS.Run::mineandheld_landingset one deadline, settle within it, and givework_onwhat remains. A corrected server still has 30 s in all to serve again, as the test documents, rather than 30 s to settle plus 30 s for work.Fixture::settledtakes its time limit, and the replay passes its 30 s.Evidence
Local run: private PostgreSQL 16.15, pinned qbit 1.0.0, libfaketime 0.9.10, debug build.
payout revision changed before share commitin the second the node took the held block at height 12.refused {}, 18 blocks landed once each, and no persistence failure or stale-job cause on either server. In every run, both held blocks wereoffer_reservedat the jump, made exactly 1 submitblock call while held, and were answeredaccepted./tmpquota filled. The other timed out in the settle wait while every database lock wait on the host hit its 5 s lock timeout during a concurrent build: server 1 could not take its refresh's advisory lock. The old test would have failed there too, with no work in 30 s.ledger-confirmation-failedat the fence, oncestale-jobwith causepayout_revision.REFUSED_AFTER_STEP_BACKlet both through, which shows the step-back refusals are this race.refused {}.cargo fmt --all --checkandcargo clippy -p qbit-prism-server --all-targets -- -D warningsare clean.The clock-jump test is nightly-only (
#[ignore]). In this PR's CI, the shared helper is exercised only through the transcript replay; the first nightly after merge covers the rest.No test was added or renamed, so
test/prism-gated-tests.txtandtest/prism-nightly-gated-tests.txtare unchanged.Not in this PR
The third commit is empty. It re-runs CI after shard 2 failed
authorization_rpc'sauthorization_fallback_requires_a_definitive_address_resultwith a database statement timeout. That test is outside this change, and the shard passed on the first commit.#657 is a product bug on the same fence: a block-bearing proof whose revision moves between its check and its fence loses its block.
🤖 Generated with Claude Code