Configurable BAL retention policy #9637
Open
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.
Adds new CLI options:
--Xchain-pruning-bals-retained- sets the number of retained BALs, must be <=--Xchain-pruning-blocks-retained--Xchain-pruning-bals-frequency- the time in blocks after which BAL pruning is executed--Xchain-bal-pruning-enabled- whether BAL pruning is enabled (default: true)The relationship between BALs and blocks retained is currently enforced because both pruning task use
forkBlocks, but only one can be responsible for deleting them (which is the block pruning task) without further changes. However, this restriction only applies if--Xchain-pruning-enabled, which it isn't by default, so removing this restriction was considered lower priority for now.Breaking changes:
The option
--Xchain-pruning-blocks-blocks-limitwas renamed to--Xchain-pruning-blocks-bals-limit, as it sets the lower bound on the number of BALs retained (and then only indirectly on blocks retained). This is debatable as if BAL pruning is disabled, it still bounds blocks retained.By default, the minimal number of BALs retained (and hence the minimum number of blocks retained) is
3533 * 32 = 417792. This lower bound can be overriden by setting a lower--Xchain-pruning-blocks-bals-limit, for example for purposes of networks without BALs or WSP.TODO:
BALs retained <= blocks retained.Based on #9629 .