Update to Libp2p to 39.1 (#2448)
* Adjust beacon node timeouts for validator client HTTP requests (#2352) Resolves #2313 Provide `BeaconNodeHttpClient` with a dedicated `Timeouts` struct. This will allow granular adjustment of the timeout duration for different calls made from the VC to the BN. These can either be a constant value, or as a ratio of the slot duration. Improve timeout performance by using these adjusted timeout duration's only whenever a fallback endpoint is available. Add a CLI flag called `use-long-timeouts` to revert to the old behavior. Additionally set the default `BeaconNodeHttpClient` timeouts to the be the slot duration of the network, rather than a constant 12 seconds. This will allow it to adjust to different network specifications. Co-authored-by: Paul Hauner <paul@paulhauner.com> * Use read_recursive locks in database (#2417) Closes #2245 Replace all calls to `RwLock::read` in the `store` crate with `RwLock::read_recursive`. * Unfortunately we can't run the deadlock detector on CI because it's pinned to an old Rust 1.51.0 nightly which cannot compile Lighthouse (one of our deps uses `ptr::addr_of!` which is too new). A fun side-project at some point might be to update the deadlock detector. * The reason I think we haven't seen this deadlock (at all?) in practice is that _writes_ to the database's split point are quite infrequent, and a concurrent write is required to trigger the deadlock. The split point is only written when finalization advances, which is once per epoch (every ~6 minutes), and state reads are also quite sporadic. Perhaps we've just been incredibly lucky, or there's something about the timing of state reads vs database migration that protects us. * I wrote a few small programs to demo the deadlock, and the effectiveness of the `read_recursive` fix: https://github.com/michaelsproul/relock_deadlock_mvp * [The docs for `read_recursive`](https://docs.rs/lock_api/0.4.2/lock_api/struct.RwLock.html#method.read_recursive) warn of starvation for writers. I think in order for starvation to occur the database would have to be spammed with so many state reads that it's unable to ever clear them all and find time for a write, in which case migration of states to the freezer would cease. If an attack could be performed to trigger this starvation then it would likely trigger a deadlock in the current code, and I think ceasing migration is preferable to deadlocking in this extreme situation. In practice neither should occur due to protection from spammy peers at the network layer. Nevertheless, it would be prudent to run this change on the testnet nodes to check that it doesn't cause accidental starvation. * Return more detail when invalid data is found in the DB during startup (#2445) - Resolves #2444 Adds some more detail to the error message returned when the `BeaconChainBuilder` is unable to access or decode block/state objects during startup. NA * Use hardware acceleration for SHA256 (#2426) Modify the SHA256 implementation in `eth2_hashing` so that it switches between `ring` and `sha2` to take advantage of [x86_64 SHA extensions](https://en.wikipedia.org/wiki/Intel_SHA_extensions). The extensions are available on modern Intel and AMD CPUs, and seem to provide a considerable speed-up: on my Ryzen 5950X it dropped state tree hashing times by about 30% from 35ms to 25ms (on Prater). The extensions became available in the `sha2` crate [last year](https://www.reddit.com/r/rust/comments/hf2vcx/ann_rustcryptos_sha1_and_sha2_now_support/), and are not available in Ring, which uses a [pure Rust implementation of sha2](https://github.com/briansmith/ring/blob/main/src/digest/sha2.rs). Ring is faster on CPUs that lack the extensions so I've implemented a runtime switch to use `sha2` only when the extensions are available. The runtime switching seems to impose a miniscule penalty (see the benchmarks linked below). * Start a release checklist (#2270) NA Add a checklist to the release draft created by CI. I know @michaelsproul was also working on this and I suspect @realbigsean also might have useful input. NA * Serious banning * fmt Co-authored-by: Mac L <mjladson@pm.me> Co-authored-by: Paul Hauner <paul@paulhauner.com> Co-authored-by: Michael Sproul <michael@sigmaprime.io>
This commit is contained in:
parent
3c0d3227ab
commit
c62810b408
227
Cargo.lock
generated
227
Cargo.lock
generated
@ -1523,7 +1523,7 @@ dependencies = [
|
|||||||
"hex",
|
"hex",
|
||||||
"hkdf",
|
"hkdf",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"libp2p-core 0.29.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libp2p-core",
|
||||||
"lru",
|
"lru",
|
||||||
"lru_time_cache",
|
"lru_time_cache",
|
||||||
"parking_lot",
|
"parking_lot",
|
||||||
@ -3273,14 +3273,15 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libp2p"
|
name = "libp2p"
|
||||||
version = "0.39.0"
|
version = "0.39.1"
|
||||||
source = "git+https://github.com/libp2p/rust-libp2p?rev=c1ef4bffd225a78cefe8fa43dc8ee18e03ff4f93#c1ef4bffd225a78cefe8fa43dc8ee18e03ff4f93"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "9004c06878ef8f3b4b4067e69a140d87ed20bf777287f82223e49713b36ee433"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"atomic",
|
"atomic",
|
||||||
"bytes 1.0.1",
|
"bytes 1.0.1",
|
||||||
"futures",
|
"futures",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"libp2p-core 0.29.0 (git+https://github.com/libp2p/rust-libp2p?rev=c1ef4bffd225a78cefe8fa43dc8ee18e03ff4f93)",
|
"libp2p-core",
|
||||||
"libp2p-dns",
|
"libp2p-dns",
|
||||||
"libp2p-gossipsub",
|
"libp2p-gossipsub",
|
||||||
"libp2p-identify",
|
"libp2p-identify",
|
||||||
@ -3291,7 +3292,7 @@ dependencies = [
|
|||||||
"libp2p-tcp",
|
"libp2p-tcp",
|
||||||
"libp2p-websocket",
|
"libp2p-websocket",
|
||||||
"libp2p-yamux",
|
"libp2p-yamux",
|
||||||
"multiaddr 0.12.0",
|
"multiaddr",
|
||||||
"parking_lot",
|
"parking_lot",
|
||||||
"pin-project 1.0.7",
|
"pin-project 1.0.7",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
@ -3314,46 +3315,13 @@ dependencies = [
|
|||||||
"lazy_static",
|
"lazy_static",
|
||||||
"libsecp256k1",
|
"libsecp256k1",
|
||||||
"log",
|
"log",
|
||||||
"multiaddr 0.13.0",
|
"multiaddr",
|
||||||
"multihash 0.14.0",
|
"multihash",
|
||||||
"multistream-select 0.10.2",
|
"multistream-select",
|
||||||
"parking_lot",
|
"parking_lot",
|
||||||
"pin-project 1.0.7",
|
"pin-project 1.0.7",
|
||||||
"prost 0.8.0",
|
"prost",
|
||||||
"prost-build 0.8.0",
|
"prost-build",
|
||||||
"rand 0.7.3",
|
|
||||||
"ring",
|
|
||||||
"rw-stream-sink",
|
|
||||||
"sha2",
|
|
||||||
"smallvec",
|
|
||||||
"thiserror",
|
|
||||||
"unsigned-varint 0.7.0",
|
|
||||||
"void",
|
|
||||||
"zeroize",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "libp2p-core"
|
|
||||||
version = "0.29.0"
|
|
||||||
source = "git+https://github.com/libp2p/rust-libp2p?rev=c1ef4bffd225a78cefe8fa43dc8ee18e03ff4f93#c1ef4bffd225a78cefe8fa43dc8ee18e03ff4f93"
|
|
||||||
dependencies = [
|
|
||||||
"asn1_der",
|
|
||||||
"bs58",
|
|
||||||
"ed25519-dalek",
|
|
||||||
"either",
|
|
||||||
"fnv",
|
|
||||||
"futures",
|
|
||||||
"futures-timer",
|
|
||||||
"lazy_static",
|
|
||||||
"libsecp256k1",
|
|
||||||
"log",
|
|
||||||
"multiaddr 0.12.0",
|
|
||||||
"multihash 0.13.2",
|
|
||||||
"multistream-select 0.10.3",
|
|
||||||
"parking_lot",
|
|
||||||
"pin-project 1.0.7",
|
|
||||||
"prost 0.7.0",
|
|
||||||
"prost-build 0.7.0",
|
|
||||||
"rand 0.7.3",
|
"rand 0.7.3",
|
||||||
"ring",
|
"ring",
|
||||||
"rw-stream-sink",
|
"rw-stream-sink",
|
||||||
@ -3368,10 +3336,11 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "libp2p-dns"
|
name = "libp2p-dns"
|
||||||
version = "0.29.0"
|
version = "0.29.0"
|
||||||
source = "git+https://github.com/libp2p/rust-libp2p?rev=c1ef4bffd225a78cefe8fa43dc8ee18e03ff4f93#c1ef4bffd225a78cefe8fa43dc8ee18e03ff4f93"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "58ff08b3196b85a17f202d80589e93b1660a574af67275706657fdc762e42c32"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"futures",
|
"futures",
|
||||||
"libp2p-core 0.29.0 (git+https://github.com/libp2p/rust-libp2p?rev=c1ef4bffd225a78cefe8fa43dc8ee18e03ff4f93)",
|
"libp2p-core",
|
||||||
"log",
|
"log",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
"trust-dns-resolver",
|
"trust-dns-resolver",
|
||||||
@ -3380,7 +3349,8 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "libp2p-gossipsub"
|
name = "libp2p-gossipsub"
|
||||||
version = "0.32.0"
|
version = "0.32.0"
|
||||||
source = "git+https://github.com/libp2p/rust-libp2p?rev=c1ef4bffd225a78cefe8fa43dc8ee18e03ff4f93#c1ef4bffd225a78cefe8fa43dc8ee18e03ff4f93"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b1cc48709bcbc3a3321f08a73560b4bbb4166a7d56f6fdb615bc775f4f91058e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"asynchronous-codec",
|
"asynchronous-codec",
|
||||||
"base64 0.13.0",
|
"base64 0.13.0",
|
||||||
@ -3389,11 +3359,11 @@ dependencies = [
|
|||||||
"fnv",
|
"fnv",
|
||||||
"futures",
|
"futures",
|
||||||
"hex_fmt",
|
"hex_fmt",
|
||||||
"libp2p-core 0.29.0 (git+https://github.com/libp2p/rust-libp2p?rev=c1ef4bffd225a78cefe8fa43dc8ee18e03ff4f93)",
|
"libp2p-core",
|
||||||
"libp2p-swarm",
|
"libp2p-swarm",
|
||||||
"log",
|
"log",
|
||||||
"prost 0.7.0",
|
"prost",
|
||||||
"prost-build 0.7.0",
|
"prost-build",
|
||||||
"rand 0.7.3",
|
"rand 0.7.3",
|
||||||
"regex",
|
"regex",
|
||||||
"sha2",
|
"sha2",
|
||||||
@ -3405,14 +3375,15 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "libp2p-identify"
|
name = "libp2p-identify"
|
||||||
version = "0.30.0"
|
version = "0.30.0"
|
||||||
source = "git+https://github.com/libp2p/rust-libp2p?rev=c1ef4bffd225a78cefe8fa43dc8ee18e03ff4f93#c1ef4bffd225a78cefe8fa43dc8ee18e03ff4f93"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a7b61f6cf07664fb97016c318c4d4512b3dd4cc07238607f3f0163245f99008e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"futures",
|
"futures",
|
||||||
"libp2p-core 0.29.0 (git+https://github.com/libp2p/rust-libp2p?rev=c1ef4bffd225a78cefe8fa43dc8ee18e03ff4f93)",
|
"libp2p-core",
|
||||||
"libp2p-swarm",
|
"libp2p-swarm",
|
||||||
"log",
|
"log",
|
||||||
"prost 0.7.0",
|
"prost",
|
||||||
"prost-build 0.7.0",
|
"prost-build",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
"wasm-timer",
|
"wasm-timer",
|
||||||
]
|
]
|
||||||
@ -3420,12 +3391,13 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "libp2p-mplex"
|
name = "libp2p-mplex"
|
||||||
version = "0.29.0"
|
version = "0.29.0"
|
||||||
source = "git+https://github.com/libp2p/rust-libp2p?rev=c1ef4bffd225a78cefe8fa43dc8ee18e03ff4f93#c1ef4bffd225a78cefe8fa43dc8ee18e03ff4f93"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "313d9ea526c68df4425f580024e67a9d3ffd49f2c33de5154b1f5019816f7a99"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"asynchronous-codec",
|
"asynchronous-codec",
|
||||||
"bytes 1.0.1",
|
"bytes 1.0.1",
|
||||||
"futures",
|
"futures",
|
||||||
"libp2p-core 0.29.0 (git+https://github.com/libp2p/rust-libp2p?rev=c1ef4bffd225a78cefe8fa43dc8ee18e03ff4f93)",
|
"libp2p-core",
|
||||||
"log",
|
"log",
|
||||||
"nohash-hasher",
|
"nohash-hasher",
|
||||||
"parking_lot",
|
"parking_lot",
|
||||||
@ -3437,16 +3409,17 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "libp2p-noise"
|
name = "libp2p-noise"
|
||||||
version = "0.32.0"
|
version = "0.32.0"
|
||||||
source = "git+https://github.com/libp2p/rust-libp2p?rev=c1ef4bffd225a78cefe8fa43dc8ee18e03ff4f93#c1ef4bffd225a78cefe8fa43dc8ee18e03ff4f93"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "3f1db7212f342b6ba7c981cc40e31f76e9e56cb48e65fa4c142ecaca5839523e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytes 1.0.1",
|
"bytes 1.0.1",
|
||||||
"curve25519-dalek",
|
"curve25519-dalek",
|
||||||
"futures",
|
"futures",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"libp2p-core 0.29.0 (git+https://github.com/libp2p/rust-libp2p?rev=c1ef4bffd225a78cefe8fa43dc8ee18e03ff4f93)",
|
"libp2p-core",
|
||||||
"log",
|
"log",
|
||||||
"prost 0.7.0",
|
"prost",
|
||||||
"prost-build 0.7.0",
|
"prost-build",
|
||||||
"rand 0.8.4",
|
"rand 0.8.4",
|
||||||
"sha2",
|
"sha2",
|
||||||
"snow",
|
"snow",
|
||||||
@ -3458,11 +3431,12 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "libp2p-swarm"
|
name = "libp2p-swarm"
|
||||||
version = "0.30.0"
|
version = "0.30.0"
|
||||||
source = "git+https://github.com/libp2p/rust-libp2p?rev=c1ef4bffd225a78cefe8fa43dc8ee18e03ff4f93#c1ef4bffd225a78cefe8fa43dc8ee18e03ff4f93"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "7083861341e1555467863b4cd802bea1e8c4787c0f7b5110097d0f1f3248f9a9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"either",
|
"either",
|
||||||
"futures",
|
"futures",
|
||||||
"libp2p-core 0.29.0 (git+https://github.com/libp2p/rust-libp2p?rev=c1ef4bffd225a78cefe8fa43dc8ee18e03ff4f93)",
|
"libp2p-core",
|
||||||
"log",
|
"log",
|
||||||
"rand 0.7.3",
|
"rand 0.7.3",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
@ -3472,8 +3446,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libp2p-swarm-derive"
|
name = "libp2p-swarm-derive"
|
||||||
version = "0.23.0"
|
version = "0.24.0"
|
||||||
source = "git+https://github.com/libp2p/rust-libp2p?rev=c1ef4bffd225a78cefe8fa43dc8ee18e03ff4f93#c1ef4bffd225a78cefe8fa43dc8ee18e03ff4f93"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ab8cb308d4fc854869f5abb54fdab0833d2cf670d407c745849dc47e6e08d79c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"quote",
|
"quote",
|
||||||
"syn",
|
"syn",
|
||||||
@ -3482,14 +3457,15 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "libp2p-tcp"
|
name = "libp2p-tcp"
|
||||||
version = "0.29.0"
|
version = "0.29.0"
|
||||||
source = "git+https://github.com/libp2p/rust-libp2p?rev=c1ef4bffd225a78cefe8fa43dc8ee18e03ff4f93#c1ef4bffd225a78cefe8fa43dc8ee18e03ff4f93"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "79edd26b6b4bb5feee210dcda562dca186940dfecb0024b979c3f50824b3bf28"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"futures",
|
"futures",
|
||||||
"futures-timer",
|
"futures-timer",
|
||||||
"if-addrs",
|
"if-addrs",
|
||||||
"ipnet",
|
"ipnet",
|
||||||
"libc",
|
"libc",
|
||||||
"libp2p-core 0.29.0 (git+https://github.com/libp2p/rust-libp2p?rev=c1ef4bffd225a78cefe8fa43dc8ee18e03ff4f93)",
|
"libp2p-core",
|
||||||
"log",
|
"log",
|
||||||
"socket2 0.4.0",
|
"socket2 0.4.0",
|
||||||
"tokio 1.8.1",
|
"tokio 1.8.1",
|
||||||
@ -3498,12 +3474,13 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "libp2p-websocket"
|
name = "libp2p-websocket"
|
||||||
version = "0.30.0"
|
version = "0.30.0"
|
||||||
source = "git+https://github.com/libp2p/rust-libp2p?rev=c1ef4bffd225a78cefe8fa43dc8ee18e03ff4f93#c1ef4bffd225a78cefe8fa43dc8ee18e03ff4f93"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ddf99dcbf5063e9d59087f61b1e85c686ceab2f5abedb472d32288065c0e5e27"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"either",
|
"either",
|
||||||
"futures",
|
"futures",
|
||||||
"futures-rustls",
|
"futures-rustls",
|
||||||
"libp2p-core 0.29.0 (git+https://github.com/libp2p/rust-libp2p?rev=c1ef4bffd225a78cefe8fa43dc8ee18e03ff4f93)",
|
"libp2p-core",
|
||||||
"log",
|
"log",
|
||||||
"quicksink",
|
"quicksink",
|
||||||
"rw-stream-sink",
|
"rw-stream-sink",
|
||||||
@ -3515,10 +3492,11 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "libp2p-yamux"
|
name = "libp2p-yamux"
|
||||||
version = "0.33.0"
|
version = "0.33.0"
|
||||||
source = "git+https://github.com/libp2p/rust-libp2p?rev=c1ef4bffd225a78cefe8fa43dc8ee18e03ff4f93#c1ef4bffd225a78cefe8fa43dc8ee18e03ff4f93"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "214cc0dd9c37cbed27f0bb1eba0c41bbafdb93a8be5e9d6ae1e6b4b42cd044bf"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"futures",
|
"futures",
|
||||||
"libp2p-core 0.29.0 (git+https://github.com/libp2p/rust-libp2p?rev=c1ef4bffd225a78cefe8fa43dc8ee18e03ff4f93)",
|
"libp2p-core",
|
||||||
"parking_lot",
|
"parking_lot",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"yamux",
|
"yamux",
|
||||||
@ -3901,24 +3879,6 @@ dependencies = [
|
|||||||
"tokio 1.8.1",
|
"tokio 1.8.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "multiaddr"
|
|
||||||
version = "0.12.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "7139982f583d7e53879d9f611fe48ced18e77d684309484f2252c76bcd39f549"
|
|
||||||
dependencies = [
|
|
||||||
"arrayref",
|
|
||||||
"bs58",
|
|
||||||
"byteorder",
|
|
||||||
"data-encoding",
|
|
||||||
"multihash 0.13.2",
|
|
||||||
"percent-encoding",
|
|
||||||
"serde",
|
|
||||||
"static_assertions",
|
|
||||||
"unsigned-varint 0.7.0",
|
|
||||||
"url",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "multiaddr"
|
name = "multiaddr"
|
||||||
version = "0.13.0"
|
version = "0.13.0"
|
||||||
@ -3929,7 +3889,7 @@ dependencies = [
|
|||||||
"bs58",
|
"bs58",
|
||||||
"byteorder",
|
"byteorder",
|
||||||
"data-encoding",
|
"data-encoding",
|
||||||
"multihash 0.14.0",
|
"multihash",
|
||||||
"percent-encoding",
|
"percent-encoding",
|
||||||
"serde",
|
"serde",
|
||||||
"static_assertions",
|
"static_assertions",
|
||||||
@ -3937,19 +3897,6 @@ dependencies = [
|
|||||||
"url",
|
"url",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "multihash"
|
|
||||||
version = "0.13.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "4dac63698b887d2d929306ea48b63760431ff8a24fac40ddb22f9c7f49fb7cab"
|
|
||||||
dependencies = [
|
|
||||||
"digest",
|
|
||||||
"generic-array",
|
|
||||||
"multihash-derive",
|
|
||||||
"sha2",
|
|
||||||
"unsigned-varint 0.5.1",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "multihash"
|
name = "multihash"
|
||||||
version = "0.14.0"
|
version = "0.14.0"
|
||||||
@ -4015,19 +3962,6 @@ dependencies = [
|
|||||||
"unsigned-varint 0.7.0",
|
"unsigned-varint 0.7.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "multistream-select"
|
|
||||||
version = "0.10.3"
|
|
||||||
source = "git+https://github.com/libp2p/rust-libp2p?rev=c1ef4bffd225a78cefe8fa43dc8ee18e03ff4f93#c1ef4bffd225a78cefe8fa43dc8ee18e03ff4f93"
|
|
||||||
dependencies = [
|
|
||||||
"bytes 1.0.1",
|
|
||||||
"futures",
|
|
||||||
"log",
|
|
||||||
"pin-project 1.0.7",
|
|
||||||
"smallvec",
|
|
||||||
"unsigned-varint 0.7.0",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "native-tls"
|
name = "native-tls"
|
||||||
version = "0.2.7"
|
version = "0.2.7"
|
||||||
@ -4721,16 +4655,6 @@ dependencies = [
|
|||||||
"thiserror",
|
"thiserror",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "prost"
|
|
||||||
version = "0.7.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "9e6984d2f1a23009bd270b8bb56d0926810a3d483f59c987d77969e9d8e840b2"
|
|
||||||
dependencies = [
|
|
||||||
"bytes 1.0.1",
|
|
||||||
"prost-derive 0.7.0",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "prost"
|
name = "prost"
|
||||||
version = "0.8.0"
|
version = "0.8.0"
|
||||||
@ -4738,25 +4662,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "de5e2533f59d08fcf364fd374ebda0692a70bd6d7e66ef97f306f45c6c5d8020"
|
checksum = "de5e2533f59d08fcf364fd374ebda0692a70bd6d7e66ef97f306f45c6c5d8020"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytes 1.0.1",
|
"bytes 1.0.1",
|
||||||
"prost-derive 0.8.0",
|
"prost-derive",
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "prost-build"
|
|
||||||
version = "0.7.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "32d3ebd75ac2679c2af3a92246639f9fcc8a442ee420719cc4fe195b98dd5fa3"
|
|
||||||
dependencies = [
|
|
||||||
"bytes 1.0.1",
|
|
||||||
"heck",
|
|
||||||
"itertools 0.9.0",
|
|
||||||
"log",
|
|
||||||
"multimap",
|
|
||||||
"petgraph",
|
|
||||||
"prost 0.7.0",
|
|
||||||
"prost-types 0.7.0",
|
|
||||||
"tempfile",
|
|
||||||
"which",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -4771,25 +4677,12 @@ dependencies = [
|
|||||||
"log",
|
"log",
|
||||||
"multimap",
|
"multimap",
|
||||||
"petgraph",
|
"petgraph",
|
||||||
"prost 0.8.0",
|
"prost",
|
||||||
"prost-types 0.8.0",
|
"prost-types",
|
||||||
"tempfile",
|
"tempfile",
|
||||||
"which",
|
"which",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "prost-derive"
|
|
||||||
version = "0.7.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "169a15f3008ecb5160cba7d37bcd690a7601b6d30cfb87a117d45e59d52af5d4"
|
|
||||||
dependencies = [
|
|
||||||
"anyhow",
|
|
||||||
"itertools 0.9.0",
|
|
||||||
"proc-macro2",
|
|
||||||
"quote",
|
|
||||||
"syn",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "prost-derive"
|
name = "prost-derive"
|
||||||
version = "0.8.0"
|
version = "0.8.0"
|
||||||
@ -4803,16 +4696,6 @@ dependencies = [
|
|||||||
"syn",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "prost-types"
|
|
||||||
version = "0.7.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "b518d7cdd93dab1d1122cf07fa9a60771836c668dde9d9e2a139f957f0d9f1bb"
|
|
||||||
dependencies = [
|
|
||||||
"bytes 1.0.1",
|
|
||||||
"prost 0.7.0",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "prost-types"
|
name = "prost-types"
|
||||||
version = "0.8.0"
|
version = "0.8.0"
|
||||||
@ -4820,7 +4703,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "603bbd6394701d13f3f25aada59c7de9d35a6a5887cfc156181234a44002771b"
|
checksum = "603bbd6394701d13f3f25aada59c7de9d35a6a5887cfc156181234a44002771b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytes 1.0.1",
|
"bytes 1.0.1",
|
||||||
"prost 0.8.0",
|
"prost",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -7031,12 +6914,6 @@ dependencies = [
|
|||||||
"subtle",
|
"subtle",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "unsigned-varint"
|
|
||||||
version = "0.5.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "f7fdeedbf205afadfe39ae559b75c3240f24e257d0ca27e85f85cb82aa19ac35"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unsigned-varint"
|
name = "unsigned-varint"
|
||||||
version = "0.6.0"
|
version = "0.6.0"
|
||||||
|
@ -42,10 +42,7 @@ regex = "1.3.9"
|
|||||||
strum = { version = "0.20", features = ["derive"] }
|
strum = { version = "0.20", features = ["derive"] }
|
||||||
|
|
||||||
[dependencies.libp2p]
|
[dependencies.libp2p]
|
||||||
#version = "0.38.0"
|
version = "0.39.1"
|
||||||
# Bleeding edge, while we wait for 0.39.0
|
|
||||||
git = "https://github.com/libp2p/rust-libp2p"
|
|
||||||
rev = "c1ef4bffd225a78cefe8fa43dc8ee18e03ff4f93"
|
|
||||||
default-features = false
|
default-features = false
|
||||||
features = ["websocket", "identify", "mplex", "yamux", "noise", "gossipsub", "dns-tokio", "tcp-tokio"]
|
features = ["websocket", "identify", "mplex", "yamux", "noise", "gossipsub", "dns-tokio", "tcp-tokio"]
|
||||||
|
|
||||||
|
@ -840,7 +840,6 @@ impl<TSpec: EthSpec> NetworkBehaviourEventProcess<RPCMessage<TSpec>> for Behavio
|
|||||||
let peer_id = event.peer_id;
|
let peer_id = event.peer_id;
|
||||||
|
|
||||||
if !self.peer_manager.is_connected(&peer_id) {
|
if !self.peer_manager.is_connected(&peer_id) {
|
||||||
// NOTE: Upgraded to log to test occurrences
|
|
||||||
debug!(
|
debug!(
|
||||||
self.log,
|
self.log,
|
||||||
"Ignoring rpc message of disconnecting peer";
|
"Ignoring rpc message of disconnecting peer";
|
||||||
|
@ -31,7 +31,7 @@ const MIN_SCORE: f64 = -100.0;
|
|||||||
/// The halflife of a peer's score. I.e the number of seconds it takes for the score to decay to half its value.
|
/// The halflife of a peer's score. I.e the number of seconds it takes for the score to decay to half its value.
|
||||||
const SCORE_HALFLIFE: f64 = 600.0;
|
const SCORE_HALFLIFE: f64 = 600.0;
|
||||||
/// The number of seconds we ban a peer for before their score begins to decay.
|
/// The number of seconds we ban a peer for before their score begins to decay.
|
||||||
const BANNED_BEFORE_DECAY: Duration = Duration::from_secs(1800);
|
const BANNED_BEFORE_DECAY: Duration = Duration::from_secs(12 * 3600); // 12 hours
|
||||||
|
|
||||||
/// We weight negative gossipsub scores in such a way that they never result in a disconnect by
|
/// We weight negative gossipsub scores in such a way that they never result in a disconnect by
|
||||||
/// themselves. This "solves" the problem of non-decaying gossipsub scores for disconnected peers.
|
/// themselves. This "solves" the problem of non-decaying gossipsub scores for disconnected peers.
|
||||||
|
@ -329,8 +329,8 @@ impl<TSpec: EthSpec> Service<TSpec> {
|
|||||||
.peer_manager_mut()
|
.peer_manager_mut()
|
||||||
.inject_connection_closed(peer_id, endpoint, num_established);
|
.inject_connection_closed(peer_id, endpoint, num_established);
|
||||||
}
|
}
|
||||||
SwarmEvent::NewListenAddr(multiaddr) => {
|
SwarmEvent::NewListenAddr { address, .. } => {
|
||||||
return Libp2pEvent::NewListenAddr(multiaddr)
|
return Libp2pEvent::NewListenAddr(address)
|
||||||
}
|
}
|
||||||
SwarmEvent::IncomingConnection {
|
SwarmEvent::IncomingConnection {
|
||||||
local_addr,
|
local_addr,
|
||||||
@ -363,16 +363,18 @@ impl<TSpec: EthSpec> Service<TSpec> {
|
|||||||
SwarmEvent::UnknownPeerUnreachableAddr { address, error } => {
|
SwarmEvent::UnknownPeerUnreachableAddr { address, error } => {
|
||||||
debug!(self.log, "Peer not known at dialed address"; "address" => %address, "error" => %error);
|
debug!(self.log, "Peer not known at dialed address"; "address" => %address, "error" => %error);
|
||||||
}
|
}
|
||||||
SwarmEvent::ExpiredListenAddr(multiaddr) => {
|
SwarmEvent::ExpiredListenAddr { address, .. } => {
|
||||||
debug!(self.log, "Listen address expired"; "multiaddr" => %multiaddr)
|
debug!(self.log, "Listen address expired"; "address" => %address)
|
||||||
}
|
}
|
||||||
SwarmEvent::ListenerClosed { addresses, reason } => {
|
SwarmEvent::ListenerClosed {
|
||||||
|
addresses, reason, ..
|
||||||
|
} => {
|
||||||
crit!(self.log, "Listener closed"; "addresses" => ?addresses, "reason" => ?reason);
|
crit!(self.log, "Listener closed"; "addresses" => ?addresses, "reason" => ?reason);
|
||||||
if Swarm::listeners(&self.swarm).count() == 0 {
|
if Swarm::listeners(&self.swarm).count() == 0 {
|
||||||
return Libp2pEvent::ZeroListeners;
|
return Libp2pEvent::ZeroListeners;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SwarmEvent::ListenerError { error } => {
|
SwarmEvent::ListenerError { error, .. } => {
|
||||||
// this is non fatal, but we still check
|
// this is non fatal, but we still check
|
||||||
warn!(self.log, "Listener error"; "error" => ?error);
|
warn!(self.log, "Listener error"; "error" => ?error);
|
||||||
if Swarm::listeners(&self.swarm).count() == 0 {
|
if Swarm::listeners(&self.swarm).count() == 0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user