substrate icon indicating copy to clipboard operation
substrate copied to clipboard

Remove discarded block bodies and states from the database.

Open arkpar opened this issue 3 years ago • 3 comments

Block header and bodies currently account for 90% of the database size on disk. By default the node keeps all headers and bodies in the database, even ones that are not in the finalized chain. There no point in keeping old blocks that are not in the finalized chain, as they are of no interest to anyone. Such blocks should be removed by default, potentially saving a lot of disk space. An option to keep all blocks should be available (perhaps an extension of --keep-blocks). As it is with state pruning, the node should discard non-finalized blocks after some delay, to allow for reversion of finality.

State pruning in archive mode also keeps states for such blocks. There should be a separate pruning mode that preserves full state history for canonical chain only.

arkpar avatar Jul 25 '22 17:07 arkpar

hi @arkpar , is anyone working on this ? If not , I'd like to have a try .

hzy1919 avatar Jul 28 '22 11:07 hzy1919

@hzy1919 You are welcome to try. Reach me (@arkadiy:matrix.parity.io ) or @cheme (@emeric:matrix.parity.io) on element if you need any hints.

arkpar avatar Jul 28 '22 18:07 arkpar

@arkpar OK , thanks!

hzy1919 avatar Jul 29 '22 00:07 hzy1919