Skip to content

Commit 3a5888e

Browse files
Ban and unban peers at the swarm level (#3653)
## Issue Addressed I missed this from #3491. peers were being banned at the behaviour level only. The identify errors are explained by this as well ## Proposed Changes Add banning and unbanning ## Additional Info Befor,e having tests that catch this was hard because the swarm was outside the behaviour. We could now have tests that prevent something like this in the future
1 parent dbb93cd commit 3a5888e

File tree

1 file changed

+2
-0
lines changed
  • beacon_node/lighthouse_network/src/service

1 file changed

+2
-0
lines changed

beacon_node/lighthouse_network/src/service/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1342,10 +1342,12 @@ impl<AppReqId: ReqId, TSpec: EthSpec> Network<AppReqId, TSpec> {
13421342
Some(NetworkEvent::PeerDisconnected(peer_id))
13431343
}
13441344
PeerManagerEvent::Banned(peer_id, associated_ips) => {
1345+
self.swarm.ban_peer_id(peer_id);
13451346
self.discovery_mut().ban_peer(&peer_id, associated_ips);
13461347
Some(NetworkEvent::PeerBanned(peer_id))
13471348
}
13481349
PeerManagerEvent::UnBanned(peer_id, associated_ips) => {
1350+
self.swarm.unban_peer_id(peer_id);
13491351
self.discovery_mut().unban_peer(&peer_id, associated_ips);
13501352
Some(NetworkEvent::PeerUnbanned(peer_id))
13511353
}

0 commit comments

Comments
 (0)