Skip to content

core: won-block dual-path broadcast SSOT (BTC delegates) [Phase-1 convergence, DRAFT — review+operator-tap, no auto-merge] - #498

Merged
frstrtr merged 1 commit into
masterfrom
btc/core-broadcast-ssot
Jun 25, 2026
Merged

core: won-block dual-path broadcast SSOT (BTC delegates) [Phase-1 convergence, DRAFT — review+operator-tap, no auto-merge]#498
frstrtr merged 1 commit into
masterfrom
btc/core-broadcast-ssot

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 25, 2026

Copy link
Copy Markdown
Owner

What

Phase-1 of the v36-native broadcaster-guard convergence (bucket-2 standardization). Lifts the canonical won-block dual-path broadcast policy into a cross-coin SSOT and makes BTC a thin delegate.

  • NEW core::broadcast_block_with_fallback in src/core/block_broadcast.hpp — the canonical primary-then-fallback policy (P2P relay primary, submitblock RPC fallback) + both-legs-guarded never-silent-drop invariant.
  • src/impl/btc/coin/block_broadcast.hpp reduced to a thin, signature-stable delegate forwarding to the core SSOT. Every existing includer (btc node.hpp, and the nmc/dgb trees that cross-include this header) keeps resolving the same symbol with zero behavior change.
  • NEW CoreBlockBroadcast KATs on the core symbol directly (rides allowlisted core_test).

Scope discipline (EXCEPTIONAL shared-core change)

  • Only core/ and btc/ touched. nmc/dgb/bch trees are NOT modified.
  • Per-coin dispatcher delegation to the new core SSOT is a separate, per-coin, steward-owned slice, sequenced AFTER this core SSOT + the design doc land and the operator greenlights the convergence direction (integrator to surface as a [decision-needed] tap).
  • Per-coin PREFIX/IDENTIFIER isolation primitives are untouched — this converges only the v36-native shared broadcast structure (bucket 2), not the isolation boundary (bucket 1).

Verification

  • core_test --gtest_filter=CoreBlockBroadcast.*6/6
  • btc target build → exit 0
  • test_coin_broadcaster (BTC broadcaster) → 65/65 through the delegate
  • nmc_block_broadcast_test (cross-coin includer) → 7/7, compiles+passes unchanged

Merge policy

Shared-core is EXCEPTIONAL under per-coin isolation: DO NOT auto-merge. Needs integrator review + operator tap. Draft until then. Companion convergence DESIGN doc held in the/docs pending operator approval to push.

The primary-then-fallback won-block broadcast policy (P2P relay primary,
submitblock RPC fallback) and its both-legs-guarded never-silent-drop
invariant are identical for every coin. Lift the canonical implementation
from btc::coin into a cross-coin SSOT core::broadcast_block_with_fallback
(<core/block_broadcast.hpp>), and reduce the btc::coin entry point to a
thin, signature-stable delegate so existing BTC call sites and the other
coin trees that cross-include the BTC header keep resolving the same symbol
with zero behavior change.

Core-only reference slice: only core/ and btc/ are touched. Per-coin
dispatcher delegation to the new core SSOT is a separate, per-coin,
steward-owned slice sequenced after operator greenlight; the per-coin
PREFIX/IDENTIFIER isolation primitives are unaffected (this converges only
the v36-native shared broadcast structure).

Adds CoreBlockBroadcast guard/policy KATs (primary-no-double-broadcast,
throwing-relay-still-falls-back, throwing-rpc-collapses-to-false,
neither-sink-false, null-sink tolerance) on the core symbol directly.

Verified: core_test CoreBlockBroadcast 6/6; btc build exit0;
test_coin_broadcaster 65/65; nmc_block_broadcast_test 7/7 (cross-coin
includer compiles + passes unchanged through the delegate).
@frstrtr
frstrtr marked this pull request as ready for review June 25, 2026 19:17
@frstrtr
frstrtr merged commit 68fda01 into master Jun 25, 2026
21 checks passed
frstrtr added a commit that referenced this pull request Jun 26, 2026
…RPC) (#530)

The won-block path called submit_block_with_fallback, whose P2P-primary
policy treats a cmpctblock announce-success as reaching the network and so
short-circuits the submitblock RPC. But an announce does NOT connect the
tip: under compact-block relay the daemon requests the body via getblocktxn,
which the c2pool broadcaster does not serve, so the block never
ConnectBlock()s and the subsidy is silently lost (G3b leg-(b) blocker).

Add a BTC-lane-fenced broadcast_block_for_connect / submit_block_for_connect
that fires the submitblock RPC UNCONDITIONALLY (connect-authoritative),
keeping the P2P relay for best-effort fast propagation, and wire the stratum
won-block path to it. The cross-coin core::broadcast_block_with_fallback
contract is untouched (the always-fire convergence stays HOLD per #500/#498);
only the BTC connect path opts in. New block_broadcast_connect_test.cpp rides
the allowlisted btc_share_test (no NOT_BUILT risk) and pins the always-fire
invariant plus a side-by-side contrast lock that the fallback policy still
short-circuits.

Co-authored-by: frstrtr <frstrtr@users.noreply.github.com>
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