Skip to content

chainparams: remove dead testnet4 and signet support - #24

Open
Avecci-Claussen wants to merge 1 commit into
fractal-bitcoin:fractal-29.xfrom
Avecci-Claussen:fix/disable-dead-networks
Open

Avecci-Claussen wants to merge 1 commit into
fractal-bitcoin:fractal-29.xfrom
Avecci-Claussen:fix/disable-dead-networks

Conversation

@Avecci-Claussen

Copy link
Copy Markdown

Fractal Bitcoin ships testnet4 and signet chain parameters inherited
from upstream Bitcoin Core, but neither network is viable:

  • Their ASERT difficulty-anchor fields (nASERTAnchorHeight,
    nASERTAnchorBits, nASERTAnchorTime) are left zero-initialized, so
    the first call into the ASERT DAA dereferences garbage anchor state.
  • Their seeds, assumevalid, and checkpoint values are empty or stale, and
    -signetchallenge handling accepts a network whose genesis and
    difficulty schedule were never adapted to Fractal's consensus changes
    (AuxPoW, indexer blocks, FIP-102 subsidy).

Keeping these half-configured networks selectable via -chain=testnet4
/ -chain=signet is a footgun: the node either crashes in the DAA or
mines/validates against meaningless parameters.

This change removes CTestNet4Params and SigNetParams, the
-testnet4/-signet args, the seed lists, and the related string
plumbing, and makes CreateChainParams reject those chain types with a
clear error. The signet block-solution checker (CheckSignetBlockSolution)
is consensus utility code and is retained; its unit and fuzz coverage is
kept by constructing consensus params locally instead of going through
the removed network definitions.

Test plan: argsman_tests, validation_tests/signet_parse_tests,
pow_tests, key_io_tests, versionbits_tests pass; the signet fuzz
target still builds and runs against locally constructed params.

Both configurations are dead-on-arrival: Consensus::Params::ASERTAnchor
has no default member initializers and neither CTestNet4Params nor
SigNetParams sets asertAnchorParams or nASERTHalfLife (only mainnet and
testnet3 do). Release builds keep assertions enabled, so the first block
validated on those networks hits the asertAnchorParams assert in pow.cpp
over indeterminate memory, or worse, computes garbage nBits and stalls
the chain forever. Both configs also carry Bitcoin's seeds, genesis,
nMinimumChainWork and defaultAssumeValid, which cannot be valid under
Fractal's DAA - these networks never ran this code.

Remove the param classes, their factories, SigNetOptions, and the fixed
seed blobs. CreateChainParams now fails with a clear error for those
chain types, the -testnet4/-signet/-signetchallenge/-signetseednode
options are gone, -chain no longer accepts testnet4/signet, and
GetNetworkForMagic no longer maps their message starts. Help text and
config-section recognition are updated to the three supported networks.

The SIGNET/TESTNET4 ChainType enum values are kept so remaining switch
statements stay exhaustive; their branches are now unreachable.

Tests: drop the testnet4/signet chainparams sanity cases and signet
key_io vectors, narrow the network loops to main/test/regtest, and
regenerate the argsman merge-test golden hash (the chain-conflict error
message changed). signet_parse_tests and the signet fuzz target now
exercise the BIP325 block-solution checker against locally constructed
consensus params instead of network params, keeping that coverage while
signet networks are unsupported.
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.

1 participant