c62810b408
* 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>
58 lines
1.7 KiB
TOML
58 lines
1.7 KiB
TOML
[package]
|
|
name = "eth2_libp2p"
|
|
version = "0.2.0"
|
|
authors = ["Sigma Prime <contact@sigmaprime.io>"]
|
|
edition = "2018"
|
|
|
|
[dependencies]
|
|
discv5 = { version = "0.1.0-beta.6", features = ["libp2p"] }
|
|
unsigned-varint = { version = "0.6.0", features = ["codec"] }
|
|
types = { path = "../../consensus/types" }
|
|
hashset_delay = { path = "../../common/hashset_delay" }
|
|
eth2_ssz_types = { path = "../../consensus/ssz_types" }
|
|
serde = { version = "1.0.116", features = ["derive"] }
|
|
serde_derive = "1.0.116"
|
|
eth2_ssz = "0.1.2"
|
|
eth2_ssz_derive = "0.1.0"
|
|
slog = { version = "2.5.2", features = ["max_level_trace"] }
|
|
lighthouse_version = { path = "../../common/lighthouse_version" }
|
|
tokio = { version = "1.7.1", features = ["time", "macros"] }
|
|
futures = "0.3.7"
|
|
futures-io = "0.3.7"
|
|
error-chain = "0.12.4"
|
|
dirs = "3.0.1"
|
|
fnv = "1.0.7"
|
|
lazy_static = "1.4.0"
|
|
lighthouse_metrics = { path = "../../common/lighthouse_metrics" }
|
|
smallvec = "1.6.1"
|
|
tokio-io-timeout = "1.1.1"
|
|
lru = "0.6.0"
|
|
parking_lot = "0.11.0"
|
|
sha2 = "0.9.1"
|
|
base64 = "0.13.0"
|
|
snap = "1.0.1"
|
|
void = "1.0.2"
|
|
hex = "0.4.2"
|
|
tokio-util = { version = "0.6.2", features = ["codec", "compat", "time"] }
|
|
tiny-keccak = "2.0.2"
|
|
task_executor = { path = "../../common/task_executor" }
|
|
rand = "0.7.3"
|
|
directory = { path = "../../common/directory" }
|
|
regex = "1.3.9"
|
|
strum = { version = "0.20", features = ["derive"] }
|
|
|
|
[dependencies.libp2p]
|
|
version = "0.39.1"
|
|
default-features = false
|
|
features = ["websocket", "identify", "mplex", "yamux", "noise", "gossipsub", "dns-tokio", "tcp-tokio"]
|
|
|
|
[dev-dependencies]
|
|
tokio = { version = "1.7.1", features = ["full"] }
|
|
slog-term = "2.6.0"
|
|
slog-async = "2.5.0"
|
|
tempfile = "3.1.0"
|
|
exit-future = "0.2.0"
|
|
|
|
[features]
|
|
libp2p-websocket = []
|