nmc(P1e): activation-height gate + in-memory storage leg (re-target #190+#192 -> master) - #193
Merged
Conversation
check_activation_gate(height, has_auxpow) -> AdmitResult: below activation an AuxPow is premature, at/after activation (mainnet) it is mandatory; refuses to judge (REJECT_UNPINNED) while auxpow_activation_height stays the -1 sentinel so no verdict is rendered off a placeholder. Factored like the P1d verify_auxpow_header gate so it is unit-testable independent of the still-deferred storage path. +4 KATs (30->34), rides the existing build.yml-allowlisted nmc_auxpow_merkle_test target. NMC-only under src/impl/nmc/, btc tree READ-ONLY.
Build the connect path behind the P1d proof gate and the P1e activation gate: a header that passes verification is now CONNECTED into the in-memory index instead of being dropped (both add paths previously returned false). connect_locked() (shared by add_header / add_auxpow_header, mutex held): seeds the chain root on an empty chain (height 0, checkpoint anchor), otherwise links by m_previous_block (unknown parent -> orphan reject), derives height = parent+1, runs check_activation_gate() on the connected height (premature/missing-auxpow/unpinned all reject), then inserts the IndexEntry and advances the tip (height-proxy fork choice). Idempotent on a known hash. While auxpow_activation_height is the -1 sentinel the gate returns REJECT_UNPINNED so production builds nothing off a placeholder. Deferred to the next sub-leg: difficulty/PoW validation, cumulative-work summation, work-based reorg, LevelDB persistence. +6 KATs (NmcP1eStore) 34->40, full Nmc suite green; rides the allowlisted nmc_auxpow_merkle_test, no CMake/CI change.
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.
Re-PR of the NMC P1e stack that merged into stale intermediate branches when the batch retarget hit a GraphQL error. Both commits are genuinely missing from master 39ef837; merge-tree shows ZERO conflicts.
Linear 2-commit stack (correct order):
Foundations already on master: P1c #184/#185 (1e85e7e), P1d #189 (be5b1ef).
KATs: 34 green after activation gate -> 40 green after storage leg.
I do not self-merge — verify + merge at your discretion.