core: won-block dual-path broadcast SSOT (BTC delegates) [Phase-1 convergence, DRAFT — review+operator-tap, no auto-merge] - #498
Merged
Conversation
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
marked this pull request as ready for review
June 25, 2026 19:17
This was referenced Jun 25, 2026
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>
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-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.
core::broadcast_block_with_fallbackinsrc/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.hppreduced to a thin, signature-stable delegate forwarding to the core SSOT. Every existing includer (btcnode.hpp, and the nmc/dgb trees that cross-include this header) keeps resolving the same symbol with zero behavior change.CoreBlockBroadcastKATs on the core symbol directly (rides allowlistedcore_test).Scope discipline (EXCEPTIONAL shared-core change)
core/andbtc/touched. nmc/dgb/bch trees are NOT modified.[decision-needed]tap).Verification
core_test --gtest_filter=CoreBlockBroadcast.*→ 6/6btctarget build → exit 0test_coin_broadcaster(BTC broadcaster) → 65/65 through the delegatenmc_block_broadcast_test(cross-coin includer) → 7/7, compiles+passes unchangedMerge 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/docspending operator approval to push.