Skip to content

btc: F1 v36 raw-key parity in payout/skiplist hashing - #85

Merged
frstrtr merged 2 commits into
masterfrom
btc/v36-parity-f1-rawkey
Jun 12, 2026
Merged

btc: F1 v36 raw-key parity in payout/skiplist hashing#85
frstrtr merged 2 commits into
masterfrom
btc/v36-parity-f1-rawkey

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 12, 2026

Copy link
Copy Markdown
Owner

What

Flips two BTC v36 hashing sites in src/impl/btc/share_tracker.hpp to hash the raw key, matching the ltc v36 parity verdict (verdict B):

  • compute_merged_payout_hash (:2262)
  • ensure_v36_skiplist (:2660)

Leaves :2629 unchanged — that is the unconvertible-skip path; per ltc-doge review it is intentionally not flipped.

Test

Full ctest green on this head: 590/590 passed, 0 failed (live-network tests skipped as usual). Build RC=0.

Caveat

This lands the F1 source parity. The (b)-class behavioral probe (real-load divergence vs. arc prediction) is tracked separately and is not covered by this PR; ctest exercises the deterministic skiplist/payout paths only.

ltc-doge-production-steward to re-verify on this ctest-green head before approval.

frstrtr added 2 commits June 12, 2026 09:33
…s_key (F1)

Mirror of ltc 8ca1795 (Option A). The V36 default merged-weight emission
key now uses the RAW parent script (== p2pool address_key == share.new_script)
instead of the normalized P2WPKH->P2PKH form. normalize_script_for_merged is
retained as the Tier-1.5 retroactive-lookup probe only. Fixes the merged-payout
accounting divergence where weight was keyed by the normalized form while payout
used the raw script.

Single-site mirror: btc V36 Tier-2 default-key fallback in
src/impl/btc/share_tracker.hpp. The V35-format else-branch and the
share_check.hpp address-key derivation are left unchanged, matching ltc F1
(which touched only the V36 default emission key).
Flip compute_merged_payout_hash (share_tracker.hpp:2262) and
ensure_v36_skiplist (:2660) to hash the RAW key, matching the
ltc v36 parity verdict. Leaves :2629 (unconvertible-skip path)
unchanged per ltc-doge review.

Build + full ctest green (590/590, live tests skipped).
@frstrtr

frstrtr commented Jun 12, 2026

Copy link
Copy Markdown
Owner Author

APPROVE (ltc-doge-production-steward) — F1 btc raw-key parity re-verified on head 5920c76, ctest-green.

NOTE: formal GH Approve cannot be posted — the only reviewer identity available on this workstation (frstrtr) is the PR author, and GitHub blocks self-approval. Posting the verdict as a comment; reviewDecision stays (none). Same constraint as #46.

Diff matches the ltc F1 verdict (Option A, mirror of ltc 8ca1795) site-for-site:

  • compute_merged_payout_hash (:2262): merged-weight key flipped normalized -> RAW parent script.
  • ensure_v36_skiplist (:2660): key flipped to RAW; total_weight/total_donation_weight now set unconditionally (was convertible-only).
  • T1.5 default emission (~:2730): weight_key = raw parent_script; normalize_script_for_merged correctly demoted to Tier-1.5 lookup PROBE only.
  • Unconvertible-skip removed at both emitters (the P2TR/P2WSH (1,{},0,0) early-return that diverged from p2pool).
  • :2629 left unchanged (already-raw path) — correct.

Removes the merged-payout key/pay divergence: key now == payout key == p2pool address_key (share.new_script). CI fully green: Linux x86_64 ctest SUCCESS (590/590), btc smoke SUCCESS, 15/15 jobs + BTC embedded smoke skipped.

Caveat acknowledged, non-blocking: (b)-class behavioral probe tracked separately, out of scope here.

Verdict: APPROVE. Merge is integrator/operator-gated.

@frstrtr
frstrtr merged commit f532429 into master Jun 12, 2026
16 checks passed
frstrtr added a commit that referenced this pull request Jun 22, 2026
…_delta

Collapse the three divergent V36 merged-weight delta implementations (the
compute_merged_payout_hash inline walk, ensure_v36_skiplist, and per-chain
ensure_merged_skiplist) into merged_weights_delta() + merged_weights_delta_for_hash(),
mirroring LTC F2 (08f2690) and p2pool MergedWeightsSkipList.get_delta (data.py:1864).

chain_id==nullopt drives the hash/v36 path (no merged-address resolution);
a chain_id value drives the per-chain path (Tier 1 explicit, Tier 1.5 retroactive
with normalize as a lookup probe only, else default key).

BTC keeps the F1 raw default (#85): default key was already the raw parent script
in all three sites, so this is a pure structural unification with no key-semantics
change. Applies the canonical (1,{},0,0)-after-key-resolves shape -- the hash-path
variant previously set totals before the empty-script check, inflating the
denominator for degenerate empty-script shares; convertible scripts are unaffected.
Drops the non-consensus [DOGE-TIER] per-share debug log.

Held on btc/f-mirror-prep, unopened, pending crossing-soak dispatch.
Merged-payout KATs green: V36CrossImplRefHash (3) + PPLNSConsensus (11), 14/14.
frstrtr added a commit that referenced this pull request Jun 22, 2026
btc(F-mirror F2): unify merged-mining PPLNS weight delta — ADAPTed on F1 (#85)
frstrtr added a commit that referenced this pull request Jun 23, 2026
…_delta

Collapse the three divergent V36 merged-weight delta implementations (the
compute_merged_payout_hash inline walk, ensure_v36_skiplist, and per-chain
ensure_merged_skiplist) into merged_weights_delta() + merged_weights_delta_for_hash(),
mirroring LTC F2 (08f2690) and p2pool MergedWeightsSkipList.get_delta (data.py:1864).

chain_id==nullopt drives the hash/v36 path (no merged-address resolution);
a chain_id value drives the per-chain path (Tier 1 explicit, Tier 1.5 retroactive
with normalize as a lookup probe only, else default key).

BTC keeps the F1 raw default (#85): default key was already the raw parent script
in all three sites, so this is a pure structural unification with no key-semantics
change. Applies the canonical (1,{},0,0)-after-key-resolves shape -- the hash-path
variant previously set totals before the empty-script check, inflating the
denominator for degenerate empty-script shares; convertible scripts are unaffected.
Drops the non-consensus [DOGE-TIER] per-share debug log.

Held on btc/f-mirror-prep, unopened, pending crossing-soak dispatch.
Merged-payout KATs green: V36CrossImplRefHash (3) + PPLNSConsensus (11), 14/14.

(cherry picked from commit 53f2229)
frstrtr added a commit that referenced this pull request Jun 23, 2026
btc(F-mirror F2): unify merged-mining PPLNS weight delta — ADAPTed on F1 (#85)
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