Skip to content

dgb: Stage 4d mining_submit decision SSOT (submit_classify.hpp) [HOLD/surface-for-tap] - #296

Merged
frstrtr merged 1 commit into
masterfrom
dgb/82-4d-submit-classify-ssot
Jun 21, 2026
Merged

dgb: Stage 4d mining_submit decision SSOT (submit_classify.hpp) [HOLD/surface-for-tap]#296
frstrtr merged 1 commit into
masterfrom
dgb/82-4d-submit-classify-ssot

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 21, 2026

Copy link
Copy Markdown
Owner

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.

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
frstrtr merged commit a558f0f into master Jun 21, 2026
29 checks passed
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>
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