diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b07be40..8b69bd8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -155,8 +155,8 @@ jobs: # TODO: support musl # - { image: alpine:latest, commands: "apk update && apk add alpine-sdk cmake curl bash" } - { image: archlinux:latest, commands: "pacman -Syyu --noconfirm base-devel git cmake openssl" } - - { image: debian:stable, commands: "apt update && apt -y install build-essential curl cmake git libssl-dev" } - - { image: fedora:latest, commands: "dnf install --assumeyes @development-tools gcc gcc-c++ cmake git openssl-devel" } + - { image: debian:stable, commands: "apt update && apt -y install build-essential curl cmake git pkg-config libssl-dev" } + - { image: fedora:latest, commands: "dnf install --assumeyes @development-tools gcc gcc-c++ cmake git openssl-devel perl-core" } steps: - name: Checkout diff --git a/Cargo.lock b/Cargo.lock index 15743c8..932829f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,6 +17,18 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", + "zeroize", +] + [[package]] name = "ahash" version = "0.8.12" @@ -29,6 +41,61 @@ dependencies = [ "zerocopy", ] +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "amplify" +version = "4.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f7fb4ac7c881e54a8e7015e399b6112a2a5bc958b6c89ac510840ff20273b31" +dependencies = [ + "amplify_derive", + "amplify_num", + "ascii", + "getrandom 0.2.16", + "getrandom 0.3.3", + "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" @@ -44,6 +111,12 @@ dependencies = [ "libc", ] +[[package]] +name = "anes" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" + [[package]] name = "anstyle" version = "1.0.10" @@ -83,6 +156,101 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" +[[package]] +name = "arti-client" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "855132b9da6a7c968736dda4c1824689073e4e2009817d06f52a70153271235c" +dependencies = [ + "async-trait", + "cfg-if", + "derive-deftly 1.1.0", + "derive_builder_fork_arti", + "derive_more", + "educe", + "fs-mistrust", + "futures", + "hostname-validator", + "humantime", + "humantime-serde", + "libc", + "once_cell", + "postage", + "rand 0.9.1", + "safelog", + "serde", + "thiserror 2.0.12", + "time", + "tor-async-utils", + "tor-basic-utils", + "tor-chanmgr", + "tor-circmgr", + "tor-config", + "tor-config-path", + "tor-dirmgr", + "tor-error", + "tor-guardmgr", + "tor-hsclient", + "tor-hscrypto", + "tor-hsservice", + "tor-keymgr", + "tor-linkspec", + "tor-llcrypto", + "tor-memquota", + "tor-netdir", + "tor-netdoc", + "tor-persist", + "tor-proto", + "tor-protover", + "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.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56624a96882bb8c26d61312ae18cb45868e5a9992ea73c58e45c3101e56a1e60" +dependencies = [ + "asn1-rs-derive", + "asn1-rs-impl", + "displaydoc", + "nom", + "num-traits", + "rusticata-macros", + "thiserror 2.0.12", +] + +[[package]] +name = "asn1-rs-derive" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3109e49b1e4909e9db6515a30c633684d68cdeaa252f215214cb4fa1a5bfee2c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", + "synstructure", +] + +[[package]] +name = "asn1-rs-impl" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + [[package]] name = "assert-json-diff" version = "2.0.2" @@ -93,6 +261,37 @@ dependencies = [ "serde_json", ] +[[package]] +name = "assert_matches" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" + +[[package]] +name = "async-compression" +version = "0.4.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40f6024f3f856663b45fd0c9b6f2024034a702f453549449e0d84a305900dad4" +dependencies = [ + "flate2", + "futures-core", + "futures-io", + "memchr", + "pin-project-lite", +] + +[[package]] +name = "async-native-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9343dc5acf07e79ff82d0c37899f079db3534d99f189a1837c8e549c99405bec" +dependencies = [ + "futures-util", + "native-tls", + "thiserror 1.0.69", + "url", +] + [[package]] name = "async-stream" version = "0.3.6" @@ -126,6 +325,49 @@ dependencies = [ "syn 2.0.101", ] +[[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.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a860072022177f903e59730004fb5dc13db9275b79bb2aef7ba8ce831956c233" +dependencies = [ + "bytes", + "futures-sink", + "futures-util", + "memchr", + "pin-project-lite", +] + +[[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.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89cbf775b137e9b968e67227ef7f775587cde3fd31b0d8599dbd0f598a48340" +dependencies = [ + "bytemuck", +] + [[package]] name = "atomic-waker" version = "1.1.2" @@ -208,12 +450,24 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + [[package]] name = "base64" version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" +[[package]] +name = "base64ct" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55248b47b0caf0546f7988906588779981c43bb1bc9d0c44087278f80cdb44ba" + [[package]] name = "bincode" version = "1.3.3" @@ -223,6 +477,16 @@ dependencies = [ "serde", ] +[[package]] +name = "bincode" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36eaf5d7b090263e8150820482d5d93cd964a81e4019913c972f4edcc6edb740" +dependencies = [ + "serde", + "unty", +] + [[package]] name = "bit-set" version = "0.8.0" @@ -288,6 +552,17 @@ dependencies = [ "constant_time_eq", ] +[[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.101", +] + [[package]] name = "block-buffer" version = "0.10.4" @@ -320,12 +595,35 @@ dependencies = [ "syn 2.0.101", ] +[[package]] +name = "bounded-vec-deque" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2225b558afc76c596898f5f1b3fc35cfce0eb1b13635cbd7d1b2a7177dc10ccd" + +[[package]] +name = "bstr" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "234113d19d0d7d613b40e86fb654acf958910802bcceab913a4f9e7cda03b1a4" +dependencies = [ + "memchr", + "regex-automata 0.4.9", + "serde", +] + [[package]] name = "bumpalo" version = "3.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" +[[package]] +name = "by_address" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64fa3c856b712db6612c019f14756e64e4bcea13337a6b33b696333a9eaa2d06" + [[package]] name = "bytemuck" version = "1.23.0" @@ -361,6 +659,18 @@ dependencies = [ "serde", ] +[[package]] +name = "caret" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "061dc3258f029feaf9ff02b43c6af5ea67a7dfaed5d2aef36204c812e614ef9c" + +[[package]] +name = "cast" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" + [[package]] name = "cc" version = "1.2.22" @@ -393,9 +703,48 @@ dependencies = [ "android-tzdata", "iana-time-zone", "num-traits", + "serde", "windows-link", ] +[[package]] +name = "ciborium" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" +dependencies = [ + "ciborium-io", + "ciborium-ll", + "serde", +] + +[[package]] +name = "ciborium-io" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" + +[[package]] +name = "ciborium-ll" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" +dependencies = [ + "ciborium-io", + "half", +] + +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", + "zeroize", +] + [[package]] name = "clap" version = "4.5.37" @@ -414,7 +763,7 @@ checksum = "efd9466fac8543255d3b1fcad4762c5e116ffe808c8a3043d4263cd4fd4862a2" dependencies = [ "anstyle", "clap_lex", - "strsim", + "strsim 0.11.1", "terminal_size", ] @@ -445,6 +794,32 @@ dependencies = [ "cc", ] +[[package]] +name = "coarsetime" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91849686042de1b41cd81490edc83afbcb0abe5a9b6f2c4114f23ce8cca1bcf4" +dependencies = [ + "libc", + "wasix", + "wasm-bindgen", +] + +[[package]] +name = "concurrent-queue" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + [[package]] name = "const_format" version = "0.2.34" @@ -473,6 +848,34 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" +[[package]] +name = "convert_case" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb402b8d4c85569410425650ce3eddc7d698ed96d39a73f941b08fb63082f1e7" +dependencies = [ + "unicode-segmentation", +] + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation" version = "0.10.0" @@ -507,6 +910,52 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "criterion" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2b12d017a929603d80db1831cd3a24082f8137ce19c69e6447f54f5fc8d692f" +dependencies = [ + "anes", + "cast", + "ciborium", + "clap", + "criterion-plot", + "is-terminal", + "itertools 0.10.5", + "num-traits", + "once_cell", + "oorandom", + "plotters", + "rayon", + "regex", + "serde", + "serde_derive", + "serde_json", + "tinytemplate", + "walkdir", +] + +[[package]] +name = "criterion-cycles-per-byte" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1029452fa751c93f8834962dd74807d69f0a6c7624d5b06625b393aeb6a14fc2" +dependencies = [ + "cfg-if", + "criterion", +] + +[[package]] +name = "criterion-plot" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" +dependencies = [ + "cast", + "itertools 0.10.5", +] + [[package]] name = "crossbeam" version = "0.8.4" @@ -563,12 +1012,20 @@ version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" +[[package]] +name = "crunchy" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" + [[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", ] @@ -583,6 +1040,15 @@ dependencies = [ "typenum", ] +[[package]] +name = "ctr" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" +dependencies = [ + "cipher", +] + [[package]] name = "cuprate-address-book" version = "0.1.0" @@ -593,9 +1059,9 @@ dependencies = [ "cuprate-pruning", "cuprate-test-utils", "futures", - "indexmap", - "rand", - "thiserror", + "indexmap 2.9.0", + "rand 0.8.5", + "thiserror 1.0.69", "tokio", "tokio-util", "tower 0.5.1", @@ -608,7 +1074,7 @@ version = "0.1.0" dependencies = [ "futures", "pin-project", - "thiserror", + "thiserror 1.0.69", "tokio", ] @@ -629,11 +1095,11 @@ dependencies = [ "curve25519-dalek", "hex", "hex-literal", - "indexmap", + "indexmap 2.9.0", "monero-serai", "pretty_assertions", "proptest", - "rand", + "rand 0.8.5", "rayon", "serde", "tempfile", @@ -656,13 +1122,13 @@ dependencies = [ "futures", "hex", "hex-literal", - "indexmap", + "indexmap 2.9.0", "monero-serai", "proptest", "proptest-derive", - "rand", + "rand 0.8.5", "rayon", - "thiserror", + "thiserror 1.0.69", "thread_local", "tokio", "tokio-test", @@ -683,7 +1149,7 @@ dependencies = [ "monero-serai", "randomx-rs", "rayon", - "thiserror", + "thiserror 1.0.69", "thread_local", "tokio", "tokio-util", @@ -704,13 +1170,13 @@ dependencies = [ "curve25519-dalek", "hex", "hex-literal", - "indexmap", + "indexmap 2.9.0", "monero-serai", "proptest", "proptest-derive", - "rand", + "rand 0.8.5", "rayon", - "thiserror", + "thiserror 1.0.69", "tokio", "tracing", ] @@ -731,7 +1197,7 @@ dependencies = [ "seq-macro", "sha3", "skein", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -740,9 +1206,9 @@ version = "0.1.0" dependencies = [ "futures", "proptest", - "rand", + "rand 0.8.5", "rand_distr", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-util", "tower 0.5.1", @@ -762,7 +1228,7 @@ dependencies = [ "redb", "serde", "tempfile", - "thiserror", + "thiserror 1.0.69", "tracing", ] @@ -790,7 +1256,7 @@ dependencies = [ "hex", "paste", "ref-cast", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -823,7 +1289,7 @@ dependencies = [ "bytes", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -848,7 +1314,7 @@ dependencies = [ "crossbeam", "cuprate-constants", "curve25519-dalek", - "dirs", + "dirs 5.0.1", "futures", "libc", "monero-serai", @@ -874,7 +1340,7 @@ dependencies = [ "pretty_assertions", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -888,8 +1354,8 @@ dependencies = [ "cuprate-helper", "futures", "proptest", - "rand", - "thiserror", + "rand 0.8.5", + "thiserror 1.0.69", "tokio", "tokio-util", "tracing", @@ -912,14 +1378,14 @@ dependencies = [ "cuprate-types", "cuprate-wire", "futures", - "indexmap", + "indexmap 2.9.0", "monero-serai", "pin-project", "proptest", - "rand", + "rand 0.8.5", "rand_distr", "rayon", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-stream", "tokio-test", @@ -933,7 +1399,7 @@ name = "cuprate-p2p-bucket" version = "0.1.0" dependencies = [ "arrayvec", - "rand", + "rand 0.8.5", ] [[package]] @@ -951,8 +1417,8 @@ dependencies = [ "futures", "hex", "hex-literal", - "rand", - "thiserror", + "rand 0.8.5", + "thiserror 1.0.69", "tokio", "tokio-stream", "tokio-test", @@ -964,6 +1430,22 @@ dependencies = [ [[package]] name = "cuprate-p2p-transport" version = "0.1.0" +dependencies = [ + "arti-client", + "async-trait", + "cuprate-p2p-core", + "cuprate-wire", + "futures", + "tokio", + "tokio-socks", + "tokio-util", + "tor-cell", + "tor-config-path", + "tor-hsservice", + "tor-proto", + "tor-rtcompat", + "tracing", +] [[package]] name = "cuprate-pruning" @@ -971,7 +1453,7 @@ version = "0.1.0" dependencies = [ "borsh", "cuprate-constants", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1054,7 +1536,7 @@ dependencies = [ "rayon", "serde", "tempfile", - "thiserror", + "thiserror 1.0.69", "tokio", "tower 0.5.1", ] @@ -1072,15 +1554,15 @@ dependencies = [ "cuprate-hex", "curve25519-dalek", "hex-literal", - "indexmap", + "indexmap 2.9.0", "monero-serai", "pretty_assertions", "proptest", "proptest-derive", "serde", "serde_json", - "strum", - "thiserror", + "strum 0.26.3", + "thiserror 1.0.69", ] [[package]] @@ -1089,6 +1571,7 @@ version = "0.1.0" dependencies = [ "arbitrary", "bitflags 2.9.0", + "borsh", "bytes", "cuprate-epee-encoding", "cuprate-fixed-bytes", @@ -1097,7 +1580,7 @@ dependencies = [ "cuprate-types", "hex", "proptest", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1116,6 +1599,7 @@ name = "cuprated" version = "0.0.5" dependencies = [ "anyhow", + "arti-client", "async-trait", "axum", "bitflags 2.9.0", @@ -1148,6 +1632,7 @@ dependencies = [ "cuprate-levin", "cuprate-p2p", "cuprate-p2p-core", + "cuprate-p2p-transport", "cuprate-pruning", "cuprate-rpc-interface", "cuprate-rpc-types", @@ -1157,33 +1642,36 @@ dependencies = [ "cuprate-wire", "curve25519-dalek", "dashmap", - "dirs", + "dirs 5.0.1", "futures", "hex", "hex-literal", - "indexmap", + "indexmap 2.9.0", "monero-address", "monero-serai", "nu-ansi-term", "paste", "pin-project", "pretty_assertions", - "rand", + "rand 0.8.5", "rand_distr", "randomx-rs", "rayon", "serde", "serde_bytes", "serde_json", - "strum", + "strum 0.26.3", "tempfile", - "thiserror", + "thiserror 1.0.69", "thread_local", "tokio", "tokio-stream", "tokio-util", "toml", "toml_edit", + "tor-hsservice", + "tor-persist", + "tor-rtcompat", "tower 0.5.1", "tower-http", "tracing", @@ -1203,7 +1691,7 @@ dependencies = [ "digest", "fiat-crypto", "group", - "rand_core", + "rand_core 0.6.4", "rustc_version", "subtle", "zeroize", @@ -1230,12 +1718,82 @@ dependencies = [ "digest", "ff", "group", - "rand_core", + "rand_core 0.6.4", "rustversion", "subtle", "zeroize", ] +[[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.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" +dependencies = [ + "darling_core 0.20.11", + "darling_macro 0.20.11", +] + +[[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.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim 0.11.1", + "syn 2.0.101", +] + +[[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.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" +dependencies = [ + "darling_core 0.20.11", + "quote", + "syn 2.0.101", +] + [[package]] name = "dashmap" version = "6.1.0" @@ -1250,6 +1808,37 @@ dependencies = [ "parking_lot_core", ] +[[package]] +name = "data-encoding" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476" + +[[package]] +name = "der" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" +dependencies = [ + "const-oid", + "pem-rfc7468", + "zeroize", +] + +[[package]] +name = "der-parser" +version = "10.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07da5016415d5a3c4dd39b11ed26f915f52fc4e0dc197d87908bc916e51bc1a6" +dependencies = [ + "asn1-rs", + "cookie-factory", + "displaydoc", + "nom", + "num-traits", + "rusticata-macros", +] + [[package]] name = "deranged" version = "0.4.0" @@ -1257,6 +1846,63 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" dependencies = [ "powerfmt", + "serde", +] + +[[package]] +name = "derive-deftly" +version = "0.14.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8ea84d0109517cc2253d4a679bdda1e8989e9bd86987e9e4f75ffdda0095fd1" +dependencies = [ + "derive-deftly-macros 0.14.6", + "heck", +] + +[[package]] +name = "derive-deftly" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a55a256deae70e0772adfd583c57c1403c6ddbd1d1f1f84f64e94acaecc25eeb" +dependencies = [ + "derive-deftly-macros 1.1.0", + "heck", +] + +[[package]] +name = "derive-deftly-macros" +version = "0.14.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "357422a457ccb850dc8f1c1680e0670079560feaad6c2e247e3f345c4fab8a3f" +dependencies = [ + "heck", + "indexmap 2.9.0", + "itertools 0.14.0", + "proc-macro-crate", + "proc-macro2", + "quote", + "sha3", + "strum 0.27.1", + "syn 2.0.101", + "void", +] + +[[package]] +name = "derive-deftly-macros" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47cf90c375e516cf601a57727744bdf7a547680a470a2e8a6580a12288cf0630" +dependencies = [ + "heck", + "indexmap 2.9.0", + "itertools 0.14.0", + "proc-macro-crate", + "proc-macro2", + "quote", + "sha3", + "strum 0.27.1", + "syn 2.0.101", + "void", ] [[package]] @@ -1270,6 +1916,59 @@ dependencies = [ "syn 2.0.101", ] +[[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 = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "syn 2.0.101", + "unicode-xid", +] + [[package]] name = "diff" version = "0.1.13" @@ -1283,6 +1982,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", + "const-oid", "crypto-common", "subtle", ] @@ -1296,17 +1996,35 @@ dependencies = [ "digest", "hex", "md-5", - "rand", + "rand 0.8.5", "sha2", ] +[[package]] +name = "directories" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16f5094c54661b38d03bd7e50df373292118db60b585c08a411c6d840017fe7d" +dependencies = [ + "dirs-sys 0.5.0", +] + [[package]] name = "dirs" version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" dependencies = [ - "dirs-sys", + "dirs-sys 0.4.1", +] + +[[package]] +name = "dirs" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e" +dependencies = [ + "dirs-sys 0.5.0", ] [[package]] @@ -1317,10 +2035,22 @@ checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" dependencies = [ "libc", "option-ext", - "redox_users", + "redox_users 0.4.6", "windows-sys 0.48.0", ] +[[package]] +name = "dirs-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" +dependencies = [ + "libc", + "option-ext", + "redox_users 0.5.0", + "windows-sys 0.59.0", +] + [[package]] name = "displaydoc" version = "0.2.5" @@ -1332,13 +2062,77 @@ dependencies = [ "syn 2.0.101", ] +[[package]] +name = "downcast-rs" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea8a8b81cacc08888170eef4d13b775126db426d0b348bee9d18c2c1eaf123cf" + [[package]] name = "doxygen-rs" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "415b6ec780d34dcf624666747194393603d0373b7141eef01d12ee58881507d9" dependencies = [ - "phf", + "phf 0.11.3", +] + +[[package]] +name = "dyn-clone" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c7a8fb8a9fbf66c1f703fe16184d10ca0ee9d23be5b4436400408ba54a95005" + +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +dependencies = [ + "der", + "digest", + "elliptic-curve", + "rfc6979", + "signature", + "spki", +] + +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "pkcs8", + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" +dependencies = [ + "curve25519-dalek", + "ed25519", + "merlin", + "rand_core 0.6.4", + "serde", + "sha2", + "subtle", + "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]] @@ -1347,6 +2141,38 @@ version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" +[[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", + "ff", + "generic-array", + "group", + "pkcs8", + "rand_core 0.6.4", + "sec1", + "subtle", + "zeroize", +] + +[[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.101", +] + [[package]] name = "equivalent" version = "1.0.2" @@ -1363,6 +2189,29 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "event-listener" +version = "5.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3492acde4c3fc54c845eaab3eed8bd00c7a7d881f78bfc801e43a93dec1331ae" +dependencies = [ + "concurrent-queue", + "parking", + "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.3.0" @@ -1376,7 +2225,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" dependencies = [ "bitvec", - "rand_core", + "rand_core 0.6.4", "subtle", ] @@ -1386,6 +2235,31 @@ version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" +[[package]] +name = "figment" +version = "0.10.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cb01cd46b0cf372153850f4c6c272d9cbea2da513e07538405148f95bd789f3" +dependencies = [ + "atomic 0.6.1", + "serde", + "toml", + "uncased", + "version_check", +] + +[[package]] +name = "filetime" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" +dependencies = [ + "cfg-if", + "libc", + "libredox", + "windows-sys 0.59.0", +] + [[package]] name = "flate2" version = "1.1.1" @@ -1409,12 +2283,39 @@ dependencies = [ "zeroize", ] +[[package]] +name = "fluid-let" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "749cff877dc1af878a0b31a41dd221a753634401ea0ef2f87b62d3171522485a" + [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + [[package]] name = "form_urlencoded" version = "1.2.1" @@ -1424,6 +2325,52 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "fs-mistrust" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "198b8f9ab4cff63b5c91e9e64edd4e6b43cd7fe7a52519a03c6c32ea0acfa557" +dependencies = [ + "derive_builder_fork_arti", + "dirs 6.0.0", + "libc", + "pwd-grp", + "serde", + "thiserror 2.0.12", + "walkdir", +] + +[[package]] +name = "fslock" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04412b8935272e3a9bae6f48c7bfff74c2911f60525404edfdd28e49884c3bfb" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "fslock-arti-fork" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b21bd626aaab7b904b20bef6d9e06298914a0c8d9fb8b010483766b2e532791" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "fslock-guard" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed387b899db1671a47eaf17e7e6d7008577262c09319cb8e19601371192b526f" +dependencies = [ + "fslock-arti-fork", + "thiserror 2.0.12", + "winapi", +] + [[package]] name = "funty" version = "2.0.0" @@ -1438,6 +2385,7 @@ checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", + "futures-executor", "futures-io", "futures-sink", "futures-task", @@ -1460,6 +2408,17 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +[[package]] +name = "futures-executor" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + [[package]] name = "futures-io" version = "0.3.31" @@ -1515,6 +2474,7 @@ checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", + "zeroize", ] [[package]] @@ -1524,8 +2484,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" dependencies = [ "cfg-if", + "js-sys", "libc", "wasi 0.11.0+wasi-snapshot-preview1", + "wasm-bindgen", ] [[package]] @@ -1535,9 +2497,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" dependencies = [ "cfg-if", + "js-sys", "libc", "r-efi", "wasi 0.14.2+wasi-0.2.4", + "wasm-bindgen", ] [[package]] @@ -1546,6 +2510,12 @@ version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" +[[package]] +name = "glob-match" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9985c9503b412198aa4197559e9a318524ebc4519c229bfa05a535828c950b9d" + [[package]] name = "groestl" version = "0.10.1" @@ -1562,10 +2532,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", - "rand_core", + "rand_core 0.6.4", "subtle", ] +[[package]] +name = "growable-bloom-filter" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d174ccb4ba660d431329e7f0797870d0a4281e36353ec4b4a3c5eab6c2cfb6f1" +dependencies = [ + "serde", + "serde_bytes", + "serde_derive", + "xxhash-rust", +] + [[package]] name = "h2" version = "0.4.10" @@ -1578,13 +2560,29 @@ dependencies = [ "futures-core", "futures-sink", "http", - "indexmap", + "indexmap 2.9.0", "slab", "tokio", "tokio-util", "tracing", ] +[[package]] +name = "half" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "459196ed295495a68f7d7fe1d84f6c4b7ff0e21fe3017b2f283c6fac3ad803c9" +dependencies = [ + "cfg-if", + "crunchy", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + [[package]] name = "hashbrown" version = "0.14.5" @@ -1599,6 +2597,18 @@ name = "hashbrown" version = "0.15.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84b26c544d002229e640969970a2e74021aadf6e2f96372b9c58eff97de08eb3" +dependencies = [ + "foldhash", +] + +[[package]] +name = "hashlink" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7382cf6263419f2d8df38c55d7da83da5c18aef87fc7a7fc1fb1e344edfe14c1" +dependencies = [ + "hashbrown 0.15.3", +] [[package]] name = "heck" @@ -1637,13 +2647,19 @@ version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d3f528b053a6d700b2734eabcd0fd49cb8230647aa72958467527b0b7917114" dependencies = [ - "bincode", + "bincode 1.3.3", "byteorder", "heed-traits", "serde", "serde_json", ] +[[package]] +name = "hermit-abi" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" + [[package]] name = "hex" version = "0.4.3" @@ -1659,6 +2675,30 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "hostname-validator" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f558a64ac9af88b5ba400d99b579451af0d39c6d360980045b91aac966d705e2" + [[package]] name = "http" version = "1.3.1" @@ -1705,6 +2745,22 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" +[[package]] +name = "humantime" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b112acc8b3adf4b107a8ec20977da0273a8c386765a3ec0229bd500a1443f9f" + +[[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 = "1.6.0" @@ -1874,6 +2930,12 @@ dependencies = [ "zerovec", ] +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "idna" version = "1.0.3" @@ -1895,6 +2957,17 @@ dependencies = [ "icu_properties", ] +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", + "serde", +] + [[package]] name = "indexmap" version = "2.9.0" @@ -1904,6 +2977,74 @@ dependencies = [ "equivalent", "hashbrown 0.15.3", "rayon", + "serde", +] + +[[package]] +name = "inotify" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f37dccff2791ab604f9babef0ba14fbe0be30bd368dc541e2b08d07c8aa908f3" +dependencies = [ + "bitflags 2.9.0", + "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.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" +dependencies = [ + "generic-array", +] + +[[package]] +name = "inventory" +version = "0.3.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab08d7cd2c5897f2c949e5383ea7c7db03fb19130ffcfbf7eda795137ae3cb83" +dependencies = [ + "rustversion", +] + +[[package]] +name = "is-terminal" +version = "0.4.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" +dependencies = [ + "hermit-abi", + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +dependencies = [ + "either", ] [[package]] @@ -1943,6 +3084,16 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "k12" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4dc5fdb62af2f520116927304f15d25b3c2667b4817b90efdc045194c912c54" +dependencies = [ + "digest", + "sha3", +] + [[package]] name = "keccak" version = "0.1.5" @@ -1967,11 +3118,34 @@ version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4933f3f57a8e9d9da04db23fb153356ecaf00cbd14aee46279c33dc80925c37" +[[package]] +name = "kqueue" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac30106d7dce88daf4a3fcb4879ea939476d5074a9b7ddd0fb97fa4bed5596a" +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 = "lazy_static" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +dependencies = [ + "spin", +] [[package]] name = "libc" @@ -2003,6 +3177,18 @@ checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ "bitflags 2.9.0", "libc", + "redox_syscall", +] + +[[package]] +name = "libsqlite3-sys" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91632f3b4fb6bd1d72aa3d78f41ffecfcf2b1a6648d8c241dbe7dbfaf4875e15" +dependencies = [ + "cc", + "pkg-config", + "vcpkg", ] [[package]] @@ -2044,6 +3230,15 @@ version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + [[package]] name = "matchit" version = "0.7.3" @@ -2066,6 +3261,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 = "merlin" version = "3.0.0" @@ -2074,7 +3278,7 @@ checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" dependencies = [ "byteorder", "keccak", - "rand_core", + "rand_core 0.6.4", "zeroize", ] @@ -2084,6 +3288,12 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "miniz_oxide" version = "0.8.8" @@ -2100,6 +3310,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ "libc", + "log", "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys 0.52.0", ] @@ -2113,7 +3324,7 @@ dependencies = [ "monero-io", "monero-primitives", "std-shims", - "thiserror", + "thiserror 1.0.69", "zeroize", ] @@ -2139,9 +3350,9 @@ dependencies = [ "monero-generators", "monero-io", "monero-primitives", - "rand_core", + "rand_core 0.6.4", "std-shims", - "thiserror", + "thiserror 1.0.69", "zeroize", ] @@ -2157,11 +3368,11 @@ dependencies = [ "monero-generators", "monero-io", "monero-primitives", - "rand_chacha", - "rand_core", + "rand_chacha 0.3.1", + "rand_core 0.6.4", "std-shims", "subtle", - "thiserror", + "thiserror 1.0.69", "zeroize", ] @@ -2198,7 +3409,7 @@ dependencies = [ "monero-io", "monero-primitives", "std-shims", - "thiserror", + "thiserror 1.0.69", "zeroize", ] @@ -2227,7 +3438,7 @@ dependencies = [ "serde", "serde_json", "std-shims", - "thiserror", + "thiserror 1.0.69", "zeroize", ] @@ -2261,6 +3472,57 @@ dependencies = [ "tokio", ] +[[package]] +name = "native-tls" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework 2.11.1", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "notify" +version = "8.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fee8403b3d66ac7b26aee6e40a897d85dc5ce26f44da36b8b73e987cc52e943" +dependencies = [ + "bitflags 2.9.0", + "filetime", + "inotify", + "kqueue", + "libc", + "log", + "mio", + "notify-types", + "walkdir", + "windows-sys 0.59.0", +] + +[[package]] +name = "notify-types" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e0826a989adedc2a244799e823aece04662b66609d96af8dff7ac6df9a8925d" + [[package]] name = "nu-ansi-term" version = "0.46.0" @@ -2271,12 +3533,59 @@ dependencies = [ "winapi", ] +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "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" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +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" @@ -2287,6 +3596,28 @@ dependencies = [ "libm", ] +[[package]] +name = "num_enum" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a973b4e44ce6cad84ce69d797acf9a044532e4184c4f267913d1b546a0727b7a" +dependencies = [ + "num_enum_derive", + "rustversion", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77e878c846a8abae00dd069496dbe8751b16ac1c3d6bd2a7283a938e8228f90d" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.101", +] + [[package]] name = "object" version = "0.36.7" @@ -2302,24 +3633,143 @@ version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" +[[package]] +name = "oneshot-fused-workaround" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2948fd2414b613f9a97f8401270bd5d7638265ab940475cdbcfa28a0273d58" +dependencies = [ + "futures", +] + +[[package]] +name = "oorandom" +version = "11.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e" + +[[package]] +name = "openssl" +version = "0.10.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8505734d46c8ab1e19a1dce3aef597ad87dcb4c37e7188231769bd6bd51cebf8" +dependencies = [ + "bitflags 2.9.0", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + [[package]] name = "openssl-probe" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" +[[package]] +name = "openssl-src" +version = "300.5.1+3.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "735230c832b28c000e3bc117119e6466a663ec73506bc0a9907ea4187508e42a" +dependencies = [ + "cc", +] + +[[package]] +name = "openssl-sys" +version = "0.9.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90096e2e47630d78b7d1c20952dc621f957103f8bc2c8359ec81290d75238571" +dependencies = [ + "cc", + "libc", + "openssl-src", + "pkg-config", + "vcpkg", +] + [[package]] name = "option-ext" 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 = "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", +] + +[[package]] +name = "p384" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe42f1670a52a47d448f14b6a5c61dd78fce51856e68edaa38f7ae3a46b8d6b6" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", +] + +[[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", +] + [[package]] name = "page_size" version = "0.6.0" @@ -2330,6 +3780,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "parking" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" + [[package]] name = "parking_lot" version = "0.12.3" @@ -2359,6 +3815,15 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[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" @@ -2371,8 +3836,19 @@ version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" dependencies = [ - "phf_macros", - "phf_shared", + "phf_macros 0.11.3", + "phf_shared 0.11.3", +] + +[[package]] +name = "phf" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "913273894cec178f401a31ec4b656318d95473527be05c0752cc41cdc32be8b7" +dependencies = [ + "phf_macros 0.12.1", + "phf_shared 0.12.1", + "serde", ] [[package]] @@ -2381,8 +3857,18 @@ version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" dependencies = [ - "phf_shared", - "rand", + "phf_shared 0.11.3", + "rand 0.8.5", +] + +[[package]] +name = "phf_generator" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cbb1126afed61dd6368748dae63b1ee7dc480191c6262a3b4ff1e29d86a6c5b" +dependencies = [ + "fastrand", + "phf_shared 0.12.1", ] [[package]] @@ -2391,8 +3877,21 @@ version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" dependencies = [ - "phf_generator", - "phf_shared", + "phf_generator 0.11.3", + "phf_shared 0.11.3", + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "phf_macros" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d713258393a82f091ead52047ca779d37e5766226d009de21696c4e667044368" +dependencies = [ + "phf_generator 0.12.1", + "phf_shared 0.12.1", "proc-macro2", "quote", "syn 2.0.101", @@ -2407,6 +3906,15 @@ dependencies = [ "siphasher", ] +[[package]] +name = "phf_shared" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06005508882fb681fd97892ecff4b7fd0fee13ef1aa569f8695dae7ab9099981" +dependencies = [ + "siphasher", +] + [[package]] name = "pin-project" version = "1.1.10" @@ -2439,6 +3947,76 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "pkg-config" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" + +[[package]] +name = "plotters" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aeb6f403d7a4911efb1e33402027fc44f29b5bf6def3effcc22d7bb75f2b747" +dependencies = [ + "num-traits", + "plotters-backend", + "plotters-svg", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "plotters-backend" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df42e13c12958a16b3f7f4386b9ab1f3e7933914ecea48da7139435263a4172a" + +[[package]] +name = "plotters-svg" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51bae2ac328883f7acdfea3d66a7c35751187f870bc81f94563733a154d7a670" +dependencies = [ + "plotters-backend", +] + +[[package]] +name = "postage" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af3fb618632874fb76937c2361a7f22afd393c982a2165595407edc75b06d3c1" +dependencies = [ + "atomic 0.5.3", + "crossbeam-queue", + "futures", + "parking_lot", + "pin-project", + "static_assertions", + "thiserror 1.0.69", +] + [[package]] name = "potential_utf" version = "0.1.2" @@ -2473,6 +4051,26 @@ dependencies = [ "yansi", ] +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + +[[package]] +name = "priority-queue" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5676d703dda103cbb035b653a9f11448c0a7216c7926bd35fcb5865475d0c970" +dependencies = [ + "autocfg", + "equivalent", + "indexmap 2.9.0", +] + [[package]] name = "proc-macro-crate" version = "3.3.0" @@ -2502,10 +4100,10 @@ dependencies = [ "bitflags 2.9.0", "lazy_static", "num-traits", - "rand", - "rand_chacha", + "rand 0.8.5", + "rand_chacha 0.3.1", "rand_xorshift", - "regex-syntax", + "regex-syntax 0.8.5", "rusty-fork", "tempfile", "unarray", @@ -2522,6 +4120,18 @@ dependencies = [ "syn 2.0.101", ] +[[package]] +name = "pwd-grp" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b94fdf3867b7f2889a736f0022ea9386766280d2cca4bdbe41629ada9e4f3b8f" +dependencies = [ + "derive-deftly 0.14.6", + "libc", + "paste", + "thiserror 1.0.69", +] + [[package]] name = "quick-error" version = "1.2.3" @@ -2556,8 +4166,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", - "rand_chacha", - "rand_core", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97" +dependencies = [ + "rand_chacha 0.9.0", + "rand_core 0.9.3", ] [[package]] @@ -2567,7 +4187,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.3", ] [[package]] @@ -2579,6 +4209,15 @@ dependencies = [ "getrandom 0.2.16", ] +[[package]] +name = "rand_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" +dependencies = [ + "getrandom 0.3.3", +] + [[package]] name = "rand_distr" version = "0.4.3" @@ -2586,7 +4225,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31" dependencies = [ "num-traits", - "rand", + "rand 0.8.5", +] + +[[package]] +name = "rand_jitter" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b16df48f071248e67b8fc5e866d9448d45c08ad8b672baaaf796e2f15e606ff0" +dependencies = [ + "libc", + "rand_core 0.9.3", + "winapi", ] [[package]] @@ -2595,7 +4245,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" dependencies = [ - "rand_core", + "rand_core 0.6.4", ] [[package]] @@ -2606,7 +4256,7 @@ dependencies = [ "bitflags 1.3.2", "cmake", "libc", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -2629,6 +4279,15 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "rdrand" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d92195228612ac8eed47adbc2ed0f04e513a4ccb98175b6f2bd04d963b533655" +dependencies = [ + "rand_core 0.6.4", +] + [[package]] name = "redb" version = "2.5.0" @@ -2655,7 +4314,18 @@ checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom 0.2.16", "libredox", - "thiserror", + "thiserror 1.0.69", +] + +[[package]] +name = "redox_users" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd6f9d3d47bdd2ad6945c5015a226ec6155d0bcdfd8f7cd29f86b71f8de99d2b" +dependencies = [ + "getrandom 0.2.16", + "libredox", + "thiserror 2.0.12", ] [[package]] @@ -2678,12 +4348,66 @@ dependencies = [ "syn 2.0.101", ] +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata 0.4.9", + "regex-syntax 0.8.5", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.5", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + [[package]] name = "regex-syntax" version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" +[[package]] +name = "retry-error" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce97442758392c7e2a7716e06c514de75f0fe4b5a4b76e14ba1e5edfb7ba3512" + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac", + "subtle", +] + [[package]] name = "ring" version = "0.17.14" @@ -2698,6 +4422,42 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "rsa" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78928ac1ed176a5ca1d17e578a1825f3d81ca54cf41053a592584b020cfd691b" +dependencies = [ + "const-oid", + "digest", + "num-bigint-dig", + "num-integer", + "num-traits", + "pkcs1", + "pkcs8", + "rand_core 0.6.4", + "sha2", + "signature", + "spki", + "subtle", + "zeroize", +] + +[[package]] +name = "rusqlite" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3de23c3319433716cf134eed225fe9986bc24f63bed9be9f20c329029e672dc7" +dependencies = [ + "bitflags 2.9.0", + "fallible-iterator", + "fallible-streaming-iterator", + "hashlink", + "libsqlite3-sys", + "smallvec", + "time", +] + [[package]] name = "rustc-demangle" version = "0.1.24" @@ -2713,6 +4473,15 @@ dependencies = [ "semver", ] +[[package]] +name = "rusticata-macros" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632" +dependencies = [ + "nom", +] + [[package]] name = "rustix" version = "1.0.7" @@ -2750,7 +4519,7 @@ dependencies = [ "openssl-probe", "rustls-pki-types", "schannel", - "security-framework", + "security-framework 3.2.0", ] [[package]] @@ -2797,6 +4566,37 @@ version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" +[[package]] +name = "safelog" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d343b15e1705331c25689e0fa87e8514fb33bd3c9beeb45658a7c355f317de2" +dependencies = [ + "derive_more", + "educe", + "either", + "fluid-let", + "thiserror 2.0.12", +] + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "sanitize-filename" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc984f4f9ceb736a7bb755c3e3bd17dc56370af2600c9780dcc48c66453da34d" +dependencies = [ + "regex", +] + [[package]] name = "schannel" version = "0.1.27" @@ -2806,12 +4606,63 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "schemars" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd191f9397d57d581cddd31014772520aa448f65ef991055d7f61582c65165f" +dependencies = [ + "dyn-clone", + "ref-cast", + "serde", + "serde_json", +] + +[[package]] +name = "schemars" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1375ba8ef45a6f15d83fa8748f1079428295d403d6ea991d09ab100155fbc06d" +dependencies = [ + "dyn-clone", + "ref-cast", + "serde", + "serde_json", +] + [[package]] name = "scopeguard" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[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 = "security-framework" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +dependencies = [ + "bitflags 2.9.0", + "core-foundation 0.9.4", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + [[package]] name = "security-framework" version = "3.2.0" @@ -2819,7 +4670,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "271720403f46ca04f7ba6f55d438f8bd878d6b8ca0a1046e8228c4145bcbb316" dependencies = [ "bitflags 2.9.0", - "core-foundation", + "core-foundation 0.10.0", "core-foundation-sys", "libc", "security-framework-sys", @@ -2856,6 +4707,16 @@ dependencies = [ "serde_derive", ] +[[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_bytes" version = "0.11.17" @@ -2876,6 +4737,15 @@ dependencies = [ "syn 2.0.101", ] +[[package]] +name = "serde_ignored" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b516445dac1e3535b6d658a7b528d771153dfb272ed4180ca4617a20550365ff" +dependencies = [ + "serde", +] + [[package]] name = "serde_json" version = "1.0.140" @@ -2919,6 +4789,49 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_with" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2c45cd61fefa9db6f254525d46e392b852e0e61d9a1fd36e5bd183450a556d5" +dependencies = [ + "base64", + "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.9.0", + "schemars 0.9.0", + "schemars 1.0.3", + "serde", + "serde_derive", + "serde_json", + "serde_with_macros", + "time", +] + +[[package]] +name = "serde_with_macros" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de90945e6565ce0d9a25098082ed4ee4002e047cb59892c318d66821e14bb30f" +dependencies = [ + "darling 0.20.11", + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "sha2" version = "0.10.9" @@ -2949,6 +4862,17 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "shellexpand" +version = "3.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b1fdf65dd6331831494dd616b30351c38e96e45921a27745cf98490458b90bb" +dependencies = [ + "bstr", + "dirs 6.0.0", + "os_str_bytes", +] + [[package]] name = "shlex" version = "1.3.0" @@ -2964,6 +4888,16 @@ dependencies = [ "libc", ] +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest", + "rand_core 0.6.4", +] + [[package]] name = "simple-request" version = "0.1.0" @@ -3002,6 +4936,29 @@ dependencies = [ "autocfg", ] +[[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.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9500059071474a36baac642b6bb99ca1dbac0ce43727abbba02dad83822dadf2" +dependencies = [ + "paste", + "serde", + "slotmap", + "thiserror 2.0.12", + "void", +] + [[package]] name = "smallvec" version = "1.15.0" @@ -3024,12 +4981,69 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + +[[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", +] + +[[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", + "signature", + "ssh-cipher", + "ssh-encoding", + "subtle", + "zeroize", +] + [[package]] name = "stable_deref_trait" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + [[package]] name = "std-shims" version = "0.1.1" @@ -3039,6 +5053,12 @@ dependencies = [ "spin", ] +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + [[package]] name = "strsim" version = "0.11.1" @@ -3051,7 +5071,16 @@ version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" dependencies = [ - "strum_macros", + "strum_macros 0.26.4", +] + +[[package]] +name = "strum" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f64def088c51c9510a8579e3c5d67c65349dcf755e5479ad3d010aa6454e2c32" +dependencies = [ + "strum_macros 0.27.1", ] [[package]] @@ -3067,6 +5096,19 @@ dependencies = [ "syn 2.0.101", ] +[[package]] +name = "strum_macros" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c77a8c5abcaf0f9ce05d62342b7d298c346515365c36b673df4ebe3ced01fde8" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.101", +] + [[package]] name = "subtle" version = "2.6.1" @@ -3162,7 +5204,16 @@ version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +dependencies = [ + "thiserror-impl 2.0.12", ] [[package]] @@ -3176,6 +5227,17 @@ dependencies = [ "syn 2.0.101", ] +[[package]] +name = "thiserror-impl" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + [[package]] name = "thread_local" version = "1.1.8" @@ -3233,6 +5295,16 @@ dependencies = [ "zerovec", ] +[[package]] +name = "tinytemplate" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" +dependencies = [ + "serde", + "serde_json", +] + [[package]] name = "tokio" version = "1.45.0" @@ -3272,6 +5344,17 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-socks" +version = "0.5.2" +source = "git+https://github.com/Cuprate/tokio-socks.git?rev=8737caf#8737caf429a86ab181954444fac4f9b917795b19" +dependencies = [ + "either", + "futures-util", + "thiserror 1.0.69", + "tokio", +] + [[package]] name = "tokio-stream" version = "0.1.17" @@ -3305,6 +5388,7 @@ checksum = "66a539a9ad6d5d281510d5bd368c973d636c02dbf8a67300bfb6b950696ad7df" dependencies = [ "bytes", "futures-core", + "futures-io", "futures-sink", "futures-util", "hashbrown 0.15.3", @@ -3341,7 +5425,7 @@ version = "0.22.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "310068873db2c5b3e7659d2cc35d21855dbafa50d1ce336397c666e3cb08137e" dependencies = [ - "indexmap", + "indexmap 2.9.0", "serde", "serde_spanned", "toml_datetime", @@ -3355,6 +5439,997 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfb942dfe1d8e29a7ee7fcbde5bd2b9a25fb89aa70caea2eba3bee836ff41076" +[[package]] +name = "tor-async-utils" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12bee2c4a8ea4cfe533bf284eef89d26f53ed0145854c54471734cb36e451f3e" +dependencies = [ + "derive-deftly 1.1.0", + "educe", + "futures", + "oneshot-fused-workaround", + "pin-project", + "postage", + "thiserror 2.0.12", + "void", +] + +[[package]] +name = "tor-basic-utils" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41a4e9e4da7ce0f089aee75808db143c4d547ca6d4ffd5b15a1cb042c3082928" +dependencies = [ + "derive_more", + "hex", + "itertools 0.14.0", + "libc", + "paste", + "rand 0.9.1", + "rand_chacha 0.9.0", + "serde", + "slab", + "smallvec", + "thiserror 2.0.12", +] + +[[package]] +name = "tor-bytes" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5a4a8401219d99b460c9bc001386366a4c50dc881a0abf346f04c1785f7e06a" +dependencies = [ + "bytes", + "derive-deftly 1.1.0", + "digest", + "educe", + "getrandom 0.3.3", + "safelog", + "thiserror 2.0.12", + "tor-error", + "tor-llcrypto", + "zeroize", +] + +[[package]] +name = "tor-cell" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "230485eda02aa73aea39aefdc1aff7fbc6304de1ce510de366261727e3007a92" +dependencies = [ + "amplify", + "bitflags 2.9.0", + "bytes", + "caret", + "derive-deftly 1.1.0", + "derive_more", + "educe", + "paste", + "rand 0.9.1", + "smallvec", + "thiserror 2.0.12", + "tor-basic-utils", + "tor-bytes", + "tor-cert", + "tor-error", + "tor-hscrypto", + "tor-linkspec", + "tor-llcrypto", + "tor-memquota", + "tor-protover", + "tor-units", + "void", +] + +[[package]] +name = "tor-cert" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9abc35321d207c3ffbfdc37feb0a9e186555ee49dfaa8079027115ce44491ff2" +dependencies = [ + "caret", + "derive_builder_fork_arti", + "derive_more", + "digest", + "thiserror 2.0.12", + "tor-bytes", + "tor-checkable", + "tor-llcrypto", +] + +[[package]] +name = "tor-chanmgr" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85f54ff3c72323739c4903f6b8c5fd1a0b8b8554fbba2c1ffa712c1c7d4faa22" +dependencies = [ + "async-trait", + "caret", + "derive_builder_fork_arti", + "derive_more", + "educe", + "futures", + "oneshot-fused-workaround", + "postage", + "rand 0.9.1", + "safelog", + "serde", + "thiserror 2.0.12", + "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.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72e994401be86ecdaa8b17b176cd1562ddddc6778a47afd751e6db99ccadb8e6" +dependencies = [ + "humantime", + "signature", + "thiserror 2.0.12", + "tor-llcrypto", +] + +[[package]] +name = "tor-circmgr" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efafa2ca72873965c33dcba7375d14d436b584cacb0344b8068f559d8d775bcc" +dependencies = [ + "amplify", + "async-trait", + "bounded-vec-deque", + "cfg-if", + "derive_builder_fork_arti", + "derive_more", + "downcast-rs", + "dyn-clone", + "educe", + "futures", + "humantime-serde", + "itertools 0.14.0", + "once_cell", + "oneshot-fused-workaround", + "pin-project", + "rand 0.9.1", + "retry-error", + "safelog", + "serde", + "static_assertions", + "thiserror 2.0.12", + "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", + "tor-units", + "tracing", + "void", + "weak-table", +] + +[[package]] +name = "tor-config" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3280e6e26a30f94d752d55d273c307d2b819971ff4b830101d816990f9a5ec36" +dependencies = [ + "amplify", + "cfg-if", + "derive-deftly 1.1.0", + "derive_builder_fork_arti", + "educe", + "either", + "figment", + "fs-mistrust", + "futures", + "itertools 0.14.0", + "notify", + "paste", + "postage", + "regex", + "serde", + "serde-value", + "serde_ignored", + "strum 0.27.1", + "thiserror 2.0.12", + "toml", + "tor-basic-utils", + "tor-error", + "tor-rtcompat", + "tracing", + "void", +] + +[[package]] +name = "tor-config-path" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5347bcbe96c660694fe52fb76e852d982d73fe0d92f4c4cb9eaa8427a5d52f17" +dependencies = [ + "directories", + "serde", + "shellexpand", + "thiserror 2.0.12", + "tor-error", + "tor-general-addr", +] + +[[package]] +name = "tor-consdiff" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3d8e230e901c09dd73c81f12402e8c0221d992ee131ff32ac0dde72f972f47e" +dependencies = [ + "digest", + "hex", + "thiserror 2.0.12", + "tor-llcrypto", +] + +[[package]] +name = "tor-dirclient" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d6913b3a246442dca5a02b3002c9820b0e491a03eb9448843bd73782fb2b0d7" +dependencies = [ + "async-compression", + "base64ct", + "derive_more", + "futures", + "hex", + "http", + "httparse", + "httpdate", + "itertools 0.14.0", + "memchr", + "thiserror 2.0.12", + "tor-circmgr", + "tor-error", + "tor-hscrypto", + "tor-linkspec", + "tor-llcrypto", + "tor-netdoc", + "tor-proto", + "tor-rtcompat", + "tracing", +] + +[[package]] +name = "tor-dirmgr" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05a13cf2d0f3d92b8a0d45b661d7b2978ae726cc252d8a8e4308b750ab3b3275" +dependencies = [ + "async-trait", + "base64ct", + "derive_builder_fork_arti", + "derive_more", + "digest", + "educe", + "event-listener", + "fs-mistrust", + "fslock", + "futures", + "hex", + "humantime", + "humantime-serde", + "itertools 0.14.0", + "memmap2", + "oneshot-fused-workaround", + "paste", + "postage", + "rand 0.9.1", + "rusqlite", + "safelog", + "scopeguard", + "serde", + "serde_json", + "signature", + "static_assertions", + "strum 0.27.1", + "thiserror 2.0.12", + "time", + "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-protover", + "tor-rtcompat", + "tracing", +] + +[[package]] +name = "tor-error" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79ae19c74564749c54e14e532ffb15f84807f734d17f452bb3ffb8b1957f06a2" +dependencies = [ + "derive_more", + "futures", + "paste", + "retry-error", + "static_assertions", + "strum 0.27.1", + "thiserror 2.0.12", + "tracing", + "void", +] + +[[package]] +name = "tor-general-addr" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dad9c6e9147f4ee644c80c3b044813cf93a3f802279c49b06aac2f4f33555877" +dependencies = [ + "derive_more", + "thiserror 2.0.12", + "void", +] + +[[package]] +name = "tor-guardmgr" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32ff4df101c82b9731bc9d54b94ffdee6053471cfa3aa78663c53a545d3d3139" +dependencies = [ + "amplify", + "base64ct", + "derive-deftly 1.1.0", + "derive_builder_fork_arti", + "derive_more", + "dyn-clone", + "educe", + "futures", + "humantime", + "humantime-serde", + "itertools 0.14.0", + "num_enum", + "oneshot-fused-workaround", + "pin-project", + "postage", + "rand 0.9.1", + "safelog", + "serde", + "strum 0.27.1", + "thiserror 2.0.12", + "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-hsclient" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4ad84737ce249b56f74bede1b09f61a4169979c3cef124012a9447e1790066a" +dependencies = [ + "async-trait", + "derive-deftly 1.1.0", + "derive_more", + "educe", + "either", + "futures", + "itertools 0.14.0", + "oneshot-fused-workaround", + "postage", + "rand 0.9.1", + "retry-error", + "safelog", + "slotmap-careful", + "strum 0.27.1", + "thiserror 2.0.12", + "tor-async-utils", + "tor-basic-utils", + "tor-bytes", + "tor-cell", + "tor-checkable", + "tor-circmgr", + "tor-config", + "tor-dirclient", + "tor-error", + "tor-hscrypto", + "tor-keymgr", + "tor-linkspec", + "tor-llcrypto", + "tor-memquota", + "tor-netdir", + "tor-netdoc", + "tor-persist", + "tor-proto", + "tor-protover", + "tor-rtcompat", + "tracing", +] + +[[package]] +name = "tor-hscrypto" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7469efe5d22466fcaaeec9506bf03426ce59c03ee1b8a7c8b316830b153b40a" +dependencies = [ + "cipher", + "data-encoding", + "derive-deftly 1.1.0", + "derive_more", + "digest", + "hex", + "humantime", + "itertools 0.14.0", + "paste", + "rand 0.9.1", + "safelog", + "serde", + "signature", + "subtle", + "thiserror 2.0.12", + "tor-basic-utils", + "tor-bytes", + "tor-error", + "tor-key-forge", + "tor-llcrypto", + "tor-memquota", + "tor-units", + "void", + "zeroize", +] + +[[package]] +name = "tor-hsservice" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60ed074e5e9a9eb14e4e98b37d9f08a43538883e71ba916c859dbc4f6ad90f1f" +dependencies = [ + "amplify", + "async-trait", + "base64ct", + "cfg-if", + "derive-deftly 1.1.0", + "derive_builder_fork_arti", + "derive_more", + "digest", + "educe", + "fs-mistrust", + "futures", + "growable-bloom-filter", + "hex", + "humantime", + "itertools 0.14.0", + "k12", + "once_cell", + "oneshot-fused-workaround", + "postage", + "rand 0.9.1", + "rand_core 0.9.3", + "retry-error", + "safelog", + "serde", + "serde_with", + "strum 0.27.1", + "thiserror 2.0.12", + "tor-async-utils", + "tor-basic-utils", + "tor-bytes", + "tor-cell", + "tor-circmgr", + "tor-config", + "tor-config-path", + "tor-dirclient", + "tor-error", + "tor-hscrypto", + "tor-keymgr", + "tor-linkspec", + "tor-llcrypto", + "tor-log-ratelim", + "tor-netdir", + "tor-netdoc", + "tor-persist", + "tor-proto", + "tor-protover", + "tor-relay-selection", + "tor-rtcompat", + "tracing", + "void", +] + +[[package]] +name = "tor-key-forge" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6697b58f1518757b975993d345a261387eb7a86c730cb542ad1ea68284155eaa" +dependencies = [ + "derive-deftly 1.1.0", + "derive_more", + "downcast-rs", + "paste", + "rand 0.9.1", + "signature", + "ssh-key", + "thiserror 2.0.12", + "tor-bytes", + "tor-cert", + "tor-checkable", + "tor-error", + "tor-llcrypto", +] + +[[package]] +name = "tor-keymgr" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56d765c0fd6b1910b427feb1b604fbc85e5768332e9be1e670bf64e698c92606" +dependencies = [ + "amplify", + "arrayvec", + "cfg-if", + "derive-deftly 1.1.0", + "derive_builder_fork_arti", + "derive_more", + "downcast-rs", + "dyn-clone", + "fs-mistrust", + "glob-match", + "humantime", + "inventory", + "itertools 0.14.0", + "rand 0.9.1", + "serde", + "signature", + "ssh-key", + "thiserror 2.0.12", + "tor-basic-utils", + "tor-bytes", + "tor-config", + "tor-config-path", + "tor-error", + "tor-hscrypto", + "tor-key-forge", + "tor-llcrypto", + "tor-persist", + "tracing", + "walkdir", + "zeroize", +] + +[[package]] +name = "tor-linkspec" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1feeea901ff88616175c3bcf3fbc53466117e7d655c15253f80260be017333bd" +dependencies = [ + "base64ct", + "by_address", + "caret", + "derive-deftly 1.1.0", + "derive_builder_fork_arti", + "derive_more", + "hex", + "itertools 0.14.0", + "safelog", + "serde", + "serde_with", + "strum 0.27.1", + "thiserror 2.0.12", + "tor-basic-utils", + "tor-bytes", + "tor-config", + "tor-llcrypto", + "tor-memquota", + "tor-protover", +] + +[[package]] +name = "tor-llcrypto" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "992c49dd4c285c52594858c0e92afe96531203dbe9bb29cfbe6937d94bb3c7ad" +dependencies = [ + "aes", + "base64ct", + "ctr", + "curve25519-dalek", + "der-parser", + "derive-deftly 1.1.0", + "derive_more", + "digest", + "ed25519-dalek", + "educe", + "getrandom 0.3.3", + "hex", + "rand 0.9.1", + "rand_chacha 0.9.0", + "rand_core 0.6.4", + "rand_core 0.9.3", + "rand_jitter", + "rdrand", + "rsa", + "safelog", + "serde", + "sha1", + "sha2", + "sha3", + "signature", + "subtle", + "thiserror 2.0.12", + "tor-memquota", + "visibility", + "x25519-dalek", + "zeroize", +] + +[[package]] +name = "tor-log-ratelim" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "511702fd833651896f1e6ca486c1b0d8d3f28b8f8724526ae8260c33ee49b2e8" +dependencies = [ + "futures", + "humantime", + "thiserror 2.0.12", + "tor-error", + "tor-rtcompat", + "tracing", + "weak-table", +] + +[[package]] +name = "tor-memquota" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07de5fe3ab545970b36319397b8c5e82fffbad5682581e06d030cfda0296cd9f" +dependencies = [ + "derive-deftly 1.1.0", + "derive_more", + "dyn-clone", + "educe", + "futures", + "itertools 0.14.0", + "paste", + "pin-project", + "serde", + "slotmap-careful", + "static_assertions", + "thiserror 2.0.12", + "tor-async-utils", + "tor-basic-utils", + "tor-config", + "tor-error", + "tor-log-ratelim", + "tor-rtcompat", + "tracing", + "void", +] + +[[package]] +name = "tor-netdir" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497936529955a5512e2500366aca3f353081f51edde633d5c9fc2124f1da36a6" +dependencies = [ + "async-trait", + "bitflags 2.9.0", + "derive_more", + "digest", + "futures", + "hex", + "humantime", + "itertools 0.14.0", + "num_enum", + "rand 0.9.1", + "serde", + "static_assertions", + "strum 0.27.1", + "thiserror 2.0.12", + "time", + "tor-basic-utils", + "tor-error", + "tor-hscrypto", + "tor-linkspec", + "tor-llcrypto", + "tor-netdoc", + "tor-protover", + "tor-units", + "tracing", + "typed-index-collections", +] + +[[package]] +name = "tor-netdoc" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f51ac213a399bf26bc4801495dd17ede3c118d2bedd6575d79c08dbf1379c1a7" +dependencies = [ + "amplify", + "base64ct", + "bitflags 2.9.0", + "cipher", + "derive_builder_fork_arti", + "derive_more", + "digest", + "educe", + "hex", + "humantime", + "itertools 0.14.0", + "memchr", + "phf 0.12.1", + "rand 0.9.1", + "serde", + "serde_with", + "signature", + "smallvec", + "subtle", + "thiserror 2.0.12", + "time", + "tinystr", + "tor-basic-utils", + "tor-bytes", + "tor-cell", + "tor-cert", + "tor-checkable", + "tor-error", + "tor-hscrypto", + "tor-linkspec", + "tor-llcrypto", + "tor-protover", + "tor-units", + "void", + "weak-table", + "zeroize", +] + +[[package]] +name = "tor-persist" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fabc9ba76dbe0ca3b254ed73480455a337c1941904f375d583efcdc57966f98" +dependencies = [ + "amplify", + "derive-deftly 1.1.0", + "derive_more", + "filetime", + "fs-mistrust", + "fslock", + "fslock-guard", + "futures", + "itertools 0.14.0", + "oneshot-fused-workaround", + "paste", + "sanitize-filename", + "serde", + "serde_json", + "thiserror 2.0.12", + "time", + "tor-async-utils", + "tor-basic-utils", + "tor-error", + "tracing", + "void", +] + +[[package]] +name = "tor-proto" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89554cb29f3002b33851e5113b10ae97ca395548a11639de557caac01f627f41" +dependencies = [ + "amplify", + "asynchronous-codec", + "bitvec", + "bytes", + "caret", + "cfg-if", + "cipher", + "coarsetime", + "criterion-cycles-per-byte", + "derive-deftly 1.1.0", + "derive_builder_fork_arti", + "derive_more", + "digest", + "educe", + "futures", + "futures-util", + "hkdf", + "hmac", + "itertools 0.14.0", + "oneshot-fused-workaround", + "pin-project", + "postage", + "rand 0.9.1", + "rand_core 0.9.3", + "safelog", + "slotmap-careful", + "smallvec", + "static_assertions", + "subtle", + "sync_wrapper 1.0.2", + "thiserror 2.0.12", + "tokio", + "tokio-util", + "tor-async-utils", + "tor-basic-utils", + "tor-bytes", + "tor-cell", + "tor-cert", + "tor-checkable", + "tor-config", + "tor-error", + "tor-hscrypto", + "tor-linkspec", + "tor-llcrypto", + "tor-log-ratelim", + "tor-memquota", + "tor-protover", + "tor-rtcompat", + "tor-rtmock", + "tor-units", + "tracing", + "typenum", + "visibility", + "void", + "zeroize", +] + +[[package]] +name = "tor-protover" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4af2a2d9610dafe2fd8eb79015f91e0e8881155147d676b190e061ae7ee0403e" +dependencies = [ + "caret", + "paste", + "serde_with", + "thiserror 2.0.12", + "tor-bytes", +] + +[[package]] +name = "tor-relay-selection" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5516546b720c83a21636824f2a03c64caf1a72bc1f94ee16672679f1295e7a6" +dependencies = [ + "rand 0.9.1", + "serde", + "tor-basic-utils", + "tor-linkspec", + "tor-netdir", + "tor-netdoc", +] + +[[package]] +name = "tor-rtcompat" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75969f63c5147af49753e1c03339d342bc3e53e7412518e52702cc417cff729" +dependencies = [ + "async-native-tls", + "async-trait", + "async_executors", + "asynchronous-codec", + "coarsetime", + "derive_more", + "dyn-clone", + "educe", + "futures", + "hex", + "libc", + "native-tls", + "paste", + "pin-project", + "thiserror 2.0.12", + "tokio", + "tokio-util", + "tor-error", + "tor-general-addr", + "tracing", + "void", +] + +[[package]] +name = "tor-rtmock" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a13e2946c396cf450ea4f9a3b48f2c4125b011da6019d7da7f1e0e7cd37596c9" +dependencies = [ + "amplify", + "assert_matches", + "async-trait", + "derive-deftly 1.1.0", + "derive_more", + "educe", + "futures", + "humantime", + "itertools 0.14.0", + "oneshot-fused-workaround", + "pin-project", + "priority-queue", + "slotmap-careful", + "strum 0.27.1", + "thiserror 2.0.12", + "tor-error", + "tor-general-addr", + "tor-rtcompat", + "tracing", + "tracing-test", + "void", +] + +[[package]] +name = "tor-socksproto" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b7d2a9b7394b8f2c683d282f4a0da08c056ed23b3bb9afdb84cb92d554c77b" +dependencies = [ + "amplify", + "caret", + "derive-deftly 1.1.0", + "educe", + "safelog", + "subtle", + "thiserror 2.0.12", + "tor-bytes", + "tor-error", +] + +[[package]] +name = "tor-units" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22f2bd3dc4f5defec5d4b9d152d911a3a852d08409558dd927ec8eb28e20f9de" +dependencies = [ + "derive-deftly 1.1.0", + "derive_more", + "serde", + "thiserror 2.0.12", + "tor-memquota", +] + [[package]] name = "tower" version = "0.5.1" @@ -3444,7 +6519,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3566e8ce28cc0a3fe42519fc80e6b4c943cc4c8cef275620eb8dac2d3d4e06cf" dependencies = [ "crossbeam-channel", - "thiserror", + "thiserror 1.0.69", "time", "tracing-subscriber", ] @@ -3487,20 +6562,55 @@ version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" dependencies = [ + "matchers", "nu-ansi-term", + "once_cell", + "regex", "sharded-slab", "smallvec", "thread_local", + "tracing", "tracing-core", "tracing-log", ] +[[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.101", +] + [[package]] name = "try-lock" version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +[[package]] +name = "typed-index-collections" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fd393dbd1e7b23e0cab7396570309b4068aa504e9dac2cd41d827583b4e9ab7" +dependencies = [ + "bincode 2.0.1", + "serde", +] + [[package]] name = "typenum" version = "1.18.0" @@ -3513,12 +6623,27 @@ 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 = "unicode-ident" version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" +[[package]] +name = "unicode-segmentation" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" + [[package]] name = "unicode-xid" version = "0.2.6" @@ -3531,6 +6656,12 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" +[[package]] +name = "unty" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d49784317cd0d1ee7ec5c716dd598ec5b4483ea832a2dced265471cc0f690ae" + [[package]] name = "ureq" version = "2.12.1" @@ -3572,12 +6703,35 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + [[package]] name = "version_check" version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" +[[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.101", +] + +[[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" + [[package]] name = "wait-timeout" version = "0.2.1" @@ -3587,6 +6741,16 @@ dependencies = [ "libc", ] +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + [[package]] name = "want" version = "0.3.1" @@ -3611,6 +6775,15 @@ dependencies = [ "wit-bindgen-rt", ] +[[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.100" @@ -3669,6 +6842,22 @@ dependencies = [ "unicode-ident", ] +[[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.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + [[package]] name = "webpki-roots" version = "0.26.11" @@ -3703,6 +6892,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +[[package]] +name = "winapi-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys 0.59.0", +] + [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -3991,6 +7189,24 @@ dependencies = [ "tap", ] +[[package]] +name = "x25519-dalek" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7e468321c81fb07fa7f4c636c3972b9100f0346e5b6a9f2bd0603a52f7ed277" +dependencies = [ + "curve25519-dalek", + "rand_core 0.6.4", + "serde", + "zeroize", +] + +[[package]] +name = "xxhash-rust" +version = "0.8.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdd20c5420375476fbd4394763288da7eb0cc0b8c11deed431a91562af7335d3" + [[package]] name = "yansi" version = "1.0.1" diff --git a/Cargo.toml b/Cargo.toml index 32f8248..c510625 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -167,6 +167,7 @@ axum = { version = "0.7", default-features = false } anyhow = { version = "1", default-features = false } arc-swap = { version = "1", default-features = false } arrayvec = { version = "0.7", default-features = false } +arti-client = { version = "0.32", default-features = false } async-trait = { version = "0.1", default-features = false } bitflags = { version = "2", default-features = false } blake3 = { version = "1", default-features = false } @@ -203,11 +204,18 @@ thiserror = { version = "1", default-features = false } thread_local = { version = "1", default-features = false } tokio-util = { version = "0.7", default-features = false } tokio-stream = { version = "0.1", default-features = false } +tokio-socks = { git = "https://github.com/Cuprate/tokio-socks.git", rev = "8737caf", default-features = false } tokio = { version = "1", default-features = false } tower = { git = "https://github.com/Cuprate/tower.git", rev = "6c7faf0", default-features = false } # tower-http = { version = "0.6", default-features = false } toml = { version = "0.8", default-features = false } toml_edit = { version = "0.22", default-features = false } +tor-cell = { version = "0.32", default-features = false } +tor-config-path = { version = "0.32", default-features = false } +tor-hsservice = { version = "0.32", default-features = false } +tor-persist = { version = "0.32", default-features = false } +tor-proto = { version = "0.32", default-features = false } +tor-rtcompat = { version = "0.32", default-features = false } tracing-appender = { version = "0.2", default-features = false } tracing-subscriber = { version = "0.3", default-features = false } tracing = { version = "0.1", default-features = false } diff --git a/binaries/cuprated/Cargo.toml b/binaries/cuprated/Cargo.toml index 64778a9..bb21ccc 100644 --- a/binaries/cuprated/Cargo.toml +++ b/binaries/cuprated/Cargo.toml @@ -28,6 +28,7 @@ cuprate-hex = { workspace = true } cuprate-json-rpc = { workspace = true } cuprate-levin = { workspace = true } cuprate-p2p-core = { workspace = true } +cuprate-p2p-transport = { workspace = true } cuprate-p2p = { workspace = true } cuprate-pruning = { workspace = true } cuprate-rpc-interface = { workspace = true, features = ["dummy"] } @@ -41,6 +42,7 @@ cuprate-wire = { workspace = true } # TODO: after v1.0.0, remove unneeded dependencies. axum = { workspace = true, features = ["tokio", "http1", "http2"] } anyhow = { workspace = true } +arti-client = { workspace = true, features = ["tokio", "native-tls", "onion-service-client", "onion-service-service", "static"] } async-trait = { workspace = true } bitflags = { workspace = true } borsh = { workspace = true } @@ -79,6 +81,9 @@ tokio-stream = { workspace = true } tokio = { workspace = true } toml = { workspace = true, features = ["parse", "display"]} toml_edit = { workspace = true } +tor-hsservice = { workspace = true } +tor-persist = { workspace = true } +tor-rtcompat = { workspace = true } tower = { workspace = true, features = ["limit"] } tower-http = { workspace = true, features = ["limit"] } tracing-appender = { workspace = true } diff --git a/binaries/cuprated/src/config.rs b/binaries/cuprated/src/config.rs index d74deeb..feddff2 100644 --- a/binaries/cuprated/src/config.rs +++ b/binaries/cuprated/src/config.rs @@ -8,6 +8,7 @@ use std::{ time::Duration, }; +use arti_client::KeystoreSelector; use clap::Parser; use serde::{Deserialize, Serialize}; @@ -17,11 +18,13 @@ use cuprate_helper::{ network::Network, }; use cuprate_p2p::block_downloader::BlockDownloaderConfig; -use cuprate_p2p_core::ClearNet; +use cuprate_p2p_core::{ClearNet, Tor}; +use cuprate_wire::OnionAddr; use crate::{ constants::{DEFAULT_CONFIG_STARTUP_DELAY, DEFAULT_CONFIG_WARNING}, logging::eprintln_red, + tor::{TorContext, TorMode}, }; mod args; @@ -31,6 +34,7 @@ mod rayon; mod rpc; mod storage; mod tokio; +mod tor; mod tracing_config; #[macro_use] @@ -42,6 +46,7 @@ use rayon::RayonConfig; pub use rpc::RpcConfig; use storage::StorageConfig; use tokio::TokioConfig; +use tor::TorConfig; use tracing_config::TracingConfig; /// Header to put at the start of the generated config file. @@ -144,6 +149,10 @@ config_struct! { /// Configuration for cuprated's P2P system. pub p2p: P2PConfig, + #[child = true] + /// Configuration for cuprated's Tor component + pub tor: TorConfig, + #[child = true] /// Configuration for cuprated's RPC system. pub rpc: RpcConfig, @@ -165,6 +174,7 @@ impl Default for Config { fast_sync: true, tracing: Default::default(), tokio: Default::default(), + tor: Default::default(), rayon: Default::default(), p2p: Default::default(), rpc: Default::default(), @@ -227,6 +237,45 @@ impl Config { } } + /// The [`Tor`], [`cuprate_p2p::P2PConfig`]. + pub fn tor_p2p_config(&self, ctx: &TorContext) -> cuprate_p2p::P2PConfig { + let inbound_enabled = self.p2p.tor_net.inbound_onion; + let our_onion_address = match ctx.mode { + TorMode::Off => None, + TorMode::Daemon => inbound_enabled.then(|| + OnionAddr::new( + &self.tor.daemon.anonymous_inbound, + self.p2p.tor_net.p2p_port + ).expect("Unable to parse supplied `anonymous_inbound` onion address. Please make sure the address is correct.")), + TorMode::Arti => inbound_enabled.then(|| { + let addr = ctx.arti_onion_service + .as_ref() + .unwrap() + .generate_identity_key(KeystoreSelector::Primary) + .unwrap() + .to_string(); + + OnionAddr::new(&addr, self.p2p.tor_net.p2p_port).unwrap() + }) + }; + + cuprate_p2p::P2PConfig { + network: self.network, + seeds: p2p::tor_net_seed_nodes(self.network), + outbound_connections: self.p2p.tor_net.outbound_connections, + extra_outbound_connections: self.p2p.tor_net.extra_outbound_connections, + max_inbound_connections: self.p2p.tor_net.max_inbound_connections, + gray_peers_percent: self.p2p.tor_net.gray_peers_percent, + p2p_port: self.p2p.tor_net.p2p_port, + rpc_port: 0, + address_book_config: self.p2p.tor_net.address_book_config.address_book_config( + &self.fs.cache_directory, + self.network, + our_onion_address, + ), + } + } + /// The [`ContextConfig`]. pub const fn context_config(&self) -> ContextConfig { match self.network { diff --git a/binaries/cuprated/src/config/p2p.rs b/binaries/cuprated/src/config/p2p.rs index 2fda708..e4b13a8 100644 --- a/binaries/cuprated/src/config/p2p.rs +++ b/binaries/cuprated/src/config/p2p.rs @@ -5,16 +5,24 @@ use std::{ time::Duration, }; +use arti_client::{ + config::onion_service::{OnionServiceConfig, OnionServiceConfigBuilder}, + TorClient, TorClientBuilder, TorClientConfig, +}; use serde::{Deserialize, Serialize}; +use tor_rtcompat::PreferredRuntime; use cuprate_helper::{fs::address_book_path, network::Network}; use cuprate_p2p::config::TransportConfig; use cuprate_p2p_core::{ transports::{Tcp, TcpServerConfig}, - ClearNet, NetworkZone, Transport, + ClearNet, NetworkZone, Tor, Transport, }; +use cuprate_p2p_transport::{Arti, ArtiClientConfig, ArtiServerConfig}; use cuprate_wire::OnionAddr; +use crate::{p2p::ProxySettings, tor::TorMode}; + use super::macros::config_struct; config_struct! { @@ -26,6 +34,10 @@ config_struct! { /// The clear-net P2P config. pub clear_net: ClearNetConfig, + #[child = true] + /// The tor-net P2P config. + pub tor_net: TorNetConfig, + #[child = true] /// Block downloader config. /// @@ -147,9 +159,10 @@ config_struct! { /// Examples | 0.0, 0.5, 0.123, 0.999, 1.0 pub gray_peers_percent: f64, - /// The port to use to accept incoming IPv4 P2P connections. + /// The port bind to this network zone. /// - /// Setting this to 0 will disable incoming P2P connections. + /// This port will be bind to if the incoming P2P + /// server for this zone has been enabled. /// /// Type | Number /// Valid values | 0..65534 @@ -165,6 +178,17 @@ config_struct! { #[derive(Debug, Deserialize, Serialize, PartialEq)] #[serde(deny_unknown_fields, default)] pub struct ClearNetConfig { + + /// Enable IPv4 inbound server. + /// + /// The inbound server will listen on port `p2p.clear_net.p2p_port`. + /// Setting this to `false` will disable incoming IPv4 P2P connections. + /// + /// Type | boolean + /// Valid values | false, true + /// Examples | false + pub enable_inbound: bool, + /// The IPv4 address to bind and listen for connections on. /// /// Type | IPv4 address @@ -173,6 +197,7 @@ config_struct! { /// Enable IPv6 inbound server. /// + /// The inbound server will listen on port `p2p.clear_net.p2p_port`. /// Setting this to `false` will disable incoming IPv6 P2P connections. /// /// Type | boolean @@ -185,20 +210,83 @@ config_struct! { /// Type | IPv6 address /// Examples | "::", "2001:0db8:85a3:0000:0000:8a2e:0370:7334" pub listen_on_v6: Ipv6Addr, + + #[comment_out = true] + /// The proxy to use for outgoing P2P connections + /// + /// This setting can only take "Tor" at the moment. + /// This will anonymise clearnet connections through Tor. + /// + /// Setting this to "" (an empty string) will disable the proxy. + /// + /// Enabling this setting will disable inbound connections. + /// + /// Type | String + /// Valid values | "Tor" + /// Examples | "Tor" + pub proxy: ProxySettings, + } + + /// The config values for P2P tor. + #[derive(Debug, Deserialize, Serialize, PartialEq)] + #[serde(deny_unknown_fields, default)] + pub struct TorNetConfig { + + #[comment_out = true] + /// Enable the Tor P2P network. + /// + /// Type | boolean + /// Valid values | false, true + /// Examples | false + pub enabled: bool, + + #[comment_out = true] + /// Enable Tor inbound onion server. + /// + /// In Arti mode, setting this to `true` will enable Arti's onion service for accepting inbound + /// Tor P2P connections. The keypair and therefore onion address is generated randomly on first run. + /// + /// In Daemon mode, setting this to `true` will enable a TCP server listening for inbound connections + /// from your Tor daemon. Refer to the `tor.anonymous_inbound` and `tor.listening_addr` field for onion address + /// and listening configuration. + /// + /// The server will listen on port `p2p.tor_net.p2p_port` + /// + /// Type | boolean + /// Valid values | false, true + /// Examples | false + pub inbound_onion: bool, } } impl Default for ClearNetConfig { fn default() -> Self { Self { + p2p_port: 18080, + enable_inbound: true, listen_on: Ipv4Addr::UNSPECIFIED, enable_inbound_v6: false, listen_on_v6: Ipv6Addr::UNSPECIFIED, + proxy: ProxySettings::Socks(String::new()), outbound_connections: 32, extra_outbound_connections: 8, max_inbound_connections: 128, gray_peers_percent: 0.7, + address_book_config: AddressBookConfig::default(), + } + } +} + +impl Default for TorNetConfig { + fn default() -> Self { + Self { + enabled: false, + inbound_onion: false, p2p_port: 18080, + outbound_connections: 12, + extra_outbound_connections: 2, + max_inbound_connections: 128, + gray_peers_percent: 0.7, address_book_config: AddressBookConfig::default(), } } diff --git a/binaries/cuprated/src/config/tor.rs b/binaries/cuprated/src/config/tor.rs new file mode 100644 index 0000000..1fbdbfe --- /dev/null +++ b/binaries/cuprated/src/config/tor.rs @@ -0,0 +1,133 @@ +use std::{ + net::{IpAddr, Ipv4Addr, SocketAddr, SocketAddrV4}, + path::PathBuf, +}; + +use serde::{Deserialize, Serialize}; + +use cuprate_helper::fs::CUPRATE_DATA_DIR; + +use crate::{config::macros::config_struct, tor::TorMode}; + +config_struct! { + /// Arti config + #[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq)] + #[serde(deny_unknown_fields, default)] + #[allow(rustdoc::broken_intra_doc_links)] + pub struct ArtiConfig { + /// Path to the arti state directory. + /// + /// The default directories for each OS: + /// + /// | OS | Path | + /// |---------|-----------------------------------------------------| + /// | Windows | "C:\Users\Alice\AppData\Roaming\Cuprate\" | + /// | macOS | "/Users/Alice/Library/Application Support/Cuprate/" | + /// | Linux | "/home/alice/.local/share/cuprate/" | + pub directory_path: PathBuf, + + /// Enable isolated circuits for Arti. + /// + /// If set, Arti will use different tor circuits for each connections. This can + /// cause stability issues if the connection count is important. + /// + /// Type | boolean + /// Valid values | false, true + /// Examples | false + pub isolated_circuit: bool, + + /// Enable PoW security for Arti. + /// + /// If set, Arti will enforce an EquiX PoW to be resolved for + /// other nodes to complete a rendez-vous request when under + /// heavy load. + /// + /// Type | boolean + /// Valid values | false, true + /// Examples | false + pub onion_service_pow: bool, + } + + /// Tor config + #[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq)] + #[serde(deny_unknown_fields, default)] + #[allow(rustdoc::broken_intra_doc_links)] + pub struct TorDaemonConfig { + /// The IP address and port of the external Tor daemon to use for outgoing connections. + /// + /// Type | Socket address + /// Examples | "[::1]:9050", "127.0.0.1:9050" + pub address: SocketAddr, + + #[comment_out = true] + /// Enable inbound connections for Daemon mode + /// + /// This string specify the onion address that should be advertized to the Tor network + /// and that your daemon should be expecting connections from. + /// + /// When this is set, `p2p.tor_net.p2p_port` is not used for host listening, but as the source + /// port of your hidden service in your torrc configuration file. For setting Cuprate's + /// listening port see `tor.listening_addr` field + /// + /// Type | String + /// Valid values | "<56 character domain>.onion" + /// Examples | "monerotoruzizulg5ttgat2emf4d6fbmiea25detrmmy7erypseyteyd.onion" + pub anonymous_inbound: String, + + /// The IP address and port to bind and listen on for anonymous inbound connections from Tor Daemon. + /// + /// Type | Socket address + /// Examples | "0.0.0.0:18083", "192.168.1.50:2000", "[::]:5000", "[2001:0db8:85a3:0000:0000:8a2e:0370:7334]:18082" + pub listening_addr: SocketAddr, + } + + /// Tor config + #[derive(Debug, Default, Clone, Deserialize, Serialize, PartialEq, Eq)] + #[serde(deny_unknown_fields, default)] + #[allow(rustdoc::broken_intra_doc_links)] + pub struct TorConfig { + + #[comment_out = true] + /// Enable Tor network by specifying how to connect to it. + /// + /// When "Daemon" is set, the Tor daemon address to use can be + /// specified in `tor.daemon_addr`. + /// + /// Type | String + /// Valid values | "Arti", "Daemon", "Off" + /// Examples | "Arti" + pub mode: TorMode, + + #[child = true] + /// Arti config + /// + /// Only relevant if `tor.mode` is set to "Arti" + pub arti: ArtiConfig, + + #[child = true] + /// Tor Daemon config + /// + /// Only relevant if `tor.mode` is set to "Daemon" + pub daemon: TorDaemonConfig, + } +} + +impl Default for TorDaemonConfig { + fn default() -> Self { + Self { + address: "127.0.0.1:9050".parse().unwrap(), + anonymous_inbound: String::new(), + listening_addr: SocketAddrV4::new(Ipv4Addr::LOCALHOST, 18083).into(), + } + } +} + +impl Default for ArtiConfig { + fn default() -> Self { + Self { + directory_path: CUPRATE_DATA_DIR.join("arti"), + isolated_circuit: false, + onion_service_pow: false, + } + } +} diff --git a/binaries/cuprated/src/main.rs b/binaries/cuprated/src/main.rs index 0081dbb..5bf6feb 100644 --- a/binaries/cuprated/src/main.rs +++ b/binaries/cuprated/src/main.rs @@ -34,7 +34,10 @@ use cuprate_types::blockchain::BlockchainWriteRequest; use txpool::IncomingTxHandler; use crate::{ - config::Config, constants::PANIC_CRITICAL_SERVICE_ERROR, logging::CupratedTracingFilter, + config::Config, + constants::PANIC_CRITICAL_SERVICE_ERROR, + logging::CupratedTracingFilter, + tor::{initialize_tor_if_enabled, TorMode}, }; mod blockchain; @@ -47,6 +50,7 @@ mod p2p; mod rpc; mod signals; mod statics; +mod tor; mod txpool; mod version; @@ -118,20 +122,23 @@ fn main() { .await .unwrap(); + // Bootstrap or configure Tor if enabled. + let tor_context = initialize_tor_if_enabled(&config).await; + // Start p2p network zones let (network_interfaces, tx_handler_subscribers) = p2p::initialize_zones_p2p( &config, context_svc.clone(), - blockchain_write_handle.clone(), blockchain_read_handle.clone(), - txpool_write_handle.clone(), txpool_read_handle.clone(), + tor_context, ) .await; // Create the incoming tx handler service. let tx_handler = IncomingTxHandler::init( network_interfaces.clearnet_network_interface.clone(), + network_interfaces.tor_network_interface, txpool_write_handle.clone(), txpool_read_handle.clone(), context_svc.clone(), diff --git a/binaries/cuprated/src/p2p.rs b/binaries/cuprated/src/p2p.rs index 3a0e410..b268c93 100644 --- a/binaries/cuprated/src/p2p.rs +++ b/binaries/cuprated/src/p2p.rs @@ -4,14 +4,20 @@ use std::convert::From; +use arti_client::TorClient; use futures::{FutureExt, TryFutureExt}; +use serde::{Deserialize, Serialize}; use tokio::sync::oneshot::{self, Sender}; +use tor_rtcompat::PreferredRuntime; use tower::{Service, ServiceExt}; use cuprate_blockchain::service::{BlockchainReadHandle, BlockchainWriteHandle}; use cuprate_consensus::BlockchainContextService; use cuprate_p2p::{config::TransportConfig, NetworkInterface, P2PConfig}; -use cuprate_p2p_core::{client::InternalPeerID, transports::Tcp, ClearNet, NetworkZone, Transport}; +use cuprate_p2p_core::{ + client::InternalPeerID, transports::Tcp, ClearNet, NetworkZone, Tor, Transport, +}; +use cuprate_p2p_transport::{Arti, ArtiClientConfig, Daemon}; use cuprate_txpool::service::{TxpoolReadHandle, TxpoolWriteHandle}; use cuprate_types::blockchain::BlockchainWriteRequest; @@ -19,6 +25,10 @@ use crate::{ blockchain, config::Config, constants::PANIC_CRITICAL_SERVICE_ERROR, + tor::{ + transport_arti_config, transport_clearnet_arti_config, transport_daemon_config, TorContext, + TorMode, + }, txpool::{self, IncomingTxHandler}, }; @@ -28,10 +38,20 @@ pub mod request_handler; pub use network_address::CrossNetworkInternalPeerId; +/// A simple parsing enum for the `p2p.clear_net.proxy` field +#[derive(Debug, Deserialize, Serialize, PartialEq, Eq)] +pub enum ProxySettings { + Tor, + #[serde(untagged)] + Socks(String), +} + /// This struct collect all supported and optional network zone interfaces. pub struct NetworkInterfaces { /// Mandatory clearnet network interface pub clearnet_network_interface: NetworkInterface, + /// Optional tor network interface + pub tor_network_interface: Option>, // ...one can dream for more! } @@ -39,6 +59,7 @@ impl NetworkInterfaces { pub const fn new(clearnet_network_interface: NetworkInterface) -> Self { Self { clearnet_network_interface, + tor_network_interface: None, } } } @@ -48,25 +69,93 @@ impl NetworkInterfaces { pub async fn initialize_zones_p2p( config: &Config, context_svc: BlockchainContextService, - mut blockchain_write_handle: BlockchainWriteHandle, mut blockchain_read_handle: BlockchainReadHandle, - txpool_write_handle: TxpoolWriteHandle, txpool_read_handle: TxpoolReadHandle, + tor_ctx: TorContext, ) -> (NetworkInterfaces, Vec>) { - // Start TCP clearnet P2P. - let (clearnet, incoming_tx_handler_tx) = start_zone_p2p::( - blockchain_read_handle.clone(), - context_svc.clone(), - txpool_read_handle.clone(), - config.clearnet_p2p_config(), - (&config.p2p.clear_net).into(), - ) - .await - .unwrap(); + // Start clearnet P2P. + let (clearnet, incoming_tx_handler_tx) = { + // If proxy is set + match config.p2p.clear_net.proxy { + ProxySettings::Tor => match tor_ctx.mode { + TorMode::Arti => { + tracing::info!("Anonymizing clearnet connections through Arti."); + start_zone_p2p::( + blockchain_read_handle.clone(), + context_svc.clone(), + txpool_read_handle.clone(), + config.clearnet_p2p_config(), + transport_clearnet_arti_config(&tor_ctx), + ) + .await + .unwrap() + } + TorMode::Daemon => { + tracing::error!("Anonymizing clearnet connections through the Tor daemon is not yet supported."); + std::process::exit(0); + } + TorMode::Off => { + tracing::error!("Clearnet proxy set to \"tor\" but Tor is actually off. Please be sure to set a mode in the configuration or command line"); + std::process::exit(0); + } + }, + ProxySettings::Socks(ref s) => { + if !s.is_empty() { + tracing::error!("Socks proxy is not yet supported."); + std::process::exit(0); + } + + start_zone_p2p::( + blockchain_read_handle.clone(), + context_svc.clone(), + txpool_read_handle.clone(), + config.clearnet_p2p_config(), + (&config.p2p.clear_net).into(), + ) + .await + .unwrap() + } + } + }; // Create network interface collection - let network_interfaces = NetworkInterfaces::new(clearnet); - let tx_handler_subscribers = vec![incoming_tx_handler_tx]; + let mut network_interfaces = NetworkInterfaces::new(clearnet); + let mut tx_handler_subscribers = vec![incoming_tx_handler_tx]; + + // Start Tor P2P (if enabled) + let tor = if config.p2p.tor_net.enabled { + match tor_ctx.mode { + TorMode::Off => None, + TorMode::Daemon => Some( + start_zone_p2p::( + blockchain_read_handle.clone(), + context_svc.clone(), + txpool_read_handle.clone(), + config.tor_p2p_config(&tor_ctx), + transport_daemon_config(config), + ) + .await + .unwrap(), + ), + TorMode::Arti => Some( + start_zone_p2p::( + blockchain_read_handle.clone(), + context_svc.clone(), + txpool_read_handle.clone(), + config.tor_p2p_config(&tor_ctx), + transport_arti_config(config, tor_ctx), + ) + .await + .unwrap(), + ), + } + } else { + None + }; + if let Some((tor, incoming_tx_handler_tx)) = tor { + network_interfaces.tor_network_interface = Some(tor); + tx_handler_subscribers.push(incoming_tx_handler_tx); + } (network_interfaces, tx_handler_subscribers) } diff --git a/binaries/cuprated/src/p2p/request_handler.rs b/binaries/cuprated/src/p2p/request_handler.rs index a7df1dc..79f14db 100644 --- a/binaries/cuprated/src/p2p/request_handler.rs +++ b/binaries/cuprated/src/p2p/request_handler.rs @@ -386,12 +386,14 @@ where return Ok(ProtocolResponse::NA); } - let state = if request.dandelionpp_fluff { + let addr = peer_information.id.into(); + + let anon_zone = matches!(addr, CrossNetworkInternalPeerId::Tor(_)); + + let state = if request.dandelionpp_fluff && !anon_zone { TxState::Fluff } else { - TxState::Stem { - from: peer_information.id.into(), - } + TxState::Stem { from: addr } }; // Drop all the data except the stuff we still need. diff --git a/binaries/cuprated/src/tor.rs b/binaries/cuprated/src/tor.rs new file mode 100644 index 0000000..76dc421 --- /dev/null +++ b/binaries/cuprated/src/tor.rs @@ -0,0 +1,197 @@ +//! Tor initialization +//! +//! Extract configuration and initialize Arti. + +//---------------------------------------------------------------------------------------------------- Imports + +use std::{default, sync::Arc}; + +use arti_client::{ + config::{onion_service::OnionServiceConfigBuilder, CfgPath, TorClientConfigBuilder}, + KeystoreSelector, StreamPrefs, TorClient, TorClientBuilder, TorClientConfig, +}; +use futures::Stream; +use serde::{Deserialize, Serialize}; +use tor_hsservice::{OnionService, RendRequest, RunningOnionService}; +use tor_persist::hsnickname::HsNickname; +use tor_rtcompat::PreferredRuntime; +use tracing::info; + +use cuprate_helper::fs::CUPRATE_DATA_DIR; +use cuprate_p2p::TransportConfig; +use cuprate_p2p_core::{ClearNet, Tor}; +use cuprate_p2p_transport::{ + Arti, ArtiClientConfig, ArtiServerConfig, Daemon, DaemonClientConfig, DaemonServerConfig, +}; +use cuprate_wire::OnionAddr; + +use crate::{config::Config, p2p::ProxySettings}; + +//---------------------------------------------------------------------------------------------------- Initialization + +#[derive(Clone, Default, Debug, Copy, PartialEq, Eq, Serialize, Deserialize)] +/// Describe if Tor is enabled and how +pub enum TorMode { + /// Use of the [`arti_client`] library. + Arti, + /// Use of external tor daemon + Daemon, + + #[default] + /// Tor is disabled + Off, +} + +/// Contains the necessary Tor configuration or structures +/// for initializing P2P. +pub struct TorContext { + /// Which mode are we using. + pub mode: TorMode, + + // -------- Only in Arti mode + /// Arti bootstrapped [`TorClient`]. + pub bootstrapped_client: Option>, + /// Arti bootstrapped client config + pub arti_client_config: Option, + /// Arti onion service address. + pub arti_onion_service: Option, +} + +/// Initialize the Tor network if enabled in configuration +/// +/// This function will bootstrap Arti if needed by Tor network zone or +/// clearnet as a proxy. +pub async fn initialize_tor_if_enabled(config: &Config) -> TorContext { + let mode = config.tor.mode; + let anonymize_clearnet = matches!(config.p2p.clear_net.proxy, ProxySettings::Tor); + + // Start Arti client + let (bootstrapped_client, arti_client_config) = + if mode == TorMode::Arti && (config.p2p.tor_net.enabled || anonymize_clearnet) { + Some(initialize_arti_client(config).await) + } else { + None + } + .unzip(); + + // Start Arti onion service + let arti_onion_service = arti_client_config + .as_ref() + .map(|client_config| initialize_arti_onion_service(client_config, config)); + + TorContext { + mode, + bootstrapped_client, + arti_client_config, + arti_onion_service, + } +} + +/// Initialize Arti Tor client. +async fn initialize_arti_client(config: &Config) -> (TorClient, TorClientConfig) { + // Configuration + let mut tor_config = TorClientConfig::builder(); + + // Storage + tor_config + .storage() + .state_dir(CfgPath::new_literal(config.tor.arti.directory_path.clone())); + + let tor_config = tor_config + .build() + .expect("Failed to build Tor client configuration."); + + // Bootstrapping + info!("Bootstrapping Arti's TorClient..."); + let mut tor_client = TorClient::builder() + .config(tor_config.clone()) + .create_bootstrapped() + .await + .inspect_err(|err| tracing::error!("Unable to bootstrap arti: {err}")) + .unwrap(); + + // Isolation + if config.tor.arti.isolated_circuit { + let mut stream_prefs = StreamPrefs::new(); + stream_prefs.isolate_every_stream(); + tor_client.set_stream_prefs(stream_prefs); + } + + (tor_client, tor_config) +} + +fn initialize_arti_onion_service(client_config: &TorClientConfig, config: &Config) -> OnionService { + let onion_svc_config = OnionServiceConfigBuilder::default() + .enable_pow(config.tor.arti.onion_service_pow) + .nickname(HsNickname::new("cuprate".into()).unwrap()) + .build() + .unwrap(); + + TorClient::::create_onion_service(client_config, onion_svc_config) + .expect("Unable to start Arti onion service.") +} + +//---------------------------------------------------------------------------------------------------- Transport configuration + +pub fn transport_arti_config(config: &Config, ctx: TorContext) -> TransportConfig { + // Extracting + let (Some(bootstrapped_client), Some(client_config)) = + (ctx.bootstrapped_client, ctx.arti_client_config) + else { + panic!("Arti client should be initialized"); + }; + + let server_config = config.p2p.tor_net.inbound_onion.then(|| { + let Some(onion_svc) = ctx.arti_onion_service else { + panic!("inbound onion enabled, but no onion service initialized!"); + }; + + ArtiServerConfig::new( + onion_svc, + config.p2p.tor_net.p2p_port, + &bootstrapped_client, + &client_config, + ) + }); + + TransportConfig:: { + client_config: ArtiClientConfig { + client: bootstrapped_client, + }, + server_config, + } +} + +pub fn transport_clearnet_arti_config(ctx: &TorContext) -> TransportConfig { + let Some(bootstrapped_client) = &ctx.bootstrapped_client else { + panic!("Arti enabled but no TorClient initialized!"); + }; + + TransportConfig:: { + client_config: ArtiClientConfig { + client: bootstrapped_client.clone(), + }, + server_config: None, + } +} + +pub fn transport_daemon_config(config: &Config) -> TransportConfig { + let mut invalid_onion = false; + + if config.p2p.tor_net.inbound_onion && config.tor.daemon.anonymous_inbound.is_empty() { + invalid_onion = true; + tracing::warn!("Onion inbound is enabled yet no onion host has been defined in configuration. Inbound server disabled."); + } + + TransportConfig:: { + client_config: DaemonClientConfig { + tor_daemon: config.tor.daemon.address, + }, + server_config: (config.p2p.tor_net.inbound_onion && !invalid_onion).then_some( + DaemonServerConfig { + ip: config.tor.daemon.listening_addr.ip(), + port: config.tor.daemon.listening_addr.port(), + }, + ), + } +} diff --git a/binaries/cuprated/src/txpool/dandelion.rs b/binaries/cuprated/src/txpool/dandelion.rs index 00d9f5a..14473e9 100644 --- a/binaries/cuprated/src/txpool/dandelion.rs +++ b/binaries/cuprated/src/txpool/dandelion.rs @@ -1,10 +1,17 @@ -use std::time::Duration; +use std::{ + task::{ready, Poll}, + time::Duration, +}; + +use futures::{future::BoxFuture, FutureExt, TryFutureExt}; +use tower::{Service, ServiceExt}; use cuprate_dandelion_tower::{ - pool::DandelionPoolService, DandelionConfig, DandelionRouter, Graph, + pool::DandelionPoolService, traits::StemRequest, DandelionConfig, DandelionRouteReq, + DandelionRouter, DandelionRouterError, Graph, State, TxState, }; use cuprate_p2p::NetworkInterface; -use cuprate_p2p_core::ClearNet; +use cuprate_p2p_core::{client::InternalPeerID, ClearNet, NetworkZone, Tor}; use cuprate_txpool::service::{TxpoolReadHandle, TxpoolWriteHandle}; use crate::{ @@ -12,10 +19,13 @@ use crate::{ txpool::incoming_tx::{DandelionTx, TxId}, }; +mod anon_net_service; mod diffuse_service; mod stem_service; mod tx_store; +pub use anon_net_service::AnonTxService; + /// The configuration used for [`cuprate_dandelion_tower`]. /// /// TODO: should we expose this to users of cuprated? probably not. @@ -27,17 +37,74 @@ const DANDELION_CONFIG: DandelionConfig = DandelionConfig { }; /// A [`DandelionRouter`] with all generic types defined. -type ConcreteDandelionRouter = DandelionRouter< - stem_service::OutboundPeerStream, - diffuse_service::DiffuseService, +pub(super) type ConcreteDandelionRouter = DandelionRouter< + stem_service::OutboundPeerStream, + diffuse_service::DiffuseService, CrossNetworkInternalPeerId, - stem_service::StemPeerService, + stem_service::StemPeerService, DandelionTx, >; +/// The dandelion router used to send transactions to the network. +pub(super) struct MainDandelionRouter { + clearnet_router: ConcreteDandelionRouter, + tor_router: Option>, +} + +impl MainDandelionRouter { + pub const fn new( + clearnet_router: ConcreteDandelionRouter, + tor_router: Option>, + ) -> Self { + Self { + clearnet_router, + tor_router, + } + } +} + +impl Service> for MainDandelionRouter { + type Response = State; + type Error = DandelionRouterError; + type Future = BoxFuture<'static, Result>; + + fn poll_ready(&mut self, cx: &mut std::task::Context<'_>) -> Poll> { + if let Some(tor_router) = self.tor_router.as_mut() { + ready!(tor_router.poll_ready(cx))?; + } + + self.clearnet_router.poll_ready(cx) + } + + fn call( + &mut self, + req: DandelionRouteReq, + ) -> Self::Future { + // TODO: is this the best way to use anonymity networks? + if req.state == TxState::Local { + if let Some(tor_router) = self.tor_router.as_mut() { + if let Some(mut peer) = tor_router.peer.take() { + tracing::debug!("routing tx over Tor"); + return peer + .call(StemRequest(req.tx)) + .map_ok(|_| State::Stem) + .map_err(DandelionRouterError::PeerError) + .boxed(); + } + + tracing::warn!( + "failed to route tx over Tor, no connections, falling back to Clearnet" + ); + } + } + + self.clearnet_router.call(req) + } +} + /// Starts the dandelion pool manager task and returns a handle to send txs to broadcast. pub fn start_dandelion_pool_manager( - router: ConcreteDandelionRouter, + router: MainDandelionRouter, txpool_read_handle: TxpoolReadHandle, txpool_write_handle: TxpoolWriteHandle, ) -> DandelionPoolService { @@ -54,12 +121,17 @@ pub fn start_dandelion_pool_manager( } /// Creates a [`DandelionRouter`] from a [`NetworkInterface`]. -pub fn dandelion_router(clear_net: NetworkInterface) -> ConcreteDandelionRouter { +pub fn dandelion_router( + network_interface: NetworkInterface, +) -> ConcreteDandelionRouter +where + InternalPeerID: Into, +{ DandelionRouter::new( diffuse_service::DiffuseService { - clear_net_broadcast_service: clear_net.broadcast_svc(), + clear_net_broadcast_service: network_interface.broadcast_svc(), }, - stem_service::OutboundPeerStream::new(clear_net), + stem_service::OutboundPeerStream::::new(network_interface), DANDELION_CONFIG, ) } diff --git a/binaries/cuprated/src/txpool/dandelion/anon_net_service.rs b/binaries/cuprated/src/txpool/dandelion/anon_net_service.rs new file mode 100644 index 0000000..e44cdaf --- /dev/null +++ b/binaries/cuprated/src/txpool/dandelion/anon_net_service.rs @@ -0,0 +1,68 @@ +use std::{ + pin::Pin, + task::{ready, Context, Poll}, +}; + +use futures::{Stream, StreamExt, TryStream}; +use tower::Service; + +use cuprate_dandelion_tower::{DandelionRouterError, OutboundPeer}; +use cuprate_p2p::NetworkInterface; +use cuprate_p2p_core::{client::InternalPeerID, NetworkZone}; + +use crate::{ + p2p::CrossNetworkInternalPeerId, + txpool::dandelion::stem_service::{OutboundPeerStream, StemPeerService}, +}; + +/// The service to prepare peers on anonymous network zones for sending transactions. +pub struct AnonTxService { + outbound_peer_discover: Pin>>, + pub peer: Option>, +} + +impl AnonTxService +where + InternalPeerID: Into, +{ + pub fn new(network_interface: NetworkInterface) -> Self { + Self { + outbound_peer_discover: Box::pin(OutboundPeerStream::new(network_interface)), + peer: None, + } + } + + pub fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll> { + loop { + if let Some(peer) = &mut self.peer { + if ready!(peer.poll_ready(cx)).is_err() { + self.peer = None; + + continue; + } + + return Poll::Ready(Ok(())); + } + + let ret = ready!(self + .outbound_peer_discover + .as_mut() + .try_poll_next(cx) + .map_err(DandelionRouterError::OutboundPeerStreamError)) + .ok_or(DandelionRouterError::OutboundPeerDiscoverExited)??; + + match ret { + OutboundPeer::Peer(_, mut svc) => { + let poll = svc.poll_ready(cx); + self.peer = Some(svc); + if ready!(poll).is_err() { + self.peer = None; + } + } + OutboundPeer::Exhausted => return Poll::Ready(Ok(())), + } + } + + Poll::Ready(Ok(())) + } +} diff --git a/binaries/cuprated/src/txpool/dandelion/diffuse_service.rs b/binaries/cuprated/src/txpool/dandelion/diffuse_service.rs index 621503f..a3d6213 100644 --- a/binaries/cuprated/src/txpool/dandelion/diffuse_service.rs +++ b/binaries/cuprated/src/txpool/dandelion/diffuse_service.rs @@ -8,16 +8,16 @@ use tower::Service; use cuprate_dandelion_tower::traits::DiffuseRequest; use cuprate_p2p::{BroadcastRequest, BroadcastSvc}; -use cuprate_p2p_core::ClearNet; +use cuprate_p2p_core::{ClearNet, NetworkZone}; use crate::txpool::dandelion::DandelionTx; /// The dandelion diffusion service. -pub struct DiffuseService { - pub clear_net_broadcast_service: BroadcastSvc, +pub struct DiffuseService { + pub clear_net_broadcast_service: BroadcastSvc, } -impl Service> for DiffuseService { +impl Service> for DiffuseService { type Response = (); type Error = tower::BoxError; type Future = Ready>; diff --git a/binaries/cuprated/src/txpool/dandelion/stem_service.rs b/binaries/cuprated/src/txpool/dandelion/stem_service.rs index 32e35eb..9f4adaf 100644 --- a/binaries/cuprated/src/txpool/dandelion/stem_service.rs +++ b/binaries/cuprated/src/txpool/dandelion/stem_service.rs @@ -12,38 +12,39 @@ use cuprate_dandelion_tower::{traits::StemRequest, OutboundPeer}; use cuprate_p2p::{ClientDropGuard, NetworkInterface, PeerSetRequest, PeerSetResponse}; use cuprate_p2p_core::{ client::{Client, InternalPeerID}, - BroadcastMessage, ClearNet, NetworkZone, PeerRequest, ProtocolRequest, + BroadcastMessage, ClearNet, NetworkZone, PeerRequest, ProtocolRequest, Tor, }; use cuprate_wire::protocol::NewTransactions; use crate::{p2p::CrossNetworkInternalPeerId, txpool::dandelion::DandelionTx}; /// The dandelion outbound peer stream. -pub struct OutboundPeerStream { - clear_net: NetworkInterface, - state: OutboundPeerStreamState, +pub struct OutboundPeerStream { + network_interface: NetworkInterface, + state: OutboundPeerStreamState, } -impl OutboundPeerStream { - pub const fn new(clear_net: NetworkInterface) -> Self { +impl OutboundPeerStream { + pub const fn new(network_interface: NetworkInterface) -> Self { Self { - clear_net, + network_interface, state: OutboundPeerStreamState::Standby, } } } -impl Stream for OutboundPeerStream { - type Item = Result< - OutboundPeer>, - tower::BoxError, - >; +impl Stream for OutboundPeerStream +where + InternalPeerID: Into, +{ + type Item = + Result>, tower::BoxError>; fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { loop { match &mut self.state { OutboundPeerStreamState::Standby => { - let peer_set = self.clear_net.peer_set(); + let peer_set = self.network_interface.peer_set(); let res = ready!(peer_set.poll_ready(cx)); self.state = OutboundPeerStreamState::AwaitingPeer( @@ -61,10 +62,9 @@ impl Stream for OutboundPeerStream { }; match stem_peer { - Some(peer) => OutboundPeer::Peer( - CrossNetworkInternalPeerId::ClearNet(peer.info.id), - StemPeerService(peer), - ), + Some(peer) => { + OutboundPeer::Peer(peer.info.id.into(), StemPeerService(peer)) + } None => OutboundPeer::Exhausted, } }))); @@ -75,11 +75,11 @@ impl Stream for OutboundPeerStream { } /// The state of the [`OutboundPeerStream`]. -enum OutboundPeerStreamState { +enum OutboundPeerStreamState { /// Standby state. Standby, /// Awaiting a response from the peer-set. - AwaitingPeer(BoxFuture<'static, Result, tower::BoxError>>), + AwaitingPeer(BoxFuture<'static, Result, tower::BoxError>>), } /// The stem service, used to send stem txs. diff --git a/binaries/cuprated/src/txpool/incoming_tx.rs b/binaries/cuprated/src/txpool/incoming_tx.rs index 4f0cc6c..e1f81c4 100644 --- a/binaries/cuprated/src/txpool/incoming_tx.rs +++ b/binaries/cuprated/src/txpool/incoming_tx.rs @@ -21,7 +21,7 @@ use cuprate_dandelion_tower::{ }; use cuprate_helper::asynch::rayon_spawn_async; use cuprate_p2p::NetworkInterface; -use cuprate_p2p_core::ClearNet; +use cuprate_p2p_core::{ClearNet, Tor}; use cuprate_txpool::{ service::{ interface::{ @@ -39,7 +39,7 @@ use crate::{ p2p::CrossNetworkInternalPeerId, signals::REORG_LOCK, txpool::{ - dandelion, + dandelion::{self, AnonTxService, ConcreteDandelionRouter, MainDandelionRouter}, relay_rules::{check_tx_relay_rules, RelayRuleError}, txs_being_handled::{TxsBeingHandled, TxsBeingHandledLocally}, }, @@ -105,12 +105,16 @@ impl IncomingTxHandler { #[expect(clippy::significant_drop_tightening)] pub fn init( clear_net: NetworkInterface, + tor_net: Option>, txpool_write_handle: TxpoolWriteHandle, txpool_read_handle: TxpoolReadHandle, blockchain_context_cache: BlockchainContextService, blockchain_read_handle: BlockchainReadHandle, ) -> Self { - let dandelion_router = dandelion::dandelion_router(clear_net); + let clearnet_router = dandelion::dandelion_router(clear_net); + let tor_router = tor_net.map(AnonTxService::new); + + let dandelion_router = MainDandelionRouter::new(clearnet_router, tor_router); let dandelion_pool_manager = dandelion::start_dandelion_pool_manager( dandelion_router, diff --git a/consensus/fast-sync/src/fast_sync.rs b/consensus/fast-sync/src/fast_sync.rs index 6b519df..a11fb6b 100644 --- a/consensus/fast-sync/src/fast_sync.rs +++ b/consensus/fast-sync/src/fast_sync.rs @@ -303,7 +303,7 @@ mod tests { let entry = ChainEntry { ids, - peer: InternalPeerID::Unknown(1), + peer: InternalPeerID::Unknown([1; 16]), handle: handle.1 }; @@ -335,7 +335,7 @@ mod tests { let entries = (0..len).map(|i| { ChainEntry { ids: vec![HASHES.get(i).copied().unwrap_or_default()], - peer: InternalPeerID::Unknown(1), + peer: InternalPeerID::Unknown([1; 16]), handle: handle.1.clone() } }).collect(); @@ -369,7 +369,7 @@ mod tests { let handle = HandleBuilder::new().build(); let entry = ChainEntry { ids: HASHES[hashes_start_height..(hashes_start_height + len)].to_vec(), - peer: InternalPeerID::Unknown(1), + peer: InternalPeerID::Unknown([1; 16]), handle: handle.1 }; diff --git a/deny.toml b/deny.toml index 305e451..3d831ed 100644 --- a/deny.toml +++ b/deny.toml @@ -83,7 +83,8 @@ ignore = [ #{ crate = "a-crate-that-is-yanked@0.1.1", reason = "you can specify why you are ignoring the yanked crate" }, # TODO: check this is sorted before a beta release. - { id = "RUSTSEC-2024-0436", reason = "`paste` unmaintained, not necessarily vulnerable yet." } + { id = "RUSTSEC-2024-0436", reason = "`paste` unmaintained, not necessarily vulnerable yet." }, + { id = "RUSTSEC-2023-0071", reason = "rsa is used in arti." } ] # If this is true, then cargo deny will use the git executable to fetch advisory database. # If this is false, then it uses a built-in git library. @@ -101,6 +102,7 @@ ignore = [ allow = [ # Nothing required - free to use without permission. "CC0-1.0", # https://creativecommons.org/publicdomain/zero/1.0/ + "Unlicense", # Must include copyright notice. "BSD-2-Clause", # https://tldrlegal.com/license/bsd-2-clause-license-(freebsd) diff --git a/net/epee-encoding/src/macros.rs b/net/epee-encoding/src/macros.rs index 269e438..7df1823 100644 --- a/net/epee-encoding/src/macros.rs +++ b/net/epee-encoding/src/macros.rs @@ -14,7 +14,7 @@ pub use paste::paste; /// /// struct Example { /// a: u8 -/// } +/// } /// /// epee_object!( /// Example, @@ -132,6 +132,7 @@ macro_rules! epee_object { use super::*; #[derive(Default)] + #[allow(clippy::empty_structs_with_brackets)] pub struct [<__Builder $obj>] { $($field: Option,)* $($flat_field: <$flat_ty as cuprate_epee_encoding::EpeeObject>::Builder,)* diff --git a/net/wire/Cargo.toml b/net/wire/Cargo.toml index 84f413c..013e472 100644 --- a/net/wire/Cargo.toml +++ b/net/wire/Cargo.toml @@ -18,6 +18,7 @@ cuprate-types = { workspace = true, default-features = false, features cuprate-helper = { workspace = true, default-features = false, features = ["map"] } bitflags = { workspace = true, features = ["std"] } +borsh = { workspace = true, features = ["derive"] } bytes = { workspace = true, features = ["std"] } thiserror = { workspace = true } diff --git a/net/wire/src/network_address/onion_addr.rs b/net/wire/src/network_address/onion_addr.rs index ce4632d..4aa8686 100644 --- a/net/wire/src/network_address/onion_addr.rs +++ b/net/wire/src/network_address/onion_addr.rs @@ -8,12 +8,13 @@ use std::{ str::{self, FromStr}, }; +use borsh::{BorshDeserialize, BorshSerialize}; use thiserror::Error; use super::{NetworkAddress, NetworkAddressIncorrectZone}; /// A v3, `Copy`able onion address. -#[derive(Clone, Debug, Copy, PartialEq, Eq, Hash)] +#[derive(Clone, Debug, Copy, PartialEq, Eq, Hash, BorshSerialize, BorshDeserialize)] pub struct OnionAddr { /// 56 characters encoded onion v3 domain without the .onion suffix /// diff --git a/p2p/dandelion-tower/src/pool/manager.rs b/p2p/dandelion-tower/src/pool/manager.rs index 2ac3302..a911959 100644 --- a/p2p/dandelion-tower/src/pool/manager.rs +++ b/p2p/dandelion-tower/src/pool/manager.rs @@ -12,7 +12,7 @@ use tokio::{ sync::{mpsc, oneshot}, task::JoinSet, }; -use tokio_util::time::DelayQueue; +use tokio_util::time::{delay_queue, DelayQueue}; use tower::{Service, ServiceExt}; use crate::{ @@ -41,6 +41,7 @@ pub struct DandelionPoolManager { /// Current stem pool embargo timers. pub(crate) embargo_timers: DelayQueue, + pub(crate) embargo_timer_keys: HashMap, /// The distrobution to sample to get embargo timers. pub(crate) embargo_dist: Exp, @@ -68,8 +69,10 @@ where embargo_timer ); - self.embargo_timers - .insert(tx_id, Duration::from_secs_f64(embargo_timer)); + let key = self + .embargo_timers + .insert(tx_id.clone(), Duration::from_secs_f64(embargo_timer)); + self.embargo_timer_keys.insert(tx_id, key); } /// Stems the tx, setting the stem origin, if it wasn't already set. @@ -164,9 +167,9 @@ where // Remove the tx from the maps used during the stem phase. self.stem_origins.remove(&tx_id); - // The key for this is *Not* the tx_id, it is given on insert, so just keep the timer in the - // map. These timers should be relatively short, so it shouldn't be a problem. - //self.embargo_timers.try_remove(&tx_id); + if let Some(key) = self.embargo_timer_keys.remove(&tx_id) { + self.embargo_timers.try_remove(&key); + } self.backing_pool .ready() diff --git a/p2p/dandelion-tower/src/pool/mod.rs b/p2p/dandelion-tower/src/pool/mod.rs index 40a3617..90eb555 100644 --- a/p2p/dandelion-tower/src/pool/mod.rs +++ b/p2p/dandelion-tower/src/pool/mod.rs @@ -87,6 +87,7 @@ where routing_set: JoinSet::new(), stem_origins: HashMap::new(), embargo_timers: DelayQueue::new(), + embargo_timer_keys: HashMap::new(), embargo_dist: Exp::new(1.0 / config.average_embargo_timeout().as_secs_f64()).unwrap(), config, _tx: PhantomData, diff --git a/p2p/dandelion-tower/src/router.rs b/p2p/dandelion-tower/src/router.rs index 7ca0598..8344f55 100644 --- a/p2p/dandelion-tower/src/router.rs +++ b/p2p/dandelion-tower/src/router.rs @@ -183,8 +183,14 @@ where .map_err(DandelionRouterError::OutboundPeerStreamError)) .ok_or(DandelionRouterError::OutboundPeerDiscoverExited)?? { - OutboundPeer::Peer(key, svc) => { - self.stem_peers.insert(key, svc); + OutboundPeer::Peer(key, mut svc) => { + let poll = svc.poll_ready(cx); + + self.stem_peers.insert(key.clone(), svc); + + if ready!(poll).is_err() { + self.stem_peers.remove(&key); + } } OutboundPeer::Exhausted => { tracing::warn!("Failed to retrieve enough outbound peers for optimal dandelion++, privacy may be degraded."); diff --git a/p2p/p2p-core/Cargo.toml b/p2p/p2p-core/Cargo.toml index dd14373..21c076a 100644 --- a/p2p/p2p-core/Cargo.toml +++ b/p2p/p2p-core/Cargo.toml @@ -28,6 +28,8 @@ rand = { workspace = true, features = ["std", "std_rng"] } tracing = { workspace = true, features = ["std", "attributes"] } hex-literal = { workspace = true } +hex = { workspace = true } + borsh = { workspace = true, features = ["derive", "std"], optional = true } [dev-dependencies] diff --git a/p2p/p2p-core/src/client.rs b/p2p/p2p-core/src/client.rs index ca0f201..77d5086 100644 --- a/p2p/p2p-core/src/client.rs +++ b/p2p/p2p-core/src/client.rs @@ -40,14 +40,14 @@ pub enum InternalPeerID { /// A known address. KnownAddr(A), /// An unknown address (probably an inbound anonymity network connection). - Unknown(u128), + Unknown([u8; 16]), } impl Display for InternalPeerID { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { match self { Self::KnownAddr(addr) => addr.fmt(f), - Self::Unknown(id) => f.write_str(&format!("Unknown, ID: {id}")), + Self::Unknown(id) => f.write_str(&format!("Unknown, ID: {}", hex::encode(id))), } } } diff --git a/p2p/p2p-core/src/client/timeout_monitor.rs b/p2p/p2p-core/src/client/timeout_monitor.rs index 54bc50e..79b95a3 100644 --- a/p2p/p2p-core/src/client/timeout_monitor.rs +++ b/p2p/p2p-core/src/client/timeout_monitor.rs @@ -28,7 +28,7 @@ use crate::{ fields(addr = %peer_information.id), skip_all, )] -pub async fn connection_timeout_monitor_task( +pub(super) async fn connection_timeout_monitor_task( peer_information: PeerInformation, connection_tx: mpsc::Sender, diff --git a/p2p/p2p-core/src/lib.rs b/p2p/p2p-core/src/lib.rs index 979e5e2..c874943 100644 --- a/p2p/p2p-core/src/lib.rs +++ b/p2p/p2p-core/src/lib.rs @@ -168,9 +168,9 @@ pub trait Transport: Clone + Send + 'static { /// Note: Currently, this client config is considered immutable during operational runtime. If one /// wish to apply modifications on the fly, they will need to make use of an inner shared and mutable /// reference to do so. - type ClientConfig: Default + Clone + Debug + Send + Sync + 'static; + type ClientConfig: Clone + Send + Sync + 'static; /// Server configuration necessary when instantiating a listener for inbound connections. - type ServerConfig: Default + Clone + Debug + Send + Sync + 'static; + type ServerConfig: Send + Sync + 'static; /// The stream (incoming data) type of this transport method. type Stream: Stream> + Unpin + Send + 'static; diff --git a/p2p/p2p-transport/Cargo.toml b/p2p/p2p-transport/Cargo.toml index f4d8f9f..65c7e2d 100644 --- a/p2p/p2p-transport/Cargo.toml +++ b/p2p/p2p-transport/Cargo.toml @@ -5,7 +5,27 @@ edition = "2021" license = "MIT" authors = ["SyntheticBird"] +[features] +default = ["static"] +static = ["arti-client/static"] + [dependencies] +cuprate-p2p-core = { workspace = true } +cuprate-wire = { workspace = true } + +async-trait = { workspace = true } +futures = { workspace = true } +tokio = { workspace = true, features = ["net"] } +tokio-socks = { workspace = true, features = ["tokio"] } +tokio-util = { workspace = true, features = ["codec"] } +arti-client = { workspace = true, features = ["tokio", "native-tls", "onion-service-client", "onion-service-service", "experimental-api", "static-sqlite"] } +tor-config-path = { workspace = true } +tor-cell = { workspace = true } +tor-hsservice = { workspace = true } +tor-proto = { workspace = true } +tor-rtcompat = { workspace = true } + +tracing = { workspace = true } [lints] workspace = true diff --git a/p2p/p2p-transport/src/arti.rs b/p2p/p2p-transport/src/arti.rs new file mode 100644 index 0000000..aff90ce --- /dev/null +++ b/p2p/p2p-transport/src/arti.rs @@ -0,0 +1,221 @@ +//! Arti Transport +//! +//! This module defines a transport method for the `Tor` network zone using the `arti_client` library. +//! + +//---------------------------------------------------------------------------------------------------- Imports + +use std::{ + io::{self, ErrorKind}, + pin::Pin, + sync::Arc, + task::{Context, Poll}, +}; + +use arti_client::{DataReader, DataWriter, TorClient, TorClientConfig}; +use async_trait::async_trait; +use futures::{Stream, StreamExt}; +use tokio_util::codec::{FramedRead, FramedWrite}; +use tor_cell::relaycell::msg::Connected; +use tor_config_path::CfgPathResolver; +use tor_hsservice::{handle_rend_requests, OnionService, RunningOnionService}; +use tor_proto::stream::IncomingStreamRequest; +use tor_rtcompat::PreferredRuntime; + +use cuprate_p2p_core::{ClearNet, NetworkZone, Tor, Transport}; +use cuprate_wire::MoneroWireCodec; + +use crate::DisabledListener; + +//---------------------------------------------------------------------------------------------------- Configuration + +#[derive(Clone)] +pub struct ArtiClientConfig { + /// Arti bootstrapped client + pub client: TorClient, +} + +pub struct ArtiServerConfig { + /// Arti onion service + pub onion_svc: OnionService, + /// Listening port + pub port: u16, + + // Mandatory resources for launching the onion service + client: TorClient, + path_resolver: Arc, +} + +impl ArtiServerConfig { + pub fn new( + onion_svc: OnionService, + port: u16, + client: &TorClient, + config: &TorClientConfig, + ) -> Self { + let path_resolver: &CfgPathResolver = config.as_ref(); + + Self { + onion_svc, + port, + client: client.clone(), + path_resolver: Arc::new(path_resolver.clone()), + } + } +} + +//---------------------------------------------------------------------------------------------------- Transport + +type PinnedStream = Pin + Send>>; + +/// An onion service listening for incoming peer connections. +pub struct OnionListener { + /// A handle to the onion service instance. + _onion_svc: Arc, + /// A modified stream that produce a data stream and sink from rendez-vous requests. + listener: PinnedStream>, +} + +impl Stream for OnionListener { + type Item = Result< + ( + Option<::Addr>, + FramedRead, + FramedWrite, + ), + io::Error, + >; + + fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + match self.listener.poll_next_unpin(cx) { + Poll::Pending => Poll::Pending, + Poll::Ready(req) => Poll::Ready(req.map(|r| { + r.map(|(stream, sink)| { + ( + None, // Inbound is anonymous + FramedRead::new(stream, MoneroWireCodec::default()), + FramedWrite::new(sink, MoneroWireCodec::default()), + ) + }) + })), + } + } +} + +#[derive(Clone, Copy)] +pub struct Arti; + +#[async_trait] +impl Transport for Arti { + type ClientConfig = ArtiClientConfig; + type ServerConfig = ArtiServerConfig; + + type Stream = FramedRead; + type Sink = FramedWrite; + type Listener = OnionListener; + + async fn connect_to_peer( + addr: ::Addr, + config: &Self::ClientConfig, + ) -> Result<(Self::Stream, Self::Sink), io::Error> { + config + .client + .connect((addr.addr_string(), addr.port())) + .await + .map_err(|e| io::Error::new(ErrorKind::ConnectionAborted, e.to_string())) + .map(|stream| { + let (stream, sink) = stream.split(); + ( + FramedRead::new(stream, MoneroWireCodec::default()), + FramedWrite::new(sink, MoneroWireCodec::default()), + ) + }) + } + + async fn incoming_connection_listener( + config: Self::ServerConfig, + ) -> Result { + tracing::info!( + "Listening for incoming Tor P2P connections on address: {}:{}", + config.onion_svc.onion_address().unwrap(), + config.port + ); + + // Launch onion service + #[expect(clippy::clone_on_ref_ptr)] + let (svc, rdv_stream) = config + .onion_svc + .launch( + config.client.runtime().clone(), + config.client.dirmgr().clone(), + config.client.hs_circ_pool().clone(), + config.path_resolver, + ) + .unwrap(); + + // Accept all rendez-vous and await correct stream request + let req_stream = handle_rend_requests(rdv_stream).then(move |sreq| async move { + match sreq.request() { + // As specified in: + // + // A client that wishes to open a data stream with us needs to send a BEGIN message with an empty address + // and no flags. We additionally filter requests to the correct port configured and advertised on P2P. + IncomingStreamRequest::Begin(r) + if r.port() == config.port && r.addr().is_empty() && r.flags().is_empty() => + { + let stream = sreq + .accept(Connected::new_empty()) + .await + .map_err(|e| io::Error::new(ErrorKind::BrokenPipe, e.to_string()))?; + + Ok(stream.split()) + } + _ => { + sreq.shutdown_circuit() + .expect("Should never panic, unless programming error from arti's end."); + + Err(io::Error::other("Received invalid command")) + } + } + }); + + Ok(OnionListener { + _onion_svc: svc, + listener: Box::pin(req_stream), + }) + } +} + +#[async_trait] +impl Transport for Arti { + type ClientConfig = ArtiClientConfig; + type ServerConfig = (); + + type Stream = FramedRead; + type Sink = FramedWrite; + type Listener = DisabledListener; + + async fn connect_to_peer( + addr: ::Addr, + config: &Self::ClientConfig, + ) -> Result<(Self::Stream, Self::Sink), io::Error> { + config + .client + .connect(addr.to_string()) + .await + .map_err(|e| io::Error::new(ErrorKind::ConnectionAborted, e.to_string())) + .map(|stream| { + let (stream, sink) = stream.split(); + ( + FramedRead::new(stream, MoneroWireCodec::default()), + FramedWrite::new(sink, MoneroWireCodec::default()), + ) + }) + } + + async fn incoming_connection_listener( + _config: Self::ServerConfig, + ) -> Result { + panic!("In anonymized clearnet mode, inbound is disabled!"); + } +} diff --git a/p2p/p2p-transport/src/disabled.rs b/p2p/p2p-transport/src/disabled.rs new file mode 100644 index 0000000..a0b0590 --- /dev/null +++ b/p2p/p2p-transport/src/disabled.rs @@ -0,0 +1,35 @@ +use std::{ + io, + marker::PhantomData, + pin::Pin, + task::{Context, Poll}, +}; + +use futures::Stream; +use tokio_util::codec::{FramedRead, FramedWrite}; + +use cuprate_p2p_core::NetworkZone; +use cuprate_wire::MoneroWireCodec; + +/// In proxied clearnet mode, inbound is disabled. +pub struct DisabledListener { + _zone: PhantomData, + _reader: PhantomData, + _writer: PhantomData, +} + +impl Stream for DisabledListener { + type Item = Result< + ( + Option, + FramedRead, + FramedWrite, + ), + io::Error, + >; + + fn poll_next(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll> { + // Panic within [`Transport::incoming_connection_listener`] + unreachable!() + } +} diff --git a/p2p/p2p-transport/src/lib.rs b/p2p/p2p-transport/src/lib.rs index b2e7577..b6abb85 100644 --- a/p2p/p2p-transport/src/lib.rs +++ b/p2p/p2p-transport/src/lib.rs @@ -1,3 +1,15 @@ //! ## P2P Transports //! -//! This crate will welcome additional transport implementation for Cuprate. +//! This crate implement additional transports for Cuprate. + +/// Arti library implementation. +mod arti; +pub use arti::{Arti, ArtiClientConfig, ArtiServerConfig}; + +/// Tor daemon (SOCKS5) implementation +mod tor; +pub use tor::{Daemon, DaemonClientConfig, DaemonServerConfig}; + +/// Disabled listener +mod disabled; +pub(crate) use disabled::DisabledListener; diff --git a/p2p/p2p-transport/src/tor.rs b/p2p/p2p-transport/src/tor.rs new file mode 100644 index 0000000..2409eac --- /dev/null +++ b/p2p/p2p-transport/src/tor.rs @@ -0,0 +1,112 @@ +//! Tor Daemon Transport +//! +//! This module defines a transport method for the `Tor` network zone using an external Tor daemon supporting SOCKS5. +//! + +//---------------------------------------------------------------------------------------------------- Imports + +use std::{ + io::{self, ErrorKind}, + net::{IpAddr, SocketAddr}, + pin::Pin, + task::{Context, Poll}, +}; + +use async_trait::async_trait; +use futures::Stream; +use tokio::net::{ + tcp::{OwnedReadHalf, OwnedWriteHalf}, + TcpListener, +}; +use tokio_socks::tcp::Socks5Stream; +use tokio_util::codec::{FramedRead, FramedWrite}; + +use cuprate_p2p_core::{NetworkZone, Tor, Transport}; +use cuprate_wire::MoneroWireCodec; + +//---------------------------------------------------------------------------------------------------- Configuration + +#[derive(Clone, Copy)] +pub struct DaemonClientConfig { + /// Socket address of the external Tor daemon + pub tor_daemon: SocketAddr, +} + +#[derive(Clone, Copy)] +pub struct DaemonServerConfig { + /// Listening IP Address. + pub ip: IpAddr, + + /// Listening TCP Port. + pub port: u16, +} + +//---------------------------------------------------------------------------------------------------- Transport + +/// A simple TCP server waiting for connections from the Tor daemon +pub struct DaemonInboundStream { + listener: TcpListener, +} + +impl Stream for DaemonInboundStream { + type Item = Result< + ( + Option<::Addr>, + FramedRead, + FramedWrite, + ), + io::Error, + >; + + fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + self.listener + .poll_accept(cx) + .map_ok(|(stream, _)| { + let (stream, sink) = stream.into_split(); + + ( + None, // Inbound is anonymous + FramedRead::new(stream, MoneroWireCodec::default()), + FramedWrite::new(sink, MoneroWireCodec::default()), + ) + }) + .map(Some) + } +} + +#[derive(Clone, Copy)] +pub struct Daemon; + +#[async_trait] +impl Transport for Daemon { + type ClientConfig = DaemonClientConfig; + type ServerConfig = DaemonServerConfig; + + type Stream = FramedRead; + type Sink = FramedWrite; + type Listener = DaemonInboundStream; + + async fn connect_to_peer( + addr: ::Addr, + config: &Self::ClientConfig, + ) -> Result<(Self::Stream, Self::Sink), io::Error> { + Socks5Stream::connect(config.tor_daemon, addr.to_string()) + .await + .map_err(|e| io::Error::new(ErrorKind::ConnectionAborted, e.to_string())) + .map(|stream| { + let (stream, sink) = stream.into_inner().into_split(); + ( + FramedRead::new(stream, MoneroWireCodec::default()), + FramedWrite::new(sink, MoneroWireCodec::default()), + ) + }) + } + + async fn incoming_connection_listener( + config: Self::ServerConfig, + ) -> Result { + let listener = TcpListener::bind((config.ip, config.port)).await?; + + Ok(DaemonInboundStream { listener }) + } +} diff --git a/p2p/p2p/src/block_downloader/download_batch.rs b/p2p/p2p/src/block_downloader/download_batch.rs index dd95218..17848b2 100644 --- a/p2p/p2p/src/block_downloader/download_batch.rs +++ b/p2p/p2p/src/block_downloader/download_batch.rs @@ -30,7 +30,7 @@ use crate::{ ) )] #[expect(clippy::used_underscore_binding)] -pub async fn download_batch_task( +pub(super) async fn download_batch_task( client: ClientDropGuard, ids: ByteArrayVec<32>, previous_id: [u8; 32], diff --git a/p2p/p2p/src/block_downloader/request_chain.rs b/p2p/p2p/src/block_downloader/request_chain.rs index 9adbaaa..659574a 100644 --- a/p2p/p2p/src/block_downloader/request_chain.rs +++ b/p2p/p2p/src/block_downloader/request_chain.rs @@ -79,7 +79,7 @@ pub(crate) async fn request_chain_entry_from_peer( /// /// We then wait for their response and choose the peer who claims the highest cumulative difficulty. #[instrument(level = "error", skip_all)] -pub async fn initial_chain_search( +pub(super) async fn initial_chain_search( peer_set: &mut BoxCloneService, tower::BoxError>, mut our_chain_svc: C, ) -> Result, BlockDownloadError> diff --git a/p2p/p2p/src/broadcast.rs b/p2p/p2p/src/broadcast.rs index a12d7a2..09fe1f7 100644 --- a/p2p/p2p/src/broadcast.rs +++ b/p2p/p2p/src/broadcast.rs @@ -424,8 +424,8 @@ mod tests { let (mut brcst, outbound_mkr, inbound_mkr) = init_broadcast_channels::>(TEST_CONFIG); - let mut outbound_stream = pin!(outbound_mkr(InternalPeerID::Unknown(1))); - let mut inbound_stream = pin!(inbound_mkr(InternalPeerID::Unknown(1))); + let mut outbound_stream = pin!(outbound_mkr(InternalPeerID::Unknown([1; 16]))); + let mut inbound_stream = pin!(inbound_mkr(InternalPeerID::Unknown([1; 16]))); // Outbound should get 1 and 3, inbound should get 2 and 3. @@ -483,8 +483,8 @@ mod tests { let (mut brcst, outbound_mkr, inbound_mkr) = init_broadcast_channels::>(TEST_CONFIG); - let mut outbound_stream = pin!(outbound_mkr(InternalPeerID::Unknown(1))); - let mut inbound_stream = pin!(inbound_mkr(InternalPeerID::Unknown(1))); + let mut outbound_stream = pin!(outbound_mkr(InternalPeerID::Unknown([1; 16]))); + let mut inbound_stream = pin!(inbound_mkr(InternalPeerID::Unknown([1; 16]))); brcst .ready() @@ -509,11 +509,11 @@ mod tests { let (mut brcst, outbound_mkr, inbound_mkr) = init_broadcast_channels::>(TEST_CONFIG); - let mut outbound_stream = pin!(outbound_mkr(InternalPeerID::Unknown(1))); - let mut outbound_stream_from = pin!(outbound_mkr(InternalPeerID::Unknown(0))); + let mut outbound_stream = pin!(outbound_mkr(InternalPeerID::Unknown([1; 16]))); + let mut outbound_stream_from = pin!(outbound_mkr(InternalPeerID::Unknown([0; 16]))); - let mut inbound_stream = pin!(inbound_mkr(InternalPeerID::Unknown(1))); - let mut inbound_stream_from = pin!(inbound_mkr(InternalPeerID::Unknown(0))); + let mut inbound_stream = pin!(inbound_mkr(InternalPeerID::Unknown([1; 16]))); + let mut inbound_stream_from = pin!(inbound_mkr(InternalPeerID::Unknown([0; 16]))); brcst .ready() @@ -522,7 +522,7 @@ mod tests { .call(BroadcastRequest::Transaction { tx_bytes: Bytes::from_static(&[1]), direction: None, - received_from: Some(InternalPeerID::Unknown(0)), + received_from: Some(InternalPeerID::Unknown([0; 16])), }) .await .unwrap(); diff --git a/p2p/p2p/src/inbound_server.rs b/p2p/p2p/src/inbound_server.rs index 735ff98..33105a4 100644 --- a/p2p/p2p/src/inbound_server.rs +++ b/p2p/p2p/src/inbound_server.rs @@ -34,7 +34,7 @@ use crate::{ /// Starts the inbound server. This function will listen to all incoming connections /// and initiate handshake if needed, after verifying the address isn't banned. #[instrument(level = "warn", skip_all)] -pub async fn inbound_server( +pub(super) async fn inbound_server( new_connection_tx: mpsc::Sender>, mut handshaker: HS, mut address_book: A, diff --git a/p2p/p2p/src/lib.rs b/p2p/p2p/src/lib.rs index 55fd428..64c7544 100644 --- a/p2p/p2p/src/lib.rs +++ b/p2p/p2p/src/lib.rs @@ -39,7 +39,7 @@ pub use peer_set::{ClientDropGuard, PeerSetRequest, PeerSetResponse}; /// You must provide: /// - A protocol request handler, which is given to each connection /// - A core sync service, which keeps track of the sync state of our node -#[instrument(level = "debug", name = "net", skip_all, fields(zone = Z::NAME))] +#[instrument(level = "error", name = "net", skip_all, fields(zone = Z::NAME))] pub async fn initialize_network( protocol_request_handler_maker: PR, core_sync_svc: CS, diff --git a/rpc/types/src/macros.rs b/rpc/types/src/macros.rs index da5c9ce..971f4af 100644 --- a/rpc/types/src/macros.rs +++ b/rpc/types/src/macros.rs @@ -107,6 +107,7 @@ macro_rules! define_request_and_response { /// $( #[$type_attr] )* /// + #[allow(clippy::empty_structs_with_brackets)] $( #[$request_type_attr] )* [<$type_name Request>] $(($restricted $(, $empty)?))? { $(