From 6cd228fadaa5e91b758d61f7f869a2a1b33e7356 Mon Sep 17 00:00:00 2001 From: binarybaron <86064887+binarybaron@users.noreply.github.com> Date: Thu, 21 Nov 2024 01:00:36 +0100 Subject: [PATCH] feat(swap): Use `art_client` to dial over Tor (#196) - Upgrade `sqlx` to `0.8` - Use `arti_client@0.24` in combination with [`libp2p-community-tor`](https://crates.io/crates/libp2p-community-tor/0.4.1). https://github.com/umgefahren/libp2p-tor/pull/18 was required for this. - Display spinner in GUI while Tor circuits are being established - Remove unused dependencies (`once_cell`, `tauri-plugin-devtools`, `digest`, `hyper`, `itertools`, `erased_serde`) - Bundle roboto font from npm registry --- CHANGELOG.md | 2 + Cargo.lock | 2703 ++++++++++++++--- src-gui/index.html | 63 +- src-gui/package.json | 3 +- src-gui/src/models/cliModel.ts | 1 + src-gui/src/renderer/components/App.tsx | 1 + .../components/alert/DaemonStatusAlert.tsx | 6 + .../components/other/RenderedCliLog.tsx | 5 +- src-gui/yarn.lock | 5 + src-tauri/Cargo.toml | 2 - src-tauri/src/lib.rs | 1 + ...c946bc4d37d50f40670b4f51d2efcce595aa6.json | 20 + ...d9ae92227d057386921e0e57165b887de3c75.json | 12 + ...3cad023c30705d5b41a1399ef79d8d2571d7c.json | 20 + ...b501749f907f7c422945a8bdda2b6274f5225.json | 12 + ...a50f51073d36257d49768de99ff863e3511e0.json | 12 + ...d9431ee68360941f341386cbacf44ea598de8.json | 26 + ...b1c0a27b2a45656549b23076d7542cfa21ecf.json | 20 + ...a22e7fdc6b925de211f7784782f051c2dcd8c.json | 20 + ...7a8e5014bdc694c36a14053ef3bb2fc0c69b0.json | 12 + ...c5401e2122077365e5e5a19408c068c7f9454.json | 20 + ...aa665aae3c6f1e312ee444e65df1c95afe8b2.json | 20 + ...03323a8cf258cbebb2834e3f7cf8f812fa646.json | 20 + ...b59cced041406a9db71da827b09f0d3bacfd6.json | 12 + ...35821da948bd86cc57798b4d8375baf0b51ae.json | 20 + swap/Cargo.toml | 15 +- swap/src/cli.rs | 3 +- swap/src/cli/api.rs | 47 +- swap/src/cli/api/request.rs | 14 +- swap/src/cli/api/tauri_bindings.rs | 1 + swap/src/cli/command.rs | 22 +- swap/src/cli/list_sellers.rs | 7 +- swap/src/cli/tor.rs | 30 + swap/src/cli/transport.rs | 15 +- swap/src/common/tracing_util.rs | 8 +- swap/src/database/sqlite.rs | 76 +- swap/src/monero/wallet_rpc.rs | 7 +- swap/src/network.rs | 1 - swap/src/network/swarm.rs | 14 +- swap/src/network/tor_transport.rs | 258 -- swap/tests/harness/mod.rs | 4 +- 41 files changed, 2689 insertions(+), 871 deletions(-) create mode 100644 swap/.sqlx/query-081c729a0f1ad6e4ff3e13d6702c946bc4d37d50f40670b4f51d2efcce595aa6.json create mode 100644 swap/.sqlx/query-0ab84c094964968e96a3f2bf590d9ae92227d057386921e0e57165b887de3c75.json create mode 100644 swap/.sqlx/query-0d465a17ebbb5761421def759c73cad023c30705d5b41a1399ef79d8d2571d7c.json create mode 100644 swap/.sqlx/query-2a356078a41b321234adf2aa385b501749f907f7c422945a8bdda2b6274f5225.json create mode 100644 swap/.sqlx/query-50a5764546f69c118fa0b64120da50f51073d36257d49768de99ff863e3511e0.json create mode 100644 swap/.sqlx/query-5cc61dd0315571bc198401a354cd9431ee68360941f341386cbacf44ea598de8.json create mode 100644 swap/.sqlx/query-88f761a4f7a0429cad1df0b1bebb1c0a27b2a45656549b23076d7542cfa21ecf.json create mode 100644 swap/.sqlx/query-98a8b7f4971e0eb4ab8f5aa688aa22e7fdc6b925de211f7784782f051c2dcd8c.json create mode 100644 swap/.sqlx/query-b703032b4ddc627a1124817477e7a8e5014bdc694c36a14053ef3bb2fc0c69b0.json create mode 100644 swap/.sqlx/query-ce270dd4a4b9615695a79864240c5401e2122077365e5e5a19408c068c7f9454.json create mode 100644 swap/.sqlx/query-d78acba5eb8563826dd190e0886aa665aae3c6f1e312ee444e65df1c95afe8b2.json create mode 100644 swap/.sqlx/query-e05620f420f8c1022971eeb66a803323a8cf258cbebb2834e3f7cf8f812fa646.json create mode 100644 swap/.sqlx/query-e36c287aa98ae80ad4b6bb6f7e4b59cced041406a9db71da827b09f0d3bacfd6.json create mode 100644 swap/.sqlx/query-e9d422daf774d099fcbde6c4cda35821da948bd86cc57798b4d8375baf0b51ae.json create mode 100644 swap/src/cli/tor.rs delete mode 100644 swap/src/network/tor_transport.rs diff --git a/CHANGELOG.md b/CHANGELOG.md index 0480c6ec..6701d821 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +- CLI + GUI: Tor is now bundled with the application. All libp2p connections between peers are routed through Tor, if the `--enable-tor` flag is set. The `--tor-socks5-port` argument has been removed. This feature is powered by [arti](https://tpo.pages.torproject.net/core/arti/), an implementation of the Tor protocol in Rust by the Tor Project. + ## [1.0.0-rc.5] - 2024-11-19 - GUI: Set new Discord invite link to non-expired one diff --git a/Cargo.lock b/Cargo.lock index a1bbb98a..9e6e904d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -36,6 +36,7 @@ dependencies = [ "cfg-if", "cipher", "cpufeatures", + "zeroize", ] [[package]] @@ -105,6 +106,50 @@ version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "45862d1c77f2228b9e10bc609d5bc203d86ebc9b87ad8d5d5167a6c9abf739d9" +[[package]] +name = "amplify" +version = "4.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "448cf0c3afc71439b5f837aac5399a1ef2b223f5f38324dbfb4343deec3b80cc" +dependencies = [ + "amplify_derive", + "amplify_num", + "ascii", + "wasm-bindgen", +] + +[[package]] +name = "amplify_derive" +version = "4.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a6309e6b8d89b36b9f959b7a8fa093583b94922a0f6438a24fb08936de4d428" +dependencies = [ + "amplify_syn", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "amplify_num" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99bcb75a2982047f733547042fc3968c0f460dfcf7d90b90dea3b2744580e9ad" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "amplify_syn" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7736fb8d473c0d83098b5bac44df6a561e20470375cd8bcae30516dc889fd62a" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "android-tzdata" version = "0.1.1" @@ -224,13 +269,63 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] -name = "asn1-rs" -version = "0.6.2" +name = "arti-client" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5493c3bedbacf7fd7382c6346bbd66687d12bbaad3a89a2d2c303ee6cf20b048" +checksum = "57064cebe248bf9c0e1df2cce40926cfd9c8cad9c3103c53c594c6c5f7794d8b" dependencies = [ - "asn1-rs-derive", - "asn1-rs-impl", + "async-trait", + "cfg-if", + "derive-deftly", + "derive_builder_fork_arti", + "derive_more 1.0.0", + "educe", + "fs-mistrust", + "futures", + "hostname-validator", + "humantime", + "humantime-serde", + "libc", + "postage", + "rand 0.8.5", + "safelog", + "serde", + "thiserror 1.0.69", + "tor-async-utils", + "tor-basic-utils", + "tor-chanmgr", + "tor-circmgr", + "tor-config", + "tor-dirmgr", + "tor-error", + "tor-guardmgr", + "tor-keymgr", + "tor-linkspec", + "tor-llcrypto", + "tor-memquota", + "tor-netdir", + "tor-netdoc", + "tor-persist", + "tor-proto", + "tor-rtcompat", + "tracing", + "void", +] + +[[package]] +name = "ascii" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d92bec98840b8f03a5ff5413de5293bfcd8bf96467cf5452609f939ec6f5de16" + +[[package]] +name = "asn1-rs" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6fd5ddaf0351dff5b8da21b2fb4ff8e08ddd02857f0bf69c47639106c0fff0" +dependencies = [ + "asn1-rs-derive 0.4.0", + "asn1-rs-impl 0.1.0", "displaydoc", "nom", "num-traits", @@ -239,6 +334,34 @@ dependencies = [ "time 0.3.36", ] +[[package]] +name = "asn1-rs" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5493c3bedbacf7fd7382c6346bbd66687d12bbaad3a89a2d2c303ee6cf20b048" +dependencies = [ + "asn1-rs-derive 0.5.1", + "asn1-rs-impl 0.2.0", + "displaydoc", + "nom", + "num-traits", + "rusticata-macros", + "thiserror 1.0.69", + "time 0.3.36", +] + +[[package]] +name = "asn1-rs-derive" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "synstructure 0.12.6", +] + [[package]] name = "asn1-rs-derive" version = "0.5.1" @@ -248,7 +371,18 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.87", - "synstructure", + "synstructure 0.13.1", +] + +[[package]] +name = "asn1-rs-impl" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] @@ -317,6 +451,19 @@ dependencies = [ "tokio", ] +[[package]] +name = "async-compression" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cb8f1d480b0ea3783ab015936d2a55c87e219676f0c0b7dec61494043f21857" +dependencies = [ + "flate2", + "futures-core", + "futures-io", + "memchr", + "pin-project-lite", +] + [[package]] name = "async-executor" version = "1.13.1" @@ -428,28 +575,6 @@ dependencies = [ "windows-sys 0.59.0", ] -[[package]] -name = "async-stream" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" -dependencies = [ - "async-stream-impl", - "futures-core", - "pin-project-lite", -] - -[[package]] -name = "async-stream-impl" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", -] - [[package]] name = "async-task" version = "4.7.1" @@ -467,6 +592,21 @@ dependencies = [ "syn 2.0.87", ] +[[package]] +name = "async_executors" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a982d2f86de6137cc05c9db9a915a19886c97911f9790d04f174cede74be01a5" +dependencies = [ + "blanket", + "futures-core", + "futures-task", + "futures-util", + "pin-project", + "rustc_version", + "tokio", +] + [[package]] name = "asynchronous-codec" version = "0.6.2" @@ -518,13 +658,28 @@ dependencies = [ [[package]] name = "atoi" -version = "1.0.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7c57d12312ff59c811c0643f4d80830505833c9ffaebd193d819392b265be8e" +checksum = "f28d99ec8bfea296261ca1af174f24225171fea9664ba9003cbebee704810528" dependencies = [ "num-traits", ] +[[package]] +name = "atomic" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59bdb34bc650a32731b31bd8f0829cc15d24a708ee31559e0bb34f2bc320cba" + +[[package]] +name = "atomic" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d818003e740b63afc82337e3160717f4f63078720a810b7b903e70a5d1d2994" +dependencies = [ + "bytemuck", +] + [[package]] name = "atomic-waker" version = "1.1.2" @@ -559,51 +714,6 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" -[[package]] -name = "axum" -version = "0.6.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" -dependencies = [ - "async-trait", - "axum-core", - "bitflags 1.3.2", - "bytes", - "futures-util", - "http 0.2.12", - "http-body 0.4.6", - "hyper 0.14.31", - "itoa 1.0.11", - "matchit", - "memchr", - "mime", - "percent-encoding", - "pin-project-lite", - "rustversion", - "serde", - "sync_wrapper 0.1.2", - "tower", - "tower-layer", - "tower-service", -] - -[[package]] -name = "axum-core" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" -dependencies = [ - "async-trait", - "bytes", - "futures-util", - "http 0.2.12", - "http-body 0.4.6", - "mime", - "rustversion", - "tower-layer", - "tower-service", -] - [[package]] name = "backoff" version = "0.4.0" @@ -639,6 +749,12 @@ version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + [[package]] name = "base32" version = "0.4.0" @@ -879,6 +995,17 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "blanket" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0b121a9fe0df916e362fb3271088d071159cdf11db0e4182d02152850756eff" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "block" version = "0.1.6" @@ -969,13 +1096,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf4918709cc4dd777ad2b6303ed03cb37f3ca0ccede8c1b0d28ac6db8f4710e0" dependencies = [ "once_cell", - "proc-macro-crate 2.0.2", + "proc-macro-crate 2.0.0", "proc-macro2", "quote", "syn 2.0.87", "syn_derive", ] +[[package]] +name = "bounded-vec-deque" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2225b558afc76c596898f5f1b3fc35cfce0eb1b13635cbd7d1b2a7177dc10ccd" + [[package]] name = "brotli" version = "3.5.0" @@ -1034,6 +1167,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a68f1f47cdf0ec8ee4b941b2eee2a80cb796db73118c0dd09ac63fbe405be22" dependencies = [ "memchr", + "regex-automata 0.4.9", "serde", ] @@ -1043,6 +1177,12 @@ version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +[[package]] +name = "by_address" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64fa3c856b712db6612c019f14756e64e4bcea13337a6b33b696333a9eaa2d06" + [[package]] name = "bytecheck" version = "0.6.12" @@ -1147,6 +1287,12 @@ dependencies = [ "serde", ] +[[package]] +name = "caret" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1df55dc0c84d5a555c4b8b84ecf3cff724df77a7b1a8c4a70cd66a981524cff0" + [[package]] name = "cargo-platform" version = "0.1.8" @@ -1177,7 +1323,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a969e13a7589e9e3e4207e153bae624ade2b5622fb4684a4923b23ec3d57719" dependencies = [ "serde", - "toml 0.8.2", + "toml 0.8.19", ] [[package]] @@ -1346,6 +1492,17 @@ dependencies = [ "error-code", ] +[[package]] +name = "coarsetime" +version = "0.1.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13b3839cf01bb7960114be3ccf2340f541b6d0c81f8690b007b2b39f750f7e5d" +dependencies = [ + "libc", + "wasix", + "wasm-bindgen", +] + [[package]] name = "cocoa" version = "0.26.0" @@ -1432,7 +1589,7 @@ dependencies = [ "nom", "pathdiff", "serde", - "toml 0.8.2", + "toml 0.8.19", ] [[package]] @@ -1475,6 +1632,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" +[[package]] +name = "convert_case" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" +dependencies = [ + "unicode-segmentation", +] + [[package]] name = "cookie" version = "0.18.1" @@ -1485,6 +1651,15 @@ dependencies = [ "version_check", ] +[[package]] +name = "cookie-factory" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9885fa71e26b8ab7855e2ec7cae6e9b380edff76cd052e07c683a0319d51b3a2" +dependencies = [ + "futures", +] + [[package]] name = "core-foundation" version = "0.9.4" @@ -1672,6 +1847,18 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array", + "rand_core 0.6.4", + "subtle", + "zeroize", +] + [[package]] name = "crypto-common" version = "0.1.6" @@ -1803,6 +1990,16 @@ dependencies = [ "darling_macro 0.13.4", ] +[[package]] +name = "darling" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" +dependencies = [ + "darling_core 0.14.4", + "darling_macro 0.14.4", +] + [[package]] name = "darling" version = "0.20.10" @@ -1827,6 +2024,20 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "darling_core" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim 0.10.0", + "syn 1.0.109", +] + [[package]] name = "darling_core" version = "0.20.10" @@ -1852,6 +2063,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "darling_macro" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" +dependencies = [ + "darling_core 0.14.4", + "quote", + "syn 1.0.109", +] + [[package]] name = "darling_macro" version = "0.20.10" @@ -1896,16 +2118,32 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ "const-oid", + "pem-rfc7468", "zeroize", ] +[[package]] +name = "der-parser" +version = "8.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbd676fbbab537128ef0278adb5576cf363cff6aa22a7b24effe97347cfab61e" +dependencies = [ + "asn1-rs 0.5.2", + "displaydoc", + "nom", + "num-bigint", + "num-traits", + "rusticata-macros", +] + [[package]] name = "der-parser" version = "9.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5cd0a5c643689626bec213c4d8bd4d96acc8ffdb4ad4bb6bc16abf27d5f4b553" dependencies = [ - "asn1-rs", + "asn1-rs 0.6.2", + "cookie-factory", "displaydoc", "nom", "num-bigint", @@ -1934,6 +2172,34 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "derive-deftly" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72f9bc3564f74be6c35d49a7efee54380d7946ccc631323067f33fabb9246027" +dependencies = [ + "derive-deftly-macros", + "heck 0.5.0", +] + +[[package]] +name = "derive-deftly-macros" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1b84d32b18d9a256d81e4fec2e4cfd0ab6dde5e5ff49be1713ae0adbd0060c2" +dependencies = [ + "heck 0.5.0", + "indexmap 2.6.0", + "itertools", + "proc-macro-crate 2.0.0", + "proc-macro2", + "quote", + "sha3 0.10.8", + "strum", + "syn 2.0.87", + "void", +] + [[package]] name = "derive_arbitrary" version = "1.4.1" @@ -1945,13 +2211,44 @@ dependencies = [ "syn 2.0.87", ] +[[package]] +name = "derive_builder_core_fork_arti" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24c1b715c79be6328caa9a5e1a387a196ea503740f0722ec3dd8f67a9e72314d" +dependencies = [ + "darling 0.14.4", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_builder_fork_arti" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3eae24d595f4d0ecc90a9a5a6d11c2bd8dafe2375ec4a1ec63250e5ade7d228" +dependencies = [ + "derive_builder_macro_fork_arti", +] + +[[package]] +name = "derive_builder_macro_fork_arti" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69887769a2489cd946bf782eb2b1bb2cb7bc88551440c94a765d4f040c08ebf3" +dependencies = [ + "derive_builder_core_fork_arti", + "syn 1.0.109", +] + [[package]] name = "derive_more" version = "0.99.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ - "convert_case", + "convert_case 0.4.0", "proc-macro2", "quote", "rustc_version", @@ -1959,45 +2256,25 @@ dependencies = [ ] [[package]] -name = "devtools-core" -version = "0.3.5" +name = "derive_more" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78cdd51f6f62ad4eb9b6581d7e238e1779db3144ddbd711388f552e6ed3194b" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" dependencies = [ - "async-stream", - "bytes", - "devtools-wire-format", - "futures", - "http 0.2.12", - "hyper 0.14.31", - "log", - "prost-types", - "ringbuf", - "thiserror 1.0.69", - "tokio", - "tokio-stream", - "tonic", - "tonic-health", - "tonic-web", - "tower", - "tower-http 0.4.4", - "tower-layer", - "tracing", - "tracing-core", - "tracing-subscriber", + "derive_more-impl", ] [[package]] -name = "devtools-wire-format" -version = "0.5.2" +name = "derive_more-impl" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1c0de542960449c9566001c1879d10ede95f3f2e0013fdae0cc3b153bfabb0d" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ - "bitflags 2.6.0", - "prost", - "prost-types", - "tonic", - "tracing-core", + "convert_case 0.6.0", + "proc-macro2", + "quote", + "syn 2.0.87", + "unicode-xid", ] [[package]] @@ -2029,10 +2306,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer 0.10.4", + "const-oid", "crypto-common", "subtle", ] +[[package]] +name = "directories" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a49173b84e034382284f27f1af4dcbbd231ffa358c0fe316541a7337f376a35" +dependencies = [ + "dirs-sys", +] + [[package]] name = "directories-next" version = "2.0.0" @@ -2121,6 +2408,12 @@ version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" +[[package]] +name = "downcast-rs" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" + [[package]] name = "dpi" version = "0.1.1" @@ -2157,6 +2450,20 @@ version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +dependencies = [ + "der", + "digest 0.10.7", + "elliptic-curve", + "rfc6979", + "signature 2.2.0", + "spki", +] + [[package]] name = "ecdsa_fun" version = "0.10.0" @@ -2210,6 +2517,7 @@ checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" dependencies = [ "curve25519-dalek 4.1.3", "ed25519 2.2.3", + "merlin", "rand_core 0.6.4", "serde", "sha2 0.10.8", @@ -2217,6 +2525,18 @@ dependencies = [ "zeroize", ] +[[package]] +name = "educe" +version = "0.4.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f0042ff8246a363dbe77d2ceedb073339e85a804b9a47636c6e016a9a32c05f" +dependencies = [ + "enum-ordinalize", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "either" version = "1.13.0" @@ -2244,6 +2564,25 @@ dependencies = [ "winapi", ] +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest 0.10.7", + "ff", + "generic-array", + "group", + "pkcs8", + "rand_core 0.6.4", + "sec1", + "subtle", + "zeroize", +] + [[package]] name = "embed-resource" version = "2.5.1" @@ -2253,7 +2592,7 @@ dependencies = [ "cc", "memchr", "rustc_version", - "toml 0.8.2", + "toml 0.8.19", "vswhom", "winreg 0.52.0", ] @@ -2297,6 +2636,19 @@ dependencies = [ "syn 2.0.87", ] +[[package]] +name = "enum-ordinalize" +version = "3.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bf1fa3f06bbff1ea5b1a9c7b14aa992a39657db60a2759457328d7e058f49ee" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "enumflags2" version = "0.7.10" @@ -2350,6 +2702,17 @@ version = "3.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a5d9305ccc6942a704f4335694ecd3de2ea531b114ac2d51f5f843750787a92f" +[[package]] +name = "etcetera" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "136d1b5283a1ab77bd9257427ffd09d8667ced0570b6f938942bc7568ed5b943" +dependencies = [ + "cfg-if", + "home", + "windows-sys 0.48.0", +] + [[package]] name = "event-listener" version = "2.5.3" @@ -2377,6 +2740,18 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "fallible-iterator" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" + +[[package]] +name = "fallible-streaming-iterator" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" + [[package]] name = "fastrand" version = "2.2.0" @@ -2392,6 +2767,16 @@ dependencies = [ "simd-adler32", ] +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "fiat-crypto" version = "0.2.9" @@ -2408,6 +2793,19 @@ dependencies = [ "rustc_version", ] +[[package]] +name = "figment" +version = "0.10.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cb01cd46b0cf372153850f4c6c272d9cbea2da513e07538405148f95bd789f3" +dependencies = [ + "atomic 0.6.0", + "serde", + "toml 0.8.19", + "uncased", + "version_check", +] + [[package]] name = "filetime" version = "0.2.25" @@ -2443,14 +2841,19 @@ dependencies = [ ] [[package]] -name = "flume" -version = "0.10.14" +name = "fluid-let" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1657b4441c3403d9f7b3409e47575237dac27b1b5726df654a6ecbf92f0f7577" +checksum = "749cff877dc1af878a0b31a41dd221a753634401ea0ef2f87b62d3171522485a" + +[[package]] +name = "flume" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da0e4dd2a88388a1f4ccc7c9ce104604dab68d9f408dc34cd45823d5a9069095" dependencies = [ "futures-core", "futures-sink", - "pin-project", "spin 0.9.8", ] @@ -2502,6 +2905,22 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "fs-mistrust" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a12a327e6e1ee5595f66105852c644a2d65dfbc62c30c90f53a2783d270002de" +dependencies = [ + "derive_builder_fork_arti", + "dirs", + "libc", + "once_cell", + "pwd-grp", + "serde", + "thiserror 1.0.69", + "walkdir", +] + [[package]] name = "fs2" version = "0.4.3" @@ -2512,6 +2931,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "fslock" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04412b8935272e3a9bae6f48c7bfff74c2911f60525404edfdd28e49884c3bfb" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "funty" version = "2.0.0" @@ -2583,13 +3012,13 @@ dependencies = [ [[package]] name = "futures-intrusive" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a604f7a68fbf8103337523b1fadc8ade7361ee3f112f7c680ad179651616aed5" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" dependencies = [ "futures-core", "lock_api", - "parking_lot 0.11.2", + "parking_lot 0.12.3", ] [[package]] @@ -2622,6 +3051,16 @@ dependencies = [ "syn 2.0.87", ] +[[package]] +name = "futures-rustls" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35bd3cf68c183738046838e300353e4716c674dc5e56890de4826801a6622a28" +dependencies = [ + "futures-io", + "rustls 0.21.12", +] + [[package]] name = "futures-rustls" version = "0.26.0" @@ -2797,6 +3236,7 @@ dependencies = [ "serde", "typenum", "version_check", + "zeroize", ] [[package]] @@ -2930,7 +3370,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bb0228f477c0900c880fd78c8759b95c7636dbd7842707f49e132378aa2acdc" dependencies = [ "heck 0.4.1", - "proc-macro-crate 2.0.2", + "proc-macro-crate 2.0.0", "proc-macro-error", "proc-macro2", "quote", @@ -2953,6 +3393,12 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +[[package]] +name = "glob-match" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9985c9503b412198aa4197559e9a318524ebc4519c229bfa05a535828c950b9d" + [[package]] name = "globset" version = "0.4.15" @@ -2977,6 +3423,17 @@ dependencies = [ "system-deps", ] +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "gtk" version = "0.18.1" @@ -3105,9 +3562,9 @@ dependencies = [ [[package]] name = "hashlink" -version = "0.8.4" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" +checksum = "6ba4ff7128dee98c7dc9794b6a411377e1404dba1c97deb8d1a55297bd25d8af" dependencies = [ "hashbrown 0.14.5", ] @@ -3136,9 +3593,6 @@ name = "heck" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" -dependencies = [ - "unicode-segmentation", -] [[package]] name = "heck" @@ -3265,6 +3719,15 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys 0.52.0", +] + [[package]] name = "hostname" version = "0.3.1" @@ -3276,6 +3739,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "hostname-validator" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f558a64ac9af88b5ba400d99b579451af0d39c6d360980045b91aac966d705e2" + [[package]] name = "html5ever" version = "0.26.0" @@ -3364,6 +3833,22 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "humantime-serde" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57a3db5ea5923d99402c94e9feb261dc5ee9b4efa158b0315f788cf549cc200c" +dependencies = [ + "humantime", + "serde", +] + [[package]] name = "hyper" version = "0.14.31" @@ -3427,18 +3912,6 @@ dependencies = [ "webpki-roots 0.26.6", ] -[[package]] -name = "hyper-timeout" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" -dependencies = [ - "hyper 0.14.31", - "pin-project-lite", - "tokio", - "tokio-io-timeout", -] - [[package]] name = "hyper-util" version = "0.1.10" @@ -3738,6 +4211,26 @@ dependencies = [ "cfb", ] +[[package]] +name = "inotify" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdd168d97690d0b8c412d6b6c10360277f4d7ee495c5d0d5d5fe0854923255cc" +dependencies = [ + "bitflags 1.3.2", + "inotify-sys", + "libc", +] + +[[package]] +name = "inotify-sys" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb" +dependencies = [ + "libc", +] + [[package]] name = "inout" version = "0.1.3" @@ -3756,6 +4249,12 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "inventory" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f958d3d68f4167080a18141e10381e7634563984a537f2a49a30fd8e53ac5767" + [[package]] name = "ipconfig" version = "0.3.2" @@ -3808,15 +4307,6 @@ version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" -[[package]] -name = "itertools" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.13.0" @@ -4101,6 +4591,26 @@ dependencies = [ "unicode-segmentation", ] +[[package]] +name = "kqueue" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7447f1ca1b7b563588a205fe93dea8df60fd981423a768bc1c0ded35ed147d0c" +dependencies = [ + "kqueue-sys", + "libc", +] + +[[package]] +name = "kqueue-sys" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed9625ffda8729b85e45cf04090035ac368927b8cebc34898e7c120f52e4838b" +dependencies = [ + "bitflags 1.3.2", + "libc", +] + [[package]] name = "kuchikiki" version = "0.8.2" @@ -4119,6 +4629,9 @@ name = "lazy_static" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +dependencies = [ + "spin 0.9.8", +] [[package]] name = "libappindicator" @@ -4207,6 +4720,7 @@ dependencies = [ "libp2p-request-response", "libp2p-swarm", "libp2p-tcp", + "libp2p-tls 0.3.0", "libp2p-upnp", "libp2p-yamux", "multiaddr", @@ -4227,6 +4741,19 @@ dependencies = [ "void", ] +[[package]] +name = "libp2p-community-tor" +version = "0.4.1" +source = "git+https://github.com/UnstoppableSwap/libp2p-tor?branch=main#b7e67aeb551ba2e72634be33837a00428286da38" +dependencies = [ + "arti-client", + "futures", + "libp2p", + "tokio", + "tor-rtcompat", + "tracing", +] + [[package]] name = "libp2p-connection-limits" version = "0.3.1" @@ -4484,7 +5011,7 @@ dependencies = [ "if-watch", "libp2p-core", "libp2p-identity", - "libp2p-tls", + "libp2p-tls 0.4.1", "parking_lot 0.12.3", "quinn", "rand 0.8.5", @@ -4596,6 +5123,25 @@ dependencies = [ "tracing", ] +[[package]] +name = "libp2p-tls" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93ce7e3c2e7569d685d08ec795157981722ff96e9e9f9eae75df3c29d02b07a5" +dependencies = [ + "futures", + "futures-rustls 0.24.0", + "libp2p-core", + "libp2p-identity", + "rcgen", + "ring 0.16.20", + "rustls 0.21.12", + "rustls-webpki 0.101.7", + "thiserror 1.0.69", + "x509-parser 0.15.1", + "yasna", +] + [[package]] name = "libp2p-tls" version = "0.4.1" @@ -4603,7 +5149,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b7b831e55ce2aa6c354e6861a85fdd4dd0a2b97d5e276fabac0e4810a71776" dependencies = [ "futures", - "futures-rustls", + "futures-rustls 0.26.0", "libp2p-core", "libp2p-identity", "rcgen", @@ -4611,7 +5157,7 @@ dependencies = [ "rustls 0.23.16", "rustls-webpki 0.101.7", "thiserror 1.0.69", - "x509-parser", + "x509-parser 0.16.0", "yasna", ] @@ -4659,9 +5205,9 @@ dependencies = [ [[package]] name = "libsqlite3-sys" -version = "0.24.2" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "898745e570c7d0453cc1fbc4a701eb6c662ed54e8fec8b7d14be137ebeeb9d14" +checksum = "2e99fb7a497b1e3339bc746195567ed8d3e24945ecd636e3619d20b9de9e9149" dependencies = [ "cc", "pkg-config", @@ -4698,18 +5244,6 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" -[[package]] -name = "local-ip-address" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "612ed4ea9ce5acfb5d26339302528a5e1e59dfed95e9e11af3c083236ff1d15d" -dependencies = [ - "libc", - "neli", - "thiserror 1.0.69", - "windows-sys 0.48.0", -] - [[package]] name = "lock_api" version = "0.4.12" @@ -4795,10 +5329,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" [[package]] -name = "matchit" -version = "0.7.3" +name = "md-5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" +dependencies = [ + "cfg-if", + "digest 0.10.7", +] [[package]] name = "memchr" @@ -4806,6 +5344,15 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +[[package]] +name = "memmap2" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd3f7eed9d3848f8b98834af67102b720745c4ec028fcd0aa0239277e7de374f" +dependencies = [ + "libc", +] + [[package]] name = "memoffset" version = "0.9.1" @@ -4815,6 +5362,18 @@ dependencies = [ "autocfg", ] +[[package]] +name = "merlin" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" +dependencies = [ + "byteorder", + "keccak", + "rand_core 0.6.4", + "zeroize", +] + [[package]] name = "mime" version = "0.3.17" @@ -4871,6 +5430,7 @@ checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ "hermit-abi 0.3.9", "libc", + "log", "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys 0.52.0", ] @@ -5079,31 +5639,6 @@ dependencies = [ "jni-sys", ] -[[package]] -name = "neli" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1100229e06604150b3becd61a4965d5c70f3be1759544ea7274166f4be41ef43" -dependencies = [ - "byteorder", - "libc", - "log", - "neli-proc-macros", -] - -[[package]] -name = "neli-proc-macros" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c168194d373b1e134786274020dae7fc5513d565ea2ebb9bc9ff17ffb69106d4" -dependencies = [ - "either", - "proc-macro2", - "quote", - "serde", - "syn 1.0.109", -] - [[package]] name = "netlink-packet-core" version = "0.4.2" @@ -5221,6 +5756,33 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "notify" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c533b4c39709f9ba5005d8002048266593c1cfaf3c5f0739d5b8ab0c6c504009" +dependencies = [ + "bitflags 2.6.0", + "filetime", + "inotify", + "kqueue", + "libc", + "log", + "mio", + "notify-types", + "walkdir", + "windows-sys 0.52.0", +] + +[[package]] +name = "notify-types" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7393c226621f817964ffb3dc5704f9509e107a8b024b489cc2c1b217378785df" +dependencies = [ + "instant", +] + [[package]] name = "ntapi" version = "0.4.1" @@ -5250,6 +5812,23 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-bigint-dig" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" +dependencies = [ + "byteorder", + "lazy_static", + "libm", + "num-integer", + "num-iter", + "num-traits", + "rand 0.8.5", + "smallvec", + "zeroize", +] + [[package]] name = "num-conv" version = "0.1.0" @@ -5265,6 +5844,17 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-iter" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + [[package]] name = "num-traits" version = "0.2.19" @@ -5300,7 +5890,7 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ - "proc-macro-crate 2.0.2", + "proc-macro-crate 2.0.0", "proc-macro2", "quote", "syn 2.0.87", @@ -5551,13 +6141,22 @@ dependencies = [ "memchr", ] +[[package]] +name = "oid-registry" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bedf36ffb6ba96c2eb7144ef6270557b52e54b20c0a8e1eb2ff99a6c6959bff" +dependencies = [ + "asn1-rs 0.5.2", +] + [[package]] name = "oid-registry" version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8d8034d9489cdaf79228eb9f6a3b8d7bb32ba00d6645ebd48eef4077ceb5bd9" dependencies = [ - "asn1-rs", + "asn1-rs 0.6.2", ] [[package]] @@ -5566,6 +6165,15 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +[[package]] +name = "oneshot-fused-workaround" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f49cbc8293c5ba37516d29aba392a94a34638367d17d67617cea34e4f9acd05" +dependencies = [ + "futures", +] + [[package]] name = "opaque-debug" version = "0.3.1" @@ -5595,6 +6203,15 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" +[[package]] +name = "ordered-float" +version = "2.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68f19d67e5a2795c94e73e0bb1cc1a7edeb2e28efd39e2e1c9b7a40c1108b11c" +dependencies = [ + "num-traits", +] + [[package]] name = "ordered-stream" version = "0.2.0" @@ -5615,12 +6232,59 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "os_str_bytes" +version = "6.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" +dependencies = [ + "memchr", +] + [[package]] name = "overload" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2 0.10.8", +] + +[[package]] +name = "p384" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70786f51bcc69f6a4c0360e063a4cac5419ef7c5cd5b3c99ad70f3be5ba79209" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2 0.10.8", +] + +[[package]] +name = "p521" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fc9e2161f1f215afdfce23677034ae137bbd45016a880c2eb3ba8eb95f085b2" +dependencies = [ + "base16ct", + "ecdsa", + "elliptic-curve", + "primeorder", + "rand_core 0.6.4", + "sha2 0.10.8", +] + [[package]] name = "pango" version = "0.18.3" @@ -5722,6 +6386,15 @@ dependencies = [ "serde", ] +[[package]] +name = "pem-rfc7468" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" +dependencies = [ + "base64ct", +] + [[package]] name = "percent-encoding" version = "2.3.1" @@ -5950,6 +6623,17 @@ dependencies = [ "futures-io", ] +[[package]] +name = "pkcs1" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" +dependencies = [ + "der", + "pkcs8", + "spki", +] + [[package]] name = "pkcs8" version = "0.10.2" @@ -6031,16 +6715,19 @@ dependencies = [ ] [[package]] -name = "port_check" -version = "0.2.1" +name = "postage" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2110609fb863cdb367d4e69d6c43c81ba6a8c7d18e80082fe9f3ef16b23afeed" - -[[package]] -name = "portable-atomic" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc9c68a3f6da06753e9335d63e27f6b9754dd1920d941135b7ea8224f141adb2" +checksum = "af3fb618632874fb76937c2361a7f22afd393c982a2165595407edc75b06d3c1" +dependencies = [ + "atomic 0.5.3", + "crossbeam-queue", + "futures", + "parking_lot 0.12.3", + "pin-project", + "static_assertions", + "thiserror 1.0.69", +] [[package]] name = "powerfmt" @@ -6063,6 +6750,15 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + [[package]] name = "primitive-types" version = "0.9.1" @@ -6073,6 +6769,17 @@ dependencies = [ "uint", ] +[[package]] +name = "priority-queue" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "714c75db297bc88a63783ffc6ab9f830698a6705aa0201416931759ef4c8183d" +dependencies = [ + "autocfg", + "equivalent", + "indexmap 2.6.0", +] + [[package]] name = "proc-macro-crate" version = "1.3.1" @@ -6085,11 +6792,10 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "2.0.2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b00f26d3400549137f92511a46ac1cd8ce37cb5598a96d382381458b992a5d24" +checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" dependencies = [ - "toml_datetime", "toml_edit 0.20.2", ] @@ -6175,38 +6881,6 @@ dependencies = [ "unarray", ] -[[package]] -name = "prost" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" -dependencies = [ - "bytes", - "prost-derive", -] - -[[package]] -name = "prost-derive" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" -dependencies = [ - "anyhow", - "itertools 0.12.1", - "proc-macro2", - "quote", - "syn 2.0.87", -] - -[[package]] -name = "prost-types" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" -dependencies = [ - "prost", -] - [[package]] name = "ptr_meta" version = "0.1.4" @@ -6227,6 +6901,18 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "pwd-grp" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b94fdf3867b7f2889a736f0022ea9386766280d2cca4bdbe41629ada9e4f3b8f" +dependencies = [ + "derive-deftly", + "libc", + "paste", + "thiserror 1.0.69", +] + [[package]] name = "qrcode" version = "0.14.1" @@ -6604,7 +7290,7 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", - "sync_wrapper 1.0.1", + "sync_wrapper", "tokio", "tokio-rustls 0.26.0", "tokio-socks", @@ -6629,6 +7315,22 @@ dependencies = [ "quick-error", ] +[[package]] +name = "retry-error" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ef93545b13f6dd83a9f98c8a656ccbd7bc2b95a747844346c70f7e6f5a5932" + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac 0.12.1", + "subtle", +] + [[package]] name = "ring" version = "0.16.20" @@ -6659,16 +7361,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "ringbuf" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "726bb493fe9cac765e8f96a144c3a8396bdf766dedad22e504b70b908dcbceb4" -dependencies = [ - "crossbeam-utils", - "portable-atomic", -] - [[package]] name = "rkyv" version = "0.7.45" @@ -6698,6 +7390,27 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "rsa" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d0e5124fcb30e76a7e79bfee683a2746db83784b86289f6251b54b7950a0dfc" +dependencies = [ + "const-oid", + "digest 0.10.7", + "num-bigint-dig", + "num-integer", + "num-traits", + "pkcs1", + "pkcs8", + "rand_core 0.6.4", + "sha2 0.10.8", + "signature 2.2.0", + "spki", + "subtle", + "zeroize", +] + [[package]] name = "rtnetlink" version = "0.10.1" @@ -6713,6 +7426,21 @@ dependencies = [ "tokio", ] +[[package]] +name = "rusqlite" +version = "0.32.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7753b721174eb8ff87a9a0e799e2d7bc3749323e773db92e0984debb00019d6e" +dependencies = [ + "bitflags 2.6.0", + "fallible-iterator", + "fallible-streaming-iterator", + "hashlink", + "libsqlite3-sys", + "smallvec", + "time 0.3.36", +] + [[package]] name = "rust_decimal" version = "1.36.0" @@ -6837,6 +7565,7 @@ version = "0.23.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eee87ff5d9b36712a58574e12e9f0ea80f915a5b0ac518d322b24a465617925e" dependencies = [ + "log", "once_cell", "ring 0.17.8", "rustls-pki-types", @@ -6952,6 +7681,19 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +[[package]] +name = "safelog" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d00c331d3dad51d67db003b70b4e1ab8408c5b89f5830af4d282e612a75a84f3" +dependencies = [ + "derive_more 1.0.0", + "educe", + "either", + "fluid-let", + "thiserror 1.0.69", +] + [[package]] name = "same-file" version = "1.0.6" @@ -6961,6 +7703,16 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "sanitize-filename" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ed72fbaf78e6f2d41744923916966c4fbe3d7c74e3037a8ee482f1115572603" +dependencies = [ + "lazy_static", + "regex", +] + [[package]] name = "scc" version = "2.2.4" @@ -7044,6 +7796,20 @@ version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "pkcs8", + "subtle", + "zeroize", +] + [[package]] name = "secp256k1" version = "0.24.3" @@ -7160,7 +7926,7 @@ checksum = "df320f1889ac4ba6bc0cdc9c9af7af4bd64bb927bccdf32d81140dc1f9be12fe" dependencies = [ "bitflags 1.3.2", "cssparser", - "derive_more", + "derive_more 0.99.18", "fxhash", "log", "matches", @@ -7181,21 +7947,6 @@ dependencies = [ "serde", ] -[[package]] -name = "sequential-macro" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb5facc5f409a55d25bf271c853402a00e1187097d326757043f5dd711944d07" - -[[package]] -name = "sequential-test" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0d9c0d773bc7e7733264f460e5dfa00b2510421ddd6284db0749eef8dfb79e9" -dependencies = [ - "sequential-macro", -] - [[package]] name = "serde" version = "1.0.215" @@ -7225,6 +7976,16 @@ dependencies = [ "typeid", ] +[[package]] +name = "serde-value" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3a1a3341211875ef120e117ea7fd5228530ae7e7036a779fdc9117be6b3282c" +dependencies = [ + "ordered-float", + "serde", +] + [[package]] name = "serde_cbor" version = "0.11.2" @@ -7257,6 +8018,15 @@ dependencies = [ "syn 2.0.87", ] +[[package]] +name = "serde_ignored" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8e319a36d1b52126a0d608f24e93b2d81297091818cd70625fcf50a15d84ddf" +dependencies = [ + "serde", +] + [[package]] name = "serde_json" version = "1.0.132" @@ -7470,6 +8240,16 @@ dependencies = [ "opaque-debug", ] +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest 0.10.7", + "keccak", +] + [[package]] name = "sharded-slab" version = "0.1.7" @@ -7495,6 +8275,17 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" +[[package]] +name = "shellexpand" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da03fa3b94cc19e3ebfc88c4229c49d8f08cdbd1228870a45f0ffdf84988e14b" +dependencies = [ + "bstr", + "dirs", + "os_str_bytes", +] + [[package]] name = "shlex" version = "1.3.0" @@ -7536,6 +8327,7 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ + "digest 0.10.7", "rand_core 0.6.4", ] @@ -7588,11 +8380,37 @@ dependencies = [ "parking_lot 0.11.2", ] +[[package]] +name = "slotmap" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbff4acf519f630b3a3ddcfaea6c06b42174d9a44bc70c620e9ed1649d58b82a" +dependencies = [ + "serde", + "version_check", +] + +[[package]] +name = "slotmap-careful" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0521c412b8940cf10d63e88faa7b63839ced20547e6d49d86417d90d0c1af8ad" +dependencies = [ + "paste", + "serde", + "slotmap", + "thiserror 1.0.69", + "void", +] + [[package]] name = "smallvec" version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +dependencies = [ + "serde", +] [[package]] name = "snow" @@ -7722,70 +8540,81 @@ dependencies = [ [[package]] name = "sqlx" -version = "0.6.3" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8de3b03a925878ed54a954f621e64bf55a3c1bd29652d0d1a17830405350188" +checksum = "93334716a037193fac19df402f8571269c84a00852f6a7066b5d2616dcd64d3e" dependencies = [ "sqlx-core", "sqlx-macros", + "sqlx-mysql", + "sqlx-postgres", + "sqlx-sqlite", ] [[package]] name = "sqlx-core" -version = "0.6.3" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa8241483a83a3f33aa5fff7e7d9def398ff9990b2752b6c6112b83c6d246029" +checksum = "d4d8060b456358185f7d50c55d9b5066ad956956fddec42ee2e8567134a8936e" dependencies = [ - "ahash 0.7.8", "atoi", - "bitflags 1.3.2", "byteorder", "bytes", "crc", "crossbeam-queue", - "dotenvy", "either", - "event-listener 2.5.3", - "flume", + "event-listener 5.3.1", "futures-channel", "futures-core", - "futures-executor", "futures-intrusive", + "futures-io", "futures-util", + "hashbrown 0.14.5", "hashlink", "hex", - "indexmap 1.9.3", - "itoa 1.0.11", - "libc", - "libsqlite3-sys", + "indexmap 2.6.0", "log", "memchr", "once_cell", "paste", "percent-encoding", - "rustls 0.20.9", - "rustls-pemfile 1.0.4", + "rustls 0.23.16", + "rustls-pemfile 2.2.0", "serde", + "serde_json", "sha2 0.10.8", "smallvec", "sqlformat", - "sqlx-rt", - "stringprep", "thiserror 1.0.69", + "tokio", "tokio-stream", + "tracing", "url", - "webpki-roots 0.22.6", + "webpki-roots 0.26.6", ] [[package]] name = "sqlx-macros" -version = "0.6.3" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9966e64ae989e7e575b19d7265cb79d7fc3cbbdf179835cb0d716f294c2049c9" +checksum = "cac0692bcc9de3b073e8d747391827297e075c7710ff6276d9f7a1f3d58c6657" +dependencies = [ + "proc-macro2", + "quote", + "sqlx-core", + "sqlx-macros-core", + "syn 2.0.87", +] + +[[package]] +name = "sqlx-macros-core" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1804e8a7c7865599c9c79be146dc8a9fd8cc86935fa641d3ea58e5f0688abaa5" dependencies = [ "dotenvy", "either", - "heck 0.4.1", + "heck 0.5.0", "hex", "once_cell", "proc-macro2", @@ -7794,20 +8623,157 @@ dependencies = [ "serde_json", "sha2 0.10.8", "sqlx-core", - "sqlx-rt", - "syn 1.0.109", + "sqlx-mysql", + "sqlx-postgres", + "sqlx-sqlite", + "syn 2.0.87", + "tempfile", + "tokio", "url", ] [[package]] -name = "sqlx-rt" -version = "0.6.3" +name = "sqlx-mysql" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "804d3f245f894e61b1e6263c84b23ca675d96753b5abfd5cc8597d86806e8024" +checksum = "64bb4714269afa44aef2755150a0fc19d756fb580a67db8885608cf02f47d06a" dependencies = [ + "atoi", + "base64 0.22.1", + "bitflags 2.6.0", + "byteorder", + "bytes", + "crc", + "digest 0.10.7", + "dotenvy", + "either", + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "generic-array", + "hex", + "hkdf", + "hmac 0.12.1", + "itoa 1.0.11", + "log", + "md-5", + "memchr", "once_cell", - "tokio", - "tokio-rustls 0.23.4", + "percent-encoding", + "rand 0.8.5", + "rsa", + "serde", + "sha1", + "sha2 0.10.8", + "smallvec", + "sqlx-core", + "stringprep", + "thiserror 1.0.69", + "tracing", + "whoami", +] + +[[package]] +name = "sqlx-postgres" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fa91a732d854c5d7726349bb4bb879bb9478993ceb764247660aee25f67c2f8" +dependencies = [ + "atoi", + "base64 0.22.1", + "bitflags 2.6.0", + "byteorder", + "crc", + "dotenvy", + "etcetera", + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "hex", + "hkdf", + "hmac 0.12.1", + "home", + "itoa 1.0.11", + "log", + "md-5", + "memchr", + "once_cell", + "rand 0.8.5", + "serde", + "serde_json", + "sha2 0.10.8", + "smallvec", + "sqlx-core", + "stringprep", + "thiserror 1.0.69", + "tracing", + "whoami", +] + +[[package]] +name = "sqlx-sqlite" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5b2cf34a45953bfd3daaf3db0f7a7878ab9b7a6b91b422d24a7a9e4c857b680" +dependencies = [ + "atoi", + "flume", + "futures-channel", + "futures-core", + "futures-executor", + "futures-intrusive", + "futures-util", + "libsqlite3-sys", + "log", + "percent-encoding", + "serde", + "serde_urlencoded", + "sqlx-core", + "tracing", + "url", +] + +[[package]] +name = "ssh-cipher" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caac132742f0d33c3af65bfcde7f6aa8f62f0e991d80db99149eb9d44708784f" +dependencies = [ + "cipher", + "ssh-encoding", +] + +[[package]] +name = "ssh-encoding" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb9242b9ef4108a78e8cd1a2c98e193ef372437f8c22be363075233321dd4a15" +dependencies = [ + "base64ct", + "pem-rfc7468", + "sha2 0.10.8", +] + +[[package]] +name = "ssh-key" +version = "0.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b86f5297f0f04d08cabaa0f6bff7cb6aec4d9c3b49d87990d63da9d9156a8c3" +dependencies = [ + "p256", + "p384", + "p521", + "rand_core 0.6.4", + "rsa", + "sec1", + "sha2 0.10.8", + "signature 2.2.0", + "ssh-cipher", + "ssh-encoding", + "subtle", + "zeroize", ] [[package]] @@ -7940,7 +8906,8 @@ name = "swap" version = "1.0.0-rc.5" dependencies = [ "anyhow", - "async-compression", + "arti-client", + "async-compression 0.3.15", "async-trait", "asynchronous-codec 0.7.0", "atty", @@ -7957,27 +8924,22 @@ dependencies = [ "curve25519-dalek-ng", "data-encoding", "dialoguer", - "digest 0.10.7", "directories-next", "ecdsa_fun", "ed25519-dalek 1.0.1", - "erased-serde", "futures", "get-port", "hex", - "hyper 0.14.31", - "hyper 1.5.0", - "itertools 0.13.0", "jsonrpsee", "jsonrpsee-core", "libp2p", + "libp2p-community-tor", "mockito", "monero", "monero-harness", "monero-rpc", "once_cell", "pem", - "port_check", "proptest", "qrcode", "rand 0.8.5", @@ -7986,7 +8948,6 @@ dependencies = [ "reqwest", "rust_decimal", "rust_decimal_macros", - "sequential-test", "serde", "serde_cbor", "serde_json", @@ -8003,17 +8964,16 @@ dependencies = [ "thiserror 1.0.69", "time 0.3.36", "tokio", - "tokio-socks", "tokio-tar", "tokio-tungstenite", "tokio-util", - "toml 0.8.2", + "toml 0.8.19", + "tor-rtcompat", "torut", "tower", - "tower-http 0.3.5", + "tower-http", "tracing", "tracing-appender", - "tracing-futures", "tracing-subscriber", "typeshare", "unsigned-varint 0.8.0", @@ -8069,12 +9029,6 @@ dependencies = [ "syn 2.0.87", ] -[[package]] -name = "sync_wrapper" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" - [[package]] name = "sync_wrapper" version = "1.0.1" @@ -8084,6 +9038,18 @@ dependencies = [ "futures-core", ] +[[package]] +name = "synstructure" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "unicode-xid", +] + [[package]] name = "synstructure" version = "0.13.1" @@ -8139,7 +9105,7 @@ dependencies = [ "cfg-expr", "heck 0.5.0", "pkg-config", - "toml 0.8.2", + "toml 0.8.19", "version-compare", ] @@ -8257,7 +9223,6 @@ dependencies = [ "tauri-utils", "thiserror 2.0.3", "tokio", - "tracing", "tray-icon", "url", "urlpattern", @@ -8285,7 +9250,7 @@ dependencies = [ "serde_json", "tauri-utils", "tauri-winres", - "toml 0.8.2", + "toml 0.8.19", "walkdir", ] @@ -8343,7 +9308,7 @@ dependencies = [ "serde", "serde_json", "tauri-utils", - "toml 0.8.2", + "toml 0.8.19", "walkdir", ] @@ -8377,33 +9342,6 @@ dependencies = [ "thiserror 1.0.69", ] -[[package]] -name = "tauri-plugin-devtools" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5cd17faa36a826e5686bd0fda5bc3f4c903682263f00cd50f2f778fc4bb866" -dependencies = [ - "async-stream", - "bytes", - "cocoa", - "colored", - "devtools-core", - "futures", - "local-ip-address", - "log", - "objc", - "serde", - "serde_json", - "swift-rs", - "tauri", - "tauri-plugin", - "tokio", - "tonic", - "tonic-health", - "tracing", - "tracing-subscriber", -] - [[package]] name = "tauri-plugin-process" version = "2.0.1" @@ -8534,7 +9472,6 @@ dependencies = [ "tao", "tauri-runtime", "tauri-utils", - "tracing", "url", "webkit2gtk", "webview2-com", @@ -8573,7 +9510,7 @@ dependencies = [ "serde_with 3.11.0", "swift-rs", "thiserror 2.0.3", - "toml 0.8.2", + "toml 0.8.19", "url", "urlpattern", "uuid", @@ -8803,16 +9740,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "tokio-io-timeout" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" -dependencies = [ - "pin-project-lite", - "tokio", -] - [[package]] name = "tokio-macros" version = "2.4.0" @@ -8835,17 +9762,6 @@ dependencies = [ "webpki 0.21.4", ] -[[package]] -name = "tokio-rustls" -version = "0.23.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" -dependencies = [ - "rustls 0.20.9", - "tokio", - "webpki 0.22.4", -] - [[package]] name = "tokio-rustls" version = "0.24.1" @@ -8950,21 +9866,21 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.2" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.20.2", + "toml_edit 0.22.22", ] [[package]] name = "toml_datetime" -version = "0.6.3" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" dependencies = [ "serde", ] @@ -8979,7 +9895,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "winnow", + "winnow 0.5.40", ] [[package]] @@ -8987,72 +9903,860 @@ name = "toml_edit" version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" +dependencies = [ + "indexmap 2.6.0", + "toml_datetime", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.22.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ "indexmap 2.6.0", "serde", "serde_spanned", "toml_datetime", - "winnow", + "winnow 0.6.20", ] [[package]] -name = "tonic" -version = "0.10.2" +name = "tor-async-utils" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d560933a0de61cf715926b9cac824d4c883c2c43142f787595e48280c40a1d0e" +checksum = "3157a36bca68d25da943d9e77804fb1dadca108cd124871668a18763eae735b6" +dependencies = [ + "derive-deftly", + "educe", + "futures", + "oneshot-fused-workaround", + "pin-project", + "postage", + "thiserror 1.0.69", + "void", +] + +[[package]] +name = "tor-basic-utils" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3915f18c6574f797c5d59089074f79f81e6d93495d726179eebc9084126d617e" +dependencies = [ + "derive_more 1.0.0", + "hex", + "itertools", + "libc", + "paste", + "rand 0.8.5", + "rand_chacha 0.3.1", + "serde", + "slab", + "smallvec", + "thiserror 1.0.69", +] + +[[package]] +name = "tor-bytes" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6cef6d87b08baf1475bc24da39343705ab9b4f7f916d0ee19fa657634733d0d" +dependencies = [ + "bytes", + "derive-deftly", + "digest 0.10.7", + "educe", + "getrandom 0.2.15", + "safelog", + "thiserror 1.0.69", + "tor-error", + "tor-llcrypto", + "zeroize", +] + +[[package]] +name = "tor-cell" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35443109312b7ea355d767afc696d00389604a6afa6144a44ba074f7290bbb6b" +dependencies = [ + "amplify", + "bitflags 2.6.0", + "bytes", + "caret", + "derive-deftly", + "derive_more 1.0.0", + "educe", + "paste", + "rand 0.8.5", + "smallvec", + "thiserror 1.0.69", + "tor-basic-utils", + "tor-bytes", + "tor-cert", + "tor-error", + "tor-linkspec", + "tor-llcrypto", + "tor-memquota", + "tor-units", + "void", +] + +[[package]] +name = "tor-cert" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b8eaa55aa20a3cab77943e176ed48f34c90d9ba0dc98c64adef6c15aef0bc8" +dependencies = [ + "caret", + "derive_more 1.0.0", + "digest 0.10.7", + "thiserror 1.0.69", + "tor-bytes", + "tor-checkable", + "tor-llcrypto", +] + +[[package]] +name = "tor-chanmgr" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0eabe776706c7062468bb7fdab05136c7a9db6325e9688e02d47a7b6d6dee9d" dependencies = [ - "async-stream", "async-trait", - "axum", - "base64 0.21.7", - "bytes", - "h2 0.3.26", - "http 0.2.12", - "http-body 0.4.6", - "hyper 0.14.31", - "hyper-timeout", - "percent-encoding", + "derive_builder_fork_arti", + "derive_more 1.0.0", + "educe", + "futures", + "oneshot-fused-workaround", + "postage", + "rand 0.8.5", + "safelog", + "serde", + "thiserror 1.0.69", + "tor-async-utils", + "tor-basic-utils", + "tor-cell", + "tor-config", + "tor-error", + "tor-linkspec", + "tor-llcrypto", + "tor-memquota", + "tor-netdir", + "tor-proto", + "tor-rtcompat", + "tor-socksproto", + "tor-units", + "tracing", + "void", +] + +[[package]] +name = "tor-checkable" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c1d164cf835d4f5e4150293e8322e152e8d8a39839cfea219742556df8fbe2" +dependencies = [ + "humantime", + "signature 2.2.0", + "thiserror 1.0.69", + "tor-llcrypto", +] + +[[package]] +name = "tor-circmgr" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d24638de4d36226023345c0e5f40e0e2244d2f6aec118b9c7cdb464c8f5f6277" +dependencies = [ + "amplify", + "async-trait", + "bounded-vec-deque", + "cfg-if", + "derive_builder_fork_arti", + "derive_more 1.0.0", + "downcast-rs", + "dyn-clone", + "educe", + "futures", + "humantime-serde", + "itertools", + "once_cell", + "oneshot-fused-workaround", "pin-project", - "prost", - "tokio", - "tokio-stream", - "tower", - "tower-layer", - "tower-service", + "rand 0.8.5", + "retry-error", + "safelog", + "serde", + "static_assertions", + "thiserror 1.0.69", + "tor-async-utils", + "tor-basic-utils", + "tor-chanmgr", + "tor-config", + "tor-error", + "tor-guardmgr", + "tor-linkspec", + "tor-memquota", + "tor-netdir", + "tor-netdoc", + "tor-persist", + "tor-proto", + "tor-protover", + "tor-relay-selection", + "tor-rtcompat", + "tracing", + "void", + "weak-table", +] + +[[package]] +name = "tor-config" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16a89f7cc30d911d5baf61a181b15ea16219d5a63b54ff87bd3e05d3814ad212" +dependencies = [ + "amplify", + "cfg-if", + "derive-deftly", + "derive_builder_fork_arti", + "directories", + "educe", + "either", + "figment", + "fs-mistrust", + "futures", + "itertools", + "notify", + "once_cell", + "paste", + "postage", + "regex", + "serde", + "serde-value", + "serde_ignored", + "shellexpand", + "strum", + "thiserror 1.0.69", + "toml 0.8.19", + "tor-basic-utils", + "tor-config-path", + "tor-error", + "tor-rtcompat", + "tracing", + "void", +] + +[[package]] +name = "tor-config-path" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eebee676fe2b0c76c262e107a11a996cb381ff484d136c218becea6a4c15be5a" +dependencies = [ + "directories", + "once_cell", + "serde", + "shellexpand", + "thiserror 1.0.69", + "tor-error", +] + +[[package]] +name = "tor-consdiff" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01fd67886ae74b82d4cf7a15bc34c7381d10287178b3f9e8d92311cb74b761b1" +dependencies = [ + "digest 0.10.7", + "hex", + "thiserror 1.0.69", + "tor-llcrypto", +] + +[[package]] +name = "tor-dirclient" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a65ac0b04c4ff8c303a291ab22aa453c73929895b16a8314d888a7d0269c8343" +dependencies = [ + "async-compression 0.4.17", + "base64ct", + "derive_more 1.0.0", + "futures", + "hex", + "http 1.1.0", + "httparse", + "httpdate", + "itertools", + "memchr", + "thiserror 1.0.69", + "tor-circmgr", + "tor-error", + "tor-linkspec", + "tor-llcrypto", + "tor-netdoc", + "tor-proto", + "tor-rtcompat", "tracing", ] [[package]] -name = "tonic-health" -version = "0.10.2" +name = "tor-dirmgr" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f80db390246dfb46553481f6024f0082ba00178ea495dbb99e70ba9a4fafb5e1" +checksum = "b3a3e12af4860040f28cb14b03f9fae18a9aa0f1e66dab77ef0d9f93026ba95b" dependencies = [ - "async-stream", - "prost", - "tokio", - "tokio-stream", - "tonic", + "async-trait", + "base64ct", + "derive_builder_fork_arti", + "derive_more 1.0.0", + "digest 0.10.7", + "educe", + "event-listener 5.3.1", + "fs-mistrust", + "fslock", + "futures", + "hex", + "humantime", + "humantime-serde", + "itertools", + "memmap2", + "once_cell", + "oneshot-fused-workaround", + "paste", + "postage", + "rand 0.8.5", + "rusqlite", + "safelog", + "scopeguard", + "serde", + "signature 2.2.0", + "strum", + "thiserror 1.0.69", + "time 0.3.36", + "tor-async-utils", + "tor-basic-utils", + "tor-checkable", + "tor-circmgr", + "tor-config", + "tor-consdiff", + "tor-dirclient", + "tor-error", + "tor-guardmgr", + "tor-llcrypto", + "tor-netdir", + "tor-netdoc", + "tor-persist", + "tor-proto", + "tor-rtcompat", + "tracing", ] [[package]] -name = "tonic-web" -version = "0.10.2" +name = "tor-error" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fddb2a37b247e6adcb9f239f4e5cefdcc5ed526141a416b943929f13aea2cce" +checksum = "82249e99eeab846b0264aabb761bceba891b9a5e5875fd2644683feeb96ea417" dependencies = [ - "base64 0.21.7", - "bytes", - "http 0.2.12", - "http-body 0.4.6", - "hyper 0.14.31", - "pin-project", - "tokio-stream", - "tonic", - "tower-http 0.4.4", - "tower-layer", - "tower-service", + "derive_more 1.0.0", + "futures", + "once_cell", + "paste", + "retry-error", + "static_assertions", + "strum", + "thiserror 1.0.69", "tracing", + "void", +] + +[[package]] +name = "tor-general-addr" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3279be11b11750ea2bb85cc6ac81f22223696650400834d8e64c9449136b593e" +dependencies = [ + "derive_more 1.0.0", + "thiserror 1.0.69", + "void", +] + +[[package]] +name = "tor-guardmgr" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a732a0331e57b852512dcba2e2cecac1b7e9aee91e231b1d7373f8d6ca4aa1a" +dependencies = [ + "amplify", + "base64ct", + "derive-deftly", + "derive_builder_fork_arti", + "derive_more 1.0.0", + "dyn-clone", + "educe", + "futures", + "humantime", + "humantime-serde", + "itertools", + "num_enum", + "oneshot-fused-workaround", + "pin-project", + "postage", + "rand 0.8.5", + "safelog", + "serde", + "strum", + "thiserror 1.0.69", + "tor-async-utils", + "tor-basic-utils", + "tor-config", + "tor-error", + "tor-linkspec", + "tor-llcrypto", + "tor-netdir", + "tor-netdoc", + "tor-persist", + "tor-proto", + "tor-relay-selection", + "tor-rtcompat", + "tor-units", + "tracing", +] + +[[package]] +name = "tor-hscrypto" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f00099189e52d3376082b58139759249f16a53119d3d4f5f023168881c87d0a0" +dependencies = [ + "data-encoding", + "derive_more 1.0.0", + "digest 0.10.7", + "itertools", + "paste", + "rand 0.8.5", + "safelog", + "signature 2.2.0", + "subtle", + "thiserror 1.0.69", + "tor-basic-utils", + "tor-bytes", + "tor-error", + "tor-llcrypto", + "tor-units", + "void", +] + +[[package]] +name = "tor-key-forge" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "814a3ceb5b1c0a790f3604f2745775ca4a2cac3499a00c8641fc03030e068e08" +dependencies = [ + "derive-deftly", + "derive_more 1.0.0", + "downcast-rs", + "paste", + "rand 0.8.5", + "signature 2.2.0", + "ssh-key", + "thiserror 1.0.69", + "tor-error", + "tor-hscrypto", + "tor-llcrypto", +] + +[[package]] +name = "tor-keymgr" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "335a589e149aa728b09c1614a76f9857993c133c2b0fa03319c41218f4bde975" +dependencies = [ + "amplify", + "arrayvec", + "cfg-if", + "derive-deftly", + "derive_builder_fork_arti", + "derive_more 1.0.0", + "downcast-rs", + "dyn-clone", + "fs-mistrust", + "glob-match", + "humantime", + "inventory", + "itertools", + "rand 0.8.5", + "serde", + "signature 2.2.0", + "ssh-key", + "thiserror 1.0.69", + "tor-basic-utils", + "tor-config", + "tor-error", + "tor-hscrypto", + "tor-key-forge", + "tor-llcrypto", + "tor-persist", + "tracing", + "walkdir", + "zeroize", +] + +[[package]] +name = "tor-linkspec" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc92002b84c1cdea158aac4a3a400d61dd02fae5d9d0e8a36a8e08cd64fda6e9" +dependencies = [ + "base64ct", + "by_address", + "caret", + "derive-deftly", + "derive_builder_fork_arti", + "derive_more 1.0.0", + "hex", + "itertools", + "safelog", + "serde", + "serde_with 3.11.0", + "strum", + "thiserror 1.0.69", + "tor-basic-utils", + "tor-bytes", + "tor-config", + "tor-llcrypto", + "tor-memquota", + "tor-protover", +] + +[[package]] +name = "tor-llcrypto" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877d2fae2ef8f29ad91bd434e195bdef98662839be9ed4befdf071956b093123" +dependencies = [ + "aes", + "base64ct", + "ctr", + "curve25519-dalek 4.1.3", + "der-parser 9.0.0", + "derive-deftly", + "derive_more 1.0.0", + "digest 0.10.7", + "ed25519-dalek 2.1.1", + "educe", + "getrandom 0.2.15", + "hex", + "rand_core 0.6.4", + "rsa", + "safelog", + "serde", + "sha1", + "sha2 0.10.8", + "sha3 0.10.8", + "signature 2.2.0", + "subtle", + "thiserror 1.0.69", + "tor-memquota", + "visibility", + "x25519-dalek", + "zeroize", +] + +[[package]] +name = "tor-log-ratelim" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b090937d1bde6910769b2be6b514fc1c07e83f646a14a471f8f2647367afd10" +dependencies = [ + "futures", + "humantime", + "once_cell", + "thiserror 1.0.69", + "tor-error", + "tor-rtcompat", + "tracing", + "weak-table", +] + +[[package]] +name = "tor-memquota" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4560cc9485af7c499f611e2ed565dfcf1445e804faad0dd47ad097f4e9bf7d2" +dependencies = [ + "derive-deftly", + "derive_more 1.0.0", + "dyn-clone", + "educe", + "futures", + "itertools", + "paste", + "pin-project", + "serde", + "slotmap-careful", + "static_assertions", + "thiserror 1.0.69", + "tor-async-utils", + "tor-basic-utils", + "tor-config", + "tor-error", + "tor-log-ratelim", + "tor-rtcompat", + "tracing", + "void", +] + +[[package]] +name = "tor-netdir" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68a99ad35659954aa280e678c3af2ab68934caaf55b94b947e2fb6f850598b5a" +dependencies = [ + "bitflags 2.6.0", + "derive_more 1.0.0", + "futures", + "humantime", + "itertools", + "num_enum", + "rand 0.8.5", + "serde", + "static_assertions", + "strum", + "thiserror 1.0.69", + "tor-basic-utils", + "tor-error", + "tor-linkspec", + "tor-llcrypto", + "tor-netdoc", + "tor-protover", + "tor-units", + "tracing", + "typed-index-collections", +] + +[[package]] +name = "tor-netdoc" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f74630f9b13b192e84e09a0b39460eec8d1d23f6fa4b45f03d06782322d583fb" +dependencies = [ + "amplify", + "base64ct", + "bitflags 2.6.0", + "cipher", + "derive_builder_fork_arti", + "derive_more 1.0.0", + "digest 0.10.7", + "educe", + "hex", + "humantime", + "itertools", + "once_cell", + "phf 0.11.2", + "serde", + "serde_with 3.11.0", + "signature 2.2.0", + "smallvec", + "subtle", + "thiserror 1.0.69", + "time 0.3.36", + "tinystr", + "tor-basic-utils", + "tor-bytes", + "tor-cell", + "tor-cert", + "tor-checkable", + "tor-error", + "tor-llcrypto", + "tor-protover", + "void", + "weak-table", + "zeroize", +] + +[[package]] +name = "tor-persist" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69b035192b529f6316c77d969f1e3be9f85d61ca1e1f946c91a96f987fdaba5e" +dependencies = [ + "derive-deftly", + "derive_more 1.0.0", + "filetime", + "fs-mistrust", + "fslock", + "futures", + "itertools", + "oneshot-fused-workaround", + "paste", + "sanitize-filename", + "serde", + "serde_json", + "thiserror 1.0.69", + "tor-async-utils", + "tor-basic-utils", + "tor-error", + "tracing", + "void", +] + +[[package]] +name = "tor-proto" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c911edb20425cff696606795d80241d4c412293254bd88b8a7a84ed92c3a098" +dependencies = [ + "asynchronous-codec 0.7.0", + "bitvec", + "bytes", + "cipher", + "coarsetime", + "derive-deftly", + "derive_builder_fork_arti", + "derive_more 1.0.0", + "digest 0.10.7", + "educe", + "futures", + "hkdf", + "hmac 0.12.1", + "oneshot-fused-workaround", + "pin-project", + "rand 0.8.5", + "rand_core 0.6.4", + "safelog", + "subtle", + "thiserror 1.0.69", + "tokio", + "tokio-util", + "tor-async-utils", + "tor-basic-utils", + "tor-bytes", + "tor-cell", + "tor-cert", + "tor-checkable", + "tor-config", + "tor-error", + "tor-linkspec", + "tor-llcrypto", + "tor-log-ratelim", + "tor-memquota", + "tor-rtcompat", + "tor-rtmock", + "tor-units", + "tracing", + "typenum", + "void", + "zeroize", +] + +[[package]] +name = "tor-protover" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bc5e3793a53b21b0c98304ea42e1f0fcab3bb37eca96027f9cb4df90685ba31" +dependencies = [ + "caret", + "thiserror 1.0.69", +] + +[[package]] +name = "tor-relay-selection" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ba71ca940e15bb86586c3e0cb98b94b9f63a816ef7e1df6aa59cde1114bf86f" +dependencies = [ + "rand 0.8.5", + "serde", + "tor-basic-utils", + "tor-linkspec", + "tor-netdir", + "tor-netdoc", +] + +[[package]] +name = "tor-rtcompat" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d91a0e023078fad1f6c65367efac78dada4c5c9ede7498ce7772f66f3bed15b" +dependencies = [ + "async-trait", + "async_executors", + "coarsetime", + "derive_more 1.0.0", + "dyn-clone", + "educe", + "futures", + "futures-rustls 0.26.0", + "paste", + "pin-project", + "rustls-pki-types", + "thiserror 1.0.69", + "tokio", + "tokio-util", + "tor-error", + "tor-general-addr", + "tracing", + "void", + "x509-signature", +] + +[[package]] +name = "tor-rtmock" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aacc825722bcad1dca140540a166e582409b4408ce6fbefd8e08d45264ea99f2" +dependencies = [ + "amplify", + "async-trait", + "derive-deftly", + "derive_more 1.0.0", + "educe", + "futures", + "humantime", + "itertools", + "oneshot-fused-workaround", + "pin-project", + "priority-queue", + "slotmap-careful", + "strum", + "thiserror 1.0.69", + "tor-error", + "tor-general-addr", + "tor-rtcompat", + "tracing", + "tracing-test", + "void", +] + +[[package]] +name = "tor-socksproto" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1eb7a8c792dd59b63fc25add39982d0509c3a58fe6e40eb2294324bf0d30f364" +dependencies = [ + "amplify", + "caret", + "derive-deftly", + "educe", + "safelog", + "subtle", + "thiserror 1.0.69", + "tor-bytes", + "tor-error", +] + +[[package]] +name = "tor-units" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01b1660c5ba8d5851d5411be3f9c0ae629e2b4e6e8db655b74f354611e5c18a7" +dependencies = [ + "derive-deftly", + "derive_more 1.0.0", + "thiserror 1.0.69", + "tor-memquota", ] [[package]] @@ -9063,13 +10767,13 @@ checksum = "99febc413f26cf855b3a309c5872edff5c31e0ffe9c2fce5681868761df36f69" dependencies = [ "base32", "base64 0.13.1", - "derive_more", + "derive_more 0.99.18", "ed25519-dalek 1.0.1", "hex", "hmac 0.11.0", "rand 0.7.3", "sha2 0.9.9", - "sha3", + "sha3 0.9.1", "tokio", ] @@ -9100,7 +10804,7 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f873044bf02dd1e8239e9c1293ea39dad76dc594ec16185d0a1bf31d8dc8d858" dependencies = [ - "async-compression", + "async-compression 0.3.15", "base64 0.13.1", "bitflags 1.3.2", "bytes", @@ -9124,24 +10828,6 @@ dependencies = [ "uuid", ] -[[package]] -name = "tower-http" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" -dependencies = [ - "bitflags 2.6.0", - "bytes", - "futures-core", - "futures-util", - "http 0.2.12", - "http-body 0.4.6", - "http-range-header", - "pin-project-lite", - "tower-layer", - "tower-service", -] - [[package]] name = "tower-layer" version = "0.3.3" @@ -9199,18 +10885,6 @@ dependencies = [ "valuable", ] -[[package]] -name = "tracing-futures" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" -dependencies = [ - "futures", - "futures-task", - "pin-project", - "tracing", -] - [[package]] name = "tracing-log" version = "0.2.0" @@ -9255,6 +10929,27 @@ dependencies = [ "tracing-serde", ] +[[package]] +name = "tracing-test" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "557b891436fe0d5e0e363427fc7f217abf9ccd510d5136549847bdcbcd011d68" +dependencies = [ + "tracing-core", + "tracing-subscriber", + "tracing-test-macro", +] + +[[package]] +name = "tracing-test-macro" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04659ddb06c87d233c566112c1c9c5b9e98256d9af50ec3bc9c8327f873a7568" +dependencies = [ + "quote", + "syn 2.0.87", +] + [[package]] name = "tray-icon" version = "0.19.1" @@ -9304,6 +10999,12 @@ dependencies = [ "webpki 0.21.4", ] +[[package]] +name = "typed-index-collections" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "183496e014253d15abbe6235677b1392dba2d40524c88938991226baa38ac7c4" + [[package]] name = "typeid" version = "1.0.2" @@ -9373,6 +11074,15 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" +[[package]] +name = "uncased" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1b88fcfe09e89d3866a5c11019378088af2d24c3fbd4f0543f96b479ec90697" +dependencies = [ + "version_check", +] + [[package]] name = "unic-char-property" version = "0.9.0" @@ -9465,6 +11175,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + [[package]] name = "unicode_categories" version = "0.1.1" @@ -9504,10 +11220,9 @@ dependencies = [ [[package]] name = "unstoppableswap-gui-rs" -version = "1.0.0-rc.5" +version = "0.7.0" dependencies = [ "anyhow", - "once_cell", "serde", "serde_json", "swap", @@ -9516,7 +11231,6 @@ dependencies = [ "tauri-build", "tauri-plugin-cli", "tauri-plugin-clipboard-manager", - "tauri-plugin-devtools", "tauri-plugin-process", "tauri-plugin-shell", "tauri-plugin-single-instance", @@ -9644,6 +11358,17 @@ version = "0.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9dcc60c0624df774c82a0ef104151231d37da4962957d691c011c852b2473314" +[[package]] +name = "visibility" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d674d135b4a8c1d7e813e2f8d1c9a58308aee4a680323066025e53132218bd91" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "void" version = "1.0.2" @@ -9716,6 +11441,21 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" + +[[package]] +name = "wasix" +version = "0.12.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1fbb4ef9bbca0c1170e0b00dd28abc9e3b68669821600cad1caaed606583c6d" +dependencies = [ + "wasi 0.11.0+wasi-snapshot-preview1", +] + [[package]] name = "wasm-bindgen" version = "0.2.95" @@ -9796,6 +11536,12 @@ dependencies = [ "web-sys", ] +[[package]] +name = "weak-table" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "323f4da9523e9a669e1eaf9c6e763892769b1d38c623913647bfdc1532fe4549" + [[package]] name = "web-sys" version = "0.3.72" @@ -9955,6 +11701,16 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082" +[[package]] +name = "whoami" +version = "1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "372d5b87f58ec45c384ba03563b03544dc5fadc3983e434b286913f5b4a9bb6d" +dependencies = [ + "redox_syscall 0.5.7", + "wasite", +] + [[package]] name = "widestring" version = "1.1.0" @@ -10394,6 +12150,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "winnow" +version = "0.6.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" +dependencies = [ + "memchr", +] + [[package]] name = "winreg" version = "0.50.0" @@ -10459,7 +12224,6 @@ dependencies = [ "soup3", "tao-macros", "thiserror 1.0.69", - "tracing", "url", "webkit2gtk", "webkit2gtk-sys", @@ -10529,23 +12293,50 @@ dependencies = [ "zeroize", ] +[[package]] +name = "x509-parser" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7069fba5b66b9193bd2c5d3d4ff12b839118f6bcbef5328efafafb5395cf63da" +dependencies = [ + "asn1-rs 0.5.2", + "data-encoding", + "der-parser 8.2.0", + "lazy_static", + "nom", + "oid-registry 0.6.1", + "rusticata-macros", + "thiserror 1.0.69", + "time 0.3.36", +] + [[package]] name = "x509-parser" version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcbc162f30700d6f3f82a24bf7cc62ffe7caea42c0b2cba8bf7f3ae50cf51f69" dependencies = [ - "asn1-rs", + "asn1-rs 0.6.2", "data-encoding", - "der-parser", + "der-parser 9.0.0", "lazy_static", "nom", - "oid-registry", + "oid-registry 0.7.1", "rusticata-macros", "thiserror 1.0.69", "time 0.3.36", ] +[[package]] +name = "x509-signature" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb2bc2a902d992cd5f471ee3ab0ffd6603047a4207384562755b9d6de977518" +dependencies = [ + "ring 0.16.20", + "untrusted 0.7.1", +] + [[package]] name = "xattr" version = "1.3.1" @@ -10643,7 +12434,7 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.87", - "synstructure", + "synstructure 0.13.1", ] [[package]] @@ -10749,7 +12540,7 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.87", - "synstructure", + "synstructure 0.13.1", ] [[package]] diff --git a/src-gui/index.html b/src-gui/index.html index 94b9ba4e..6780d6c8 100644 --- a/src-gui/index.html +++ b/src-gui/index.html @@ -1,36 +1,35 @@ - - - - - - - -
- - - - + +
+ + + + + \ No newline at end of file diff --git a/src-gui/package.json b/src-gui/package.json index f609304a..f6e02a56 100644 --- a/src-gui/package.json +++ b/src-gui/package.json @@ -15,6 +15,7 @@ "tauri": "tauri" }, "dependencies": { + "@fontsource/roboto": "^5.1.0", "@material-ui/core": "^4.12.4", "@material-ui/icons": "^4.11.3", "@material-ui/lab": "^4.0.0-alpha.61", @@ -66,4 +67,4 @@ "vite-tsconfig-paths": "^4.3.2", "vitest": "^2.1.1" } -} \ No newline at end of file +} diff --git a/src-gui/src/models/cliModel.ts b/src-gui/src/models/cliModel.ts index d0c3f88d..00c9cb9b 100644 --- a/src-gui/src/models/cliModel.ts +++ b/src-gui/src/models/cliModel.ts @@ -17,6 +17,7 @@ export interface CliLog { name: CliLogSpanType; [index: string]: unknown; }[]; + target?: string; } function isCliLog(log: unknown): log is CliLog { diff --git a/src-gui/src/renderer/components/App.tsx b/src-gui/src/renderer/components/App.tsx index f564b0fb..893d6507 100644 --- a/src-gui/src/renderer/components/App.tsx +++ b/src-gui/src/renderer/components/App.tsx @@ -13,6 +13,7 @@ import { useSettings } from "store/hooks"; import { themes } from "./theme"; import { useEffect } from "react"; import { setupBackgroundTasks } from "renderer/background"; +import "@fontsource/roboto"; const useStyles = makeStyles((theme) => ({ innerContent: { diff --git a/src-gui/src/renderer/components/alert/DaemonStatusAlert.tsx b/src-gui/src/renderer/components/alert/DaemonStatusAlert.tsx index c99b4692..76f872c6 100644 --- a/src-gui/src/renderer/components/alert/DaemonStatusAlert.tsx +++ b/src-gui/src/renderer/components/alert/DaemonStatusAlert.tsx @@ -57,6 +57,12 @@ export default function DaemonStatusAlert() { Opening the local database ); + case "EstablishingTorCircuits": + return ( + + Connecting to the Tor network + + ); } break; case "Available": diff --git a/src-gui/src/renderer/components/other/RenderedCliLog.tsx b/src-gui/src/renderer/components/other/RenderedCliLog.tsx index 52517396..7b2d0453 100644 --- a/src-gui/src/renderer/components/other/RenderedCliLog.tsx +++ b/src-gui/src/renderer/components/other/RenderedCliLog.tsx @@ -5,7 +5,7 @@ import { logsToRawString } from "utils/parseUtils"; import ScrollablePaperTextBox from "./ScrollablePaperTextBox"; function RenderedCliLog({ log }: { log: CliLog }) { - const { timestamp, level, fields } = log; + const { timestamp, level, fields, target } = log; const levelColorMap = { DEBUG: "#1976d2", // Blue @@ -29,6 +29,9 @@ function RenderedCliLog({ log }: { log: CliLog }) { size="small" style={{ backgroundColor: levelColorMap[level], color: "white" }} /> + {target && ( + + )} {fields.message} diff --git a/src-gui/yarn.lock b/src-gui/yarn.lock index 1eda4a1b..574058fa 100644 --- a/src-gui/yarn.lock +++ b/src-gui/yarn.lock @@ -399,6 +399,11 @@ resolved "https://registry.yarnpkg.com/@eslint/object-schema/-/object-schema-2.1.4.tgz#9e69f8bb4031e11df79e03db09f9dbbae1740843" integrity sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ== +"@fontsource/roboto@^5.1.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@fontsource/roboto/-/roboto-5.1.0.tgz#00230737ec09c60ae877a5e33d067c0607fdd5ba" + integrity sha512-cFRRC1s6RqPygeZ8Uw/acwVHqih8Czjt6Q0MwoUoDe9U3m4dH1HmNDRBZyqlMSFwgNAUKgFImncKdmDHyKpwdg== + "@humanwhocodes/module-importer@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 73a2e9fd..0a7a07d7 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -16,14 +16,12 @@ tauri-build = { version = "2.0", features = [ "config-json5" ] } [dependencies] anyhow = "1" -once_cell = "1" serde = { version = "1", features = [ "derive" ] } serde_json = "1" swap = { path = "../swap", features = [ "tauri" ] } sysinfo = "=0.32.0" tauri = { version = "2.0", features = [ "config-json5" ] } tauri-plugin-clipboard-manager = "2.0" -tauri-plugin-devtools = "2.0" tauri-plugin-process = "2.0" tauri-plugin-shell = "2.0" tauri-plugin-store = "2.1.0" diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 71981bfd..758114b5 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -299,6 +299,7 @@ async fn initialize_context( }) .with_json(false) .with_debug(true) + .with_tor(true) .with_tauri(tauri_handle.clone()) .build() .await; diff --git a/swap/.sqlx/query-081c729a0f1ad6e4ff3e13d6702c946bc4d37d50f40670b4f51d2efcce595aa6.json b/swap/.sqlx/query-081c729a0f1ad6e4ff3e13d6702c946bc4d37d50f40670b4f51d2efcce595aa6.json new file mode 100644 index 00000000..94b77425 --- /dev/null +++ b/swap/.sqlx/query-081c729a0f1ad6e4ff3e13d6702c946bc4d37d50f40670b4f51d2efcce595aa6.json @@ -0,0 +1,20 @@ +{ + "db_name": "SQLite", + "query": "\n SELECT peer_id\n FROM peers\n WHERE swap_id = ?\n ", + "describe": { + "columns": [ + { + "name": "peer_id", + "ordinal": 0, + "type_info": "Text" + } + ], + "parameters": { + "Right": 1 + }, + "nullable": [ + false + ] + }, + "hash": "081c729a0f1ad6e4ff3e13d6702c946bc4d37d50f40670b4f51d2efcce595aa6" +} diff --git a/swap/.sqlx/query-0ab84c094964968e96a3f2bf590d9ae92227d057386921e0e57165b887de3c75.json b/swap/.sqlx/query-0ab84c094964968e96a3f2bf590d9ae92227d057386921e0e57165b887de3c75.json new file mode 100644 index 00000000..f05e8f65 --- /dev/null +++ b/swap/.sqlx/query-0ab84c094964968e96a3f2bf590d9ae92227d057386921e0e57165b887de3c75.json @@ -0,0 +1,12 @@ +{ + "db_name": "SQLite", + "query": "\n insert into peer_addresses (\n peer_id,\n address\n ) values (?, ?);\n ", + "describe": { + "columns": [], + "parameters": { + "Right": 2 + }, + "nullable": [] + }, + "hash": "0ab84c094964968e96a3f2bf590d9ae92227d057386921e0e57165b887de3c75" +} diff --git a/swap/.sqlx/query-0d465a17ebbb5761421def759c73cad023c30705d5b41a1399ef79d8d2571d7c.json b/swap/.sqlx/query-0d465a17ebbb5761421def759c73cad023c30705d5b41a1399ef79d8d2571d7c.json new file mode 100644 index 00000000..58fbb3f8 --- /dev/null +++ b/swap/.sqlx/query-0d465a17ebbb5761421def759c73cad023c30705d5b41a1399ef79d8d2571d7c.json @@ -0,0 +1,20 @@ +{ + "db_name": "SQLite", + "query": "\n SELECT min(entered_at) as start_date\n FROM swap_states\n WHERE swap_id = ?\n ", + "describe": { + "columns": [ + { + "name": "start_date", + "ordinal": 0, + "type_info": "Text" + } + ], + "parameters": { + "Right": 1 + }, + "nullable": [ + true + ] + }, + "hash": "0d465a17ebbb5761421def759c73cad023c30705d5b41a1399ef79d8d2571d7c" +} diff --git a/swap/.sqlx/query-2a356078a41b321234adf2aa385b501749f907f7c422945a8bdda2b6274f5225.json b/swap/.sqlx/query-2a356078a41b321234adf2aa385b501749f907f7c422945a8bdda2b6274f5225.json new file mode 100644 index 00000000..a42beda2 --- /dev/null +++ b/swap/.sqlx/query-2a356078a41b321234adf2aa385b501749f907f7c422945a8bdda2b6274f5225.json @@ -0,0 +1,12 @@ +{ + "db_name": "SQLite", + "query": "\n insert into peers (\n swap_id,\n peer_id\n ) values (?, ?);\n ", + "describe": { + "columns": [], + "parameters": { + "Right": 2 + }, + "nullable": [] + }, + "hash": "2a356078a41b321234adf2aa385b501749f907f7c422945a8bdda2b6274f5225" +} diff --git a/swap/.sqlx/query-50a5764546f69c118fa0b64120da50f51073d36257d49768de99ff863e3511e0.json b/swap/.sqlx/query-50a5764546f69c118fa0b64120da50f51073d36257d49768de99ff863e3511e0.json new file mode 100644 index 00000000..f83a6884 --- /dev/null +++ b/swap/.sqlx/query-50a5764546f69c118fa0b64120da50f51073d36257d49768de99ff863e3511e0.json @@ -0,0 +1,12 @@ +{ + "db_name": "SQLite", + "query": "\n insert into monero_addresses (\n swap_id,\n address\n ) values (?, ?);\n ", + "describe": { + "columns": [], + "parameters": { + "Right": 2 + }, + "nullable": [] + }, + "hash": "50a5764546f69c118fa0b64120da50f51073d36257d49768de99ff863e3511e0" +} diff --git a/swap/.sqlx/query-5cc61dd0315571bc198401a354cd9431ee68360941f341386cbacf44ea598de8.json b/swap/.sqlx/query-5cc61dd0315571bc198401a354cd9431ee68360941f341386cbacf44ea598de8.json new file mode 100644 index 00000000..7f58635f --- /dev/null +++ b/swap/.sqlx/query-5cc61dd0315571bc198401a354cd9431ee68360941f341386cbacf44ea598de8.json @@ -0,0 +1,26 @@ +{ + "db_name": "SQLite", + "query": "\n SELECT swap_id, state\n FROM (\n SELECT max(id), swap_id, state\n FROM swap_states\n GROUP BY swap_id\n )\n ", + "describe": { + "columns": [ + { + "name": "swap_id", + "ordinal": 0, + "type_info": "Text" + }, + { + "name": "state", + "ordinal": 1, + "type_info": "Text" + } + ], + "parameters": { + "Right": 0 + }, + "nullable": [ + true, + true + ] + }, + "hash": "5cc61dd0315571bc198401a354cd9431ee68360941f341386cbacf44ea598de8" +} diff --git a/swap/.sqlx/query-88f761a4f7a0429cad1df0b1bebb1c0a27b2a45656549b23076d7542cfa21ecf.json b/swap/.sqlx/query-88f761a4f7a0429cad1df0b1bebb1c0a27b2a45656549b23076d7542cfa21ecf.json new file mode 100644 index 00000000..b7429dcd --- /dev/null +++ b/swap/.sqlx/query-88f761a4f7a0429cad1df0b1bebb1c0a27b2a45656549b23076d7542cfa21ecf.json @@ -0,0 +1,20 @@ +{ + "db_name": "SQLite", + "query": "\n SELECT state\n FROM swap_states\n WHERE swap_id = ?\n ORDER BY id desc\n LIMIT 1;\n\n ", + "describe": { + "columns": [ + { + "name": "state", + "ordinal": 0, + "type_info": "Text" + } + ], + "parameters": { + "Right": 1 + }, + "nullable": [ + false + ] + }, + "hash": "88f761a4f7a0429cad1df0b1bebb1c0a27b2a45656549b23076d7542cfa21ecf" +} diff --git a/swap/.sqlx/query-98a8b7f4971e0eb4ab8f5aa688aa22e7fdc6b925de211f7784782f051c2dcd8c.json b/swap/.sqlx/query-98a8b7f4971e0eb4ab8f5aa688aa22e7fdc6b925de211f7784782f051c2dcd8c.json new file mode 100644 index 00000000..5a5f8c4f --- /dev/null +++ b/swap/.sqlx/query-98a8b7f4971e0eb4ab8f5aa688aa22e7fdc6b925de211f7784782f051c2dcd8c.json @@ -0,0 +1,20 @@ +{ + "db_name": "SQLite", + "query": "SELECT DISTINCT address FROM monero_addresses", + "describe": { + "columns": [ + { + "name": "address", + "ordinal": 0, + "type_info": "Text" + } + ], + "parameters": { + "Right": 0 + }, + "nullable": [ + false + ] + }, + "hash": "98a8b7f4971e0eb4ab8f5aa688aa22e7fdc6b925de211f7784782f051c2dcd8c" +} diff --git a/swap/.sqlx/query-b703032b4ddc627a1124817477e7a8e5014bdc694c36a14053ef3bb2fc0c69b0.json b/swap/.sqlx/query-b703032b4ddc627a1124817477e7a8e5014bdc694c36a14053ef3bb2fc0c69b0.json new file mode 100644 index 00000000..79ade14e --- /dev/null +++ b/swap/.sqlx/query-b703032b4ddc627a1124817477e7a8e5014bdc694c36a14053ef3bb2fc0c69b0.json @@ -0,0 +1,12 @@ +{ + "db_name": "SQLite", + "query": "\n insert into swap_states (\n swap_id,\n entered_at,\n state\n ) values (?, ?, ?);\n ", + "describe": { + "columns": [], + "parameters": { + "Right": 3 + }, + "nullable": [] + }, + "hash": "b703032b4ddc627a1124817477e7a8e5014bdc694c36a14053ef3bb2fc0c69b0" +} diff --git a/swap/.sqlx/query-ce270dd4a4b9615695a79864240c5401e2122077365e5e5a19408c068c7f9454.json b/swap/.sqlx/query-ce270dd4a4b9615695a79864240c5401e2122077365e5e5a19408c068c7f9454.json new file mode 100644 index 00000000..4927cda6 --- /dev/null +++ b/swap/.sqlx/query-ce270dd4a4b9615695a79864240c5401e2122077365e5e5a19408c068c7f9454.json @@ -0,0 +1,20 @@ +{ + "db_name": "SQLite", + "query": "\n SELECT address\n FROM monero_addresses\n WHERE swap_id = ?\n ", + "describe": { + "columns": [ + { + "name": "address", + "ordinal": 0, + "type_info": "Text" + } + ], + "parameters": { + "Right": 1 + }, + "nullable": [ + false + ] + }, + "hash": "ce270dd4a4b9615695a79864240c5401e2122077365e5e5a19408c068c7f9454" +} diff --git a/swap/.sqlx/query-d78acba5eb8563826dd190e0886aa665aae3c6f1e312ee444e65df1c95afe8b2.json b/swap/.sqlx/query-d78acba5eb8563826dd190e0886aa665aae3c6f1e312ee444e65df1c95afe8b2.json new file mode 100644 index 00000000..cf0105e2 --- /dev/null +++ b/swap/.sqlx/query-d78acba5eb8563826dd190e0886aa665aae3c6f1e312ee444e65df1c95afe8b2.json @@ -0,0 +1,20 @@ +{ + "db_name": "SQLite", + "query": "\n SELECT DISTINCT address\n FROM peer_addresses\n WHERE peer_id = ?\n ", + "describe": { + "columns": [ + { + "name": "address", + "ordinal": 0, + "type_info": "Text" + } + ], + "parameters": { + "Right": 1 + }, + "nullable": [ + false + ] + }, + "hash": "d78acba5eb8563826dd190e0886aa665aae3c6f1e312ee444e65df1c95afe8b2" +} diff --git a/swap/.sqlx/query-e05620f420f8c1022971eeb66a803323a8cf258cbebb2834e3f7cf8f812fa646.json b/swap/.sqlx/query-e05620f420f8c1022971eeb66a803323a8cf258cbebb2834e3f7cf8f812fa646.json new file mode 100644 index 00000000..5eb6fef3 --- /dev/null +++ b/swap/.sqlx/query-e05620f420f8c1022971eeb66a803323a8cf258cbebb2834e3f7cf8f812fa646.json @@ -0,0 +1,20 @@ +{ + "db_name": "SQLite", + "query": "\n SELECT state\n FROM swap_states\n WHERE swap_id = ?\n ", + "describe": { + "columns": [ + { + "name": "state", + "ordinal": 0, + "type_info": "Text" + } + ], + "parameters": { + "Right": 1 + }, + "nullable": [ + false + ] + }, + "hash": "e05620f420f8c1022971eeb66a803323a8cf258cbebb2834e3f7cf8f812fa646" +} diff --git a/swap/.sqlx/query-e36c287aa98ae80ad4b6bb6f7e4b59cced041406a9db71da827b09f0d3bacfd6.json b/swap/.sqlx/query-e36c287aa98ae80ad4b6bb6f7e4b59cced041406a9db71da827b09f0d3bacfd6.json new file mode 100644 index 00000000..d836424a --- /dev/null +++ b/swap/.sqlx/query-e36c287aa98ae80ad4b6bb6f7e4b59cced041406a9db71da827b09f0d3bacfd6.json @@ -0,0 +1,12 @@ +{ + "db_name": "SQLite", + "query": "\n INSERT INTO buffered_transfer_proofs (\n swap_id,\n proof\n ) VALUES (?, ?);\n ", + "describe": { + "columns": [], + "parameters": { + "Right": 2 + }, + "nullable": [] + }, + "hash": "e36c287aa98ae80ad4b6bb6f7e4b59cced041406a9db71da827b09f0d3bacfd6" +} diff --git a/swap/.sqlx/query-e9d422daf774d099fcbde6c4cda35821da948bd86cc57798b4d8375baf0b51ae.json b/swap/.sqlx/query-e9d422daf774d099fcbde6c4cda35821da948bd86cc57798b4d8375baf0b51ae.json new file mode 100644 index 00000000..f375b6b6 --- /dev/null +++ b/swap/.sqlx/query-e9d422daf774d099fcbde6c4cda35821da948bd86cc57798b4d8375baf0b51ae.json @@ -0,0 +1,20 @@ +{ + "db_name": "SQLite", + "query": "\n SELECT proof\n FROM buffered_transfer_proofs\n WHERE swap_id = ?\n ", + "describe": { + "columns": [ + { + "name": "proof", + "ordinal": 0, + "type_info": "Text" + } + ], + "parameters": { + "Right": 1 + }, + "nullable": [ + false + ] + }, + "hash": "e9d422daf774d099fcbde6c4cda35821da948bd86cc57798b4d8375baf0b51ae" +} diff --git a/swap/Cargo.toml b/swap/Cargo.toml index d1569937..d2b8c7bf 100644 --- a/swap/Cargo.toml +++ b/swap/Cargo.toml @@ -13,6 +13,7 @@ tauri = [ "dep:tauri" ] [dependencies] anyhow = "1" +arti-client = { version = "0.24.0", features = [ "static-sqlite", "tokio", "rustls" ], default-features = false } async-compression = { version = "0.3", features = [ "bzip2", "tokio" ] } async-trait = "0.1" asynchronous-codec = "0.7.0" @@ -29,7 +30,6 @@ conquer-once = "0.4" curve25519-dalek = { package = "curve25519-dalek-ng", version = "4" } data-encoding = "2.6" dialoguer = "0.11" -digest = "0.10.7" directories-next = "2" ecdsa_fun = { version = "0.10", default-features = false, features = [ "libsecp_compat", @@ -37,14 +37,12 @@ ecdsa_fun = { version = "0.10", default-features = false, features = [ "adaptor", ] } ed25519-dalek = "1" -erased-serde = "0.4.5" futures = { version = "0.3", default-features = false } hex = "0.4" -hyper = "0.14.20" -itertools = "0.13" jsonrpsee = { version = "0.16.2", features = [ "server" ] } jsonrpsee-core = "0.16.2" libp2p = { version = "0.53.2", features = [ "tcp", "yamux", "dns", "noise", "request-response", "ping", "rendezvous", "identify", "macros", "cbor", "json", "tokio", "serde", "rsa" ] } +libp2p-community-tor = { git = "https://github.com/UnstoppableSwap/libp2p-tor", branch = "main" } monero = { version = "0.12", features = [ "serde_support" ] } monero-rpc = { path = "../monero-rpc" } once_cell = "1.19" @@ -73,10 +71,9 @@ sigma_fun = { version = "0.7", default-features = false, features = [ "secp256k1", "alloc", ] } -sqlx = { version = "0.6.3", features = [ +sqlx = { version = "0.8", features = [ "sqlite", "runtime-tokio-rustls", - "offline", ] } structopt = "0.3" strum = { version = "0.26", features = [ "derive" ] } @@ -95,10 +92,10 @@ tokio = { version = "1", features = [ "net", "parking_lot", ] } -tokio-socks = "0.5" tokio-tungstenite = { version = "0.15", features = [ "rustls-tls" ] } tokio-util = { version = "0.7", features = [ "io", "codec" ] } toml = "0.8" +tor-rtcompat = "0.24.0" torut = { version = "0.2", default-features = false, features = [ "v3", "control", @@ -107,7 +104,6 @@ tower = { version = "0.4.13", features = [ "full" ] } tower-http = { version = "0.3.4", features = [ "full" ] } tracing = { version = "0.1", features = [ "attributes" ] } tracing-appender = "0.2" -tracing-futures = { version = "0.2", features = [ "std-future", "futures-03" ] } tracing-subscriber = { version = "0.3", default-features = false, features = [ "fmt", "ansi", @@ -131,13 +127,10 @@ zip = "0.5" [dev-dependencies] bitcoin-harness = { git = "https://github.com/delta1/bitcoin-harness-rs.git", rev = "80cc8d05db2610d8531011be505b7bee2b5cdf9f" } get-port = "3" -hyper = "1.3" jsonrpsee = { version = "0.16.2", features = [ "ws-client" ] } mockito = "1.4" monero-harness = { path = "../monero-harness" } -port_check = "0.2" proptest = "1" -sequential-test = "0.2.4" serde_cbor = "0.11" serial_test = "3.1" tempfile = "3" diff --git a/swap/src/cli.rs b/swap/src/cli.rs index 3ea3a947..7fc460d2 100644 --- a/swap/src/cli.rs +++ b/swap/src/cli.rs @@ -4,6 +4,7 @@ pub mod cancel_and_refund; pub mod command; mod event_loop; mod list_sellers; +mod tor; pub mod transport; pub mod watcher; @@ -45,7 +46,7 @@ mod tests { rendezvous_peer_id, rendezvous_address, namespace, - 0, + None, identity::Keypair::generate_ed25519(), ); let sellers = tokio::time::timeout(Duration::from_secs(15), list_sellers) diff --git a/swap/src/cli/api.rs b/swap/src/cli/api.rs index 4ac4a573..f11ae19e 100644 --- a/swap/src/cli/api.rs +++ b/swap/src/cli/api.rs @@ -1,7 +1,7 @@ pub mod request; pub mod tauri_bindings; -use crate::cli::command::{Bitcoin, Monero, Tor}; +use crate::cli::command::{Bitcoin, Monero}; use crate::common::tracing_util::Format; use crate::database::{open_db, AccessMode}; use crate::env::{Config as EnvConfig, GetConfig, Mainnet, Testnet}; @@ -12,6 +12,7 @@ use crate::seed::Seed; use crate::{bitcoin, common, monero}; use anyhow::anyhow; use anyhow::{bail, Context as AnyContext, Error, Result}; +use arti_client::TorClient; use futures::future::try_join_all; use std::fmt; use std::future::Future; @@ -22,18 +23,19 @@ use tauri_bindings::{ }; use tokio::sync::{broadcast, broadcast::Sender, Mutex as TokioMutex, RwLock}; use tokio::task::JoinHandle; +use tor_rtcompat::tokio::TokioRustlsRuntime; use tracing::level_filters::LevelFilter; use tracing::Level; use url::Url; use uuid::Uuid; +use super::tor::init_tor_client; use super::watcher::Watcher; static START: Once = Once::new(); #[derive(Clone, PartialEq, Debug)] pub struct Config { - tor_socks5_port: u16, namespace: XmrBtcNamespace, pub env_config: EnvConfig, seed: Option, @@ -188,6 +190,7 @@ pub struct Context { bitcoin_wallet: Option>, monero_wallet: Option>, monero_rpc_process: Option>>, + tor_client: Option>>, } /// A conveniant builder struct for [`Context`]. @@ -196,11 +199,11 @@ pub struct Context { pub struct ContextBuilder { monero: Option, bitcoin: Option, - tor: Option, data: Option, is_testnet: bool, debug: bool, json: bool, + tor: bool, tauri_handle: Option, } @@ -219,11 +222,11 @@ impl ContextBuilder { ContextBuilder { monero: None, bitcoin: None, - tor: None, data: None, is_testnet: false, debug: false, json: false, + tor: false, tauri_handle: None, } } @@ -247,12 +250,6 @@ impl ContextBuilder { self } - /// Configures the Context to use Tor with the given configuration. - pub fn with_tor(mut self, tor: impl Into>) -> Self { - self.tor = tor.into(); - self - } - /// Attach a handle to Tauri to the Context for emitting events etc. pub fn with_tauri(mut self, tauri: impl Into>) -> Self { self.tauri_handle = tauri.into(); @@ -277,6 +274,12 @@ impl ContextBuilder { self } + /// Whether to initialize a Tor client (default false) + pub fn with_tor(mut self, tor: bool) -> Self { + self.tor = tor; + self + } + /// Takes the builder, initializes the context by initializing the wallets and other components and returns the Context. pub async fn build(self) -> Result { let data_dir = data::data_dir_from(self.data, self.is_testnet)?; @@ -343,6 +346,7 @@ impl ContextBuilder { self.tauri_handle.clone(), ) .await?; + (Some(Arc::new(wlt)), Some(Arc::new(SyncMutex::new(prc)))) } else { (None, None) @@ -356,8 +360,6 @@ impl ContextBuilder { TauriContextInitializationProgress::OpeningDatabase, )); - let tor_socks5_port = self.tor.map_or(9050, |tor| tor.tor_socks5_port); - // If we are connected to the Bitcoin blockchain and if there is a handle to Tauri present, // we start a background task to watch for timelock changes. if let Some(wallet) = bitcoin_wallet.clone() { @@ -372,13 +374,28 @@ impl ContextBuilder { } } + self.tauri_handle + .emit_context_init_progress_event(TauriContextStatusEvent::Initializing( + TauriContextInitializationProgress::EstablishingTorCircuits, + )); + + let tor = if self.tor { + init_tor_client(&data_dir) + .await + .inspect_err(|err| { + tracing::error!(%err, "Failed to establish Tor client"); + }) + .ok() + } else { + None + }; + let context = Context { db, bitcoin_wallet, monero_wallet, monero_rpc_process, config: Config { - tor_socks5_port, namespace: XmrBtcNamespace::from_is_testnet(self.is_testnet), env_config, seed: Some(seed), @@ -390,6 +407,7 @@ impl ContextBuilder { swap_lock, tasks: Arc::new(PendingTaskList::default()), tauri_handle: self.tauri_handle, + tor_client: tor, }; Ok(context) @@ -423,6 +441,7 @@ impl Context { swap_lock: Arc::new(SwapLock::new()), tasks: Arc::new(PendingTaskList::default()), tauri_handle: None, + tor_client: None, } } @@ -539,7 +558,6 @@ impl Config { let data_dir = data::data_dir_from(None, false).expect("Could not find data directory"); Self { - tor_socks5_port: 9050, namespace: XmrBtcNamespace::from_is_testnet(false), env_config, seed: Some(seed), @@ -576,7 +594,6 @@ pub mod api_test { let env_config = env_config_from(is_testnet); Self { - tor_socks5_port: 9050, namespace: XmrBtcNamespace::from_is_testnet(is_testnet), env_config, seed: Some(seed), diff --git a/swap/src/cli/api/request.rs b/swap/src/cli/api/request.rs index 7a8942ba..bfd10e4e 100644 --- a/swap/src/cli/api/request.rs +++ b/swap/src/cli/api/request.rs @@ -625,7 +625,7 @@ pub async fn buy_xmr( let mut swarm = swarm::cli( seed.derive_libp2p_identity(), - context.config.tor_socks5_port, + context.tor_client.clone(), behaviour, ) .await?; @@ -813,7 +813,7 @@ pub async fn resume_swap( ), (seed.clone(), context.config.namespace), ); - let mut swarm = swarm::cli(seed.clone(), context.config.tor_socks5_port, behaviour).await?; + let mut swarm = swarm::cli(seed.clone(), context.tor_client.clone(), behaviour).await?; let our_peer_id = swarm.local_peer_id(); tracing::debug!(peer_id = %our_peer_id, "Network layer initialized"); @@ -1083,7 +1083,7 @@ pub async fn list_sellers( rendezvous_node_peer_id, rendezvous_point, context.config.namespace, - context.config.tor_socks5_port, + context.tor_client.clone(), identity, ) .await?; @@ -1224,17 +1224,9 @@ where } loop { - println!("max_giveable: {}", max_giveable); - println!("bid_quote.min_quantity: {}", bid_quote.min_quantity); let min_outstanding = bid_quote.min_quantity - max_giveable; - println!("min_outstanding: {}", min_outstanding); let min_bitcoin_lock_tx_fee = estimate_fee(min_outstanding).await?; - println!("min_bitcoin_lock_tx_fee: {}", min_bitcoin_lock_tx_fee); let min_deposit_until_swap_will_start = min_outstanding + min_bitcoin_lock_tx_fee; - println!( - "min_deposit_until_swap_will_start: {}", - min_deposit_until_swap_will_start - ); let max_deposit_until_maximum_amount_is_reached = maximum_amount - max_giveable + min_bitcoin_lock_tx_fee; diff --git a/swap/src/cli/api/tauri_bindings.rs b/swap/src/cli/api/tauri_bindings.rs index 576a3ee5..9e2e4a52 100644 --- a/swap/src/cli/api/tauri_bindings.rs +++ b/swap/src/cli/api/tauri_bindings.rs @@ -123,6 +123,7 @@ pub enum TauriContextInitializationProgress { }, OpeningMoneroWallet, OpeningDatabase, + EstablishingTorCircuits, } #[typeshare] diff --git a/swap/src/cli/command.rs b/swap/src/cli/command.rs index 15ce38bc..9810f7e5 100644 --- a/swap/src/cli/command.rs +++ b/swap/src/cli/command.rs @@ -33,8 +33,6 @@ pub const DEFAULT_ELECTRUM_RPC_URL_TESTNET: &str = "tcp://electrum.blockstream.i const DEFAULT_BITCOIN_CONFIRMATION_TARGET: u16 = 1; pub const DEFAULT_BITCOIN_CONFIRMATION_TARGET_TESTNET: u16 = 1; -const DEFAULT_TOR_SOCKS5_PORT: &str = "9050"; - /// Represents the result of parsing the command-line parameters. #[derive(Debug)] @@ -85,9 +83,9 @@ where let context = Arc::new( ContextBuilder::new(is_testnet) + .with_tor(tor.enable_tor) .with_bitcoin(bitcoin) .with_monero(monero) - .with_tor(tor) .with_data_dir(data) .with_debug(debug) .with_json(json) @@ -184,9 +182,9 @@ where } => { let context = Arc::new( ContextBuilder::new(is_testnet) + .with_tor(tor.enable_tor) .with_bitcoin(bitcoin) .with_monero(monero) - .with_tor(tor) .with_data_dir(data) .with_debug(debug) .with_json(json) @@ -231,9 +229,9 @@ where } => { let context = Arc::new( ContextBuilder::new(is_testnet) + .with_tor(tor.enable_tor) .with_bitcoin(bitcoin) .with_monero(monero) - .with_tor(tor) .with_data_dir(data) .with_debug(debug) .with_json(json) @@ -248,12 +246,10 @@ where CliCommand::CancelAndRefund { swap_id: SwapId { swap_id }, bitcoin, - tor, } => { let context = Arc::new( ContextBuilder::new(is_testnet) .with_bitcoin(bitcoin) - .with_tor(tor) .with_data_dir(data) .with_debug(debug) .with_json(json) @@ -273,7 +269,7 @@ where } => { let context = Arc::new( ContextBuilder::new(is_testnet) - .with_tor(tor) + .with_tor(tor.enable_tor) .with_data_dir(data) .with_debug(debug) .with_json(json) @@ -475,9 +471,6 @@ enum CliCommand { #[structopt(flatten)] bitcoin: Bitcoin, - - #[structopt(flatten)] - tor: Tor, }, /// Discover and list sellers (i.e. ASB providers) ListSellers { @@ -562,11 +555,10 @@ impl Bitcoin { #[derive(structopt::StructOpt, Debug)] pub struct Tor { #[structopt( - long = "tor-socks5-port", - help = "Your local Tor socks5 proxy port", - default_value = DEFAULT_TOR_SOCKS5_PORT + long = "enable-tor", + help = "Bootstrap a tor client and use it for all libp2p connections" )] - pub tor_socks5_port: u16, + pub enable_tor: bool, } #[derive(structopt::StructOpt, Debug)] diff --git a/swap/src/cli/list_sellers.rs b/swap/src/cli/list_sellers.rs index 5464f233..1bbb5224 100644 --- a/swap/src/cli/list_sellers.rs +++ b/swap/src/cli/list_sellers.rs @@ -2,6 +2,7 @@ use crate::network::quote::BidQuote; use crate::network::rendezvous::XmrBtcNamespace; use crate::network::{quote, swarm}; use anyhow::{Context, Result}; +use arti_client::TorClient; use futures::StreamExt; use libp2p::multiaddr::Protocol; use libp2p::request_response; @@ -12,7 +13,9 @@ use serde::Serialize; use serde_with::{serde_as, DisplayFromStr}; use std::collections::hash_map::Entry; use std::collections::HashMap; +use std::sync::Arc; use std::time::Duration; +use tor_rtcompat::tokio::TokioRustlsRuntime; use typeshare::typeshare; /// Returns sorted list of sellers, with [Online](Status::Online) listed first. @@ -25,7 +28,7 @@ pub async fn list_sellers( rendezvous_node_peer_id: PeerId, rendezvous_node_addr: Multiaddr, namespace: XmrBtcNamespace, - tor_socks5_port: u16, + maybe_tor_client: Option>>, identity: identity::Keypair, ) -> Result> { let behaviour = Behaviour { @@ -33,7 +36,7 @@ pub async fn list_sellers( quote: quote::cli(), ping: ping::Behaviour::new(ping::Config::new().with_timeout(Duration::from_secs(60))), }; - let mut swarm = swarm::cli(identity, tor_socks5_port, behaviour).await?; + let mut swarm = swarm::cli(identity, maybe_tor_client, behaviour).await?; swarm.add_peer_address(rendezvous_node_peer_id, rendezvous_node_addr.clone()); diff --git a/swap/src/cli/tor.rs b/swap/src/cli/tor.rs new file mode 100644 index 00000000..070669a0 --- /dev/null +++ b/swap/src/cli/tor.rs @@ -0,0 +1,30 @@ +use std::path::Path; +use std::sync::Arc; + +use arti_client::{config::TorClientConfigBuilder, Error, TorClient}; +use tor_rtcompat::tokio::TokioRustlsRuntime; + +pub async fn init_tor_client(data_dir: &Path) -> Result>, Error> { + // We store the Tor state in the data directory + let data_dir = data_dir.join("tor"); + let state_dir = data_dir.join("state"); + let cache_dir = data_dir.join("cache"); + + // The client configuration describes how to connect to the Tor network, + // and what directories to use for storing persistent state. + let config = TorClientConfigBuilder::from_directories(state_dir, cache_dir) + .build() + .expect("We initialized the Tor client all required attributes"); + + // Start the Arti client, and let it bootstrap a connection to the Tor network. + // (This takes a while to gather the necessary directory information. + // It uses cached information when possible.) + let runtime = TokioRustlsRuntime::current().expect("We are always running with tokio"); + + let tor_client = TorClient::with_runtime(runtime) + .config(config) + .create_bootstrapped() + .await?; + + Ok(Arc::new(tor_client)) +} diff --git a/swap/src/cli/transport.rs b/swap/src/cli/transport.rs index b70fb299..6c3f32b6 100644 --- a/swap/src/cli/transport.rs +++ b/swap/src/cli/transport.rs @@ -1,11 +1,15 @@ -use crate::network::tor_transport::TorDialOnlyTransport; +use std::sync::Arc; + use crate::network::transport::authenticate_and_multiplex; use anyhow::Result; +use arti_client::TorClient; use libp2p::core::muxing::StreamMuxerBox; use libp2p::core::transport::{Boxed, OptionalTransport}; use libp2p::dns; use libp2p::tcp; use libp2p::{identity, PeerId, Transport}; +use libp2p_community_tor::{AddressConversion, TorTransport}; +use tor_rtcompat::tokio::TokioRustlsRuntime; /// Creates the libp2p transport for the swap CLI. /// @@ -17,13 +21,16 @@ use libp2p::{identity, PeerId, Transport}; /// TCP transport. pub fn new( identity: &identity::Keypair, - maybe_tor_socks5_port: Option, + maybe_tor_client: Option>>, ) -> Result> { let tcp = tcp::tokio::Transport::new(tcp::Config::new().nodelay(true)); let tcp_with_dns = dns::tokio::Transport::system(tcp)?; - let maybe_tor_transport = match maybe_tor_socks5_port { - Some(port) => OptionalTransport::some(TorDialOnlyTransport::new(port)), + let maybe_tor_transport: OptionalTransport = match maybe_tor_client { + Some(client) => OptionalTransport::some(libp2p_community_tor::TorTransport::from_client( + client, + AddressConversion::IpAndDns, + )), None => OptionalTransport::none(), }; diff --git a/swap/src/common/tracing_util.rs b/swap/src/common/tracing_util.rs index bad75a4c..f8ba47ee 100644 --- a/swap/src/common/tracing_util.rs +++ b/swap/src/common/tracing_util.rs @@ -72,7 +72,7 @@ pub fn init( .with_writer(TauriWriter::new(tauri_handle)) .with_ansi(false) .with_timer(UtcTime::rfc_3339()) - .with_target(false) + .with_target(true) .json() .with_filter(env_filter(level_filter)?); @@ -101,6 +101,12 @@ fn env_filter(level_filter: LevelFilter) -> Result { Ok(EnvFilter::from_default_env() .add_directive(Directive::from_str(&format!("asb={}", &level_filter))?) .add_directive(Directive::from_str(&format!("swap={}", &level_filter))?) + .add_directive(Directive::from_str(&format!("arti={}", &level_filter))?) + .add_directive(Directive::from_str(&format!("libp2p={}", &level_filter))?) + .add_directive(Directive::from_str(&format!( + "libp2p_community_tor={}", + &level_filter + ))?) .add_directive(Directive::from_str(&format!( "unstoppableswap-gui-rs={}", &level_filter diff --git a/swap/src/database/sqlite.rs b/swap/src/database/sqlite.rs index 36f5b99e..93403aba 100644 --- a/swap/src/database/sqlite.rs +++ b/swap/src/database/sqlite.rs @@ -29,7 +29,7 @@ impl SqliteDatabase { let path_str = format!("sqlite:{}", path.as_ref().display()); - let mut options = SqliteConnectOptions::from_str(&path_str)?.read_only(read_only); + let options = SqliteConnectOptions::from_str(&path_str)?.read_only(read_only); let options = options.disable_statement_logging(); let pool = SqlitePool::connect_with(options.to_owned()).await?; @@ -59,8 +59,6 @@ impl SqliteDatabase { #[async_trait] impl Database for SqliteDatabase { async fn insert_peer_id(&self, swap_id: Uuid, peer_id: PeerId) -> Result<()> { - let mut conn = self.pool.acquire().await?; - let swap_id = swap_id.to_string(); let peer_id = peer_id.to_string(); @@ -74,15 +72,13 @@ impl Database for SqliteDatabase { swap_id, peer_id ) - .execute(&mut conn) + .execute(&self.pool) .await?; Ok(()) } async fn get_peer_id(&self, swap_id: Uuid) -> Result { - let mut conn = self.pool.acquire().await?; - let swap_id = swap_id.to_string(); let row = sqlx::query!( @@ -93,7 +89,7 @@ impl Database for SqliteDatabase { "#, swap_id ) - .fetch_one(&mut conn) + .fetch_one(&self.pool) .await?; let peer_id = PeerId::from_str(&row.peer_id)?; @@ -101,8 +97,6 @@ impl Database for SqliteDatabase { } async fn insert_monero_address(&self, swap_id: Uuid, address: Address) -> Result<()> { - let mut conn = self.pool.acquire().await?; - let swap_id = swap_id.to_string(); let address = address.to_string(); @@ -116,15 +110,13 @@ impl Database for SqliteDatabase { swap_id, address ) - .execute(&mut conn) + .execute(&self.pool) .await?; Ok(()) } async fn get_monero_address(&self, swap_id: Uuid) -> Result
{ - let mut conn = self.pool.acquire().await?; - let swap_id = swap_id.to_string(); let row = sqlx::query!( @@ -135,7 +127,7 @@ impl Database for SqliteDatabase { "#, swap_id ) - .fetch_one(&mut conn) + .fetch_one(&self.pool) .await?; let address = row.address.parse()?; @@ -144,10 +136,8 @@ impl Database for SqliteDatabase { } async fn get_monero_addresses(&self) -> Result> { - let mut conn = self.pool.acquire().await?; - let rows = sqlx::query!("SELECT DISTINCT address FROM monero_addresses") - .fetch_all(&mut conn) + .fetch_all(&self.pool) .await?; let addresses = rows @@ -159,8 +149,6 @@ impl Database for SqliteDatabase { } async fn insert_address(&self, peer_id: PeerId, address: Multiaddr) -> Result<()> { - let mut conn = self.pool.acquire().await?; - let peer_id = peer_id.to_string(); let address = address.to_string(); @@ -174,15 +162,13 @@ impl Database for SqliteDatabase { peer_id, address ) - .execute(&mut conn) + .execute(&self.pool) .await?; Ok(()) } async fn get_addresses(&self, peer_id: PeerId) -> Result> { - let mut conn = self.pool.acquire().await?; - let peer_id = peer_id.to_string(); let rows = sqlx::query!( @@ -193,7 +179,7 @@ impl Database for SqliteDatabase { "#, peer_id, ) - .fetch_all(&mut conn) + .fetch_all(&self.pool) .await?; let addresses = rows @@ -208,7 +194,6 @@ impl Database for SqliteDatabase { } async fn get_swap_start_date(&self, swap_id: Uuid) -> Result { - let mut conn = self.pool.acquire().await?; let swap_id = swap_id.to_string(); let row = sqlx::query!( @@ -219,7 +204,7 @@ impl Database for SqliteDatabase { "#, swap_id ) - .fetch_one(&mut conn) + .fetch_one(&self.pool) .await?; row.start_date @@ -227,7 +212,6 @@ impl Database for SqliteDatabase { } async fn insert_latest_state(&self, swap_id: Uuid, state: State) -> Result<()> { - let mut conn = self.pool.acquire().await?; let entered_at = OffsetDateTime::now_utc(); let swap = serde_json::to_string(&Swap::from(state))?; @@ -246,7 +230,7 @@ impl Database for SqliteDatabase { entered_at, swap ) - .execute(&mut conn) + .execute(&self.pool) .await?; // Emit event to Tauri, the frontend will then send another request to get the latest state @@ -257,7 +241,6 @@ impl Database for SqliteDatabase { } async fn get_state(&self, swap_id: Uuid) -> Result { - let mut conn = self.pool.acquire().await?; let swap_id = swap_id.to_string(); let row = sqlx::query!( r#" @@ -270,7 +253,7 @@ impl Database for SqliteDatabase { "#, swap_id ) - .fetch_all(&mut conn) + .fetch_all(&self.pool) .await?; let row = row @@ -282,34 +265,38 @@ impl Database for SqliteDatabase { } async fn all(&self) -> Result> { - let mut conn = self.pool.acquire().await?; let rows = sqlx::query!( r#" - SELECT swap_id, state - FROM ( - SELECT max(id), swap_id, state - FROM swap_states - GROUP BY swap_id - ) + SELECT swap_id, state + FROM ( + SELECT max(id), swap_id, state + FROM swap_states + GROUP BY swap_id + ) "# ) - .fetch_all(&mut conn) + .fetch_all(&self.pool) .await?; let result = rows .iter() .filter_map(|row| { - let swap_id = match Uuid::from_str(&row.swap_id) { + let (Some(swap_id), Some(state)) = (&row.swap_id, &row.state) else { + tracing::error!("Row didn't contain state or swap_id when it should have"); + return None; + }; + + let swap_id = match Uuid::from_str(swap_id) { Ok(id) => id, Err(e) => { - tracing::error!(swap_id = %row.swap_id, error = ?e, "Failed to parse UUID"); + tracing::error!(%swap_id, error = ?e, "Failed to parse UUID"); return None; } }; - let state = match serde_json::from_str::(&row.state) { + let state = match serde_json::from_str::(state) { Ok(a) => State::from(a), Err(e) => { - tracing::error!(swap_id = %swap_id, error = ?e, "Failed to deserialize state"); + tracing::error!(%swap_id, error = ?e, "Failed to deserialize state"); return None; } }; @@ -322,7 +309,6 @@ impl Database for SqliteDatabase { } async fn get_states(&self, swap_id: Uuid) -> Result> { - let mut conn = self.pool.acquire().await?; let swap_id = swap_id.to_string(); // TODO: We should use query! instead of query here to allow for at-compile-time validation @@ -335,7 +321,7 @@ impl Database for SqliteDatabase { "#, swap_id ) - .fetch_all(&mut conn) + .fetch_all(&self.pool) .await?; let result = rows @@ -359,7 +345,6 @@ impl Database for SqliteDatabase { swap_id: Uuid, proof: TransferProof, ) -> Result<()> { - let mut conn = self.pool.acquire().await?; let swap_id = swap_id.to_string(); let proof = serde_json::to_string(&proof)?; @@ -373,14 +358,13 @@ impl Database for SqliteDatabase { swap_id, proof ) - .execute(&mut conn) + .execute(&self.pool) .await?; Ok(()) } async fn get_buffered_transfer_proof(&self, swap_id: Uuid) -> Result> { - let mut conn = self.pool.acquire().await?; let swap_id = swap_id.to_string(); let row = sqlx::query!( @@ -391,7 +375,7 @@ impl Database for SqliteDatabase { "#, swap_id ) - .fetch_all(&mut conn) + .fetch_all(&self.pool) .await?; if row.is_empty() { diff --git a/swap/src/monero/wallet_rpc.rs b/swap/src/monero/wallet_rpc.rs index 05e1633c..e684d437 100644 --- a/swap/src/monero/wallet_rpc.rs +++ b/swap/src/monero/wallet_rpc.rs @@ -27,7 +27,7 @@ use crate::cli::api::tauri_bindings::{ // See: https://www.moneroworld.com/#nodes, https://monero.fail // We don't need any testnet nodes because we don't support testnet at all -const MONERO_DAEMONS: Lazy<[MoneroDaemon; 16]> = Lazy::new(|| { +static MONERO_DAEMONS: Lazy<[MoneroDaemon; 16]> = Lazy::new(|| { [ MoneroDaemon::new("xmr-node.cakewallet.com", 18081, Network::Mainnet), MoneroDaemon::new("nodex.monerujo.io", 18081, Network::Mainnet), @@ -169,8 +169,9 @@ async fn choose_monero_daemon(network: Network) -> Result { .build()?; // We only want to check for daemons that match the specified network - let daemons = &*MONERO_DAEMONS; - let network_matching_daemons = daemons.iter().filter(|daemon| daemon.network == network); + let network_matching_daemons = MONERO_DAEMONS + .iter() + .filter(|daemon| daemon.network == network); for daemon in network_matching_daemons { match daemon.is_available(&client).await { diff --git a/swap/src/network.rs b/swap/src/network.rs index afaca7fd..5f613f93 100644 --- a/swap/src/network.rs +++ b/swap/src/network.rs @@ -7,7 +7,6 @@ pub mod redial; pub mod rendezvous; pub mod swap_setup; pub mod swarm; -pub mod tor_transport; pub mod transfer_proof; pub mod transport; diff --git a/swap/src/network/swarm.rs b/swap/src/network/swarm.rs index c3213539..9a89c2d5 100644 --- a/swap/src/network/swarm.rs +++ b/swap/src/network/swarm.rs @@ -2,13 +2,16 @@ use crate::asb::{LatestRate, RendezvousNode}; use crate::libp2p_ext::MultiAddrExt; use crate::network::rendezvous::XmrBtcNamespace; use crate::seed::Seed; -use crate::{asb, bitcoin, cli, env, tor}; +use crate::{asb, bitcoin, cli, env}; use anyhow::Result; +use arti_client::TorClient; use libp2p::swarm::NetworkBehaviour; use libp2p::SwarmBuilder; use libp2p::{identity, Multiaddr, Swarm}; use std::fmt::Debug; +use std::sync::Arc; use std::time::Duration; +use tor_rtcompat::tokio::TokioRustlsRuntime; #[allow(clippy::too_many_arguments)] pub fn asb( @@ -61,18 +64,13 @@ where pub async fn cli( identity: identity::Keypair, - tor_socks5_port: u16, + maybe_tor_client: Option>>, behaviour: T, ) -> Result> where T: NetworkBehaviour, { - let maybe_tor_socks5_port = match tor::Client::new(tor_socks5_port).assert_tor_running().await { - Ok(()) => Some(tor_socks5_port), - Err(_) => None, - }; - - let transport = cli::transport::new(&identity, maybe_tor_socks5_port)?; + let transport = cli::transport::new(&identity, maybe_tor_client)?; let swarm = SwarmBuilder::with_existing_identity(identity) .with_tokio() diff --git a/swap/src/network/tor_transport.rs b/swap/src/network/tor_transport.rs deleted file mode 100644 index 9170afc7..00000000 --- a/swap/src/network/tor_transport.rs +++ /dev/null @@ -1,258 +0,0 @@ -use anyhow::Result; -use data_encoding::BASE32; -use futures::future::{BoxFuture, Ready}; -use libp2p::core::multiaddr::{Multiaddr, Protocol}; -use libp2p::core::transport::{ListenerId, TransportError}; -use libp2p::core::Transport; -use libp2p::tcp::tokio::TcpStream; -use std::borrow::Cow; -use std::net::{Ipv4Addr, Ipv6Addr}; -use std::{fmt, io}; -use tokio_socks::tcp::Socks5Stream; - -/// A [`Transport`] that can dial onion addresses through a running Tor daemon. -#[derive(Clone)] -pub struct TorDialOnlyTransport { - socks_port: u16, -} - -impl TorDialOnlyTransport { - pub fn new(socks_port: u16) -> Self { - Self { socks_port } - } -} - -impl Transport for TorDialOnlyTransport { - type Output = TcpStream; - type Error = io::Error; - type ListenerUpgrade = Ready>; - type Dial = BoxFuture<'static, Result>; - - fn listen_on( - &mut self, - _id: ListenerId, - addr: Multiaddr, - ) -> Result<(), TransportError> { - Err(TransportError::MultiaddrNotSupported(addr)) - } - - fn dial(&mut self, addr: Multiaddr) -> Result> { - let address = TorCompatibleAddress::from_multiaddr(Cow::Borrowed(&addr))?; - - if address.is_certainly_not_reachable_via_tor_daemon() { - return Err(TransportError::MultiaddrNotSupported(addr)); - } - - let socks_port = self.socks_port; - - Ok(Box::pin(async move { - tracing::debug!(address = %addr, "Establishing connection through Tor proxy"); - - let stream = - Socks5Stream::connect((Ipv4Addr::LOCALHOST, socks_port), address.to_string()) - .await - .map_err(|e| io::Error::new(io::ErrorKind::ConnectionRefused, e))?; - - tracing::debug!("Connection through Tor established"); - - Ok(TcpStream(stream.into_inner())) - })) - } - - fn address_translation(&self, _: &Multiaddr, _: &Multiaddr) -> Option { - None - } - - fn dial_as_listener( - &mut self, - addr: Multiaddr, - ) -> Result> { - let address = TorCompatibleAddress::from_multiaddr(Cow::Borrowed(&addr))?; - - if address.is_certainly_not_reachable_via_tor_daemon() { - return Err(TransportError::MultiaddrNotSupported(addr)); - } - - let socks_port = self.socks_port; - - Ok(Box::pin(async move { - tracing::debug!(address = %addr, "Establishing connection through Tor proxy"); - - let stream = - Socks5Stream::connect((Ipv4Addr::LOCALHOST, socks_port), address.to_string()) - .await - .map_err(|e| io::Error::new(io::ErrorKind::ConnectionRefused, e))?; - - tracing::debug!("Connection through Tor established"); - - Ok(TcpStream(stream.into_inner())) - })) - } - - fn remove_listener(&mut self, _id: ListenerId) -> bool { - // TODO(Libp2p Migration): What do we need to do here? - // I believe nothing because we are not using the transport to listen. - false - } - - fn poll( - self: std::pin::Pin<&mut Self>, - _cx: &mut std::task::Context<'_>, - ) -> std::task::Poll> - { - // TODO(Libp2p Migration): What do we need to do here? - // See: https://github.com/libp2p/rust-libp2p/pull/2652 - // I believe we do not need to do anything here because we are not using the transport to listen. - // But we need to verify this before merging. - - std::task::Poll::Pending - } -} - -/// Represents an address that is _compatible_ with Tor, i.e. can be resolved by -/// the Tor daemon. -#[derive(Debug)] -enum TorCompatibleAddress { - Onion3 { host: String, port: u16 }, - Dns { address: String, port: u16 }, - Ip4 { address: Ipv4Addr, port: u16 }, - Ip6 { address: Ipv6Addr, port: u16 }, -} - -impl TorCompatibleAddress { - /// Constructs a new [`TorCompatibleAddress`] from a [`Multiaddr`]. - fn from_multiaddr(multi: Cow<'_, Multiaddr>) -> Result> { - match multi.iter().collect::>().as_slice() { - [Protocol::Onion3(onion), ..] => Ok(TorCompatibleAddress::Onion3 { - host: BASE32.encode(onion.hash()).to_lowercase(), - port: onion.port(), - }), - [Protocol::Ip4(address), Protocol::Tcp(port) | Protocol::Udp(port), ..] => { - Ok(TorCompatibleAddress::Ip4 { - address: *address, - port: *port, - }) - } - [Protocol::Dns(address) | Protocol::Dns4(address), Protocol::Tcp(port) | Protocol::Udp(port), ..] => { - Ok(TorCompatibleAddress::Dns { - address: format!("{}", address), - port: *port, - }) - } - [Protocol::Ip6(address), Protocol::Tcp(port) | Protocol::Udp(port), ..] => { - Ok(TorCompatibleAddress::Ip6 { - address: *address, - port: *port, - }) - } - _ => Err(TransportError::MultiaddrNotSupported(multi.into_owned())), - } - } - - /// Checks if the address is reachable via the Tor daemon. - /// - /// The Tor daemon can dial onion addresses, resolve DNS names and dial - /// IP4/IP6 addresses reachable via the public Internet. - /// We can't guarantee that an address is reachable via the Internet but we - /// can say that some addresses are almost certainly not reachable, for - /// example, loopback addresses. - fn is_certainly_not_reachable_via_tor_daemon(&self) -> bool { - match self { - TorCompatibleAddress::Onion3 { .. } => false, - TorCompatibleAddress::Dns { address, .. } => address == "localhost", - TorCompatibleAddress::Ip4 { address, .. } => address.is_loopback(), - TorCompatibleAddress::Ip6 { address, .. } => address.is_loopback(), - } - } -} - -impl fmt::Display for TorCompatibleAddress { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - match self { - TorCompatibleAddress::Onion3 { host, port } => write!(f, "{}.onion:{}", host, port), - TorCompatibleAddress::Dns { address, port } => write!(f, "{}:{}", address, port), - TorCompatibleAddress::Ip4 { address, port } => write!(f, "{}:{}", address, port), - TorCompatibleAddress::Ip6 { address, port } => write!(f, "{}:{}", address, port), - } - } -} - -#[cfg(test)] -pub mod test { - use super::*; - - #[test] - fn test_tor_address_string() { - let address = tor_compatible_address_from_str("/onion3/oarchy4tamydxcitaki6bc2v4leza6v35iezmu2chg2bap63sv6f2did:1024/p2p/12D3KooWPD4uHN74SHotLN7VCH7Fm8zZgaNVymYcpeF1fpD2guc9"); - - assert!(!address.is_certainly_not_reachable_via_tor_daemon()); - assert_eq!( - address.to_string(), - "oarchy4tamydxcitaki6bc2v4leza6v35iezmu2chg2bap63sv6f2did.onion:1024" - ); - } - - #[test] - fn tcp_to_address_string_should_be_some() { - let address = tor_compatible_address_from_str("/ip4/127.0.0.1/tcp/7777"); - - assert!(address.is_certainly_not_reachable_via_tor_daemon()); - assert_eq!(address.to_string(), "127.0.0.1:7777"); - } - - #[test] - fn ip6_to_address_string_should_be_some() { - let address = - tor_compatible_address_from_str("/ip6/2001:db8:85a3:8d3:1319:8a2e:370:7348/tcp/7777"); - - assert!(!address.is_certainly_not_reachable_via_tor_daemon()); - assert_eq!( - address.to_string(), - "2001:db8:85a3:8d3:1319:8a2e:370:7348:7777" - ); - } - - #[test] - fn udp_to_address_string_should_be_some() { - let address = tor_compatible_address_from_str("/ip4/127.0.0.1/udp/7777"); - - assert!(address.is_certainly_not_reachable_via_tor_daemon()); - assert_eq!(address.to_string(), "127.0.0.1:7777"); - } - - #[test] - fn ws_to_address_string_should_be_some() { - let address = tor_compatible_address_from_str("/ip4/127.0.0.1/tcp/7777/ws"); - - assert!(address.is_certainly_not_reachable_via_tor_daemon()); - assert_eq!(address.to_string(), "127.0.0.1:7777"); - } - - #[test] - fn dns4_to_address_string_should_be_some() { - let address = tor_compatible_address_from_str("/dns4/randomdomain.com/tcp/7777"); - - assert!(!address.is_certainly_not_reachable_via_tor_daemon()); - assert_eq!(address.to_string(), "randomdomain.com:7777"); - } - - #[test] - fn dns_to_address_string_should_be_some() { - let address = tor_compatible_address_from_str("/dns/randomdomain.com/tcp/7777"); - - assert!(!address.is_certainly_not_reachable_via_tor_daemon()); - assert_eq!(address.to_string(), "randomdomain.com:7777"); - } - - #[test] - fn dnsaddr_to_address_string_should_be_error() { - let address = "/dnsaddr/randomdomain.com"; - - let _ = - TorCompatibleAddress::from_multiaddr(Cow::Owned(address.parse().unwrap())).unwrap_err(); - } - - fn tor_compatible_address_from_str(str: &str) -> TorCompatibleAddress { - TorCompatibleAddress::from_multiaddr(Cow::Owned(str.parse().unwrap())).unwrap() - } -} diff --git a/swap/tests/harness/mod.rs b/swap/tests/harness/mod.rs index 99b52dfa..9abd0413 100644 --- a/swap/tests/harness/mod.rs +++ b/swap/tests/harness/mod.rs @@ -494,8 +494,6 @@ impl BobParams { swap_id: Uuid, db: Arc, ) -> Result<(cli::EventLoop, cli::EventLoopHandle)> { - let tor_socks5_port = get_port() - .expect("We don't care about Tor in the tests so we get a free port to disable it."); let identity = self.seed.derive_libp2p_identity(); let behaviour = cli::Behaviour::new( @@ -504,7 +502,7 @@ impl BobParams { self.bitcoin_wallet.clone(), (identity.clone(), XmrBtcNamespace::Testnet), ); - let mut swarm = swarm::cli(identity.clone(), tor_socks5_port, behaviour).await?; + let mut swarm = swarm::cli(identity.clone(), None, behaviour).await?; swarm.add_peer_address(self.alice_peer_id, self.alice_address.clone()); cli::EventLoop::new(swap_id, swarm, self.alice_peer_id, db.clone())