diff --git a/Cargo.lock b/Cargo.lock index bf14b97c2f..0a37989170 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,20 +2,7 @@ # It is not intended for manual editing. # Copyright 2020 - Nym Technologies SA # SPDX-License-Identifier: Apache-2.0 -[[package]] -name = "addr2line" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b6a2d3371669ab3ca9797670853d61402b03d0b4b9ebf33d677dfa720203072" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e" +version = 3 [[package]] name = "aes-ctr" @@ -26,19 +13,19 @@ dependencies = [ "aes-soft 0.3.3", "aesni 0.6.0", "ctr 0.3.2", - "stream-cipher 0.3.2", + "stream-cipher", ] [[package]] name = "aes-ctr" -version = "0.4.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92e60aeefd2a0243bd53a42e92444e039f67c3d7f0382c9813577696e7c10bf3" +checksum = "7729c3cde54d67063be556aeac75a81330d802f0259500ca40cb52967f975763" dependencies = [ - "aes-soft 0.4.0", - "aesni 0.7.0", - "ctr 0.4.0", - "stream-cipher 0.4.1", + "aes-soft 0.6.4", + "aesni 0.10.0", + "cipher", + "ctr 0.6.0", ] [[package]] @@ -54,13 +41,12 @@ dependencies = [ [[package]] name = "aes-soft" -version = "0.4.0" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4925647ee64e5056cf231608957ce7c81e12d6d6e316b9ce1404778cc1d35fa7" +checksum = "be14c7498ea50828a38d0e24a765ed2effe92a705885b57d029cd67d45744072" dependencies = [ - "block-cipher", - "byteorder", - "opaque-debug 0.2.3", + "cipher", + "opaque-debug 0.3.0", ] [[package]] @@ -71,18 +57,17 @@ checksum = "2f70a6b5f971e473091ab7cfb5ffac6cde81666c4556751d8d5620ead8abf100" dependencies = [ "block-cipher-trait", "opaque-debug 0.2.3", - "stream-cipher 0.3.2", + "stream-cipher", ] [[package]] name = "aesni" -version = "0.7.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d050d39b0b7688b3a3254394c3e30a9d66c41dcf9b05b0e2dbdc623f6505d264" +checksum = "ea2e11f5e94c2f7d386164cc2aa1f97823fed6f259e486940a71c174dd01b0ce" dependencies = [ - "block-cipher", - "opaque-debug 0.2.3", - "stream-cipher 0.4.1", + "cipher", + "opaque-debug 0.3.0", ] [[package]] @@ -100,7 +85,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -109,12 +94,6 @@ version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d25d88fd6b8041580a654f9d0c581a047baee2b3efee13275f2fc392fc75034" -[[package]] -name = "array-init" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30bbe2f5e3d117f55bd8c7a1f9191e4a5deba9f15f595bbea4f670c59c765db" - [[package]] name = "arrayref" version = "0.3.6" @@ -129,15 +108,35 @@ checksum = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8" [[package]] name = "assert-json-diff" -version = "1.1.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4259cbe96513d2f1073027a259fc2ca917feb3026a5a8d984e3628e490255cc0" +checksum = "50f1c3703dd33532d7f0ca049168930e9099ecac238e23cf932f3a69c42f06da" dependencies = [ - "extend", "serde", "serde_json", ] +[[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 = "atty" version = "0.2.14" @@ -146,7 +145,7 @@ checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ "hermit-abi", "libc", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -155,26 +154,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" -[[package]] -name = "backtrace" -version = "0.3.50" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46254cf2fdcdf1badb5934448c1bcbe046a56537b3987d96c51a7afc5d03f293" -dependencies = [ - "addr2line", - "cfg-if 0.1.10", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", -] - -[[package]] -name = "base64" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" - [[package]] name = "base64" version = "0.12.3" @@ -218,9 +197,9 @@ dependencies = [ [[package]] name = "blake3" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce4f9586c9a3151c4b49b19e82ba163dd073614dd057e53c969e1a4db5b52720" +checksum = "e9ff35b701f3914bdb8fad3368d822c766ef2858b2583198e41639b936f09d3f" dependencies = [ "arrayref", "arrayvec", @@ -252,15 +231,6 @@ dependencies = [ "generic-array 0.14.4", ] -[[package]] -name = "block-cipher" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa136449e765dc7faa244561ccae839c394048667929af599b5d931ebe7b7f10" -dependencies = [ - "generic-array 0.14.4", -] - [[package]] name = "block-cipher-trait" version = "0.6.2" @@ -285,6 +255,12 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "476e9cd489f9e121e02ffa6014a8ef220ecb15c05ed23fc34cca13925dc283fb" +[[package]] +name = "bs58" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" + [[package]] name = "bumpalo" version = "3.4.0" @@ -344,14 +320,12 @@ dependencies = [ ] [[package]] -name = "chrono" -version = "0.4.15" +name = "cipher" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942f72db697d8767c22d46a598e01f2d3b475501ea43d0db4f16d90259182d0b" +checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" dependencies = [ - "num-integer", - "num-traits", - "time", + "generic-array 0.14.4", ] [[package]] @@ -375,8 +349,8 @@ version = "0.9.2" dependencies = [ "config", "crypto", - "dirs 2.0.2", - "futures 0.3.9", + "dirs", + "futures", "gateway-client", "gateway-requests", "humantime-serde", @@ -384,24 +358,15 @@ dependencies = [ "nonexhaustive-delayqueue", "nymsphinx", "pemstore", - "rand", + "rand 0.7.3", "serde", - "sled 0.33.0", + "sled", "tempfile", - "tokio 0.2.22", + "tokio", "topology", "validator-client-rest", ] -[[package]] -name = "cloudabi" -version = "0.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" -dependencies = [ - "bitflags", -] - [[package]] name = "cloudabi" version = "0.1.0" @@ -413,13 +378,13 @@ dependencies = [ [[package]] name = "colored" -version = "1.9.3" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4ffc801dacf156c5854b9df4f425a626539c3a6ef7893cc0c5084a23f0b6c59" +checksum = "b3616f750b84d8f0de8a58bda93e08e2a81ad3f523089b05f1dffecab48c6cbd" dependencies = [ "atty", "lazy_static", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -469,7 +434,7 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de70197a0fe4e402aa260da00ec62d9bf091afe87866e9f3347691d591b60f89" dependencies = [ - "syn 1.0.58", + "syn", ] [[package]] @@ -531,20 +496,19 @@ dependencies = [ name = "crypto" version = "0.1.0" dependencies = [ - "aes-ctr 0.4.0", + "aes-ctr 0.6.0", "blake3", - "bs58", + "bs58 0.4.0", + "cipher", "digest 0.9.0", "ed25519-dalek", "generic-array 0.14.4", - "hkdf 0.9.0", + "hkdf 0.10.0", "hmac 0.8.1", "log", "nymsphinx-types", "pemstore", - "pretty_env_logger", - "rand", - "stream-cipher 0.4.1", + "rand 0.7.3", "x25519-dalek", ] @@ -568,6 +532,16 @@ dependencies = [ "subtle 2.2.3", ] +[[package]] +name = "crypto-mac" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4857fd85a0c34b3c3297875b747c1e02e06b6a0ea32dd892d8192b9ce0813ea6" +dependencies = [ + "generic-array 0.14.4", + "subtle 2.2.3", +] + [[package]] name = "ctr" version = "0.3.2" @@ -575,29 +549,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "022cd691704491df67d25d006fe8eca083098253c4d43516c2206479c58c6736" dependencies = [ "block-cipher-trait", - "stream-cipher 0.3.2", + "stream-cipher", ] [[package]] name = "ctr" -version = "0.4.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3592740fd55aaf61dd72df96756bd0d11e6037b89dcf30ae2e1895b267692be" +checksum = "fb4a30d54f7443bf3d6191dcd486aca19e67cb3c49fa7a06a319966346707e7f" dependencies = [ - "stream-cipher 0.4.1", -] - -[[package]] -name = "curve25519-dalek" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d85653f070353a16313d0046f173f70d1aadd5b42600a14de626f0dfb3473a5" -dependencies = [ - "byteorder", - "digest 0.8.1", - "rand_core", - "subtle 2.2.3", - "zeroize", + "cipher", ] [[package]] @@ -608,7 +569,7 @@ checksum = "c8492de420e9e60bc9a1d66e2dbb91825390b738a388606600663fc529b4b307" dependencies = [ "byteorder", "digest 0.9.0", - "rand_core", + "rand_core 0.5.1", "subtle 2.2.3", "zeroize", ] @@ -647,16 +608,6 @@ dependencies = [ "generic-array 0.14.4", ] -[[package]] -name = "dirs" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13aea89a5c93364a98e9b37b2fa237effbb694d5cfe01c5b70941f7eb087d5e3" -dependencies = [ - "cfg-if 0.1.10", - "dirs-sys", -] - [[package]] name = "dirs" version = "3.0.1" @@ -674,7 +625,7 @@ checksum = "8e93d7f5705de3e49895a2b5e0b8855a1c27f080192ae9c32a6432d50741a57a" dependencies = [ "libc", "redox_users", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -689,12 +640,6 @@ version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" -[[package]] -name = "dtoa" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134951f4028bdadb9b84baf4232681efbf277da25144b9b0ad65df75946c422b" - [[package]] name = "ed25519" version = "1.0.1" @@ -710,9 +655,9 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53d2e93f837d749c16d118e7ddf7a4dfd0ac8f452cf51e46e9348824e5ef6851" dependencies = [ - "curve25519-dalek 3.0.0", + "curve25519-dalek", "ed25519", - "rand", + "rand 0.7.3", "serde", "sha2 0.9.1", "zeroize", @@ -729,9 +674,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.6.2" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aafcde04e90a5226a6443b7aabdb016ba2f8307c847d524724bd9b346dd1a2d3" +checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36" dependencies = [ "atty", "humantime 1.3.0", @@ -740,27 +685,6 @@ dependencies = [ "termcolor", ] -[[package]] -name = "error-chain" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d2f06b9cac1506ece98fe3231e3cc9c4410ec3d5b1f24ae1c8946f0742cdefc" -dependencies = [ - "version_check", -] - -[[package]] -name = "extend" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f47da3a72ec598d9c8937a7ebca8962a5c7a1f28444e38c2b33c771ba3f55f05" -dependencies = [ - "proc-macro-error", - "proc-macro2 1.0.24", - "quote 1.0.7", - "syn 1.0.58", -] - [[package]] name = "fake-simd" version = "0.1.2" @@ -805,31 +729,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" dependencies = [ "libc", - "winapi 0.3.9", + "winapi", ] -[[package]] -name = "fuchsia-zircon" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" -dependencies = [ - "bitflags", - "fuchsia-zircon-sys", -] - -[[package]] -name = "fuchsia-zircon-sys" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" - -[[package]] -name = "futures" -version = "0.1.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b980f2816d6ee8673b6517b52cb0e808a180efc92e5c19d02cdda79066703ef" - [[package]] name = "futures" version = "0.3.9" @@ -885,9 +787,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f8719ca0e1f3c5e34f3efe4570ef2c0610ca6da85ae7990d472e9cbfba13664" dependencies = [ "proc-macro-hack", - "proc-macro2 1.0.24", - "quote 1.0.7", - "syn 1.0.58", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -918,7 +820,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project-lite 0.2.4", + "pin-project-lite", "pin-utils", "proc-macro-hack", "proc-macro-nested", @@ -939,16 +841,17 @@ name = "gateway-client" version = "0.1.0" dependencies = [ "crypto", - "futures 0.3.9", + "futures", "gateway-requests", + "getrandom 0.2.2", "log", "nymsphinx", - "rand", - "tokio 0.2.22", + "rand 0.7.3", + "tokio", "tokio-tungstenite", "tungstenite", "wasm-bindgen", - "wasm-bindgen-futures 0.4.21", + "wasm-bindgen-futures", "wasm-timer", "wasm-utils", ] @@ -957,13 +860,13 @@ dependencies = [ name = "gateway-requests" version = "0.1.0" dependencies = [ - "bs58", + "bs58 0.3.1", "crypto", - "futures 0.3.9", + "futures", "log", "nymsphinx", "pemstore", - "rand", + "rand 0.7.3", "serde", "serde_json", "tungstenite", @@ -1001,28 +904,16 @@ dependencies = [ ] [[package]] -name = "gimli" -version = "0.22.0" +name = "getrandom" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaf91faf136cb47367fa430cd46e37a788775e7fa104f8b4bcb3861dc389b724" - -[[package]] -name = "h2" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "993f9e0baeed60001cf565546b0d3dbe6a6ad23f2bd31644a133c641eccf6d53" +checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" dependencies = [ - "bytes 0.5.6", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http", - "indexmap", - "slab", - "tokio 0.2.22", - "tokio-util 0.3.1", - "tracing", + "cfg-if 1.0.0", + "js-sys", + "libc", + "wasi 0.10.0+wasi-snapshot-preview1", + "wasm-bindgen", ] [[package]] @@ -1039,8 +930,8 @@ dependencies = [ "http", "indexmap", "slab", - "tokio 1.3.0", - "tokio-util 0.6.4", + "tokio", + "tokio-util", "tracing", ] @@ -1085,12 +976,12 @@ dependencies = [ [[package]] name = "hkdf" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe1149865383e4526a43aee8495f9a325f0b806c63ce6427d06336a590abbbc9" +checksum = "51ab2f639c231793c5f6114bdb9bbe50a7dbbfcd7c7c6bd8475dec2d991e964f" dependencies = [ "digest 0.9.0", - "hmac 0.8.1", + "hmac 0.10.1", ] [[package]] @@ -1113,6 +1004,16 @@ dependencies = [ "digest 0.9.0", ] +[[package]] +name = "hmac" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1441c6b1e930e2817404b5046f1f989899143a12bf92de603b69f4e0aee1e15" +dependencies = [ + "crypto-mac 0.10.0", + "digest 0.9.0", +] + [[package]] name = "http" version = "0.2.1" @@ -1124,16 +1025,6 @@ dependencies = [ "itoa", ] -[[package]] -name = "http-body" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" -dependencies = [ - "bytes 0.5.6", - "http", -] - [[package]] name = "http-body" version = "0.4.0" @@ -1181,30 +1072,6 @@ dependencies = [ "serde", ] -[[package]] -name = "hyper" -version = "0.13.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e68a8dd9716185d9e64ea473ea6ef63529252e3e27623295a0378a19665d5eb" -dependencies = [ - "bytes 0.5.6", - "futures-channel", - "futures-core", - "futures-util", - "h2 0.2.6", - "http", - "http-body 0.3.1", - "httparse", - "itoa", - "pin-project 0.4.23", - "socket2", - "time", - "tokio 0.2.22", - "tower-service", - "tracing", - "want", -] - [[package]] name = "hyper" version = "0.14.4" @@ -1215,33 +1082,20 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", - "h2 0.3.1", + "h2", "http", - "http-body 0.4.0", + "http-body", "httparse", "httpdate", "itoa", - "pin-project 1.0.4", + "pin-project", "socket2", - "tokio 1.3.0", + "tokio", "tower-service", "tracing", "want", ] -[[package]] -name = "hyper-tls" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d979acc56dcb5b8dddba3917601745e877576475aa046df3226eabdecef78eed" -dependencies = [ - "bytes 0.5.6", - "hyper 0.13.7", - "native-tls", - "tokio 0.2.22", - "tokio-tls", -] - [[package]] name = "hyper-tls" version = "0.5.0" @@ -1249,17 +1103,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ "bytes 1.0.1", - "hyper 0.14.4", + "hyper", "native-tls", - "tokio 1.3.0", + "tokio", "tokio-native-tls", ] [[package]] name = "idna" -version = "0.2.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" +checksum = "89829a5d69c23d348314a7ac337fe39173b61149a9864deabd260983aed48c21" dependencies = [ "matches", "unicode-bidi", @@ -1278,11 +1132,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]] @@ -1291,15 +1145,6 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b141fdc7836c525d4d594027d318c84161ca17aaf8113ab1f81ab93ae897485" -[[package]] -name = "iovec" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" -dependencies = [ - "libc", -] - [[package]] name = "ipnet" version = "2.3.0" @@ -1330,16 +1175,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "kernel32-sys" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] - [[package]] name = "keystream" version = "1.0.0" @@ -1358,6 +1193,12 @@ version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "538c092e5586f4cdd7dd8078c4a79220e3e168880218124dcbce860f0ea938c6" +[[package]] +name = "libm" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a" + [[package]] name = "lioness" version = "0.1.2" @@ -1370,15 +1211,6 @@ dependencies = [ "keystream", ] -[[package]] -name = "lock_api" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" -dependencies = [ - "scopeguard", -] - [[package]] name = "lock_api" version = "0.4.1" @@ -1441,9 +1273,9 @@ name = "metrics-client" version = "0.1.0" dependencies = [ "mockito", - "reqwest 0.10.8", + "reqwest", "serde", - "tokio 0.2.22", + "tokio", ] [[package]] @@ -1452,44 +1284,6 @@ version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" -[[package]] -name = "mime_guess" -version = "2.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2684d4c2e97d99848d30b324b00c8fcc7e5c897b7cbb5819b09e7c90e8baf212" -dependencies = [ - "mime", - "unicase", -] - -[[package]] -name = "miniz_oxide" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d7559a8a40d0f97e1edea3220f698f78b1c5ab67532e49f68fde3910323b722" -dependencies = [ - "adler", -] - -[[package]] -name = "mio" -version = "0.6.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430" -dependencies = [ - "cfg-if 0.1.10", - "fuchsia-zircon", - "fuchsia-zircon-sys", - "iovec", - "kernel32-sys", - "libc", - "log", - "miow 0.2.1", - "net2", - "slab", - "winapi 0.2.8", -] - [[package]] name = "mio" version = "0.7.10" @@ -1498,44 +1292,9 @@ checksum = "2182a122f3b7f3f5329cb1972cee089ba2459a0a80a56935e6e674f096f8d839" dependencies = [ "libc", "log", - "miow 0.3.6", + "miow", "ntapi", - "winapi 0.3.9", -] - -[[package]] -name = "mio-named-pipes" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0840c1c50fd55e521b247f949c241c9997709f23bd7f023b9762cd561e935656" -dependencies = [ - "log", - "mio 0.6.22", - "miow 0.3.6", - "winapi 0.3.9", -] - -[[package]] -name = "mio-uds" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afcb699eb26d4332647cc848492bbc15eafb26f08d0304550d5aa1f612e066f0" -dependencies = [ - "iovec", - "libc", - "mio 0.6.22", -] - -[[package]] -name = "miow" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" -dependencies = [ - "kernel32-sys", - "net2", - "winapi 0.2.8", - "ws2_32-sys", + "winapi", ] [[package]] @@ -1545,18 +1304,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a33c1b55807fbed163481b5ba66db4b2fa6cde694a5027be10fb724206c5897" dependencies = [ "socket2", - "winapi 0.3.9", + "winapi", ] [[package]] name = "mixnet-client" version = "0.1.0" dependencies = [ - "futures 0.3.9", + "futures", "log", "nymsphinx", - "tokio 0.2.22", - "tokio-util 0.3.1", + "tokio", + "tokio-util", ] [[package]] @@ -1573,7 +1332,7 @@ name = "mixnode-common" version = "0.1.0" dependencies = [ "dashmap", - "futures 0.3.9", + "futures", "log", "nonexhaustive-delayqueue", "nymsphinx-acknowledgements", @@ -1582,14 +1341,14 @@ dependencies = [ "nymsphinx-framing", "nymsphinx-params", "nymsphinx-types", - "tokio 0.2.22", + "tokio", ] [[package]] name = "mockito" -version = "0.23.3" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae82e6bad452dd42b0f4437414eae3c8c27b958a55dc6c198e351042c4e3024e" +checksum = "d10030163d67f681db11810bc486df3149e6d91c8b4f3f96fa8b62b546c2cef8" dependencies = [ "assert-json-diff", "colored", @@ -1597,10 +1356,10 @@ dependencies = [ "httparse", "lazy_static", "log", - "percent-encoding", - "rand", + "rand 0.8.3", "regex", "serde_json", + "serde_urlencoded", ] [[package]] @@ -1621,22 +1380,13 @@ dependencies = [ "tempfile", ] -[[package]] -name = "net2" -version = "0.2.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ebc3ec692ed7c9a255596c67808dee269f64655d8baf7b4f0638e51ba1d6853" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "winapi 0.3.9", -] - [[package]] name = "nonexhaustive-delayqueue" version = "0.1.0" dependencies = [ - "tokio 0.2.22", + "tokio", + "tokio-stream", + "tokio-util", ] [[package]] @@ -1645,26 +1395,17 @@ version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" dependencies = [ - "winapi 0.3.9", -] - -[[package]] -name = "num-integer" -version = "0.1.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d59457e662d541ba17869cf51cf177c0b5f0cbf476c66bdc90bf1edac4f875b" -dependencies = [ - "autocfg", - "num-traits", + "winapi", ] [[package]] name = "num-traits" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac267bcc07f48ee5f8935ab0d24f316fb722d7a1292e2913f0cc196b29ffd611" +checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" dependencies = [ "autocfg", + "libm", ] [[package]] @@ -1685,20 +1426,20 @@ dependencies = [ "client-core", "config", "crypto", - "dirs 3.0.1", + "dirs", "dotenv", - "futures 0.3.9", + "futures", "gateway-client", "gateway-requests", "log", "nymsphinx", "pemstore", "pretty_env_logger", - "rand", + "rand 0.7.3", "serde", "serde_json", - "sled 0.33.0", - "tokio 0.2.22", + "sled", + "tokio", "tokio-tungstenite", "topology", "url", @@ -1713,16 +1454,16 @@ version = "0.9.0" dependencies = [ "console_error_panic_hook", "crypto", - "futures 0.3.9", + "futures", "gateway-client", "js-sys", "nymsphinx", - "rand", + "rand 0.7.3", "serde", "topology", "validator-client", "wasm-bindgen", - "wasm-bindgen-futures 0.4.21", + "wasm-bindgen-futures", "wasm-bindgen-test", "wasm-utils", "wee_alloc", @@ -1736,9 +1477,9 @@ dependencies = [ "config", "crypto", "dashmap", - "dirs 2.0.2", + "dirs", "dotenv", - "futures 0.3.9", + "futures", "gateway-requests", "humantime-serde", "log", @@ -1747,13 +1488,13 @@ dependencies = [ "nymsphinx", "pemstore", "pretty_env_logger", - "rand", + "rand 0.7.3", "serde", - "sled 0.31.0", - "tokio 0.2.22", + "sled", + "tokio", + "tokio-stream", "tokio-tungstenite", - "tokio-util 0.3.1", - "tungstenite", + "tokio-util", "validator-client-rest", "version-checker", ] @@ -1762,14 +1503,13 @@ dependencies = [ name = "nym-mixnode" version = "0.9.2" dependencies = [ - "bs58", + "bs58 0.4.0", "clap", "config", "crypto", - "curve25519-dalek 2.1.0", - "dirs 2.0.2", + "dirs", "dotenv", - "futures 0.3.9", + "futures", "humantime-serde", "log", "metrics-client", @@ -1779,10 +1519,10 @@ dependencies = [ "nymsphinx", "pemstore", "pretty_env_logger", - "rand", + "rand 0.7.3", "serde", - "tokio 0.2.22", - "tokio-util 0.3.1", + "tokio", + "tokio-util", "topology", "validator-client-rest", "version-checker", @@ -1795,17 +1535,17 @@ dependencies = [ "clap", "crypto", "dotenv", - "futures 0.3.9", + "futures", "gateway-client", "gateway-requests", "log", "nymsphinx", - "pin-project 1.0.4", + "pin-project", "pretty_env_logger", - "rand", + "rand 0.7.3", "serde", "serde_json", - "tokio 0.2.22", + "tokio", "topology", "validator-client", "version-checker", @@ -1816,8 +1556,8 @@ name = "nym-network-requester" version = "0.9.2" dependencies = [ "clap", - "dirs 2.0.2", - "futures 0.3.9", + "dirs", + "futures", "ipnetwork", "log", "nymsphinx", @@ -1825,9 +1565,9 @@ dependencies = [ "pretty_env_logger", "proxy-helpers", "publicsuffix", - "rand", + "rand 0.7.3", "socks5-requests", - "tokio 0.2.22", + "tokio", "tokio-tungstenite", "websocket-requests", ] @@ -1840,22 +1580,22 @@ dependencies = [ "client-core", "config", "crypto", - "dirs 3.0.1", + "dirs", "dotenv", - "futures 0.3.9", + "futures", "gateway-client", "gateway-requests", "log", "nymsphinx", "ordered-buffer", - "pin-project 0.4.23", + "pin-project", "pretty_env_logger", "proxy-helpers", - "rand", + "rand 0.7.3", "serde", "snafu", "socks5-requests", - "tokio 0.2.22", + "tokio", "topology", "validator-client-rest", "version-checker", @@ -1875,9 +1615,9 @@ dependencies = [ "nymsphinx-framing", "nymsphinx-params", "nymsphinx-types", - "rand", - "rand_distr", - "tokio 0.2.22", + "rand 0.7.3", + "rand_distr 0.3.0", + "tokio", "topology", ] @@ -1890,7 +1630,7 @@ dependencies = [ "nymsphinx-params", "nymsphinx-types", "pemstore", - "rand", + "rand 0.7.3", "topology", ] @@ -1900,7 +1640,7 @@ version = "0.1.0" dependencies = [ "crypto", "nymsphinx-types", - "rand", + "rand 0.7.3", "serde", ] @@ -1908,12 +1648,12 @@ dependencies = [ name = "nymsphinx-anonymous-replies" version = "0.1.0" dependencies = [ - "bs58", + "bs58 0.4.0", "crypto", "nymsphinx-addressing", "nymsphinx-params", "nymsphinx-types", - "rand", + "rand 0.7.3", "serde", "topology", ] @@ -1926,7 +1666,7 @@ dependencies = [ "nymsphinx-addressing", "nymsphinx-params", "nymsphinx-types", - "rand", + "rand 0.7.3", ] [[package]] @@ -1940,7 +1680,7 @@ dependencies = [ "nymsphinx-forwarding", "nymsphinx-params", "nymsphinx-types", - "rand", + "rand 0.7.3", "topology", ] @@ -1957,10 +1697,10 @@ dependencies = [ name = "nymsphinx-framing" version = "0.1.0" dependencies = [ - "bytes 0.5.6", + "bytes 1.0.1", "nymsphinx-params", "nymsphinx-types", - "tokio-util 0.3.1", + "tokio-util", ] [[package]] @@ -1978,12 +1718,6 @@ dependencies = [ "sphinx", ] -[[package]] -name = "object" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ab52be62400ca80aa00285d25253d7f7c437b7375c4de678f5405d3afe82ca5" - [[package]] name = "once_cell" version = "1.7.2" @@ -2042,16 +1776,6 @@ dependencies = [ "log", ] -[[package]] -name = "parking_lot" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3a704eb390aafdc107b0e392f56a82b668e3a71366993b5340f5833fd62505e" -dependencies = [ - "lock_api 0.3.4", - "parking_lot_core 0.7.2", -] - [[package]] name = "parking_lot" version = "0.11.0" @@ -2059,22 +1783,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4893845fa2ca272e647da5d0e46660a314ead9c2fdd9a883aabc32e481a8733" dependencies = [ "instant", - "lock_api 0.4.1", - "parking_lot_core 0.8.0", -] - -[[package]] -name = "parking_lot_core" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d58c7c768d4ba344e3e8d72518ac13e259d7c7ade24167003b8488e10b6740a3" -dependencies = [ - "cfg-if 0.1.10", - "cloudabi 0.0.3", - "libc", - "redox_syscall", - "smallvec", - "winapi 0.3.9", + "lock_api", + "parking_lot_core", ] [[package]] @@ -2084,22 +1794,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c361aa727dd08437f2f1447be8b59a33b0edd15e0fcee698f935613d9efbca9b" dependencies = [ "cfg-if 0.1.10", - "cloudabi 0.1.0", + "cloudabi", "instant", "libc", "redox_syscall", "smallvec", - "winapi 0.3.9", + "winapi", ] [[package]] name = "pem" -version = "0.7.0" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1581760c757a756a41f0ee3ff01256227bdf64cb752839779b95ffb01c59793" +checksum = "fd56cbd21fea48d0c440b41cd69c589faacade08c992d9a54e471b79d0fd13eb" dependencies = [ - "base64 0.11.0", - "lazy_static", + "base64 0.13.0", + "once_cell", "regex", ] @@ -2143,9 +1853,9 @@ checksum = "99b8db626e31e5b81787b9783425769681b347011cc59471e33ea46d2ea0cf55" dependencies = [ "pest", "pest_meta", - "proc-macro2 1.0.24", - "quote 1.0.7", - "syn 1.0.58", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -2159,33 +1869,13 @@ dependencies = [ "sha-1 0.8.2", ] -[[package]] -name = "pin-project" -version = "0.4.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca4433fff2ae79342e497d9f8ee990d174071408f28f726d6d83af93e58e48aa" -dependencies = [ - "pin-project-internal 0.4.23", -] - [[package]] name = "pin-project" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95b70b68509f17aa2857863b6fa00bf21fc93674c7a8893de2f469f6aa7ca2f2" dependencies = [ - "pin-project-internal 1.0.4", -] - -[[package]] -name = "pin-project-internal" -version = "0.4.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c0e815c3ee9a031fdf5af21c10aa17c573c9c6a566328d99e3936c34e36461f" -dependencies = [ - "proc-macro2 1.0.24", - "quote 1.0.7", - "syn 1.0.58", + "pin-project-internal", ] [[package]] @@ -2194,17 +1884,11 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "caa25a6393f22ce819b0f50e0be89287292fda8d425be38ee0ca14c4931d9e71" dependencies = [ - "proc-macro2 1.0.24", - "quote 1.0.7", - "syn 1.0.58", + "proc-macro2", + "quote", + "syn", ] -[[package]] -name = "pin-project-lite" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282adbf10f2698a7a77f8e983a74b2d18176c19a7fd32a45446139ae7b02b715" - [[package]] name = "pin-project-lite" version = "0.2.4" @@ -2231,39 +1915,14 @@ checksum = "c36fa947111f5c62a733b652544dd0016a43ce89619538a8ef92724a6f501a20" [[package]] name = "pretty_env_logger" -version = "0.3.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "717ee476b1690853d222af4634056d830b5197ffd747726a9a1eee6da9f49074" +checksum = "926d36b9553851b8b0005f1275891b392ee4d2d833852c417ed025477350fb9d" dependencies = [ - "chrono", "env_logger", "log", ] -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2 1.0.24", - "quote 1.0.7", - "syn 1.0.58", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2 1.0.24", - "quote 1.0.7", - "version_check", -] - [[package]] name = "proc-macro-hack" version = "0.5.19" @@ -2276,48 +1935,37 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eba180dafb9038b050a4c280019bbedf9f2467b61e5d892dcad585bb57aadc5a" -[[package]] -name = "proc-macro2" -version = "0.4.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" -dependencies = [ - "unicode-xid 0.1.0", -] - [[package]] name = "proc-macro2" version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" dependencies = [ - "unicode-xid 0.2.1", + "unicode-xid", ] [[package]] name = "proxy-helpers" version = "0.1.0" dependencies = [ - "bytes 0.5.6", - "futures 0.3.9", + "bytes 1.0.1", + "futures", "log", "ordered-buffer", "socks5-requests", - "tokio 0.2.22", + "tokio", "tokio-test", + "tokio-util", ] [[package]] name = "publicsuffix" -version = "1.5.4" +version = "1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bbaa49075179162b49acac1c6aa45fb4dafb5f13cf6794276d77bc7fd95757b" +checksum = "95b4ce31ff0a27d93c8de1849cf58162283752f065a90d508f1105fa6c9a213f" dependencies = [ - "error-chain", "idna", - "lazy_static", "native-tls", - "regex", "url", ] @@ -2333,22 +1981,13 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ac73b1112776fc109b2e61909bc46c7e1bf0d7f690ffb1676553acce16d5cda" -[[package]] -name = "quote" -version = "0.6.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" -dependencies = [ - "proc-macro2 0.4.30", -] - [[package]] name = "quote" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" dependencies = [ - "proc-macro2 1.0.24", + "proc-macro2", ] [[package]] @@ -2357,11 +1996,23 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" dependencies = [ - "getrandom", + "getrandom 0.1.14", "libc", - "rand_chacha", - "rand_core", - "rand_hc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc 0.2.0", +] + +[[package]] +name = "rand" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e" +dependencies = [ + "libc", + "rand_chacha 0.3.0", + "rand_core 0.6.2", + "rand_hc 0.3.0", ] [[package]] @@ -2371,7 +2022,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.2", ] [[package]] @@ -2380,7 +2041,16 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" dependencies = [ - "getrandom", + "getrandom 0.1.14", +] + +[[package]] +name = "rand_core" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" +dependencies = [ + "getrandom 0.2.2", ] [[package]] @@ -2389,7 +2059,17 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96977acbdd3a6576fb1d27391900035bf3863d4a16422973a409b488cf29ffb2" dependencies = [ - "rand", + "rand 0.7.3", +] + +[[package]] +name = "rand_distr" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9e9532ada3929fb8b2e9dbe28d1e06c9b2cc65813f074fcb6bd5fbefeff9d56" +dependencies = [ + "num-traits", + "rand 0.7.3", ] [[package]] @@ -2398,7 +2078,16 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" dependencies = [ - "rand_core", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_hc" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73" +dependencies = [ + "rand_core 0.6.2", ] [[package]] @@ -2413,7 +2102,7 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de0737333e7a9502c789a36d7c7fa6092a49895d4faa31ca5df163857ded2e9d" dependencies = [ - "getrandom", + "getrandom 0.1.14", "redox_syscall", "rust-argon2", ] @@ -2442,43 +2131,7 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" dependencies = [ - "winapi 0.3.9", -] - -[[package]] -name = "reqwest" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9eaa17ac5d7b838b7503d118fa16ad88f440498bf9ffe5424e621f93190d61e" -dependencies = [ - "base64 0.12.3", - "bytes 0.5.6", - "encoding_rs", - "futures-core", - "futures-util", - "http", - "http-body 0.3.1", - "hyper 0.13.7", - "hyper-tls 0.4.3", - "ipnet", - "js-sys", - "lazy_static", - "log", - "mime", - "mime_guess", - "native-tls", - "percent-encoding", - "pin-project-lite 0.1.7", - "serde", - "serde_json", - "serde_urlencoded 0.6.1", - "tokio 0.2.22", - "tokio-tls", - "url", - "wasm-bindgen", - "wasm-bindgen-futures 0.4.21", - "web-sys", - "winreg", + "winapi", ] [[package]] @@ -2493,9 +2146,9 @@ dependencies = [ "futures-core", "futures-util", "http", - "http-body 0.4.0", - "hyper 0.14.4", - "hyper-tls 0.5.0", + "http-body", + "hyper", + "hyper-tls", "ipnet", "js-sys", "lazy_static", @@ -2503,15 +2156,15 @@ dependencies = [ "mime", "native-tls", "percent-encoding", - "pin-project-lite 0.2.4", + "pin-project-lite", "serde", "serde_json", - "serde_urlencoded 0.7.0", - "tokio 1.3.0", + "serde_urlencoded", + "tokio", "tokio-native-tls", "url", "wasm-bindgen", - "wasm-bindgen-futures 0.4.21", + "wasm-bindgen-futures", "web-sys", "winreg", ] @@ -2528,12 +2181,6 @@ dependencies = [ "crossbeam-utils", ] -[[package]] -name = "rustc-demangle" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" - [[package]] name = "ryu" version = "1.0.5" @@ -2547,7 +2194,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" dependencies = [ "lazy_static", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2567,10 +2214,10 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11af7a475c9ee266cfaa9e303a47c830ebe072bf3101ab907a7b7b9d816fa01d" dependencies = [ - "proc-macro2 1.0.24", - "quote 1.0.7", + "proc-macro2", + "quote", "serde_derive_internals", - "syn 1.0.58", + "syn", ] [[package]] @@ -2610,18 +2257,21 @@ dependencies = [ [[package]] name = "semver" -version = "0.9.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" dependencies = [ "semver-parser", ] [[package]] name = "semver-parser" -version = "0.7.0" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" +checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" +dependencies = [ + "pest", +] [[package]] name = "serde" @@ -2647,9 +2297,9 @@ version = "1.0.115" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "609feed1d0a73cc36a0182a840a9b37b4a82f0b1150369f0536a9e3f2a31dc48" dependencies = [ - "proc-macro2 1.0.24", - "quote 1.0.7", - "syn 1.0.58", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -2658,9 +2308,9 @@ version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1dbab34ca63057a1f15280bdf3c39f2b1eb1b54c17e98360e511637aef7418c6" dependencies = [ - "proc-macro2 1.0.24", - "quote 1.0.7", - "syn 1.0.58", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -2674,18 +2324,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_urlencoded" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ec5d77e2d4c73717816afac02670d5c4f534ea95ed430442cad02e7a6e32c97" -dependencies = [ - "dtoa", - "itoa", - "serde", - "url", -] - [[package]] name = "serde_urlencoded" version = "0.7.0" @@ -2772,9 +2410,9 @@ checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" [[package]] name = "sled" -version = "0.31.0" +version = "0.34.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fb6824dde66ad33bf20c6e8476f5b82b871bc8bc3c129a10ea2f7dae5060fa3" +checksum = "f72c064e63fbca3138ad07f3588c58093f1684f3a99f60dcfa6d46b87e60fde7" dependencies = [ "crc32fast", "crossbeam-epoch", @@ -2783,24 +2421,7 @@ dependencies = [ "fxhash", "libc", "log", - "parking_lot 0.10.2", -] - -[[package]] -name = "sled" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "701fd6e07375a3ecff6f754e990862fc115e881f602b950518e18658005e262b" -dependencies = [ - "array-init", - "crc32fast", - "crossbeam-epoch", - "crossbeam-utils", - "fs2", - "fxhash", - "libc", - "log", - "parking_lot 0.11.0", + "parking_lot", ] [[package]] @@ -2811,24 +2432,23 @@ checksum = "fbee7696b84bbf3d89a1c2eccff0850e3047ed46bfcd2e92c29a2d074d57e252" [[package]] name = "snafu" -version = "0.4.4" +version = "0.6.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b028158eb06caa8345bee10cccfb25fa632beccf0ef5308832b4fd4b78a7db48" +checksum = "eab12d3c261b2308b0d80c26fffb58d17eba81a4be97890101f416b478c79ca7" dependencies = [ - "backtrace", "doc-comment", "snafu-derive", ] [[package]] name = "snafu-derive" -version = "0.4.4" +version = "0.6.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf50aaef500c248a590e2696e8bf8c7620ca2235b9bb90a70363d82dd1abec6a" +checksum = "1508efa03c362e23817f96cde18abed596a25219a8b2c66e8db33c03543d315b" dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", - "syn 0.15.44", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -2839,7 +2459,7 @@ checksum = "122e570113d28d773067fab24266b66753f6ea915758651696b6e35e49f88d6e" dependencies = [ "cfg-if 1.0.0", "libc", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2858,16 +2478,16 @@ dependencies = [ "aes-ctr 0.3.0", "arrayref", "blake2", - "bs58", + "bs58 0.3.1", "byteorder", "chacha", - "curve25519-dalek 3.0.0", + "curve25519-dalek", "hkdf 0.8.0", "hmac 0.7.1", "lioness", "log", - "rand", - "rand_distr", + "rand 0.7.3", + "rand_distr 0.2.2", "sha2 0.8.2", ] @@ -2880,16 +2500,6 @@ dependencies = [ "generic-array 0.12.3", ] -[[package]] -name = "stream-cipher" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09f8ed9974042b8c3672ff3030a69fcc03b74c47c3d1ecb7755e8a3626011e88" -dependencies = [ - "block-cipher", - "generic-array 0.14.4", -] - [[package]] name = "strsim" version = "0.8.0" @@ -2908,26 +2518,15 @@ version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "502d53007c02d7605a05df1c1a73ee436952781653da5d0bf57ad608f66932c1" -[[package]] -name = "syn" -version = "0.15.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" -dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", - "unicode-xid 0.1.0", -] - [[package]] name = "syn" version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc60a3d73ea6594cd712d830cc1f0390fd71542d8c8cd24e70cc54cdfd5e05d5" dependencies = [ - "proc-macro2 1.0.24", - "quote 1.0.7", - "unicode-xid 0.2.1", + "proc-macro2", + "quote", + "unicode-xid", ] [[package]] @@ -2936,10 +2535,10 @@ version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b834f2d66f734cb897113e34aaff2f1ab4719ca946f9a7358dba8f8064148701" dependencies = [ - "proc-macro2 1.0.24", - "quote 1.0.7", - "syn 1.0.58", - "unicode-xid 0.2.1", + "proc-macro2", + "quote", + "syn", + "unicode-xid", ] [[package]] @@ -2950,10 +2549,10 @@ checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" dependencies = [ "cfg-if 0.1.10", "libc", - "rand", + "rand 0.7.3", "redox_syscall", "remove_dir_all", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2989,9 +2588,9 @@ version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7765189610d8241a44529806d6fd1f2e0a08734313a35d5b3a556f92b381f3c0" dependencies = [ - "proc-macro2 1.0.24", - "quote 1.0.7", - "syn 1.0.58", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -3003,70 +2602,49 @@ dependencies = [ "lazy_static", ] -[[package]] -name = "time" -version = "0.1.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" -dependencies = [ - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi 0.3.9", -] - [[package]] name = "tinyvec" -version = "0.3.4" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "238ce071d267c5710f9d31451efec16c5ee22de34df17cc05e56cbc92e967117" - -[[package]] -name = "tokio" -version = "0.2.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d34ca54d84bf2b5b4d7d31e901a8464f7b60ac145a284fba25ceb801f2ddccd" +checksum = "317cca572a0e89c3ce0ca1f1bdc9369547fe318a683418e42ac8f59d14701023" dependencies = [ - "bytes 0.5.6", - "fnv", - "futures-core", - "iovec", - "lazy_static", - "libc", - "memchr", - "mio 0.6.22", - "mio-named-pipes", - "mio-uds", - "num_cpus", - "pin-project-lite 0.1.7", - "signal-hook-registry", - "slab", - "tokio-macros", - "winapi 0.3.9", + "tinyvec_macros", ] [[package]] -name = "tokio" -version = "1.3.0" +name = "tinyvec_macros" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d56477f6ed99e10225f38f9f75f872f29b8b8bd8c0b946f63345bb144e9eeda" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" + +[[package]] +name = "tokio" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "134af885d758d645f0f0505c9a8b3f9bf8a348fd822e112ab5248138348f1722" dependencies = [ "autocfg", "bytes 1.0.1", "libc", "memchr", - "mio 0.7.10", - "pin-project-lite 0.2.4", + "mio", + "num_cpus", + "once_cell", + "pin-project-lite", + "signal-hook-registry", + "tokio-macros", + "winapi", ] [[package]] name = "tokio-macros" -version = "0.2.5" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0c3acc6aa564495a0f2e1d59fab677cd7f81a19994cfc7f3ad0e64301560389" +checksum = "caf7b11a536f46a809a8a9f0bb4237020f70ecbf115b842360afb127ea2fda57" dependencies = [ - "proc-macro2 1.0.24", - "quote 1.0.7", - "syn 1.0.58", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -3076,57 +2654,46 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" dependencies = [ "native-tls", - "tokio 1.3.0", + "tokio", +] + +[[package]] +name = "tokio-stream" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e177a5d8c3bf36de9ebe6d58537d8879e964332f93fb3339e43f618c81361af0" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", ] [[package]] name = "tokio-test" -version = "0.2.1" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed0049c119b6d505c4447f5c64873636c7af6c75ab0d45fd9f618d82acb8016d" +checksum = "f58403903e94d4bc56805e46597fced893410b2e753e229d3f7f22423ea03f67" dependencies = [ - "bytes 0.5.6", + "async-stream", + "bytes 1.0.1", "futures-core", - "tokio 0.2.22", -] - -[[package]] -name = "tokio-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a70f4fcd7b3b24fb194f837560168208f669ca8cb70d0c4b862944452396343" -dependencies = [ - "native-tls", - "tokio 0.2.22", + "tokio", + "tokio-stream", ] [[package]] name = "tokio-tungstenite" -version = "0.11.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d9e878ad426ca286e4dcae09cbd4e1973a7f8987d97570e2469703dd7f5720c" +checksum = "1e96bb520beab540ab664bd5a9cfeaa1fcd846fa68c830b42e2c8963071251d2" dependencies = [ "futures-util", "log", - "pin-project 0.4.23", - "tokio 0.2.22", + "pin-project", + "tokio", "tungstenite", ] -[[package]] -name = "tokio-util" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499" -dependencies = [ - "bytes 0.5.6", - "futures-core", - "futures-sink", - "log", - "pin-project-lite 0.1.7", - "tokio 0.2.22", -] - [[package]] name = "tokio-util" version = "0.6.4" @@ -3137,8 +2704,9 @@ dependencies = [ "futures-core", "futures-sink", "log", - "pin-project-lite 0.2.4", - "tokio 1.3.0", + "pin-project-lite", + "slab", + "tokio", ] [[package]] @@ -3154,14 +2722,13 @@ dependencies = [ name = "topology" version = "0.1.0" dependencies = [ - "bs58", + "bs58 0.4.0", "crypto", "log", "mixnet-contract", "nymsphinx-addressing", "nymsphinx-types", - "pretty_env_logger", - "rand", + "rand 0.7.3", "version-checker", ] @@ -3178,8 +2745,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01ebdc2bb4498ab1ab5f5b73c5803825e60199229ccba0698170e3be0e7f959f" dependencies = [ "cfg-if 1.0.0", - "log", - "pin-project-lite 0.2.4", + "pin-project-lite", "tracing-core", ] @@ -3200,19 +2766,20 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "tungstenite" -version = "0.11.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0308d80d86700c5878b9ef6321f020f29b1bb9d5ff3cab25e75e23f3a492a23" +checksum = "5fe8dada8c1a3aeca77d6b51a4f1314e0f4b8e438b7b1b71e3ddaca8080e4093" dependencies = [ - "base64 0.12.3", + "base64 0.13.0", "byteorder", - "bytes 0.5.6", + "bytes 1.0.1", "http", "httparse", "input_buffer", "log", - "rand", + "rand 0.8.3", "sha-1 0.9.1", + "thiserror", "url", "utf-8", ] @@ -3229,15 +2796,6 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" -[[package]] -name = "unicase" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" -dependencies = [ - "version_check", -] - [[package]] name = "unicode-bidi" version = "0.3.4" @@ -3249,9 +2807,9 @@ dependencies = [ [[package]] name = "unicode-normalization" -version = "0.1.13" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb19cf769fa8c6a80a162df694621ebeb4dafb606470b2b2fce0be40a98a977" +checksum = "07fbfce1c8a97d547e8b5334978438d9d6ec8c20e38f56d4a4374d181493eaef" dependencies = [ "tinyvec", ] @@ -3262,12 +2820,6 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" -[[package]] -name = "unicode-xid" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" - [[package]] name = "unicode-xid" version = "0.2.1" @@ -3299,10 +2851,10 @@ dependencies = [ "crypto", "log", "mockito", - "reqwest 0.10.8", + "reqwest", "schemars", "serde", - "tokio 0.2.22", + "tokio", "topology", ] @@ -3312,7 +2864,7 @@ version = "0.1.0" dependencies = [ "base64 0.13.0", "mixnet-contract", - "reqwest 0.11.2", + "reqwest", "serde", "serde_json", ] @@ -3385,25 +2937,12 @@ dependencies = [ "bumpalo", "lazy_static", "log", - "proc-macro2 1.0.24", - "quote 1.0.7", - "syn 1.0.58", + "proc-macro2", + "quote", + "syn", "wasm-bindgen-shared", ] -[[package]] -name = "wasm-bindgen-futures" -version = "0.3.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83420b37346c311b9ed822af41ec2e82839bfe99867ec6c54e2da43b7538771c" -dependencies = [ - "cfg-if 0.1.10", - "futures 0.1.29", - "js-sys", - "wasm-bindgen", - "web-sys", -] - [[package]] name = "wasm-bindgen-futures" version = "0.4.21" @@ -3422,7 +2961,7 @@ version = "0.2.71" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5ac38da8ef716661f0f36c0d8320b89028efe10c7c0afde65baffb496ce0d3b" dependencies = [ - "quote 1.0.7", + "quote", "wasm-bindgen-macro-support", ] @@ -3432,9 +2971,9 @@ version = "0.2.71" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc053ec74d454df287b9374ee8abb36ffd5acb95ba87da3ba5b7d3fe20eb401e" dependencies = [ - "proc-macro2 1.0.24", - "quote 1.0.7", - "syn 1.0.58", + "proc-macro2", + "quote", + "syn", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3447,27 +2986,26 @@ checksum = "7d6f8ec44822dd71f5f221a5847fb34acd9060535c1211b70a05844c0f6383b1" [[package]] name = "wasm-bindgen-test" -version = "0.2.50" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2d9693b63a742d481c7f80587e057920e568317b2806988c59cd71618bc26c1" +checksum = "2ea9e4f0050d5498a160e6b9d278a9699598e445b51dacd05598da55114c801a" dependencies = [ "console_error_panic_hook", - "futures 0.1.29", "js-sys", "scoped-tls", "wasm-bindgen", - "wasm-bindgen-futures 0.3.27", + "wasm-bindgen-futures", "wasm-bindgen-test-macro", ] [[package]] name = "wasm-bindgen-test-macro" -version = "0.2.50" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0789dac148a8840bbcf9efe13905463b733fa96543bfbf263790535c11af7ba5" +checksum = "43f40402f495d92df6cdd0d329e7cc2580c8f99bcd74faff0e468923a764b7d4" dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", + "proc-macro2", + "quote", ] [[package]] @@ -3476,12 +3014,12 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" dependencies = [ - "futures 0.3.9", + "futures", "js-sys", - "parking_lot 0.11.0", + "parking_lot", "pin-utils", "wasm-bindgen", - "wasm-bindgen-futures 0.4.21", + "wasm-bindgen-futures", "web-sys", ] @@ -3489,11 +3027,11 @@ dependencies = [ name = "wasm-utils" version = "0.1.0" dependencies = [ - "futures 0.3.9", + "futures", "js-sys", "tungstenite", "wasm-bindgen", - "wasm-bindgen-futures 0.4.21", + "wasm-bindgen-futures", "web-sys", ] @@ -3525,15 +3063,9 @@ dependencies = [ "cfg-if 0.1.10", "libc", "memory_units", - "winapi 0.3.9", + "winapi", ] -[[package]] -name = "winapi" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" - [[package]] name = "winapi" version = "0.3.9" @@ -3544,12 +3076,6 @@ dependencies = [ "winapi-x86_64-pc-windows-gnu", ] -[[package]] -name = "winapi-build" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" - [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" @@ -3562,7 +3088,7 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -3577,17 +3103,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69" dependencies = [ - "winapi 0.3.9", -] - -[[package]] -name = "ws2_32-sys" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" -dependencies = [ - "winapi 0.2.8", - "winapi-build", + "winapi", ] [[package]] @@ -3596,8 +3112,8 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc614d95359fd7afc321b66d2107ede58b246b844cf5d8a0adcca413e439f088" dependencies = [ - "curve25519-dalek 3.0.0", - "rand_core", + "curve25519-dalek", + "rand_core 0.5.1", "zeroize", ] @@ -3616,8 +3132,8 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de251eec69fc7c1bc3923403d18ececb929380e016afe103da75f396704f8ca2" dependencies = [ - "proc-macro2 1.0.24", - "quote 1.0.7", - "syn 1.0.58", + "proc-macro2", + "quote", + "syn", "synstructure", ] diff --git a/clients/client-core/Cargo.toml b/clients/client-core/Cargo.toml index 4b4cc058cd..76bb6579cc 100644 --- a/clients/client-core/Cargo.toml +++ b/clients/client-core/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] -dirs = "2.0.2" -futures = "0.3.1" -humantime-serde = "1.0.1" +dirs = "3.0" +futures = "0.3" +humantime-serde = "1.0" log = "0.4" rand = { version = "0.7.3", features = ["wasm-bindgen"] } -serde = { version = "1.0.104", features = ["derive"] } -sled = "0.33" -tokio = { version = "0.2", features = ["full"] } +serde = { version = "1.0", features = ["derive"] } +sled = "0.34" +tokio = { version = "1.4", features = ["macros"] } # internal config = { path = "../../common/config" } diff --git a/clients/client-core/src/client/cover_traffic_stream.rs b/clients/client-core/src/client/cover_traffic_stream.rs index 6d68046a8e..f2c3ad9d70 100644 --- a/clients/client-core/src/client/cover_traffic_stream.rs +++ b/clients/client-core/src/client/cover_traffic_stream.rs @@ -46,7 +46,7 @@ where /// Internal state, determined by `average_message_sending_delay`, /// used to keep track of when a next packet should be sent out. - next_delay: time::Delay, + next_delay: Pin>, /// Channel used for sending prepared sphinx packets to `MixTrafficController` that sends them /// out to the network without any further delays. @@ -74,7 +74,7 @@ where fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { // it is not yet time to return a message - if Pin::new(&mut self.next_delay).poll(cx).is_pending() { + if self.next_delay.as_mut().poll(cx).is_pending() { return Poll::Pending; }; @@ -87,7 +87,7 @@ where // The next interval value is `next_poisson_delay` after the one that just // yielded. let next = now + next_poisson_delay; - self.next_delay.reset(next); + self.next_delay.as_mut().reset(next); Poll::Ready(Some(())) } @@ -112,7 +112,7 @@ impl LoopCoverTrafficStream { average_ack_delay, average_packet_delay, average_cover_message_sending_delay, - next_delay: time::delay_for(Default::default()), + next_delay: Box::pin(time::sleep(Default::default())), mix_tx, our_full_destination, rng, @@ -166,10 +166,10 @@ impl LoopCoverTrafficStream { async fn run(&mut self) { // we should set initial delay only when we actually start the stream - self.next_delay = time::delay_for(sample_poisson_duration( + self.next_delay = Box::pin(time::sleep(sample_poisson_duration( &mut self.rng, self.average_cover_message_sending_delay, - )); + ))); while self.next().await.is_some() { self.on_new_message().await; diff --git a/clients/client-core/src/client/real_messages_control/acknowledgement_control/action_controller.rs b/clients/client-core/src/client/real_messages_control/acknowledgement_control/action_controller.rs index 34e1edf5bc..393e740552 100644 --- a/clients/client-core/src/client/real_messages_control/acknowledgement_control/action_controller.rs +++ b/clients/client-core/src/client/real_messages_control/acknowledgement_control/action_controller.rs @@ -15,21 +15,19 @@ use super::PendingAcknowledgement; use crate::client::real_messages_control::acknowledgement_control::RetransmissionRequestSender; use futures::channel::mpsc::{self, UnboundedReceiver, UnboundedSender}; +use futures::StreamExt; use log::*; -use nonexhaustive_delayqueue::NonExhaustiveDelayQueue; +use nonexhaustive_delayqueue::{Expired, NonExhaustiveDelayQueue, QueueKey, TimerError}; use nymsphinx::chunking::fragment::FragmentIdentifier; use nymsphinx::Delay as SphinxDelay; use std::collections::HashMap; use std::sync::Arc; use std::time::Duration; -use tokio::stream::StreamExt; -use tokio::time::delay_queue::{self, Expired}; -use tokio::time::Error as TimerError; pub(crate) type ActionSender = UnboundedSender; // The actual data being sent off as well as potential key to the delay queue -type PendingAckEntry = (Arc, Option); +type PendingAckEntry = (Arc, Option); // we can either: // - have a completely new set of packets we just sent and need to create entries for diff --git a/clients/client-core/src/client/real_messages_control/real_traffic_stream.rs b/clients/client-core/src/client/real_messages_control/real_traffic_stream.rs index 3d22b4f5a4..b088f91630 100644 --- a/clients/client-core/src/client/real_messages_control/real_traffic_stream.rs +++ b/clients/client-core/src/client/real_messages_control/real_traffic_stream.rs @@ -73,7 +73,7 @@ where /// Internal state, determined by `average_message_sending_delay`, /// used to keep track of when a next packet should be sent out. - next_delay: time::Delay, + next_delay: Pin>, /// Channel used for sending prepared sphinx packets to `MixTrafficController` that sends them /// out to the network without any further delays. @@ -128,7 +128,7 @@ where fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { // it is not yet time to return a message - if Pin::new(&mut self.next_delay).poll(cx).is_pending() { + if self.next_delay.as_mut().poll(cx).is_pending() { return Poll::Pending; }; @@ -141,7 +141,7 @@ where // The next interval value is `next_poisson_delay` after the one that just // yielded. let next = now + next_poisson_delay; - self.next_delay.reset(next); + self.next_delay.as_mut().reset(next); // check if we have anything immediately available if let Some(real_available) = self.received_buffer.pop_front() { @@ -190,7 +190,7 @@ where config, ack_key, sent_notifier, - next_delay: time::delay_for(Default::default()), + next_delay: Box::pin(time::sleep(Default::default())), mix_tx, real_receiver, our_full_destination, @@ -272,10 +272,10 @@ where // Send messages at certain rate and if no real traffic is available, send cover message. async fn run_normal_out_queue(&mut self) { // we should set initial delay only when we actually start the stream - self.next_delay = time::delay_for(sample_poisson_duration( + self.next_delay = Box::pin(time::sleep(sample_poisson_duration( &mut self.rng, self.config.average_message_sending_delay, - )); + ))); while let Some(next_message) = self.next().await { self.on_message(next_message).await; diff --git a/clients/client-core/src/client/topology_control.rs b/clients/client-core/src/client/topology_control.rs index 27465f413e..43a7a9081e 100644 --- a/clients/client-core/src/client/topology_control.rs +++ b/clients/client-core/src/client/topology_control.rs @@ -234,7 +234,7 @@ impl TopologyRefresher { pub fn start(mut self, handle: &Handle) -> JoinHandle<()> { handle.spawn(async move { loop { - tokio::time::delay_for(self.refresh_rate).await; + tokio::time::sleep(self.refresh_rate).await; self.refresh().await; } }) diff --git a/clients/native/Cargo.toml b/clients/native/Cargo.toml index fa0949cb60..62a87ca092 100644 --- a/clients/native/Cargo.toml +++ b/clients/native/Cargo.toml @@ -22,12 +22,12 @@ clap = "2.33.0" # for the command line arguments dirs = "3.0" # for determining default store directories in config dotenv = "0.15.0" # for obtaining environmental variables (only used for RUST_LOG for time being) log = "0.4" # self explanatory -pretty_env_logger = "0.3" # for formatting log messages +pretty_env_logger = "0.4" # for formatting log messages rand = {version = "0.7.3", features = ["wasm-bindgen"]} # rng-related traits + some rng implementation to use serde = { version = "1.0.104", features = ["derive"] } # for config serialization/deserialization -sled = "0.33" # for storage of replySURB decryption keys -tokio = { version = "0.2", features = ["full"] } # async runtime -tokio-tungstenite = "0.11.0" # websocket +sled = "0.34" # for storage of replySURB decryption keys +tokio = { version = "1.4", features = ["rt-multi-thread", "net", "signal"] } # async runtime +tokio-tungstenite = "0.14" # websocket ## internal client-core = { path = "../client-core" } diff --git a/clients/native/examples/websocket_binarysend.rs b/clients/native/examples/websocket_binarysend.rs index 2a2726dd03..3e9f563a0d 100644 --- a/clients/native/examples/websocket_binarysend.rs +++ b/clients/native/examples/websocket_binarysend.rs @@ -1,13 +1,15 @@ use futures::{SinkExt, StreamExt}; use nymsphinx::addressing::clients::Recipient; use tokio::net::TcpStream; -use tokio_tungstenite::{connect_async, tungstenite::protocol::Message, WebSocketStream}; +use tokio_tungstenite::{ + connect_async, tungstenite::protocol::Message, MaybeTlsStream, WebSocketStream, +}; use websocket_requests::{requests::ClientRequest, responses::ServerResponse}; // just helpers functions that work in this very particular context because we are sending to ourselves // and hence will always get a response back (i.e. the message we sent) async fn send_message_and_get_response( - ws_stream: &mut WebSocketStream, + ws_stream: &mut WebSocketStream>, req: Vec, ) -> ServerResponse { ws_stream.send(Message::Binary(req)).await.unwrap(); @@ -18,7 +20,7 @@ async fn send_message_and_get_response( } } -async fn get_self_address(ws_stream: &mut WebSocketStream) -> Recipient { +async fn get_self_address(ws_stream: &mut WebSocketStream>) -> Recipient { let self_address_request = ClientRequest::SelfAddress.serialize(); let response = send_message_and_get_response(ws_stream, self_address_request).await; diff --git a/clients/native/examples/websocket_textsend.rs b/clients/native/examples/websocket_textsend.rs index 7aa5bc5bec..6804ea53b4 100644 --- a/clients/native/examples/websocket_textsend.rs +++ b/clients/native/examples/websocket_textsend.rs @@ -1,7 +1,9 @@ use futures::{SinkExt, StreamExt}; use serde_json::json; use tokio::net::TcpStream; -use tokio_tungstenite::{connect_async, tungstenite::protocol::Message, WebSocketStream}; +use tokio_tungstenite::{ + connect_async, tungstenite::protocol::Message, MaybeTlsStream, WebSocketStream, +}; // PREFACE: in practice I don't see why you would ever want to use text api while in Rust, but example // is here for the completion sake @@ -9,7 +11,7 @@ use tokio_tungstenite::{connect_async, tungstenite::protocol::Message, WebSocket // just helpers functions that work in this very particular context because we are sending to ourselves // and hence will always get a response back (i.e. the message we sent) async fn send_message_and_get_json_response( - ws_stream: &mut WebSocketStream, + ws_stream: &mut WebSocketStream>, text_req: String, ) -> serde_json::Value { ws_stream.send(Message::Text(text_req)).await.unwrap(); @@ -20,7 +22,7 @@ async fn send_message_and_get_json_response( } } -async fn get_self_address(ws_stream: &mut WebSocketStream) -> String { +async fn get_self_address(ws_stream: &mut WebSocketStream>) -> String { let self_address_request = json!({ "type": "selfAddress" }).to_string(); let response = send_message_and_get_json_response(ws_stream, self_address_request).await; diff --git a/clients/native/src/client/mod.rs b/clients/native/src/client/mod.rs index 8dc7004a4d..61a6e7487d 100644 --- a/clients/native/src/client/mod.rs +++ b/clients/native/src/client/mod.rs @@ -106,21 +106,20 @@ impl NymClient { info!("Starting loop cover traffic stream..."); // we need to explicitly enter runtime due to "next_delay: time::delay_for(Default::default())" // set in the constructor which HAS TO be called within context of a tokio runtime - self.runtime - .enter(|| { - LoopCoverTrafficStream::new( - self.key_manager.ack_key(), - self.config.get_base().get_average_ack_delay(), - self.config.get_base().get_average_packet_delay(), - self.config - .get_base() - .get_loop_cover_traffic_average_delay(), - mix_tx, - self.as_mix_recipient(), - topology_accessor, - ) - }) - .start(self.runtime.handle()); + let _guard = self.runtime.enter(); + + LoopCoverTrafficStream::new( + self.key_manager.ack_key(), + self.config.get_base().get_average_ack_delay(), + self.config.get_base().get_average_packet_delay(), + self.config + .get_base() + .get_loop_cover_traffic_average_delay(), + mix_tx, + self.as_mix_recipient(), + topology_accessor, + ) + .start(self.runtime.handle()); } fn start_real_traffic_controller( @@ -153,18 +152,17 @@ impl NymClient { // we need to explicitly enter runtime due to "next_delay: time::delay_for(Default::default())" // set in the constructor [of OutQueueControl] which HAS TO be called within context of a tokio runtime // When refactoring this restriction should definitely be removed. - let real_messages_controller = self.runtime.enter(|| { - RealMessagesController::new( - controller_config, - ack_receiver, - input_receiver, - mix_sender, - topology_accessor, - reply_key_storage, - ) - }); - real_messages_controller - .start(self.runtime.handle(), self.config.get_base().get_vpn_mode()); + let _guard = self.runtime.enter(); + + RealMessagesController::new( + controller_config, + ack_receiver, + input_receiver, + mix_sender, + topology_accessor, + reply_key_storage, + ) + .start(self.runtime.handle(), self.config.get_base().get_vpn_mode()); } // buffer controlling all messages fetched from provider diff --git a/clients/native/src/commands/init.rs b/clients/native/src/commands/init.rs index 6a380f2e46..1ac2a96b70 100644 --- a/clients/native/src/commands/init.rs +++ b/clients/native/src/commands/init.rs @@ -182,7 +182,7 @@ pub fn execute(matches: &ArgMatches) { }; // TODO: is there perhaps a way to make it work without having to spawn entire runtime? - let mut rt = tokio::runtime::Runtime::new().unwrap(); + let rt = tokio::runtime::Runtime::new().unwrap(); let (shared_keys, gateway_listener) = rt.block_on(registration_fut); config .get_base_mut() diff --git a/clients/native/src/websocket/listener.rs b/clients/native/src/websocket/listener.rs index 0d0b99ad60..0688d77b51 100644 --- a/clients/native/src/websocket/listener.rs +++ b/clients/native/src/websocket/listener.rs @@ -14,10 +14,8 @@ use super::handler::Handler; use log::*; -use std::{ - net::{Shutdown, SocketAddr}, - sync::Arc, -}; +use std::{net::SocketAddr, sync::Arc}; +use tokio::io::AsyncWriteExt; use tokio::runtime; use tokio::{sync::Notify, task::JoinHandle}; @@ -47,7 +45,7 @@ impl Listener { } pub(crate) async fn run(&mut self, handler: Handler) { - let mut tcp_listener = tokio::net::TcpListener::bind(self.address) + let tcp_listener = tokio::net::TcpListener::bind(self.address) .await .expect("Failed to start websocket listener"); @@ -61,7 +59,7 @@ impl Listener { } new_conn = tcp_listener.accept() => { match new_conn { - Ok((socket, remote_addr)) => { + Ok((mut socket, remote_addr)) => { debug!("Received connection from {:?}", remote_addr); if self.state.is_connected() { warn!("tried to duplicate!"); @@ -70,7 +68,7 @@ impl Listener { // while we only ever want to accept a single connection, we don't want // to leave clients hanging (and also allow for reconnection if it somehow // was dropped) - match socket.shutdown(Shutdown::Both) { + match socket.shutdown().await { Ok(_) => trace!( "closed the connection between attempting websocket handshake" ), @@ -84,7 +82,7 @@ impl Listener { let fresh_handler = handler.clone(); tokio::spawn(async move { fresh_handler.handle_connection(socket).await; - notify_clone.notify(); + notify_clone.notify_one(); }); self.state = State::Connected; } diff --git a/clients/socks5/Cargo.toml b/clients/socks5/Cargo.toml index 2dd5d570e0..3fd1724abb 100644 --- a/clients/socks5/Cargo.toml +++ b/clients/socks5/Cargo.toml @@ -14,12 +14,12 @@ dirs = "3.0" # for determining default store directories in config dotenv = "0.15.0" futures = "0.3" log = "0.4" -pin-project = "0.4" -pretty_env_logger = "0.3" +pin-project = "1.0" +pretty_env_logger = "0.4" rand = { version = "0.7.3", features = ["wasm-bindgen"] } serde = { version = "1.0", features = ["derive"] } # for config serialization/deserialization -snafu = "0.4.1" -tokio = { version = "0.2", features = ["rt-threaded"] } +snafu = "0.6" +tokio = { version = "1.4", features = ["rt-multi-thread", "net", "signal"] } # internal client-core = { path = "../client-core" } diff --git a/clients/socks5/src/client/mod.rs b/clients/socks5/src/client/mod.rs index 165b42e192..73a4085052 100644 --- a/clients/socks5/src/client/mod.rs +++ b/clients/socks5/src/client/mod.rs @@ -94,21 +94,20 @@ impl NymClient { info!("Starting loop cover traffic stream..."); // we need to explicitly enter runtime due to "next_delay: time::delay_for(Default::default())" // set in the constructor which HAS TO be called within context of a tokio runtime - self.runtime - .enter(|| { - LoopCoverTrafficStream::new( - self.key_manager.ack_key(), - self.config.get_base().get_average_ack_delay(), - self.config.get_base().get_average_packet_delay(), - self.config - .get_base() - .get_loop_cover_traffic_average_delay(), - mix_tx, - self.as_mix_recipient(), - topology_accessor, - ) - }) - .start(self.runtime.handle()); + let _guard = self.runtime.enter(); + + LoopCoverTrafficStream::new( + self.key_manager.ack_key(), + self.config.get_base().get_average_ack_delay(), + self.config.get_base().get_average_packet_delay(), + self.config + .get_base() + .get_loop_cover_traffic_average_delay(), + mix_tx, + self.as_mix_recipient(), + topology_accessor, + ) + .start(self.runtime.handle()); } fn start_real_traffic_controller( @@ -141,18 +140,17 @@ impl NymClient { // we need to explicitly enter runtime due to "next_delay: time::delay_for(Default::default())" // set in the constructor [of OutQueueControl] which HAS TO be called within context of a tokio runtime // When refactoring this restriction should definitely be removed. - let real_messages_controller = self.runtime.enter(|| { - RealMessagesController::new( - controller_config, - ack_receiver, - input_receiver, - mix_sender, - topology_accessor, - reply_key_storage, - ) - }); - real_messages_controller - .start(self.runtime.handle(), self.config.get_base().get_vpn_mode()); + let _guard = self.runtime.enter(); + + RealMessagesController::new( + controller_config, + ack_receiver, + input_receiver, + mix_sender, + topology_accessor, + reply_key_storage, + ) + .start(self.runtime.handle(), self.config.get_base().get_vpn_mode()); } // buffer controlling all messages fetched from provider diff --git a/clients/socks5/src/commands/init.rs b/clients/socks5/src/commands/init.rs index ddb75623d8..0bca77e2a4 100644 --- a/clients/socks5/src/commands/init.rs +++ b/clients/socks5/src/commands/init.rs @@ -184,7 +184,7 @@ pub fn execute(matches: &ArgMatches) { }; // TODO: is there perhaps a way to make it work without having to spawn entire runtime? - let mut rt = tokio::runtime::Runtime::new().unwrap(); + let rt = tokio::runtime::Runtime::new().unwrap(); let (shared_keys, gateway_listener) = rt.block_on(registration_fut); config .get_base_mut() diff --git a/clients/socks5/src/socks/client.rs b/clients/socks5/src/socks/client.rs index f9b0c6cdcc..f4e411652c 100644 --- a/clients/socks5/src/socks/client.rs +++ b/clients/socks5/src/socks/client.rs @@ -17,9 +17,10 @@ use proxy_helpers::connection_controller::{ use proxy_helpers::proxy_runner::ProxyRunner; use rand::RngCore; use socks5_requests::{ConnectionId, RemoteAddress, Request}; -use std::net::{Shutdown, SocketAddr}; +use std::io; +use std::net::SocketAddr; use std::pin::Pin; -use tokio::prelude::*; +use tokio::io::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt, ReadBuf}; use tokio::{self, net::TcpStream}; #[pin_project(project = StateProject)] @@ -61,12 +62,12 @@ impl StreamState { } } - fn shutdown(&self, how: Shutdown) -> io::Result<()> { + async fn shutdown(&mut self) -> io::Result<()> { // shutdown should only be called if proxy is not being run. If it is, there's some bug // somewhere match self { StreamState::RunningProxy => panic!("Tried to shutdown stream while proxy is running"), - StreamState::Available(ref stream) => TcpStream::shutdown(stream, how), + StreamState::Available(ref mut stream) => TcpStream::shutdown(stream).await, } } } @@ -76,8 +77,8 @@ impl AsyncRead for StreamState { fn poll_read( self: Pin<&mut Self>, cx: &mut Context<'_>, - buf: &mut [u8], - ) -> Poll> { + buf: &mut ReadBuf<'_>, + ) -> Poll> { match self.project() { StateProject::RunningProxy => Poll::Ready(Err(io::Error::new( io::ErrorKind::NotFound, @@ -190,9 +191,9 @@ impl SocksClient { } /// Shutdown the TcpStream to the client and end the session - pub fn shutdown(&mut self) -> Result<(), SocksProxyError> { + pub async fn shutdown(&mut self) -> Result<(), SocksProxyError> { info!("client is shutting down its TCP stream"); - self.stream.shutdown(Shutdown::Both)?; + self.stream.shutdown().await?; Ok(()) } @@ -210,7 +211,7 @@ impl SocksClient { // Handle SOCKS4 requests if header[0] != SOCKS_VERSION { warn!("Init: Unsupported version: SOCKS{}", self.socks_version); - self.shutdown() + self.shutdown().await } // Valid SOCKS5 else { @@ -390,7 +391,7 @@ impl SocksClient { self.stream.write_all(&response).await?; // Shutdown - self.shutdown()?; + self.shutdown().await?; } Ok(()) @@ -404,7 +405,7 @@ impl SocksClient { warn!("Client has no suitable authentication methods!"); response[1] = AuthenticationMethods::NoMethods as u8; self.stream.write_all(&response).await?; - self.shutdown()?; + self.shutdown().await?; Err(ResponseCode::Failure.into()) } } diff --git a/clients/socks5/src/socks/request.rs b/clients/socks5/src/socks/request.rs index 5869d0d60d..14cda99989 100644 --- a/clients/socks5/src/socks/request.rs +++ b/clients/socks5/src/socks/request.rs @@ -2,7 +2,7 @@ use super::types::{AddrType, ResponseCode, SocksProxyError}; use super::{utils as socks_utils, SOCKS_VERSION}; use log::*; use std::fmt::{self, Display}; -use tokio::prelude::*; +use tokio::io::{AsyncRead, AsyncReadExt}; /// A Socks5 request hitting the proxy. pub(crate) struct SocksRequest { diff --git a/clients/socks5/src/socks/server.rs b/clients/socks5/src/socks/server.rs index e222b106a7..afa6f88e02 100644 --- a/clients/socks5/src/socks/server.rs +++ b/clients/socks5/src/socks/server.rs @@ -48,7 +48,7 @@ impl SphinxSocksServer { input_sender: InputMessageSender, buffer_requester: ReceivedBufferRequestSender, ) -> Result<(), SocksProxyError> { - let mut listener = TcpListener::bind(self.listening_address).await.unwrap(); + let listener = TcpListener::bind(self.listening_address).await.unwrap(); info!("Serving Connections..."); // controller for managing all active connections @@ -100,7 +100,7 @@ impl SphinxSocksServer { if client.error(response).await.is_err() { warn!("Failed to send error code"); }; - if client.shutdown().is_err() { + if client.shutdown().await.is_err() { warn!("Failed to shutdown TcpStream"); }; } diff --git a/clients/webassembly/Cargo.toml b/clients/webassembly/Cargo.toml index 74bc66287e..298f9176bc 100644 --- a/clients/webassembly/Cargo.toml +++ b/clients/webassembly/Cargo.toml @@ -45,7 +45,7 @@ console_error_panic_hook = { version = "0.1", optional = true } wee_alloc = { version = "0.4", optional = true } [dev-dependencies] -wasm-bindgen-test = "0.2" +wasm-bindgen-test = "0.3" [package.metadata.wasm-pack.profile.release] wasm-opt = false diff --git a/common/client-libs/gateway-client/Cargo.toml b/common/client-libs/gateway-client/Cargo.toml index 68a7e98f58..c357a9d3dc 100644 --- a/common/client-libs/gateway-client/Cargo.toml +++ b/common/client-libs/gateway-client/Cargo.toml @@ -19,16 +19,16 @@ gateway-requests = { path = "../../../gateway/gateway-requests" } nymsphinx = { path = "../../nymsphinx" } [dependencies.tungstenite] -version = "0.11" +version = "0.13" default-features = false # non-wasm-only dependencies [target."cfg(not(target_arch = \"wasm32\"))".dependencies.tokio] -version = "0.2" -features = ["macros", "rt-core", "stream", "sync", "time"] +version = "1.4" +features = ["macros", "rt", "net", "sync", "time"] [target."cfg(not(target_arch = \"wasm32\"))".dependencies.tokio-tungstenite] -version = "0.11" +version = "0.14" # wasm-only dependencies [target."cfg(target_arch = \"wasm32\")".dependencies.wasm-bindgen] @@ -44,6 +44,15 @@ path = "../../wasm-utils" [target."cfg(target_arch = \"wasm32\")".dependencies.wasm-timer] version = "0.2" +# this is due to tungstenite using `rand` 0.8 and associated changes in `getrandom` crate +# which now does not support wasm32-unknown-unknown target by default. +# using the below, we assume our client is going to be run in environment +# containing javascript (such as a web browser or node.js). +# refer to https://docs.rs/getrandom/0.2.2/getrandom/#webassembly-support for more information +[target."cfg(target_arch = \"wasm32\")".dependencies.getrandom] +version = "0.2" +features = ["js"] + [dev-dependencies] # for tests #url = "2.1" diff --git a/common/client-libs/gateway-client/src/client.rs b/common/client-libs/gateway-client/src/client.rs index c25880eb8b..57caff1d58 100644 --- a/common/client-libs/gateway-client/src/client.rs +++ b/common/client-libs/gateway-client/src/client.rs @@ -203,7 +203,7 @@ impl GatewayClient { } #[cfg(not(target_arch = "wasm32"))] - tokio::time::delay_for(self.reconnection_backoff).await; + tokio::time::sleep(self.reconnection_backoff).await; #[cfg(target_arch = "wasm32")] if let Err(err) = wasm_timer::Delay::new(self.reconnection_backoff).await { @@ -241,7 +241,9 @@ impl GatewayClient { }; #[cfg(not(target_arch = "wasm32"))] - let timeout = tokio::time::delay_for(self.response_timeout_duration); + let timeout = tokio::time::sleep(self.response_timeout_duration); + #[cfg(not(target_arch = "wasm32"))] + tokio::pin!(timeout); // technically the `wasm_timer` also works outside wasm, but unless required, // I really prefer to just stick to tokio diff --git a/common/client-libs/gateway-client/src/socket_state.rs b/common/client-libs/gateway-client/src/socket_state.rs index 5d0304248f..58af584f4c 100644 --- a/common/client-libs/gateway-client/src/socket_state.rs +++ b/common/client-libs/gateway-client/src/socket_state.rs @@ -27,7 +27,7 @@ use tungstenite::Message; #[cfg(not(target_arch = "wasm32"))] use tokio::net::TcpStream; #[cfg(not(target_arch = "wasm32"))] -use tokio_tungstenite::WebSocketStream; +use tokio_tungstenite::{MaybeTlsStream, WebSocketStream}; #[cfg(target_arch = "wasm32")] use wasm_bindgen_futures; @@ -37,7 +37,7 @@ use wasm_utils::websocket::JSWebsocket; // type alias for not having to type the whole thing every single time (and now it makes it easier // to use different types based on compilation target) #[cfg(not(target_arch = "wasm32"))] -type WsConn = WebSocketStream; +type WsConn = WebSocketStream>; #[cfg(target_arch = "wasm32")] type WsConn = JSWebsocket; @@ -124,11 +124,14 @@ impl PartiallyDelegated { }; }; - match ret_err { + if match ret_err { Err(err) => stream_sender.send(Err(err)), Ok(_) => stream_sender.send(Ok(stream)), } - .unwrap(); + .is_err() + { + panic!("failed to send back `mixnet_receiver_future` result on the oneshot channel") + } }; #[cfg(target_arch = "wasm32")] diff --git a/common/client-libs/metrics-client/Cargo.toml b/common/client-libs/metrics-client/Cargo.toml index 5bff198dc0..972182f9db 100644 --- a/common/client-libs/metrics-client/Cargo.toml +++ b/common/client-libs/metrics-client/Cargo.toml @@ -8,8 +8,8 @@ edition = "2018" [dependencies] serde = { version = "1.0", features = ["derive"] } -reqwest = { version = "0.10", features = ["json"] } +reqwest = { version = "0.11", features = ["json"] } [dev-dependencies] -mockito = "0.23.0" -tokio = { version = "0.2", features = ["macros"] } \ No newline at end of file +mockito = "0.30" +tokio = "1.4" \ No newline at end of file diff --git a/common/client-libs/mixnet-client/Cargo.toml b/common/client-libs/mixnet-client/Cargo.toml index 4aa980a23f..1d32991f1f 100644 --- a/common/client-libs/mixnet-client/Cargo.toml +++ b/common/client-libs/mixnet-client/Cargo.toml @@ -9,8 +9,8 @@ edition = "2018" [dependencies] futures = "0.3" log = "0.4.8" -tokio = { version = "0.2", features = ["full"] } -tokio-util = { version = "0.3.1", features = ["codec"] } +tokio = { version = "1.4", features = ["time", "net", "rt"] } +tokio-util = { version = "0.6", features = ["codec"] } # internal nymsphinx = {path = "../../nymsphinx" } diff --git a/common/client-libs/mixnet-client/src/client.rs b/common/client-libs/mixnet-client/src/client.rs index 4b3281d1cf..c9b7003bcf 100644 --- a/common/client-libs/mixnet-client/src/client.rs +++ b/common/client-libs/mixnet-client/src/client.rs @@ -26,7 +26,7 @@ use std::sync::atomic::{AtomicU32, Ordering}; use std::sync::Arc; use std::time::Duration; use tokio::net::TcpStream; -use tokio::time::delay_for; +use tokio::time::sleep; use tokio_util::codec::Framed; pub struct Config { @@ -185,7 +185,7 @@ impl Client { // before executing the manager, wait for what was specified, if anything if let Some(backoff) = backoff { trace!("waiting for {:?} before attempting connection", backoff); - delay_for(backoff).await; + sleep(backoff).await; } Self::manage_connection( diff --git a/common/client-libs/validator-client/Cargo.toml b/common/client-libs/validator-client/Cargo.toml index 7ac6f18fdb..4833926e31 100644 --- a/common/client-libs/validator-client/Cargo.toml +++ b/common/client-libs/validator-client/Cargo.toml @@ -8,13 +8,13 @@ edition = "2018" [dependencies] log = "0.4" -reqwest = { version = "0.10", features = ["json"] } -schemars = "0.7.6" +reqwest = { version = "0.11", features = ["json"] } +schemars = "0.7" serde = { version = "1.0", features = ["derive"] } crypto = { path = "../../crypto" } topology = { path = "../../topology" } [dev-dependencies] -mockito = "0.23.0" -tokio = { version = "0.2", features = ["macros"] } \ No newline at end of file +mockito = "0.30" +tokio = "1.4" \ No newline at end of file diff --git a/common/config/Cargo.toml b/common/config/Cargo.toml index d955cd93d8..b264012a61 100644 --- a/common/config/Cargo.toml +++ b/common/config/Cargo.toml @@ -8,5 +8,5 @@ edition = "2018" [dependencies] handlebars = "3.0.1" -serde = { version = "1.0.104", features = ["derive"] } +serde = { version = "1.0", features = ["derive"] } toml = "0.5.6" diff --git a/common/crypto/Cargo.toml b/common/crypto/Cargo.toml index a6c3980e11..221cb9a8ac 100644 --- a/common/crypto/Cargo.toml +++ b/common/crypto/Cargo.toml @@ -7,18 +7,18 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -aes-ctr = "0.4" -bs58 = "0.3.0" -blake3 = "0.3.5" +aes-ctr = "0.6.0" +bs58 = "0.4" +blake3 = "0.3" +#blake3 = { version = "0.3", features = ["traits-preview"]} digest = "0.9" generic-array = "0.14" -hkdf = "0.9" +hkdf = "0.10" hmac = "0.8" -stream-cipher = "0.4" +cipher = "0.2" x25519-dalek = "1.1" ed25519-dalek = "1.0" log = "0.4" -pretty_env_logger = "0.3" rand = { version = "0.7.3", features = ["wasm-bindgen"] } # internal diff --git a/common/crypto/src/shared_key.rs b/common/crypto/src/shared_key.rs index be8b4e475c..fa24bbf0e7 100644 --- a/common/crypto/src/shared_key.rs +++ b/common/crypto/src/shared_key.rs @@ -14,10 +14,10 @@ use crate::asymmetric::encryption; use crate::hkdf; +use cipher::stream::{Key, NewStreamCipher, SyncStreamCipher}; use digest::{BlockInput, FixedOutput, Reset, Update}; use generic_array::{typenum::Unsigned, ArrayLength}; use rand::{CryptoRng, RngCore}; -use stream_cipher::{Key, NewStreamCipher, SyncStreamCipher}; /// Generate an ephemeral encryption keypair and perform diffie-hellman to establish /// shared key with the remote. diff --git a/common/crypto/src/symmetric/stream_cipher.rs b/common/crypto/src/symmetric/stream_cipher.rs index 8a7f13eaf4..ce6200e6ed 100644 --- a/common/crypto/src/symmetric/stream_cipher.rs +++ b/common/crypto/src/symmetric/stream_cipher.rs @@ -4,12 +4,12 @@ #![allow(renamed_and_removed_lints)] #![allow(unknown_lints)] // beta-nightly #![allow(clippy::unknown_clippy_lints)] // `clippy::upper_case_acronyms` does not exist on stable just yet +use cipher::stream::{Nonce, StreamCipher, SyncStreamCipher}; use generic_array::{typenum::Unsigned, GenericArray}; use rand::{CryptoRng, RngCore}; -use stream_cipher::{Nonce, StreamCipher, SyncStreamCipher}; // re-export this for ease of use -pub use stream_cipher::{Key, NewStreamCipher}; +pub use cipher::stream::{Key, NewStreamCipher}; // TODO: note that this is not the most secure approach here // we are not using nonces properly but instead "kinda" thinking of them as IVs. diff --git a/common/mixnode-common/Cargo.toml b/common/mixnode-common/Cargo.toml index 5049f1d99d..a50f4b5de2 100644 --- a/common/mixnode-common/Cargo.toml +++ b/common/mixnode-common/Cargo.toml @@ -17,4 +17,4 @@ nymsphinx-forwarding = { path = "../nymsphinx/forwarding" } nymsphinx-framing = { path = "../nymsphinx/framing" } nymsphinx-params = { path = "../nymsphinx/params" } nymsphinx-types = { path = "../nymsphinx/types" } -tokio = { version = "0.2", features = ["time", "macros", "rt-core"] } \ No newline at end of file +tokio = { version = "1.4", features = ["time", "macros", "rt"] } \ No newline at end of file diff --git a/common/mixnode-common/src/cached_packet_processor/cache.rs b/common/mixnode-common/src/cached_packet_processor/cache.rs index 345e7c3824..a5feaf1be7 100644 --- a/common/mixnode-common/src/cached_packet_processor/cache.rs +++ b/common/mixnode-common/src/cached_packet_processor/cache.rs @@ -15,13 +15,13 @@ use dashmap::mapref::one::Ref; use dashmap::DashMap; use futures::channel::mpsc; +use futures::StreamExt; use log::*; -use nonexhaustive_delayqueue::{Expired, NonExhaustiveDelayQueue}; +use nonexhaustive_delayqueue::{Expired, NonExhaustiveDelayQueue, TimerError}; use nymsphinx_types::header::keys::RoutingKeys; use nymsphinx_types::SharedSecret; use std::sync::Arc; -use tokio::stream::StreamExt; -use tokio::time::{Duration, Error as TimeError}; +use tokio::time::Duration; type CachedKeys = (Option, RoutingKeys); @@ -128,7 +128,7 @@ impl CacheInvalidator { // pros: the lock situation will be spread more in time // cons: possibly less efficient? - fn handle_expired(&mut self, expired: Option, TimeError>>) { + fn handle_expired(&mut self, expired: Option, TimerError>>) { let expired = expired.expect("the queue has unexpectedly terminated!"); let expired_entry = expired.expect("Encountered timer issue within the runtime!"); diff --git a/common/nonexhaustive-delayqueue/Cargo.toml b/common/nonexhaustive-delayqueue/Cargo.toml index 65dea23278..7dfd0318d2 100644 --- a/common/nonexhaustive-delayqueue/Cargo.toml +++ b/common/nonexhaustive-delayqueue/Cargo.toml @@ -7,4 +7,6 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -tokio = { version = "0.2", features = ["stream", "time"] } \ No newline at end of file +tokio = { version = "1.4", features = [] } +tokio-stream = "0.1" # this one seems to be a thing until `Stream` trait is stabilised in stdlib +tokio-util = { version = "0.6", features = ["time"] } diff --git a/common/nonexhaustive-delayqueue/src/lib.rs b/common/nonexhaustive-delayqueue/src/lib.rs index 669ab36a14..9762693120 100644 --- a/common/nonexhaustive-delayqueue/src/lib.rs +++ b/common/nonexhaustive-delayqueue/src/lib.rs @@ -15,10 +15,12 @@ use std::pin::Pin; use std::task::{Context, Poll, Waker}; use std::time::Duration; -use tokio::stream::Stream; -pub use tokio::time::delay_queue::Expired; -use tokio::time::{delay_queue, DelayQueue, Instant}; +use tokio::time::Instant; +use tokio_stream::Stream; +use tokio_util::time::{delay_queue, DelayQueue}; +pub use tokio::time::error::Error as TimerError; +pub use tokio_util::time::delay_queue::Expired; pub type QueueKey = delay_queue::Key; /// A variant of tokio's `DelayQueue`, such that its `Stream` implementation will never return a 'None'. diff --git a/common/nymsphinx/Cargo.toml b/common/nymsphinx/Cargo.toml index 083a4d8833..a93bbbb6a3 100644 --- a/common/nymsphinx/Cargo.toml +++ b/common/nymsphinx/Cargo.toml @@ -8,7 +8,7 @@ edition = "2018" [dependencies] rand = { version = "0.7.3", features = ["wasm-bindgen"] } -rand_distr = "0.2.2" +rand_distr = "0.3" nymsphinx-acknowledgements = { path = "acknowledgements" } nymsphinx-addressing = { path = "addressing" } @@ -30,5 +30,5 @@ topology = { path = "../topology" } path = "framing" [target."cfg(not(target_arch = \"wasm32\"))".dependencies.tokio] -version = "0.2" +version = "1.4" features = ["sync"] diff --git a/common/nymsphinx/acknowledgements/src/identifier.rs b/common/nymsphinx/acknowledgements/src/identifier.rs index 2fcaeab789..dd79aa2291 100644 --- a/common/nymsphinx/acknowledgements/src/identifier.rs +++ b/common/nymsphinx/acknowledgements/src/identifier.rs @@ -13,9 +13,8 @@ // limitations under the License. use crate::AckKey; -use crypto::aes_ctr::stream_cipher::NewStreamCipher; use crypto::generic_array::typenum::Unsigned; -use crypto::symmetric::stream_cipher::{self, encrypt, iv_from_slice, random_iv}; +use crypto::symmetric::stream_cipher::{self, encrypt, iv_from_slice, random_iv, NewStreamCipher}; use nymsphinx_params::{ packet_sizes::PacketSize, AckEncryptionAlgorithm, SerializedFragmentIdentifier, FRAG_ID_LEN, }; diff --git a/common/nymsphinx/anonymous-replies/Cargo.toml b/common/nymsphinx/anonymous-replies/Cargo.toml index 7a2e2bdf69..be41fef7f2 100644 --- a/common/nymsphinx/anonymous-replies/Cargo.toml +++ b/common/nymsphinx/anonymous-replies/Cargo.toml @@ -8,7 +8,7 @@ edition = "2018" [dependencies] rand = {version = "0.7.3", features = ["wasm-bindgen"]} -bs58 = "0.3" +bs58 = "0.4" serde = "1.0" crypto = { path = "../../crypto" } diff --git a/common/nymsphinx/framing/Cargo.toml b/common/nymsphinx/framing/Cargo.toml index 6e645bd246..7e73173606 100644 --- a/common/nymsphinx/framing/Cargo.toml +++ b/common/nymsphinx/framing/Cargo.toml @@ -7,8 +7,8 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -bytes = "0.5" -tokio-util = { version = "0.3.1", features = ["codec"] } +bytes = "1.0" +tokio-util = { version = "0.6", features = ["codec"] } nymsphinx-types = { path = "../types" } nymsphinx-params = { path = "../params" } diff --git a/common/pemstore/Cargo.toml b/common/pemstore/Cargo.toml index 713ee67cd6..9c5b4f5c1e 100644 --- a/common/pemstore/Cargo.toml +++ b/common/pemstore/Cargo.toml @@ -7,4 +7,4 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -pem = "0.7.0" +pem = "0.8" diff --git a/common/socks5/proxy-helpers/Cargo.toml b/common/socks5/proxy-helpers/Cargo.toml index dc73412ad9..9d9b42d627 100644 --- a/common/socks5/proxy-helpers/Cargo.toml +++ b/common/socks5/proxy-helpers/Cargo.toml @@ -7,14 +7,16 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -bytes = "0.5" -# TODO: "time" feature is only required for the delay loop which is going to go away very soon! -tokio = { version = "0.2", features = [ "tcp", "io-util", "sync", "macros", "time" ] } +bytes = "1.0" +tokio = { version = "1.4", features = [ "net", "io-util", "sync", "macros", "time" ] } +tokio-util = { version = "0.6", features = [ "io" ] } # reason for getting this guy is to to able to port to tokio 1.X more quickly by being able to use +# their `read_buf` [from the util crate] replacement rather than having to rethink/reimplement `AvailableReader` with the new AsyncRead trait definition. +# In the long run, the dependency should probably get removed in favour of pure-tokio implementation, but for time being it's fine. futures = "0.3" log = "0.4" socks5-requests = { path = "../requests" } ordered-buffer = { path = "../ordered-buffer" } [dev-dependencies] -tokio = { version = "0.2", features = ["rt-threaded"] } -tokio-test = "0.2" \ No newline at end of file +tokio = { version = "1.4", features = ["rt-multi-thread"] } +tokio-test = "0.4" \ No newline at end of file diff --git a/common/socks5/proxy-helpers/src/available_reader.rs b/common/socks5/proxy-helpers/src/available_reader.rs index d84331e4bb..c4f6b6eac3 100644 --- a/common/socks5/proxy-helpers/src/available_reader.rs +++ b/common/socks5/proxy-helpers/src/available_reader.rs @@ -13,6 +13,7 @@ // limitations under the License. use bytes::{BufMut, Bytes, BytesMut}; +use futures::Stream; use std::cell::RefCell; use std::future::Future; use std::io; @@ -20,8 +21,8 @@ use std::ops::DerefMut; use std::pin::Pin; use std::task::{Context, Poll}; use tokio::io::AsyncRead; -use tokio::stream::Stream; -use tokio::time::{delay_for, Delay, Duration, Instant}; +use tokio::time::{sleep, Duration, Instant, Sleep}; +use tokio_util::io::poll_read_buf; const MAX_READ_AMOUNT: usize = 500 * 1000; // 0.5MB const GRACE_DURATION: Duration = Duration::from_millis(1); @@ -31,7 +32,7 @@ pub struct AvailableReader<'a, R: AsyncRead + Unpin> { // mutably borrow both inner reader and buffer at the same time) buf: RefCell, inner: RefCell<&'a mut R>, - grace_period: Option, + grace_period: Option>>, } impl<'a, R> AvailableReader<'a, R> @@ -44,7 +45,7 @@ where AvailableReader { buf: RefCell::new(BytesMut::with_capacity(Self::BUF_INCREMENT)), inner: RefCell::new(reader), - grace_period: Some(delay_for(GRACE_DURATION)), + grace_period: Some(Box::pin(sleep(GRACE_DURATION))), } } } @@ -59,8 +60,11 @@ impl<'a, R: AsyncRead + Unpin> Stream for AvailableReader<'a, R> { } // note: poll_read_buf calls `buf.advance_mut(n)` - let poll_res = Pin::new(self.inner.borrow_mut().deref_mut()) - .poll_read_buf(cx, self.buf.borrow_mut().deref_mut()); + let poll_res = poll_read_buf( + Pin::new(self.inner.borrow_mut().deref_mut()), + cx, + self.buf.borrow_mut().deref_mut(), + ); match poll_res { Poll::Pending => { @@ -84,7 +88,7 @@ impl<'a, R: AsyncRead + Unpin> Stream for AvailableReader<'a, R> { // if exists - reset grace period if let Some(grace_period) = self.grace_period.as_mut() { let now = Instant::now(); - grace_period.reset(now + GRACE_DURATION); + grace_period.as_mut().reset(now + GRACE_DURATION); } // if we read a non-0 amount, we're not done yet! @@ -115,10 +119,10 @@ impl<'a, R: AsyncRead + Unpin> Stream for AvailableReader<'a, R> { #[cfg(test)] mod tests { use super::*; - use futures::poll; + use futures::{poll, StreamExt}; use std::io::Cursor; use std::time::Duration; - use tokio::stream::StreamExt; + use tokio::io::AsyncReadExt; use tokio_test::assert_pending; #[tokio::test] @@ -161,6 +165,10 @@ mod tests { assert_eq!(read_data, first_data_chunk); assert_pending!(poll!(available_reader.next())); + + // before dropping the mock, we need to empty it + let mut buf = vec![0u8; second_data_chunk.len()]; + reader_mock.read(&mut buf).await.unwrap(); } #[tokio::test] diff --git a/common/socks5/proxy-helpers/src/connection_controller.rs b/common/socks5/proxy-helpers/src/connection_controller.rs index 0d1c90b86c..bcff242a84 100644 --- a/common/socks5/proxy-helpers/src/connection_controller.rs +++ b/common/socks5/proxy-helpers/src/connection_controller.rs @@ -13,11 +13,11 @@ // limitations under the License. use futures::channel::mpsc; +use futures::StreamExt; use log::*; use ordered_buffer::{OrderedMessage, OrderedMessageBuffer}; use socks5_requests::ConnectionId; use std::collections::{HashMap, HashSet}; -use tokio::stream::StreamExt; /// A generic message produced after reading from a socket/connection. It includes data that was /// actually read alongside boolean indicating whether the connection got closed so that diff --git a/common/socks5/proxy-helpers/src/proxy_runner/inbound.rs b/common/socks5/proxy-helpers/src/proxy_runner/inbound.rs index 66ee852101..59c5a52468 100644 --- a/common/socks5/proxy-helpers/src/proxy_runner/inbound.rs +++ b/common/socks5/proxy-helpers/src/proxy_runner/inbound.rs @@ -17,13 +17,13 @@ use super::SHUTDOWN_TIMEOUT; use crate::available_reader::AvailableReader; use bytes::Bytes; use futures::FutureExt; +use futures::StreamExt; use log::*; use ordered_buffer::OrderedMessageSender; use socks5_requests::ConnectionId; use std::{io, sync::Arc}; use tokio::select; -use tokio::stream::StreamExt; -use tokio::{net::tcp::OwnedReadHalf, sync::Notify, time::delay_for}; +use tokio::{net::tcp::OwnedReadHalf, sync::Notify, time::sleep}; fn send_empty_close( connection_id: ConnectionId, @@ -99,9 +99,7 @@ where { let mut available_reader = AvailableReader::new(&mut reader); let mut message_sender = OrderedMessageSender::new(); - let shutdown_future = shutdown_notify - .notified() - .then(|_| delay_for(SHUTDOWN_TIMEOUT)); + let shutdown_future = shutdown_notify.notified().then(|_| sleep(SHUTDOWN_TIMEOUT)); tokio::pin!(shutdown_future); @@ -122,7 +120,7 @@ where } } trace!("{} - inbound closed", connection_id); - shutdown_notify.notify(); + shutdown_notify.notify_one(); reader } diff --git a/common/socks5/proxy-helpers/src/proxy_runner/outbound.rs b/common/socks5/proxy-helpers/src/proxy_runner/outbound.rs index 8e6c06df7d..c196d82b9a 100644 --- a/common/socks5/proxy-helpers/src/proxy_runner/outbound.rs +++ b/common/socks5/proxy-helpers/src/proxy_runner/outbound.rs @@ -15,17 +15,13 @@ use super::SHUTDOWN_TIMEOUT; use crate::connection_controller::{ConnectionMessage, ConnectionReceiver}; use futures::FutureExt; +use futures::StreamExt; use log::*; use socks5_requests::ConnectionId; use std::{sync::Arc, time::Duration}; -use tokio::prelude::*; +use tokio::io::AsyncWriteExt; use tokio::select; -use tokio::stream::StreamExt; -use tokio::{ - net::tcp::OwnedWriteHalf, - sync::Notify, - time::{delay_for, Instant}, -}; +use tokio::{net::tcp::OwnedWriteHalf, sync::Notify, time::sleep, time::Instant}; const MIX_TTL: Duration = Duration::from_secs(5 * 60); @@ -66,13 +62,10 @@ pub(super) async fn run_outbound( connection_id: ConnectionId, shutdown_notify: Arc, ) -> (OwnedWriteHalf, ConnectionReceiver) { - let shutdown_future = shutdown_notify - .notified() - .then(|_| delay_for(SHUTDOWN_TIMEOUT)); - + let shutdown_future = shutdown_notify.notified().then(|_| sleep(SHUTDOWN_TIMEOUT)); tokio::pin!(shutdown_future); - let mut mix_timeout = delay_for(MIX_TTL); + let mut mix_timeout = Box::pin(sleep(MIX_TTL)); loop { select! { @@ -81,7 +74,7 @@ pub(super) async fn run_outbound( if deal_with_message(connection_message, &mut writer, &local_destination_address, &remote_source_address, connection_id).await { break; } - mix_timeout.reset(Instant::now() + MIX_TTL); + mix_timeout.as_mut().reset(Instant::now() + MIX_TTL); } else { warn!("mix receiver is none so we already got removed somewhere. This isn't really a warning, but shouldn't happen to begin with, so please say if you see this message"); break; @@ -100,7 +93,7 @@ pub(super) async fn run_outbound( } trace!("{} - outbound closed", connection_id); - shutdown_notify.notify(); + shutdown_notify.notify_one(); (writer, mix_receiver) } diff --git a/common/topology/Cargo.toml b/common/topology/Cargo.toml index ac03e868c1..199505b83f 100644 --- a/common/topology/Cargo.toml +++ b/common/topology/Cargo.toml @@ -7,9 +7,8 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -bs58 = "0.3.0" +bs58 = "0.4" log = "0.4" -pretty_env_logger = "0.3" rand = { version = "0.7.3", features = ["wasm-bindgen"] } ## internal diff --git a/common/version-checker/Cargo.toml b/common/version-checker/Cargo.toml index 80c97fb349..6cc9b02bb8 100644 --- a/common/version-checker/Cargo.toml +++ b/common/version-checker/Cargo.toml @@ -7,4 +7,4 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -semver = "0.9.0" \ No newline at end of file +semver = "0.11" \ No newline at end of file diff --git a/common/wasm-utils/Cargo.toml b/common/wasm-utils/Cargo.toml index 7dfefb7771..2b5dd88f43 100644 --- a/common/wasm-utils/Cargo.toml +++ b/common/wasm-utils/Cargo.toml @@ -14,7 +14,7 @@ wasm-bindgen-futures = "0.4" # we don't want entire tokio-tungstenite, tungstenite itself is just fine - we just want message and error enums [dependencies.tungstenite] -version = "0.11" +version = "0.13" default-features = false [dependencies.web-sys] diff --git a/common/wasm-utils/src/websocket/mod.rs b/common/wasm-utils/src/websocket/mod.rs index 2450186fa7..7d4117c92c 100644 --- a/common/wasm-utils/src/websocket/mod.rs +++ b/common/wasm-utils/src/websocket/mod.rs @@ -15,7 +15,6 @@ use crate::websocket::state::State; use crate::{console_error, console_log}; use futures::{Sink, Stream}; -use std::borrow::Cow; use std::cell::RefCell; use std::collections::VecDeque; use std::io; @@ -49,9 +48,8 @@ fn try_message_event_into_ws_message(msg_event: MessageEvent) -> Result Ok(WsMessage::Text(text)), None => Err(WsError::Utf8), }, - _ => Err(WsError::Protocol(Cow::from( - "received a websocket message that is neither a String, ArrayBuffer or a Blob", - ))), + // "received a websocket message that is neither a String, ArrayBuffer or a Blob" + _ => Err(WsError::Io(io::Error::from(io::ErrorKind::InvalidInput))), } } @@ -71,6 +69,7 @@ fn try_message_event_into_ws_message(msg_event: MessageEvent) -> Result; const MAX_RECONNECTION_ATTEMPTS: u32 = 10; @@ -16,7 +15,8 @@ const RECONNECTION_BACKOFF: Duration = Duration::from_secs(10); /// All metrics messages get copied out to this dashboard instance's clients. pub(crate) struct MetricsWebsocketClient { metrics_address: String, - metrics_upstream: WebSocketStream>>, + // metrics_upstream: WebSocketStream>>, + metrics_upstream: WebSocketStream>, broadcaster: broadcast::Sender, reconnection_attempt: u32, @@ -52,7 +52,7 @@ impl MetricsWebsocketClient { } // use linear backoff to try to reconnect asap - delay_for(RECONNECTION_BACKOFF * self.reconnection_attempt).await; + sleep(RECONNECTION_BACKOFF * self.reconnection_attempt).await; let ws_stream = match connect_async(&self.metrics_address).await { Ok((ws_stream, _)) => ws_stream, diff --git a/explorer/src/websockets/server.rs b/explorer/src/websockets/server.rs index 9b66c4545a..36bf502e45 100644 --- a/explorer/src/websockets/server.rs +++ b/explorer/src/websockets/server.rs @@ -3,6 +3,7 @@ use log::*; use std::{io::Error as IoError, net::SocketAddr}; use tokio::net::{TcpListener, TcpStream}; use tokio::sync::broadcast; +use tokio_stream::wrappers::BroadcastStream; use tokio_tungstenite::accept_async; use tokio_tungstenite::tungstenite::Message; @@ -14,13 +15,13 @@ pub struct DashboardWebsocketServer { impl DashboardWebsocketServer { pub fn new(port: u16, sender: broadcast::Sender) -> DashboardWebsocketServer { let addr = format!("[::]:{}", port); - DashboardWebsocketServer { addr, sender } + DashboardWebsocketServer { sender, addr } } pub async fn start(self) -> Result<(), IoError> { let try_socket = TcpListener::bind(&self.addr).await; - let mut listener = try_socket?; + let listener = try_socket?; info!("starting to listen on {}", self.addr); while let Ok((stream, addr)) = listener.accept().await { tokio::spawn(Self::handle_connection( @@ -36,7 +37,7 @@ impl DashboardWebsocketServer { async fn handle_connection( stream: TcpStream, addr: SocketAddr, - mut receiver: broadcast::Receiver, + receiver: broadcast::Receiver, ) { let mut ws_stream = match accept_async(stream).await { Ok(ws_stream) => ws_stream, @@ -50,7 +51,8 @@ impl DashboardWebsocketServer { }; info!("client connected from {}", addr); - while let Some(message) = receiver.next().await { + let mut broadcast_stream = BroadcastStream::new(receiver); + while let Some(message) = broadcast_stream.next().await { let message = message.expect("the websocket broadcaster is dead!"); if let Err(err) = ws_stream.send(message).await { warn!( diff --git a/gateway/Cargo.toml b/gateway/Cargo.toml index acb53efccd..0686dc4fd9 100644 --- a/gateway/Cargo.toml +++ b/gateway/Cargo.toml @@ -11,19 +11,20 @@ edition = "2018" [dependencies] clap = "2.33.0" -dirs = "2.0.2" +dirs = "3.0" dashmap = "4.0" dotenv = "0.15.0" futures = "0.3" humantime-serde = "1.0.1" log = "0.4" -pretty_env_logger = "0.3" +pretty_env_logger = "0.4" rand = "0.7" serde = { version = "1.0.104", features = ["derive"] } -sled = "0.31" -tokio = { version = "0.2", features = ["full"] } -tokio-util = { version = "0.3.1", features = ["codec"] } -tokio-tungstenite = "0.11" +sled = "0.34" +tokio = { version = "1.4", features = [ "rt-multi-thread", "net", "signal", "fs" ] } +tokio-util = { version = "0.6", features = [ "codec" ] } +tokio-stream = { version = "0.1", features = [ "fs" ] } +tokio-tungstenite = "0.14" # internal config = { path = "../common/config" } @@ -35,7 +36,3 @@ nymsphinx = { path = "../common/nymsphinx" } pemstore = { path = "../common/pemstore" } validator-client-rest = { path = "../common/client-libs/validator-client-rest" } version-checker = { path = "../common/version-checker" } - -[dependencies.tungstenite] -version = "0.11" -default-features = false diff --git a/gateway/gateway-requests/Cargo.toml b/gateway/gateway-requests/Cargo.toml index 72ce311a6c..bf8d0ba1c5 100644 --- a/gateway/gateway-requests/Cargo.toml +++ b/gateway/gateway-requests/Cargo.toml @@ -22,7 +22,7 @@ crypto = { path = "../../common/crypto" } pemstore = { path = "../../common/pemstore" } [dependencies.tungstenite] -version = "0.11" +version = "0.13" default-features = false diff --git a/gateway/src/node/client_handling/websocket/connection_handler.rs b/gateway/src/node/client_handling/websocket/connection_handler.rs index ac3a1f8717..caa26a06b1 100644 --- a/gateway/src/node/client_handling/websocket/connection_handler.rs +++ b/gateway/src/node/client_handling/websocket/connection_handler.rs @@ -10,7 +10,7 @@ use crate::node::client_handling::websocket::message_receiver::{ use crypto::asymmetric::identity; use futures::{ channel::{mpsc, oneshot}, - SinkExt, + SinkExt, StreamExt, }; use gateway_requests::authentication::encrypted_address::EncryptedAddressBytes; use gateway_requests::authentication::iv::AuthenticationIV; @@ -24,7 +24,7 @@ use nymsphinx::DestinationAddressBytes; use rand::{CryptoRng, Rng}; use std::convert::TryFrom; use std::sync::Arc; -use tokio::{prelude::*, stream::StreamExt}; +use tokio::io::{AsyncRead, AsyncWrite}; use tokio_tungstenite::{ tungstenite::{protocol::Message, Error as WsError}, WebSocketStream, diff --git a/gateway/src/node/client_handling/websocket/listener.rs b/gateway/src/node/client_handling/websocket/listener.rs index 03a1d05349..492ce9bf08 100644 --- a/gateway/src/node/client_handling/websocket/listener.rs +++ b/gateway/src/node/client_handling/websocket/listener.rs @@ -30,7 +30,7 @@ impl Listener { outbound_mix_sender: MixForwardingSender, ) { info!("Starting websocket listener at {}", self.address); - let mut tcp_listener = tokio::net::TcpListener::bind(self.address) + let tcp_listener = tokio::net::TcpListener::bind(self.address) .await .expect("Failed to start websocket listener"); diff --git a/gateway/src/node/mixnet_handling/receiver/connection_handler.rs b/gateway/src/node/mixnet_handling/receiver/connection_handler.rs index 0315026b46..8975abcebe 100644 --- a/gateway/src/node/mixnet_handling/receiver/connection_handler.rs +++ b/gateway/src/node/mixnet_handling/receiver/connection_handler.rs @@ -9,6 +9,7 @@ use crate::node::mixnet_handling::receiver::packet_processing::PacketProcessor; use crate::node::storage::inboxes::{ClientStorage, StoreData}; use dashmap::DashMap; use futures::channel::oneshot; +use futures::StreamExt; use log::*; use mixnet_client::forwarder::MixForwardingSender; use mixnode_common::cached_packet_processor::processor::ProcessedFinalHop; @@ -16,11 +17,10 @@ use nymsphinx::forwarding::packet::MixPacket; use nymsphinx::framing::codec::SphinxCodec; use nymsphinx::framing::packet::FramedSphinxPacket; use nymsphinx::DestinationAddressBytes; +use std::io; use std::net::SocketAddr; use std::sync::Arc; use tokio::net::TcpStream; -use tokio::prelude::*; -use tokio::stream::StreamExt; use tokio_util::codec::Framed; pub(crate) struct ConnectionHandler { diff --git a/gateway/src/node/mixnet_handling/receiver/listener.rs b/gateway/src/node/mixnet_handling/receiver/listener.rs index 34f52953f1..f0633ea0bf 100644 --- a/gateway/src/node/mixnet_handling/receiver/listener.rs +++ b/gateway/src/node/mixnet_handling/receiver/listener.rs @@ -18,7 +18,7 @@ impl Listener { pub(crate) async fn run(&mut self, connection_handler: ConnectionHandler) { info!("Starting mixnet listener at {}", self.address); - let mut tcp_listener = tokio::net::TcpListener::bind(self.address) + let tcp_listener = tokio::net::TcpListener::bind(self.address) .await .expect("Failed to start mixnet listener"); diff --git a/gateway/src/node/mod.rs b/gateway/src/node/mod.rs index 9a11560c0e..9e6275ddfe 100644 --- a/gateway/src/node/mod.rs +++ b/gateway/src/node/mod.rs @@ -159,7 +159,7 @@ impl Gateway { pub fn run(&mut self) { info!("Starting nym gateway!"); - let mut runtime = Runtime::new().unwrap(); + let runtime = Runtime::new().unwrap(); runtime.block_on(async { if let Some(duplicate_node_key) = self.check_if_same_ip_gateway_exists().await { diff --git a/gateway/src/node/storage/inboxes.rs b/gateway/src/node/storage/inboxes.rs index 0ffad668b2..a58e46eda8 100644 --- a/gateway/src/node/storage/inboxes.rs +++ b/gateway/src/node/storage/inboxes.rs @@ -12,7 +12,8 @@ use std::path::PathBuf; use std::sync::Arc; use tokio::fs; use tokio::fs::File; -use tokio::prelude::*; +use tokio::io::AsyncWriteExt; +use tokio_stream::wrappers::ReadDirStream; fn dummy_message() -> ClientFile { ClientFile { @@ -135,8 +136,7 @@ impl ClientStorage { } let mut msgs = Vec::new(); - let mut read_dir = fs::read_dir(full_store_dir).await?; - + let mut read_dir = ReadDirStream::new(fs::read_dir(full_store_dir).await?); while let Some(dir_entry) = read_dir.next().await { if let Ok(dir_entry) = dir_entry { if !Self::is_valid_file(&dir_entry).await { diff --git a/mixnode/Cargo.toml b/mixnode/Cargo.toml index eab6af6a7b..741b4f01f6 100644 --- a/mixnode/Cargo.toml +++ b/mixnode/Cargo.toml @@ -10,19 +10,18 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -bs58 = "0.3.0" +bs58 = "0.4.0" clap = "2.33.0" -curve25519-dalek = "2.0.0" -dirs = "2.0.2" +dirs = "3.0" dotenv = "0.15.0" -futures = "0.3.1" +futures = "0.3" humantime-serde = "1.0.1" log = "0.4" -pretty_env_logger = "0.3" +pretty_env_logger = "0.4" rand = "0.7" -serde = { version = "1.0.104", features = ["derive"] } -tokio = { version = "0.2", features = ["full"] } -tokio-util = { version = "0.3.1", features = ["codec"] } +serde = { version = "1.0", features = ["derive"] } +tokio = { version = "1.4", features = [ "rt-multi-thread", "net", "signal" ] } +tokio-util = { version = "0.6", features = ["codec"] } ## internal config = { path = "../common/config" } diff --git a/mixnode/src/commands/init.rs b/mixnode/src/commands/init.rs index 2b6046231e..aee518d3b5 100644 --- a/mixnode/src/commands/init.rs +++ b/mixnode/src/commands/init.rs @@ -131,7 +131,7 @@ async fn choose_layer( pub fn execute(matches: &ArgMatches) { // TODO: this should probably be made implicit by slapping `#[tokio::main]` on our main method // and then removing runtime from mixnode itself in `run` - let mut rt = Runtime::new().unwrap(); + let rt = Runtime::new().unwrap(); rt.block_on(async { let id = matches.value_of("id").unwrap(); println!("Initialising mixnode {}...", id); diff --git a/mixnode/src/node/listener/connection_handler/mod.rs b/mixnode/src/node/listener/connection_handler/mod.rs index 8e1ade0092..1dae33ac1c 100644 --- a/mixnode/src/node/listener/connection_handler/mod.rs +++ b/mixnode/src/node/listener/connection_handler/mod.rs @@ -5,6 +5,7 @@ use crate::node::listener::connection_handler::packet_processing::{ MixProcessingResult, PacketProcessor, }; use crate::node::packet_delayforwarder::PacketDelayForwardSender; +use futures::StreamExt; use log::*; use nymsphinx::forwarding::packet::MixPacket; use nymsphinx::framing::codec::SphinxCodec; @@ -12,7 +13,6 @@ use nymsphinx::framing::packet::FramedSphinxPacket; use nymsphinx::Delay as SphinxDelay; use std::net::SocketAddr; use tokio::net::TcpStream; -use tokio::stream::StreamExt; use tokio::time::Instant; use tokio_util::codec::Framed; diff --git a/mixnode/src/node/listener/mod.rs b/mixnode/src/node/listener/mod.rs index 3fe4a121d0..60b78797bd 100644 --- a/mixnode/src/node/listener/mod.rs +++ b/mixnode/src/node/listener/mod.rs @@ -19,7 +19,7 @@ impl Listener { } async fn run(&mut self, connection_handler: ConnectionHandler) { - let mut listener = TcpListener::bind(self.address) + let listener = TcpListener::bind(self.address) .await .expect("Failed to create TCP listener"); loop { diff --git a/mixnode/src/node/metrics.rs b/mixnode/src/node/metrics.rs index f686418a1c..0f1e4c89bf 100644 --- a/mixnode/src/node/metrics.rs +++ b/mixnode/src/node/metrics.rs @@ -138,11 +138,11 @@ impl MetricsSender { { Err(err) => { error!("failed to send metrics - {:?}", err); - tokio::time::delay_for(METRICS_FAILURE_BACKOFF) + tokio::time::sleep(METRICS_FAILURE_BACKOFF) } Ok(new_interval) => { debug!("sent metrics information"); - tokio::time::delay_for(Duration::from_secs(new_interval.next_report_in)) + tokio::time::sleep(Duration::from_secs(new_interval.next_report_in)) } }; diff --git a/mixnode/src/node/mod.rs b/mixnode/src/node/mod.rs index bdbfaa6244..3c70e1c9d9 100644 --- a/mixnode/src/node/mod.rs +++ b/mixnode/src/node/mod.rs @@ -123,7 +123,7 @@ impl MixNode { pub fn run(&mut self) { info!("Starting nym mixnode"); - let mut runtime = Runtime::new().unwrap(); + let runtime = Runtime::new().unwrap(); runtime.block_on(async { if let Some(duplicate_node_key) = self.check_if_same_ip_node_exists().await { diff --git a/mixnode/src/node/packet_delayforwarder.rs b/mixnode/src/node/packet_delayforwarder.rs index bc5809f71f..002aae5615 100644 --- a/mixnode/src/node/packet_delayforwarder.rs +++ b/mixnode/src/node/packet_delayforwarder.rs @@ -3,11 +3,11 @@ use crate::node::metrics::MetricsReporter; use futures::channel::mpsc; +use futures::StreamExt; use log::*; -use nonexhaustive_delayqueue::{Expired, NonExhaustiveDelayQueue}; +use nonexhaustive_delayqueue::{Expired, NonExhaustiveDelayQueue, TimerError}; use nymsphinx::forwarding::packet::MixPacket; -use tokio::stream::StreamExt; -use tokio::time::{Duration, Error as TimeError, Instant}; +use tokio::time::{Duration, Instant}; // Delay + MixPacket vs Instant + MixPacket @@ -71,7 +71,7 @@ impl DelayForwarder { } /// Upon packet being finished getting delayed, forward it to the mixnet. - fn handle_done_delaying(&mut self, packet: Option, TimeError>>) { + fn handle_done_delaying(&mut self, packet: Option, TimerError>>) { // those are critical errors that I don't think can be recovered from. let delayed = packet.expect("the queue has unexpectedly terminated!"); let delayed_packet = delayed diff --git a/network-monitor/Cargo.toml b/network-monitor/Cargo.toml index b940a51b18..8a7aaf1a3f 100644 --- a/network-monitor/Cargo.toml +++ b/network-monitor/Cargo.toml @@ -15,11 +15,11 @@ dotenv = "0.15.0" futures = "0.3" log = "0.4" pin-project = "1.0" -pretty_env_logger = "0.3" +pretty_env_logger = "0.4" rand = "0.7" serde = "1.0" serde_json = "1.0" -tokio = { version = "0.2", features = ["signal", "rt-threaded", "macros"] } +tokio = { version = "1.4", features = ["rt-multi-thread", "macros", "signal", "time"] } ## internal crypto = { path = "../common/crypto" } diff --git a/network-monitor/src/monitor/mod.rs b/network-monitor/src/monitor/mod.rs index 8123c82f30..ff894235b4 100644 --- a/network-monitor/src/monitor/mod.rs +++ b/network-monitor/src/monitor/mod.rs @@ -8,7 +8,7 @@ use crate::monitor::summary_producer::SummaryProducer; use log::*; use std::collections::HashSet; use std::sync::Arc; -use tokio::time::{delay_for, interval_at, Duration, Instant}; +use tokio::time::{interval_at, sleep, Duration, Instant}; use validator_client::models::mixmining::BatchMixStatus; pub(crate) mod preparer; @@ -91,7 +91,7 @@ impl Monitor { debug!(target: "Monitor", "sending is over, waiting for {:?} before checking what we received", PACKET_DELIVERY_TIMEOUT); // give the packets some time to traverse the network - delay_for(PACKET_DELIVERY_TIMEOUT).await; + sleep(PACKET_DELIVERY_TIMEOUT).await; let received = self.received_processor.return_received().await; diff --git a/network-monitor/src/monitor/receiver.rs b/network-monitor/src/monitor/receiver.rs index 5064e244be..230f4e7989 100644 --- a/network-monitor/src/monitor/receiver.rs +++ b/network-monitor/src/monitor/receiver.rs @@ -5,8 +5,8 @@ use crate::gateways_reader::{GatewayChannel, GatewayMessages, GatewaysReader}; use crate::monitor::processor::ReceivedProcessorSender; use crypto::asymmetric::identity; use futures::channel::mpsc; +use futures::StreamExt; use gateway_client::{AcknowledgementReceiver, MixnetMessageReceiver}; -use tokio::stream::StreamExt; pub(crate) type GatewayClientUpdateSender = mpsc::UnboundedSender; pub(crate) type GatewayClientUpdateReceiver = mpsc::UnboundedReceiver; diff --git a/network-monitor/src/monitor/sender.rs b/network-monitor/src/monitor/sender.rs index 516a40e7be..9bb2e76cb0 100644 --- a/network-monitor/src/monitor/sender.rs +++ b/network-monitor/src/monitor/sender.rs @@ -167,7 +167,7 @@ impl PacketSender { client.batch_send_mix_packets(mix_packets).await?; } - tokio::time::delay_for(TIME_CHUNK_SIZE).await; + tokio::time::sleep(TIME_CHUNK_SIZE).await; mix_packets = retained; } diff --git a/service-providers/network-requester/Cargo.toml b/service-providers/network-requester/Cargo.toml index 5adc7caf88..2da4d40374 100644 --- a/service-providers/network-requester/Cargo.toml +++ b/service-providers/network-requester/Cargo.toml @@ -11,12 +11,12 @@ edition = "2018" [dependencies] clap = "2.33.0" -dirs = "2.0.2" +dirs = "3.0" futures = "0.3" log = "0.4" -pretty_env_logger = "0.3" -tokio = { version = "0.2", features = ["stream", "tcp", "rt-threaded", "macros"] } -tokio-tungstenite = "0.11.0" +pretty_env_logger = "0.4" +tokio = { version = "1.4", features = [ "net", "rt-multi-thread", "macros" ] } +tokio-tungstenite = "0.14" publicsuffix = "1.5" ipnetwork = "0.17" diff --git a/service-providers/network-requester/src/allowed_hosts.rs b/service-providers/network-requester/src/allowed_hosts.rs index c0717e6c3f..3026b4eebb 100644 --- a/service-providers/network-requester/src/allowed_hosts.rs +++ b/service-providers/network-requester/src/allowed_hosts.rs @@ -48,8 +48,8 @@ impl OutboundRequestFilter { } } - fn fetch_domain_list() -> Result { - Ok(publicsuffix::List::fetch()?) + fn fetch_domain_list() -> Result { + publicsuffix::List::fetch() } /// Returns `true` if a host's root domain is in the `allowed_hosts` list. diff --git a/service-providers/network-requester/src/connection.rs b/service-providers/network-requester/src/connection.rs index 268a68c549..ee3aff024e 100644 --- a/service-providers/network-requester/src/connection.rs +++ b/service-providers/network-requester/src/connection.rs @@ -6,8 +6,8 @@ use nymsphinx::addressing::clients::Recipient; use proxy_helpers::connection_controller::ConnectionReceiver; use proxy_helpers::proxy_runner::ProxyRunner; use socks5_requests::{ConnectionId, RemoteAddress, Response}; +use std::io; use tokio::net::TcpStream; -use tokio::prelude::*; /// A TCP connection between the Socks5 service provider, which makes /// outbound requests on behalf of users and returns the responses through diff --git a/service-providers/network-requester/src/core.rs b/service-providers/network-requester/src/core.rs index d110f1663f..544da86395 100644 --- a/service-providers/network-requester/src/core.rs +++ b/service-providers/network-requester/src/core.rs @@ -4,6 +4,7 @@ use crate::allowed_hosts::{HostsStore, OutboundRequestFilter}; use crate::connection::Connection; use crate::websocket; +use crate::websocket::TSWebsocketStream; use futures::channel::mpsc; use futures::stream::{SplitSink, SplitStream}; use futures::{SinkExt, StreamExt}; @@ -14,9 +15,7 @@ use proxy_helpers::connection_controller::{Controller, ControllerCommand, Contro use socks5_requests::{ConnectionId, Request, Response}; use std::path::PathBuf; use std::sync::atomic::{AtomicUsize, Ordering}; -use tokio::net::TcpStream; use tokio_tungstenite::tungstenite::protocol::Message; -use tokio_tungstenite::WebSocketStream; use websocket::WebsocketConnectionError; use websocket_requests::{requests::ClientRequest, responses::ServerResponse}; @@ -51,7 +50,7 @@ impl ServiceProvider { /// Listens for any messages from `mix_reader` that should be written back to the mix network /// via the `websocket_writer`. async fn mixnet_response_listener( - mut websocket_writer: SplitSink, Message>, + mut websocket_writer: SplitSink, mut mix_reader: mpsc::UnboundedReceiver<(Response, Recipient)>, ) { // TODO: wire SURBs in here once they're available @@ -69,7 +68,7 @@ impl ServiceProvider { } async fn read_websocket_message( - websocket_reader: &mut SplitStream>, + websocket_reader: &mut SplitStream, ) -> Option { while let Some(msg) = websocket_reader.next().await { let data = msg @@ -270,7 +269,7 @@ impl ServiceProvider { } // Make the websocket connection so we can receive incoming Mixnet messages. - async fn connect_websocket(&self, uri: &str) -> WebSocketStream { + async fn connect_websocket(&self, uri: &str) -> TSWebsocketStream { let ws_stream = match websocket::Connection::new(uri).connect().await { Ok(ws_stream) => { info!("* connected to local websocket server at {}", uri); diff --git a/service-providers/network-requester/src/websocket.rs b/service-providers/network-requester/src/websocket.rs index 258899d41e..9d241d9888 100644 --- a/service-providers/network-requester/src/websocket.rs +++ b/service-providers/network-requester/src/websocket.rs @@ -2,8 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 use tokio::net::TcpStream; -use tokio_tungstenite::connect_async; use tokio_tungstenite::WebSocketStream; +use tokio_tungstenite::{connect_async, MaybeTlsStream}; + +#[allow(clippy::upper_case_acronyms)] +pub(crate) type TSWebsocketStream = WebSocketStream>; pub struct Connection { uri: String, @@ -16,7 +19,7 @@ impl Connection { } } - pub async fn connect(&self) -> Result, WebsocketConnectionError> { + pub async fn connect(&self) -> Result { match connect_async(&self.uri).await { Ok((ws_stream, _)) => Ok(ws_stream), Err(_e) => Err(WebsocketConnectionError::ConnectionNotEstablished),