Skip to content

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

Open
echennells wants to merge 1 commit into
libbitcoin:masterfrom
echennells:reorg-window-rewind
Open

echennells wants to merge 1 commit into
libbitcoin:masterfrom
echennells:reorg-window-rewind

Conversation

@echennells

Copy link
Copy Markdown
Contributor

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.

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.

1 participant