Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Historic block pruning #4158

Open
wants to merge 11 commits into
base: unstable
Choose a base branch
from

Conversation

michaelsproul
Copy link
Member

@michaelsproul michaelsproul commented Apr 3, 2023

Issue Addressed

Closes:

Builds on:

Proposed Changes

Add a step to the finalization migration which deletes blocks if they are older than the newly computed weak subjectivity checkpoint. To avoid burdening the disk this deletion is scheduled to occur once per week.

The block pruning is potentially I/O intensive, so to prevent it running in parallel with the I/O heavy finalization migration, it happens as part of finalization in the migrator. This required plumbing in the BeaconChain.

Limitations

If a node has been synced from genesis or has reconstructed states then block pruning is disabled. This is because we should also prune the historic states from disk in this case, and currently have no machinery in unstable for doing this (I had a branch, once upon a time). In the interests of simplicity this is deferred for future work.

Although now that I think about it, maybe having states without blocks is OK... and we will trigger the case where the oldest_block_slot is greater than the state_upper_limit even with this restriction (once a node prunes blocks newer than its oldest stored state). Need to think on this some more. Related: #3211.

TODO

  • Think more about state vs block interaction described above.
  • Consider explicitly checking finality before pruning
  • Add tests

@michaelsproul michaelsproul added work-in-progress PR is a work-in-progress v4.1.0 Post-Capella minor release labels Apr 3, 2023
@paulhauner paulhauner added v4.2.0 Q2 2023 and removed v4.1.0 Post-Capella minor release labels Apr 13, 2023
@michaelsproul michaelsproul added v4.3.0 Estimated Q2 2023 and removed v4.2.0 Q2 2023 labels May 15, 2023
@michaelsproul
Copy link
Member Author

Dropping this to v4.2.1, I haven't had a chance to implement the state deletion yet

@michaelsproul michaelsproul added v4.5.0 ETA Q4 2023 v4.4.1 ETA August 2023 and removed v4.3.0 Estimated Q2 2023 v4.5.0 ETA Q4 2023 labels Jun 28, 2023
@delbonis
Copy link

delbonis commented Jul 3, 2023

What are the blockers on this PR?

@michaelsproul
Copy link
Member Author

@delbonis We need to implement pruning for historic states as well, something that drops all the existing historic states and prevents more from being stored would be the simplest. Are you interested in working on it? Otherwise I'm hoping to get to it soon-ish

@michaelsproul
Copy link
Member Author

Opened a separate issue for the state pruning here: #4481

@michaelsproul michaelsproul added v4.5.0 ETA Q4 2023 and removed v4.4.1 ETA August 2023 labels Aug 14, 2023
@paulhauner paulhauner added v4.6.0 ETA Q1 2024 and removed v4.5.0 ETA Q4 2023 labels Sep 20, 2023
@michaelsproul michaelsproul removed the v4.6.0 ETA Q1 2024 label Dec 7, 2023
@michaelsproul
Copy link
Member Author

Dropping this from 4.6.0 as I don't have time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
work-in-progress PR is a work-in-progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants