dgb(coin): SSOT for V36 PPLNS exponential weight-decay rate - #450
Merged
Conversation
frstrtr
force-pushed
the
dgb/share-weight-decay-ssot
branch
2 times, most recently
from
June 25, 2026 00:29
06204bf to
0a8af02
Compare
Lift the decay-rate arithmetic shared by three open-coded copies in share_tracker.hpp (init_decay_table, get_v36_decayed_cumulative_weights, and the [PARENT-PPLNS] diagnostic dump) into coin/share_weight_decay.hpp: half_life = max(chain_length / 4, 1) decay_per = SCALE - (SCALE * 693147) / (1e6 * half_life) decayed_att = (att * decay_fp) >> 40 (40-bit fixed point) Conforms to frstrtr/p2pool-merged-v36 data.py get_decayed_cumulative_weights (the V36-native decayed PPLNS path; 3-bucket rule bucket-2 v36-native shared structure, distinct from the older p2pool-dgb-scrypt flat WeightsSkipList baseline that stays live during the crossing window). FENCED: header-only constexpr, share_tracker.hpp NOT rewired -- the byte-identity delegation of the three copies is the follow-on PR. The per-depth decay_fp accumulation (80-bit mul128_shift) stays in the caller's walk; the SSOT exposes only the rate constants and the final attempts shift. Non-circular KAT dgb_share_weight_decay_test (6/6): half_life, decay_per, and decayed_attempts goldens are hand-derived from the oracle formula (CL=8640 V36 / 2880 baseline / tiny-chain guard), not from the helper under test. Registered in both the test CMakeLists and the build.yml --target allowlist (#143 NOT_BUILT trap).
frstrtr
force-pushed
the
dgb/share-weight-decay-ssot
branch
from
June 25, 2026 05:36
0a8af02 to
4481afe
Compare
frstrtr
added a commit
that referenced
this pull request
Jun 26, 2026
…rewire dgb: rewire decay constants onto share_weight_decay SSOT (#450 follow-on)
frstrtr
added a commit
that referenced
this pull request
Jun 26, 2026
…p-ssot dgb: route consensus get_desired_version_weights clamp onto chain_walk_window SSOT (#450 follow-on)
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.
Phase-B SSOT pillar — V36 PPLNS exponential weight-decay rate
Lifts the decay-rate arithmetic shared by three open-coded copies in
src/impl/dgb/share_tracker.hppinto a new SSOT headersrc/impl/dgb/coin/share_weight_decay.hpp:init_decay_table()(decay-table precompute, ~line 170)get_v36_decayed_cumulative_weights()(hot-path PPLNS weights, ~line 1718)[PARENT-PPLNS]GENTX-mismatch diagnostic dump (~line 1793)All three compute the same constants:
Oracle / 3-bucket classification
Conforms to frstrtr/p2pool-merged-v36
p2pool/data.pyget_decayed_cumulative_weights(the V36-native decayed PPLNS path).This is bucket-2 (v36-native shared structure) — standardize cross-coin
toward this shape for the V37 unified migration. It is distinct from the older
p2pool-dgb-scryptflatWeightsSkipListbaseline (no decay), which stays thelive path during the crossing window and is not touched here.
Fenced
constexpr;share_tracker.hppis NOT rewired. Thebyte-identity delegation of the three copies is the follow-on PR.
decay_fpaccumulation is an 80-bit product done withmul128_shiftin the caller's walk — that stays inshare_tracker.hpp; theSSOT exposes only the rate constants and the final attempts shift.
src/impl/dgb/**+ the build.yml allowlist.No shared/bitcoin_family or other-coin tree.
Proof
dgb_share_weight_decay_test6/6 green. Non-circular: half_life /decay_per / decayed_attempts goldens are hand-derived from the oracle formula
(CL=8640 V36, CL=2880 baseline, tiny-chain half_life=1 guard), not from the
helper under test.
CMakeLists.txtand thebuild.yml--targetallowlist (default + AUX_DOGE arms) — avoids the ci: build test_dgb_subsidy in both Linux test jobs (fix master-red NOT_BUILT) #143 NOT_BUILTtrap.
No self-merge — integrator taps after full-rollup green.