Skip to content

Conversation

michaelsproul
Copy link
Member

Proposed Changes

@chong-he noticed that nodes running v6.0.0 do not reclaim disk space after pruning states. This is because the generic compact method on the database only compacts a handful of columns: BeaconState, BeaconStateSummary, BeaconBlock.

For pre-v6.0.0 databases, most of the data for historic states will have been stored in the BeaconState column, so users upgrading from v5.x to v6 should have been able to reclaim most of the used space. There are only a handful of old columns like BeaconStateRoots which won't have been compacted.

For nodes running v6 that prune states after upgrading, the compaction currently misses the two most important columns: BeaconStateSnapshot and BeaconStateDiff. I've added a new compact_freezer method which compacts all of the current-schema columns, and all the old schema columns for good measure.

@michaelsproul michaelsproul added v6.0.1 Bugfix for v6.0.0 database labels Dec 7, 2024
@michaelsproul michaelsproul changed the base branch from stable to release-v6.0.1 December 7, 2024 01:46
DBColumn::BeaconRestorePoint,
DBColumn::BeaconHistoricalRoots,
DBColumn::BeaconRandaoMixes,
DBColumn::BeaconHistoricalSummaries,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hope we don't make the same mistake when rolling diffs on hot DB

michaelsproul added a commit that referenced this pull request Dec 13, 2024
Squashed commit of the following:

commit 32cdb32
Merge: f749988 fc0e0ae
Author: Michael Sproul <michael@sigmaprime.io>
Date:   Thu Dec 12 13:14:32 2024 +1100

    Merge branch 'release-v6.0.1' into compact-more

commit f749988
Author: Michael Sproul <michael@sigmaprime.io>
Date:   Sat Dec 7 12:46:54 2024 +1100

    Compact more when pruning states
@michaelsproul michaelsproul mentioned this pull request Dec 13, 2024
@michaelsproul
Copy link
Member Author

@mergify queue

Copy link

mergify bot commented Dec 14, 2024

queue

✅ The pull request has been merged automatically

The pull request has been merged automatically at f3b7888

@michaelsproul michaelsproul added the ready-for-merge This PR is ready to merge. label Dec 14, 2024
mergify bot added a commit that referenced this pull request Dec 14, 2024
@mergify mergify bot merged commit f3b7888 into sigp:release-v6.0.1 Dec 14, 2024
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
database ready-for-merge This PR is ready to merge. v6.0.1 Bugfix for v6.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants