conflux-rust
conflux-rust copied to clipboard
Pivot chain reorg during catching up will violate the confirmed state assumption for archive nodes.
Archive nodes will execute blocks normally in the phase CatchUpSyncBlock
, and states (snapshots and MPTs) before a confirmed height will be deleted.
However, the confirmation probability is inaccurate during catching up because only a part of blocks are received, and violating this assumption is possible. This will result in a panic like
thread 'Consensus Worker' panicked at 'forked_at 5803248 should > boundary_lower_bound, boundary StateAvailabilityBoundary { synced_state_height: 0, lower_bound: 5806001, upper_bound: 5810510, optimistic_executed_height: Some(5810511) }', core/src/consensus/consensus_inner/consensus_new_block_handler.rs
where fork_at
is before the state lower_bound
.
Since we have assumed that the checkpoint will not be reverted during catching-up, always keeping the states from the checkpoint to the tip should be enough?