StratisBitcoinFullNode icon indicating copy to clipboard operation
StratisBitcoinFullNode copied to clipboard

Cleaning old rewind data

Open NicolasDorier opened this issue 8 years ago • 6 comments

Rewind data need to be cleaned. At block 330000, my hard drive took 20GB of space when the UTXO was only 2GB.

2 observations:

  • We do not need rewind data if we are synching old blocks. (what about not saving them at all?)
  • We do not need more than 1 days worth of block as it is unlikely there is such big reorg.

If we need to rewind past the last rewind data, the UTXO is completely wiped out, and reperform a full indexing. (we can save time here by disabling checks on block that were validated previously)

NicolasDorier avatar Jan 13 '17 05:01 NicolasDorier

I am not sure I follow, are you referring to the BlockRepository?

dangershony avatar Jan 13 '17 09:01 dangershony

no, DBreezeCoinView.

NicolasDorier avatar Jan 15 '17 14:01 NicolasDorier

So basically the CoinView keep track of information to rewind in case of fork. If no information is found, then the CoinView is wiped out back to genesis.

Thing is that we probably do not need Rewind data older than 100 blocks, as such rewind is unexpected.

NicolasDorier avatar Jan 16 '17 11:01 NicolasDorier

Ah I see it's rewind data that is bulking up your disk. Did you consider keeping rewind data only till last checkpoint? Though , we don't have checkpoints implemented yet I believe.

dangershony avatar Jan 16 '17 11:01 dangershony

checkpoint is a different concept from rewind data.

Each rewind data can cover several block, except when your node is fully sync, you have one rewind data for every block (basically I do it as every flush on the coinview)

I will make a checkpoint system that users can customer to sync fast without verifying a bunch of old blocks.

NicolasDorier avatar Jan 17 '17 11:01 NicolasDorier