lighthouse/beacon_node
Age Manning 3d99ce25f8 Correct a race condition when dialing peers (#4056)
There is a race condition which occurs when multiple discovery queries return at almost the exact same time and they independently contain a useful peer we would like to connect to.

The condition can occur that we can add the same peer to the dial queue, before we get a chance to process the queue. 
This ends up displaying an error to the user: 
```
ERRO Dialing an already dialing peer
```
Although this error is harmless it's not ideal. 

There are two solutions to resolving this:
1. As we decide to dial the peer, we change the state in the peer-db to dialing (before we add it to the queue) which would prevent other requests from adding to the queue. 
2. We prevent duplicates in the dial queue

This PR has opted for 2. because 1. will complicate the code in that we are changing states in non-intuitive places. Although this technically adds a very slight performance cost, its probably a cleaner solution as we can keep the state-changing logic in one place.
2023-03-16 05:44:54 +00:00
..
beacon_chain Add parent_block_number to payload SSE (#4053) 2023-03-14 06:26:37 +00:00
builder_client Merge remote-tracking branch 'origin/unstable' into capella 2023-01-12 16:22:00 +11:00
client Support for Ipv6 (#4046) 2023-03-14 01:13:34 +00:00
eth1 exchangeCapabilities & Capella Readiness Logging (#3918) 2023-01-31 18:26:23 +01:00
execution_layer Add parent_block_number to payload SSE (#4053) 2023-03-14 06:26:37 +00:00
genesis Fix the new BLS to execution change test 2023-01-25 15:47:07 +11:00
http_api Support for Ipv6 (#4046) 2023-03-14 01:13:34 +00:00
http_metrics Add content-type header to metrics server response (#3970) 2023-02-28 02:20:50 +00:00
lighthouse_network Correct a race condition when dialing peers (#4056) 2023-03-16 05:44:54 +00:00
network Correct a race condition when dialing peers (#4056) 2023-03-16 05:44:54 +00:00
operation_pool Fix Capella schema downgrades (#4004) 2023-02-20 17:50:42 +11:00
src Support for Ipv6 (#4046) 2023-03-14 01:13:34 +00:00
store Clean capella (#4019) 2023-03-01 03:19:02 +00:00
tests Appease Clippy 1.68 and refactor http_api (#4068) 2023-03-13 01:40:03 +00:00
timer Use async code when interacting with EL (#3244) 2022-07-03 05:36:50 +00:00
Cargo.toml Release v3.5.1 (#4049) 2023-03-07 07:57:39 +00:00