lighthouse/beacon_node
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
..
beacon_chain Avoid parallel fork choice runs during sync (#3217) 2022-05-25 03:27:30 +00:00
client Allow TaskExecutor to be used in async tests (#3178) 2022-05-16 08:35:59 +00:00
eth1 Improve eth1 block cache sync (for Ropsten) (#3234) 2022-06-03 06:05:03 +00:00
execution_layer Emit log when fee recipient values are inconsistent (#3202) 2022-06-03 03:22:54 +00:00
genesis Update and consolidate dependencies (#3136) 2022-04-04 00:26:16 +00:00
http_api Use genesis slot for node/syncing (#3226) 2022-05-31 06:09:11 +00:00
http_metrics Support IPv6 in BN and VC HTTP APIs (#3104) 2022-03-24 00:04:49 +00:00
lighthouse_network Fix: PeerManager doesn't remove "outbound only" peers which should be pruned (#3236) 2022-06-06 05:51:10 +00:00
network Fix typo in peer state transition log (#3224) 2022-05-31 06:09:10 +00:00
operation_pool Remove DB migrations for legacy database schemas (#3181) 2022-05-17 04:54:39 +00:00
src Improve eth1 block cache sync (for Ropsten) (#3234) 2022-06-03 06:05:03 +00:00
store Separate execution payloads in the DB (#3157) 2022-05-12 00:42:17 +00:00
tests Altair consensus changes and refactors (#2279) 2021-07-09 06:15:32 +00:00
timer Call per_slot_task from a blocking thread (v2) (#3199) 2022-05-20 23:05:07 +00:00
Cargo.toml v2.3.0 (#3222) 2022-05-30 01:35:10 +00:00