btc: connect-authoritative won-block submit (always-fire submitblock RPC) — G3b leg-(b) connect fix - #530
Merged
Conversation
…RPC) 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.
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
Fixes the G3b leg-(b) connect blocker: a won block was relayed but never connected the tip, silently losing the subsidy.
The stratum won-block path called
submit_block_with_fallback, whose P2P-primary policy treats a P2P relay success as "reached the network" and short-circuits thesubmitblockRPC. But a P2P relay success only means the block was announced (a cmpctblock header). Under compact-block relay the daemon then requests the body viagetblocktxn, which the c2pool broadcaster does not serve, so the daemon neverConnectBlock()s and the block is silently lost despiterelay_p2p()returning true.Change (BTC-lane-fenced)
btc::coin::broadcast_block_for_connect+Node::submit_block_for_connect: fires thesubmitblockRPC unconditionally (connect-authoritative -- submitblock delivers the full block, so it always connects), keeping the P2P relay for best-effort fast propagation.main_btc.cpp) to the connect-authoritative call.block_broadcast_connect_test.cpp(rides the allowlistedbtc_share_test, no NOT_BUILT risk) -- 5 KATs pin always-fire, P2P-fail-still-connects, both-fail-reaches-neither, null-P2P, plus a side-by-side contrast lock that the fallback policy still short-circuits.What is NOT changed
The cross-coin SSOT
core::broadcast_block_with_fallbackcontract is untouched. The "give submitblock primacy / always-fire" convergence is the v37 broadcaster-convergence shape held on HOLD (#500 / #498); only the BTC won-block connect path opts into it locally here. The existingblock_broadcast_guard_test(6 KATs) still passes unchanged, proving the fallback policy is intact.Verify
btc_share_testbuilds clean;BtcBlockBroadcastConnect.*(5) +BtcBlockBroadcastGuard.*(6) = 11/11 PASS.Held for operator tap -- I do not self-merge.