Skip to content

nmc(P1 PE): P2P-primary block-relay sink + never-silent-drop submit_block - #223

Merged
frstrtr merged 1 commit into
masterfrom
nmc/p1-pe-submit-relay
Jun 19, 2026
Merged

nmc(P1 PE): P2P-primary block-relay sink + never-silent-drop submit_block#223
frstrtr merged 1 commit into
masterfrom
nmc/p1-pe-submit-relay

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 19, 2026

Copy link
Copy Markdown
Owner

NMC P1 PE — submit leg (slice 1/2)

Embedded NMC submit path now actually relays found aux-blocks instead of logging a stub. AuxChainEmbedded gains a settable BlockRelayFn sink that the host wires to CoinBroadcaster::submit_block_raw (hex decoded at the wiring site, mirroring the BTC on_block_relay seam).

submit_block() is now never-silent-drop (per BTC #162): an unwired relay or a 0-peer broadcast returns false (so the caller can fall back) while the hex is still cached for get_block_hex(). Only a relay reaching >=1 peer returns true.

Tests — nmc_template_builder_test 13 -> 16 green (exit 0)

  • SubmitBlockRelaysExactHexToPeers — sink receives byte-exact hex, returns success on >=1 peer
  • SubmitBlockNeverSilentDropOnZeroPeers — sink ran, 0 peers => false
  • SubmitBlockCachesHexForRetrieval — updated to the never-silent contract (no relay => false, hex still cached)

Fence

  • src/impl/nmc/ only; btc tree READ-ONLY. No CMake/build.yml change — rides existing nmc_template_builder_test allowlist entry, no NOT_BUILT risk.

Stacked on master (#210/#213/#214/#218 all landed). Next PE slice: wire the sink at the host to the live CoinBroadcaster + start the soak.

…lock

Embedded NMC submit path now relays found aux-blocks through a settable
BlockRelayFn sink (host wires it to CoinBroadcaster::submit_block_raw,
decoded at the wiring site, mirroring the BTC on_block_relay seam).
submit_block() no longer claims success unconditionally: an unwired relay
or a 0-peer broadcast surfaces as failure (never-silent-drop, per BTC #162)
while the hex is still cached for get_block_hex(). +3 KATs (relay exact-hex,
no-relay fail, 0-peer fail); existing cache KAT updated to the new contract.
Rides nmc_template_builder_test — no CMake/build.yml change.
@frstrtr
frstrtr merged commit e2d90ec into master Jun 19, 2026
18 checks passed
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