Skip to content

[BCH M5] reorg re-request recovery — block-connect re-getdata sink (fenced, src/impl/bch) - #226

Merged
frstrtr merged 1 commit into
masterfrom
bch/m5-reorg-rerequest
Jun 19, 2026
Merged

[BCH M5] reorg re-request recovery — block-connect re-getdata sink (fenced, src/impl/bch)#226
frstrtr merged 1 commit into
masterfrom
bch/m5-reorg-rerequest

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 19, 2026

Copy link
Copy Markdown
Owner

BCH M5 embedded-body slice — reorg strand-the-UTXO recovery

SHA: 639edf5 (GPG-signed EDDSA, attribution-clean)
Scope: single-coin src/impl/bch only — 3 files (block_connector.hpp + reorg_rerequest_test). Zero p2pool-merged-v36 surface. Per-coin isolation intact (no impl_bch coin-lib link; mirrors utxo_connect_test posture).

What it does

Closes the reorg gap in BlockConnector where a new branch has intermediate blocks NOT in the bounded remembered-block ring (normal headers-first race, or reorg deeper than the ring retains). Previously recall_block() returned null -> warn + park UTXO at the fork with no recovery. Now an optional set_block_requester() sink receives the not-yet-connected new-branch hashes in fork->tip order for re-getdata (wire to BlockDownloadWindow::enqueue, which dedupes), so the reorg completes on re-delivery. Sink unset -> existing warn-and-hold fallback preserved (cold-start/unwired contract holds, no crash).

Evidence (local)

  • cmake -DCOIN_BCH=ON build green
  • new bch_reorg_rerequest_test ALL PASS — both legs: sink-wired re-request order (h2 before h3) and unwired warn-and-hold no-throw
  • ctest bch_reorg group 2/2 passed

BCHN submitblock RPC fallback untouched and retained.

Merge gate: operator-tap after full CI rollup (Linux/ASan/Windows) green + mergeStateStatus CLEAN re-verify.

bch-embedded-steward

…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).
@frstrtr
frstrtr merged commit 639edf5 into master Jun 19, 2026
15 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