fn max_digest_intervals_to_keep(min_blocks_to_keep: u64, max_digest_interval: u64) -> u64 {
	// config.digest_level_at_block ensures that it is not zero
	debug_assert!(max_digest_interval != 0);

	let max_digest_intervals_to_keep = min_blocks_to_keep / max_digest_interval;
	if max_digest_intervals_to_keep == 0 {
		1
	} else {
		max_digest_intervals_to_keep
	}
}
/// Select pruning delay for the changes tries. To make sure we could build a changes
/// trie at block B, we need an access to previous:
/// max_digest_interval = config.digest_interval ^ config.digest_levels
/// blocks. So we can only prune blocks that are earlier than B - max_digest_interval.
/// The pruning_delay stands for number of max_digest_interval-s that we want to keep:
/// 0 or 1: means that only last changes trie is guaranteed to exists;
/// 2: the last chnages trie + previous changes trie
/// ...
Select pruning delay for the changes tries. To make sure we could build a changes
trie at block B, we need an access to previous:
max_digest_interval = config.digest_interval ^ config.digest_levels
blocks. So we can only prune blocks that are earlier than B - max_digest_interval.
The pruning_delay stands for number of max_digest_interval-s that we want to keep:
0 or 1: means that only last changes trie is guaranteed to exists;
2: the last chnages trie + previous changes trie
Select pruning delay for the changes tries . To make sure we could build a changes trie at block B we need an access to previous : max_digest_interval = config . digest_interval ^ config . digest_levels blocks . So we can only prune blocks that are earlier than B - max_digest_interval . The pruning_delay stands for number of max_digest_interval - s that we want to keep : 0 or 1 : means that only last changes trie is guaranteed to exists ; 2 : the last chnages trie + previous changes trie
fn max_digest_intervals_to_keep(min_blocks_to_keep: u64, max_digest_interval: u64) -> u64 {
	// config.digest_level_at_block ensures that it is not zero
	debug_assert!(max_digest_interval != 0);
	let max_digest_intervals_to_keep = min_blocks_to_keep / max_digest_interval;
	if max_digest_intervals_to_keep == 0 {
		1
	} else {
		max_digest_intervals_to_keep
	}
}
fn max_digest_intervals_to_keep ( min_blocks_to_keep : u64 , max_digest_interval : u64 ) -> u64 { // config.digest_level_at_block ensures that it is not zero debug_assert ! ( max_digest_interval 0 ) ; let max_digest_intervals_to_keep = min_blocks_to_keep / max_digest_interval ; if max_digest_intervals_to_keep == 0 { 1 } else { max_digest_intervals_to_keep } }
Select pruning delay for the changes tries.
Select pruning delay for the changes tries .
min_blocks_to_keep
u64
max_digest_interval
u64
min_blocks_to_keep
u64
max_digest_interval
u64