Skip to content

btc: activate v36 modern layer (AutoRatchet + version-gated donation) - #81

Merged
frstrtr merged 1 commit into
masterfrom
btc/activate-v36-modern-layer
Jun 11, 2026
Merged

btc: activate v36 modern layer (AutoRatchet + version-gated donation)#81
frstrtr merged 1 commit into
masterfrom
btc/activate-v36-modern-layer

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Activates the present-but-inert btc modern layer (pillars 1 forward-version-voting + 4 donation-migration). btc forms its OWN v36 network; not p2pool-parity-bound.

Scope (2 files, btc-only; per-coin isolation invariant held — zero ltc/core/other-coin change):

  • Instantiate btc::AutoRatchet with target_version=36 (v37-generic, parameterized — instantiated, not rewritten).
  • Replace the 3 hardcoded share_version=35 sites with the live/voted version (work_source.cpp + 2 sites in main_btc.cpp).
  • Pass v36_active (share_version>=36) into generate_share_transaction so gentx uses the v36 path.
  • Version-gate get_donation_script(version): pre-v36 = forrestv P2PK DONATION_SCRIPT; v36+ = COMBINED_DONATION_SCRIPT (P2SH 1-of-2). btc donation constants confirmed byte-identical to ltc; gated swap wired against existing shared constants, no new constants.

Out of scope (untouched, per task boundaries): share_check.hpp version-transition VALIDATION (F10, capture-gated behind #81); literal-36 -> version-constant cleanup (cross-cutting ltc/core).

Pillars 2/3 for btc: pillar 2 (DensePPLNSRing) present in src/impl/btc/{node.cpp,share_tracker.hpp}; pillar 3 (anti-hop) not present in src/impl/btc/ — sequence next.

Goal: btc smoke + Linux/macOS/Windows GREEN; btc v36 sharechain forms + votes toward v37. Merge operator-gated.

Transition-validation gate, pillars 1 (forward-version-voting) + 4
(donation-migration) for btc's own modern v36 sharechain. btc was
present-but-inert; this instantiates the layer. btc-only files —
zero ltc/core/other-coin behavior change.

- Instantiate btc::AutoRatchet(target_version=36), state under net_dir.
- Replace the 3 hardcoded share_version=35 sites with the AutoRatchet
  -voted version: work_source frozen_ref (via rh_result), ref_hash_fn,
  and create_local_share. work_source stays coin-agnostic — it consumes
  rh_result.share_version produced by the btc ref_hash_fn.
- create_local_share dispatches on share_version (<=35 v35 path, >=36
  v36 path), threading v36_active into generate_share_transaction for
  locally created shares without touching share_check.hpp.
- Version-gate the donation script: pre-v36 P2PK DONATION_SCRIPT,
  v36+ COMBINED_DONATION_SCRIPT (P2SH 1-of-2) via the existing
  PoolConfig::get_donation_script(version). Initial + per-PPLNS-refresh.

Does NOT touch the share_check.hpp version-transition validation
(check()/validate_version_switch) — that is F10, capture-gated.
Pillars 2 (DensePPLNSRing) + 3 (anti-hop/whale_departure) remain
present-inert; sequenced next.
@frstrtr
frstrtr merged commit c889e7a into master Jun 11, 2026
16 checks passed
frstrtr added a commit that referenced this pull request Jun 12, 2026
…cal 95% punish (F10)

- share_check step 2: replace retroactive 95%-obsolescence check with the
  canonical p2pool check() 60% PPLNS-weighted switch rule (data.py:1396-1414),
  evaluated only at version boundaries vs the parent.
- ShareTracker::get_desired_version_weights: new uint288 PPLNS-weighted variant
  (weight = ShareIndex::work) for the consensus gate; flat-count
  get_desired_version_counts retained for AutoRatchet + tail guard (count-based,
  finding #1 — weighting them would shift activation timing).
- Drop should_punish_version (95% obsolescence) and its Phase-4 head-scoring
  input (share_tracker.hpp:1148); head-scoring now punishes only naughty heads.
- Remove dead validate_version_switch (0 callers).

Restores #81 zero-divergence parity vs p2pool-merged-v36: no reject/score-down
of shares canonical accepts. Linux x86_64 ctest 590/590.
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