lighthouse icon indicating copy to clipboard operation
lighthouse copied to clipboard

Prune historic blocks

Open michaelsproul opened this issue 2 years ago • 4 comments

Description

Currently Lighthouse stores every block from genesis to the current head, with no option to drop the older parts of history.

The p2p spec defines a parameter MIN_EPOCHS_FOR_BLOCK_REQUESTS equal to ~5 months, which we could adopt as the default backfill period for new checkpoint synced nodes.

https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/p2p-interface.md#consensus-layer-network-interaction-domains

If community consensus enables it we could also automatically prune blocks older than MIN_EPOCHS_FOR_BLOCK_REQUESTS on all nodes in real time. Assuming finality and no storage of historic states this would make the size of the database approximately constant :heart_eyes_cat:

michaelsproul avatar May 24 '22 01:05 michaelsproul

Any update here?

jmcruz1983 avatar Jun 28 '22 09:06 jmcruz1983

On the backburner, we're hesitant to add this feature without opt-in from other client teams and a good solution to providing access to the historical data.

michaelsproul avatar Jun 29 '22 01:06 michaelsproul

Syncing from checkpoint sync doesn't store all blocks, just the minimum we need to serve. I'm going to close this in favour of block pruning in #4158

AgeManning avatar Apr 09 '24 05:04 AgeManning