nmc: P1 PE 2b-ii — pin NMC P2P network magic SSOT (f9beb4fe/fabfb5fe) - #239
Merged
Conversation
Add NMCChainParams::p2p_magic (4-byte pchMessageStart), the frame prefix
every parent-NMC P2P message carries. The embedded won-block broadcaster
(PE) needs it to talk the NMC wire protocol; a wrong/zero magic makes
namecoind drop the peer on EOF before the handshake completes (the failure
main_bch.cpp:138 documents for BCH).
Values sourced from namecoin-core src/kernel/chainparams.cpp pchMessageStart,
NOT from memory:
mainnet CMainParams = f9 be b4 fe
testnet3 CTestNetParams = fa bf b5 fe (pairs with the testnet3 genesis
time=1296688602 pinned in 2b-0)
New NmcP1Genesis.P2PMagicPinned KAT asserts both magics + their inequality
(net-isolation primitive). Rides the allowlisted nmc_auxpow_wire_test exe
-> no build.yml change. SSOT for a follow-on host get_chain_p2p_prefix wire
slice (shared-host hunk, operator-tap). Mainnet GENESIS stays TO-CONFIRM
pending a mainnet namecoind; magic is a published network constant.
Fence: src/impl/nmc/ only.
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.
P1 PE 2b-ii — NMC P2P network-magic SSOT
Adds
NMCChainParams::p2p_magic(4-bytepchMessageStart), the frame prefix every parent-NMC P2P message carries. The embedded won-block broadcaster (PE) needs it to talk the NMC wire protocol — a wrong/zero magic makes namecoind drop the peer on EOF before the handshake completes (the failuremain_bch.cpp:138documents for BCH).Values — sourced, not from memory
From genuine upstream namecoin-core
src/kernel/chainparams.cpppchMessageStart(the same sourcechain_seeds.hppcites):CMainParams=f9 be b4 feCTestNetParams=fa bf b5 fe(pairs with the testnet3 genesis time=1296688602 pinned in 2b-0 nmc(P1 PE 2b-0): pin testnet genesis + chain_id=1 in NMCChainParams #233)Magic is a published network constant (no daemon re-derivation needed), distinct from the genesis hash. Mainnet GENESIS stays TO-CONFIRM pending a mainnet namecoind.
Test
New
NmcP1Genesis.P2PMagicPinnedKAT asserts both magics + their inequality (net-isolation primitive). Rides the allowlistednmc_auxpow_wire_testexe → no build.yml change. Local build + run: 4/4 PASS, exit 0.Fence
src/impl/nmc/only (header_chain.hpp + auxpow_wire_test.cpp). Own-coin-tree, non-consensus, no shared-host file → auto-merge-eligible class.Follow-on
Host
get_chain_p2p_prefixtable currently returns {} (P2P broadcast disabled) for NMC; a follow-on host wire slice references this SSOT (shared-host hunk → operator-tap, like 2b-i #238). Cut off origin/master per the slice-base rule (NOT stacked on #238).