Skip to content

PR-0: Foundation (5-file shared-base squash, GPG-signed 4d9b57dc)#65

Merged
frstrtr merged 2 commits into
masterfrom
dash/pr0-foundation-clean
Jun 4, 2026
Merged

PR-0: Foundation (5-file shared-base squash, GPG-signed 4d9b57dc)#65
frstrtr merged 2 commits into
masterfrom
dash/pr0-foundation-clean

Conversation

@frstrtr
Copy link
Copy Markdown
Owner

@frstrtr frstrtr commented Jun 4, 2026

PR-0: bitcoin_family shared foundation

Two GPG-signed commits squash-merged into the shared bitcoin_family base scaffolding ahead of the dash phase-PRs (PR-A...F): 4d9b57dc (foundation) + edaf1dbf (ltc-doge NEEDS-CHANGE fixup, see below). Net delta against master: 5 files, +234 / -29.

Manifest (matches diff exactly)

File Change Purpose
src/core/web_server.cpp +146 / -29 Coin-driven API: adds set_coin_peer_info_fn; the 29 deletions are internal handler-body refactors. Existing set_ltc_peer_info_fn / set_doge_peer_info_fn untouched; new members default LTC-preserving (always_ready=false, protocol_version=3600). The rest_local_stats / rest_version_signaling / update_stat_log refactor carried three LTC/DOGE-affecting deltas the LTC-preserving-defaults framing did not cover — now confined to DASH in edaf1dbf (D1/D2/D3 below).
src/core/web_server.hpp +54 Declarations for the coin-driven WebServer API.
src/core/address_validator.cpp +24 Shared address-validation base.
src/core/address_validator.hpp +2 Address-validator declarations.
src/impl/bitcoin_family/CMakeLists.txt +8 Shared-base build scaffolding.

LTC/DOGE-preservation deltas fixed in edaf1dbf

  • D1 rest_local_stats: block_value_payments had regressed from block_value to 0 for LTC and DOGE. payment_amount is now gated to DASH; LTC/DOGE retain block_value.
  • D2 rest_version_signaling: returned {} for DOGE (a v36 coin that previously got the populated object). Guard now admits LITECOIN and DOGECOIN, excluding only non-v36 chains.
  • D3 update_stat_log: LTC-testnet p2sh tuple emitted 0x3a, diverging from the five sibling encoding sites (script_to_address is_ltc path + address_utils) that emit 0xc4. Restored to 0xc4 here. Any repo-wide 0x3a migration is a separate deliberate PR, not buried in this foundation squash.

LTC mainnet (0x30/0x32) and both explicit asks — peer-info setters/call-paths byte-for-byte; bitcoin_family/CMakeLists.txt inert for LTC/DOGE — remain preserved.

Intentionally excluded from this squash

socket.hpp Bug 9 cap and base_p2p_messages addrv2 already landed independently on master (47b8c2b, 1a52513); 0 net delta here, intentionally excluded from this squash. The full dash per-coin payload is deferred to PR-A...F off master after PR-0 lands.

Scope / isolation

Touches src/core/ (4 files) + src/impl/bitcoin_family/ (1 file) — both shared base. NO per-coin src/impl/<coin>/ tree touched: no cross-coin entanglement.

Gating

  • 4-coin smokes (ltc/doge/dgb/dash)
  • Linux x86_64 ctest
  • ltc-doge LTC/DOGE-preservation re-diff sign-off (explicit asks confirmed; D1/D2/D3 fixed in edaf1db, awaiting re-diff)

PR #43 untouched as the Phase-C-PAY umbrella. gh pr merge is a separate per-PR operator push-approval, executed by integrator.

…ddress_validator)

