Evict inactive peers from the collator protocol peer-set (#2680)

* malicious reputation cost is fatal

* make ReportBad a malicious cost

* futures control-flow for cleaning up inactive collator peers

* guide: network bridge updates

* add `PeerDisconnected` message

* guide: update

* reverse order

* remember to match

* implement disconnect peer in network bridge

* implement disconnect_inactive_peers

* test

* remove println

* don't hardcore policy

* add fuse outside of loop

* use default eviction policy
This commit is contained in:
Robert Habermeier
2021-03-24 13:32:28 +01:00
committed by GitHub
parent 0f8b6f2f6e
commit b8867d71bc
12 changed files with 437 additions and 38 deletions
@@ -32,7 +32,7 @@ impl UnifiedReputationChange {
Self::CostMajor(_) => -300_000,
Self::CostMinorRepeated(_) => -200_000,
Self::CostMajorRepeated(_) => -600_000,
Self::Malicious(_) => -1_000_000,
Self::Malicious(_) => i32::min_value(),
Self::BenefitMajorFirst(_) => 300_000,
Self::BenefitMajor(_) => 200_000,
Self::BenefitMinorFirst(_) => 15_000,