Skip to content

dash(s7): mn_state_machine leaf — providertx + mn_state_db + mn_state_machine + KAT - #352

Merged
frstrtr merged 1 commit into
masterfrom
dash/s7-mn-state-leaf
Jun 23, 2026
Merged

dash(s7): mn_state_machine leaf — providertx + mn_state_db + mn_state_machine + KAT#352
frstrtr merged 1 commit into
masterfrom
dash/s7-mn-state-leaf

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 23, 2026

Copy link
Copy Markdown
Owner

DASH S7 — mn_state_machine leaf

The last absent header before the embedded_gbt capstone. Ports the DASH masternode state-machine that turns the SimplifiedMNList leaf (#309) into a live, auto-maintained DMN list the embedded-GBT payee projection consumes.

Files

  • src/impl/dash/coin/vendor/providertx.hpp — CProRegTx / CProUpServTx / CProUpRegTx / CProUpRevTx wire (de)serialization with nVersion/nType field gating + parse_protx_payload full-consume / trailing-garbage rejection.
  • src/impl/dash/coin/mn_state_db.hppMNState internal persistence wire round-trip.
  • src/impl/dash/coin/mn_state_machine.hppapply_block RebuildListFromBlock semantics (register / update-service / update-registrar / revoke / collateral spend / payee resolution), find_expected_payee + pick_paid_mn memcmp tiebreak, sync_validity_from_sml.
  • test/test_dash_mn_state.cpp — KAT (23 cases).

KAT philosophy

Mirrors test_dash_simplifiedmns.cpp: every assertion is a structural round-trip (serialize -> deserialize -> EQ), a bit-exact wire-length preimage, or an algorithm self-consistency property. No fabricated "expected" hashes.

Verification (Linux x86_64, GCC 13)

  • Configure + build test_dash_mn_state: green.
  • ctest -R DashMnState from build/: 100% tests passed, 0 tests failed out of 23 (non-hollow, real count).
  • CI test-allowlist drift-guard: OK. Registered in test/CMakeLists.txt (mirrors the simplifiedmns / quorum_root block incl. OBJECT-lib SCC direct-naming) and added to both --target lists in .github/workflows/build.yml.

Scope (honest)

The end-to-end cross-check — apply_block over a REAL Dash mainnet special-tx block matching dashd protx list — requires a live Dash node oracle (mnlistdiff) and is deferred to the embedded_gbt integration leaf. It is not claimed here. The dashd-RPC fallback is preserved.

Draft — held for integrator verify + operator tap. Do not merge.

@frstrtr
frstrtr marked this pull request as ready for review June 23, 2026 10:03
@frstrtr
frstrtr merged commit d1f5053 into master Jun 23, 2026
29 of 31 checks passed
frstrtr added a commit that referenced this pull request Jun 23, 2026
Ports the DASH embedded GetBlockTemplate projection and its bit-parity
cross-check against the dashd-RPC shadow. Closes the S7 absent-header set
(mn_state_machine #352 is the last leaf this consumes).

embedded_gbt.hpp builds the coinbase value, masternode payment payee
projection, and packed_payments from the live mn_state_machine DMN list,
then DashEmbeddedGbt KAT asserts bit-exact equality against the dashd
getblocktemplate shadow and detects coinbase_value / payee /
packed_payments-size drift. dashd-RPC fallback preserved.

ctest DashEmbeddedGbt: 7/7 passed (non-hollow, Linux x86_64 GCC 13).
frstrtr added a commit that referenced this pull request Jun 23, 2026
…_machine + KAT (#352)

Co-authored-by: frstrtr <frstrtr@users.noreply.github.com>
frstrtr added a commit that referenced this pull request Jun 23, 2026
Ports the DASH embedded GetBlockTemplate projection and its bit-parity
cross-check against the dashd-RPC shadow. Closes the S7 absent-header set
(mn_state_machine #352 is the last leaf this consumes).

embedded_gbt.hpp builds the coinbase value, masternode payment payee
projection, and packed_payments from the live mn_state_machine DMN list,
then DashEmbeddedGbt KAT asserts bit-exact equality against the dashd
getblocktemplate shadow and detects coinbase_value / payee /
packed_payments-size drift. dashd-RPC fallback preserved.

ctest DashEmbeddedGbt: 7/7 passed (non-hollow, Linux x86_64 GCC 13).
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