Skip to content

nmc(P1f): HeaderChain::get_locator — BIP31 block locator over tip ancestry - #200

Merged
frstrtr merged 1 commit into
masterfrom
nmc/p1f-header-locator
Jun 19, 2026
Merged

nmc(P1f): HeaderChain::get_locator — BIP31 block locator over tip ancestry#200
frstrtr merged 1 commit into
masterfrom
nmc/p1f-header-locator

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 19, 2026

Copy link
Copy Markdown
Owner

Revived from #199 (collaterally auto-closed when #197 merge deleted its stack base nmc/p1e-work-reorg-forkchoice). Rebased onto master @bd1f0e26, head 04b3c8f.

P1f get_locator() leg: BIP31 block locator walking tip ancestry via m_previous_block (exponential step-back, no height index), mirroring btc HeaderChain. Pure mechanism, no consensus value.

NMC tree only: src/impl/nmc/coin/header_chain.hpp + src/impl/nmc/test/auxpow_merkle_test.cpp. +6 KATs, suite 52->58 green.

Fenced-skeleton: NMC-only, no shared/other-coin surface.

…estry

Build a getheaders block locator by walking the tip ancestry through
m_previous_block with BIP31-style exponential backoff: dense near the
tip, doubling the stride past the first 10 entries, chain root always
anchored. Walking parent links follows the best chain we just
fork-chose, so the locator stays correct across reorgs without a
separate height index. Mirrors src/impl/btc/coin/header_chain.hpp.

+6 KATs (empty / single / dense-short / long-contiguous-anchored /
backoff / follows-tip-after-reorg); suite 52 -> 58 green.
@frstrtr
frstrtr merged commit 771f586 into master Jun 19, 2026
18 checks passed
frstrtr added a commit that referenced this pull request Jun 19, 2026
…->64)

Rebased onto master (771f586) post-#200/get_locator. Persists every accepted entry under "h"+block_hash (IndexEntryDiskV1), plus tip/height pointers, in one synced WriteBatch; init() restores m_index/m_tip/m_tip_height/m_best_work via load_from_db(). NMC has no height-index (full-residency m_index), so no "i" key. Auxpow blob deferred (presence flag only). Coexists with get_locator: 6 persist KATs + 6 locator KATs = 58->64 green.
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