diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 4a7d61bd8d8e..0442224fead4 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -123,7 +123,7 @@ jobs: uses: actions-rs/cargo@v1 with: command: audit - args: --ignore RUSTSEC-2020-0071 --ignore RUSTSEC-2021-0130 --ignore RUSTSEC-2022-0040 + args: --ignore RUSTSEC-2020-0071 --ignore RUSTSEC-2022-0040 build: name: Build diff --git a/Cargo.lock b/Cargo.lock index aa3633544e64..691b00c24897 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -29,7 +29,7 @@ dependencies = [ "fvm_ipld_encoding", "fvm_shared", "ipld_blockstore", - "libp2p 0.40.0", + "libp2p", "serde", ] @@ -320,7 +320,7 @@ dependencies = [ "http-types", "httparse", "log", - "pin-project 1.0.11", + "pin-project", ] [[package]] @@ -337,7 +337,7 @@ dependencies = [ "parking", "polling", "slab", - "socket2 0.4.4", + "socket2", "waker-fn", "winapi 0.3.9", ] @@ -466,15 +466,16 @@ dependencies = [ [[package]] name = "async-std-resolver" -version = "0.20.4" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbf3e776afdf3a2477ef4854b85ba0dff3bd85792f685fb3c68948b4d304e4f0" +checksum = "0f2f8a4a203be3325981310ab243a28e6e4ea55b6519bffce05d41ab60e09ad8" dependencies = [ "async-std", "async-trait", "futures-io", "futures-util", "pin-utils", + "socket2", "trust-dns-resolver", ] @@ -521,15 +522,6 @@ dependencies = [ "pin-project-lite 0.2.9", ] -[[package]] -name = "atomic" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b88d82667eca772c4aa12f0f1348b3ae643424c8876448f3f7bd5787032e234c" -dependencies = [ - "autocfg", -] - [[package]] name = "atomic-waker" version = "1.0.0" @@ -731,13 +723,11 @@ dependencies = [ [[package]] name = "blake2" -version = "0.9.2" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a4e37d16930f5459780f5621038b6382b9bb37c19016f39fb6b5808d831f174" +checksum = "b9cf849ee05b2ee5fba5e36f97ff8ec2533916700fc0758d40d92136a42f3388" dependencies = [ - "crypto-mac 0.8.0", - "digest 0.9.0", - "opaque-debug 0.3.0", + "digest 0.10.3", ] [[package]] @@ -1070,9 +1060,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chacha20" -version = "0.7.3" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f08493fa7707effc63254c66c6ea908675912493cd67952eda23c09fae2610b1" +checksum = "5c80e5460aa66fe3b91d40bcbdab953a597b60053e34d684ac6903f863b680a6" dependencies = [ "cfg-if 1.0.0", "cipher 0.3.0", @@ -1082,9 +1072,9 @@ dependencies = [ [[package]] name = "chacha20poly1305" -version = "0.8.2" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6547abe025f4027edacd9edaa357aded014eecec42a5070d9b885c3c334aba2" +checksum = "a18446b09be63d457bbec447509e85f662f32952b035ce892290396bc0b0cff5" dependencies = [ "aead 0.4.3", "chacha20", @@ -1124,8 +1114,8 @@ dependencies = [ "legacy_ipld_amt", "lockfree", "log", - "lru 0.7.8", - "multihash 0.16.2", + "lru", + "multihash", "networks", "num-traits", "pbr", @@ -1169,9 +1159,8 @@ dependencies = [ "ipld_blockstore", "lazy_static", "legacy_ipld_amt", - "libp2p 0.40.0", "log", - "lru 0.7.8", + "lru", "message_pool", "networks", "nonempty", @@ -1214,7 +1203,7 @@ checksum = "fc949bff6704880faf064c42a4854032ab07bfcf3a4fcb82a57470acededb69c" dependencies = [ "core2", "multibase 0.9.1", - "multihash 0.16.2", + "multihash", "serde", "serde_bytes", "unsigned-varint 0.7.1", @@ -1283,6 +1272,15 @@ dependencies = [ "vec_map", ] +[[package]] +name = "cmake" +version = "0.1.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8ad8cef104ac57b68b89df3208164d228503abbdce70f6880ffa3d970e7443a" +dependencies = [ + "cc", +] + [[package]] name = "colored" version = "2.0.0" @@ -1350,6 +1348,22 @@ dependencies = [ "version_check", ] +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" + [[package]] name = "core2" version = "0.4.0" @@ -1661,7 +1675,7 @@ dependencies = [ "openssl-probe", "openssl-sys", "schannel", - "socket2 0.4.4", + "socket2", "winapi 0.3.9", ] @@ -1694,6 +1708,19 @@ dependencies = [ "zeroize", ] +[[package]] +name = "curve25519-dalek" +version = "4.0.0-pre.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12dc3116fe595d7847c701796ac1b189bd86b81f4f593c6f775f9d80fb2e29f4" +dependencies = [ + "byteorder 1.4.3", + "digest 0.10.3", + "rand_core 0.6.3", + "subtle", + "zeroize", +] + [[package]] name = "darling" version = "0.12.4" @@ -1952,6 +1979,7 @@ checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" dependencies = [ "block-buffer 0.10.2", "crypto-common", + "subtle", ] [[package]] @@ -2008,9 +2036,9 @@ checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" [[package]] name = "dtoa" -version = "0.4.8" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56899898ce76aaf4a0f24d914c97ea6ed976d42fec6ad33fcbb0a1103e07b2b0" +checksum = "c6053ff46b5639ceb91756a85a4c8914668393a03170efd79c8884a529d80656" [[package]] name = "ec-gpu" @@ -2042,7 +2070,7 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" dependencies = [ - "curve25519-dalek", + "curve25519-dalek 3.2.1", "ed25519", "rand 0.7.3", "serde", @@ -2067,9 +2095,9 @@ dependencies = [ [[package]] name = "enum-as-inner" -version = "0.3.4" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "570d109b813e904becc80d8d5da38376818a143348413f7149f1340fe04754d4" +checksum = "21cdad81446a7f7dc43f6a77409efeb9733d2fa65553efef6018ef257c959b73" dependencies = [ "heck 0.4.0", "proc-macro2 1.0.43", @@ -2433,7 +2461,7 @@ dependencies = [ "itertools 0.10.3", "lazy_static", "log", - "multihash 0.16.2", + "multihash", "num-derive", "num-traits", "rand 0.8.5", @@ -2696,7 +2724,7 @@ dependencies = [ "ipld_blockstore", "jsonrpc-v2", "key_management", - "libp2p 0.41.2", + "libp2p", "log", "message_pool", "metrics", @@ -2839,7 +2867,7 @@ dependencies = [ "libipld-core", "libipld-macro", "multibase 0.9.1", - "multihash 0.16.2", + "multihash", "serde", "serde_json", "thiserror", @@ -2858,7 +2886,7 @@ dependencies = [ "fvm_ipld_encoding", "fvm_shared", "leb128", - "multihash 0.16.2", + "multihash", "num-bigint 0.4.3", "serde", ] @@ -2897,10 +2925,10 @@ dependencies = [ "git-version", "ipld_blockstore", "lazy_static", - "libp2p 0.40.0", + "libp2p", "libp2p-bitswap", "log", - "multihash 0.16.2", + "multihash", "networks", "serde", "serde_ipld_dagcbor 0.1.2", @@ -3079,9 +3107,9 @@ dependencies = [ [[package]] name = "futures-rustls" -version = "0.21.1" +version = "0.22.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a1387e07917c711fb4ee4f48ea0adb04a3c9739e53ef85bf43ae1edc2937a8b" +checksum = "d2411eed028cdf8c8034eaf21f9915f956b6c3abec4d4c7949ee67f0721127bd" dependencies = [ "futures-io", "rustls", @@ -3147,7 +3175,7 @@ dependencies = [ "fvm_shared", "lazy_static", "log", - "multihash 0.16.2", + "multihash", "num-derive", "num-traits", "num_cpus", @@ -3208,7 +3236,7 @@ checksum = "688239a96199577f6705a3f9689abfd795f867f91f5847bc7e236017cc672df7" dependencies = [ "anyhow", "cid", - "multihash 0.16.2", + "multihash", ] [[package]] @@ -3236,7 +3264,7 @@ dependencies = [ "cid", "cs_serde_bytes", "fvm_ipld_blockstore", - "multihash 0.16.2", + "multihash", "serde", "serde_ipld_dagcbor 0.2.2", "serde_repr", @@ -3258,7 +3286,7 @@ dependencies = [ "fvm_ipld_blockstore", "fvm_ipld_encoding", "libipld-core", - "multihash 0.16.2", + "multihash", "once_cell", "serde", "sha2 0.10.2", @@ -3301,7 +3329,7 @@ dependencies = [ "lazy_static", "libsecp256k1 0.7.1", "log", - "multihash 0.16.2", + "multihash", "num-bigint 0.4.3", "num-derive", "num-integer", @@ -3601,7 +3629,7 @@ checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" dependencies = [ "bytes 1.2.1", "fnv", - "itoa 1.0.3", + "itoa", ] [[package]] @@ -3674,39 +3702,30 @@ dependencies = [ [[package]] name = "if-addrs" -version = "0.6.7" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2273e421f7c4f0fc99e1934fe4776f59d8df2972f4199d703fc0da9f2a9f73de" +checksum = "cbc0fa01ffc752e9dbc72818cdb072cd028b86be5e09dd04c5a643704fe101a9" dependencies = [ - "if-addrs-sys", "libc", "winapi 0.3.9", ] -[[package]] -name = "if-addrs-sys" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de74b9dd780476e837e5eb5ab7c88b49ed304126e412030a0adba99c8efe79ea" -dependencies = [ - "cc", - "libc", -] - [[package]] name = "if-watch" -version = "0.2.2" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae8ab7f67bad3240049cb24fb9cb0b4c2c6af4c245840917fbbdededeee91179" +checksum = "015a7df1eb6dda30df37f34b63ada9b7b352984b0e84de2a20ed526345000791" dependencies = [ "async-io", + "core-foundation", + "fnv", "futures", - "futures-lite", "if-addrs", "ipnet", - "libc", "log", - "winapi 0.3.9", + "rtnetlink", + "system-configuration", + "windows", ] [[package]] @@ -3800,11 +3819,11 @@ checksum = "ec58677acfea8a15352d42fc87d11d63596ade9239e0a7c9352914417515dbe6" [[package]] name = "ipconfig" -version = "0.2.2" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7e2f18aece9709094573a9f24f483c4f65caa4298e2f7ae1b71cc65d853fad7" +checksum = "723519edce41262b05d4143ceb95050e4c614f483e78e9fd9e39a8275a84ad98" dependencies = [ - "socket2 0.3.19", + "socket2", "widestring", "winapi 0.3.9", "winreg", @@ -3909,12 +3928,6 @@ dependencies = [ "either", ] -[[package]] -name = "itoa" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" - [[package]] name = "itoa" version = "1.0.3" @@ -4094,7 +4107,7 @@ dependencies = [ "libipld-json", "libipld-macro", "log", - "multihash 0.16.2", + "multihash", "parking_lot 0.12.1", "thiserror", ] @@ -4133,7 +4146,7 @@ dependencies = [ "cid", "core2", "multibase 0.9.1", - "multihash 0.16.2", + "multihash", "serde", "thiserror", ] @@ -4145,7 +4158,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "415427568962961e21009eb92fd6052de95174423cff9d3c583491858e060f4e" dependencies = [ "libipld-core", - "multihash 0.16.2", + "multihash", "serde", "serde_json", ] @@ -4187,23 +4200,26 @@ dependencies = [ [[package]] name = "libp2p" -version = "0.40.0" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bec54343492ba5940a6c555e512c6721139835d28c59bc22febece72dfd0d9d" +checksum = "81327106887e42d004fbdab1fef93675be2e2e07c1b95fce45e2cc813485611d" dependencies = [ - "atomic", "bytes 1.2.1", "futures", + "futures-timer", + "getrandom 0.2.7", + "instant", "lazy_static", + "libp2p-autonat", "libp2p-core", "libp2p-deflate", "libp2p-dns", "libp2p-floodsub", "libp2p-gossipsub", - "libp2p-identify 0.31.0", + "libp2p-identify", "libp2p-kad", "libp2p-mdns", - "libp2p-metrics 0.1.0", + "libp2p-metrics", "libp2p-mplex", "libp2p-noise", "libp2p-ping", @@ -4212,54 +4228,48 @@ dependencies = [ "libp2p-relay", "libp2p-rendezvous", "libp2p-request-response", - "libp2p-swarm 0.31.0", - "libp2p-swarm-derive 0.25.0", + "libp2p-swarm", + "libp2p-swarm-derive", "libp2p-tcp", "libp2p-uds", "libp2p-wasm-ext", "libp2p-websocket", "libp2p-yamux", "multiaddr", - "parking_lot 0.11.2", - "pin-project 1.0.11", + "parking_lot 0.12.1", + "pin-project", + "rand 0.7.3", "smallvec", - "wasm-timer", ] [[package]] -name = "libp2p" -version = "0.41.2" +name = "libp2p-autonat" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e00f5d572808870564cd48b5d86a253c3dc19487e5861c0fb9c74af60314fdb" +checksum = "4decc51f3573653a9f4ecacb31b1b922dd20c25a6322bb15318ec04287ec46f9" dependencies = [ - "atomic", - "bytes 1.2.1", + "async-trait", "futures", "futures-timer", - "getrandom 0.2.7", "instant", - "lazy_static", "libp2p-core", - "libp2p-identify 0.32.1", - "libp2p-metrics 0.2.0", - "libp2p-swarm 0.32.0", - "libp2p-swarm-derive 0.26.1", - "multiaddr", - "parking_lot 0.11.2", - "pin-project 1.0.11", - "rand 0.7.3", - "smallvec", + "libp2p-request-response", + "libp2p-swarm", + "log", + "prost 0.10.4", + "prost-build 0.10.4", + "rand 0.8.5", ] [[package]] name = "libp2p-bitswap" version = "0.6.1" -source = "git+https://github.com/ChainSafe/libp2p-bitswap?rev=8d3913ea7fc1e693776c83eecc7a9675c3426446#8d3913ea7fc1e693776c83eecc7a9675c3426446" +source = "git+https://github.com/ChainSafe/libp2p-bitswap?rev=5c79b37feceb3ba76d5a488b1713cfaaf861baa3#5c79b37feceb3ba76d5a488b1713cfaaf861baa3" dependencies = [ "async-std", "fnv", "futures", - "libp2p 0.40.0", + "libp2p", "log", "prost 0.8.0", "prost-build 0.8.0", @@ -4271,9 +4281,9 @@ dependencies = [ [[package]] name = "libp2p-core" -version = "0.30.2" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86aad7d54df283db817becded03e611137698a6509d4237a96881976a162340c" +checksum = "fbf9b94cefab7599b2d3dff2f93bee218c6621d68590b23ede4485813cbcece6" dependencies = [ "asn1_der", "bs58", @@ -4287,16 +4297,16 @@ dependencies = [ "libsecp256k1 0.7.1", "log", "multiaddr", - "multihash 0.14.0", + "multihash", "multistream-select", - "parking_lot 0.11.2", - "pin-project 1.0.11", - "prost 0.9.0", - "prost-build 0.9.0", + "parking_lot 0.12.1", + "pin-project", + "prost 0.10.4", + "prost-build 0.10.4", "rand 0.8.5", "ring", "rw-stream-sink", - "sha2 0.9.9", + "sha2 0.10.2", "smallvec", "thiserror", "unsigned-varint 0.7.1", @@ -4306,9 +4316,9 @@ dependencies = [ [[package]] name = "libp2p-deflate" -version = "0.30.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51a800adb195f33de63f4b17b63fe64cfc23bf2c6a0d3d0d5321328664e65197" +checksum = "d0183dc2a3da1fbbf85e5b6cf51217f55b14f5daea0c455a9536eef646bfec71" dependencies = [ "flate2", "futures", @@ -4317,41 +4327,42 @@ dependencies = [ [[package]] name = "libp2p-dns" -version = "0.30.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb8f89d15cb6e3c5bc22afff7513b11bab7856f2872d3cfba86f7f63a06bc498" +checksum = "6cbf54723250fa5d521383be789bf60efdabe6bacfb443f87da261019a49b4b5" dependencies = [ "async-std-resolver", "futures", "libp2p-core", "log", + "parking_lot 0.12.1", "smallvec", "trust-dns-resolver", ] [[package]] name = "libp2p-floodsub" -version = "0.31.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aab3d7210901ea51b7bae2b581aa34521797af8c4ec738c980bda4a06434067f" +checksum = "98a4b6ffd53e355775d24b76f583fdda54b3284806f678499b57913adb94f231" dependencies = [ "cuckoofilter", "fnv", "futures", "libp2p-core", - "libp2p-swarm 0.31.0", + "libp2p-swarm", "log", - "prost 0.9.0", - "prost-build 0.9.0", + "prost 0.10.4", + "prost-build 0.10.4", "rand 0.7.3", "smallvec", ] [[package]] name = "libp2p-gossipsub" -version = "0.33.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfeead619eb5dac46e65acc78c535a60aaec803d1428cca6407c3a4fc74d698d" +checksum = "74b4b888cfbeb1f5551acd3aa1366e01bf88ede26cc3c4645d0d2d004d5ca7b0" dependencies = [ "asynchronous-codec", "base64 0.13.0", @@ -4360,14 +4371,16 @@ dependencies = [ "fnv", "futures", "hex_fmt", + "instant", "libp2p-core", - "libp2p-swarm 0.31.0", + "libp2p-swarm", "log", - "prost 0.9.0", - "prost-build 0.9.0", + "prometheus-client", + "prost 0.10.4", + "prost-build 0.10.4", "rand 0.7.3", "regex", - "sha2 0.9.9", + "sha2 0.10.2", "smallvec", "unsigned-varint 0.7.1", "wasm-timer", @@ -4375,69 +4388,58 @@ dependencies = [ [[package]] name = "libp2p-identify" -version = "0.31.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cca1275574183f288ff8b72d535d5ffa5ea9292ef7829af8b47dcb197c7b0dcd" -dependencies = [ - "futures", - "libp2p-core", - "libp2p-swarm 0.31.0", - "log", - "lru 0.6.6", - "prost 0.9.0", - "prost-build 0.9.0", - "smallvec", - "wasm-timer", -] - -[[package]] -name = "libp2p-identify" -version = "0.32.1" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32329181638a103321c05ef697f406abbccc695780b7c7d3dc34206758e9eb09" +checksum = "c50b585518f8efd06f93ac2f976bd672e17cdac794644b3117edd078e96bda06" dependencies = [ + "asynchronous-codec", "futures", "futures-timer", "libp2p-core", - "libp2p-swarm 0.32.0", + "libp2p-swarm", "log", - "lru 0.7.8", - "prost 0.9.0", - "prost-build 0.9.0", + "lru", + "prost 0.10.4", + "prost-build 0.10.4", + "prost-codec", "smallvec", + "thiserror", + "void", ] [[package]] name = "libp2p-kad" -version = "0.32.0" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2297dc0ca285f3a09d1368bde02449e539b46f94d32d53233f53f6625bcd3ba" +checksum = "740862893bb5f06ac24acc9d49bdeadc3a5e52e51818a30a25c1f3519da2c851" dependencies = [ - "arrayvec 0.5.2", + "arrayvec 0.7.2", "asynchronous-codec", "bytes 1.2.1", "either", "fnv", "futures", + "futures-timer", + "instant", "libp2p-core", - "libp2p-swarm 0.31.0", + "libp2p-swarm", "log", - "prost 0.9.0", - "prost-build 0.9.0", + "prost 0.10.4", + "prost-build 0.10.4", "rand 0.7.3", - "sha2 0.9.9", + "sha2 0.10.2", "smallvec", + "thiserror", "uint", "unsigned-varint 0.7.1", "void", - "wasm-timer", ] [[package]] name = "libp2p-mdns" -version = "0.32.0" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c864b64bdc8a84ff3910a0df88e6535f256191a450870f1e7e10cbf8e64d45" +checksum = "66e5e5919509603281033fd16306c61df7a4428ce274b67af5e14b07de5cdcb2" dependencies = [ "async-io", "data-encoding", @@ -4446,45 +4448,35 @@ dependencies = [ "if-watch", "lazy_static", "libp2p-core", - "libp2p-swarm 0.31.0", + "libp2p-swarm", "log", "rand 0.8.5", "smallvec", - "socket2 0.4.4", + "socket2", "void", ] [[package]] name = "libp2p-metrics" -version = "0.1.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4af432fcdd2f8ba4579b846489f8f0812cfd738ced2c0af39df9b1c48bbb6ab2" +checksum = "ef8aff4a1abef42328fbb30b17c853fff9be986dc39af17ee39f9c5f755c5e0c" dependencies = [ "libp2p-core", - "libp2p-identify 0.31.0", + "libp2p-gossipsub", + "libp2p-identify", "libp2p-kad", "libp2p-ping", - "libp2p-swarm 0.31.0", - "open-metrics-client", -] - -[[package]] -name = "libp2p-metrics" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59f3be49edeecff13ef0d0dc28295ba4a33910611715f04236325d08e4119e0" -dependencies = [ - "libp2p-core", - "libp2p-identify 0.32.1", - "libp2p-swarm 0.32.0", - "open-metrics-client", + "libp2p-relay", + "libp2p-swarm", + "prometheus-client", ] [[package]] name = "libp2p-mplex" -version = "0.30.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2cd64ef597f40e14bfce0497f50ecb63dd6d201c61796daeb4227078834fbf" +checksum = "61fd1b20638ec209c5075dfb2e8ce6a7ea4ec3cd3ad7b77f7a477c06d53322e2" dependencies = [ "asynchronous-codec", "bytes 1.2.1", @@ -4492,7 +4484,7 @@ dependencies = [ "libp2p-core", "log", "nohash-hasher", - "parking_lot 0.11.2", + "parking_lot 0.12.1", "rand 0.7.3", "smallvec", "unsigned-varint 0.7.1", @@ -4500,20 +4492,20 @@ dependencies = [ [[package]] name = "libp2p-noise" -version = "0.33.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8772c7a99088221bb7ca9c5c0574bf55046a7ab4c319f3619b275f28c8fb87a" +checksum = "762408cb5d84b49a600422d7f9a42c18012d8da6ebcd570f9a4a4290ba41fb6f" dependencies = [ "bytes 1.2.1", - "curve25519-dalek", + "curve25519-dalek 3.2.1", "futures", "lazy_static", "libp2p-core", "log", - "prost 0.9.0", - "prost-build 0.9.0", + "prost 0.10.4", + "prost-build 0.10.4", "rand 0.8.5", - "sha2 0.9.9", + "sha2 0.10.2", "snow", "static_assertions", "x25519-dalek", @@ -4522,32 +4514,33 @@ dependencies = [ [[package]] name = "libp2p-ping" -version = "0.31.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80ef7b0ec5cf06530d9eb6cf59ae49d46a2c45663bde31c25a12f682664adbcf" +checksum = "100a6934ae1dbf8a693a4e7dd1d730fd60b774dafc45688ed63b554497c6c925" dependencies = [ "futures", + "futures-timer", + "instant", "libp2p-core", - "libp2p-swarm 0.31.0", + "libp2p-swarm", "log", "rand 0.7.3", "void", - "wasm-timer", ] [[package]] name = "libp2p-plaintext" -version = "0.30.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fba1a6ff33e4a274c89a3b1d78b9f34f32af13265cc5c46c16938262d4e945a" +checksum = "be27bf0820a6238a4e06365b096d428271cce85a129cf16f2fe9eb1610c4df86" dependencies = [ "asynchronous-codec", "bytes 1.2.1", "futures", "libp2p-core", "log", - "prost 0.9.0", - "prost-build 0.9.0", + "prost 0.10.4", + "prost-build 0.10.4", "unsigned-varint 0.7.1", "void", ] @@ -4560,7 +4553,7 @@ checksum = "0f1a458bbda880107b5b36fcb9b5a1ef0c329685da0e203ed692a8ebe64cc92c" dependencies = [ "futures", "log", - "pin-project 1.0.11", + "pin-project", "rand 0.7.3", "salsa20", "sha3 0.9.1", @@ -4568,116 +4561,96 @@ dependencies = [ [[package]] name = "libp2p-relay" -version = "0.4.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2852b61c90fa8ce3c8fcc2aba76e6cefc20d648f9df29157d6b3a916278ef3e3" +checksum = "4931547ee0cce03971ccc1733ff05bb0c4349fd89120a39e9861e2bbe18843c3" dependencies = [ "asynchronous-codec", "bytes 1.2.1", + "either", "futures", "futures-timer", + "instant", "libp2p-core", - "libp2p-swarm 0.31.0", + "libp2p-swarm", "log", - "pin-project 1.0.11", - "prost 0.9.0", - "prost-build 0.9.0", - "rand 0.7.3", + "pin-project", + "prost 0.10.4", + "prost-build 0.10.4", + "prost-codec", + "rand 0.8.5", "smallvec", - "unsigned-varint 0.7.1", + "static_assertions", + "thiserror", "void", - "wasm-timer", ] [[package]] name = "libp2p-rendezvous" -version = "0.1.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14a6d2b9e7677eff61dc3d2854876aaf3976d84a01ef6664b610c77a0c9407c5" +checksum = "9511c9672ba33284838e349623319c8cad2d18cfad243ae46c6b7e8a2982ea4e" dependencies = [ "asynchronous-codec", "bimap", "futures", + "futures-timer", + "instant", "libp2p-core", - "libp2p-swarm 0.31.0", + "libp2p-swarm", "log", - "prost 0.9.0", - "prost-build 0.9.0", + "prost 0.10.4", + "prost-build 0.10.4", "rand 0.8.5", - "sha2 0.9.9", + "sha2 0.10.2", "thiserror", "unsigned-varint 0.7.1", "void", - "wasm-timer", ] [[package]] name = "libp2p-request-response" -version = "0.13.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a877a4ced6d46bf84677e1974e8cf61fb434af73b2e96fb48d6cb6223a4634d8" +checksum = "508a189e2795d892c8f5c1fa1e9e0b1845d32d7b0b249dbf7b05b18811361843" dependencies = [ "async-trait", "bytes 1.2.1", "futures", + "instant", "libp2p-core", - "libp2p-swarm 0.31.0", + "libp2p-swarm", "log", - "lru 0.7.8", "rand 0.7.3", "smallvec", "unsigned-varint 0.7.1", - "wasm-timer", -] - -[[package]] -name = "libp2p-swarm" -version = "0.31.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f5184a508f223bc100a12665517773fb8730e9f36fc09eefb670bf01b107ae9" -dependencies = [ - "either", - "futures", - "libp2p-core", - "log", - "rand 0.7.3", - "smallvec", - "void", - "wasm-timer", ] [[package]] name = "libp2p-swarm" -version = "0.32.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb84d40627cd109bbbf43da9269d4ef75903f42356c88d98b2b55c47c430c792" +checksum = "95ac5be6c2de2d1ff3f7693fda6faf8a827b1f3e808202277783fea9f527d114" dependencies = [ "either", + "fnv", "futures", "futures-timer", "instant", "libp2p-core", "log", + "pin-project", "rand 0.7.3", "smallvec", + "thiserror", "void", ] [[package]] name = "libp2p-swarm-derive" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "072c290f727d39bdc4e9d6d1c847978693d25a673bd757813681e33e5f6c00c2" -dependencies = [ - "quote 1.0.21", - "syn 1.0.99", -] - -[[package]] -name = "libp2p-swarm-derive" -version = "0.26.1" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33b4d0acd47739fe0b570728d8d11bbb535050d84c0cf05d6477a4891fceae10" +checksum = "9f54a64b6957249e0ce782f8abf41d97f69330d02bf229f0672d864f0650cc76" dependencies = [ "quote 1.0.21", "syn 1.0.99", @@ -4685,9 +4658,9 @@ dependencies = [ [[package]] name = "libp2p-tcp" -version = "0.30.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7399c5b6361ef525d41c11fcf51635724f832baf5819b30d3d873eabb4fbae4b" +checksum = "8a6771dc19aa3c65d6af9a8c65222bfc8fcd446630ddca487acd161fa6096f3b" dependencies = [ "async-io", "futures", @@ -4697,14 +4670,14 @@ dependencies = [ "libc", "libp2p-core", "log", - "socket2 0.4.4", + "socket2", ] [[package]] name = "libp2p-uds" -version = "0.30.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8b7563e46218165dfd60f64b96f7ce84590d75f53ecbdc74a7dd01450dc5973" +checksum = "d125e3e5f0d58f3c6ac21815b20cf4b6a88b8db9dc26368ea821838f4161fd4d" dependencies = [ "async-std", "futures", @@ -4714,9 +4687,9 @@ dependencies = [ [[package]] name = "libp2p-wasm-ext" -version = "0.30.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1008a302b73c5020251f9708c653f5ed08368e530e247cc9cd2f109ff30042cf" +checksum = "ec894790eec3c1608f8d1a8a0bdf0dbeb79ed4de2dce964222011c2896dfa05a" dependencies = [ "futures", "js-sys", @@ -4728,15 +4701,16 @@ dependencies = [ [[package]] name = "libp2p-websocket" -version = "0.31.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e12df82d1ed64969371a9e65ea92b91064658604cc2576c2757f18ead9a1cf" +checksum = "9808e57e81be76ff841c106b4c5974fb4d41a233a7bdd2afbf1687ac6def3818" dependencies = [ "either", "futures", "futures-rustls", "libp2p-core", "log", + "parking_lot 0.12.1", "quicksink", "rw-stream-sink", "soketto", @@ -4746,13 +4720,13 @@ dependencies = [ [[package]] name = "libp2p-yamux" -version = "0.34.0" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e7362abb8867d7187e7e93df17f460d554c997fc5c8ac57dc1259057f6889af" +checksum = "c6dea686217a06072033dc025631932810e2f6ad784e4fafa42e27d311c7a81c" dependencies = [ "futures", "libp2p-core", - "parking_lot 0.11.2", + "parking_lot 0.12.1", "thiserror", "yamux", ] @@ -4934,15 +4908,6 @@ dependencies = [ "value-bag", ] -[[package]] -name = "lru" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ea2d928b485416e8908cff2d97d621db22b27f7b3b6729e438bcf42c671ba91" -dependencies = [ - "hashbrown 0.11.2", -] - [[package]] name = "lru" version = "0.7.8" @@ -5072,7 +5037,7 @@ dependencies = [ "key_management", "libsecp256k1 0.6.0", "log", - "lru 0.7.8", + "lru", "networks", "num-rational", "num-traits", @@ -5136,15 +5101,15 @@ checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" [[package]] name = "multiaddr" -version = "0.13.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48ee4ea82141951ac6379f964f71b20876d43712bea8faf6dd1a375e08a46499" +checksum = "3c580bfdd8803cce319b047d239559a22f809094aaea4ac13902a1fdcfcd4261" dependencies = [ "arrayref", "bs58", "byteorder 1.4.3", "data-encoding", - "multihash 0.14.0", + "multihash", "percent-encoding", "serde", "static_assertions", @@ -5174,19 +5139,6 @@ dependencies = [ "data-encoding-macro", ] -[[package]] -name = "multihash" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "752a61cd890ff691b4411423d23816d5866dd5621e4d1c5687a53b94b5a979d8" -dependencies = [ - "digest 0.9.0", - "generic-array 0.14.6", - "multihash-derive 0.7.2", - "sha2 0.9.9", - "unsigned-varint 0.7.1", -] - [[package]] name = "multihash" version = "0.16.2" @@ -5198,7 +5150,7 @@ dependencies = [ "blake3 1.3.1", "core2", "digest 0.10.3", - "multihash-derive 0.8.0", + "multihash-derive", "serde", "serde-big-array", "sha2 0.10.2", @@ -5206,20 +5158,6 @@ dependencies = [ "unsigned-varint 0.7.1", ] -[[package]] -name = "multihash-derive" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "424f6e86263cd5294cbd7f1e95746b95aca0e0d66bff31e5a40d6baa87b4aa99" -dependencies = [ - "proc-macro-crate 1.2.0", - "proc-macro-error", - "proc-macro2 1.0.43", - "quote 1.0.21", - "syn 1.0.99", - "synstructure", -] - [[package]] name = "multihash-derive" version = "0.8.0" @@ -5242,14 +5180,14 @@ checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" [[package]] name = "multistream-select" -version = "0.10.4" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56a336acba8bc87c8876f6425407dbbe6c417bf478b22015f8fb0994ef3bc0ab" +checksum = "363a84be6453a70e63513660f4894ef815daf88e3356bffcda9ca27d810ce83b" dependencies = [ "bytes 1.2.1", "futures", "log", - "pin-project 1.0.11", + "pin-project", "smallvec", "unsigned-varint 0.7.1", ] @@ -5321,6 +5259,72 @@ dependencies = [ "url", ] +[[package]] +name = "netlink-packet-core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "345b8ab5bd4e71a2986663e88c56856699d060e78e152e6e9d7966fcd5491297" +dependencies = [ + "anyhow", + "byteorder 1.4.3", + "libc", + "netlink-packet-utils", +] + +[[package]] +name = "netlink-packet-route" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9ea4302b9759a7a88242299225ea3688e63c85ea136371bb6cf94fd674efaab" +dependencies = [ + "anyhow", + "bitflags", + "byteorder 1.4.3", + "libc", + "netlink-packet-core", + "netlink-packet-utils", +] + +[[package]] +name = "netlink-packet-utils" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25af9cf0dc55498b7bd94a1508af7a78706aa0ab715a73c5169273e03c84845e" +dependencies = [ + "anyhow", + "byteorder 1.4.3", + "paste", + "thiserror", +] + +[[package]] +name = "netlink-proto" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65b4b14489ab424703c092062176d52ba55485a89c076b4f9db05092b7223aa6" +dependencies = [ + "bytes 1.2.1", + "futures", + "log", + "netlink-packet-core", + "netlink-sys", + "thiserror", + "tokio", +] + +[[package]] +name = "netlink-sys" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92b654097027250401127914afb37cb1f311df6610a9891ff07a757e94199027" +dependencies = [ + "async-io", + "bytes 1.2.1", + "futures", + "libc", + "log", +] + [[package]] name = "networks" version = "0.1.0" @@ -5513,29 +5517,6 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" -[[package]] -name = "open-metrics-client" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7337d80c23c2d8b1349563981bc4fb531220733743ba8115454a67b181173f0d" -dependencies = [ - "dtoa", - "itoa 0.4.8", - "open-metrics-client-derive-text-encode", - "owning_ref", -] - -[[package]] -name = "open-metrics-client-derive-text-encode" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a15c83b586f00268c619c1cb3340ec1a6f59dd9ba1d9833a273a68e6d5cd8ffc" -dependencies = [ - "proc-macro2 1.0.43", - "quote 1.0.21", - "syn 1.0.99", -] - [[package]] name = "opencl3" version = "0.4.1" @@ -5755,33 +5736,13 @@ dependencies = [ "indexmap", ] -[[package]] -name = "pin-project" -version = "0.4.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ef0f924a5ee7ea9cbcea77529dba45f8a9ba9f622419fe3386ca581a3ae9d5a" -dependencies = [ - "pin-project-internal 0.4.30", -] - [[package]] name = "pin-project" version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78203e83c48cffbe01e4a2d35d566ca4de445d79a85372fc64e378bfc812a260" dependencies = [ - "pin-project-internal 1.0.11", -] - -[[package]] -name = "pin-project-internal" -version = "0.4.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "851c8d0ce9bebe43790dedfc86614c23494ac9f423dd618d3a61fc693eafe61e" -dependencies = [ - "proc-macro2 1.0.43", - "quote 1.0.21", - "syn 1.0.99", + "pin-project-internal", ] [[package]] @@ -6062,6 +6023,29 @@ dependencies = [ "thiserror", ] +[[package]] +name = "prometheus-client" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac1abe0255c04d15f571427a2d1e00099016506cf3297b53853acd2b7eb87825" +dependencies = [ + "dtoa", + "itoa", + "owning_ref", + "prometheus-client-derive-text-encode", +] + +[[package]] +name = "prometheus-client-derive-text-encode" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8e12d01b9d66ad9eb4529c57666b6263fc1993cb30261d83ead658fdd932652" +dependencies = [ + "proc-macro2 1.0.43", + "quote 1.0.21", + "syn 1.0.99", +] + [[package]] name = "prost" version = "0.8.0" @@ -6074,12 +6058,12 @@ dependencies = [ [[package]] name = "prost" -version = "0.9.0" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "444879275cb4fd84958b1a1d5420d15e6fcf7c235fe47f053c9c2a80aceb6001" +checksum = "71adf41db68aa0daaefc69bb30bcd68ded9b9abaad5d1fbb6304c4fb390e083e" dependencies = [ "bytes 1.2.1", - "prost-derive 0.9.0", + "prost-derive 0.10.1", ] [[package]] @@ -6102,24 +6086,39 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.9.0" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62941722fb675d463659e49c4f3fe1fe792ff24fe5bbaa9c08cd3b98a1c354f5" +checksum = "8ae5a4388762d5815a9fc0dea33c56b021cdc8dde0c55e0c9ca57197254b0cab" dependencies = [ "bytes 1.2.1", - "heck 0.3.3", + "cfg-if 1.0.0", + "cmake", + "heck 0.4.0", "itertools 0.10.3", "lazy_static", "log", "multimap", "petgraph 0.6.2", - "prost 0.9.0", - "prost-types 0.9.0", + "prost 0.10.4", + "prost-types 0.10.1", "regex", "tempfile", "which", ] +[[package]] +name = "prost-codec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00af1e92c33b4813cc79fda3f2dbf56af5169709be0202df730e9ebc3e4cd007" +dependencies = [ + "asynchronous-codec", + "bytes 1.2.1", + "prost 0.10.4", + "thiserror", + "unsigned-varint 0.7.1", +] + [[package]] name = "prost-derive" version = "0.8.0" @@ -6135,9 +6134,9 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.9.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9cc1a3263e07e0bf68e96268f37665207b49560d98739662cdfaae215c720fe" +checksum = "7b670f45da57fb8542ebdbb6105a925fe571b67f9e7ed9f47a06a84e72b4e7cc" dependencies = [ "anyhow", "itertools 0.10.3", @@ -6158,12 +6157,12 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.9.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534b7a0e836e3c482d2693070f982e39e7611da9695d4d1f5a4b186b51faef0a" +checksum = "2d0a014229361011dc8e69c8a1ec6c2e8d0f2af7c91e3ea3f5b2170298461e68" dependencies = [ "bytes 1.2.1", - "prost 0.9.0", + "prost 0.10.4", ] [[package]] @@ -6620,7 +6619,7 @@ dependencies = [ "ipld_blockstore", "jsonrpc-v2", "key_management", - "libp2p 0.40.0", + "libp2p", "message_pool", "once_cell", "serde", @@ -6649,6 +6648,21 @@ dependencies = [ "surf", ] +[[package]] +name = "rtnetlink" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "322c53fd76a18698f1c27381d58091de3a043d356aa5bd0d510608b565f469a0" +dependencies = [ + "async-global-executor", + "futures", + "log", + "netlink-packet-route", + "netlink-proto", + "nix", + "thiserror", +] + [[package]] name = "rug" version = "1.16.0" @@ -6696,15 +6710,6 @@ dependencies = [ "semver 0.9.0", ] -[[package]] -name = "rustc_version" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" -dependencies = [ - "semver 0.11.0", -] - [[package]] name = "rustc_version" version = "0.4.0" @@ -6730,11 +6735,10 @@ dependencies = [ [[package]] name = "rustls" -version = "0.19.1" +version = "0.20.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" +checksum = "5aab8ee6c7097ed6057f43c187a62418d0c05a4bd5f18b3571db50ee0f9ce033" dependencies = [ - "base64 0.13.0", "log", "ring", "sct", @@ -6749,12 +6753,12 @@ checksum = "97477e48b4cf8603ad5f7aaf897467cf42ab4218a38ef76fb14c2d6773a6d6a8" [[package]] name = "rw-stream-sink" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4da5fcb054c46f5a5dff833b129285a93d3f0179531735e6c866e8cc307d2020" +checksum = "26338f5e09bb721b85b135ea05af7767c90b52f6de4f087d4f4a3a9d64e7dc04" dependencies = [ "futures", - "pin-project 0.4.30", + "pin-project", "static_assertions", ] @@ -6800,9 +6804,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "sct" -version = "0.6.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" dependencies = [ "ring", "untrusted", @@ -6923,7 +6927,7 @@ version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38dd04e3c8279e75b31ef29dbdceebfe5ad89f4d0937213c53f7d49d01b3d5a7" dependencies = [ - "itoa 1.0.3", + "itoa", "ryu", "serde", ] @@ -6978,7 +6982,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ "form_urlencoded", - "itoa 1.0.3", + "itoa", "ryu", "serde", ] @@ -7219,31 +7223,19 @@ checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" [[package]] name = "snow" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6142f7c25e94f6fd25a32c3348ec230df9109b463f59c8c7acc4bd34936babb7" +checksum = "774d05a3edae07ce6d68ea6984f3c05e9bba8927e3dd591e3b479e5b03213d0d" dependencies = [ "aes-gcm 0.9.4", "blake2", "chacha20poly1305", - "rand 0.8.5", + "curve25519-dalek 4.0.0-pre.2", "rand_core 0.6.3", "ring", - "rustc_version 0.3.3", - "sha2 0.9.9", + "rustc_version 0.4.0", + "sha2 0.10.2", "subtle", - "x25519-dalek", -] - -[[package]] -name = "socket2" -version = "0.3.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "122e570113d28d773067fab24266b66753f6ea915758651696b6e35e49f88d6e" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "winapi 0.3.9", ] [[package]] @@ -7382,7 +7374,7 @@ dependencies = [ "fvm_ipld_bitfield", "fvm_shared", "ipld_blockstore", - "libp2p 0.40.0", + "libp2p", "log", "num_cpus", "rayon", @@ -7757,6 +7749,27 @@ dependencies = [ "unicode-xid 0.2.3", ] +[[package]] +name = "system-configuration" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d75182f12f490e953596550b65ee31bda7c8e043d9386174b353bda50838c3fd" +dependencies = [ + "bitflags", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "tap" version = "1.0.1" @@ -7903,7 +7916,7 @@ dependencies = [ "async-tungstenite", "base64 0.13.0", "futures-util", - "pin-project 1.0.11", + "pin-project", "serde", "serde_json", "sha-1", @@ -7942,7 +7955,7 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2702e08a7a860f005826c6815dcac101b19b5eb330c27fe4a5928fec1d20ddd" dependencies = [ - "itoa 1.0.3", + "itoa", "libc", "num_threads", "serde", @@ -8052,6 +8065,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a8325f63a7d4774dd041e363b2409ed1c5cbbd0f867795e661df066b2b0a581" dependencies = [ "autocfg", + "bytes 1.2.1", + "memchr", "num_cpus", "once_cell", "pin-project-lite 0.2.9", @@ -8105,15 +8120,15 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" dependencies = [ - "pin-project 1.0.11", + "pin-project", "tracing", ] [[package]] name = "trust-dns-proto" -version = "0.20.4" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca94d4e9feb6a181c690c4040d7a24ef34018d8313ac5044a61d21222ae24e31" +checksum = "9c31f240f59877c3d4bb3b3ea0ec5a6a0cff07323580ff8c7a605cd7d08b255d" dependencies = [ "async-trait", "cfg-if 1.0.0", @@ -8135,9 +8150,9 @@ dependencies = [ [[package]] name = "trust-dns-resolver" -version = "0.20.4" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecae383baad9995efaa34ce8e57d12c3f305e545887472a492b838f4b5cfb77a" +checksum = "e4ba72c2ea84515690c9fcef4c6c660bb9df3036ed1051686de84605b74fd558" dependencies = [ "cfg-if 1.0.0", "futures-util", @@ -8145,7 +8160,7 @@ dependencies = [ "lazy_static", "log", "lru-cache", - "parking_lot 0.11.2", + "parking_lot 0.12.1", "resolv-conf", "smallvec", "thiserror", @@ -8656,9 +8671,9 @@ dependencies = [ [[package]] name = "webpki" -version = "0.21.4" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" +checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" dependencies = [ "ring", "untrusted", @@ -8666,9 +8681,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.21.1" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aabe153544e473b775453675851ecc86863d2a81d786d741f6b76778f2a48940" +checksum = "f1c760f0d366a6c24a02ed7816e23e691f5d92291f94d15e836006fd11b04daf" dependencies = [ "webpki", ] @@ -8695,9 +8710,9 @@ dependencies = [ [[package]] name = "widestring" -version = "0.4.3" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c168940144dd21fd8046987c16a46a33d5fc84eec29ef9dcddc2ac9e31526b7c" +checksum = "17882f045410753661207383517a6f62ec3dbeb6a4ed2acce01f0728238d1983" [[package]] name = "winapi" @@ -8742,43 +8757,86 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45296b64204227616fdbf2614cefa4c236b98ee64dfaaaa435207ed99fe7829f" +dependencies = [ + "windows_aarch64_msvc 0.34.0", + "windows_i686_gnu 0.34.0", + "windows_i686_msvc 0.34.0", + "windows_x86_64_gnu 0.34.0", + "windows_x86_64_msvc 0.34.0", +] + [[package]] name = "windows-sys" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" dependencies = [ - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_msvc", + "windows_aarch64_msvc 0.36.1", + "windows_i686_gnu 0.36.1", + "windows_i686_msvc 0.36.1", + "windows_x86_64_gnu 0.36.1", + "windows_x86_64_msvc 0.36.1", ] +[[package]] +name = "windows_aarch64_msvc" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17cffbe740121affb56fad0fc0e421804adf0ae00891205213b5cecd30db881d" + [[package]] name = "windows_aarch64_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" +[[package]] +name = "windows_i686_gnu" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2564fde759adb79129d9b4f54be42b32c89970c18ebf93124ca8870a498688ed" + [[package]] name = "windows_i686_gnu" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" +[[package]] +name = "windows_i686_msvc" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cd9d32ba70453522332c14d38814bceeb747d80b3958676007acadd7e166956" + [[package]] name = "windows_i686_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" +[[package]] +name = "windows_x86_64_gnu" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfce6deae227ee8d356d19effc141a509cc503dfd1f850622ec4b0f84428e1f4" + [[package]] name = "windows_x86_64_gnu" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" +[[package]] +name = "windows_x86_64_msvc" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d19538ccc21819d01deaf88d6a17eae6596a12e9aafdbb97916fb49896d89de9" + [[package]] name = "windows_x86_64_msvc" version = "0.36.1" @@ -8787,9 +8845,9 @@ checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" [[package]] name = "winreg" -version = "0.6.2" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2986deb581c4fe11b621998a5e53361efe6b48a151178d0cd9eeffa4dc6acc9" +checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69" dependencies = [ "winapi 0.3.9", ] @@ -8809,21 +8867,21 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2392b6b94a576b4e2bf3c5b2757d63f10ada8020a2e4d08ac849ebcf6ea8e077" dependencies = [ - "curve25519-dalek", + "curve25519-dalek 3.2.1", "rand_core 0.5.1", "zeroize", ] [[package]] name = "yamux" -version = "0.9.0" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7d9028f208dd5e63c614be69f115c1b53cacc1111437d4c765185856666c107" +checksum = "e5d9ba232399af1783a58d8eb26f6b5006fbefe2dc9ef36bd283324792d03ea5" dependencies = [ "futures", "log", "nohash-hasher", - "parking_lot 0.11.2", + "parking_lot 0.12.1", "rand 0.8.5", "static_assertions", ] diff --git a/Dockerfile b/Dockerfile index f57b04c2b4b3..777e958f6c42 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,7 @@ FROM rust:1-buster AS build-env # Install dependencies -RUN apt-get update && apt-get install --no-install-recommends -y build-essential clang ocl-icd-opencl-dev +RUN apt-get update && apt-get install --no-install-recommends -y build-essential clang ocl-icd-opencl-dev cmake WORKDIR /usr/src/forest COPY . . diff --git a/README.md b/README.md index c0741f0233ba..16a75b1ab7de 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ sudo apt install build-essential clang ocl-icd-opencl-dev libssl-dev sudo pacman -S base-devel clang ocl-icd openssl # Fedora (36) -sudo dnf install -y clang-devel ocl-icd-devel +sudo dnf install -y clang-devel ocl-icd-devel cmake ``` ## Installation diff --git a/blockchain/chain_sync/Cargo.toml b/blockchain/chain_sync/Cargo.toml index 0b3824ce4f80..7cfe90874b72 100644 --- a/blockchain/chain_sync/Cargo.toml +++ b/blockchain/chain_sync/Cargo.toml @@ -31,7 +31,6 @@ interpreter = { path = "../../vm/interpreter/" } ipld_blockstore = "0.1" lazy_static = "1.4.0" legacy_ipld_amt = { path = "../../ipld/legacy_amt" } -libp2p = { version = "0.40.0-rc.1", default-features = false } log = "0.4.8" lru = "0.7.2" message_pool = { path = "../message_pool" } diff --git a/blockchain/chain_sync/src/chain_muxer.rs b/blockchain/chain_sync/src/chain_muxer.rs index 1f2f434e4b58..08caec027d56 100644 --- a/blockchain/chain_sync/src/chain_muxer.rs +++ b/blockchain/chain_sync/src/chain_muxer.rs @@ -17,12 +17,12 @@ use forest_blocks::{ Block, Error as ForestBlockError, FullTipset, GossipBlock, Tipset, TipsetKeys, }; use forest_libp2p::{ - hello::HelloRequest, rpc::RequestResponseError, NetworkEvent, NetworkMessage, PubsubMessage, + hello::HelloRequest, rpc::RequestResponseError, NetworkEvent, NetworkMessage, PeerId, + PubsubMessage, }; use forest_message::SignedMessage; use fvm_shared::message::Message; use ipld_blockstore::BlockStore; -use libp2p::core::PeerId; use message_pool::{MessagePool, Provider}; use state_manager::StateManager; diff --git a/blockchain/chain_sync/src/network_context.rs b/blockchain/chain_sync/src/network_context.rs index 18980c06ab08..18181d1f4bc8 100644 --- a/blockchain/chain_sync/src/network_context.rs +++ b/blockchain/chain_sync/src/network_context.rs @@ -12,11 +12,10 @@ use forest_libp2p::{ }, hello::{HelloRequest, HelloResponse}, rpc::RequestResponseError, - NetworkMessage, + NetworkMessage, PeerId, }; use futures::channel::oneshot::channel as oneshot_channel; use ipld_blockstore::{BlockStore, BlockStoreExt}; -use libp2p::core::PeerId; use log::{debug, trace, warn}; use std::convert::TryFrom; use std::sync::Arc; diff --git a/blockchain/chain_sync/src/peer_manager.rs b/blockchain/chain_sync/src/peer_manager.rs index 8bb5b7940931..b967bb3b5f20 100644 --- a/blockchain/chain_sync/src/peer_manager.rs +++ b/blockchain/chain_sync/src/peer_manager.rs @@ -8,7 +8,7 @@ use std::{cmp::Ordering, collections::HashSet}; use async_std::sync::RwLock; use forest_blocks::Tipset; -use libp2p::core::PeerId; +use forest_libp2p::PeerId; use log::{debug, trace}; use rand::seq::SliceRandom; use smallvec::SmallVec; diff --git a/forest/Cargo.toml b/forest/Cargo.toml index 34f62cc45901..fa591c1c16a1 100644 --- a/forest/Cargo.toml +++ b/forest/Cargo.toml @@ -39,7 +39,7 @@ genesis = { path = "../utils/genesis" } hex = "0.4" ipld_blockstore = "0.1" key_management = { path = "../key_management" } -libp2p = { version = "0.41", default-features = false, features = ["identify"] } +libp2p = { version = "0.46", default-features = false, features = ["identify"] } log = "0.4" message_pool = { path = "../blockchain/message_pool" } metrics = { path = "../utils/metrics" } diff --git a/forest/src/daemon.rs b/forest/src/daemon.rs index 134bf254e535..55a6e4a089bf 100644 --- a/forest/src/daemon.rs +++ b/forest/src/daemon.rs @@ -10,7 +10,7 @@ use chain::ChainStore; use chain_sync::consensus::SyncGossipSubmitter; use chain_sync::ChainMuxer; use fil_types::verifier::FullVerifier; -use forest_libp2p::{get_keypair, Libp2pConfig, Libp2pService}; +use forest_libp2p::{ed25519, get_keypair, Keypair, Libp2pConfig, Libp2pService}; use fvm_shared::version::NetworkVersion; use genesis::{get_network_name_from_genesis, import_chain, read_genesis_header}; use key_management::ENCRYPTED_KEYSTORE_NAME; @@ -22,7 +22,6 @@ use state_manager::StateManager; use utils::write_to_file; use async_std::{channel::bounded, sync::RwLock, task}; -use libp2p::identity::{ed25519, Keypair}; use log::{debug, error, info, trace, warn}; use rpassword::read_password; diff --git a/ipld/blockstore/src/lib.rs b/ipld/blockstore/src/lib.rs index 4a9d507ab539..01f716be4595 100644 --- a/ipld/blockstore/src/lib.rs +++ b/ipld/blockstore/src/lib.rs @@ -32,6 +32,10 @@ pub trait BlockStoreExt: BlockStore { } } + fn contains(&self, cid: &Cid) -> anyhow::Result { + Ok(self.get(cid)?.is_some()) + } + /// Put an object in the block store and return the Cid identifier. fn put_obj(&self, obj: &S, code: Code) -> anyhow::Result where diff --git a/node/forest_libp2p/Cargo.toml b/node/forest_libp2p/Cargo.toml index a654075b947f..71cbcfd6cf4b 100644 --- a/node/forest_libp2p/Cargo.toml +++ b/node/forest_libp2p/Cargo.toml @@ -25,7 +25,7 @@ fvm_shared = { version = "0.8.0", default-features = false, features = ["testing git-version = "0.3" ipld_blockstore = "0.1" lazy_static = "1.4" -libp2p = { version = "0.40.0-rc.1", default-features = false, features = [ +libp2p = { version = "0.46", default-features = false, features = [ "gossipsub", "kad", "identify", @@ -39,7 +39,7 @@ libp2p = { version = "0.40.0-rc.1", default-features = false, features = [ "request-response", "websocket", ] } -libp2p-bitswap = { git = "https://github.com/ChainSafe/libp2p-bitswap", rev = "8d3913ea7fc1e693776c83eecc7a9675c3426446" } +libp2p-bitswap = { git = "https://github.com/ChainSafe/libp2p-bitswap", rev = "5c79b37feceb3ba76d5a488b1713cfaaf861baa3" } log = "0.4" multihash = { version = "0.16", default-features = false, features = ["std", "multihash-impl", "identity", "sha2"] } networks = { path = "../../types/networks" } diff --git a/node/forest_libp2p/src/behaviour.rs b/node/forest_libp2p/src/behaviour.rs index 13c3cb7c6626..91198997ac9d 100644 --- a/node/forest_libp2p/src/behaviour.rs +++ b/node/forest_libp2p/src/behaviour.rs @@ -406,7 +406,7 @@ impl ForestBehaviour { ) -> Poll< NetworkBehaviourAction< ::OutEvent, - ::ProtocolsHandler, + ::ConnectionHandler, >, > { // Poll to see if any response is ready to be sent back. diff --git a/node/forest_libp2p/src/discovery.rs b/node/forest_libp2p/src/discovery.rs index 3e2c7c467efd..575599f7126b 100644 --- a/node/forest_libp2p/src/discovery.rs +++ b/node/forest_libp2p/src/discovery.rs @@ -4,20 +4,15 @@ use async_std::stream::{self, Interval}; use async_std::task; use futures::prelude::*; -use libp2p::swarm::DialError; +use libp2p::core::transport::ListenerId; +use libp2p::swarm::behaviour::toggle::ToggleIntoConnectionHandler; +use libp2p::swarm::{ConnectionHandler, DialError, IntoConnectionHandler}; use libp2p::{ - core::{ - connection::{ConnectionId, ListenerId}, - ConnectedPoint, Multiaddr, PeerId, PublicKey, - }, + core::{connection::ConnectionId, ConnectedPoint, Multiaddr, PeerId, PublicKey}, kad::{handler::KademliaHandlerProto, Kademlia, KademliaConfig, KademliaEvent, QueryId}, mdns::MdnsEvent, multiaddr::Protocol, - swarm::{ - toggle::{Toggle, ToggleIntoProtoHandler}, - IntoProtocolsHandler, NetworkBehaviour, NetworkBehaviourAction, PollParameters, - ProtocolsHandler, - }, + swarm::{behaviour::toggle::Toggle, NetworkBehaviour, NetworkBehaviourAction, PollParameters}, }; use libp2p::{kad::record::store::MemoryStore, mdns::Mdns}; use log::{debug, error, trace, warn}; @@ -214,10 +209,10 @@ impl DiscoveryBehaviour { } impl NetworkBehaviour for DiscoveryBehaviour { - type ProtocolsHandler = ToggleIntoProtoHandler>; + type ConnectionHandler = ToggleIntoConnectionHandler>; type OutEvent = DiscoveryOut; - fn new_handler(&mut self) -> Self::ProtocolsHandler { + fn new_handler(&mut self) -> Self::ConnectionHandler { self.kademlia.new_handler() } @@ -250,21 +245,25 @@ impl NetworkBehaviour for DiscoveryBehaviour { conn: &ConnectionId, endpoint: &ConnectedPoint, failed_addresses: Option<&Vec>, + other_established: usize, ) { self.num_connections += 1; - self.kademlia - .inject_connection_established(peer_id, conn, endpoint, failed_addresses) - } - - fn inject_connected(&mut self, peer_id: &PeerId) { - let multiaddr = self.addresses_of_peer(peer_id); - self.peer_addresses.insert(*peer_id, multiaddr); - self.peers.insert(*peer_id); - self.pending_events - .push_back(DiscoveryOut::Connected(*peer_id)); + if other_established == 0 { + let multiaddr = self.addresses_of_peer(peer_id); + self.peer_addresses.insert(*peer_id, multiaddr); + self.peers.insert(*peer_id); + self.pending_events + .push_back(DiscoveryOut::Connected(*peer_id)); + } - self.kademlia.inject_connected(peer_id) + self.kademlia.inject_connection_established( + peer_id, + conn, + endpoint, + failed_addresses, + other_established, + ) } fn inject_connection_closed( @@ -272,27 +271,31 @@ impl NetworkBehaviour for DiscoveryBehaviour { peer_id: &PeerId, conn: &ConnectionId, endpoint: &ConnectedPoint, - handler: ::Handler, + handler: ::Handler, + remaining_established: usize, ) { self.num_connections -= 1; - self.kademlia - .inject_connection_closed(peer_id, conn, endpoint, handler) - } - - fn inject_disconnected(&mut self, peer_id: &PeerId) { - self.peers.remove(peer_id); - self.pending_events - .push_back(DiscoveryOut::Disconnected(*peer_id)); + if remaining_established == 0 { + self.peers.remove(peer_id); + self.pending_events + .push_back(DiscoveryOut::Disconnected(*peer_id)); + } - self.kademlia.inject_disconnected(peer_id) + self.kademlia.inject_connection_closed( + peer_id, + conn, + endpoint, + handler, + remaining_established, + ) } fn inject_event( &mut self, peer_id: PeerId, connection: ConnectionId, - event: <::Handler as ProtocolsHandler>::OutEvent, + event: <::Handler as ConnectionHandler>::OutEvent, ) { if let Some(kad) = self.kademlia.as_mut() { return kad.inject_event(peer_id, connection, event); @@ -311,7 +314,7 @@ impl NetworkBehaviour for DiscoveryBehaviour { fn inject_dial_failure( &mut self, peer_id: Option, - handler: Self::ProtocolsHandler, + handler: Self::ConnectionHandler, err: &DialError, ) { self.kademlia.inject_dial_failure(peer_id, handler, err) @@ -334,7 +337,7 @@ impl NetworkBehaviour for DiscoveryBehaviour { &mut self, cx: &mut Context, params: &mut impl PollParameters, - ) -> Poll> { + ) -> Poll> { // Immediately process the content of `discovered`. if let Some(ev) = self.pending_events.pop_front() { return Poll::Ready(NetworkBehaviourAction::GenerateEvent(ev)); @@ -376,19 +379,8 @@ impl NetworkBehaviour for DiscoveryBehaviour { debug!("Libp2p => Unhandled Kademlia event: {:?}", other) } }, - NetworkBehaviourAction::DialAddress { address, handler } => { - return Poll::Ready(NetworkBehaviourAction::DialAddress { address, handler }) - } - NetworkBehaviourAction::DialPeer { - peer_id, - condition, - handler, - } => { - return Poll::Ready(NetworkBehaviourAction::DialPeer { - peer_id, - condition, - handler, - }) + NetworkBehaviourAction::Dial { opts, handler } => { + return Poll::Ready(NetworkBehaviourAction::Dial { opts, handler }); } NetworkBehaviourAction::NotifyHandler { peer_id, @@ -440,8 +432,7 @@ impl NetworkBehaviour for DiscoveryBehaviour { } MdnsEvent::Expired(_) => {} }, - NetworkBehaviourAction::DialAddress { .. } => {} - NetworkBehaviourAction::DialPeer { .. } => {} + NetworkBehaviourAction::Dial { .. } => {} // Nothing to notify handler NetworkBehaviourAction::NotifyHandler { event, .. } => match event {}, NetworkBehaviourAction::ReportObservedAddr { address, score } => { diff --git a/node/forest_libp2p/src/lib.rs b/node/forest_libp2p/src/lib.rs index 9bc63e6d868d..5cf8882eb3e8 100644 --- a/node/forest_libp2p/src/lib.rs +++ b/node/forest_libp2p/src/lib.rs @@ -21,5 +21,6 @@ pub use self::service::*; // Re-export some libp2p types pub use libp2p::core::PeerId; +pub use libp2p::identity::{ed25519, Keypair}; pub use libp2p::multiaddr::{Multiaddr, Protocol}; pub use multihash::Multihash; diff --git a/node/forest_libp2p/src/service.rs b/node/forest_libp2p/src/service.rs index 3114349071ab..3a05f31c9fa3 100644 --- a/node/forest_libp2p/src/service.rs +++ b/node/forest_libp2p/src/service.rs @@ -28,11 +28,12 @@ use libp2p::request_response::ResponseChannel; use libp2p::swarm::SwarmEvent; use libp2p::{ core, - core::connection::ConnectionLimits, core::muxing::StreamMuxerBox, core::transport::Boxed, identity::{ed25519, Keypair}, - mplex, noise, yamux, PeerId, Swarm, Transport, + mplex, noise, + swarm::ConnectionLimits, + yamux, PeerId, Swarm, Transport, }; use libp2p::{core::Multiaddr, swarm::SwarmBuilder}; use log::{debug, error, info, trace, warn}; @@ -354,7 +355,7 @@ where for multiaddr in addresses.iter_mut() { multiaddr.push(Protocol::P2p(Multihash::from_bytes(&peer_id.to_bytes()).unwrap())); - if Swarm::dial_addr(swarm_stream.get_mut(), multiaddr.clone()).is_ok() { + if Swarm::dial(swarm_stream.get_mut(), multiaddr.clone()).is_ok() { success = true; break; }; @@ -403,8 +404,9 @@ async fn emit_event(sender: &Sender, event: NetworkEvent) { /// Builds the transport stack that LibP2P will communicate over. pub fn build_transport(local_key: Keypair) -> Boxed<(PeerId, StreamMuxerBox)> { - let transport = libp2p::tcp::TcpConfig::new().nodelay(true); - let transport = libp2p::websocket::WsConfig::new(transport.clone()).or_transport(transport); + let tcp_transport = + || libp2p::tcp::TcpTransport::new(libp2p::tcp::GenTcpConfig::new().nodelay(true)); + let transport = libp2p::websocket::WsConfig::new(tcp_transport()).or_transport(tcp_transport()); let transport = async_std::task::block_on(libp2p::dns::DnsConfig::system(transport)).unwrap(); let auth_config = { let dh_keys = noise::Keypair::::new() diff --git a/node/rpc-api/Cargo.toml b/node/rpc-api/Cargo.toml index 358cc83373a9..3beef4f1ab98 100644 --- a/node/rpc-api/Cargo.toml +++ b/node/rpc-api/Cargo.toml @@ -29,7 +29,7 @@ cid = { version = "0.8", default-features = false, features = ["st fvm = "1.0" fvm_ipld_bitfield = { version = "0.5.2", features = ["json"] } fvm_shared = { version = "0.8.0", default-features = false } -libp2p = { version = "0.40.0-rc.1", default-features = false } +libp2p = { version = "0.46", default-features = false } once_cell = "1.7" serde = { version = "1.0", default-features = false, features = ["derive"] } serde_json = "1.0" diff --git a/vm/actor_interface/Cargo.toml b/vm/actor_interface/Cargo.toml index c350b58e3e7c..44cb4b947077 100644 --- a/vm/actor_interface/Cargo.toml +++ b/vm/actor_interface/Cargo.toml @@ -29,5 +29,5 @@ fvm_ipld_bitfield = "0.5.2" fvm_ipld_encoding = "0.2" fvm_shared = { version = "0.8.0", default-features = false } ipld_blockstore = "0.1" -libp2p = { version = "0.40.0-rc.1", default-features = false } +libp2p = { version = "0.46", default-features = false } serde = { version = "1.0", features = ["derive"] } diff --git a/vm/state_migration/Cargo.toml b/vm/state_migration/Cargo.toml index 2d97324ae204..d08b3980255d 100644 --- a/vm/state_migration/Cargo.toml +++ b/vm/state_migration/Cargo.toml @@ -19,7 +19,7 @@ fvm = "1.0" fvm_ipld_bitfield = "0.5.2" fvm_shared = { version = "0.8.0", default-features = false } ipld_blockstore = "0.1" -libp2p = { version = "0.40.0-rc.1", default-features = false } +libp2p = { version = "0.46", default-features = false } log = "0.4" num_cpus = "1.13" rayon = "1.5"