Skip to content

dgb: saturating uint288 emergency-decay shift + proving KAT - #562

Merged
frstrtr merged 1 commit into
masterfrom
dgb/emergency-decay-saturating-shift
Jun 27, 2026
Merged

dgb: saturating uint288 emergency-decay shift + proving KAT#562
frstrtr merged 1 commit into
masterfrom
dgb/emergency-decay-saturating-shift

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 27, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes a consensus-bearing overflow in the DGB sharechain emergency-decay difficulty path. The "eased" max_bits adjustment shifted in a width that wraps at its modulus during a prolonged share drought, producing a ~50-68 min death-spiral gap where the SUT diverges from the oracle (which saturates to MAX).

Change: perform the emergency-decay shift in uint288 with an explicit saturating clamp to MAX, matching frstrtr/p2pool-dgb-scrypt get_decayed_cumulative_weights reduction semantics. Verified bit-for-bit equal to the oracle across a full sparse-prev by horizon sweep (5 prev values, h=0..255, plus interpolation points).

Scope / fencing

  • src/impl/dgb/coin/share_tracker.hpp — uint288 incremental saturate in the emergency-decay shift.
  • src/impl/dgb/test/emergency_decay_saturation_test.cpp — new proving KAT (suite EmergencyDecaySaturation.*, ctest d-miner5(p1): transport-agnostic miner notification engine (evaluator + core + email adapter) #552-555), oracle-pinned, non-circular.
  • src/impl/dgb/test/CMakeLists.txt — wires the new test (full SCC link).
  • .github/workflows/build.yml — adds dgb_emergency_decay_saturation_test to BOTH coin-matrix allowlists so it is built and run, not a NOT_BUILT sentinel.

Fenced to src/impl/dgb plus the new KAT plus CI allowlist. No edits to shared base, ltc, doge, or bitcoin_family.

Bucket classification

Bucket-2 (v36-native shared structure): the uint288 saturating-shift semantics here are the reference std for the other Scrypt-family coins. ltc-doge cc'd to confirm reduction-order parity against the oracle thread.

Compat

Backward-compatible with the DGB older baseline during the crossing window; conforms to frstrtr/p2pool-dgb-scrypt oracle. No p2pool-merged-v36 divergence introduced.

Verification

  • EmergencyDecaySaturation.* KAT: oracle-equal across full sweep.
  • No self-merge. CONSENSUS-bearing difficulty path requires operator tap.

Replace uint256 eased<<=halvings (wraps at 2^256, ~50-68min death-spiral
gap vs oracle) with a saturating shift computed in uint288 so emergency
decay saturates to MAX, matching frstrtr/p2pool-dgb-scrypt. Adds
EmergencyDecaySaturation KAT: h21=57.5min fails-before/passes-after,
NEW==ORACLE 0-mismatch + interpolation, death-spiral>0. Consensus-bearing;
held for operator scope tap, no self-merge.
@frstrtr
frstrtr merged commit 01f61d5 into master Jun 27, 2026
32 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