Skip to content

Allow fail-closed mainnet prelaunch readiness - #21

Merged
kiwidream merged 1 commit into
mainfrom
qbit-prelaunch-deadlock-fix
Jul 14, 2026
Merged

kiwidream merged 1 commit into
mainfrom
qbit-prelaunch-deadlock-fix

Conversation

@kiwidream

@kiwidream kiwidream commented Jul 14, 2026 •

Copy link
Copy Markdown
Member

Summary

  • add an explicit runtime mirror for the shared mainnet launch-readiness flag
  • permit the production CKPool readiness gate to be disabled only for mainnet when prelaunch is explicitly authorized
  • preserve RPC chain identity validation and all unrelated production safeguards
  • keep missing, malformed, launch-enabled, and non-mainnet configurations fail closed
  • cover the environment checker, shared preflight, compose wiring, and CKPool startup path

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:

CKPOOL_NON_TEST_READINESS_GATE=0
QBIT_MAINNET_LAUNCH_READINESS_CHECKS_ENABLED=0

Launch uses both values set to 1. Deployments that omit the new flag retain the existing strict behavior.

Validation

  • Dockerized ShellCheck
  • shell syntax checks
  • Python source compilation
  • 498 Python unit tests
  • full locked Rust workspace tests
  • Docker Compose validation for permissionless, permissionless-real, auxpow, and prism profiles

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_ENABLED as an optional runtime mirror of qbit-tools’ mainnet launch flag, documented in .env.example and passed into ckpool / ckpool-real via compose.yaml.

In production mode, CKPOOL_NON_TEST_READINESS_GATE=0 is no longer unconditionally rejected. It is allowed only on QBIT_CHAIN=mainnet when QBIT_MAINNET_LAUNCH_READINESS_CHECKS_ENABLED=0 is set explicitly; missing, malformed, launch-enabled (=1), or non-mainnet combinations stay fail-closed. scripts/check-env.sh and docker/ckpool/qbit-ckpool-preflight.py implement the same contract, including stricter validation of initialblockdownload and 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.


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

@djh58
djh58 self-requested a review July 14, 2026 18:04
@kiwidream
kiwidream merged commit 9f70c97 into main Jul 14, 2026
5 checks passed
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.

2 participants