Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Tendermint Block Pruning #7265
Tendermint Block Pruning #7265
Changes from 18 commits
996ec85
d181ced
4e3bb9e
b5f6d5b
7436c83
a918473
ecec1da
277e7cc
5a2ce12
a019645
d0fe264
a2d008e
cddfc90
693825b
0d48839
53f8478
a2a9ab6
b43bb87
451fcb3
9e766c1
f3f9170
ce5726a
7a94b11
2c3d62a
94c2a03
b3821ef
21c5429
9016543
9fa78d6
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
I think this should use
KeepEvery
, notInterval
. Consider the case ofKeepEvery: 1000
andInterval: 10
. At height 10890, this will allow block pruning up to 10880, even though the last state height persisted to disk is 10000 - if the node restarts, it will try to replay from 10000, but can't since the blocks are gone.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.
You're absolutely right! Can't believe I missed this.
Interval
is when the heights are actually pruned from disk -- nomenclature always confuses me...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.
However, in this case
H=10890
, andX=H-KeepEvery=9890
which isn't totally correct either. I think we need to doX=H-(H%KeepEvery)
?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.
Yes, that's more accurate.
H-KeepEvery
would work, but has an excessive safety margin. If you go forminNonZero
then take care whenH<KeepEvery
, since this expression results in0
and thus would be ignored.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.
Correct, in this case, we must be sure to return
0
as to not prune anything because that would be bad!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.
Updated. @erikgrinaker could you take another look?
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.
Looks good!
It occurred to me that another way to handle this would be to simply return a configuration error if
minRetainBlocks
was set lower than all these other parameters - instead of magically extending it. Not really sure which UX is better.