Skip to content

test(dash): S8 job-notify round-trip KAT — merkle branch binds coinbase to canonical root#632

Merged
frstrtr merged 1 commit into
masterfrom
ci-steward/dash-s8-job-notify-roundtrip
Jul 4, 2026
Merged

test(dash): S8 job-notify round-trip KAT — merkle branch binds coinbase to canonical root#632
frstrtr merged 1 commit into
masterfrom
ci-steward/dash-s8-job-notify-roundtrip

Conversation

@frstrtr

@frstrtr frstrtr commented Jul 4, 2026

Copy link
Copy Markdown
Owner

DASH S8 stratum-binding suite — job-notify round-trip KAT (final leaf)

Closes the S8 stratum-binding contract suite. The two prior leaves pin the
get_work()->job half:

This leaf pins the remaining notify->submit seam: the mining.notify
merkle branch — computed once per job — must fold the miner's reassembled
coinb1 || extranonce2 || coinb2 back to the same canonical merkle root
the pool derives over the full tx list, for every extranonce2. That
equality is the whole reason a miner iterates the slot locally without
re-fetching the job; if the branch did not bind, every submit would carry a
root the pool rejects.

What it pins

  1. Branch depth for a 4-leaf tree (two siblings, one per level).
  2. Round-trip identity: zero extranonce2 → miner walk reproduces the pool root byte-for-byte.
  3. Round-trip under iteration: the same branch binds distinct extranonce2 values back to their matching canonical roots.
  4. Root injectivity: distinct extranonce2 → distinct block merkle root (search-space partition).
  5. Wire form: merkle branch is LE internal-bytes hex (stratum.py convention), not the reversed display form.
  6. Golden merkle-root byte-parity anchors.

Non-circular guard

Every expected value is derived from an independent Python sha256d merkle
walk
, not from the SUT. The leaf0 anchors match test_dash_stratum_binding
exactly, confirming a shared coinbase layout. The pool-side canonical root is
computed in-test with a standard merkle reduction, separate from
merkle_branches_raw, so the round-trip equality is a real cross-check rather
than a tautology.

Oracle

frstrtr/p2pool-dash @9a0a609 — dash/stratum.py (LE merkle-branch packing) +
p2pool/work.py:421,436-437 (coinb1/coinb2 split).

Scope / safety

Pure, socket-free, node-free synthetic layout — no dashd, no live sharechain,
no template build. DASH-tree-fenced: adds test/test_dash_job_notify_roundtrip.cpp
plus its test/CMakeLists.txt registration and the two build.yml allowlist
entries only. Non-consensus, additive, GO-independent. Merge-gated on full
green — no self-merge.

…mbled coinbase to canonical root

Final leaf of the S8 stratum-binding suite. Pins the notify->submit seam:
the mining.notify merkle_branch (sent once per job) must fold the miners
reassembled coinb1||extranonce2||coinb2 back to the SAME canonical merkle
root the pool computes over the full tx list, for every extranonce2. That
equality is why a miner iterates the slot locally without re-fetching.

Oracle: p2pool-dash @9a0a609 dash/stratum.py (LE merkle-branch packing) +
work.py:421,436-437 (coinb1/coinb2 split). All goldens from an independent
Python sha256d walk; leaf0 anchors match test_dash_stratum_binding. Pure /
socket-free / node-free synthetic layout; DASH-tree-fenced (test/ +
CMakeLists + build.yml allowlist only), non-consensus.
@frstrtr frstrtr force-pushed the ci-steward/dash-s8-job-notify-roundtrip branch from 2d403f2 to dfc1000 Compare July 4, 2026 19:58
@frstrtr frstrtr merged commit ecf7f02 into master Jul 4, 2026
22 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