[BCH M5] reorg re-request recovery — block-connect re-getdata sink (fenced, src/impl/bch) - #226
Merged
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).
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.
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)
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