dgb: saturating uint288 emergency-decay shift + proving KAT - #562
Merged
Conversation
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.
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.
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-scryptget_decayed_cumulative_weightsreduction 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 (suiteEmergencyDecaySaturation.*, 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— addsdgb_emergency_decay_saturation_testto BOTH coin-matrix allowlists so it is built and run, not a NOT_BUILT sentinel.Fenced to
src/impl/dgbplus 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-scryptoracle. No p2pool-merged-v36 divergence introduced.Verification
EmergencyDecaySaturation.*KAT: oracle-equal across full sweep.