lighthouse/beacon_node
Age Manning 3ebb8b0244 Improved peer management (#2993)
## Issue Addressed

I noticed in some logs some excess and unecessary discovery queries. What was happening was we were pruning our peers down to our outbound target and having some disconnect. When we are below this threshold we try to find more peers (even if we are at our peer limit). The request becomes futile because we have no more peer slots. 

This PR corrects this issue and advances the pruning mechanism to favour subnet peers. 

An overview the new logic added is:
- We prune peers down to a target outbound peer count which is higher than the minimum outbound peer count.
- We only search for more peers if there is room to do so, and we are below the minimum outbound peer count not the target. So this gives us some buffer for peers to disconnect. The buffer is currently 10%

The modified pruning logic is documented in the code but for reference it should do the following:
- Prune peers with bad scores first
- If we need to prune more peers, then prune peers that are subscribed to a long-lived subnet
- If we still need to prune peers, the prune peers that we have a higher density of on any given subnet which should drive for uniform peers across all subnets.

This will need a bit of testing as it modifies some significant peer management behaviours in lighthouse.
2022-02-18 02:36:43 +00:00
..
beacon_chain Engine API v1.0.0.alpha.6 + interop tests (#3024) 2022-02-17 21:47:06 +00:00
client Engine API v1.0.0.alpha.6 + interop tests (#3024) 2022-02-17 21:47:06 +00:00
eth1 Bump crate versions (#2829) 2021-12-02 14:29:57 +11:00
execution_layer Engine API v1.0.0.alpha.6 + interop tests (#3024) 2022-02-17 21:47:06 +00:00
genesis Bump crate versions (#2829) 2021-12-02 14:29:57 +11:00
http_api libp2p upgrade + gossipsub interval fix (#3012) 2022-02-10 04:12:03 +00:00
http_metrics libp2p upgrade + gossipsub interval fix (#3012) 2022-02-10 04:12:03 +00:00
lighthouse_network Improved peer management (#2993) 2022-02-18 02:36:43 +00:00
network Improved peer management (#2993) 2022-02-18 02:36:43 +00:00
operation_pool Implement API for block rewards (#2628) 2022-01-27 01:06:02 +00:00
src Engine API v1.0.0.alpha.6 + interop tests (#3024) 2022-02-17 21:47:06 +00:00
store Additional networking metrics (#2549) 2021-12-22 06:17:14 +00:00
tests Altair consensus changes and refactors (#2279) 2021-07-09 06:15:32 +00:00
timer Update Lighthouse Dependencies (#2818) 2021-11-18 05:08:42 +00:00
Cargo.toml Engine API v1.0.0.alpha.6 + interop tests (#3024) 2022-02-17 21:47:06 +00:00