Test the pruning of excess peers using randomly generated input (#3248)

## Issue Addressed

https://github.com/sigp/lighthouse/issues/3092


## Proposed Changes

Added property-based tests for the pruning implementation. A randomly generated input for the test contains connection direction, subnets, and scores.


## Additional Info

I left some comments on this PR, what I have tried, and [a question](https://github.com/sigp/lighthouse/pull/3248#discussion_r891981969).

Co-authored-by: Diva M <divma@protonmail.com>
This commit is contained in:
Akihito Nakano
2022-06-25 22:22:34 +00:00
parent d21f083777
commit 082ed35bdc
4 changed files with 124 additions and 0 deletions

View File

@@ -223,6 +223,7 @@ impl RealScore {
#[cfg(test)]
pub fn set_gossipsub_score(&mut self, score: f64) {
self.gossipsub_score = score;
self.update_state();
}
/// Applies time-based logic such as decay rates to the score.