From 6219114a57ee49ab4ba587c91247793934afc0e2 Mon Sep 17 00:00:00 2001 From: realbigsean Date: Fri, 22 Jan 2021 18:26:08 -0500 Subject: [PATCH 01/17] udpate dependencies --- Cargo.lock | 1351 ++++++++--------- account_manager/Cargo.toml | 2 +- beacon_node/Cargo.toml | 2 +- beacon_node/beacon_chain/Cargo.toml | 2 +- beacon_node/client/Cargo.toml | 4 +- beacon_node/client/src/notifier.rs | 4 +- beacon_node/eth1/Cargo.toml | 4 +- beacon_node/eth1/src/service.rs | 3 +- beacon_node/eth2_libp2p/Cargo.toml | 18 +- beacon_node/eth2_libp2p/src/behaviour/mod.rs | 4 +- beacon_node/eth2_libp2p/src/discovery/mod.rs | 5 +- .../eth2_libp2p/src/peer_manager/mod.rs | 2 +- beacon_node/eth2_libp2p/src/rpc/handler.rs | 1 + beacon_node/eth2_libp2p/src/rpc/protocol.rs | 7 +- .../eth2_libp2p/src/rpc/rate_limiter.rs | 2 +- beacon_node/genesis/Cargo.toml | 2 +- beacon_node/http_api/Cargo.toml | 8 +- beacon_node/http_api/src/lib.rs | 8 +- beacon_node/http_metrics/Cargo.toml | 6 +- beacon_node/network/Cargo.toml | 3 +- beacon_node/network/src/router/mod.rs | 4 +- beacon_node/network/src/service.rs | 4 +- beacon_node/timer/Cargo.toml | 2 +- beacon_node/timer/src/lib.rs | 3 +- boot_node/Cargo.toml | 2 +- common/deposit_contract/Cargo.toml | 2 +- common/eth2/Cargo.toml | 4 +- common/hashset_delay/Cargo.toml | 4 +- common/remote_signer_consumer/Cargo.toml | 4 +- common/rest_types/Cargo.toml | 2 +- common/task_executor/Cargo.toml | 2 +- common/warp_utils/Cargo.toml | 4 +- consensus/int_to_bytes/Cargo.toml | 2 +- lcli/Cargo.toml | 2 +- lighthouse/Cargo.toml | 2 +- lighthouse/environment/Cargo.toml | 2 +- slasher/service/Cargo.toml | 3 +- slasher/service/src/service.rs | 6 +- testing/eth1_test_rig/Cargo.toml | 2 +- testing/node_test_rig/Cargo.toml | 2 +- testing/remote_signer_test/Cargo.toml | 4 +- testing/simulator/Cargo.toml | 2 +- testing/simulator/src/eth1_sim.rs | 4 +- testing/simulator/src/sync_sim.rs | 12 +- validator_client/Cargo.toml | 6 +- validator_client/src/attestation_service.rs | 4 +- validator_client/src/duties_service.rs | 4 +- validator_client/src/fork_service.rs | 4 +- validator_client/src/notifier.rs | 2 +- 49 files changed, 769 insertions(+), 769 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ec8bbde7d1f..c484c502d55 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -19,7 +19,7 @@ dependencies = [ "eth2_ssz_derive", "eth2_wallet", "eth2_wallet_manager", - "futures 0.3.8", + "futures 0.3.12", "hex", "libc", "rand 0.7.3", @@ -31,7 +31,7 @@ dependencies = [ "slog-term", "slot_clock", "tempfile", - "tokio 0.3.6", + "tokio 1.0.2", "tokio-compat-02", "types", "validator_dir", @@ -58,9 +58,9 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.14.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c0929d69e78dd9bf5408269919fcbcaeb2e35e5d43e5815517cdc6a8e11a423" +checksum = "a55f82cfe485775d02112886f4169bde0c5894d75e79ead7eafe7e40a25e45f7" dependencies = [ "gimli", ] @@ -228,9 +228,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.36" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68803225a7b13e47191bab76f2687382b60d259e8cf37f6e1893658b84bb9479" +checksum = "afddf7f520a80dbf76e6f50a35bca42a2331ef227a28b3b6dc5c2e2338d114b1" [[package]] name = "arbitrary" @@ -243,9 +243,9 @@ dependencies = [ [[package]] name = "arc-swap" -version = "0.4.8" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dabe5a181f83789739c194cbe5a897dde195078fac08568d09221fd6137a7ba8" +checksum = "d4d7d63395147b81a9e570bcc6243aaf71c017bd666d4909cfef0085bdda8d73" [[package]] name = "arrayref" @@ -325,12 +325,15 @@ dependencies = [ [[package]] name = "async-global-executor" -version = "1.4.3" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73079b49cd26b8fd5a15f68fc7707fc78698dc2a3d61430f2a7a9430230dfa04" +checksum = "9586ec52317f36de58453159d48351bc244bc24ced3effc1fce22f3d48664af6" dependencies = [ + "async-channel", "async-executor", "async-io", + "async-mutex", + "blocking", "futures-lite", "num_cpus", "once_cell", @@ -356,6 +359,15 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "async-lock" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1996609732bde4a9988bc42125f55f2af5f3c36370e27c778d5191a4a1b63bfb" +dependencies = [ + "event-listener", +] + [[package]] name = "async-mutex" version = "1.4.0" @@ -377,6 +389,15 @@ dependencies = [ "url", ] +[[package]] +name = "async-object-pool" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aeb901c30ebc2fc4ab46395bbfbdba9542c16559d853645d75190c3056caf3bc" +dependencies = [ + "async-std", +] + [[package]] name = "async-process" version = "1.0.1" @@ -395,17 +416,16 @@ dependencies = [ [[package]] name = "async-std" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f9f84f1280a2b436a2c77c2582602732b6c2f4321d5494d6e799e6c367859a8" +checksum = "d9f06685bad74e0570f5213741bea82158279a4103d988e57bfada11ad230341" dependencies = [ "async-channel", "async-global-executor", "async-io", - "async-mutex", + "async-lock", "async-process", - "blocking", - "crossbeam-utils 0.8.1", + "crossbeam-utils", "futures-channel", "futures-core", "futures-io", @@ -416,31 +436,39 @@ dependencies = [ "memchr", "num_cpus", "once_cell", - "pin-project-lite 0.2.0", + "pin-project-lite 0.2.4", "pin-utils", "slab", "wasm-bindgen-futures", ] [[package]] -name = "async-task" -version = "4.0.3" +name = "async-stream" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91831deabf0d6d7ec49552e489aed63b7456a7a3c46cff62adad428110b0af0" +checksum = "3670df70cbc01729f901f94c887814b3c68db038aad1329a418bae178bc5295c" +dependencies = [ + "async-stream-impl", + "futures-core", +] [[package]] -name = "async-tls" -version = "0.11.0" +name = "async-stream-impl" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f23d769dbf1838d5df5156e7b1ad404f4c463d1ac2c6aeb6cd943630f8a8400" +checksum = "a3548b8efc9f8e8a5a0a2808c5bd8451a9031b9e5b879a79590304ae928b0a70" dependencies = [ - "futures-core", - "futures-io", - "rustls", - "webpki", - "webpki-roots", + "proc-macro2", + "quote", + "syn", ] +[[package]] +name = "async-task" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e91831deabf0d6d7ec49552e489aed63b7456a7a3c46cff62adad428110b0af0" + [[package]] name = "async-trait" version = "0.1.42" @@ -452,6 +480,19 @@ dependencies = [ "syn", ] +[[package]] +name = "asynchronous-codec" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb4401f0a3622dad2e0763fa79e0eb328bc70fb7dccfdd645341f00d671247d6" +dependencies = [ + "bytes 1.0.1", + "futures-sink", + "futures-util", + "memchr", + "pin-project-lite 0.2.4", +] + [[package]] name = "atomic" version = "0.5.0" @@ -473,7 +514,7 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf13118df3e3dce4b5ac930641343b91b656e4e72c8f8325838b01a4b1c9d45" dependencies = [ - "http 0.2.2", + "http", "log", "url", ] @@ -567,7 +608,7 @@ dependencies = [ "eth2_ssz_types", "exit-future", "fork_choice", - "futures 0.3.8", + "futures 0.3.12", "genesis", "int_to_bytes", "integer-sqrt", @@ -600,7 +641,7 @@ dependencies = [ "strum", "task_executor", "tempfile", - "tokio 0.3.6", + "tokio 1.0.2", "tree_hash", "types", ] @@ -622,7 +663,7 @@ dependencies = [ "eth2_network_config", "eth2_ssz", "exit-future", - "futures 0.3.8", + "futures 0.3.12", "genesis", "hex", "hyper 0.13.9", @@ -637,7 +678,7 @@ dependencies = [ "slog-term", "store", "task_executor", - "tokio 0.3.6", + "tokio 1.0.2", "tokio-compat-02", "types", ] @@ -728,17 +769,6 @@ dependencies = [ "constant_time_eq", ] -[[package]] -name = "blake2s_simd" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e461a7034e85b211a4acb57ee2e6730b32912b06c08cc242243c39fc21ae6a2" -dependencies = [ - "arrayref", - "arrayvec", - "constant_time_eq", -] - [[package]] name = "block-buffer" version = "0.7.3" @@ -839,7 +869,7 @@ dependencies = [ "eth2_libp2p", "eth2_network_config", "eth2_ssz", - "futures 0.3.8", + "futures 0.3.12", "hex", "log", "logging", @@ -849,7 +879,7 @@ dependencies = [ "slog-stdlog", "slog-term", "sloggers", - "tokio 0.3.6", + "tokio 1.0.2", "types", ] @@ -907,9 +937,9 @@ checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[package]] name = "byteorder" -version = "1.3.4" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" +checksum = "ae44d1a3d5a19df61dd0c8beb138458ac2a53a7ac09eba97d55592540004306b" [[package]] name = "bytes" @@ -923,6 +953,12 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e0dcbc35f504eb6fc275a6d20e4ebcda18cf50d40ba6fabff8c711fa16cb3b16" +[[package]] +name = "bytes" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040" + [[package]] name = "bzip2" version = "0.3.3" @@ -1024,7 +1060,7 @@ dependencies = [ "libc", "num-integer", "num-traits", - "time 0.1.44", + "time 0.1.43", "winapi 0.3.9", ] @@ -1077,7 +1113,7 @@ dependencies = [ "eth2_config", "eth2_libp2p", "eth2_ssz", - "futures 0.3.8", + "futures 0.3.12", "genesis", "http_api", "http_metrics", @@ -1098,24 +1134,15 @@ dependencies = [ "slot_clock", "store", "task_executor", - "time 0.2.23", + "time 0.2.24", "timer", - "tokio 0.3.6", + "tokio 1.0.2", "toml", "tree_hash", "types", "url", ] -[[package]] -name = "cloudabi" -version = "0.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" -dependencies = [ - "bitflags", -] - [[package]] name = "cmake" version = "0.1.45" @@ -1178,9 +1205,9 @@ checksum = "a2d9162b7289a46e86208d6af2c686ca5bfde445878c41a458a9fac706252d0b" [[package]] name = "const_fn" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd51eab21ab4fd6a3bf889e2d0958c0a6e3a61ad04260325e919e652a2a62826" +checksum = "28b9d6de7f49e22cf97ad17fc4036ece69300032f45f78f30b4a4482cdc3f4a6" [[package]] name = "constant_time_eq" @@ -1261,16 +1288,6 @@ dependencies = [ "itertools 0.9.0", ] -[[package]] -name = "crossbeam-channel" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b153fe7cbef478c567df0f972e02e6d736db11affe43dfc9c56a9374d1adfb87" -dependencies = [ - "crossbeam-utils 0.7.2", - "maybe-uninit", -] - [[package]] name = "crossbeam-channel" version = "0.5.0" @@ -1278,7 +1295,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dca26ee1f8d361640700bde38b2c37d8c22b3ce2d360e1fc1c74ea4b0aa7d775" dependencies = [ "cfg-if 1.0.0", - "crossbeam-utils 0.8.1", + "crossbeam-utils", ] [[package]] @@ -1289,7 +1306,7 @@ checksum = "94af6efb46fef72616855b036a624cf27ba656ffc9be1b9a3c931cfc7749a9a9" dependencies = [ "cfg-if 1.0.0", "crossbeam-epoch", - "crossbeam-utils 0.8.1", + "crossbeam-utils", ] [[package]] @@ -1300,23 +1317,12 @@ checksum = "a1aaa739f95311c2c7887a76863f500026092fb1dce0161dab577e559ef3569d" dependencies = [ "cfg-if 1.0.0", "const_fn", - "crossbeam-utils 0.8.1", + "crossbeam-utils", "lazy_static", "memoffset", "scopeguard", ] -[[package]] -name = "crossbeam-utils" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" -dependencies = [ - "autocfg 1.0.1", - "cfg-if 0.1.10", - "lazy_static", -] - [[package]] name = "crossbeam-utils" version = "0.8.1" @@ -1448,9 +1454,9 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "3.0.0" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8492de420e9e60bc9a1d66e2dbb91825390b738a388606600663fc529b4b307" +checksum = "f627126b946c25a4638eec0ea634fc52506dea98db118aae985118ce7c3d723f" dependencies = [ "byteorder", "digest 0.9.0", @@ -1507,9 +1513,9 @@ dependencies = [ [[package]] name = "derivative" -version = "2.1.1" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb582b60359da160a9477ee80f15c8d784c477e69c217ef2cdd4169c24ea380f" +checksum = "eaed5874effa6cde088c644ddcdcb4ffd1511391c5be4fdd7a5ccd02c7e4a183" dependencies = [ "proc-macro2", "quote", @@ -1628,8 +1634,7 @@ checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" [[package]] name = "discv5" version = "0.1.0-beta.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddad09a9bd70478c581a9f7e608a17962c5561a3ca7b1eb5b75cf1c6c3f124b8" +source = "git+https://github.com/sigp/discv5?branch=master#c4f3e1e1221a6d7cffaeae8a9680652d2408eef9" dependencies = [ "aes-ctr", "aes-gcm 0.8.0", @@ -1637,21 +1642,21 @@ dependencies = [ "digest 0.9.0", "enr", "fnv", - "futures 0.3.8", + "futures 0.3.12", "hex", "hkdf", "k256", "lazy_static", - "libp2p-core 0.23.1", + "libp2p-core 0.25.2", "lru_time_cache", - "multihash 0.11.4", "parking_lot", "rand 0.7.3", "rlp", "sha2 0.9.2", "smallvec", - "tokio 0.3.6", - "tokio-util 0.5.1", + "tokio 1.0.2", + "tokio-stream", + "tokio-util 0.6.2", "tracing", "tracing-subscriber", "uint", @@ -1812,7 +1817,7 @@ dependencies = [ "eth2_config", "eth2_network_config", "exit-future", - "futures 0.3.8", + "futures 0.3.12", "logging", "parking_lot", "slog", @@ -1821,7 +1826,7 @@ dependencies = [ "slog-term", "sloggers", "task_executor", - "tokio 0.3.6", + "tokio 1.0.2", "types", ] @@ -1846,7 +1851,7 @@ dependencies = [ "eth2_ssz", "eth2_ssz_derive", "fallback", - "futures 0.3.8", + "futures 0.3.12", "hex", "lazy_static", "libflate", @@ -1860,7 +1865,7 @@ dependencies = [ "sloggers", "state_processing", "task_executor", - "tokio 0.3.6", + "tokio 1.0.2", "tokio-compat-02", "toml", "tree_hash", @@ -1873,9 +1878,9 @@ name = "eth1_test_rig" version = "0.2.0" dependencies = [ "deposit_contract", - "futures 0.3.8", + "futures 0.3.12", "serde_json", - "tokio 0.3.6", + "tokio 1.0.2", "tokio-compat-02", "types", "web3", @@ -1886,12 +1891,12 @@ name = "eth2" version = "0.1.0" dependencies = [ "account_utils", - "bytes 0.5.6", + "bytes 1.0.1", "eth2_keystore", "eth2_libp2p", "eth2_ssz", "eth2_ssz_derive", - "futures 0.3.8", + "futures 0.3.12", "futures-util", "hex", "libsecp256k1", @@ -1991,7 +1996,8 @@ dependencies = [ "eth2_ssz_types", "exit-future", "fnv", - "futures 0.3.8", + "futures 0.3.12", + "futures-io", "hashset_delay", "hex", "lazy_static", @@ -2014,11 +2020,12 @@ dependencies = [ "task_executor", "tempfile", "tiny-keccak 2.0.2", - "tokio 0.3.6", + "tokio 1.0.2", "tokio-io-timeout", - "tokio-util 0.4.0", + "tokio-stream", + "tokio-util 0.6.2", "types", - "unsigned-varint 0.5.1 (git+https://github.com/sigp/unsigned-varint?branch=dep-update)", + "unsigned-varint 0.6.0", "void", ] @@ -2147,7 +2154,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e43f2f1833d64e33f15592464d6fdd70f349dda7b1a53088eb83cd94014008c5" dependencies = [ - "futures 0.3.8", + "futures 0.3.12", ] [[package]] @@ -2241,12 +2248,13 @@ dependencies = [ [[package]] name = "flume" -version = "0.9.2" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bebadab126f8120d410b677ed95eee4ba6eb7c6dd8e34a5ec88a08050e26132" +checksum = "0362ef9c4c1fa854ff95b4cb78045a86e810d804dc04937961988b45427104a9" dependencies = [ "futures-core", "futures-sink", + "pin-project 1.0.4", "spinning_top", ] @@ -2307,12 +2315,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "fuchsia-cprng" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" - [[package]] name = "fuchsia-zircon" version = "0.3.3" @@ -2343,9 +2345,9 @@ checksum = "4c7e4c2612746b0df8fed4ce0c69156021b704c9aefa360311c04e6e9e002eed" [[package]] name = "futures" -version = "0.3.8" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b3b0c040a1fe6529d30b3c5944b280c7f0dcb2930d2c3062bca967b602583d0" +checksum = "da9052a1a50244d8d5aa9bf55cbc2fb6f357c86cc52e46c62ed390a7180cf150" dependencies = [ "futures-channel", "futures-core", @@ -2358,9 +2360,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.8" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b7109687aa4e177ef6fe84553af6280ef2778bdb7783ba44c9dc3399110fe64" +checksum = "f2d31b7ec7efab6eefc7c57233bb10b847986139d88cc2f5a02a1ae6871a1846" dependencies = [ "futures-core", "futures-sink", @@ -2368,15 +2370,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.8" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "847ce131b72ffb13b6109a221da9ad97a64cbe48feb1028356b836b47b8f1748" +checksum = "79e5145dde8da7d1b3892dad07a9c98fc04bc39892b1ecc9692cf53e2b780a65" [[package]] name = "futures-executor" -version = "0.3.8" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4caa2b2b68b880003057c1dd49f1ed937e38f22fcf6c212188a121f08cf40a65" +checksum = "e9e59fdc009a4b3096bf94f740a0f2424c082521f20a9b08c5c07c48d90fd9b9" dependencies = [ "futures-core", "futures-task", @@ -2386,9 +2388,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.8" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "611834ce18aaa1bd13c4b374f5d653e1027cf99b6b502584ff8c9a64413b30bb" +checksum = "28be053525281ad8259d47e4de5de657b25e7bac113458555bb4b70bc6870500" [[package]] name = "futures-lite" @@ -2401,15 +2403,15 @@ dependencies = [ "futures-io", "memchr", "parking", - "pin-project-lite 0.2.0", + "pin-project-lite 0.2.4", "waker-fn", ] [[package]] name = "futures-macro" -version = "0.3.8" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77408a692f1f97bcc61dc001d752e00643408fbc922e4d634c655df50d595556" +checksum = "c287d25add322d9f9abdcdc5927ca398917996600182178774032e9f8258fedd" dependencies = [ "proc-macro-hack", "proc-macro2", @@ -2417,17 +2419,28 @@ dependencies = [ "syn", ] +[[package]] +name = "futures-rustls" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a1387e07917c711fb4ee4f48ea0adb04a3c9739e53ef85bf43ae1edc2937a8b" +dependencies = [ + "futures-io", + "rustls", + "webpki", +] + [[package]] name = "futures-sink" -version = "0.3.8" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f878195a49cee50e006b02b93cf7e0a95a38ac7b776b4c4d9cc1207cd20fcb3d" +checksum = "caf5c69029bda2e743fddd0582d1083951d65cc9539aebf8812f36c3491342d6" [[package]] name = "futures-task" -version = "0.3.8" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c554eb5bf48b2426c4771ab68c6b14468b6e76cc90996f528c3338d761a4d0d" +checksum = "13de07eb8ea81ae445aca7b69f5f7bf15d7bf4912d8ca37d6645c77ae8a58d86" dependencies = [ "once_cell", ] @@ -2440,9 +2453,9 @@ checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" [[package]] name = "futures-util" -version = "0.3.8" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d304cff4a7b99cfb7986f7d43fbe93d175e72e704a8860787cc95e9ffd85cbd2" +checksum = "632a8cd0f2a4b3fdea1657f08bde063848c3bd00f9bbf6e256b8be78802e624b" dependencies = [ "futures-channel", "futures-core", @@ -2451,38 +2464,13 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project 1.0.2", + "pin-project-lite 0.2.4", "pin-utils", "proc-macro-hack", "proc-macro-nested", "slab", ] -[[package]] -name = "futures_codec" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce54d63f8b0c75023ed920d46fd71d0cbbb830b0ee012726b5b4f506fb6dea5b" -dependencies = [ - "bytes 0.5.6", - "futures 0.3.8", - "memchr", - "pin-project 0.4.27", -] - -[[package]] -name = "generator" -version = "0.6.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cdc09201b2e8ca1b19290cf7e65de2246b8e91fb6874279722189c4de7b94dc" -dependencies = [ - "cc", - "libc", - "log", - "rustc_version", - "winapi 0.3.9", -] - [[package]] name = "generic-array" version = "0.12.3" @@ -2512,7 +2500,7 @@ dependencies = [ "eth2_hashing", "eth2_ssz", "exit-future", - "futures 0.3.8", + "futures 0.3.12", "int_to_bytes", "merkle_proof", "parking_lot", @@ -2521,7 +2509,7 @@ dependencies = [ "serde_derive", "slog", "state_processing", - "tokio 0.3.6", + "tokio 1.0.2", "tokio-compat-02", "tree_hash", "types", @@ -2529,15 +2517,26 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "libc", "wasi 0.9.0+wasi-snapshot-preview1", ] +[[package]] +name = "getrandom" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi 0.10.1+wasi-snapshot-preview1", +] + [[package]] name = "ghash" version = "0.3.1" @@ -2617,7 +2616,7 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "http 0.2.2", + "http", "indexmap", "slab", "tokio 0.2.24", @@ -2629,27 +2628,28 @@ dependencies = [ [[package]] name = "h2" version = "0.3.0" -source = "git+https://github.com/agemanning/h2?branch=lighthouse#a59d6eba170ffaa7d9504b95c98b7321f459581b" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b67e66362108efccd8ac053abafc8b7a8d86a37e6e48fc4f6f7485eb5e9e6a5" dependencies = [ - "bytes 0.6.0", + "bytes 1.0.1", "fnv", "futures-core", "futures-sink", "futures-util", - "http 0.2.1", + "http", "indexmap", "slab", - "tokio 0.3.6", - "tokio-util 0.5.1", + "tokio 1.0.2", + "tokio-util 0.6.2", "tracing", "tracing-futures", ] [[package]] name = "half" -version = "1.6.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d36fab90f82edc3c747f9d438e06cf0a491055896f2a279638bb5beed6c40177" +checksum = "62aca2aba2d62b4a7f5b33f3712cb1b0692779a56fb510499d5c0aa594daeaf3" [[package]] name = "hashbrown" @@ -2673,40 +2673,25 @@ dependencies = [ name = "hashset_delay" version = "0.2.0" dependencies = [ - "futures 0.3.8", - "tokio 0.3.6", - "tokio-util 0.5.1", + "futures 0.3.12", + "tokio 1.0.2", + "tokio-util 0.6.2", ] [[package]] name = "headers" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed18eb2459bf1a09ad2d6b1547840c3e5e62882fa09b9a6a20b1de8e3228848f" -dependencies = [ - "base64 0.12.3", - "bitflags", - "bytes 0.5.6", - "headers-core 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "http 0.2.2", - "mime", - "sha-1 0.8.2", - "time 0.1.44", -] - -[[package]] -name = "headers" -version = "0.3.2" -source = "git+https://github.com/blacktemplar/headers?branch=lighthouse#8bffbd8aa2e170745a81e62fc0d7e98c0a23a69a" +checksum = "62689dc57c7456e69712607ffcbd0aa1dfcccf9af73727e9b25bc1825375cac3" dependencies = [ "base64 0.13.0", "bitflags", - "bytes 0.6.0", - "headers-core 0.2.0 (git+https://github.com/blacktemplar/headers?branch=lighthouse)", - "http 0.2.1", + "bytes 1.0.1", + "headers-core", + "http", "mime", "sha-1 0.8.2", - "time 0.1.44", + "time 0.1.43", ] [[package]] @@ -2715,15 +2700,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" dependencies = [ - "http 0.2.2", -] - -[[package]] -name = "headers-core" -version = "0.2.0" -source = "git+https://github.com/blacktemplar/headers?branch=lighthouse#8bffbd8aa2e170745a81e62fc0d7e98c0a23a69a" -dependencies = [ - "http 0.2.1", + "http", ] [[package]] @@ -2737,9 +2714,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.1.17" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aca5565f760fb5b220e499d72710ed156fdb74e631659e99377d9ebfbd13ae8" +checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c" dependencies = [ "libc", ] @@ -2819,21 +2796,11 @@ dependencies = [ [[package]] name = "http" -version = "0.2.1" -source = "git+https://github.com/agemanning/http?branch=lighthouse#144a8ad6334f40bf4f84e26cf582ff164795024a" -dependencies = [ - "bytes 0.6.0", - "fnv", - "itoa", -] - -[[package]] -name = "http" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84129d298a6d57d246960ff8eb831ca4af3f96d29e2e28848dae275408658e26" +checksum = "7245cd7449cc792608c3c8a9eaf69bd4eabbabf802713748fd739c98b82f0747" dependencies = [ - "bytes 0.5.6", + "bytes 1.0.1", "fnv", "itoa", ] @@ -2845,22 +2812,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" dependencies = [ "bytes 0.5.6", - "http 0.2.2", + "http", ] [[package]] name = "http-body" -version = "0.3.1" -source = "git+https://github.com/agemanning/http-body?branch=lighthouse#a10365c24eaee8eab881519accad48b695b88ccf" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2861bd27ee074e5ee891e8b539837a9430012e249d7f0ca2d795650f579c1994" dependencies = [ - "bytes 0.6.0", - "http 0.2.1", + "bytes 1.0.1", + "http", ] [[package]] name = "http_api" version = "0.1.0" dependencies = [ + "async-stream", "beacon_chain", "bs58 0.4.0", "discv5", @@ -2870,7 +2839,7 @@ dependencies = [ "eth2_libp2p", "eth2_ssz", "fork_choice", - "futures 0.3.8", + "futures 0.3.12", "hex", "lazy_static", "lighthouse_metrics", @@ -2882,8 +2851,9 @@ dependencies = [ "slot_clock", "state_processing", "store", - "tokio 0.3.6", + "tokio 1.0.2", "tokio-compat-02", + "tokio-stream", "tree_hash", "types", "warp", @@ -2907,7 +2877,7 @@ dependencies = [ "slog", "slot_clock", "store", - "tokio 0.3.6", + "tokio 1.0.2", "tokio-compat-02", "types", "warp", @@ -2928,36 +2898,36 @@ checksum = "494b4d60369511e7dea41cf646832512a94e542f68bb9c49e54518e0f468eb47" [[package]] name = "httpmock" -version = "0.5.2" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1e098238acaa95e0bb3fd357317817fde35efb9cdedf74b18b24698499eea9d" +checksum = "c3651b042b15370cea138892c0496c195ab77b472548d43e6595284c57da1bf5" dependencies = [ "assert-json-diff", + "async-object-pool", "async-trait", "base64 0.13.0", "basic-cookies", - "crossbeam-utils 0.8.1", + "crossbeam-utils", "difference", "futures-util", - "hyper 0.13.9", + "hyper 0.14.2", "isahc", "lazy_static", "levenshtein", "log", - "puddle", "qstring", "regex", "serde", "serde_json", "serde_regex", - "tokio 0.2.24", + "tokio 1.0.2", ] [[package]] name = "humantime" -version = "2.0.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c1ad908cc71012b7bea4d0c53ba96a8cba9962f048fa68d143376143d863b7a" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" @@ -2970,12 +2940,12 @@ dependencies = [ "futures-core", "futures-util", "h2 0.2.7", - "http 0.2.2", - "http-body 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "http", + "http-body 0.3.1", "httparse", "httpdate", "itoa", - "pin-project 1.0.2", + "pin-project 1.0.4", "socket2", "tokio 0.2.24", "tower-service", @@ -2985,22 +2955,23 @@ dependencies = [ [[package]] name = "hyper" -version = "0.14.0-dev" -source = "git+https://github.com/sigp/hyper?branch=lighthouse#6e24636c115108711fc2ac0c1cf81d4b3dce2277" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12219dc884514cb4a6a03737f4413c0e01c23a1b059b0156004b23f1e19dccbe" dependencies = [ - "bytes 0.6.0", + "bytes 1.0.1", "futures-channel", "futures-core", "futures-util", "h2 0.3.0", - "http 0.2.1", - "http-body 0.3.1 (git+https://github.com/agemanning/http-body?branch=lighthouse)", + "http", + "http-body 0.4.0", "httparse", "httpdate", "itoa", - "pin-project 1.0.2", + "pin-project 1.0.4", "socket2", - "tokio 0.3.6", + "tokio 1.0.2", "tower-service", "tracing", "want", @@ -3013,10 +2984,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f93ec5be69758dfc06b9b29efa9d6e9306e387c85eb362c603912eead2ad98c7" dependencies = [ "bytes 0.5.6", - "futures 0.3.8", - "http 0.2.2", + "futures 0.3.12", + "http", "hyper 0.13.9", - "hyper-tls", + "hyper-tls 0.4.3", "native-tls", "tokio 0.2.24", "tokio-tls", @@ -3037,6 +3008,19 @@ dependencies = [ "tokio-tls", ] +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes 1.0.1", + "hyper 0.14.2", + "native-tls", + "tokio 1.0.2", + "tokio-native-tls", +] + [[package]] name = "idna" version = "0.2.0" @@ -3069,6 +3053,22 @@ dependencies = [ "libc", ] +[[package]] +name = "if-watch" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16d7c5e361e6b05c882b4847dd98992534cebc6fcde7f4bc98225bcf10fd6d0d" +dependencies = [ + "async-io", + "futures 0.3.12", + "futures-lite", + "if-addrs", + "ipnet", + "libc", + "log", + "winapi 0.3.9", +] + [[package]] name = "igd" version = "0.11.1" @@ -3121,11 +3121,11 @@ dependencies = [ [[package]] name = "input_buffer" -version = "0.3.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19a8a95243d5a0398cae618ec29477c6e3cb631152be5c19481f80bc71559754" +checksum = "f97967975f448f1a7ddb12b0bc41069d09ed6a1c161a92687e057325db35d413" dependencies = [ - "bytes 0.5.6", + "bytes 1.0.1", ] [[package]] @@ -3141,7 +3141,7 @@ dependencies = [ name = "int_to_bytes" version = "0.2.0" dependencies = [ - "bytes 0.6.0", + "bytes 1.0.1", "hex", "yaml-rust", ] @@ -3172,18 +3172,17 @@ checksum = "47be2f14c678be2fdcab04ab1171db51b2762ce6f0a8ee87c8dd4a04ed216135" [[package]] name = "isahc" -version = "0.9.14" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2948a0ce43e2c2ef11d7edf6816508998d99e13badd1150be0914205df9388a" +checksum = "ff5419136b615bb64a2d0f8ccc91ed2e74c3bcf77e71c1820dbd6663898d1b34" dependencies = [ - "bytes 0.5.6", - "crossbeam-utils 0.8.1", + "crossbeam-utils", "curl", "curl-sys", "encoding_rs", "flume", "futures-lite", - "http 0.2.2", + "http", "log", "mime", "once_cell", @@ -3280,9 +3279,9 @@ dependencies = [ [[package]] name = "lalrpop" -version = "0.19.2" +version = "0.19.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efcc8a1810b0880931ce6ada8409110c3eea6becdaa9dc891426d129f49c7469" +checksum = "4a71d75b267b3299da9ccff4dd80d73325b5d8adcd76fe97cf92725eb7c6f122" dependencies = [ "ascii-canvas", "atty", @@ -3303,9 +3302,9 @@ dependencies = [ [[package]] name = "lalrpop-util" -version = "0.19.2" +version = "0.19.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b01a98b09a1724a37353d44a62d758e087fb4ae8133108e6dcc51062d15d68" +checksum = "3ebbd90154472db6267a7d28ca08fea7788e5619fef10f2398155cb74c08f77a" dependencies = [ "regex", ] @@ -3336,7 +3335,7 @@ dependencies = [ "eth2_network_config", "eth2_ssz", "eth2_wallet", - "futures 0.3.8", + "futures 0.3.12", "genesis", "hex", "lighthouse_version", @@ -3347,7 +3346,7 @@ dependencies = [ "serde_yaml", "simple_logger", "state_processing", - "tokio 0.3.6", + "tokio 1.0.2", "tokio-compat-02", "tree_hash", "types", @@ -3384,9 +3383,9 @@ checksum = "66189c12161c65c0023ceb53e2fccc0013311bcb36a7cbd0f9c5e938b408ac96" [[package]] name = "libc" -version = "0.2.81" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1482821306169ec4d07f6aca392a4681f66c75c9918aa49641a2595db64053cb" +checksum = "89203f3fba0a3795506acaad8ebce3c80c0af93f994d5a1d7a0b1eeb23271929" [[package]] name = "libflate" @@ -3424,14 +3423,14 @@ dependencies = [ [[package]] name = "libp2p" -version = "0.33.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=97000533e4710183124abde017c6c3d68287c1ae#97000533e4710183124abde017c6c3d68287c1ae" +version = "0.35.0" +source = "git+https://github.com/libp2p/rust-libp2p?rev=bbd3df64ed4cc99a5ddac47ab53673161c70e6da#bbd3df64ed4cc99a5ddac47ab53673161c70e6da" dependencies = [ "atomic", - "bytes 0.5.6", - "futures 0.3.8", + "bytes 1.0.1", + "futures 0.3.12", "lazy_static", - "libp2p-core 0.26.0", + "libp2p-core 0.27.0", "libp2p-core-derive", "libp2p-dns", "libp2p-gossipsub", @@ -3442,76 +3441,77 @@ dependencies = [ "libp2p-tcp", "libp2p-websocket", "libp2p-yamux", - "parity-multiaddr 0.10.0", + "parity-multiaddr 0.11.0", "parking_lot", - "pin-project 1.0.2", + "pin-project 1.0.4", "smallvec", "wasm-timer", ] [[package]] name = "libp2p-core" -version = "0.23.1" +version = "0.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3960524389409633550567e8a9e0684d25a33f4f8408887ff897dd9fdfbdb771" +checksum = "cc9c96d3a606a696a3a6c0ad3c3352c57bda2082ec9090930f1bd9daf787039f" dependencies = [ "asn1_der", - "bs58 0.3.1", + "bs58 0.4.0", + "bytes 0.5.6", "ed25519-dalek", "either", "fnv", - "futures 0.3.8", + "futures 0.3.12", "futures-timer", "lazy_static", "libsecp256k1", "log", - "multihash 0.11.4", - "multistream-select 0.8.5", - "parity-multiaddr 0.9.6", + "multihash", + "multistream-select 0.9.1", + "parity-multiaddr 0.10.1", "parking_lot", - "pin-project 1.0.2", - "prost", - "prost-build", + "pin-project 1.0.4", + "prost 0.6.1", + "prost-build 0.6.1", "rand 0.7.3", "ring", "rw-stream-sink", "sha2 0.9.2", "smallvec", "thiserror", - "unsigned-varint 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "unsigned-varint 0.5.1", "void", "zeroize", ] [[package]] name = "libp2p-core" -version = "0.26.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=97000533e4710183124abde017c6c3d68287c1ae#97000533e4710183124abde017c6c3d68287c1ae" +version = "0.27.0" +source = "git+https://github.com/libp2p/rust-libp2p?rev=bbd3df64ed4cc99a5ddac47ab53673161c70e6da#bbd3df64ed4cc99a5ddac47ab53673161c70e6da" dependencies = [ "asn1_der", "bs58 0.4.0", "ed25519-dalek", "either", "fnv", - "futures 0.3.8", + "futures 0.3.12", "futures-timer", "lazy_static", "libsecp256k1", "log", - "multihash 0.13.2", - "multistream-select 0.9.1", - "parity-multiaddr 0.10.0", + "multihash", + "multistream-select 0.10.0", + "parity-multiaddr 0.11.0", "parking_lot", - "pin-project 1.0.2", - "prost", - "prost-build", + "pin-project 1.0.4", + "prost 0.7.0", + "prost-build 0.7.0", "rand 0.7.3", "ring", "rw-stream-sink", "sha2 0.9.2", "smallvec", "thiserror", - "unsigned-varint 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "unsigned-varint 0.6.0", "void", "zeroize", ] @@ -3519,7 +3519,7 @@ dependencies = [ [[package]] name = "libp2p-core-derive" version = "0.21.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=97000533e4710183124abde017c6c3d68287c1ae#97000533e4710183124abde017c6c3d68287c1ae" +source = "git+https://github.com/libp2p/rust-libp2p?rev=bbd3df64ed4cc99a5ddac47ab53673161c70e6da#bbd3df64ed4cc99a5ddac47ab53673161c70e6da" dependencies = [ "quote", "syn", @@ -3527,84 +3527,84 @@ dependencies = [ [[package]] name = "libp2p-dns" -version = "0.26.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=97000533e4710183124abde017c6c3d68287c1ae#97000533e4710183124abde017c6c3d68287c1ae" +version = "0.27.0" +source = "git+https://github.com/libp2p/rust-libp2p?rev=bbd3df64ed4cc99a5ddac47ab53673161c70e6da#bbd3df64ed4cc99a5ddac47ab53673161c70e6da" dependencies = [ - "futures 0.3.8", - "libp2p-core 0.26.0", + "futures 0.3.12", + "libp2p-core 0.27.0", "log", ] [[package]] name = "libp2p-gossipsub" -version = "0.26.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=97000533e4710183124abde017c6c3d68287c1ae#97000533e4710183124abde017c6c3d68287c1ae" +version = "0.28.0" +source = "git+https://github.com/libp2p/rust-libp2p?rev=bbd3df64ed4cc99a5ddac47ab53673161c70e6da#bbd3df64ed4cc99a5ddac47ab53673161c70e6da" dependencies = [ + "asynchronous-codec", "base64 0.13.0", "byteorder", - "bytes 0.5.6", + "bytes 1.0.1", "fnv", - "futures 0.3.8", - "futures_codec", + "futures 0.3.12", "hex_fmt", - "libp2p-core 0.26.0", + "libp2p-core 0.27.0", "libp2p-swarm", "log", - "prost", - "prost-build", + "prost 0.7.0", + "prost-build 0.7.0", "rand 0.7.3", "regex", "sha2 0.9.2", "smallvec", - "unsigned-varint 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "unsigned-varint 0.6.0", "wasm-timer", ] [[package]] name = "libp2p-identify" -version = "0.26.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=97000533e4710183124abde017c6c3d68287c1ae#97000533e4710183124abde017c6c3d68287c1ae" +version = "0.27.0" +source = "git+https://github.com/libp2p/rust-libp2p?rev=bbd3df64ed4cc99a5ddac47ab53673161c70e6da#bbd3df64ed4cc99a5ddac47ab53673161c70e6da" dependencies = [ - "futures 0.3.8", - "libp2p-core 0.26.0", + "futures 0.3.12", + "libp2p-core 0.27.0", "libp2p-swarm", "log", - "prost", - "prost-build", + "prost 0.7.0", + "prost-build 0.7.0", "smallvec", "wasm-timer", ] [[package]] name = "libp2p-mplex" -version = "0.26.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=97000533e4710183124abde017c6c3d68287c1ae#97000533e4710183124abde017c6c3d68287c1ae" +version = "0.27.0" +source = "git+https://github.com/libp2p/rust-libp2p?rev=bbd3df64ed4cc99a5ddac47ab53673161c70e6da#bbd3df64ed4cc99a5ddac47ab53673161c70e6da" dependencies = [ - "bytes 0.5.6", - "futures 0.3.8", - "futures_codec", - "libp2p-core 0.26.0", + "asynchronous-codec", + "bytes 1.0.1", + "futures 0.3.12", + "libp2p-core 0.27.0", "log", "nohash-hasher", "parking_lot", "rand 0.7.3", "smallvec", - "unsigned-varint 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "unsigned-varint 0.6.0", ] [[package]] name = "libp2p-noise" -version = "0.28.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=97000533e4710183124abde017c6c3d68287c1ae#97000533e4710183124abde017c6c3d68287c1ae" +version = "0.29.0" +source = "git+https://github.com/libp2p/rust-libp2p?rev=bbd3df64ed4cc99a5ddac47ab53673161c70e6da#bbd3df64ed4cc99a5ddac47ab53673161c70e6da" dependencies = [ - "bytes 0.5.6", + "bytes 1.0.1", "curve25519-dalek", - "futures 0.3.8", + "futures 0.3.12", "lazy_static", - "libp2p-core 0.26.0", + "libp2p-core 0.27.0", "log", - "prost", - "prost-build", + "prost 0.7.0", + "prost-build 0.7.0", "rand 0.7.3", "sha2 0.9.2", "snow", @@ -3615,12 +3615,12 @@ dependencies = [ [[package]] name = "libp2p-swarm" -version = "0.26.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=97000533e4710183124abde017c6c3d68287c1ae#97000533e4710183124abde017c6c3d68287c1ae" +version = "0.27.0" +source = "git+https://github.com/libp2p/rust-libp2p?rev=bbd3df64ed4cc99a5ddac47ab53673161c70e6da#bbd3df64ed4cc99a5ddac47ab53673161c70e6da" dependencies = [ "either", - "futures 0.3.8", - "libp2p-core 0.26.0", + "futures 0.3.12", + "libp2p-core 0.27.0", "log", "rand 0.7.3", "smallvec", @@ -3630,45 +3630,46 @@ dependencies = [ [[package]] name = "libp2p-tcp" -version = "0.26.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=97000533e4710183124abde017c6c3d68287c1ae#97000533e4710183124abde017c6c3d68287c1ae" +version = "0.27.0" +source = "git+https://github.com/libp2p/rust-libp2p?rev=bbd3df64ed4cc99a5ddac47ab53673161c70e6da#bbd3df64ed4cc99a5ddac47ab53673161c70e6da" dependencies = [ - "futures 0.3.8", + "async-io", + "futures 0.3.12", "futures-timer", "if-addrs", + "if-watch", "ipnet", - "libp2p-core 0.26.0", + "libc", + "libp2p-core 0.27.0", "log", "socket2", - "tokio 0.3.6", + "tokio 1.0.2", ] [[package]] name = "libp2p-websocket" -version = "0.27.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=97000533e4710183124abde017c6c3d68287c1ae#97000533e4710183124abde017c6c3d68287c1ae" +version = "0.28.0" +source = "git+https://github.com/libp2p/rust-libp2p?rev=bbd3df64ed4cc99a5ddac47ab53673161c70e6da#bbd3df64ed4cc99a5ddac47ab53673161c70e6da" dependencies = [ - "async-tls", "either", - "futures 0.3.8", - "libp2p-core 0.26.0", + "futures 0.3.12", + "futures-rustls", + "libp2p-core 0.27.0", "log", "quicksink", - "rustls", "rw-stream-sink", "soketto", "url", - "webpki", "webpki-roots", ] [[package]] name = "libp2p-yamux" -version = "0.29.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=97000533e4710183124abde017c6c3d68287c1ae#97000533e4710183124abde017c6c3d68287c1ae" +version = "0.30.0" +source = "git+https://github.com/libp2p/rust-libp2p?rev=bbd3df64ed4cc99a5ddac47ab53673161c70e6da#bbd3df64ed4cc99a5ddac47ab53673161c70e6da" dependencies = [ - "futures 0.3.8", - "libp2p-core 0.26.0", + "futures 0.3.12", + "libp2p-core 0.27.0", "parking_lot", "thiserror", "yamux", @@ -3728,7 +3729,7 @@ dependencies = [ "env_logger 0.8.2", "environment", "eth2_network_config", - "futures 0.3.8", + "futures 0.3.12", "lighthouse_version", "logging", "remote_signer", @@ -3738,7 +3739,7 @@ dependencies = [ "slog-term", "sloggers", "tempfile", - "tokio 0.3.6", + "tokio 1.0.2", "tokio-compat-02", "types", "validator_client", @@ -3763,9 +3764,9 @@ dependencies = [ [[package]] name = "linked-hash-map" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dd5a6d5999d9907cda8ed67bbd137d3af8085216c2ac62de5be860bd41f304a" +checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" [[package]] name = "lmdb" @@ -3808,9 +3809,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.11" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" +checksum = "fcf3805d4480bb5b86070dcfeb9e2cb2ebc148adb753c5cca5f884d1d65a42b2" dependencies = [ "cfg-if 0.1.10", ] @@ -3825,19 +3826,6 @@ dependencies = [ "slog-term", ] -[[package]] -name = "loom" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0e8460f2f2121162705187214720353c517b97bdfb3494c0b1e33d83ebe4bed" -dependencies = [ - "cfg-if 0.1.10", - "generator", - "scoped-tls", - "serde", - "serde_json", -] - [[package]] name = "lru" version = "0.6.3" @@ -3856,9 +3844,9 @@ dependencies = [ [[package]] name = "lru_time_cache" -version = "0.11.3" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cc2beb26938dfd9988fc368548b70bcdfaf955f55aa788e1682198de794a451" +checksum = "78f957950068c53af3b32a1b3a6e69f6dd3c19fa6f0dcc1168b846662d5e10b1" [[package]] name = "mach" @@ -3890,12 +3878,6 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" -[[package]] -name = "maybe-uninit" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" - [[package]] name = "memchr" version = "2.3.4" @@ -3991,9 +3973,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f33bc887064ef1fd66020c9adfc45bb9f33d75a42096c81e7c56c65b75dd1a8b" +checksum = "e50ae3f04d169fcc9bde0b547d1c205219b7157e07ded9c5aff03e0637cb3ed7" dependencies = [ "libc", "log", @@ -4047,21 +4029,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "multihash" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567122ab6492f49b59def14ecc36e13e64dca4188196dd0cd41f9f3f979f3df6" -dependencies = [ - "blake2b_simd", - "blake2s_simd", - "digest 0.9.0", - "sha-1 0.9.2", - "sha2 0.9.2", - "sha3", - "unsigned-varint 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "multihash" version = "0.13.2" @@ -4072,7 +4039,7 @@ dependencies = [ "generic-array 0.14.4", "multihash-derive", "sha2 0.9.2", - "unsigned-varint 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "unsigned-varint 0.5.1", ] [[package]] @@ -4097,9 +4064,9 @@ checksum = "1255076139a83bb467426e7f8d0134968a8118844faa755985e077cf31850333" [[package]] name = "multipart" -version = "0.17.0" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8209c33c951f07387a8497841122fc6f712165e3f9bda3e6be4645b58188f676" +checksum = "d050aeedc89243f5347c3e237e3e13dc76fbe4ae3742a57b94dc14f69acf76d4" dependencies = [ "buf_redux", "httparse", @@ -4107,7 +4074,7 @@ dependencies = [ "mime", "mime_guess", "quick-error", - "rand 0.6.5", + "rand 0.7.3", "safemem", "tempfile", "twoway", @@ -4115,36 +4082,36 @@ dependencies = [ [[package]] name = "multistream-select" -version = "0.8.5" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93faf2e41f9ee62fb01680ed48f3cc26652352327aa2e59869070358f6b7dd75" +checksum = "dda822043bba2d6da31c4e14041f9794f8fb130a5959289038d0b809d8888614" dependencies = [ "bytes 0.5.6", - "futures 0.3.8", + "futures 0.3.12", "log", - "pin-project 1.0.2", + "pin-project 1.0.4", "smallvec", - "unsigned-varint 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "unsigned-varint 0.5.1", ] [[package]] name = "multistream-select" -version = "0.9.1" -source = "git+https://github.com/sigp/rust-libp2p?rev=97000533e4710183124abde017c6c3d68287c1ae#97000533e4710183124abde017c6c3d68287c1ae" +version = "0.10.0" +source = "git+https://github.com/libp2p/rust-libp2p?rev=bbd3df64ed4cc99a5ddac47ab53673161c70e6da#bbd3df64ed4cc99a5ddac47ab53673161c70e6da" dependencies = [ - "bytes 0.5.6", - "futures 0.3.8", + "bytes 1.0.1", + "futures 0.3.12", "log", - "pin-project 1.0.2", + "pin-project 1.0.4", "smallvec", - "unsigned-varint 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "unsigned-varint 0.6.0", ] [[package]] name = "native-tls" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fcc7939b5edc4e4f86b1b4a04bb1498afaaf871b1a6691838ed06fcb48d3a3f" +checksum = "b8d96b2e1c8da3957d58100b09f102c6d9cfdfced01b7ec5a8974044bb09dbd4" dependencies = [ "lazy_static", "libc", @@ -4190,7 +4157,7 @@ dependencies = [ "eth2_ssz_types", "exit-future", "fnv", - "futures 0.3.8", + "futures 0.3.12", "genesis", "hashset_delay", "hex", @@ -4217,7 +4184,8 @@ dependencies = [ "strum", "task_executor", "tempfile", - "tokio 0.3.6", + "tokio 1.0.2", + "tokio-stream", "tree_hash", "types", ] @@ -4261,7 +4229,7 @@ dependencies = [ "environment", "eth2", "eth2_config", - "futures 0.3.8", + "futures 0.3.12", "genesis", "reqwest", "serde", @@ -4457,44 +4425,44 @@ dependencies = [ [[package]] name = "parity-multiaddr" -version = "0.9.6" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43244a26dc1ddd3097216bb12eaa6cf8a07b060c72718d9ebd60fd297d6401df" +checksum = "180cd097078b337d2ba6400c6a67b181b38b611273cb1d8d12f3d8d5d8eaaacb" dependencies = [ "arrayref", "bs58 0.4.0", "byteorder", "data-encoding", - "multihash 0.11.4", + "multihash", "percent-encoding", "serde", "static_assertions", - "unsigned-varint 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "unsigned-varint 0.5.1", "url", ] [[package]] name = "parity-multiaddr" -version = "0.10.0" -source = "git+https://github.com/sigp/rust-libp2p?rev=97000533e4710183124abde017c6c3d68287c1ae#97000533e4710183124abde017c6c3d68287c1ae" +version = "0.11.0" +source = "git+https://github.com/libp2p/rust-libp2p?rev=bbd3df64ed4cc99a5ddac47ab53673161c70e6da#bbd3df64ed4cc99a5ddac47ab53673161c70e6da" dependencies = [ "arrayref", "bs58 0.4.0", "byteorder", "data-encoding", - "multihash 0.13.2", + "multihash", "percent-encoding", "serde", "static_assertions", - "unsigned-varint 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "unsigned-varint 0.6.0", "url", ] [[package]] name = "parity-scale-codec" -version = "1.3.5" +version = "1.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c740e5fbcb6847058b40ac7e5574766c6388f585e184d769910fe0d3a2ca861" +checksum = "79602888a81ace83e3d1d4b2873286c1f5f906c84db667594e8db8da3506c383" dependencies = [ "arrayvec", "bitvec 0.17.4", @@ -4528,7 +4496,7 @@ dependencies = [ "cfg-if 1.0.0", "instant", "libc", - "redox_syscall", + "redox_syscall 0.1.57", "smallvec", "winapi 0.3.9", ] @@ -4593,11 +4561,11 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.0.2" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ccc2237c2c489783abd8c4c80e5450fc0e98644555b1364da68cc29aa151ca7" +checksum = "95b70b68509f17aa2857863b6fa00bf21fc93674c7a8893de2f469f6aa7ca2f2" dependencies = [ - "pin-project-internal 1.0.2", + "pin-project-internal 1.0.4", ] [[package]] @@ -4613,9 +4581,9 @@ dependencies = [ [[package]] name = "pin-project-internal" -version = "1.0.2" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8e8d2bf0b23038a4424865103a4df472855692821aab4e4f5c3312d461d9e5f" +checksum = "caa25a6393f22ce819b0f50e0be89287292fda8d425be38ee0ca14c4931d9e71" dependencies = [ "proc-macro2", "quote", @@ -4630,9 +4598,9 @@ checksum = "c917123afa01924fc84bb20c4c03f004d9c38e5127e3c039bbf7f4b9c76a2f6b" [[package]] name = "pin-project-lite" -version = "0.2.0" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b063f57ec186e6140e2b8b6921e5f1bd89c7356dda5b33acc5401203ca6131c" +checksum = "439697af366c49a6d0a010c56a0d97685bc140ce0d377b13a2ea2aa42d64a827" [[package]] name = "pin-utils" @@ -4764,9 +4732,9 @@ checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" [[package]] name = "proc-macro-nested" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eba180dafb9038b050a4c280019bbedf9f2467b61e5d892dcad585bb57aadc5a" +checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" [[package]] name = "proc-macro2" @@ -4811,7 +4779,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce49aefe0a6144a45de32927c77bd2859a5f7677b55f220ae5b744e87389c212" dependencies = [ "bytes 0.5.6", - "prost-derive", + "prost-derive 0.6.1", +] + +[[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]] @@ -4826,10 +4804,28 @@ dependencies = [ "log", "multimap", "petgraph", - "prost", - "prost-types", + "prost 0.6.1", + "prost-types 0.6.1", + "tempfile", + "which 3.1.1", +] + +[[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", + "which 4.0.2", ] [[package]] @@ -4845,6 +4841,19 @@ dependencies = [ "syn", ] +[[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]] name = "prost-types" version = "0.6.1" @@ -4852,7 +4861,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1834f67c0697c001304b75be76f67add9c89742eda3a085ad8ee0bb38c3417aa" dependencies = [ "bytes 0.5.6", - "prost", + "prost 0.6.1", +] + +[[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]] @@ -4869,9 +4888,9 @@ dependencies = [ [[package]] name = "protobuf" -version = "2.18.1" +version = "2.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da78e04bc0e40f36df43ecc6575e4f4b180e8156c4efd73f13d5619479b05696" +checksum = "86473d5f16580f10b131a0bf0afb68f8e029d1835d33a00f37281b05694e5312" [[package]] name = "psutil" @@ -4892,15 +4911,6 @@ dependencies = [ "unescape", ] -[[package]] -name = "puddle" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cf84452e80b28e2b05e53964d6f5a44a57978ce19b4920be49e1a61079a24d7" -dependencies = [ - "async-std", -] - [[package]] name = "qstring" version = "0.7.2" @@ -4998,32 +5008,13 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "941ba9d78d8e2f7ce474c015eea4d9c6d25b6a3327f9832ee29a4de27f91bbb8" -[[package]] -name = "rand" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" -dependencies = [ - "autocfg 0.1.7", - "libc", - "rand_chacha 0.1.1", - "rand_core 0.4.2", - "rand_hc 0.1.0", - "rand_isaac", - "rand_jitter", - "rand_os", - "rand_pcg", - "rand_xorshift 0.1.1", - "winapi 0.3.9", -] - [[package]] name = "rand" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" dependencies = [ - "getrandom", + "getrandom 0.1.16", "libc", "rand_chacha 0.2.2", "rand_core 0.5.1", @@ -5031,13 +5022,15 @@ dependencies = [ ] [[package]] -name = "rand_chacha" -version = "0.1.1" +name = "rand" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" +checksum = "18519b42a40024d661e1714153e9ad0c3de27cd495760ceb09710920f1098b1e" dependencies = [ - "autocfg 0.1.7", - "rand_core 0.3.1", + "libc", + "rand_chacha 0.3.0", + "rand_core 0.6.1", + "rand_hc 0.3.0", ] [[package]] @@ -5051,36 +5044,31 @@ dependencies = [ ] [[package]] -name = "rand_core" -version = "0.3.1" +name = "rand_chacha" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" dependencies = [ - "rand_core 0.4.2", + "ppv-lite86", + "rand_core 0.6.1", ] -[[package]] -name = "rand_core" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" - [[package]] name = "rand_core" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" dependencies = [ - "getrandom", + "getrandom 0.1.16", ] [[package]] -name = "rand_hc" -version = "0.1.0" +name = "rand_core" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" +checksum = "c026d7df8b298d90ccbbc5190bd04d85e159eaf5576caeacf8741da93ccbd2e5" dependencies = [ - "rand_core 0.3.1", + "getrandom 0.2.2", ] [[package]] @@ -5093,56 +5081,12 @@ dependencies = [ ] [[package]] -name = "rand_isaac" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "rand_jitter" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" -dependencies = [ - "libc", - "rand_core 0.4.2", - "winapi 0.3.9", -] - -[[package]] -name = "rand_os" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" -dependencies = [ - "cloudabi", - "fuchsia-cprng", - "libc", - "rand_core 0.4.2", - "rdrand", - "winapi 0.3.9", -] - -[[package]] -name = "rand_pcg" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" -dependencies = [ - "autocfg 0.1.7", - "rand_core 0.4.2", -] - -[[package]] -name = "rand_xorshift" -version = "0.1.1" +name = "rand_hc" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" +checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73" dependencies = [ - "rand_core 0.3.1", + "rand_core 0.6.1", ] [[package]] @@ -5172,27 +5116,27 @@ version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ab346ac5921dc62ffa9f89b7a773907511cdfa5490c572ae9be1be33e8afa4a" dependencies = [ - "crossbeam-channel 0.5.0", + "crossbeam-channel", "crossbeam-deque", - "crossbeam-utils 0.8.1", + "crossbeam-utils", "lazy_static", "num_cpus", ] [[package]] -name = "rdrand" -version = "0.4.0" +name = "redox_syscall" +version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" -dependencies = [ - "rand_core 0.3.1", -] +checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" [[package]] name = "redox_syscall" -version = "0.1.57" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" +checksum = "05ec8ca9416c5ea37062b502703cd7fcb207736bc294f6e0cf367ac6fc234570" +dependencies = [ + "bitflags", +] [[package]] name = "redox_users" @@ -5200,16 +5144,16 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de0737333e7a9502c789a36d7c7fa6092a49895d4faa31ca5df163857ded2e9d" dependencies = [ - "getrandom", - "redox_syscall", + "getrandom 0.1.16", + "redox_syscall 0.1.57", "rust-argon2", ] [[package]] name = "regex" -version = "1.4.2" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38cf2c13ed4745de91a5eb834e11c00bcc3709e773173b2ce4c56c9fbde04b9c" +checksum = "d9251239e129e16308e70d853559389de218ac275b515068abc96829d05b948a" dependencies = [ "aho-corasick", "memchr", @@ -5229,9 +5173,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.21" +version = "0.6.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b181ba2dcf07aaccad5448e8ead58db5b742cf85dfe035e2227f137a539a189" +checksum = "b5eb417147ba9860a96cfe72a0b93bf88fee1744b5636ec99ab20c1aa9376581" [[package]] name = "remote_signer" @@ -5271,7 +5215,7 @@ version = "0.2.0" dependencies = [ "clap", "environment", - "futures 0.3.8", + "futures 0.3.12", "hyper 0.13.9", "lazy_static", "regex", @@ -5291,7 +5235,7 @@ dependencies = [ "remote_signer_test", "reqwest", "serde", - "tokio 0.3.6", + "tokio 1.0.2", "types", ] @@ -5309,7 +5253,7 @@ dependencies = [ "serde", "serde_json", "tempfile", - "tokio 0.3.6", + "tokio 1.0.2", "tokio-compat-02", "types", ] @@ -5325,33 +5269,32 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.10.10" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0718f81a8e14c4dbb3b34cf23dc6aaf9ab8a0dfec160c534b3dbca1aaa21f47c" +checksum = "fd281b1030aa675fb90aa994d07187645bb3c8fc756ca766e7c3070b439de9de" dependencies = [ "base64 0.13.0", - "bytes 0.5.6", + "bytes 1.0.1", "encoding_rs", "futures-core", "futures-util", - "http 0.2.2", - "http-body 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.13.9", - "hyper-tls", + "http", + "http-body 0.4.0", + "hyper 0.14.2", + "hyper-tls 0.5.0", "ipnet", "js-sys", "lazy_static", "log", "mime", - "mime_guess", "native-tls", "percent-encoding", - "pin-project-lite 0.2.0", + "pin-project-lite 0.2.4", "serde", "serde_json", "serde_urlencoded", - "tokio 0.2.24", - "tokio-tls", + "tokio 1.0.2", + "tokio-native-tls", "url", "wasm-bindgen", "wasm-bindgen-futures", @@ -5391,9 +5334,9 @@ dependencies = [ [[package]] name = "rpassword" -version = "5.0.0" +version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d755237fc0f99d98641540e66abac8bc46a0652f19148ac9e21de2da06b326c9" +checksum = "ffc936cf8a7ea60c58f030fd36a612a48f440610214dc54bc36431f9ea0c3efb" dependencies = [ "libc", "winapi 0.3.9", @@ -5423,7 +5366,7 @@ dependencies = [ "base64 0.13.0", "blake2b_simd", "constant_time_eq", - "crossbeam-utils 0.8.1", + "crossbeam-utils", ] [[package]] @@ -5472,7 +5415,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4da5fcb054c46f5a5dff833b129285a93d3f0179531735e6c866e8cc307d2020" dependencies = [ - "futures 0.3.8", + "futures 0.3.12", "pin-project 0.4.27", "static_assertions", ] @@ -5622,9 +5565,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.118" +version = "1.0.120" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06c64263859d87aa2eb554587e2d23183398d617427327cf2b3d0ed8c69e4800" +checksum = "166b2349061381baf54a58e4b13c89369feb0ef2eaa57198899e2312aac30aab" dependencies = [ "serde_derive", ] @@ -5641,9 +5584,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.118" +version = "1.0.120" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c84d3526699cd55261af4b941e4e725444df67aa4f9e6a3564f18030d12672df" +checksum = "0ca2a8cb5805ce9e3b95435e3765b7b553cecc762d938d409434338386cb5775" dependencies = [ "proc-macro2", "quote", @@ -5652,9 +5595,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.60" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1500e84d27fe482ed1dc791a56eddc2f230046a040fa908c08bda1d9fb615779" +checksum = "4fceb2595057b6891a4ee808f70054bd2d12f0e97f1cbb78689b59f676df325a" dependencies = [ "itoa", "ryu", @@ -5706,9 +5649,9 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.8.14" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7baae0a99f1a324984bcdc5f0718384c1f69775f1c7eec8b859b71b443e3fd7" +checksum = "971be8f6e4d4a47163b405a3df70d14359186f9ab0f3a3ec37df144ca1ce089f" dependencies = [ "dtoa", "linked-hash-map", @@ -5786,12 +5729,11 @@ dependencies = [ [[package]] name = "sharded-slab" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b4921be914e16899a80adefb821f8ddb7974e3f1250223575a44ed994882127" +checksum = "79c719719ee05df97490f80a45acfc99e5a30ce98a1e4fb67aee422745ae14e3" dependencies = [ "lazy_static", - "loom", ] [[package]] @@ -5844,11 +5786,11 @@ dependencies = [ "env_logger 0.8.2", "eth1", "eth1_test_rig", - "futures 0.3.8", + "futures 0.3.12", "node_test_rig", "parking_lot", "rayon", - "tokio 0.3.6", + "tokio 1.0.2", "tokio-compat-02", "types", "validator_client", @@ -5907,7 +5849,8 @@ dependencies = [ "slot_clock", "state_processing", "task_executor", - "tokio 0.3.6", + "tokio 1.0.2", + "tokio-stream", "types", ] @@ -5937,11 +5880,11 @@ checksum = "8347046d4ebd943127157b94d63abb990fcf729dc4e9978927fdf4ac3c998d06" [[package]] name = "slog-async" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b3336ce47ce2f96673499fc07eb85e3472727b9a7a2959964b002c2ce8fbbb" +checksum = "c60813879f820c85dbc4eabf3269befe374591289019775898d56a81a804fbdc" dependencies = [ - "crossbeam-channel 0.4.4", + "crossbeam-channel", "slog", "take_mut", "thread_local", @@ -5971,9 +5914,9 @@ dependencies = [ [[package]] name = "slog-scope" -version = "4.3.0" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c44c89dd8b0ae4537d1ae318353eaf7840b4869c536e31c41e963d1ea523ee6" +checksum = "2f95a4b4c3274cd2869549da82b57ccc930859bdbf5bcea0424bc5f140b3c786" dependencies = [ "arc-swap", "lazy_static", @@ -6094,7 +6037,7 @@ dependencies = [ "base64 0.12.3", "bytes 0.5.6", "flate2", - "futures 0.3.8", + "futures 0.3.12", "httparse", "log", "rand 0.7.3", @@ -6118,9 +6061,9 @@ dependencies = [ [[package]] name = "standback" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf906c8b8fc3f6ecd1046e01da1d8ddec83e48c8b08b84dcc02b585a6bedf5a8" +checksum = "c66a8cff4fa24853fdf6b51f75c6d7f8206d7c75cab4e467bcd7f25c2b1febe0" dependencies = [ "version_check", ] @@ -6314,9 +6257,9 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.56" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9802ddde94170d186eeee5005b798d9c159fa970403f1be19976d0cfb939b72" +checksum = "cc60a3d73ea6594cd712d830cc1f0390fd71542d8c8cd24e70cc54cdfd5e05d5" dependencies = [ "proc-macro2", "quote", @@ -6358,24 +6301,24 @@ name = "task_executor" version = "0.1.0" dependencies = [ "exit-future", - "futures 0.3.8", + "futures 0.3.12", "lazy_static", "lighthouse_metrics", "slog", - "tokio 0.3.6", + "tokio 1.0.2", "tokio-compat-02", ] [[package]] name = "tempfile" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" +checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "libc", - "rand 0.7.3", - "redox_syscall", + "rand 0.8.2", + "redox_syscall 0.2.4", "remove_dir_all", "winapi 0.3.9", ] @@ -6449,9 +6392,9 @@ dependencies = [ [[package]] name = "thread_local" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" +checksum = "bb9bc092d0d51e76b2b19d9d85534ffc9ec2db959a2523cdae0697e2972cd447" dependencies = [ "lazy_static", ] @@ -6467,20 +6410,19 @@ dependencies = [ [[package]] name = "time" -version = "0.1.44" +version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" +checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" dependencies = [ "libc", - "wasi 0.10.0+wasi-snapshot-preview1", "winapi 0.3.9", ] [[package]] name = "time" -version = "0.2.23" +version = "0.2.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcdaeea317915d59b2b4cd3b5efcd156c309108664277793f5351700c02ce98b" +checksum = "273d3ed44dca264b0d6b3665e8d48fb515042d42466fad93d2a45b90ec4058f7" dependencies = [ "const_fn", "libc", @@ -6519,12 +6461,12 @@ name = "timer" version = "0.2.0" dependencies = [ "beacon_chain", - "futures 0.3.8", + "futures 0.3.12", "parking_lot", "slog", "slot_clock", "task_executor", - "tokio 0.3.6", + "tokio 1.0.2", "types", ] @@ -6566,9 +6508,9 @@ dependencies = [ [[package]] name = "tinytemplate" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d3dc76004a03cec1c5932bca4cdc2e39aaa798e3f82363dd94f9adf6098c12f" +checksum = "a2ada8616fad06a2d0c455adc530de4ef57605a8120cc65da9653e0e9623ca74" dependencies = [ "serde", "serde_json", @@ -6620,18 +6562,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "720ba21c25078711bf456d607987d95bce90f7c3bea5abe1db587862e7a1e87c" dependencies = [ "autocfg 1.0.1", - "bytes 0.6.0", "futures-core", + "pin-project-lite 0.2.4", +] + +[[package]] +name = "tokio" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ca04cec6ff2474c638057b65798f60ac183e5e79d3448bb7163d36a39cff6ec" +dependencies = [ + "autocfg 1.0.1", + "bytes 1.0.1", "libc", "memchr", - "mio 0.7.6", + "mio 0.7.7", "num_cpus", "once_cell", "parking_lot", - "pin-project-lite 0.2.0", + "pin-project-lite 0.2.4", "signal-hook-registry", - "slab", - "tokio-macros 0.3.2", + "tokio-macros 1.0.0", "winapi 0.3.9", ] @@ -6650,11 +6601,12 @@ dependencies = [ [[package]] name = "tokio-io-timeout" -version = "0.5.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6654a6da4326b0b4228000891d44fbcbdaa1904c6ddfa06617230649073be8fb" +checksum = "90c49f106be240de154571dd31fbe48acb10ba6c6dd6f6517ad603abffa42de9" dependencies = [ - "tokio 0.3.6", + "pin-project-lite 0.2.4", + "tokio 1.0.2", ] [[package]] @@ -6670,15 +6622,36 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "0.3.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46dfffa59fc3c8aad216ed61bdc2c263d2b9d87a9c8ac9de0c11a813e51b6db7" +checksum = "42517d2975ca3114b22a16192634e8241dc5cc1f130be194645970cc1c371494" dependencies = [ "proc-macro2", "quote", "syn", ] +[[package]] +name = "tokio-native-tls" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" +dependencies = [ + "native-tls", + "tokio 1.0.2", +] + +[[package]] +name = "tokio-stream" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76066865172052eb8796c686f0b441a93df8b08d40a950b062ffb9a426f00edd" +dependencies = [ + "futures-core", + "pin-project-lite 0.2.4", + "tokio 1.0.2", +] + [[package]] name = "tokio-tls" version = "0.3.1" @@ -6691,14 +6664,14 @@ dependencies = [ [[package]] name = "tokio-tungstenite" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0381c1e6e08908317cee104781ca48afe03f37cc857792b85f01f9828fb55ba3" +checksum = "e1a5f475f1b9d077ea1017ecbc60890fda8e54942d680ca0b1d2b47cfa2d861b" dependencies = [ "futures-util", "log", - "pin-project 1.0.2", - "tokio 0.3.6", + "pin-project 1.0.4", + "tokio 1.0.2", "tungstenite", ] @@ -6718,34 +6691,35 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.4.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24793699f4665ba0416ed287dc794fe6b11a4aa5e4e95b58624f45f6c46b97d4" +checksum = "3137de2b078e95274b696cc522e87f22c9a753fe3ef3344116ffb94f104f10a3" dependencies = [ - "bytes 0.5.6", + "bytes 0.6.0", "futures-core", "futures-io", "futures-sink", "log", - "pin-project-lite 0.1.11", - "slab", + "pin-project-lite 0.2.4", "tokio 0.3.6", ] [[package]] name = "tokio-util" -version = "0.5.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3137de2b078e95274b696cc522e87f22c9a753fe3ef3344116ffb94f104f10a3" +checksum = "feb971a26599ffd28066d387f109746df178eff14d5ea1e235015c5601967a4b" dependencies = [ - "bytes 0.6.0", + "async-stream", + "bytes 1.0.1", "futures-core", "futures-io", "futures-sink", "log", - "pin-project-lite 0.2.0", + "pin-project-lite 0.2.4", "slab", - "tokio 0.3.6", + "tokio 1.0.2", + "tokio-stream", ] [[package]] @@ -6771,7 +6745,7 @@ checksum = "9f47026cdc4080c07e49b37087de021820269d996f581aac150ef9e5583eefe3" dependencies = [ "cfg-if 1.0.0", "log", - "pin-project-lite 0.2.0", + "pin-project-lite 0.2.4", "tracing-attributes", "tracing-core", ] @@ -6898,18 +6872,18 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "tungstenite" -version = "0.11.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0308d80d86700c5878b9ef6321f020f29b1bb9d5ff3cab25e75e23f3a492a23" +checksum = "8ada8297e8d70872fa9a551d93250a9f407beb9f37ef86494eb20012a2ff7c24" dependencies = [ - "base64 0.12.3", + "base64 0.13.0", "byteorder", - "bytes 0.5.6", - "http 0.2.2", + "bytes 1.0.1", + "http", "httparse", "input_buffer", "log", - "rand 0.7.3", + "rand 0.8.2", "sha-1 0.9.2", "url", "utf-8", @@ -6933,7 +6907,7 @@ dependencies = [ "base64 0.11.0", "bytes 0.5.6", "chrono", - "http 0.2.2", + "http", "mime", ] @@ -6966,7 +6940,7 @@ dependencies = [ "log", "merkle_proof", "rand 0.7.3", - "rand_xorshift 0.2.0", + "rand_xorshift", "rayon", "regex", "rusqlite", @@ -7063,18 +7037,16 @@ name = "unsigned-varint" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7fdeedbf205afadfe39ae559b75c3240f24e257d0ca27e85f85cb82aa19ac35" -dependencies = [ - "bytes 0.5.6", - "futures_codec", -] [[package]] name = "unsigned-varint" -version = "0.5.1" -source = "git+https://github.com/sigp/unsigned-varint?branch=dep-update#b9f8b1ec8b2dbb1d5d27db9601be758065a4d8a6" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35581ff83d4101e58b582e607120c7f5ffb17e632a980b1f38334d76b36908b2" dependencies = [ - "bytes 0.5.6", - "tokio-util 0.4.0", + "asynchronous-codec", + "bytes 1.0.1", + "tokio-util 0.6.2", ] [[package]] @@ -7103,11 +7075,11 @@ checksum = "05e42f7c18b8f902290b009cde6d651262f956c98bc51bca4cd1d511c9cd85c7" [[package]] name = "uuid" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fde2f6a4bea1d6e007c4ad38c6839fa71cbb63b6dbf5b595aa38dc9b1093c11" +checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" dependencies = [ - "rand 0.7.3", + "getrandom 0.2.2", "serde", ] @@ -7132,7 +7104,7 @@ dependencies = [ "eth2_ssz_derive", "exit-future", "fallback", - "futures 0.3.8", + "futures 0.3.12", "hex", "hyper 0.13.9", "lazy_static", @@ -7158,7 +7130,7 @@ dependencies = [ "slog-term", "slot_clock", "tempfile", - "tokio 0.3.6", + "tokio 1.0.2", "tokio-compat-02", "tree_hash", "types", @@ -7244,26 +7216,29 @@ dependencies = [ [[package]] name = "warp" -version = "0.2.5" -source = "git+https://github.com/sigp/warp?branch=lighthouse#21b36a987ecc1b3c50c1314578ded64d12f742c6" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dafd0aac2818a94a34df0df1100a7356c493d8ede4393875fd0b5c51bb6bc80" dependencies = [ - "bytes 0.6.0", - "futures 0.3.8", - "headers 0.3.2 (git+https://github.com/blacktemplar/headers?branch=lighthouse)", - "http 0.2.1", - "hyper 0.14.0-dev", + "bytes 1.0.1", + "futures 0.3.12", + "headers", + "http", + "hyper 0.14.2", "log", "mime", "mime_guess", "multipart", "percent-encoding", - "pin-project 1.0.2", + "pin-project 1.0.4", "scoped-tls", "serde", "serde_json", "serde_urlencoded", - "tokio 0.3.6", + "tokio 1.0.2", + "tokio-stream", "tokio-tungstenite", + "tokio-util 0.6.2", "tower-service", "tracing", "tracing-futures", @@ -7275,13 +7250,13 @@ version = "0.1.0" dependencies = [ "beacon_chain", "eth2", - "headers 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "headers", "lazy_static", "lighthouse_metrics", "safe_arith", "serde", "state_processing", - "tokio 0.3.6", + "tokio 1.0.2", "types", "warp", ] @@ -7294,9 +7269,9 @@ checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" +version = "0.10.1+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" +checksum = "93c6c3420963c5c64bca373b25e77acb562081b9bb4dd5bb864187742186cea9" [[package]] name = "wasm-bindgen" @@ -7396,7 +7371,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" dependencies = [ - "futures 0.3.8", + "futures 0.3.12", "js-sys", "parking_lot", "pin-utils", @@ -7427,17 +7402,17 @@ dependencies = [ "derive_more", "ethabi", "ethereum-types", - "futures 0.3.8", + "futures 0.3.12", "futures-timer", "hex", "hyper 0.13.9", "hyper-proxy", - "hyper-tls", + "hyper-tls 0.4.3", "jsonrpc-core", "log", "native-tls", "parking_lot", - "pin-project 1.0.2", + "pin-project 1.0.4", "rlp", "secp256k1", "serde", @@ -7487,6 +7462,16 @@ dependencies = [ "libc", ] +[[package]] +name = "which" +version = "4.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87c14ef7e1b8b8ecfc75d5eca37949410046e66f15d185c01d70824f1f8111ef" +dependencies = [ + "libc", + "thiserror", +] + [[package]] name = "winapi" version = "0.2.8" @@ -7583,9 +7568,9 @@ dependencies = [ [[package]] name = "yaml-rust" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39f0c922f1a334134dc2f7a8b67dc5d25f0735263feec974345ff706bcf20b0d" +checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" dependencies = [ "linked-hash-map", ] @@ -7596,7 +7581,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9aeb8c4043cac71c3c299dff107171c220d179492350ea198e109a414981b83c" dependencies = [ - "futures 0.3.8", + "futures 0.3.12", "log", "nohash-hasher", "parking_lot", @@ -7636,5 +7621,5 @@ dependencies = [ "crc32fast", "flate2", "thiserror", - "time 0.1.44", + "time 0.1.43", ] diff --git a/account_manager/Cargo.toml b/account_manager/Cargo.toml index 24eef147d70..e5c6776afc0 100644 --- a/account_manager/Cargo.toml +++ b/account_manager/Cargo.toml @@ -27,7 +27,7 @@ eth2_wallet = { path = "../crypto/eth2_wallet" } eth2_wallet_manager = { path = "../common/eth2_wallet_manager" } rand = "0.7.3" validator_dir = { path = "../common/validator_dir" } -tokio = { version = "0.3.5", features = ["full"] } +tokio = { version = "1.0.2", features = ["full"] } eth2_keystore = { path = "../crypto/eth2_keystore" } account_utils = { path = "../common/account_utils" } slashing_protection = { path = "../validator_client/slashing_protection" } diff --git a/beacon_node/Cargo.toml b/beacon_node/Cargo.toml index f26d99d27ee..c1e2f1ab0de 100644 --- a/beacon_node/Cargo.toml +++ b/beacon_node/Cargo.toml @@ -27,7 +27,7 @@ slog = { version = "2.5.2", features = ["max_level_trace", "release_max_level_tr slog-term = "2.6.0" slog-async = "2.5.0" ctrlc = { version = "3.1.6", features = ["termination"] } -tokio = { version = "0.3.2", features = ["time"] } +tokio = { version = "1.0.2", features = ["time"] } exit-future = "0.2.0" dirs = "3.0.1" logging = { path = "../common/logging" } diff --git a/beacon_node/beacon_chain/Cargo.toml b/beacon_node/beacon_chain/Cargo.toml index dc6cdae030f..70b1ab3b1f1 100644 --- a/beacon_node/beacon_chain/Cargo.toml +++ b/beacon_node/beacon_chain/Cargo.toml @@ -40,7 +40,7 @@ eth2_ssz_derive = "0.1.0" state_processing = { path = "../../consensus/state_processing" } tree_hash = "0.1.1" types = { path = "../../consensus/types" } -tokio = "0.3.2" +tokio = "1.0.2" eth1 = { path = "../eth1" } futures = "0.3.7" genesis = { path = "../genesis" } diff --git a/beacon_node/client/Cargo.toml b/beacon_node/client/Cargo.toml index 638072b666e..42d21edaa85 100644 --- a/beacon_node/client/Cargo.toml +++ b/beacon_node/client/Cargo.toml @@ -26,10 +26,10 @@ error-chain = "0.12.4" serde_yaml = "0.8.13" slog = { version = "2.5.2", features = ["max_level_trace"] } slog-async = "2.5.0" -tokio = "0.3.2" +tokio = "1.0.2" dirs = "3.0.1" futures = "0.3.7" -reqwest = { version = "0.10.8", features = ["native-tls-vendored"] } +reqwest = { version = "0.11.0", features = ["native-tls-vendored"] } url = "2.1.1" eth1 = { path = "../eth1" } genesis = { path = "../genesis" } diff --git a/beacon_node/client/src/notifier.rs b/beacon_node/client/src/notifier.rs index 2e6300d12fb..9b3c9c746b5 100644 --- a/beacon_node/client/src/notifier.rs +++ b/beacon_node/client/src/notifier.rs @@ -64,8 +64,8 @@ pub fn spawn_notifier( } // Perform post-genesis logging. - while interval.next().await.is_some() { - let connected_peer_count = network.connected_peers(); + loop { + interval.tick().await; let connected_peer_count = network.connected_peers(); let sync_state = network.sync_state(); let head_info = beacon_chain.head_info().map_err(|e| { diff --git a/beacon_node/eth1/Cargo.toml b/beacon_node/eth1/Cargo.toml index 0ee75381bc0..fe5cd84420f 100644 --- a/beacon_node/eth1/Cargo.toml +++ b/beacon_node/eth1/Cargo.toml @@ -13,7 +13,7 @@ environment = { path = "../../lighthouse/environment" } tokio-compat-02 = "0.1" [dependencies] -reqwest = { version = "0.10.8", features = ["native-tls-vendored"] } +reqwest = { version = "0.11.0", features = ["native-tls-vendored"] } futures = "0.3.7" serde_json = "1.0.58" serde = { version = "1.0.116", features = ["derive"] } @@ -26,7 +26,7 @@ tree_hash = "0.1.1" eth2_hashing = "0.1.0" parking_lot = "0.11.0" slog = "2.5.2" -tokio = { version = "0.3.2", features = ["full"] } +tokio = { version = "1.0.2", features = ["full"] } state_processing = { path = "../../consensus/state_processing" } libflate = "1.0.2" lighthouse_metrics = { path = "../../common/lighthouse_metrics"} diff --git a/beacon_node/eth1/src/service.rs b/beacon_node/eth1/src/service.rs index 43eee28e6c9..eb3398ad85c 100644 --- a/beacon_node/eth1/src/service.rs +++ b/beacon_node/eth1/src/service.rs @@ -721,7 +721,8 @@ impl Service { let mut interval = interval_at(Instant::now(), update_interval); let update_future = async move { - while interval.next().await.is_some() { + loop { + interval.tick().await; self.do_update(update_interval).await.ok(); } }; diff --git a/beacon_node/eth2_libp2p/Cargo.toml b/beacon_node/eth2_libp2p/Cargo.toml index 11540bdabd7..6abdbd294ba 100644 --- a/beacon_node/eth2_libp2p/Cargo.toml +++ b/beacon_node/eth2_libp2p/Cargo.toml @@ -5,8 +5,8 @@ authors = ["Sigma Prime "] edition = "2018" [dependencies] -discv5 = { version = "0.1.0-beta.2", features = ["libp2p"] } -unsigned-varint = { git = "https://github.com/sigp/unsigned-varint", branch = "dep-update", features = ["codec"] } +discv5 = { git = "https://github.com/sigp/discv5", branch = "master", 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" } @@ -16,15 +16,16 @@ 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 = "0.3.2", features = ["time", "macros"] } +tokio = { version = "1.0.2", 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 = "0.5.0" +tokio-io-timeout = "1.1.1" lru = "0.6.0" parking_lot = "0.11.0" sha2 = "0.9.1" @@ -32,7 +33,8 @@ base64 = "0.13.0" snap = "1.0.1" void = "1.0.2" hex = "0.4.2" -tokio-util = { version = "0.4.0", features = ["codec", "compat", "time"] } +tokio-util = { version = "0.6.2", features = ["codec", "compat", "time"] } +tokio-stream = "0.1.2" tiny-keccak = "2.0.2" task_executor = { path = "../../common/task_executor" } rand = "0.7.3" @@ -42,13 +44,13 @@ strum = { version = "0.20", features = ["derive"] } [dependencies.libp2p] #version = "0.23.0" -git = "https://github.com/sigp/rust-libp2p" -rev = "97000533e4710183124abde017c6c3d68287c1ae" +git = "https://github.com/libp2p/rust-libp2p" +rev = "bbd3df64ed4cc99a5ddac47ab53673161c70e6da" default-features = false features = ["websocket", "identify", "mplex", "yamux", "noise", "gossipsub", "dns", "tcp-tokio"] [dev-dependencies] -tokio = { version = "0.3.2", features = ["full"] } +tokio = { version = "1.0.2", features = ["full"] } slog-term = "2.6.0" slog-async = "2.5.0" tempfile = "3.1.0" diff --git a/beacon_node/eth2_libp2p/src/behaviour/mod.rs b/beacon_node/eth2_libp2p/src/behaviour/mod.rs index 2e10fb686d7..fc0ef8b4857 100644 --- a/beacon_node/eth2_libp2p/src/behaviour/mod.rs +++ b/beacon_node/eth2_libp2p/src/behaviour/mod.rs @@ -832,7 +832,7 @@ impl Behaviour { if let Some((peer_id, reason)) = self.peers_to_dc.pop_front() { return Poll::Ready(NBAction::NotifyHandler { peer_id, - handler: NotifyHandler::All, + handler: NotifyHandler::Any, event: BehaviourHandlerIn::Shutdown( reason.map(|reason| (RequestId::Behaviour, RPCRequest::Goodbye(reason))), ), @@ -893,7 +893,7 @@ impl Behaviour { } // perform gossipsub score updates when necessary - while let Poll::Ready(Some(_)) = self.update_gossipsub_scores.poll_next_unpin(cx) { + while let Poll::Ready(_) = self.update_gossipsub_scores.poll_tick(cx) { self.peer_manager.update_gossipsub_scores(&self.gossipsub); } diff --git a/beacon_node/eth2_libp2p/src/discovery/mod.rs b/beacon_node/eth2_libp2p/src/discovery/mod.rs index c22c7d6cdc7..17b05ece3e8 100644 --- a/beacon_node/eth2_libp2p/src/discovery/mod.rs +++ b/beacon_node/eth2_libp2p/src/discovery/mod.rs @@ -896,7 +896,10 @@ impl Discovery { } EventStream::InActive => {} // ignore checking the stream EventStream::Present(ref mut stream) => { - while let Ok(event) = stream.try_recv() { + //TODO: replace this with try_rec() when this issue is resolved: + // (should this be try_recv?) + // https://github.com/tokio-rs/tokio/issues/3350 + while let Some(Some(event)) = stream.recv().now_or_never() { match event { // We filter out unwanted discv5 events here and only propagate useful results to // the peer manager. diff --git a/beacon_node/eth2_libp2p/src/peer_manager/mod.rs b/beacon_node/eth2_libp2p/src/peer_manager/mod.rs index 035644e90bf..e749842adb9 100644 --- a/beacon_node/eth2_libp2p/src/peer_manager/mod.rs +++ b/beacon_node/eth2_libp2p/src/peer_manager/mod.rs @@ -972,7 +972,7 @@ impl Stream for PeerManager { fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { // perform the heartbeat when necessary - while let Poll::Ready(Some(_)) = self.heartbeat.poll_next_unpin(cx) { + while let Poll::Ready(_) = self.heartbeat.poll_tick(cx) { self.heartbeat(); } diff --git a/beacon_node/eth2_libp2p/src/rpc/handler.rs b/beacon_node/eth2_libp2p/src/rpc/handler.rs index 38d0391aa3f..41731d5d9a3 100644 --- a/beacon_node/eth2_libp2p/src/rpc/handler.rs +++ b/beacon_node/eth2_libp2p/src/rpc/handler.rs @@ -7,6 +7,7 @@ use super::{RPCReceived, RPCSend}; use crate::rpc::protocol::{InboundFramed, OutboundFramed}; use fnv::FnvHashMap; use futures::prelude::*; +use futures::{Sink, SinkExt}; use libp2p::core::upgrade::{ InboundUpgrade, NegotiationError, OutboundUpgrade, ProtocolError, UpgradeError, }; diff --git a/beacon_node/eth2_libp2p/src/rpc/protocol.rs b/beacon_node/eth2_libp2p/src/rpc/protocol.rs index 19a60508831..70640ecdf5a 100644 --- a/beacon_node/eth2_libp2p/src/rpc/protocol.rs +++ b/beacon_node/eth2_libp2p/src/rpc/protocol.rs @@ -9,7 +9,7 @@ use crate::rpc::{ MaxRequestBlocks, MAX_REQUEST_BLOCKS, }; use futures::future::BoxFuture; -use futures::prelude::*; +use futures::{Future, FutureExt, Sink, SinkExt, Stream, StreamExt}; use futures::prelude::{AsyncRead, AsyncWrite}; use libp2p::core::{InboundUpgrade, OutboundUpgrade, ProtocolName, UpgradeInfo}; use ssz::Encode; @@ -23,6 +23,7 @@ use tokio_util::{ codec::Framed, compat::{Compat, FuturesAsyncReadCompatExt}, }; +use tokio::io::AsyncReadExt; use types::{BeaconBlock, EthSpec, Hash256, MainnetEthSpec, Signature, SignedBeaconBlock}; lazy_static! { @@ -278,7 +279,7 @@ impl ProtocolName for ProtocolId { pub type InboundOutput = (RPCRequest, InboundFramed); pub type InboundFramed = - Framed>, InboundCodec>; + Framed>>>, InboundCodec>; impl InboundUpgrade for RPCProtocol where @@ -304,7 +305,7 @@ where let mut timed_socket = TimeoutStream::new(socket); timed_socket.set_read_timeout(Some(Duration::from_secs(TTFB_TIMEOUT))); - let socket = Framed::new(timed_socket, codec); + let socket = Framed::new(Box::pin(timed_socket), codec); // MetaData requests should be empty, return the stream match protocol_name { diff --git a/beacon_node/eth2_libp2p/src/rpc/rate_limiter.rs b/beacon_node/eth2_libp2p/src/rpc/rate_limiter.rs index bc34ce832e7..a64e4c348c5 100644 --- a/beacon_node/eth2_libp2p/src/rpc/rate_limiter.rs +++ b/beacon_node/eth2_libp2p/src/rpc/rate_limiter.rs @@ -241,7 +241,7 @@ impl Future for RPCRateLimiter { type Output = (); fn poll(mut self: Pin<&mut Self>, cx: &mut Context) -> Poll { - while let Poll::Ready(Some(_)) = self.prune_interval.poll_next_unpin(cx) { + while let Poll::Ready(_) = self.prune_interval.poll_tick(cx) { self.prune(); } diff --git a/beacon_node/genesis/Cargo.toml b/beacon_node/genesis/Cargo.toml index 383c79d904a..0e65d27c92c 100644 --- a/beacon_node/genesis/Cargo.toml +++ b/beacon_node/genesis/Cargo.toml @@ -19,7 +19,7 @@ merkle_proof = { path = "../../consensus/merkle_proof" } eth2_ssz = "0.1.2" eth2_hashing = "0.1.0" tree_hash = "0.1.1" -tokio = { version = "0.3.2", features = ["full"] } +tokio = { version = "1.0.2", features = ["full"] } parking_lot = "0.11.0" slog = "2.5.2" exit-future = "0.2.0" diff --git a/beacon_node/http_api/Cargo.toml b/beacon_node/http_api/Cargo.toml index a35d832db94..f749af5deef 100644 --- a/beacon_node/http_api/Cargo.toml +++ b/beacon_node/http_api/Cargo.toml @@ -5,9 +5,11 @@ authors = ["Paul Hauner "] edition = "2018" [dependencies] -warp = { git = "https://github.com/sigp/warp ", branch = "lighthouse" } +async-stream = "0.3.0" +warp = "0.3.0" serde = { version = "1.0.116", features = ["derive"] } -tokio = { version = "0.3.2", features = ["macros","stream","sync"] } +tokio = { version = "1.0.2", features = ["macros","sync"] } +tokio-stream = "0.1.2" parking_lot = "0.11.0" types = { path = "../../consensus/types" } hex = "0.4.2" @@ -32,5 +34,5 @@ futures = "0.3.8" store = { path = "../store" } environment = { path = "../../lighthouse/environment" } tree_hash = "0.1.1" -discv5 = { version = "0.1.0-beta.2", features = ["libp2p"] } +discv5 = { git = "https://github.com/sigp/discv5", branch = "master" } tokio-compat-02 = "0.1" diff --git a/beacon_node/http_api/src/lib.rs b/beacon_node/http_api/src/lib.rs index 70e83068733..2d534dea88b 100644 --- a/beacon_node/http_api/src/lib.rs +++ b/beacon_node/http_api/src/lib.rs @@ -34,7 +34,7 @@ use std::convert::TryInto; use std::future::Future; use std::net::{Ipv4Addr, SocketAddr, SocketAddrV4}; use std::sync::Arc; -use tokio::stream::{StreamExt, StreamMap}; +use tokio_stream::{StreamExt, StreamMap}; use tokio::sync::broadcast::error::RecvError; use tokio::sync::mpsc::UnboundedSender; use types::{ @@ -43,7 +43,7 @@ use types::{ SignedBeaconBlock, SignedVoluntaryExit, Slot, YamlConfig, }; use warp::http::StatusCode; -use warp::sse::ServerSentEvent; +use warp::sse::Event; use warp::Reply; use warp::{http::Response, Filter, Stream}; use warp_utils::reject::ServerSentEventError; @@ -214,7 +214,7 @@ pub fn prometheus_metrics() -> warp::filters::log::Log( ctx: Arc>, shutdown: impl Future + Send + Sync + 'static, -) -> Result<(SocketAddr, impl Future), Error> { +) -> Result<(SocketAddr, impl Future), Error> where <::EthSpec as EthSpec>::MaxValidatorsPerCommittee: Unpin { let config = ctx.config.clone(); let log = ctx.log.clone(); @@ -2389,7 +2389,7 @@ pub fn serve( if let Some(event_handler) = chain.event_handler.as_ref() { for topic in topics.topics.0.clone() { - let receiver = match topic { + let mut receiver = match topic { api_types::EventTopic::Head => event_handler.subscribe_head(), api_types::EventTopic::Block => event_handler.subscribe_block(), api_types::EventTopic::Attestation => { diff --git a/beacon_node/http_metrics/Cargo.toml b/beacon_node/http_metrics/Cargo.toml index ab2e53206d9..e960d82c2cc 100644 --- a/beacon_node/http_metrics/Cargo.toml +++ b/beacon_node/http_metrics/Cargo.toml @@ -8,7 +8,7 @@ edition = "2018" [dependencies] prometheus = "0.11.0" -warp = { git = "https://github.com/sigp/warp ", branch = "lighthouse" } +warp = "0.3.0" serde = { version = "1.0.116", features = ["derive"] } slog = "2.5.2" beacon_chain = { path = "../beacon_chain" } @@ -22,8 +22,8 @@ lighthouse_version = { path = "../../common/lighthouse_version" } warp_utils = { path = "../../common/warp_utils" } [dev-dependencies] -tokio = { version = "0.3.2", features = ["sync"] } -reqwest = { version = "0.10.8", features = ["json"] } +tokio = { version = "1.0.2", features = ["sync"] } +reqwest = { version = "0.11.0", features = ["json"] } environment = { path = "../../lighthouse/environment" } types = { path = "../../consensus/types" } tokio-compat-02 = "0.1" diff --git a/beacon_node/network/Cargo.toml b/beacon_node/network/Cargo.toml index cef863da674..8950fe3b794 100644 --- a/beacon_node/network/Cargo.toml +++ b/beacon_node/network/Cargo.toml @@ -30,7 +30,8 @@ eth2_ssz_types = { path = "../../consensus/ssz_types" } tree_hash = "0.1.1" futures = "0.3.7" error-chain = "0.12.4" -tokio = { version = "0.3.2", features = ["full"] } +tokio = { version = "1.0.2", features = ["full"] } +tokio-stream = "0.1.2" parking_lot = "0.11.0" smallvec = "1.6.1" rand = "0.7.3" diff --git a/beacon_node/network/src/router/mod.rs b/beacon_node/network/src/router/mod.rs index 56332f7dee6..f3d91970ea6 100644 --- a/beacon_node/network/src/router/mod.rs +++ b/beacon_node/network/src/router/mod.rs @@ -20,6 +20,8 @@ use slog::{debug, o, trace}; use std::sync::Arc; use tokio::sync::mpsc; use types::EthSpec; +use tokio_stream::{Stream, StreamExt, wrappers::UnboundedReceiverStream}; +use types::Error::UnableToDetermineProducer; /// Handles messages received from the network and client and organises syncing. This /// functionality of this struct is to validate an decode messages from the network before @@ -101,7 +103,7 @@ impl Router { executor.spawn( async move { debug!(log, "Network message router started"); - handler_recv + UnboundedReceiverStream::new(handler_recv) .for_each(move |msg| future::ready(handler.handle_message(msg))) .await; }, diff --git a/beacon_node/network/src/service.rs b/beacon_node/network/src/service.rs index be5876a2a66..2a68d5b02e7 100644 --- a/beacon_node/network/src/service.rs +++ b/beacon_node/network/src/service.rs @@ -266,7 +266,7 @@ fn spawn_service( info!(service.log, "Network service shutdown"); return; } - _ = service.metrics_update.next() => { + _ = service.metrics_update.tick() => { // update various network metrics metric_update_counter +=1; if metric_update_counter % T::EthSpec::default_spec().seconds_per_slot == 0 { @@ -283,7 +283,7 @@ fn spawn_service( metrics::update_sync_metrics(&service.network_globals); } - _ = service.gossipsub_parameter_update.next() => { + _ = service.gossipsub_parameter_update.tick() => { if let Ok(slot) = service.beacon_chain.slot() { if let Some(active_validators) = service.beacon_chain.with_head(|head| { Ok::<_, BeaconChainError>( diff --git a/beacon_node/timer/Cargo.toml b/beacon_node/timer/Cargo.toml index 07bfc8c0e3a..8b8caf76d21 100644 --- a/beacon_node/timer/Cargo.toml +++ b/beacon_node/timer/Cargo.toml @@ -8,7 +8,7 @@ edition = "2018" beacon_chain = { path = "../beacon_chain" } types = { path = "../../consensus/types" } slot_clock = { path = "../../common/slot_clock" } -tokio = { version = "0.3.2", features = ["full"] } +tokio = { version = "1.0.2", features = ["full"] } slog = "2.5.2" parking_lot = "0.11.0" futures = "0.3.7" diff --git a/beacon_node/timer/src/lib.rs b/beacon_node/timer/src/lib.rs index 639b81b7de9..056740eb32b 100644 --- a/beacon_node/timer/src/lib.rs +++ b/beacon_node/timer/src/lib.rs @@ -26,7 +26,8 @@ pub fn spawn_timer( // Warning: `interval_at` panics if `seconds_per_slot` = 0. let mut interval = interval_at(start_instant, Duration::from_secs(seconds_per_slot)); let timer_future = async move { - while interval.next().await.is_some() { + loop { + interval.tick().await; beacon_chain.per_slot_task(); } }; diff --git a/boot_node/Cargo.toml b/boot_node/Cargo.toml index 3a69ba39add..319270662a7 100644 --- a/boot_node/Cargo.toml +++ b/boot_node/Cargo.toml @@ -13,7 +13,7 @@ eth2_network_config = { path = "../common/eth2_network_config" } eth2_ssz = "0.1.2" slog = "2.5.2" sloggers = "1.0.1" -tokio = "0.3.2" +tokio = "1.0.2" log = "0.4.11" slog-term = "2.6.0" logging = { path = "../common/logging" } diff --git a/common/deposit_contract/Cargo.toml b/common/deposit_contract/Cargo.toml index 1a6f8439514..6c27d124857 100644 --- a/common/deposit_contract/Cargo.toml +++ b/common/deposit_contract/Cargo.toml @@ -7,7 +7,7 @@ edition = "2018" build = "build.rs" [build-dependencies] -reqwest = { version = "0.10.8", features = ["blocking", "json", "native-tls-vendored"] } +reqwest = { version = "0.11.0", features = ["blocking", "json", "native-tls-vendored"] } serde_json = "1.0.58" sha2 = "0.9.1" hex = "0.4.2" diff --git a/common/eth2/Cargo.toml b/common/eth2/Cargo.toml index d7eddd7dffa..72b18d13fef 100644 --- a/common/eth2/Cargo.toml +++ b/common/eth2/Cargo.toml @@ -11,7 +11,7 @@ serde = { version = "1.0.116", features = ["derive"] } serde_json = "1.0.58" types = { path = "../../consensus/types" } hex = "0.4.2" -reqwest = { version = "0.10.8", features = ["json","stream"] } +reqwest = { version = "0.11.0", features = ["json","stream"] } eth2_libp2p = { path = "../../beacon_node/eth2_libp2p" } proto_array = { path = "../../consensus/proto_array", optional = true } serde_utils = { path = "../../consensus/serde_utils" } @@ -19,7 +19,7 @@ zeroize = { version = "1.1.1", features = ["zeroize_derive"] } eth2_keystore = { path = "../../crypto/eth2_keystore" } libsecp256k1 = "0.3.5" ring = "0.16.19" -bytes = "0.5.6" +bytes = "1.0.1" account_utils = { path = "../../common/account_utils" } eth2_ssz = "0.1.2" eth2_ssz_derive = "0.1.0" diff --git a/common/hashset_delay/Cargo.toml b/common/hashset_delay/Cargo.toml index c9a450ae78c..86827ac6e23 100644 --- a/common/hashset_delay/Cargo.toml +++ b/common/hashset_delay/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" [dependencies] futures = "0.3.7" -tokio-util = { version = "0.5.0", features = ["time"] } +tokio-util = { version = "0.6.2", features = ["time"] } [dev-dependencies] -tokio = { version = "0.3.2", features = ["time", "rt-multi-thread", "macros"] } +tokio = { version = "1.0.2", features = ["time", "rt-multi-thread", "macros"] } diff --git a/common/remote_signer_consumer/Cargo.toml b/common/remote_signer_consumer/Cargo.toml index c11c2170d34..ee951aada71 100644 --- a/common/remote_signer_consumer/Cargo.toml +++ b/common/remote_signer_consumer/Cargo.toml @@ -9,7 +9,7 @@ rand = "0.7.3" remote_signer_test = { path = "../../testing/remote_signer_test" } [dependencies] -reqwest = { version = "0.10.8", features = ["json"] } +reqwest = { version = "0.11.0", features = ["json"] } serde = { version = "1.0.116", features = ["derive"] } -tokio = { version = "0.3.5", features = ["time"] } +tokio = { version = "1.0.2", features = ["time"] } types = { path = "../../consensus/types" } diff --git a/common/rest_types/Cargo.toml b/common/rest_types/Cargo.toml index 9b6b828568f..f121722d43d 100644 --- a/common/rest_types/Cargo.toml +++ b/common/rest_types/Cargo.toml @@ -15,7 +15,7 @@ bls = { path = "../../crypto/bls" } serde = { version = "1.0.110", features = ["derive"] } rayon = "1.3.0" hyper = "0.13.5" -tokio = { version = "0.3.5", features = ["sync"] } +tokio = { version = "1.0.2", features = ["sync"] } environment = { path = "../../lighthouse/environment" } store = { path = "../../beacon_node/store" } beacon_chain = { path = "../../beacon_node/beacon_chain" } diff --git a/common/task_executor/Cargo.toml b/common/task_executor/Cargo.toml index 1c5efc67701..e288c941940 100644 --- a/common/task_executor/Cargo.toml +++ b/common/task_executor/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Sigma Prime "] edition = "2018" [dependencies] -tokio = { version = "0.3.2", features = ["rt"] } +tokio = { version = "1.0.2", features = ["rt"] } slog = "2.5.2" futures = "0.3.7" exit-future = "0.2.0" diff --git a/common/warp_utils/Cargo.toml b/common/warp_utils/Cargo.toml index 84f25d5ae03..7346d867b21 100644 --- a/common/warp_utils/Cargo.toml +++ b/common/warp_utils/Cargo.toml @@ -7,14 +7,14 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -warp = { git = "https://github.com/sigp/warp ", branch = "lighthouse" } +warp = "0.3.0" eth2 = { path = "../eth2" } types = { path = "../../consensus/types" } beacon_chain = { path = "../../beacon_node/beacon_chain" } state_processing = { path = "../../consensus/state_processing" } safe_arith = { path = "../../consensus/safe_arith" } serde = { version = "1.0.116", features = ["derive"] } -tokio = { version = "0.3.2", features = ["sync"] } +tokio = { version = "1.0.2", features = ["sync"] } headers = "0.3.2" lighthouse_metrics = { path = "../lighthouse_metrics" } lazy_static = "1.4.0" diff --git a/consensus/int_to_bytes/Cargo.toml b/consensus/int_to_bytes/Cargo.toml index e4f3389ba33..81fd49b4f26 100644 --- a/consensus/int_to_bytes/Cargo.toml +++ b/consensus/int_to_bytes/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Paul Hauner "] edition = "2018" [dependencies] -bytes = "0.6.0" +bytes = "1.0.1" [dev-dependencies] yaml-rust = "0.4.4" diff --git a/lcli/Cargo.toml b/lcli/Cargo.toml index 6d5470f6465..61407cf74bf 100644 --- a/lcli/Cargo.toml +++ b/lcli/Cargo.toml @@ -27,7 +27,7 @@ dirs = "3.0.1" genesis = { path = "../beacon_node/genesis" } deposit_contract = { path = "../common/deposit_contract" } tree_hash = "0.1.1" -tokio = { version = "0.3.2", features = ["full"] } +tokio = { version = "1.0.2", features = ["full"] } clap_utils = { path = "../common/clap_utils" } eth2_libp2p = { path = "../beacon_node/eth2_libp2p" } validator_dir = { path = "../common/validator_dir", features = ["insecure_keys"] } diff --git a/lighthouse/Cargo.toml b/lighthouse/Cargo.toml index 4e0f05e4b50..59f94b850fe 100644 --- a/lighthouse/Cargo.toml +++ b/lighthouse/Cargo.toml @@ -20,7 +20,7 @@ spec-v12 = [] [dependencies] beacon_node = { "path" = "../beacon_node" } -tokio = "0.3.2" +tokio = "1.0.2" slog = { version = "2.5.2", features = ["max_level_trace"] } sloggers = "1.0.1" types = { "path" = "../consensus/types" } diff --git a/lighthouse/environment/Cargo.toml b/lighthouse/environment/Cargo.toml index 9260b9cfd4c..6632d1d3bf7 100644 --- a/lighthouse/environment/Cargo.toml +++ b/lighthouse/environment/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Paul Hauner "] edition = "2018" [dependencies] -tokio = { version = "0.3.2", features = ["macros", "rt", "rt-multi-thread" ] } +tokio = { version = "1.0.2", features = ["macros", "rt", "rt-multi-thread" ] } slog = { version = "2.5.2", features = ["max_level_trace"] } sloggers = "1.0.1" types = { "path" = "../../consensus/types" } diff --git a/slasher/service/Cargo.toml b/slasher/service/Cargo.toml index 0326734f831..0c85ea24829 100644 --- a/slasher/service/Cargo.toml +++ b/slasher/service/Cargo.toml @@ -14,5 +14,6 @@ slog = "2.5.2" slot_clock = { path = "../../common/slot_clock" } state_processing = { path = "../../consensus/state_processing" } task_executor = { path = "../../common/task_executor" } -tokio = { version = "0.3.5", features = ["full"] } +tokio = { version = "1.0.2", features = ["full"] } +tokio-stream = "0.1.2" types = { path = "../../consensus/types" } diff --git a/slasher/service/src/service.rs b/slasher/service/src/service.rs index 18ca063ecff..fa2803e8f6c 100644 --- a/slasher/service/src/service.rs +++ b/slasher/service/src/service.rs @@ -19,7 +19,7 @@ use state_processing::{ use std::sync::mpsc::{sync_channel, Receiver, SyncSender, TrySendError}; use std::sync::Arc; use task_executor::TaskExecutor; -use tokio::stream::StreamExt; +use tokio_stream::StreamExt; use tokio::sync::mpsc::UnboundedSender; use tokio::time::{interval_at, Duration, Instant}; use types::{AttesterSlashing, Epoch, EthSpec, ProposerSlashing}; @@ -83,8 +83,8 @@ impl SlasherService { // https://github.com/sigp/lighthouse/issues/1861 let mut interval = interval_at(Instant::now(), Duration::from_secs(update_period)); - while interval.next().await.is_some() { - if let Some(current_slot) = beacon_chain.slot_clock.now() { + loop { + interval.tick().await; if let Some(current_slot) = beacon_chain.slot_clock.now() { let current_epoch = current_slot.epoch(T::EthSpec::slots_per_epoch()); if let Err(TrySendError::Disconnected(_)) = notif_sender.try_send(current_epoch) { break; diff --git a/testing/eth1_test_rig/Cargo.toml b/testing/eth1_test_rig/Cargo.toml index 49188c4697a..0fd880e86f1 100644 --- a/testing/eth1_test_rig/Cargo.toml +++ b/testing/eth1_test_rig/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Paul Hauner "] edition = "2018" [dependencies] -tokio = { version = "0.3.2", features = ["time"] } +tokio = { version = "1.0.2", features = ["time"] } tokio-compat-02 = "0.1" web3 = "0.14.0" futures = "0.3.7" diff --git a/testing/node_test_rig/Cargo.toml b/testing/node_test_rig/Cargo.toml index 93eb8a2301d..0a7fd1a98cf 100644 --- a/testing/node_test_rig/Cargo.toml +++ b/testing/node_test_rig/Cargo.toml @@ -10,7 +10,7 @@ beacon_node = { path = "../../beacon_node" } types = { path = "../../consensus/types" } eth2_config = { path = "../../common/eth2_config" } tempfile = "3.1.0" -reqwest = { version = "0.10.8", features = ["native-tls-vendored"] } +reqwest = { version = "0.11.0", features = ["native-tls-vendored"] } url = "2.1.1" serde = "1.0.116" futures = "0.3.7" diff --git a/testing/remote_signer_test/Cargo.toml b/testing/remote_signer_test/Cargo.toml index f0f795262e4..46de7d56504 100644 --- a/testing/remote_signer_test/Cargo.toml +++ b/testing/remote_signer_test/Cargo.toml @@ -11,10 +11,10 @@ hex = "0.4.2" httpmock = "0.5.1" remote_signer_client = { path = "../../remote_signer/client" } remote_signer_consumer = { path = "../../common/remote_signer_consumer" } -reqwest = { version = "0.10.8", features = ["blocking", "json"] } +reqwest = { version = "0.11.0", features = ["blocking", "json"] } serde = { version = "1.0.116", features = ["derive"] } serde_json = "1.0.58" tempfile = "3.1.0" -tokio = { version = "0.3.5", features = ["time"] } +tokio = { version = "1.0.2", features = ["time"] } types = { path = "../../consensus/types" } tokio-compat-02 = "0.1" diff --git a/testing/simulator/Cargo.toml b/testing/simulator/Cargo.toml index 491a801cff9..d8415fe019b 100644 --- a/testing/simulator/Cargo.toml +++ b/testing/simulator/Cargo.toml @@ -13,7 +13,7 @@ types = { path = "../../consensus/types" } validator_client = { path = "../../validator_client" } parking_lot = "0.11.0" futures = "0.3.7" -tokio = "0.3.2" +tokio = "1.0.2" eth1_test_rig = { path = "../eth1_test_rig" } env_logger = "0.8.2" clap = "2.33.3" diff --git a/testing/simulator/src/eth1_sim.rs b/testing/simulator/src/eth1_sim.rs index 4cd5f5020ee..5b98c1d74d1 100644 --- a/testing/simulator/src/eth1_sim.rs +++ b/testing/simulator/src/eth1_sim.rs @@ -89,8 +89,8 @@ pub fn run_eth1_sim(matches: &ArgMatches) -> Result<(), String> { // Start a timer that produces eth1 blocks on an interval. tokio::spawn(async move { let mut interval = tokio::time::interval(eth1_block_time); - while interval.next().await.is_some() { - let _ = ganache.evm_mine().await; + loop { + interval.tick().await; let _ = ganache.evm_mine().await; } }); diff --git a/testing/simulator/src/sync_sim.rs b/testing/simulator/src/sync_sim.rs index db2140c5123..0542abf0e38 100644 --- a/testing/simulator/src/sync_sim.rs +++ b/testing/simulator/src/sync_sim.rs @@ -217,8 +217,8 @@ pub async fn verify_one_node_sync( // limited to at most `sync_timeout` epochs let mut interval = tokio::time::interval(epoch_duration); let mut count = 0; - while interval.next().await.is_some() { - if count >= sync_timeout || !check_still_syncing(&network_c).await? { + loop { + interval.tick().await; if count >= sync_timeout || !check_still_syncing(&network_c).await? { break; } count += 1; @@ -254,8 +254,8 @@ pub async fn verify_two_nodes_sync( // limited to at most `sync_timeout` epochs let mut interval = tokio::time::interval(epoch_duration); let mut count = 0; - while interval.next().await.is_some() { - if count >= sync_timeout || !check_still_syncing(&network_c).await? { + loop { + interval.tick().await; if count >= sync_timeout || !check_still_syncing(&network_c).await? { break; } count += 1; @@ -302,8 +302,8 @@ pub async fn verify_in_between_sync( // limited to at most `sync_timeout` epochs let mut interval = tokio::time::interval(epoch_duration); let mut count = 0; - while interval.next().await.is_some() { - if count >= sync_timeout || !check_still_syncing(&network_c).await? { + loop { + interval.tick().await; if count >= sync_timeout || !check_still_syncing(&network_c).await? { break; } count += 1; diff --git a/validator_client/Cargo.toml b/validator_client/Cargo.toml index bea10631f86..494bc913f9e 100644 --- a/validator_client/Cargo.toml +++ b/validator_client/Cargo.toml @@ -9,7 +9,7 @@ name = "validator_client" path = "src/lib.rs" [dev-dependencies] -tokio = { version = "0.3.2", features = ["time", "rt-multi-thread", "macros"] } +tokio = { version = "1.0.2", features = ["time", "rt-multi-thread", "macros"] } deposit_contract = { path = "../common/deposit_contract" } tokio-compat-02 = "0.1" @@ -30,7 +30,7 @@ serde_yaml = "0.8.13" slog = { version = "2.5.2", features = ["max_level_trace", "release_max_level_trace"] } slog-async = "2.5.0" slog-term = "2.6.0" -tokio = { version = "0.3.2", features = ["time"] } +tokio = { version = "1.0.2", features = ["time"] } futures = "0.3.7" dirs = "3.0.1" directory = { path = "../common/directory" } @@ -53,7 +53,7 @@ eth2_keystore = { path = "../crypto/eth2_keystore" } account_utils = { path = "../common/account_utils" } lighthouse_version = { path = "../common/lighthouse_version" } warp_utils = { path = "../common/warp_utils" } -warp = { git = "https://github.com/sigp/warp ", branch = "lighthouse" } +warp = "0.3.0" hyper = "0.13.8" serde_utils = { path = "../consensus/serde_utils" } libsecp256k1 = "0.3.5" diff --git a/validator_client/src/attestation_service.rs b/validator_client/src/attestation_service.rs index 4fae5b8d685..7b4d2ba1ef8 100644 --- a/validator_client/src/attestation_service.rs +++ b/validator_client/src/attestation_service.rs @@ -149,8 +149,8 @@ impl AttestationService { let executor = self.context.executor.clone(); let interval_fut = async move { - while interval.next().await.is_some() { - let log = self.context.log(); + loop { + interval.tick().await; let log = self.context.log(); if let Err(e) = self.spawn_attestation_tasks(slot_duration) { crit!( diff --git a/validator_client/src/duties_service.rs b/validator_client/src/duties_service.rs index 0554ce3492e..f43dd2d8d01 100644 --- a/validator_client/src/duties_service.rs +++ b/validator_client/src/duties_service.rs @@ -490,8 +490,8 @@ impl DutiesService { let executor = self.inner.context.executor.clone(); let interval_fut = async move { - while interval.next().await.is_some() { - self.clone().do_update(&mut block_service_tx, &spec).await; + loop { + interval.tick().await; self.clone().do_update(&mut block_service_tx, &spec).await; } }; diff --git a/validator_client/src/fork_service.rs b/validator_client/src/fork_service.rs index 82c827b08a8..0fdde80e4bc 100644 --- a/validator_client/src/fork_service.rs +++ b/validator_client/src/fork_service.rs @@ -164,8 +164,8 @@ impl ForkService { let executor = context.executor.clone(); let interval_fut = async move { - while interval.next().await.is_some() { - self.clone().do_update().await.ok(); + loop { + interval.tick().await; self.clone().do_update().await.ok(); } }; diff --git a/validator_client/src/notifier.rs b/validator_client/src/notifier.rs index 2dd77312ea3..2feb079d9d6 100644 --- a/validator_client/src/notifier.rs +++ b/validator_client/src/notifier.rs @@ -24,7 +24,7 @@ pub fn spawn_notifier(client: &ProductionValidatorClient) -> Resu let interval_fut = async move { let log = context.log(); - while interval.next().await.is_some() { + loop { let num_available = duties_service.beacon_nodes.num_available().await; let num_synced = duties_service.beacon_nodes.num_synced().await; let num_total = duties_service.beacon_nodes.num_total().await; From ec99fc3b6e6921c12896a99af8172e1b71459cdf Mon Sep 17 00:00:00 2001 From: realbigsean Date: Sat, 23 Jan 2021 18:01:43 -0500 Subject: [PATCH 02/17] fix sse --- beacon_node/client/src/builder.rs | 7 +- beacon_node/client/src/notifier.rs | 3 +- beacon_node/eth1/src/service.rs | 2 +- beacon_node/eth2_libp2p/src/rpc/protocol.rs | 4 +- beacon_node/http_api/src/broadcast_stream.rs | 39 ++++++++ beacon_node/http_api/src/lib.rs | 96 ++++++++++++-------- beacon_node/network/src/router/mod.rs | 4 +- beacon_node/src/lib.rs | 10 +- boot_node/src/server.rs | 2 +- common/eth2/src/types.rs | 10 ++ lighthouse/src/main.rs | 5 +- slasher/service/src/service.rs | 5 +- testing/simulator/src/eth1_sim.rs | 3 +- testing/simulator/src/sync_sim.rs | 15 +-- validator_client/src/attestation_service.rs | 3 +- validator_client/src/duties_service.rs | 3 +- validator_client/src/fork_service.rs | 3 +- validator_client/src/notifier.rs | 2 +- 18 files changed, 156 insertions(+), 60 deletions(-) create mode 100644 beacon_node/http_api/src/broadcast_stream.rs diff --git a/beacon_node/client/src/builder.rs b/beacon_node/client/src/builder.rs index c47e74cebc6..99920482cec 100644 --- a/beacon_node/client/src/builder.rs +++ b/beacon_node/client/src/builder.rs @@ -115,7 +115,10 @@ where mut self, client_genesis: ClientGenesis, config: ClientConfig, - ) -> Result { + ) -> Result + where + ::MaxValidatorsPerCommittee: Unpin, + { let store = self.store.clone(); let chain_spec = self.chain_spec.clone(); let runtime_context = self.runtime_context.clone(); @@ -414,6 +417,8 @@ where pub fn build( self, ) -> Result>, String> + where + ::MaxValidatorsPerCommittee: Unpin, { let runtime_context = self .runtime_context diff --git a/beacon_node/client/src/notifier.rs b/beacon_node/client/src/notifier.rs index 9b3c9c746b5..da1168651eb 100644 --- a/beacon_node/client/src/notifier.rs +++ b/beacon_node/client/src/notifier.rs @@ -65,7 +65,8 @@ pub fn spawn_notifier( // Perform post-genesis logging. loop { - interval.tick().await; let connected_peer_count = network.connected_peers(); + interval.tick().await; + let connected_peer_count = network.connected_peers(); let sync_state = network.sync_state(); let head_info = beacon_chain.head_info().map_err(|e| { diff --git a/beacon_node/eth1/src/service.rs b/beacon_node/eth1/src/service.rs index eb3398ad85c..5d16b61b36c 100644 --- a/beacon_node/eth1/src/service.rs +++ b/beacon_node/eth1/src/service.rs @@ -721,7 +721,7 @@ impl Service { let mut interval = interval_at(Instant::now(), update_interval); let update_future = async move { - loop { + loop { interval.tick().await; self.do_update(update_interval).await.ok(); } diff --git a/beacon_node/eth2_libp2p/src/rpc/protocol.rs b/beacon_node/eth2_libp2p/src/rpc/protocol.rs index 70640ecdf5a..de86097d1a2 100644 --- a/beacon_node/eth2_libp2p/src/rpc/protocol.rs +++ b/beacon_node/eth2_libp2p/src/rpc/protocol.rs @@ -9,8 +9,8 @@ use crate::rpc::{ MaxRequestBlocks, MAX_REQUEST_BLOCKS, }; use futures::future::BoxFuture; -use futures::{Future, FutureExt, Sink, SinkExt, Stream, StreamExt}; use futures::prelude::{AsyncRead, AsyncWrite}; +use futures::{Future, FutureExt, Sink, SinkExt, Stream, StreamExt}; use libp2p::core::{InboundUpgrade, OutboundUpgrade, ProtocolName, UpgradeInfo}; use ssz::Encode; use ssz_types::VariableList; @@ -18,12 +18,12 @@ use std::io; use std::marker::PhantomData; use std::time::Duration; use strum::{AsStaticRef, AsStaticStr}; +use tokio::io::AsyncReadExt; use tokio_io_timeout::TimeoutStream; use tokio_util::{ codec::Framed, compat::{Compat, FuturesAsyncReadCompatExt}, }; -use tokio::io::AsyncReadExt; use types::{BeaconBlock, EthSpec, Hash256, MainnetEthSpec, Signature, SignedBeaconBlock}; lazy_static! { diff --git a/beacon_node/http_api/src/broadcast_stream.rs b/beacon_node/http_api/src/broadcast_stream.rs new file mode 100644 index 00000000000..f741eea3cc6 --- /dev/null +++ b/beacon_node/http_api/src/broadcast_stream.rs @@ -0,0 +1,39 @@ +use crate::Stream; +use async_stream::try_stream; +use std::pin::Pin; +use tokio::sync::broadcast::error::RecvError; +use tokio::sync::broadcast::Receiver; + +use std::task::{Context, Poll}; + +/// A wrapper around [`Receiver`] that implements [`Stream`]. Achieved by using the [`async-stream`] crate. +/// +/// [`Receiver`]: struct@tokio::sync::broadcast::Receiver +/// [`Stream`]: trait@crate::Stream +/// [`async-stream`]: https://docs.rs/async-stream +pub struct BroadcastStream { + inner: Pin> + Send + Sync>>, +} + +impl BroadcastStream { + /// Create a new `BroadcastStream`. + pub fn new(mut rx: Receiver) -> Self { + let stream = try_stream! { + loop { + let item = rx.recv().await?; + yield item; + } + }; + Self { + inner: Box::pin(stream), + } + } +} + +impl Stream for BroadcastStream { + type Item = Result; + + fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + Pin::new(&mut self.inner).poll_next(cx) + } +} diff --git a/beacon_node/http_api/src/lib.rs b/beacon_node/http_api/src/lib.rs index 2d534dea88b..0dbaadb6812 100644 --- a/beacon_node/http_api/src/lib.rs +++ b/beacon_node/http_api/src/lib.rs @@ -7,6 +7,7 @@ mod beacon_proposer_cache; mod block_id; +mod broadcast_stream; mod metrics; mod state_id; mod validator_inclusion; @@ -20,6 +21,7 @@ use beacon_proposer_cache::BeaconProposerCache; use block_id::BlockId; use eth2::types::{self as api_types, EventKind, ValidatorId}; use eth2_libp2p::{types::SyncState, EnrExt, NetworkGlobals, PeerId, PubsubMessage}; +use futures::future; use lighthouse_version::version_with_platform; use network::NetworkMessage; use parking_lot::Mutex; @@ -34,9 +36,10 @@ use std::convert::TryInto; use std::future::Future; use std::net::{Ipv4Addr, SocketAddr, SocketAddrV4}; use std::sync::Arc; -use tokio_stream::{StreamExt, StreamMap}; use tokio::sync::broadcast::error::RecvError; +use tokio::sync::broadcast::Receiver; use tokio::sync::mpsc::UnboundedSender; +use tokio_stream::{Stream, StreamExt, StreamMap}; use types::{ Attestation, AttestationDuty, AttesterSlashing, CloneConfig, CommitteeCache, Epoch, EthSpec, Hash256, ProposerSlashing, PublicKey, PublicKeyBytes, RelativeEpoch, SignedAggregateAndProof, @@ -45,7 +48,7 @@ use types::{ use warp::http::StatusCode; use warp::sse::Event; use warp::Reply; -use warp::{http::Response, Filter, Stream}; +use warp::{http::Response, Filter}; use warp_utils::reject::ServerSentEventError; use warp_utils::task::{blocking_json_task, blocking_task}; @@ -214,7 +217,10 @@ pub fn prometheus_metrics() -> warp::filters::log::Log( ctx: Arc>, shutdown: impl Future + Send + Sync + 'static, -) -> Result<(SocketAddr, impl Future), Error> where <::EthSpec as EthSpec>::MaxValidatorsPerCommittee: Unpin { +) -> Result<(SocketAddr, impl Future), Error> +where + <::EthSpec as EthSpec>::MaxValidatorsPerCommittee: Unpin, +{ let config = ctx.config.clone(); let log = ctx.log.clone(); @@ -1610,9 +1616,9 @@ pub fn serve( .and(warp::path("duties")) .and(warp::path("proposer")) .and(warp::path::param::().or_else(|_| async { - Err(warp_utils::reject::custom_bad_request( - "Invalid epoch".to_string(), - )) + Err(warp_utils::reject::custom_bad_request( + "Invalid epoch".to_string(), + )) })) .and(warp::path::end()) .and(not_while_syncing_filter.clone()) @@ -1637,7 +1643,7 @@ pub fn serve( if epoch == current_epoch { let dependent_root_slot = current_epoch .start_slot(T::EthSpec::slots_per_epoch()) - 1; - let dependent_root = if dependent_root_slot > chain.best_slot().map_err(warp_utils::reject::beacon_chain_error)? { + let dependent_root = if dependent_root_slot > chain.best_slot().map_err(warp_utils::reject::beacon_chain_error)? { chain.head_beacon_block_root().map_err(warp_utils::reject::beacon_chain_error)? } else { chain @@ -1649,7 +1655,7 @@ pub fn serve( beacon_proposer_cache .lock() .get_proposers(&chain, epoch) - .map(|duties| api_types::DutiesResponse{ data: duties, dependent_root} ) + .map(|duties| api_types::DutiesResponse { data: duties, dependent_root }) } else { let state = StateId::slot(epoch.start_slot(T::EthSpec::slots_per_epoch())) @@ -1657,7 +1663,7 @@ pub fn serve( let dependent_root_slot = state.current_epoch() .start_slot(T::EthSpec::slots_per_epoch()) - 1; - let dependent_root = if dependent_root_slot > chain.best_slot().map_err(warp_utils::reject::beacon_chain_error)? { + let dependent_root = if dependent_root_slot > chain.best_slot().map_err(warp_utils::reject::beacon_chain_error)? { chain.head_beacon_block_root().map_err(warp_utils::reject::beacon_chain_error)? } else { chain @@ -1691,8 +1697,7 @@ pub fn serve( }) .collect::, _>>() .map(|duties| { - - api_types::DutiesResponse{ + api_types::DutiesResponse { dependent_root, data: duties, } @@ -2053,7 +2058,7 @@ pub fn serve( "attestation_slot" => aggregate.message.aggregate.data.slot, ); failures.push(api_types::Failure::new(index, format!("Verification: {:?}", e))); - }, + } } } @@ -2087,7 +2092,7 @@ pub fn serve( if !failures.is_empty() { Err(warp_utils::reject::indexed_bad_request("error processing aggregate and proofs".to_string(), - failures + failures, )) } else { Ok(()) @@ -2358,23 +2363,27 @@ pub fn serve( }) }); - fn merge_streams( - stream_map: StreamMap< - String, - impl Stream, RecvError>> + Unpin + Send + 'static, - >, - ) -> impl Stream> - + Send - + 'static { - // Convert messages into Server-Sent Events and return resulting stream. - stream_map.map(move |(topic_name, msg)| match msg { - Ok(data) => Ok((warp::sse::event(topic_name), warp::sse::json(data)).boxed()), - Err(e) => Err(warp_utils::reject::server_sent_event_error(format!( - "{:?}", - e - ))), - }) - } + // fn stream_events(mut receiver: Receiver>) + // -> impl Stream, RecvError>> + Unpin + Send + 'static where ::MaxValidatorsPerCommittee: Unpin + // { + // async_stream::try_stream! { + // loop { + // let event = receiver.recv().await?; + // yield event; + // } + // } + // } + // + // fn merge_streams( + // stream_map: StreamMap< + // String, + // impl Stream, RecvError>> + Send + Unpin + 'static, + // >, + // ) -> impl Stream> + 'static { + // + // // Convert messages into Server-Sent Events and return resulting stream. + // stream_map + // } let get_events = eth1_v1 .and(warp::path("events")) @@ -2385,7 +2394,7 @@ pub fn serve( |topics: api_types::EventQuery, chain: Arc>| { blocking_task(move || { // for each topic subscribed spawn a new subscription - let mut stream_map = StreamMap::with_capacity(topics.topics.0.len()); + let mut receivers = Vec::with_capacity(topics.topics.0.len()); if let Some(event_handler) = chain.event_handler.as_ref() { for topic in topics.topics.0.clone() { @@ -2402,7 +2411,24 @@ pub fn serve( event_handler.subscribe_finalized() } }; - stream_map.insert(topic.to_string(), Box::pin(receiver.into_stream())); + + receivers.push(broadcast_stream::BroadcastStream::new(receiver).map( + |(msg)| { + match msg { + Ok(data) => Event::default() + .event(data.topic_name()) + .json_data(data) + .map_err(|e| { + warp_utils::reject::server_sent_event_error( + format!("{:?}", e), + ) + }), + Err(e) => Err(warp_utils::reject::server_sent_event_error( + format!("{:?}", e), + )), + } + }, + )); } } else { return Err(warp_utils::reject::custom_server_error( @@ -2410,11 +2436,9 @@ pub fn serve( )); } - let stream = merge_streams(stream_map); + let s = futures::stream::select_all(receivers); - Ok::<_, warp::Rejection>(warp::sse::reply( - warp::sse::keep_alive().stream(stream), - )) + Ok::<_, warp::Rejection>(warp::sse::reply(warp::sse::keep_alive().stream(s))) }) }, ); diff --git a/beacon_node/network/src/router/mod.rs b/beacon_node/network/src/router/mod.rs index f3d91970ea6..0805b34394e 100644 --- a/beacon_node/network/src/router/mod.rs +++ b/beacon_node/network/src/router/mod.rs @@ -19,9 +19,9 @@ use processor::Processor; use slog::{debug, o, trace}; use std::sync::Arc; use tokio::sync::mpsc; -use types::EthSpec; -use tokio_stream::{Stream, StreamExt, wrappers::UnboundedReceiverStream}; +use tokio_stream::{wrappers::UnboundedReceiverStream, Stream, StreamExt}; use types::Error::UnableToDetermineProducer; +use types::EthSpec; /// Handles messages received from the network and client and organises syncing. This /// functionality of this struct is to validate an decode messages from the network before diff --git a/beacon_node/src/lib.rs b/beacon_node/src/lib.rs index 7671c15ea22..903ebd2ad1a 100644 --- a/beacon_node/src/lib.rs +++ b/beacon_node/src/lib.rs @@ -44,7 +44,10 @@ impl ProductionBeaconNode { pub async fn new_from_cli( context: RuntimeContext, matches: ArgMatches<'static>, - ) -> Result { + ) -> Result + where + ::MaxValidatorsPerCommittee: Unpin, + { let client_config = get_config::(&matches, &context.eth2_config().spec, context.log().clone())?; Self::new(context, client_config).await @@ -56,7 +59,10 @@ impl ProductionBeaconNode { pub async fn new( context: RuntimeContext, mut client_config: ClientConfig, - ) -> Result { + ) -> Result + where + ::MaxValidatorsPerCommittee: Unpin, + { let spec = context.eth2_config().spec.clone(); let client_config_1 = client_config.clone(); let client_genesis = client_config.genesis.clone(); diff --git a/boot_node/src/server.rs b/boot_node/src/server.rs index 14f37113690..8900df064f7 100644 --- a/boot_node/src/server.rs +++ b/boot_node/src/server.rs @@ -78,7 +78,7 @@ pub async fn run(config: BootNodeConfig, log: slog::Logger) { // listen for events loop { tokio::select! { - _ = metric_interval.next() => { + _ = metric_interval.tick() => { // display server metrics let metrics = discv5.metrics(); info!(log, "Server metrics"; "connected_peers" => discv5.connected_peers(), "active_sessions" => metrics.active_sessions, "requests/s" => format!("{:.2}", metrics.unsolicited_requests_per_second)); diff --git a/common/eth2/src/types.rs b/common/eth2/src/types.rs index 49719a4c294..f905025be04 100644 --- a/common/eth2/src/types.rs +++ b/common/eth2/src/types.rs @@ -682,6 +682,16 @@ pub enum EventKind { } impl EventKind { + pub fn topic_name(&self) -> &str { + match self { + EventKind::Head(_) => "head", + EventKind::Block(_) => "block", + EventKind::Attestation(_) => "attestation", + EventKind::VoluntaryExit(_) => "voluntary_exit", + EventKind::FinalizedCheckpoint(_) => "finalized_checkpoint", + } + } + pub fn from_sse_bytes(message: &[u8]) -> Result { let s = from_utf8(message) .map_err(|e| ServerError::InvalidServerSentEvent(format!("{:?}", e)))?; diff --git a/lighthouse/src/main.rs b/lighthouse/src/main.rs index a3344d124a4..32d62075e95 100644 --- a/lighthouse/src/main.rs +++ b/lighthouse/src/main.rs @@ -190,7 +190,10 @@ fn run( environment_builder: EnvironmentBuilder, matches: &ArgMatches, testnet_config: Eth2NetworkConfig, -) -> Result<(), String> { +) -> Result<(), String> +where + ::MaxValidatorsPerCommittee: Unpin, +{ if std::mem::size_of::() != 8 { return Err(format!( "{}-bit architecture is not supported (64-bit only).", diff --git a/slasher/service/src/service.rs b/slasher/service/src/service.rs index fa2803e8f6c..51e81ab18f6 100644 --- a/slasher/service/src/service.rs +++ b/slasher/service/src/service.rs @@ -19,9 +19,9 @@ use state_processing::{ use std::sync::mpsc::{sync_channel, Receiver, SyncSender, TrySendError}; use std::sync::Arc; use task_executor::TaskExecutor; -use tokio_stream::StreamExt; use tokio::sync::mpsc::UnboundedSender; use tokio::time::{interval_at, Duration, Instant}; +use tokio_stream::StreamExt; use types::{AttesterSlashing, Epoch, EthSpec, ProposerSlashing}; pub struct SlasherService { @@ -84,7 +84,8 @@ impl SlasherService { let mut interval = interval_at(Instant::now(), Duration::from_secs(update_period)); loop { - interval.tick().await; if let Some(current_slot) = beacon_chain.slot_clock.now() { + interval.tick().await; + if let Some(current_slot) = beacon_chain.slot_clock.now() { let current_epoch = current_slot.epoch(T::EthSpec::slots_per_epoch()); if let Err(TrySendError::Disconnected(_)) = notif_sender.try_send(current_epoch) { break; diff --git a/testing/simulator/src/eth1_sim.rs b/testing/simulator/src/eth1_sim.rs index 5b98c1d74d1..a2ba87d91f2 100644 --- a/testing/simulator/src/eth1_sim.rs +++ b/testing/simulator/src/eth1_sim.rs @@ -90,7 +90,8 @@ pub fn run_eth1_sim(matches: &ArgMatches) -> Result<(), String> { tokio::spawn(async move { let mut interval = tokio::time::interval(eth1_block_time); loop { - interval.tick().await; let _ = ganache.evm_mine().await; + interval.tick().await; + let _ = ganache.evm_mine().await; } }); diff --git a/testing/simulator/src/sync_sim.rs b/testing/simulator/src/sync_sim.rs index 0542abf0e38..5992552327a 100644 --- a/testing/simulator/src/sync_sim.rs +++ b/testing/simulator/src/sync_sim.rs @@ -217,8 +217,9 @@ pub async fn verify_one_node_sync( // limited to at most `sync_timeout` epochs let mut interval = tokio::time::interval(epoch_duration); let mut count = 0; - loop { - interval.tick().await; if count >= sync_timeout || !check_still_syncing(&network_c).await? { + loop { + interval.tick().await; + if count >= sync_timeout || !check_still_syncing(&network_c).await? { break; } count += 1; @@ -254,8 +255,9 @@ pub async fn verify_two_nodes_sync( // limited to at most `sync_timeout` epochs let mut interval = tokio::time::interval(epoch_duration); let mut count = 0; - loop { - interval.tick().await; if count >= sync_timeout || !check_still_syncing(&network_c).await? { + loop { + interval.tick().await; + if count >= sync_timeout || !check_still_syncing(&network_c).await? { break; } count += 1; @@ -302,8 +304,9 @@ pub async fn verify_in_between_sync( // limited to at most `sync_timeout` epochs let mut interval = tokio::time::interval(epoch_duration); let mut count = 0; - loop { - interval.tick().await; if count >= sync_timeout || !check_still_syncing(&network_c).await? { + loop { + interval.tick().await; + if count >= sync_timeout || !check_still_syncing(&network_c).await? { break; } count += 1; diff --git a/validator_client/src/attestation_service.rs b/validator_client/src/attestation_service.rs index 7b4d2ba1ef8..45c0ac98837 100644 --- a/validator_client/src/attestation_service.rs +++ b/validator_client/src/attestation_service.rs @@ -150,7 +150,8 @@ impl AttestationService { let interval_fut = async move { loop { - interval.tick().await; let log = self.context.log(); + interval.tick().await; + let log = self.context.log(); if let Err(e) = self.spawn_attestation_tasks(slot_duration) { crit!( diff --git a/validator_client/src/duties_service.rs b/validator_client/src/duties_service.rs index f43dd2d8d01..7ec1a86e43f 100644 --- a/validator_client/src/duties_service.rs +++ b/validator_client/src/duties_service.rs @@ -491,7 +491,8 @@ impl DutiesService { let interval_fut = async move { loop { - interval.tick().await; self.clone().do_update(&mut block_service_tx, &spec).await; + interval.tick().await; + self.clone().do_update(&mut block_service_tx, &spec).await; } }; diff --git a/validator_client/src/fork_service.rs b/validator_client/src/fork_service.rs index 0fdde80e4bc..7ba3fb6dd06 100644 --- a/validator_client/src/fork_service.rs +++ b/validator_client/src/fork_service.rs @@ -165,7 +165,8 @@ impl ForkService { let interval_fut = async move { loop { - interval.tick().await; self.clone().do_update().await.ok(); + interval.tick().await; + self.clone().do_update().await.ok(); } }; diff --git a/validator_client/src/notifier.rs b/validator_client/src/notifier.rs index 2feb079d9d6..db3be272880 100644 --- a/validator_client/src/notifier.rs +++ b/validator_client/src/notifier.rs @@ -24,7 +24,7 @@ pub fn spawn_notifier(client: &ProductionValidatorClient) -> Resu let interval_fut = async move { let log = context.log(); - loop { + loop { let num_available = duties_service.beacon_nodes.num_available().await; let num_synced = duties_service.beacon_nodes.num_synced().await; let num_total = duties_service.beacon_nodes.num_total().await; From ee723dfc66a243dd96b11215fdfd9f1d8264a2f0 Mon Sep 17 00:00:00 2001 From: realbigsean Date: Mon, 25 Jan 2021 09:09:28 -0500 Subject: [PATCH 03/17] update `MaxValidatorsPerCommitte` to be `Unpin` --- beacon_node/client/src/builder.rs | 6 ++---- beacon_node/eth2_libp2p/src/rpc/protocol.rs | 1 - beacon_node/eth2_libp2p/src/rpc/rate_limiter.rs | 1 - beacon_node/http_api/src/lib.rs | 3 +-- beacon_node/src/lib.rs | 6 ++---- consensus/types/src/eth_spec.rs | 2 +- lighthouse/src/main.rs | 3 +-- 7 files changed, 7 insertions(+), 15 deletions(-) diff --git a/beacon_node/client/src/builder.rs b/beacon_node/client/src/builder.rs index 99920482cec..8628a66512d 100644 --- a/beacon_node/client/src/builder.rs +++ b/beacon_node/client/src/builder.rs @@ -116,8 +116,7 @@ where client_genesis: ClientGenesis, config: ClientConfig, ) -> Result - where - ::MaxValidatorsPerCommittee: Unpin, + { let store = self.store.clone(); let chain_spec = self.chain_spec.clone(); @@ -417,8 +416,7 @@ where pub fn build( self, ) -> Result>, String> - where - ::MaxValidatorsPerCommittee: Unpin, + { let runtime_context = self .runtime_context diff --git a/beacon_node/eth2_libp2p/src/rpc/protocol.rs b/beacon_node/eth2_libp2p/src/rpc/protocol.rs index de86097d1a2..96bc41c5d82 100644 --- a/beacon_node/eth2_libp2p/src/rpc/protocol.rs +++ b/beacon_node/eth2_libp2p/src/rpc/protocol.rs @@ -18,7 +18,6 @@ use std::io; use std::marker::PhantomData; use std::time::Duration; use strum::{AsStaticRef, AsStaticStr}; -use tokio::io::AsyncReadExt; use tokio_io_timeout::TimeoutStream; use tokio_util::{ codec::Framed, diff --git a/beacon_node/eth2_libp2p/src/rpc/rate_limiter.rs b/beacon_node/eth2_libp2p/src/rpc/rate_limiter.rs index a64e4c348c5..8e096f8164d 100644 --- a/beacon_node/eth2_libp2p/src/rpc/rate_limiter.rs +++ b/beacon_node/eth2_libp2p/src/rpc/rate_limiter.rs @@ -1,6 +1,5 @@ use crate::rpc::{Protocol, RPCRequest}; use fnv::FnvHashMap; -use futures::StreamExt; use libp2p::PeerId; use std::convert::TryInto; use std::future::Future; diff --git a/beacon_node/http_api/src/lib.rs b/beacon_node/http_api/src/lib.rs index 0dbaadb6812..2b473dd7975 100644 --- a/beacon_node/http_api/src/lib.rs +++ b/beacon_node/http_api/src/lib.rs @@ -218,8 +218,7 @@ pub fn serve( ctx: Arc>, shutdown: impl Future + Send + Sync + 'static, ) -> Result<(SocketAddr, impl Future), Error> -where - <::EthSpec as EthSpec>::MaxValidatorsPerCommittee: Unpin, + { let config = ctx.config.clone(); let log = ctx.log.clone(); diff --git a/beacon_node/src/lib.rs b/beacon_node/src/lib.rs index 903ebd2ad1a..eb710f0f7a4 100644 --- a/beacon_node/src/lib.rs +++ b/beacon_node/src/lib.rs @@ -45,8 +45,7 @@ impl ProductionBeaconNode { context: RuntimeContext, matches: ArgMatches<'static>, ) -> Result - where - ::MaxValidatorsPerCommittee: Unpin, + { let client_config = get_config::(&matches, &context.eth2_config().spec, context.log().clone())?; @@ -60,8 +59,7 @@ impl ProductionBeaconNode { context: RuntimeContext, mut client_config: ClientConfig, ) -> Result - where - ::MaxValidatorsPerCommittee: Unpin, + { let spec = context.eth2_config().spec.clone(); let client_config_1 = client_config.clone(); diff --git a/consensus/types/src/eth_spec.rs b/consensus/types/src/eth_spec.rs index 9eeee557f89..3cd5555a2c2 100644 --- a/consensus/types/src/eth_spec.rs +++ b/consensus/types/src/eth_spec.rs @@ -56,7 +56,7 @@ pub trait EthSpec: 'static + Default + Sync + Send + Clone + Debug + PartialEq + /* * Misc */ - type MaxValidatorsPerCommittee: Unsigned + Clone + Sync + Send + Debug + PartialEq + Eq; + type MaxValidatorsPerCommittee: Unsigned + Clone + Sync + Send + Debug + PartialEq + Eq + Unpin; /* * Time parameters */ diff --git a/lighthouse/src/main.rs b/lighthouse/src/main.rs index 32d62075e95..0252a39a70d 100644 --- a/lighthouse/src/main.rs +++ b/lighthouse/src/main.rs @@ -191,8 +191,7 @@ fn run( matches: &ArgMatches, testnet_config: Eth2NetworkConfig, ) -> Result<(), String> -where - ::MaxValidatorsPerCommittee: Unpin, + { if std::mem::size_of::() != 8 { return Err(format!( From 8ca209209dd0578619172df3c2a935d8cd8ee5e9 Mon Sep 17 00:00:00 2001 From: realbigsean Date: Mon, 25 Jan 2021 09:46:55 -0500 Subject: [PATCH 04/17] compile tests --- beacon_node/eth2_libp2p/tests/rpc_tests.rs | 4 +- beacon_node/http_api/tests/tests.rs | 87 +++++----------------- 2 files changed, 22 insertions(+), 69 deletions(-) diff --git a/beacon_node/eth2_libp2p/tests/rpc_tests.rs b/beacon_node/eth2_libp2p/tests/rpc_tests.rs index 29abd14fe33..b4fdde81189 100644 --- a/beacon_node/eth2_libp2p/tests/rpc_tests.rs +++ b/beacon_node/eth2_libp2p/tests/rpc_tests.rs @@ -313,7 +313,7 @@ fn test_blocks_by_range_chunked_rpc_terminates_correctly() { // sent in the timeout match futures::future::select( Box::pin(receiver.next_event()), - tokio::time::sleep(Duration::from_secs(1)), + Box::pin(tokio::time::sleep(Duration::from_secs(1))), ) .await { @@ -688,7 +688,7 @@ fn test_blocks_by_root_chunked_rpc_terminates_correctly() { // sent in the timeout match futures::future::select( Box::pin(receiver.next_event()), - tokio::time::sleep(Duration::from_millis(1000)), + Box::pin(tokio::time::sleep(Duration::from_secs(1))), ) .await { diff --git a/beacon_node/http_api/tests/tests.rs b/beacon_node/http_api/tests/tests.rs index dedfe400afa..e7b58179640 100644 --- a/beacon_node/http_api/tests/tests.rs +++ b/beacon_node/http_api/tests/tests.rs @@ -25,12 +25,12 @@ use std::sync::Arc; use tokio::sync::mpsc; use tokio::sync::oneshot; use tokio::time::Duration; -use tokio_compat_02::FutureExt; use tree_hash::TreeHash; use types::{ test_utils::generate_deterministic_keypairs, AggregateSignature, BeaconState, BitList, Domain, EthSpec, Hash256, Keypair, MainnetEthSpec, RelativeEpoch, SelectionProof, SignedRoot, Slot, }; +use futures::FutureExt; type E = MainnetEthSpec; @@ -933,7 +933,11 @@ impl ApiTester { self.client.post_beacon_blocks(next_block).await.unwrap(); assert!( - self.network_rx.try_recv().is_ok(), + self.network_rx.recv().now_or_never().is_some(), + "valid blocks should be sent to network" + ); + assert!( + self.network_rx.recv().now_or_never().is_some(), "valid blocks should be sent to network" ); @@ -947,7 +951,7 @@ impl ApiTester { assert!(self.client.post_beacon_blocks(&next_block).await.is_err()); assert!( - self.network_rx.try_recv().is_ok(), + self.network_rx.recv().now_or_never().is_some(), "invalid blocks should be sent to network" ); @@ -997,7 +1001,7 @@ impl ApiTester { .unwrap(); assert!( - self.network_rx.try_recv().is_ok(), + self.network_rx.recv().now_or_never().is_some(), "valid attestation should be sent to network" ); @@ -1034,7 +1038,7 @@ impl ApiTester { } assert!( - self.network_rx.try_recv().is_ok(), + self.network_rx.recv().now_or_never().is_some(), "if some attestations are valid, we should send them to the network" ); @@ -1064,7 +1068,7 @@ impl ApiTester { .unwrap(); assert!( - self.network_rx.try_recv().is_ok(), + self.network_rx.recv().now_or_never().is_some(), "valid attester slashing should be sent to network" ); @@ -1081,7 +1085,7 @@ impl ApiTester { .unwrap_err(); assert!( - self.network_rx.try_recv().is_err(), + self.network_rx.recv().now_or_never().is_none(), "invalid attester slashing should not be sent to network" ); @@ -1110,7 +1114,7 @@ impl ApiTester { .unwrap(); assert!( - self.network_rx.try_recv().is_ok(), + self.network_rx.recv().now_or_never().is_some(), "valid proposer slashing should be sent to network" ); @@ -1127,7 +1131,7 @@ impl ApiTester { .unwrap_err(); assert!( - self.network_rx.try_recv().is_err(), + self.network_rx.recv().now_or_never().is_none(), "invalid proposer slashing should not be sent to network" ); @@ -1156,7 +1160,7 @@ impl ApiTester { .unwrap(); assert!( - self.network_rx.try_recv().is_ok(), + self.network_rx.recv().now_or_never().is_some(), "valid exit should be sent to network" ); @@ -1173,7 +1177,7 @@ impl ApiTester { .unwrap_err(); assert!( - self.network_rx.try_recv().is_err(), + self.network_rx.recv().now_or_never().is_none(), "invalid exit should not be sent to network" ); @@ -1822,7 +1826,7 @@ impl ApiTester { .await .unwrap(); - assert!(self.network_rx.try_recv().is_ok()); + assert!(self.network_rx.recv().now_or_never().is_some()); self } @@ -1837,7 +1841,7 @@ impl ApiTester { .await .unwrap_err(); - assert!(self.network_rx.try_recv().is_err()); + assert!(self.network_rx.recv().now_or_never().is_none()); self } @@ -1856,7 +1860,7 @@ impl ApiTester { .await .unwrap(); - self.network_rx.try_recv().unwrap(); + self.network_rx.recv().now_or_never().unwrap(); self } @@ -2127,20 +2131,18 @@ async fn poll_events, eth2::Error>> + Unpin #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn get_events() { - ApiTester::new().test_get_events().compat().await; + ApiTester::new().test_get_events().await; } #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn get_events_from_genesis() { ApiTester::new_from_genesis() .test_get_events_from_genesis() - .compat() .await; } #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn beacon_get() { - async { ApiTester::new() .test_beacon_genesis() .await @@ -2178,16 +2180,12 @@ async fn beacon_get() { .await .test_get_beacon_pool_voluntary_exits() .await; - } - .compat() - .await; } #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn post_beacon_blocks_valid() { ApiTester::new() .test_post_beacon_blocks_valid() - .compat() .await; } @@ -2195,7 +2193,6 @@ async fn post_beacon_blocks_valid() { async fn post_beacon_blocks_invalid() { ApiTester::new() .test_post_beacon_blocks_invalid() - .compat() .await; } @@ -2203,7 +2200,6 @@ async fn post_beacon_blocks_invalid() { async fn beacon_pools_post_attestations_valid() { ApiTester::new() .test_post_beacon_pool_attestations_valid() - .compat() .await; } @@ -2211,7 +2207,6 @@ async fn beacon_pools_post_attestations_valid() { async fn beacon_pools_post_attestations_invalid() { ApiTester::new() .test_post_beacon_pool_attestations_invalid() - .compat() .await; } @@ -2219,7 +2214,6 @@ async fn beacon_pools_post_attestations_invalid() { async fn beacon_pools_post_attester_slashings_valid() { ApiTester::new() .test_post_beacon_pool_attester_slashings_valid() - .compat() .await; } @@ -2227,7 +2221,6 @@ async fn beacon_pools_post_attester_slashings_valid() { async fn beacon_pools_post_attester_slashings_invalid() { ApiTester::new() .test_post_beacon_pool_attester_slashings_invalid() - .compat() .await; } @@ -2235,7 +2228,6 @@ async fn beacon_pools_post_attester_slashings_invalid() { async fn beacon_pools_post_proposer_slashings_valid() { ApiTester::new() .test_post_beacon_pool_proposer_slashings_valid() - .compat() .await; } @@ -2243,7 +2235,6 @@ async fn beacon_pools_post_proposer_slashings_valid() { async fn beacon_pools_post_proposer_slashings_invalid() { ApiTester::new() .test_post_beacon_pool_proposer_slashings_invalid() - .compat() .await; } @@ -2251,7 +2242,6 @@ async fn beacon_pools_post_proposer_slashings_invalid() { async fn beacon_pools_post_voluntary_exits_valid() { ApiTester::new() .test_post_beacon_pool_voluntary_exits_valid() - .compat() .await; } @@ -2259,7 +2249,6 @@ async fn beacon_pools_post_voluntary_exits_valid() { async fn beacon_pools_post_voluntary_exits_invalid() { ApiTester::new() .test_post_beacon_pool_voluntary_exits_invalid() - .compat() .await; } @@ -2267,13 +2256,10 @@ async fn beacon_pools_post_voluntary_exits_invalid() { async fn config_get() { ApiTester::new() .test_get_config_fork_schedule() - .compat() .await .test_get_config_spec() - .compat() .await .test_get_config_deposit_contract() - .compat() .await; } @@ -2281,10 +2267,8 @@ async fn config_get() { async fn debug_get() { ApiTester::new() .test_get_debug_beacon_states() - .compat() .await .test_get_debug_beacon_heads() - .compat() .await; } @@ -2292,25 +2276,18 @@ async fn debug_get() { async fn node_get() { ApiTester::new() .test_get_node_version() - .compat() .await .test_get_node_syncing() - .compat() .await .test_get_node_identity() - .compat() .await .test_get_node_health() - .compat() .await .test_get_node_peers_by_id() - .compat() .await .test_get_node_peers() - .compat() .await .test_get_node_peer_count() - .compat() .await; } @@ -2318,7 +2295,6 @@ async fn node_get() { async fn get_validator_duties_attester() { ApiTester::new() .test_get_validator_duties_attester() - .compat() .await; } @@ -2327,7 +2303,6 @@ async fn get_validator_duties_attester_with_skip_slots() { ApiTester::new() .skip_slots(E::slots_per_epoch() * 2) .test_get_validator_duties_attester() - .compat() .await; } @@ -2335,7 +2310,6 @@ async fn get_validator_duties_attester_with_skip_slots() { async fn get_validator_duties_proposer() { ApiTester::new() .test_get_validator_duties_proposer() - .compat() .await; } @@ -2344,13 +2318,12 @@ async fn get_validator_duties_proposer_with_skip_slots() { ApiTester::new() .skip_slots(E::slots_per_epoch() * 2) .test_get_validator_duties_proposer() - .compat() .await; } #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn block_production() { - ApiTester::new().test_block_production().compat().await; + ApiTester::new().test_block_production().await; } #[tokio::test(flavor = "multi_thread", worker_threads = 2)] @@ -2358,7 +2331,6 @@ async fn block_production_with_skip_slots() { ApiTester::new() .skip_slots(E::slots_per_epoch() * 2) .test_block_production() - .compat() .await; } @@ -2366,7 +2338,6 @@ async fn block_production_with_skip_slots() { async fn get_validator_attestation_data() { ApiTester::new() .test_get_validator_attestation_data() - .compat() .await; } @@ -2375,7 +2346,6 @@ async fn get_validator_attestation_data_with_skip_slots() { ApiTester::new() .skip_slots(E::slots_per_epoch() * 2) .test_get_validator_attestation_data() - .compat() .await; } @@ -2383,7 +2353,6 @@ async fn get_validator_attestation_data_with_skip_slots() { async fn get_validator_aggregate_attestation() { ApiTester::new() .test_get_validator_aggregate_attestation() - .compat() .await; } @@ -2392,7 +2361,6 @@ async fn get_validator_aggregate_attestation_with_skip_slots() { ApiTester::new() .skip_slots(E::slots_per_epoch() * 2) .test_get_validator_aggregate_attestation() - .compat() .await; } @@ -2400,7 +2368,6 @@ async fn get_validator_aggregate_attestation_with_skip_slots() { async fn get_validator_aggregate_and_proofs_valid() { ApiTester::new() .test_get_validator_aggregate_and_proofs_valid() - .compat() .await; } @@ -2409,7 +2376,6 @@ async fn get_validator_aggregate_and_proofs_valid_with_skip_slots() { ApiTester::new() .skip_slots(E::slots_per_epoch() * 2) .test_get_validator_aggregate_and_proofs_valid() - .compat() .await; } @@ -2417,7 +2383,6 @@ async fn get_validator_aggregate_and_proofs_valid_with_skip_slots() { async fn get_validator_aggregate_and_proofs_invalid() { ApiTester::new() .test_get_validator_aggregate_and_proofs_invalid() - .compat() .await; } @@ -2426,7 +2391,6 @@ async fn get_validator_aggregate_and_proofs_invalid_with_skip_slots() { ApiTester::new() .skip_slots(E::slots_per_epoch() * 2) .test_get_validator_aggregate_and_proofs_invalid() - .compat() .await; } @@ -2434,7 +2398,6 @@ async fn get_validator_aggregate_and_proofs_invalid_with_skip_slots() { async fn get_validator_beacon_committee_subscriptions() { ApiTester::new() .test_get_validator_beacon_committee_subscriptions() - .compat() .await; } @@ -2442,33 +2405,23 @@ async fn get_validator_beacon_committee_subscriptions() { async fn lighthouse_endpoints() { ApiTester::new() .test_get_lighthouse_health() - .compat() .await .test_get_lighthouse_syncing() - .compat() .await .test_get_lighthouse_proto_array() - .compat() .await .test_get_lighthouse_validator_inclusion() - .compat() .await .test_get_lighthouse_validator_inclusion_global() - .compat() .await .test_get_lighthouse_eth1_syncing() - .compat() .await .test_get_lighthouse_eth1_block_cache() - .compat() .await .test_get_lighthouse_eth1_deposit_cache() - .compat() .await .test_get_lighthouse_beacon_states_ssz() - .compat() .await .test_get_lighthouse_staking() - .compat() .await; } From bc1a8688e4cabad2ffc3d89d0e98c589a5ea98d5 Mon Sep 17 00:00:00 2001 From: realbigsean Date: Mon, 25 Jan 2021 13:01:14 -0500 Subject: [PATCH 05/17] revert compat removal for web3 tests --- Cargo.lock | 60 ++++++++++--------- account_manager/Cargo.toml | 1 - account_manager/src/validator/exit.rs | 4 +- beacon_node/Cargo.toml | 3 +- beacon_node/client/src/notifier.rs | 37 ++++++------ beacon_node/eth1/src/service.rs | 2 +- beacon_node/eth2_libp2p/Cargo.toml | 4 +- beacon_node/eth2_libp2p/src/rpc/protocol.rs | 2 +- beacon_node/http_api/Cargo.toml | 1 - beacon_node/http_api/src/lib.rs | 12 ++-- beacon_node/http_api/tests/tests.rs | 21 +++---- beacon_node/http_metrics/Cargo.toml | 1 - beacon_node/http_metrics/tests/tests.rs | 2 - beacon_node/network/src/router/mod.rs | 3 +- beacon_node/tests/test.rs | 6 +- beacon_node/timer/src/lib.rs | 1 - boot_node/src/server.rs | 1 - common/rest_types/Cargo.toml | 2 +- common/task_executor/Cargo.toml | 1 - common/task_executor/src/lib.rs | 8 +-- lcli/src/eth1_genesis.rs | 4 +- lighthouse/src/main.rs | 7 +-- remote_signer/client/Cargo.toml | 2 +- slasher/service/src/service.rs | 1 - testing/remote_signer_test/Cargo.toml | 1 - .../remote_signer_test/src/api_test_signer.rs | 4 +- testing/remote_signer_test/src/consumer.rs | 4 +- testing/simulator/Cargo.toml | 1 - testing/simulator/src/eth1_sim.rs | 2 +- testing/simulator/src/no_eth1_sim.rs | 2 +- testing/simulator/src/sync_sim.rs | 2 +- validator_client/Cargo.toml | 3 +- validator_client/src/attestation_service.rs | 1 - validator_client/src/duties_service.rs | 2 +- validator_client/src/fork_service.rs | 1 - validator_client/src/http_api/tests.rs | 16 ++--- validator_client/src/notifier.rs | 3 +- 37 files changed, 96 insertions(+), 132 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c484c502d55..56e3c195b1f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -32,7 +32,6 @@ dependencies = [ "slot_clock", "tempfile", "tokio 1.0.2", - "tokio-compat-02", "types", "validator_dir", ] @@ -666,7 +665,7 @@ dependencies = [ "futures 0.3.12", "genesis", "hex", - "hyper 0.13.9", + "hyper 0.14.2", "lighthouse_version", "logging", "node_test_rig", @@ -679,7 +678,6 @@ dependencies = [ "store", "task_executor", "tokio 1.0.2", - "tokio-compat-02", "types", ] @@ -2852,7 +2850,6 @@ dependencies = [ "state_processing", "store", "tokio 1.0.2", - "tokio-compat-02", "tokio-stream", "tree_hash", "types", @@ -2878,7 +2875,6 @@ dependencies = [ "slot_clock", "store", "tokio 1.0.2", - "tokio-compat-02", "types", "warp", "warp_utils", @@ -3423,8 +3419,9 @@ dependencies = [ [[package]] name = "libp2p" -version = "0.35.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=bbd3df64ed4cc99a5ddac47ab53673161c70e6da#bbd3df64ed4cc99a5ddac47ab53673161c70e6da" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5133112ce42be9482f6a87be92a605dd6bbc9e93c297aee77d172ff06908f3a" dependencies = [ "atomic", "bytes 1.0.1", @@ -3486,7 +3483,8 @@ dependencies = [ [[package]] name = "libp2p-core" version = "0.27.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=bbd3df64ed4cc99a5ddac47ab53673161c70e6da#bbd3df64ed4cc99a5ddac47ab53673161c70e6da" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dad04d3cef6c1df366a6ab58c9cf8b06497699e335d83ac2174783946ff847d6" dependencies = [ "asn1_der", "bs58 0.4.0", @@ -3519,7 +3517,8 @@ dependencies = [ [[package]] name = "libp2p-core-derive" version = "0.21.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=bbd3df64ed4cc99a5ddac47ab53673161c70e6da#bbd3df64ed4cc99a5ddac47ab53673161c70e6da" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4bc40943156e42138d22ed3c57ff0e1a147237742715937622a99b10fbe0156" dependencies = [ "quote", "syn", @@ -3528,7 +3527,8 @@ dependencies = [ [[package]] name = "libp2p-dns" version = "0.27.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=bbd3df64ed4cc99a5ddac47ab53673161c70e6da#bbd3df64ed4cc99a5ddac47ab53673161c70e6da" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5153b6db68fd4baa3b304e377db744dd8fea8ff4e4504509ee636abcde88d3e3" dependencies = [ "futures 0.3.12", "libp2p-core 0.27.0", @@ -3537,8 +3537,9 @@ dependencies = [ [[package]] name = "libp2p-gossipsub" -version = "0.28.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=bbd3df64ed4cc99a5ddac47ab53673161c70e6da#bbd3df64ed4cc99a5ddac47ab53673161c70e6da" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12451ba9493e87c91baf2a6dffce9ddf1fbc807a0861532d7cf477954f8ebbee" dependencies = [ "asynchronous-codec", "base64 0.13.0", @@ -3563,7 +3564,8 @@ dependencies = [ [[package]] name = "libp2p-identify" version = "0.27.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=bbd3df64ed4cc99a5ddac47ab53673161c70e6da#bbd3df64ed4cc99a5ddac47ab53673161c70e6da" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b40fb36a059b7a8cce1514bd8b546fa612e006c9937caa7f5950cb20021fe91e" dependencies = [ "futures 0.3.12", "libp2p-core 0.27.0", @@ -3578,7 +3580,8 @@ dependencies = [ [[package]] name = "libp2p-mplex" version = "0.27.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=bbd3df64ed4cc99a5ddac47ab53673161c70e6da#bbd3df64ed4cc99a5ddac47ab53673161c70e6da" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2705dc94b01ab9e3779b42a09bbf3712e637ed213e875c30face247291a85af0" dependencies = [ "asynchronous-codec", "bytes 1.0.1", @@ -3595,7 +3598,8 @@ dependencies = [ [[package]] name = "libp2p-noise" version = "0.29.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=bbd3df64ed4cc99a5ddac47ab53673161c70e6da#bbd3df64ed4cc99a5ddac47ab53673161c70e6da" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4aca322b52a0c5136142a7c3971446fb1e9964923a526c9cc6ef3b7c94e57778" dependencies = [ "bytes 1.0.1", "curve25519-dalek", @@ -3616,7 +3620,8 @@ dependencies = [ [[package]] name = "libp2p-swarm" version = "0.27.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=bbd3df64ed4cc99a5ddac47ab53673161c70e6da#bbd3df64ed4cc99a5ddac47ab53673161c70e6da" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ea8c69839a0e593c8c6a24282cb234d48ac37be4153183f4914e00f5303e75" dependencies = [ "either", "futures 0.3.12", @@ -3631,7 +3636,8 @@ dependencies = [ [[package]] name = "libp2p-tcp" version = "0.27.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=bbd3df64ed4cc99a5ddac47ab53673161c70e6da#bbd3df64ed4cc99a5ddac47ab53673161c70e6da" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dbd3d7076a478ac5a6aca55e74bdc250ac539b95de09b9d09915e0b8d01a6b2" dependencies = [ "async-io", "futures 0.3.12", @@ -3649,7 +3655,8 @@ dependencies = [ [[package]] name = "libp2p-websocket" version = "0.28.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=bbd3df64ed4cc99a5ddac47ab53673161c70e6da#bbd3df64ed4cc99a5ddac47ab53673161c70e6da" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3b1c6a3431045da8b925ed83384e4c5163e14b990572307fca9c507435d4d22" dependencies = [ "either", "futures 0.3.12", @@ -3666,7 +3673,8 @@ dependencies = [ [[package]] name = "libp2p-yamux" version = "0.30.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=bbd3df64ed4cc99a5ddac47ab53673161c70e6da#bbd3df64ed4cc99a5ddac47ab53673161c70e6da" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "490b8b27fc40fe35212df1b6a3d14bffaa4117cbff956fdc2892168a371102ad" dependencies = [ "futures 0.3.12", "libp2p-core 0.27.0", @@ -4097,7 +4105,8 @@ dependencies = [ [[package]] name = "multistream-select" version = "0.10.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=bbd3df64ed4cc99a5ddac47ab53673161c70e6da#bbd3df64ed4cc99a5ddac47ab53673161c70e6da" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10ddc0eb0117736f19d556355464fc87efc8ad98b29e3fd84f02531eb6e90840" dependencies = [ "bytes 1.0.1", "futures 0.3.12", @@ -4444,7 +4453,8 @@ dependencies = [ [[package]] name = "parity-multiaddr" version = "0.11.0" -source = "git+https://github.com/libp2p/rust-libp2p?rev=bbd3df64ed4cc99a5ddac47ab53673161c70e6da#bbd3df64ed4cc99a5ddac47ab53673161c70e6da" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bfda2e46fc5e14122649e2645645a81ee5844e0fb2e727ef560cc71a8b2d801" dependencies = [ "arrayref", "bs58 0.4.0", @@ -5216,7 +5226,7 @@ dependencies = [ "clap", "environment", "futures 0.3.12", - "hyper 0.13.9", + "hyper 0.14.2", "lazy_static", "regex", "remote_signer_backend", @@ -5254,7 +5264,6 @@ dependencies = [ "serde_json", "tempfile", "tokio 1.0.2", - "tokio-compat-02", "types", ] @@ -5791,7 +5800,6 @@ dependencies = [ "parking_lot", "rayon", "tokio 1.0.2", - "tokio-compat-02", "types", "validator_client", ] @@ -6306,7 +6314,6 @@ dependencies = [ "lighthouse_metrics", "slog", "tokio 1.0.2", - "tokio-compat-02", ] [[package]] @@ -7106,7 +7113,7 @@ dependencies = [ "fallback", "futures 0.3.12", "hex", - "hyper 0.13.9", + "hyper 0.14.2", "lazy_static", "libc", "libsecp256k1", @@ -7131,7 +7138,6 @@ dependencies = [ "slot_clock", "tempfile", "tokio 1.0.2", - "tokio-compat-02", "tree_hash", "types", "validator_dir", diff --git a/account_manager/Cargo.toml b/account_manager/Cargo.toml index e5c6776afc0..3402f3264b2 100644 --- a/account_manager/Cargo.toml +++ b/account_manager/Cargo.toml @@ -34,7 +34,6 @@ slashing_protection = { path = "../validator_client/slashing_protection" } eth2 = {path = "../common/eth2"} safe_arith = {path = "../consensus/safe_arith"} slot_clock = { path = "../common/slot_clock" } -tokio-compat-02 = "0.1" [dev-dependencies] tempfile = "3.1.0" diff --git a/account_manager/src/validator/exit.rs b/account_manager/src/validator/exit.rs index d65e87a9a2f..66e1db1d9e0 100644 --- a/account_manager/src/validator/exit.rs +++ b/account_manager/src/validator/exit.rs @@ -12,7 +12,6 @@ use safe_arith::SafeArith; use slot_clock::{SlotClock, SystemTimeSlotClock}; use std::path::PathBuf; use std::time::Duration; -use tokio_compat_02::FutureExt; use types::{ChainSpec, Epoch, EthSpec, Fork, VoluntaryExit}; pub const CMD: &str = "exit"; @@ -85,8 +84,7 @@ pub fn cli_run(matches: &ArgMatches, env: Environment) -> Result< &spec, stdin_inputs, &testnet_config, - ) - .compat(), + ), )?; Ok(()) diff --git a/beacon_node/Cargo.toml b/beacon_node/Cargo.toml index c1e2f1ab0de..82b3e15d210 100644 --- a/beacon_node/Cargo.toml +++ b/beacon_node/Cargo.toml @@ -10,7 +10,6 @@ path = "src/lib.rs" [dev-dependencies] node_test_rig = { path = "../testing/node_test_rig" } -tokio-compat-02 = "0.1" [features] write_ssz_files = ["beacon_chain/write_ssz_files"] # Writes debugging .ssz files to /tmp during block processing. @@ -41,7 +40,7 @@ eth2_libp2p = { path = "./eth2_libp2p" } eth2_ssz = "0.1.2" serde = "1.0.116" clap_utils = { path = "../common/clap_utils" } -hyper = "0.13.8" +hyper = "0.14.2" lighthouse_version = { path = "../common/lighthouse_version" } hex = "0.4.2" slasher = { path = "../slasher" } diff --git a/beacon_node/client/src/notifier.rs b/beacon_node/client/src/notifier.rs index da1168651eb..f6b13d44d7d 100644 --- a/beacon_node/client/src/notifier.rs +++ b/beacon_node/client/src/notifier.rs @@ -1,7 +1,6 @@ use crate::metrics; use beacon_chain::{BeaconChain, BeaconChainTypes}; use eth2_libp2p::NetworkGlobals; -use futures::prelude::*; use parking_lot::Mutex; use slog::{debug, error, info, warn, Logger}; use slot_clock::SlotClock; @@ -69,22 +68,27 @@ pub fn spawn_notifier( let connected_peer_count = network.connected_peers(); let sync_state = network.sync_state(); - let head_info = beacon_chain.head_info().map_err(|e| { - error!( - log, - "Failed to get beacon chain head info"; - "error" => format!("{:?}", e) - ) - })?; + let head_info = match beacon_chain.head_info() { + Ok(head_info) => head_info, + Err(e) => { + error!(log, "Failed to get beacon chain head info"; "error" => format!("{:?}", e)); + break; + }, + }; let head_slot = head_info.slot; - let current_slot = beacon_chain.slot().map_err(|e| { - error!( - log, - "Unable to read current slot"; - "error" => format!("{:?}", e) - ) - })?; + let current_slot = match beacon_chain.slot() { + Ok(slot) => slot, + Err(e) => { + error!( + log, + "Unable to read current slot"; + "error" => format!("{:?}", e) + ); + break; + } + }; + let current_epoch = current_slot.epoch(T::EthSpec::slots_per_epoch()); let finalized_epoch = head_info.finalized_checkpoint.epoch; let finalized_root = head_info.finalized_checkpoint.root; @@ -176,11 +180,10 @@ pub fn spawn_notifier( eth1_logging(&beacon_chain, &log); } - Ok::<(), ()>(()) }; // run the notifier on the current executor - executor.spawn(interval_future.unwrap_or_else(|_| ()), "notifier"); + executor.spawn(interval_future,"notifier"); Ok(()) } diff --git a/beacon_node/eth1/src/service.rs b/beacon_node/eth1/src/service.rs index 5d16b61b36c..b55d9e37350 100644 --- a/beacon_node/eth1/src/service.rs +++ b/beacon_node/eth1/src/service.rs @@ -9,7 +9,7 @@ use crate::{ inner::{DepositUpdater, Inner}, }; use fallback::{Fallback, FallbackError}; -use futures::{future::TryFutureExt, StreamExt}; +use futures::{future::TryFutureExt}; use parking_lot::{RwLock, RwLockReadGuard}; use serde::{Deserialize, Serialize}; use slog::{crit, debug, error, info, trace, warn, Logger}; diff --git a/beacon_node/eth2_libp2p/Cargo.toml b/beacon_node/eth2_libp2p/Cargo.toml index 6abdbd294ba..b57e696172a 100644 --- a/beacon_node/eth2_libp2p/Cargo.toml +++ b/beacon_node/eth2_libp2p/Cargo.toml @@ -43,9 +43,7 @@ regex = "1.3.9" strum = { version = "0.20", features = ["derive"] } [dependencies.libp2p] -#version = "0.23.0" -git = "https://github.com/libp2p/rust-libp2p" -rev = "bbd3df64ed4cc99a5ddac47ab53673161c70e6da" +version = "0.34.0" default-features = false features = ["websocket", "identify", "mplex", "yamux", "noise", "gossipsub", "dns", "tcp-tokio"] diff --git a/beacon_node/eth2_libp2p/src/rpc/protocol.rs b/beacon_node/eth2_libp2p/src/rpc/protocol.rs index 96bc41c5d82..de74e98dd7a 100644 --- a/beacon_node/eth2_libp2p/src/rpc/protocol.rs +++ b/beacon_node/eth2_libp2p/src/rpc/protocol.rs @@ -10,7 +10,7 @@ use crate::rpc::{ }; use futures::future::BoxFuture; use futures::prelude::{AsyncRead, AsyncWrite}; -use futures::{Future, FutureExt, Sink, SinkExt, Stream, StreamExt}; +use futures::{FutureExt, SinkExt, StreamExt}; use libp2p::core::{InboundUpgrade, OutboundUpgrade, ProtocolName, UpgradeInfo}; use ssz::Encode; use ssz_types::VariableList; diff --git a/beacon_node/http_api/Cargo.toml b/beacon_node/http_api/Cargo.toml index f749af5deef..d148330adda 100644 --- a/beacon_node/http_api/Cargo.toml +++ b/beacon_node/http_api/Cargo.toml @@ -35,4 +35,3 @@ store = { path = "../store" } environment = { path = "../../lighthouse/environment" } tree_hash = "0.1.1" discv5 = { git = "https://github.com/sigp/discv5", branch = "master" } -tokio-compat-02 = "0.1" diff --git a/beacon_node/http_api/src/lib.rs b/beacon_node/http_api/src/lib.rs index 2b473dd7975..cd2c81db457 100644 --- a/beacon_node/http_api/src/lib.rs +++ b/beacon_node/http_api/src/lib.rs @@ -19,9 +19,8 @@ use beacon_chain::{ }; use beacon_proposer_cache::BeaconProposerCache; use block_id::BlockId; -use eth2::types::{self as api_types, EventKind, ValidatorId}; +use eth2::types::{self as api_types, ValidatorId}; use eth2_libp2p::{types::SyncState, EnrExt, NetworkGlobals, PeerId, PubsubMessage}; -use futures::future; use lighthouse_version::version_with_platform; use network::NetworkMessage; use parking_lot::Mutex; @@ -36,10 +35,8 @@ use std::convert::TryInto; use std::future::Future; use std::net::{Ipv4Addr, SocketAddr, SocketAddrV4}; use std::sync::Arc; -use tokio::sync::broadcast::error::RecvError; -use tokio::sync::broadcast::Receiver; use tokio::sync::mpsc::UnboundedSender; -use tokio_stream::{Stream, StreamExt, StreamMap}; +use tokio_stream::{Stream, StreamExt}; use types::{ Attestation, AttestationDuty, AttesterSlashing, CloneConfig, CommitteeCache, Epoch, EthSpec, Hash256, ProposerSlashing, PublicKey, PublicKeyBytes, RelativeEpoch, SignedAggregateAndProof, @@ -49,7 +46,6 @@ use warp::http::StatusCode; use warp::sse::Event; use warp::Reply; use warp::{http::Response, Filter}; -use warp_utils::reject::ServerSentEventError; use warp_utils::task::{blocking_json_task, blocking_task}; const API_PREFIX: &str = "eth"; @@ -2397,7 +2393,7 @@ pub fn serve( if let Some(event_handler) = chain.event_handler.as_ref() { for topic in topics.topics.0.clone() { - let mut receiver = match topic { + let receiver = match topic { api_types::EventTopic::Head => event_handler.subscribe_head(), api_types::EventTopic::Block => event_handler.subscribe_block(), api_types::EventTopic::Attestation => { @@ -2412,7 +2408,7 @@ pub fn serve( }; receivers.push(broadcast_stream::BroadcastStream::new(receiver).map( - |(msg)| { + |msg| { match msg { Ok(data) => Event::default() .event(data.topic_name()) diff --git a/beacon_node/http_api/tests/tests.rs b/beacon_node/http_api/tests/tests.rs index e7b58179640..b6b1067f786 100644 --- a/beacon_node/http_api/tests/tests.rs +++ b/beacon_node/http_api/tests/tests.rs @@ -933,14 +933,11 @@ impl ApiTester { self.client.post_beacon_blocks(next_block).await.unwrap(); assert!( - self.network_rx.recv().now_or_never().is_some(), - "valid blocks should be sent to network" - ); - assert!( - self.network_rx.recv().now_or_never().is_some(), + self.network_rx.recv().await.is_some(), "valid blocks should be sent to network" ); + self } @@ -951,7 +948,7 @@ impl ApiTester { assert!(self.client.post_beacon_blocks(&next_block).await.is_err()); assert!( - self.network_rx.recv().now_or_never().is_some(), + self.network_rx.recv().await.is_some(), "invalid blocks should be sent to network" ); @@ -1001,7 +998,7 @@ impl ApiTester { .unwrap(); assert!( - self.network_rx.recv().now_or_never().is_some(), + self.network_rx.recv().await.is_some(), "valid attestation should be sent to network" ); @@ -1038,7 +1035,7 @@ impl ApiTester { } assert!( - self.network_rx.recv().now_or_never().is_some(), + self.network_rx.recv().await.is_some(), "if some attestations are valid, we should send them to the network" ); @@ -1068,7 +1065,7 @@ impl ApiTester { .unwrap(); assert!( - self.network_rx.recv().now_or_never().is_some(), + self.network_rx.recv().await.is_some(), "valid attester slashing should be sent to network" ); @@ -1114,7 +1111,7 @@ impl ApiTester { .unwrap(); assert!( - self.network_rx.recv().now_or_never().is_some(), + self.network_rx.recv().await.is_some(), "valid proposer slashing should be sent to network" ); @@ -1160,7 +1157,7 @@ impl ApiTester { .unwrap(); assert!( - self.network_rx.recv().now_or_never().is_some(), + self.network_rx.recv().await.is_some(), "valid exit should be sent to network" ); @@ -1826,7 +1823,7 @@ impl ApiTester { .await .unwrap(); - assert!(self.network_rx.recv().now_or_never().is_some()); + assert!(self.network_rx.recv().await.is_some()); self } diff --git a/beacon_node/http_metrics/Cargo.toml b/beacon_node/http_metrics/Cargo.toml index e960d82c2cc..915ef8dbf61 100644 --- a/beacon_node/http_metrics/Cargo.toml +++ b/beacon_node/http_metrics/Cargo.toml @@ -26,4 +26,3 @@ tokio = { version = "1.0.2", features = ["sync"] } reqwest = { version = "0.11.0", features = ["json"] } environment = { path = "../../lighthouse/environment" } types = { path = "../../consensus/types" } -tokio-compat-02 = "0.1" diff --git a/beacon_node/http_metrics/tests/tests.rs b/beacon_node/http_metrics/tests/tests.rs index cd0420f4bd1..db161c6d68b 100644 --- a/beacon_node/http_metrics/tests/tests.rs +++ b/beacon_node/http_metrics/tests/tests.rs @@ -5,7 +5,6 @@ use reqwest::StatusCode; use std::net::Ipv4Addr; use std::sync::Arc; use tokio::sync::oneshot; -use tokio_compat_02::FutureExt; use types::MainnetEthSpec; type Context = http_metrics::Context>; @@ -46,6 +45,5 @@ async fn returns_200_ok() { assert_eq!(reqwest::get(&url).await.unwrap().status(), StatusCode::OK); } - .compat() .await } diff --git a/beacon_node/network/src/router/mod.rs b/beacon_node/network/src/router/mod.rs index 0805b34394e..ad6659543ae 100644 --- a/beacon_node/network/src/router/mod.rs +++ b/beacon_node/network/src/router/mod.rs @@ -19,8 +19,7 @@ use processor::Processor; use slog::{debug, o, trace}; use std::sync::Arc; use tokio::sync::mpsc; -use tokio_stream::{wrappers::UnboundedReceiverStream, Stream, StreamExt}; -use types::Error::UnableToDetermineProducer; +use tokio_stream::{wrappers::UnboundedReceiverStream}; use types::EthSpec; /// Handles messages received from the network and client and organises syncing. This diff --git a/beacon_node/tests/test.rs b/beacon_node/tests/test.rs index 011209a1437..a18cf038caf 100644 --- a/beacon_node/tests/test.rs +++ b/beacon_node/tests/test.rs @@ -1,14 +1,11 @@ #![cfg(test)] -//TODO: Drop compat library once reqwest and other libraries update to tokio 0.3 - use beacon_chain::StateSkipConfig; use node_test_rig::{ environment::{Environment, EnvironmentBuilder}, eth2::types::StateId, testing_client_config, LocalBeaconNode, }; -use tokio_compat_02::FutureExt; use types::{EthSpec, MinimalEthSpec, Slot}; fn env_builder() -> EnvironmentBuilder { @@ -46,8 +43,7 @@ fn http_server_genesis_state() { .runtime() .block_on( remote_node - .get_debug_beacon_states(StateId::Slot(Slot::new(0))) - .compat(), + .get_debug_beacon_states(StateId::Slot(Slot::new(0))), ) .expect("should fetch state from http api") .unwrap() diff --git a/beacon_node/timer/src/lib.rs b/beacon_node/timer/src/lib.rs index 056740eb32b..d0f449bab83 100644 --- a/beacon_node/timer/src/lib.rs +++ b/beacon_node/timer/src/lib.rs @@ -3,7 +3,6 @@ //! This service allows task execution on the beacon node for various functionality. use beacon_chain::{BeaconChain, BeaconChainTypes}; -use futures::stream::StreamExt; use slog::info; use slot_clock::SlotClock; use std::sync::Arc; diff --git a/boot_node/src/server.rs b/boot_node/src/server.rs index 8900df064f7..b1efd805ce7 100644 --- a/boot_node/src/server.rs +++ b/boot_node/src/server.rs @@ -5,7 +5,6 @@ use eth2_libp2p::{ discv5::{enr::NodeId, Discv5, Discv5ConfigBuilder, Discv5Event}, EnrExt, Eth2Enr, }; -use futures::prelude::*; use slog::info; use types::EthSpec; diff --git a/common/rest_types/Cargo.toml b/common/rest_types/Cargo.toml index f121722d43d..ac7ae347364 100644 --- a/common/rest_types/Cargo.toml +++ b/common/rest_types/Cargo.toml @@ -14,7 +14,7 @@ state_processing = { path = "../../consensus/state_processing" } bls = { path = "../../crypto/bls" } serde = { version = "1.0.110", features = ["derive"] } rayon = "1.3.0" -hyper = "0.13.5" +hyper = "0.14.2" tokio = { version = "1.0.2", features = ["sync"] } environment = { path = "../../lighthouse/environment" } store = { path = "../../beacon_node/store" } diff --git a/common/task_executor/Cargo.toml b/common/task_executor/Cargo.toml index e288c941940..aa2c6139a96 100644 --- a/common/task_executor/Cargo.toml +++ b/common/task_executor/Cargo.toml @@ -11,4 +11,3 @@ futures = "0.3.7" exit-future = "0.2.0" lazy_static = "1.4.0" lighthouse_metrics = { path = "../lighthouse_metrics" } -tokio-compat-02 = "0.1" diff --git a/common/task_executor/src/lib.rs b/common/task_executor/src/lib.rs index e5a263ae394..ab06e22b39d 100644 --- a/common/task_executor/src/lib.rs +++ b/common/task_executor/src/lib.rs @@ -5,7 +5,6 @@ use futures::prelude::*; use slog::{debug, o, trace}; use std::sync::Weak; use tokio::runtime::Runtime; -use tokio_compat_02::FutureExt; /// A wrapper over a runtime handle which can spawn async and blocking tasks. #[derive(Clone)] @@ -63,7 +62,7 @@ impl TaskExecutor { if let Some(int_gauge) = metrics::get_int_gauge(&metrics::ASYNC_TASKS_COUNT, &[name]) { // Task is shutdown before it completes if `exit` receives let int_gauge_1 = int_gauge.clone(); - let future = future::select(Box::pin(task.compat()), exit).then(move |either| { + let future = future::select(Box::pin(task), exit).then(move |either| { match either { future::Either::Left(_) => trace!(log, "Async task completed"; "task" => name), future::Either::Right(_) => { @@ -103,8 +102,7 @@ impl TaskExecutor { .then(move |_| { int_gauge_1.dec(); futures::future::ready(()) - }) - .compat(); + }); int_gauge.inc(); if let Some(runtime) = self.runtime.upgrade() { @@ -186,7 +184,7 @@ impl TaskExecutor { int_gauge.inc(); if let Some(runtime) = self.runtime.upgrade() { - Some(runtime.spawn(future.compat())) + Some(runtime.spawn(future)) } else { debug!(self.log, "Couldn't spawn task. Runtime shutting down"); None diff --git a/lcli/src/eth1_genesis.rs b/lcli/src/eth1_genesis.rs index bd064abe68d..6d7a1c1696f 100644 --- a/lcli/src/eth1_genesis.rs +++ b/lcli/src/eth1_genesis.rs @@ -6,7 +6,6 @@ use ssz::Encode; use std::cmp::max; use std::path::PathBuf; use std::time::Duration; -use tokio_compat_02::FutureExt; use types::EthSpec; /// Interval between polling the eth1 node for genesis information. @@ -77,7 +76,6 @@ pub fn run(mut env: Environment, matches: &ArgMatches<'_>) -> Res info!("Connecting to eth1 http endpoints: {:?}", endpoints); Ok(()) - } - .compat(), + }, ) } diff --git a/lighthouse/src/main.rs b/lighthouse/src/main.rs index 0252a39a70d..e538e82372d 100644 --- a/lighthouse/src/main.rs +++ b/lighthouse/src/main.rs @@ -7,7 +7,6 @@ use lighthouse_version::VERSION; use slog::{crit, info, warn}; use std::path::PathBuf; use std::process::exit; -use tokio_compat_02::FutureExt; use types::{EthSpec, EthSpecId}; use validator_client::ProductionValidatorClient; @@ -293,8 +292,7 @@ fn run( .shutdown_sender() .try_send("Failed to start beacon node"); } - } - .compat(), + }, ); } ("validator_client", Some(matches)) => { @@ -320,8 +318,7 @@ fn run( .shutdown_sender() .try_send("Failed to start validator client"); } - } - .compat(), + }, ); } ("remote_signer", Some(matches)) => { diff --git a/remote_signer/client/Cargo.toml b/remote_signer/client/Cargo.toml index dac014790e3..c43dbeb1e78 100644 --- a/remote_signer/client/Cargo.toml +++ b/remote_signer/client/Cargo.toml @@ -9,7 +9,7 @@ clap = "2.33.3" client_backend = { path = "../backend", package = "remote_signer_backend" } environment = { path = "../../lighthouse/environment" } futures = "0.3.6" -hyper = "0.13.8" +hyper = "0.14.2" lazy_static = "1.4.0" regex = "1.3.9" serde = { version = "1.0.116", features = ["derive"] } diff --git a/slasher/service/src/service.rs b/slasher/service/src/service.rs index 51e81ab18f6..96a157adc7f 100644 --- a/slasher/service/src/service.rs +++ b/slasher/service/src/service.rs @@ -21,7 +21,6 @@ use std::sync::Arc; use task_executor::TaskExecutor; use tokio::sync::mpsc::UnboundedSender; use tokio::time::{interval_at, Duration, Instant}; -use tokio_stream::StreamExt; use types::{AttesterSlashing, Epoch, EthSpec, ProposerSlashing}; pub struct SlasherService { diff --git a/testing/remote_signer_test/Cargo.toml b/testing/remote_signer_test/Cargo.toml index 46de7d56504..e6485fa1832 100644 --- a/testing/remote_signer_test/Cargo.toml +++ b/testing/remote_signer_test/Cargo.toml @@ -17,4 +17,3 @@ serde_json = "1.0.58" tempfile = "3.1.0" tokio = { version = "1.0.2", features = ["time"] } types = { path = "../../consensus/types" } -tokio-compat-02 = "0.1" diff --git a/testing/remote_signer_test/src/api_test_signer.rs b/testing/remote_signer_test/src/api_test_signer.rs index 68d1f6a3859..edd8df9c756 100644 --- a/testing/remote_signer_test/src/api_test_signer.rs +++ b/testing/remote_signer_test/src/api_test_signer.rs @@ -26,10 +26,10 @@ impl ApiTestSigner { let client = environment .runtime() - .block_on(tokio_compat_02::FutureExt::compat(Client::new( + .block_on(Client::new( runtime_context, &matches, - ))) + )) .map_err(|e| format!("Failed to init Rest API: {}", e)) .unwrap(); diff --git a/testing/remote_signer_test/src/consumer.rs b/testing/remote_signer_test/src/consumer.rs index 83f828691fa..cdca7cecae9 100644 --- a/testing/remote_signer_test/src/consumer.rs +++ b/testing/remote_signer_test/src/consumer.rs @@ -30,13 +30,13 @@ pub fn do_sign_request( ) -> Result { let runtime = Builder::new_multi_thread().enable_all().build().unwrap(); - runtime.block_on(tokio_compat_02::FutureExt::compat(test_client.sign( + runtime.block_on(test_client.sign( &test_input.public_key, test_input.bls_domain, test_input.data, test_input.fork, test_input.genesis_validators_root, - ))) + )) } #[derive(Serialize)] diff --git a/testing/simulator/Cargo.toml b/testing/simulator/Cargo.toml index d8415fe019b..dea35487880 100644 --- a/testing/simulator/Cargo.toml +++ b/testing/simulator/Cargo.toml @@ -18,4 +18,3 @@ eth1_test_rig = { path = "../eth1_test_rig" } env_logger = "0.8.2" clap = "2.33.3" rayon = "1.4.1" -tokio-compat-02 = "0.1" diff --git a/testing/simulator/src/eth1_sim.rs b/testing/simulator/src/eth1_sim.rs index a2ba87d91f2..6124f8c1fec 100644 --- a/testing/simulator/src/eth1_sim.rs +++ b/testing/simulator/src/eth1_sim.rs @@ -206,7 +206,7 @@ pub fn run_eth1_sim(matches: &ArgMatches) -> Result<(), String> { }; env.runtime() - .block_on(tokio_compat_02::FutureExt::compat(main_future)) + .block_on(main_future) .unwrap(); env.fire_signal(); diff --git a/testing/simulator/src/no_eth1_sim.rs b/testing/simulator/src/no_eth1_sim.rs index c20c1261191..b6b801fbef1 100644 --- a/testing/simulator/src/no_eth1_sim.rs +++ b/testing/simulator/src/no_eth1_sim.rs @@ -159,7 +159,7 @@ pub fn run_no_eth1_sim(matches: &ArgMatches) -> Result<(), String> { }; env.runtime() - .block_on(tokio_compat_02::FutureExt::compat(main_future)) + .block_on(main_future) .unwrap(); env.fire_signal(); diff --git a/testing/simulator/src/sync_sim.rs b/testing/simulator/src/sync_sim.rs index 5992552327a..2f40b80a115 100644 --- a/testing/simulator/src/sync_sim.rs +++ b/testing/simulator/src/sync_sim.rs @@ -131,7 +131,7 @@ fn syncing_sim( }; env.runtime() - .block_on(tokio_compat_02::FutureExt::compat(main_future)) + .block_on(main_future) .unwrap(); env.fire_signal(); diff --git a/validator_client/Cargo.toml b/validator_client/Cargo.toml index 494bc913f9e..14d53797c98 100644 --- a/validator_client/Cargo.toml +++ b/validator_client/Cargo.toml @@ -11,7 +11,6 @@ path = "src/lib.rs" [dev-dependencies] tokio = { version = "1.0.2", features = ["time", "rt-multi-thread", "macros"] } deposit_contract = { path = "../common/deposit_contract" } -tokio-compat-02 = "0.1" [dependencies] eth2_ssz = "0.1.2" @@ -54,7 +53,7 @@ account_utils = { path = "../common/account_utils" } lighthouse_version = { path = "../common/lighthouse_version" } warp_utils = { path = "../common/warp_utils" } warp = "0.3.0" -hyper = "0.13.8" +hyper = "0.14.2" serde_utils = { path = "../consensus/serde_utils" } libsecp256k1 = "0.3.5" ring = "0.16.19" diff --git a/validator_client/src/attestation_service.rs b/validator_client/src/attestation_service.rs index 45c0ac98837..97d2496b17c 100644 --- a/validator_client/src/attestation_service.rs +++ b/validator_client/src/attestation_service.rs @@ -6,7 +6,6 @@ use crate::{ }; use environment::RuntimeContext; use futures::future::FutureExt; -use futures::StreamExt; use slog::{crit, error, info, trace}; use slot_clock::SlotClock; use std::collections::HashMap; diff --git a/validator_client/src/duties_service.rs b/validator_client/src/duties_service.rs index 7ec1a86e43f..730ed4d87d0 100644 --- a/validator_client/src/duties_service.rs +++ b/validator_client/src/duties_service.rs @@ -5,7 +5,7 @@ use crate::{ }; use environment::RuntimeContext; use futures::channel::mpsc::Sender; -use futures::{SinkExt, StreamExt}; +use futures::{SinkExt}; use parking_lot::RwLock; use slog::{debug, error, trace, warn}; use slot_clock::SlotClock; diff --git a/validator_client/src/fork_service.rs b/validator_client/src/fork_service.rs index 7ba3fb6dd06..d404323c421 100644 --- a/validator_client/src/fork_service.rs +++ b/validator_client/src/fork_service.rs @@ -3,7 +3,6 @@ use crate::http_metrics::metrics; use environment::RuntimeContext; use eth2::types::StateId; use futures::future::FutureExt; -use futures::StreamExt; use parking_lot::RwLock; use slog::Logger; use slog::{debug, trace}; diff --git a/validator_client/src/http_api/tests.rs b/validator_client/src/http_api/tests.rs index ce0a1ef6903..abcc5f20c68 100644 --- a/validator_client/src/http_api/tests.rs +++ b/validator_client/src/http_api/tests.rs @@ -25,7 +25,6 @@ use std::sync::Arc; use tempfile::{tempdir, TempDir}; use tokio::runtime::Runtime; use tokio::sync::oneshot; -use tokio_compat_02::FutureExt; const PASSWORD_BYTES: &[u8] = &[42, 50, 37]; @@ -446,8 +445,7 @@ fn invalid_pubkey() { .invalidate_api_token() .test_get_lighthouse_version_invalid() .await; - } - .compat(), + }, ); } @@ -465,8 +463,7 @@ fn simple_getters() { .await .test_get_lighthouse_spec() .await; - } - .compat(), + }, ); } @@ -507,8 +504,7 @@ fn hd_validator_creation() { .await .assert_enabled_validators_count(2) .assert_validators_count(3); - } - .compat(), + }, ); } @@ -537,8 +533,7 @@ fn validator_enabling() { .await .assert_enabled_validators_count(2) .assert_validators_count(2); - } - .compat(), + }, ); } @@ -573,7 +568,6 @@ fn keystore_validator_creation() { .await .assert_enabled_validators_count(1) .assert_validators_count(2); - } - .compat(), + }, ); } diff --git a/validator_client/src/notifier.rs b/validator_client/src/notifier.rs index db3be272880..907fddb7cf4 100644 --- a/validator_client/src/notifier.rs +++ b/validator_client/src/notifier.rs @@ -1,5 +1,4 @@ use crate::ProductionValidatorClient; -use futures::StreamExt; use slog::{error, info}; use slot_clock::SlotClock; use tokio::time::{interval_at, Duration, Instant}; @@ -19,7 +18,7 @@ pub fn spawn_notifier(client: &ProductionValidatorClient) -> Resu // Run the notifier half way through each slot. let start_instant = Instant::now() + duration_to_next_slot + (slot_duration / 2); - let mut interval = interval_at(start_instant, slot_duration); + let _interval = interval_at(start_instant, slot_duration); let interval_fut = async move { let log = context.log(); From 6d18854b70d72cd3a5cce5953fbb887816f0e053 Mon Sep 17 00:00:00 2001 From: realbigsean Date: Mon, 25 Jan 2021 13:34:24 -0500 Subject: [PATCH 06/17] clippy --- account_manager/src/validator/exit.rs | 18 +- beacon_node/client/src/builder.rs | 5 +- beacon_node/client/src/notifier.rs | 4 +- beacon_node/eth1/src/service.rs | 2 +- beacon_node/eth2_libp2p/src/rpc/handler.rs | 6 +- beacon_node/http_api/src/lib.rs | 4 +- beacon_node/http_api/tests/tests.rs | 97 ++++----- beacon_node/network/src/router/mod.rs | 2 +- beacon_node/src/lib.rs | 8 +- beacon_node/tests/test.rs | 5 +- common/task_executor/src/lib.rs | 9 +- lcli/src/eth1_genesis.rs | 28 ++- lighthouse/src/main.rs | 62 +++--- .../remote_signer_test/src/api_test_signer.rs | 5 +- testing/simulator/src/eth1_sim.rs | 4 +- testing/simulator/src/no_eth1_sim.rs | 4 +- testing/simulator/src/sync_sim.rs | 4 +- validator_client/src/duties_service.rs | 2 +- validator_client/src/http_api/tests.rs | 206 +++++++++--------- 19 files changed, 211 insertions(+), 264 deletions(-) diff --git a/account_manager/src/validator/exit.rs b/account_manager/src/validator/exit.rs index 66e1db1d9e0..018483896ff 100644 --- a/account_manager/src/validator/exit.rs +++ b/account_manager/src/validator/exit.rs @@ -76,16 +76,14 @@ pub fn cli_run(matches: &ArgMatches, env: Environment) -> Result< .clone() .expect("network should have a valid config"); - env.runtime().block_on( - publish_voluntary_exit::( - &keystore_path, - password_file_path.as_ref(), - &client, - &spec, - stdin_inputs, - &testnet_config, - ), - )?; + env.runtime().block_on(publish_voluntary_exit::( + &keystore_path, + password_file_path.as_ref(), + &client, + &spec, + stdin_inputs, + &testnet_config, + ))?; Ok(()) } diff --git a/beacon_node/client/src/builder.rs b/beacon_node/client/src/builder.rs index 8628a66512d..c47e74cebc6 100644 --- a/beacon_node/client/src/builder.rs +++ b/beacon_node/client/src/builder.rs @@ -115,9 +115,7 @@ where mut self, client_genesis: ClientGenesis, config: ClientConfig, - ) -> Result - - { + ) -> Result { let store = self.store.clone(); let chain_spec = self.chain_spec.clone(); let runtime_context = self.runtime_context.clone(); @@ -416,7 +414,6 @@ where pub fn build( self, ) -> Result>, String> - { let runtime_context = self .runtime_context diff --git a/beacon_node/client/src/notifier.rs b/beacon_node/client/src/notifier.rs index f6b13d44d7d..e38f5199fc9 100644 --- a/beacon_node/client/src/notifier.rs +++ b/beacon_node/client/src/notifier.rs @@ -73,7 +73,7 @@ pub fn spawn_notifier( Err(e) => { error!(log, "Failed to get beacon chain head info"; "error" => format!("{:?}", e)); break; - }, + } }; let head_slot = head_info.slot; @@ -183,7 +183,7 @@ pub fn spawn_notifier( }; // run the notifier on the current executor - executor.spawn(interval_future,"notifier"); + executor.spawn(interval_future, "notifier"); Ok(()) } diff --git a/beacon_node/eth1/src/service.rs b/beacon_node/eth1/src/service.rs index b55d9e37350..6a8f2a38541 100644 --- a/beacon_node/eth1/src/service.rs +++ b/beacon_node/eth1/src/service.rs @@ -9,7 +9,7 @@ use crate::{ inner::{DepositUpdater, Inner}, }; use fallback::{Fallback, FallbackError}; -use futures::{future::TryFutureExt}; +use futures::future::TryFutureExt; use parking_lot::{RwLock, RwLockReadGuard}; use serde::{Deserialize, Serialize}; use slog::{crit, debug, error, info, trace, warn, Logger}; diff --git a/beacon_node/eth2_libp2p/src/rpc/handler.rs b/beacon_node/eth2_libp2p/src/rpc/handler.rs index 41731d5d9a3..6f7aff78b70 100644 --- a/beacon_node/eth2_libp2p/src/rpc/handler.rs +++ b/beacon_node/eth2_libp2p/src/rpc/handler.rs @@ -134,7 +134,7 @@ enum HandlerState { /// /// While in this state the handler rejects new requests but tries to finish existing ones. /// Once the timer expires, all messages are killed. - ShuttingDown(Sleep), + ShuttingDown(Box), /// The handler is deactivated. A goodbye has been sent and no more messages are sent or /// received. Deactivated, @@ -240,9 +240,9 @@ where self.dial_queue.push((id, req)); } - self.state = HandlerState::ShuttingDown(sleep_until( + self.state = HandlerState::ShuttingDown(Box::new(sleep_until( TInstant::now() + Duration::from_secs(SHUTDOWN_TIMEOUT_SECS as u64), - )); + ))); } } diff --git a/beacon_node/http_api/src/lib.rs b/beacon_node/http_api/src/lib.rs index cd2c81db457..17732a7d0ba 100644 --- a/beacon_node/http_api/src/lib.rs +++ b/beacon_node/http_api/src/lib.rs @@ -213,9 +213,7 @@ pub fn prometheus_metrics() -> warp::filters::log::Log( ctx: Arc>, shutdown: impl Future + Send + Sync + 'static, -) -> Result<(SocketAddr, impl Future), Error> - -{ +) -> Result<(SocketAddr, impl Future), Error> { let config = ctx.config.clone(); let log = ctx.log.clone(); diff --git a/beacon_node/http_api/tests/tests.rs b/beacon_node/http_api/tests/tests.rs index b6b1067f786..1e3bb9651b3 100644 --- a/beacon_node/http_api/tests/tests.rs +++ b/beacon_node/http_api/tests/tests.rs @@ -15,6 +15,7 @@ use eth2_libp2p::{ Enr, EnrExt, NetworkGlobals, PeerId, }; use futures::stream::{Stream, StreamExt}; +use futures::FutureExt; use http_api::{Config, Context}; use network::NetworkMessage; use state_processing::per_slot_processing; @@ -30,7 +31,6 @@ use types::{ test_utils::generate_deterministic_keypairs, AggregateSignature, BeaconState, BitList, Domain, EthSpec, Hash256, Keypair, MainnetEthSpec, RelativeEpoch, SelectionProof, SignedRoot, Slot, }; -use futures::FutureExt; type E = MainnetEthSpec; @@ -937,7 +937,6 @@ impl ApiTester { "valid blocks should be sent to network" ); - self } @@ -2140,57 +2139,53 @@ async fn get_events_from_genesis() { #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn beacon_get() { - ApiTester::new() - .test_beacon_genesis() - .await - .test_beacon_states_root() - .await - .test_beacon_states_fork() - .await - .test_beacon_states_finality_checkpoints() - .await - .test_beacon_states_validators() - .await - .test_beacon_states_validator_balances() - .await - .test_beacon_states_committees() - .await - .test_beacon_states_validator_id() - .await - .test_beacon_headers_all_slots() - .await - .test_beacon_headers_all_parents() - .await - .test_beacon_headers_block_id() - .await - .test_beacon_blocks() - .await - .test_beacon_blocks_attestations() - .await - .test_beacon_blocks_root() - .await - .test_get_beacon_pool_attestations() - .await - .test_get_beacon_pool_attester_slashings() - .await - .test_get_beacon_pool_proposer_slashings() - .await - .test_get_beacon_pool_voluntary_exits() - .await; + ApiTester::new() + .test_beacon_genesis() + .await + .test_beacon_states_root() + .await + .test_beacon_states_fork() + .await + .test_beacon_states_finality_checkpoints() + .await + .test_beacon_states_validators() + .await + .test_beacon_states_validator_balances() + .await + .test_beacon_states_committees() + .await + .test_beacon_states_validator_id() + .await + .test_beacon_headers_all_slots() + .await + .test_beacon_headers_all_parents() + .await + .test_beacon_headers_block_id() + .await + .test_beacon_blocks() + .await + .test_beacon_blocks_attestations() + .await + .test_beacon_blocks_root() + .await + .test_get_beacon_pool_attestations() + .await + .test_get_beacon_pool_attester_slashings() + .await + .test_get_beacon_pool_proposer_slashings() + .await + .test_get_beacon_pool_voluntary_exits() + .await; } #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn post_beacon_blocks_valid() { - ApiTester::new() - .test_post_beacon_blocks_valid() - .await; + ApiTester::new().test_post_beacon_blocks_valid().await; } #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn post_beacon_blocks_invalid() { - ApiTester::new() - .test_post_beacon_blocks_invalid() - .await; + ApiTester::new().test_post_beacon_blocks_invalid().await; } #[tokio::test(flavor = "multi_thread", worker_threads = 2)] @@ -2290,9 +2285,7 @@ async fn node_get() { #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn get_validator_duties_attester() { - ApiTester::new() - .test_get_validator_duties_attester() - .await; + ApiTester::new().test_get_validator_duties_attester().await; } #[tokio::test(flavor = "multi_thread", worker_threads = 2)] @@ -2305,9 +2298,7 @@ async fn get_validator_duties_attester_with_skip_slots() { #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn get_validator_duties_proposer() { - ApiTester::new() - .test_get_validator_duties_proposer() - .await; + ApiTester::new().test_get_validator_duties_proposer().await; } #[tokio::test(flavor = "multi_thread", worker_threads = 2)] @@ -2333,9 +2324,7 @@ async fn block_production_with_skip_slots() { #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn get_validator_attestation_data() { - ApiTester::new() - .test_get_validator_attestation_data() - .await; + ApiTester::new().test_get_validator_attestation_data().await; } #[tokio::test(flavor = "multi_thread", worker_threads = 2)] diff --git a/beacon_node/network/src/router/mod.rs b/beacon_node/network/src/router/mod.rs index ad6659543ae..8d9b1cd6247 100644 --- a/beacon_node/network/src/router/mod.rs +++ b/beacon_node/network/src/router/mod.rs @@ -19,7 +19,7 @@ use processor::Processor; use slog::{debug, o, trace}; use std::sync::Arc; use tokio::sync::mpsc; -use tokio_stream::{wrappers::UnboundedReceiverStream}; +use tokio_stream::wrappers::UnboundedReceiverStream; use types::EthSpec; /// Handles messages received from the network and client and organises syncing. This diff --git a/beacon_node/src/lib.rs b/beacon_node/src/lib.rs index eb710f0f7a4..7671c15ea22 100644 --- a/beacon_node/src/lib.rs +++ b/beacon_node/src/lib.rs @@ -44,9 +44,7 @@ impl ProductionBeaconNode { pub async fn new_from_cli( context: RuntimeContext, matches: ArgMatches<'static>, - ) -> Result - - { + ) -> Result { let client_config = get_config::(&matches, &context.eth2_config().spec, context.log().clone())?; Self::new(context, client_config).await @@ -58,9 +56,7 @@ impl ProductionBeaconNode { pub async fn new( context: RuntimeContext, mut client_config: ClientConfig, - ) -> Result - - { + ) -> Result { let spec = context.eth2_config().spec.clone(); let client_config_1 = client_config.clone(); let client_genesis = client_config.genesis.clone(); diff --git a/beacon_node/tests/test.rs b/beacon_node/tests/test.rs index a18cf038caf..0d5c6c9fb34 100644 --- a/beacon_node/tests/test.rs +++ b/beacon_node/tests/test.rs @@ -41,10 +41,7 @@ fn http_server_genesis_state() { let api_state = env .runtime() - .block_on( - remote_node - .get_debug_beacon_states(StateId::Slot(Slot::new(0))), - ) + .block_on(remote_node.get_debug_beacon_states(StateId::Slot(Slot::new(0)))) .expect("should fetch state from http api") .unwrap() .data; diff --git a/common/task_executor/src/lib.rs b/common/task_executor/src/lib.rs index ab06e22b39d..f2de8b93995 100644 --- a/common/task_executor/src/lib.rs +++ b/common/task_executor/src/lib.rs @@ -98,11 +98,10 @@ impl TaskExecutor { ) { if let Some(int_gauge) = metrics::get_int_gauge(&metrics::ASYNC_TASKS_COUNT, &[name]) { let int_gauge_1 = int_gauge.clone(); - let future = task - .then(move |_| { - int_gauge_1.dec(); - futures::future::ready(()) - }); + let future = task.then(move |_| { + int_gauge_1.dec(); + futures::future::ready(()) + }); int_gauge.inc(); if let Some(runtime) = self.runtime.upgrade() { diff --git a/lcli/src/eth1_genesis.rs b/lcli/src/eth1_genesis.rs index 6d7a1c1696f..530295021e0 100644 --- a/lcli/src/eth1_genesis.rs +++ b/lcli/src/eth1_genesis.rs @@ -61,21 +61,19 @@ pub fn run(mut env: Environment, matches: &ArgMatches<'_>) -> Res let genesis_service = Eth1GenesisService::new(config, env.core_context().log().clone(), spec.clone()); - env.runtime().block_on( - async { - let _ = genesis_service - .wait_for_genesis_state::(ETH1_GENESIS_UPDATE_INTERVAL, spec) - .await - .map(move |genesis_state| { - eth2_network_config.genesis_state_bytes = Some(genesis_state.as_ssz_bytes()); - eth2_network_config.force_write_to_file(testnet_dir) - }) - .map_err(|e| format!("Failed to find genesis: {}", e))?; + env.runtime().block_on(async { + let _ = genesis_service + .wait_for_genesis_state::(ETH1_GENESIS_UPDATE_INTERVAL, spec) + .await + .map(move |genesis_state| { + eth2_network_config.genesis_state_bytes = Some(genesis_state.as_ssz_bytes()); + eth2_network_config.force_write_to_file(testnet_dir) + }) + .map_err(|e| format!("Failed to find genesis: {}", e))?; - info!("Starting service to produce genesis BeaconState from eth1"); - info!("Connecting to eth1 http endpoints: {:?}", endpoints); + info!("Starting service to produce genesis BeaconState from eth1"); + info!("Connecting to eth1 http endpoints: {:?}", endpoints); - Ok(()) - }, - ) + Ok(()) + }) } diff --git a/lighthouse/src/main.rs b/lighthouse/src/main.rs index e538e82372d..53f3f2c1058 100644 --- a/lighthouse/src/main.rs +++ b/lighthouse/src/main.rs @@ -189,9 +189,7 @@ fn run( environment_builder: EnvironmentBuilder, matches: &ArgMatches, testnet_config: Eth2NetworkConfig, -) -> Result<(), String> - -{ +) -> Result<(), String> { if std::mem::size_of::() != 8 { return Err(format!( "{}-bit architecture is not supported (64-bit only).", @@ -282,18 +280,16 @@ fn run( &context.eth2_config().spec, context.log().clone(), )?; - environment.runtime().spawn( - async move { - if let Err(e) = ProductionBeaconNode::new(context.clone(), config).await { - crit!(log, "Failed to start beacon node"; "reason" => e); - // Ignore the error since it always occurs during normal operation when - // shutting down. - let _ = executor - .shutdown_sender() - .try_send("Failed to start beacon node"); - } - }, - ); + environment.runtime().spawn(async move { + if let Err(e) = ProductionBeaconNode::new(context.clone(), config).await { + crit!(log, "Failed to start beacon node"; "reason" => e); + // Ignore the error since it always occurs during normal operation when + // shutting down. + let _ = executor + .shutdown_sender() + .try_send("Failed to start beacon node"); + } + }); } ("validator_client", Some(matches)) => { let context = environment.core_context(); @@ -301,25 +297,23 @@ fn run( let executor = context.executor.clone(); let config = validator_client::Config::from_cli(&matches, context.log()) .map_err(|e| format!("Unable to initialize validator config: {}", e))?; - environment.runtime().spawn( - async move { - let run = async { - ProductionValidatorClient::new(context, config) - .await? - .start_service()?; - - Ok::<(), String>(()) - }; - if let Err(e) = run.await { - crit!(log, "Failed to start validator client"; "reason" => e); - // Ignore the error since it always occurs during normal operation when - // shutting down. - let _ = executor - .shutdown_sender() - .try_send("Failed to start validator client"); - } - }, - ); + environment.runtime().spawn(async move { + let run = async { + ProductionValidatorClient::new(context, config) + .await? + .start_service()?; + + Ok::<(), String>(()) + }; + if let Err(e) = run.await { + crit!(log, "Failed to start validator client"; "reason" => e); + // Ignore the error since it always occurs during normal operation when + // shutting down. + let _ = executor + .shutdown_sender() + .try_send("Failed to start validator client"); + } + }); } ("remote_signer", Some(matches)) => { if let Err(e) = remote_signer::run(&mut environment, matches) { diff --git a/testing/remote_signer_test/src/api_test_signer.rs b/testing/remote_signer_test/src/api_test_signer.rs index edd8df9c756..8c9b6dc44b0 100644 --- a/testing/remote_signer_test/src/api_test_signer.rs +++ b/testing/remote_signer_test/src/api_test_signer.rs @@ -26,10 +26,7 @@ impl ApiTestSigner { let client = environment .runtime() - .block_on(Client::new( - runtime_context, - &matches, - )) + .block_on(Client::new(runtime_context, &matches)) .map_err(|e| format!("Failed to init Rest API: {}", e)) .unwrap(); diff --git a/testing/simulator/src/eth1_sim.rs b/testing/simulator/src/eth1_sim.rs index 6124f8c1fec..fe748152c4b 100644 --- a/testing/simulator/src/eth1_sim.rs +++ b/testing/simulator/src/eth1_sim.rs @@ -205,9 +205,7 @@ pub fn run_eth1_sim(matches: &ArgMatches) -> Result<(), String> { Ok::<(), String>(()) }; - env.runtime() - .block_on(main_future) - .unwrap(); + env.runtime().block_on(main_future).unwrap(); env.fire_signal(); env.shutdown_on_idle(); diff --git a/testing/simulator/src/no_eth1_sim.rs b/testing/simulator/src/no_eth1_sim.rs index b6b801fbef1..48b9c318bcc 100644 --- a/testing/simulator/src/no_eth1_sim.rs +++ b/testing/simulator/src/no_eth1_sim.rs @@ -158,9 +158,7 @@ pub fn run_no_eth1_sim(matches: &ArgMatches) -> Result<(), String> { Ok::<(), String>(()) }; - env.runtime() - .block_on(main_future) - .unwrap(); + env.runtime().block_on(main_future).unwrap(); env.fire_signal(); env.shutdown_on_idle(); diff --git a/testing/simulator/src/sync_sim.rs b/testing/simulator/src/sync_sim.rs index 2f40b80a115..9da52a35c99 100644 --- a/testing/simulator/src/sync_sim.rs +++ b/testing/simulator/src/sync_sim.rs @@ -130,9 +130,7 @@ fn syncing_sim( Ok::<(), String>(()) }; - env.runtime() - .block_on(main_future) - .unwrap(); + env.runtime().block_on(main_future).unwrap(); env.fire_signal(); env.shutdown_on_idle(); diff --git a/validator_client/src/duties_service.rs b/validator_client/src/duties_service.rs index 730ed4d87d0..0c69a0c2504 100644 --- a/validator_client/src/duties_service.rs +++ b/validator_client/src/duties_service.rs @@ -5,7 +5,7 @@ use crate::{ }; use environment::RuntimeContext; use futures::channel::mpsc::Sender; -use futures::{SinkExt}; +use futures::SinkExt; use parking_lot::RwLock; use slog::{debug, error, trace, warn}; use slot_clock::SlotClock; diff --git a/validator_client/src/http_api/tests.rs b/validator_client/src/http_api/tests.rs index abcc5f20c68..f9ebec71a0e 100644 --- a/validator_client/src/http_api/tests.rs +++ b/validator_client/src/http_api/tests.rs @@ -438,136 +438,126 @@ struct KeystoreValidatorScenario { fn invalid_pubkey() { let runtime = build_runtime(); let weak_runtime = Arc::downgrade(&runtime); - runtime.block_on( - async { - ApiTester::new(weak_runtime) - .await - .invalidate_api_token() - .test_get_lighthouse_version_invalid() - .await; - }, - ); + runtime.block_on(async { + ApiTester::new(weak_runtime) + .await + .invalidate_api_token() + .test_get_lighthouse_version_invalid() + .await; + }); } #[test] fn simple_getters() { let runtime = build_runtime(); let weak_runtime = Arc::downgrade(&runtime); - runtime.block_on( - async { - ApiTester::new(weak_runtime) - .await - .test_get_lighthouse_version() - .await - .test_get_lighthouse_health() - .await - .test_get_lighthouse_spec() - .await; - }, - ); + runtime.block_on(async { + ApiTester::new(weak_runtime) + .await + .test_get_lighthouse_version() + .await + .test_get_lighthouse_health() + .await + .test_get_lighthouse_spec() + .await; + }); } #[test] fn hd_validator_creation() { let runtime = build_runtime(); let weak_runtime = Arc::downgrade(&runtime); - runtime.block_on( - async { - ApiTester::new(weak_runtime) - .await - .assert_enabled_validators_count(0) - .assert_validators_count(0) - .create_hd_validators(HdValidatorScenario { - count: 2, - specify_mnemonic: true, - key_derivation_path_offset: 0, - disabled: vec![], - }) - .await - .assert_enabled_validators_count(2) - .assert_validators_count(2) - .create_hd_validators(HdValidatorScenario { - count: 1, - specify_mnemonic: false, - key_derivation_path_offset: 0, - disabled: vec![0], - }) - .await - .assert_enabled_validators_count(2) - .assert_validators_count(3) - .create_hd_validators(HdValidatorScenario { - count: 0, - specify_mnemonic: true, - key_derivation_path_offset: 4, - disabled: vec![], - }) - .await - .assert_enabled_validators_count(2) - .assert_validators_count(3); - }, - ); + runtime.block_on(async { + ApiTester::new(weak_runtime) + .await + .assert_enabled_validators_count(0) + .assert_validators_count(0) + .create_hd_validators(HdValidatorScenario { + count: 2, + specify_mnemonic: true, + key_derivation_path_offset: 0, + disabled: vec![], + }) + .await + .assert_enabled_validators_count(2) + .assert_validators_count(2) + .create_hd_validators(HdValidatorScenario { + count: 1, + specify_mnemonic: false, + key_derivation_path_offset: 0, + disabled: vec![0], + }) + .await + .assert_enabled_validators_count(2) + .assert_validators_count(3) + .create_hd_validators(HdValidatorScenario { + count: 0, + specify_mnemonic: true, + key_derivation_path_offset: 4, + disabled: vec![], + }) + .await + .assert_enabled_validators_count(2) + .assert_validators_count(3); + }); } #[test] fn validator_enabling() { let runtime = build_runtime(); let weak_runtime = Arc::downgrade(&runtime); - runtime.block_on( - async { - ApiTester::new(weak_runtime) - .await - .create_hd_validators(HdValidatorScenario { - count: 2, - specify_mnemonic: false, - key_derivation_path_offset: 0, - disabled: vec![], - }) - .await - .assert_enabled_validators_count(2) - .assert_validators_count(2) - .set_validator_enabled(0, false) - .await - .assert_enabled_validators_count(1) - .assert_validators_count(2) - .set_validator_enabled(0, true) - .await - .assert_enabled_validators_count(2) - .assert_validators_count(2); - }, - ); + runtime.block_on(async { + ApiTester::new(weak_runtime) + .await + .create_hd_validators(HdValidatorScenario { + count: 2, + specify_mnemonic: false, + key_derivation_path_offset: 0, + disabled: vec![], + }) + .await + .assert_enabled_validators_count(2) + .assert_validators_count(2) + .set_validator_enabled(0, false) + .await + .assert_enabled_validators_count(1) + .assert_validators_count(2) + .set_validator_enabled(0, true) + .await + .assert_enabled_validators_count(2) + .assert_validators_count(2); + }); } #[test] fn keystore_validator_creation() { let runtime = build_runtime(); let weak_runtime = Arc::downgrade(&runtime); - runtime.block_on( - async { - ApiTester::new(weak_runtime) - .await - .assert_enabled_validators_count(0) - .assert_validators_count(0) - .create_keystore_validators(KeystoreValidatorScenario { - correct_password: true, - enabled: true, - }) - .await - .assert_enabled_validators_count(1) - .assert_validators_count(1) - .create_keystore_validators(KeystoreValidatorScenario { - correct_password: false, - enabled: true, - }) - .await - .assert_enabled_validators_count(1) - .assert_validators_count(1) - .create_keystore_validators(KeystoreValidatorScenario { - correct_password: true, - enabled: false, - }) - .await - .assert_enabled_validators_count(1) - .assert_validators_count(2); - }, - ); + runtime.block_on(async { + ApiTester::new(weak_runtime) + .await + .assert_enabled_validators_count(0) + .assert_validators_count(0) + .create_keystore_validators(KeystoreValidatorScenario { + correct_password: true, + enabled: true, + }) + .await + .assert_enabled_validators_count(1) + .assert_validators_count(1) + .create_keystore_validators(KeystoreValidatorScenario { + correct_password: false, + enabled: true, + }) + .await + .assert_enabled_validators_count(1) + .assert_validators_count(1) + .create_keystore_validators(KeystoreValidatorScenario { + correct_password: true, + enabled: false, + }) + .await + .assert_enabled_validators_count(1) + .assert_validators_count(2); + }); } From 2c4ad9aa928ba280b610fc6c4f2c1520a4bb2bc2 Mon Sep 17 00:00:00 2001 From: realbigsean Date: Mon, 25 Jan 2021 13:45:47 -0500 Subject: [PATCH 07/17] remove commented out code, fix notifier --- beacon_node/http_api/src/lib.rs | 22 ---------------------- validator_client/src/notifier.rs | 3 ++- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/beacon_node/http_api/src/lib.rs b/beacon_node/http_api/src/lib.rs index 17732a7d0ba..1b0e246e2c1 100644 --- a/beacon_node/http_api/src/lib.rs +++ b/beacon_node/http_api/src/lib.rs @@ -2356,28 +2356,6 @@ pub fn serve( }) }); - // fn stream_events(mut receiver: Receiver>) - // -> impl Stream, RecvError>> + Unpin + Send + 'static where ::MaxValidatorsPerCommittee: Unpin - // { - // async_stream::try_stream! { - // loop { - // let event = receiver.recv().await?; - // yield event; - // } - // } - // } - // - // fn merge_streams( - // stream_map: StreamMap< - // String, - // impl Stream, RecvError>> + Send + Unpin + 'static, - // >, - // ) -> impl Stream> + 'static { - // - // // Convert messages into Server-Sent Events and return resulting stream. - // stream_map - // } - let get_events = eth1_v1 .and(warp::path("events")) .and(warp::path::end()) diff --git a/validator_client/src/notifier.rs b/validator_client/src/notifier.rs index 907fddb7cf4..beaa5b69767 100644 --- a/validator_client/src/notifier.rs +++ b/validator_client/src/notifier.rs @@ -18,12 +18,13 @@ pub fn spawn_notifier(client: &ProductionValidatorClient) -> Resu // Run the notifier half way through each slot. let start_instant = Instant::now() + duration_to_next_slot + (slot_duration / 2); - let _interval = interval_at(start_instant, slot_duration); + let mut interval = interval_at(start_instant, slot_duration); let interval_fut = async move { let log = context.log(); loop { + interval.tick().await; let num_available = duties_service.beacon_nodes.num_available().await; let num_synced = duties_service.beacon_nodes.num_synced().await; let num_total = duties_service.beacon_nodes.num_total().await; From 8731dc7fbdd496ee64d0cf27345629fb29af64e3 Mon Sep 17 00:00:00 2001 From: realbigsean Date: Mon, 25 Jan 2021 14:19:39 -0500 Subject: [PATCH 08/17] remove unused deps --- Cargo.lock | 2 -- lcli/Cargo.toml | 1 - lighthouse/Cargo.toml | 1 - 3 files changed, 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 56e3c195b1f..2289ed54fdf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3343,7 +3343,6 @@ dependencies = [ "simple_logger", "state_processing", "tokio 1.0.2", - "tokio-compat-02", "tree_hash", "types", "validator_dir", @@ -3748,7 +3747,6 @@ dependencies = [ "sloggers", "tempfile", "tokio 1.0.2", - "tokio-compat-02", "types", "validator_client", "validator_dir", diff --git a/lcli/Cargo.toml b/lcli/Cargo.toml index 61407cf74bf..125b6fb619d 100644 --- a/lcli/Cargo.toml +++ b/lcli/Cargo.toml @@ -37,4 +37,3 @@ lighthouse_version = { path = "../common/lighthouse_version" } directory = { path = "../common/directory" } account_utils = { path = "../common/account_utils" } eth2_wallet = { path = "../crypto/eth2_wallet" } -tokio-compat-02 = "0.1" diff --git a/lighthouse/Cargo.toml b/lighthouse/Cargo.toml index 59f94b850fe..bca53bf69ad 100644 --- a/lighthouse/Cargo.toml +++ b/lighthouse/Cargo.toml @@ -41,7 +41,6 @@ directory = { path = "../common/directory" } lighthouse_version = { path = "../common/lighthouse_version" } account_utils = { path = "../common/account_utils" } remote_signer = { "path" = "../remote_signer" } -tokio-compat-02 = "0.1" [dev-dependencies] tempfile = "3.1.0" From ef457ba04e8e5b7a7560ca617f8aa9a4f4c91197 Mon Sep 17 00:00:00 2001 From: realbigsean Date: Mon, 25 Jan 2021 18:05:13 -0500 Subject: [PATCH 09/17] update to tokio 1.1 --- Cargo.lock | 78 ++++++++++++++--------------- beacon_node/beacon_chain/Cargo.toml | 2 +- beacon_node/client/Cargo.toml | 2 +- beacon_node/client/src/notifier.rs | 2 +- boot_node/Cargo.toml | 2 +- lighthouse/Cargo.toml | 2 +- testing/simulator/Cargo.toml | 2 +- 7 files changed, 45 insertions(+), 45 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2289ed54fdf..d2537816a9c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -31,7 +31,7 @@ dependencies = [ "slog-term", "slot_clock", "tempfile", - "tokio 1.0.2", + "tokio 1.1.0", "types", "validator_dir", ] @@ -640,7 +640,7 @@ dependencies = [ "strum", "task_executor", "tempfile", - "tokio 1.0.2", + "tokio 1.1.0", "tree_hash", "types", ] @@ -677,7 +677,7 @@ dependencies = [ "slog-term", "store", "task_executor", - "tokio 1.0.2", + "tokio 1.1.0", "types", ] @@ -877,7 +877,7 @@ dependencies = [ "slog-stdlog", "slog-term", "sloggers", - "tokio 1.0.2", + "tokio 1.1.0", "types", ] @@ -1134,7 +1134,7 @@ dependencies = [ "task_executor", "time 0.2.24", "timer", - "tokio 1.0.2", + "tokio 1.1.0", "toml", "tree_hash", "types", @@ -1652,7 +1652,7 @@ dependencies = [ "rlp", "sha2 0.9.2", "smallvec", - "tokio 1.0.2", + "tokio 1.1.0", "tokio-stream", "tokio-util 0.6.2", "tracing", @@ -1824,7 +1824,7 @@ dependencies = [ "slog-term", "sloggers", "task_executor", - "tokio 1.0.2", + "tokio 1.1.0", "types", ] @@ -1863,7 +1863,7 @@ dependencies = [ "sloggers", "state_processing", "task_executor", - "tokio 1.0.2", + "tokio 1.1.0", "tokio-compat-02", "toml", "tree_hash", @@ -1878,7 +1878,7 @@ dependencies = [ "deposit_contract", "futures 0.3.12", "serde_json", - "tokio 1.0.2", + "tokio 1.1.0", "tokio-compat-02", "types", "web3", @@ -2018,7 +2018,7 @@ dependencies = [ "task_executor", "tempfile", "tiny-keccak 2.0.2", - "tokio 1.0.2", + "tokio 1.1.0", "tokio-io-timeout", "tokio-stream", "tokio-util 0.6.2", @@ -2507,7 +2507,7 @@ dependencies = [ "serde_derive", "slog", "state_processing", - "tokio 1.0.2", + "tokio 1.1.0", "tokio-compat-02", "tree_hash", "types", @@ -2637,7 +2637,7 @@ dependencies = [ "http", "indexmap", "slab", - "tokio 1.0.2", + "tokio 1.1.0", "tokio-util 0.6.2", "tracing", "tracing-futures", @@ -2672,7 +2672,7 @@ name = "hashset_delay" version = "0.2.0" dependencies = [ "futures 0.3.12", - "tokio 1.0.2", + "tokio 1.1.0", "tokio-util 0.6.2", ] @@ -2849,7 +2849,7 @@ dependencies = [ "slot_clock", "state_processing", "store", - "tokio 1.0.2", + "tokio 1.1.0", "tokio-stream", "tree_hash", "types", @@ -2874,7 +2874,7 @@ dependencies = [ "slog", "slot_clock", "store", - "tokio 1.0.2", + "tokio 1.1.0", "types", "warp", "warp_utils", @@ -2916,7 +2916,7 @@ dependencies = [ "serde", "serde_json", "serde_regex", - "tokio 1.0.2", + "tokio 1.1.0", ] [[package]] @@ -2967,7 +2967,7 @@ dependencies = [ "itoa", "pin-project 1.0.4", "socket2", - "tokio 1.0.2", + "tokio 1.1.0", "tower-service", "tracing", "want", @@ -3013,7 +3013,7 @@ dependencies = [ "bytes 1.0.1", "hyper 0.14.2", "native-tls", - "tokio 1.0.2", + "tokio 1.1.0", "tokio-native-tls", ] @@ -3342,7 +3342,7 @@ dependencies = [ "serde_yaml", "simple_logger", "state_processing", - "tokio 1.0.2", + "tokio 1.1.0", "tree_hash", "types", "validator_dir", @@ -3648,7 +3648,7 @@ dependencies = [ "libp2p-core 0.27.0", "log", "socket2", - "tokio 1.0.2", + "tokio 1.1.0", ] [[package]] @@ -3746,7 +3746,7 @@ dependencies = [ "slog-term", "sloggers", "tempfile", - "tokio 1.0.2", + "tokio 1.1.0", "types", "validator_client", "validator_dir", @@ -4191,7 +4191,7 @@ dependencies = [ "strum", "task_executor", "tempfile", - "tokio 1.0.2", + "tokio 1.1.0", "tokio-stream", "tree_hash", "types", @@ -5243,7 +5243,7 @@ dependencies = [ "remote_signer_test", "reqwest", "serde", - "tokio 1.0.2", + "tokio 1.1.0", "types", ] @@ -5261,7 +5261,7 @@ dependencies = [ "serde", "serde_json", "tempfile", - "tokio 1.0.2", + "tokio 1.1.0", "types", ] @@ -5300,7 +5300,7 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", - "tokio 1.0.2", + "tokio 1.1.0", "tokio-native-tls", "url", "wasm-bindgen", @@ -5797,7 +5797,7 @@ dependencies = [ "node_test_rig", "parking_lot", "rayon", - "tokio 1.0.2", + "tokio 1.1.0", "types", "validator_client", ] @@ -5855,7 +5855,7 @@ dependencies = [ "slot_clock", "state_processing", "task_executor", - "tokio 1.0.2", + "tokio 1.1.0", "tokio-stream", "types", ] @@ -6311,7 +6311,7 @@ dependencies = [ "lazy_static", "lighthouse_metrics", "slog", - "tokio 1.0.2", + "tokio 1.1.0", ] [[package]] @@ -6471,7 +6471,7 @@ dependencies = [ "slog", "slot_clock", "task_executor", - "tokio 1.0.2", + "tokio 1.1.0", "types", ] @@ -6573,9 +6573,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.0.2" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ca04cec6ff2474c638057b65798f60ac183e5e79d3448bb7163d36a39cff6ec" +checksum = "8efab2086f17abcddb8f756117665c958feee6b2e39974c2f1600592ab3a4195" dependencies = [ "autocfg 1.0.1", "bytes 1.0.1", @@ -6611,7 +6611,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90c49f106be240de154571dd31fbe48acb10ba6c6dd6f6517ad603abffa42de9" dependencies = [ "pin-project-lite 0.2.4", - "tokio 1.0.2", + "tokio 1.1.0", ] [[package]] @@ -6643,7 +6643,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" dependencies = [ "native-tls", - "tokio 1.0.2", + "tokio 1.1.0", ] [[package]] @@ -6654,7 +6654,7 @@ checksum = "76066865172052eb8796c686f0b441a93df8b08d40a950b062ffb9a426f00edd" dependencies = [ "futures-core", "pin-project-lite 0.2.4", - "tokio 1.0.2", + "tokio 1.1.0", ] [[package]] @@ -6676,7 +6676,7 @@ dependencies = [ "futures-util", "log", "pin-project 1.0.4", - "tokio 1.0.2", + "tokio 1.1.0", "tungstenite", ] @@ -6723,7 +6723,7 @@ dependencies = [ "log", "pin-project-lite 0.2.4", "slab", - "tokio 1.0.2", + "tokio 1.1.0", "tokio-stream", ] @@ -7135,7 +7135,7 @@ dependencies = [ "slog-term", "slot_clock", "tempfile", - "tokio 1.0.2", + "tokio 1.1.0", "tree_hash", "types", "validator_dir", @@ -7239,7 +7239,7 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", - "tokio 1.0.2", + "tokio 1.1.0", "tokio-stream", "tokio-tungstenite", "tokio-util 0.6.2", @@ -7260,7 +7260,7 @@ dependencies = [ "safe_arith", "serde", "state_processing", - "tokio 1.0.2", + "tokio 1.1.0", "types", "warp", ] diff --git a/beacon_node/beacon_chain/Cargo.toml b/beacon_node/beacon_chain/Cargo.toml index 70b1ab3b1f1..3bc77c245db 100644 --- a/beacon_node/beacon_chain/Cargo.toml +++ b/beacon_node/beacon_chain/Cargo.toml @@ -40,7 +40,7 @@ eth2_ssz_derive = "0.1.0" state_processing = { path = "../../consensus/state_processing" } tree_hash = "0.1.1" types = { path = "../../consensus/types" } -tokio = "1.0.2" +tokio = "1.1.0" eth1 = { path = "../eth1" } futures = "0.3.7" genesis = { path = "../genesis" } diff --git a/beacon_node/client/Cargo.toml b/beacon_node/client/Cargo.toml index 42d21edaa85..28dea4055d6 100644 --- a/beacon_node/client/Cargo.toml +++ b/beacon_node/client/Cargo.toml @@ -26,7 +26,7 @@ error-chain = "0.12.4" serde_yaml = "0.8.13" slog = { version = "2.5.2", features = ["max_level_trace"] } slog-async = "2.5.0" -tokio = "1.0.2" +tokio = "1.1.0" dirs = "3.0.1" futures = "0.3.7" reqwest = { version = "0.11.0", features = ["native-tls-vendored"] } diff --git a/beacon_node/client/src/notifier.rs b/beacon_node/client/src/notifier.rs index e38f5199fc9..79ed0e01dfd 100644 --- a/beacon_node/client/src/notifier.rs +++ b/beacon_node/client/src/notifier.rs @@ -217,7 +217,7 @@ fn eth1_logging(beacon_chain: &BeaconChain, log: &Logger / beacon_chain.spec.seconds_per_eth1_block }) .map(|distance| distance.to_string()) - .unwrap_or_else(|| "initializing deposits".to_string()); + .unwrap_or("initializing deposits".to_string()); warn!( log, diff --git a/boot_node/Cargo.toml b/boot_node/Cargo.toml index 319270662a7..2179c0f60c7 100644 --- a/boot_node/Cargo.toml +++ b/boot_node/Cargo.toml @@ -13,7 +13,7 @@ eth2_network_config = { path = "../common/eth2_network_config" } eth2_ssz = "0.1.2" slog = "2.5.2" sloggers = "1.0.1" -tokio = "1.0.2" +tokio = "1.1.0" log = "0.4.11" slog-term = "2.6.0" logging = { path = "../common/logging" } diff --git a/lighthouse/Cargo.toml b/lighthouse/Cargo.toml index bca53bf69ad..d2ec5bb39f9 100644 --- a/lighthouse/Cargo.toml +++ b/lighthouse/Cargo.toml @@ -20,7 +20,7 @@ spec-v12 = [] [dependencies] beacon_node = { "path" = "../beacon_node" } -tokio = "1.0.2" +tokio = "1.1.0" slog = { version = "2.5.2", features = ["max_level_trace"] } sloggers = "1.0.1" types = { "path" = "../consensus/types" } diff --git a/testing/simulator/Cargo.toml b/testing/simulator/Cargo.toml index dea35487880..549520c5a0a 100644 --- a/testing/simulator/Cargo.toml +++ b/testing/simulator/Cargo.toml @@ -13,7 +13,7 @@ types = { path = "../../consensus/types" } validator_client = { path = "../../validator_client" } parking_lot = "0.11.0" futures = "0.3.7" -tokio = "1.0.2" +tokio = "1.1.0" eth1_test_rig = { path = "../eth1_test_rig" } env_logger = "0.8.2" clap = "2.33.3" From 67ecdf46c6942385a2f6065d02fabb42fee4b572 Mon Sep 17 00:00:00 2001 From: realbigsean Date: Mon, 25 Jan 2021 18:38:56 -0500 Subject: [PATCH 10/17] update to tokio 1.1 --- beacon_node/client/src/notifier.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beacon_node/client/src/notifier.rs b/beacon_node/client/src/notifier.rs index 79ed0e01dfd..e38f5199fc9 100644 --- a/beacon_node/client/src/notifier.rs +++ b/beacon_node/client/src/notifier.rs @@ -217,7 +217,7 @@ fn eth1_logging(beacon_chain: &BeaconChain, log: &Logger / beacon_chain.spec.seconds_per_eth1_block }) .map(|distance| distance.to_string()) - .unwrap_or("initializing deposits".to_string()); + .unwrap_or_else(|| "initializing deposits".to_string()); warn!( log, From 9083607fe94fa473f1450fc65219f0f569edd7cb Mon Sep 17 00:00:00 2001 From: realbigsean Date: Mon, 25 Jan 2021 19:30:16 -0500 Subject: [PATCH 11/17] update tokio to 1.1 --- account_manager/Cargo.toml | 2 +- beacon_node/Cargo.toml | 2 +- beacon_node/eth1/Cargo.toml | 2 +- beacon_node/eth2_libp2p/Cargo.toml | 4 ++-- beacon_node/genesis/Cargo.toml | 2 +- beacon_node/http_api/Cargo.toml | 2 +- beacon_node/http_metrics/Cargo.toml | 2 +- beacon_node/network/Cargo.toml | 2 +- beacon_node/timer/Cargo.toml | 2 +- common/hashset_delay/Cargo.toml | 2 +- common/remote_signer_consumer/Cargo.toml | 2 +- common/rest_types/Cargo.toml | 2 +- common/task_executor/Cargo.toml | 2 +- common/warp_utils/Cargo.toml | 2 +- lcli/Cargo.toml | 2 +- lighthouse/environment/Cargo.toml | 2 +- slasher/service/Cargo.toml | 2 +- testing/eth1_test_rig/Cargo.toml | 2 +- testing/remote_signer_test/Cargo.toml | 2 +- validator_client/Cargo.toml | 4 ++-- 20 files changed, 22 insertions(+), 22 deletions(-) diff --git a/account_manager/Cargo.toml b/account_manager/Cargo.toml index 3402f3264b2..93b06c18aee 100644 --- a/account_manager/Cargo.toml +++ b/account_manager/Cargo.toml @@ -27,7 +27,7 @@ eth2_wallet = { path = "../crypto/eth2_wallet" } eth2_wallet_manager = { path = "../common/eth2_wallet_manager" } rand = "0.7.3" validator_dir = { path = "../common/validator_dir" } -tokio = { version = "1.0.2", features = ["full"] } +tokio = { version = "1.1.0", features = ["full"] } eth2_keystore = { path = "../crypto/eth2_keystore" } account_utils = { path = "../common/account_utils" } slashing_protection = { path = "../validator_client/slashing_protection" } diff --git a/beacon_node/Cargo.toml b/beacon_node/Cargo.toml index 82b3e15d210..00379d76272 100644 --- a/beacon_node/Cargo.toml +++ b/beacon_node/Cargo.toml @@ -26,7 +26,7 @@ slog = { version = "2.5.2", features = ["max_level_trace", "release_max_level_tr slog-term = "2.6.0" slog-async = "2.5.0" ctrlc = { version = "3.1.6", features = ["termination"] } -tokio = { version = "1.0.2", features = ["time"] } +tokio = { version = "1.1.0", features = ["time"] } exit-future = "0.2.0" dirs = "3.0.1" logging = { path = "../common/logging" } diff --git a/beacon_node/eth1/Cargo.toml b/beacon_node/eth1/Cargo.toml index fe5cd84420f..bf4835d7104 100644 --- a/beacon_node/eth1/Cargo.toml +++ b/beacon_node/eth1/Cargo.toml @@ -26,7 +26,7 @@ tree_hash = "0.1.1" eth2_hashing = "0.1.0" parking_lot = "0.11.0" slog = "2.5.2" -tokio = { version = "1.0.2", features = ["full"] } +tokio = { version = "1.1.0", features = ["full"] } state_processing = { path = "../../consensus/state_processing" } libflate = "1.0.2" lighthouse_metrics = { path = "../../common/lighthouse_metrics"} diff --git a/beacon_node/eth2_libp2p/Cargo.toml b/beacon_node/eth2_libp2p/Cargo.toml index b57e696172a..8128d75e8b1 100644 --- a/beacon_node/eth2_libp2p/Cargo.toml +++ b/beacon_node/eth2_libp2p/Cargo.toml @@ -16,7 +16,7 @@ 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.0.2", features = ["time", "macros"] } +tokio = { version = "1.1.0", features = ["time", "macros"] } futures = "0.3.7" futures-io = "0.3.7" error-chain = "0.12.4" @@ -48,7 +48,7 @@ default-features = false features = ["websocket", "identify", "mplex", "yamux", "noise", "gossipsub", "dns", "tcp-tokio"] [dev-dependencies] -tokio = { version = "1.0.2", features = ["full"] } +tokio = { version = "1.1.0", features = ["full"] } slog-term = "2.6.0" slog-async = "2.5.0" tempfile = "3.1.0" diff --git a/beacon_node/genesis/Cargo.toml b/beacon_node/genesis/Cargo.toml index 0e65d27c92c..ef9f214011c 100644 --- a/beacon_node/genesis/Cargo.toml +++ b/beacon_node/genesis/Cargo.toml @@ -19,7 +19,7 @@ merkle_proof = { path = "../../consensus/merkle_proof" } eth2_ssz = "0.1.2" eth2_hashing = "0.1.0" tree_hash = "0.1.1" -tokio = { version = "1.0.2", features = ["full"] } +tokio = { version = "1.1.0", features = ["full"] } parking_lot = "0.11.0" slog = "2.5.2" exit-future = "0.2.0" diff --git a/beacon_node/http_api/Cargo.toml b/beacon_node/http_api/Cargo.toml index d148330adda..500e2455406 100644 --- a/beacon_node/http_api/Cargo.toml +++ b/beacon_node/http_api/Cargo.toml @@ -8,7 +8,7 @@ edition = "2018" async-stream = "0.3.0" warp = "0.3.0" serde = { version = "1.0.116", features = ["derive"] } -tokio = { version = "1.0.2", features = ["macros","sync"] } +tokio = { version = "1.1.0", features = ["macros","sync"] } tokio-stream = "0.1.2" parking_lot = "0.11.0" types = { path = "../../consensus/types" } diff --git a/beacon_node/http_metrics/Cargo.toml b/beacon_node/http_metrics/Cargo.toml index 915ef8dbf61..42bf60f0011 100644 --- a/beacon_node/http_metrics/Cargo.toml +++ b/beacon_node/http_metrics/Cargo.toml @@ -22,7 +22,7 @@ lighthouse_version = { path = "../../common/lighthouse_version" } warp_utils = { path = "../../common/warp_utils" } [dev-dependencies] -tokio = { version = "1.0.2", features = ["sync"] } +tokio = { version = "1.1.0", features = ["sync"] } reqwest = { version = "0.11.0", features = ["json"] } environment = { path = "../../lighthouse/environment" } types = { path = "../../consensus/types" } diff --git a/beacon_node/network/Cargo.toml b/beacon_node/network/Cargo.toml index 8950fe3b794..bd9d1caf490 100644 --- a/beacon_node/network/Cargo.toml +++ b/beacon_node/network/Cargo.toml @@ -30,7 +30,7 @@ eth2_ssz_types = { path = "../../consensus/ssz_types" } tree_hash = "0.1.1" futures = "0.3.7" error-chain = "0.12.4" -tokio = { version = "1.0.2", features = ["full"] } +tokio = { version = "1.1.0", features = ["full"] } tokio-stream = "0.1.2" parking_lot = "0.11.0" smallvec = "1.6.1" diff --git a/beacon_node/timer/Cargo.toml b/beacon_node/timer/Cargo.toml index 8b8caf76d21..d45a214b388 100644 --- a/beacon_node/timer/Cargo.toml +++ b/beacon_node/timer/Cargo.toml @@ -8,7 +8,7 @@ edition = "2018" beacon_chain = { path = "../beacon_chain" } types = { path = "../../consensus/types" } slot_clock = { path = "../../common/slot_clock" } -tokio = { version = "1.0.2", features = ["full"] } +tokio = { version = "1.1.0", features = ["full"] } slog = "2.5.2" parking_lot = "0.11.0" futures = "0.3.7" diff --git a/common/hashset_delay/Cargo.toml b/common/hashset_delay/Cargo.toml index 86827ac6e23..80e5e9e2b6e 100644 --- a/common/hashset_delay/Cargo.toml +++ b/common/hashset_delay/Cargo.toml @@ -9,4 +9,4 @@ futures = "0.3.7" tokio-util = { version = "0.6.2", features = ["time"] } [dev-dependencies] -tokio = { version = "1.0.2", features = ["time", "rt-multi-thread", "macros"] } +tokio = { version = "1.1.0", features = ["time", "rt-multi-thread", "macros"] } diff --git a/common/remote_signer_consumer/Cargo.toml b/common/remote_signer_consumer/Cargo.toml index ee951aada71..67279715c98 100644 --- a/common/remote_signer_consumer/Cargo.toml +++ b/common/remote_signer_consumer/Cargo.toml @@ -11,5 +11,5 @@ remote_signer_test = { path = "../../testing/remote_signer_test" } [dependencies] reqwest = { version = "0.11.0", features = ["json"] } serde = { version = "1.0.116", features = ["derive"] } -tokio = { version = "1.0.2", features = ["time"] } +tokio = { version = "1.1.0", features = ["time"] } types = { path = "../../consensus/types" } diff --git a/common/rest_types/Cargo.toml b/common/rest_types/Cargo.toml index ac7ae347364..acb7ff379a6 100644 --- a/common/rest_types/Cargo.toml +++ b/common/rest_types/Cargo.toml @@ -15,7 +15,7 @@ bls = { path = "../../crypto/bls" } serde = { version = "1.0.110", features = ["derive"] } rayon = "1.3.0" hyper = "0.14.2" -tokio = { version = "1.0.2", features = ["sync"] } +tokio = { version = "1.1.0", features = ["sync"] } environment = { path = "../../lighthouse/environment" } store = { path = "../../beacon_node/store" } beacon_chain = { path = "../../beacon_node/beacon_chain" } diff --git a/common/task_executor/Cargo.toml b/common/task_executor/Cargo.toml index aa2c6139a96..5f142522c52 100644 --- a/common/task_executor/Cargo.toml +++ b/common/task_executor/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Sigma Prime "] edition = "2018" [dependencies] -tokio = { version = "1.0.2", features = ["rt"] } +tokio = { version = "1.1.0", features = ["rt"] } slog = "2.5.2" futures = "0.3.7" exit-future = "0.2.0" diff --git a/common/warp_utils/Cargo.toml b/common/warp_utils/Cargo.toml index 7346d867b21..d227f5e1e7b 100644 --- a/common/warp_utils/Cargo.toml +++ b/common/warp_utils/Cargo.toml @@ -14,7 +14,7 @@ beacon_chain = { path = "../../beacon_node/beacon_chain" } state_processing = { path = "../../consensus/state_processing" } safe_arith = { path = "../../consensus/safe_arith" } serde = { version = "1.0.116", features = ["derive"] } -tokio = { version = "1.0.2", features = ["sync"] } +tokio = { version = "1.1.0", features = ["sync"] } headers = "0.3.2" lighthouse_metrics = { path = "../lighthouse_metrics" } lazy_static = "1.4.0" diff --git a/lcli/Cargo.toml b/lcli/Cargo.toml index 125b6fb619d..a61fbaa8df0 100644 --- a/lcli/Cargo.toml +++ b/lcli/Cargo.toml @@ -27,7 +27,7 @@ dirs = "3.0.1" genesis = { path = "../beacon_node/genesis" } deposit_contract = { path = "../common/deposit_contract" } tree_hash = "0.1.1" -tokio = { version = "1.0.2", features = ["full"] } +tokio = { version = "1.1.0", features = ["full"] } clap_utils = { path = "../common/clap_utils" } eth2_libp2p = { path = "../beacon_node/eth2_libp2p" } validator_dir = { path = "../common/validator_dir", features = ["insecure_keys"] } diff --git a/lighthouse/environment/Cargo.toml b/lighthouse/environment/Cargo.toml index 6632d1d3bf7..6e0556a6d2d 100644 --- a/lighthouse/environment/Cargo.toml +++ b/lighthouse/environment/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Paul Hauner "] edition = "2018" [dependencies] -tokio = { version = "1.0.2", features = ["macros", "rt", "rt-multi-thread" ] } +tokio = { version = "1.1.0", features = ["macros", "rt", "rt-multi-thread" ] } slog = { version = "2.5.2", features = ["max_level_trace"] } sloggers = "1.0.1" types = { "path" = "../../consensus/types" } diff --git a/slasher/service/Cargo.toml b/slasher/service/Cargo.toml index 0c85ea24829..ddc32119603 100644 --- a/slasher/service/Cargo.toml +++ b/slasher/service/Cargo.toml @@ -14,6 +14,6 @@ slog = "2.5.2" slot_clock = { path = "../../common/slot_clock" } state_processing = { path = "../../consensus/state_processing" } task_executor = { path = "../../common/task_executor" } -tokio = { version = "1.0.2", features = ["full"] } +tokio = { version = "1.1.0", features = ["full"] } tokio-stream = "0.1.2" types = { path = "../../consensus/types" } diff --git a/testing/eth1_test_rig/Cargo.toml b/testing/eth1_test_rig/Cargo.toml index 0fd880e86f1..7f0ad6daf9f 100644 --- a/testing/eth1_test_rig/Cargo.toml +++ b/testing/eth1_test_rig/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Paul Hauner "] edition = "2018" [dependencies] -tokio = { version = "1.0.2", features = ["time"] } +tokio = { version = "1.1.0", features = ["time"] } tokio-compat-02 = "0.1" web3 = "0.14.0" futures = "0.3.7" diff --git a/testing/remote_signer_test/Cargo.toml b/testing/remote_signer_test/Cargo.toml index e6485fa1832..08dd0b5387f 100644 --- a/testing/remote_signer_test/Cargo.toml +++ b/testing/remote_signer_test/Cargo.toml @@ -15,5 +15,5 @@ reqwest = { version = "0.11.0", features = ["blocking", "json"] } serde = { version = "1.0.116", features = ["derive"] } serde_json = "1.0.58" tempfile = "3.1.0" -tokio = { version = "1.0.2", features = ["time"] } +tokio = { version = "1.1.0", features = ["time"] } types = { path = "../../consensus/types" } diff --git a/validator_client/Cargo.toml b/validator_client/Cargo.toml index 14d53797c98..ac282ffc2ff 100644 --- a/validator_client/Cargo.toml +++ b/validator_client/Cargo.toml @@ -9,7 +9,7 @@ name = "validator_client" path = "src/lib.rs" [dev-dependencies] -tokio = { version = "1.0.2", features = ["time", "rt-multi-thread", "macros"] } +tokio = { version = "1.1.0", features = ["time", "rt-multi-thread", "macros"] } deposit_contract = { path = "../common/deposit_contract" } [dependencies] @@ -29,7 +29,7 @@ serde_yaml = "0.8.13" slog = { version = "2.5.2", features = ["max_level_trace", "release_max_level_trace"] } slog-async = "2.5.0" slog-term = "2.6.0" -tokio = { version = "1.0.2", features = ["time"] } +tokio = { version = "1.1.0", features = ["time"] } futures = "0.3.7" dirs = "3.0.1" directory = { path = "../common/directory" } From 3e449d9e419d15a2c8ea4859a92e48d47a48d189 Mon Sep 17 00:00:00 2001 From: realbigsean Date: Tue, 26 Jan 2021 09:17:28 -0500 Subject: [PATCH 12/17] update `BroadcastStream` to keep up with the upstream --- beacon_node/http_api/src/broadcast_stream.rs | 44 +++++++++++++++----- 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/beacon_node/http_api/src/broadcast_stream.rs b/beacon_node/http_api/src/broadcast_stream.rs index f741eea3cc6..fc4a6dc32e1 100644 --- a/beacon_node/http_api/src/broadcast_stream.rs +++ b/beacon_node/http_api/src/broadcast_stream.rs @@ -1,27 +1,45 @@ use crate::Stream; -use async_stream::try_stream; +use async_stream::stream; use std::pin::Pin; use tokio::sync::broadcast::error::RecvError; use tokio::sync::broadcast::Receiver; +use std::fmt; use std::task::{Context, Poll}; -/// A wrapper around [`Receiver`] that implements [`Stream`]. Achieved by using the [`async-stream`] crate. +// TODO: this should be replaced with the tokio's `BroadcastStream` once it's added to +// tokio-stream (https://github.com/tokio-rs/tokio/pull/3384) + +/// A wrapper around [`tokio::sync::broadcast::Receiver`] that implements [`Stream`]. /// -/// [`Receiver`]: struct@tokio::sync::broadcast::Receiver +/// [`tokio::sync::broadcast::Receiver`]: struct@tokio::sync::broadcast::Receiver /// [`Stream`]: trait@crate::Stream -/// [`async-stream`]: https://docs.rs/async-stream -pub struct BroadcastStream { - inner: Pin> + Send + Sync>>, +pub struct BroadcastStream { + inner: Pin> + Send + Sync>>, +} + +/// An error returned from the inner stream of a [`BroadcastStream`]. +#[derive(Debug, PartialEq)] +pub enum BroadcastStreamRecvError { + /// The receiver lagged too far behind. Attempting to receive again will + /// return the oldest message still retained by the channel. + /// + /// Includes the number of skipped messages. + Lagged(u64), } impl BroadcastStream { /// Create a new `BroadcastStream`. pub fn new(mut rx: Receiver) -> Self { - let stream = try_stream! { + let stream = stream! { loop { - let item = rx.recv().await?; - yield item; + match rx.recv().await { + Ok(item) => yield Ok(item), + Err(err) => match err { + RecvError::Closed => break, + RecvError::Lagged(n) => yield Err(BroadcastStreamRecvError::Lagged(n)), + }, + } } }; Self { @@ -31,9 +49,15 @@ impl BroadcastStream { } impl Stream for BroadcastStream { - type Item = Result; + type Item = Result; fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { Pin::new(&mut self.inner).poll_next(cx) } } + +impl fmt::Debug for BroadcastStream { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("BroadcastStream").finish() + } +} From 39f1263a6f29409bfac88058a7b045ce749c4704 Mon Sep 17 00:00:00 2001 From: realbigsean Date: Tue, 26 Jan 2021 10:11:38 -0500 Subject: [PATCH 13/17] update discv5 to my fork --- Cargo.lock | 212 ++++++----------------------- beacon_node/eth2_libp2p/Cargo.toml | 2 +- beacon_node/http_api/Cargo.toml | 2 +- 3 files changed, 40 insertions(+), 176 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d2537816a9c..75841497c48 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -611,7 +611,7 @@ dependencies = [ "genesis", "int_to_bytes", "integer-sqrt", - "itertools 0.9.0", + "itertools", "lazy_static", "lighthouse_metrics", "log", @@ -1261,7 +1261,7 @@ dependencies = [ "clap", "criterion-plot", "csv", - "itertools 0.9.0", + "itertools", "lazy_static", "num-traits", "oorandom", @@ -1283,7 +1283,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e022feadec601fba1649cfa83586381a4ad31c6bf3a9ab7d408118b05dd9889d" dependencies = [ "cast", - "itertools 0.9.0", + "itertools", ] [[package]] @@ -1632,7 +1632,7 @@ checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" [[package]] name = "discv5" version = "0.1.0-beta.2" -source = "git+https://github.com/sigp/discv5?branch=master#c4f3e1e1221a6d7cffaeae8a9680652d2408eef9" +source = "git+https://github.com/realbigsean/discv5?rev=e1fd56eefcf88d6f5281eccdbf24ed8f1ee52f92#e1fd56eefcf88d6f5281eccdbf24ed8f1ee52f92" dependencies = [ "aes-ctr", "aes-gcm 0.8.0", @@ -1645,7 +1645,7 @@ dependencies = [ "hkdf", "k256", "lazy_static", - "libp2p-core 0.25.2", + "libp2p-core", "lru_time_cache", "parking_lot", "rand 0.7.3", @@ -2177,7 +2177,7 @@ checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" name = "fallback" version = "0.1.0" dependencies = [ - "itertools 0.9.0", + "itertools", ] [[package]] @@ -3190,15 +3190,6 @@ dependencies = [ "waker-fn", ] -[[package]] -name = "itertools" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.9.0" @@ -3284,7 +3275,7 @@ dependencies = [ "bit-set", "diff", "ena", - "itertools 0.9.0", + "itertools", "lalrpop-util", "petgraph", "pico-args", @@ -3426,7 +3417,7 @@ dependencies = [ "bytes 1.0.1", "futures 0.3.12", "lazy_static", - "libp2p-core 0.27.0", + "libp2p-core", "libp2p-core-derive", "libp2p-dns", "libp2p-gossipsub", @@ -3437,48 +3428,13 @@ dependencies = [ "libp2p-tcp", "libp2p-websocket", "libp2p-yamux", - "parity-multiaddr 0.11.0", + "parity-multiaddr", "parking_lot", "pin-project 1.0.4", "smallvec", "wasm-timer", ] -[[package]] -name = "libp2p-core" -version = "0.25.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc9c96d3a606a696a3a6c0ad3c3352c57bda2082ec9090930f1bd9daf787039f" -dependencies = [ - "asn1_der", - "bs58 0.4.0", - "bytes 0.5.6", - "ed25519-dalek", - "either", - "fnv", - "futures 0.3.12", - "futures-timer", - "lazy_static", - "libsecp256k1", - "log", - "multihash", - "multistream-select 0.9.1", - "parity-multiaddr 0.10.1", - "parking_lot", - "pin-project 1.0.4", - "prost 0.6.1", - "prost-build 0.6.1", - "rand 0.7.3", - "ring", - "rw-stream-sink", - "sha2 0.9.2", - "smallvec", - "thiserror", - "unsigned-varint 0.5.1", - "void", - "zeroize", -] - [[package]] name = "libp2p-core" version = "0.27.0" @@ -3496,12 +3452,12 @@ dependencies = [ "libsecp256k1", "log", "multihash", - "multistream-select 0.10.0", - "parity-multiaddr 0.11.0", + "multistream-select", + "parity-multiaddr", "parking_lot", "pin-project 1.0.4", - "prost 0.7.0", - "prost-build 0.7.0", + "prost", + "prost-build", "rand 0.7.3", "ring", "rw-stream-sink", @@ -3530,7 +3486,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5153b6db68fd4baa3b304e377db744dd8fea8ff4e4504509ee636abcde88d3e3" dependencies = [ "futures 0.3.12", - "libp2p-core 0.27.0", + "libp2p-core", "log", ] @@ -3547,11 +3503,11 @@ dependencies = [ "fnv", "futures 0.3.12", "hex_fmt", - "libp2p-core 0.27.0", + "libp2p-core", "libp2p-swarm", "log", - "prost 0.7.0", - "prost-build 0.7.0", + "prost", + "prost-build", "rand 0.7.3", "regex", "sha2 0.9.2", @@ -3567,11 +3523,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b40fb36a059b7a8cce1514bd8b546fa612e006c9937caa7f5950cb20021fe91e" dependencies = [ "futures 0.3.12", - "libp2p-core 0.27.0", + "libp2p-core", "libp2p-swarm", "log", - "prost 0.7.0", - "prost-build 0.7.0", + "prost", + "prost-build", "smallvec", "wasm-timer", ] @@ -3585,7 +3541,7 @@ dependencies = [ "asynchronous-codec", "bytes 1.0.1", "futures 0.3.12", - "libp2p-core 0.27.0", + "libp2p-core", "log", "nohash-hasher", "parking_lot", @@ -3604,10 +3560,10 @@ dependencies = [ "curve25519-dalek", "futures 0.3.12", "lazy_static", - "libp2p-core 0.27.0", + "libp2p-core", "log", - "prost 0.7.0", - "prost-build 0.7.0", + "prost", + "prost-build", "rand 0.7.3", "sha2 0.9.2", "snow", @@ -3624,7 +3580,7 @@ checksum = "22ea8c69839a0e593c8c6a24282cb234d48ac37be4153183f4914e00f5303e75" dependencies = [ "either", "futures 0.3.12", - "libp2p-core 0.27.0", + "libp2p-core", "log", "rand 0.7.3", "smallvec", @@ -3645,7 +3601,7 @@ dependencies = [ "if-watch", "ipnet", "libc", - "libp2p-core 0.27.0", + "libp2p-core", "log", "socket2", "tokio 1.1.0", @@ -3660,7 +3616,7 @@ dependencies = [ "either", "futures 0.3.12", "futures-rustls", - "libp2p-core 0.27.0", + "libp2p-core", "log", "quicksink", "rw-stream-sink", @@ -3676,7 +3632,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "490b8b27fc40fe35212df1b6a3d14bffaa4117cbff956fdc2892168a371102ad" dependencies = [ "futures 0.3.12", - "libp2p-core 0.27.0", + "libp2p-core", "parking_lot", "thiserror", "yamux", @@ -4086,20 +4042,6 @@ dependencies = [ "twoway", ] -[[package]] -name = "multistream-select" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dda822043bba2d6da31c4e14041f9794f8fb130a5959289038d0b809d8888614" -dependencies = [ - "bytes 0.5.6", - "futures 0.3.12", - "log", - "pin-project 1.0.4", - "smallvec", - "unsigned-varint 0.5.1", -] - [[package]] name = "multistream-select" version = "0.10.0" @@ -4170,7 +4112,7 @@ dependencies = [ "hex", "if-addrs", "igd", - "itertools 0.9.0", + "itertools", "lazy_static", "lighthouse_metrics", "logging", @@ -4430,24 +4372,6 @@ dependencies = [ "types", ] -[[package]] -name = "parity-multiaddr" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180cd097078b337d2ba6400c6a67b181b38b611273cb1d8d12f3d8d5d8eaaacb" -dependencies = [ - "arrayref", - "bs58 0.4.0", - "byteorder", - "data-encoding", - "multihash", - "percent-encoding", - "serde", - "static_assertions", - "unsigned-varint 0.5.1", - "url", -] - [[package]] name = "parity-multiaddr" version = "0.11.0" @@ -4780,16 +4704,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "prost" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce49aefe0a6144a45de32927c77bd2859a5f7677b55f220ae5b744e87389c212" -dependencies = [ - "bytes 0.5.6", - "prost-derive 0.6.1", -] - [[package]] name = "prost" version = "0.7.0" @@ -4797,25 +4711,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e6984d2f1a23009bd270b8bb56d0926810a3d483f59c987d77969e9d8e840b2" dependencies = [ "bytes 1.0.1", - "prost-derive 0.7.0", -] - -[[package]] -name = "prost-build" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02b10678c913ecbd69350e8535c3aef91a8676c0773fc1d7b95cdd196d7f2f26" -dependencies = [ - "bytes 0.5.6", - "heck", - "itertools 0.8.2", - "log", - "multimap", - "petgraph", - "prost 0.6.1", - "prost-types 0.6.1", - "tempfile", - "which 3.1.1", + "prost-derive", ] [[package]] @@ -4826,27 +4722,14 @@ checksum = "32d3ebd75ac2679c2af3a92246639f9fcc8a442ee420719cc4fe195b98dd5fa3" dependencies = [ "bytes 1.0.1", "heck", - "itertools 0.9.0", + "itertools", "log", "multimap", "petgraph", - "prost 0.7.0", - "prost-types 0.7.0", + "prost", + "prost-types", "tempfile", - "which 4.0.2", -] - -[[package]] -name = "prost-derive" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "537aa19b95acde10a12fec4301466386f757403de4cd4e5b4fa78fb5ecb18f72" -dependencies = [ - "anyhow", - "itertools 0.8.2", - "proc-macro2", - "quote", - "syn", + "which", ] [[package]] @@ -4856,22 +4739,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "169a15f3008ecb5160cba7d37bcd690a7601b6d30cfb87a117d45e59d52af5d4" dependencies = [ "anyhow", - "itertools 0.9.0", + "itertools", "proc-macro2", "quote", "syn", ] -[[package]] -name = "prost-types" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1834f67c0697c001304b75be76f67add9c89742eda3a085ad8ee0bb38c3417aa" -dependencies = [ - "bytes 0.5.6", - "prost 0.6.1", -] - [[package]] name = "prost-types" version = "0.7.0" @@ -4879,7 +4752,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b518d7cdd93dab1d1122cf07fa9a60771836c668dde9d9e2a139f957f0d9f1bb" dependencies = [ "bytes 1.0.1", - "prost 0.7.0", + "prost", ] [[package]] @@ -6087,7 +5960,7 @@ dependencies = [ "eth2_ssz_types", "int_to_bytes", "integer-sqrt", - "itertools 0.9.0", + "itertools", "lazy_static", "log", "merkle_proof", @@ -6174,7 +6047,7 @@ dependencies = [ "directory", "eth2_ssz", "eth2_ssz_derive", - "itertools 0.9.0", + "itertools", "lazy_static", "leveldb", "lighthouse_metrics", @@ -7457,15 +7330,6 @@ dependencies = [ "cc", ] -[[package]] -name = "which" -version = "3.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d011071ae14a2f6671d0b74080ae0cd8ebf3a6f8c9589a2cd45f23126fe29724" -dependencies = [ - "libc", -] - [[package]] name = "which" version = "4.0.2" diff --git a/beacon_node/eth2_libp2p/Cargo.toml b/beacon_node/eth2_libp2p/Cargo.toml index 8128d75e8b1..73de7ef8ddd 100644 --- a/beacon_node/eth2_libp2p/Cargo.toml +++ b/beacon_node/eth2_libp2p/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Sigma Prime "] edition = "2018" [dependencies] -discv5 = { git = "https://github.com/sigp/discv5", branch = "master", features = ["libp2p"] } +discv5 = { git = "https://github.com/realbigsean/discv5", rev = "e1fd56eefcf88d6f5281eccdbf24ed8f1ee52f92", features = ["libp2p"] } unsigned-varint = { version = "0.6.0", features = ["codec"] } types = { path = "../../consensus/types" } hashset_delay = { path = "../../common/hashset_delay" } diff --git a/beacon_node/http_api/Cargo.toml b/beacon_node/http_api/Cargo.toml index 500e2455406..59dc73eba59 100644 --- a/beacon_node/http_api/Cargo.toml +++ b/beacon_node/http_api/Cargo.toml @@ -34,4 +34,4 @@ futures = "0.3.8" store = { path = "../store" } environment = { path = "../../lighthouse/environment" } tree_hash = "0.1.1" -discv5 = { git = "https://github.com/sigp/discv5", branch = "master" } +discv5 = { git = "https://github.com/realbigsean/discv5", rev = "e1fd56eefcf88d6f5281eccdbf24ed8f1ee52f92" } From be917c7ed66496f994447fc89fceeda5143a7ffd Mon Sep 17 00:00:00 2001 From: realbigsean Date: Fri, 5 Feb 2021 12:12:25 -0500 Subject: [PATCH 14/17] update discv5 and `BroadcastStream` --- Cargo.lock | 107 ++++++++++-------- beacon_node/eth2_libp2p/Cargo.toml | 2 +- .../eth2_libp2p/src/discovery/enr_ext.rs | 7 +- beacon_node/eth2_libp2p/src/discovery/mod.rs | 5 +- .../eth2_libp2p/src/peer_manager/mod.rs | 6 +- .../eth2_libp2p/src/peer_manager/peer_info.rs | 5 +- .../src/peer_manager/peer_sync_status.rs | 20 +++- .../eth2_libp2p/src/peer_manager/peerdb.rs | 14 ++- .../eth2_libp2p/src/types/sync_state.rs | 16 ++- beacon_node/http_api/Cargo.toml | 3 +- beacon_node/http_api/src/broadcast_stream.rs | 57 +++++----- beacon_node/http_api/src/lib.rs | 2 +- beacon_node/network/Cargo.toml | 2 +- beacon_node/network/src/persisted_dht.rs | 2 +- common/eth2_network_config/Cargo.toml | 2 +- consensus/fork_choice/tests/tests.rs | 7 +- 16 files changed, 143 insertions(+), 114 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 75841497c48..06f551b66c3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1197,9 +1197,9 @@ dependencies = [ [[package]] name = "const-oid" -version = "0.1.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2d9162b7289a46e86208d6af2c686ca5bfde445878c41a458a9fac706252d0b" +checksum = "c5d82796b70971fbb603900a5edc797a4d9be0f9ec1257f83a1dba0aa374e3e9" [[package]] name = "const_fn" @@ -1358,16 +1358,6 @@ dependencies = [ "subtle 2.4.0", ] -[[package]] -name = "crypto-mac" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58bcd97a54c7ca5ce2f6eb16f6bede5b0ab5f0055fedc17d2f0b4466e21671ca" -dependencies = [ - "generic-array 0.14.4", - "subtle 2.4.0", -] - [[package]] name = "crypto-mac" version = "0.10.0" @@ -1509,6 +1499,15 @@ dependencies = [ "types", ] +[[package]] +name = "der" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51f59c66c30bb7445c8320a5f9233e437e3572368099f25532a59054328899b4" +dependencies = [ + "const-oid", +] + [[package]] name = "derivative" version = "2.1.3" @@ -1631,8 +1630,9 @@ checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" [[package]] name = "discv5" -version = "0.1.0-beta.2" -source = "git+https://github.com/realbigsean/discv5?rev=e1fd56eefcf88d6f5281eccdbf24ed8f1ee52f92#e1fd56eefcf88d6f5281eccdbf24ed8f1ee52f92" +version = "0.1.0-beta.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f52d2228d51e8f868a37d5b5b25b82c13552b635d5b47c3a5d53855a6fc4f0" dependencies = [ "aes-ctr", "aes-gcm 0.8.0", @@ -1649,12 +1649,12 @@ dependencies = [ "lru_time_cache", "parking_lot", "rand 0.7.3", - "rlp", + "rlp 0.5.0", "sha2 0.9.2", "smallvec", "tokio 1.1.0", "tokio-stream", - "tokio-util 0.6.2", + "tokio-util 0.6.3", "tracing", "tracing-subscriber", "uint", @@ -1669,12 +1669,12 @@ checksum = "88d7ed2934d741c6b37e33e3832298e8850b53fd2d2bea03873375596c7cea4e" [[package]] name = "ecdsa" -version = "0.8.5" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87bf8bfb05ea8a6f74ddf48c7d1774851ba77bbe51ac984fdfa6c30310e1ff5f" +checksum = "41fbdb4ff710acb4db8ca29f93b897529ea6d6a45626d5183b47e012aa6ae7e4" dependencies = [ "elliptic-curve", - "hmac 0.9.0", + "hmac 0.10.1", "signature", ] @@ -1732,16 +1732,16 @@ checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" [[package]] name = "elliptic-curve" -version = "0.6.6" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "396db09c483e7fca5d4fdb9112685632b3e76c9a607a2649c1bf904404a01366" +checksum = "592b1c857559479c056b73a3053c717108a70e4dce320ad28c79c63f5c2e62ba" dependencies = [ "bitvec 0.18.4", - "const-oid", "digest 0.9.0", "ff", "generic-array 0.14.4", "group", + "pkcs8", "rand_core 0.5.1", "subtle 2.4.0", "zeroize", @@ -1767,18 +1767,19 @@ dependencies = [ [[package]] name = "enr" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08ca9417e6cb1ac2aeb9d5075f4ac74173081969d1a26486f72a14770320e4c4" +checksum = "264237bc285638466aef78b954837d8a05371425cb21447d6e31db89d06d7a1b" dependencies = [ "base64 0.12.3", "bs58 0.3.1", + "bytes 1.0.1", "ed25519-dalek", "hex", "k256", "log", "rand 0.7.3", - "rlp", + "rlp 0.5.0", "serde", "sha3", "zeroize", @@ -2021,7 +2022,7 @@ dependencies = [ "tokio 1.1.0", "tokio-io-timeout", "tokio-stream", - "tokio-util 0.6.2", + "tokio-util 0.6.3", "types", "unsigned-varint 0.6.0", "void", @@ -2638,7 +2639,7 @@ dependencies = [ "indexmap", "slab", "tokio 1.1.0", - "tokio-util 0.6.2", + "tokio-util 0.6.3", "tracing", "tracing-futures", ] @@ -2673,7 +2674,7 @@ version = "0.2.0" dependencies = [ "futures 0.3.12", "tokio 1.1.0", - "tokio-util 0.6.2", + "tokio-util 0.6.3", ] [[package]] @@ -2761,16 +2762,6 @@ dependencies = [ "digest 0.9.0", ] -[[package]] -name = "hmac" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "deae6d9dbb35ec2c502d62b8f7b1c000a0822c3b0794ba36b3149c0a1c840dff" -dependencies = [ - "crypto-mac 0.9.1", - "digest 0.9.0", -] - [[package]] name = "hmac" version = "0.10.1" @@ -2851,6 +2842,7 @@ dependencies = [ "store", "tokio 1.1.0", "tokio-stream", + "tokio-util 0.6.3", "tree_hash", "types", "warp", @@ -3093,7 +3085,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f7a72f11830b52333f36e3b09a288333888bf54380fd0ac0790a3c31ab0f3c5" dependencies = [ - "rlp", + "rlp 0.4.6", ] [[package]] @@ -3229,9 +3221,9 @@ dependencies = [ [[package]] name = "k256" -version = "0.5.10" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3934640b1efbc660af5889d041854b6985d403771dc4d5fee984e13e8f82f313" +checksum = "cf02ecc966e1b7e8db1c81ac8f321ba24d1cfab5b634961fab10111f015858e1" dependencies = [ "cfg-if 1.0.0", "ecdsa", @@ -4121,7 +4113,7 @@ dependencies = [ "num_cpus", "parking_lot", "rand 0.7.3", - "rlp", + "rlp 0.5.0", "slog", "slog-async", "slog-term", @@ -4540,6 +4532,15 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "pkcs8" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4839a901843f3942576e65857f0ebf2e190ef7024d3c62a94099ba3f819ad1d" +dependencies = [ + "der", +] + [[package]] name = "pkg-config" version = "0.3.19" @@ -5212,6 +5213,16 @@ dependencies = [ "rustc-hex", ] +[[package]] +name = "rlp" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e54369147e3e7796c9b885c7304db87ca3d09a0a98f72843d532868675bbfba8" +dependencies = [ + "bytes 1.0.1", + "rustc-hex", +] + [[package]] name = "rpassword" version = "5.0.1" @@ -6584,11 +6595,10 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "feb971a26599ffd28066d387f109746df178eff14d5ea1e235015c5601967a4b" +checksum = "ebb7cb2f00c5ae8df755b252306272cd1790d39728363936e01827e11f0b017b" dependencies = [ - "async-stream", "bytes 1.0.1", "futures-core", "futures-io", @@ -6597,7 +6607,6 @@ dependencies = [ "pin-project-lite 0.2.4", "slab", "tokio 1.1.0", - "tokio-stream", ] [[package]] @@ -6924,7 +6933,7 @@ checksum = "35581ff83d4101e58b582e607120c7f5ffb17e632a980b1f38334d76b36908b2" dependencies = [ "asynchronous-codec", "bytes 1.0.1", - "tokio-util 0.6.2", + "tokio-util 0.6.3", ] [[package]] @@ -7115,7 +7124,7 @@ dependencies = [ "tokio 1.1.0", "tokio-stream", "tokio-tungstenite", - "tokio-util 0.6.2", + "tokio-util 0.6.3", "tower-service", "tracing", "tracing-futures", @@ -7290,7 +7299,7 @@ dependencies = [ "native-tls", "parking_lot", "pin-project 1.0.4", - "rlp", + "rlp 0.4.6", "secp256k1", "serde", "serde_json", diff --git a/beacon_node/eth2_libp2p/Cargo.toml b/beacon_node/eth2_libp2p/Cargo.toml index 73de7ef8ddd..060330583cf 100644 --- a/beacon_node/eth2_libp2p/Cargo.toml +++ b/beacon_node/eth2_libp2p/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Sigma Prime "] edition = "2018" [dependencies] -discv5 = { git = "https://github.com/realbigsean/discv5", rev = "e1fd56eefcf88d6f5281eccdbf24ed8f1ee52f92", features = ["libp2p"] } +discv5 = { version = "0.1.0-beta.3", features = ["libp2p"] } unsigned-varint = { version = "0.6.0", features = ["codec"] } types = { path = "../../consensus/types" } hashset_delay = { path = "../../common/hashset_delay" } diff --git a/beacon_node/eth2_libp2p/src/discovery/enr_ext.rs b/beacon_node/eth2_libp2p/src/discovery/enr_ext.rs index daf769ea1bd..dde8b6c2fb2 100644 --- a/beacon_node/eth2_libp2p/src/discovery/enr_ext.rs +++ b/beacon_node/eth2_libp2p/src/discovery/enr_ext.rs @@ -221,8 +221,9 @@ impl CombinedKeyExt for CombinedKey { fn from_libp2p(key: &libp2p::core::identity::Keypair) -> Result { match key { Keypair::Secp256k1(key) => { - let secret = discv5::enr::k256::ecdsa::SigningKey::new(&key.secret().to_bytes()) - .expect("libp2p key must be valid"); + let secret = + discv5::enr::k256::ecdsa::SigningKey::from_bytes(&key.secret().to_bytes()) + .expect("libp2p key must be valid"); Ok(CombinedKey::Secp256k1(secret)) } Keypair::Ed25519(key) => { @@ -277,7 +278,7 @@ mod tests { fn test_secp256k1_peer_id_conversion() { let sk_hex = "df94a73d528434ce2309abb19c16aedb535322797dbd59c157b1e04095900f48"; let sk_bytes = hex::decode(sk_hex).unwrap(); - let secret_key = discv5::enr::k256::ecdsa::SigningKey::new(&sk_bytes).unwrap(); + let secret_key = discv5::enr::k256::ecdsa::SigningKey::from_bytes(&sk_bytes).unwrap(); let libp2p_sk = libp2p::identity::secp256k1::SecretKey::from_bytes(sk_bytes).unwrap(); let secp256k1_kp: libp2p::identity::secp256k1::Keypair = libp2p_sk.into(); diff --git a/beacon_node/eth2_libp2p/src/discovery/mod.rs b/beacon_node/eth2_libp2p/src/discovery/mod.rs index 17b05ece3e8..8bfe71c6c75 100644 --- a/beacon_node/eth2_libp2p/src/discovery/mod.rs +++ b/beacon_node/eth2_libp2p/src/discovery/mod.rs @@ -896,10 +896,7 @@ impl Discovery { } EventStream::InActive => {} // ignore checking the stream EventStream::Present(ref mut stream) => { - //TODO: replace this with try_rec() when this issue is resolved: - // (should this be try_recv?) - // https://github.com/tokio-rs/tokio/issues/3350 - while let Some(Some(event)) = stream.recv().now_or_never() { + while let Poll::Ready(Some(event)) = stream.poll_recv(cx) { match event { // We filter out unwanted discv5 events here and only propagate useful results to // the peer manager. diff --git a/beacon_node/eth2_libp2p/src/peer_manager/mod.rs b/beacon_node/eth2_libp2p/src/peer_manager/mod.rs index e749842adb9..4da3f69406b 100644 --- a/beacon_node/eth2_libp2p/src/peer_manager/mod.rs +++ b/beacon_node/eth2_libp2p/src/peer_manager/mod.rs @@ -1011,8 +1011,10 @@ impl Stream for PeerManager { } } - if !matches!(self.network_globals.sync_state(), SyncState::SyncingFinalized{..}|SyncState::SyncingHead{..}) - { + if !matches!( + self.network_globals.sync_state(), + SyncState::SyncingFinalized { .. } | SyncState::SyncingHead { .. } + ) { loop { match self.status_peers.poll_next_unpin(cx) { Poll::Ready(Some(Ok(peer_id))) => { diff --git a/beacon_node/eth2_libp2p/src/peer_manager/peer_info.rs b/beacon_node/eth2_libp2p/src/peer_manager/peer_info.rs index 759850ef4b7..49546776a8f 100644 --- a/beacon_node/eth2_libp2p/src/peer_manager/peer_info.rs +++ b/beacon_node/eth2_libp2p/src/peer_manager/peer_info.rs @@ -156,7 +156,10 @@ impl PeerInfo { /// Checks if the status is connected. pub fn is_connected(&self) -> bool { - matches!(self.connection_status, PeerConnectionStatus::Connected { .. }) + matches!( + self.connection_status, + PeerConnectionStatus::Connected { .. } + ) } /// Checks if the status is connected. diff --git a/beacon_node/eth2_libp2p/src/peer_manager/peer_sync_status.rs b/beacon_node/eth2_libp2p/src/peer_manager/peer_sync_status.rs index 473741d4fc2..d282c03f0d9 100644 --- a/beacon_node/eth2_libp2p/src/peer_manager/peer_sync_status.rs +++ b/beacon_node/eth2_libp2p/src/peer_manager/peer_sync_status.rs @@ -29,12 +29,20 @@ pub struct SyncInfo { impl std::cmp::PartialEq for PeerSyncStatus { fn eq(&self, other: &Self) -> bool { - matches!((self, other), - (PeerSyncStatus::Synced { .. }, PeerSyncStatus::Synced { .. }) | - (PeerSyncStatus::Advanced { .. }, PeerSyncStatus::Advanced { .. }) | - (PeerSyncStatus::Behind { .. }, PeerSyncStatus::Behind { .. }) | - (PeerSyncStatus::IrrelevantPeer, PeerSyncStatus::IrrelevantPeer) | - (PeerSyncStatus::Unknown, PeerSyncStatus::Unknown)) + matches!( + (self, other), + (PeerSyncStatus::Synced { .. }, PeerSyncStatus::Synced { .. }) + | ( + PeerSyncStatus::Advanced { .. }, + PeerSyncStatus::Advanced { .. } + ) + | (PeerSyncStatus::Behind { .. }, PeerSyncStatus::Behind { .. }) + | ( + PeerSyncStatus::IrrelevantPeer, + PeerSyncStatus::IrrelevantPeer + ) + | (PeerSyncStatus::Unknown, PeerSyncStatus::Unknown) + ) } } diff --git a/beacon_node/eth2_libp2p/src/peer_manager/peerdb.rs b/beacon_node/eth2_libp2p/src/peer_manager/peerdb.rs index 379505d8073..26aeb29af80 100644 --- a/beacon_node/eth2_libp2p/src/peer_manager/peerdb.rs +++ b/beacon_node/eth2_libp2p/src/peer_manager/peerdb.rs @@ -137,14 +137,20 @@ impl PeerDB { /// If we are connected or currently dialing the peer returns true. pub fn is_connected_or_dialing(&self, peer_id: &PeerId) -> bool { - matches!(self.connection_status(peer_id), Some(PeerConnectionStatus::Connected { .. }) - | Some(PeerConnectionStatus::Dialing { .. })) + matches!( + self.connection_status(peer_id), + Some(PeerConnectionStatus::Connected { .. }) + | Some(PeerConnectionStatus::Dialing { .. }) + ) } /// If we are connected or in the process of disconnecting pub fn is_connected_or_disconnecting(&self, peer_id: &PeerId) -> bool { - matches!(self.connection_status(peer_id), Some(PeerConnectionStatus::Connected { .. }) - | Some(PeerConnectionStatus::Disconnecting { .. })) + matches!( + self.connection_status(peer_id), + Some(PeerConnectionStatus::Connected { .. }) + | Some(PeerConnectionStatus::Disconnecting { .. }) + ) } /// Returns true if the peer is synced at least to our current head. diff --git a/beacon_node/eth2_libp2p/src/types/sync_state.rs b/beacon_node/eth2_libp2p/src/types/sync_state.rs index f5b6a155854..6fdcc2d0871 100644 --- a/beacon_node/eth2_libp2p/src/types/sync_state.rs +++ b/beacon_node/eth2_libp2p/src/types/sync_state.rs @@ -23,12 +23,16 @@ pub enum SyncState { impl PartialEq for SyncState { fn eq(&self, other: &Self) -> bool { - matches!((self, other), - (SyncState::SyncingFinalized { .. }, SyncState::SyncingFinalized { .. }) | - (SyncState::SyncingHead { .. }, SyncState::SyncingHead { .. }) | - (SyncState::Synced, SyncState::Synced) | - (SyncState::Stalled, SyncState::Stalled) | - (SyncState::SyncTransition, SyncState::SyncTransition)) + matches!( + (self, other), + ( + SyncState::SyncingFinalized { .. }, + SyncState::SyncingFinalized { .. } + ) | (SyncState::SyncingHead { .. }, SyncState::SyncingHead { .. }) + | (SyncState::Synced, SyncState::Synced) + | (SyncState::Stalled, SyncState::Stalled) + | (SyncState::SyncTransition, SyncState::SyncTransition) + ) } } diff --git a/beacon_node/http_api/Cargo.toml b/beacon_node/http_api/Cargo.toml index 59dc73eba59..a44412cffd4 100644 --- a/beacon_node/http_api/Cargo.toml +++ b/beacon_node/http_api/Cargo.toml @@ -10,6 +10,7 @@ warp = "0.3.0" serde = { version = "1.0.116", features = ["derive"] } tokio = { version = "1.1.0", features = ["macros","sync"] } tokio-stream = "0.1.2" +tokio-util = "0.6.3" parking_lot = "0.11.0" types = { path = "../../consensus/types" } hex = "0.4.2" @@ -34,4 +35,4 @@ futures = "0.3.8" store = { path = "../store" } environment = { path = "../../lighthouse/environment" } tree_hash = "0.1.1" -discv5 = { git = "https://github.com/realbigsean/discv5", rev = "e1fd56eefcf88d6f5281eccdbf24ed8f1ee52f92" } +discv5 = { version = "0.1.0-beta.3" } diff --git a/beacon_node/http_api/src/broadcast_stream.rs b/beacon_node/http_api/src/broadcast_stream.rs index fc4a6dc32e1..9e35a556acb 100644 --- a/beacon_node/http_api/src/broadcast_stream.rs +++ b/beacon_node/http_api/src/broadcast_stream.rs @@ -1,21 +1,20 @@ -use crate::Stream; -use async_stream::stream; -use std::pin::Pin; -use tokio::sync::broadcast::error::RecvError; -use tokio::sync::broadcast::Receiver; +// TODO: this should be replaced with the tokio's `BroadcastStream` once it's added to +// tokio-stream (https://github.com/tokio-rs/tokio/pull/3384) use std::fmt; +use std::pin::Pin; use std::task::{Context, Poll}; - -// TODO: this should be replaced with the tokio's `BroadcastStream` once it's added to -// tokio-stream (https://github.com/tokio-rs/tokio/pull/3384) +use tokio::sync::broadcast::error::RecvError; +use tokio::sync::broadcast::Receiver; +use tokio_stream::Stream; +use tokio_util::sync::ReusableBoxFuture; /// A wrapper around [`tokio::sync::broadcast::Receiver`] that implements [`Stream`]. /// /// [`tokio::sync::broadcast::Receiver`]: struct@tokio::sync::broadcast::Receiver /// [`Stream`]: trait@crate::Stream pub struct BroadcastStream { - inner: Pin> + Send + Sync>>, + inner: ReusableBoxFuture<(Result, Receiver)>, } /// An error returned from the inner stream of a [`BroadcastStream`]. @@ -28,35 +27,39 @@ pub enum BroadcastStreamRecvError { Lagged(u64), } -impl BroadcastStream { +async fn make_future(mut rx: Receiver) -> (Result, Receiver) { + let result = rx.recv().await; + (result, rx) +} + +impl BroadcastStream { /// Create a new `BroadcastStream`. - pub fn new(mut rx: Receiver) -> Self { - let stream = stream! { - loop { - match rx.recv().await { - Ok(item) => yield Ok(item), - Err(err) => match err { - RecvError::Closed => break, - RecvError::Lagged(n) => yield Err(BroadcastStreamRecvError::Lagged(n)), - }, - } - } - }; + pub fn new(rx: Receiver) -> Self { Self { - inner: Box::pin(stream), + inner: ReusableBoxFuture::new(make_future(rx)), } } } -impl Stream for BroadcastStream { +impl Stream for BroadcastStream { type Item = Result; - fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { - Pin::new(&mut self.inner).poll_next(cx) + let (result, rx) = match self.inner.poll(cx) { + std::task::Poll::Ready(t) => t, + std::task::Poll::Pending => return std::task::Poll::Pending, + }; + self.inner.set(make_future(rx)); + match result { + Ok(item) => Poll::Ready(Some(Ok(item))), + Err(RecvError::Closed) => Poll::Ready(None), + Err(RecvError::Lagged(n)) => { + Poll::Ready(Some(Err(BroadcastStreamRecvError::Lagged(n)))) + } + } } } -impl fmt::Debug for BroadcastStream { +impl fmt::Debug for BroadcastStream { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("BroadcastStream").finish() } diff --git a/beacon_node/http_api/src/lib.rs b/beacon_node/http_api/src/lib.rs index 1b0e246e2c1..707e5fd378c 100644 --- a/beacon_node/http_api/src/lib.rs +++ b/beacon_node/http_api/src/lib.rs @@ -36,7 +36,7 @@ use std::future::Future; use std::net::{Ipv4Addr, SocketAddr, SocketAddrV4}; use std::sync::Arc; use tokio::sync::mpsc::UnboundedSender; -use tokio_stream::{Stream, StreamExt}; +use tokio_stream::StreamExt; use types::{ Attestation, AttestationDuty, AttesterSlashing, CloneConfig, CommitteeCache, Epoch, EthSpec, Hash256, ProposerSlashing, PublicKey, PublicKeyBytes, RelativeEpoch, SignedAggregateAndProof, diff --git a/beacon_node/network/Cargo.toml b/beacon_node/network/Cargo.toml index bd9d1caf490..5f8470c2fb8 100644 --- a/beacon_node/network/Cargo.toml +++ b/beacon_node/network/Cargo.toml @@ -36,7 +36,7 @@ parking_lot = "0.11.0" smallvec = "1.6.1" rand = "0.7.3" fnv = "1.0.7" -rlp = "0.4.6" +rlp = "0.5.0" lazy_static = "1.4.0" lighthouse_metrics = { path = "../../common/lighthouse_metrics" } task_executor = { path = "../../common/task_executor" } diff --git a/beacon_node/network/src/persisted_dht.rs b/beacon_node/network/src/persisted_dht.rs index c11fcd44852..59b0bd9ab24 100644 --- a/beacon_node/network/src/persisted_dht.rs +++ b/beacon_node/network/src/persisted_dht.rs @@ -38,7 +38,7 @@ impl StoreItem for PersistedDht { } fn as_store_bytes(&self) -> Vec { - rlp::encode_list(&self.enrs) + rlp::encode_list(&self.enrs).to_vec() } fn from_store_bytes(bytes: &[u8]) -> Result { diff --git a/common/eth2_network_config/Cargo.toml b/common/eth2_network_config/Cargo.toml index 1407833fa57..b11f93672ef 100644 --- a/common/eth2_network_config/Cargo.toml +++ b/common/eth2_network_config/Cargo.toml @@ -19,4 +19,4 @@ serde_yaml = "0.8.13" types = { path = "../../consensus/types"} eth2_ssz = "0.1.2" eth2_config = { path = "../eth2_config"} -enr = { version = "0.4.0", features = ["ed25519", "k256"] } +enr = { version = "0.5.0", features = ["ed25519", "k256"] } diff --git a/consensus/fork_choice/tests/tests.rs b/consensus/fork_choice/tests/tests.rs index 70513177bac..32675002aab 100644 --- a/consensus/fork_choice/tests/tests.rs +++ b/consensus/fork_choice/tests/tests.rs @@ -635,12 +635,7 @@ fn invalid_block_future_slot() { |block, _| { block.slot = block.slot + 1; }, - |err| { - assert_invalid_block!( - err, - InvalidBlock::FutureSlot { .. } - ) - }, + |err| assert_invalid_block!(err, InvalidBlock::FutureSlot { .. }), ); } From 7b529aa632c5ef4c04fbbd5be2e572f5dcd71acb Mon Sep 17 00:00:00 2001 From: realbigsean Date: Mon, 8 Feb 2021 17:29:40 -0500 Subject: [PATCH 15/17] update hyper to 14.4 --- beacon_node/Cargo.toml | 2 +- common/rest_types/Cargo.toml | 2 +- remote_signer/client/Cargo.toml | 2 +- validator_client/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/beacon_node/Cargo.toml b/beacon_node/Cargo.toml index 00379d76272..e19034d4a13 100644 --- a/beacon_node/Cargo.toml +++ b/beacon_node/Cargo.toml @@ -40,7 +40,7 @@ eth2_libp2p = { path = "./eth2_libp2p" } eth2_ssz = "0.1.2" serde = "1.0.116" clap_utils = { path = "../common/clap_utils" } -hyper = "0.14.2" +hyper = "0.14.4" lighthouse_version = { path = "../common/lighthouse_version" } hex = "0.4.2" slasher = { path = "../slasher" } diff --git a/common/rest_types/Cargo.toml b/common/rest_types/Cargo.toml index acb7ff379a6..3d4c70c1c33 100644 --- a/common/rest_types/Cargo.toml +++ b/common/rest_types/Cargo.toml @@ -14,7 +14,7 @@ state_processing = { path = "../../consensus/state_processing" } bls = { path = "../../crypto/bls" } serde = { version = "1.0.110", features = ["derive"] } rayon = "1.3.0" -hyper = "0.14.2" +hyper = "0.14.4" tokio = { version = "1.1.0", features = ["sync"] } environment = { path = "../../lighthouse/environment" } store = { path = "../../beacon_node/store" } diff --git a/remote_signer/client/Cargo.toml b/remote_signer/client/Cargo.toml index c43dbeb1e78..7b6b3f24782 100644 --- a/remote_signer/client/Cargo.toml +++ b/remote_signer/client/Cargo.toml @@ -9,7 +9,7 @@ clap = "2.33.3" client_backend = { path = "../backend", package = "remote_signer_backend" } environment = { path = "../../lighthouse/environment" } futures = "0.3.6" -hyper = "0.14.2" +hyper = "0.14.4" lazy_static = "1.4.0" regex = "1.3.9" serde = { version = "1.0.116", features = ["derive"] } diff --git a/validator_client/Cargo.toml b/validator_client/Cargo.toml index ac282ffc2ff..cb4ae2e2345 100644 --- a/validator_client/Cargo.toml +++ b/validator_client/Cargo.toml @@ -53,7 +53,7 @@ account_utils = { path = "../common/account_utils" } lighthouse_version = { path = "../common/lighthouse_version" } warp_utils = { path = "../common/warp_utils" } warp = "0.3.0" -hyper = "0.14.2" +hyper = "0.14.4" serde_utils = { path = "../consensus/serde_utils" } libsecp256k1 = "0.3.5" ring = "0.16.19" From 4fc7f5b83f41a35dfb7630248d8670a7eef096a6 Mon Sep 17 00:00:00 2001 From: realbigsean Date: Mon, 8 Feb 2021 17:32:22 -0500 Subject: [PATCH 16/17] Cargo.lock update --- Cargo.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d2537816a9c..cc49e47bb10 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -665,7 +665,7 @@ dependencies = [ "futures 0.3.12", "genesis", "hex", - "hyper 0.14.2", + "hyper 0.14.4", "lighthouse_version", "logging", "node_test_rig", @@ -2906,7 +2906,7 @@ dependencies = [ "crossbeam-utils", "difference", "futures-util", - "hyper 0.14.2", + "hyper 0.14.4", "isahc", "lazy_static", "levenshtein", @@ -2951,9 +2951,9 @@ dependencies = [ [[package]] name = "hyper" -version = "0.14.2" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12219dc884514cb4a6a03737f4413c0e01c23a1b059b0156004b23f1e19dccbe" +checksum = "e8e946c2b1349055e0b72ae281b238baf1a3ea7307c7e9f9d64673bdd9c26ac7" dependencies = [ "bytes 1.0.1", "futures-channel", @@ -3011,7 +3011,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ "bytes 1.0.1", - "hyper 0.14.2", + "hyper 0.14.4", "native-tls", "tokio 1.1.0", "tokio-native-tls", @@ -5224,7 +5224,7 @@ dependencies = [ "clap", "environment", "futures 0.3.12", - "hyper 0.14.2", + "hyper 0.14.4", "lazy_static", "regex", "remote_signer_backend", @@ -5287,7 +5287,7 @@ dependencies = [ "futures-util", "http", "http-body 0.4.0", - "hyper 0.14.2", + "hyper 0.14.4", "hyper-tls 0.5.0", "ipnet", "js-sys", @@ -7111,7 +7111,7 @@ dependencies = [ "fallback", "futures 0.3.12", "hex", - "hyper 0.14.2", + "hyper 0.14.4", "lazy_static", "libc", "libsecp256k1", @@ -7228,7 +7228,7 @@ dependencies = [ "futures 0.3.12", "headers", "http", - "hyper 0.14.2", + "hyper 0.14.4", "log", "mime", "mime_guess", From d06dd14f549ba9e0315dd6413c45e797bcf357cd Mon Sep 17 00:00:00 2001 From: realbigsean Date: Tue, 9 Feb 2021 12:15:22 -0500 Subject: [PATCH 17/17] remove unused dependencies --- Cargo.lock | 23 ----------------------- beacon_node/eth2_libp2p/Cargo.toml | 1 - beacon_node/http_api/Cargo.toml | 1 - 3 files changed, 25 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 737e4411ac8..ed028b99716 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -441,27 +441,6 @@ dependencies = [ "wasm-bindgen-futures", ] -[[package]] -name = "async-stream" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3670df70cbc01729f901f94c887814b3c68db038aad1329a418bae178bc5295c" -dependencies = [ - "async-stream-impl", - "futures-core", -] - -[[package]] -name = "async-stream-impl" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3548b8efc9f8e8a5a0a2808c5bd8451a9031b9e5b879a79590304ae928b0a70" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "async-task" version = "4.0.3" @@ -2021,7 +2000,6 @@ dependencies = [ "tiny-keccak 2.0.2", "tokio 1.1.0", "tokio-io-timeout", - "tokio-stream", "tokio-util 0.6.3", "types", "unsigned-varint 0.6.0", @@ -2818,7 +2796,6 @@ dependencies = [ name = "http_api" version = "0.1.0" dependencies = [ - "async-stream", "beacon_chain", "bs58 0.4.0", "discv5", diff --git a/beacon_node/eth2_libp2p/Cargo.toml b/beacon_node/eth2_libp2p/Cargo.toml index 060330583cf..6941ed3821c 100644 --- a/beacon_node/eth2_libp2p/Cargo.toml +++ b/beacon_node/eth2_libp2p/Cargo.toml @@ -34,7 +34,6 @@ snap = "1.0.1" void = "1.0.2" hex = "0.4.2" tokio-util = { version = "0.6.2", features = ["codec", "compat", "time"] } -tokio-stream = "0.1.2" tiny-keccak = "2.0.2" task_executor = { path = "../../common/task_executor" } rand = "0.7.3" diff --git a/beacon_node/http_api/Cargo.toml b/beacon_node/http_api/Cargo.toml index a44412cffd4..25b32d33f36 100644 --- a/beacon_node/http_api/Cargo.toml +++ b/beacon_node/http_api/Cargo.toml @@ -5,7 +5,6 @@ authors = ["Paul Hauner "] edition = "2018" [dependencies] -async-stream = "0.3.0" warp = "0.3.0" serde = { version = "1.0.116", features = ["derive"] } tokio = { version = "1.1.0", features = ["macros","sync"] }