-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat(pruning): prune ChangeSets & History during pipeline #3728
Conversation
Codecov Report
... and 12 files with indirect coverage changes
Flags with carried forward coverage won't be shown. Click here to find out more.
|
since there was some overlap, should #3733 be pushed first |
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.
LGTM overall, nits. Appreciate the tests!
With this PR, lower end machines might not be able to catch up if their pruning is very aggressive. This happens because the pipeline re-run that happens after the first sync will trigger the hashing and merkle stages to be run from scratch since there might not be enough changesets. And if it cannot finish before 64 blocks have been merged, this behaviour will repeat itself. Follow-up PR will handle that by temporarily not pruning so many changesets, so we can leverage the incremental branches of these stages. But it requires a few too many changes for this PR |
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.
nit re duplicate condition,
otherwise lgtm
|
||
/// Part of the data that can be pruned. | ||
#[main_codec] | ||
#[derive(Debug, Clone, Copy, Eq, PartialEq, Ord, PartialOrd)] | ||
#[derive(Debug, Display, Clone, Copy, Eq, PartialEq, Ord, PartialOrd)] | ||
pub enum PrunePart { |
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.
@shekhirin what do you think about renaming this to PruneStep
?
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.
Personally, "Step" sounds like a consecutive action like "Stage" in the context of pipeline, while in pruning you can enable different parts and it doesn't really matter in which order and composition they are executed. But I do agree that "Part" is weird too.
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.
maybe PruneComponent
?
if to_block - from_block > self.clean_threshold || from_block == 1 || !has_enough_changesets | ||
{ |
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.
we have the same check twice,
is it worth it to move this to a separate function and properly document it?
Resolves #3433
Resolves #3434
AccountHistory
andStorageHistory
stages.Full pruning is not supported, and will throw error at reading the configuration. Minimum 64 block distance.