chainparams: remove dead testnet4 and signet support - #24
Open
Avecci-Claussen wants to merge 1 commit into
Open
Avecci-Claussen wants to merge 1 commit into
Avecci-Claussen wants to merge 1 commit into
Conversation
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.
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.
Fractal Bitcoin ships
testnet4andsignetchain parameters inheritedfrom upstream Bitcoin Core, but neither network is viable:
nASERTAnchorHeight,nASERTAnchorBits,nASERTAnchorTime) are left zero-initialized, sothe first call into the ASERT DAA dereferences garbage anchor state.
-signetchallengehandling accepts a network whose genesis anddifficulty 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=signetis a footgun: the node either crashes in the DAA ormines/validates against meaningless parameters.
This change removes
CTestNet4ParamsandSigNetParams, the-testnet4/-signetargs, the seed lists, and the related stringplumbing, and makes
CreateChainParamsreject those chain types with aclear 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_testspass; thesignetfuzztarget still builds and runs against locally constructed params.