Skip to content

bch(M5): reorg re-request connector — daemon-assembly integration - #229

Merged
frstrtr merged 2 commits into
masterfrom
bch/m5-connector-wire
Jun 19, 2026
Merged

bch(M5): reorg re-request connector — daemon-assembly integration#229
frstrtr merged 2 commits into
masterfrom
bch/m5-connector-wire

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 19, 2026

Copy link
Copy Markdown
Owner

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:

  • EmbeddedDaemon::assemble() now instantiates + 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.
  • p2p_node: request_block_downloads() routes re-getdata through the IBD window (same in-flight bound + timeout/eviction as IBD).
  • connector() accessor + has_block_requester() introspector.
  • embedded_daemon_assembly_test: asserts is_attached()+has_block_requester(), stable across idempotent re-assemble().

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.

frstrtr added 2 commits June 19, 2026 18:05
…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.
@frstrtr
frstrtr merged commit f15666e into master Jun 19, 2026
16 of 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