Implement prune only stagnant check mode (#5761)

* Limit number of elements loaded from the stagnant key

This will likely be required if we enable stagnant prunning as currently database has way
too many entries to be prunned in a single iteration

* Fmt run

* Slightly improve logging

* Some more debug nits

* Fmt pass

* Add stagnant prunning delay

* Enable stagnant check worker

* Implement stagnant pruning without stagnant checks

* Update node/core/chain-selection/src/tree.rs

Co-authored-by: Andronik <write@reusable.software>

* Apply suggestions from code review

Co-authored-by: Andronik <write@reusable.software>

Co-authored-by: Andronik <write@reusable.software>
This commit is contained in:
Vsevolod Stakhov
2022-07-09 09:36:33 +01:00
committed by GitHub
parent 1d9d959b1a
commit c11c1f38f4
4 changed files with 95 additions and 7 deletions
@@ -244,6 +244,7 @@ fn test_harness<T: Future<Output = VirtualOverseer>>(
context,
backend.clone(),
StagnantCheckInterval::new(TEST_STAGNANT_INTERVAL),
StagnantCheckMode::CheckAndPrune,
Box::new(clock.clone()),
);