mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 16:21:02 +00:00
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:
committed by
GitHub
parent
0f8b6f2f6e
commit
b8867d71bc
@@ -211,6 +211,9 @@ pub enum NetworkBridgeMessage {
|
||||
/// Report a peer for their actions.
|
||||
ReportPeer(PeerId, UnifiedReputationChange),
|
||||
|
||||
/// Disconnect a peer from the given peer-set without affecting their reputation.
|
||||
DisconnectPeer(PeerId, PeerSet),
|
||||
|
||||
/// Send a message to one or more peers on the validation peer-set.
|
||||
SendValidationMessage(Vec<PeerId>, protocol_v1::ValidationProtocol),
|
||||
|
||||
@@ -249,6 +252,7 @@ impl NetworkBridgeMessage {
|
||||
pub fn relay_parent(&self) -> Option<Hash> {
|
||||
match self {
|
||||
Self::ReportPeer(_, _) => None,
|
||||
Self::DisconnectPeer(_, _) => None,
|
||||
Self::SendValidationMessage(_, _) => None,
|
||||
Self::SendCollationMessage(_, _) => None,
|
||||
Self::SendValidationMessages(_) => None,
|
||||
|
||||
Reference in New Issue
Block a user