Skip to content

nmc(P1f-a): canonical CAuxPow Serialize + persist auxpow blob behind has_auxpow - #202

Merged
frstrtr merged 2 commits into
masterfrom
nmc/p1f-auxpow-wire
Jun 19, 2026
Merged

nmc(P1f-a): canonical CAuxPow Serialize + persist auxpow blob behind has_auxpow#202
frstrtr merged 2 commits into
masterfrom
nmc/p1f-auxpow-wire

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 19, 2026

Copy link
Copy Markdown
Owner

Sub-leg (a) of NMC P1f, per integrator GO (port the canonical Namecoin CAuxPow wire layout, fenced to src/impl/nmc/). Stacked on #201.

What

  • nmc::coin::AuxPow gains Serialize/Unserialize: a byte-faithful port of Namecoin CAuxPow / classic Bitcoin auxpow field order — CMerkleTx coinbase leg (parent_coinbase TX_NO_WITNESS, parent_block_hash, parent_coinbase_branch, parent_coinbase_index) -> chain-merkle leg (chain_merkle_branch, chain_merkle_index) -> parent_header (80-byte CPureBlockHeader). Parent coinbase is witness-stripped to match the txid the parent tx-merkle tree commits (same stance as parent_coinbase_txid()).
  • IndexEntryDiskV1 now persists the blob behind has_auxpow (write iff ==1; restore in to_entry()); the nmc(P1f): HeaderChain LevelDB persistence (h/tip/height) + 6 KATs (52->58) #201 deferred flag-only leg is removed.
  • +2 KATs: codec full round-trip + still-VALID through check_proof; IndexEntryDiskV1 blob round-trip (+ proofless => nullopt). nmc(P1f): HeaderChain LevelDB persistence (h/tip/height) + 6 KATs (52->58) #201 deferred-blob test updated to assert restoration. 64->66 green.

Fence

Touches src/impl/nmc/ only — no bitcoin_family/ or src/core/. Target nmc_auxpow_merkle_test already in build.yml allowlist (no CI change).

Consensus note / merge handling

Adds a consensus serialization shape — per integrator this does NOT auto-merge: CI-verify, then operator tap. Immediate follow-up: ground-truth wire-vector assertion serializing a captured Namecoin testnet auxpow and asserting the daemon bytes (KAT currently self-round-trips + verifies).

…has_auxpow

Port the Namecoin CAuxPow wire layout to nmc::coin::AuxPow::Serialize/Unserialize
(CMerkleTx coinbase leg -> chain-merkle leg -> parent header, daemon field order;
parent coinbase TX_NO_WITNESS to match the committed txid). Persist the blob in
IndexEntryDiskV1 behind has_auxpow and restore it in to_entry(); the deferred
flag-only leg is removed. Fenced to src/impl/nmc/ only. +2 KATs (codec round-trip
+ still-VALID; IndexEntryDiskV1 blob round-trip) and the #201 deferred-blob test
updated to assert restoration. 64->66 green.
@frstrtr
frstrtr changed the base branch from nmc/p1f-leveldb-persist to master June 19, 2026 12:51
@frstrtr
frstrtr merged commit d8b4023 into master Jun 19, 2026
19 checks passed
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