dgb: naughty-propagation ancestor-punishment SSOT + KAT (Phase-B) - #445
Merged
Conversation
Phase-B conformance pillar. Lift the pure-integer naughty-generation arithmetic from share_tracker.hpp:561-577 into a header-only SSOT coin/naughty_propagation.hpp and pin it against the p2pool-dgb-scrypt data.py:543-549 oracle with a non-circular KAT. Oracle rule: when a share's previous_share_hash exists and the parent is naughty (>0), child.naughty = 1 + parent.naughty, reset to 0 once it would exceed 6 generations; a non-naughty parent leaves the child's counter untouched. The rule is consensus-bearing -- best_descendent (data.py:812-813) skips naughty children, so it decides which sharechain tails the pool refuses to build on. A silent drift in the +1 step or the 6-generation reset clamp would re-rank tails with no compile error, diverging from the V36 master-compat reference. naughty_child_generation() captures the bare +1/clamp arithmetic; propagate_naughty_from_parent() adds the "parent is naughty" guard and returns std::nullopt when no propagation applies (clean parent). FENCED: header-only, additive, share_tracker.hpp NOT rewired -- the inline body computes the identical value, so the byte-identity delegation is a follow-on. Pure unsigned arithmetic, links only GTest. Target wired into CMakeLists.txt + both build.yml allowlist sites. KAT 4/4 green, expectations hand-derived from the oracle.
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.
DGB Phase-B: naughty-propagation ancestor-punishment SSOT
Integrator-greenlit non-gated Phase-B pillar (same shape as the prior SSOT lifts). Lifts the naughty-generation arithmetic from
share_tracker.hpp:561-577into header-onlycoin/naughty_propagation.hpp, pinned non-circularly against the p2pool-dgb-scryptdata.py:543-549oracle.Oracle
naughty_child_generation(parent)— bare1 + parent, clamp>6 -> 0.propagate_naughty_from_parent(parent)— adds the "parent is naughty" guard; returnsstd::nulloptfor a clean parent (child counter left untouched).Why it matters
Consensus-bearing:
best_descendent(data.py:812-813) skips naughty children, so the rule decides which sharechain tails the pool refuses to build on. A silent drift in the+1step or the 6-generation reset clamp would re-rank tails with no compile error, diverging from the V36 master-compat reference.Fenced / additive
share_tracker.hppNOT rewired — the inline body computes the identical value, so the byte-identity delegation is a follow-on.CMakeLists.txt+ bothbuild.ymlallowlist sites (ci: build test_dgb_subsidy in both Linux test jobs (fix master-red NOT_BUILT) #143 NOT_BUILT trap).Proof
KAT
dgb_naughty_propagation_test4/4 green; every expectation hand-derived from the oracle (incl. an 8-generation chain-walk anchor). GPG-signed, no attribution. No self-merge — operator tap on full-rollup green.