Repository navigation
Description
PastaClaw flagged this while reviewing #8235, where it was deferred to a follow-up instead of being fixed in that pull request. This issue tracks the follow-up.
A stalled ChainLock reorg can still advance the conflicting branch (suggestion)
Impact: A snapshot chainstate that stalls while disconnecting a conflicting tip can still activate and announce a new block on that branch above the locked height.
Where: src/validation.cpp:4518-4530 at 686a97a1fc92:
Lines 4518 to 4530 in 686a97a
| // Now mark the blocks we just disconnected as descendants conflicting | |
| // (note this may not be all descendants). | |
| while (pindex_was_in_chain && conflicting_walk_tip != pindex && conflicting_walk_tip != m_chain.Tip()) { | |
| conflicting_walk_tip->nStatus |= BLOCK_CONFLICT_CHAINLOCK; | |
| setBlockIndexCandidates.erase(conflicting_walk_tip); | |
| conflicting_walk_tip = conflicting_walk_tip->pprev; | |
| } | |
| if (!stalled) { | |
| // Mark the block itself as conflicting. | |
| pindex->nStatus |= BLOCK_CONFLICT_CHAINLOCK; | |
| setBlockIndexCandidates.erase(pindex); | |
| } |
Keeping the current tip as a fallback is necessary when it cannot be disconnected, but it should not remain extendable. On a partial stall,
MarkConflictingBlock()marks only the blocks it disconnected; on a first-disconnect stall, it marks none. If the retained tip is at or above the locked height, a child passes the direct-parent flag check, andHasConflictingChainLock()returns false for the child because its height is above the lock. The remembered disconnect stall also permits the child because its chain contains the retained tip. Check the locked ancestor before activating an extension, and extend the snapshot stall test to cover a child above the locked height rather than only a sibling at that height.
Origin
- Pull request: fix: treat missing or unreadable local Evo state as an error, not invalidity #8235
- Review thread: fix: treat missing or unreadable local Evo state as an error, not invalidity #8235 (comment)
- Filed by PastaClaw when it accepted the deferral, as nothing else tracked it.
Activity