Skip to content

test(dash-s8): stratum-binding contract harness — job target -> wire difficulty#629

Closed
frstrtr wants to merge 1 commit into
masterfrom
ci-steward/dash-s8-stratum-binding
Closed

test(dash-s8): stratum-binding contract harness — job target -> wire difficulty#629
frstrtr wants to merge 1 commit into
masterfrom
ci-steward/dash-s8-stratum-binding

Conversation

@frstrtr

@frstrtr frstrtr commented Jul 4, 2026

Copy link
Copy Markdown
Owner

S8 stratum-binding contract harness (test-only, fenced)

Next warm-lane slice per the migration groundwork: the S8 binding layer, which the existing get_work() KATs (test_dash_work_target, test_dash_work_job_targets) do not cover. Those pin the pure target arithmetic; this pins how an assembled uint256 job target becomes the mining.set_difficulty value the miner receives.

Contract pinned

  • X11 multiplier == 1, not scrypt's 2**16. The shared core::stratum::StratumConfig defaults to set_difficulty_multiplier = 65536.0 (scrypt LTC/DOGE); a DASH work source must override to 1.0. Oracle: frstrtr/p2pool-dash @9a0a609 networks/dash.py DUMB_SCRYPT_DIFF.
  • target → wire difficulty: target_to_difficulty(target) * multiplier, diff-1 == 0xFFFF*2**208. Vectors 1.0 / 16.0 / 256.0 pinned exact.
  • job round-trip: min_share_target (share floor) never harder than share_target (vardiff); clip-to-SANE honoured at the byte level before difficulty is computed; over-hard client vardiff clips UP to sane_min (~10000 dash mainnet).

Every expected difficulty derived independently from the oracle integer relations, not read back from the SUT.

Scope

Fenced to test/test_dash_stratum_binding.cpp (new), test/CMakeLists.txt, and the build.yml test allowlist (both matrix lines). Header-only, pure, socket-free, node-free — no VM200/201 dashd, no live sharechain. Non-consensus; independent of the migration operator GO. No self-merge — merge-gated on FULL green CI rollup.

…difficulty

Pins the S8 BINDING layer the get_work() KATs do not cover: how an assembled
uint256 job target (assemble_work_job_targets) becomes the mining.set_difficulty
value a miner receives.

Contract pinned (test-only, header-only over work_job_targets.hpp +
core/target_utils + core/stratum_types; pure, socket-free, node-free):
  - X11 DUMB_SCRYPT_DIFF multiplier == 1 (NOT scrypt 2**16); the shared
    core::stratum::StratumConfig defaults to 65536, so a DASH work source must
    override set_difficulty_multiplier to 1.0.
  - target -> wire difficulty: target_to_difficulty(target) * multiplier, diff-1
    == 0xFFFF*2**208; 1.0 / 16.0 / 256.0 vectors pinned exact.
  - job round-trip: min_share (share floor) never harder than share_target
    (vardiff); clip-to-SANE honoured at byte level before difficulty is computed;
    over-hard client vardiff clips UP to sane_min (~10000 dash mainnet).

Expected difficulties derived independently from oracle integer relations
(frstrtr/p2pool-dash @9a0a609 networks/dash.py DUMB_SCRYPT_DIFF; work.py
get_work), not read back from the SUT. Fenced to test/ + build.yml allowlist;
non-consensus, independent of the migration operator GO.
@frstrtr

frstrtr commented Jul 4, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #630 (identical test_dash_stratum_binding.cpp; #630 also wires the build.yml gate and is CLEAN). Closing to keep one canonical PR.

@frstrtr frstrtr closed this Jul 4, 2026
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