nmc(card237): wire-vector KAT — real mainnet auxpow round-trip - #218
Merged
Conversation
Pin the canonical Namecoin CAuxPow wire layout (AuxPow::Serialize / Unserialize) against a GENUINE mainnet block: namecoin-cli getblock 47589169f94e3e77bf4da8067e76b4417b021f0eb10760995671856f21b8d4b4 0 (block 757000, merge-mined under a BTC/AntPool parent coinbase). The KAT deserializes the 80-byte NMC header (asserts base version 4, auxpow flag, chain_id 1), deserializes the AuxPow, re-serializes it, and requires byte-for-byte reproduction of the mainnet auxpow region. The vector is external truth from the daemon, not a self-derived fixture, so a field-order / int-width / witness-stripping deviation diverges here rather than being mirrored. Fenced to src/impl/nmc/ (core + nmc::coin only; btc tree untouched). Registered in test/CMakeLists.txt AND the build.yml --target allowlist (both jobs) to avoid the #137 NOT_BUILT sentinel.
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.
Pins the canonical Namecoin
CAuxPowwire layout against a genuine mainnet block —namecoin-cli getblock 47589169...b8d4b4 0, block 757000, merge-mined under a BTC/AntPool parent coinbase (pulled from the pruned mainnet node on VM 219/.140, card 237).What it tests
0x100, chain_id 1.AuxPow, re-serialize it, and require byte-for-byte reproduction of the mainnet auxpow region[80, 80+len). External daemon truth, not a self-derived fixture — a field-order / int-width / witness-stripping bug diverges here instead of being mirrored.CMerkleTx hashBlockis legitimately null in auxpow blobs (parent linkage is the separateparent_header); the round-trip proves we preserve that zero verbatim.Fence / CI:
src/impl/nmc/only (core + nmc::coin; btc tree untouched). Registered intest/CMakeLists.txtand thebuild.yml--targetallowlist (both Linux jobs) to avoid the #137 NOT_BUILT sentinel.1 test, green locally (
nmc_auxpow_wire_test).