test(dash-s8): stratum-binding contract harness — job target -> wire difficulty#629
Closed
frstrtr wants to merge 1 commit into
Closed
test(dash-s8): stratum-binding contract harness — job target -> wire difficulty#629frstrtr wants to merge 1 commit into
frstrtr wants to merge 1 commit into
Conversation
…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.
This was referenced Jul 4, 2026
Owner
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 assembleduint256job target becomes themining.set_difficultyvalue the miner receives.Contract pinned
core::stratum::StratumConfigdefaults toset_difficulty_multiplier = 65536.0(scrypt LTC/DOGE); a DASH work source must override to1.0. Oracle:frstrtr/p2pool-dash @9a0a609 networks/dash.pyDUMB_SCRYPT_DIFF.target_to_difficulty(target) * multiplier, diff-1 ==0xFFFF*2**208. Vectors 1.0 / 16.0 / 256.0 pinned exact.min_share_target(share floor) never harder thanshare_target(vardiff); clip-to-SANE honoured at the byte level before difficulty is computed; over-hard client vardiff clips UP tosane_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 thebuild.ymltest 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.