dgb: Stage 4d mining_submit decision SSOT (submit_classify.hpp) [HOLD/surface-for-tap] - #296
Merged
Merged
Conversation
Add coin/submit_classify.hpp: the single place mining_submit places a submission Scrypt pow_hash into one of three outcome classes. Tighten-first ladder (block target checked before share target, so a won block -- a superset of an accepted share -- wins the classification): pow_hash <= block_target -> WonBlock (submit_block_fn_ broadcast) pow_hash <= share_target -> ShareAccept (try_mint_share sharechain mint) otherwise -> Reject Inclusive at BOTH boundaries via the same pow<=target == !(pow>target) gate the header_chain satisfaction check and the nonce grinder run, matching DigiByte Core CheckProofOfWork and p2pool-merged-v36 share-accept -- keeps c2pool-dgb bit-compatible with the daemon and the Python reference. Header-only, depends only on dgb_arith256.hpp (u256): no scrypt, no core, no dgb OBJECT lib -- a pure decision over three integers. 7/7 KAT pins the ladder, both inclusive boundaries, the zero-hash superset case, and a safety invariant that an inverted (malformed) target pair can only mis-Reject, never spurious WonBlock. Registered in both build.yml --target allowlists (#143 trap). mining_submit still returns the stage-4d low-difficulty stub -- no behavior change. The header-reconstruct -> scrypt_pow_hash -> classify -> dispatch wiring that makes this the live-invocation point is the following slice.
frstrtr
added a commit
that referenced
this pull request
Jun 23, 2026
Add coin/submit_classify.hpp: the single place mining_submit places a submission Scrypt pow_hash into one of three outcome classes. Tighten-first ladder (block target checked before share target, so a won block -- a superset of an accepted share -- wins the classification): pow_hash <= block_target -> WonBlock (submit_block_fn_ broadcast) pow_hash <= share_target -> ShareAccept (try_mint_share sharechain mint) otherwise -> Reject Inclusive at BOTH boundaries via the same pow<=target == !(pow>target) gate the header_chain satisfaction check and the nonce grinder run, matching DigiByte Core CheckProofOfWork and p2pool-merged-v36 share-accept -- keeps c2pool-dgb bit-compatible with the daemon and the Python reference. Header-only, depends only on dgb_arith256.hpp (u256): no scrypt, no core, no dgb OBJECT lib -- a pure decision over three integers. 7/7 KAT pins the ladder, both inclusive boundaries, the zero-hash superset case, and a safety invariant that an inverted (malformed) target pair can only mis-Reject, never spurious WonBlock. Registered in both build.yml --target allowlists (#143 trap). mining_submit still returns the stage-4d low-difficulty stub -- no behavior change. The header-reconstruct -> scrypt_pow_hash -> classify -> dispatch wiring that makes this the live-invocation point is the following slice. Co-authored-by: frstrtr <frstrtr@users.noreply.github.com>
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.
Stage 4d slice 1 of the DGB stratum hot path. Adds coin/submit_classify.hpp -- the single place mining_submit classifies a submission Scrypt pow_hash into WonBlock / ShareAccept / Reject, tighten-first (block target before share target). Inclusive at both boundaries via the same pow<=target gate as header_chain + the nonce grinder, mirroring DigiByte Core CheckProofOfWork and p2pool-merged-v36 share-accept.
Header-only (dgb_arith256 u256 only; no scrypt/core/dgb-lib). 7/7 KAT: the ladder, both inclusive boundaries, the zero-hash superset, and a safety invariant that an inverted target pair can only mis-Reject, never spurious-WonBlock. In both build.yml --target allowlists (#143 trap).
No behavior change: mining_submit still returns the low-difficulty stub. The header-reconstruct -> scrypt_pow_hash -> classify -> dispatch(submit_block_fn_ / try_mint_share) wiring that makes this the live-invocation point is the next slice. HOLD -- no self-merge; consensus-bearing decision core, integrator taps.