bch(g3): --testnet4 net-params path -- magic e2b7daaf + own-genesis selector - #615
Merged
Conversation
…elector Wire BCH testnet4 into the c2pool-bch --pool entrypoint so the embedded daemon selects testnet4 consensus params instead of falling back to testnet3. Prior: run_pool had no testnet4 branch, so it emitted testnet3 magic f4e5f3f4 + testnet3 genesis; BCHN EOF-dropped the peer right after connect and HeaderChain stuck at h0. - config_coin.hpp: m_testnet4 flag (testnet-class for ABLA/ASERT). - embedded_daemon.hpp: select BCHChainParams::testnet4() (own genesis 000000001dd4.., ASERT anchor 16844) when m_testnet4. - main_bch.cpp: --testnet4 arg (port 28333); bch_magic_bytes() emits e2b7daaf (CTestNet4Params, verified vs bchn29 rodata); run_pool threads testnet4 through magic / params / banner label. testnet4() + asert_testnet4() consensus constants already in master; this is CLI + selector wiring only. Behavioural proof: --pool --testnet4 vs a testnet4 BCHN substrate handshakes off h0 (start_height=312925, BCHN 29.0.0), EOF-drop gone, HeaderChain advances past h0. No p2pool-merged-v36 surface change (subsidy / payout / version-gate untouched) -> surface-for-tap. Per-coin isolation intact: only src/impl/bch/ plus the c2pool-bch-exclusive main_bch.cpp entrypoint; no src/core / bitcoin_family / peer-coin hunks. Cosmetic follow-up (tracked, non-consensus): leveldb path + BCHWorkSource still label bitcoincash_testnet for testnet4; magic/genesis/P2P path proven correct by sync off the real testnet4 chain.
frstrtr
force-pushed
the
bch/testnet4-magic-path
branch
from
July 3, 2026 18:48
bf372f4 to
ea739ee
Compare
frstrtr
added a commit
that referenced
this pull request
Jul 3, 2026
bch(g3): testnet4 own LevelDB sharechain namespace (stacked on #615)
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.
What
Wire BCH testnet4 into the
c2pool-bch --poolentrypoint so the embedded daemon selects testnet4 consensus params instead of falling back to testnet3.Root cause (prior):
run_poolhad no testnet4 branch -> emitted testnet3 magicf4e5f3f4+ testnet3 genesis -> BCHN EOF-dropped the peer right after connect -> HeaderChain stuck at h0.Hunks (3 files)
src/impl/bch/config_coin.hpp—m_testnet4flag (testnet-class for ABLA/ASERT).src/impl/bch/coin/embedded_daemon.hpp— selectBCHChainParams::testnet4()(own genesis000000001dd4.., ASERT anchor 16844) whenm_testnet4.src/c2pool/main_bch.cpp—--testnet4arg (port 28333);bch_magic_bytes()emitse2b7daaf(CTestNet4Params, verified vs bchn29 rodata);run_poolthreads testnet4 through magic / params / banner.testnet4()+asert_testnet4()consensus constants already live in master — this is CLI + selector wiring only.Proof
Build GREEN (link EXIT=0). Behavioural:
--pool --testnet4vs a testnet4 BCHN substrate handshakes off h0 (start_height=312925, BCHN 29.0.0), EOF-drop gone, HeaderChain advances past h0 (2000->4000/312925 climbing).Isolation / compat
src/impl/bch/+ the c2pool-bch-exclusivemain_bch.cppentrypoint. Nosrc/core/bitcoin_family/ peer-coin hunks.Follow-up (tracked, non-consensus)
Cosmetic leveldb path + BCHWorkSource still label
bitcoincash_testnetfor testnet4; magic/genesis/P2P path proven correct by sync off the real testnet4 chain. Separate label-harmonization slice.Do NOT self-merge — integrator merges on operator tap.