Protect PRISM submits during current-tip fanout - #85
Draft
Anatolie wants to merge 5 commits into
Draft
Conversation
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.
Why
PRISM makes a new tip globally current before its replacement job reaches every socket. During the incident, current-tip client coverage remained at 0% for 13–83 seconds. Miners on slow or blocked sockets kept submitting the exact job they had received, but those shares were rejected as stale or unknown; 177 of 6,408 post-deploy rejects (2.76%) fell into those categories.
Stale grace deliberately remains zero. Broadening it would make unrelated old jobs eligible and would change accounting semantics beyond this fanout failure mode.
What changed
credit_policy=fanout-transitionand carries a strict receipt in audit bundle v1.2.Expected outcome
When enabled, a blocked client can receive credit for its exact delivered job only until its replacement is delivered or the absolute lease expires. Clients that receive the replacement switch immediately. This should remove stale/unknown rejects caused solely by incomplete fanout without enabling general previous-tip credit, accepting guessed or reused jobs, or risking an old-tip block candidate.
Merging alone does not change runtime accounting because the lease defaults to disabled.
Configuration
Safe source defaults:
After the ledger schema and all v1.2 audit consumers are qualified, the intended deployment values are:
Monitor after merge
transition-lease-expiredandtransition-lease-revoked.qbit_prism_fanout_transition_credited_shares_total, active leases, retained entries, and lifecycle events; retained state should fall after fanout/churn, whilecapacity_evictedindicates cap pressure.Validation
cargo test --locked --workspace --all-targetspassed.Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.