bch(M5): reorg re-request connector — daemon-assembly integration - #229
Merged
Conversation
…ocks instead of stranding UTXO at fork When a reorg new branch has intermediate blocks not in the connectors bounded remembered ring (headers-first race, or reorg deeper than the ring retains), recall_block() returned null and the connector logged a warning and left the UTXO view parked at the fork with no recovery path. Add an optional set_block_requester() sink: the not-yet-connected new-branch hashes (fork->tip order) are handed to it for re-getdata (wire to BlockDownloadWindow::enqueue, which dedupes) so the reorg completes on their re-delivery. Unset -> existing warn-and-hold fallback (cold-start / unwired contract preserved, no crash). Single-coin BCH (src/impl/bch only); zero p2pool-merged-v36 surface (local block-connect / download plumbing). New bch_reorg_rerequest_test pins both legs (sink-wired re-request order + unwired warn-and-hold).
Integration half of the reorg re-request recovery (#226 added the BlockConnector logic; this instantiates + attaches it in the live daemon graph). assemble() now owns a BlockConnector(m_chain, m_pool), binds its deep-reorg re-request sink to the P2P block-download window (request_block_downloads -> m_block_dl: bounded, deduping, reissue-accounted, no-op offline), and attaches it to full_block so every received block drives header connect + best-chain-gated UTXO/mempool reconciliation. Connector declared after m_node so its full_block subscription tears down before the event source. Adds connector() accessor + has_block_requester() introspector; assembly test asserts is_attached()+has_block_requester() and that the wiring is stable across an idempotent re-assemble(). Network-free (sink no-ops until start_p2p). Single-coin src/impl/bch only; zero p2pool-merged-v36 surface.
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.
M5 embedded-daemon body slice. Superset of #226: contains its reorg re-request logic commit (639edf5) plus the daemon-integration commit (f15666e) that wires that connector into the live daemon graph.
What f15666e adds:
Scope: single-coin src/impl/bch only; zero p2pool-merged-v36 surface; network-free (sink no-ops until start_p2p). GPG-signed, attribution-clean. Local syntax-check clean; full CI rollup is the gate.
Integrator: merge THIS (superset) and close #226 as subsumed, OR I can rebase the integration commit onto #226 — your call. Merge operator-gated.