Skip to content

dgb: naughty-propagation ancestor-punishment SSOT + KAT (Phase-B) - #445

Merged
frstrtr merged 1 commit into
masterfrom
dgb/naughty-propagation-ssot
Jun 24, 2026
Merged

dgb: naughty-propagation ancestor-punishment SSOT + KAT (Phase-B)#445
frstrtr merged 1 commit into
masterfrom
dgb/naughty-propagation-ssot

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 24, 2026

Copy link
Copy Markdown
Owner

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-577 into header-only coin/naughty_propagation.hpp, pinned non-circularly against the p2pool-dgb-scrypt data.py:543-549 oracle.

Oracle

if self.share_data['previous_share_hash'] and tracker.items[prev].naughty:
    self.naughty = 1 + tracker.items[prev].naughty
    if self.naughty > 6:
        self.naughty = 0
  • naughty_child_generation(parent) — bare 1 + parent, clamp >6 -> 0.
  • propagate_naughty_from_parent(parent) — adds the "parent is naughty" guard; returns std::nullopt for 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 +1 step or the 6-generation reset clamp would re-rank tails with no compile error, diverging from the V36 master-compat reference.

Fenced / additive

Proof

KAT dgb_naughty_propagation_test 4/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.

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.
@frstrtr
frstrtr merged commit 241403e into master Jun 24, 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