Adds sync stats for use in TUI, and resets the chain body to genesis and restarts if an error is detected during validation. Note this does not yet cover all error conditions and it's still very possible for the pibd process to stall. However, I have been able to successfully sync a node to testnet after these changes.
Update to show pibd progress stats in tui. Note it's currently showing the percentage as the number of complete 'blocks' represented by the current PIBD progress, which is probably not ideal (should discuss)
add parameter to reset_chain_head to allow for only rolling back the body without rolling back headers
Functions to clear out the prune list after a reset, which is currently not being rolled back on rewind for some reason. Note I'm not entirely happy with this approach, and the real fix of rewinding the prunelist properly should be done before this is deployed on mainnet.
Add error state to pibd state enum
Function to reset state of desegmenter when an error is reported
Reset chain, prune list and desegmenter when an error is reported.
Adds sync stats for use in TUI, and resets the chain body to genesis and restarts if an error is detected during validation. Note this does not yet cover all error conditions and it's still very possible for the pibd process to stall. However, I have been able to successfully sync a node to testnet after these changes.
reset_chain_head
to allow for only rolling back the body without rolling back headers