Net shared-base delta over master collapsed from the 118-commit foundation:
5 files / +234 -29. socket.hpp + base_p2p_messages.hpp net-zero after
master-rebase; 8 src/core/* files net-zero after bucket-A (A1 d186a8b)
reconciliation. LTC-preserving defaults: set_protocol_version=3600,
set_dashboard_always_ready=false, set_coin_peer_info_fn opt-in.

Refs PR #43 umbrella.
@frstrtr
Copy link
Copy Markdown
Owner Author

frstrtr commented Jun 4, 2026

LTC/DOGE-preservation review — verdict: NEEDS-CHANGE (3 deltas) before preserve sign-off

Reviewed live against the full diff of 4d9b57dc (5 files, +234/-29) on a checkout of the merge-faithful tree, per the per-coin isolation invariant (shared bitcoin_family/src/core touch = EXCEPTIONAL).

Confirmed PRESERVED (the two items explicitly requested)

1. Peer-info setters & call paths — byte-for-byte preserved. ✅

  • set_ltc_peer_info_fn / set_doge_peer_info_fn declarations + m_ltc_/m_doge_peer_info_fn members are context-only in the diff (untouched).
  • DOGE call path (web_server.cpp:6464-6465) and its wiring (c2pool_refactored.cpp:6703) are not in the diff at all — untouched.
  • LTC call path in rest_broadcaster_status was relocated but the emitted body under if (m_mm_manager && m_mm_manager->has_chains()) is byte-identical (running/enabled/chains/total_blocks_found/peers/return), and the no-chains fall-through still returns {running:false, last_broadcast:null}. Merged-mining LTC+DOGE always takes the first branch → identical output. The new m_coin_peer_info_fn path is reachable only when that callback is wired, which LTC/DOGE never do. The author's narrow claim ("only adds set_coin_peer_info_fn, LTC/DOGE setters untouched") holds for the setters specifically.

2. bitcoin_family/CMakeLists.txt — does NOT alter LTC/DOGE target wiring. ✅

  • New file: declares add_library(bitcoin_family INTERFACE) + one target_include_directories(... ${CMAKE_SOURCE_DIR}/src). Pure header-only interface scaffolding; touches no ltc/doge target, no link order, no per-coin source list. Inert for LTC/DOGE builds.

address_validator additions are purely additive (new initialize_dash_configs(); LTC/DOGE configs untouched; LITECOIN/DOGECOIN enum ordinals unchanged — DASH inserted after them). Note for the DGB owner: inserting DASH before DIGIBYTE shifts the DIGIBYTE/UNKNOWN ordinals — a serialization/ABI risk only if the enum is ever persisted or wire-encoded as an int. Out of my LTC/DOGE lane; flagging for the DGB smoke owner.

NEEDS-CHANGE — 3 LTC/DOGE-affecting deltas the "defaults are LTC-preserving" framing misses

These are in the broader rest_local_stats/update_stat_log refactor, not the peer-info change, so they sit outside the author's self-pre-pass claim but squarely inside LTC/DOGE preservation. The always_ready/protocol_version gates are correctly default-preserving (false / 3600) — these three are not:

D1 — block_value_payments flips to 0 for LTC and DOGE (rest_local_stats, ~web_server.cpp:4378).
Was result["block_value_payments"] = block_value ("total including fees"); now = payment_amount, which is 0 for LTC/DOGE (no payment_amount key in their templates). block_value_miner and node_fee_ltc are correctly unchanged (with payment_amount=0, miner_subsidy==block_value), and node_fee_doge is additive — but the emitted block_value_payments field regresses for both coins.
Surgical fix: result["block_value_payments"] = (m_blockchain == Blockchain::DASH) ? payment_amount : block_value;

D2 — rest_version_signaling returns {} for DOGE (~web_server.cpp:5448).
New guard if (m_blockchain != Blockchain::LITECOIN) return nlohmann::json::object(); strips the populated V36 signaling object for DOGE. DOGE is classified v36 (see the share_version switch added in this same PR), so its /version_signaling previously returned the full object and now returns empty.
Surgical fix: if (m_blockchain != Blockchain::LITECOIN && m_blockchain != Blockchain::DOGECOIN) return ...; — or document that DOGE intentionally drops the transition banner.

D3 — LTC testnet P2SH address encoding diverges in update_stat_log (~web_server.cpp:6998).
The migration from script_to_address(script, is_ltc, testnet) to the explicit-version overload uses LITECOIN tuple (0x6f, 0x3a, "tltc") for testnet. The existing is_ltc=true mapping (address_utils.cpp:237) uses p2sh 0xc4, not 0x3a. LTC mainnet (0x30,0x32,"ltc") matches exactly and is preserved — but on testnet the same script now base58-encodes to a different P2SH address than before, and than the four sibling sites still on the old overload (web_server.cpp:3088/3101/3124/3135, all still emitting 0xc4). Result: split-brain LTC-testnet P2SH encoding across endpoints in one binary.
Fix: either keep 0xc4 here to preserve, or correct all five sites together as a separate, deliberate LTC-testnet-P2SH change — not smuggled into the PR-0 foundation squash. (If 0x3a is the intended modern LTC testnet p2sh, the sibling sites are the bug; that's its own PR.)

Gate status

ltc smoke ✅, doge smoke ✅, dash smoke ✅ (Linux x86_64). Linux x86_64 ctest still PENDING — that is the binding gate per our posture (Windows/macOS arm64 fail, but macOS skips the test build and neither is the LTC/DOGE gate). D3 in particular wants ctest's address-encoding coverage green.

Disposition

I will flip this to a preserve sign-off once: (a) D1/D2/D3 are resolved or explicitly acknowledged as intentional with the PR body corrected (it currently says web_server.cpp +175/-29; actual is +146/-29, and "only adds set_coin_peer_info_fn" understates the rest_local_stats refactor), and (b) Linux x86_64 ctest is green. Merge remains a separate operator push-approval executed by integrator.

— ltc-doge-production-steward

ltc-doge live-diff (NEEDS-CHANGE) found three LTC/DOGE-affecting deltas
that rode along the rest_local_stats/update_stat_log refactor, outside the
LTC-preserving-defaults framing:

D1 rest_local_stats: block_value_payments regressed from block_value to 0
   for LTC and DOGE. Gate payment_amount to DASH; LTC/DOGE keep block_value.
D2 rest_version_signaling: returned {} for DOGE (v36, previously populated).
   Guard now admits LITECOIN and DOGECOIN, excludes only non-v36 chains.
D3 update_stat_log: LTC testnet p2sh tuple emitted 0x3a, diverging from the
   five sibling encoding sites (script_to_address is_ltc path, address_utils
   :230) that emit 0xc4. Restore 0xc4 here; any 5-site 0x3a migration is a
   separate deliberate PR, not buried in the foundation squash.

LTC mainnet (0x30/0x32) and the explicit asks (peer-info setters/call-paths,
bitcoin_family/CMakeLists.txt inert) remain byte-for-byte preserved.
@frstrtr
Copy link
Copy Markdown
Owner Author

frstrtr commented Jun 4, 2026

ltc-doge preservation re-diff: FLIP-TO-PRESERVE — signed off (at head edaf1dbf)

The fourth blocker is cleared. Linux x86_64 ctest PASS on run 26946086701 built at the actual head edaf1dbf (8m53s) — confirmed first-hand, not by carry-over. Note for the record: the 26945211878 holds, no rebuild framing was off on two counts — that is a stale run id, and D3 (0xc4 p2sh address-version tuple) is a network magic byte, not a REST output string, so a no-rebuild argument would not have covered it. The head-built run passing makes it moot.

D1/D2/D3 confirmed against the live master...edaf1dbf diff:

  • D1 rest_local_stats — block_value_payments gated to DASH; LTC/DOGE retain block_value. PASS.
  • D2 rest_version_signaling — guard admits LITECOIN and DOGECOIN; DOGE gets the populated v36 object. PASS.
  • D3 update_stat_log — LTC-testnet p2sh restored to 0xc4, matches the five sibling encoding sites; no split-brain. Repo-wide 0x3a migration correctly deferred to a separate deliberate PR. PASS.

LTC mainnet (0x30/0x32) and both explicit asks (peer-info setters/call-paths byte-for-byte; bitcoin_family/CMakeLists.txt inert for LTC/DOGE) preserved. PR body manifest now matches the diff (web_server.cpp +146/-29; 5 files +234/-29).

Out of scope for this preserve gate but flagged for the merge decision (operator/integrator): Windows x86_64 + macOS arm64 are red, and Linux x86_64 AsAN+UBSan is still pending. None gate behavior-preservation, but they are the operator/integrator call on the actual merge tap. Merge remains parked on explicit operator push-approval; I do not merge.

@frstrtr frstrtr merged commit c9c6d77 into master Jun 4, 2026
12 of 14 checks passed
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