3d99ce25f8
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.
54 lines
1.6 KiB
TOML
54 lines
1.6 KiB
TOML
[package]
|
|
name = "network"
|
|
version = "0.2.0"
|
|
authors = ["Sigma Prime <contact@sigmaprime.io>"]
|
|
edition = "2021"
|
|
|
|
[dev-dependencies]
|
|
sloggers = { version = "2.1.1", features = ["json"] }
|
|
genesis = { path = "../genesis" }
|
|
matches = "0.1.8"
|
|
exit-future = "0.2.0"
|
|
slog-term = "2.6.0"
|
|
slog-async = "2.5.0"
|
|
environment = { path = "../../lighthouse/environment" }
|
|
|
|
[dependencies]
|
|
beacon_chain = { path = "../beacon_chain" }
|
|
store = { path = "../store" }
|
|
lighthouse_network = { path = "../lighthouse_network" }
|
|
types = { path = "../../consensus/types" }
|
|
slot_clock = { path = "../../common/slot_clock" }
|
|
slog = { version = "2.5.2", features = ["max_level_trace"] }
|
|
hex = "0.4.2"
|
|
eth2_ssz = "0.4.1"
|
|
eth2_ssz_types = "0.2.2"
|
|
futures = "0.3.7"
|
|
error-chain = "0.12.4"
|
|
tokio = { version = "1.14.0", features = ["full"] }
|
|
tokio-stream = "0.1.3"
|
|
smallvec = "1.6.1"
|
|
rand = "0.8.5"
|
|
fnv = "1.0.7"
|
|
rlp = "0.5.0"
|
|
lazy_static = "1.4.0"
|
|
lighthouse_metrics = { path = "../../common/lighthouse_metrics" }
|
|
logging = { path = "../../common/logging" }
|
|
task_executor = { path = "../../common/task_executor" }
|
|
igd = "0.11.1"
|
|
itertools = "0.10.0"
|
|
num_cpus = "1.13.0"
|
|
lru_cache = { path = "../../common/lru_cache" }
|
|
if-addrs = "0.6.4"
|
|
strum = "0.24.0"
|
|
tokio-util = { version = "0.6.3", features = ["time"] }
|
|
derivative = "2.2.0"
|
|
delay_map = "0.3.0"
|
|
ethereum-types = { version = "0.14.1", optional = true }
|
|
operation_pool = { path = "../operation_pool" }
|
|
execution_layer = { path = "../execution_layer" }
|
|
|
|
[features]
|
|
deterministic_long_lived_attnets = [ "ethereum-types" ]
|
|
# default = ["deterministic_long_lived_attnets"]
|