nano-node
nano-node copied to clipboard
Overhaul of `online_reps` class
This is an overhaul of online_reps
class:
- Run periodic online weight sampling on a dedicated thread, which makes it more robust and easier to debug.
- Eliminate use of
store.online_weight.count ()
and erasing entries based on their timestamps instead (2 weeks for live, 1 day for beta). - Add stats and logging to improve observability.
- Add asserts to ensure data consistency.
- Split and rewrite functions, so they are (subjectively) cleaner.
- Ensure that
nano::online_reps::trended ()
can never return value lower than the limit configured viaonline_weight_minimum
.