Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Remove discarded block bodies and states from the database. #11912

Closed
arkpar opened this issue Jul 25, 2022 · 3 comments · Fixed by #11983
Closed

Remove discarded block bodies and states from the database. #11912

arkpar opened this issue Jul 25, 2022 · 3 comments · Fixed by #11983
Labels
C1-low PR touches the given topic and has a low impact on builders. I8-footprint An enhancement to provide a smaller (system load, memory, network or disk) footprint. U3-nice_to_have Issue is worth doing eventually. Z1-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder Z6-mentor An easy task where a mentor is available. Please indicate in the issue who the mentor could be.

Comments

@arkpar
Copy link
Member

arkpar commented Jul 25, 2022

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 arkpar added I8-footprint An enhancement to provide a smaller (system load, memory, network or disk) footprint. U3-nice_to_have Issue is worth doing eventually. Z6-mentor An easy task where a mentor is available. Please indicate in the issue who the mentor could be. Z1-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder C1-low PR touches the given topic and has a low impact on builders. labels Jul 25, 2022
@hzy1919
Copy link
Contributor

hzy1919 commented Jul 28, 2022

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

@arkpar
Copy link
Member Author

arkpar commented Jul 28, 2022

@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.

@hzy1919
Copy link
Contributor

hzy1919 commented Jul 29, 2022

@arkpar OK , thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C1-low PR touches the given topic and has a low impact on builders. I8-footprint An enhancement to provide a smaller (system load, memory, network or disk) footprint. U3-nice_to_have Issue is worth doing eventually. Z1-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder Z6-mentor An easy task where a mentor is available. Please indicate in the issue who the mentor could be.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants