dgb(phase-b): tail-hashrate-score chain-walk endpoints SSOT + KAT - #411
Merged
Conversation
Lift the pure integer endpoint arithmetic of ShareTracker::score() (the per-tail approximate-hashrate ranking that drives best_tail selection) into a fenced header-only SSOT, coin/tail_score_endpoints.hpp: - end-point offset = CHAIN_LENGTH * 15 / 16 (get_nth_parent_hash dist) - trailing walk len = min(CHAIN_LENGTH / 16, end_point_acc_height) - short-chain guard = head_acc_height < CHAIN_LENGTH - unresolvable block = 1e6 confirmation fallback (tiny but non-zero score) - time span = max(1, block_span * BLOCK_PERIOD) - score = total_work / time_span vs the p2pool-dgb-scrypt data.py:843-855 oracle. The chain-walk halves (get_nth_parent_hash / get_chain / get_delta) stay in ShareTracker; this slice lifts only the arithmetic, with a non-circular KAT (8/8) deriving every expectation from the oracle formula + DGB net constants (CHAIN_LENGTH 2880/400, BLOCK_PERIOD 75), including two full-composite hand-derived score anchors. FENCED, additive: share_tracker.hpp NOT rewired (byte-identity delegation is the follow-on). Per-coin isolation: src/impl/dgb/ only. Test in both build.yml --target arms + dir CMakeLists.txt.
This was referenced Jun 24, 2026
frstrtr
added a commit
that referenced
this pull request
Jun 25, 2026
…ow-on) Production byte-identical delegation of the six pure-arithmetic sites in ShareTracker::score() onto the KAT-pinned coin/tail_score_endpoints.hpp SSOT (landed header-only in #411). The chain walk stays inside the member (it needs the verified skip-list / TrackerView); only the integer endpoint/guard/span arithmetic is delegated: - short-chain guard -> score_head_too_short - 15/16 endpoint offset -> score_endpoint_offset - /16 tail walk count -> score_tail_walk_count - unresolved-block span -> score_resolved_block_span - span clamp -> score_time_span - work/span divide -> score_value Value-identical (same int32_t span type, same uint288 divide); chain_length is a positive net constant so signed/unsigned (CL*15)/16 and CL/16 coincide. Diagnostic tail-ranking arithmetic, fenced to src/impl/dgb/, no consensus value semantics changed. Closes the #411 SSOT drift-risk (header was not yet referenced by the live score path). dgb_share_test 34/34; dgb_tail_score_endpoints_test 8/8.
frstrtr
added a commit
that referenced
this pull request
Jun 25, 2026
dgb: rewire ShareTracker::score onto coin/ tail_score SSOT (#411 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.
What
Phase-B SSOT slice: lift the pure integer endpoint arithmetic of
ShareTracker::score()— the per-tail approximate-hashrate ranking that drivesbest_tailselection (data.py:767-772) — into a fenced header-only SSOTsrc/impl/dgb/coin/tail_score_endpoints.hpp.Lifted (free functions over already-resolved inputs):
CHAIN_LENGTH*15/16(get_nth_parent_hash distance)min(CHAIN_LENGTH/16, end_point_acc_height)head_acc_height < CHAIN_LENGTHmax(1, block_span*BLOCK_PERIOD)and thework/time_spandivideThe chain-walk halves (get_nth_parent_hash / get_chain / get_delta) stay in ShareTracker (they need the skip-list / TrackerView).
Oracle
p2pool-dgb-scrypt
data.py:843-855ShareTracker.score(). Every KAT expectation hand-derived from the oracle formula + DGB net constants (CHAIN_LENGTH 2880 mainnet / 400 testnet, PARENT.BLOCK_PERIOD 75s) — non-circular, incl. two full-composite hand-derived score anchors (resolved 4-deep → 3000; unresolvable → 10).Fencing
share_tracker.hppNOT rewired (byte-identity delegation is the follow-on).src/impl/dgb/only.dgb_tail_score_endpoints_test8/8 green; registered in dir CMakeLists.txt + both build.yml--targetarms (ci: build test_dgb_subsidy in both Linux test jobs (fix master-red NOT_BUILT) #143 NOT_BUILT trap).No self-merge — integrator taps on full-rollup green.