Repository navigation
Allow fail-closed mainnet prelaunch readiness - #21
Merged
Merged
Conversation
djh58
self-requested a review
July 14, 2026 18:04
djh58
approved these changes
Jul 14, 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.
Summary
Root cause
The production gate unconditionally rejected
CKPOOL_NON_TEST_READINESS_GATE=0, so CKPool could not start to mine the first post-genesis block.Runtime contract
Prelaunch must provide both:
Launch uses both values set to
1. Deployments that omit the new flag retain the existing strict behavior.Validation
Note
Medium Risk
Changes production safety gates for mainnet CKPool startup; misconfiguration could weaken readiness checks, though the dual-flag contract and unchanged non-mainnet behavior limit exposure.
Overview
Adds
QBIT_MAINNET_LAUNCH_READINESS_CHECKS_ENABLEDas an optional runtime mirror of qbit-tools’ mainnet launch flag, documented in.env.exampleand passed intockpool/ckpool-realviacompose.yaml.In production mode,
CKPOOL_NON_TEST_READINESS_GATE=0is no longer unconditionally rejected. It is allowed only onQBIT_CHAIN=mainnetwhenQBIT_MAINNET_LAUNCH_READINESS_CHECKS_ENABLED=0is set explicitly; missing, malformed, launch-enabled (=1), or non-mainnet combinations stay fail-closed.scripts/check-env.shanddocker/ckpool/qbit-ckpool-preflight.pyimplement the same contract, including stricter validation ofinitialblockdownloadand peer counts when the gate stays on.Prelaunch still validates RPC chain identity; IBD and minimum-peer checks are skipped only for the authorized mainnet prelaunch path. Unit and startup tests cover env checking, preflight, compose wiring, and CKPool startup.
Reviewed by Cursor Bugbot for commit 2ba0fc3. Bugbot is set up for automated code reviews on this repo. Configure here.
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.