Skip to content

Rewind the download window and bump validation on regression. - #10

Open
echennells wants to merge 7 commits into
masterfrom
reorg-window-rewind
Open

echennells wants to merge 7 commits into
masterfrom
reorg-window-rewind

Conversation

@echennells

@echennells echennells commented Sep 14, 2026 •

Copy link
Copy Markdown
Owner

After a reorganization the node can stop making progress while headers continue to arrive; a restart clears it. Two chasers are left waiting on events that never come.

chaser_check::do_regressed rewinds the position and purges outstanding work, but leaves requested_ and advanced_ where they were, and ignores a regression that falls above the position but inside the requested window. set_unassociated then defers new requests while position() < requested_, waiting on work that was just purged, so the heights between the position and the old request are never requested. The guard now considers the window as well as the position, and both are rewound with it, as at start.

chaser_validate advances on the checked event for the block above its position, or on a bump. When a reorganization returns to a branch whose next block is already downloaded, neither arrives. The organizer now bumps validation on regression as it does once at start.

Reproduced on regtest against bitcoind and on replays of recorded testnet3 reorganizations, and observed handled on live testnet3. A regression organized while not current does not stall, so the bump stays within the currency gate.

@echennells
echennells force-pushed the reorg-window-rewind branch 6 times, most recently from 89b04d6 to 999f242 Compare September 19, 2026 02:19
@echennells echennells changed the title Rewind the download window with the position on regression. Rewind the download window and bump validation on regression. Sep 19, 2026
@echennells
echennells force-pushed the reorg-window-rewind branch 2 times, most recently from d2ca85e to 6754931 Compare September 21, 2026 16:59
@echennells
echennells changed the base branch from master to tmp-base-10 September 21, 2026 17:00
@echennells
echennells changed the base branch from tmp-base-10 to master September 21, 2026 17:00
evoskuil and others added 6 commits September 21, 2026 14:18
Make read/write sequencing consistent across channels.
Replace the chase event enum parameter with typed event payloads.
After a reorganization the node can stop making progress while headers
continue to arrive; a restart clears it. Two chasers are left waiting
on events that never come.

`chaser_check::do_regressed` rewinds the position and purges
outstanding work, but leaves `requested_` and `advanced_` where they
were, and ignores a regression that falls above the position but inside
the requested window. `set_unassociated` then defers new requests while
`position() < requested_`, waiting on work that was just purged, so the
heights between the position and the old request are never requested.
The guard now considers the window as well as the position, and both
are rewound with it, as at start.

`chaser_validate` advances on the checked event for the block above its
position, or on a bump. When a reorganization returns to a branch whose
next block is already downloaded, neither arrives. The organizer now
bumps validation on regression as it does once at start.

Reproduced on regtest against bitcoind and on replays of recorded
testnet3 reorganizations, and observed handled on live testnet3. A
regression organized while not current does not stall, so the bump
stays within the currency gate.
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.

2 participants