You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9dea26e
Browse filesBrowse the repository at this point in the historyBrowse files
fix(dash-spv): drop masternode lists above a followed fork, refuse forks below the checkpoint (#1201)
* fix(dash-spv): drop masternode lists built above a followed fork
`handle_fork` truncated the stored headers, filters, blocks and wallets
above the fork, but not the masternode list engine. Lists built on the
dropped blocks stayed in memory, kept answering quorum lookups for blocks
that had left the chain, and kept serving as the base of the next tip
diff.
The engine now drops, right after the headers:
- every list above the fork;
- every rotated cycle whose base block left the chain, or whose mining
window ends above the fork, since its commitments may have been mined
on the dropped branch.
So the engine never holds lists above the stored tip, even if a later
truncation fails. The truncation steps move into `truncate_chain_above`, so
they can be tested without a running sync loop.
Test would have caught this in CI: `following_a_fork_drops_the_masternode_lists_above_it`
fails without the engine truncation (lists above the fork remain) and
passes with it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(dash-spv): refuse forks below the newest reached checkpoint
`fork_height` refused a branch off below the best ChainLock, but not one
below a compiled-in checkpoint (`CheckpointManager::should_reject_fork`
was never called). A peer could make the client drop and re-sync a
checkpointed part of its chain.
A branch off below the newest checkpoint at or below the stored tip is no
longer treated as a fork. A checkpoint above the tip fixes nothing yet,
so `should_reject_fork`, which compares against the newest compiled
checkpoint whatever the tip, is not used.
Test would have caught this in CI:
`a_branch_off_below_the_newest_reached_checkpoint_is_no_fork` ("below the
checkpoint") fails without the floor and passes with it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
0 commit comments