lighthouse/beacon_node/lighthouse_network/src
Akihito Nakano a6d2ed6119 Fix: PeerManager doesn't remove "outbound only" peers which should be pruned (#3236)
## Issue Addressed

This is one step to address https://github.com/sigp/lighthouse/issues/3092 before introducing `quickcheck`.

I noticed an issue while I was reading the pruning implementation `PeerManager::prune_excess_peers()`. If a peer with the following condition, **`outbound_peers_pruned` counter increases but the peer is not pushed to `peers_to_prune`**.

- [outbound only](1e4ac8a4b9/beacon_node/lighthouse_network/src/peer_manager/mod.rs (L1018))
- [min_subnet_count <= MIN_SYNC_COMMITTEE_PEERS](1e4ac8a4b9/beacon_node/lighthouse_network/src/peer_manager/mod.rs (L1047))

As a result, PeerManager doesn't remove "outbound" peers which should be pruned.

Note: [`subnet_to_peer`](e0d673ea86/beacon_node/lighthouse_network/src/peer_manager/mod.rs (L999)) (HashMap) doesn't guarantee a particular order of iteration. So whether the test fails depend on the order of iteration.
2022-06-06 05:51:10 +00:00
..
behaviour log upgrades + prevent dialing of disconnecting peers (#3148) 2022-04-13 03:54:43 +00:00
discovery [refactor] Refactor Option/Result combinators (#3180) 2022-05-16 01:59:47 +00:00
peer_manager Fix: PeerManager doesn't remove "outbound only" peers which should be pruned (#3236) 2022-06-06 05:51:10 +00:00
rpc Poll shutdown timeout in rpc handler (#3153) 2022-04-13 03:54:44 +00:00
types Retry gossipsub messages when insufficient peers (#2964) 2022-02-03 01:12:30 +00:00
config.rs Filter non global ips from discovery (#3023) 2022-03-02 03:14:27 +00:00
lib.rs libp2p upgrade + gossipsub interval fix (#3012) 2022-02-10 04:12:03 +00:00
metrics.rs Retry gossipsub messages when insufficient peers (#2964) 2022-02-03 01:12:30 +00:00
service.rs Custom RPC request management for sync (#3029) 2022-03-02 22:07:17 +00:00