nmc(header-chain): retire stale P0 banners + wire batch add_headers (SPV ingest) - #594
Merged
Merged
Conversation
…ders SPV ingest header_chain.hpp documented the storage/connect/persist path as an unimplemented P0 "structural skeleton", but P1e (in-memory connect + fork-choice) and P1f (LevelDB persist via connect_locked/persist_entry_locked) landed long ago. Retire the now-false P0/P0-DEFER comments (top STATUS banner first bullet, class doc, init(), tip(), add_header()) so the documented state matches the wired code; keep the genuinely-deferred live-node constant cross-check (PE item4) and the accurate batch note. Also implement add_headers(): the one remaining no-op leg. It now runs each header through the same connect_locked path as add_header() under a single lock, returning the count newly connected -- the natural getheaders batch-ingest entry point for SPV header-sync. coin_smoke.cpp force-compiles the batch path.
frstrtr
force-pushed
the
nmc/header-chain-retire-stale-p0-wire-batch-spv
branch
from
June 28, 2026 03:02
3bdaefe to
47f705f
Compare
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
Two coupled NMC header_chain cleanups, btc-fenced, single-coin, zero core / zero bitcoin_family touch (slice off origin/master).
1. Retire stale P0/P0-DEFER comments.
header_chain.hppstill documented the storage/connect/persist path as an unimplemented "structural skeleton" with a P0 fence. That is false: P1e (in-memory connect + cumulative-work + fork-choice) and P1f (LevelDB persist viaconnect_locked()/persist_entry_locked()) landed long ago (e.g. #494/#497/#546). Retired the now-false comments on the top STATUS banner (first bullet), the class doc,init(),tip(), andadd_header()so the documented state matches the wired code. Kept the genuinely-deferred live-node constant cross-check (PE item4 soak) and the accurate batch note. Prevents a reviewer (or me) from re-doing already-landed PA work.2. Implement
add_headers()— the one remaining no-op leg (previouslyreturn 0). It now runs each header through the sameconnect_locked()path asadd_header()under a single lock, returning the count newly connected. This is the natural getheaders batch-ingest entry point for SPV header-sync (the approved PA milestone).coin_smoke.cppforce-compiles the batch path.Test
nmc_coinbuilds clean.Scope / isolation
Per-coin isolation invariant held: namespace
nmc::coinonly; no shared core / bitcoin_family touch -> no EXCEPTIONAL review trigger. External namecoind RPC fallback untouched.Fast-follow
Dedicated batch-ingest KAT (ascending / gapped / out-of-order ordering assertions) — no GTest HeaderChain harness exists in src/impl/nmc/test yet; building one is a follow slice.