From 60d66022f6dd0c285bcb1ef88b373a44643fbefb Mon Sep 17 00:00:00 2001 From: DanS Date: Sun, 30 Aug 2026 17:26:21 -0500 Subject: [PATCH] regtest: default -checkpoints off so an isolated node leaves IBD chainparams_commandline() applies the DRAGONX mainnet checkpoint set to every SMART_CHAIN_SYMBOL=="DRAGONX" network, -regtest included, so an isolated regtest node (height ~hundreds) sits far below the top checkpoint (~3.2M). IsInitialBlockDownload() latches true whenever fCheckpointsEnabled && height < GetTotalBlocksEstimate(), so regtest was permanently in IBD -- disabling every ChainTip auto-op that gates on !IBD (autoshield, z_sweep, consolidation) and the below-checkpoint script-check skip, and forcing every regtest test to pass -checkpoints=0 by hand. Default -checkpoints to false on regtest (still overridable with -checkpoints=1). Verified: a fresh regtest node logs "Leaving InitialBlockDownload" after a few blocks with no flag, and -checkpoints=1 keeps it in IBD as before. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01PGhWvdBSgt6UxxHANr7gfN --- src/init.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/init.cpp b/src/init.cpp index df83709af..f1bb05347 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1432,7 +1432,13 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) mempool.setSanityCheck(1.0 / ratio); } fCheckBlockIndex = GetBoolArg("-checkblockindex", chainparams.DefaultConsistencyChecks()); - fCheckpointsEnabled = GetBoolArg("-checkpoints", true); + // Regtest inherits the DRAGONX *mainnet* checkpoint set (chainparams_commandline applies it + // for every SMART_CHAIN_SYMBOL=="DRAGONX" network, regardless of -regtest), whose top height + // ~3.2M would otherwise pin an isolated regtest chain in IsInitialBlockDownload() forever -- + // disabling the ChainTip auto-ops (autoshield/sweep/consolidation) and the below-checkpoint + // script-check skip. Default checkpoints OFF on regtest so a fresh regtest node leaves IBD + // normally; still overridable with -checkpoints=1. + fCheckpointsEnabled = GetBoolArg("-checkpoints", chainparams.NetworkIDString() != "regtest"); // -par=0 means autodetect, but nScriptCheckThreads==0 means no concurrency nScriptCheckThreads = GetArg("-par", DEFAULT_SCRIPTCHECK_THREADS);