dogecoin / dogecoin

very currency
MIT License
14.4k stars 2.8k forks source link

[feat] Detect, inform and recover from disk corruption issues better #3489

Open patricklodder opened 1 month ago

patricklodder commented 1 month ago

Originally requested by @sumariva in https://github.com/dogecoin/dogecoin/issues/3451#issuecomment-2016598812

  1. When read errors occur, cryptic messages show up in Qt, such as "Block does not have our chainid", leaving the operator with no clue why this error occured and how to solve it, leaving Dogecoin Qt in a loop where at every restart the same error message occurs. Improving error messages displayed to Qt may help improve this.
  2. We may want to create better tooling to rewind the chain state up to the last known non-corrupted block before the first read error occurred and continue sync from there, as the chain can be quite slow to sync during high traffic. This is especially important for pruned nodes, as disk errors on these nodes will often have only impact on the tail end of the chain, greatly saving download targets (and with that saving the network as a whole a lot of data out too.