Skip to content

dash(S8): CoinStateMaintainer populates NodeCoinState off tip/MN/mempool updates (stacks on #673)#674

Merged
frstrtr merged 1 commit into
masterfrom
dash/s8-coin-state-maintainer
Jul 12, 2026
Merged

dash(S8): CoinStateMaintainer populates NodeCoinState off tip/MN/mempool updates (stacks on #673)#674
frstrtr merged 1 commit into
masterfrom
dash/s8-coin-state-maintainer

Conversation

@frstrtr

@frstrtr frstrtr commented Jul 11, 2026

Copy link
Copy Markdown
Owner

Slice 7 of the S8 embedded_gbt live-wire lane; stacks on #673 (which stacks on #672). Merge order: #672 -> #673 -> #674.

What

The maintainer that POPULATES the node-held NodeCoinState off the async reception + think update path, replacing the set_tip-on-demand pattern where a caller poked NodeCoinState::set_tip() directly.

  • src/impl/dash/coin/coin_state_maintainer.hpp: on_mn_list_update / on_mempool_tx / on_new_tip / on_invalidate event methods over a node-owned NodeCoinState&. Readiness gate: republish (set_tip) ONLY when a non-empty MN list AND a tip are both present, in either order. Empty mnlistdiff (gap) and reorg demote to the retained dashd fallback; a reorg drops the tip so a fresh tip is required to re-arm (no stale-prev auto-republish). Mempool optional for viability (empty => valid coinbase-only template).
  • test/test_dash_coin_state_maintainer.cpp: 4 KATs.

Constraints (per integrator, this thread)

  • Strictly single-coin: src/impl/dash/coin/ only; the src header includes only impl/dash/coin/* + core/uint256. No bitcoin_family / src/core reach. gh pr diff 674 --name-only = 4 files (src header, test, test/CMakeLists.txt, build.yml).
  • Maintainer-path proof (the ask): KATs prove the bundle flips has_state=true on a live tip+MN update in BOTH orders, byte-equal to a direct build_embedded_workdata() incl. a routed mempool tx (fee 10000 confirmed reaching the template), and demotes on empty-MN gap / reorg.
  • dashd RPC fallback retained as the always-reachable [GBT-XCHECK] safety path; populated()==false always routes there.

Test

test_dash_coin_state_maintainer 4/4 PASS (run directly from build/; registered in BOTH build.yml --target allowlists). Reconfig cmake rc=0, target builds+links clean.

No self-merge — integrator verify (diff scope + oracle parity pin: embedded_gbt.hpp untouched, test_dash_embedded_gbt 8/8) + operator tap for anything consensus-bearing.

…ool updates (stacks on #673)

The maintainer that flips the node-held embedded coin-state bundle live off
the async reception + think update path, replacing the set_tip-on-demand
pattern (#673 left publication to whoever poked NodeCoinState::set_tip).

- src/impl/dash/coin/coin_state_maintainer.hpp: on_mn_list_update /
  on_mempool_tx / on_new_tip / on_invalidate event methods over a node-owned
  NodeCoinState&. Readiness gate: republish (set_tip) ONLY when a non-empty
  MN list AND a tip are both present, in either order. Empty mnlistdiff (gap)
  and reorg demote to the retained dashd fallback; a reorg drops the tip so a
  fresh tip is required to re-arm (no stale-prev auto-republish). Mempool is
  optional for viability (empty => valid coinbase-only template).
- test/test_dash_coin_state_maintainer.cpp: 4 KATs proving the bundle flips
  has_state=true only on a live tip+MN update (both orders), byte-equal to a
  direct build_embedded_workdata() incl. a routed mempool tx, and demotes on
  empty-MN gap / reorg. Registered in both build.yml --target allowlists.

STRICTLY single-coin: impl/dash/coin/ only, no bitcoin_family / src/core reach.
dashd RPC fallback retained as the always-reachable [GBT-XCHECK] safety path.
@frstrtr frstrtr changed the base branch from dash/s8-node-coin-state to master July 11, 2026 19:16
@frstrtr frstrtr merged commit 48e93de into master Jul 12, 2026
2 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