Skip to content

dgb(test): pin get_desired_version_weights attempts-weighting conformance - #249

Merged
frstrtr merged 1 commit into
masterfrom
dgb/desired-version-weights-conform-kat
Jun 20, 2026
Merged

dgb(test): pin get_desired_version_weights attempts-weighting conformance#249
frstrtr merged 1 commit into
masterfrom
dgb/desired-version-weights-conform-kat

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 20, 2026

Copy link
Copy Markdown
Owner

Phase-B pool/share conformance vs frstrtr/p2pool-dgb-scrypt oracle.

What: Adds DesiredVersionWeightsByAttempts KAT to dgb_share_test. The check()-phase version-switch gate (share_check step 2) tallies each share desired_version vote weighted by target_to_average_attempts(target) (= ShareIndex::work), per canonical p2pool get_desired_version_counts (data.py:2651) — NOT one-share-one-vote. Previously had zero test coverage.

Guard: a SINGLE high-difficulty dv=35 share out-votes TWO low-difficulty dv=36 shares (the property a flat count inverts), and each per-version weight is tied directly to the SSOT work fn (no magic literals).

3-bucket: bucket-2 v36-native shared structure — must stay byte-identical with p2pool-merged-v36 across all coins.

Scope: test-only, single-coin, no prod change. Target already in build.yml allowlist (#143 trap avoided). 8/8 dgb_share_test PASS, GPG-signed.

HOLD merge — integrator merges on operator approval.

…y:2651)

The check()-phase version-switch gate tallies each share desired_version vote
weighted by target_to_average_attempts(target) (=ShareIndex::work), not a flat
per-share count. Guard a SINGLE high-difficulty share out-votes TWO low-diff
shares — the property a flat count inverts — and tie each per-version weight to
the SSOT work fn. Bucket-2 v36-native shared structure; must stay byte-identical
with p2pool-merged-v36 across coins. Test-only, no prod change.
@frstrtr
frstrtr merged commit 67f89af into master Jun 20, 2026
27 checks passed
frstrtr added a commit that referenced this pull request Jun 21, 2026
…#293)

The DGB VOTING-state baseline share version was a [decision-needed] held on
PR #292. Resolved against the canonical oracle frstrtr/p2pool-dgb-scrypt
@22761e7 (2026-06-17): data.py:636 Share.VERSION=35, VOTING_VERSION=35,
SUCCESSOR=None, share_versions={35:Share}; networks/digibyte.py:26
SEGWIT_ACTIVATION_VERSION=35. SUCCESSOR=None means 35 is the format the live
node currently mints, so base_version=35 is unambiguous. The "older than LTC"
divergence is the P2P PROTOCOL version (p2p.py VERSION=3501 vs LTC 3503), not
the share version.

New fenced header auto_ratchet_wire.hpp is the single production location of
the baseline constant: make_dgb_ratchet() constructs AutoRatchet(target=36,
base=35) and dgb_select_mint_versions() is the run-loop selector. The
work-weighted tail guard already inside get_share_version keeps mint
activation subordinate to the 60%-by-work accept gate (#249/#289) -- this
seam adds no new policy. base_version stays an explicit constructor param so
the v37 unified shape is clean.

De-staled the [decision-needed] notes in auto_ratchet.hpp and share_test.cpp.
+2 KATs pin the wired constant and bootstrap mint=35/vote=36; dgb_share_test
22/22 green. Surface-for-tap (consensus-bearing version-gate flip), HOLD.

Co-authored-by: frstrtr <frstrtr@users.noreply.github.com>
frstrtr added a commit that referenced this pull request Jun 23, 2026
…te (contract)

Mirrors the intent of ltc 865fdd7 onto the DGB lane. ltc-doge root-caused
the v35->v36 crossing wedge (#97): the AutoRatchet mint gate activated on a
95%-by-flat-COUNT desired-version tally, but the consensus accept gate
(share_check step 2 / p2pool check() data.py:1399) admits a V36 boundary
share only at the WORK-WEIGHTED 60% rule (canonical get_desired_version_counts,
data.py:2651, weights each share by target_to_average_attempts). Under
heterogeneous hashrate the flat count outran the work-weighted accept gate,
so the minter produced boundary shares every peer rejected -> frozen crossing.

DGB carries NO AutoRatchet minter yet (no src/impl/dgb/auto_ratchet.hpp; the
minter lands in Phase B). The DGB accept gate (share_check.hpp version-switch
rule) is ALREADY work-weighted/canonical via get_desired_version_weights, and
that accessor is KAT-pinned (#249). The ONLY artifact of the unsafe F10
flat-count choice on this lane is the design-contract recorded in comments,
which would seed the exact wedge into the future port. This corrects those
comments so DGB's AutoRatchet is born work-weighted: its activation tail guard
MUST read get_desired_version_weights over the same [9/10*CL, CL] window at the
same 60% threshold the accept gate enforces, superseding F10.

v36-native shared structure (consensus version-signaling), standardized
cross-coin for a clean v37 migration. Comment-only; zero behavior change (no
minter exists to alter). Per-coin isolation preserved: touches src/impl/dgb/ only.
frstrtr added a commit that referenced this pull request Jun 23, 2026
Port p2pool-v36 data.py AutoRatchet (mirrors src/impl/ltc/auto_ratchet.hpp)
as the DGB mint side that pairs with the already work-weighted accept gate
(#249/#289). Bucket-2 v36-native shared structure, standardized cross-coin
toward the v37 unified form; VOTING tail guard is work-weighted so an
activation can never outrun the 60%-by-work accept gate.

DGB divergence from LTC: the VOTING-state minted version is a constructor
parameter (base_version_), NOT the ltc hardcode target-1. Per operator
re-scope, DGBs live pre-v36 baseline conforms to frstrtr/p2pool-dgb-scrypt
and is OLDER than ltc v35; the exact value is a decision-needed for the
run-loop wire-in. Module is surface-for-tap (unwired) until that lands.

KAT (in dgb_share_test): pins thresholds 95/50/2x/60, proves base_version
is parameterized (not hardcoded 35), bootstrap mints baseline while voting
target, and JSON state persists across restart. 4/4 new, 20/20 suite green.
frstrtr added a commit that referenced this pull request Jun 23, 2026
…#293)

The DGB VOTING-state baseline share version was a [decision-needed] held on
PR #292. Resolved against the canonical oracle frstrtr/p2pool-dgb-scrypt
@22761e7 (2026-06-17): data.py:636 Share.VERSION=35, VOTING_VERSION=35,
SUCCESSOR=None, share_versions={35:Share}; networks/digibyte.py:26
SEGWIT_ACTIVATION_VERSION=35. SUCCESSOR=None means 35 is the format the live
node currently mints, so base_version=35 is unambiguous. The "older than LTC"
divergence is the P2P PROTOCOL version (p2p.py VERSION=3501 vs LTC 3503), not
the share version.

New fenced header auto_ratchet_wire.hpp is the single production location of
the baseline constant: make_dgb_ratchet() constructs AutoRatchet(target=36,
base=35) and dgb_select_mint_versions() is the run-loop selector. The
work-weighted tail guard already inside get_share_version keeps mint
activation subordinate to the 60%-by-work accept gate (#249/#289) -- this
seam adds no new policy. base_version stays an explicit constructor param so
the v37 unified shape is clean.

De-staled the [decision-needed] notes in auto_ratchet.hpp and share_test.cpp.
+2 KATs pin the wired constant and bootstrap mint=35/vote=36; dgb_share_test
22/22 green. Surface-for-tap (consensus-bearing version-gate flip), HOLD.

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