conflux-rust
conflux-rust copied to clipboard
Restarted full nodes may fail to get state.
Assume a full node crashed and restarts, and it now needs to sync a snapshot at height H. When it needs the state at height H, it should use the snapshot at height H directly.
However, if the node already has a snapshot at height H-SNAPSHOT_EPOCH_COUNT, it will take the state at height H as a normal case instead of the synced state, so it will try to use the snapshot at height H-SNAPSHOT_EPOCH_COUNT plus the intermediate delta MPT at height H. And this intermediate delta MPT does not exist, meaning this node will fail to get the state at height H.
I'll be re-assigned for a proper low priority fix.
Checked with @peilun-conflux I think a better fix is to remove all existing snapshots after successful sync, so that the old data don't interfere with the new state.