Skip to content

nmc(PE-2d/1): CoinBroadcaster::submit_block_raw returns relayed-peer count - #254

Merged
frstrtr merged 1 commit into
masterfrom
nmc/pe-relay-count-return
Jun 20, 2026
Merged

nmc(PE-2d/1): CoinBroadcaster::submit_block_raw returns relayed-peer count#254
frstrtr merged 1 commit into
masterfrom
nmc/pe-relay-count-return

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 20, 2026

Copy link
Copy Markdown
Owner

What

CoinBroadcaster::submit_block_raw now returns size_t = number of peers the block was successfully relayed to (was void).

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 counted sent internally but discarded it.

Scope / safety

Test

test_coin_broadcaster 65/65 PASS (exit 0), +1 KAT CoinBroadcaster.SubmitBlockRawNoPeersReturnsZero (no peers => returns 0u). Local build clean.

Shared-tree change → operator-tap, NOT auto-merge. I do not self-merge.

…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
frstrtr merged commit 7680256 into master Jun 20, 2026
18 checks passed
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/.
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