-
Notifications
You must be signed in to change notification settings - Fork 907
Shrink persisted fork choice data #7805
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
Conversation
Closes #7760 or we want to go further? |
This isn't finished yet, I'm working on the compression now and it gets the size down to 1.9MB total |
This pull request has merge conflicts. Could you please resolve them @michaelsproul? 🙏 |
@@ -162,9 +164,9 @@ where | |||
/// It is assumed that `anchor` is already persisted in `store`. | |||
pub fn get_forkchoice_store( | |||
store: Arc<HotColdDB<E, Hot, Cold>>, | |||
anchor: &BeaconSnapshot<E>, | |||
anchor: BeaconSnapshot<E>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need ownership here? we're cloning the beacon state below, and i dont see this moved anywhere
) | ||
.map_err(|e| { | ||
Error::MigrationError(format!( | ||
"Error loading fork choise store from persisted: {e:?}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small typo fork choice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great optimisation 🎉
I wasn't very familiar with this part of the codebase before so it took a while to review. I've reviewed this and it looks solid and clean to me. Really nice work!
Will leave it to you to merge if you'd like to do more testing or another pair of eyes (maybe @dapplion ?) |
Issue Addressed
Closes:
Proposed Changes
balances_cache
fromPersistedForkChoiceStore
(~65 MB saving on mainnet)justified_balances
fromPersistedForkChoiceStore
(~16 MB saving on mainnet)balances
fromProtoArray
/SszContainer
.Testing Results
Total bytes written is way down:
Time spent writing to disk is also way down: