nmc(P1 PE): P2P-primary block-relay sink + never-silent-drop submit_block - #223
Merged
Conversation
…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.
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.
NMC P1 PE — submit leg (slice 1/2)
Embedded NMC submit path now actually relays found aux-blocks instead of logging a stub.
AuxChainEmbeddedgains a settableBlockRelayFnsink that the host wires toCoinBroadcaster::submit_block_raw(hex decoded at the wiring site, mirroring the BTCon_block_relayseam).submit_block()is now never-silent-drop (per BTC #162): an unwired relay or a 0-peer broadcast returnsfalse(so the caller can fall back) while the hex is still cached forget_block_hex(). Only a relay reaching >=1 peer returnstrue.Tests — nmc_template_builder_test 13 -> 16 green (exit 0)
SubmitBlockRelaysExactHexToPeers— sink receives byte-exact hex, returns success on >=1 peerSubmitBlockNeverSilentDropOnZeroPeers— sink ran, 0 peers => falseSubmitBlockCachesHexForRetrieval— updated to the never-silent contract (no relay => false, hex still cached)Fence
nmc_template_builder_testallowlist 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.