nmc(P1f): HeaderChain::get_locator — BIP31 block locator (+6 KATs, 52->58) - #199
Closed
frstrtr wants to merge 1 commit into
Closed
nmc(P1f): HeaderChain::get_locator — BIP31 block locator (+6 KATs, 52->58)#199frstrtr wants to merge 1 commit into
frstrtr wants to merge 1 commit into
Conversation
…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.
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.
P1f — block locator (NMC HeaderChain)
P1e is complete (#197). This opens P1f:
HeaderChain::get_locator()— the getheaders locator the SPV header-sync path needs.What it does
m_previous_block: dense near the tip, stride doubles past the first 10 entries, chain root always anchored.src/impl/btc/coin/header_chain.hppshape.Tests
+6 KATs (empty / single / dense-short / long-contiguous+root-anchored / backoff-stride / follows-tip-after-work-reorg). Full
nmc_auxpow_merkle_testsuite 52 -> 58 green; build clean.Stacking
Based on #197 (
nmc/p1e-work-reorg-forkchoice). Rebase to master once #197 lands. I do not self-merge.