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

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

@arkpar

Description

@arkpar

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C1-lowPR touches the given topic and has a low impact on builders.I8-footprintAn enhancement to provide a smaller (system load, memory, network or disk) footprint.U3-nice_to_haveIssue is worth doing eventually.Z1-easyCan be fixed primarily by duplicating and adapting code by an intermediate coderZ6-mentorAn easy task where a mentor is available. Please indicate in the issue who the mentor could be.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions