The node activity score is computed as 2 * votes - polls, with an exponential smoothing. It starts at 0, and is updated every 10 minutes. After 10 minutes there are 3 possible cases:
- it turns > 0 if the node voted when we polled it
- it turns < 0 if the node did not vote when we polled it
- it remains 0 if we did not poll the node
This behavior can be problematic when deciding whether a node can be evicted or not: if the score of a node is 0, we don't know if it was never selected for polling (case 3) or if the score was not computed yet (before 10 minutes elapsed). If the node was never selected for polling, this means this is not an interesting node to protect from eviction. On the other hand, a node that did not get its score computed might be an interesting one, we just don't know yet.
This diff adds a negative penalty to the score, which causes the case 3 to turn into a negative score as well. By doing that we can easily decide if a node is worth being protected from eviction: a node with a strictly negative score is not worth it.
Depends on D9858. Supersedes D9862.
Ref T1634.