Skip to content

nmc(P1e): activation-height gate + in-memory storage leg (re-target #190+#192 -> master) - #193

Merged
frstrtr merged 2 commits into
masterfrom
nmc/p1e-storage-leg
Jun 19, 2026
Merged

nmc(P1e): activation-height gate + in-memory storage leg (re-target #190+#192 -> master)#193
frstrtr merged 2 commits into
masterfrom
nmc/p1e-storage-leg

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 19, 2026

Copy link
Copy Markdown
Owner

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):

  1. 9603f53 nmc(P1e): factor activation-height admission gate + 4 KATs (was PR nmc(P1e): activation-height admission gate + 4 KATs (stacked on #189) #190)
  2. 9cfa9b3 nmc(P1e): in-memory header connect path (storage leg) + 6 KATs (was PR nmc(P1e): in-memory header connect path (storage leg) + 6 KATs #192, stacked)

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.

frstrtr added 2 commits June 19, 2026 05:23
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.
@frstrtr
frstrtr merged commit 871a91d into master Jun 19, 2026
16 checks passed
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