nmc(PE-2d/1): CoinBroadcaster::submit_block_raw returns relayed-peer count - #254
Merged
Conversation
…count Embedded aux backends (nmc::coin::AuxChainEmbedded::submit_block) wire their P2P-primary BlockRelayFn (size_t(block_hex)) to CoinBroadcaster::submit_block_raw, but the broadcaster discarded its internal sent count and returned void. The backend therefore could not honour the never-silent-drop invariant (#162): a block that reached 0 peers would be indistinguishable from a successful relay. Return static_cast<size_t>(sent) so the wiring site can propagate the true peer count. Backward-compatible: the sole host caller (mm_manager block-relay lambda) ignores the value. +1 KAT: no peers => submit_block_raw == 0.
frstrtr
added a commit
that referenced
this pull request
Jun 20, 2026
…te P2P won-block from 2d Per integrator design call (2026-06-20): embedded mode relies SOLELY on P2P relay for won-block propagation. submit_aux_block() is intentionally inert in-process (mirrors doge embedded path), so LEG 1 (submitauxblock) is external-RPC-deployment-only / N/A in the embedded soak -- never driven here. The dual-path submitblock fallback stays a DEPLOYMENT-level gate, kept explicit. LEG 2 (P2P primary) is the live embedded won-block route and is UN-GATED from 2d (#247/#253/#254 landed on master 294fb30). The end-to-end assert fires once the in-loop c2pool embedded regtest process drives node A -- next slice. Recut off origin/master (294fb30); scripts-only, fenced to scripts/.
frstrtr
added a commit
that referenced
this pull request
Jun 20, 2026
…te P2P won-block from 2d Per integrator design call (2026-06-20): embedded mode relies SOLELY on P2P relay for won-block propagation. submit_aux_block() is intentionally inert in-process (mirrors doge embedded path), so LEG 1 (submitauxblock) is external-RPC-deployment-only / N/A in the embedded soak -- never driven here. The dual-path submitblock fallback stays a DEPLOYMENT-level gate, kept explicit. LEG 2 (P2P primary) is the live embedded won-block route and is UN-GATED from 2d (#247/#253/#254 landed on master 294fb30). The end-to-end assert fires once the in-loop c2pool embedded regtest process drives node A -- next slice. Recut off origin/master (294fb30); scripts-only, fenced to scripts/.
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
CoinBroadcaster::submit_block_rawnow returnssize_t= number of peers the block was successfully relayed to (wasvoid).Why
This is the prerequisite for NMC PE-2d item (1) — wiring the embedded NMC
AuxChainEmbedded::set_block_relay(BlockRelayFn = size_t(block_hex)) to a CoinBroadcaster at host init. The backend needs the relayed-peer count to honour the never-silent-drop invariant (#162 / PR #253): a found block that reached 0 peers must surface as a failure, not a phantom success. The broadcaster already countedsentinternally but discarded it.Scope / safety
src/c2pool/merged/coin_broadcaster.hpp+ 1 KAT.Test
test_coin_broadcaster65/65 PASS (exit 0), +1 KATCoinBroadcaster.SubmitBlockRawNoPeersReturnsZero(no peers => returns 0u). Local build clean.Shared-tree change → operator-tap, NOT auto-merge. I do not self-merge.