Skip to content

nmc(header-chain): retire stale P0 banners + wire batch add_headers (SPV ingest) - #594

Merged
frstrtr merged 1 commit into
masterfrom
nmc/header-chain-retire-stale-p0-wire-batch-spv
Jun 28, 2026
Merged

nmc(header-chain): retire stale P0 banners + wire batch add_headers (SPV ingest)#594
frstrtr merged 1 commit into
masterfrom
nmc/header-chain-retire-stale-p0-wire-batch-spv

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 28, 2026

Copy link
Copy Markdown
Owner

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.hpp still 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 via connect_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(), and add_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 (previously return 0). It now runs each header through the same connect_locked() path as add_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.cpp force-compiles the batch path.

Test

  • nmc_coin builds clean.
  • nmc suite green: nmc_template_builder_test (17), nmc_host_dualpath_test (5), nmc_fallback_path_conformance_test (3) all PASS.

Scope / isolation

Per-coin isolation invariant held: namespace nmc::coin only; 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.

…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
frstrtr force-pushed the nmc/header-chain-retire-stale-p0-wire-batch-spv branch from 3bdaefe to 47f705f Compare June 28, 2026 03:02
@frstrtr
frstrtr merged commit f34473f into master Jun 28, 2026
22 checks passed
@frstrtr
frstrtr deleted the nmc/header-chain-retire-stale-p0-wire-batch-spv branch June 28, 2026 07:15
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