From 04c9d7c2b9b9eb9c64821e216bfe77e31bb29bca Mon Sep 17 00:00:00 2001 From: binarybaron Date: Wed, 7 Aug 2024 12:54:28 +0200 Subject: [PATCH 001/112] wip: migrate to libp2p 0.53.2 --- Cargo.lock | 2213 ++++++++++++++++++++++++----- swap/Cargo.toml | 14 +- swap/src/asb/event_loop.rs | 8 +- swap/src/asb/network.rs | 19 +- swap/src/cli/behaviour.rs | 29 +- swap/src/cli/event_loop.rs | 9 +- swap/src/network/tor_transport.rs | 5 +- watchtower | 1 + 8 files changed, 1930 insertions(+), 368 deletions(-) create mode 160000 watchtower diff --git a/Cargo.lock b/Cargo.lock index b3223d8db..ab3af2d42 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,188 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "actix-codec" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f7b0a21988c1bf877cf4759ef5ddaac04c1c9fe808c9142ecb78ba97d97a28a" +dependencies = [ + "bitflags 2.4.0", + "bytes", + "futures-core", + "futures-sink", + "memchr", + "pin-project-lite", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "actix-http" +version = "3.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ae682f693a9cd7b058f2b0b5d9a6d7728a8555779bedbbc35dd88528611d020" +dependencies = [ + "actix-codec", + "actix-rt", + "actix-service", + "actix-utils", + "ahash 0.8.11", + "base64 0.22.1", + "bitflags 2.4.0", + "brotli", + "bytes", + "bytestring", + "derive_more", + "encoding_rs", + "flate2", + "futures-core", + "h2 0.3.26", + "http 0.2.11", + "httparse", + "httpdate", + "itoa", + "language-tags", + "local-channel", + "mime", + "percent-encoding", + "pin-project-lite", + "rand 0.8.5", + "sha1", + "smallvec", + "tokio", + "tokio-util", + "tracing", + "zstd", +] + +[[package]] +name = "actix-macros" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" +dependencies = [ + "quote", + "syn 2.0.46", +] + +[[package]] +name = "actix-router" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13d324164c51f63867b57e73ba5936ea151b8a41a1d23d1031eeb9f70d0236f8" +dependencies = [ + "bytestring", + "cfg-if 1.0.0", + "http 0.2.11", + "regex", + "regex-lite", + "serde", + "tracing", +] + +[[package]] +name = "actix-rt" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24eda4e2a6e042aa4e55ac438a2ae052d3b5da0ecf83d7411e1a368946925208" +dependencies = [ + "futures-core", + "tokio", +] + +[[package]] +name = "actix-server" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b02303ce8d4e8be5b855af6cf3c3a08f3eff26880faad82bab679c22d3650cb5" +dependencies = [ + "actix-rt", + "actix-service", + "actix-utils", + "futures-core", + "futures-util", + "mio", + "socket2", + "tokio", + "tracing", +] + +[[package]] +name = "actix-service" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b894941f818cfdc7ccc4b9e60fa7e53b5042a2e8567270f9147d5591893373a" +dependencies = [ + "futures-core", + "paste", + "pin-project-lite", +] + +[[package]] +name = "actix-utils" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88a1dcdff1466e3c2488e1cb5c36a71822750ad43839937f85d2f4d9f8b705d8" +dependencies = [ + "local-waker", + "pin-project-lite", +] + +[[package]] +name = "actix-web" +version = "4.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1988c02af8d2b718c05bc4aeb6a66395b7cdf32858c2c71131e5637a8c05a9ff" +dependencies = [ + "actix-codec", + "actix-http", + "actix-macros", + "actix-router", + "actix-rt", + "actix-server", + "actix-service", + "actix-utils", + "actix-web-codegen", + "ahash 0.8.11", + "bytes", + "bytestring", + "cfg-if 1.0.0", + "cookie", + "derive_more", + "encoding_rs", + "futures-core", + "futures-util", + "itoa", + "language-tags", + "log", + "mime", + "once_cell", + "pin-project-lite", + "regex", + "regex-lite", + "serde", + "serde_json", + "serde_urlencoded", + "smallvec", + "socket2", + "time 0.3.36", + "url", +] + +[[package]] +name = "actix-web-codegen" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f591380e2e68490b5dfaf1dd1aa0ebe78d84ba7067078512b4ea6e4492d622b8" +dependencies = [ + "actix-router", + "proc-macro2", + "quote", + "syn 2.0.46", +] + [[package]] name = "addr2line" version = "0.21.0" @@ -69,6 +251,19 @@ dependencies = [ "version_check", ] +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if 1.0.0", + "getrandom 0.2.11", + "once_cell", + "version_check", + "zerocopy", +] + [[package]] name = "aho-corasick" version = "0.7.18" @@ -79,8 +274,34 @@ dependencies = [ ] [[package]] +<<<<<<< HEAD name = "aho-corasick" version = "1.1.3" +======= +name = "alloc-no-stdlib" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" + +[[package]] +name = "alloc-stdlib" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" +dependencies = [ + "alloc-no-stdlib", +] + +[[package]] +name = "allocator-api2" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + +[[package]] +name = "ansi_term" +version = "0.11.0" +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ @@ -169,10 +390,43 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" [[package]] -name = "asn1_der" -version = "0.7.4" +name = "asn1-rs" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6fd5ddaf0351dff5b8da21b2fb4ff8e08ddd02857f0bf69c47639106c0fff0" +dependencies = [ + "asn1-rs-derive", + "asn1-rs-impl", + "displaydoc", + "nom", + "num-traits", + "rusticata-macros", + "thiserror", + "time 0.3.36", +] + +[[package]] +name = "asn1-rs-derive" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d6e24d2cce90c53b948c46271bfb053e4bdc2db9b5d3f65e20f8cf28a1b7fc3" +checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "synstructure", +] + +[[package]] +name = "asn1-rs-impl" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] [[package]] name = "assert-json-diff" @@ -195,17 +449,47 @@ dependencies = [ "flate2", "futures-core", "memchr", - "pin-project-lite 0.2.13", + "pin-project-lite", "tokio", ] +[[package]] +name = "async-io" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d6baa8f0178795da0e71bc42c9e5d13261aac7ee549853162e66a241ba17964" +dependencies = [ + "async-lock 3.4.0", + "cfg-if 1.0.0", + "concurrent-queue", + "futures-io", + "futures-lite", + "parking", + "polling", + "rustix", + "slab", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "async-lock" version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa24f727524730b077666307f2734b4a1a1c57acb79193127dcc8914d5242dd7" dependencies = [ - "event-listener", + "event-listener 2.5.3", +] + +[[package]] +name = "async-lock" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" +dependencies = [ + "event-listener 5.3.1", + "event-listener-strategy", + "pin-project-lite", ] [[package]] @@ -251,7 +535,20 @@ dependencies = [ "futures-sink", "futures-util", "memchr", - "pin-project-lite 0.2.13", + "pin-project-lite", +] + +[[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]] @@ -287,12 +584,14 @@ dependencies = [ ] [[package]] -name = "atomic" -version = "0.5.0" +name = "attohttpc" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3410529e8288c463bedb5930f82833bc0c90e5d2fe639a56582a4d09220b281" +checksum = "8d9a9bf8b79a749ee0b911b91b671cc2b6c670bdbc7e3dfd537576ddc94bb2a2" dependencies = [ - "autocfg", + "http 0.2.11", + "log", + "url", ] [[package]] @@ -366,8 +665,8 @@ dependencies = [ "futures-core", "getrandom 0.2.11", "instant", - "pin-project-lite 0.2.13", - "rand 0.8.3", + "pin-project-lite", + "rand 0.8.5", "tokio", ] @@ -386,6 +685,12 @@ dependencies = [ "rustc-demangle", ] +[[package]] +name = "base-x" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" + [[package]] name = "base32" version = "0.4.0" @@ -425,6 +730,21 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" +[[package]] +name = "base64-compat" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a8d4d2746f89841e49230dd26917df1876050f95abafafbe34f47cb534b88d7" +dependencies = [ + "byteorder", +] + +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + [[package]] name = "bdk" version = "0.28.0" @@ -439,7 +759,7 @@ dependencies = [ "js-sys", "log", "miniscript", - "rand 0.8.3", + "rand 0.8.5", "serde", "serde_json", "sled", @@ -480,9 +800,9 @@ checksum = "4d73a8ae8ce52d09395e4cafc83b5b81c3deb70a97740e907669c8683c4dd50a" [[package]] name = "bimap" -version = "0.6.1" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50ae17cabbc8a38a1e3e4c1a6a664e9a09672dc14d0896fa8d865d3a5a446b07" +checksum = "230c5f1ca6a325a32553f8640d31ac9b49f2411e901e427570154868b46da4f7" [[package]] name = "bincode" @@ -558,7 +878,7 @@ dependencies = [ "hex", "hmac 0.12.1", "jsonrpc_client", - "rand 0.8.3", + "rand 0.8.5", "reqwest", "serde", "serde_json", @@ -579,6 +899,19 @@ dependencies = [ "serde", ] +[[package]] +name = "bitcoincore-rpc" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0261b2bb7617e0c91b452a837bbd1291fd34ad6990cb8e3ffc28239cc045b5ca" +dependencies = [ + "bitcoincore-rpc-json", + "jsonrpc", + "log", + "serde", + "serde_json", +] + [[package]] name = "bitcoincore-rpc-json" version = "0.16.0" @@ -607,13 +940,11 @@ dependencies = [ [[package]] name = "blake2" -version = "0.9.2" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a4e37d16930f5459780f5621038b6382b9bb37c19016f39fb6b5808d831f174" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" dependencies = [ - "crypto-mac 0.8.0", - "digest 0.9.0", - "opaque-debug", + "digest 0.10.7", ] [[package]] @@ -694,7 +1025,7 @@ checksum = "37626c9e941a687ee9abef6065b44c379478ae563b7483c613dd705ef1dff59e" dependencies = [ "borsh-derive-internal", "borsh-schema-derive-internal", - "proc-macro-crate 0.1.5", + "proc-macro-crate", "proc-macro2", "syn 1.0.109", ] @@ -723,6 +1054,7 @@ dependencies = [ [[package]] name = "brotli" +<<<<<<< HEAD version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d640d25bc63c50fb1f0b545ffd80207d2e10a4c965530809b40ba3386825c391" @@ -766,8 +1098,35 @@ dependencies = [ [[package]] name = "bs58" version = "0.4.0" +======= +version = "6.0.0" +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" +checksum = "74f7971dbd9326d58187408ab83117d8ac1bb9c17b085fdacd1cf2f598719b6b" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", + "brotli-decompressor", +] + +[[package]] +name = "brotli-decompressor" +version = "4.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a45bd2e4095a8b518033b128020dd4a55aab1c0a381ba4404a472630f4bc362" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", +] + +[[package]] +name = "bs58" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" +dependencies = [ + "tinyvec", +] [[package]] name = "bstr" @@ -820,11 +1179,25 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" +<<<<<<< HEAD version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" dependencies = [ "serde", +======= +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" + +[[package]] +name = "bytestring" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d80203ea6b29df88012294f62733de21cfeab47f17b41af3a38bc30a03ee72" +dependencies = [ + "bytes", +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) ] [[package]] @@ -967,21 +1340,21 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "chacha20" -version = "0.7.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fee7ad89dc1128635074c268ee661f90c3f7e83d9fd12910608c36b47d6c3412" +checksum = "5c80e5460aa66fe3b91d40bcbdab953a597b60053e34d684ac6903f863b680a6" dependencies = [ "cfg-if", "cipher", - "cpufeatures 0.1.4", + "cpufeatures 0.2.12", "zeroize", ] [[package]] name = "chacha20poly1305" -version = "0.8.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1580317203210c517b6d44794abfbe600698276db18127e37ad3e69bf5e848e5" +checksum = "a18446b09be63d457bbec447509e85f662f32952b035ce892290396bc0b0cff5" dependencies = [ "aead", "chacha20", @@ -1106,6 +1479,15 @@ dependencies = [ "unicode-width", ] +[[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 = "config" version = "0.14.0" @@ -1149,6 +1531,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + [[package]] name = "convert_case" version = "0.4.0" @@ -1156,6 +1544,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" [[package]] +<<<<<<< HEAD name = "core-foundation" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1163,13 +1552,29 @@ checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", +======= +name = "cookie" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e859cd57d0710d9e06c381b550c06e76992472a8c6d527aecd2fc673dcc231fb" +dependencies = [ + "percent-encoding", + "time 0.3.36", + "version_check", +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) ] [[package]] name = "core-foundation" +<<<<<<< HEAD version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b55271e5c8c478ad3f38ad24ef34923091e0548492a266d19b3c0b4d82574c63" +======= +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) dependencies = [ "core-foundation-sys", "libc", @@ -1177,6 +1582,7 @@ dependencies = [ [[package]] name = "core-foundation-sys" +<<<<<<< HEAD version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" @@ -1227,6 +1633,19 @@ dependencies = [ "bitflags 2.6.0", "core-foundation 0.10.0", "libc", +======= +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" + +[[package]] +name = "core2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b49ba7ef1ad6107f8824dbe97de947cbaac53c44e7f9756a1fba0d37c1eec505" +dependencies = [ + "memchr", +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) ] [[package]] @@ -1240,9 +1659,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.1" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95059428f66df56b63431fdb4e1947ed2190586af5c5a8a8b71122bdf5a7f469" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] @@ -1338,7 +1757,7 @@ dependencies = [ "bitflags 2.6.0", "crossterm_winapi", "libc", - "parking_lot 0.12.0", + "parking_lot 0.12.3", "winapi", ] @@ -1367,16 +1786,6 @@ dependencies = [ "typenum", ] -[[package]] -name = "crypto-mac" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" -dependencies = [ - "generic-array", - "subtle", -] - [[package]] name = "crypto-mac" version = "0.11.0" @@ -1446,6 +1855,33 @@ dependencies = [ "zeroize", ] +[[package]] +name = "curve25519-dalek" +version = "4.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures 0.2.12", + "curve25519-dalek-derive", + "digest 0.10.7", + "fiat-crypto", + "rustc_version 0.4.0", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.46", +] + [[package]] name = "curve25519-dalek-ng" version = "4.0.1" @@ -1454,7 +1890,7 @@ checksum = "574d8b2cd0bae5434fd50d53280f8299d95557a978686555880aaf5b8f4f81e9" dependencies = [ "byteorder", "digest 0.9.0", - "rand_core 0.6.2", + "rand_core 0.6.4", "serde", "subtle-ng", "zeroize", @@ -1536,6 +1972,50 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" +[[package]] +name = "data-encoding-macro" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1559b6cba622276d6d63706db152618eeb15b89b3e4041446b05876e352e639" +dependencies = [ + "data-encoding", + "data-encoding-macro-internal", +] + +[[package]] +name = "data-encoding-macro-internal" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "332d754c0af53bc87c108fed664d121ecf59207ec4196041f04d6ab9002ad33f" +dependencies = [ + "data-encoding", + "syn 1.0.109", +] + +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "der-parser" +version = "8.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbd676fbbab537128ef0278adb5576cf363cff6aa22a7b24effe97347cfab61e" +dependencies = [ + "asn1-rs", + "displaydoc", + "nom", + "num-bigint", + "num-traits", + "rusticata-macros", +] + [[package]] name = "deranged" version = "0.3.10" @@ -1646,15 +2126,22 @@ dependencies = [ [[package]] name = "dirs" +<<<<<<< HEAD version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +======= +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) dependencies = [ "dirs-sys", ] [[package]] name = "dirs-sys" +<<<<<<< HEAD version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" @@ -1663,6 +2150,15 @@ dependencies = [ "option-ext", "redox_users", "windows-sys 0.48.0", +======= +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +dependencies = [ + "libc", + "redox_users", + "winapi", +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) ] [[package]] @@ -1677,6 +2173,7 @@ dependencies = [ ] [[package]] +<<<<<<< HEAD name = "dispatch" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1699,6 +2196,12 @@ name = "dlopen2_derive" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2b99bf03862d7f545ebc28ddd33a665b50865f4dfd84031a393823879bd4c54" +======= +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) dependencies = [ "proc-macro2", "quote", @@ -1706,6 +2209,15 @@ dependencies = [ ] [[package]] +<<<<<<< HEAD +======= +name = "dotenv" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" + +[[package]] +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) name = "dotenvy" version = "0.15.6" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1765,7 +2277,17 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37c66a534cbb46ab4ea03477eae19d5c22c01da8258030280b7bd9d8433fb6ef" dependencies = [ - "signature", + "signature 1.3.0", +] + +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "pkcs8", + "signature 2.2.0", ] [[package]] @@ -1774,19 +2296,34 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" dependencies = [ - "curve25519-dalek", - "ed25519", + "curve25519-dalek 3.1.0", + "ed25519 1.0.3", "rand 0.7.3", "serde", "sha2 0.9.8", "zeroize", ] +[[package]] +name = "ed25519-dalek" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" +dependencies = [ + "curve25519-dalek 4.1.3", + "ed25519 2.2.3", + "rand_core 0.6.4", + "serde", + "sha2 0.10.8", + "subtle", + "zeroize", +] + [[package]] name = "either" -version = "1.6.1" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" dependencies = [ "serde", ] @@ -1838,6 +2375,7 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "encoding_rs" version = "0.8.34" +<<<<<<< HEAD source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ @@ -1847,13 +2385,24 @@ dependencies = [ [[package]] name = "enum-as-inner" version = "0.3.3" +======= +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c5f0096a91d210159eceb2ff5e1c4da18388a170e1e3ce948aac9c8fdbbf595" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ - "heck 0.3.2", + "cfg-if 1.0.0", +] + +[[package]] +name = "enum-as-inner" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ffccbb6966c05b32ef8fbac435df276c4ae4d3dc55a8cd0eb9745e6c12f546a" +dependencies = [ + "heck 0.4.1", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.46", ] [[package]] @@ -1895,6 +2444,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] +<<<<<<< HEAD name = "exr" version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1908,6 +2458,26 @@ dependencies = [ "rayon-core", "smallvec", "zune-inflate", +======= +name = "event-listener" +version = "5.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" +dependencies = [ + "event-listener 5.3.1", + "pin-project-lite", +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) ] [[package]] @@ -1917,6 +2487,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] +<<<<<<< HEAD name = "fdeflate" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1934,6 +2505,12 @@ dependencies = [ "memoffset", "rustc_version 0.4.1", ] +======= +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) [[package]] name = "filetime" @@ -1954,17 +2531,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493c" dependencies = [ "byteorder", - "rand 0.8.3", + "rand 0.8.5", "rustc-hex", "static_assertions", ] -[[package]] -name = "fixedbitset" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "279fb028e20b3c4c320317955b77c5e0c9701f05a1d309905d6fc702cdc5053e" - [[package]] name = "flate2" version = "1.0.33" @@ -1972,6 +2543,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253" dependencies = [ "crc32fast", +<<<<<<< HEAD "libz-sys", "miniz_oxide 0.8.0", ] @@ -1983,6 +2555,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17c704e9dbe1ddd863da1e6ff3567795087b1eb201ce80d8fa81162e1516500d" dependencies = [ "bitflags 1.3.2", +======= + "libc", + "miniz_oxide 0.3.7", +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) ] [[package]] @@ -1993,8 +2569,12 @@ checksum = "1657b4441c3403d9f7b3409e47575237dac27b1b5726df654a6ecbf92f0f7577" dependencies = [ "futures-core", "futures-sink", +<<<<<<< HEAD "nanorand", "pin-project 1.1.5", +======= + "pin-project", +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) "spin 0.9.4", ] @@ -2075,6 +2655,16 @@ dependencies = [ "futures-util", ] +[[package]] +name = "futures-bounded" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91f328e7fb845fc832912fb6a34f40cf6d1888c92f974d1893a54e97b5ff542e" +dependencies = [ + "futures-timer", + "futures-util", +] + [[package]] name = "futures-channel" version = "0.3.30" @@ -2120,6 +2710,16 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +[[package]] +name = "futures-lite" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" +dependencies = [ + "futures-core", + "pin-project-lite", +] + [[package]] name = "futures-macro" version = "0.3.30" @@ -2133,13 +2733,12 @@ dependencies = [ [[package]] name = "futures-rustls" -version = "0.22.1" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e01fe9932a224b72b45336d96040aa86386d674a31d0af27d800ea7bc8ca97fe" +checksum = "35bd3cf68c183738046838e300353e4716c674dc5e56890de4826801a6622a28" dependencies = [ "futures-io", - "rustls 0.20.2", - "webpki 0.22.0", + "rustls 0.21.12", ] [[package]] @@ -2173,7 +2772,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project-lite 0.2.13", + "pin-project-lite", "pin-utils", "slab", ] @@ -2539,9 +3138,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.18" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f8a914c2987b688368b5138aa05321db91f4090cf26118185672ad588bce21" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" dependencies = [ "bytes", "fnv", @@ -2549,7 +3148,11 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.11", +<<<<<<< HEAD "indexmap 1.9.3", +======= + "indexmap 2.1.0", +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) "slab", "tokio", "tokio-util", @@ -2595,9 +3198,6 @@ name = "hashbrown" version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" -dependencies = [ - "ahash", -] [[package]] name = "hashbrown" @@ -2605,7 +3205,7 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "ahash", + "ahash 0.7.6", ] [[package]] @@ -2613,6 +3213,10 @@ name = "hashbrown" version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash 0.8.11", + "allocator-api2", +] [[package]] name = "hashlink" @@ -2667,6 +3271,21 @@ dependencies = [ ] [[package]] +<<<<<<< HEAD +======= +name = "hermit-abi" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "379dada1584ad501b383485dd706b8afb7a70fcbc7f4da7d780638a5a6124a60" + +[[package]] +name = "hermit-abi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" + +[[package]] +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) name = "hex" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2685,10 +3304,66 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] +<<<<<<< HEAD name = "hex_fmt" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b07f60793ff0a4d9cef0f18e63b5357e06209987153a64648c972c1e5aff336f" +======= +name = "hickory-proto" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07698b8420e2f0d6447a436ba999ec85d8fbf2a398bbd737b82cac4a2e96e512" +dependencies = [ + "async-trait", + "cfg-if 1.0.0", + "data-encoding", + "enum-as-inner", + "futures-channel", + "futures-io", + "futures-util", + "idna 0.4.0", + "ipnet", + "once_cell", + "rand 0.8.5", + "socket2", + "thiserror", + "tinyvec", + "tokio", + "tracing", + "url", +] + +[[package]] +name = "hickory-resolver" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28757f23aa75c98f254cf0405e6d8c25b831b32921b050a66692427679b1f243" +dependencies = [ + "cfg-if 1.0.0", + "futures-util", + "hickory-proto", + "ipconfig", + "lru-cache", + "once_cell", + "parking_lot 0.12.3", + "rand 0.8.5", + "resolv-conf", + "smallvec", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac 0.12.1", +] +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) [[package]] name = "hmac" @@ -2696,7 +3371,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" dependencies = [ - "crypto-mac 0.11.0", + "crypto-mac", "digest 0.9.0", ] @@ -2787,7 +3462,7 @@ dependencies = [ "futures-core", "http 1.1.0", "http-body 1.0.0", - "pin-project-lite 0.2.13", + "pin-project-lite", ] [[package]] @@ -2804,9 +3479,9 @@ checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" -version = "1.0.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05842d0d43232b23ccb7060ecb0f0626922c21f30012e97b767b30afd4a5d4b9" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" @@ -2818,14 +3493,20 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", - "h2 0.3.18", + "h2 0.3.26", "http 0.2.11", "http-body 0.4.6", "httparse", "httpdate", +<<<<<<< HEAD "itoa 1.0.11", "pin-project-lite 0.2.13", "socket2 0.5.5", +======= + "itoa", + "pin-project-lite", + "socket2", +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) "tokio", "tower-service", "tracing", @@ -2845,9 +3526,14 @@ dependencies = [ "http 1.1.0", "http-body 1.0.0", "httparse", +<<<<<<< HEAD "httpdate", "itoa 1.0.11", "pin-project-lite 0.2.13", +======= + "itoa", + "pin-project-lite", +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) "smallvec", "tokio", "want", @@ -2895,8 +3581,8 @@ dependencies = [ "http 1.1.0", "http-body 1.0.0", "hyper 1.4.1", - "pin-project-lite 0.2.13", - "socket2 0.5.5", + "pin-project-lite", + "socket2", "tokio", "tower", "tower-service", @@ -2944,11 +3630,10 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.2.2" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89829a5d69c23d348314a7ac337fe39173b61149a9864deabd260983aed48c21" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" dependencies = [ - "matches", "unicode-bidi", "unicode-normalization", ] @@ -2965,12 +3650,50 @@ dependencies = [ [[package]] name = "if-addrs" -version = "0.7.0" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbc0fa01ffc752e9dbc72818cdb072cd028b86be5e09dd04c5a643704fe101a9" +checksum = "cabb0019d51a643781ff15c9c8a3e5dedc365c47211270f4e8f82812fedd8f0a" dependencies = [ "libc", - "winapi", + "windows-sys 0.48.0", +] + +[[package]] +name = "if-watch" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6b0422c86d7ce0e97169cc42e04ae643caf278874a7a3c87b8150a220dc7e1e" +dependencies = [ + "async-io", + "core-foundation", + "fnv", + "futures", + "if-addrs", + "ipnet", + "log", + "rtnetlink", + "system-configuration", + "tokio", + "windows", +] + +[[package]] +name = "igd-next" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "064d90fec10d541084e7b39ead8875a5a80d9114a2b18791565253bae25f49e4" +dependencies = [ + "async-trait", + "attohttpc", + "bytes", + "futures", + "http 0.2.11", + "hyper 0.14.28", + "log", + "rand 0.8.5", + "tokio", + "url", + "xmltree", ] [[package]] @@ -3046,21 +3769,21 @@ dependencies = [ [[package]] name = "ipconfig" -version = "0.2.2" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7e2f18aece9709094573a9f24f483c4f65caa4298e2f7ae1b71cc65d853fad7" +checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2 0.3.19", + "socket2", "widestring", - "winapi", - "winreg 0.6.2", + "windows-sys 0.48.0", + "winreg 0.50.0", ] [[package]] name = "ipnet" -version = "2.3.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47be2f14c678be2fdcab04ab1171db51b2762ce6f0a8ee87c8dd4a04ed216135" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "iri-string" @@ -3193,6 +3916,7 @@ dependencies = [ ] [[package]] +<<<<<<< HEAD name = "json-patch" version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3223,6 +3947,16 @@ checksum = "1c6e529149475ca0b2820835d3dce8fcc41c6b943ca608d32f35b449255e4627" dependencies = [ "fluent-uri", "serde", +======= +name = "jsonrpc" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f8423b78fc94d12ef1a4a9d13c348c9a78766dda0cc18817adf0faf77e670c8" +dependencies = [ + "base64-compat", + "serde", + "serde_derive", +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) "serde_json", ] @@ -3270,7 +4004,11 @@ dependencies = [ "http 0.2.11", "jsonrpsee-core", "jsonrpsee-types", +<<<<<<< HEAD "pin-project 1.1.5", +======= + "pin-project", +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) "rustls-native-certs 0.6.3", "soketto", "thiserror", @@ -3288,8 +4026,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4e70b4439a751a5de7dd5ed55eacff78ebf4ffe0fc009cb1ebb11417f5b536b" dependencies = [ "anyhow", +<<<<<<< HEAD "arrayvec 0.7.2", "async-lock", +======= + "arrayvec", + "async-lock 2.7.0", +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) "async-trait", "beef", "futures-channel", @@ -3298,8 +4041,8 @@ dependencies = [ "globset", "hyper 0.14.28", "jsonrpsee-types", - "parking_lot 0.12.0", - "rand 0.8.3", + "parking_lot 0.12.3", + "rand 0.8.5", "rustc-hash", "serde", "serde_json", @@ -3374,6 +4117,7 @@ dependencies = [ ] [[package]] +<<<<<<< HEAD name = "keyboard-types" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3396,6 +4140,12 @@ dependencies = [ "matches", "selectors", ] +======= +name = "language-tags" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4345964bb142484797b161f473a503a434de77149dd8c7427788c6e13379388" +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) [[package]] name = "lazy_static" @@ -3469,59 +4219,91 @@ checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb" [[package]] name = "libp2p" -version = "0.42.2" +version = "0.53.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f592f1b06f12a5686a5de7be9f289a161c96d5f89f12b04b7d14cf3d61d7381" +checksum = "681fb3f183edfbedd7a57d32ebe5dcdc0b9f94061185acf3c30249349cc6fc99" dependencies = [ - "atomic", "bytes", + "either", "futures", "futures-timer", "getrandom 0.2.11", "instant", - "lazy_static", + "libp2p-allow-block-list", + "libp2p-connection-limits", "libp2p-core", "libp2p-dns", "libp2p-gossipsub", "libp2p-identify", +<<<<<<< HEAD "libp2p-kad", +======= + "libp2p-identity", + "libp2p-mdns", +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) "libp2p-metrics", - "libp2p-mplex", "libp2p-noise", "libp2p-ping", + "libp2p-quic", "libp2p-rendezvous", "libp2p-request-response", "libp2p-swarm", - "libp2p-swarm-derive", "libp2p-tcp", + "libp2p-upnp", "libp2p-websocket", "libp2p-yamux", "multiaddr", +<<<<<<< HEAD "parking_lot 0.11.2", "pin-project 1.1.5", "rand 0.7.3", "smallvec", +======= + "pin-project", + "rw-stream-sink", + "thiserror", +] + +[[package]] +name = "libp2p-allow-block-list" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "107b238b794cb83ab53b74ad5dcf7cca3200899b72fe662840cfb52f5b0a32e6" +dependencies = [ + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", + "void", +] + +[[package]] +name = "libp2p-connection-limits" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7cd50a78ccfada14de94cbacd3ce4b0138157f376870f13d3a8422cd075b4fd" +dependencies = [ + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", + "void", +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) ] [[package]] name = "libp2p-core" -version = "0.31.1" +version = "0.41.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c4178afd65bf7c56744b4e0a6cfa6e9b694fe666efba596e03a46f79454d8d" +checksum = "a5a8920cbd8540059a01950c1e5c96ea8d89eb50c51cd366fc18bdf540a6e48f" dependencies = [ - "asn1_der", - "bs58", - "ed25519-dalek", "either", "fnv", "futures", "futures-timer", - "instant", - "lazy_static", - "log", + "libp2p-identity", "multiaddr", "multihash", "multistream-select", +<<<<<<< HEAD "parking_lot 0.11.2", "pin-project 1.1.5", "prost 0.9.0", @@ -3531,24 +4313,36 @@ dependencies = [ "rw-stream-sink", "serde", "sha2 0.10.8", +======= + "once_cell", + "parking_lot 0.12.3", + "pin-project", + "quick-protobuf", + "rand 0.8.5", + "rw-stream-sink", +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) "smallvec", "thiserror", - "unsigned-varint", + "tracing", + "unsigned-varint 0.8.0", "void", - "zeroize", + "web-time", ] [[package]] name = "libp2p-dns" -version = "0.31.0" +version = "0.41.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39d4a2e7efe62c738833b6be6c0f158cf7ffccba462320f4b3bebe43e1050e7b" +checksum = "d17cbcf7160ff35c3e8e560de4a068fe9d6cb777ea72840e48eb76ff9576c4b6" dependencies = [ + "async-trait", "futures", + "hickory-resolver", "libp2p-core", - "log", + "libp2p-identity", + "parking_lot 0.12.3", "smallvec", - "trust-dns-resolver", + "tracing", ] [[package]] @@ -3583,19 +4377,69 @@ dependencies = [ [[package]] name = "libp2p-identify" -version = "0.33.0" +version = "0.44.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae5d84b4e57cb66abb9dd28ea36f69620816e004a7479c0ad76f45002820f99b" +checksum = "20499a945d2f0221fdc6269b3848892c0f370d2ee3e19c7f65a29d8f860f6126" dependencies = [ + "asynchronous-codec 0.7.0", + "either", "futures", + "futures-bounded", "futures-timer", "libp2p-core", + "libp2p-identity", "libp2p-swarm", - "log", "lru", +<<<<<<< HEAD "prost 0.9.0", "prost-build", +======= + "quick-protobuf", + "quick-protobuf-codec 0.3.1", +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) + "smallvec", + "thiserror", + "tracing", + "void", +] + +[[package]] +name = "libp2p-identity" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55cca1eb2bc1fd29f099f3daaab7effd01e1a54b7c577d0ed082521034d912e8" +dependencies = [ + "bs58", + "ed25519-dalek 2.1.1", + "hkdf", + "multihash", + "quick-protobuf", + "rand 0.8.5", + "sha2 0.10.8", + "thiserror", + "tracing", + "zeroize", +] + +[[package]] +name = "libp2p-mdns" +version = "0.45.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49007d9a339b3e1d7eeebc4d67c05dbf23d300b7d091193ec2d3f26802d7faf2" +dependencies = [ + "data-encoding", + "futures", + "hickory-proto", + "if-watch", + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", + "rand 0.8.5", "smallvec", + "socket2", + "tokio", + "tracing", + "void", ] [[package]] @@ -3629,187 +4473,270 @@ dependencies = [ [[package]] name = "libp2p-metrics" -version = "0.3.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0791098ddec13b0c2f9ed37a29175f7c712ce8804ebaba7cbd8bddbc83120190" +checksum = "fdac91ae4f291046a3b2660c039a2830c931f84df2ee227989af92f7692d3357" dependencies = [ + "futures", + "instant", "libp2p-core", "libp2p-identify", + "libp2p-identity", "libp2p-ping", "libp2p-swarm", - "open-metrics-client", -] - -[[package]] -name = "libp2p-mplex" -version = "0.31.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49d470ee73a74340e429fa278469ed274a648738e3fb8de2e8d113482441732f" -dependencies = [ - "asynchronous-codec", - "bytes", - "futures", - "libp2p-core", - "log", - "nohash-hasher", - "parking_lot 0.11.2", - "rand 0.7.3", - "smallvec", - "unsigned-varint", + "pin-project", + "prometheus-client", ] [[package]] name = "libp2p-noise" -version = "0.34.0" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3676dc2df10a7f4f6a80fbeaf2ce4168a0ca6567273e3105b21fa4c877be9017" +checksum = "8ecd0545ce077f6ea5434bcb76e8d0fe942693b4380aaad0d34a358c2bd05793" dependencies = [ + "asynchronous-codec 0.7.0", "bytes", - "curve25519-dalek", + "curve25519-dalek 4.1.3", "futures", - "lazy_static", "libp2p-core", +<<<<<<< HEAD "log", "prost 0.9.0", "prost-build", "rand 0.8.3", +======= + "libp2p-identity", + "multiaddr", + "multihash", + "once_cell", + "quick-protobuf", + "rand 0.8.5", +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) "sha2 0.10.8", "snow", "static_assertions", + "thiserror", + "tracing", "x25519-dalek", "zeroize", ] [[package]] name = "libp2p-ping" -version = "0.33.0" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d384b30135f122a59bf0d186647ad307da0878a9563232cb382d9dbded6a393e" +checksum = "76b94ee41bd8c294194fe608851e45eb98de26fe79bc7913838cbffbfe8c7ce2" dependencies = [ + "either", "futures", "futures-timer", "instant", "libp2p-core", + "libp2p-identity", "libp2p-swarm", - "log", - "rand 0.7.3", + "rand 0.8.5", + "tracing", "void", ] +[[package]] +name = "libp2p-quic" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0375cdfee57b47b313ef1f0fdb625b78aed770d33a40cf1c294a371ff5e6666" +dependencies = [ + "bytes", + "futures", + "futures-timer", + "if-watch", + "libp2p-core", + "libp2p-identity", + "libp2p-tls", + "parking_lot 0.12.3", + "quinn 0.10.2", + "rand 0.8.5", + "ring 0.16.20", + "rustls 0.21.12", + "socket2", + "thiserror", + "tokio", + "tracing", +] + [[package]] name = "libp2p-rendezvous" -version = "0.3.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec166a822f4167929c8e1673c05106f7c86a42b8e9e917b569e1d86f06b9d8b5" +checksum = "168a444a16f569771bcb48aa081a32724079156e64a730dd900276391ccb6385" dependencies = [ - "asynchronous-codec", + "async-trait", + "asynchronous-codec 0.6.0", "bimap", "futures", "futures-timer", "instant", "libp2p-core", + "libp2p-identity", + "libp2p-request-response", "libp2p-swarm", +<<<<<<< HEAD "log", "prost 0.9.0", "prost-build", "rand 0.8.3", "sha2 0.10.8", +======= + "quick-protobuf", + "quick-protobuf-codec 0.2.0", + "rand 0.8.5", +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) "thiserror", - "unsigned-varint", + "tracing", "void", ] [[package]] name = "libp2p-request-response" -version = "0.15.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36194499f5b03d66d56badbed430d93bf1bfd9cec80311e03280de130fbe3d5e" +checksum = "e12823250fe0c45bdddea6eefa2be9a609aff1283ff4e1d8a294fdbb89572f6f" dependencies = [ "async-trait", - "bytes", "futures", + "futures-bounded", + "futures-timer", "instant", "libp2p-core", + "libp2p-identity", "libp2p-swarm", - "log", - "rand 0.7.3", + "rand 0.8.5", + "serde", + "serde_json", "smallvec", - "unsigned-varint", + "tracing", + "void", ] [[package]] name = "libp2p-swarm" -version = "0.33.0" +version = "0.44.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db8ae0811c7a05b6edc6684eb5cc69b055cbb715ad780e6b97872d90308503c1" +checksum = "e92532fc3c4fb292ae30c371815c9b10103718777726ea5497abc268a4761866" dependencies = [ "either", + "fnv", "futures", "futures-timer", "instant", "libp2p-core", - "log", - "rand 0.7.3", + "libp2p-identity", + "libp2p-swarm-derive", + "multistream-select", + "once_cell", + "rand 0.8.5", "smallvec", + "tokio", + "tracing", "void", ] [[package]] name = "libp2p-swarm-derive" -version = "0.26.1" +version = "0.34.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33b4d0acd47739fe0b570728d8d11bbb535050d84c0cf05d6477a4891fceae10" +checksum = "b644268b4acfdaa6a6100b31226ee7a36d96ab4c43287d113bfd2308607d8b6f" dependencies = [ + "heck 0.4.1", + "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.46", ] [[package]] name = "libp2p-tcp" -version = "0.31.1" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52042e8796c5b58d0415bceb1bcb1bcca28b222339978e52b1a0305800bb5199" +checksum = "8b2460fc2748919adff99ecbc1aab296e4579e41f374fb164149bd2c9e529d4c" dependencies = [ "futures", "futures-timer", - "if-addrs", - "ipnet", + "if-watch", "libc", "libp2p-core", - "log", - "socket2 0.4.7", + "libp2p-identity", + "socket2", + "tokio", + "tracing", +] + +[[package]] +name = "libp2p-tls" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93ce7e3c2e7569d685d08ec795157981722ff96e9e9f9eae75df3c29d02b07a5" +dependencies = [ + "futures", + "futures-rustls", + "libp2p-core", + "libp2p-identity", + "rcgen", + "ring 0.16.20", + "rustls 0.21.12", + "rustls-webpki 0.101.7", + "thiserror", + "x509-parser", + "yasna", +] + +[[package]] +name = "libp2p-upnp" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b49cc89949bf0e06869297cd4fe2c132358c23fe93e76ad43950453df4da3d35" +dependencies = [ + "futures", + "futures-timer", + "igd-next", + "libp2p-core", + "libp2p-swarm", "tokio", + "tracing", + "void", ] [[package]] name = "libp2p-websocket" -version = "0.33.0" +version = "0.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83d788da0ab952632d6ead2486baf38a98db92907d4bc5d0f324af0d0fab803d" +checksum = "f4846d51afd08180e164291c3754ba30dd4fbac6fac65571be56403c16431a5e" dependencies = [ "either", "futures", "futures-rustls", "libp2p-core", - "log", - "quicksink", + "libp2p-identity", + "parking_lot 0.12.3", + "pin-project-lite", "rw-stream-sink", "soketto", + "tracing", "url", - "webpki-roots 0.22.2", + "webpki-roots 0.25.4", ] [[package]] name = "libp2p-yamux" -version = "0.35.0" +version = "0.45.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "053d13ce0670d29f9c5a974cf371e6cc4d2d864da1c72bf6870ac5d5e45e2036" +checksum = "ddd5265f6b80f94d48a3963541aad183cc598a645755d2f1805a373e41e0716b" dependencies = [ + "either", "futures", "libp2p-core", - "parking_lot 0.11.2", "thiserror", - "yamux", + "tracing", + "yamux 0.12.1", + "yamux 0.13.3", ] [[package]] @@ -3848,6 +4775,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" [[package]] +<<<<<<< HEAD name = "local-ip-address" version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3860,6 +4788,25 @@ dependencies = [ ] [[package]] +======= +name = "local-channel" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6cbc85e69b8df4b8bb8b89ec634e7189099cea8927a276b7384ce5488e53ec8" +dependencies = [ + "futures-core", + "futures-sink", + "local-waker", +] + +[[package]] +name = "local-waker" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d873d7c67ce09b42110d801813efbc9364414e356be9935700d368351657487" + +[[package]] +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) name = "lock_api" version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3876,11 +4823,11 @@ checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "lru" -version = "0.7.5" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32613e41de4c47ab04970c348ca7ae7382cf116625755af070b008a15516a889" +checksum = "37ee39891760e7d94734f6f63fedc29a2e4a152f836120753a72503f09fcf904" dependencies = [ - "hashbrown 0.11.2", + "hashbrown 0.14.3", ] [[package]] @@ -3937,10 +4884,14 @@ dependencies = [ ] [[package]] -name = "matches" -version = "0.1.8" +name = "md-5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" +dependencies = [ + "cfg-if 1.0.0", + "digest 0.10.7", +] [[package]] name = "matchit" @@ -4021,6 +4972,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", + "log", "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys 0.48.0", ] @@ -4041,7 +4993,7 @@ dependencies = [ "hyper 1.4.1", "hyper-util", "log", - "rand 0.8.3", + "rand 0.8.5", "regex", "serde_json", "serde_urlencoded", @@ -4094,7 +5046,7 @@ name = "monero-rpc" version = "0.1.0" dependencies = [ "anyhow", - "curve25519-dalek", + "curve25519-dalek 3.1.0", "hex", "hex-literal 0.4.1", "jsonrpc_client", @@ -4114,7 +5066,7 @@ name = "monero-wallet" version = "0.1.0" dependencies = [ "anyhow", - "curve25519-dalek", + "curve25519-dalek 3.1.0", "monero", "monero-harness", "monero-rpc", @@ -4146,68 +5098,146 @@ dependencies = [ [[package]] name = "multiaddr" -version = "0.13.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48ee4ea82141951ac6379f964f71b20876d43712bea8faf6dd1a375e08a46499" +checksum = "8b852bc02a2da5feed68cd14fa50d0774b92790a5bdbfa932a813926c8472070" dependencies = [ "arrayref", - "bs58", "byteorder", "data-encoding", + "libp2p-identity", + "multibase", "multihash", "percent-encoding", "serde", "static_assertions", - "unsigned-varint", + "unsigned-varint 0.7.1", "url", ] +[[package]] +name = "multibase" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b3539ec3c1f04ac9748a260728e855f261b4977f5c3406612c884564f329404" +dependencies = [ + "base-x", + "data-encoding", + "data-encoding-macro", +] + [[package]] name = "multihash" -version = "0.14.0" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "752a61cd890ff691b4411423d23816d5866dd5621e4d1c5687a53b94b5a979d8" +checksum = "076d548d76a0e2a0d4ab471d0b1c36c577786dfc4471242035d97a12a735c492" dependencies = [ +<<<<<<< HEAD "digest 0.9.0", "generic-array", "multihash-derive", "serde", "sha2 0.9.8", "unsigned-varint", +======= + "core2", + "unsigned-varint 0.7.1", +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) ] [[package]] -name = "multihash-derive" -version = "0.7.2" +name = "multistream-select" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "424f6e86263cd5294cbd7f1e95746b95aca0e0d66bff31e5a40d6baa87b4aa99" +checksum = "ea0df8e5eec2298a62b326ee4f0d7fe1a6b90a09dfcf9df37b38f947a8c42f19" dependencies = [ - "proc-macro-crate 1.1.0", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", - "synstructure", + "bytes", + "futures", + "log", +<<<<<<< HEAD + "pin-project 1.1.5", +======= + "pin-project", +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) + "smallvec", + "unsigned-varint 0.7.1", +] + +[[package]] +name = "netlink-packet-core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "345b8ab5bd4e71a2986663e88c56856699d060e78e152e6e9d7966fcd5491297" +dependencies = [ + "anyhow", + "byteorder", + "libc", + "netlink-packet-utils", ] [[package]] -name = "multimap" -version = "0.8.3" +name = "netlink-packet-route" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" +checksum = "d9ea4302b9759a7a88242299225ea3688e63c85ea136371bb6cf94fd674efaab" +dependencies = [ + "anyhow", + "bitflags 1.3.2", + "byteorder", + "libc", + "netlink-packet-core", + "netlink-packet-utils", +] [[package]] -name = "multistream-select" -version = "0.11.0" +name = "netlink-packet-utils" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ede8a08c71ad5a95cdd0e4e52facd37190977039a4704eb82a283f713747d34" +dependencies = [ + "anyhow", + "byteorder", + "paste", + "thiserror", +] + +[[package]] +name = "netlink-proto" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "363a84be6453a70e63513660f4894ef815daf88e3356bffcda9ca27d810ce83b" +checksum = "65b4b14489ab424703c092062176d52ba55485a89c076b4f9db05092b7223aa6" dependencies = [ "bytes", "futures", "log", - "pin-project 1.1.5", - "smallvec", - "unsigned-varint", + "netlink-packet-core", + "netlink-sys", + "thiserror", + "tokio", +] + +[[package]] +name = "netlink-sys" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "416060d346fbaf1f23f9512963e3e878f1a78e707cb699ba9215761754244307" +dependencies = [ + "bytes", + "futures", + "libc", + "log", + "tokio", +] + +[[package]] +name = "nix" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" +dependencies = [ + "bitflags 1.3.2", + "cfg-if 1.0.0", + "libc", ] [[package]] @@ -4313,6 +5343,17 @@ dependencies = [ "winapi", ] +[[package]] +name = "num-bigint" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + [[package]] name = "num-conv" version = "0.1.0" @@ -4505,6 +5546,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "oid-registry" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bedf36ffb6ba96c2eb7144ef6270557b52e54b20c0a8e1eb2ff99a6c6959bff" +dependencies = [ + "asn1-rs", +] + [[package]] name = "once_cell" version = "1.19.0" @@ -4518,6 +5568,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] +<<<<<<< HEAD name = "open" version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -4552,6 +5603,8 @@ dependencies = [ ] [[package]] +======= +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) name = "openssl-probe" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -4580,13 +5633,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] -name = "owning_ref" -version = "0.4.1" +name = "parking" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff55baddef9e4ad00f88b6c743a2a8062d4c6ade126c2a528644b8e444d52ce" -dependencies = [ - "stable_deref_trait", -] +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" [[package]] name = "pango" @@ -4626,9 +5676,9 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.12.0" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f5ec2493a61ac0506c0f4199f99070cbe83857b0337006a30f3e6719b8ef58" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core 0.9.1", @@ -4701,6 +5751,7 @@ dependencies = [ ] [[package]] +<<<<<<< HEAD name = "pest_derive" version = "2.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -4879,11 +5930,14 @@ dependencies = [ ] [[package]] +======= +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) name = "pin-project" -version = "0.4.30" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ef0f924a5ee7ea9cbcea77529dba45f8a9ba9f622419fe3386ca581a3ae9d5a" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" dependencies = [ +<<<<<<< HEAD "pin-project-internal 0.4.30", ] @@ -4894,20 +5948,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" dependencies = [ "pin-project-internal 1.1.5", +======= + "pin-project-internal", +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) ] [[package]] name = "pin-project-internal" -version = "0.4.30" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "851c8d0ce9bebe43790dedfc86614c23494ac9f423dd618d3a61fc693eafe61e" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.46", ] [[package]] +<<<<<<< HEAD name = "pin-project-internal" version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -4925,6 +5983,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" [[package]] +======= +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) name = "pin-project-lite" version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -4936,6 +5996,16 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[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.31" @@ -4968,6 +6038,21 @@ dependencies = [ "miniz_oxide 0.7.1", ] +[[package]] +name = "polling" +version = "3.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3ed00ed3fbf728b5816498ecd316d1716eecaced9c0c8d2c5a6740ca214985b" +dependencies = [ + "cfg-if 1.0.0", + "concurrent-queue", + "hermit-abi 0.4.0", + "pin-project-lite", + "rustix", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "poly1305" version = "0.7.0" @@ -5040,6 +6125,7 @@ dependencies = [ ] [[package]] +<<<<<<< HEAD name = "proc-macro-crate" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -5060,6 +6146,8 @@ dependencies = [ ] [[package]] +======= +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) name = "proc-macro-error" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -5098,6 +6186,29 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "prometheus-client" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "504ee9ff529add891127c4827eb481bd69dc0ebc72e9a682e187db4caa60c3ca" +dependencies = [ + "dtoa", + "itoa", + "parking_lot 0.12.3", + "prometheus-client-derive-encode", +] + +[[package]] +name = "prometheus-client-derive-encode" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.46", +] + [[package]] name = "proptest" version = "1.5.0" @@ -5109,7 +6220,7 @@ dependencies = [ "bitflags 2.6.0", "lazy_static", "num-traits", - "rand 0.8.3", + "rand 0.8.5", "rand_chacha 0.3.1", "rand_xorshift", "regex-syntax 0.8.2", @@ -5119,6 +6230,7 @@ dependencies = [ ] [[package]] +<<<<<<< HEAD name = "prost" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -5204,6 +6316,8 @@ dependencies = [ ] [[package]] +======= +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) name = "ptr_meta" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -5248,6 +6362,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] +<<<<<<< HEAD name = "quick-xml" version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -5259,12 +6374,58 @@ dependencies = [ [[package]] name = "quicksink" version = "0.1.2" +======= +name = "quick-protobuf" +version = "0.8.1" +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77de3c815e5a160b1539c6592796801df2043ae35e123b46d73380cfa57af858" +checksum = "9d6da84cc204722a989e01ba2f6e1e276e190f22263d0cb6ce8526fcdb0d2e1f" dependencies = [ - "futures-core", - "futures-sink", - "pin-project-lite 0.1.12", + "byteorder", +] + +[[package]] +name = "quick-protobuf-codec" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ededb1cd78531627244d51dd0c7139fbe736c7d57af0092a76f0ffb2f56e98" +dependencies = [ + "asynchronous-codec 0.6.0", + "bytes", + "quick-protobuf", + "thiserror", + "unsigned-varint 0.7.1", +] + +[[package]] +name = "quick-protobuf-codec" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15a0580ab32b169745d7a39db2ba969226ca16738931be152a3209b409de2474" +dependencies = [ + "asynchronous-codec 0.7.0", + "bytes", + "quick-protobuf", + "thiserror", + "unsigned-varint 0.8.0", +] + +[[package]] +name = "quinn" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cc2c5017e4b43d5995dcea317bc46c1e09404c0a9664d2908f7f02dfe943d75" +dependencies = [ + "bytes", + "futures-io", + "pin-project-lite", + "quinn-proto 0.10.6", + "quinn-udp 0.4.1", + "rustc-hash", + "rustls 0.21.12", + "thiserror", + "tokio", + "tracing", ] [[package]] @@ -5274,9 +6435,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4ceeeeabace7857413798eb1ffa1e9c905a9946a57d81fb69b4b71c4d8eb3ad" dependencies = [ "bytes", - "pin-project-lite 0.2.13", - "quinn-proto", - "quinn-udp", + "pin-project-lite", + "quinn-proto 0.11.3", + "quinn-udp 0.5.2", "rustc-hash", "rustls 0.23.10", "thiserror", @@ -5284,6 +6445,23 @@ dependencies = [ "tracing", ] +[[package]] +name = "quinn-proto" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "141bf7dfde2fbc246bfd3fe12f2455aa24b0fbd9af535d8c86c7bd1381ff2b1a" +dependencies = [ + "bytes", + "rand 0.8.5", + "ring 0.16.20", + "rustc-hash", + "rustls 0.21.12", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + [[package]] name = "quinn-proto" version = "0.11.3" @@ -5291,7 +6469,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ddf517c03a109db8100448a4be38d498df8a210a99fe0e1b9eaf39e78c640efe" dependencies = [ "bytes", - "rand 0.8.3", + "rand 0.8.5", "ring 0.17.3", "rustc-hash", "rustls 0.23.10", @@ -5301,6 +6479,19 @@ dependencies = [ "tracing", ] +[[package]] +name = "quinn-udp" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "055b4e778e8feb9f93c4e439f71dc2156ef13360b432b799e179a8c4cdf0b1d7" +dependencies = [ + "bytes", + "libc", + "socket2", + "tracing", + "windows-sys 0.48.0", +] + [[package]] name = "quinn-udp" version = "0.5.2" @@ -5309,7 +6500,7 @@ checksum = "9096629c45860fc7fb143e125eb826b5e721e10be3263160c7d60ca832cf8c46" dependencies = [ "libc", "once_cell", - "socket2 0.5.5", + "socket2", "tracing", "windows-sys 0.52.0", ] @@ -5333,20 +6524,23 @@ dependencies = [ "libc", "rand_chacha 0.2.2", "rand_core 0.5.1", +<<<<<<< HEAD "rand_hc 0.2.0", "rand_pcg", +======= + "rand_hc", +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) ] [[package]] name = "rand" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", "rand_chacha 0.3.1", - "rand_core 0.6.2", - "rand_hc 0.3.0", + "rand_core 0.6.4", ] [[package]] @@ -5366,7 +6560,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.2", + "rand_core 0.6.4", ] [[package]] @@ -5380,9 +6574,9 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.6.2" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ "getrandom 0.2.11", ] @@ -5397,6 +6591,7 @@ dependencies = [ ] [[package]] +<<<<<<< HEAD name = "rand_hc" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -5415,12 +6610,26 @@ dependencies = [ ] [[package]] +======= +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) name = "rand_xorshift" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" dependencies = [ - "rand_core 0.6.2", + "rand_core 0.6.4", +] + +[[package]] +name = "rcgen" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52c4f3084aa3bc7dfbba4eff4fab2a54db4324965d8872ab933565e6fbd83bc6" +dependencies = [ + "pem", + "ring 0.16.20", + "time 0.3.36", + "yasna", ] [[package]] @@ -5469,11 +6678,19 @@ dependencies = [ [[package]] name = "redox_syscall" +<<<<<<< HEAD version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0884ad60e090bf1345b93da0a5de8923c93884cd03f40dfcfddd3b4bee661853" dependencies = [ "bitflags 2.6.0", +======= +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags 1.3.2", +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) ] [[package]] @@ -5509,6 +6726,7 @@ dependencies = [ ] [[package]] +<<<<<<< HEAD name = "regex-automata" version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -5518,6 +6736,12 @@ dependencies = [ "memchr", "regex-syntax 0.8.2", ] +======= +name = "regex-lite" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53a49587ad06b26609c52e423de037e7f57f20d53535d66e08c695f347df952a" +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) [[package]] name = "regex-syntax" @@ -5563,8 +6787,8 @@ dependencies = [ "mime", "once_cell", "percent-encoding", - "pin-project-lite 0.2.13", - "quinn", + "pin-project-lite", + "quinn 0.11.2", "rustls 0.23.10", "rustls-pemfile 2.1.2", "rustls-pki-types", @@ -5660,6 +6884,21 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "rtnetlink" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "322c53fd76a18698f1c27381d58091de3a043d356aa5bd0d510608b565f469a0" +dependencies = [ + "futures", + "log", + "netlink-packet-route", + "netlink-proto", + "nix", + "thiserror", + "tokio", +] + [[package]] name = "rust_decimal" version = "1.30.0" @@ -5672,7 +6911,7 @@ dependencies = [ "byteorder", "bytes", "num-traits", - "rand 0.8.3", + "rand 0.8.5", "rkyv", "serde", "serde_json", @@ -5717,11 +6956,28 @@ dependencies = [ [[package]] name = "rustc_version" +<<<<<<< HEAD version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ "semver 1.0.23", +======= +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver 1.0.23", +] + +[[package]] +name = "rusticata-macros" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632" +dependencies = [ + "nom", +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) ] [[package]] @@ -5762,6 +7018,18 @@ dependencies = [ "webpki 0.22.0", ] +[[package]] +name = "rustls" +version = "0.21.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" +dependencies = [ + "log", + "ring 0.17.3", + "rustls-webpki 0.101.7", + "sct 0.7.0", +] + [[package]] name = "rustls" version = "0.23.10" @@ -5771,7 +7039,7 @@ dependencies = [ "once_cell", "ring 0.17.3", "rustls-pki-types", - "rustls-webpki", + "rustls-webpki 0.102.4", "subtle", "zeroize", ] @@ -5825,6 +7093,16 @@ version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" +[[package]] +name = "rustls-webpki" +version = "0.101.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring 0.17.3", + "untrusted 0.9.0", +] + [[package]] name = "rustls-webpki" version = "0.102.4" @@ -5856,12 +7134,12 @@ dependencies = [ [[package]] name = "rw-stream-sink" -version = "0.2.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4da5fcb054c46f5a5dff833b129285a93d3f0179531735e6c866e8cc307d2020" +checksum = "d8c9026ff5d2f23da5e45bbc283f156383001bfb09c4e44256d02c1a685fe9a1" dependencies = [ "futures", - "pin-project 0.4.30", + "pin-project", "static_assertions", ] @@ -5971,7 +7249,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff55dc09d460954e9ef2fa8a7ced735a964be9981fd50e870b2b3b0705e14964" dependencies = [ "bitcoin_hashes", - "rand 0.8.3", + "rand 0.8.5", "secp256k1-sys 0.6.1", "serde", ] @@ -6031,7 +7309,7 @@ checksum = "9ecc2adce3ef929c5dc7dacdd612d65ab98002ee18119215ce25d8054ed53c1a" dependencies = [ "bincode 2.0.0-rc.3", "digest 0.10.7", - "rand_core 0.6.2", + "rand_core 0.6.4", "secp256k1 0.27.0", "secp256k1 0.28.2", "secp256kfun_arithmetic_macros", @@ -6106,9 +7384,12 @@ name = "semver" version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +<<<<<<< HEAD dependencies = [ "serde", ] +======= +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) [[package]] name = "semver-parser" @@ -6301,7 +7582,7 @@ dependencies = [ "futures", "log", "once_cell", - "parking_lot 0.12.0", + "parking_lot 0.12.3", "scc", "serial_test_derive", ] @@ -6362,6 +7643,17 @@ dependencies = [ "opaque-debug", ] +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures 0.2.12", + "digest 0.10.7", +] + [[package]] name = "sha2" version = "0.9.8" @@ -6369,8 +7661,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b69f9a4c9740d74c5baa3fd2e547f9525fa8088a8a958e0ca2409a514e33f5fa" dependencies = [ "block-buffer 0.9.0", +<<<<<<< HEAD "cfg-if", "cpufeatures 0.2.1", +======= + "cfg-if 1.0.0", + "cpufeatures 0.2.12", +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) "digest 0.9.0", "opaque-debug", ] @@ -6381,8 +7678,13 @@ version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ +<<<<<<< HEAD "cfg-if", "cpufeatures 0.2.1", +======= + "cfg-if 1.0.0", + "cpufeatures 0.2.12", +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) "digest 0.10.7", ] @@ -6438,7 +7740,7 @@ dependencies = [ "curve25519-dalek-ng", "digest 0.10.7", "generic-array", - "rand_core 0.6.2", + "rand_core 0.6.4", "secp256kfun", "serde", ] @@ -6459,10 +7761,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f0242b8e50dd9accdd56170e94ca1ebd223b098eb9c83539a6e367d0f36ae68" [[package]] +<<<<<<< HEAD name = "simd-adler32" version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" +======= +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "rand_core 0.6.4", +] +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) [[package]] name = "similar" @@ -6506,16 +7818,17 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "snow" -version = "0.8.0" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6142f7c25e94f6fd25a32c3348ec230df9109b463f59c8c7acc4bd34936babb7" +checksum = "0c9d1425eb528a21de2755c75af4c9b5d57f50a0d4c3b7f1828a4cd03f8ba155" dependencies = [ "aes-gcm", "blake2", "chacha20poly1305", - "rand 0.8.3", - "rand_core 0.6.2", + "curve25519-dalek 4.1.3", + "rand_core 0.6.4", "ring 0.16.20", +<<<<<<< HEAD "rustc_version 0.3.3", "sha2 0.9.8", "subtle", @@ -6541,6 +7854,11 @@ checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" dependencies = [ "libc", "winapi", +======= + "rustc_version 0.4.0", + "sha2 0.10.8", + "subtle", +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) ] [[package]] @@ -6583,12 +7901,11 @@ checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2" dependencies = [ "base64 0.13.1", "bytes", - "flate2", "futures", "http 0.2.11", "httparse", "log", - "rand 0.8.3", + "rand 0.8.5", "sha-1", ] @@ -6633,6 +7950,16 @@ dependencies = [ "lock_api", ] +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + [[package]] name = "sqlformat" version = "0.2.0" @@ -6660,16 +7987,18 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa8241483a83a3f33aa5fff7e7d9def398ff9990b2752b6c6112b83c6d246029" dependencies = [ - "ahash", + "ahash 0.7.6", "atoi", + "base64 0.13.1", "bitflags 1.3.2", "byteorder", "bytes", "crc", "crossbeam-queue", + "dirs", "dotenvy", "either", - "event-listener", + "event-listener 2.5.3", "flume", "futures-channel", "futures-core", @@ -6678,18 +8007,29 @@ dependencies = [ "futures-util", "hashlink", "hex", +<<<<<<< HEAD "indexmap 1.9.3", "itoa 1.0.11", +======= + "hkdf", + "hmac 0.12.1", + "indexmap 1.7.0", + "itoa", +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) "libc", "libsqlite3-sys", "log", + "md-5", "memchr", "once_cell", "paste", "percent-encoding", + "rand 0.8.5", "rustls 0.20.2", "rustls-pemfile 1.0.0", "serde", + "serde_json", + "sha1", "sha2 0.10.8", "smallvec", "sqlformat", @@ -6699,6 +8039,7 @@ dependencies = [ "tokio-stream", "url", "webpki-roots 0.22.2", + "whoami", ] [[package]] @@ -6734,12 +8075,6 @@ dependencies = [ "tokio-rustls 0.23.1", ] -[[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" @@ -6882,8 +8217,12 @@ dependencies = [ "digest 0.10.7", "directories-next", "ecdsa_fun", +<<<<<<< HEAD "ed25519-dalek", "erased-serde", +======= + "ed25519-dalek 1.0.1", +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) "futures", "get-port", "hex", @@ -6902,7 +8241,7 @@ dependencies = [ "port_check", "proptest", "qrcode", - "rand 0.8.3", + "rand 0.8.5", "rand_chacha 0.3.1", "regex", "reqwest", @@ -6942,6 +8281,7 @@ dependencies = [ "uuid", "vergen", "void", + "watchtower", "zip", ] @@ -7006,8 +8346,34 @@ dependencies = [ ] [[package]] +<<<<<<< HEAD name = "system-deps" version = "6.2.2" +======= +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "tempfile" +version = "3.10.1" +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349" dependencies = [ @@ -7433,7 +8799,7 @@ dependencies = [ "hex", "hmac 0.12.1", "log", - "rand 0.8.3", + "rand 0.8.5", "serde", "serde_json", "sha2 0.10.8", @@ -7548,9 +8914,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.1.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317cca572a0e89c3ce0ca1f1bdc9369547fe318a683418e42ac8f59d14701023" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ "tinyvec_macros", ] @@ -7572,10 +8938,10 @@ dependencies = [ "libc", "mio", "num_cpus", - "parking_lot 0.12.0", - "pin-project-lite 0.2.13", + "parking_lot 0.12.3", + "pin-project-lite", "signal-hook-registry", - "socket2 0.5.5", + "socket2", "tokio-macros", "windows-sys 0.48.0", ] @@ -7653,7 +9019,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d660770404473ccd7bc9f8b28494a811bc18542b915c0855c51e8f419d5223ce" dependencies = [ "futures-core", - "pin-project-lite 0.2.13", + "pin-project-lite", "tokio", ] @@ -7680,7 +9046,11 @@ checksum = "511de3f85caf1c98983545490c3d09685fa8eb634e57eec22bb4db271f46cbd8" dependencies = [ "futures-util", "log", +<<<<<<< HEAD "pin-project 1.1.5", +======= + "pin-project", +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) "rustls 0.19.0", "tokio", "tokio-rustls 0.22.0", @@ -7699,7 +9069,7 @@ dependencies = [ "futures-core", "futures-io", "futures-sink", - "pin-project-lite 0.2.13", + "pin-project-lite", "tokio", ] @@ -7840,7 +9210,7 @@ dependencies = [ "base32", "base64 0.13.1", "derive_more", - "ed25519-dalek", + "ed25519-dalek 1.0.1", "hex", "hmac 0.11.0", "rand 0.7.3", @@ -7857,12 +9227,17 @@ checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" dependencies = [ "futures-core", "futures-util", +<<<<<<< HEAD "hdrhistogram", "indexmap 1.9.3", "pin-project 1.1.5", "pin-project-lite 0.2.13", "rand 0.8.3", "slab", +======= + "pin-project", + "pin-project-lite", +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) "tokio", "tokio-util", "tower-layer", @@ -7937,7 +9312,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ "log", - "pin-project-lite 0.2.13", + "pin-project-lite", "tracing-attributes", "tracing-core", ] @@ -7983,7 +9358,11 @@ checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" dependencies = [ "futures", "futures-task", +<<<<<<< HEAD "pin-project 1.1.5", +======= + "pin-project", +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) "tracing", ] @@ -8032,6 +9411,7 @@ dependencies = [ ] [[package]] +<<<<<<< HEAD name = "tray-icon" version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -8098,6 +9478,8 @@ dependencies = [ ] [[package]] +======= +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) name = "try-lock" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -8115,7 +9497,7 @@ dependencies = [ "http 0.2.11", "httparse", "log", - "rand 0.8.3", + "rand 0.8.5", "rustls 0.19.0", "rustls-native-certs 0.5.0", "sha-1", @@ -8294,13 +9676,12 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d86a8dc7f45e4c1b0d30e43038c38f274e77af056aa5f74b93c2cf9eb3c1c836" dependencies = [ - "asynchronous-codec", + "asynchronous-codec 0.6.0", "bytes", - "futures-io", - "futures-util", ] [[package]] +<<<<<<< HEAD name = "unstoppableswap-gui-rs" version = "0.0.0" dependencies = [ @@ -8318,6 +9699,12 @@ dependencies = [ "tauri-plugin-store", "tracing", ] +======= +name = "unsigned-varint" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb066959b24b5196ae73cb057f45598450d2c5f71460e98c49b738086eff9c06" +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) [[package]] name = "untrusted" @@ -8410,9 +9797,9 @@ checksum = "852e951cb7832cb45cb1169900d19760cfa39b82bc0ea9c0e5a14ae88411c98b" [[package]] name = "version_check" -version = "0.9.3" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "virtue" @@ -8487,6 +9874,12 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" + [[package]] name = "wasm-bindgen" version = "0.2.90" @@ -8566,6 +9959,24 @@ dependencies = [ "web-sys", ] +[[package]] +name = "watchtower" +version = "0.1.0" +dependencies = [ + "actix-web", + "anyhow", + "bitcoincore-rpc", + "dotenv", + "futures", + "libp2p", + "serde", + "serde_json", + "sqlx", + "tokio", + "tracing", + "tracing-subscriber 0.3.18", +] + [[package]] name = "web-sys" version = "0.3.67" @@ -8577,6 +9988,7 @@ dependencies = [ ] [[package]] +<<<<<<< HEAD name = "webkit2gtk" version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -8618,6 +10030,15 @@ dependencies = [ "pkg-config", "soup3-sys", "system-deps", +======= +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) ] [[package]] @@ -8658,6 +10079,12 @@ dependencies = [ "webpki 0.22.0", ] +[[package]] +name = "webpki-roots" +version = "0.25.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" + [[package]] name = "webpki-roots" version = "0.26.1" @@ -8668,6 +10095,7 @@ dependencies = [ ] [[package]] +<<<<<<< HEAD name = "webview2-com" version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -8712,18 +10140,23 @@ checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082" [[package]] name = "which" version = "4.0.2" +======= +name = "whoami" +version = "1.5.1" +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87c14ef7e1b8b8ecfc75d5eca37949410046e66f15d185c01d70824f1f8111ef" +checksum = "a44ab49fad634e88f55bf8f9bb3abd2f27d7204172a112c7c9987e01c1c94ea9" dependencies = [ - "libc", - "thiserror", + "redox_syscall 0.4.1", + "wasite", + "web-sys", ] [[package]] name = "widestring" -version = "0.4.3" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c168940144dd21fd8046987c16a46a33d5fc84eec29ef9dcddc2ac9e31526b7c" +checksum = "7219d36b6eac893fa81e84ebe06485e7dcbb616177469b142df14f1f4deb1311" [[package]] name = "winapi" @@ -8757,6 +10190,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] +<<<<<<< HEAD name = "window-vibrancy" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -8778,10 +10212,20 @@ checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" dependencies = [ "windows-core 0.58.0", "windows-targets 0.52.6", +======= +name = "windows" +version = "0.51.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" +dependencies = [ + "windows-core", + "windows-targets 0.48.5", +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) ] [[package]] name = "windows-core" +<<<<<<< HEAD version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" @@ -8852,6 +10296,13 @@ checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" dependencies = [ "windows-result", "windows-targets 0.52.6", +======= +version = "0.51.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +dependencies = [ + "windows-targets 0.48.5", +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) ] [[package]] @@ -8882,7 +10333,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.0", + "windows-targets 0.48.5", ] [[package]] @@ -8920,17 +10371,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] @@ -8966,9 +10417,9 @@ checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" @@ -8984,6 +10435,7 @@ checksum = "d8e92753b1c443191654ec532f14c199742964a061be25d77d7a96f09db20bf5" [[package]] name = "windows_aarch64_msvc" +<<<<<<< HEAD version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" @@ -8991,8 +10443,11 @@ checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_aarch64_msvc" version = "0.48.0" +======= +version = "0.48.5" +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" @@ -9008,6 +10463,7 @@ checksum = "6a711c68811799e017b6038e0922cb27a5e2f43a2ddb609fe0b6f3eeda9de615" [[package]] name = "windows_i686_gnu" +<<<<<<< HEAD version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" @@ -9015,8 +10471,11 @@ checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_gnu" version = "0.48.0" +======= +version = "0.48.5" +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" @@ -9038,6 +10497,7 @@ checksum = "146c11bb1a02615db74680b32a68e2d61f553cc24c4eb5b4ca10311740e44172" [[package]] name = "windows_i686_msvc" +<<<<<<< HEAD version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" @@ -9045,8 +10505,11 @@ checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_i686_msvc" version = "0.48.0" +======= +version = "0.48.5" +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" @@ -9062,6 +10525,7 @@ checksum = "c912b12f7454c6620635bbff3450962753834be2a594819bd5e945af18ec64bc" [[package]] name = "windows_x86_64_gnu" +<<<<<<< HEAD version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" @@ -9069,8 +10533,11 @@ checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnu" version = "0.48.0" +======= +version = "0.48.5" +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" @@ -9086,9 +10553,9 @@ checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" @@ -9104,6 +10571,7 @@ checksum = "504a2476202769977a040c6364301a3f65d0cc9e3fb08600b2bda150a0488316" [[package]] name = "windows_x86_64_msvc" +<<<<<<< HEAD version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" @@ -9111,8 +10579,11 @@ checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "windows_x86_64_msvc" version = "0.48.0" +======= +version = "0.48.5" +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" @@ -9131,11 +10602,12 @@ dependencies = [ [[package]] name = "winreg" -version = "0.6.2" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2986deb581c4fe11b621998a5e53361efe6b48a151178d0cd9eeffa4dc6acc9" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "winapi", + "cfg-if 1.0.0", + "windows-sys 0.48.0", ] [[package]] @@ -9229,15 +10701,33 @@ checksum = "ec107c4503ea0b4a98ef47356329af139c0a4f7750e621cf2973cd3385ebcb3d" [[package]] name = "x25519-dalek" -version = "1.1.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc614d95359fd7afc321b66d2107ede58b246b844cf5d8a0adcca413e439f088" +checksum = "c7e468321c81fb07fa7f4c636c3972b9100f0346e5b6a9f2bd0603a52f7ed277" dependencies = [ - "curve25519-dalek", - "rand_core 0.5.1", + "curve25519-dalek 4.1.3", + "rand_core 0.6.4", + "serde", "zeroize", ] +[[package]] +name = "x509-parser" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7069fba5b66b9193bd2c5d3d4ff12b839118f6bcbef5328efafafb5395cf63da" +dependencies = [ + "asn1-rs", + "data-encoding", + "der-parser", + "lazy_static", + "nom", + "oid-registry", + "rusticata-macros", + "thiserror", + "time 0.3.36", +] + [[package]] name = "xattr" version = "1.1.3" @@ -9249,25 +10739,86 @@ dependencies = [ "rustix", ] +[[package]] +name = "xml-rs" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "791978798f0597cfc70478424c2b4fdc2b7a8024aaff78497ef00f24ef674193" + +[[package]] +name = "xmltree" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7d8a75eaf6557bb84a65ace8609883db44a29951042ada9b393151532e41fcb" +dependencies = [ + "xml-rs", +] + [[package]] name = "yamux" -version = "0.10.1" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c0608f53c1dc0bad505d03a34bbd49fbf2ad7b51eb036123e896365532745a1" +checksum = "9ed0164ae619f2dc144909a9f082187ebb5893693d8c0196e8085283ccd4b776" dependencies = [ "futures", "log", "nohash-hasher", - "parking_lot 0.12.0", - "rand 0.8.3", + "parking_lot 0.12.3", + "pin-project", + "rand 0.8.5", + "static_assertions", +] + +[[package]] +name = "yamux" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31b5e376a8b012bee9c423acdbb835fc34d45001cfa3106236a624e4b738028" +dependencies = [ + "futures", + "log", + "nohash-hasher", + "parking_lot 0.12.3", + "pin-project", + "rand 0.8.5", "static_assertions", + "web-time", +] + +[[package]] +name = "yasna" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" +dependencies = [ + "time 0.3.36", +] + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.46", ] [[package]] name = "zeroize" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" dependencies = [ "zeroize_derive", ] @@ -9298,10 +10849,38 @@ dependencies = [ ] [[package]] +<<<<<<< HEAD name = "zune-inflate" version = "0.2.54" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73ab332fe2f6680068f3582b16a24f90ad7096d5d39b974d1c0aff0125116f02" dependencies = [ "simd-adler32", +======= +name = "zstd" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcf2b778a664581e31e389454a7072dab1647606d44f7feea22cd5abb9c9f3f9" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "7.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54a3ab4db68cea366acc5c897c7b4d4d1b8994a9cd6e6f841f8964566a419059" +dependencies = [ + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.13+zstd.1.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" +dependencies = [ + "cc", + "pkg-config", +>>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) ] diff --git a/swap/Cargo.toml b/swap/Cargo.toml index a349f3eda..54d26d374 100644 --- a/swap/Cargo.toml +++ b/swap/Cargo.toml @@ -43,22 +43,10 @@ hyper = "0.14.20" itertools = "0.13" jsonrpsee = { version = "0.16.2", features = [ "server" ] } jsonrpsee-core = "0.16.2" -libp2p = { version = "0.42.2", default-features = false, features = [ - "tcp-tokio", - "yamux", - "mplex", - "dns-tokio", - "noise", - "request-response", - "websocket", - "ping", - "rendezvous", - "identify", - "serde", -] } monero = { version = "0.12", features = [ "serde_support" ] } monero-rpc = { path = "../monero-rpc" } once_cell = "1.19" +libp2p = { version = "0.53.2", default-features = false, features = [ "tcp", "yamux", "dns", "noise", "request-response", "websocket", "ping", "rendezvous", "identify" ] } pem = "3.0" proptest = "1" qrcode = "0.14" diff --git a/swap/src/asb/event_loop.rs b/swap/src/asb/event_loop.rs index c82b746b8..1abe97789 100644 --- a/swap/src/asb/event_loop.rs +++ b/swap/src/asb/event_loop.rs @@ -12,7 +12,7 @@ use anyhow::{Context, Result}; use futures::future; use futures::future::{BoxFuture, FutureExt}; use futures::stream::{FuturesUnordered, StreamExt}; -use libp2p::request_response::{RequestId, ResponseChannel}; +use libp2p::request_response::{InboundRequestId, OutboundRequestId, ResponseChannel}; use libp2p::swarm::SwarmEvent; use libp2p::{PeerId, Swarm}; use rust_decimal::Decimal; @@ -62,7 +62,7 @@ where /// Tracks [`transfer_proof::Request`]s which are currently inflight and /// awaiting an acknowledgement. - inflight_transfer_proofs: HashMap>, + inflight_transfer_proofs: HashMap>, } impl EventLoop @@ -333,10 +333,10 @@ where SwarmEvent::IncomingConnectionError { send_back_addr: address, error, .. } => { tracing::warn!(%address, "Failed to set up connection with peer: {:#}", error); } - SwarmEvent::ConnectionClosed { peer_id: peer, num_established: 0, endpoint, cause: Some(error) } => { + SwarmEvent::ConnectionClosed { peer_id: peer, num_established: 0, endpoint, cause: Some(error), connection_id } => { tracing::debug!(%peer, address = %endpoint.get_remote_address(), "Lost connection to peer: {:#}", error); } - SwarmEvent::ConnectionClosed { peer_id: peer, num_established: 0, endpoint, cause: None } => { + SwarmEvent::ConnectionClosed { peer_id: peer, num_established: 0, endpoint, cause: None, connection_id } => { tracing::info!(%peer, address = %endpoint.get_remote_address(), "Successfully closed connection"); } SwarmEvent::NewListenAddr{address, ..} => { diff --git a/swap/src/asb/network.rs b/swap/src/asb/network.rs index 268a3cbae..8b461d07f 100644 --- a/swap/src/asb/network.rs +++ b/swap/src/asb/network.rs @@ -11,32 +11,27 @@ use crate::network::{ use crate::protocol::alice::State3; use anyhow::{anyhow, Error, Result}; use futures::FutureExt; -use libp2p::core::connection::ConnectionId; use libp2p::core::muxing::StreamMuxerBox; use libp2p::core::transport::Boxed; -use libp2p::dns::TokioDnsConfig; -use libp2p::identify::{Identify, IdentifyConfig, IdentifyEvent}; -use libp2p::ping::{Ping, PingConfig, PingEvent}; -use libp2p::request_response::{RequestId, ResponseChannel}; +use libp2p::request_response::{ResponseChannel}; use libp2p::swarm::dial_opts::PeerCondition; use libp2p::swarm::{ - IntoProtocolsHandler, NetworkBehaviour, NetworkBehaviourAction, PollParameters, - ProtocolsHandler, + NetworkBehaviour }; -use libp2p::tcp::TokioTcpConfig; -use libp2p::websocket::WsConfig; -use libp2p::{identity, Multiaddr, NetworkBehaviour, PeerId, Transport}; +use libp2p::{Multiaddr, PeerId, Transport}; use std::task::Poll; use std::time::Duration; use uuid::Uuid; pub mod transport { + use libp2p::{dns, identity, tcp, websocket::WsConfig}; + use super::*; /// Creates the libp2p transport for the ASB. pub fn new(identity: &identity::Keypair) -> Result> { - let tcp = TokioTcpConfig::new().nodelay(true); - let tcp_with_dns = TokioDnsConfig::system(tcp)?; + let tcp = tcp::Config::new().nodelay(true); + let tcp_with_dns = dns::ResolverConfig::default::system(tcp)?; let websocket_with_dns = WsConfig::new(tcp_with_dns.clone()); let transport = tcp_with_dns.or_transport(websocket_with_dns).boxed(); diff --git a/swap/src/cli/behaviour.rs b/swap/src/cli/behaviour.rs index 72dc5891a..df68b6788 100644 --- a/swap/src/cli/behaviour.rs +++ b/swap/src/cli/behaviour.rs @@ -10,17 +10,16 @@ use crate::protocol::bob::State2; use crate::{bitcoin, env}; use anyhow::{anyhow, Error, Result}; use libp2p::core::Multiaddr; -use libp2p::identify::{Identify, IdentifyConfig, IdentifyEvent}; -use libp2p::ping::{Ping, PingConfig, PingEvent}; -use libp2p::request_response::{RequestId, ResponseChannel}; -use libp2p::{identity, NetworkBehaviour, PeerId}; +use libp2p::request_response::{ResponseChannel, InboundRequestId}; +use libp2p::swarm::{NetworkBehaviour}; +use libp2p::{identify, identity, ping, PeerId}; use std::sync::Arc; use std::time::Duration; #[derive(Debug)] pub enum OutEvent { QuoteReceived { - id: RequestId, + id: InboundRequestId, response: BidQuote, }, SwapSetupCompleted(Box>), @@ -30,15 +29,15 @@ pub enum OutEvent { peer: PeerId, }, EncryptedSignatureAcknowledged { - id: RequestId, + id: InboundRequestId, }, CooperativeXmrRedeemFulfilled { - id: RequestId, + id: InboundRequestId, s_a: Scalar, swap_id: uuid::Uuid, }, CooperativeXmrRedeemRejected { - id: RequestId, + id: InboundRequestId, reason: CooperativeXmrRedeemRejectReason, swap_id: uuid::Uuid, }, @@ -81,12 +80,12 @@ pub struct Behaviour { pub cooperative_xmr_redeem: cooperative_xmr_redeem_after_punish::Behaviour, pub encrypted_signature: encrypted_signature::Behaviour, pub redial: redial::Behaviour, - pub identify: Identify, + pub identify: identify::Behaviour, /// Ping behaviour that ensures that the underlying network connection is /// still alive. If the ping fails a connection close event will be /// emitted that is picked up as swarm event. - ping: Ping, + ping: ping::Behaviour, } impl Behaviour { @@ -98,7 +97,7 @@ impl Behaviour { ) -> Self { let agentVersion = format!("cli/{} ({})", env!("CARGO_PKG_VERSION"), identify_params.1); let protocolVersion = "/comit/xmr/btc/1.0.0".to_string(); - let identifyConfig = IdentifyConfig::new(protocolVersion, identify_params.0.public()) + let identifyConfig = identify::Config::new(protocolVersion, identify_params.0.public()) .with_agent_version(agentVersion); Self { @@ -121,14 +120,14 @@ impl Behaviour { } } -impl From for OutEvent { - fn from(_: PingEvent) -> Self { +impl From for OutEvent { + fn from(_: ping::Event) -> Self { OutEvent::Other } } -impl From for OutEvent { - fn from(_: IdentifyEvent) -> Self { +impl From for OutEvent { + fn from(_: identify::Event) -> Self { OutEvent::Other } } diff --git a/swap/src/cli/event_loop.rs b/swap/src/cli/event_loop.rs index 53ee65b85..397cf5783 100644 --- a/swap/src/cli/event_loop.rs +++ b/swap/src/cli/event_loop.rs @@ -1,5 +1,6 @@ use crate::bitcoin::EncryptedSignature; use crate::cli::behaviour::{Behaviour, OutEvent}; +use libp2p::swarm::NetworkBehaviour; use crate::monero; use crate::network::cooperative_xmr_redeem_after_punish::{Request, Response}; use crate::network::encrypted_signature; @@ -202,10 +203,10 @@ impl EventLoop { SwarmEvent::ConnectionEstablished { peer_id, endpoint, .. } if peer_id == self.alice_peer_id => { tracing::info!(peer_id = %endpoint.get_remote_address(), "Connected to Alice"); } - SwarmEvent::Dialing(peer_id) if peer_id == self.alice_peer_id => { - tracing::debug!(%peer_id, "Dialling Alice"); + SwarmEvent::Dialing { peer_id: Some(alice_peer_id), connection_id } if alice_peer_id == self.alice_peer_id => { + tracing::debug!(%alice_peer_id, "Dialling Alice"); } - SwarmEvent::ConnectionClosed { peer_id, endpoint, num_established, cause: Some(error) } if peer_id == self.alice_peer_id && num_established == 0 => { + SwarmEvent::ConnectionClosed { peer_id, endpoint, num_established, cause: Some(error), connection_id } if peer_id == self.alice_peer_id && num_established == 0 => { tracing::warn!(peer_id = %endpoint.get_remote_address(), cause = %error, "Lost connection to Alice"); } SwarmEvent::ConnectionClosed { peer_id, num_established, cause: None, .. } if peer_id == self.alice_peer_id && num_established == 0 => { @@ -213,7 +214,7 @@ impl EventLoop { tracing::info!("Successfully closed connection to Alice"); return; } - SwarmEvent::OutgoingConnectionError { peer_id: Some(alice_peer_id), error } if alice_peer_id == self.alice_peer_id => { + SwarmEvent::OutgoingConnectionError { peer_id: Some(alice_peer_id), error, connection_id } if alice_peer_id == self.alice_peer_id => { tracing::warn!(%error, "Failed to dial Alice"); if let Some(duration) = self.swarm.behaviour_mut().redial.until_next_redial() { diff --git a/swap/src/network/tor_transport.rs b/swap/src/network/tor_transport.rs index 4f441e171..351b5dc34 100644 --- a/swap/src/network/tor_transport.rs +++ b/swap/src/network/tor_transport.rs @@ -5,7 +5,6 @@ use libp2p::core::multiaddr::{Multiaddr, Protocol}; use libp2p::core::transport::TransportError; use libp2p::core::Transport; use libp2p::tcp::tokio::{Tcp, TcpStream}; -use libp2p::tcp::TcpListenStream; use std::borrow::Cow; use std::net::{Ipv4Addr, Ipv6Addr}; use std::{fmt, io}; @@ -34,7 +33,7 @@ impl Transport for TorDialOnlyTransport { Err(TransportError::MultiaddrNotSupported(addr)) } - fn dial(self, addr: Multiaddr) -> Result> { + fn dial(&mut self, addr: Multiaddr) -> Result> { let address = TorCompatibleAddress::from_multiaddr(Cow::Borrowed(&addr))?; if address.is_certainly_not_reachable_via_tor_daemon() { @@ -60,7 +59,7 @@ impl Transport for TorDialOnlyTransport { fn address_translation(&self, _: &Multiaddr, _: &Multiaddr) -> Option { None } - fn dial_as_listener(self, addr: Multiaddr) -> Result> { + fn dial_as_listener(&mut self, addr: Multiaddr) -> Result> { let address = TorCompatibleAddress::from_multiaddr(Cow::Borrowed(&addr))?; if address.is_certainly_not_reachable_via_tor_daemon() { diff --git a/watchtower b/watchtower new file mode 160000 index 000000000..825166e94 --- /dev/null +++ b/watchtower @@ -0,0 +1 @@ +Subproject commit 825166e948ceccc9e6378a5d34fb29b062301327 From 7029b7d9a4707e02dd37b919de262306d1650bb4 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Thu, 10 Oct 2024 14:19:07 +0200 Subject: [PATCH 002/112] remove submodule --- watchtower | 1 - 1 file changed, 1 deletion(-) delete mode 160000 watchtower diff --git a/watchtower b/watchtower deleted file mode 160000 index 825166e94..000000000 --- a/watchtower +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 825166e948ceccc9e6378a5d34fb29b062301327 From fec79f6219e2d9c663f90f9fb6a32d8700c4d591 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Thu, 10 Oct 2024 14:27:00 +0200 Subject: [PATCH 003/112] update Cargo.lock --- Cargo.lock | 3542 +++++++++++++++++----------------------------------- 1 file changed, 1146 insertions(+), 2396 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ab3af2d42..92cbd155d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,193 +2,11 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "actix-codec" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f7b0a21988c1bf877cf4759ef5ddaac04c1c9fe808c9142ecb78ba97d97a28a" -dependencies = [ - "bitflags 2.4.0", - "bytes", - "futures-core", - "futures-sink", - "memchr", - "pin-project-lite", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "actix-http" -version = "3.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ae682f693a9cd7b058f2b0b5d9a6d7728a8555779bedbbc35dd88528611d020" -dependencies = [ - "actix-codec", - "actix-rt", - "actix-service", - "actix-utils", - "ahash 0.8.11", - "base64 0.22.1", - "bitflags 2.4.0", - "brotli", - "bytes", - "bytestring", - "derive_more", - "encoding_rs", - "flate2", - "futures-core", - "h2 0.3.26", - "http 0.2.11", - "httparse", - "httpdate", - "itoa", - "language-tags", - "local-channel", - "mime", - "percent-encoding", - "pin-project-lite", - "rand 0.8.5", - "sha1", - "smallvec", - "tokio", - "tokio-util", - "tracing", - "zstd", -] - -[[package]] -name = "actix-macros" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" -dependencies = [ - "quote", - "syn 2.0.46", -] - -[[package]] -name = "actix-router" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13d324164c51f63867b57e73ba5936ea151b8a41a1d23d1031eeb9f70d0236f8" -dependencies = [ - "bytestring", - "cfg-if 1.0.0", - "http 0.2.11", - "regex", - "regex-lite", - "serde", - "tracing", -] - -[[package]] -name = "actix-rt" -version = "2.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eda4e2a6e042aa4e55ac438a2ae052d3b5da0ecf83d7411e1a368946925208" -dependencies = [ - "futures-core", - "tokio", -] - -[[package]] -name = "actix-server" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b02303ce8d4e8be5b855af6cf3c3a08f3eff26880faad82bab679c22d3650cb5" -dependencies = [ - "actix-rt", - "actix-service", - "actix-utils", - "futures-core", - "futures-util", - "mio", - "socket2", - "tokio", - "tracing", -] - -[[package]] -name = "actix-service" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b894941f818cfdc7ccc4b9e60fa7e53b5042a2e8567270f9147d5591893373a" -dependencies = [ - "futures-core", - "paste", - "pin-project-lite", -] - -[[package]] -name = "actix-utils" -version = "3.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88a1dcdff1466e3c2488e1cb5c36a71822750ad43839937f85d2f4d9f8b705d8" -dependencies = [ - "local-waker", - "pin-project-lite", -] - -[[package]] -name = "actix-web" -version = "4.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1988c02af8d2b718c05bc4aeb6a66395b7cdf32858c2c71131e5637a8c05a9ff" -dependencies = [ - "actix-codec", - "actix-http", - "actix-macros", - "actix-router", - "actix-rt", - "actix-server", - "actix-service", - "actix-utils", - "actix-web-codegen", - "ahash 0.8.11", - "bytes", - "bytestring", - "cfg-if 1.0.0", - "cookie", - "derive_more", - "encoding_rs", - "futures-core", - "futures-util", - "itoa", - "language-tags", - "log", - "mime", - "once_cell", - "pin-project-lite", - "regex", - "regex-lite", - "serde", - "serde_json", - "serde_urlencoded", - "smallvec", - "socket2", - "time 0.3.36", - "url", -] - -[[package]] -name = "actix-web-codegen" -version = "4.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f591380e2e68490b5dfaf1dd1aa0ebe78d84ba7067078512b4ea6e4492d622b8" -dependencies = [ - "actix-router", - "proc-macro2", - "quote", - "syn 2.0.46", -] - [[package]] name = "addr2line" -version = "0.21.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] @@ -207,30 +25,30 @@ checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "aead" -version = "0.4.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "922b33332f54fc0ad13fa3e514601e8d30fb54e1f3eadc36643f6526db645621" +checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" dependencies = [ + "crypto-common", "generic-array", ] [[package]] name = "aes" -version = "0.7.2" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbda1ffd586ec58bdbc3290f9243c1d05bec1abf49ec15e4bc3d60070b7d9d11" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" dependencies = [ "cfg-if", "cipher", - "cpufeatures 0.1.4", - "opaque-debug", + "cpufeatures", ] [[package]] name = "aes-gcm" -version = "0.9.1" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee2263805ba4537ccbb19db28525a7b1ebc7284c228eb5634c3124ca63eb03f" +checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" dependencies = [ "aead", "aes", @@ -242,11 +60,11 @@ dependencies = [ [[package]] name = "ahash" -version = "0.7.6" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "once_cell", "version_check", ] @@ -257,8 +75,7 @@ version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ - "cfg-if 1.0.0", - "getrandom 0.2.11", + "cfg-if", "once_cell", "version_check", "zerocopy", @@ -266,18 +83,14 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "0.7.18" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] [[package]] -<<<<<<< HEAD -name = "aho-corasick" -version = "1.1.3" -======= name = "alloc-no-stdlib" version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -298,31 +111,6 @@ version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" -[[package]] -name = "ansi_term" -version = "0.11.0" ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "alloc-no-stdlib" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" - -[[package]] -name = "alloc-stdlib" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" -dependencies = [ - "alloc-no-stdlib", -] - [[package]] name = "android-tzdata" version = "0.1.1" @@ -340,18 +128,18 @@ dependencies = [ [[package]] name = "ansi_term" -version = "0.11.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" dependencies = [ "winapi", ] [[package]] name = "anyhow" -version = "1.0.86" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" [[package]] name = "arboard" @@ -361,72 +149,27 @@ checksum = "df099ccb16cd014ff054ac1bf392c67feeef57164b05c42f037cd40f5d4357f4" dependencies = [ "clipboard-win", "core-graphics 0.23.2", - "image 0.25.0", + "image 0.25.2", "log", "objc2", "objc2-app-kit", "objc2-foundation", - "parking_lot 0.12.0", + "parking_lot 0.12.3", "windows-sys 0.48.0", "x11rb", ] [[package]] name = "arrayref" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" - -[[package]] -name = "arrayvec" -version = "0.5.2" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" [[package]] name = "arrayvec" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" - -[[package]] -name = "asn1-rs" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f6fd5ddaf0351dff5b8da21b2fb4ff8e08ddd02857f0bf69c47639106c0fff0" -dependencies = [ - "asn1-rs-derive", - "asn1-rs-impl", - "displaydoc", - "nom", - "num-traits", - "rusticata-macros", - "thiserror", - "time 0.3.36", -] - -[[package]] -name = "asn1-rs-derive" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", - "synstructure", -] - -[[package]] -name = "asn1-rs-impl" -version = "0.1.0" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "assert-json-diff" @@ -455,12 +198,12 @@ dependencies = [ [[package]] name = "async-io" -version = "2.3.3" +version = "2.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6baa8f0178795da0e71bc42c9e5d13261aac7ee549853162e66a241ba17964" +checksum = "444b0228950ee6501b3568d3c93bf1176a1fdbc3b758dcd9475046d30f4dc7e8" dependencies = [ "async-lock 3.4.0", - "cfg-if 1.0.0", + "cfg-if", "concurrent-queue", "futures-io", "futures-lite", @@ -469,14 +212,14 @@ dependencies = [ "rustix", "slab", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "async-lock" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa24f727524730b077666307f2734b4a1a1c57acb79193127dcc8914d5242dd7" +checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" dependencies = [ "event-listener 2.5.3", ] @@ -500,7 +243,7 @@ checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" dependencies = [ "async-stream-impl", "futures-core", - "pin-project-lite 0.2.13", + "pin-project-lite", ] [[package]] @@ -511,25 +254,25 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.79", ] [[package]] name = "async-trait" -version = "0.1.81" +version = "0.1.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" +checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.79", ] [[package]] name = "asynchronous-codec" -version = "0.6.0" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0de5164e5edbf51c45fb8c2d9664ae1c095cce1b265ecf7569093c0d66ef690" +checksum = "4057f2c32adbb2fc158e22fb38433c8e9bbf76b75a4732c7c0cbaf695fb65568" dependencies = [ "bytes", "futures-sink", @@ -584,15 +327,10 @@ dependencies = [ ] [[package]] -name = "attohttpc" -version = "0.24.1" +name = "atomic-waker" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d9a9bf8b79a749ee0b911b91b671cc2b6c670bdbc7e3dfd537576ddc94bb2a2" -dependencies = [ - "http 0.2.11", - "log", - "url", -] +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "atty" @@ -600,16 +338,16 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.19", "libc", "winapi", ] [[package]] name = "autocfg" -version = "1.0.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "axum" @@ -622,15 +360,15 @@ dependencies = [ "bitflags 1.3.2", "bytes", "futures-util", - "http 0.2.11", + "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.28", + "hyper 0.14.30", "itoa 1.0.11", "matchit", "memchr", "mime", "percent-encoding", - "pin-project-lite 0.2.13", + "pin-project-lite", "rustversion", "serde", "sync_wrapper 0.1.2", @@ -648,7 +386,7 @@ dependencies = [ "async-trait", "bytes", "futures-util", - "http 0.2.11", + "http 0.2.12", "http-body 0.4.6", "mime", "rustversion", @@ -663,7 +401,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b62ddb9cb1ec0a098ad4bbf9344d0713fa193ae1a80af55febcff2627b6a00c1" dependencies = [ "futures-core", - "getrandom 0.2.11", + "getrandom 0.2.15", "instant", "pin-project-lite", "rand 0.8.5", @@ -672,17 +410,17 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", - "miniz_oxide 0.7.1", + "miniz_oxide 0.8.0", "object", "rustc-demangle", + "windows-targets 0.52.6", ] [[package]] @@ -699,9 +437,9 @@ checksum = "23ce669cd6c8588f79e15cf450314f9638f967fc5770ff1c7c1deb0925ea7cfa" [[package]] name = "base58-monero" -version = "0.3.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "465ba1f408efdef4d9379bdfa7340899b63e472d50c7fb666480ccfd5a893e53" +checksum = "935c90240f9b7749c80746bf88ad9cb346f34b01ee30ad4d566dfdecd6e3cc6a" dependencies = [ "thiserror", ] @@ -730,15 +468,6 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" -[[package]] -name = "base64-compat" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a8d4d2746f89841e49230dd26917df1876050f95abafafbe34f47cb534b88d7" -dependencies = [ - "byteorder", -] - [[package]] name = "base64ct" version = "1.6.0" @@ -747,15 +476,15 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "bdk" -version = "0.28.0" +version = "0.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9b650f45ae7dc8558544448253f3e1ae443433637ccd9f9d14d2089ff913480" +checksum = "b15adb2017ab6437b6704a779ab8bbefe857612f5af9d84b677a1767f965e099" dependencies = [ "async-trait", "bdk-macros", "bitcoin", "electrum-client", - "getrandom 0.2.11", + "getrandom 0.2.15", "js-sys", "log", "miniscript", @@ -834,9 +563,9 @@ dependencies = [ [[package]] name = "bit-set" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e11e16035ea35e4e5997b393eacbf6f63983188f7a2ad25bfb13465f5ad59de" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" dependencies = [ "bit-vec", ] @@ -862,7 +591,7 @@ dependencies = [ "base64 0.13.1", "bech32", "bitcoin_hashes", - "secp256k1 0.24.1", + "secp256k1 0.24.3", "serde", ] @@ -899,19 +628,6 @@ dependencies = [ "serde", ] -[[package]] -name = "bitcoincore-rpc" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0261b2bb7617e0c91b452a837bbd1291fd34ad6990cb8e3ffc28239cc045b5ca" -dependencies = [ - "bitcoincore-rpc-json", - "jsonrpc", - "log", - "serde", - "serde_json", -] - [[package]] name = "bitcoincore-rpc-json" version = "0.16.0" @@ -938,6 +654,18 @@ dependencies = [ "serde", ] +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + [[package]] name = "blake2" version = "0.10.6" @@ -965,9 +693,9 @@ dependencies = [ [[package]] name = "block-buffer" -version = "0.10.2" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ "generic-array", ] @@ -1009,52 +737,30 @@ dependencies = [ [[package]] name = "borsh" -version = "0.10.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "822462c1e7b17b31961798a6874b36daea6818e99e0cb7d3b7b0fa3c477751c3" +checksum = "26d4d6dafc1a3bb54687538972158f07b2c948bc57d5890df22c0739098b3028" dependencies = [ "borsh-derive", - "hashbrown 0.12.3", + "cfg_aliases 0.1.1", ] [[package]] name = "borsh-derive" -version = "0.10.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37626c9e941a687ee9abef6065b44c379478ae563b7483c613dd705ef1dff59e" +checksum = "bf4918709cc4dd777ad2b6303ed03cb37f3ca0ccede8c1b0d28ac6db8f4710e0" dependencies = [ - "borsh-derive-internal", - "borsh-schema-derive-internal", - "proc-macro-crate", + "once_cell", + "proc-macro-crate 2.0.2", "proc-macro2", - "syn 1.0.109", -] - -[[package]] -name = "borsh-derive-internal" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61820b4c5693eafb998b1e67485423c923db4a75f72585c247bdee32bad81e7b" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "borsh-schema-derive-internal" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c76cdbfa13def20d1f8af3ae7b3c6771f06352a74221d8851262ac384c122b8e" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", + "quote", + "syn 2.0.79", + "syn_derive", ] [[package]] name = "brotli" -<<<<<<< HEAD version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d640d25bc63c50fb1f0b545ffd80207d2e10a4c965530809b40ba3386825c391" @@ -1095,30 +801,6 @@ dependencies = [ "alloc-stdlib", ] -[[package]] -name = "bs58" -version = "0.4.0" -======= -version = "6.0.0" ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74f7971dbd9326d58187408ab83117d8ac1bb9c17b085fdacd1cf2f598719b6b" -dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", - "brotli-decompressor", -] - -[[package]] -name = "brotli-decompressor" -version = "4.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a45bd2e4095a8b518033b128020dd4a55aab1c0a381ba4404a472630f4bc362" -dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", -] - [[package]] name = "bs58" version = "0.5.1" @@ -1130,9 +812,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.6.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6798148dccfbff0fae41c7574d2fa8f1ef3492fba0face179de5d8d447d67b05" +checksum = "40723b8fb387abc38f4f4a37c09073622e41dd12327033091ef8950659e6dc0c" dependencies = [ "memchr", "serde", @@ -1140,25 +822,26 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.6.1" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63396b8a4b9de3f4fdfb320ab6080762242f66a8ef174c49d8e19b674db4cdbe" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "bytecheck" -version = "0.6.9" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d11cac2c12b5adc6570dad2ee1b87eff4955dac476fe12d81e5fdd352e52406f" +checksum = "23cdc57ce23ac53c931e88a43d06d070a6fd142f2617be5855eb75efc9beb1c2" dependencies = [ "bytecheck_derive", "ptr_meta", + "simdutf8", ] [[package]] name = "bytecheck_derive" -version = "0.6.9" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e576ebe98e605500b3c8041bb888e966653577172df6dd97398714eb30b9bf" +checksum = "3db406d29fbcd95542e92559bed4d8ad92636d1ca8b3b72ede10b4bcc010e659" dependencies = [ "proc-macro2", "quote", @@ -1167,44 +850,36 @@ dependencies = [ [[package]] name = "bytemuck" -version = "1.14.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" +checksum = "94bbb0ad554ad961ddc5da507a12a29b14e4ae5bda06b19f575a3e6079d2e2ae" [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "byteorder-lite" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" [[package]] name = "bytes" -<<<<<<< HEAD version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" dependencies = [ "serde", -======= -version = "1.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" - -[[package]] -name = "bytestring" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d80203ea6b29df88012294f62733de21cfeab47f17b41af3a38bc30a03ee72" -dependencies = [ - "bytes", ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) ] [[package]] name = "bzip2" -version = "0.4.2" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abf8012c8a15d5df745fcf258d93e6149dcf102882c8d8702d9cff778eab43a8" +checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" dependencies = [ "bzip2-sys", "libc", @@ -1212,9 +887,9 @@ dependencies = [ [[package]] name = "bzip2-sys" -version = "0.1.10+1.0.8" +version = "0.1.11+1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17fa3d1ac1ca21c5c4e36a97f3c3eb25084576f6fc47bf0139c1123434216c6c" +checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" dependencies = [ "cc", "libc", @@ -1272,7 +947,7 @@ checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" dependencies = [ "camino", "cargo-platform", - "semver 1.0.23", + "semver", "serde", "serde_json", "thiserror", @@ -1290,9 +965,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.21" +version = "1.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07b1695e2c7e8fc85310cde85aeaab7e3097f593c91d209d3f9df76c928100f0" +checksum = "2e80e3b6a3ab07840e1cae9b0666a63970dc28e8ed5ffbcdacbfc760c281bfc1" dependencies = [ "jobserver", "libc", @@ -1332,6 +1007,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + [[package]] name = "cfg_aliases" version = "0.2.1" @@ -1340,21 +1021,20 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "chacha20" -version = "0.8.2" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c80e5460aa66fe3b91d40bcbdab953a597b60053e34d684ac6903f863b680a6" +checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818" dependencies = [ "cfg-if", "cipher", - "cpufeatures 0.2.12", - "zeroize", + "cpufeatures", ] [[package]] name = "chacha20poly1305" -version = "0.9.1" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18446b09be63d457bbec447509e85f662f32952b035ce892290396bc0b0cff5" +checksum = "10cd79432192d1c0f4e1a0fef9527696cc039165d729fb41b3f4f4f354c2dc35" dependencies = [ "aead", "chacha20", @@ -1380,18 +1060,20 @@ dependencies = [ [[package]] name = "cipher" -version = "0.3.0" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" dependencies = [ - "generic-array", + "crypto-common", + "inout", + "zeroize", ] [[package]] name = "clap" -version = "2.33.3" +version = "2.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002" +checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" dependencies = [ "ansi_term", "atty", @@ -1518,17 +1200,15 @@ checksum = "e763eef8846b13b380f37dfecda401770b0ca4e56e95170237bd7c25c7db3582" [[package]] name = "console" -version = "0.15.0" +version = "0.15.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28b32d32ca44b70c3e4acd7db1babf555fa026e385fb95f18028f88848b3c31" +checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" dependencies = [ "encode_unicode", + "lazy_static", "libc", - "once_cell", - "regex", - "terminal_size", "unicode-width", - "winapi", + "windows-sys 0.52.0", ] [[package]] @@ -1544,7 +1224,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" [[package]] -<<<<<<< HEAD name = "core-foundation" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1552,29 +1231,13 @@ checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", -======= -name = "cookie" -version = "0.16.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e859cd57d0710d9e06c381b550c06e76992472a8c6d527aecd2fc673dcc231fb" -dependencies = [ - "percent-encoding", - "time 0.3.36", - "version_check", ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) ] [[package]] name = "core-foundation" -<<<<<<< HEAD version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b55271e5c8c478ad3f38ad24ef34923091e0548492a266d19b3c0b4d82574c63" -======= -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) dependencies = [ "core-foundation-sys", "libc", @@ -1582,7 +1245,6 @@ dependencies = [ [[package]] name = "core-foundation-sys" -<<<<<<< HEAD version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" @@ -1633,10 +1295,7 @@ dependencies = [ "bitflags 2.6.0", "core-foundation 0.10.0", "libc", -======= -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +] [[package]] name = "core2" @@ -1645,108 +1304,83 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b49ba7ef1ad6107f8824dbe97de947cbaac53c44e7f9756a1fba0d37c1eec505" dependencies = [ "memchr", ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) -] - -[[package]] -name = "cpufeatures" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed00c67cb5d0a7d64a44f6ad2668db7e7530311dd53ea79bcd4fb022c64911c8" -dependencies = [ - "libc", ] [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" dependencies = [ "libc", ] -[[package]] -name = "cpuid-bool" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634" - [[package]] name = "crc" -version = "3.0.0" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53757d12b596c16c78b83458d732a5d1a17ab3f53f2f7412f6fb57cc8a140ab3" +checksum = "69e6e4d7b33a94f0991c26729976b10ebde1d34c3ee82408fb536164fa10d636" dependencies = [ "crc-catalog", ] [[package]] name = "crc-catalog" -version = "2.1.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d0165d2900ae6778e36e80bbc4da3b5eefccee9ba939761f9c2882a5d9af3ff" +checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" [[package]] name = "crc32fast" -version = "1.2.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] [[package]] name = "crossbeam-channel" -version = "0.5.9" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c3242926edf34aec4ac3a77108ad4854bffaa2e4ddc1824124ce59231302d5" +checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" dependencies = [ - "cfg-if", "crossbeam-utils", ] [[package]] name = "crossbeam-deque" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fca89a0e215bab21874660c67903c5f143333cab1da83d041c7ded6053774751" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.16" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d2fe95351b870527a5d09bf563ed3c97c0cffb87cf1c78a591bf48bb218d9aa" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "autocfg", - "cfg-if", "crossbeam-utils", - "memoffset", ] [[package]] name = "crossbeam-queue" -version = "0.3.8" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1cfb3ea8a53f37c40dea2c7bedcbd88bdfae54f5e2175d6ecaff1c988353add" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" dependencies = [ - "cfg-if", "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.17" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d96137f14f244c37f989d9fff8f95e6c18b918e71f36638f8c49112e4c78f" -dependencies = [ - "cfg-if", -] +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crossterm" @@ -1778,11 +1412,12 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "crypto-common" -version = "0.1.3" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57952ca27b5e3606ff4dd79b0020231aaf9d6aa76dc05fd30137538c50bd3ce8" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array", + "rand_core 0.6.4", "typenum", ] @@ -1820,7 +1455,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" dependencies = [ "quote", - "syn 2.0.46", + "syn 2.0.79", ] [[package]] @@ -1830,23 +1465,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" dependencies = [ "quote", - "syn 2.0.46", + "syn 2.0.79", ] [[package]] name = "ctr" -version = "0.7.0" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a232f92a03f37dd7d7dd2adc67166c77e9cd88de5b019b9a9eecfaeaf7bfd481" +checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" dependencies = [ "cipher", ] [[package]] name = "curve25519-dalek" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "639891fde0dbea823fc3d798a0fdf9d2f9440a42d64a78ab3488b0ca025117b3" +checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" dependencies = [ "byteorder", "digest 0.9.0", @@ -1861,12 +1496,12 @@ version = "4.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" dependencies = [ - "cfg-if 1.0.0", - "cpufeatures 0.2.12", + "cfg-if", + "cpufeatures", "curve25519-dalek-derive", "digest 0.10.7", "fiat-crypto", - "rustc_version 0.4.0", + "rustc_version", "subtle", "zeroize", ] @@ -1879,14 +1514,14 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.79", ] [[package]] name = "curve25519-dalek-ng" -version = "4.0.1" +version = "4.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "574d8b2cd0bae5434fd50d53280f8299d95557a978686555880aaf5b8f4f81e9" +checksum = "1c359b7249347e46fb28804470d071c921156ad62b3eef5d34e2ba867533dec8" dependencies = [ "byteorder", "digest 0.9.0", @@ -1941,7 +1576,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.46", + "syn 2.0.79", ] [[package]] @@ -1963,7 +1598,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core 0.20.10", "quote", - "syn 2.0.46", + "syn 2.0.79", ] [[package]] @@ -2002,25 +1637,11 @@ dependencies = [ "zeroize", ] -[[package]] -name = "der-parser" -version = "8.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbd676fbbab537128ef0278adb5576cf363cff6aa22a7b24effe97347cfab61e" -dependencies = [ - "asn1-rs", - "displaydoc", - "nom", - "num-bigint", - "num-traits", - "rusticata-macros", -] - [[package]] name = "deranged" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eb30d70a07a3b04884d2677f06bec33509dc67ca60d92949e5535352d3191dc" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ "powerfmt", "serde", @@ -2028,15 +1649,15 @@ dependencies = [ [[package]] name = "derive_more" -version = "0.99.16" +version = "0.99.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40eebddd2156ce1bb37b20bbe5151340a31828b1f2d22ba4141f3531710e38df" +checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ "convert_case", "proc-macro2", "quote", - "rustc_version 0.3.3", - "syn 1.0.109", + "rustc_version", + "syn 2.0.79", ] [[package]] @@ -2049,10 +1670,10 @@ dependencies = [ "bytes", "devtools-wire-format", "futures", - "http 0.2.11", - "hyper 0.14.28", + "http 0.2.12", + "hyper 0.14.30", "log", - "prost-types 0.12.6", + "prost-types", "ringbuf", "thiserror", "tokio", @@ -2075,8 +1696,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1c0de542960449c9566001c1879d10ede95f3f2e0013fdae0cc3b153bfabb0d" dependencies = [ "bitflags 2.6.0", - "prost 0.12.6", - "prost-types 0.12.6", + "prost", + "prost-types", "tonic", "tracing-core", ] @@ -2109,7 +1730,7 @@ version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer 0.10.2", + "block-buffer 0.10.4", "crypto-common", "subtle", ] @@ -2126,22 +1747,15 @@ dependencies = [ [[package]] name = "dirs" -<<<<<<< HEAD version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" -======= -version = "4.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) dependencies = [ "dirs-sys", ] [[package]] name = "dirs-sys" -<<<<<<< HEAD version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" @@ -2150,15 +1764,6 @@ dependencies = [ "option-ext", "redox_users", "windows-sys 0.48.0", -======= -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" -dependencies = [ - "libc", - "redox_users", - "winapi", ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) ] [[package]] @@ -2173,7 +1778,6 @@ dependencies = [ ] [[package]] -<<<<<<< HEAD name = "dispatch" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2196,32 +1800,17 @@ name = "dlopen2_derive" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2b99bf03862d7f545ebc28ddd33a665b50865f4dfd84031a393823879bd4c54" -======= -name = "displaydoc" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) dependencies = [ "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.79", ] [[package]] -<<<<<<< HEAD -======= -name = "dotenv" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" - -[[package]] ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) name = "dotenvy" -version = "0.15.6" +version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03d8c417d7a8cb362e0c37e5d815f5eb7c37f79ff93707329d5a194e42e54ca0" +checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" [[package]] name = "dpi" @@ -2234,9 +1823,9 @@ dependencies = [ [[package]] name = "dtoa" -version = "1.0.2" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5caaa75cbd2b960ff1e5392d2cfb1f44717fffe12fc1f32b7b5d1267f99732a6" +checksum = "dcbb2bf8e87535c23f7a8a321e364ce21462d0ff10cb6407820e8e96dfff6653" [[package]] name = "dtoa-short" @@ -2273,11 +1862,11 @@ dependencies = [ [[package]] name = "ed25519" -version = "1.0.3" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37c66a534cbb46ab4ea03477eae19d5c22c01da8258030280b7bd9d8433fb6ef" +checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" dependencies = [ - "signature 1.3.0", + "signature 1.6.4", ] [[package]] @@ -2296,11 +1885,11 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" dependencies = [ - "curve25519-dalek 3.1.0", - "ed25519 1.0.3", + "curve25519-dalek 3.2.0", + "ed25519 1.5.3", "rand 0.7.3", "serde", - "sha2 0.9.8", + "sha2 0.9.9", "zeroize", ] @@ -2330,31 +1919,31 @@ dependencies = [ [[package]] name = "electrum-client" -version = "0.12.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82a232d46710f8064b7bb2029d82819fc1f5fba053687e0e3bb47cc762af24f6" +checksum = "a8e1e1e452aef3ee772d19cc6272ef642f22ce0f4a9fb715ffe98010934e2ae1" dependencies = [ "bitcoin", "byteorder", "libc", "log", - "rustls 0.20.2", + "rustls 0.20.9", "serde", "serde_json", - "webpki 0.22.0", - "webpki-roots 0.22.2", + "webpki 0.22.4", + "webpki-roots 0.22.6", "winapi", ] [[package]] name = "embed-resource" -version = "2.4.3" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4edcacde9351c33139a41e3c97eb2334351a81a2791bebb0b243df837128f602" +checksum = "f4e24052d7be71f0efb50c201557f6fe7d237cfd5a64fd5bcd7fd8fe32dbbffa" dependencies = [ "cc", "memchr", - "rustc_version 0.4.1", + "rustc_version", "toml 0.8.2", "vswhom", "winreg 0.52.0", @@ -2375,7 +1964,6 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "encoding_rs" version = "0.8.34" -<<<<<<< HEAD source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ @@ -2384,25 +1972,14 @@ dependencies = [ [[package]] name = "enum-as-inner" -version = "0.3.3" -======= ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "enum-as-inner" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ffccbb6966c05b32ef8fbac435df276c4ae4d3dc55a8cd0eb9745e6c12f546a" +checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc" dependencies = [ - "heck 0.4.1", + "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.79", ] [[package]] @@ -2423,9 +2000,9 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", @@ -2444,21 +2021,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] -<<<<<<< HEAD -name = "exr" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1e481eb11a482815d3e9d618db8c42a93207134662873809335a92327440c18" -dependencies = [ - "bit_field", - "flume", - "half 2.2.1", - "lebe", - "miniz_oxide 0.7.1", - "rayon-core", - "smallvec", - "zune-inflate", -======= name = "event-listener" version = "5.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2477,25 +2039,45 @@ checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" dependencies = [ "event-listener 5.3.1", "pin-project-lite", ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) +] + +[[package]] +name = "exr" +version = "1.72.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "887d93f60543e9a9362ef8a21beedd0a833c5d9610e18c67abe15a5963dcb1a4" +dependencies = [ + "bit_field", + "flume 0.11.0", + "half 2.4.1", + "lebe", + "miniz_oxide 0.7.4", + "rayon-core", + "smallvec", + "zune-inflate", ] [[package]] name = "fastrand" -version = "2.0.1" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] -<<<<<<< HEAD name = "fdeflate" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f9bfee30e4dedf0ab8b422f03af778d9612b63f502710fc500a334ebe2de645" +checksum = "d8090f921a24b04994d9929e204f50b498a33ea6ba559ffaa05e04f7ee7fb5ab" dependencies = [ "simd-adler32", ] +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + [[package]] name = "field-offset" version = "0.3.6" @@ -2503,25 +2085,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38e2275cc4e4fc009b0669731a1e5ab7ebf11f469eaede2bab9309a5b4d6057f" dependencies = [ "memoffset", - "rustc_version 0.4.1", + "rustc_version", ] -======= -name = "fiat-crypto" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) [[package]] name = "filetime" -version = "0.2.14" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d34cfa13a63ae058bfa601fe9e313bbdb3746427c1459185464ce0fcf62e1e8" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.2.10", - "winapi", + "libredox", + "windows-sys 0.59.0", ] [[package]] @@ -2538,13 +2114,11 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.33" +version = "1.0.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253" +checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" dependencies = [ "crc32fast", -<<<<<<< HEAD - "libz-sys", "miniz_oxide 0.8.0", ] @@ -2555,10 +2129,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17c704e9dbe1ddd863da1e6ff3567795087b1eb201ce80d8fa81162e1516500d" dependencies = [ "bitflags 1.3.2", -======= - "libc", - "miniz_oxide 0.3.7", ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) ] [[package]] @@ -2569,13 +2139,17 @@ checksum = "1657b4441c3403d9f7b3409e47575237dac27b1b5726df654a6ecbf92f0f7577" dependencies = [ "futures-core", "futures-sink", -<<<<<<< HEAD - "nanorand", - "pin-project 1.1.5", -======= "pin-project", ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) - "spin 0.9.4", + "spin 0.9.8", +] + +[[package]] +name = "flume" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" +dependencies = [ + "spin 0.9.8", ] [[package]] @@ -2584,6 +2158,12 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" + [[package]] name = "foreign-types" version = "0.5.0" @@ -2602,7 +2182,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.79", ] [[package]] @@ -2630,6 +2210,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + [[package]] name = "futf" version = "0.1.5" @@ -2642,9 +2228,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -2667,9 +2253,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -2677,15 +2263,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -2695,9 +2281,9 @@ dependencies = [ [[package]] name = "futures-intrusive" -version = "0.4.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62007592ac46aa7c2b6416f7deb9a8a8f63a01e0f1d6e1787d5630170db2b63e" +checksum = "a604f7a68fbf8103337523b1fadc8ade7361ee3f112f7c680ad179651616aed5" dependencies = [ "futures-core", "lock_api", @@ -2706,9 +2292,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-lite" @@ -2722,48 +2308,49 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.79", ] [[package]] name = "futures-rustls" -version = "0.24.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35bd3cf68c183738046838e300353e4716c674dc5e56890de4826801a6622a28" +checksum = "a8f2f12607f92c69b12ed746fabf9ca4f5c482cba46679c1a75b874ed7c26adb" dependencies = [ "futures-io", - "rustls 0.21.12", + "rustls 0.23.14", + "rustls-pki-types", ] [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-timer" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" +checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-channel", "futures-core", @@ -2887,9 +2474,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.4" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "serde", "typenum", @@ -2909,7 +2496,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0176e0459c2e4a1fe232f984bca6890e681076abb9934f6cea7c326f3fc47818" dependencies = [ "libc", - "windows-targets 0.48.0", + "windows-targets 0.48.5", ] [[package]] @@ -2925,22 +2512,20 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.11" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", - "js-sys", "libc", "wasi 0.11.0+wasi-snapshot-preview1", - "wasm-bindgen", ] [[package]] name = "ghash" -version = "0.4.1" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f6fb2a26dd2ebd268a68bc8e9acc9e67e487952f33384055a1cbe697514c64e" +checksum = "f0d8a4362ccb29cb0b265253fb0a2728f592895ee6854fd9bc13f2ffda266ff1" dependencies = [ "opaque-debug", "polyval", @@ -2958,9 +2543,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "gio" @@ -2976,7 +2561,7 @@ dependencies = [ "glib", "libc", "once_cell", - "pin-project-lite 0.2.13", + "pin-project-lite", "smallvec", "thiserror", ] @@ -3041,7 +2626,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.79", ] [[package]] @@ -3062,15 +2647,15 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "globset" -version = "0.4.10" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "029d74589adefde59de1a0c4f4732695c32805624aec7b68d91503d4dba79afc" +checksum = "15f1ce686646e7f1e19bf7d5533fe443a45dbfb990e00629110797578b42fb19" dependencies = [ - "aho-corasick 0.7.18", + "aho-corasick", "bstr", - "fnv", "log", - "regex", + "regex-automata 0.4.8", + "regex-syntax 0.8.5", ] [[package]] @@ -3129,11 +2714,11 @@ version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6063efb63db582968fb7df72e1ae68aa6360dcfb0a75143f34fc7d616bad75e" dependencies = [ - "proc-macro-crate 1.1.0", + "proc-macro-crate 1.3.1", "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.79", ] [[package]] @@ -3147,12 +2732,8 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "http 0.2.11", -<<<<<<< HEAD - "indexmap 1.9.3", -======= - "indexmap 2.1.0", ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) + "http 0.2.12", + "indexmap 2.6.0", "slab", "tokio", "tokio-util", @@ -3161,17 +2742,17 @@ dependencies = [ [[package]] name = "h2" -version = "0.4.3" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51ee2dd2e4f378392eeff5d51618cd9a63166a2513846bbc55f21cfacd9199d4" +checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" dependencies = [ + "atomic-waker", "bytes", "fnv", "futures-core", "futures-sink", - "futures-util", "http 1.1.0", - "indexmap 2.1.0", + "indexmap 2.6.0", "slab", "tokio", "tokio-util", @@ -3180,51 +2761,57 @@ dependencies = [ [[package]] name = "half" -version = "1.7.1" +version = "1.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62aca2aba2d62b4a7f5b33f3712cb1b0692779a56fb510499d5c0aa594daeaf3" +checksum = "1b43ede17f21864e81be2fa654110bf1e793774238d86ef8555c37e6519c0403" [[package]] name = "half" -version = "2.2.1" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02b4af3693f1b705df946e9fe5631932443781d0aabb423b62fcd4d73f6d2fd0" +checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" dependencies = [ + "cfg-if", "crunchy", ] [[package]] name = "hashbrown" -version = "0.11.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash 0.7.8", +] [[package]] name = "hashbrown" -version = "0.12.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ - "ahash 0.7.6", + "ahash 0.8.11", + "allocator-api2", ] [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" dependencies = [ - "ahash 0.8.11", "allocator-api2", + "equivalent", + "foldhash", ] [[package]] name = "hashlink" -version = "0.8.1" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69fe1fcf8b4278d860ad0548329f892a3631fb63f82574df68275f34cdbe0ffa" +checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" dependencies = [ - "hashbrown 0.12.3", + "hashbrown 0.14.5", ] [[package]] @@ -3239,9 +2826,9 @@ dependencies = [ [[package]] name = "heck" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cbf45460356b7deeb5e3415b5563308c0a9b057c85e12b06ad551f98d0a6ac" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" dependencies = [ "unicode-segmentation", ] @@ -3263,20 +2850,18 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" -version = "0.1.18" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" dependencies = [ "libc", ] [[package]] -<<<<<<< HEAD -======= name = "hermit-abi" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "379dada1584ad501b383485dd706b8afb7a70fcbc7f4da7d780638a5a6124a60" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hermit-abi" @@ -3285,7 +2870,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" [[package]] ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) name = "hex" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3304,19 +2888,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] -<<<<<<< HEAD -name = "hex_fmt" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b07f60793ff0a4d9cef0f18e63b5357e06209987153a64648c972c1e5aff336f" -======= name = "hickory-proto" version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07698b8420e2f0d6447a436ba999ec85d8fbf2a398bbd737b82cac4a2e96e512" dependencies = [ "async-trait", - "cfg-if 1.0.0", + "cfg-if", "data-encoding", "enum-as-inner", "futures-channel", @@ -3326,10 +2904,8 @@ dependencies = [ "ipnet", "once_cell", "rand 0.8.5", - "socket2", "thiserror", "tinyvec", - "tokio", "tracing", "url", ] @@ -3340,7 +2916,7 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28757f23aa75c98f254cf0405e6d8c25b831b32921b050a66692427679b1f243" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "futures-util", "hickory-proto", "ipconfig", @@ -3351,7 +2927,6 @@ dependencies = [ "resolv-conf", "smallvec", "thiserror", - "tokio", "tracing", ] @@ -3363,7 +2938,6 @@ checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" dependencies = [ "hmac 0.12.1", ] ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) [[package]] name = "hmac" @@ -3411,9 +2985,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ "bytes", "fnv", @@ -3438,15 +3012,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", - "http 0.2.11", - "pin-project-lite 0.2.13", + "http 0.2.12", + "pin-project-lite", ] [[package]] name = "http-body" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", "http 1.1.0", @@ -3454,14 +3028,14 @@ dependencies = [ [[package]] name = "http-body-util" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ "bytes", - "futures-core", + "futures-util", "http 1.1.0", - "http-body 1.0.0", + "http-body 1.0.1", "pin-project-lite", ] @@ -3473,9 +3047,9 @@ checksum = "add0ab9360ddbd88cfeb3bd9574a1d85cfdfa14db10b3e21d3700dbc4328758f" [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "httpdate" @@ -3485,28 +3059,22 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "0.14.28" +version = "0.14.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" dependencies = [ "bytes", "futures-channel", "futures-core", "futures-util", "h2 0.3.26", - "http 0.2.11", + "http 0.2.12", "http-body 0.4.6", "httparse", "httpdate", -<<<<<<< HEAD "itoa 1.0.11", - "pin-project-lite 0.2.13", - "socket2 0.5.5", -======= - "itoa", "pin-project-lite", "socket2", ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) "tokio", "tower-service", "tracing", @@ -3522,18 +3090,13 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2 0.4.3", + "h2 0.4.6", "http 1.1.0", - "http-body 1.0.0", + "http-body 1.0.1", "httparse", -<<<<<<< HEAD "httpdate", "itoa 1.0.11", - "pin-project-lite 0.2.13", -======= - "itoa", "pin-project-lite", ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) "smallvec", "tokio", "want", @@ -3541,20 +3104,20 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.27.2" +version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" +checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", "http 1.1.0", "hyper 1.4.1", "hyper-util", - "rustls 0.23.10", + "rustls 0.23.14", "rustls-pki-types", "tokio", "tokio-rustls 0.26.0", "tower-service", - "webpki-roots 0.26.1", + "webpki-roots 0.26.6", ] [[package]] @@ -3563,28 +3126,27 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" dependencies = [ - "hyper 0.14.28", - "pin-project-lite 0.2.13", + "hyper 0.14.30", + "pin-project-lite", "tokio", "tokio-io-timeout", ] [[package]] name = "hyper-util" -version = "0.1.3" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca38ef113da30126bbff9cd1705f9273e15d45498615d138b0c20279ac7a76aa" +checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b" dependencies = [ "bytes", "futures-channel", "futures-util", "http 1.1.0", - "http-body 1.0.0", + "http-body 1.0.1", "hyper 1.4.1", "pin-project-lite", "socket2", "tokio", - "tower", "tower-service", "tracing", ] @@ -3665,7 +3227,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6b0422c86d7ce0e97169cc42e04ae643caf278874a7a3c87b8150a220dc7e1e" dependencies = [ "async-io", - "core-foundation", + "core-foundation 0.9.4", "fnv", "futures", "if-addrs", @@ -3673,27 +3235,7 @@ dependencies = [ "log", "rtnetlink", "system-configuration", - "tokio", - "windows", -] - -[[package]] -name = "igd-next" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "064d90fec10d541084e7b39ead8875a5a80d9114a2b18791565253bae25f49e4" -dependencies = [ - "async-trait", - "attohttpc", - "bytes", - "futures", - "http 0.2.11", - "hyper 0.14.28", - "log", - "rand 0.8.5", - "tokio", - "url", - "xmltree", + "windows 0.51.1", ] [[package]] @@ -3716,12 +3258,12 @@ dependencies = [ [[package]] name = "image" -version = "0.25.0" +version = "0.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9b4f005360d32e9325029b38ba47ebd7a56f3316df09249368939562d518645" +checksum = "99314c8a2152b8ddb211f924cdae532d8c5e4c8bb54728e12fff1b0cd5963a10" dependencies = [ "bytemuck", - "byteorder", + "byteorder-lite", "num-traits", "png", "tiff", @@ -3740,12 +3282,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.1.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.15.0", "serde", ] @@ -3758,11 +3300,20 @@ dependencies = [ "cfb", ] +[[package]] +name = "inout" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +dependencies = [ + "generic-array", +] + [[package]] name = "instant" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ "cfg-if", ] @@ -3781,9 +3332,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.9.0" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" [[package]] name = "iri-string" @@ -3815,9 +3366,9 @@ dependencies = [ [[package]] name = "itertools" -version = "0.10.5" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" dependencies = [ "either", ] @@ -3908,15 +3459,14 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.67" +version = "0.3.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" +checksum = "0cb94a0ffd3f3ee755c20f7d8752f45cac88605a4dcf808abcff72873296ec7b" dependencies = [ "wasm-bindgen", ] [[package]] -<<<<<<< HEAD name = "json-patch" version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3947,16 +3497,6 @@ checksum = "1c6e529149475ca0b2820835d3dce8fcc41c6b943ca608d32f35b449255e4627" dependencies = [ "fluent-uri", "serde", -======= -name = "jsonrpc" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f8423b78fc94d12ef1a4a9d13c348c9a78766dda0cc18817adf0faf77e670c8" -dependencies = [ - "base64-compat", - "serde", - "serde_derive", ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) "serde_json", ] @@ -3984,9 +3524,9 @@ dependencies = [ [[package]] name = "jsonrpsee" -version = "0.16.2" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d291e3a5818a2384645fd9756362e6d89cf0541b0b916fa7702ea4a9833608e" +checksum = "367a292944c07385839818bb71c8d76611138e2dedb0677d035b8da21d29c78b" dependencies = [ "jsonrpsee-core", "jsonrpsee-server", @@ -3996,57 +3536,48 @@ dependencies = [ [[package]] name = "jsonrpsee-client-transport" -version = "0.16.2" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "965de52763f2004bc91ac5bcec504192440f0b568a5d621c59d9dbd6f886c3fb" +checksum = "c8b3815d9f5d5de348e5f162b316dc9cdf4548305ebb15b4eb9328e66cf27d7a" dependencies = [ "futures-util", - "http 0.2.11", + "http 0.2.12", "jsonrpsee-core", "jsonrpsee-types", -<<<<<<< HEAD - "pin-project 1.1.5", -======= "pin-project", ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) "rustls-native-certs 0.6.3", - "soketto", + "soketto 0.7.1", "thiserror", "tokio", - "tokio-rustls 0.23.1", + "tokio-rustls 0.24.1", "tokio-util", "tracing", - "webpki-roots 0.22.2", + "webpki-roots 0.25.4", ] [[package]] name = "jsonrpsee-core" -version = "0.16.2" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4e70b4439a751a5de7dd5ed55eacff78ebf4ffe0fc009cb1ebb11417f5b536b" +checksum = "2b5dde66c53d6dcdc8caea1874a45632ec0fcf5b437789f1e45766a1512ce803" dependencies = [ "anyhow", -<<<<<<< HEAD - "arrayvec 0.7.2", - "async-lock", -======= "arrayvec", - "async-lock 2.7.0", ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) + "async-lock 2.8.0", "async-trait", "beef", "futures-channel", "futures-timer", "futures-util", "globset", - "hyper 0.14.28", + "hyper 0.14.30", "jsonrpsee-types", "parking_lot 0.12.3", "rand 0.8.5", - "rustc-hash", + "rustc-hash 1.1.0", "serde", "serde_json", - "soketto", + "soketto 0.7.1", "thiserror", "tokio", "tracing", @@ -4054,19 +3585,19 @@ dependencies = [ [[package]] name = "jsonrpsee-server" -version = "0.16.2" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fb69dad85df79527c019659a992498d03f8495390496da2f07e6c24c2b356fc" +checksum = "cf4d945a6008c9b03db3354fb3c83ee02d2faa9f2e755ec1dfb69c3551b8f4ba" dependencies = [ "futures-channel", "futures-util", - "http 0.2.11", - "hyper 0.14.28", + "http 0.2.12", + "hyper 0.14.30", "jsonrpsee-core", "jsonrpsee-types", "serde", "serde_json", - "soketto", + "soketto 0.7.1", "tokio", "tokio-stream", "tokio-util", @@ -4076,9 +3607,9 @@ dependencies = [ [[package]] name = "jsonrpsee-types" -version = "0.16.2" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bd522fe1ce3702fd94812965d7bb7a3364b1c9aba743944c5a00529aae80f8c" +checksum = "245ba8e5aa633dd1c1e4fae72bce06e71f42d34c14a2767c6b4d173b57bee5e5" dependencies = [ "anyhow", "beef", @@ -4090,11 +3621,11 @@ dependencies = [ [[package]] name = "jsonrpsee-ws-client" -version = "0.16.2" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b83daeecfc6517cfe210df24e570fb06213533dfb990318fae781f4c7119dd9" +checksum = "4e1b3975ed5d73f456478681a417128597acd6a2487855fdb7b4a3d4d195bf5e" dependencies = [ - "http 0.2.11", + "http 0.2.12", "jsonrpsee-client-transport", "jsonrpsee-core", "jsonrpsee-types", @@ -4102,9 +3633,12 @@ dependencies = [ [[package]] name = "keccak" -version = "0.1.0" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] [[package]] name = "keccak-hash" @@ -4117,7 +3651,6 @@ dependencies = [ ] [[package]] -<<<<<<< HEAD name = "keyboard-types" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -4140,18 +3673,12 @@ dependencies = [ "matches", "selectors", ] -======= -name = "language-tags" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4345964bb142484797b161f473a503a434de77149dd8c7427788c6e13379388" ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "lebe" @@ -4185,9 +3712,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.153" +version = "0.2.159" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" [[package]] name = "libgit2-sys" @@ -4213,9 +3740,9 @@ dependencies = [ [[package]] name = "libm" -version = "0.2.6" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "libp2p" @@ -4227,38 +3754,24 @@ dependencies = [ "either", "futures", "futures-timer", - "getrandom 0.2.11", + "getrandom 0.2.15", "instant", "libp2p-allow-block-list", "libp2p-connection-limits", "libp2p-core", "libp2p-dns", - "libp2p-gossipsub", "libp2p-identify", -<<<<<<< HEAD - "libp2p-kad", -======= "libp2p-identity", - "libp2p-mdns", ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) "libp2p-metrics", "libp2p-noise", "libp2p-ping", - "libp2p-quic", "libp2p-rendezvous", "libp2p-request-response", "libp2p-swarm", "libp2p-tcp", - "libp2p-upnp", "libp2p-websocket", "libp2p-yamux", "multiaddr", -<<<<<<< HEAD - "parking_lot 0.11.2", - "pin-project 1.1.5", - "rand 0.7.3", - "smallvec", -======= "pin-project", "rw-stream-sink", "thiserror", @@ -4286,7 +3799,6 @@ dependencies = [ "libp2p-identity", "libp2p-swarm", "void", ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) ] [[package]] @@ -4303,24 +3815,12 @@ dependencies = [ "multiaddr", "multihash", "multistream-select", -<<<<<<< HEAD - "parking_lot 0.11.2", - "pin-project 1.1.5", - "prost 0.9.0", - "prost-build", - "rand 0.8.3", - "ring 0.16.20", - "rw-stream-sink", - "serde", - "sha2 0.10.8", -======= "once_cell", "parking_lot 0.12.3", "pin-project", "quick-protobuf", "rand 0.8.5", "rw-stream-sink", ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) "smallvec", "thiserror", "tracing", @@ -4345,41 +3845,11 @@ dependencies = [ "tracing", ] -[[package]] -name = "libp2p-gossipsub" -version = "0.35.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "385ae5f44e84f51e17014c9f1d98464121d3b1b182c167a0b4482d6250c61926" -dependencies = [ - "asynchronous-codec", - "base64 0.13.1", - "byteorder", - "bytes", - "fnv", - "futures", - "futures-timer", - "hex_fmt", - "instant", - "libp2p-core", - "libp2p-swarm", - "log", - "open-metrics-client", - "pin-project 1.1.5", - "prost 0.9.0", - "prost-build", - "rand 0.7.3", - "regex", - "serde", - "sha2 0.10.8", - "smallvec", - "unsigned-varint", -] - [[package]] name = "libp2p-identify" -version = "0.44.1" +version = "0.44.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20499a945d2f0221fdc6269b3848892c0f370d2ee3e19c7f65a29d8f860f6126" +checksum = "b5d635ebea5ca0c3c3e77d414ae9b67eccf2a822be06091b9c1a0d13029a1e2f" dependencies = [ "asynchronous-codec 0.7.0", "either", @@ -4390,13 +3860,8 @@ dependencies = [ "libp2p-identity", "libp2p-swarm", "lru", -<<<<<<< HEAD - "prost 0.9.0", - "prost-build", -======= "quick-protobuf", "quick-protobuf-codec 0.3.1", ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) "smallvec", "thiserror", "tracing", @@ -4421,56 +3886,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "libp2p-mdns" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49007d9a339b3e1d7eeebc4d67c05dbf23d300b7d091193ec2d3f26802d7faf2" -dependencies = [ - "data-encoding", - "futures", - "hickory-proto", - "if-watch", - "libp2p-core", - "libp2p-identity", - "libp2p-swarm", - "rand 0.8.5", - "smallvec", - "socket2", - "tokio", - "tracing", - "void", -] - -[[package]] -name = "libp2p-kad" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eeaa28a4c7a8c574874e090c2a731ecc7b81595911fee425b552c799a20abbb" -dependencies = [ - "arrayvec 0.5.2", - "asynchronous-codec", - "bytes", - "either", - "fnv", - "futures", - "futures-timer", - "instant", - "libp2p-core", - "libp2p-swarm", - "log", - "prost 0.9.0", - "prost-build", - "rand 0.7.3", - "serde", - "sha2 0.10.8", - "smallvec", - "thiserror", - "uint", - "unsigned-varint", - "void", -] - [[package]] name = "libp2p-metrics" version = "0.14.1" @@ -4499,19 +3914,12 @@ dependencies = [ "curve25519-dalek 4.1.3", "futures", "libp2p-core", -<<<<<<< HEAD - "log", - "prost 0.9.0", - "prost-build", - "rand 0.8.3", -======= "libp2p-identity", "multiaddr", "multihash", "once_cell", "quick-protobuf", "rand 0.8.5", ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) "sha2 0.10.8", "snow", "static_assertions", @@ -4523,9 +3931,9 @@ dependencies = [ [[package]] name = "libp2p-ping" -version = "0.44.0" +version = "0.44.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76b94ee41bd8c294194fe608851e45eb98de26fe79bc7913838cbffbfe8c7ce2" +checksum = "a1de5a6cf64fba7f7e8f2102711c9c6c043a8e56b86db8cd306492c517da3fb3" dependencies = [ "either", "futures", @@ -4539,30 +3947,6 @@ dependencies = [ "void", ] -[[package]] -name = "libp2p-quic" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0375cdfee57b47b313ef1f0fdb625b78aed770d33a40cf1c294a371ff5e6666" -dependencies = [ - "bytes", - "futures", - "futures-timer", - "if-watch", - "libp2p-core", - "libp2p-identity", - "libp2p-tls", - "parking_lot 0.12.3", - "quinn 0.10.2", - "rand 0.8.5", - "ring 0.16.20", - "rustls 0.21.12", - "socket2", - "thiserror", - "tokio", - "tracing", -] - [[package]] name = "libp2p-rendezvous" version = "0.14.0" @@ -4570,7 +3954,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "168a444a16f569771bcb48aa081a32724079156e64a730dd900276391ccb6385" dependencies = [ "async-trait", - "asynchronous-codec 0.6.0", + "asynchronous-codec 0.6.2", "bimap", "futures", "futures-timer", @@ -4579,17 +3963,9 @@ dependencies = [ "libp2p-identity", "libp2p-request-response", "libp2p-swarm", -<<<<<<< HEAD - "log", - "prost 0.9.0", - "prost-build", - "rand 0.8.3", - "sha2 0.10.8", -======= "quick-protobuf", "quick-protobuf-codec 0.2.0", "rand 0.8.5", ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) "thiserror", "tracing", "void", @@ -4597,9 +3973,9 @@ dependencies = [ [[package]] name = "libp2p-request-response" -version = "0.26.1" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e12823250fe0c45bdddea6eefa2be9a609aff1283ff4e1d8a294fdbb89572f6f" +checksum = "c314fe28368da5e3a262553fb0ad575c1c8934c461e10de10265551478163836" dependencies = [ "async-trait", "futures", @@ -4610,8 +3986,6 @@ dependencies = [ "libp2p-identity", "libp2p-swarm", "rand 0.8.5", - "serde", - "serde_json", "smallvec", "tracing", "void", @@ -4619,9 +3993,9 @@ dependencies = [ [[package]] name = "libp2p-swarm" -version = "0.44.1" +version = "0.44.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e92532fc3c4fb292ae30c371815c9b10103718777726ea5497abc268a4761866" +checksum = "80cae6cb75f89dbca53862f9ebe0b9f463aa7b302762fcfaafb9e51dcc9b0f7e" dependencies = [ "either", "fnv", @@ -4630,28 +4004,15 @@ dependencies = [ "instant", "libp2p-core", "libp2p-identity", - "libp2p-swarm-derive", + "lru", "multistream-select", "once_cell", "rand 0.8.5", "smallvec", - "tokio", "tracing", "void", ] -[[package]] -name = "libp2p-swarm-derive" -version = "0.34.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b644268b4acfdaa6a6100b31226ee7a36d96ab4c43287d113bfd2308607d8b6f" -dependencies = [ - "heck 0.4.1", - "proc-macro2", - "quote", - "syn 2.0.46", -] - [[package]] name = "libp2p-tcp" version = "0.41.0" @@ -4665,50 +4026,14 @@ dependencies = [ "libp2p-core", "libp2p-identity", "socket2", - "tokio", "tracing", ] -[[package]] -name = "libp2p-tls" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ce7e3c2e7569d685d08ec795157981722ff96e9e9f9eae75df3c29d02b07a5" -dependencies = [ - "futures", - "futures-rustls", - "libp2p-core", - "libp2p-identity", - "rcgen", - "ring 0.16.20", - "rustls 0.21.12", - "rustls-webpki 0.101.7", - "thiserror", - "x509-parser", - "yasna", -] - -[[package]] -name = "libp2p-upnp" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b49cc89949bf0e06869297cd4fe2c132358c23fe93e76ad43950453df4da3d35" -dependencies = [ - "futures", - "futures-timer", - "igd-next", - "libp2p-core", - "libp2p-swarm", - "tokio", - "tracing", - "void", -] - [[package]] name = "libp2p-websocket" -version = "0.43.0" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4846d51afd08180e164291c3754ba30dd4fbac6fac65571be56403c16431a5e" +checksum = "85b953b6803a1f3161a989538974d72511c4e48a4af355337b6fb90723c56c05" dependencies = [ "either", "futures", @@ -4718,7 +4043,8 @@ dependencies = [ "parking_lot 0.12.3", "pin-project-lite", "rw-stream-sink", - "soketto", + "soketto 0.8.0", + "thiserror", "tracing", "url", "webpki-roots 0.25.4", @@ -4739,6 +4065,17 @@ dependencies = [ "yamux 0.13.3", ] +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.6.0", + "libc", + "redox_syscall 0.5.7", +] + [[package]] name = "libsqlite3-sys" version = "0.24.2" @@ -4764,18 +4101,17 @@ dependencies = [ [[package]] name = "linked-hash-map" -version = "0.5.4" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.4.12" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] -<<<<<<< HEAD name = "local-ip-address" version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -4788,30 +4124,12 @@ dependencies = [ ] [[package]] -======= -name = "local-channel" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6cbc85e69b8df4b8bb8b89ec634e7189099cea8927a276b7384ce5488e53ec8" -dependencies = [ - "futures-core", - "futures-sink", - "local-waker", -] - -[[package]] -name = "local-waker" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d873d7c67ce09b42110d801813efbc9364414e356be9935700d368351657487" - -[[package]] ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) name = "lock_api" -version = "0.4.6" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88943dd7ef4a2e5a4bfa2753aaab3013e34ce2533d1996fb18ef591e315e2b3b" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ + "autocfg", "scopeguard", ] @@ -4823,11 +4141,11 @@ checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "lru" -version = "0.12.4" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ee39891760e7d94734f6f63fedc29a2e4a152f836120753a72503f09fcf904" +checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" dependencies = [ - "hashbrown 0.14.3", + "hashbrown 0.15.0", ] [[package]] @@ -4880,18 +4198,14 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" dependencies = [ - "regex-automata 0.1.9", + "regex-automata 0.1.10", ] [[package]] -name = "md-5" -version = "0.10.6" +name = "matches" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" -dependencies = [ - "cfg-if 1.0.0", - "digest 0.10.7", -] +checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" [[package]] name = "matchit" @@ -4916,9 +4230,9 @@ dependencies = [ [[package]] name = "mime" -version = "0.3.16" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "mime_guess" @@ -4932,15 +4246,15 @@ dependencies = [ [[package]] name = "minimal-lexical" -version = "0.1.3" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c835948974f68e0bd58636fc6c5b1fbff7b297e3046f11b3b3c18bbac012c6d" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniscript" -version = "9.0.2" +version = "9.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5b106477a0709e2da253e5559ba4ab20a272f8577f1eefff72f3a905b5d35f5" +checksum = "152791b5a02e0841b9ff1087396e1aba9f9caf81e8b96095be483734b265c094" dependencies = [ "bitcoin", "serde", @@ -4948,12 +4262,11 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", - "simd-adler32", ] [[package]] @@ -4963,18 +4276,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" dependencies = [ "adler2", + "simd-adler32", ] [[package]] name = "mio" -version = "0.8.10" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ + "hermit-abi 0.3.9", "libc", - "log", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -4988,7 +4302,7 @@ dependencies = [ "colored", "futures-util", "http 1.1.0", - "http-body 1.0.0", + "http-body 1.0.1", "http-body-util", "hyper 1.4.1", "hyper-util", @@ -5046,7 +4360,7 @@ name = "monero-rpc" version = "0.1.0" dependencies = [ "anyhow", - "curve25519-dalek 3.1.0", + "curve25519-dalek 3.2.0", "hex", "hex-literal 0.4.1", "jsonrpc_client", @@ -5066,7 +4380,7 @@ name = "monero-wallet" version = "0.1.0" dependencies = [ "anyhow", - "curve25519-dalek 3.1.0", + "curve25519-dalek 3.2.0", "monero", "monero-harness", "monero-rpc", @@ -5098,9 +4412,9 @@ dependencies = [ [[package]] name = "multiaddr" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b852bc02a2da5feed68cd14fa50d0774b92790a5bdbfa932a813926c8472070" +checksum = "fe6351f60b488e04c1d21bc69e56b89cb3f5e8f5d22557d6e8031bdfd79b6961" dependencies = [ "arrayref", "byteorder", @@ -5111,7 +4425,7 @@ dependencies = [ "percent-encoding", "serde", "static_assertions", - "unsigned-varint 0.7.1", + "unsigned-varint 0.8.0", "url", ] @@ -5132,17 +4446,8 @@ version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "076d548d76a0e2a0d4ab471d0b1c36c577786dfc4471242035d97a12a735c492" dependencies = [ -<<<<<<< HEAD - "digest 0.9.0", - "generic-array", - "multihash-derive", - "serde", - "sha2 0.9.8", - "unsigned-varint", -======= "core2", - "unsigned-varint 0.7.1", ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) + "unsigned-varint 0.7.2", ] [[package]] @@ -5154,13 +4459,64 @@ dependencies = [ "bytes", "futures", "log", -<<<<<<< HEAD - "pin-project 1.1.5", -======= "pin-project", ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) "smallvec", - "unsigned-varint 0.7.1", + "unsigned-varint 0.7.2", +] + +[[package]] +name = "ndk" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4" +dependencies = [ + "bitflags 2.6.0", + "jni-sys", + "log", + "ndk-sys", + "num_enum", + "raw-window-handle", + "thiserror", +] + +[[package]] +name = "ndk-context" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" + +[[package]] +name = "ndk-sys" +version = "0.6.0+11769913" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee6cda3051665f1fb8d9e08fc35c96d5a244fb1be711a03b71118828afc9a873" +dependencies = [ + "jni-sys", +] + +[[package]] +name = "neli" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1100229e06604150b3becd61a4965d5c70f3be1759544ea7274166f4be41ef43" +dependencies = [ + "byteorder", + "libc", + "log", + "neli-proc-macros", +] + +[[package]] +name = "neli-proc-macros" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c168194d373b1e134786274020dae7fc5513d565ea2ebb9bc9ff17ffb69106d4" +dependencies = [ + "either", + "proc-macro2", + "quote", + "serde", + "syn 1.0.109", ] [[package]] @@ -5220,88 +4576,11 @@ dependencies = [ name = "netlink-sys" version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "416060d346fbaf1f23f9512963e3e878f1a78e707cb699ba9215761754244307" -dependencies = [ - "bytes", - "futures", - "libc", - "log", - "tokio", -] - -[[package]] -name = "nix" -version = "0.24.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" -dependencies = [ - "bitflags 1.3.2", - "cfg-if 1.0.0", - "libc", -] - -[[package]] -name = "nanorand" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" -dependencies = [ - "getrandom 0.2.11", -] - -[[package]] -name = "ndk" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4" -dependencies = [ - "bitflags 2.6.0", - "jni-sys", - "log", - "ndk-sys", - "num_enum", - "raw-window-handle", - "thiserror", -] - -[[package]] -name = "ndk-context" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" - -[[package]] -name = "ndk-sys" -version = "0.6.0+11769913" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee6cda3051665f1fb8d9e08fc35c96d5a244fb1be711a03b71118828afc9a873" -dependencies = [ - "jni-sys", -] - -[[package]] -name = "neli" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1100229e06604150b3becd61a4965d5c70f3be1759544ea7274166f4be41ef43" -dependencies = [ - "byteorder", - "libc", - "log", - "neli-proc-macros", -] - -[[package]] -name = "neli-proc-macros" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c168194d373b1e134786274020dae7fc5513d565ea2ebb9bc9ff17ffb69106d4" +checksum = "416060d346fbaf1f23f9512963e3e878f1a78e707cb699ba9215761754244307" dependencies = [ - "either", - "proc-macro2", - "quote", - "serde", - "syn 1.0.109", + "bytes", + "libc", + "log", ] [[package]] @@ -5310,6 +4589,17 @@ version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" +[[package]] +name = "nix" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" +dependencies = [ + "bitflags 1.3.2", + "cfg-if", + "libc", +] + [[package]] name = "nodrop" version = "0.1.14" @@ -5324,13 +4614,12 @@ checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" [[package]] name = "nom" -version = "7.0.0" +version = "7.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffd9d26838a953b4af82cbeb9f1592c6798916983959be223a7124e992742c1" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" dependencies = [ "memchr", "minimal-lexical", - "version_check", ] [[package]] @@ -5343,17 +4632,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "num-bigint" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - [[package]] name = "num-conv" version = "0.1.0" @@ -5362,9 +4640,9 @@ checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", "libm", @@ -5372,11 +4650,11 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.14.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.9", "libc", ] @@ -5398,14 +4676,14 @@ dependencies = [ "proc-macro-crate 2.0.2", "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.79", ] [[package]] name = "num_threads" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" +checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" dependencies = [ "libc", ] @@ -5539,36 +4817,26 @@ dependencies = [ [[package]] name = "object" -version = "0.32.1" +version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ "memchr", ] -[[package]] -name = "oid-registry" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bedf36ffb6ba96c2eb7144ef6270557b52e54b20c0a8e1eb2ff99a6c6959bff" -dependencies = [ - "asn1-rs", -] - [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "opaque-debug" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] -<<<<<<< HEAD name = "open" version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -5580,35 +4848,10 @@ dependencies = [ ] [[package]] -name = "open-metrics-client" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f85842b073145726190373213c63f852020fb884c841a3a1f390637267a2fb8c" -dependencies = [ - "dtoa", - "itoa 1.0.11", - "open-metrics-client-derive-text-encode", - "owning_ref", -] - -[[package]] -name = "open-metrics-client-derive-text-encode" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a15c83b586f00268c619c1cb3340ec1a6f59dd9ba1d9833a273a68e6d5cd8ffc" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -======= ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) name = "openssl-probe" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28988d872ab76095a6e6ac88d99b54fd267702734fd7ffe610ca27f533ddb95a" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "option-ext" @@ -5632,12 +4875,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" -[[package]] -name = "parking" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" - [[package]] name = "pango" version = "0.18.3" @@ -5663,6 +4900,12 @@ dependencies = [ "system-deps", ] +[[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.11.2" @@ -5671,7 +4914,7 @@ checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" dependencies = [ "instant", "lock_api", - "parking_lot_core 0.8.5", + "parking_lot_core 0.8.6", ] [[package]] @@ -5681,41 +4924,41 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", - "parking_lot_core 0.9.1", + "parking_lot_core 0.9.10", ] [[package]] name = "parking_lot_core" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" +checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" dependencies = [ "cfg-if", "instant", "libc", - "redox_syscall 0.2.10", + "redox_syscall 0.2.16", "smallvec", "winapi", ] [[package]] name = "parking_lot_core" -version = "0.9.1" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28141e0cc4143da2443301914478dc976a61ffdb3f043058310c70df2fed8954" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.2.10", + "redox_syscall 0.5.7", "smallvec", - "windows-sys 0.32.0", + "windows-targets 0.52.6", ] [[package]] name = "paste" -version = "1.0.9" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pathdiff" @@ -5751,7 +4994,6 @@ dependencies = [ ] [[package]] -<<<<<<< HEAD name = "pest_derive" version = "2.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -5771,7 +5013,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.79", ] [[package]] @@ -5785,16 +5027,6 @@ dependencies = [ "sha2 0.10.8", ] -[[package]] -name = "petgraph" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a13a2fa9d0b63e5f22328828741e523766fff0ee9e779316902290dff3f824f" -dependencies = [ - "fixedbitset", - "indexmap 1.9.3", -] - [[package]] name = "phf" version = "0.8.0" @@ -5862,7 +5094,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6" dependencies = [ "phf_shared 0.10.0", - "rand 0.8.3", + "rand 0.8.5", ] [[package]] @@ -5872,7 +5104,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" dependencies = [ "phf_shared 0.11.2", - "rand 0.8.3", + "rand 0.8.5", ] [[package]] @@ -5899,7 +5131,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.79", ] [[package]] @@ -5929,66 +5161,31 @@ dependencies = [ "siphasher", ] -[[package]] -======= ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) -name = "pin-project" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" -dependencies = [ -<<<<<<< HEAD - "pin-project-internal 0.4.30", -] - [[package]] name = "pin-project" -version = "1.1.5" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +checksum = "baf123a161dde1e524adf36f90bc5d8d3462824a9c43553ad07a8183161189ec" dependencies = [ - "pin-project-internal 1.1.5", -======= "pin-project-internal", ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) -] - -[[package]] -name = "pin-project-internal" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.46", ] [[package]] -<<<<<<< HEAD name = "pin-project-internal" -version = "1.1.5" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +checksum = "a4502d8515ca9f32f1fb543d987f63d95a14934883db45bdb48060b6b69257f8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.79", ] [[package]] name = "pin-project-lite" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" - -[[package]] -======= ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) -name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -6019,7 +5216,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42cf17e9a1800f5f396bc67d193dc9411b59012a5876445ef450d449881e1016" dependencies = [ "base64 0.22.1", - "indexmap 2.1.0", + "indexmap 2.6.0", "quick-xml", "serde", "time 0.3.36", @@ -6027,50 +5224,51 @@ dependencies = [ [[package]] name = "png" -version = "0.17.13" +version = "0.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06e4b0d3d1312775e782c86c91a111aa1f910cbb65e1337f9975b5f9a554b5e1" +checksum = "52f9d46a34a05a6a57566bc2bfae066ef07585a6e3fa30fbbdff5936380623f0" dependencies = [ "bitflags 1.3.2", "crc32fast", "fdeflate", "flate2", - "miniz_oxide 0.7.1", + "miniz_oxide 0.8.0", ] [[package]] name = "polling" -version = "3.7.2" +version = "3.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3ed00ed3fbf728b5816498ecd316d1716eecaced9c0c8d2c5a6740ca214985b" +checksum = "cc2790cd301dec6cd3b7a025e4815cf825724a51c98dccfe6a3e55f05ffb6511" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "concurrent-queue", "hermit-abi 0.4.0", "pin-project-lite", "rustix", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "poly1305" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fe800695325da85083cd23b56826fccb2e2dc29b218e7811a6f33bc93f414be" +checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" dependencies = [ - "cpufeatures 0.1.4", + "cpufeatures", "opaque-debug", "universal-hash", ] [[package]] name = "polyval" -version = "0.5.0" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "864231b0b86ce05168a8e6da0fea2e67275dacf25f75b00a62cfd341aab904a9" +checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25" dependencies = [ - "cpufeatures 0.1.4", + "cfg-if", + "cpufeatures", "opaque-debug", "universal-hash", ] @@ -6095,9 +5293,12 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.10" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] [[package]] name = "precomputed-hash" @@ -6107,9 +5308,9 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" [[package]] name = "primitive-types" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2415937401cb030a2a0a4d922483f945fa068f52a7dbb22ce0fe5f2b6f6adace" +checksum = "06345ee39fbccfb06ab45f3a1a5798d9dafa04cb8921a76d227040003a234b0e" dependencies = [ "fixed-hash", "uint", @@ -6117,22 +5318,12 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" -dependencies = [ - "toml 0.5.11", -] - -[[package]] -<<<<<<< HEAD -name = "proc-macro-crate" -version = "1.1.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ebace6889caf889b4d3f76becee12e90353f2b8c7d875534a71e5742f8f6f83" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ - "thiserror", - "toml 0.5.11", + "once_cell", + "toml_edit 0.19.15", ] [[package]] @@ -6146,8 +5337,6 @@ dependencies = [ ] [[package]] -======= ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) name = "proc-macro-error" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -6179,9 +5368,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.74" +version = "1.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2de98502f212cfcea8d0bb305bd0f49d7ebdd75b64ba0a68f937d888f4e0d6db" +checksum = "b3e4daa0dcf6feba26f985457cdf104d4b4256fc5a09547140f3631bb076b19a" dependencies = [ "unicode-ident", ] @@ -6193,7 +5382,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "504ee9ff529add891127c4827eb481bd69dc0ebc72e9a682e187db4caa60c3ca" dependencies = [ "dtoa", - "itoa", + "itoa 1.0.11", "parking_lot 0.12.3", "prometheus-client-derive-encode", ] @@ -6206,7 +5395,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.79", ] [[package]] @@ -6223,23 +5412,12 @@ dependencies = [ "rand 0.8.5", "rand_chacha 0.3.1", "rand_xorshift", - "regex-syntax 0.8.2", + "regex-syntax 0.8.5", "rusty-fork", "tempfile", "unarray", ] -[[package]] -<<<<<<< HEAD -name = "prost" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "444879275cb4fd84958b1a1d5420d15e6fcf7c235fe47f053c9c2a80aceb6001" -dependencies = [ - "bytes", - "prost-derive 0.9.0", -] - [[package]] name = "prost" version = "0.12.6" @@ -6247,40 +5425,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" dependencies = [ "bytes", - "prost-derive 0.12.6", -] - -[[package]] -name = "prost-build" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62941722fb675d463659e49c4f3fe1fe792ff24fe5bbaa9c08cd3b98a1c354f5" -dependencies = [ - "bytes", - "heck 0.3.2", - "itertools 0.10.5", - "lazy_static", - "log", - "multimap", - "petgraph", - "prost 0.9.0", - "prost-types 0.9.0", - "regex", - "tempfile", - "which", -] - -[[package]] -name = "prost-derive" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9cc1a3263e07e0bf68e96268f37665207b49560d98739662cdfaae215c720fe" -dependencies = [ - "anyhow", - "itertools 0.10.5", - "proc-macro2", - "quote", - "syn 1.0.109", + "prost-derive", ] [[package]] @@ -6290,20 +5435,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" dependencies = [ "anyhow", - "itertools 0.10.5", + "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.46", -] - -[[package]] -name = "prost-types" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534b7a0e836e3c482d2693070f982e39e7611da9695d4d1f5a4b186b51faef0a" -dependencies = [ - "bytes", - "prost 0.9.0", + "syn 2.0.79", ] [[package]] @@ -6312,12 +5447,10 @@ version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" dependencies = [ - "prost 0.12.6", + "prost", ] [[package]] -======= ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) name = "ptr_meta" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -6352,7 +5485,7 @@ version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d68782463e408eb1e668cf6152704bd856c78c5b6417adaee3203d8f4c1fc9ec" dependencies = [ - "image 0.25.0", + "image 0.25.2", ] [[package]] @@ -6362,22 +5495,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] -<<<<<<< HEAD -name = "quick-xml" -version = "0.32.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d3a6e5838b60e0e8fa7a43f22ade549a37d61f8bdbe636d0d7816191de969c2" -dependencies = [ - "memchr", -] - -[[package]] -name = "quicksink" -version = "0.1.2" -======= name = "quick-protobuf" version = "0.8.1" ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d6da84cc204722a989e01ba2f6e1e276e190f22263d0cb6ce8526fcdb0d2e1f" dependencies = [ @@ -6390,11 +5509,11 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8ededb1cd78531627244d51dd0c7139fbe736c7d57af0092a76f0ffb2f56e98" dependencies = [ - "asynchronous-codec 0.6.0", + "asynchronous-codec 0.6.2", "bytes", "quick-protobuf", "thiserror", - "unsigned-varint 0.7.1", + "unsigned-varint 0.7.2", ] [[package]] @@ -6411,35 +5530,27 @@ dependencies = [ ] [[package]] -name = "quinn" -version = "0.10.2" +name = "quick-xml" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cc2c5017e4b43d5995dcea317bc46c1e09404c0a9664d2908f7f02dfe943d75" +checksum = "1d3a6e5838b60e0e8fa7a43f22ade549a37d61f8bdbe636d0d7816191de969c2" dependencies = [ - "bytes", - "futures-io", - "pin-project-lite", - "quinn-proto 0.10.6", - "quinn-udp 0.4.1", - "rustc-hash", - "rustls 0.21.12", - "thiserror", - "tokio", - "tracing", + "memchr", ] [[package]] name = "quinn" -version = "0.11.2" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4ceeeeabace7857413798eb1ffa1e9c905a9946a57d81fb69b4b71c4d8eb3ad" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" dependencies = [ "bytes", "pin-project-lite", - "quinn-proto 0.11.3", - "quinn-udp 0.5.2", - "rustc-hash", - "rustls 0.23.10", + "quinn-proto", + "quinn-udp", + "rustc-hash 2.0.0", + "rustls 0.23.14", + "socket2", "thiserror", "tokio", "tracing", @@ -6447,32 +5558,15 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "141bf7dfde2fbc246bfd3fe12f2455aa24b0fbd9af535d8c86c7bd1381ff2b1a" -dependencies = [ - "bytes", - "rand 0.8.5", - "ring 0.16.20", - "rustc-hash", - "rustls 0.21.12", - "slab", - "thiserror", - "tinyvec", - "tracing", -] - -[[package]] -name = "quinn-proto" -version = "0.11.3" +version = "0.11.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddf517c03a109db8100448a4be38d498df8a210a99fe0e1b9eaf39e78c640efe" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" dependencies = [ "bytes", "rand 0.8.5", - "ring 0.17.3", - "rustc-hash", - "rustls 0.23.10", + "ring 0.17.8", + "rustc-hash 2.0.0", + "rustls 0.23.14", "slab", "thiserror", "tinyvec", @@ -6481,39 +5575,32 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "055b4e778e8feb9f93c4e439f71dc2156ef13360b432b799e179a8c4cdf0b1d7" -dependencies = [ - "bytes", - "libc", - "socket2", - "tracing", - "windows-sys 0.48.0", -] - -[[package]] -name = "quinn-udp" -version = "0.5.2" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9096629c45860fc7fb143e125eb826b5e721e10be3263160c7d60ca832cf8c46" +checksum = "4fe68c2e9e1a1234e218683dbdf9f9dfcb094113c5ac2b938dfcb9bab4c4140b" dependencies = [ "libc", "once_cell", "socket2", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "quote" -version = "1.0.35" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + [[package]] name = "rand" version = "0.7.3" @@ -6524,12 +5611,8 @@ dependencies = [ "libc", "rand_chacha 0.2.2", "rand_core 0.5.1", -<<<<<<< HEAD - "rand_hc 0.2.0", - "rand_pcg", -======= "rand_hc", ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) + "rand_pcg", ] [[package]] @@ -6578,7 +5661,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", ] [[package]] @@ -6590,16 +5673,6 @@ dependencies = [ "rand_core 0.5.1", ] -[[package]] -<<<<<<< HEAD -name = "rand_hc" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73" -dependencies = [ - "rand_core 0.6.2", -] - [[package]] name = "rand_pcg" version = "0.2.1" @@ -6610,8 +5683,6 @@ dependencies = [ ] [[package]] -======= ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) name = "rand_xorshift" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -6620,18 +5691,6 @@ dependencies = [ "rand_core 0.6.4", ] -[[package]] -name = "rcgen" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52c4f3084aa3bc7dfbba4eff4fab2a54db4324965d8872ab933565e6fbd83bc6" -dependencies = [ - "pem", - "ring 0.16.20", - "time 0.3.36", - "yasna", -] - [[package]] name = "raw-window-handle" version = "0.6.2" @@ -6660,9 +5719,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.10" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ "bitflags 1.3.2", ] @@ -6678,70 +5737,55 @@ dependencies = [ [[package]] name = "redox_syscall" -<<<<<<< HEAD -version = "0.5.4" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0884ad60e090bf1345b93da0a5de8923c93884cd03f40dfcfddd3b4bee661853" +checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ "bitflags 2.6.0", -======= -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) ] [[package]] name = "redox_users" -version = "0.4.0" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ - "getrandom 0.2.11", - "redox_syscall 0.2.10", + "getrandom 0.2.15", + "libredox", + "thiserror", ] [[package]] name = "regex" -version = "1.10.6" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" +checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" dependencies = [ - "aho-corasick 1.1.3", + "aho-corasick", "memchr", - "regex-automata 0.4.7", - "regex-syntax 0.8.2", + "regex-automata 0.4.8", + "regex-syntax 0.8.5", ] [[package]] name = "regex-automata" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1ded71d66a4a97f5e961fd0cb25a5f366a42a41570d16a763a69c092c26ae4" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" dependencies = [ - "byteorder", "regex-syntax 0.6.29", ] [[package]] -<<<<<<< HEAD name = "regex-automata" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" dependencies = [ - "aho-corasick 1.1.3", + "aho-corasick", "memchr", - "regex-syntax 0.8.2", + "regex-syntax 0.8.5", ] -======= -name = "regex-lite" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53a49587ad06b26609c52e423de037e7f57f20d53535d66e08c695f347df952a" ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) [[package]] name = "regex-syntax" @@ -6751,32 +5795,32 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "rend" -version = "0.3.6" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79af64b4b6362ffba04eef3a4e10829718a4896dac19daa741851c86781edf95" +checksum = "71fe3824f5629716b1589be05dacd749f6aa084c87e00e016714a8cdfccc997c" dependencies = [ "bytecheck", ] [[package]] name = "reqwest" -version = "0.12.7" +version = "0.12.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" +checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ "base64 0.22.1", "bytes", "futures-core", "futures-util", - "h2 0.4.3", + "h2 0.4.6", "http 1.1.0", - "http-body 1.0.0", + "http-body 1.0.1", "http-body-util", "hyper 1.4.1", "hyper-rustls", @@ -6788,9 +5832,9 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "quinn 0.11.2", - "rustls 0.23.10", - "rustls-pemfile 2.1.2", + "quinn", + "rustls 0.23.14", + "rustls-pemfile 2.2.0", "rustls-pki-types", "serde", "serde_json", @@ -6806,7 +5850,7 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams", "web-sys", - "webpki-roots 0.26.1", + "webpki-roots 0.26.6", "windows-registry", ] @@ -6837,16 +5881,17 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.3" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9babe80d5c16becf6594aa32ad2be8fe08498e7ae60b77de8df700e67f191d7e" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", - "getrandom 0.2.11", + "cfg-if", + "getrandom 0.2.15", "libc", - "spin 0.9.4", + "spin 0.9.8", "untrusted 0.9.0", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -6861,23 +5906,27 @@ dependencies = [ [[package]] name = "rkyv" -version = "0.7.39" +version = "0.7.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cec2b3485b07d96ddfd3134767b8a447b45ea4eb91448d0a35180ec0ffd5ed15" +checksum = "9008cd6385b9e161d8229e1f6549dd23c3d022f132a2ea37ac3a10ac4935779b" dependencies = [ + "bitvec", "bytecheck", + "bytes", "hashbrown 0.12.3", "ptr_meta", "rend", "rkyv_derive", "seahash", + "tinyvec", + "uuid", ] [[package]] name = "rkyv_derive" -version = "0.7.39" +version = "0.7.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6eaedadc88b53e36dd32d940ed21ae4d850d5916f2581526921f553a72ac34c4" +checksum = "503d1d27590a2b0a3a4ca4c94755aa2875657196ecbf401a42eff41d7de532c0" dependencies = [ "proc-macro2", "quote", @@ -6896,19 +5945,16 @@ dependencies = [ "netlink-proto", "nix", "thiserror", - "tokio", ] [[package]] name = "rust_decimal" -version = "1.30.0" +version = "1.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0446843641c69436765a35a5a77088e28c2e6a12da93e84aa3ab1cd4aa5a042" +checksum = "b082d80e3e3cc52b2ed634388d436fe1f4de6af5786cc2de9ba9737527bdf555" dependencies = [ - "arrayvec 0.7.2", + "arrayvec", "borsh", - "bytecheck", - "byteorder", "bytes", "num-traits", "rand 0.8.5", @@ -6919,9 +5965,9 @@ dependencies = [ [[package]] name = "rust_decimal_macros" -version = "1.30.0" +version = "1.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ca5c398d85f83b9a44de754a2048625a8c5eafcf070da7b8f116b685e2f6608" +checksum = "da991f231869f34268415a49724c6578e740ad697ba0999199d6f22b3949332c" dependencies = [ "quote", "rust_decimal", @@ -6929,9 +5975,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" @@ -6940,51 +5986,31 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] -name = "rustc-hex" -version = "2.1.0" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] -name = "rustc_version" -version = "0.3.3" +name = "rustc-hex" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" -dependencies = [ - "semver 0.11.0", -] +checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" [[package]] name = "rustc_version" -<<<<<<< HEAD version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver 1.0.23", -======= -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver 1.0.23", -] - -[[package]] -name = "rusticata-macros" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632" -dependencies = [ - "nom", ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) + "semver", ] [[package]] name = "rustix" -version = "0.38.31" +version = "0.38.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" +checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" dependencies = [ "bitflags 2.6.0", "errno", @@ -6995,27 +6021,27 @@ dependencies = [ [[package]] name = "rustls" -version = "0.19.0" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "064fd21ff87c6e87ed4506e68beb42459caa4a0e2eb144932e6776768556980b" +checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" dependencies = [ "base64 0.13.1", "log", "ring 0.16.20", - "sct 0.6.0", + "sct 0.6.1", "webpki 0.21.4", ] [[package]] name = "rustls" -version = "0.20.2" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d37e5e2290f3e040b594b1a9e04377c2c671f1a1cfd9bfdef82106ac1c113f84" +checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" dependencies = [ "log", "ring 0.16.20", - "sct 0.7.0", - "webpki 0.22.0", + "sct 0.7.1", + "webpki 0.22.4", ] [[package]] @@ -7025,21 +6051,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", - "ring 0.17.3", + "ring 0.17.8", "rustls-webpki 0.101.7", - "sct 0.7.0", + "sct 0.7.1", ] [[package]] name = "rustls" -version = "0.23.10" +version = "0.23.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05cff451f60db80f490f3c182b77c35260baace73209e9cdbbe526bfe3a4d402" +checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ "once_cell", - "ring 0.17.3", + "ring 0.17.8", "rustls-pki-types", - "rustls-webpki 0.102.4", + "rustls-webpki 0.102.8", "subtle", "zeroize", ] @@ -7051,7 +6077,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a07b7c1885bd8ed3831c289b7870b13ef46fe0e856d288c30d9cc17d75a2092" dependencies = [ "openssl-probe", - "rustls 0.19.0", + "rustls 0.19.1", "schannel", "security-framework", ] @@ -7063,35 +6089,34 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", - "rustls-pemfile 1.0.0", + "rustls-pemfile 1.0.4", "schannel", "security-framework", ] [[package]] name = "rustls-pemfile" -version = "1.0.0" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7522c9de787ff061458fe9a829dc790a3f5b22dc571694fc5883f448b94d9a9" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ - "base64 0.13.1", + "base64 0.21.7", ] [[package]] name = "rustls-pemfile" -version = "2.1.2" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" dependencies = [ - "base64 0.22.1", "rustls-pki-types", ] [[package]] name = "rustls-pki-types" -version = "1.7.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" +checksum = "0e696e35370c65c9c541198af4543ccd580cf17fc25d8e05c5a242b202488c55" [[package]] name = "rustls-webpki" @@ -7099,26 +6124,26 @@ version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring 0.17.3", + "ring 0.17.8", "untrusted 0.9.0", ] [[package]] name = "rustls-webpki" -version = "0.102.4" +version = "0.102.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" dependencies = [ - "ring 0.17.3", + "ring 0.17.8", "rustls-pki-types", "untrusted 0.9.0", ] [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "rusty-fork" @@ -7145,9 +6170,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.5" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "same-file" @@ -7160,21 +6185,20 @@ dependencies = [ [[package]] name = "scc" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76ad2bbb0ae5100a07b7a6f2ed7ab5fd0045551a4c507989b7a620046ea3efdc" +checksum = "836f1e0f4963ef5288b539b643b35e043e76a32d0f4e47e67febf69576527f50" dependencies = [ "sdd", ] [[package]] name = "schannel" -version = "0.1.19" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" +checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" dependencies = [ - "lazy_static", - "winapi", + "windows-sys 0.59.0", ] [[package]] @@ -7201,7 +6225,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.46", + "syn 2.0.79", ] [[package]] @@ -7212,9 +6236,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sct" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3042af939fca8c3453b7af0f1c66e533a15a86169e39de2657310ade8f98d3c" +checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" dependencies = [ "ring 0.16.20", "untrusted 0.7.1", @@ -7222,19 +6246,19 @@ dependencies = [ [[package]] name = "sct" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring 0.16.20", - "untrusted 0.7.1", + "ring 0.17.8", + "untrusted 0.9.0", ] [[package]] name = "sdd" -version = "0.2.0" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b84345e4c9bd703274a082fb80caaa99b7612be48dfaa1dd9266577ec412309d" +checksum = "60a7b59a5d9b0099720b417b6325d91a52cbf5b3dcb5041d864be53eefa58abc" [[package]] name = "seahash" @@ -7244,9 +6268,9 @@ checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" [[package]] name = "secp256k1" -version = "0.24.1" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff55dc09d460954e9ef2fa8a7ced735a964be9981fd50e870b2b3b0705e14964" +checksum = "6b1629c9c557ef9b293568b338dddfc8208c98a18c59d722a9d53f859d9c9b62" dependencies = [ "bitcoin_hashes", "rand 0.8.5", @@ -7329,11 +6353,11 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.3.1" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23a2ac85147a3a11d77ecf1bc7166ec0b92febfa4461c37944e180f319ece467" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", "core-foundation 0.9.4", "core-foundation-sys", "libc", @@ -7342,9 +6366,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.3.0" +version = "2.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e4effb91b4b8b6fb7732e670b6cee160278ff8e6bf485c7805d9e319d76e284" +checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" dependencies = [ "core-foundation-sys", "libc", @@ -7370,35 +6394,14 @@ dependencies = [ "thin-slice", ] -[[package]] -name = "semver" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" -dependencies = [ - "semver-parser", -] - [[package]] name = "semver" version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" -<<<<<<< HEAD dependencies = [ "serde", ] -======= ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) - -[[package]] -name = "semver-parser" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" -dependencies = [ - "pest", -] [[package]] name = "sequential-macro" @@ -7417,21 +6420,20 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.208" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff085d2cb684faa248efb494c39b68e522822ac0de72ccf08109abde717cfb2" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" dependencies = [ "serde_derive", ] [[package]] name = "serde-big-array" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18b20e7752957bbe9661cff4e0bb04d183d0948cdab2ea58cdb9df36a61dfe62" +checksum = "cd31f59f6fe2b0c055371bb2f16d7f0aa7d8881676c04a55b1596d1a17cd10a4" dependencies = [ "serde", - "serde_derive", ] [[package]] @@ -7451,19 +6453,19 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" dependencies = [ - "half 1.7.1", + "half 1.8.3", "serde", ] [[package]] name = "serde_derive" -version = "1.0.208" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.79", ] [[package]] @@ -7474,14 +6476,14 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.79", ] [[package]] name = "serde_json" -version = "1.0.124" +version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66ad62847a56b3dba58cc891acd13884b9c61138d330c0d7b6181713d4fce38d" +checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" dependencies = [ "itoa 1.0.11", "memchr", @@ -7497,14 +6499,14 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.79", ] [[package]] name = "serde_spanned" -version = "0.6.7" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" dependencies = [ "serde", ] @@ -7533,19 +6535,19 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.9.0" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cecfa94848272156ea67b2b1a53f20fc7bc638c4a46d2f8abde08f05f4b857" +checksum = "8e28bdad6db2b8340e449f7108f020b3b092e8583a9e3fb82713e1d4e71fe817" dependencies = [ "base64 0.22.1", "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.1.0", + "indexmap 2.6.0", "serde", "serde_derive", "serde_json", - "serde_with_macros 3.9.0", + "serde_with_macros 3.11.0", "time 0.3.36", ] @@ -7563,14 +6565,14 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.9.0" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8fee4991ef4f274617a51ad4af30519438dacb2f56ac773b08a1922ff743350" +checksum = "9d846214a9854ef724f3da161b426242d8de7c1fc7de2f89bb1efcb154dca79d" dependencies = [ "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.79", ] [[package]] @@ -7595,7 +6597,7 @@ checksum = "82fe9db325bcef1fbcde82e078a5cc4efdf787e96b3b9cf45b50b529f2083d67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.79", ] [[package]] @@ -7632,13 +6634,13 @@ dependencies = [ [[package]] name = "sha-1" -version = "0.9.4" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfebf75d25bd900fd1e7d11501efab59bc846dbc76196839663e6637bba9f25f" +checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" dependencies = [ "block-buffer 0.9.0", "cfg-if", - "cpuid-bool", + "cpufeatures", "digest 0.9.0", "opaque-debug", ] @@ -7649,25 +6651,20 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ - "cfg-if 1.0.0", - "cpufeatures 0.2.12", + "cfg-if", + "cpufeatures", "digest 0.10.7", ] [[package]] name = "sha2" -version = "0.9.8" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b69f9a4c9740d74c5baa3fd2e547f9525fa8088a8a958e0ca2409a514e33f5fa" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" dependencies = [ "block-buffer 0.9.0", -<<<<<<< HEAD "cfg-if", - "cpufeatures 0.2.1", -======= - "cfg-if 1.0.0", - "cpufeatures 0.2.12", ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) + "cpufeatures", "digest 0.9.0", "opaque-debug", ] @@ -7678,13 +6675,8 @@ version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ -<<<<<<< HEAD "cfg-if", - "cpufeatures 0.2.1", -======= - "cfg-if 1.0.0", - "cpufeatures 0.2.12", ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) + "cpufeatures", "digest 0.10.7", ] @@ -7747,26 +6739,20 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.0" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] [[package]] name = "signature" -version = "1.3.0" +version = "1.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f0242b8e50dd9accdd56170e94ca1ebd223b098eb9c83539a6e367d0f36ae68" +checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" [[package]] -<<<<<<< HEAD -name = "simd-adler32" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" -======= name = "signature" version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -7774,13 +6760,24 @@ checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ "rand_core 0.6.4", ] ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) + +[[package]] +name = "simd-adler32" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" + +[[package]] +name = "simdutf8" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" [[package]] name = "similar" -version = "2.3.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aeaf503862c419d66959f5d7ca015337d864e9c49485d771b732e2a20453597" +checksum = "1de1d4f81173b03af4c0cbed3c898f6bff5b870e4a7f5d6f4057d62a7a4b686e" [[package]] name = "siphasher" @@ -7790,9 +6787,12 @@ checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" [[package]] name = "slab" -version = "0.4.2" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] [[package]] name = "sled" @@ -7818,57 +6818,29 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "snow" -version = "0.9.3" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c9d1425eb528a21de2755c75af4c9b5d57f50a0d4c3b7f1828a4cd03f8ba155" +checksum = "850948bee068e713b8ab860fe1adc4d109676ab4c3b621fd8147f06b261f2f85" dependencies = [ "aes-gcm", "blake2", "chacha20poly1305", "curve25519-dalek 4.1.3", "rand_core 0.6.4", - "ring 0.16.20", -<<<<<<< HEAD - "rustc_version 0.3.3", - "sha2 0.9.8", - "subtle", - "x25519-dalek", -] - -[[package]] -name = "socket2" -version = "0.3.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "122e570113d28d773067fab24266b66753f6ea915758651696b6e35e49f88d6e" -dependencies = [ - "cfg-if", - "libc", - "winapi", -] - -[[package]] -name = "socket2" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" -dependencies = [ - "libc", - "winapi", -======= - "rustc_version 0.4.0", + "ring 0.17.8", + "rustc_version", "sha2 0.10.8", "subtle", ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) ] [[package]] name = "socket2" -version = "0.5.5" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -7878,7 +6850,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "18051cdd562e792cad055119e0cdb2cfc137e44e3987532e0f9659a77931bb08" dependencies = [ "bytemuck", - "cfg_aliases", + "cfg_aliases 0.2.1", "core-graphics 0.24.0", "foreign-types", "js-sys", @@ -7887,7 +6859,7 @@ dependencies = [ "objc2-foundation", "objc2-quartz-core", "raw-window-handle", - "redox_syscall 0.5.4", + "redox_syscall 0.5.7", "wasm-bindgen", "web-sys", "windows-sys 0.59.0", @@ -7902,13 +6874,28 @@ dependencies = [ "base64 0.13.1", "bytes", "futures", - "http 0.2.11", + "http 0.2.12", "httparse", "log", "rand 0.8.5", "sha-1", ] +[[package]] +name = "soketto" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37468c595637c10857701c990f93a40ce0e357cedb0953d1c26c8d8027f9bb53" +dependencies = [ + "base64 0.22.1", + "bytes", + "futures", + "httparse", + "log", + "rand 0.8.5", + "sha1", +] + [[package]] name = "soup3" version = "0.5.0" @@ -7943,9 +6930,9 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] name = "spin" -version = "0.9.4" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f6002a767bff9e83f8eeecf883ecb8011875a21ae8da43bffb817a57e78cc09" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" dependencies = [ "lock_api", ] @@ -7962,11 +6949,10 @@ dependencies = [ [[package]] name = "sqlformat" -version = "0.2.0" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f87e292b4291f154971a43c3774364e2cbcaec599d3f5bf6fa9d122885dbc38a" +checksum = "7bba3a93db0cc4f7bdece8bb09e77e2e785c20bfebf79eb8340ed80708048790" dependencies = [ - "itertools 0.10.5", "nom", "unicode_categories", ] @@ -7987,19 +6973,17 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa8241483a83a3f33aa5fff7e7d9def398ff9990b2752b6c6112b83c6d246029" dependencies = [ - "ahash 0.7.6", + "ahash 0.7.8", "atoi", - "base64 0.13.1", "bitflags 1.3.2", "byteorder", "bytes", "crc", "crossbeam-queue", - "dirs", "dotenvy", "either", "event-listener 2.5.3", - "flume", + "flume 0.10.14", "futures-channel", "futures-core", "futures-executor", @@ -8007,29 +6991,18 @@ dependencies = [ "futures-util", "hashlink", "hex", -<<<<<<< HEAD "indexmap 1.9.3", "itoa 1.0.11", -======= - "hkdf", - "hmac 0.12.1", - "indexmap 1.7.0", - "itoa", ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) "libc", "libsqlite3-sys", "log", - "md-5", "memchr", "once_cell", "paste", "percent-encoding", - "rand 0.8.5", - "rustls 0.20.2", - "rustls-pemfile 1.0.0", + "rustls 0.20.9", + "rustls-pemfile 1.0.4", "serde", - "serde_json", - "sha1", "sha2 0.10.8", "smallvec", "sqlformat", @@ -8038,8 +7011,7 @@ dependencies = [ "thiserror", "tokio-stream", "url", - "webpki-roots 0.22.2", - "whoami", + "webpki-roots 0.22.6", ] [[package]] @@ -8072,9 +7044,15 @@ checksum = "804d3f245f894e61b1e6263c84b23ca675d96753b5abfd5cc8597d86806e8024" dependencies = [ "once_cell", "tokio", - "tokio-rustls 0.23.1", + "tokio-rustls 0.23.4", ] +[[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" @@ -8089,7 +7067,7 @@ checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" dependencies = [ "new_debug_unreachable", "once_cell", - "parking_lot 0.12.0", + "parking_lot 0.12.3", "phf_shared 0.10.0", "precomputed-hash", "serde", @@ -8109,12 +7087,13 @@ dependencies = [ [[package]] name = "stringprep" -version = "0.1.2" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ee348cb74b87454fff4b551cbf727025810a004f88aeacae7f85b87f4e9a1c1" +checksum = "7b4df3d392d81bd458a8a621b8bffbd2302a12ffe288a9d931670948749463b1" dependencies = [ "unicode-bidi", "unicode-normalization", + "unicode-properties", ] [[package]] @@ -8152,7 +7131,7 @@ version = "0.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcb5ae327f9cc13b68763b5749770cb9e048a99bd9dfdfa58d0cf05d5f64afe0" dependencies = [ - "heck 0.3.2", + "heck 0.3.3", "proc-macro-error", "proc-macro2", "quote", @@ -8178,20 +7157,20 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.46", + "syn 2.0.79", ] [[package]] name = "subtle" -version = "2.5.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "subtle-ng" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8049cf85f0e715d6af38dde439cb0ccb91f67fb9f5f63c80f8b43e48356e1a3f" +checksum = "734676eb262c623cec13c3155096e08d1f8f29adce39ba17948b18dad1e54142" [[package]] name = "swap" @@ -8217,16 +7196,12 @@ dependencies = [ "digest 0.10.7", "directories-next", "ecdsa_fun", -<<<<<<< HEAD - "ed25519-dalek", - "erased-serde", -======= "ed25519-dalek 1.0.1", ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) + "erased-serde", "futures", "get-port", "hex", - "hyper 0.14.28", + "hyper 0.14.30", "hyper 1.4.1", "itertools 0.13.0", "jsonrpsee", @@ -8281,7 +7256,6 @@ dependencies = [ "uuid", "vergen", "void", - "watchtower", "zip", ] @@ -8309,15 +7283,27 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.46" +version = "2.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89456b690ff72fddcecf231caedbe615c59480c93358a93dfae7fc29e3ebbf0e" +checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] +[[package]] +name = "syn_derive" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1329189c02ff984e9736652b1631330da25eaa6bc639089ed4915d25446cbe7b" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.79", +] + [[package]] name = "sync_wrapper" version = "0.1.2" @@ -8334,29 +7320,13 @@ dependencies = [ ] [[package]] -name = "synstructure" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b834f2d66f734cb897113e34aaff2f1ab4719ca946f9a7358dba8f8064148701" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", - "unicode-xid", -] - -[[package]] -<<<<<<< HEAD -name = "system-deps" -version = "6.2.2" -======= name = "system-configuration" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" dependencies = [ "bitflags 1.3.2", - "core-foundation", + "core-foundation 0.9.4", "system-configuration-sys", ] @@ -8371,9 +7341,8 @@ dependencies = [ ] [[package]] -name = "tempfile" -version = "3.10.1" ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) +name = "system-deps" +version = "6.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349" dependencies = [ @@ -8386,9 +7355,9 @@ dependencies = [ [[package]] name = "tao" -version = "0.30.2" +version = "0.30.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06e48d7c56b3f7425d061886e8ce3b6acfab1993682ed70bef50fd133d721ee6" +checksum = "a0dbbebe82d02044dfa481adca1550d6dd7bd16e086bc34fa0fbecceb5a63751" dependencies = [ "bitflags 2.6.0", "cocoa", @@ -8411,13 +7380,13 @@ dependencies = [ "ndk-sys", "objc", "once_cell", - "parking_lot 0.12.0", + "parking_lot 0.12.3", "raw-window-handle", "scopeguard", "tao-macros", "unicode-segmentation", "url", - "windows", + "windows 0.58.0", "windows-core 0.58.0", "windows-version", "x11-dl", @@ -8431,9 +7400,15 @@ checksum = "f4e16beb8b2ac17db28eab8bca40e62dbfbb34c0fcdc6d9826b11b7b5d047dfd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.79", ] +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + [[package]] name = "target-lexicon" version = "0.12.16" @@ -8442,9 +7417,9 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tauri" -version = "2.0.0" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c9c08beea86d5095b6f5fb1c788fe8759b23c3f71927c66a69e725a91d089cd" +checksum = "5920aad0804ea5e86808d4b6e8753d3bcbae7efc8f4e41a4da00b45427559868" dependencies = [ "anyhow", "bytes", @@ -8452,7 +7427,7 @@ dependencies = [ "dunce", "embed_plist", "futures-util", - "getrandom 0.2.11", + "getrandom 0.2.15", "glob", "gtk", "heck 0.5.0", @@ -8488,14 +7463,14 @@ dependencies = [ "webkit2gtk", "webview2-com", "window-vibrancy", - "windows", + "windows 0.58.0", ] [[package]] name = "tauri-build" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93bb649a284aec2ab43e8df6831b8c8060d231ec8ddf05bf021d58cb67570e1f" +checksum = "935f9b3c49b22b3e2e485a57f46d61cd1ae07b1cbb2ba87387a387caf2d8c4e7" dependencies = [ "anyhow", "cargo_toml", @@ -8504,7 +7479,7 @@ dependencies = [ "heck 0.5.0", "json-patch", "schemars", - "semver 1.0.23", + "semver", "serde", "serde_json", "tauri-utils", @@ -8515,9 +7490,9 @@ dependencies = [ [[package]] name = "tauri-codegen" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4511912612ba0da11aeb300e18e18b2c7067fd14aa886eac46bdcc43b4fa3ee" +checksum = "95d7443dd4f0b597704b6a14b964ee2ed16e99928d8e6292ae9825f09fbcd30e" dependencies = [ "base64 0.22.1", "brotli 6.0.0", @@ -8527,11 +7502,11 @@ dependencies = [ "png", "proc-macro2", "quote", - "semver 1.0.23", + "semver", "serde", "serde_json", "sha2 0.10.8", - "syn 2.0.46", + "syn 2.0.79", "tauri-utils", "thiserror", "time 0.3.36", @@ -8542,23 +7517,23 @@ dependencies = [ [[package]] name = "tauri-macros" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62ee976578a14b779996d7b6879d7e625c8ce674bc87e223953664f37def2eef" +checksum = "4d2c0963ccfc3f5194415f2cce7acc975942a8797fbabfb0aa1ed6f59326ae7f" dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.79", "tauri-codegen", "tauri-utils", ] [[package]] name = "tauri-plugin" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "774d084450b7ec8e445ad119079307f935b7bf3d736da139a8664eb1d4909aa5" +checksum = "b2e6660a409963e4d57b9bfab4addd141eeff41bd3a7fb14e13004a832cf7ef6" dependencies = [ "anyhow", "glob", @@ -8616,9 +7591,9 @@ dependencies = [ [[package]] name = "tauri-plugin-process" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73a682de610de60cfeea5212cbbaca9a6c25bd48854067f2aee3c27ee87ae65c" +checksum = "ae06a00087c148962a52814a2d7265b1a0505bced5ffb74f8c284a5f96a4d03d" dependencies = [ "tauri", "tauri-plugin", @@ -8626,9 +7601,9 @@ dependencies = [ [[package]] name = "tauri-plugin-shell" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2929bb35edb7255949e0cbcb2285ff6b02371bf826ad03471077b6b3bf4e6d60" +checksum = "371fb9aca2823990a2d0db7970573be5fdf07881fcaa2b835b29631feb84aec1" dependencies = [ "encoding_rs", "log", @@ -8647,9 +7622,9 @@ dependencies = [ [[package]] name = "tauri-plugin-store" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c824c56d35d3aeb97eda0f827c9c419d8fd153a2958f3f40e8e9f34ecc564e6d" +checksum = "5058f179f7215390fc5a68eeffcb805b7e2681d6e817a5d08094fae7ab649e68" dependencies = [ "dunce", "log", @@ -8663,9 +7638,9 @@ dependencies = [ [[package]] name = "tauri-runtime" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2570e1f33f332a2d2d9967ebb3903bc4e1f92b9c47e4d1b302c10ea4153fcdbb" +checksum = "af12ad1af974b274ef1d32a94e6eba27a312b429ef28fcb98abc710df7f9151d" dependencies = [ "dpi", "gtk", @@ -8677,14 +7652,14 @@ dependencies = [ "tauri-utils", "thiserror", "url", - "windows", + "windows 0.58.0", ] [[package]] name = "tauri-runtime-wry" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8147d8f9ed418d83a90af3d64fbdca5e0e924ae28e5351da88f9568169db8665" +checksum = "e45e88aa0b11b302d836e6ea3e507a6359044c4a8bc86b865ba99868c695753d" dependencies = [ "gtk", "http 1.1.0", @@ -8703,15 +7678,15 @@ dependencies = [ "url", "webkit2gtk", "webview2-com", - "windows", + "windows 0.58.0", "wry", ] [[package]] name = "tauri-utils" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f87856e9d7fa91fd710362f3c73fccbf6bfd036934908791e65bd803d54dc8a8" +checksum = "c38b0230d6880cf6dd07b6d7dd7789a0869f98ac12146e0d18d1c1049215a045" dependencies = [ "brotli 6.0.0", "cargo_metadata", @@ -8730,11 +7705,11 @@ dependencies = [ "quote", "regex", "schemars", - "semver 1.0.23", + "semver", "serde", "serde-untagged", "serde_json", - "serde_with 3.9.0", + "serde_with 3.11.0", "swift-rs", "thiserror", "toml 0.8.2", @@ -8756,9 +7731,9 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.12.0" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" +checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" dependencies = [ "cfg-if", "fastrand", @@ -8778,16 +7753,6 @@ dependencies = [ "utf-8", ] -[[package]] -name = "terminal_size" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ca8ced750734db02076f44132d802af0b33b09942331f4459dde8636fd2406" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "testcontainers" version = "0.15.0" @@ -8822,30 +7787,31 @@ checksum = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c" [[package]] name = "thiserror" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.79", ] [[package]] name = "thread_local" -version = "1.1.4" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ + "cfg-if", "once_cell", ] @@ -8862,11 +7828,12 @@ dependencies = [ [[package]] name = "time" -version = "0.1.43" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" +checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" dependencies = [ "libc", + "wasi 0.10.0+wasi-snapshot-preview1", "winapi", ] @@ -8923,27 +7890,26 @@ dependencies = [ [[package]] name = "tinyvec_macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.38.1" +version = "1.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb2caba9f80616f438e09748d5acda951967e1ea58508ef53d9c6402485a46df" +checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" dependencies = [ "backtrace", "bytes", "libc", "mio", - "num_cpus", "parking_lot 0.12.3", "pin-project-lite", "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -8952,41 +7918,51 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" dependencies = [ - "pin-project-lite 0.2.13", + "pin-project-lite", "tokio", ] [[package]] name = "tokio-macros" -version = "2.3.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.79", +] + +[[package]] +name = "tokio-rustls" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6" +dependencies = [ + "rustls 0.19.1", + "tokio", + "webpki 0.21.4", ] [[package]] name = "tokio-rustls" -version = "0.22.0" +version = "0.23.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6" +checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" dependencies = [ - "rustls 0.19.0", + "rustls 0.20.9", "tokio", - "webpki 0.21.4", + "webpki 0.22.4", ] [[package]] name = "tokio-rustls" -version = "0.23.1" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4baa378e417d780beff82bf54ceb0d195193ea6a00c14e22359e7f39456b5689" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.20.2", + "rustls 0.21.12", "tokio", - "webpki 0.22.0", ] [[package]] @@ -8995,7 +7971,7 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.10", + "rustls 0.23.14", "rustls-pki-types", "tokio", ] @@ -9014,9 +7990,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.11" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d660770404473ccd7bc9f8b28494a811bc18542b915c0855c51e8f419d5223ce" +checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" dependencies = [ "futures-core", "pin-project-lite", @@ -9046,24 +8022,20 @@ checksum = "511de3f85caf1c98983545490c3d09685fa8eb634e57eec22bb4db271f46cbd8" dependencies = [ "futures-util", "log", -<<<<<<< HEAD - "pin-project 1.1.5", -======= "pin-project", ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) - "rustls 0.19.0", + "rustls 0.19.1", "tokio", "tokio-rustls 0.22.0", "tungstenite", "webpki 0.21.4", - "webpki-roots 0.21.0", + "webpki-roots 0.21.1", ] [[package]] name = "tokio-util" -version = "0.7.11" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" +checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" dependencies = [ "bytes", "futures-core", @@ -9073,15 +8045,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "toml" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" -dependencies = [ - "serde", -] - [[package]] name = "toml" version = "0.7.8" @@ -9121,7 +8084,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.1.0", + "indexmap 2.6.0", "serde", "serde_spanned", "toml_datetime", @@ -9134,7 +8097,7 @@ version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" dependencies = [ - "indexmap 2.1.0", + "indexmap 2.6.0", "serde", "serde_spanned", "toml_datetime", @@ -9152,14 +8115,14 @@ dependencies = [ "axum", "base64 0.21.7", "bytes", - "h2 0.3.18", - "http 0.2.11", + "h2 0.3.26", + "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.28", + "hyper 0.14.30", "hyper-timeout", "percent-encoding", - "pin-project 1.1.5", - "prost 0.12.6", + "pin-project", + "prost", "tokio", "tokio-stream", "tower", @@ -9175,7 +8138,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f80db390246dfb46553481f6024f0082ba00178ea495dbb99e70ba9a4fafb5e1" dependencies = [ "async-stream", - "prost 0.12.6", + "prost", "tokio", "tokio-stream", "tonic", @@ -9189,10 +8152,10 @@ checksum = "0fddb2a37b247e6adcb9f239f4e5cefdcc5ed526141a416b943929f13aea2cce" dependencies = [ "base64 0.21.7", "bytes", - "http 0.2.11", + "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.28", - "pin-project 1.1.5", + "hyper 0.14.30", + "pin-project", "tokio-stream", "tonic", "tower-http 0.4.4", @@ -9214,7 +8177,7 @@ dependencies = [ "hex", "hmac 0.11.0", "rand 0.7.3", - "sha2 0.9.8", + "sha2 0.9.9", "sha3", "tokio", ] @@ -9227,17 +8190,12 @@ checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" dependencies = [ "futures-core", "futures-util", -<<<<<<< HEAD "hdrhistogram", "indexmap 1.9.3", - "pin-project 1.1.5", - "pin-project-lite 0.2.13", - "rand 0.8.3", - "slab", -======= "pin-project", "pin-project-lite", ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) + "rand 0.8.5", + "slab", "tokio", "tokio-util", "tower-layer", @@ -9257,7 +8215,7 @@ dependencies = [ "bytes", "futures-core", "futures-util", - "http 0.2.11", + "http 0.2.12", "http-body 0.4.6", "http-range-header", "httpdate", @@ -9265,7 +8223,7 @@ dependencies = [ "mime", "mime_guess", "percent-encoding", - "pin-project-lite 0.2.13", + "pin-project-lite", "tokio", "tokio-util", "tower", @@ -9285,25 +8243,25 @@ dependencies = [ "bytes", "futures-core", "futures-util", - "http 0.2.11", + "http 0.2.12", "http-body 0.4.6", "http-range-header", - "pin-project-lite 0.2.13", + "pin-project-lite", "tower-layer", "tower-service", ] [[package]] name = "tower-layer" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" [[package]] name = "tower-service" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" @@ -9337,7 +8295,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.79", ] [[package]] @@ -9358,11 +8316,7 @@ checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" dependencies = [ "futures", "futures-task", -<<<<<<< HEAD - "pin-project 1.1.5", -======= "pin-project", ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) "tracing", ] @@ -9411,7 +8365,6 @@ dependencies = [ ] [[package]] -<<<<<<< HEAD name = "tray-icon" version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -9433,57 +8386,10 @@ dependencies = [ ] [[package]] -name = "trust-dns-proto" -version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d57e219ba600dd96c2f6d82eb79645068e14edbc5c7e27514af40436b88150c" -dependencies = [ - "async-trait", - "cfg-if", - "data-encoding", - "enum-as-inner", - "futures-channel", - "futures-io", - "futures-util", - "idna 0.2.2", - "ipnet", - "lazy_static", - "log", - "rand 0.8.3", - "smallvec", - "thiserror", - "tinyvec", - "tokio", - "url", -] - -[[package]] -name = "trust-dns-resolver" -version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0437eea3a6da51acc1e946545ff53d5b8fb2611ff1c3bed58522dde100536ae" -dependencies = [ - "cfg-if", - "futures-util", - "ipconfig", - "lazy_static", - "log", - "lru-cache", - "parking_lot 0.11.2", - "resolv-conf", - "smallvec", - "thiserror", - "tokio", - "trust-dns-proto", -] - -[[package]] -======= ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) name = "try-lock" -version = "0.2.3" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "tungstenite" @@ -9494,11 +8400,11 @@ dependencies = [ "base64 0.13.1", "byteorder", "bytes", - "http 0.2.11", + "http 0.2.12", "httparse", "log", "rand 0.8.5", - "rustls 0.19.0", + "rustls 0.19.1", "rustls-native-certs 0.5.0", "sha-1", "thiserror", @@ -9515,9 +8421,9 @@ checksum = "0e13db2e0ccd5e14a544e8a246ba2312cd25223f616442d7f2cb0e3db614236e" [[package]] name = "typenum" -version = "1.15.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "typeshare" @@ -9538,20 +8444,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a615d6c2764852a2e88a4f16e9ce1ea49bb776b5872956309e170d63a042a34f" dependencies = [ "quote", - "syn 2.0.46", + "syn 2.0.79", ] [[package]] name = "ucd-trie" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" [[package]] name = "uint" -version = "0.9.0" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e11fe9a9348741cf134085ad57c249508345fe16411b3d7fb4ff2da2f1d6382e" +checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" dependencies = [ "byteorder", "crunchy", @@ -9617,25 +8523,31 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" [[package]] name = "unicode-ident" -version = "1.0.2" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15c61ba63f9235225a22310255a29b806b907c9b8c964bcbd0a2c70f3f2deea7" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-properties" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e70f2a8b45122e719eb623c01822704c4e0907e7e426a05927e1a1cfff5b75d0" + [[package]] name = "unicode-segmentation" version = "1.12.0" @@ -9644,15 +8556,9 @@ checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" [[package]] name = "unicode-width" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" - -[[package]] -name = "unicode-xid" -version = "0.2.1" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] name = "unicode_categories" @@ -9662,26 +8568,31 @@ checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" [[package]] name = "universal-hash" -version = "0.4.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8326b2c654932e3e4f9196e69d08fdf7cfd718e1dc6f66b347e6024a0c961402" +checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" dependencies = [ - "generic-array", + "crypto-common", "subtle", ] [[package]] name = "unsigned-varint" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d86a8dc7f45e4c1b0d30e43038c38f274e77af056aa5f74b93c2cf9eb3c1c836" +checksum = "6889a77d49f1f013504cec6bf97a2c730394adedaeb1deb5ea08949a50541105" dependencies = [ - "asynchronous-codec 0.6.0", + "asynchronous-codec 0.6.2", "bytes", ] [[package]] -<<<<<<< HEAD +name = "unsigned-varint" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb066959b24b5196ae73cb057f45598450d2c5f71460e98c49b738086eff9c06" + +[[package]] name = "unstoppableswap-gui-rs" version = "0.0.0" dependencies = [ @@ -9699,12 +8610,6 @@ dependencies = [ "tauri-plugin-store", "tracing", ] -======= -name = "unsigned-varint" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb066959b24b5196ae73cb057f45598450d2c5f71460e98c49b738086eff9c06" ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) [[package]] name = "untrusted" @@ -9744,9 +8649,9 @@ dependencies = [ [[package]] name = "utf-8" -version = "0.7.5" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05e42f7c18b8f902290b009cde6d651262f956c98bc51bca4cd1d511c9cd85c7" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" [[package]] name = "uuid" @@ -9754,7 +8659,7 @@ version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" dependencies = [ - "getrandom 0.2.11", + "getrandom 0.2.15", "serde", ] @@ -9766,9 +8671,9 @@ checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "vcpkg" -version = "0.2.11" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b00bca6106a5e23f3eee943593759b7fcddb00554332e856d990c893966879fb" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "vec_map" @@ -9854,11 +8759,10 @@ dependencies = [ [[package]] name = "want" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" dependencies = [ - "log", "try-lock", ] @@ -9870,46 +8774,47 @@ checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +version = "0.10.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" [[package]] -name = "wasite" -version = "0.1.0" +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.90" +version = "0.2.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" +checksum = "ef073ced962d62984fb38a36e5fdc1a2b23c9e0e1fa0689bb97afa4202ef6887" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.90" +version = "0.2.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" +checksum = "c4bfab14ef75323f4eb75fa52ee0a3fb59611977fd3240da19b2cf36ff85030e" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.79", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.40" +version = "0.4.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" +checksum = "65471f79c1022ffa5291d33520cbbb53b7687b01c2f8e83b57d102eed7ed479d" dependencies = [ "cfg-if", "js-sys", @@ -9919,9 +8824,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.90" +version = "0.2.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" +checksum = "a7bec9830f60924d9ceb3ef99d55c155be8afa76954edffbb5936ff4509474e7" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -9929,28 +8834,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.90" +version = "0.2.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" +checksum = "4c74f6e152a76a2ad448e223b0fc0b6b5747649c3d769cc6bf45737bf97d0ed6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.79", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.90" +version = "0.2.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" +checksum = "a42f6c679374623f295a8623adfe63d9284091245c3504bde47c17a3ce2777d9" [[package]] name = "wasm-streams" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b65dc4c90b63b118468cf747d8bf3566c1913ef60be765b5730ead9e0a3ba129" +checksum = "4e072d4e72f700fb3443d8fe94a39315df013eef1104903cdb0a2abd322bbecd" dependencies = [ "futures-util", "js-sys", @@ -9960,35 +8865,26 @@ dependencies = [ ] [[package]] -name = "watchtower" -version = "0.1.0" +name = "web-sys" +version = "0.3.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44188d185b5bdcae1052d08bcbcf9091a5524038d4572cc4f4f2bb9d5554ddd9" dependencies = [ - "actix-web", - "anyhow", - "bitcoincore-rpc", - "dotenv", - "futures", - "libp2p", - "serde", - "serde_json", - "sqlx", - "tokio", - "tracing", - "tracing-subscriber 0.3.18", + "js-sys", + "wasm-bindgen", ] [[package]] -name = "web-sys" -version = "0.3.67" +name = "web-time" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" dependencies = [ "js-sys", "wasm-bindgen", ] [[package]] -<<<<<<< HEAD name = "webkit2gtk" version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -10030,15 +8926,6 @@ dependencies = [ "pkg-config", "soup3-sys", "system-deps", -======= -name = "web-time" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" -dependencies = [ - "js-sys", - "wasm-bindgen", ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) ] [[package]] @@ -10053,30 +8940,30 @@ dependencies = [ [[package]] name = "webpki" -version = "0.22.0" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" dependencies = [ - "ring 0.16.20", - "untrusted 0.7.1", + "ring 0.17.8", + "untrusted 0.9.0", ] [[package]] name = "webpki-roots" -version = "0.21.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82015b7e0b8bad8185994674a13a93306bea76cf5a16c5a181382fd3a5ec2376" +checksum = "aabe153544e473b775453675851ecc86863d2a81d786d741f6b76778f2a48940" dependencies = [ "webpki 0.21.4", ] [[package]] name = "webpki-roots" -version = "0.22.2" +version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "552ceb903e957524388c4d3475725ff2c8b7960922063af6ce53c9a43da07449" +checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" dependencies = [ - "webpki 0.22.0", + "webpki 0.22.4", ] [[package]] @@ -10087,15 +8974,14 @@ checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "webpki-roots" -version = "0.26.1" +version = "0.26.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3de34ae270483955a94f4b21bdaaeb83d508bb84a01435f393818edb0012009" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" dependencies = [ "rustls-pki-types", ] [[package]] -<<<<<<< HEAD name = "webview2-com" version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -10103,7 +8989,7 @@ checksum = "6f61ff3d9d0ee4efcb461b14eb3acfda2702d10dc329f339303fc3e57215ae2c" dependencies = [ "webview2-com-macros", "webview2-com-sys", - "windows", + "windows 0.58.0", "windows-core 0.58.0", "windows-implement", "windows-interface", @@ -10117,7 +9003,7 @@ checksum = "1d228f15bba3b9d56dde8bddbee66fa24545bd17b48d5128ccf4a8742b18e431" dependencies = [ "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.79", ] [[package]] @@ -10127,7 +9013,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3a3e2eeb58f82361c93f9777014668eb3d07e7d174ee4c819575a9208011886" dependencies = [ "thiserror", - "windows", + "windows 0.58.0", "windows-core 0.58.0", ] @@ -10137,21 +9023,6 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082" -[[package]] -name = "which" -version = "4.0.2" -======= -name = "whoami" -version = "1.5.1" ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44ab49fad634e88f55bf8f9bb3abd2f27d7204172a112c7c9987e01c1c94ea9" -dependencies = [ - "redox_syscall 0.4.1", - "wasite", - "web-sys", -] - [[package]] name = "widestring" version = "1.1.0" @@ -10190,7 +9061,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] -<<<<<<< HEAD name = "window-vibrancy" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -10204,6 +9074,16 @@ dependencies = [ "windows-version", ] +[[package]] +name = "windows" +version = "0.51.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" +dependencies = [ + "windows-core 0.51.1", + "windows-targets 0.48.5", +] + [[package]] name = "windows" version = "0.58.0" @@ -10212,20 +9092,19 @@ checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" dependencies = [ "windows-core 0.58.0", "windows-targets 0.52.6", -======= -name = "windows" +] + +[[package]] +name = "windows-core" version = "0.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" +checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" dependencies = [ - "windows-core", "windows-targets 0.48.5", ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) ] [[package]] name = "windows-core" -<<<<<<< HEAD version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" @@ -10254,7 +9133,7 @@ checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.79", ] [[package]] @@ -10265,7 +9144,7 @@ checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" dependencies = [ "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.79", ] [[package]] @@ -10296,26 +9175,6 @@ checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" dependencies = [ "windows-result", "windows-targets 0.52.6", -======= -version = "0.51.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" -dependencies = [ - "windows-targets 0.48.5", ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) -] - -[[package]] -name = "windows-sys" -version = "0.32.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3df6e476185f92a12c072be4a189a0210dcdcf512a1891d6dff9edb874deadc6" -dependencies = [ - "windows_aarch64_msvc 0.32.0", - "windows_i686_gnu 0.32.0", - "windows_i686_msvc 0.32.0", - "windows_x86_64_gnu 0.32.0", - "windows_x86_64_msvc 0.32.0", ] [[package]] @@ -10429,23 +9288,13 @@ checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" -version = "0.32.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8e92753b1c443191654ec532f14c199742964a061be25d77d7a96f09db20bf5" - -[[package]] -name = "windows_aarch64_msvc" -<<<<<<< HEAD version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" -======= version = "0.48.5" ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" @@ -10457,23 +9306,13 @@ checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" -version = "0.32.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a711c68811799e017b6038e0922cb27a5e2f43a2ddb609fe0b6f3eeda9de615" - -[[package]] -name = "windows_i686_gnu" -<<<<<<< HEAD version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_gnu" -version = "0.48.0" -======= version = "0.48.5" ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" @@ -10491,23 +9330,13 @@ checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" -version = "0.32.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "146c11bb1a02615db74680b32a68e2d61f553cc24c4eb5b4ca10311740e44172" - -[[package]] -name = "windows_i686_msvc" -<<<<<<< HEAD version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_i686_msvc" -version = "0.48.0" -======= version = "0.48.5" ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" @@ -10519,23 +9348,13 @@ checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" -version = "0.32.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c912b12f7454c6620635bbff3450962753834be2a594819bd5e945af18ec64bc" - -[[package]] -name = "windows_x86_64_gnu" -<<<<<<< HEAD version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" -======= version = "0.48.5" ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" @@ -10565,23 +9384,13 @@ checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" -version = "0.32.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "504a2476202769977a040c6364301a3f65d0cc9e3fb08600b2bda150a0488316" - -[[package]] -name = "windows_x86_64_msvc" -<<<<<<< HEAD version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" -======= version = "0.48.5" ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" @@ -10606,7 +9415,7 @@ version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "windows-sys 0.48.0", ] @@ -10655,12 +9464,21 @@ dependencies = [ "webkit2gtk", "webkit2gtk-sys", "webview2-com", - "windows", + "windows 0.58.0", "windows-core 0.58.0", "windows-version", "x11-dl", ] +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + [[package]] name = "x11" version = "2.21.0" @@ -10711,49 +9529,17 @@ dependencies = [ "zeroize", ] -[[package]] -name = "x509-parser" -version = "0.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7069fba5b66b9193bd2c5d3d4ff12b839118f6bcbef5328efafafb5395cf63da" -dependencies = [ - "asn1-rs", - "data-encoding", - "der-parser", - "lazy_static", - "nom", - "oid-registry", - "rusticata-macros", - "thiserror", - "time 0.3.36", -] - [[package]] name = "xattr" -version = "1.1.3" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7dae5072fe1f8db8f8d29059189ac175196e410e40ba42d5d4684ae2f750995" +checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" dependencies = [ "libc", "linux-raw-sys", "rustix", ] -[[package]] -name = "xml-rs" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "791978798f0597cfc70478424c2b4fdc2b7a8024aaff78497ef00f24ef674193" - -[[package]] -name = "xmltree" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7d8a75eaf6557bb84a65ace8609883db44a29951042ada9b393151532e41fcb" -dependencies = [ - "xml-rs", -] - [[package]] name = "yamux" version = "0.12.1" @@ -10785,21 +9571,13 @@ dependencies = [ "web-time", ] -[[package]] -name = "yasna" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" -dependencies = [ - "time 0.3.36", -] - [[package]] name = "zerocopy" version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ + "byteorder", "zerocopy-derive", ] @@ -10811,7 +9589,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.79", ] [[package]] @@ -10831,7 +9609,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.79", ] [[package]] @@ -10845,42 +9623,14 @@ dependencies = [ "crc32fast", "flate2", "thiserror", - "time 0.1.43", + "time 0.1.45", ] [[package]] -<<<<<<< HEAD name = "zune-inflate" version = "0.2.54" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73ab332fe2f6680068f3582b16a24f90ad7096d5d39b974d1c0aff0125116f02" dependencies = [ "simd-adler32", -======= -name = "zstd" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcf2b778a664581e31e389454a7072dab1647606d44f7feea22cd5abb9c9f3f9" -dependencies = [ - "zstd-safe", -] - -[[package]] -name = "zstd-safe" -version = "7.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54a3ab4db68cea366acc5c897c7b4d4d1b8994a9cd6e6f841f8964566a419059" -dependencies = [ - "zstd-sys", -] - -[[package]] -name = "zstd-sys" -version = "2.0.13+zstd.1.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" -dependencies = [ - "cc", - "pkg-config", ->>>>>>> a56435aa (wip: migrate to libp2p 0.53.2) ] From 33598abd2fae341afc18c89c2805c9de18bcba63 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Wed, 16 Oct 2024 19:05:58 +0200 Subject: [PATCH 004/112] Upgrade libp2p to 0.53.2 and update related code - Update libp2p dependency to 0.53.2 in Cargo.toml - Add libp2p-swarm-derive dependency - Update imports and usage of libp2p types and traits - Refactor NetworkBehaviour implementations to match new API - Update Identify and Ping behavior configurations - Adjust event handling in network behaviors - Fix compiler errors and warnings related to API changes --- .gitignore | 1 + Cargo.lock | 13 +++ swap/Cargo.toml | 2 +- swap/src/asb/network.rs | 177 +++++++++++++++++------------- swap/src/cli/behaviour.rs | 12 +- swap/src/cli/event_loop.rs | 2 +- swap/src/network/tor_transport.rs | 5 +- 7 files changed, 128 insertions(+), 84 deletions(-) diff --git a/.gitignore b/.gitignore index eb5a316cb..3df278ece 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ target +.vscode diff --git a/Cargo.lock b/Cargo.lock index 92cbd155d..939ba1078 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4004,6 +4004,7 @@ dependencies = [ "instant", "libp2p-core", "libp2p-identity", + "libp2p-swarm-derive", "lru", "multistream-select", "once_cell", @@ -4013,6 +4014,18 @@ dependencies = [ "void", ] +[[package]] +name = "libp2p-swarm-derive" +version = "0.34.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5daceb9dd908417b6dfcfe8e94098bc4aac54500c282e78120b885dadc09b999" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "syn 2.0.79", +] + [[package]] name = "libp2p-tcp" version = "0.41.0" diff --git a/swap/Cargo.toml b/swap/Cargo.toml index 54d26d374..414646cf9 100644 --- a/swap/Cargo.toml +++ b/swap/Cargo.toml @@ -43,10 +43,10 @@ hyper = "0.14.20" itertools = "0.13" jsonrpsee = { version = "0.16.2", features = [ "server" ] } jsonrpsee-core = "0.16.2" +libp2p = { version = "0.53.2", default-features = false, features = [ "tcp", "yamux", "dns", "noise", "request-response", "websocket", "ping", "rendezvous", "identify", "macros" ] } monero = { version = "0.12", features = [ "serde_support" ] } monero-rpc = { path = "../monero-rpc" } once_cell = "1.19" -libp2p = { version = "0.53.2", default-features = false, features = [ "tcp", "yamux", "dns", "noise", "request-response", "websocket", "ping", "rendezvous", "identify" ] } pem = "3.0" proptest = "1" qrcode = "0.14" diff --git a/swap/src/asb/network.rs b/swap/src/asb/network.rs index 8b461d07f..a08f5a190 100644 --- a/swap/src/asb/network.rs +++ b/swap/src/asb/network.rs @@ -13,11 +13,9 @@ use anyhow::{anyhow, Error, Result}; use futures::FutureExt; use libp2p::core::muxing::StreamMuxerBox; use libp2p::core::transport::Boxed; -use libp2p::request_response::{ResponseChannel}; +use libp2p::request_response::ResponseChannel; use libp2p::swarm::dial_opts::PeerCondition; -use libp2p::swarm::{ - NetworkBehaviour -}; +use libp2p::swarm::NetworkBehaviour; use libp2p::{Multiaddr, PeerId, Transport}; use std::task::Poll; use std::time::Duration; @@ -41,7 +39,10 @@ pub mod transport { } pub mod behaviour { - use libp2p::swarm::behaviour::toggle::Toggle; + use libp2p::{ + identify, identity, ping, request_response::InboundRequestId, + swarm::behaviour::toggle::Toggle, + }; use super::{rendezvous::RendezvousNode, *}; @@ -66,7 +67,7 @@ pub mod behaviour { }, TransferProofAcknowledged { peer: PeerId, - id: RequestId, + id: InboundRequestId, }, EncryptedSignatureReceived { msg: encrypted_signature::Request, @@ -103,7 +104,6 @@ pub mod behaviour { } } } - /// A `NetworkBehaviour` that represents an XMR/BTC swap node as Alice. #[derive(NetworkBehaviour)] #[behaviour(out_event = "OutEvent", event_process = false)] @@ -118,12 +118,12 @@ pub mod behaviour { pub transfer_proof: transfer_proof::Behaviour, pub cooperative_xmr_redeem: cooperative_xmr_redeem_after_punish::Behaviour, pub encrypted_signature: encrypted_signature::Behaviour, - pub identify: Identify, + pub identify: identify::Behaviour, /// Ping behaviour that ensures that the underlying network connection /// is still alive. If the ping fails a connection close event /// will be emitted that is picked up as swarm event. - ping: Ping, + ping: ping::Behaviour, } impl Behaviour @@ -142,9 +142,12 @@ pub mod behaviour { let (identity, namespace) = identify_params; let agent_version = format!("asb/{} ({})", env!("CARGO_PKG_VERSION"), namespace); let protocol_version = "/comit/xmr/btc/1.0.0".to_string(); - let identifyConfig = IdentifyConfig::new(protocol_version, identity.public()) + + let identifyConfig = identify::Config::new(protocol_version, identity.public()) .with_agent_version(agent_version); + let pingConfig = ping::Config::new(); + let behaviour = if rendezvous_nodes.is_empty() { None } else { @@ -164,20 +167,20 @@ pub mod behaviour { transfer_proof: transfer_proof::alice(), encrypted_signature: encrypted_signature::alice(), cooperative_xmr_redeem: cooperative_xmr_redeem_after_punish::alice(), - ping: Ping::new(PingConfig::new().with_keep_alive(true)), - identify: Identify::new(identifyConfig), + ping: ping::Behaviour::new(pingConfig), + identify: identify::Behaviour::new(identifyConfig), } } } - impl From for OutEvent { - fn from(_: PingEvent) -> Self { + impl From for OutEvent { + fn from(_: ping::Event) -> Self { OutEvent::Other } } - impl From for OutEvent { - fn from(_: IdentifyEvent) -> Self { + impl From for OutEvent { + fn from(_: identify::Event) -> Self { OutEvent::Other } } @@ -191,10 +194,15 @@ pub mod behaviour { pub mod rendezvous { use super::*; + use libp2p::identity; use libp2p::swarm::dial_opts::DialOpts; - use libp2p::swarm::DialError; + use libp2p::swarm::{ + ConnectionDenied, ConnectionId, FromSwarm, THandler, THandlerInEvent, THandlerOutEvent, + ToSwarm, + }; use std::collections::VecDeque; use std::pin::Pin; + use std::task::Context; #[derive(Clone, PartialEq)] enum ConnectionStatus { @@ -270,87 +278,102 @@ pub mod rendezvous { } impl NetworkBehaviour for Behaviour { - type ProtocolsHandler = - ::ProtocolsHandler; - type OutEvent = libp2p::rendezvous::client::Event; + type ConnectionHandler = + ::ConnectionHandler; + type ToSwarm = libp2p::rendezvous::client::Event; - fn new_handler(&mut self) -> Self::ProtocolsHandler { - self.inner.new_handler() + fn handle_established_inbound_connection( + &mut self, + connection_id: ConnectionId, + peer: PeerId, + local_addr: &Multiaddr, + remote_addr: &Multiaddr, + ) -> Result, ConnectionDenied> { + self.inner.handle_established_inbound_connection( + connection_id, + peer, + local_addr, + remote_addr, + ) } - fn addresses_of_peer(&mut self, peer_id: &PeerId) -> Vec { - for node in self.rendezvous_nodes.iter() { - if peer_id == &node.peer_id { - return vec![node.address.clone()]; - } - } - - vec![] + fn handle_established_outbound_connection( + &mut self, + connection_id: ConnectionId, + peer: PeerId, + addr: &Multiaddr, + role_override: libp2p::core::Endpoint, + ) -> Result, ConnectionDenied> { + self.inner.handle_established_outbound_connection( + connection_id, + peer, + addr, + role_override, + ) } - fn inject_connected(&mut self, peer_id: &PeerId) { - for i in 0..self.rendezvous_nodes.len() { - if peer_id == &self.rendezvous_nodes[i].peer_id { - self.rendezvous_nodes[i].set_connection(ConnectionStatus::Connected); - match &self.rendezvous_nodes[i].registration_status { - RegistrationStatus::RegisterOnNextConnection => { - self.register(i); - self.rendezvous_nodes[i].set_registration(RegistrationStatus::Pending); + fn on_swarm_event(&mut self, event: FromSwarm) { + match event { + FromSwarm::ConnectionEstablished(e) => { + let peer_id = e.peer_id; + for i in 0..self.rendezvous_nodes.len() { + if &peer_id == &self.rendezvous_nodes[i].peer_id { + self.rendezvous_nodes[i].set_connection(ConnectionStatus::Connected); + match &self.rendezvous_nodes[i].registration_status { + RegistrationStatus::RegisterOnNextConnection => { + self.register(i); + self.rendezvous_nodes[i] + .set_registration(RegistrationStatus::Pending); + } + RegistrationStatus::Registered { .. } + | RegistrationStatus::Pending => {} + } } - RegistrationStatus::Registered { .. } => {} - RegistrationStatus::Pending => {} } } - } - } - - fn inject_disconnected(&mut self, peer_id: &PeerId) { - for i in 0..self.rendezvous_nodes.len() { - let node = &mut self.rendezvous_nodes[i]; - if peer_id == &node.peer_id { - node.connection_status = ConnectionStatus::Disconnected; + FromSwarm::ConnectionClosed(e) => { + let peer_id = e.peer_id; + for i in 0..self.rendezvous_nodes.len() { + let node = &mut self.rendezvous_nodes[i]; + if &peer_id == &node.peer_id { + node.connection_status = ConnectionStatus::Disconnected; + } + } + } + FromSwarm::DialFailure(e) => { + if let Some(peer_id) = e.peer_id { + for i in 0..self.rendezvous_nodes.len() { + let node = &mut self.rendezvous_nodes[i]; + if peer_id == node.peer_id { + node.connection_status = ConnectionStatus::Disconnected; + } + } + } } + _ => {} } + self.inner.on_swarm_event(event); } - fn inject_event( + fn on_connection_handler_event( &mut self, peer_id: PeerId, - connection: ConnectionId, - event: <::Handler as ProtocolsHandler>::OutEvent, + connection_id: ConnectionId, + event: THandlerOutEvent, ) { - self.inner.inject_event(peer_id, connection, event) - } - - fn inject_dial_failure( - &mut self, - peer_id: Option, - _handler: Self::ProtocolsHandler, - _error: &DialError, - ) { - for i in 0..self.rendezvous_nodes.len() { - let node = &mut self.rendezvous_nodes[i]; - if let Some(id) = peer_id { - if id == node.peer_id { - node.connection_status = ConnectionStatus::Disconnected; - } - } - } + self.inner + .on_connection_handler_event(peer_id, connection_id, event) } - #[allow(clippy::type_complexity)] fn poll( &mut self, - cx: &mut std::task::Context<'_>, - params: &mut impl PollParameters, - ) -> Poll> { + cx: &mut Context<'_>, + ) -> Poll>> { if let Some(peer_id) = self.to_dial.pop_front() { - return Poll::Ready(NetworkBehaviourAction::Dial { + return Poll::Ready(ToSwarm::Dial { opts: DialOpts::peer_id(peer_id) .condition(PeerCondition::Disconnected) .build(), - - handler: Self::ProtocolsHandler::new(Duration::from_secs(30)), }); } // check the status of each rendezvous node @@ -390,10 +413,10 @@ pub mod rendezvous { } } - let inner_poll = self.inner.poll(cx, params); + let inner_poll = self.inner.poll(cx); // reset the timer for the specific rendezvous node if we successfully registered - if let Poll::Ready(NetworkBehaviourAction::GenerateEvent( + if let Poll::Ready(ToSwarm::GenerateEvent( libp2p::rendezvous::client::Event::Registered { ttl, rendezvous_node, diff --git a/swap/src/cli/behaviour.rs b/swap/src/cli/behaviour.rs index df68b6788..3b65958d6 100644 --- a/swap/src/cli/behaviour.rs +++ b/swap/src/cli/behaviour.rs @@ -10,8 +10,8 @@ use crate::protocol::bob::State2; use crate::{bitcoin, env}; use anyhow::{anyhow, Error, Result}; use libp2p::core::Multiaddr; -use libp2p::request_response::{ResponseChannel, InboundRequestId}; -use libp2p::swarm::{NetworkBehaviour}; +use libp2p::request_response::{InboundRequestId, ResponseChannel}; +use libp2p::swarm::NetworkBehaviour; use libp2p::{identify, identity, ping, PeerId}; use std::sync::Arc; use std::time::Duration; @@ -97,9 +97,13 @@ impl Behaviour { ) -> Self { let agentVersion = format!("cli/{} ({})", env!("CARGO_PKG_VERSION"), identify_params.1); let protocolVersion = "/comit/xmr/btc/1.0.0".to_string(); + let identifyConfig = identify::Config::new(protocolVersion, identify_params.0.public()) .with_agent_version(agentVersion); + // TOOD: Keep alive connection forever + let pingConfig = ping::Config::new(); + Self { quote: quote::cli(), swap_setup: bob::Behaviour::new(env_config, bitcoin_wallet), @@ -107,8 +111,8 @@ impl Behaviour { encrypted_signature: encrypted_signature::bob(), cooperative_xmr_redeem: cooperative_xmr_redeem_after_punish::bob(), redial: redial::Behaviour::new(alice, Duration::from_secs(2)), - ping: Ping::new(PingConfig::new().with_keep_alive(true)), - identify: Identify::new(identifyConfig), + ping: ping::Behaviour::new(pingConfig), + identify: identify::Behaviour::new(identifyConfig), } } diff --git a/swap/src/cli/event_loop.rs b/swap/src/cli/event_loop.rs index 397cf5783..181e58bd7 100644 --- a/swap/src/cli/event_loop.rs +++ b/swap/src/cli/event_loop.rs @@ -1,6 +1,5 @@ use crate::bitcoin::EncryptedSignature; use crate::cli::behaviour::{Behaviour, OutEvent}; -use libp2p::swarm::NetworkBehaviour; use crate::monero; use crate::network::cooperative_xmr_redeem_after_punish::{Request, Response}; use crate::network::encrypted_signature; @@ -13,6 +12,7 @@ use futures::future::{BoxFuture, OptionFuture}; use futures::{FutureExt, StreamExt}; use libp2p::request_response::{RequestId, ResponseChannel}; use libp2p::swarm::dial_opts::DialOpts; +use libp2p::swarm::NetworkBehaviour; use libp2p::swarm::SwarmEvent; use libp2p::{PeerId, Swarm}; use std::collections::HashMap; diff --git a/swap/src/network/tor_transport.rs b/swap/src/network/tor_transport.rs index 351b5dc34..c8e4d3b8b 100644 --- a/swap/src/network/tor_transport.rs +++ b/swap/src/network/tor_transport.rs @@ -59,7 +59,10 @@ impl Transport for TorDialOnlyTransport { fn address_translation(&self, _: &Multiaddr, _: &Multiaddr) -> Option { None } - fn dial_as_listener(&mut self, addr: Multiaddr) -> Result> { + fn dial_as_listener( + &mut self, + addr: Multiaddr, + ) -> Result> { let address = TorCompatibleAddress::from_multiaddr(Cow::Borrowed(&addr))?; if address.is_certainly_not_reachable_via_tor_daemon() { From 4c28dcbbaf2061bfb8d65ccc7c10b5122431380b Mon Sep 17 00:00:00 2001 From: binarybaron Date: Wed, 16 Oct 2024 19:38:13 +0200 Subject: [PATCH 005/112] fix: custom impl_from_rr_event macro --- swap/src/network/impl_from_rr_event.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swap/src/network/impl_from_rr_event.rs b/swap/src/network/impl_from_rr_event.rs index b0b48e267..9c4b99164 100644 --- a/swap/src/network/impl_from_rr_event.rs +++ b/swap/src/network/impl_from_rr_event.rs @@ -8,7 +8,7 @@ macro_rules! impl_from_rr_event { ($protocol_event:ty, $behaviour_out_event:ty, $protocol:ident) => { impl From<$protocol_event> for $behaviour_out_event { fn from(event: $protocol_event) -> Self { - use ::libp2p::request_response::RequestResponseEvent::*; + use ::libp2p::request_response::Event::*; use anyhow::anyhow; match event { From 0d3424d9509292008db1653f1d7c6f52ea5e5f67 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Wed, 16 Oct 2024 20:02:17 +0200 Subject: [PATCH 006/112] work in progress --- swap/src/cli/list_sellers.rs | 4 +- swap/src/network/swap_setup/bob.rs | 74 +++++++++++++++++++----------- 2 files changed, 48 insertions(+), 30 deletions(-) diff --git a/swap/src/cli/list_sellers.rs b/swap/src/cli/list_sellers.rs index c17dc6a0b..2395e1c2f 100644 --- a/swap/src/cli/list_sellers.rs +++ b/swap/src/cli/list_sellers.rs @@ -7,7 +7,7 @@ use libp2p::multiaddr::Protocol; use libp2p::ping::{Ping, PingConfig, PingEvent}; use libp2p::request_response::{RequestResponseEvent, RequestResponseMessage}; use libp2p::swarm::dial_opts::DialOpts; -use libp2p::swarm::SwarmEvent; +use libp2p::swarm::{behaviour, NetworkBehaviour, SwarmEvent}; use libp2p::{identity, rendezvous, Multiaddr, PeerId, Swarm}; use serde::Serialize; use serde_with::{serde_as, DisplayFromStr}; @@ -98,7 +98,7 @@ impl From for OutEvent { } } -#[derive(libp2p::NetworkBehaviour)] +#[derive(NetworkBehaviour)] #[behaviour(event_process = false)] #[behaviour(out_event = "OutEvent")] struct Behaviour { diff --git a/swap/src/network/swap_setup/bob.rs b/swap/src/network/swap_setup/bob.rs index bee70c24c..6b905495d 100644 --- a/swap/src/network/swap_setup/bob.rs +++ b/swap/src/network/swap_setup/bob.rs @@ -11,9 +11,7 @@ use futures::{AsyncWriteExt, FutureExt}; use libp2p::core::connection::ConnectionId; use libp2p::core::upgrade; use libp2p::swarm::{ - KeepAlive, NegotiatedSubstream, NetworkBehaviour, NetworkBehaviourAction, NotifyHandler, - PollParameters, ProtocolsHandler, ProtocolsHandlerEvent, ProtocolsHandlerUpgrErr, - SubstreamProtocol, + ConnectionDenied, ConnectionHandler, FromSwarm, KeepAlive, NegotiatedSubstream, NetworkBehaviour, NetworkBehaviourAction, NotifyHandler, PollParameters, ProtocolsHandler, ProtocolsHandlerEvent, ProtocolsHandlerUpgrErr, SubstreamProtocol, THandler, THandlerInEvent, THandlerOutEvent, ToSwarm }; use libp2p::{Multiaddr, PeerId}; use std::collections::VecDeque; @@ -53,42 +51,62 @@ impl From for cli::OutEvent { } impl NetworkBehaviour for Behaviour { - type ProtocolsHandler = Handler; - type OutEvent = Completed; + type ConnectionHandler = Handler; + type ToSwarm = ToSwarm; - fn new_handler(&mut self) -> Self::ProtocolsHandler { - Handler::new(self.env_config, self.bitcoin_wallet.clone()) + fn handle_established_inbound_connection( + &mut self, + connection_id: ConnectionId, + peer: PeerId, + local_addr: &Multiaddr, + remote_addr: &Multiaddr, + ) -> Result, ConnectionDenied> { + Ok(Handler::new(self.env_config, self.bitcoin_wallet.clone())) } - fn addresses_of_peer(&mut self, _: &PeerId) -> Vec { - Vec::new() + fn handle_established_outbound_connection( + &mut self, + connection_id: ConnectionId, + peer: PeerId, + addr: &Multiaddr, + role_override: libp2p::core::Endpoint, + ) -> Result, ConnectionDenied> { + Ok(Handler::new(self.env_config, self.bitcoin_wallet.clone())) } - fn inject_connected(&mut self, _: &PeerId) {} - - fn inject_disconnected(&mut self, _: &PeerId) {} + fn on_swarm_event(&mut self, event: FromSwarm) { + match event { + FromSwarm::ConnectionEstablished(_) => {}, + FromSwarm::ConnectionClosed(_) => {}, + _ => {}, + } + } - fn inject_event(&mut self, peer: PeerId, _: ConnectionId, completed: Completed) { - self.completed_swaps.push_back((peer, completed)); + /*fn on_connection_handler_event( + &mut self, + peer_id: PeerId, + _connection_id: ConnectionId, + event: ::OutEvent, + ) { + self.completed_swaps.push_back((peer_id, event)); + }*/ + + fn on_connection_handler_event( + &mut self, + peer_id: PeerId, + _connection_id: libp2p::swarm::ConnectionId, + event: THandlerOutEvent, + ) { + self.completed_swaps.push_back((peer_id, event)); } fn poll( &mut self, - _cx: &mut Context<'_>, - _params: &mut impl PollParameters, - ) -> Poll> { - if let Some((_, event)) = self.completed_swaps.pop_front() { - return Poll::Ready(NetworkBehaviourAction::GenerateEvent(event)); - } - - if let Some((peer, event)) = self.new_swaps.pop_front() { - return Poll::Ready(NetworkBehaviourAction::NotifyHandler { - peer_id: peer, - handler: NotifyHandler::Any, - event, - }); + cx: &mut Context<'_>, + ) -> Poll>> { + if let Some((peer, completed)) = self.completed_swaps.pop_front() { + return Poll::Ready(ToSwarm::GenerateEvent(completed)); } - Poll::Pending } } From 70ea2f1466a5ab0ed61e26b124f31f4d6d902e8c Mon Sep 17 00:00:00 2001 From: binarybaron Date: Thu, 17 Oct 2024 15:31:46 +0200 Subject: [PATCH 007/112] fix(libp2p): impl AsRef instead of ProtocolName trait (See: https://github.com/libp2p/rust-libp2p/pull/3746) --- swap/src/network/cooperative_xmr_redeem_after_punish.rs | 7 +++---- swap/src/network/encrypted_signature.rs | 5 ++--- swap/src/network/quote.rs | 5 ++--- swap/src/network/transfer_proof.rs | 5 ++--- 4 files changed, 9 insertions(+), 13 deletions(-) diff --git a/swap/src/network/cooperative_xmr_redeem_after_punish.rs b/swap/src/network/cooperative_xmr_redeem_after_punish.rs index fb9149e25..29a738c6c 100644 --- a/swap/src/network/cooperative_xmr_redeem_after_punish.rs +++ b/swap/src/network/cooperative_xmr_redeem_after_punish.rs @@ -1,7 +1,6 @@ use crate::monero::Scalar; use crate::network::cbor_request_response::CborCodec; use crate::{asb, cli}; -use libp2p::core::ProtocolName; use libp2p::request_response::{ ProtocolSupport, RequestResponse, RequestResponseConfig, RequestResponseEvent, RequestResponseMessage, @@ -19,9 +18,9 @@ pub type Behaviour = RequestResponse &[u8] { - PROTOCOL.as_bytes() +impl AsRef for CooperativeXmrRedeemProtocol { + fn as_ref(&self) -> &str { + PROTOCOL } } diff --git a/swap/src/network/encrypted_signature.rs b/swap/src/network/encrypted_signature.rs index 5f2cd8d72..a448e0b13 100644 --- a/swap/src/network/encrypted_signature.rs +++ b/swap/src/network/encrypted_signature.rs @@ -1,6 +1,5 @@ use crate::network::cbor_request_response::CborCodec; use crate::{asb, cli}; -use libp2p::core::ProtocolName; use libp2p::request_response::{ ProtocolSupport, RequestResponse, RequestResponseConfig, RequestResponseEvent, RequestResponseMessage, @@ -18,8 +17,8 @@ pub type Behaviour = RequestResponse &[u8] { +impl AsRef for EncryptedSignatureProtocol { + fn as_ref(&self) -> &str { PROTOCOL.as_bytes() } } diff --git a/swap/src/network/quote.rs b/swap/src/network/quote.rs index d5eccf0f4..140d381c6 100644 --- a/swap/src/network/quote.rs +++ b/swap/src/network/quote.rs @@ -1,6 +1,5 @@ use crate::network::json_pull_codec::JsonPullCodec; use crate::{asb, bitcoin, cli}; -use libp2p::core::ProtocolName; use libp2p::request_response::{ ProtocolSupport, RequestResponse, RequestResponseConfig, RequestResponseEvent, RequestResponseMessage, @@ -18,8 +17,8 @@ pub type Behaviour = RequestResponse>; #[derive(Debug, Clone, Copy, Default)] pub struct BidQuoteProtocol; -impl ProtocolName for BidQuoteProtocol { - fn protocol_name(&self) -> &[u8] { +impl AsRef for BidQuoteProtocol { + fn as_ref(&self) -> &str { PROTOCOL.as_bytes() } } diff --git a/swap/src/network/transfer_proof.rs b/swap/src/network/transfer_proof.rs index 98ab88ac2..2459c9520 100644 --- a/swap/src/network/transfer_proof.rs +++ b/swap/src/network/transfer_proof.rs @@ -1,6 +1,5 @@ use crate::network::cbor_request_response::CborCodec; use crate::{asb, cli, monero}; -use libp2p::core::ProtocolName; use libp2p::request_response::{ ProtocolSupport, RequestResponse, RequestResponseConfig, RequestResponseEvent, RequestResponseMessage, @@ -18,8 +17,8 @@ pub type Behaviour = RequestResponse &[u8] { +impl AsRef for TransferProofProtocol { + fn as_ref(&self) -> &str { PROTOCOL.as_bytes() } } From b4831687a46d0ff29e9cebe9936b8515d5d3147f Mon Sep 17 00:00:00 2001 From: binarybaron Date: Thu, 17 Oct 2024 15:35:10 +0200 Subject: [PATCH 008/112] fix(libp2p): Rename out_event to to_swarm in NetworkBehaviour derive macro (See: https://docs.rs/libp2p/latest/libp2p/swarm/trait.NetworkBehaviour.html#custom-networkbehaviour-with-the-derive-macro) --- swap/src/cli/behaviour.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swap/src/cli/behaviour.rs b/swap/src/cli/behaviour.rs index 3b65958d6..1501d5ec9 100644 --- a/swap/src/cli/behaviour.rs +++ b/swap/src/cli/behaviour.rs @@ -71,7 +71,7 @@ impl OutEvent { /// A `NetworkBehaviour` that represents an XMR/BTC swap node as Bob. #[derive(NetworkBehaviour)] -#[behaviour(out_event = "OutEvent", event_process = false)] +#[behaviour(to_swarm = "OutEvent")] #[allow(missing_debug_implementations)] pub struct Behaviour { pub quote: quote::Behaviour, From eea7ddc6b511d66f84fe53ad49054a32e306087b Mon Sep 17 00:00:00 2001 From: binarybaron Date: Thu, 17 Oct 2024 15:36:27 +0200 Subject: [PATCH 009/112] fix(libp2p): Handle Io errors in impl_from_rr_event macro (See: https://github.com/libp2p/rust-libp2p/pull/5429) --- swap/src/network/impl_from_rr_event.rs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/swap/src/network/impl_from_rr_event.rs b/swap/src/network/impl_from_rr_event.rs index 9c4b99164..b5cc99049 100644 --- a/swap/src/network/impl_from_rr_event.rs +++ b/swap/src/network/impl_from_rr_event.rs @@ -30,8 +30,14 @@ macro_rules! impl_from_rr_event { peer, } } + Io(err) => { + Self::Failure { + error: anyhow!("{} failed because of an IO error: {}", $protocol, err), + peer, + } + } UnsupportedProtocols => Self::Other, // TODO: Report this and disconnected / ban the peer? - ResponseOmission => Self::Other + ResponseOmission => Self::Other, } } OutboundFailure { peer, error, .. } => { @@ -57,8 +63,14 @@ macro_rules! impl_from_rr_event { peer, } } + Io(err) => { + Self::Failure { + error: anyhow!("{} failed because of an IO error: {}", $protocol, err), + peer, + } + } } - } + }, } } } From a7e394df46b28234b5bbd76de38f4f72c369dfd0 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Thu, 17 Oct 2024 15:47:21 +0200 Subject: [PATCH 010/112] fix(libp2p): Replace RequestId with OutboundRequestId in cli/event_loop.rs --- swap/src/cli/event_loop.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/swap/src/cli/event_loop.rs b/swap/src/cli/event_loop.rs index 181e58bd7..1ea684877 100644 --- a/swap/src/cli/event_loop.rs +++ b/swap/src/cli/event_loop.rs @@ -10,9 +10,8 @@ use crate::protocol::Database; use anyhow::{Context, Result}; use futures::future::{BoxFuture, OptionFuture}; use futures::{FutureExt, StreamExt}; -use libp2p::request_response::{RequestId, ResponseChannel}; +use libp2p::request_response::{InboundRequestId, ResponseChannel}; use libp2p::swarm::dial_opts::DialOpts; -use libp2p::swarm::NetworkBehaviour; use libp2p::swarm::SwarmEvent; use libp2p::{PeerId, Swarm}; use std::collections::HashMap; @@ -36,10 +35,10 @@ pub struct EventLoop { // these represents requests that are currently in-flight. // once we get a response to a matching [`RequestId`], we will use the responder to relay the // response. - inflight_quote_requests: HashMap>, - inflight_encrypted_signature_requests: HashMap>, + inflight_quote_requests: HashMap>, + inflight_encrypted_signature_requests: HashMap>, inflight_swap_setup: Option>>, - inflight_cooperative_xmr_redeem_requests: HashMap>, + inflight_cooperative_xmr_redeem_requests: HashMap>, /// The sender we will use to relay incoming transfer proofs. transfer_proof: bmrng::RequestSender, /// The future representing the successful handling of an incoming transfer From c1b660793848a4b46c02e5902e518aa2980b0269 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Thu, 17 Oct 2024 19:14:23 +0200 Subject: [PATCH 011/112] refactor(libp2p): Use new request_response imports, syntax. Use internal cbor impl, remove custom one (See: Remove custom cbor request response implementation, replaced with one from library (See: github.com/libp2p/rust-libp2p/pull/3952) --- Cargo.lock | 11 +++ swap/Cargo.toml | 2 +- swap/src/cli.rs | 4 +- swap/src/cli/list_sellers.rs | 32 +++--- swap/src/network/cbor_request_response.rs | 98 ------------------- .../cooperative_xmr_redeem_after_punish.rs | 21 ++-- swap/src/network/encrypted_signature.rs | 23 ++--- swap/src/network/impl_from_rr_event.rs | 2 +- swap/src/network/quote.rs | 18 ++-- swap/src/network/transfer_proof.rs | 18 ++-- 10 files changed, 61 insertions(+), 168 deletions(-) delete mode 100644 swap/src/network/cbor_request_response.rs diff --git a/Cargo.lock b/Cargo.lock index 939ba1078..de63ef17f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -963,6 +963,15 @@ dependencies = [ "toml 0.8.2", ] +[[package]] +name = "cbor4ii" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "472931dd4dfcc785075b09be910147f9c6258883fc4591d0dac6116392b2daa6" +dependencies = [ + "serde", +] + [[package]] name = "cc" version = "1.1.28" @@ -3978,6 +3987,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c314fe28368da5e3a262553fb0ad575c1c8934c461e10de10265551478163836" dependencies = [ "async-trait", + "cbor4ii", "futures", "futures-bounded", "futures-timer", @@ -3986,6 +3996,7 @@ dependencies = [ "libp2p-identity", "libp2p-swarm", "rand 0.8.5", + "serde", "smallvec", "tracing", "void", diff --git a/swap/Cargo.toml b/swap/Cargo.toml index 414646cf9..3964d0b6f 100644 --- a/swap/Cargo.toml +++ b/swap/Cargo.toml @@ -43,7 +43,7 @@ hyper = "0.14.20" itertools = "0.13" jsonrpsee = { version = "0.16.2", features = [ "server" ] } jsonrpsee-core = "0.16.2" -libp2p = { version = "0.53.2", default-features = false, features = [ "tcp", "yamux", "dns", "noise", "request-response", "websocket", "ping", "rendezvous", "identify", "macros" ] } +libp2p = { version = "0.53.2", features = [ "tcp", "yamux", "dns", "noise", "request-response", "websocket", "ping", "rendezvous", "identify", "macros", "cbor" ] } monero = { version = "0.12", features = [ "serde_support" ] } monero-rpc = { path = "../monero-rpc" } once_cell = "1.19" diff --git a/swap/src/cli.rs b/swap/src/cli.rs index f881737c4..871a8b80a 100644 --- a/swap/src/cli.rs +++ b/swap/src/cli.rs @@ -24,7 +24,7 @@ mod tests { use crate::network::test::{new_swarm, SwarmExt}; use futures::StreamExt; use libp2p::multiaddr::Protocol; - use libp2p::request_response::RequestResponseEvent; + use libp2p::request_response::request_response::Event; use libp2p::swarm::{AddressScore, NetworkBehaviourEventProcess}; use libp2p::{identity, rendezvous, Multiaddr, PeerId}; use std::collections::HashSet; @@ -144,7 +144,7 @@ mod tests { } impl NetworkBehaviourEventProcess for StaticQuoteAsbBehaviour { fn inject_event(&mut self, event: quote::OutEvent) { - if let RequestResponseEvent::Message { + if let request_response::Event::Message { message: quote::Message::Request { channel, .. }, .. } = event diff --git a/swap/src/cli/list_sellers.rs b/swap/src/cli/list_sellers.rs index 2395e1c2f..560b64a5a 100644 --- a/swap/src/cli/list_sellers.rs +++ b/swap/src/cli/list_sellers.rs @@ -4,11 +4,10 @@ use crate::network::{quote, swarm}; use anyhow::{Context, Result}; use futures::StreamExt; use libp2p::multiaddr::Protocol; -use libp2p::ping::{Ping, PingConfig, PingEvent}; -use libp2p::request_response::{RequestResponseEvent, RequestResponseMessage}; +use libp2p::request_response; use libp2p::swarm::dial_opts::DialOpts; use libp2p::swarm::{behaviour, NetworkBehaviour, SwarmEvent}; -use libp2p::{identity, rendezvous, Multiaddr, PeerId, Swarm}; +use libp2p::{identity, ping, rendezvous, Multiaddr, PeerId, Swarm}; use serde::Serialize; use serde_with::{serde_as, DisplayFromStr}; use std::collections::hash_map::Entry; @@ -32,9 +31,10 @@ pub async fn list_sellers( let behaviour = Behaviour { rendezvous: rendezvous::client::Behaviour::new(identity.clone()), quote: quote::cli(), - ping: Ping::new( - PingConfig::new() - .with_keep_alive(false) + ping: ping::Behaviour::new( + ping::Config::new() + // TODO (libp2p upgrade): Keep alive the connection here + //.with_keep_alive(false) .with_interval(Duration::from_secs(86_400)), ), }; @@ -83,7 +83,7 @@ pub enum Status { enum OutEvent { Rendezvous(rendezvous::client::Event), Quote(quote::OutEvent), - Ping(PingEvent), + Ping(ping::Event), } impl From for OutEvent { @@ -104,7 +104,7 @@ impl From for OutEvent { struct Behaviour { rendezvous: rendezvous::client::Behaviour, quote: quote::Behaviour, - ping: Ping, + ping: ping::Behaviour, } #[derive(Debug)] @@ -237,18 +237,18 @@ impl EventLoop { } SwarmEvent::Behaviour(OutEvent::Quote(quote_response)) => { match quote_response { - RequestResponseEvent::Message { peer, message } => { + request_response::Event::Message { peer, message } => { match message { - RequestResponseMessage::Response { response, .. } => { + request_response::Message::Response { response, .. } => { if self.asb_quote_status.insert(peer, QuoteStatus::Received(Status::Online(response))).is_none() { tracing::error!(%peer, "Received bid quote from unexpected peer, this record will be removed!"); self.asb_quote_status.remove(&peer); } } - RequestResponseMessage::Request { .. } => unreachable!() + request_response::Message::Request { .. } => unreachable!() } } - RequestResponseEvent::OutboundFailure { peer, error, .. } => { + request_response::Event::OutboundFailure { peer, error, .. } => { if peer == self.rendezvous_peer_id { tracing::debug!(%peer, "Outbound failure when communicating with rendezvous node: {:#}", error); } else { @@ -256,7 +256,7 @@ impl EventLoop { self.asb_quote_status.remove(&peer); } } - RequestResponseEvent::InboundFailure { peer, error, .. } => { + request_response::Event::InboundFailure { peer, error, .. } => { if peer == self.rendezvous_peer_id { tracing::debug!(%peer, "Inbound failure when communicating with rendezvous node: {:#}", error); } else { @@ -264,7 +264,7 @@ impl EventLoop { self.asb_quote_status.remove(&peer); } }, - RequestResponseEvent::ResponseSent { .. } => unreachable!() + request_response::Event::ResponseSent { .. } => unreachable!() } } _ => {} @@ -323,8 +323,8 @@ impl EventLoop { #[derive(Debug)] struct StillPending {} -impl From for OutEvent { - fn from(event: PingEvent) -> Self { +impl From for OutEvent { + fn from(event: ping::Event) -> Self { OutEvent::Ping(event) } } diff --git a/swap/src/network/cbor_request_response.rs b/swap/src/network/cbor_request_response.rs deleted file mode 100644 index 634dd729e..000000000 --- a/swap/src/network/cbor_request_response.rs +++ /dev/null @@ -1,98 +0,0 @@ -use async_trait::async_trait; -use futures::prelude::*; -use libp2p::core::upgrade; -use libp2p::request_response::{ProtocolName, RequestResponseCodec}; -use serde::de::DeserializeOwned; -use serde::Serialize; -use std::fmt::Debug; -use std::io; -use std::marker::PhantomData; - -/// Message receive buffer. -pub const BUF_SIZE: usize = 1024 * 1024; - -#[derive(Clone, Copy, Debug)] -pub struct CborCodec { - phantom: PhantomData<(P, Req, Res)>, -} - -impl Default for CborCodec { - fn default() -> Self { - Self { - phantom: PhantomData, - } - } -} - -#[async_trait] -impl RequestResponseCodec for CborCodec -where - P: ProtocolName + Send + Sync + Clone, - Req: DeserializeOwned + Serialize + Send, - Res: DeserializeOwned + Serialize + Send, -{ - type Protocol = P; - type Request = Req; - type Response = Res; - - async fn read_request(&mut self, _: &Self::Protocol, io: &mut T) -> io::Result - where - T: AsyncRead + Unpin + Send, - { - let message = upgrade::read_length_prefixed(io, BUF_SIZE).await?; - let mut de = serde_cbor::Deserializer::from_slice(&message); - let msg = Req::deserialize(&mut de) - .map_err(|error| io::Error::new(io::ErrorKind::Other, error))?; - - Ok(msg) - } - - async fn read_response( - &mut self, - _: &Self::Protocol, - io: &mut T, - ) -> io::Result - where - T: AsyncRead + Unpin + Send, - { - let message = upgrade::read_length_prefixed(io, BUF_SIZE).await?; - let mut de = serde_cbor::Deserializer::from_slice(&message); - let msg = Res::deserialize(&mut de) - .map_err(|error| io::Error::new(io::ErrorKind::InvalidData, error))?; - - Ok(msg) - } - - async fn write_request( - &mut self, - _: &Self::Protocol, - io: &mut T, - req: Self::Request, - ) -> io::Result<()> - where - T: AsyncWrite + Unpin + Send, - { - let bytes = - serde_cbor::to_vec(&req).map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e))?; - - upgrade::write_length_prefixed(io, &bytes).await?; - - Ok(()) - } - - async fn write_response( - &mut self, - _: &Self::Protocol, - io: &mut T, - res: Self::Response, - ) -> io::Result<()> - where - T: AsyncWrite + Unpin + Send, - { - let bytes = serde_cbor::to_vec(&res) - .map_err(|error| io::Error::new(io::ErrorKind::InvalidData, error))?; - upgrade::write_length_prefixed(io, &bytes).await?; - - Ok(()) - } -} diff --git a/swap/src/network/cooperative_xmr_redeem_after_punish.rs b/swap/src/network/cooperative_xmr_redeem_after_punish.rs index 29a738c6c..f0a9ea4db 100644 --- a/swap/src/network/cooperative_xmr_redeem_after_punish.rs +++ b/swap/src/network/cooperative_xmr_redeem_after_punish.rs @@ -1,19 +1,15 @@ use crate::monero::Scalar; -use crate::network::cbor_request_response::CborCodec; use crate::{asb, cli}; -use libp2p::request_response::{ - ProtocolSupport, RequestResponse, RequestResponseConfig, RequestResponseEvent, - RequestResponseMessage, -}; -use libp2p::PeerId; +use libp2p::request_response::ProtocolSupport; +use libp2p::{request_response, PeerId}; use serde::{Deserialize, Serialize}; use uuid::Uuid; const PROTOCOL: &str = "/comit/xmr/btc/cooperative_xmr_redeem_after_punish/1.0.0"; -type OutEvent = RequestResponseEvent; -type Message = RequestResponseMessage; +type OutEvent = request_response::Event; +type Message = request_response::Message; -pub type Behaviour = RequestResponse>; +pub type Behaviour = request_response::cbor::Behaviour; #[derive(Debug, Clone, Copy, Default)] pub struct CooperativeXmrRedeemProtocol; @@ -50,19 +46,18 @@ pub enum Response { reason: CooperativeXmrRedeemRejectReason, }, } + pub fn alice() -> Behaviour { Behaviour::new( - CborCodec::default(), vec![(CooperativeXmrRedeemProtocol, ProtocolSupport::Inbound)], - RequestResponseConfig::default(), + request_response::Config::default(), ) } pub fn bob() -> Behaviour { Behaviour::new( - CborCodec::default(), vec![(CooperativeXmrRedeemProtocol, ProtocolSupport::Outbound)], - RequestResponseConfig::default(), + request_response::Config::default(), ) } diff --git a/swap/src/network/encrypted_signature.rs b/swap/src/network/encrypted_signature.rs index a448e0b13..52afb3f5b 100644 --- a/swap/src/network/encrypted_signature.rs +++ b/swap/src/network/encrypted_signature.rs @@ -1,18 +1,14 @@ -use crate::network::cbor_request_response::CborCodec; use crate::{asb, cli}; -use libp2p::request_response::{ - ProtocolSupport, RequestResponse, RequestResponseConfig, RequestResponseEvent, - RequestResponseMessage, -}; +use libp2p::request_response::{self, ProtocolSupport}; use libp2p::PeerId; use serde::{Deserialize, Serialize}; use uuid::Uuid; const PROTOCOL: &str = "/comit/xmr/btc/encrypted_signature/1.0.0"; -type OutEvent = RequestResponseEvent; -type Message = RequestResponseMessage; +type OutEvent = request_response::Event; +type Message = request_response::Message; -pub type Behaviour = RequestResponse>; +pub type Behaviour = request_response::cbor::Behaviour; #[derive(Debug, Clone, Copy, Default)] pub struct EncryptedSignatureProtocol; @@ -31,17 +27,18 @@ pub struct Request { pub fn alice() -> Behaviour { Behaviour::new( - CborCodec::default(), vec![(EncryptedSignatureProtocol, ProtocolSupport::Inbound)], - RequestResponseConfig::default(), + request_response::Config::default(), ) } pub fn bob() -> Behaviour { Behaviour::new( - CborCodec::default(), - vec![(EncryptedSignatureProtocol, ProtocolSupport::Outbound)], - RequestResponseConfig::default(), + vec![( + EncryptedSignatureProtocol, + request_response::ProtocolSupport::Outbound, + )], + request_response::Config::default(), ) } diff --git a/swap/src/network/impl_from_rr_event.rs b/swap/src/network/impl_from_rr_event.rs index b5cc99049..907bd944c 100644 --- a/swap/src/network/impl_from_rr_event.rs +++ b/swap/src/network/impl_from_rr_event.rs @@ -1,4 +1,4 @@ -/// Helper macro to map a [`RequestResponseEvent`] to our [`OutEvent`]. +/// Helper macro to map a [`request_response::Event`] to our [`OutEvent`]. /// /// This is primarily a macro and not a regular function because we use it for /// Alice and Bob and they have different [`OutEvent`]s that just happen to diff --git a/swap/src/network/quote.rs b/swap/src/network/quote.rs index 140d381c6..87d26eb01 100644 --- a/swap/src/network/quote.rs +++ b/swap/src/network/quote.rs @@ -1,18 +1,14 @@ -use crate::network::json_pull_codec::JsonPullCodec; use crate::{asb, bitcoin, cli}; -use libp2p::request_response::{ - ProtocolSupport, RequestResponse, RequestResponseConfig, RequestResponseEvent, - RequestResponseMessage, -}; +use libp2p::request_response::{self, ProtocolSupport}; use libp2p::PeerId; use serde::{Deserialize, Serialize}; use typeshare::typeshare; const PROTOCOL: &str = "/comit/xmr/btc/bid-quote/1.0.0"; -pub type OutEvent = RequestResponseEvent<(), BidQuote>; -pub type Message = RequestResponseMessage<(), BidQuote>; +type OutEvent = request_response::Event<(), BidQuote>; +type Message = request_response::Message<(), BidQuote>; -pub type Behaviour = RequestResponse>; +pub type Behaviour = request_response::cbor::Behaviour<(), BidQuote>; #[derive(Debug, Clone, Copy, Default)] pub struct BidQuoteProtocol; @@ -52,9 +48,8 @@ pub struct ZeroQuoteReceived; /// handing out quotes. pub fn asb() -> Behaviour { Behaviour::new( - JsonPullCodec::default(), vec![(BidQuoteProtocol, ProtocolSupport::Inbound)], - RequestResponseConfig::default(), + request_response::Config::default(), ) } @@ -64,9 +59,8 @@ pub fn asb() -> Behaviour { /// requesting quotes. pub fn cli() -> Behaviour { Behaviour::new( - JsonPullCodec::default(), vec![(BidQuoteProtocol, ProtocolSupport::Outbound)], - RequestResponseConfig::default(), + request_response::Config::default(), ) } diff --git a/swap/src/network/transfer_proof.rs b/swap/src/network/transfer_proof.rs index 2459c9520..badb548c3 100644 --- a/swap/src/network/transfer_proof.rs +++ b/swap/src/network/transfer_proof.rs @@ -1,18 +1,14 @@ -use crate::network::cbor_request_response::CborCodec; use crate::{asb, cli, monero}; -use libp2p::request_response::{ - ProtocolSupport, RequestResponse, RequestResponseConfig, RequestResponseEvent, - RequestResponseMessage, -}; +use libp2p::request_response::{self, ProtocolSupport}; use libp2p::PeerId; use serde::{Deserialize, Serialize}; use uuid::Uuid; const PROTOCOL: &str = "/comit/xmr/btc/transfer_proof/1.0.0"; -type OutEvent = RequestResponseEvent; -type Message = RequestResponseMessage; +type OutEvent = request_response::Event; +type Message = request_response::Message; -pub type Behaviour = RequestResponse>; +pub type Behaviour = request_response::cbor::Behaviour; #[derive(Debug, Clone, Copy, Default)] pub struct TransferProofProtocol; @@ -31,17 +27,15 @@ pub struct Request { pub fn alice() -> Behaviour { Behaviour::new( - CborCodec::default(), vec![(TransferProofProtocol, ProtocolSupport::Outbound)], - RequestResponseConfig::default(), + request_response::Config::default(), ) } pub fn bob() -> Behaviour { Behaviour::new( - CborCodec::default(), vec![(TransferProofProtocol, ProtocolSupport::Inbound)], - RequestResponseConfig::default(), + request_response::Config::default(), ) } From df64e764a8537ac44f281b81a15be7e3cf6a8ca9 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Fri, 18 Oct 2024 12:36:41 +0200 Subject: [PATCH 012/112] fix(libp2p): Use native json request_response impl, remove custom one --- Cargo.lock | 1 + swap/Cargo.toml | 2 +- swap/src/network.rs | 2 - swap/src/network/json_pull_codec.rs | 95 ----------------------------- swap/src/network/quote.rs | 2 +- 5 files changed, 3 insertions(+), 99 deletions(-) delete mode 100644 swap/src/network/json_pull_codec.rs diff --git a/Cargo.lock b/Cargo.lock index de63ef17f..5054ed66f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3997,6 +3997,7 @@ dependencies = [ "libp2p-swarm", "rand 0.8.5", "serde", + "serde_json", "smallvec", "tracing", "void", diff --git a/swap/Cargo.toml b/swap/Cargo.toml index 3964d0b6f..c16a78c83 100644 --- a/swap/Cargo.toml +++ b/swap/Cargo.toml @@ -43,7 +43,7 @@ hyper = "0.14.20" itertools = "0.13" jsonrpsee = { version = "0.16.2", features = [ "server" ] } jsonrpsee-core = "0.16.2" -libp2p = { version = "0.53.2", features = [ "tcp", "yamux", "dns", "noise", "request-response", "websocket", "ping", "rendezvous", "identify", "macros", "cbor" ] } +libp2p = { version = "0.53.2", features = [ "tcp", "yamux", "dns", "noise", "request-response", "websocket", "ping", "rendezvous", "identify", "macros", "cbor", "json" ] } monero = { version = "0.12", features = [ "serde_support" ] } monero-rpc = { path = "../monero-rpc" } once_cell = "1.19" diff --git a/swap/src/network.rs b/swap/src/network.rs index 893881201..afaca7fde 100644 --- a/swap/src/network.rs +++ b/swap/src/network.rs @@ -1,9 +1,7 @@ mod impl_from_rr_event; -pub mod cbor_request_response; pub mod cooperative_xmr_redeem_after_punish; pub mod encrypted_signature; -pub mod json_pull_codec; pub mod quote; pub mod redial; pub mod rendezvous; diff --git a/swap/src/network/json_pull_codec.rs b/swap/src/network/json_pull_codec.rs deleted file mode 100644 index 01fcf494b..000000000 --- a/swap/src/network/json_pull_codec.rs +++ /dev/null @@ -1,95 +0,0 @@ -use async_trait::async_trait; -use futures::prelude::*; -use libp2p::core::upgrade; -use libp2p::request_response::{ProtocolName, RequestResponseCodec}; -use serde::de::DeserializeOwned; -use serde::Serialize; -use std::fmt::Debug; -use std::io; -use std::marker::PhantomData; - -/// Message receive buffer. -pub const BUF_SIZE: usize = 1024 * 1024; - -/// A [`RequestResponseCodec`] for pull-based protocols where the response is -/// encoded using JSON. -/// -/// A pull-based protocol is a protocol where the dialer doesn't send any -/// message and expects the listener to directly send the response as the -/// substream is opened. -#[derive(Clone, Copy, Debug)] -pub struct JsonPullCodec { - phantom: PhantomData<(P, Res)>, -} - -impl Default for JsonPullCodec { - fn default() -> Self { - Self { - phantom: PhantomData, - } - } -} - -#[async_trait] -impl RequestResponseCodec for JsonPullCodec -where - P: ProtocolName + Send + Sync + Clone, - Res: DeserializeOwned + Serialize + Send, -{ - type Protocol = P; - type Request = (); - type Response = Res; - - async fn read_request(&mut self, _: &Self::Protocol, _: &mut T) -> io::Result - where - T: AsyncRead + Unpin + Send, - { - Ok(()) - } - - async fn read_response( - &mut self, - _: &Self::Protocol, - io: &mut T, - ) -> io::Result - where - T: AsyncRead + Unpin + Send, - { - let message = upgrade::read_length_prefixed(io, BUF_SIZE) - .await - .map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e))?; - let mut de = serde_json::Deserializer::from_slice(&message); - let msg = Res::deserialize(&mut de) - .map_err(|error| io::Error::new(io::ErrorKind::InvalidData, error))?; - - Ok(msg) - } - - async fn write_request( - &mut self, - _: &Self::Protocol, - _: &mut T, - _: Self::Request, - ) -> io::Result<()> - where - T: AsyncWrite + Unpin + Send, - { - Ok(()) - } - - async fn write_response( - &mut self, - _: &Self::Protocol, - io: &mut T, - res: Self::Response, - ) -> io::Result<()> - where - T: AsyncWrite + Unpin + Send, - { - let bytes = serde_json::to_vec(&res) - .map_err(|error| io::Error::new(io::ErrorKind::InvalidData, error))?; - upgrade::write_length_prefixed(io, &bytes).await?; - - Ok(()) - } -} diff --git a/swap/src/network/quote.rs b/swap/src/network/quote.rs index 87d26eb01..c6c883bf2 100644 --- a/swap/src/network/quote.rs +++ b/swap/src/network/quote.rs @@ -8,7 +8,7 @@ const PROTOCOL: &str = "/comit/xmr/btc/bid-quote/1.0.0"; type OutEvent = request_response::Event<(), BidQuote>; type Message = request_response::Message<(), BidQuote>; -pub type Behaviour = request_response::cbor::Behaviour<(), BidQuote>; +pub type Behaviour = request_response::json::Behaviour<(), BidQuote>; #[derive(Debug, Clone, Copy, Default)] pub struct BidQuoteProtocol; From 0b8f57855df24c408ea2f6372a219f3048630ed2 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Fri, 18 Oct 2024 12:44:22 +0200 Subject: [PATCH 013/112] wip(libp2p): Use new API for swap/src/network/swap_setup/bob.rs (See https://github.com/libp2p/rust-libp2p/pull/3848 and https://github.com/libp2p/rust-libp2p/blob/master/swarm/CHANGELOG.md) --- swap/src/network/swap_setup/bob.rs | 235 ++++++++++++++--------------- 1 file changed, 117 insertions(+), 118 deletions(-) diff --git a/swap/src/network/swap_setup/bob.rs b/swap/src/network/swap_setup/bob.rs index 6b905495d..38566dde1 100644 --- a/swap/src/network/swap_setup/bob.rs +++ b/swap/src/network/swap_setup/bob.rs @@ -1,17 +1,14 @@ -use crate::network::swap_setup::{ - protocol, read_cbor_message, write_cbor_message, BlockchainNetwork, SpotPriceError, - SpotPriceRequest, SpotPriceResponse, -}; +use crate::network::swap_setup::{protocol, BlockchainNetwork, SpotPriceError, SpotPriceResponse}; use crate::protocol::bob::{State0, State2}; use crate::protocol::{Message1, Message3}; use crate::{bitcoin, cli, env, monero}; use anyhow::Result; use futures::future::{BoxFuture, OptionFuture}; -use futures::{AsyncWriteExt, FutureExt}; -use libp2p::core::connection::ConnectionId; +use futures::FutureExt; use libp2p::core::upgrade; use libp2p::swarm::{ - ConnectionDenied, ConnectionHandler, FromSwarm, KeepAlive, NegotiatedSubstream, NetworkBehaviour, NetworkBehaviourAction, NotifyHandler, PollParameters, ProtocolsHandler, ProtocolsHandlerEvent, ProtocolsHandlerUpgrErr, SubstreamProtocol, THandler, THandlerInEvent, THandlerOutEvent, ToSwarm + ConnectionDenied, ConnectionHandler, ConnectionHandlerEvent, ConnectionId, FromSwarm, + NetworkBehaviour, SubstreamProtocol, THandler, THandlerInEvent, THandlerOutEvent, ToSwarm, }; use libp2p::{Multiaddr, PeerId}; use std::collections::VecDeque; @@ -19,7 +16,8 @@ use std::sync::Arc; use std::task::{Context, Poll}; use std::time::Duration; use uuid::Uuid; -use void::Void; + +use super::{read_cbor_message, write_cbor_message, SpotPriceRequest}; #[allow(missing_debug_implementations)] pub struct Behaviour { @@ -52,7 +50,7 @@ impl From for cli::OutEvent { impl NetworkBehaviour for Behaviour { type ConnectionHandler = Handler; - type ToSwarm = ToSwarm; + type ToSwarm = Completed; fn handle_established_inbound_connection( &mut self, @@ -76,26 +74,17 @@ impl NetworkBehaviour for Behaviour { fn on_swarm_event(&mut self, event: FromSwarm) { match event { - FromSwarm::ConnectionEstablished(_) => {}, - FromSwarm::ConnectionClosed(_) => {}, - _ => {}, + FromSwarm::ConnectionEstablished(_) => {} + FromSwarm::ConnectionClosed(_) => {} + _ => {} } } - /*fn on_connection_handler_event( + fn on_connection_handler_event( &mut self, peer_id: PeerId, - _connection_id: ConnectionId, - event: ::OutEvent, - ) { - self.completed_swaps.push_back((peer_id, event)); - }*/ - - fn on_connection_handler_event( - &mut self, - peer_id: PeerId, - _connection_id: libp2p::swarm::ConnectionId, - event: THandlerOutEvent, + _connection_id: libp2p::swarm::ConnectionId, + event: THandlerOutEvent, ) { self.completed_swaps.push_back((peer_id, event)); } @@ -119,7 +108,7 @@ pub struct Handler { timeout: Duration, new_swaps: VecDeque, bitcoin_wallet: Arc, - keep_alive: KeepAlive, + keep_alive: bool, } impl Handler { @@ -130,7 +119,7 @@ impl Handler { timeout: Duration::from_secs(120), new_swaps: VecDeque::default(), bitcoin_wallet, - keep_alive: KeepAlive::Yes, + keep_alive: true, } } } @@ -147,10 +136,9 @@ pub struct NewSwap { #[derive(Debug)] pub struct Completed(Result); -impl ProtocolsHandler for Handler { - type InEvent = NewSwap; - type OutEvent = Completed; - type Error = Void; +impl ConnectionHandler for Handler { + type FromBehaviour = NewSwap; + type ToBehaviour = Completed; type InboundProtocol = upgrade::DeniedUpgrade; type OutboundProtocol = protocol::SwapSetup; type InboundOpenInfo = (); @@ -160,114 +148,125 @@ impl ProtocolsHandler for Handler { SubstreamProtocol::new(upgrade::DeniedUpgrade, ()) } - fn inject_fully_negotiated_inbound(&mut self, _: Void, _: Self::InboundOpenInfo) { - unreachable!("Bob does not support inbound substreams") - } - - fn inject_fully_negotiated_outbound( - &mut self, - mut substream: NegotiatedSubstream, - info: Self::OutboundOpenInfo, - ) { - let bitcoin_wallet = self.bitcoin_wallet.clone(); - let env_config = self.env_config; - - let protocol = tokio::time::timeout(self.timeout, async move { - write_cbor_message( - &mut substream, - SpotPriceRequest { - btc: info.btc, - blockchain_network: BlockchainNetwork { - bitcoin: env_config.bitcoin_network, - monero: env_config.monero_network, - }, - }, - ) - .await?; - - let xmr = Result::from(read_cbor_message::(&mut substream).await?)?; - - let state0 = State0::new( - info.swap_id, - &mut rand::thread_rng(), - info.btc, - xmr, - env_config.bitcoin_cancel_timelock, - env_config.bitcoin_punish_timelock, - info.bitcoin_refund_address, - env_config.monero_finality_confirmations, - info.tx_refund_fee, - info.tx_cancel_fee, - ); - - write_cbor_message(&mut substream, state0.next_message()).await?; - let message1 = read_cbor_message::(&mut substream).await?; - let state1 = state0.receive(bitcoin_wallet.as_ref(), message1).await?; - - write_cbor_message(&mut substream, state1.next_message()).await?; - let message3 = read_cbor_message::(&mut substream).await?; - let state2 = state1.receive(message3)?; - - write_cbor_message(&mut substream, state2.next_message()).await?; - - substream.flush().await?; - substream.close().await?; - - Ok(state2) - }); - - let max_seconds = self.timeout.as_secs(); - self.outbound_stream = OptionFuture::from(Some( - async move { - protocol.await.map_err(|_| Error::Timeout { - seconds: max_seconds, - })? - } - .boxed(), - )); - } - - fn inject_event(&mut self, new_swap: Self::InEvent) { + fn on_behaviour_event(&mut self, new_swap: Self::FromBehaviour) { self.new_swaps.push_back(new_swap); } - fn inject_dial_upgrade_error( - &mut self, - _: Self::OutboundOpenInfo, - _: ProtocolsHandlerUpgrErr, - ) { - } - - fn connection_keep_alive(&self) -> KeepAlive { + fn connection_keep_alive(&self) -> bool { self.keep_alive } - #[allow(clippy::type_complexity)] fn poll( &mut self, cx: &mut Context<'_>, ) -> Poll< - ProtocolsHandlerEvent< - Self::OutboundProtocol, - Self::OutboundOpenInfo, - Self::OutEvent, - Self::Error, - >, + ConnectionHandlerEvent, > { if let Some(new_swap) = self.new_swaps.pop_front() { - self.keep_alive = KeepAlive::Yes; - return Poll::Ready(ProtocolsHandlerEvent::OutboundSubstreamRequest { + self.keep_alive = true; + return Poll::Ready(ConnectionHandlerEvent::OutboundSubstreamRequest { protocol: SubstreamProtocol::new(protocol::new(), new_swap), }); } - if let Some(result) = futures::ready!(self.outbound_stream.poll_unpin(cx)) { - self.outbound_stream = OptionFuture::from(None); - return Poll::Ready(ProtocolsHandlerEvent::Custom(Completed(result))); + if let Some(outbound_stream) = self.outbound_stream.as_mut() { + if let Poll::Ready(result) = outbound_stream.poll_unpin(cx) { + self.outbound_stream = None; + self.keep_alive = false; // Set to false after completing the stream + return Poll::Ready(ConnectionHandlerEvent::Custom(Completed(result))); + } } Poll::Pending } + + fn on_connection_event( + &mut self, + event: libp2p::swarm::handler::ConnectionEvent< + Self::InboundProtocol, + Self::OutboundProtocol, + Self::InboundOpenInfo, + Self::OutboundOpenInfo, + >, + ) { + match event { + libp2p::swarm::handler::ConnectionEvent::FullyNegotiatedInbound(_, _) => { + unreachable!("Bob does not support inbound substreams") + } + libp2p::swarm::handler::ConnectionEvent::FullyNegotiatedOutbound(outbound) => { + let mut substream = outbound.protocol; + let info = outbound.info; + + let bitcoin_wallet = self.bitcoin_wallet.clone(); + let env_config = self.env_config; + + let bitcoin_wallet = self.bitcoin_wallet.clone(); + let env_config = self.env_config; + + let protocol = tokio::time::timeout(self.timeout, async move { + write_cbor_message( + &mut substream, + SpotPriceRequest { + btc: info.btc, + blockchain_network: BlockchainNetwork { + bitcoin: env_config.bitcoin_network, + monero: env_config.monero_network, + }, + }, + ) + .await?; + + let xmr = Result::from( + read_cbor_message::(&mut substream).await?, + )?; + + let state0 = State0::new( + info.swap_id, + &mut rand::thread_rng(), + info.btc, + xmr, + env_config.bitcoin_cancel_timelock, + env_config.bitcoin_punish_timelock, + info.bitcoin_refund_address, + env_config.monero_finality_confirmations, + info.tx_refund_fee, + info.tx_cancel_fee, + ); + + write_cbor_message(&mut substream, state0.next_message()).await?; + let message1 = read_cbor_message::(&mut substream).await?; + let state1 = state0.receive(bitcoin_wallet.as_ref(), message1).await?; + + write_cbor_message(&mut substream, state1.next_message()).await?; + let message3 = read_cbor_message::(&mut substream).await?; + let state2 = state1.receive(message3)?; + + write_cbor_message(&mut substream, state2.next_message()).await?; + + substream.flush().await?; + substream.close().await?; + + Ok(state2) + }); + + let max_seconds = self.timeout.as_secs(); + self.outbound_stream = Some(Box::pin( + async move { + protocol.await.map_err(|_| Error::Timeout { + seconds: max_seconds, + })? + } + .boxed(), + )); + self.keep_alive = true; // Ensure the connection stays alive while processing + } + libp2p::swarm::handler::ConnectionEvent::DialUpgradeError(dial_upgrade_err) => { + // Handle dial upgrade error if needed + self.keep_alive = false; // Consider setting to false on error + } + _ => {} + } + } } impl From for Result { From bdd67a1d9e826bf49e172304f13d1adaab05d472 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Fri, 18 Oct 2024 15:51:38 +0200 Subject: [PATCH 014/112] fix(libp2p): Use new API for mplex, yamux, noise in transport setup functions --- swap/Cargo.toml | 2 +- swap/src/cli/transport.rs | 9 +++++---- swap/src/network/transport.rs | 12 ++++++------ 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/swap/Cargo.toml b/swap/Cargo.toml index c16a78c83..f2440a158 100644 --- a/swap/Cargo.toml +++ b/swap/Cargo.toml @@ -43,7 +43,7 @@ hyper = "0.14.20" itertools = "0.13" jsonrpsee = { version = "0.16.2", features = [ "server" ] } jsonrpsee-core = "0.16.2" -libp2p = { version = "0.53.2", features = [ "tcp", "yamux", "dns", "noise", "request-response", "websocket", "ping", "rendezvous", "identify", "macros", "cbor", "json" ] } +libp2p = { version = "0.53.2", features = [ "tcp", "yamux", "dns", "noise", "request-response", "websocket", "ping", "rendezvous", "identify", "macros", "cbor", "json", "tokio" ] } monero = { version = "0.12", features = [ "serde_support" ] } monero-rpc = { path = "../monero-rpc" } once_cell = "1.19" diff --git a/swap/src/cli/transport.rs b/swap/src/cli/transport.rs index 68a5cd1a9..4eea04829 100644 --- a/swap/src/cli/transport.rs +++ b/swap/src/cli/transport.rs @@ -3,8 +3,8 @@ use crate::network::transport::authenticate_and_multiplex; use anyhow::Result; use libp2p::core::muxing::StreamMuxerBox; use libp2p::core::transport::{Boxed, OptionalTransport}; -use libp2p::dns::TokioDnsConfig; -use libp2p::tcp::TokioTcpConfig; +use libp2p::dns; +use libp2p::tcp; use libp2p::{identity, PeerId, Transport}; /// Creates the libp2p transport for the swap CLI. @@ -19,8 +19,9 @@ pub fn new( identity: &identity::Keypair, maybe_tor_socks5_port: Option, ) -> Result> { - let tcp = TokioTcpConfig::new().nodelay(true); - let tcp_with_dns = TokioDnsConfig::system(tcp)?; + let tcp = tcp::Config::new().nodelay(true); + let tcp_with_dns = dns::tokio::Transport::system(tcp)?; + let maybe_tor_transport = match maybe_tor_socks5_port { Some(port) => OptionalTransport::some(TorDialOnlyTransport::new(port)), None => OptionalTransport::none(), diff --git a/swap/src/network/transport.rs b/swap/src/network/transport.rs index 35ac3e8c2..7d8f3e03f 100644 --- a/swap/src/network/transport.rs +++ b/swap/src/network/transport.rs @@ -21,12 +21,12 @@ pub fn authenticate_and_multiplex( where T: AsyncRead + AsyncWrite + Unpin + Send + 'static, { - let auth_upgrade = { - let noise_identity = noise::Keypair::::new().into_authentic(identity)?; - NoiseConfig::xx(noise_identity).into_authenticated() - }; - let multiplex_upgrade = SelectUpgrade::new(yamux::YamuxConfig::default(), MplexConfig::new()); - + let auth_upgrade = noise::Config::new(&identity); + let multiplex_upgrade: SelectUpgrade<_, _> = SelectUpgrade::new( + yamux::Config::default(), + mplex::MplexConfig::new() + ); + let transport = transport .upgrade(Version::V1) .authenticate(auth_upgrade) From 26da7d0e4b4be3b964678f2b2416fa61a36b591c Mon Sep 17 00:00:00 2001 From: binarybaron Date: Fri, 18 Oct 2024 16:14:58 +0200 Subject: [PATCH 015/112] fix(lip2p): Use new NetworkBehaviour API for swap/src/network/redial.rs --- swap/src/network/redial.rs | 90 +++++++++++++++++++++----------------- 1 file changed, 51 insertions(+), 39 deletions(-) diff --git a/swap/src/network/redial.rs b/swap/src/network/redial.rs index e65ffc1f2..fe86f6d16 100644 --- a/swap/src/network/redial.rs +++ b/swap/src/network/redial.rs @@ -2,11 +2,9 @@ use crate::cli; use backoff::backoff::Backoff; use backoff::ExponentialBackoff; use futures::future::FutureExt; -use libp2p::core::connection::ConnectionId; use libp2p::core::Multiaddr; use libp2p::swarm::dial_opts::{DialOpts, PeerCondition}; -use libp2p::swarm::protocols_handler::DummyProtocolsHandler; -use libp2p::swarm::{NetworkBehaviour, NetworkBehaviourAction, PollParameters}; +use libp2p::swarm::{NetworkBehaviour, ToSwarm}; use libp2p::PeerId; use std::pin::Pin; use std::task::{Context, Poll}; @@ -38,8 +36,9 @@ impl Behaviour { backoff: ExponentialBackoff { initial_interval: interval, current_interval: interval, - // give up dialling after 5 minutes - max_elapsed_time: Some(Duration::from_secs(5 * 60)), + // Never give up dialing + // TOOD: Libp2p Upgrade: Is this the right approach? + max_elapsed_time: None, ..ExponentialBackoff::default() }, } @@ -57,44 +56,48 @@ impl Behaviour { } impl NetworkBehaviour for Behaviour { - type ProtocolsHandler = DummyProtocolsHandler; - type OutEvent = OutEvent; + type ConnectionHandler = libp2p::swarm::dummy::ConnectionHandler; + type ToSwarm = OutEvent; - fn new_handler(&mut self) -> Self::ProtocolsHandler { - DummyProtocolsHandler::default() - } - - fn addresses_of_peer(&mut self, _: &PeerId) -> Vec { - Vec::new() + fn handle_established_inbound_connection( + &mut self, + _connection_id: libp2p::swarm::ConnectionId, + peer: PeerId, + _local_addr: &Multiaddr, + _remote_addr: &Multiaddr, + ) -> Result, libp2p::swarm::ConnectionDenied> { + if peer == self.peer { + self.sleep = None; // Cancel any active re-dialling + } + Ok(Self::ConnectionHandler::default()) } - fn inject_connected(&mut self, peer_id: &PeerId) { - if peer_id != &self.peer { - return; + fn handle_established_outbound_connection( + &mut self, + _connection_id: libp2p::swarm::ConnectionId, + peer: PeerId, + _addr: &Multiaddr, + _role_override: libp2p::core::Endpoint, + ) -> Result, libp2p::swarm::ConnectionDenied> { + if peer == self.peer { + self.sleep = None; // Cancel any active re-dialling } - - // established a connection to the desired peer, cancel any active re-dialling - self.sleep = None; + Ok(Self::ConnectionHandler::default()) } - fn inject_disconnected(&mut self, peer_id: &PeerId) { - if peer_id != &self.peer { - return; - } + fn on_swarm_event(&mut self, event: libp2p::swarm::FromSwarm) { + // TODO: Libp2p Upgrade: Maybe we also need to match for FromSwarm::DialFailure here? - // lost connection to the configured peer, trigger re-dialling with an - // exponential backoff - self.backoff.reset(); - self.sleep = Some(Box::pin(tokio::time::sleep(self.backoff.initial_interval))); + if let libp2p::swarm::FromSwarm::ConnectionClosed(closed) = event { + if closed.peer_id == self.peer { + // Lost connection, trigger re-dialling with exponential backoff + self.backoff.reset(); + self.sleep = Some(Box::pin(tokio::time::sleep(self.backoff.initial_interval))); + } + } } - fn inject_event(&mut self, _: PeerId, _: ConnectionId, _: Void) {} - - fn poll( - &mut self, - cx: &mut Context<'_>, - _: &mut impl PollParameters, - ) -> Poll> { + fn poll(&mut self, cx: &mut Context<'_>) -> std::task::Poll> { let sleep = match self.sleep.as_mut() { None => return Poll::Pending, // early exit if we shouldn't be re-dialling Some(future) => future, @@ -105,21 +108,30 @@ impl NetworkBehaviour for Behaviour { let next_dial_in = match self.backoff.next_backoff() { Some(next_dial_in) => next_dial_in, None => { - return Poll::Ready(NetworkBehaviourAction::GenerateEvent( - OutEvent::AllAttemptsExhausted { peer: self.peer }, - )); + return Poll::Ready(ToSwarm::GenerateEvent(OutEvent::AllAttemptsExhausted { + peer: self.peer, + })); } }; self.sleep = Some(Box::pin(tokio::time::sleep(next_dial_in))); - Poll::Ready(NetworkBehaviourAction::Dial { + Poll::Ready(ToSwarm::Dial { opts: DialOpts::peer_id(self.peer) .condition(PeerCondition::Disconnected) .build(), - handler: Self::ProtocolsHandler::default(), }) } + + fn on_connection_handler_event( + &mut self, + _peer_id: PeerId, + _connection_id: libp2p::swarm::ConnectionId, + _event: libp2p::swarm::THandlerOutEvent, + ) { + // the dummy connection handler does not produce any events + // therefore we do not need to handle any events here + } } impl From for cli::OutEvent { From 2a7bdf2ee77e18af967830574051ebb35f21ed3d Mon Sep 17 00:00:00 2001 From: binarybaron Date: Fri, 18 Oct 2024 16:37:05 +0200 Subject: [PATCH 016/112] fix(libp2p): Omit removed argument from Swarm::add_external_address --- swap/src/bin/asb.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/swap/src/bin/asb.rs b/swap/src/bin/asb.rs index 7a7e5f234..b0c18569d 100644 --- a/swap/src/bin/asb.rs +++ b/swap/src/bin/asb.rs @@ -193,11 +193,7 @@ pub async fn main() -> Result<()> { tracing::info!(peer_id = %swarm.local_peer_id(), "Network layer initialized"); for external_address in config.network.external_addresses { - let _ = Swarm::add_external_address( - &mut swarm, - external_address, - AddressScore::Infinite, - ); + let _ = Swarm::add_external_address(&mut swarm, external_address); } let (event_loop, mut swap_receiver) = EventLoop::new( From f402c1ad4dbf12b4ae490736d794cb1fdf4b3adb Mon Sep 17 00:00:00 2001 From: binarybaron Date: Mon, 21 Oct 2024 18:57:30 +0200 Subject: [PATCH 017/112] fix(libp2p): Destructure libp2p::rendezvous::client::Event::RegisterFailed in swap/src/asb/event_loop.rs --- swap/src/asb/event_loop.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/swap/src/asb/event_loop.rs b/swap/src/asb/event_loop.rs index 1abe97789..4519d582e 100644 --- a/swap/src/asb/event_loop.rs +++ b/swap/src/asb/event_loop.rs @@ -310,8 +310,8 @@ where SwarmEvent::Behaviour(OutEvent::Rendezvous(libp2p::rendezvous::client::Event::Registered { rendezvous_node, ttl, namespace })) => { tracing::info!("Successfully registered with rendezvous node: {} with namespace: {} and TTL: {:?}", rendezvous_node, namespace, ttl); } - SwarmEvent::Behaviour(OutEvent::Rendezvous(libp2p::rendezvous::client::Event::RegisterFailed(error))) => { - tracing::error!("Registration with rendezvous node failed: {:?}", error); + SwarmEvent::Behaviour(OutEvent::Rendezvous(libp2p::rendezvous::client::Event::RegisterFailed { rendezvous_node, namespace, error })) => { + tracing::error!("Registration with rendezvous node {} failed for namespace {}: {:?}", rendezvous_node, namespace, error); } SwarmEvent::Behaviour(OutEvent::Failure {peer, error}) => { tracing::error!( From 93cb6cb22f8789c3820400f30847c9354fc93e07 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Mon, 21 Oct 2024 19:00:29 +0200 Subject: [PATCH 018/112] fix(libp2p): Use new Transport API for TorDialOnlyTransport See https://github.com/libp2p/rust-libp2p/pull/2652 --- swap/src/cli/transport.rs | 2 +- swap/src/network/tor_transport.rs | 31 +++++++++++++++++++++++++++---- swap/src/network/transport.rs | 8 +++----- 3 files changed, 31 insertions(+), 10 deletions(-) diff --git a/swap/src/cli/transport.rs b/swap/src/cli/transport.rs index 4eea04829..11e397cbf 100644 --- a/swap/src/cli/transport.rs +++ b/swap/src/cli/transport.rs @@ -21,7 +21,7 @@ pub fn new( ) -> Result> { let tcp = tcp::Config::new().nodelay(true); let tcp_with_dns = dns::tokio::Transport::system(tcp)?; - + let maybe_tor_transport = match maybe_tor_socks5_port { Some(port) => OptionalTransport::some(TorDialOnlyTransport::new(port)), None => OptionalTransport::none(), diff --git a/swap/src/network/tor_transport.rs b/swap/src/network/tor_transport.rs index c8e4d3b8b..8adf7ecda 100644 --- a/swap/src/network/tor_transport.rs +++ b/swap/src/network/tor_transport.rs @@ -2,9 +2,9 @@ use anyhow::Result; use data_encoding::BASE32; use futures::future::{BoxFuture, FutureExt, Ready}; use libp2p::core::multiaddr::{Multiaddr, Protocol}; -use libp2p::core::transport::TransportError; +use libp2p::core::transport::{ListenerId, TransportError}; use libp2p::core::Transport; -use libp2p::tcp::tokio::{Tcp, TcpStream}; +use libp2p::tcp::tokio::TcpStream; use std::borrow::Cow; use std::net::{Ipv4Addr, Ipv6Addr}; use std::{fmt, io}; @@ -25,11 +25,14 @@ impl TorDialOnlyTransport { impl Transport for TorDialOnlyTransport { type Output = TcpStream; type Error = io::Error; - type Listener = TcpListenStream; type ListenerUpgrade = Ready>; type Dial = BoxFuture<'static, Result>; - fn listen_on(self, addr: Multiaddr) -> Result> { + fn listen_on( + &mut self, + id: ListenerId, + addr: Multiaddr, + ) -> Result<(), TransportError> { Err(TransportError::MultiaddrNotSupported(addr)) } @@ -59,6 +62,7 @@ impl Transport for TorDialOnlyTransport { fn address_translation(&self, _: &Multiaddr, _: &Multiaddr) -> Option { None } + fn dial_as_listener( &mut self, addr: Multiaddr, @@ -84,6 +88,25 @@ impl Transport for TorDialOnlyTransport { Ok(dial_future.boxed()) } + + fn remove_listener(&mut self, id: ListenerId) -> bool { + // TODO: Libp2p Upgrade: What do we need to do here? + // I believe nothing because we are not using the transport to listen. + false + } + + fn poll( + self: std::pin::Pin<&mut Self>, + cx: &mut std::task::Context<'_>, + ) -> std::task::Poll> + { + // TODO: Libp2p Upgrade: What do we need to do here? + // See: https://github.com/libp2p/rust-libp2p/pull/2652 + // I believe we do not need to do anything here because we are not using the transport to listen. + // But we need to verify this before merging. + + return std::task::Poll::Pending; + } } /// Represents an address that is _compatible_ with Tor, i.e. can be resolved by diff --git a/swap/src/network/transport.rs b/swap/src/network/transport.rs index 7d8f3e03f..c726d24f2 100644 --- a/swap/src/network/transport.rs +++ b/swap/src/network/transport.rs @@ -22,11 +22,9 @@ where T: AsyncRead + AsyncWrite + Unpin + Send + 'static, { let auth_upgrade = noise::Config::new(&identity); - let multiplex_upgrade: SelectUpgrade<_, _> = SelectUpgrade::new( - yamux::Config::default(), - mplex::MplexConfig::new() - ); - + let multiplex_upgrade: SelectUpgrade<_, _> = + SelectUpgrade::new(yamux::Config::default(), mplex::MplexConfig::new()); + let transport = transport .upgrade(Version::V1) .authenticate(auth_upgrade) From b06ecc731665aa5f4c7686328591d69bacda2c45 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Mon, 21 Oct 2024 19:18:49 +0200 Subject: [PATCH 019/112] fix(libp2p): Remove deprecated mplex See: https://github.com/libp2p/rust-libp2p/pull/3920 This should be backwards compatible because SelectUpgrade should allow older clients to use yamux instead of mplex --- Cargo.lock | 288 ++++++++++++++++++++++++++++++++++ swap/src/network/transport.rs | 6 +- 2 files changed, 290 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5054ed66f..dd0cc64ba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -171,6 +171,45 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" +[[package]] +name = "asn1-rs" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5493c3bedbacf7fd7382c6346bbd66687d12bbaad3a89a2d2c303ee6cf20b048" +dependencies = [ + "asn1-rs-derive", + "asn1-rs-impl", + "displaydoc", + "nom", + "num-traits", + "rusticata-macros", + "thiserror", + "time 0.3.36", +] + +[[package]] +name = "asn1-rs-derive" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "965c2d33e53cb6b267e148a4cb0760bc01f4904c1cd4bb4002a085bb016d1490" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", + "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.79", +] + [[package]] name = "assert-json-diff" version = "2.0.2" @@ -332,6 +371,17 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" +[[package]] +name = "attohttpc" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d9a9bf8b79a749ee0b911b91b671cc2b6c670bdbc7e3dfd537576ddc94bb2a2" +dependencies = [ + "http 0.2.12", + "log", + "url", +] + [[package]] name = "atty" version = "0.2.14" @@ -1646,6 +1696,20 @@ dependencies = [ "zeroize", ] +[[package]] +name = "der-parser" +version = "9.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cd0a5c643689626bec213c4d8bd4d96acc8ffdb4ad4bb6bc16abf27d5f4b553" +dependencies = [ + "asn1-rs", + "displaydoc", + "nom", + "num-bigint", + "num-traits", + "rusticata-macros", +] + [[package]] name = "deranged" version = "0.3.11" @@ -1792,6 +1856,17 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + [[package]] name = "dlopen2" version = "0.7.0" @@ -2913,8 +2988,10 @@ dependencies = [ "ipnet", "once_cell", "rand 0.8.5", + "socket2", "thiserror", "tinyvec", + "tokio", "tracing", "url", ] @@ -2936,6 +3013,7 @@ dependencies = [ "resolv-conf", "smallvec", "thiserror", + "tokio", "tracing", ] @@ -3244,9 +3322,29 @@ dependencies = [ "log", "rtnetlink", "system-configuration", + "tokio", "windows 0.51.1", ] +[[package]] +name = "igd-next" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "064d90fec10d541084e7b39ead8875a5a80d9114a2b18791565253bae25f49e4" +dependencies = [ + "async-trait", + "attohttpc", + "bytes", + "futures", + "http 0.2.12", + "hyper 0.14.30", + "log", + "rand 0.8.5", + "tokio", + "url", + "xmltree", +] + [[package]] name = "image" version = "0.24.9" @@ -3771,13 +3869,16 @@ dependencies = [ "libp2p-dns", "libp2p-identify", "libp2p-identity", + "libp2p-mdns", "libp2p-metrics", "libp2p-noise", "libp2p-ping", + "libp2p-quic", "libp2p-rendezvous", "libp2p-request-response", "libp2p-swarm", "libp2p-tcp", + "libp2p-upnp", "libp2p-websocket", "libp2p-yamux", "multiaddr", @@ -3895,6 +3996,27 @@ dependencies = [ "zeroize", ] +[[package]] +name = "libp2p-mdns" +version = "0.45.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49007d9a339b3e1d7eeebc4d67c05dbf23d300b7d091193ec2d3f26802d7faf2" +dependencies = [ + "data-encoding", + "futures", + "hickory-proto", + "if-watch", + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", + "rand 0.8.5", + "smallvec", + "socket2", + "tokio", + "tracing", + "void", +] + [[package]] name = "libp2p-metrics" version = "0.14.1" @@ -3956,6 +4078,30 @@ dependencies = [ "void", ] +[[package]] +name = "libp2p-quic" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c67296ad4e092e23f92aea3d2bdb6f24eab79c0929ed816dfb460ea2f4567d2b" +dependencies = [ + "bytes", + "futures", + "futures-timer", + "if-watch", + "libp2p-core", + "libp2p-identity", + "libp2p-tls", + "parking_lot 0.12.3", + "quinn", + "rand 0.8.5", + "ring 0.17.8", + "rustls 0.23.14", + "socket2", + "thiserror", + "tokio", + "tracing", +] + [[package]] name = "libp2p-rendezvous" version = "0.14.0" @@ -4022,6 +4168,7 @@ dependencies = [ "once_cell", "rand 0.8.5", "smallvec", + "tokio", "tracing", "void", ] @@ -4051,7 +4198,43 @@ dependencies = [ "libp2p-core", "libp2p-identity", "socket2", + "tokio", + "tracing", +] + +[[package]] +name = "libp2p-tls" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b7b831e55ce2aa6c354e6861a85fdd4dd0a2b97d5e276fabac0e4810a71776" +dependencies = [ + "futures", + "futures-rustls", + "libp2p-core", + "libp2p-identity", + "rcgen", + "ring 0.17.8", + "rustls 0.23.14", + "rustls-webpki 0.101.7", + "thiserror", + "x509-parser", + "yasna", +] + +[[package]] +name = "libp2p-upnp" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccf04b0e3ff3de52d07d5fd6c3b061d0e7f908ffc683c32d9638caedce86fc8" +dependencies = [ + "futures", + "futures-timer", + "igd-next", + "libp2p-core", + "libp2p-swarm", + "tokio", "tracing", + "void", ] [[package]] @@ -4604,8 +4787,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "416060d346fbaf1f23f9512963e3e878f1a78e707cb699ba9215761754244307" dependencies = [ "bytes", + "futures", "libc", "log", + "tokio", ] [[package]] @@ -4657,12 +4842,31 @@ 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-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-traits" version = "0.2.19" @@ -4849,6 +5053,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "oid-registry" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c958dd45046245b9c3c2547369bb634eb461670b2e7e0de552905801a648d1d" +dependencies = [ + "asn1-rs", +] + [[package]] name = "once_cell" version = "1.20.2" @@ -5570,6 +5783,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" dependencies = [ "bytes", + "futures-io", "pin-project-lite", "quinn-proto", "quinn-udp", @@ -5742,6 +5956,18 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "rcgen" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52c4f3084aa3bc7dfbba4eff4fab2a54db4324965d8872ab933565e6fbd83bc6" +dependencies = [ + "pem", + "ring 0.16.20", + "time 0.3.36", + "yasna", +] + [[package]] name = "redox_syscall" version = "0.2.16" @@ -5970,6 +6196,7 @@ dependencies = [ "netlink-proto", "nix", "thiserror", + "tokio", ] [[package]] @@ -6031,6 +6258,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 = "0.38.37" @@ -7344,6 +7580,17 @@ dependencies = [ "futures-core", ] +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + [[package]] name = "system-configuration" version = "0.5.1" @@ -9554,6 +9801,23 @@ dependencies = [ "zeroize", ] +[[package]] +name = "x509-parser" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcbc162f30700d6f3f82a24bf7cc62ffe7caea42c0b2cba8bf7f3ae50cf51f69" +dependencies = [ + "asn1-rs", + "data-encoding", + "der-parser", + "lazy_static", + "nom", + "oid-registry", + "rusticata-macros", + "thiserror", + "time 0.3.36", +] + [[package]] name = "xattr" version = "1.3.1" @@ -9565,6 +9829,21 @@ dependencies = [ "rustix", ] +[[package]] +name = "xml-rs" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "791978798f0597cfc70478424c2b4fdc2b7a8024aaff78497ef00f24ef674193" + +[[package]] +name = "xmltree" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7d8a75eaf6557bb84a65ace8609883db44a29951042ada9b393151532e41fcb" +dependencies = [ + "xml-rs", +] + [[package]] name = "yamux" version = "0.12.1" @@ -9596,6 +9875,15 @@ dependencies = [ "web-time", ] +[[package]] +name = "yasna" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" +dependencies = [ + "time 0.3.36", +] + [[package]] name = "zerocopy" version = "0.7.35" diff --git a/swap/src/network/transport.rs b/swap/src/network/transport.rs index c726d24f2..58ff3cb34 100644 --- a/swap/src/network/transport.rs +++ b/swap/src/network/transport.rs @@ -3,8 +3,7 @@ use futures::{AsyncRead, AsyncWrite}; use libp2p::core::muxing::StreamMuxerBox; use libp2p::core::transport::Boxed; use libp2p::core::upgrade::{SelectUpgrade, Version}; -use libp2p::mplex::MplexConfig; -use libp2p::noise::{self, NoiseConfig, X25519Spec}; +use libp2p::noise; use libp2p::{identity, yamux, PeerId, Transport}; use std::time::Duration; @@ -22,8 +21,7 @@ where T: AsyncRead + AsyncWrite + Unpin + Send + 'static, { let auth_upgrade = noise::Config::new(&identity); - let multiplex_upgrade: SelectUpgrade<_, _> = - SelectUpgrade::new(yamux::Config::default(), mplex::MplexConfig::new()); + let multiplex_upgrade: yamux::Config::default(); let transport = transport .upgrade(Version::V1) From 56765965970cde713cd5792904a300d5024ecec4 Mon Sep 17 00:00:00 2001 From: Einliterflasche Date: Tue, 22 Oct 2024 16:09:59 +0200 Subject: [PATCH 020/112] refactor: fix alice swap_setup behaviour and handler, maybe. TODO: keepalive and something else --- swap/src/cli.rs | 88 +++--- swap/src/cli/list_sellers.rs | 6 +- swap/src/network/quote.rs | 2 +- swap/src/network/swap_setup/alice.rs | 436 ++++++++++++++------------- swap/src/network/test.rs | 12 +- 5 files changed, 275 insertions(+), 269 deletions(-) diff --git a/swap/src/cli.rs b/swap/src/cli.rs index 871a8b80a..4d5f01cfe 100644 --- a/swap/src/cli.rs +++ b/swap/src/cli.rs @@ -24,8 +24,6 @@ mod tests { use crate::network::test::{new_swarm, SwarmExt}; use futures::StreamExt; use libp2p::multiaddr::Protocol; - use libp2p::request_response::request_response::Event; - use libp2p::swarm::{AddressScore, NetworkBehaviourEventProcess}; use libp2p::{identity, rendezvous, Multiaddr, PeerId}; use std::collections::HashSet; use std::iter::FromIterator; @@ -90,13 +88,13 @@ mod tests { rendezvous, ping: Default::default(), quote: quote::asb(), - static_quote, - registered: false, + // static_quote, + // registered: false, } }); let asb_address = asb.listen_on_tcp_localhost().await; - asb.add_external_address(asb_address.clone(), AddressScore::Infinite); + asb.add_external_address(asb_address.clone()); let asb_peer_id = *asb.local_peer_id(); @@ -118,58 +116,56 @@ mod tests { } } - #[derive(libp2p::NetworkBehaviour)] - #[behaviour(event_process = true)] + #[derive(libp2p::swarm::NetworkBehaviour)] struct StaticQuoteAsbBehaviour { rendezvous: asb::rendezvous::Behaviour, // Support `Ping` as a workaround until https://github.com/libp2p/rust-libp2p/issues/2109 is fixed. - ping: libp2p::ping::Ping, + ping: libp2p::ping::Behaviour, quote: quote::Behaviour, - #[behaviour(ignore)] - static_quote: BidQuote, - #[behaviour(ignore)] - registered: bool, + // #[behaviour(ignore)] + // static_quote: BidQuote, + // #[behaviour(ignore)] + // registered: bool, } - impl NetworkBehaviourEventProcess for StaticQuoteAsbBehaviour { - fn inject_event(&mut self, event: rendezvous::client::Event) { - if let rendezvous::client::Event::Registered { .. } = event { - self.registered = true; - } - } - } - - impl NetworkBehaviourEventProcess for StaticQuoteAsbBehaviour { - fn inject_event(&mut self, _: libp2p::ping::PingEvent) {} - } - impl NetworkBehaviourEventProcess for StaticQuoteAsbBehaviour { - fn inject_event(&mut self, event: quote::OutEvent) { - if let request_response::Event::Message { - message: quote::Message::Request { channel, .. }, - .. - } = event - { - self.quote - .send_response(channel, self.static_quote) - .unwrap(); - } - } - } - - #[derive(libp2p::NetworkBehaviour)] - #[behaviour(event_process = true)] + // impl NetworkBehaviourEventProcess for StaticQuoteAsbBehaviour { + // fn inject_event(&mut self, event: rendezvous::client::Event) { + // if let rendezvous::client::Event::Registered { .. } = event { + // self.registered = true; + // } + // } + // } + + // impl NetworkBehaviourEventProcess for StaticQuoteAsbBehaviour { + // fn inject_event(&mut self, _: libp2p::ping::Event) {} + // } + // impl NetworkBehaviourEventProcess for StaticQuoteAsbBehaviour { + // fn inject_event(&mut self, event: quote::OutEvent) { + // if let request_response::Event::Message { + // message: quote::Message::Request { channel, .. }, + // .. + // } = event + // { + // self.quote + // .send_response(channel, self.static_quote) + // .unwrap(); + // } + // } + // } + + #[derive(libp2p::swarm::NetworkBehaviour)] struct RendezvousPointBehaviour { rendezvous: rendezvous::server::Behaviour, // Support `Ping` as a workaround until https://github.com/libp2p/rust-libp2p/issues/2109 is fixed. - ping: libp2p::ping::Ping, + ping: libp2p::ping::Behaviour, } - impl NetworkBehaviourEventProcess for RendezvousPointBehaviour { - fn inject_event(&mut self, _: rendezvous::server::Event) {} - } - impl NetworkBehaviourEventProcess for RendezvousPointBehaviour { - fn inject_event(&mut self, _: libp2p::ping::PingEvent) {} - } + // impl NetworkBehaviourEventProcess for RendezvousPointBehaviour { + // fn inject_event(&mut self, _: rendezvous::server::Event) {} + // } + // impl NetworkBehaviourEventProcess for RendezvousPointBehaviour { + // fn inject_event(&mut self, _: libp2p::ping::Event) {} + // } impl Default for RendezvousPointBehaviour { fn default() -> Self { diff --git a/swap/src/cli/list_sellers.rs b/swap/src/cli/list_sellers.rs index 560b64a5a..65e2d33a7 100644 --- a/swap/src/cli/list_sellers.rs +++ b/swap/src/cli/list_sellers.rs @@ -173,7 +173,7 @@ impl EventLoop { self.reachable_asb_address.insert(peer_id, address.clone()); } } - SwarmEvent::OutgoingConnectionError { peer_id, error } => { + SwarmEvent::OutgoingConnectionError { peer_id, error, .. } => { if let Some(peer_id) = peer_id { if peer_id == self.rendezvous_peer_id { tracing::error!( @@ -216,7 +216,7 @@ impl EventLoop { for address in registration.record.addresses() { tracing::info!(peer_id=%peer, address=%address, "Discovered peer"); - let p2p_suffix = Protocol::P2p(*peer.as_ref()); + let p2p_suffix = Protocol::P2p(peer.into()); let _address_with_p2p = if !address .ends_with(&Multiaddr::empty().with(p2p_suffix.clone())) { @@ -228,7 +228,7 @@ impl EventLoop { self.asb_quote_status.insert(peer, QuoteStatus::Pending); // add all external addresses of that peer to the quote behaviour - self.swarm.behaviour_mut().quote.add_address(&peer, address.clone()); + self.swarm.add_peer_address(peer, address.clone()); } // request the quote, if we are not connected to the peer it will be dialed automatically diff --git a/swap/src/network/quote.rs b/swap/src/network/quote.rs index c6c883bf2..ea112106a 100644 --- a/swap/src/network/quote.rs +++ b/swap/src/network/quote.rs @@ -5,7 +5,7 @@ use serde::{Deserialize, Serialize}; use typeshare::typeshare; const PROTOCOL: &str = "/comit/xmr/btc/bid-quote/1.0.0"; -type OutEvent = request_response::Event<(), BidQuote>; +pub(crate) type OutEvent = request_response::Event<(), BidQuote>; type Message = request_response::Message<(), BidQuote>; pub type Behaviour = request_response::json::Behaviour<(), BidQuote>; diff --git a/swap/src/network/swap_setup/alice.rs b/swap/src/network/swap_setup/alice.rs index 25a80e0e0..61159cfe7 100644 --- a/swap/src/network/swap_setup/alice.rs +++ b/swap/src/network/swap_setup/alice.rs @@ -9,20 +9,20 @@ use crate::protocol::{Message0, Message2, Message4}; use crate::{asb, bitcoin, env, monero}; use anyhow::{anyhow, Context, Result}; use futures::future::{BoxFuture, OptionFuture}; -use futures::{AsyncWriteExt, FutureExt}; -use libp2p::core::connection::ConnectionId; +use futures::FutureExt; +use libp2p::swarm::handler::ConnectionEvent; +use libp2p::swarm::{ConnectionHandler, ConnectionId}; use libp2p::core::upgrade; use libp2p::swarm::{ - KeepAlive, NegotiatedSubstream, NetworkBehaviour, NetworkBehaviourAction, PollParameters, - ProtocolsHandler, ProtocolsHandlerEvent, ProtocolsHandlerUpgrErr, SubstreamProtocol, + NetworkBehaviour, ToSwarm, + SubstreamProtocol, ConnectionHandlerEvent, }; use libp2p::{Multiaddr, PeerId}; use std::collections::VecDeque; use std::fmt::Debug; use std::task::Poll; -use std::time::{Duration, Instant}; +use std::time::Duration; use uuid::Uuid; -use void::Void; #[derive(Debug)] #[allow(clippy::large_enum_variant)] @@ -147,28 +147,10 @@ impl NetworkBehaviour for Behaviour where LR: LatestRate + Send + 'static + Clone, { - type ProtocolsHandler = Handler; - type OutEvent = OutEvent; - - fn new_handler(&mut self) -> Self::ProtocolsHandler { - Handler::new( - self.min_buy, - self.max_buy, - self.env_config, - self.latest_rate.clone(), - self.resume_only, - ) - } - - fn addresses_of_peer(&mut self, _: &PeerId) -> Vec { - Vec::new() - } + type ConnectionHandler = Handler; + type ToSwarm = OutEvent; - fn inject_connected(&mut self, _: &PeerId) {} - - fn inject_disconnected(&mut self, _: &PeerId) {} - - fn inject_event(&mut self, peer_id: PeerId, _: ConnectionId, event: HandlerOutEvent) { + fn on_connection_handler_event(&mut self, peer_id: PeerId, _: ConnectionId, event: HandlerOutEvent) { match event { HandlerOutEvent::Initiated(send_wallet_snapshot) => { self.events.push_back(OutEvent::Initiated { @@ -190,15 +172,38 @@ where fn poll( &mut self, - _cx: &mut std::task::Context<'_>, - _params: &mut impl PollParameters, - ) -> Poll> { + _cx: &mut std::task::Context<'_> + ) -> Poll> { if let Some(event) = self.events.pop_front() { - return Poll::Ready(NetworkBehaviourAction::GenerateEvent(event)); + return Poll::Ready(ToSwarm::GenerateEvent(event)); } Poll::Pending } + + fn handle_established_inbound_connection( + &mut self, + _connection_id: libp2p::swarm::ConnectionId, + peer: PeerId, + local_addr: &Multiaddr, + remote_addr: &Multiaddr, + ) -> std::result::Result, libp2p::swarm::ConnectionDenied> { + todo!() + } + + fn handle_established_outbound_connection( + &mut self, + _connection_id: libp2p::swarm::ConnectionId, + peer: PeerId, + addr: &Multiaddr, + role_override: libp2p::core::Endpoint, + ) -> std::result::Result, libp2p::swarm::ConnectionDenied> { + todo!() + } + + fn on_swarm_event(&mut self, event: libp2p::swarm::FromSwarm<'_>) { + todo!() + } } type InboundStream = BoxFuture<'static, Result<(Uuid, State3)>>; @@ -215,7 +220,7 @@ pub struct Handler { resume_only: bool, timeout: Duration, - keep_alive: KeepAlive, + // keep_alive: KeepAlive, } impl Handler { @@ -235,7 +240,7 @@ impl Handler { latest_rate, resume_only, timeout: Duration::from_secs(120), - keep_alive: KeepAlive::Until(Instant::now() + Duration::from_secs(10)), + // keep_alive: KeepAlive::Until(Instant::now() + Duration::from_secs(10)), } } } @@ -247,13 +252,12 @@ pub enum HandlerOutEvent { Completed(Result<(Uuid, State3)>), } -impl ProtocolsHandler for Handler +impl ConnectionHandler for Handler where LR: LatestRate + Send + 'static, { - type InEvent = (); - type OutEvent = HandlerOutEvent; - type Error = Error; + type FromBehaviour = (); + type ToBehaviour = HandlerOutEvent; type InboundProtocol = protocol::SwapSetup; type OutboundProtocol = upgrade::DeniedUpgrade; type InboundOpenInfo = (); @@ -263,178 +267,9 @@ where SubstreamProtocol::new(protocol::new(), ()) } - fn inject_fully_negotiated_inbound( - &mut self, - mut substream: NegotiatedSubstream, - _: Self::InboundOpenInfo, - ) { - self.keep_alive = KeepAlive::Yes; - - let (sender, receiver) = bmrng::channel_with_timeout::( - 1, - Duration::from_secs(5), - ); - let resume_only = self.resume_only; - let min_buy = self.min_buy; - let max_buy = self.max_buy; - let latest_rate = self.latest_rate.latest_rate(); - let env_config = self.env_config; - - let protocol = tokio::time::timeout(self.timeout, async move { - let request = swap_setup::read_cbor_message::(&mut substream) - .await - .context("Failed to read spot price request")?; - - let wallet_snapshot = sender - .send_receive(request.btc) - .await - .context("Failed to receive wallet snapshot")?; - - // wrap all of these into another future so we can `return` from all the - // different blocks - let validate = async { - if resume_only { - return Err(Error::ResumeOnlyMode); - }; - - let blockchain_network = BlockchainNetwork { - bitcoin: env_config.bitcoin_network, - monero: env_config.monero_network, - }; - - if request.blockchain_network != blockchain_network { - return Err(Error::BlockchainNetworkMismatch { - cli: request.blockchain_network, - asb: blockchain_network, - }); - } - - let btc = request.btc; - - if btc < min_buy { - return Err(Error::AmountBelowMinimum { - min: min_buy, - buy: btc, - }); - } - - if btc > max_buy { - return Err(Error::AmountAboveMaximum { - max: max_buy, - buy: btc, - }); - } - - let rate = latest_rate.map_err(|e| Error::LatestRateFetchFailed(Box::new(e)))?; - let xmr = rate - .sell_quote(btc) - .map_err(Error::SellQuoteCalculationFailed)?; - - let unlocked = Amount::from_piconero(wallet_snapshot.balance.unlocked_balance); - if unlocked < xmr + wallet_snapshot.lock_fee { - return Err(Error::BalanceTooLow { - balance: wallet_snapshot.balance, - buy: btc, - }); - } - - Ok(xmr) - }; - - let result = validate.await; - - swap_setup::write_cbor_message( - &mut substream, - SpotPriceResponse::from_result_ref(&result), - ) - .await - .context("Failed to write spot price response")?; - - let xmr = result?; - - let state0 = State0::new( - request.btc, - xmr, - env_config, - wallet_snapshot.redeem_address, - wallet_snapshot.punish_address, - wallet_snapshot.redeem_fee, - wallet_snapshot.punish_fee, - &mut rand::thread_rng(), - ); - - let message0 = swap_setup::read_cbor_message::(&mut substream) - .await - .context("Failed to read message0")?; - let (swap_id, state1) = state0 - .receive(message0) - .context("Failed to transition state0 -> state1 using message0")?; - - swap_setup::write_cbor_message(&mut substream, state1.next_message()) - .await - .context("Failed to send message1")?; - - let message2 = swap_setup::read_cbor_message::(&mut substream) - .await - .context("Failed to read message2")?; - let state2 = state1 - .receive(message2) - .context("Failed to transition state1 -> state2 using message2")?; - - swap_setup::write_cbor_message(&mut substream, state2.next_message()) - .await - .context("Failed to send message3")?; - - let message4 = swap_setup::read_cbor_message::(&mut substream) - .await - .context("Failed to read message4")?; - let state3 = state2 - .receive(message4) - .context("Failed to transition state2 -> state3 using message4")?; - - substream - .flush() - .await - .context("Failed to flush substream after all messages were sent")?; - substream - .close() - .await - .context("Failed to close substream after all messages were sent")?; - - Ok((swap_id, state3)) - }); - - let max_seconds = self.timeout.as_secs(); - self.inbound_stream = OptionFuture::from(Some( - async move { - protocol.await.with_context(|| { - format!("Failed to complete execution setup within {}s", max_seconds) - })? - } - .boxed(), - )); - - self.events.push_back(HandlerOutEvent::Initiated(receiver)); - } - - fn inject_fully_negotiated_outbound(&mut self, _: Void, _: Self::OutboundOpenInfo) { - unreachable!("Alice does not support outbound in the handler") - } - - fn inject_event(&mut self, _: Self::InEvent) { - unreachable!("Alice does not receive events from the Behaviour in the handler") - } - - fn inject_dial_upgrade_error( - &mut self, - _: Self::OutboundOpenInfo, - _: ProtocolsHandlerUpgrErr, - ) { - unreachable!("Alice does not dial") - } - - fn connection_keep_alive(&self) -> KeepAlive { - self.keep_alive + fn connection_keep_alive(&self) -> bool { + // self.keep_alive + false } #[allow(clippy::type_complexity)] @@ -442,26 +277,199 @@ where &mut self, cx: &mut std::task::Context<'_>, ) -> Poll< - ProtocolsHandlerEvent< + ConnectionHandlerEvent< Self::OutboundProtocol, Self::OutboundOpenInfo, - Self::OutEvent, - Self::Error, + Self::ToBehaviour, >, > { if let Some(event) = self.events.pop_front() { - return Poll::Ready(ProtocolsHandlerEvent::Custom(event)); + return Poll::Ready(ConnectionHandlerEvent::NotifyBehaviour(event)); } if let Some(result) = futures::ready!(self.inbound_stream.poll_unpin(cx)) { self.inbound_stream = OptionFuture::from(None); - return Poll::Ready(ProtocolsHandlerEvent::Custom(HandlerOutEvent::Completed( + return Poll::Ready(ConnectionHandlerEvent::NotifyBehaviour(HandlerOutEvent::Completed( result, ))); } Poll::Pending } + + fn on_behaviour_event(&mut self, _event: Self::FromBehaviour) { + unreachable!("Alice does not receive events from the Behaviour in the handler") + } + + fn on_connection_event( + &mut self, + event: libp2p::swarm::handler::ConnectionEvent< + '_, + Self::InboundProtocol, + Self::OutboundProtocol, + Self::InboundOpenInfo, + Self::OutboundOpenInfo, + >, + ) { + match event { + ConnectionEvent::FullyNegotiatedInbound(substream) => { + // self.keep_alive = KeepAlive::Yes; + + let (sender, receiver) = bmrng::channel_with_timeout::( + 1, + Duration::from_secs(5), + ); + let resume_only = self.resume_only; + let min_buy = self.min_buy; + let max_buy = self.max_buy; + let latest_rate = self.latest_rate.latest_rate(); + let env_config = self.env_config; + + let protocol = tokio::time::timeout(self.timeout, async move { + let request = swap_setup::read_cbor_message::(&mut substream) + .await + .context("Failed to read spot price request")?; + + let wallet_snapshot = sender + .send_receive(request.btc) + .await + .context("Failed to receive wallet snapshot")?; + + // wrap all of these into another future so we can `return` from all the + // different blocks + let validate = async { + if resume_only { + return Err(Error::ResumeOnlyMode); + }; + + let blockchain_network = BlockchainNetwork { + bitcoin: env_config.bitcoin_network, + monero: env_config.monero_network, + }; + + if request.blockchain_network != blockchain_network { + return Err(Error::BlockchainNetworkMismatch { + cli: request.blockchain_network, + asb: blockchain_network, + }); + } + + let btc = request.btc; + + if btc < min_buy { + return Err(Error::AmountBelowMinimum { + min: min_buy, + buy: btc, + }); + } + + if btc > max_buy { + return Err(Error::AmountAboveMaximum { + max: max_buy, + buy: btc, + }); + } + + let rate = latest_rate.map_err(|e| Error::LatestRateFetchFailed(Box::new(e)))?; + let xmr = rate + .sell_quote(btc) + .map_err(Error::SellQuoteCalculationFailed)?; + + let unlocked = Amount::from_piconero(wallet_snapshot.balance.unlocked_balance); + if unlocked < xmr + wallet_snapshot.lock_fee { + return Err(Error::BalanceTooLow { + balance: wallet_snapshot.balance, + buy: btc, + }); + } + + Ok(xmr) + }; + + let result = validate.await; + + swap_setup::write_cbor_message( + &mut substream, + SpotPriceResponse::from_result_ref(&result), + ) + .await + .context("Failed to write spot price response")?; + + let xmr = result?; + + let state0 = State0::new( + request.btc, + xmr, + env_config, + wallet_snapshot.redeem_address, + wallet_snapshot.punish_address, + wallet_snapshot.redeem_fee, + wallet_snapshot.punish_fee, + &mut rand::thread_rng(), + ); + + let message0 = swap_setup::read_cbor_message::(&mut substream) + .await + .context("Failed to read message0")?; + let (swap_id, state1) = state0 + .receive(message0) + .context("Failed to transition state0 -> state1 using message0")?; + + swap_setup::write_cbor_message(&mut substream, state1.next_message()) + .await + .context("Failed to send message1")?; + + let message2 = swap_setup::read_cbor_message::(&mut substream) + .await + .context("Failed to read message2")?; + let state2 = state1 + .receive(message2) + .context("Failed to transition state1 -> state2 using message2")?; + + swap_setup::write_cbor_message(&mut substream, state2.next_message()) + .await + .context("Failed to send message3")?; + + let message4 = swap_setup::read_cbor_message::(&mut substream) + .await + .context("Failed to read message4")?; + let state3 = state2 + .receive(message4) + .context("Failed to transition state2 -> state3 using message4")?; + + substream + .flush() + .await + .context("Failed to flush substream after all messages were sent")?; + substream + .close() + .await + .context("Failed to close substream after all messages were sent")?; + + Ok((swap_id, state3)) + }); + + let max_seconds = self.timeout.as_secs(); + self.inbound_stream = OptionFuture::from(Some( + async move { + protocol.await.with_context(|| { + format!("Failed to complete execution setup within {}s", max_seconds) + })? + } + .boxed(), + )); + + self.events.push_back(HandlerOutEvent::Initiated(receiver)); + } + ConnectionEvent::DialUpgradeError(..) => { + unreachable!("Alice does not dial") + } + ConnectionEvent::FullyNegotiatedOutbound(..) => { + unreachable!("Alice does not support outbound in the handler") + } + _ => unreachable!("this wasn't implemented before..."), + } + } } impl SpotPriceResponse { diff --git a/swap/src/network/test.rs b/swap/src/network/test.rs index f27c38249..c995641c9 100644 --- a/swap/src/network/test.rs +++ b/swap/src/network/test.rs @@ -5,12 +5,14 @@ use libp2p::core::muxing::StreamMuxerBox; use libp2p::core::transport::upgrade::Version; use libp2p::core::transport::MemoryTransport; use libp2p::core::upgrade::SelectUpgrade; -use libp2p::core::{identity, Executor, Multiaddr, PeerId, Transport}; +use libp2p::core::{Executor, Multiaddr, PeerId, Transport}; +use libp2p::identity; use libp2p::mplex::MplexConfig; -use libp2p::noise::{Keypair, NoiseConfig, X25519Spec}; -use libp2p::swarm::{AddressScore, NetworkBehaviour, Swarm, SwarmBuilder, SwarmEvent}; -use libp2p::tcp::TokioTcpConfig; -use libp2p::yamux::YamuxConfig; +use libp2p::noise::{Keypair, Config as NoiseConfig, X25519Spec}; +use libp2p::swarm::{AddressScore, NetworkBehaviour, Swarm, SwarmEvent}; +use libp2p::SwarmBuilder; +use libp2p::tcp::Config as TokioTcpConfig; +use libp2p::yamux::Config as YamuxConfig; use std::fmt::Debug; use std::pin::Pin; use std::time::Duration; From 26de1664059c9a3502c9496122e6cb8da0cead1e Mon Sep 17 00:00:00 2001 From: Einliterflasche Date: Tue, 22 Oct 2024 17:06:50 +0200 Subject: [PATCH 021/112] fix more error, mostly add StreamProtocol --- Cargo.lock | 84 +++++++++++++++++++ swap/Cargo.toml | 2 +- swap/src/asb/network.rs | 8 +- swap/src/cli/behaviour.rs | 10 +-- .../cooperative_xmr_redeem_after_punish.rs | 6 +- swap/src/network/encrypted_signature.rs | 11 ++- swap/src/network/quote.rs | 14 ++-- swap/src/network/redial.rs | 2 +- swap/src/network/swarm.rs | 3 +- swap/src/network/tor_transport.rs | 20 ++--- swap/src/network/transfer_proof.rs | 8 +- swap/src/network/transport.rs | 4 +- 12 files changed, 132 insertions(+), 40 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dd0cc64ba..f3ae0ecfc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2424,6 +2424,17 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" +[[package]] +name = "futures-ticker" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9763058047f713632a52e916cc7f6a4b3fc6e9fc1ff8c5b1dc49e5a89041682e" +dependencies = [ + "futures", + "futures-timer", + "instant", +] + [[package]] name = "futures-timer" version = "3.0.3" @@ -2971,6 +2982,12 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" +[[package]] +name = "hex_fmt" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b07f60793ff0a4d9cef0f18e63b5357e06209987153a64648c972c1e5aff336f" + [[package]] name = "hickory-proto" version = "0.24.1" @@ -3867,8 +3884,10 @@ dependencies = [ "libp2p-connection-limits", "libp2p-core", "libp2p-dns", + "libp2p-gossipsub", "libp2p-identify", "libp2p-identity", + "libp2p-kad", "libp2p-mdns", "libp2p-metrics", "libp2p-noise", @@ -3931,6 +3950,7 @@ dependencies = [ "quick-protobuf", "rand 0.8.5", "rw-stream-sink", + "serde", "smallvec", "thiserror", "tracing", @@ -3955,6 +3975,38 @@ dependencies = [ "tracing", ] +[[package]] +name = "libp2p-gossipsub" +version = "0.46.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d665144a616dadebdc5fff186b1233488cdcd8bfb1223218ff084b6d052c94f7" +dependencies = [ + "asynchronous-codec 0.7.0", + "base64 0.21.7", + "byteorder", + "bytes", + "either", + "fnv", + "futures", + "futures-ticker", + "getrandom 0.2.15", + "hex_fmt", + "instant", + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", + "prometheus-client", + "quick-protobuf", + "quick-protobuf-codec 0.3.1", + "rand 0.8.5", + "regex", + "serde", + "sha2 0.10.8", + "smallvec", + "tracing", + "void", +] + [[package]] name = "libp2p-identify" version = "0.44.2" @@ -3990,12 +4042,43 @@ dependencies = [ "multihash", "quick-protobuf", "rand 0.8.5", + "serde", "sha2 0.10.8", "thiserror", "tracing", "zeroize", ] +[[package]] +name = "libp2p-kad" +version = "0.45.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cc5767727d062c4eac74dd812c998f0e488008e82cce9c33b463d38423f9ad2" +dependencies = [ + "arrayvec", + "asynchronous-codec 0.7.0", + "bytes", + "either", + "fnv", + "futures", + "futures-bounded", + "futures-timer", + "instant", + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", + "quick-protobuf", + "quick-protobuf-codec 0.3.1", + "rand 0.8.5", + "serde", + "sha2 0.10.8", + "smallvec", + "thiserror", + "tracing", + "uint", + "void", +] + [[package]] name = "libp2p-mdns" version = "0.45.1" @@ -4655,6 +4738,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "076d548d76a0e2a0d4ab471d0b1c36c577786dfc4471242035d97a12a735c492" dependencies = [ "core2", + "serde", "unsigned-varint 0.7.2", ] diff --git a/swap/Cargo.toml b/swap/Cargo.toml index f2440a158..e98ab41c5 100644 --- a/swap/Cargo.toml +++ b/swap/Cargo.toml @@ -43,7 +43,7 @@ hyper = "0.14.20" itertools = "0.13" jsonrpsee = { version = "0.16.2", features = [ "server" ] } jsonrpsee-core = "0.16.2" -libp2p = { version = "0.53.2", features = [ "tcp", "yamux", "dns", "noise", "request-response", "websocket", "ping", "rendezvous", "identify", "macros", "cbor", "json", "tokio" ] } +libp2p = { version = "0.53.2", features = [ "tcp", "yamux", "dns", "noise", "request-response", "websocket", "ping", "rendezvous", "identify", "macros", "cbor", "json", "tokio", "serde" ] } monero = { version = "0.12", features = [ "serde_support" ] } monero-rpc = { path = "../monero-rpc" } once_cell = "1.19" diff --git a/swap/src/asb/network.rs b/swap/src/asb/network.rs index a08f5a190..c3ff846a7 100644 --- a/swap/src/asb/network.rs +++ b/swap/src/asb/network.rs @@ -16,7 +16,7 @@ use libp2p::core::transport::Boxed; use libp2p::request_response::ResponseChannel; use libp2p::swarm::dial_opts::PeerCondition; use libp2p::swarm::NetworkBehaviour; -use libp2p::{Multiaddr, PeerId, Transport}; +use libp2p::{Multiaddr, PeerId}; use std::task::Poll; use std::time::Duration; use uuid::Uuid; @@ -40,7 +40,7 @@ pub mod transport { pub mod behaviour { use libp2p::{ - identify, identity, ping, request_response::InboundRequestId, + identify, identity, ping, request_response::OutboundRequestId, swarm::behaviour::toggle::Toggle, }; @@ -67,7 +67,7 @@ pub mod behaviour { }, TransferProofAcknowledged { peer: PeerId, - id: InboundRequestId, + id: OutboundRequestId, }, EncryptedSignatureReceived { msg: encrypted_signature::Request, @@ -312,7 +312,7 @@ pub mod rendezvous { ) } - fn on_swarm_event(&mut self, event: FromSwarm) { + fn on_swarm_event(&mut self, event: FromSwarm<'_>) { match event { FromSwarm::ConnectionEstablished(e) => { let peer_id = e.peer_id; diff --git a/swap/src/cli/behaviour.rs b/swap/src/cli/behaviour.rs index 1501d5ec9..12e5af6e7 100644 --- a/swap/src/cli/behaviour.rs +++ b/swap/src/cli/behaviour.rs @@ -10,7 +10,7 @@ use crate::protocol::bob::State2; use crate::{bitcoin, env}; use anyhow::{anyhow, Error, Result}; use libp2p::core::Multiaddr; -use libp2p::request_response::{InboundRequestId, ResponseChannel}; +use libp2p::request_response::{OutboundRequestId, ResponseChannel}; use libp2p::swarm::NetworkBehaviour; use libp2p::{identify, identity, ping, PeerId}; use std::sync::Arc; @@ -19,7 +19,7 @@ use std::time::Duration; #[derive(Debug)] pub enum OutEvent { QuoteReceived { - id: InboundRequestId, + id: OutboundRequestId, response: BidQuote, }, SwapSetupCompleted(Box>), @@ -29,15 +29,15 @@ pub enum OutEvent { peer: PeerId, }, EncryptedSignatureAcknowledged { - id: InboundRequestId, + id: OutboundRequestId, }, CooperativeXmrRedeemFulfilled { - id: InboundRequestId, + id: OutboundRequestId, s_a: Scalar, swap_id: uuid::Uuid, }, CooperativeXmrRedeemRejected { - id: InboundRequestId, + id: OutboundRequestId, reason: CooperativeXmrRedeemRejectReason, swap_id: uuid::Uuid, }, diff --git a/swap/src/network/cooperative_xmr_redeem_after_punish.rs b/swap/src/network/cooperative_xmr_redeem_after_punish.rs index f0a9ea4db..3d940ef37 100644 --- a/swap/src/network/cooperative_xmr_redeem_after_punish.rs +++ b/swap/src/network/cooperative_xmr_redeem_after_punish.rs @@ -1,7 +1,7 @@ use crate::monero::Scalar; use crate::{asb, cli}; use libp2p::request_response::ProtocolSupport; -use libp2p::{request_response, PeerId}; +use libp2p::{request_response, PeerId, StreamProtocol}; use serde::{Deserialize, Serialize}; use uuid::Uuid; @@ -49,14 +49,14 @@ pub enum Response { pub fn alice() -> Behaviour { Behaviour::new( - vec![(CooperativeXmrRedeemProtocol, ProtocolSupport::Inbound)], + vec![(StreamProtocol::new(CooperativeXmrRedeemProtocol.as_ref()), ProtocolSupport::Inbound)], request_response::Config::default(), ) } pub fn bob() -> Behaviour { Behaviour::new( - vec![(CooperativeXmrRedeemProtocol, ProtocolSupport::Outbound)], + vec![(StreamProtocol::new(CooperativeXmrRedeemProtocol.as_ref()), ProtocolSupport::Outbound)], request_response::Config::default(), ) } diff --git a/swap/src/network/encrypted_signature.rs b/swap/src/network/encrypted_signature.rs index 52afb3f5b..233cc9ae8 100644 --- a/swap/src/network/encrypted_signature.rs +++ b/swap/src/network/encrypted_signature.rs @@ -1,6 +1,6 @@ use crate::{asb, cli}; use libp2p::request_response::{self, ProtocolSupport}; -use libp2p::PeerId; +use libp2p::{PeerId, StreamProtocol}; use serde::{Deserialize, Serialize}; use uuid::Uuid; @@ -15,7 +15,7 @@ pub struct EncryptedSignatureProtocol; impl AsRef for EncryptedSignatureProtocol { fn as_ref(&self) -> &str { - PROTOCOL.as_bytes() + PROTOCOL } } @@ -27,7 +27,10 @@ pub struct Request { pub fn alice() -> Behaviour { Behaviour::new( - vec![(EncryptedSignatureProtocol, ProtocolSupport::Inbound)], + vec![( + StreamProtocol::new(EncryptedSignatureProtocol.as_ref()), + request_response::ProtocolSupport::Inbound, + )], request_response::Config::default(), ) } @@ -35,7 +38,7 @@ pub fn alice() -> Behaviour { pub fn bob() -> Behaviour { Behaviour::new( vec![( - EncryptedSignatureProtocol, + StreamProtocol::new(EncryptedSignatureProtocol.as_ref()), request_response::ProtocolSupport::Outbound, )], request_response::Config::default(), diff --git a/swap/src/network/quote.rs b/swap/src/network/quote.rs index ea112106a..749cab4ce 100644 --- a/swap/src/network/quote.rs +++ b/swap/src/network/quote.rs @@ -1,10 +1,10 @@ use crate::{asb, bitcoin, cli}; use libp2p::request_response::{self, ProtocolSupport}; -use libp2p::PeerId; +use libp2p::{PeerId, StreamProtocol}; use serde::{Deserialize, Serialize}; use typeshare::typeshare; -const PROTOCOL: &str = "/comit/xmr/btc/bid-quote/1.0.0"; +const PROTOCOL: &str = BidQuoteProtocol::PROTOCOL_ID; pub(crate) type OutEvent = request_response::Event<(), BidQuote>; type Message = request_response::Message<(), BidQuote>; @@ -13,9 +13,13 @@ pub type Behaviour = request_response::json::Behaviour<(), BidQuote>; #[derive(Debug, Clone, Copy, Default)] pub struct BidQuoteProtocol; +impl BidQuoteProtocol { + const PROTOCOL_ID: &str = "/comit/xmr/btc/bid-quote/1.0.0"; +} + impl AsRef for BidQuoteProtocol { fn as_ref(&self) -> &str { - PROTOCOL.as_bytes() + PROTOCOL } } @@ -48,7 +52,7 @@ pub struct ZeroQuoteReceived; /// handing out quotes. pub fn asb() -> Behaviour { Behaviour::new( - vec![(BidQuoteProtocol, ProtocolSupport::Inbound)], + vec![(StreamProtocol::new(BidQuoteProtocol::PROTOCOL_ID), ProtocolSupport::Inbound)], request_response::Config::default(), ) } @@ -59,7 +63,7 @@ pub fn asb() -> Behaviour { /// requesting quotes. pub fn cli() -> Behaviour { Behaviour::new( - vec![(BidQuoteProtocol, ProtocolSupport::Outbound)], + vec![(StreamProtocol::new(BidQuoteProtocol::PROTOCOL_ID), ProtocolSupport::Outbound)], request_response::Config::default(), ) } diff --git a/swap/src/network/redial.rs b/swap/src/network/redial.rs index fe86f6d16..46ad049c7 100644 --- a/swap/src/network/redial.rs +++ b/swap/src/network/redial.rs @@ -85,7 +85,7 @@ impl NetworkBehaviour for Behaviour { Ok(Self::ConnectionHandler::default()) } - fn on_swarm_event(&mut self, event: libp2p::swarm::FromSwarm) { + fn on_swarm_event(&mut self, event: libp2p::swarm::FromSwarm<'_>) { // TODO: Libp2p Upgrade: Maybe we also need to match for FromSwarm::DialFailure here? if let libp2p::swarm::FromSwarm::ConnectionClosed(closed) = event { diff --git a/swap/src/network/swarm.rs b/swap/src/network/swarm.rs index 37bb0a5ef..c57f4c01b 100644 --- a/swap/src/network/swarm.rs +++ b/swap/src/network/swarm.rs @@ -4,7 +4,8 @@ use crate::network::rendezvous::XmrBtcNamespace; use crate::seed::Seed; use crate::{asb, bitcoin, cli, env, tor}; use anyhow::Result; -use libp2p::swarm::{NetworkBehaviour, SwarmBuilder}; +use libp2p::swarm::NetworkBehaviour; +use libp2p::SwarmBuilder; use libp2p::{identity, Multiaddr, Swarm}; use std::fmt::Debug; diff --git a/swap/src/network/tor_transport.rs b/swap/src/network/tor_transport.rs index 8adf7ecda..9d9a680b6 100644 --- a/swap/src/network/tor_transport.rs +++ b/swap/src/network/tor_transport.rs @@ -43,20 +43,20 @@ impl Transport for TorDialOnlyTransport { return Err(TransportError::MultiaddrNotSupported(addr)); } - let dial_future = async move { + let socks_port = self.socks_port.clone(); + + Ok(Box::pin(async move { tracing::debug!(address = %addr, "Establishing connection through Tor proxy"); let stream = - Socks5Stream::connect((Ipv4Addr::LOCALHOST, self.socks_port), address.to_string()) + Socks5Stream::connect((Ipv4Addr::LOCALHOST, socks_port), address.to_string()) .await .map_err(|e| io::Error::new(io::ErrorKind::ConnectionRefused, e))?; tracing::debug!("Connection through Tor established"); Ok(TcpStream(stream.into_inner())) - }; - - Ok(dial_future.boxed()) + })) } fn address_translation(&self, _: &Multiaddr, _: &Multiaddr) -> Option { @@ -73,20 +73,20 @@ impl Transport for TorDialOnlyTransport { return Err(TransportError::MultiaddrNotSupported(addr)); } - let dial_future = async move { + let socks_port = self.socks_port.clone(); + + Ok(Box::pin(async move { tracing::debug!(address = %addr, "Establishing connection through Tor proxy"); let stream = - Socks5Stream::connect((Ipv4Addr::LOCALHOST, self.socks_port), address.to_string()) + Socks5Stream::connect((Ipv4Addr::LOCALHOST, socks_port), address.to_string()) .await .map_err(|e| io::Error::new(io::ErrorKind::ConnectionRefused, e))?; tracing::debug!("Connection through Tor established"); Ok(TcpStream(stream.into_inner())) - }; - - Ok(dial_future.boxed()) + })) } fn remove_listener(&mut self, id: ListenerId) -> bool { diff --git a/swap/src/network/transfer_proof.rs b/swap/src/network/transfer_proof.rs index badb548c3..3fe92deec 100644 --- a/swap/src/network/transfer_proof.rs +++ b/swap/src/network/transfer_proof.rs @@ -1,6 +1,6 @@ use crate::{asb, cli, monero}; use libp2p::request_response::{self, ProtocolSupport}; -use libp2p::PeerId; +use libp2p::{PeerId, StreamProtocol}; use serde::{Deserialize, Serialize}; use uuid::Uuid; @@ -15,7 +15,7 @@ pub struct TransferProofProtocol; impl AsRef for TransferProofProtocol { fn as_ref(&self) -> &str { - PROTOCOL.as_bytes() + PROTOCOL } } @@ -27,14 +27,14 @@ pub struct Request { pub fn alice() -> Behaviour { Behaviour::new( - vec![(TransferProofProtocol, ProtocolSupport::Outbound)], + vec![(StreamProtocol::new(PROTOCOL), ProtocolSupport::Outbound)], request_response::Config::default(), ) } pub fn bob() -> Behaviour { Behaviour::new( - vec![(TransferProofProtocol, ProtocolSupport::Inbound)], + vec![(StreamProtocol::new(PROTOCOL), ProtocolSupport::Inbound)], request_response::Config::default(), ) } diff --git a/swap/src/network/transport.rs b/swap/src/network/transport.rs index 58ff3cb34..5c2c6a2ac 100644 --- a/swap/src/network/transport.rs +++ b/swap/src/network/transport.rs @@ -20,8 +20,8 @@ pub fn authenticate_and_multiplex( where T: AsyncRead + AsyncWrite + Unpin + Send + 'static, { - let auth_upgrade = noise::Config::new(&identity); - let multiplex_upgrade: yamux::Config::default(); + let auth_upgrade = noise::Config::new(&identity)?; + let multiplex_upgrade = yamux::Config::default(); let transport = transport .upgrade(Version::V1) From d9679f3322c9926d55ba5f0d48692c143beec46a Mon Sep 17 00:00:00 2001 From: Einliterflasche Date: Tue, 22 Oct 2024 17:18:35 +0200 Subject: [PATCH 022/112] refactor: uncomment NetworkBehaviourEventProcess --- swap/src/cli.rs | 68 ++++++++++++++++++++-------------------- swap/src/network/test.rs | 6 ++-- 2 files changed, 37 insertions(+), 37 deletions(-) diff --git a/swap/src/cli.rs b/swap/src/cli.rs index 4d5f01cfe..51b10b256 100644 --- a/swap/src/cli.rs +++ b/swap/src/cli.rs @@ -123,35 +123,35 @@ mod tests { ping: libp2p::ping::Behaviour, quote: quote::Behaviour, - // #[behaviour(ignore)] - // static_quote: BidQuote, - // #[behaviour(ignore)] - // registered: bool, + #[behaviour(ignore)] + static_quote: BidQuote, + #[behaviour(ignore)] + registered: bool, + } + impl NetworkBehaviourEventProcess for StaticQuoteAsbBehaviour { + fn inject_event(&mut self, event: rendezvous::client::Event) { + if let rendezvous::client::Event::Registered { .. } = event { + self.registered = true; + } + } + } + + impl NetworkBehaviourEventProcess for StaticQuoteAsbBehaviour { + fn inject_event(&mut self, _: libp2p::ping::Event) {} + } + impl NetworkBehaviourEventProcess for StaticQuoteAsbBehaviour { + fn inject_event(&mut self, event: quote::OutEvent) { + if let request_response::Event::Message { + message: quote::Message::Request { channel, .. }, + .. + } = event + { + self.quote + .send_response(channel, self.static_quote) + .unwrap(); + } + } } - // impl NetworkBehaviourEventProcess for StaticQuoteAsbBehaviour { - // fn inject_event(&mut self, event: rendezvous::client::Event) { - // if let rendezvous::client::Event::Registered { .. } = event { - // self.registered = true; - // } - // } - // } - - // impl NetworkBehaviourEventProcess for StaticQuoteAsbBehaviour { - // fn inject_event(&mut self, _: libp2p::ping::Event) {} - // } - // impl NetworkBehaviourEventProcess for StaticQuoteAsbBehaviour { - // fn inject_event(&mut self, event: quote::OutEvent) { - // if let request_response::Event::Message { - // message: quote::Message::Request { channel, .. }, - // .. - // } = event - // { - // self.quote - // .send_response(channel, self.static_quote) - // .unwrap(); - // } - // } - // } #[derive(libp2p::swarm::NetworkBehaviour)] struct RendezvousPointBehaviour { @@ -160,12 +160,12 @@ mod tests { ping: libp2p::ping::Behaviour, } - // impl NetworkBehaviourEventProcess for RendezvousPointBehaviour { - // fn inject_event(&mut self, _: rendezvous::server::Event) {} - // } - // impl NetworkBehaviourEventProcess for RendezvousPointBehaviour { - // fn inject_event(&mut self, _: libp2p::ping::Event) {} - // } + impl NetworkBehaviourEventProcess for RendezvousPointBehaviour { + fn inject_event(&mut self, _: rendezvous::server::Event) {} + } + impl NetworkBehaviourEventProcess for RendezvousPointBehaviour { + fn inject_event(&mut self, _: libp2p::ping::Event) {} + } impl Default for RendezvousPointBehaviour { fn default() -> Self { diff --git a/swap/src/network/test.rs b/swap/src/network/test.rs index c995641c9..c200a9826 100644 --- a/swap/src/network/test.rs +++ b/swap/src/network/test.rs @@ -108,7 +108,7 @@ pub trait SwarmExt { async fn block_on_connection(&mut self, other: &mut Swarm) where T: NetworkBehaviour, - ::OutEvent: Debug; + ::ToSwarm: Debug; /// Listens on a random memory address, polling the [`Swarm`] until the /// transport is ready to accept connections. @@ -123,12 +123,12 @@ pub trait SwarmExt { impl SwarmExt for Swarm where B: NetworkBehaviour, - ::OutEvent: Debug, + ::ToSwarm: Debug, { async fn block_on_connection(&mut self, other: &mut Swarm) where T: NetworkBehaviour, - ::OutEvent: Debug, + ::ToSwarm: Debug, { let addr_to_dial = other.external_addresses().next().unwrap().addr.clone(); let local_peer_id = *other.local_peer_id(); From adc254a8316079e442af2d584ff659fee4d69d5f Mon Sep 17 00:00:00 2001 From: Einliterflasche Date: Tue, 22 Oct 2024 17:19:44 +0200 Subject: [PATCH 023/112] fix(libp2p): Use new SwarmBuilder API for constructing ASB/CLI swarms --- swap/src/network/swap_setup.rs | 35 +++++++++++++++------------- swap/src/network/swap_setup/alice.rs | 6 ++--- swap/src/network/swarm.rs | 18 +++++++------- 3 files changed, 30 insertions(+), 29 deletions(-) diff --git a/swap/src/network/swap_setup.rs b/swap/src/network/swap_setup.rs index eb48a2f28..de65a1995 100644 --- a/swap/src/network/swap_setup.rs +++ b/swap/src/network/swap_setup.rs @@ -1,7 +1,10 @@ use crate::monero; use anyhow::{Context, Result}; +use asynchronous_codec::{Bytes, Framed, FramedRead, FramedWrite, LengthCodec}; +use futures::{SinkExt, StreamExt}; use libp2p::core::upgrade; -use libp2p::swarm::NegotiatedSubstream; + +use libp2p::swarm::Stream; use serde::de::DeserializeOwned; use serde::{Deserialize, Serialize}; @@ -12,9 +15,8 @@ pub const BUF_SIZE: usize = 1024 * 1024; pub mod protocol { use futures::future; - use libp2p::core::upgrade::{from_fn, FromFnUpgrade}; use libp2p::core::Endpoint; - use libp2p::swarm::NegotiatedSubstream; + use libp2p::swarm::Stream; use void::Void; pub fn new() -> SwapSetup { @@ -26,14 +28,7 @@ pub mod protocol { pub type SwapSetup = FromFnUpgrade< &'static [u8], - Box< - dyn Fn( - NegotiatedSubstream, - Endpoint, - ) -> future::Ready> - + Send - + 'static, - >, + Box future::Ready> + Send + 'static>, >; } @@ -86,13 +81,17 @@ pub enum SpotPriceError { Other, } -pub async fn read_cbor_message(substream: &mut NegotiatedSubstream) -> Result +pub async fn read_cbor_message(substream: &mut Stream) -> Result where T: DeserializeOwned, { - let bytes = upgrade::read_length_prefixed(substream, BUF_SIZE) + let mut frame = Framed::new(substream, LengthCodec {}); + + let bytes = frame + .next() .await - .context("Failed to read length-prefixed message from stream")?; + .context("Failed to read length-prefixed message from stream")??; + let mut de = serde_cbor::Deserializer::from_slice(&bytes); let message = T::deserialize(&mut de).context("Failed to deserialize bytes into message using CBOR")?; @@ -100,13 +99,17 @@ where Ok(message) } -pub async fn write_cbor_message(substream: &mut NegotiatedSubstream, message: T) -> Result<()> +pub async fn write_cbor_message(substream: &mut Stream, message: T) -> Result<()> where T: Serialize, { + let mut frame = Framed::new(substream, LengthCodec {}); + let bytes = serde_cbor::to_vec(&message).context("Failed to serialize message as bytes using CBOR")?; - upgrade::write_length_prefixed(substream, &bytes) + + frame + .send(Bytes::from(bytes)) .await .context("Failed to write bytes as length-prefixed message")?; diff --git a/swap/src/network/swap_setup/alice.rs b/swap/src/network/swap_setup/alice.rs index 61159cfe7..b3fce7e8e 100644 --- a/swap/src/network/swap_setup/alice.rs +++ b/swap/src/network/swap_setup/alice.rs @@ -220,7 +220,7 @@ pub struct Handler { resume_only: bool, timeout: Duration, - // keep_alive: KeepAlive, + keep_alive: KeepAlive, } impl Handler { @@ -240,7 +240,7 @@ impl Handler { latest_rate, resume_only, timeout: Duration::from_secs(120), - // keep_alive: KeepAlive::Until(Instant::now() + Duration::from_secs(10)), + keep_alive: KeepAlive::Until(Instant::now() + Duration::from_secs(10)), } } } @@ -313,7 +313,7 @@ where ) { match event { ConnectionEvent::FullyNegotiatedInbound(substream) => { - // self.keep_alive = KeepAlive::Yes; + self.keep_alive = KeepAlive::Yes; let (sender, receiver) = bmrng::channel_with_timeout::( 1, diff --git a/swap/src/network/swarm.rs b/swap/src/network/swarm.rs index c57f4c01b..def3b516f 100644 --- a/swap/src/network/swarm.rs +++ b/swap/src/network/swarm.rs @@ -47,12 +47,11 @@ where ); let transport = asb::transport::new(&identity)?; - let peer_id = identity.public().into(); - let swarm = SwarmBuilder::new(transport, behaviour, peer_id) - .executor(Box::new(|f| { - tokio::spawn(f); - })) + let swarm = SwarmBuilder::with_existing_identity(identity) + .with_tokio() + .with_other_transport(|_| transport)? + .with_behaviour(|_| behaviour)? .build(); Ok(swarm) @@ -72,12 +71,11 @@ where }; let transport = cli::transport::new(&identity, maybe_tor_socks5_port)?; - let peer_id = identity.public().into(); - let swarm = SwarmBuilder::new(transport, behaviour, peer_id) - .executor(Box::new(|f| { - tokio::spawn(f); - })) + let swarm = SwarmBuilder::with_existing_identity(identity) + .with_tokio() + .with_other_transport(|_| transport)? + .with_behaviour(|_| behaviour)? .build(); Ok(swarm) From a6d00356d1f8982624570eb149e08e6c9f75b674 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Wed, 23 Oct 2024 01:17:41 +0200 Subject: [PATCH 024/112] fix(libp2p): Fix extrtact_peer_id util function --- swap/src/libp2p_ext.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swap/src/libp2p_ext.rs b/swap/src/libp2p_ext.rs index 11be4c505..aa7fc2641 100644 --- a/swap/src/libp2p_ext.rs +++ b/swap/src/libp2p_ext.rs @@ -8,7 +8,7 @@ pub trait MultiAddrExt { impl MultiAddrExt for Multiaddr { fn extract_peer_id(&self) -> Option { match self.iter().last()? { - Protocol::P2p(multihash) => PeerId::from_multihash(multihash).ok(), + Protocol::P2p(peer_id) => Some(peer_id), _ => None, } } From b8323d4acfec73ea8843a37dbfb30b4ef7e7db03 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Wed, 23 Oct 2024 01:18:45 +0200 Subject: [PATCH 025/112] fix(libp2p): Use new identity::Keypair::ed25519_from_bytes API for deriving libp2p identity --- swap/src/seed.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/swap/src/seed.rs b/swap/src/seed.rs index a17a79642..5bcdc374f 100644 --- a/swap/src/seed.rs +++ b/swap/src/seed.rs @@ -43,9 +43,9 @@ impl Seed { pub fn derive_libp2p_identity(&self) -> identity::Keypair { let bytes = self.derive(b"NETWORK").derive(b"LIBP2P_IDENTITY").bytes(); - let key = identity::ed25519::SecretKey::from_bytes(bytes).expect("we always pass 32 bytes"); + let key = identity::Keypair::ed25519_from_bytes(bytes).expect("we always pass 32 bytes"); - identity::Keypair::Ed25519(key.into()) + key } pub fn derive_torv3_key(&self) -> TorSecretKeyV3 { From 82947f54cbde6aa51adce62f631ef462ef3d59b8 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Wed, 23 Oct 2024 01:29:21 +0200 Subject: [PATCH 026/112] fix(libp2p): Remove websocket transport for asb, use correct API for constructing tcp transport --- swap/src/asb/network.rs | 11 ++++------- swap/src/cli/transport.rs | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/swap/src/asb/network.rs b/swap/src/asb/network.rs index c3ff846a7..34137b53d 100644 --- a/swap/src/asb/network.rs +++ b/swap/src/asb/network.rs @@ -22,19 +22,16 @@ use std::time::Duration; use uuid::Uuid; pub mod transport { - use libp2p::{dns, identity, tcp, websocket::WsConfig}; + use libp2p::{dns, identity, tcp}; use super::*; /// Creates the libp2p transport for the ASB. pub fn new(identity: &identity::Keypair) -> Result> { - let tcp = tcp::Config::new().nodelay(true); - let tcp_with_dns = dns::ResolverConfig::default::system(tcp)?; - let websocket_with_dns = WsConfig::new(tcp_with_dns.clone()); + let tcp = tcp::tokio::Transport::new(tcp::Config::new().nodelay(true)); + let tcp_with_dns = dns::tokio::Transport::system(tcp)?; - let transport = tcp_with_dns.or_transport(websocket_with_dns).boxed(); - - authenticate_and_multiplex(transport, identity) + authenticate_and_multiplex(Boxed::new(tcp_with_dns), identity) } } diff --git a/swap/src/cli/transport.rs b/swap/src/cli/transport.rs index 11e397cbf..b70fb299a 100644 --- a/swap/src/cli/transport.rs +++ b/swap/src/cli/transport.rs @@ -19,7 +19,7 @@ pub fn new( identity: &identity::Keypair, maybe_tor_socks5_port: Option, ) -> Result> { - let tcp = tcp::Config::new().nodelay(true); + let tcp = tcp::tokio::Transport::new(tcp::Config::new().nodelay(true)); let tcp_with_dns = dns::tokio::Transport::system(tcp)?; let maybe_tor_transport = match maybe_tor_socks5_port { From 8e1c0a74f4a822f4f2902fd27d23fe37d5e8317b Mon Sep 17 00:00:00 2001 From: binarybaron Date: Wed, 23 Oct 2024 13:32:49 +0200 Subject: [PATCH 027/112] fix(libp2p): Use unsigned_varint and asynchronous_codex to replace upgrade::write_length_prefixed --- Cargo.lock | 9 +++++++++ swap/Cargo.toml | 2 ++ swap/src/network/swap_setup.rs | 17 +++++++++-------- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f3ae0ecfc..a2df0323b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -331,6 +331,8 @@ dependencies = [ "futures-util", "memchr", "pin-project-lite", + "serde", + "serde_cbor", ] [[package]] @@ -7524,6 +7526,7 @@ dependencies = [ "anyhow", "async-compression", "async-trait", + "asynchronous-codec 0.7.0", "atty", "backoff", "base64 0.22.1", @@ -7597,6 +7600,7 @@ dependencies = [ "tracing-futures", "tracing-subscriber", "typeshare", + "unsigned-varint 0.8.0", "url", "uuid", "vergen", @@ -8947,6 +8951,11 @@ name = "unsigned-varint" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb066959b24b5196ae73cb057f45598450d2c5f71460e98c49b738086eff9c06" +dependencies = [ + "asynchronous-codec 0.7.0", + "bytes", + "tokio-util", +] [[package]] name = "unstoppableswap-gui-rs" diff --git a/swap/Cargo.toml b/swap/Cargo.toml index e98ab41c5..607844d9a 100644 --- a/swap/Cargo.toml +++ b/swap/Cargo.toml @@ -15,6 +15,7 @@ tauri = [ "dep:tauri" ] anyhow = "1" async-compression = { version = "0.3", features = [ "bzip2", "tokio" ] } async-trait = "0.1" +asynchronous-codec = { version = "0.7.0", features = [ "cbor" ] } atty = "0.2" backoff = { version = "0.4", features = [ "tokio" ] } base64 = "0.22" @@ -116,6 +117,7 @@ tracing-subscriber = { version = "0.3", default-features = false, features = [ "json", ] } typeshare = "1.0.3" +unsigned-varint = { version = "0.8.0", features = [ "codec", "asynchronous_codec" ] } url = { version = "2", features = [ "serde" ] } uuid = { version = "1.9", features = [ "serde", "v4" ] } void = "1" diff --git a/swap/src/network/swap_setup.rs b/swap/src/network/swap_setup.rs index de65a1995..dc0fd740f 100644 --- a/swap/src/network/swap_setup.rs +++ b/swap/src/network/swap_setup.rs @@ -1,8 +1,7 @@ use crate::monero; use anyhow::{Context, Result}; -use asynchronous_codec::{Bytes, Framed, FramedRead, FramedWrite, LengthCodec}; +use asynchronous_codec::{Bytes, Framed}; use futures::{SinkExt, StreamExt}; -use libp2p::core::upgrade; use libp2p::swarm::Stream; use serde::de::DeserializeOwned; @@ -81,11 +80,13 @@ pub enum SpotPriceError { Other, } -pub async fn read_cbor_message(substream: &mut Stream) -> Result +pub async fn read_cbor_message(stream: &mut Stream) -> Result where T: DeserializeOwned, { - let mut frame = Framed::new(substream, LengthCodec {}); + let codec = unsigned_varint::codec::UviBytes::::default(); + + let mut frame = Framed::new(stream, codec); let bytes = frame .next() @@ -99,14 +100,14 @@ where Ok(message) } -pub async fn write_cbor_message(substream: &mut Stream, message: T) -> Result<()> +pub async fn write_cbor_message(stream: &mut Stream, message: T) -> Result<()> where T: Serialize, { - let mut frame = Framed::new(substream, LengthCodec {}); + let bytes = serde_cbor::to_vec(&message).context("Failed to serialize message as bytes using CBOR")?; - let bytes = - serde_cbor::to_vec(&message).context("Failed to serialize message as bytes using CBOR")?; + let codec = unsigned_varint::codec::UviBytes::default(); + let mut frame = Framed::new(stream, codec); frame .send(Bytes::from(bytes)) From fcd489bb3b19ff32e486fa9bf0b7492baeb20a2e Mon Sep 17 00:00:00 2001 From: binarybaron Date: Wed, 23 Oct 2024 13:35:24 +0200 Subject: [PATCH 028/112] fix(libp2p): Use .boxed() to create transport --- swap/src/asb/network.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/swap/src/asb/network.rs b/swap/src/asb/network.rs index 34137b53d..eb4b75a98 100644 --- a/swap/src/asb/network.rs +++ b/swap/src/asb/network.rs @@ -22,7 +22,7 @@ use std::time::Duration; use uuid::Uuid; pub mod transport { - use libp2p::{dns, identity, tcp}; + use libp2p::{dns, identity, tcp, Transport}; use super::*; @@ -31,7 +31,7 @@ pub mod transport { let tcp = tcp::tokio::Transport::new(tcp::Config::new().nodelay(true)); let tcp_with_dns = dns::tokio::Transport::system(tcp)?; - authenticate_and_multiplex(Boxed::new(tcp_with_dns), identity) + authenticate_and_multiplex(tcp_with_dns.boxed(), identity) } } From 7a01b5c31b5272099a41e019c58fec77f3046f02 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Wed, 23 Oct 2024 15:57:09 +0200 Subject: [PATCH 029/112] fix(libp2p): Use correct Outbound/InboundRequestId in swap/src/cli/event_loop.rs --- swap/src/cli/event_loop.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/swap/src/cli/event_loop.rs b/swap/src/cli/event_loop.rs index 1ea684877..9af093d8f 100644 --- a/swap/src/cli/event_loop.rs +++ b/swap/src/cli/event_loop.rs @@ -10,7 +10,7 @@ use crate::protocol::Database; use anyhow::{Context, Result}; use futures::future::{BoxFuture, OptionFuture}; use futures::{FutureExt, StreamExt}; -use libp2p::request_response::{InboundRequestId, ResponseChannel}; +use libp2p::request_response::{InboundRequestId, OutboundRequestId, ResponseChannel}; use libp2p::swarm::dial_opts::DialOpts; use libp2p::swarm::SwarmEvent; use libp2p::{PeerId, Swarm}; @@ -35,10 +35,10 @@ pub struct EventLoop { // these represents requests that are currently in-flight. // once we get a response to a matching [`RequestId`], we will use the responder to relay the // response. - inflight_quote_requests: HashMap>, - inflight_encrypted_signature_requests: HashMap>, + inflight_quote_requests: HashMap>, + inflight_encrypted_signature_requests: HashMap>, inflight_swap_setup: Option>>, - inflight_cooperative_xmr_redeem_requests: HashMap>, + inflight_cooperative_xmr_redeem_requests: HashMap>, /// The sender we will use to relay incoming transfer proofs. transfer_proof: bmrng::RequestSender, /// The future representing the successful handling of an incoming transfer From 988255e7dbea97b91db5f504eb3347cc8bc42f03 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Wed, 23 Oct 2024 15:57:34 +0200 Subject: [PATCH 030/112] fix(libp2p): Set max buffer length for unsigned_varint codex --- swap/src/network/swap_setup.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/swap/src/network/swap_setup.rs b/swap/src/network/swap_setup.rs index dc0fd740f..caabe9cf5 100644 --- a/swap/src/network/swap_setup.rs +++ b/swap/src/network/swap_setup.rs @@ -80,13 +80,17 @@ pub enum SpotPriceError { Other, } +fn codec() -> unsigned_varint::codec::UviBytes { + let mut codec = unsigned_varint::codec::UviBytes::::default(); + codec.set_max_len(BUF_SIZE); + codec +} + pub async fn read_cbor_message(stream: &mut Stream) -> Result where T: DeserializeOwned, { - let codec = unsigned_varint::codec::UviBytes::::default(); - - let mut frame = Framed::new(stream, codec); + let mut frame = Framed::new(stream, codec()); let bytes = frame .next() @@ -106,8 +110,7 @@ where { let bytes = serde_cbor::to_vec(&message).context("Failed to serialize message as bytes using CBOR")?; - let codec = unsigned_varint::codec::UviBytes::default(); - let mut frame = Framed::new(stream, codec); + let mut frame = Framed::new(stream, codec()); frame .send(Bytes::from(bytes)) From d3a681a9817afef94990f78daac9067ff17a10c5 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Wed, 23 Oct 2024 16:24:34 +0200 Subject: [PATCH 031/112] fix(libp2p): Construct dummy connection handler directly without call to ::default() --- swap/src/network/redial.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/swap/src/network/redial.rs b/swap/src/network/redial.rs index 46ad049c7..43e0ee95b 100644 --- a/swap/src/network/redial.rs +++ b/swap/src/network/redial.rs @@ -69,7 +69,7 @@ impl NetworkBehaviour for Behaviour { if peer == self.peer { self.sleep = None; // Cancel any active re-dialling } - Ok(Self::ConnectionHandler::default()) + Ok(Self::ConnectionHandler {}) } fn handle_established_outbound_connection( @@ -82,7 +82,7 @@ impl NetworkBehaviour for Behaviour { if peer == self.peer { self.sleep = None; // Cancel any active re-dialling } - Ok(Self::ConnectionHandler::default()) + Ok(Self::ConnectionHandler {}) } fn on_swarm_event(&mut self, event: libp2p::swarm::FromSwarm<'_>) { From 03367ba3856d976c88b2ecd2a36c6463c96bd023 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Wed, 23 Oct 2024 16:25:34 +0200 Subject: [PATCH 032/112] fix(libp2p): Vendor from_fn, FromFnUpgrade which were removed --- swap/src/network/swap_setup.rs | 7 +- swap/src/network/swap_setup/vendor_from_fn.rs | 114 ++++++++++++++++++ 2 files changed, 119 insertions(+), 2 deletions(-) create mode 100644 swap/src/network/swap_setup/vendor_from_fn.rs diff --git a/swap/src/network/swap_setup.rs b/swap/src/network/swap_setup.rs index caabe9cf5..2ce007d7d 100644 --- a/swap/src/network/swap_setup.rs +++ b/swap/src/network/swap_setup.rs @@ -9,6 +9,7 @@ use serde::{Deserialize, Serialize}; pub mod alice; pub mod bob; +mod vendor_from_fn; pub const BUF_SIZE: usize = 1024 * 1024; @@ -18,15 +19,17 @@ pub mod protocol { use libp2p::swarm::Stream; use void::Void; + use super::vendor_from_fn::{from_fn, FromFnUpgrade}; + pub fn new() -> SwapSetup { from_fn( - b"/comit/xmr/btc/swap_setup/1.0.0", + "/comit/xmr/btc/swap_setup/1.0.0", Box::new(|socket, _| future::ready(Ok(socket))), ) } pub type SwapSetup = FromFnUpgrade< - &'static [u8], + &'static str, Box future::Ready> + Send + 'static>, >; } diff --git a/swap/src/network/swap_setup/vendor_from_fn.rs b/swap/src/network/swap_setup/vendor_from_fn.rs new file mode 100644 index 000000000..625b655db --- /dev/null +++ b/swap/src/network/swap_setup/vendor_from_fn.rs @@ -0,0 +1,114 @@ +// Copyright 2020 Parity Technologies (UK) Ltd. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. + +// These functions have been vendored from https://github.com/libp2p/rust-libp2p/blob/v0.51.0/core/src/upgrade/from_fn.rs because they were removed from the library itself +// This is recommended, see: https://github.com/libp2p/rust-libp2p/pull/3747 +// We replaced ProtocolName with AsRef. See: https://github.com/libp2p/rust-libp2p/pull/3746/files + +use futures::prelude::*; +use libp2p::{core::{Endpoint, UpgradeInfo}, InboundUpgrade, OutboundUpgrade}; +use std::iter; + +/// Initializes a new [`FromFnUpgrade`]. +/// +/// # Example +/// +/// ``` +/// # use libp2p_core::transport::{Transport, MemoryTransport, memory::Channel}; +/// # use libp2p_core::{upgrade, Negotiated}; +/// # use std::io; +/// # use futures::AsyncWriteExt; +/// let _transport = MemoryTransport::default() +/// .and_then(move |out, cp| { +/// upgrade::apply(out, upgrade::from_fn("/foo/1", move |mut sock: Negotiated>>, endpoint| async move { +/// if endpoint.is_dialer() { +/// upgrade::write_length_prefixed(&mut sock, "some handshake data").await?; +/// sock.close().await?; +/// } else { +/// let handshake_data = upgrade::read_length_prefixed(&mut sock, 1024).await?; +/// if handshake_data != b"some handshake data" { +/// return Err(io::Error::new(io::ErrorKind::Other, "bad handshake")); +/// } +/// } +/// Ok(sock) +/// }), cp, upgrade::Version::V1) +/// }); +/// ``` +/// +pub fn from_fn(protocol_name: P, fun: F) -> FromFnUpgrade +where + // Note: these bounds are there in order to help the compiler infer types + P: AsRef + Clone, + F: FnOnce(C, Endpoint) -> Fut, + Fut: Future>, +{ + FromFnUpgrade { protocol_name, fun } +} + +/// Implements the `UpgradeInfo`, `InboundUpgrade` and `OutboundUpgrade` traits. +/// +/// The upgrade consists in calling the function passed when creating this struct. +#[derive(Debug, Clone)] +pub struct FromFnUpgrade { + protocol_name: P, + fun: F, +} + +impl UpgradeInfo for FromFnUpgrade +where + P: AsRef + Clone, +{ + type Info = P; + type InfoIter = iter::Once

; + + fn protocol_info(&self) -> Self::InfoIter { + iter::once(self.protocol_name.clone()) + } +} + +impl InboundUpgrade for FromFnUpgrade +where + P: AsRef + Clone, + F: FnOnce(C, Endpoint) -> Fut, + Fut: Future>, +{ + type Output = Out; + type Error = Err; + type Future = Fut; + + fn upgrade_inbound(self, sock: C, _: Self::Info) -> Self::Future { + (self.fun)(sock, Endpoint::Listener) + } +} + +impl OutboundUpgrade for FromFnUpgrade +where + P: AsRef + Clone, + F: FnOnce(C, Endpoint) -> Fut, + Fut: Future>, +{ + type Output = Out; + type Error = Err; + type Future = Fut; + + fn upgrade_outbound(self, sock: C, _: Self::Info) -> Self::Future { + (self.fun)(sock, Endpoint::Dialer) + } +} From 01e8810c1e79e6155f4c969ac6cd714e8fe7621c Mon Sep 17 00:00:00 2001 From: binarybaron Date: Wed, 23 Oct 2024 17:09:15 +0200 Subject: [PATCH 033/112] fix(libp2p): Use Instant instead of KeepAlive in swap/src/network/swap_setup/alice.rs See: https://github.com/libp2p/rust-libp2p/issues/3844 --- swap/src/network/swap_setup/alice.rs | 29 ++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/swap/src/network/swap_setup/alice.rs b/swap/src/network/swap_setup/alice.rs index b3fce7e8e..0eae9eb38 100644 --- a/swap/src/network/swap_setup/alice.rs +++ b/swap/src/network/swap_setup/alice.rs @@ -21,8 +21,9 @@ use libp2p::{Multiaddr, PeerId}; use std::collections::VecDeque; use std::fmt::Debug; use std::task::Poll; -use std::time::Duration; +use std::time::{Instant, Duration}; use uuid::Uuid; +use futures::AsyncWriteExt; #[derive(Debug)] #[allow(clippy::large_enum_variant)] @@ -219,8 +220,12 @@ pub struct Handler { latest_rate: LR, resume_only: bool, - timeout: Duration, - keep_alive: KeepAlive, + // This is the timeout for the negotiation phase where Alice and Bob exchange messages + negotiation_timeout: Duration, + + // If set to None, we will keep the connection alive indefinitely + // If set to Some, we will keep the connection alive until the given instant + keep_alive_until: Option, } impl Handler { @@ -239,8 +244,8 @@ impl Handler { env_config, latest_rate, resume_only, - timeout: Duration::from_secs(120), - keep_alive: KeepAlive::Until(Instant::now() + Duration::from_secs(10)), + negotiation_timeout: Duration::from_secs(120), + keep_alive_until: Some(Instant::now() + Duration::from_secs(30)), } } } @@ -268,8 +273,10 @@ where } fn connection_keep_alive(&self) -> bool { - // self.keep_alive - false + match self.keep_alive_until { + None => true, + Some(keep_alive_until) => Instant::now() < keep_alive_until, + } } #[allow(clippy::type_complexity)] @@ -313,7 +320,9 @@ where ) { match event { ConnectionEvent::FullyNegotiatedInbound(substream) => { - self.keep_alive = KeepAlive::Yes; + self.keep_alive_until = None; + + let mut substream = substream.protocol; let (sender, receiver) = bmrng::channel_with_timeout::( 1, @@ -325,7 +334,7 @@ where let latest_rate = self.latest_rate.latest_rate(); let env_config = self.env_config; - let protocol = tokio::time::timeout(self.timeout, async move { + let protocol = tokio::time::timeout(self.negotiation_timeout, async move { let request = swap_setup::read_cbor_message::(&mut substream) .await .context("Failed to read spot price request")?; @@ -449,7 +458,7 @@ where Ok((swap_id, state3)) }); - let max_seconds = self.timeout.as_secs(); + let max_seconds = self.negotiation_timeout.as_secs(); self.inbound_stream = OptionFuture::from(Some( async move { protocol.await.with_context(|| { From d9efc5d3ed2d4899094f3ceaf5beee9afd939e6a Mon Sep 17 00:00:00 2001 From: binarybaron Date: Wed, 23 Oct 2024 23:27:49 +0200 Subject: [PATCH 034/112] fix(libp2p): Call .into to convert None into OptionFuture, use new ConnectionHandlerEvent::NotifyBehaviour, correcctly destructure libp2p::swarm::handler::ConnectionEvent::FullyNegotiatedInbound --- swap/src/network/swap_setup/bob.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/swap/src/network/swap_setup/bob.rs b/swap/src/network/swap_setup/bob.rs index 38566dde1..2ac2ee795 100644 --- a/swap/src/network/swap_setup/bob.rs +++ b/swap/src/network/swap_setup/bob.rs @@ -171,9 +171,9 @@ impl ConnectionHandler for Handler { if let Some(outbound_stream) = self.outbound_stream.as_mut() { if let Poll::Ready(result) = outbound_stream.poll_unpin(cx) { - self.outbound_stream = None; + self.outbound_stream = None.into(); self.keep_alive = false; // Set to false after completing the stream - return Poll::Ready(ConnectionHandlerEvent::Custom(Completed(result))); + return Poll::Ready(ConnectionHandlerEvent::NotifyBehaviour(Completed(result))); } } @@ -190,7 +190,7 @@ impl ConnectionHandler for Handler { >, ) { match event { - libp2p::swarm::handler::ConnectionEvent::FullyNegotiatedInbound(_, _) => { + libp2p::swarm::handler::ConnectionEvent::FullyNegotiatedInbound(_) => { unreachable!("Bob does not support inbound substreams") } libp2p::swarm::handler::ConnectionEvent::FullyNegotiatedOutbound(outbound) => { From bdedafe419bb4c276c90b0bcf92910826bd963a5 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Thu, 24 Oct 2024 00:31:33 +0200 Subject: [PATCH 035/112] fix(libp2p): Fix all remaining compiler errors, quote requests work!!!! --- swap/src/bin/asb.rs | 1 - swap/src/network/swap_setup/alice.rs | 20 ++++++++++--- swap/src/network/swap_setup/bob.rs | 44 +++++++++++++++++++--------- 3 files changed, 46 insertions(+), 19 deletions(-) diff --git a/swap/src/bin/asb.rs b/swap/src/bin/asb.rs index b0c18569d..1698a70ad 100644 --- a/swap/src/bin/asb.rs +++ b/swap/src/bin/asb.rs @@ -16,7 +16,6 @@ use anyhow::{bail, Context, Result}; use comfy_table::Table; use libp2p::core::multiaddr::Protocol; use libp2p::core::Multiaddr; -use libp2p::swarm::AddressScore; use libp2p::Swarm; use std::convert::TryInto; use std::env; diff --git a/swap/src/network/swap_setup/alice.rs b/swap/src/network/swap_setup/alice.rs index 0eae9eb38..0cc5b2e76 100644 --- a/swap/src/network/swap_setup/alice.rs +++ b/swap/src/network/swap_setup/alice.rs @@ -189,7 +189,15 @@ where local_addr: &Multiaddr, remote_addr: &Multiaddr, ) -> std::result::Result, libp2p::swarm::ConnectionDenied> { - todo!() + let handler = Handler::new( + self.min_buy, + self.max_buy, + self.env_config.clone(), + self.latest_rate.clone(), + self.resume_only, + ); + + Ok(handler) } fn handle_established_outbound_connection( @@ -199,11 +207,12 @@ where addr: &Multiaddr, role_override: libp2p::core::Endpoint, ) -> std::result::Result, libp2p::swarm::ConnectionDenied> { - todo!() + // TODO: Libp2p ugprade: Is this true? + unreachable!("Alice does not support outbound connections") } fn on_swarm_event(&mut self, event: libp2p::swarm::FromSwarm<'_>) { - todo!() + // todo!() } } @@ -273,6 +282,7 @@ where } fn connection_keep_alive(&self) -> bool { + return true; match self.keep_alive_until { None => true, Some(keep_alive_until) => Instant::now() < keep_alive_until, @@ -476,7 +486,9 @@ where ConnectionEvent::FullyNegotiatedOutbound(..) => { unreachable!("Alice does not support outbound in the handler") } - _ => unreachable!("this wasn't implemented before..."), + _ => { + // TODO: not quite sure what to do here + } } } } diff --git a/swap/src/network/swap_setup/bob.rs b/swap/src/network/swap_setup/bob.rs index 2ac2ee795..ced12bad4 100644 --- a/swap/src/network/swap_setup/bob.rs +++ b/swap/src/network/swap_setup/bob.rs @@ -16,6 +16,7 @@ use std::sync::Arc; use std::task::{Context, Poll}; use std::time::Duration; use uuid::Uuid; +use futures::AsyncWriteExt; use super::{read_cbor_message, write_cbor_message, SpotPriceRequest}; @@ -100,7 +101,7 @@ impl NetworkBehaviour for Behaviour { } } -type OutboundStream = BoxFuture<'static, Result>; +type OutboundStream = BoxFuture<'static, Result>; pub struct Handler { outbound_stream: OptionFuture, @@ -169,12 +170,10 @@ impl ConnectionHandler for Handler { }); } - if let Some(outbound_stream) = self.outbound_stream.as_mut() { - if let Poll::Ready(result) = outbound_stream.poll_unpin(cx) { - self.outbound_stream = None.into(); - self.keep_alive = false; // Set to false after completing the stream - return Poll::Ready(ConnectionHandlerEvent::NotifyBehaviour(Completed(result))); - } + if let Poll::Ready(Some(result)) = self.outbound_stream.poll_unpin(cx) { + self.outbound_stream = None.into(); + self.keep_alive = false; + return Poll::Ready(ConnectionHandlerEvent::NotifyBehaviour(Completed(result.map_err(anyhow::Error::from)))); } Poll::Pending @@ -250,14 +249,14 @@ impl ConnectionHandler for Handler { }); let max_seconds = self.timeout.as_secs(); - self.outbound_stream = Some(Box::pin( - async move { - protocol.await.map_err(|_| Error::Timeout { + self.outbound_stream = OptionFuture::from(Some(Box::pin(async move { + protocol.await.map_err(|e| match e { + tokio::time::error::Elapsed { .. } => Error::Timeout { seconds: max_seconds, - })? - } - .boxed(), - )); + }, + _ => Error::Other, + })? + }) as OutboundStream)); self.keep_alive = true; // Ensure the connection stays alive while processing } libp2p::swarm::handler::ConnectionEvent::DialUpgradeError(dial_upgrade_err) => { @@ -328,3 +327,20 @@ impl From for Error { } } } + +impl From for Error { + fn from(error: anyhow::Error) -> Self { + // This is not good we are just swallowing the error here + // TODO: Libp2p Upgrade: We should find a better way to convert these errors in the entire file here into each other + // This doesnt seem optimal at all + // Incredibly ugly code and we lose a lot of valueale information here + Error::Other + } +} + +impl From for Error { + fn from(error: std::io::Error) -> Self { + // This is not good we are just swallowing the error here + Error::Other + } +} \ No newline at end of file From ad760d7151766ae9e14c8c884f2e119535f4d681 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Thu, 24 Oct 2024 13:49:31 +0200 Subject: [PATCH 036/112] fix(libp2p): Fetch entries from new_swaps in src/network/swap_setup/bob.rs and send to ConnectionHandler --- swap/src/network/swap_setup/alice.rs | 2 +- swap/src/network/swap_setup/bob.rs | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/swap/src/network/swap_setup/alice.rs b/swap/src/network/swap_setup/alice.rs index 0cc5b2e76..768bff0dd 100644 --- a/swap/src/network/swap_setup/alice.rs +++ b/swap/src/network/swap_setup/alice.rs @@ -212,7 +212,7 @@ where } fn on_swarm_event(&mut self, event: libp2p::swarm::FromSwarm<'_>) { - // todo!() + // TODO: Do we need to do anything here? } } diff --git a/swap/src/network/swap_setup/bob.rs b/swap/src/network/swap_setup/bob.rs index ced12bad4..b7cde99ca 100644 --- a/swap/src/network/swap_setup/bob.rs +++ b/swap/src/network/swap_setup/bob.rs @@ -97,6 +97,15 @@ impl NetworkBehaviour for Behaviour { if let Some((peer, completed)) = self.completed_swaps.pop_front() { return Poll::Ready(ToSwarm::GenerateEvent(completed)); } + + if let Some((peer, event)) = self.new_swaps.pop_front() { + return Poll::Ready(ToSwarm::NotifyHandler { + peer_id: peer, + handler: libp2p::swarm::NotifyHandler::Any, + event, + }); + } + Poll::Pending } } @@ -193,6 +202,8 @@ impl ConnectionHandler for Handler { unreachable!("Bob does not support inbound substreams") } libp2p::swarm::handler::ConnectionEvent::FullyNegotiatedOutbound(outbound) => { + println!("swap_setup: bob: FullyNegotiatedOutbound reached"); + let mut substream = outbound.protocol; let info = outbound.info; From 60123b470261c422281e66fa425e50fdc9dd8a21 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Thu, 24 Oct 2024 13:50:50 +0200 Subject: [PATCH 037/112] lint: dprint fmt --- swap/src/cli/event_loop.rs | 3 +- .../cooperative_xmr_redeem_after_punish.rs | 10 ++- swap/src/network/quote.rs | 10 ++- swap/src/network/swap_setup.rs | 3 +- swap/src/network/swap_setup/alice.rs | 63 +++++++++---------- swap/src/network/swap_setup/bob.rs | 13 ++-- swap/src/network/swap_setup/vendor_from_fn.rs | 5 +- swap/src/network/test.rs | 4 +- 8 files changed, 64 insertions(+), 47 deletions(-) diff --git a/swap/src/cli/event_loop.rs b/swap/src/cli/event_loop.rs index 9af093d8f..022749873 100644 --- a/swap/src/cli/event_loop.rs +++ b/swap/src/cli/event_loop.rs @@ -38,7 +38,8 @@ pub struct EventLoop { inflight_quote_requests: HashMap>, inflight_encrypted_signature_requests: HashMap>, inflight_swap_setup: Option>>, - inflight_cooperative_xmr_redeem_requests: HashMap>, + inflight_cooperative_xmr_redeem_requests: + HashMap>, /// The sender we will use to relay incoming transfer proofs. transfer_proof: bmrng::RequestSender, /// The future representing the successful handling of an incoming transfer diff --git a/swap/src/network/cooperative_xmr_redeem_after_punish.rs b/swap/src/network/cooperative_xmr_redeem_after_punish.rs index 3d940ef37..ddafeffc8 100644 --- a/swap/src/network/cooperative_xmr_redeem_after_punish.rs +++ b/swap/src/network/cooperative_xmr_redeem_after_punish.rs @@ -49,14 +49,20 @@ pub enum Response { pub fn alice() -> Behaviour { Behaviour::new( - vec![(StreamProtocol::new(CooperativeXmrRedeemProtocol.as_ref()), ProtocolSupport::Inbound)], + vec![( + StreamProtocol::new(CooperativeXmrRedeemProtocol.as_ref()), + ProtocolSupport::Inbound, + )], request_response::Config::default(), ) } pub fn bob() -> Behaviour { Behaviour::new( - vec![(StreamProtocol::new(CooperativeXmrRedeemProtocol.as_ref()), ProtocolSupport::Outbound)], + vec![( + StreamProtocol::new(CooperativeXmrRedeemProtocol.as_ref()), + ProtocolSupport::Outbound, + )], request_response::Config::default(), ) } diff --git a/swap/src/network/quote.rs b/swap/src/network/quote.rs index 749cab4ce..d4a305766 100644 --- a/swap/src/network/quote.rs +++ b/swap/src/network/quote.rs @@ -52,7 +52,10 @@ pub struct ZeroQuoteReceived; /// handing out quotes. pub fn asb() -> Behaviour { Behaviour::new( - vec![(StreamProtocol::new(BidQuoteProtocol::PROTOCOL_ID), ProtocolSupport::Inbound)], + vec![( + StreamProtocol::new(BidQuoteProtocol::PROTOCOL_ID), + ProtocolSupport::Inbound, + )], request_response::Config::default(), ) } @@ -63,7 +66,10 @@ pub fn asb() -> Behaviour { /// requesting quotes. pub fn cli() -> Behaviour { Behaviour::new( - vec![(StreamProtocol::new(BidQuoteProtocol::PROTOCOL_ID), ProtocolSupport::Outbound)], + vec![( + StreamProtocol::new(BidQuoteProtocol::PROTOCOL_ID), + ProtocolSupport::Outbound, + )], request_response::Config::default(), ) } diff --git a/swap/src/network/swap_setup.rs b/swap/src/network/swap_setup.rs index 2ce007d7d..74b200b4f 100644 --- a/swap/src/network/swap_setup.rs +++ b/swap/src/network/swap_setup.rs @@ -111,7 +111,8 @@ pub async fn write_cbor_message(stream: &mut Stream, message: T) -> Result<() where T: Serialize, { - let bytes = serde_cbor::to_vec(&message).context("Failed to serialize message as bytes using CBOR")?; + let bytes = + serde_cbor::to_vec(&message).context("Failed to serialize message as bytes using CBOR")?; let mut frame = Framed::new(stream, codec()); diff --git a/swap/src/network/swap_setup/alice.rs b/swap/src/network/swap_setup/alice.rs index 768bff0dd..5b3fb5a47 100644 --- a/swap/src/network/swap_setup/alice.rs +++ b/swap/src/network/swap_setup/alice.rs @@ -9,21 +9,18 @@ use crate::protocol::{Message0, Message2, Message4}; use crate::{asb, bitcoin, env, monero}; use anyhow::{anyhow, Context, Result}; use futures::future::{BoxFuture, OptionFuture}; +use futures::AsyncWriteExt; use futures::FutureExt; +use libp2p::core::upgrade; use libp2p::swarm::handler::ConnectionEvent; use libp2p::swarm::{ConnectionHandler, ConnectionId}; -use libp2p::core::upgrade; -use libp2p::swarm::{ - NetworkBehaviour, ToSwarm, - SubstreamProtocol, ConnectionHandlerEvent, -}; +use libp2p::swarm::{ConnectionHandlerEvent, NetworkBehaviour, SubstreamProtocol, ToSwarm}; use libp2p::{Multiaddr, PeerId}; use std::collections::VecDeque; use std::fmt::Debug; use std::task::Poll; -use std::time::{Instant, Duration}; +use std::time::{Duration, Instant}; use uuid::Uuid; -use futures::AsyncWriteExt; #[derive(Debug)] #[allow(clippy::large_enum_variant)] @@ -151,7 +148,12 @@ where type ConnectionHandler = Handler; type ToSwarm = OutEvent; - fn on_connection_handler_event(&mut self, peer_id: PeerId, _: ConnectionId, event: HandlerOutEvent) { + fn on_connection_handler_event( + &mut self, + peer_id: PeerId, + _: ConnectionId, + event: HandlerOutEvent, + ) { match event { HandlerOutEvent::Initiated(send_wallet_snapshot) => { self.events.push_back(OutEvent::Initiated { @@ -171,17 +173,14 @@ where } } - fn poll( - &mut self, - _cx: &mut std::task::Context<'_> - ) -> Poll> { + fn poll(&mut self, _cx: &mut std::task::Context<'_>) -> Poll> { if let Some(event) = self.events.pop_front() { return Poll::Ready(ToSwarm::GenerateEvent(event)); } Poll::Pending } - + fn handle_established_inbound_connection( &mut self, _connection_id: libp2p::swarm::ConnectionId, @@ -199,7 +198,7 @@ where Ok(handler) } - + fn handle_established_outbound_connection( &mut self, _connection_id: libp2p::swarm::ConnectionId, @@ -210,10 +209,10 @@ where // TODO: Libp2p ugprade: Is this true? unreachable!("Alice does not support outbound connections") } - + fn on_swarm_event(&mut self, event: libp2p::swarm::FromSwarm<'_>) { // TODO: Do we need to do anything here? - } + } } type InboundStream = BoxFuture<'static, Result<(Uuid, State3)>>; @@ -294,11 +293,7 @@ where &mut self, cx: &mut std::task::Context<'_>, ) -> Poll< - ConnectionHandlerEvent< - Self::OutboundProtocol, - Self::OutboundOpenInfo, - Self::ToBehaviour, - >, + ConnectionHandlerEvent, > { if let Some(event) = self.events.pop_front() { return Poll::Ready(ConnectionHandlerEvent::NotifyBehaviour(event)); @@ -306,18 +301,18 @@ where if let Some(result) = futures::ready!(self.inbound_stream.poll_unpin(cx)) { self.inbound_stream = OptionFuture::from(None); - return Poll::Ready(ConnectionHandlerEvent::NotifyBehaviour(HandlerOutEvent::Completed( - result, - ))); + return Poll::Ready(ConnectionHandlerEvent::NotifyBehaviour( + HandlerOutEvent::Completed(result), + )); } Poll::Pending } - + fn on_behaviour_event(&mut self, _event: Self::FromBehaviour) { unreachable!("Alice does not receive events from the Behaviour in the handler") } - + fn on_connection_event( &mut self, event: libp2p::swarm::handler::ConnectionEvent< @@ -331,13 +326,13 @@ where match event { ConnectionEvent::FullyNegotiatedInbound(substream) => { self.keep_alive_until = None; - + let mut substream = substream.protocol; - let (sender, receiver) = bmrng::channel_with_timeout::( - 1, - Duration::from_secs(5), - ); + let (sender, receiver) = bmrng::channel_with_timeout::< + bitcoin::Amount, + WalletSnapshot, + >(1, Duration::from_secs(5)); let resume_only = self.resume_only; let min_buy = self.min_buy; let max_buy = self.max_buy; @@ -389,12 +384,14 @@ where }); } - let rate = latest_rate.map_err(|e| Error::LatestRateFetchFailed(Box::new(e)))?; + let rate = + latest_rate.map_err(|e| Error::LatestRateFetchFailed(Box::new(e)))?; let xmr = rate .sell_quote(btc) .map_err(Error::SellQuoteCalculationFailed)?; - let unlocked = Amount::from_piconero(wallet_snapshot.balance.unlocked_balance); + let unlocked = + Amount::from_piconero(wallet_snapshot.balance.unlocked_balance); if unlocked < xmr + wallet_snapshot.lock_fee { return Err(Error::BalanceTooLow { balance: wallet_snapshot.balance, diff --git a/swap/src/network/swap_setup/bob.rs b/swap/src/network/swap_setup/bob.rs index b7cde99ca..8a54f8fa3 100644 --- a/swap/src/network/swap_setup/bob.rs +++ b/swap/src/network/swap_setup/bob.rs @@ -4,6 +4,7 @@ use crate::protocol::{Message1, Message3}; use crate::{bitcoin, cli, env, monero}; use anyhow::Result; use futures::future::{BoxFuture, OptionFuture}; +use futures::AsyncWriteExt; use futures::FutureExt; use libp2p::core::upgrade; use libp2p::swarm::{ @@ -16,7 +17,6 @@ use std::sync::Arc; use std::task::{Context, Poll}; use std::time::Duration; use uuid::Uuid; -use futures::AsyncWriteExt; use super::{read_cbor_message, write_cbor_message, SpotPriceRequest}; @@ -97,7 +97,7 @@ impl NetworkBehaviour for Behaviour { if let Some((peer, completed)) = self.completed_swaps.pop_front() { return Poll::Ready(ToSwarm::GenerateEvent(completed)); } - + if let Some((peer, event)) = self.new_swaps.pop_front() { return Poll::Ready(ToSwarm::NotifyHandler { peer_id: peer, @@ -182,7 +182,9 @@ impl ConnectionHandler for Handler { if let Poll::Ready(Some(result)) = self.outbound_stream.poll_unpin(cx) { self.outbound_stream = None.into(); self.keep_alive = false; - return Poll::Ready(ConnectionHandlerEvent::NotifyBehaviour(Completed(result.map_err(anyhow::Error::from)))); + return Poll::Ready(ConnectionHandlerEvent::NotifyBehaviour(Completed( + result.map_err(anyhow::Error::from), + ))); } Poll::Pending @@ -267,7 +269,8 @@ impl ConnectionHandler for Handler { }, _ => Error::Other, })? - }) as OutboundStream)); + }) + as OutboundStream)); self.keep_alive = true; // Ensure the connection stays alive while processing } libp2p::swarm::handler::ConnectionEvent::DialUpgradeError(dial_upgrade_err) => { @@ -354,4 +357,4 @@ impl From for Error { // This is not good we are just swallowing the error here Error::Other } -} \ No newline at end of file +} diff --git a/swap/src/network/swap_setup/vendor_from_fn.rs b/swap/src/network/swap_setup/vendor_from_fn.rs index 625b655db..820acdd77 100644 --- a/swap/src/network/swap_setup/vendor_from_fn.rs +++ b/swap/src/network/swap_setup/vendor_from_fn.rs @@ -23,7 +23,10 @@ // We replaced ProtocolName with AsRef. See: https://github.com/libp2p/rust-libp2p/pull/3746/files use futures::prelude::*; -use libp2p::{core::{Endpoint, UpgradeInfo}, InboundUpgrade, OutboundUpgrade}; +use libp2p::{ + core::{Endpoint, UpgradeInfo}, + InboundUpgrade, OutboundUpgrade, +}; use std::iter; /// Initializes a new [`FromFnUpgrade`]. diff --git a/swap/src/network/test.rs b/swap/src/network/test.rs index c200a9826..66fec24b6 100644 --- a/swap/src/network/test.rs +++ b/swap/src/network/test.rs @@ -8,11 +8,11 @@ use libp2p::core::upgrade::SelectUpgrade; use libp2p::core::{Executor, Multiaddr, PeerId, Transport}; use libp2p::identity; use libp2p::mplex::MplexConfig; -use libp2p::noise::{Keypair, Config as NoiseConfig, X25519Spec}; +use libp2p::noise::{Config as NoiseConfig, Keypair, X25519Spec}; use libp2p::swarm::{AddressScore, NetworkBehaviour, Swarm, SwarmEvent}; -use libp2p::SwarmBuilder; use libp2p::tcp::Config as TokioTcpConfig; use libp2p::yamux::Config as YamuxConfig; +use libp2p::SwarmBuilder; use std::fmt::Debug; use std::pin::Pin; use std::time::Duration; From fcce5f7dc00b6e0459d9c2a904f6e8baf02a5e73 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Thu, 24 Oct 2024 13:51:59 +0200 Subject: [PATCH 038/112] debug statement: log libp2p tracing messages at all levels --- swap/src/common/tracing_util.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/swap/src/common/tracing_util.rs b/swap/src/common/tracing_util.rs index 7719df57f..9a0aba2bd 100644 --- a/swap/src/common/tracing_util.rs +++ b/swap/src/common/tracing_util.rs @@ -84,6 +84,8 @@ fn env_filter(level_filter: LevelFilter) -> Result { Ok(EnvFilter::from_default_env() .add_directive(Directive::from_str(&format!("asb={}", &level_filter))?) .add_directive(Directive::from_str(&format!("swap={}", &level_filter))?) + // TODO(libp2p upgrade): Disable this again once we merge https://github.com/UnstoppableSwap/core/pull/109 + .add_directive(Directive::from_str(&format!("libp2p=debug"))?) .add_directive(Directive::from_str(&format!( "unstoppableswap-gui-rs={}", &level_filter From dfd6180f7d70fec6f6c784d6925c677fb37432f2 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Thu, 24 Oct 2024 14:13:19 +0200 Subject: [PATCH 039/112] fix(libp2p): Swarm keeps connections alive forever instead of ping behaviour See: https://github.com/libp2p/rust-libp2p/pull/2859/ --- swap/src/network/swarm.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/swap/src/network/swarm.rs b/swap/src/network/swarm.rs index def3b516f..c3213539a 100644 --- a/swap/src/network/swarm.rs +++ b/swap/src/network/swarm.rs @@ -8,6 +8,7 @@ use libp2p::swarm::NetworkBehaviour; use libp2p::SwarmBuilder; use libp2p::{identity, Multiaddr, Swarm}; use std::fmt::Debug; +use std::time::Duration; #[allow(clippy::too_many_arguments)] pub fn asb( @@ -52,6 +53,7 @@ where .with_tokio() .with_other_transport(|_| transport)? .with_behaviour(|_| behaviour)? + .with_swarm_config(|cfg| cfg.with_idle_connection_timeout(Duration::MAX)) .build(); Ok(swarm) @@ -76,6 +78,7 @@ where .with_tokio() .with_other_transport(|_| transport)? .with_behaviour(|_| behaviour)? + .with_swarm_config(|cfg| cfg.with_idle_connection_timeout(Duration::MAX)) .build(); Ok(swarm) From 59b3b267090878d8c88c605f05748e1025f68ee2 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Thu, 24 Oct 2024 14:52:57 +0200 Subject: [PATCH 040/112] fix: increase testnet timelocks, reformat todo comments --- swap/src/env.rs | 5 +++-- swap/src/network/redial.rs | 2 +- swap/src/network/swap_setup/bob.rs | 2 +- swap/src/network/tor_transport.rs | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/swap/src/env.rs b/swap/src/env.rs index 1ba8c4326..fa8506012 100644 --- a/swap/src/env.rs +++ b/swap/src/env.rs @@ -50,6 +50,7 @@ impl GetConfig for Mainnet { bitcoin_lock_confirmed_timeout: 2.std_hours(), bitcoin_finality_confirmations: 1, bitcoin_avg_block_time: 10.std_minutes(), + // TODO(Libp2p Migration): This was temporarily increased for testing. testnet3 block time is too low at the moment bitcoin_cancel_timelock: CancelTimelock::new(72), bitcoin_punish_timelock: PunishTimelock::new(72), bitcoin_network: bitcoin::Network::Bitcoin, @@ -67,8 +68,8 @@ impl GetConfig for Testnet { bitcoin_lock_confirmed_timeout: 1.std_hours(), bitcoin_finality_confirmations: 1, bitcoin_avg_block_time: 10.std_minutes(), - bitcoin_cancel_timelock: CancelTimelock::new(12), - bitcoin_punish_timelock: PunishTimelock::new(6), + bitcoin_cancel_timelock: CancelTimelock::new(72), + bitcoin_punish_timelock: PunishTimelock::new(72), bitcoin_network: bitcoin::Network::Testnet, monero_avg_block_time: 2.std_minutes(), monero_finality_confirmations: 10, diff --git a/swap/src/network/redial.rs b/swap/src/network/redial.rs index 43e0ee95b..3f0b15f4a 100644 --- a/swap/src/network/redial.rs +++ b/swap/src/network/redial.rs @@ -86,7 +86,7 @@ impl NetworkBehaviour for Behaviour { } fn on_swarm_event(&mut self, event: libp2p::swarm::FromSwarm<'_>) { - // TODO: Libp2p Upgrade: Maybe we also need to match for FromSwarm::DialFailure here? + // TODO(Libp2p Migration): Maybe we also need to match for FromSwarm::DialFailure here? if let libp2p::swarm::FromSwarm::ConnectionClosed(closed) = event { if closed.peer_id == self.peer { diff --git a/swap/src/network/swap_setup/bob.rs b/swap/src/network/swap_setup/bob.rs index 8a54f8fa3..b2c967532 100644 --- a/swap/src/network/swap_setup/bob.rs +++ b/swap/src/network/swap_setup/bob.rs @@ -345,7 +345,7 @@ impl From for Error { impl From for Error { fn from(error: anyhow::Error) -> Self { // This is not good we are just swallowing the error here - // TODO: Libp2p Upgrade: We should find a better way to convert these errors in the entire file here into each other + // TODO(Libp2p Migration): We should find a better way to convert these errors in the entire file here into each other // This doesnt seem optimal at all // Incredibly ugly code and we lose a lot of valueale information here Error::Other diff --git a/swap/src/network/tor_transport.rs b/swap/src/network/tor_transport.rs index 9d9a680b6..59c7c4249 100644 --- a/swap/src/network/tor_transport.rs +++ b/swap/src/network/tor_transport.rs @@ -90,7 +90,7 @@ impl Transport for TorDialOnlyTransport { } fn remove_listener(&mut self, id: ListenerId) -> bool { - // TODO: Libp2p Upgrade: What do we need to do here? + // TODO(Libp2p Migration): What do we need to do here? // I believe nothing because we are not using the transport to listen. false } @@ -100,7 +100,7 @@ impl Transport for TorDialOnlyTransport { cx: &mut std::task::Context<'_>, ) -> std::task::Poll> { - // TODO: Libp2p Upgrade: What do we need to do here? + // TODO(Libp2p Migration): What do we need to do here? // See: https://github.com/libp2p/rust-libp2p/pull/2652 // I believe we do not need to do anything here because we are not using the transport to listen. // But we need to verify this before merging. From fe1867ca9a361692634fa5921ccaafe38bdeed50 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Thu, 24 Oct 2024 15:20:34 +0200 Subject: [PATCH 041/112] refactor(libp2p): Re-order function impl in swap_setup handlers to make diff more readable --- swap/src/network/swap_setup/alice.rs | 101 +++++++++++++-------------- swap/src/network/swap_setup/bob.rs | 64 ++++++++--------- 2 files changed, 82 insertions(+), 83 deletions(-) diff --git a/swap/src/network/swap_setup/alice.rs b/swap/src/network/swap_setup/alice.rs index 5b3fb5a47..166dab961 100644 --- a/swap/src/network/swap_setup/alice.rs +++ b/swap/src/network/swap_setup/alice.rs @@ -148,6 +148,24 @@ where type ConnectionHandler = Handler; type ToSwarm = OutEvent; + fn handle_established_inbound_connection( + &mut self, + _connection_id: libp2p::swarm::ConnectionId, + peer: PeerId, + local_addr: &Multiaddr, + remote_addr: &Multiaddr, + ) -> std::result::Result, libp2p::swarm::ConnectionDenied> { + let handler = Handler::new( + self.min_buy, + self.max_buy, + self.env_config.clone(), + self.latest_rate.clone(), + self.resume_only, + ); + + Ok(handler) + } + fn on_connection_handler_event( &mut self, peer_id: PeerId, @@ -181,24 +199,6 @@ where Poll::Pending } - fn handle_established_inbound_connection( - &mut self, - _connection_id: libp2p::swarm::ConnectionId, - peer: PeerId, - local_addr: &Multiaddr, - remote_addr: &Multiaddr, - ) -> std::result::Result, libp2p::swarm::ConnectionDenied> { - let handler = Handler::new( - self.min_buy, - self.max_buy, - self.env_config.clone(), - self.latest_rate.clone(), - self.resume_only, - ); - - Ok(handler) - } - fn handle_established_outbound_connection( &mut self, _connection_id: libp2p::swarm::ConnectionId, @@ -280,39 +280,6 @@ where SubstreamProtocol::new(protocol::new(), ()) } - fn connection_keep_alive(&self) -> bool { - return true; - match self.keep_alive_until { - None => true, - Some(keep_alive_until) => Instant::now() < keep_alive_until, - } - } - - #[allow(clippy::type_complexity)] - fn poll( - &mut self, - cx: &mut std::task::Context<'_>, - ) -> Poll< - ConnectionHandlerEvent, - > { - if let Some(event) = self.events.pop_front() { - return Poll::Ready(ConnectionHandlerEvent::NotifyBehaviour(event)); - } - - if let Some(result) = futures::ready!(self.inbound_stream.poll_unpin(cx)) { - self.inbound_stream = OptionFuture::from(None); - return Poll::Ready(ConnectionHandlerEvent::NotifyBehaviour( - HandlerOutEvent::Completed(result), - )); - } - - Poll::Pending - } - - fn on_behaviour_event(&mut self, _event: Self::FromBehaviour) { - unreachable!("Alice does not receive events from the Behaviour in the handler") - } - fn on_connection_event( &mut self, event: libp2p::swarm::handler::ConnectionEvent< @@ -488,6 +455,38 @@ where } } } + + fn on_behaviour_event(&mut self, _event: Self::FromBehaviour) { + unreachable!("Alice does not receive events from the Behaviour in the handler") + } + + fn connection_keep_alive(&self) -> bool { + match self.keep_alive_until { + None => true, + Some(keep_alive_until) => Instant::now() < keep_alive_until, + } + } + + #[allow(clippy::type_complexity)] + fn poll( + &mut self, + cx: &mut std::task::Context<'_>, + ) -> Poll< + ConnectionHandlerEvent, + > { + if let Some(event) = self.events.pop_front() { + return Poll::Ready(ConnectionHandlerEvent::NotifyBehaviour(event)); + } + + if let Some(result) = futures::ready!(self.inbound_stream.poll_unpin(cx)) { + self.inbound_stream = OptionFuture::from(None); + return Poll::Ready(ConnectionHandlerEvent::NotifyBehaviour( + HandlerOutEvent::Completed(result), + )); + } + + Poll::Pending + } } impl SpotPriceResponse { diff --git a/swap/src/network/swap_setup/bob.rs b/swap/src/network/swap_setup/bob.rs index b2c967532..363b80019 100644 --- a/swap/src/network/swap_setup/bob.rs +++ b/swap/src/network/swap_setup/bob.rs @@ -158,38 +158,6 @@ impl ConnectionHandler for Handler { SubstreamProtocol::new(upgrade::DeniedUpgrade, ()) } - fn on_behaviour_event(&mut self, new_swap: Self::FromBehaviour) { - self.new_swaps.push_back(new_swap); - } - - fn connection_keep_alive(&self) -> bool { - self.keep_alive - } - - fn poll( - &mut self, - cx: &mut Context<'_>, - ) -> Poll< - ConnectionHandlerEvent, - > { - if let Some(new_swap) = self.new_swaps.pop_front() { - self.keep_alive = true; - return Poll::Ready(ConnectionHandlerEvent::OutboundSubstreamRequest { - protocol: SubstreamProtocol::new(protocol::new(), new_swap), - }); - } - - if let Poll::Ready(Some(result)) = self.outbound_stream.poll_unpin(cx) { - self.outbound_stream = None.into(); - self.keep_alive = false; - return Poll::Ready(ConnectionHandlerEvent::NotifyBehaviour(Completed( - result.map_err(anyhow::Error::from), - ))); - } - - Poll::Pending - } - fn on_connection_event( &mut self, event: libp2p::swarm::handler::ConnectionEvent< @@ -280,6 +248,38 @@ impl ConnectionHandler for Handler { _ => {} } } + + fn on_behaviour_event(&mut self, new_swap: Self::FromBehaviour) { + self.new_swaps.push_back(new_swap); + } + + fn connection_keep_alive(&self) -> bool { + self.keep_alive + } + + fn poll( + &mut self, + cx: &mut Context<'_>, + ) -> Poll< + ConnectionHandlerEvent, + > { + if let Some(new_swap) = self.new_swaps.pop_front() { + self.keep_alive = true; + return Poll::Ready(ConnectionHandlerEvent::OutboundSubstreamRequest { + protocol: SubstreamProtocol::new(protocol::new(), new_swap), + }); + } + + if let Poll::Ready(Some(result)) = self.outbound_stream.poll_unpin(cx) { + self.outbound_stream = None.into(); + self.keep_alive = false; + return Poll::Ready(ConnectionHandlerEvent::NotifyBehaviour(Completed( + result.map_err(anyhow::Error::from), + ))); + } + + Poll::Pending + } } impl From for Result { From 96fa4e3a0c62a0a238250937eb21a49aa50c88f9 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Thu, 24 Oct 2024 15:26:42 +0200 Subject: [PATCH 042/112] fix(libp2p): Bob should not support inbound connections on swap setup --- swap/src/network/swap_setup/bob.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/swap/src/network/swap_setup/bob.rs b/swap/src/network/swap_setup/bob.rs index 363b80019..9cb59a6b8 100644 --- a/swap/src/network/swap_setup/bob.rs +++ b/swap/src/network/swap_setup/bob.rs @@ -60,7 +60,8 @@ impl NetworkBehaviour for Behaviour { local_addr: &Multiaddr, remote_addr: &Multiaddr, ) -> Result, ConnectionDenied> { - Ok(Handler::new(self.env_config, self.bitcoin_wallet.clone())) + // TODO(Libp2p Migration): Is this correct? + unreachable!("Bob does not support inbound connections") } fn handle_established_outbound_connection( From b663c80f319c9177bb043f4544d3454efc66d58b Mon Sep 17 00:00:00 2001 From: binarybaron Date: Thu, 24 Oct 2024 15:29:56 +0200 Subject: [PATCH 043/112] fix(libp2p): Remove old TODO comments about ping keep alive behaviour, this has been replaced by Swarm::with_idle_connection --- swap/src/cli/behaviour.rs | 1 - swap/src/cli/list_sellers.rs | 2 -- 2 files changed, 3 deletions(-) diff --git a/swap/src/cli/behaviour.rs b/swap/src/cli/behaviour.rs index 12e5af6e7..5d3a06fc1 100644 --- a/swap/src/cli/behaviour.rs +++ b/swap/src/cli/behaviour.rs @@ -101,7 +101,6 @@ impl Behaviour { let identifyConfig = identify::Config::new(protocolVersion, identify_params.0.public()) .with_agent_version(agentVersion); - // TOOD: Keep alive connection forever let pingConfig = ping::Config::new(); Self { diff --git a/swap/src/cli/list_sellers.rs b/swap/src/cli/list_sellers.rs index 65e2d33a7..04554a2e6 100644 --- a/swap/src/cli/list_sellers.rs +++ b/swap/src/cli/list_sellers.rs @@ -33,8 +33,6 @@ pub async fn list_sellers( quote: quote::cli(), ping: ping::Behaviour::new( ping::Config::new() - // TODO (libp2p upgrade): Keep alive the connection here - //.with_keep_alive(false) .with_interval(Duration::from_secs(86_400)), ), }; From 816500fdbdd4e3bd20228b2f29c3c409ad3a1a3d Mon Sep 17 00:00:00 2001 From: binarybaron Date: Thu, 24 Oct 2024 15:30:30 +0200 Subject: [PATCH 044/112] fix(libp2p): Use Swarm::add_peer_address instead of behaviour::add_address --- swap/src/cli/list_sellers.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/swap/src/cli/list_sellers.rs b/swap/src/cli/list_sellers.rs index 04554a2e6..6eebe72fb 100644 --- a/swap/src/cli/list_sellers.rs +++ b/swap/src/cli/list_sellers.rs @@ -39,9 +39,7 @@ pub async fn list_sellers( let mut swarm = swarm::cli(identity, tor_socks5_port, behaviour).await?; swarm - .behaviour_mut() - .quote - .add_address(&rendezvous_node_peer_id, rendezvous_node_addr.clone()); + .add_peer_address(rendezvous_node_peer_id, rendezvous_node_addr.clone()); swarm .dial(DialOpts::from(rendezvous_node_peer_id)) From 100de69d8961894de602b5e7f8d914c54563b439 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Thu, 24 Oct 2024 17:23:42 +0200 Subject: [PATCH 045/112] refactor(libp2p): Remove disable redundant asynchronous-codec feature --- swap/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swap/Cargo.toml b/swap/Cargo.toml index e9bf50818..314d64ef4 100644 --- a/swap/Cargo.toml +++ b/swap/Cargo.toml @@ -15,7 +15,7 @@ tauri = [ "dep:tauri" ] anyhow = "1" async-compression = { version = "0.3", features = [ "bzip2", "tokio" ] } async-trait = "0.1" -asynchronous-codec = { version = "0.7.0", features = [ "cbor" ] } +asynchronous-codec = "0.7.0" atty = "0.2" backoff = { version = "0.4", features = [ "tokio" ] } base64 = "0.22" From 6bea244489234a10f4725ceb012e2e251909c13c Mon Sep 17 00:00:00 2001 From: binarybaron Date: Thu, 24 Oct 2024 17:24:12 +0200 Subject: [PATCH 046/112] unreachable! if dummy connection handler emits event to behaviour --- swap/src/network/redial.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/swap/src/network/redial.rs b/swap/src/network/redial.rs index 3f0b15f4a..fe377fef8 100644 --- a/swap/src/network/redial.rs +++ b/swap/src/network/redial.rs @@ -131,6 +131,8 @@ impl NetworkBehaviour for Behaviour { ) { // the dummy connection handler does not produce any events // therefore we do not need to handle any events here + // TODO(Libp2p Migration): Is this correct? + unreachable!("The re-dial dummy connection handler does not produce any events"); } } From 849fe0ae76a2ec449b07b3469d62f32db4e75355 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Thu, 24 Oct 2024 17:24:42 +0200 Subject: [PATCH 047/112] refactor(libp2p): Move quote protocol id out of struct impl and make global --- swap/src/network/quote.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/swap/src/network/quote.rs b/swap/src/network/quote.rs index d4a305766..77f63cd36 100644 --- a/swap/src/network/quote.rs +++ b/swap/src/network/quote.rs @@ -4,7 +4,7 @@ use libp2p::{PeerId, StreamProtocol}; use serde::{Deserialize, Serialize}; use typeshare::typeshare; -const PROTOCOL: &str = BidQuoteProtocol::PROTOCOL_ID; +const PROTOCOL: &str = "/comit/xmr/btc/bid-quote/1.0.0"; pub(crate) type OutEvent = request_response::Event<(), BidQuote>; type Message = request_response::Message<(), BidQuote>; @@ -13,10 +13,6 @@ pub type Behaviour = request_response::json::Behaviour<(), BidQuote>; #[derive(Debug, Clone, Copy, Default)] pub struct BidQuoteProtocol; -impl BidQuoteProtocol { - const PROTOCOL_ID: &str = "/comit/xmr/btc/bid-quote/1.0.0"; -} - impl AsRef for BidQuoteProtocol { fn as_ref(&self) -> &str { PROTOCOL @@ -53,7 +49,7 @@ pub struct ZeroQuoteReceived; pub fn asb() -> Behaviour { Behaviour::new( vec![( - StreamProtocol::new(BidQuoteProtocol::PROTOCOL_ID), + StreamProtocol::new(PROTOCOL), ProtocolSupport::Inbound, )], request_response::Config::default(), From 239af00416ca79e2fba51b87dd1c38bfdd625fe6 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Thu, 24 Oct 2024 18:27:07 +0200 Subject: [PATCH 048/112] lint: dprint fmt, cargo clippy fix --- Cargo.lock | 1094 +++++++++++++++++++++-- swap/src/asb/event_loop.rs | 2 +- swap/src/bin/asb.rs | 2 +- swap/src/cli/event_loop.rs | 2 +- swap/src/cli/list_sellers.rs | 12 +- swap/src/common/tracing_util.rs | 2 +- swap/src/network/encrypted_signature.rs | 2 +- swap/src/network/quote.rs | 10 +- swap/src/network/swap_setup/alice.rs | 2 +- swap/src/network/tor_transport.rs | 8 +- swap/src/network/transport.rs | 4 +- swap/src/seed.rs | 3 +- swap/tests/harness/mod.rs | 2 +- 13 files changed, 1064 insertions(+), 81 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a2df0323b..0b7098881 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -90,6 +90,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "aligned-vec" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4aa90d7ce82d4be67b64039a3d588d38dbcc6736577de4a847025ce5b0c468d1" + [[package]] name = "alloc-no-stdlib" version = "2.0.4" @@ -135,12 +141,70 @@ dependencies = [ "winapi", ] +[[package]] +name = "anstream" +version = "0.6.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" + +[[package]] +name = "anstyle-parse" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" +dependencies = [ + "anstyle", + "windows-sys 0.52.0", +] + [[package]] name = "anyhow" version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" +[[package]] +name = "arbitrary" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" +dependencies = [ + "derive_arbitrary", +] + [[package]] name = "arboard" version = "3.4.1" @@ -149,7 +213,7 @@ checksum = "df099ccb16cd014ff054ac1bf392c67feeef57164b05c42f037cd40f5d4357f4" dependencies = [ "clipboard-win", "core-graphics 0.23.2", - "image 0.25.2", + "image", "log", "objc2", "objc2-app-kit", @@ -159,6 +223,17 @@ dependencies = [ "x11rb", ] +[[package]] +name = "arg_enum_proc_macro" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ae92a5119aa49cdbcf6b9f893fe4e1d98b04ccbf82ee0584ad948a44a734dea" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + [[package]] name = "arrayref" version = "0.3.9" @@ -171,6 +246,27 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" +[[package]] +name = "ashpd" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d43c03d9e36dd40cab48435be0b09646da362c278223ca535493877b2c1dee9" +dependencies = [ + "enumflags2", + "futures-channel", + "futures-util", + "rand 0.8.5", + "raw-window-handle", + "serde", + "serde_repr", + "tokio", + "url", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "zbus", +] + [[package]] name = "asn1-rs" version = "0.6.2" @@ -220,6 +316,30 @@ dependencies = [ "serde_json", ] +[[package]] +name = "async-broadcast" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20cd0e2e25ea8e5f7e9df04578dc6cf5c83577fd09b1a46aaf5c85e1c33f2a7e" +dependencies = [ + "event-listener 5.3.1", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-channel" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" +dependencies = [ + "concurrent-queue", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + [[package]] name = "async-compression" version = "0.3.15" @@ -274,6 +394,54 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "async-process" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63255f1dc2381611000436537bbedfe83183faa303a5a0edaf191edef06526bb" +dependencies = [ + "async-channel", + "async-io", + "async-lock 3.4.0", + "async-signal", + "async-task", + "blocking", + "cfg-if", + "event-listener 5.3.1", + "futures-lite", + "rustix", + "tracing", +] + +[[package]] +name = "async-recursion" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "async-signal" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "637e00349800c0bdf8bfc21ebbc0b6524abea702b0da4168ac00d070d0c0b9f3" +dependencies = [ + "async-io", + "async-lock 3.4.0", + "atomic-waker", + "cfg-if", + "futures-core", + "futures-io", + "rustix", + "signal-hook-registry", + "slab", + "windows-sys 0.59.0", +] + [[package]] name = "async-stream" version = "0.3.6" @@ -296,6 +464,12 @@ dependencies = [ "syn 2.0.79", ] +[[package]] +name = "async-task" +version = "4.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" + [[package]] name = "async-trait" version = "0.1.83" @@ -331,8 +505,6 @@ dependencies = [ "futures-util", "memchr", "pin-project-lite", - "serde", - "serde_cbor", ] [[package]] @@ -401,6 +573,29 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +[[package]] +name = "av1-grain" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6678909d8c5d46a42abcf571271e15fdbc0a225e3646cf23762cd415046c78bf" +dependencies = [ + "anyhow", + "arrayvec", + "log", + "nom", + "num-rational", + "v_frame", +] + +[[package]] +name = "avif-serialize" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e335041290c43101ca215eed6f43ec437eb5a42125573f600fc3fa42b9bddd62" +dependencies = [ + "arrayvec", +] + [[package]] name = "axum" version = "0.6.20" @@ -706,6 +901,12 @@ dependencies = [ "serde", ] +[[package]] +name = "bitstream-io" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b81e1519b0d82120d2fd469d5bfb2919a9361c48b02d82d04befc1cdd2002452" + [[package]] name = "bitvec" version = "1.0.1" @@ -767,6 +968,19 @@ dependencies = [ "objc2", ] +[[package]] +name = "blocking" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" +dependencies = [ + "async-channel", + "async-task", + "futures-io", + "futures-lite", + "piper", +] + [[package]] name = "bmrng" version = "0.5.2" @@ -872,6 +1086,12 @@ dependencies = [ "serde", ] +[[package]] +name = "built" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c360505aed52b7ec96a3636c3f039d99103c37d1d9b4f7a8c743d3ea9ffcd03b" + [[package]] name = "bumpalo" version = "3.16.0" @@ -1145,6 +1365,33 @@ dependencies = [ "vec_map", ] +[[package]] +name = "clap" +version = "4.5.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" +dependencies = [ + "clap_builder", +] + +[[package]] +name = "clap_builder" +version = "4.5.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim 0.11.1", +] + +[[package]] +name = "clap_lex" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" + [[package]] name = "clipboard-win" version = "5.4.0" @@ -1190,6 +1437,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" +[[package]] +name = "colorchoice" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" + [[package]] name = "colored" version = "2.1.0" @@ -1722,6 +1975,28 @@ dependencies = [ "serde", ] +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_arbitrary" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + [[package]] name = "derive_more" version = "0.99.18" @@ -1869,6 +2144,15 @@ dependencies = [ "syn 2.0.79", ] +[[package]] +name = "dlib" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" +dependencies = [ + "libloading", +] + [[package]] name = "dlopen2" version = "0.7.0" @@ -1898,6 +2182,12 @@ version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" +[[package]] +name = "downcast-rs" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" + [[package]] name = "dpi" version = "0.1.1" @@ -2056,6 +2346,12 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "endi" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3d8a32ae18130a3c84dd492d4215c3d913c3b07c6b63c2eb3eb7ff1101ab7bf" + [[package]] name = "enum-as-inner" version = "0.6.1" @@ -2068,6 +2364,27 @@ dependencies = [ "syn 2.0.79", ] +[[package]] +name = "enumflags2" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d232db7f5956f3f14313dc2f87985c58bd2c695ce124c8cdd984e08e15ac133d" +dependencies = [ + "enumflags2_derive", + "serde", +] + +[[package]] +name = "enumflags2_derive" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + [[package]] name = "equivalent" version = "1.0.1" @@ -2388,7 +2705,10 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" dependencies = [ + "fastrand", "futures-core", + "futures-io", + "parking", "pin-project-lite", ] @@ -3366,35 +3686,43 @@ dependencies = [ [[package]] name = "image" -version = "0.24.9" +version = "0.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5690139d2f55868e080017335e4b94cb7414274c74f1669c84fb5feba2c9f69d" +checksum = "99314c8a2152b8ddb211f924cdae532d8c5e4c8bb54728e12fff1b0cd5963a10" dependencies = [ "bytemuck", - "byteorder", + "byteorder-lite", "color_quant", "exr", "gif", - "jpeg-decoder", + "image-webp", "num-traits", "png", "qoi", + "ravif", + "rayon", + "rgb", "tiff", + "zune-core", + "zune-jpeg", ] [[package]] -name = "image" -version = "0.25.2" +name = "image-webp" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99314c8a2152b8ddb211f924cdae532d8c5e4c8bb54728e12fff1b0cd5963a10" +checksum = "f79afb8cbee2ef20f59ccd477a218c12a93943d075b492015ecb1bb81f8ee904" dependencies = [ - "bytemuck", "byteorder-lite", - "num-traits", - "png", - "tiff", + "quick-error 2.0.1", ] +[[package]] +name = "imgref" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0263a3d970d5c054ed9312c0057b4f3bde9c0b33836d3637361d4a9e6e7a408" + [[package]] name = "indexmap" version = "1.9.3" @@ -3444,6 +3772,17 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "interpolate_name" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34819042dc3d3971c46c2190835914dfbe0c3c13f61449b2997f4e9722dfa60" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + [[package]] name = "ipconfig" version = "0.3.2" @@ -3490,6 +3829,12 @@ dependencies = [ "once_cell", ] +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + [[package]] name = "itertools" version = "0.12.1" @@ -3579,9 +3924,6 @@ name = "jpeg-decoder" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0" -dependencies = [ - "rayon", -] [[package]] name = "js-sys" @@ -3842,6 +4184,17 @@ version = "0.2.159" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" +[[package]] +name = "libfuzzer-sys" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a96cfd5557eb82f2b83fed4955246c988d331975a002961b07c81584d107e7f7" +dependencies = [ + "arbitrary", + "cc", + "once_cell", +] + [[package]] name = "libgit2-sys" version = "0.17.0+1.8.1" @@ -4432,6 +4785,15 @@ version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +[[package]] +name = "loop9" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fae87c125b03c1d2c0150c90365d7d6bcc53fb73a9acaef207d2d065860f062" +dependencies = [ + "imgref", +] + [[package]] name = "lru" version = "0.12.5" @@ -4506,6 +4868,15 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" +[[package]] +name = "maybe-rayon" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ea1f30cedd69f0a2954655f7188c6a834246d2bcf1e315e2ac40c4b24dc9519" +dependencies = [ + "cfg-if", +] + [[package]] name = "memchr" version = "2.7.4" @@ -4553,6 +4924,12 @@ dependencies = [ "serde", ] +[[package]] +name = "minisign-verify" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a05b5d0594e0cb1ad8cee3373018d2b84e25905dc75b2468114cc9a8e86cfc20" + [[package]] name = "miniz_oxide" version = "0.7.4" @@ -4896,6 +5273,18 @@ dependencies = [ "libc", ] +[[package]] +name = "nix" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" +dependencies = [ + "bitflags 2.6.0", + "cfg-if", + "libc", + "memoffset", +] + [[package]] name = "nodrop" version = "0.1.14" @@ -4918,6 +5307,12 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "noop_proc_macro" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0676bb32a98c1a483ce53e500a81ad9c3d5b3f7c920c28c24e9cb0980d0b5bc8" + [[package]] name = "nu-ansi-term" version = "0.46.0" @@ -4944,6 +5339,17 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" +[[package]] +name = "num-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + [[package]] name = "num-integer" version = "0.1.46" @@ -4953,6 +5359,17 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-rational" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits", +] + [[package]] name = "num-traits" version = "0.2.19" @@ -5010,7 +5427,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" dependencies = [ "malloc_buf", - "objc_exception", ] [[package]] @@ -5018,6 +5434,9 @@ name = "objc-sys" version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdb91bdd390c7ce1a8607f35f3ca7151b65afc0ff5ff3b34fa350f7d7c7e4310" +dependencies = [ + "cc", +] [[package]] name = "objc2" @@ -5045,6 +5464,30 @@ dependencies = [ "objc2-quartz-core", ] +[[package]] +name = "objc2-cloud-kit" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74dd3b56391c7a0596a295029734d3c1c5e7e510a4cb30245f8221ccea96b009" +dependencies = [ + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-core-location", + "objc2-foundation", +] + +[[package]] +name = "objc2-contacts" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5ff520e9c33812fd374d8deecef01d4a840e7b41862d849513de77e44aa4889" +dependencies = [ + "block2", + "objc2", + "objc2-foundation", +] + [[package]] name = "objc2-core-data" version = "0.2.2" @@ -5069,6 +5512,18 @@ dependencies = [ "objc2-metal", ] +[[package]] +name = "objc2-core-location" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "000cfee34e683244f284252ee206a27953279d370e309649dc3ee317b37e5781" +dependencies = [ + "block2", + "objc2", + "objc2-contacts", + "objc2-foundation", +] + [[package]] name = "objc2-encode" version = "4.0.3" @@ -5083,10 +5538,23 @@ checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" dependencies = [ "bitflags 2.6.0", "block2", + "dispatch", "libc", "objc2", ] +[[package]] +name = "objc2-link-presentation" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1a1ae721c5e35be65f01a03b6d2ac13a54cb4fa70d8a5da293d7b0020261398" +dependencies = [ + "block2", + "objc2", + "objc2-app-kit", + "objc2-foundation", +] + [[package]] name = "objc2-metal" version = "0.2.2" @@ -5113,21 +5581,71 @@ dependencies = [ ] [[package]] -name = "objc_exception" -version = "0.1.2" +name = "objc2-symbols" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4" +checksum = "0a684efe3dec1b305badae1a28f6555f6ddd3bb2c2267896782858d5a78404dc" dependencies = [ - "cc", + "objc2", + "objc2-foundation", ] [[package]] -name = "objc_id" -version = "0.1.1" +name = "objc2-ui-kit" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b" +checksum = "b8bb46798b20cd6b91cbd113524c490f1686f4c4e8f49502431415f3512e2b6f" dependencies = [ - "objc", + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-cloud-kit", + "objc2-core-data", + "objc2-core-image", + "objc2-core-location", + "objc2-foundation", + "objc2-link-presentation", + "objc2-quartz-core", + "objc2-symbols", + "objc2-uniform-type-identifiers", + "objc2-user-notifications", +] + +[[package]] +name = "objc2-uniform-type-identifiers" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44fa5f9748dbfe1ca6c0b79ad20725a11eca7c2218bceb4b005cb1be26273bfe" +dependencies = [ + "block2", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-user-notifications" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76cfcbf642358e8689af64cee815d139339f3ed8ad05103ed5eaf73db8d84cb3" +dependencies = [ + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-core-location", + "objc2-foundation", +] + +[[package]] +name = "objc2-web-kit" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68bc69301064cebefc6c4c90ce9cba69225239e4b8ff99d445a2b5563797da65" +dependencies = [ + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-app-kit", + "objc2-foundation", ] [[package]] @@ -5183,6 +5701,16 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" +[[package]] +name = "ordered-stream" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50" +dependencies = [ + "futures-core", + "pin-project-lite", +] + [[package]] name = "os_pipe" version = "1.2.1" @@ -5517,6 +6045,17 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "piper" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066" +dependencies = [ + "atomic-waker", + "fastrand", + "futures-io", +] + [[package]] name = "pkcs8" version = "0.10.2" @@ -5541,7 +6080,7 @@ checksum = "42cf17e9a1800f5f396bc67d193dc9411b59012a5876445ef450d449881e1016" dependencies = [ "base64 0.22.1", "indexmap 2.6.0", - "quick-xml", + "quick-xml 0.32.0", "serde", "time 0.3.36", ] @@ -5699,6 +6238,25 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "profiling" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afbdc74edc00b6f6a218ca6a5364d6226a259d4b8ea1af4a0ea063f27e179f4d" +dependencies = [ + "profiling-procmacros", +] + +[[package]] +name = "profiling-procmacros" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a65f2e60fbf1063868558d69c6beacf412dc755f9fc020f514b7955fc914fe30" +dependencies = [ + "quote", + "syn 2.0.79", +] + [[package]] name = "prometheus-client" version = "0.22.3" @@ -5809,7 +6367,7 @@ version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d68782463e408eb1e668cf6152704bd856c78c5b6417adaee3203d8f4c1fc9ec" dependencies = [ - "image 0.25.2", + "image", ] [[package]] @@ -5818,6 +6376,12 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" +[[package]] +name = "quick-error" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" + [[package]] name = "quick-protobuf" version = "0.8.1" @@ -5862,6 +6426,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "quick-xml" +version = "0.36.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7649a7b4df05aed9ea7ec6f628c67c9953a43869b8bc50929569b2999d443fe" +dependencies = [ + "memchr", +] + [[package]] name = "quinn" version = "0.11.5" @@ -6016,6 +6589,55 @@ dependencies = [ "rand_core 0.6.4", ] +[[package]] +name = "rav1e" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd87ce80a7665b1cce111f8a16c1f3929f6547ce91ade6addf4ec86a8dda5ce9" +dependencies = [ + "arbitrary", + "arg_enum_proc_macro", + "arrayvec", + "av1-grain", + "bitstream-io", + "built", + "cfg-if", + "interpolate_name", + "itertools 0.12.1", + "libc", + "libfuzzer-sys", + "log", + "maybe-rayon", + "new_debug_unreachable", + "noop_proc_macro", + "num-derive", + "num-traits", + "once_cell", + "paste", + "profiling", + "rand 0.8.5", + "rand_chacha 0.3.1", + "simd_helpers", + "system-deps", + "thiserror", + "v_frame", + "wasm-bindgen", +] + +[[package]] +name = "ravif" +version = "0.11.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2413fd96bd0ea5cdeeb37eaf446a22e6ed7b981d792828721e74ded1980a45c6" +dependencies = [ + "avif-serialize", + "imgref", + "loop9", + "quick-error 2.0.1", + "rav1e", + "rgb", +] + [[package]] name = "raw-window-handle" version = "0.6.2" @@ -6198,7 +6820,39 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00" dependencies = [ "hostname", - "quick-error", + "quick-error 1.2.3", +] + +[[package]] +name = "rfd" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8af382a047821a08aa6bfc09ab0d80ff48d45d8726f7cd8e44891f7cb4a4278e" +dependencies = [ + "ashpd", + "block2", + "glib-sys", + "gobject-sys", + "gtk-sys", + "js-sys", + "log", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "raw-window-handle", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "windows-sys 0.48.0", +] + +[[package]] +name = "rgb" +version = "0.8.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57397d16646700483b67d2dd6511d79318f9d057fdbd21a4066aeac8b41d310a" +dependencies = [ + "bytemuck", ] [[package]] @@ -6280,7 +6934,7 @@ dependencies = [ "log", "netlink-packet-route", "netlink-proto", - "nix", + "nix 0.24.3", "thiserror", "tokio", ] @@ -6499,7 +7153,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" dependencies = [ "fnv", - "quick-error", + "quick-error 1.2.3", "tempfile", "wait-timeout", ] @@ -6575,6 +7229,12 @@ dependencies = [ "syn 2.0.79", ] +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + [[package]] name = "scopeguard" version = "1.2.0" @@ -7114,6 +7774,15 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" +[[package]] +name = "simd_helpers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95890f873bec569a0362c235787f3aca6e1e887302ba4840839bcc6459c42da6" +dependencies = [ + "quote", +] + [[package]] name = "simdutf8" version = "0.1.5" @@ -7467,7 +8136,7 @@ version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c6b5c64445ba8094a6ab0c3cd2ad323e07171012d9c98b0b15651daf1787a10" dependencies = [ - "clap", + "clap 2.34.0", "lazy_static", "structopt-derive", ] @@ -7605,7 +8274,7 @@ dependencies = [ "uuid", "vergen", "void", - "zip", + "zip 0.5.13", ] [[package]] @@ -7769,6 +8438,17 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" +[[package]] +name = "tar" +version = "0.4.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ff6c40d3aedb5e06b57c6f669ad17ab063dd1e63d977c6a88e7f4dfa4f04020" +dependencies = [ + "filetime", + "libc", + "xattr", +] + [[package]] name = "target-lexicon" version = "0.12.16" @@ -7777,9 +8457,9 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tauri" -version = "2.0.2" +version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5920aad0804ea5e86808d4b6e8753d3bcbae7efc8f4e41a4da00b45427559868" +checksum = "5ce2818e803ce3097987296623ed8c0d9f65ed93b4137ff9a83e168bdbf62932" dependencies = [ "anyhow", "bytes", @@ -7906,14 +8586,29 @@ dependencies = [ "walkdir", ] +[[package]] +name = "tauri-plugin-cli" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bccd4692b56822a60874542c7655546c8e7aed3c2e2926166e1498e595bd2a2" +dependencies = [ + "clap 4.5.20", + "log", + "serde", + "serde_json", + "tauri", + "tauri-plugin", + "thiserror", +] + [[package]] name = "tauri-plugin-clipboard-manager" -version = "2.1.0-beta.7" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "becbc5a692e842f8d6a7ab5e490c3c36d267b5c3d5bf4b6a0cdd039d7df25569" +checksum = "78b7d556886c15849198c0948fd7f4c880492f0461539176da0a8a70272e2904" dependencies = [ "arboard", - "image 0.24.9", + "image", "log", "serde", "serde_json", @@ -7949,6 +8644,45 @@ dependencies = [ "tracing-subscriber", ] +[[package]] +name = "tauri-plugin-dialog" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4307310e1d2c09ab110235834722e7c2b85099b683e1eb7342ab351b0be5ada3" +dependencies = [ + "log", + "raw-window-handle", + "rfd", + "serde", + "serde_json", + "tauri", + "tauri-plugin", + "tauri-plugin-fs", + "thiserror", + "url", +] + +[[package]] +name = "tauri-plugin-fs" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96ba7d46e86db8c830d143ef90ab5a453328365b0cc834c24edea4267b16aba0" +dependencies = [ + "anyhow", + "dunce", + "glob", + "percent-encoding", + "schemars", + "serde", + "serde_json", + "serde_repr", + "tauri", + "tauri-plugin", + "thiserror", + "url", + "uuid", +] + [[package]] name = "tauri-plugin-process" version = "2.0.1" @@ -7996,11 +8730,41 @@ dependencies = [ "tokio", ] +[[package]] +name = "tauri-plugin-updater" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dd3d2fe0f02bf52eebb5a9d23b987fffac6684646ab6fd683d706dafb18da87" +dependencies = [ + "base64 0.22.1", + "dirs", + "flate2", + "futures-util", + "http 1.1.0", + "infer", + "minisign-verify", + "percent-encoding", + "reqwest", + "semver", + "serde", + "serde_json", + "tar", + "tauri", + "tauri-plugin", + "tempfile", + "thiserror", + "time 0.3.36", + "tokio", + "url", + "windows-sys 0.59.0", + "zip 2.2.0", +] + [[package]] name = "tauri-runtime" -version = "2.0.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af12ad1af974b274ef1d32a94e6eba27a312b429ef28fcb98abc710df7f9151d" +checksum = "c8f437293d6f5e5dce829250f4dbdce4e0b52905e297a6689cc2963eb53ac728" dependencies = [ "dpi", "gtk", @@ -8017,9 +8781,9 @@ dependencies = [ [[package]] name = "tauri-runtime-wry" -version = "2.0.1" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e45e88aa0b11b302d836e6ea3e507a6359044c4a8bc86b865ba99868c695753d" +checksum = "1431602bcc71f2f840ad623915c9842ecc32999b867c4a787d975a17a9625cc6" dependencies = [ "gtk", "http 1.1.0", @@ -8269,6 +9033,7 @@ dependencies = [ "signal-hook-registry", "socket2", "tokio-macros", + "tracing", "windows-sys 0.52.0", ] @@ -8813,6 +9578,17 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" +[[package]] +name = "uds_windows" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89daebc3e6fd160ac4aa9fc8b3bf71e1f74fbf92367ae71fb83a037e8bf164b9" +dependencies = [ + "memoffset", + "tempfile", + "winapi", +] + [[package]] name = "uint" version = "0.9.5" @@ -8959,7 +9735,7 @@ dependencies = [ [[package]] name = "unstoppableswap-gui-rs" -version = "0.0.0" +version = "1.0.0-alpha.1" dependencies = [ "anyhow", "once_cell", @@ -8968,11 +9744,14 @@ dependencies = [ "swap", "tauri", "tauri-build", + "tauri-plugin-cli", "tauri-plugin-clipboard-manager", "tauri-plugin-devtools", + "tauri-plugin-dialog", "tauri-plugin-process", "tauri-plugin-shell", "tauri-plugin-store", + "tauri-plugin-updater", "tracing", ] @@ -9018,6 +9797,12 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + [[package]] name = "uuid" version = "1.10.0" @@ -9028,6 +9813,17 @@ dependencies = [ "serde", ] +[[package]] +name = "v_frame" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6f32aaa24bacd11e488aa9ba66369c7cd514885742c9fe08cfe85884db3e92b" +dependencies = [ + "aligned-vec", + "num-traits", + "wasm-bindgen", +] + [[package]] name = "valuable" version = "0.1.0" @@ -9229,6 +10025,66 @@ dependencies = [ "web-sys", ] +[[package]] +name = "wayland-backend" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "056535ced7a150d45159d3a8dc30f91a2e2d588ca0b23f70e56033622b8016f6" +dependencies = [ + "cc", + "downcast-rs", + "rustix", + "scoped-tls", + "smallvec", + "wayland-sys", +] + +[[package]] +name = "wayland-client" +version = "0.31.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b66249d3fc69f76fd74c82cc319300faa554e9d865dab1f7cd66cc20db10b280" +dependencies = [ + "bitflags 2.6.0", + "rustix", + "wayland-backend", + "wayland-scanner", +] + +[[package]] +name = "wayland-protocols" +version = "0.32.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cd0ade57c4e6e9a8952741325c30bf82f4246885dca8bf561898b86d0c1f58e" +dependencies = [ + "bitflags 2.6.0", + "wayland-backend", + "wayland-client", + "wayland-scanner", +] + +[[package]] +name = "wayland-scanner" +version = "0.31.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597f2001b2e5fc1121e3d5b9791d3e78f05ba6bfa4641053846248e3a13661c3" +dependencies = [ + "proc-macro2", + "quick-xml 0.36.2", + "quote", +] + +[[package]] +name = "wayland-sys" +version = "0.31.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efa8ac0d8e8ed3e3b5c9fc92c7881406a268e11555abe36493efabe649a29e09" +dependencies = [ + "dlib", + "log", + "pkg-config", +] + [[package]] name = "web-sys" version = "0.3.71" @@ -9796,14 +10652,12 @@ dependencies = [ [[package]] name = "wry" -version = "0.44.1" +version = "0.46.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "440600584cfbd8b0d28eace95c1f2c253db05dae43780b79380aa1e868f04c73" +checksum = "cd5cdf57c66813d97601181349c63b96994b3074fc3d7a31a8cce96e968e3bbd" dependencies = [ "base64 0.22.1", - "block", - "cocoa", - "core-graphics 0.24.0", + "block2", "crossbeam-channel", "dpi", "dunce", @@ -9816,8 +10670,11 @@ dependencies = [ "kuchikiki", "libc", "ndk", - "objc", - "objc_id", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "objc2-ui-kit", + "objc2-web-kit", "once_cell", "percent-encoding", "raw-window-handle", @@ -9922,6 +10779,16 @@ dependencies = [ "rustix", ] +[[package]] +name = "xdg-home" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec1cdab258fb55c0da61328dc52c8764709b249011b2cad0454c72f0bf10a1f6" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + [[package]] name = "xml-rs" version = "0.8.20" @@ -9977,6 +10844,65 @@ dependencies = [ "time 0.3.36", ] +[[package]] +name = "zbus" +version = "4.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b8e3d6ae3342792a6cc2340e4394334c7402f3d793b390d2c5494a4032b3030" +dependencies = [ + "async-broadcast", + "async-process", + "async-recursion", + "async-trait", + "derivative", + "enumflags2", + "event-listener 5.3.1", + "futures-core", + "futures-sink", + "futures-util", + "hex", + "nix 0.27.1", + "ordered-stream", + "rand 0.8.5", + "serde", + "serde_repr", + "sha1", + "static_assertions", + "tokio", + "tracing", + "uds_windows", + "windows-sys 0.52.0", + "xdg-home", + "zbus_macros", + "zbus_names", + "zvariant", +] + +[[package]] +name = "zbus_macros" +version = "4.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7a3e850ff1e7217a3b7a07eba90d37fe9bb9e89a310f718afcde5885ca9b6d7" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "regex", + "syn 1.0.109", + "zvariant_utils", +] + +[[package]] +name = "zbus_names" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b9b1fef7d021261cc16cba64c351d291b715febe0fa10dc3a443ac5a5022e6c" +dependencies = [ + "serde", + "static_assertions", + "zvariant", +] + [[package]] name = "zerocopy" version = "0.7.35" @@ -10032,6 +10958,27 @@ dependencies = [ "time 0.1.45", ] +[[package]] +name = "zip" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc5e4288ea4057ae23afc69a4472434a87a2495cafce6632fd1c4ec9f5cf3494" +dependencies = [ + "arbitrary", + "crc32fast", + "crossbeam-utils", + "displaydoc", + "indexmap 2.6.0", + "memchr", + "thiserror", +] + +[[package]] +name = "zune-core" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f423a2c17029964870cfaabb1f13dfab7d092a62a29a89264f4d36990ca414a" + [[package]] name = "zune-inflate" version = "0.2.54" @@ -10040,3 +10987,50 @@ checksum = "73ab332fe2f6680068f3582b16a24f90ad7096d5d39b974d1c0aff0125116f02" dependencies = [ "simd-adler32", ] + +[[package]] +name = "zune-jpeg" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16099418600b4d8f028622f73ff6e3deaabdff330fb9a2a131dea781ee8b0768" +dependencies = [ + "zune-core", +] + +[[package]] +name = "zvariant" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e09e8be97d44eeab994d752f341e67b3b0d80512a8b315a0671d47232ef1b65" +dependencies = [ + "endi", + "enumflags2", + "serde", + "static_assertions", + "url", + "zvariant_derive", +] + +[[package]] +name = "zvariant_derive" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72a5857e2856435331636a9fbb415b09243df4521a267c5bedcd5289b4d5799e" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "syn 1.0.109", + "zvariant_utils", +] + +[[package]] +name = "zvariant_utils" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00bedb16a193cc12451873fee2a1bc6550225acece0e36f333e68326c73c8172" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] diff --git a/swap/src/asb/event_loop.rs b/swap/src/asb/event_loop.rs index 4519d582e..81f1e065a 100644 --- a/swap/src/asb/event_loop.rs +++ b/swap/src/asb/event_loop.rs @@ -12,7 +12,7 @@ use anyhow::{Context, Result}; use futures::future; use futures::future::{BoxFuture, FutureExt}; use futures::stream::{FuturesUnordered, StreamExt}; -use libp2p::request_response::{InboundRequestId, OutboundRequestId, ResponseChannel}; +use libp2p::request_response::{OutboundRequestId, ResponseChannel}; use libp2p::swarm::SwarmEvent; use libp2p::{PeerId, Swarm}; use rust_decimal::Decimal; diff --git a/swap/src/bin/asb.rs b/swap/src/bin/asb.rs index 1698a70ad..6cb64b5e7 100644 --- a/swap/src/bin/asb.rs +++ b/swap/src/bin/asb.rs @@ -192,7 +192,7 @@ pub async fn main() -> Result<()> { tracing::info!(peer_id = %swarm.local_peer_id(), "Network layer initialized"); for external_address in config.network.external_addresses { - let _ = Swarm::add_external_address(&mut swarm, external_address); + Swarm::add_external_address(&mut swarm, external_address); } let (event_loop, mut swap_receiver) = EventLoop::new( diff --git a/swap/src/cli/event_loop.rs b/swap/src/cli/event_loop.rs index 022749873..104758a12 100644 --- a/swap/src/cli/event_loop.rs +++ b/swap/src/cli/event_loop.rs @@ -10,7 +10,7 @@ use crate::protocol::Database; use anyhow::{Context, Result}; use futures::future::{BoxFuture, OptionFuture}; use futures::{FutureExt, StreamExt}; -use libp2p::request_response::{InboundRequestId, OutboundRequestId, ResponseChannel}; +use libp2p::request_response::{OutboundRequestId, ResponseChannel}; use libp2p::swarm::dial_opts::DialOpts; use libp2p::swarm::SwarmEvent; use libp2p::{PeerId, Swarm}; diff --git a/swap/src/cli/list_sellers.rs b/swap/src/cli/list_sellers.rs index 6eebe72fb..6f2528666 100644 --- a/swap/src/cli/list_sellers.rs +++ b/swap/src/cli/list_sellers.rs @@ -6,7 +6,7 @@ use futures::StreamExt; use libp2p::multiaddr::Protocol; use libp2p::request_response; use libp2p::swarm::dial_opts::DialOpts; -use libp2p::swarm::{behaviour, NetworkBehaviour, SwarmEvent}; +use libp2p::swarm::{NetworkBehaviour, SwarmEvent}; use libp2p::{identity, ping, rendezvous, Multiaddr, PeerId, Swarm}; use serde::Serialize; use serde_with::{serde_as, DisplayFromStr}; @@ -31,15 +31,11 @@ pub async fn list_sellers( let behaviour = Behaviour { rendezvous: rendezvous::client::Behaviour::new(identity.clone()), quote: quote::cli(), - ping: ping::Behaviour::new( - ping::Config::new() - .with_interval(Duration::from_secs(86_400)), - ), + ping: ping::Behaviour::new(ping::Config::new().with_interval(Duration::from_secs(86_400))), }; let mut swarm = swarm::cli(identity, tor_socks5_port, behaviour).await?; - swarm - .add_peer_address(rendezvous_node_peer_id, rendezvous_node_addr.clone()); + swarm.add_peer_address(rendezvous_node_peer_id, rendezvous_node_addr.clone()); swarm .dial(DialOpts::from(rendezvous_node_peer_id)) @@ -212,7 +208,7 @@ impl EventLoop { for address in registration.record.addresses() { tracing::info!(peer_id=%peer, address=%address, "Discovered peer"); - let p2p_suffix = Protocol::P2p(peer.into()); + let p2p_suffix = Protocol::P2p(peer); let _address_with_p2p = if !address .ends_with(&Multiaddr::empty().with(p2p_suffix.clone())) { diff --git a/swap/src/common/tracing_util.rs b/swap/src/common/tracing_util.rs index 9a0aba2bd..1cdde3dac 100644 --- a/swap/src/common/tracing_util.rs +++ b/swap/src/common/tracing_util.rs @@ -85,7 +85,7 @@ fn env_filter(level_filter: LevelFilter) -> Result { .add_directive(Directive::from_str(&format!("asb={}", &level_filter))?) .add_directive(Directive::from_str(&format!("swap={}", &level_filter))?) // TODO(libp2p upgrade): Disable this again once we merge https://github.com/UnstoppableSwap/core/pull/109 - .add_directive(Directive::from_str(&format!("libp2p=debug"))?) + .add_directive(Directive::from_str(&"libp2p=debug".to_string())?) .add_directive(Directive::from_str(&format!( "unstoppableswap-gui-rs={}", &level_filter diff --git a/swap/src/network/encrypted_signature.rs b/swap/src/network/encrypted_signature.rs index 233cc9ae8..3ed6c93e3 100644 --- a/swap/src/network/encrypted_signature.rs +++ b/swap/src/network/encrypted_signature.rs @@ -1,5 +1,5 @@ use crate::{asb, cli}; -use libp2p::request_response::{self, ProtocolSupport}; +use libp2p::request_response::{self}; use libp2p::{PeerId, StreamProtocol}; use serde::{Deserialize, Serialize}; use uuid::Uuid; diff --git a/swap/src/network/quote.rs b/swap/src/network/quote.rs index 77f63cd36..84064bf15 100644 --- a/swap/src/network/quote.rs +++ b/swap/src/network/quote.rs @@ -48,10 +48,7 @@ pub struct ZeroQuoteReceived; /// handing out quotes. pub fn asb() -> Behaviour { Behaviour::new( - vec![( - StreamProtocol::new(PROTOCOL), - ProtocolSupport::Inbound, - )], + vec![(StreamProtocol::new(PROTOCOL), ProtocolSupport::Inbound)], request_response::Config::default(), ) } @@ -62,10 +59,7 @@ pub fn asb() -> Behaviour { /// requesting quotes. pub fn cli() -> Behaviour { Behaviour::new( - vec![( - StreamProtocol::new(BidQuoteProtocol::PROTOCOL_ID), - ProtocolSupport::Outbound, - )], + vec![(StreamProtocol::new(PROTOCOL), ProtocolSupport::Outbound)], request_response::Config::default(), ) } diff --git a/swap/src/network/swap_setup/alice.rs b/swap/src/network/swap_setup/alice.rs index 166dab961..be4eb178a 100644 --- a/swap/src/network/swap_setup/alice.rs +++ b/swap/src/network/swap_setup/alice.rs @@ -158,7 +158,7 @@ where let handler = Handler::new( self.min_buy, self.max_buy, - self.env_config.clone(), + self.env_config, self.latest_rate.clone(), self.resume_only, ); diff --git a/swap/src/network/tor_transport.rs b/swap/src/network/tor_transport.rs index 59c7c4249..d66ddd4ed 100644 --- a/swap/src/network/tor_transport.rs +++ b/swap/src/network/tor_transport.rs @@ -1,6 +1,6 @@ use anyhow::Result; use data_encoding::BASE32; -use futures::future::{BoxFuture, FutureExt, Ready}; +use futures::future::{BoxFuture, Ready}; use libp2p::core::multiaddr::{Multiaddr, Protocol}; use libp2p::core::transport::{ListenerId, TransportError}; use libp2p::core::Transport; @@ -43,7 +43,7 @@ impl Transport for TorDialOnlyTransport { return Err(TransportError::MultiaddrNotSupported(addr)); } - let socks_port = self.socks_port.clone(); + let socks_port = self.socks_port; Ok(Box::pin(async move { tracing::debug!(address = %addr, "Establishing connection through Tor proxy"); @@ -73,7 +73,7 @@ impl Transport for TorDialOnlyTransport { return Err(TransportError::MultiaddrNotSupported(addr)); } - let socks_port = self.socks_port.clone(); + let socks_port = self.socks_port; Ok(Box::pin(async move { tracing::debug!(address = %addr, "Establishing connection through Tor proxy"); @@ -105,7 +105,7 @@ impl Transport for TorDialOnlyTransport { // I believe we do not need to do anything here because we are not using the transport to listen. // But we need to verify this before merging. - return std::task::Poll::Pending; + std::task::Poll::Pending } } diff --git a/swap/src/network/transport.rs b/swap/src/network/transport.rs index 5c2c6a2ac..7dddfc346 100644 --- a/swap/src/network/transport.rs +++ b/swap/src/network/transport.rs @@ -2,7 +2,7 @@ use anyhow::Result; use futures::{AsyncRead, AsyncWrite}; use libp2p::core::muxing::StreamMuxerBox; use libp2p::core::transport::Boxed; -use libp2p::core::upgrade::{SelectUpgrade, Version}; +use libp2p::core::upgrade::Version; use libp2p::noise; use libp2p::{identity, yamux, PeerId, Transport}; use std::time::Duration; @@ -20,7 +20,7 @@ pub fn authenticate_and_multiplex( where T: AsyncRead + AsyncWrite + Unpin + Send + 'static, { - let auth_upgrade = noise::Config::new(&identity)?; + let auth_upgrade = noise::Config::new(identity)?; let multiplex_upgrade = yamux::Config::default(); let transport = transport diff --git a/swap/src/seed.rs b/swap/src/seed.rs index 5bcdc374f..7b20564bc 100644 --- a/swap/src/seed.rs +++ b/swap/src/seed.rs @@ -43,9 +43,8 @@ impl Seed { pub fn derive_libp2p_identity(&self) -> identity::Keypair { let bytes = self.derive(b"NETWORK").derive(b"LIBP2P_IDENTITY").bytes(); - let key = identity::Keypair::ed25519_from_bytes(bytes).expect("we always pass 32 bytes"); - key + identity::Keypair::ed25519_from_bytes(bytes).expect("we always pass 32 bytes") } pub fn derive_torv3_key(&self) -> TorSecretKeyV3 { diff --git a/swap/tests/harness/mod.rs b/swap/tests/harness/mod.rs index ef0803587..99a0a78be 100644 --- a/swap/tests/harness/mod.rs +++ b/swap/tests/harness/mod.rs @@ -420,7 +420,7 @@ impl BobParams { format!( "{}/p2p/{}", self.alice_address.clone(), - self.alice_peer_id.clone().to_base58() + self.alice_peer_id.to_base58() ) } From ff60ceebb1ac218bacfa34d53561f16f44783552 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Thu, 24 Oct 2024 19:01:37 +0200 Subject: [PATCH 049/112] fix(libp2p): Remove unused await_events_or_timeout test helper, remove unused parameter from behaviour_fn function --- swap/src/asb/network.rs | 12 ++++---- swap/src/cli.rs | 6 ++-- swap/src/network/test.rs | 61 +++++++++++----------------------------- 3 files changed, 26 insertions(+), 53 deletions(-) diff --git a/swap/src/asb/network.rs b/swap/src/asb/network.rs index eb4b75a98..5a8fcbd28 100644 --- a/swap/src/asb/network.rs +++ b/swap/src/asb/network.rs @@ -449,7 +449,7 @@ pub mod rendezvous { #[tokio::test] async fn given_no_initial_connection_when_constructed_asb_connects_and_registers_with_rendezvous_node( ) { - let mut rendezvous_node = new_swarm(|_, _| { + let mut rendezvous_node = new_swarm(|_| { rendezvous::server::Behaviour::new(rendezvous::server::Config::default()) }); let address = rendezvous_node.listen_on_random_memory_address().await; @@ -460,7 +460,7 @@ pub mod rendezvous { None, ); - let mut asb = new_swarm(|_, identity| { + let mut asb = new_swarm(|identity| { super::rendezvous::Behaviour::new(identity, vec![rendezvous_point]) }); asb.listen_on_random_memory_address().await; // this adds an external address @@ -488,7 +488,7 @@ pub mod rendezvous { #[tokio::test] async fn asb_automatically_re_registers() { - let mut rendezvous_node = new_swarm(|_, _| { + let mut rendezvous_node = new_swarm(|_| { rendezvous::server::Behaviour::new( rendezvous::server::Config::default().with_min_ttl(2), ) @@ -501,7 +501,7 @@ pub mod rendezvous { Some(5), ); - let mut asb = new_swarm(|_, identity| { + let mut asb = new_swarm(|identity| { super::rendezvous::Behaviour::new(identity, vec![rendezvous_point]) }); asb.listen_on_random_memory_address().await; // this adds an external address @@ -540,7 +540,7 @@ pub mod rendezvous { let mut registrations = HashMap::new(); // register with 5 rendezvous nodes for _ in 0..5 { - let mut rendezvous = new_swarm(|_, _| { + let mut rendezvous = new_swarm(|_| { rendezvous::server::Behaviour::new( rendezvous::server::Config::default().with_min_ttl(2), ) @@ -561,7 +561,7 @@ pub mod rendezvous { }); } - let mut asb = new_swarm(|_, identity| { + let mut asb = new_swarm(|identity| { super::rendezvous::Behaviour::new(identity, rendezvous_nodes) }); asb.listen_on_random_memory_address().await; // this adds an external address diff --git a/swap/src/cli.rs b/swap/src/cli.rs index 51b10b256..079c8e2ad 100644 --- a/swap/src/cli.rs +++ b/swap/src/cli.rs @@ -55,7 +55,7 @@ mod tests { } async fn setup_rendezvous_point() -> (Multiaddr, PeerId) { - let mut rendezvous_node = new_swarm(|_, _| RendezvousPointBehaviour::default()); + let mut rendezvous_node = new_swarm(|_| RendezvousPointBehaviour::default()); let rendezvous_address = rendezvous_node.listen_on_tcp_localhost().await; let rendezvous_peer_id = *rendezvous_node.local_peer_id(); @@ -79,7 +79,7 @@ mod tests { max_quantity: bitcoin::Amount::from_sat(9001), }; - let mut asb = new_swarm(|_, identity| { + let mut asb = new_swarm(|identity| { let rendezvous_node = RendezvousNode::new(rendezvous_address, rendezvous_peer_id, namespace, None); let rendezvous = asb::rendezvous::Behaviour::new(identity, vec![rendezvous_node]); @@ -123,6 +123,8 @@ mod tests { ping: libp2p::ping::Behaviour, quote: quote::Behaviour, + // TODO(Libp2p Migration): Support for this macro attribute has been removed: https://github.com/libp2p/rust-libp2p/pull/2842 + // We need to find a way to ignore this field, put it somewhere else #[behaviour(ignore)] static_quote: BidQuote, #[behaviour(ignore)] diff --git a/swap/src/network/test.rs b/swap/src/network/test.rs index 66fec24b6..71f2d538e 100644 --- a/swap/src/network/test.rs +++ b/swap/src/network/test.rs @@ -4,14 +4,12 @@ use futures::{future, Future, StreamExt}; use libp2p::core::muxing::StreamMuxerBox; use libp2p::core::transport::upgrade::Version; use libp2p::core::transport::MemoryTransport; -use libp2p::core::upgrade::SelectUpgrade; -use libp2p::core::{Executor, Multiaddr, PeerId, Transport}; +use libp2p::core::{Multiaddr, PeerId, Transport}; use libp2p::identity; -use libp2p::mplex::MplexConfig; -use libp2p::noise::{Config as NoiseConfig, Keypair, X25519Spec}; -use libp2p::swarm::{AddressScore, NetworkBehaviour, Swarm, SwarmEvent}; +use libp2p::noise; +use libp2p::swarm::{Executor, NetworkBehaviour, Swarm, SwarmEvent}; use libp2p::tcp::Config as TokioTcpConfig; -use libp2p::yamux::Config as YamuxConfig; +use libp2p::yamux; use libp2p::SwarmBuilder; use std::fmt::Debug; use std::pin::Pin; @@ -30,32 +28,28 @@ impl Executor for GlobalSpawnTokioExecutor { pub fn new_swarm(behaviour_fn: F) -> Swarm where B: NetworkBehaviour, - ::OutEvent: Debug, + ::ToSwarm: Debug, B: NetworkBehaviour, - F: FnOnce(PeerId, identity::Keypair) -> B, + F: FnOnce(identity::Keypair) -> B, { let identity = identity::Keypair::generate_ed25519(); let peer_id = PeerId::from(identity.public()); + let noise = noise::Config::new(&identity)?; - let dh_keys = Keypair::::new() - .into_authentic(&identity) - .expect("failed to create dh_keys"); - let noise = NoiseConfig::xx(dh_keys).into_authenticated(); - - let transport = MemoryTransport + let transport = MemoryTransport::new() .or_transport(TokioTcpConfig::new()) .upgrade(Version::V1) .authenticate(noise) - .multiplex(SelectUpgrade::new( - YamuxConfig::default(), - MplexConfig::new(), - )) + .multiplex(yamux::Config::default()) .timeout(Duration::from_secs(5)) .map(|(peer, muxer), _| (peer, StreamMuxerBox::new(muxer))) .boxed(); - SwarmBuilder::new(transport, behaviour_fn(peer_id, identity), peer_id) - .executor(Box::new(GlobalSpawnTokioExecutor)) + SwarmBuilder::with_existing_identity(identity) + .with_executor(Box::new(GlobalSpawnTokioExecutor)) + .with_other_transport(|_| transport) + .with_behaviour(|keypair| behaviour_fn(keypair.clone())) + .with_swarm_config(|cfg| cfg.with_idle_connection_timeout(Duration::MAX)) .build() } @@ -76,29 +70,6 @@ async fn get_local_tcp_address() -> Multiaddr { .unwrap() } -pub async fn await_events_or_timeout( - swarm_1: &mut (impl FusedStream> + FusedStream + Unpin), - swarm_2: &mut (impl FusedStream> + FusedStream + Unpin), -) -> (SwarmEvent, SwarmEvent) -where - SwarmEvent: Debug, - SwarmEvent: Debug, -{ - tokio::time::timeout( - Duration::from_secs(30), - future::join( - swarm_1 - .inspect(|event| tracing::debug!("Swarm1 emitted {:?}", event)) - .select_next_some(), - swarm_2 - .inspect(|event| tracing::debug!("Swarm2 emitted {:?}", event)) - .select_next_some(), - ), - ) - .await - .expect("network behaviours to emit an event within 10 seconds") -} - /// An extension trait for [`Swarm`] that makes it easier to set up a network of /// [`Swarm`]s for tests. #[async_trait] @@ -184,7 +155,7 @@ where // Memory addresses are externally reachable because they all share the same // memory-space. - self.add_external_address(multiaddr.clone(), AddressScore::Infinite); + self.add_external_address(multiaddr.clone()); multiaddr } @@ -202,7 +173,7 @@ where async fn block_until_listening_on(swarm: &mut Swarm, multiaddr: &Multiaddr) where B: NetworkBehaviour, - ::OutEvent: Debug, + ::ToSwarm: Debug, { loop { match swarm.select_next_some().await { From 1f0be4b3c610858bd97a30c7bc4317a309af2134 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Thu, 24 Oct 2024 19:08:52 +0200 Subject: [PATCH 050/112] fix(libp2p): Remove ping behaviour from test behaviours because peers dont close connections anymore when they encounter unsupported protocols See: https://github.com/libp2p/rust-libp2p/pull/2149 --- swap/src/cli.rs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/swap/src/cli.rs b/swap/src/cli.rs index 079c8e2ad..d3f6f50d4 100644 --- a/swap/src/cli.rs +++ b/swap/src/cli.rs @@ -24,7 +24,7 @@ mod tests { use crate::network::test::{new_swarm, SwarmExt}; use futures::StreamExt; use libp2p::multiaddr::Protocol; - use libp2p::{identity, rendezvous, Multiaddr, PeerId}; + use libp2p::{identity, rendezvous, Multiaddr, PeerId, request_response}; use std::collections::HashSet; use std::iter::FromIterator; use std::time::Duration; @@ -86,7 +86,6 @@ mod tests { StaticQuoteAsbBehaviour { rendezvous, - ping: Default::default(), quote: quote::asb(), // static_quote, // registered: false, @@ -119,8 +118,6 @@ mod tests { #[derive(libp2p::swarm::NetworkBehaviour)] struct StaticQuoteAsbBehaviour { rendezvous: asb::rendezvous::Behaviour, - // Support `Ping` as a workaround until https://github.com/libp2p/rust-libp2p/issues/2109 is fixed. - ping: libp2p::ping::Behaviour, quote: quote::Behaviour, // TODO(Libp2p Migration): Support for this macro attribute has been removed: https://github.com/libp2p/rust-libp2p/pull/2842 @@ -141,6 +138,7 @@ mod tests { impl NetworkBehaviourEventProcess for StaticQuoteAsbBehaviour { fn inject_event(&mut self, _: libp2p::ping::Event) {} } + impl NetworkBehaviourEventProcess for StaticQuoteAsbBehaviour { fn inject_event(&mut self, event: quote::OutEvent) { if let request_response::Event::Message { @@ -158,16 +156,11 @@ mod tests { #[derive(libp2p::swarm::NetworkBehaviour)] struct RendezvousPointBehaviour { rendezvous: rendezvous::server::Behaviour, - // Support `Ping` as a workaround until https://github.com/libp2p/rust-libp2p/issues/2109 is fixed. - ping: libp2p::ping::Behaviour, } impl NetworkBehaviourEventProcess for RendezvousPointBehaviour { fn inject_event(&mut self, _: rendezvous::server::Event) {} } - impl NetworkBehaviourEventProcess for RendezvousPointBehaviour { - fn inject_event(&mut self, _: libp2p::ping::Event) {} - } impl Default for RendezvousPointBehaviour { fn default() -> Self { @@ -175,7 +168,6 @@ mod tests { rendezvous: rendezvous::server::Behaviour::new( rendezvous::server::Config::default(), ), - ping: Default::default(), } } } From 28e11d21067f98749054c8b33cd716dbdd1c397a Mon Sep 17 00:00:00 2001 From: binarybaron Date: Fri, 25 Oct 2024 02:08:23 +0200 Subject: [PATCH 051/112] fix(docker): Use Bookworm-Slim --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 085cf7edb..05e5d64cf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ WORKDIR /build/swap RUN cargo build --release --bin=asb -FROM debian:bullseye-slim +FROM debian:bookworm-slim WORKDIR /data From d4fa5a46ec801a18e6d2100f424dee443ded8c56 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Fri, 25 Oct 2024 13:37:13 +0200 Subject: [PATCH 052/112] libp2p: Disable websocket feature, enable RSA for libp2p crate --- swap/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swap/Cargo.toml b/swap/Cargo.toml index 314d64ef4..efb027fad 100644 --- a/swap/Cargo.toml +++ b/swap/Cargo.toml @@ -44,7 +44,7 @@ hyper = "0.14.20" itertools = "0.13" jsonrpsee = { version = "0.16.2", features = [ "server" ] } jsonrpsee-core = "0.16.2" -libp2p = { version = "0.53.2", features = [ "tcp", "yamux", "dns", "noise", "request-response", "websocket", "ping", "rendezvous", "identify", "macros", "cbor", "json", "tokio", "serde" ] } +libp2p = { version = "0.53.2", features = [ "tcp", "yamux", "dns", "noise", "request-response", "ping", "rendezvous", "identify", "macros", "cbor", "json", "tokio", "serde", "rsa" ] } monero = { version = "0.12", features = [ "serde_support" ] } monero-rpc = { path = "../monero-rpc" } once_cell = "1.19" From f2cc2c3f57c2f0fc0573fb621b03ac38a1079c41 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Sun, 27 Oct 2024 23:32:21 +0100 Subject: [PATCH 053/112] libp2p: increase request_response timeouts to 60s --- swap/src/network/cooperative_xmr_redeem_after_punish.rs | 5 +++-- swap/src/network/encrypted_signature.rs | 5 +++-- swap/src/network/quote.rs | 6 ++++-- swap/src/network/transfer_proof.rs | 6 ++++-- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/swap/src/network/cooperative_xmr_redeem_after_punish.rs b/swap/src/network/cooperative_xmr_redeem_after_punish.rs index ddafeffc8..dedb56193 100644 --- a/swap/src/network/cooperative_xmr_redeem_after_punish.rs +++ b/swap/src/network/cooperative_xmr_redeem_after_punish.rs @@ -4,6 +4,7 @@ use libp2p::request_response::ProtocolSupport; use libp2p::{request_response, PeerId, StreamProtocol}; use serde::{Deserialize, Serialize}; use uuid::Uuid; +use std::time::Duration; const PROTOCOL: &str = "/comit/xmr/btc/cooperative_xmr_redeem_after_punish/1.0.0"; type OutEvent = request_response::Event; @@ -53,7 +54,7 @@ pub fn alice() -> Behaviour { StreamProtocol::new(CooperativeXmrRedeemProtocol.as_ref()), ProtocolSupport::Inbound, )], - request_response::Config::default(), + request_response::Config::default().with_request_timeout(Duration::from_secs(60)), ) } @@ -63,7 +64,7 @@ pub fn bob() -> Behaviour { StreamProtocol::new(CooperativeXmrRedeemProtocol.as_ref()), ProtocolSupport::Outbound, )], - request_response::Config::default(), + request_response::Config::default().with_request_timeout(Duration::from_secs(60)), ) } diff --git a/swap/src/network/encrypted_signature.rs b/swap/src/network/encrypted_signature.rs index 3ed6c93e3..182858cde 100644 --- a/swap/src/network/encrypted_signature.rs +++ b/swap/src/network/encrypted_signature.rs @@ -3,6 +3,7 @@ use libp2p::request_response::{self}; use libp2p::{PeerId, StreamProtocol}; use serde::{Deserialize, Serialize}; use uuid::Uuid; +use std::time::Duration; const PROTOCOL: &str = "/comit/xmr/btc/encrypted_signature/1.0.0"; type OutEvent = request_response::Event; @@ -31,7 +32,7 @@ pub fn alice() -> Behaviour { StreamProtocol::new(EncryptedSignatureProtocol.as_ref()), request_response::ProtocolSupport::Inbound, )], - request_response::Config::default(), + request_response::Config::default().with_request_timeout(Duration::from_secs(60)), ) } @@ -41,7 +42,7 @@ pub fn bob() -> Behaviour { StreamProtocol::new(EncryptedSignatureProtocol.as_ref()), request_response::ProtocolSupport::Outbound, )], - request_response::Config::default(), + request_response::Config::default().with_request_timeout(Duration::from_secs(60)), ) } diff --git a/swap/src/network/quote.rs b/swap/src/network/quote.rs index 84064bf15..05bc706c2 100644 --- a/swap/src/network/quote.rs +++ b/swap/src/network/quote.rs @@ -1,3 +1,5 @@ +use std::time::Duration; + use crate::{asb, bitcoin, cli}; use libp2p::request_response::{self, ProtocolSupport}; use libp2p::{PeerId, StreamProtocol}; @@ -49,7 +51,7 @@ pub struct ZeroQuoteReceived; pub fn asb() -> Behaviour { Behaviour::new( vec![(StreamProtocol::new(PROTOCOL), ProtocolSupport::Inbound)], - request_response::Config::default(), + request_response::Config::default().with_request_timeout(Duration::from_secs(60)), ) } @@ -60,7 +62,7 @@ pub fn asb() -> Behaviour { pub fn cli() -> Behaviour { Behaviour::new( vec![(StreamProtocol::new(PROTOCOL), ProtocolSupport::Outbound)], - request_response::Config::default(), + request_response::Config::default().with_request_timeout(Duration::from_secs(60)), ) } diff --git a/swap/src/network/transfer_proof.rs b/swap/src/network/transfer_proof.rs index 3fe92deec..83cf52c44 100644 --- a/swap/src/network/transfer_proof.rs +++ b/swap/src/network/transfer_proof.rs @@ -1,3 +1,5 @@ +use std::time::Duration; + use crate::{asb, cli, monero}; use libp2p::request_response::{self, ProtocolSupport}; use libp2p::{PeerId, StreamProtocol}; @@ -28,14 +30,14 @@ pub struct Request { pub fn alice() -> Behaviour { Behaviour::new( vec![(StreamProtocol::new(PROTOCOL), ProtocolSupport::Outbound)], - request_response::Config::default(), + request_response::Config::default().with_request_timeout(Duration::from_secs(60)), ) } pub fn bob() -> Behaviour { Behaviour::new( vec![(StreamProtocol::new(PROTOCOL), ProtocolSupport::Inbound)], - request_response::Config::default(), + request_response::Config::default().with_request_timeout(Duration::from_secs(60)), ) } From aa272a1b7c5f7d109f8e668a4b65b7ce7396e6f4 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Mon, 28 Oct 2024 16:02:17 +0100 Subject: [PATCH 054/112] fix(libp2p): Fix compile errors in unit tests --- Cargo.lock | 51 ++---- swap/src/asb/network.rs | 5 +- swap/src/cli.rs | 159 ++++++++++++++---- .../cooperative_xmr_redeem_after_punish.rs | 2 +- swap/src/network/encrypted_signature.rs | 2 +- swap/src/network/quote.rs | 4 +- swap/src/network/swap_setup/bob.rs | 23 ++- swap/src/network/test.rs | 54 +++--- 8 files changed, 179 insertions(+), 121 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0b7098881..2cb03a8d0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -306,6 +306,12 @@ dependencies = [ "syn 2.0.79", ] +[[package]] +name = "asn1_der" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "155a5a185e42c6b77ac7b88a15143d930a9e9727a5b7b77eed417404ab15c247" + [[package]] name = "assert-json-diff" version = "2.0.2" @@ -4014,7 +4020,7 @@ dependencies = [ "jsonrpsee-types", "pin-project", "rustls-native-certs 0.6.3", - "soketto 0.7.1", + "soketto", "thiserror", "tokio", "tokio-rustls 0.24.1", @@ -4045,7 +4051,7 @@ dependencies = [ "rustc-hash 1.1.0", "serde", "serde_json", - "soketto 0.7.1", + "soketto", "thiserror", "tokio", "tracing", @@ -4065,7 +4071,7 @@ dependencies = [ "jsonrpsee-types", "serde", "serde_json", - "soketto 0.7.1", + "soketto", "tokio", "tokio-stream", "tokio-util", @@ -4253,7 +4259,6 @@ dependencies = [ "libp2p-swarm", "libp2p-tcp", "libp2p-upnp", - "libp2p-websocket", "libp2p-yamux", "multiaddr", "pin-project", @@ -4391,12 +4396,14 @@ version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55cca1eb2bc1fd29f099f3daaab7effd01e1a54b7c577d0ed082521034d912e8" dependencies = [ + "asn1_der", "bs58", "ed25519-dalek 2.1.1", "hkdf", "multihash", "quick-protobuf", "rand 0.8.5", + "ring 0.17.8", "serde", "sha2 0.10.8", "thiserror", @@ -4675,27 +4682,6 @@ dependencies = [ "void", ] -[[package]] -name = "libp2p-websocket" -version = "0.43.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b953b6803a1f3161a989538974d72511c4e48a4af355337b6fb90723c56c05" -dependencies = [ - "either", - "futures", - "futures-rustls", - "libp2p-core", - "libp2p-identity", - "parking_lot 0.12.3", - "pin-project-lite", - "rw-stream-sink", - "soketto 0.8.0", - "thiserror", - "tracing", - "url", - "webpki-roots 0.25.4", -] - [[package]] name = "libp2p-yamux" version = "0.45.2" @@ -7897,21 +7883,6 @@ dependencies = [ "sha-1", ] -[[package]] -name = "soketto" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37468c595637c10857701c990f93a40ce0e357cedb0953d1c26c8d8027f9bb53" -dependencies = [ - "base64 0.22.1", - "bytes", - "futures", - "httparse", - "log", - "rand 0.8.5", - "sha1", -] - [[package]] name = "soup3" version = "0.5.0" diff --git a/swap/src/asb/network.rs b/swap/src/asb/network.rs index 5a8fcbd28..9b9e44400 100644 --- a/swap/src/asb/network.rs +++ b/swap/src/asb/network.rs @@ -561,9 +561,8 @@ pub mod rendezvous { }); } - let mut asb = new_swarm(|identity| { - super::rendezvous::Behaviour::new(identity, rendezvous_nodes) - }); + let mut asb = + new_swarm(|identity| super::rendezvous::Behaviour::new(identity, rendezvous_nodes)); asb.listen_on_random_memory_address().await; // this adds an external address let handle = tokio::spawn(async move { diff --git a/swap/src/cli.rs b/swap/src/cli.rs index d3f6f50d4..bb4e0e502 100644 --- a/swap/src/cli.rs +++ b/swap/src/cli.rs @@ -23,10 +23,15 @@ mod tests { use crate::network::rendezvous::XmrBtcNamespace; use crate::network::test::{new_swarm, SwarmExt}; use futures::StreamExt; + use libp2p::core::Endpoint; use libp2p::multiaddr::Protocol; - use libp2p::{identity, rendezvous, Multiaddr, PeerId, request_response}; + use libp2p::swarm::{ + ConnectionDenied, ConnectionId, FromSwarm, THandlerInEvent, THandlerOutEvent, ToSwarm, + }; + use libp2p::{identity, rendezvous, request_response, Multiaddr, PeerId}; use std::collections::HashSet; use std::iter::FromIterator; + use std::task::Poll; use std::time::Duration; #[tokio::test] @@ -85,10 +90,12 @@ mod tests { let rendezvous = asb::rendezvous::Behaviour::new(identity, vec![rendezvous_node]); StaticQuoteAsbBehaviour { - rendezvous, - quote: quote::asb(), - // static_quote, - // registered: false, + inner: StaticQuoteAsbBehaviourInner { + rendezvous, + quote: quote::asb(), + }, + static_quote, + registered: false, } }); @@ -116,51 +123,139 @@ mod tests { } #[derive(libp2p::swarm::NetworkBehaviour)] - struct StaticQuoteAsbBehaviour { + struct StaticQuoteAsbBehaviourInner { rendezvous: asb::rendezvous::Behaviour, quote: quote::Behaviour, + } - // TODO(Libp2p Migration): Support for this macro attribute has been removed: https://github.com/libp2p/rust-libp2p/pull/2842 - // We need to find a way to ignore this field, put it somewhere else - #[behaviour(ignore)] + struct StaticQuoteAsbBehaviour { + inner: StaticQuoteAsbBehaviourInner, static_quote: BidQuote, - #[behaviour(ignore)] registered: bool, } - impl NetworkBehaviourEventProcess for StaticQuoteAsbBehaviour { - fn inject_event(&mut self, event: rendezvous::client::Event) { - if let rendezvous::client::Event::Registered { .. } = event { - self.registered = true; - } + + impl libp2p::swarm::NetworkBehaviour for StaticQuoteAsbBehaviour { + type ConnectionHandler = + ::ConnectionHandler; + type ToSwarm = ::ToSwarm; + + fn handle_established_inbound_connection( + &mut self, + connection_id: ConnectionId, + peer: PeerId, + local_addr: &Multiaddr, + remote_addr: &Multiaddr, + ) -> Result, ConnectionDenied> { + self.inner.handle_established_inbound_connection( + connection_id, + peer, + local_addr, + remote_addr, + ) } - } - impl NetworkBehaviourEventProcess for StaticQuoteAsbBehaviour { - fn inject_event(&mut self, _: libp2p::ping::Event) {} - } + fn handle_established_outbound_connection( + &mut self, + connection_id: ConnectionId, + peer: PeerId, + addr: &Multiaddr, + role_override: Endpoint, + ) -> Result, ConnectionDenied> { + self.inner.handle_established_outbound_connection( + connection_id, + peer, + addr, + role_override, + ) + } - impl NetworkBehaviourEventProcess for StaticQuoteAsbBehaviour { - fn inject_event(&mut self, event: quote::OutEvent) { - if let request_response::Event::Message { - message: quote::Message::Request { channel, .. }, - .. - } = event - { - self.quote - .send_response(channel, self.static_quote) - .unwrap(); + fn on_swarm_event(&mut self, event: FromSwarm) { + self.inner.on_swarm_event(event); + } + + fn on_connection_handler_event( + &mut self, + peer_id: PeerId, + connection_id: ConnectionId, + event: THandlerOutEvent, + ) { + self.inner + .on_connection_handler_event(peer_id, connection_id, event); + } + + fn poll( + &mut self, + cx: &mut std::task::Context<'_>, + ) -> Poll>> { + match self.inner.poll(cx) { + Poll::Ready(ToSwarm::GenerateEvent(event)) => match event { + StaticQuoteAsbBehaviourInnerEvent::Rendezvous(rendezvous_event) => { + if let rendezvous::client::Event::Registered { .. } = rendezvous_event { + self.registered = true; + return Poll::Pending; + } + Poll::Ready(ToSwarm::GenerateEvent( + StaticQuoteAsbBehaviourInnerEvent::Rendezvous(rendezvous_event), + )) + } + StaticQuoteAsbBehaviourInnerEvent::Quote(quote_event) => { + if let request_response::Event::Message { + message: quote::Message::Request { channel, .. }, + .. + } = quote_event + { + self.inner + .quote + .send_response(channel, self.static_quote) + .unwrap(); + + return Poll::Pending; + } + + Poll::Ready(ToSwarm::GenerateEvent( + StaticQuoteAsbBehaviourInnerEvent::Quote(quote_event), + )) + } + }, + other => other, } } } + // impl NetworkBehaviourEventProcess for StaticQuoteAsbBehaviour { + // fn inject_event(&mut self, event: rendezvous::client::Event) { + // if let rendezvous::client::Event::Registered { .. } = event { + // self.registered = true; + // } + // } + // } + + // impl NetworkBehaviourEventProcess for StaticQuoteAsbBehaviour { + // fn inject_event(&mut self, _: libp2p::ping::Event) {} + // } + + // impl NetworkBehaviourEventProcess for StaticQuoteAsbBehaviour { + // fn inject_event(&mut self, event: quote::OutEvent) { + // if let request_response::Event::Message { + // message: quote::Message::Request { channel, .. }, + // .. + // } = event + // { + // self.quote + // .send_response(channel, self.static_quote) + // .unwrap(); + // } + // } + // } + #[derive(libp2p::swarm::NetworkBehaviour)] struct RendezvousPointBehaviour { rendezvous: rendezvous::server::Behaviour, } - impl NetworkBehaviourEventProcess for RendezvousPointBehaviour { - fn inject_event(&mut self, _: rendezvous::server::Event) {} - } + // impl NetworkBehaviourEventProcess for RendezvousPointBehaviour { + // fn inject_event(&mut self, _: rendezvous::server::Event) {} + // } impl Default for RendezvousPointBehaviour { fn default() -> Self { diff --git a/swap/src/network/cooperative_xmr_redeem_after_punish.rs b/swap/src/network/cooperative_xmr_redeem_after_punish.rs index dedb56193..5215297ed 100644 --- a/swap/src/network/cooperative_xmr_redeem_after_punish.rs +++ b/swap/src/network/cooperative_xmr_redeem_after_punish.rs @@ -3,8 +3,8 @@ use crate::{asb, cli}; use libp2p::request_response::ProtocolSupport; use libp2p::{request_response, PeerId, StreamProtocol}; use serde::{Deserialize, Serialize}; -use uuid::Uuid; use std::time::Duration; +use uuid::Uuid; const PROTOCOL: &str = "/comit/xmr/btc/cooperative_xmr_redeem_after_punish/1.0.0"; type OutEvent = request_response::Event; diff --git a/swap/src/network/encrypted_signature.rs b/swap/src/network/encrypted_signature.rs index 182858cde..ffd835a48 100644 --- a/swap/src/network/encrypted_signature.rs +++ b/swap/src/network/encrypted_signature.rs @@ -2,8 +2,8 @@ use crate::{asb, cli}; use libp2p::request_response::{self}; use libp2p::{PeerId, StreamProtocol}; use serde::{Deserialize, Serialize}; -use uuid::Uuid; use std::time::Duration; +use uuid::Uuid; const PROTOCOL: &str = "/comit/xmr/btc/encrypted_signature/1.0.0"; type OutEvent = request_response::Event; diff --git a/swap/src/network/quote.rs b/swap/src/network/quote.rs index 05bc706c2..2ade99611 100644 --- a/swap/src/network/quote.rs +++ b/swap/src/network/quote.rs @@ -7,8 +7,8 @@ use serde::{Deserialize, Serialize}; use typeshare::typeshare; const PROTOCOL: &str = "/comit/xmr/btc/bid-quote/1.0.0"; -pub(crate) type OutEvent = request_response::Event<(), BidQuote>; -type Message = request_response::Message<(), BidQuote>; +pub type OutEvent = request_response::Event<(), BidQuote>; +pub type Message = request_response::Message<(), BidQuote>; pub type Behaviour = request_response::json::Behaviour<(), BidQuote>; diff --git a/swap/src/network/swap_setup/bob.rs b/swap/src/network/swap_setup/bob.rs index 9cb59a6b8..6499990fe 100644 --- a/swap/src/network/swap_setup/bob.rs +++ b/swap/src/network/swap_setup/bob.rs @@ -55,10 +55,10 @@ impl NetworkBehaviour for Behaviour { fn handle_established_inbound_connection( &mut self, - connection_id: ConnectionId, - peer: PeerId, - local_addr: &Multiaddr, - remote_addr: &Multiaddr, + _connection_id: ConnectionId, + _peer: PeerId, + _local_addr: &Multiaddr, + _remote_addr: &Multiaddr, ) -> Result, ConnectionDenied> { // TODO(Libp2p Migration): Is this correct? unreachable!("Bob does not support inbound connections") @@ -66,10 +66,10 @@ impl NetworkBehaviour for Behaviour { fn handle_established_outbound_connection( &mut self, - connection_id: ConnectionId, - peer: PeerId, - addr: &Multiaddr, - role_override: libp2p::core::Endpoint, + _connection_id: ConnectionId, + _peer: PeerId, + _addr: &Multiaddr, + _role_override: libp2p::core::Endpoint, ) -> Result, ConnectionDenied> { Ok(Handler::new(self.env_config, self.bitcoin_wallet.clone())) } @@ -93,9 +93,9 @@ impl NetworkBehaviour for Behaviour { fn poll( &mut self, - cx: &mut Context<'_>, + _cx: &mut Context<'_>, ) -> Poll>> { - if let Some((peer, completed)) = self.completed_swaps.pop_front() { + if let Some((_peer, completed)) = self.completed_swaps.pop_front() { return Poll::Ready(ToSwarm::GenerateEvent(completed)); } @@ -181,9 +181,6 @@ impl ConnectionHandler for Handler { let bitcoin_wallet = self.bitcoin_wallet.clone(); let env_config = self.env_config; - let bitcoin_wallet = self.bitcoin_wallet.clone(); - let env_config = self.env_config; - let protocol = tokio::time::timeout(self.timeout, async move { write_cbor_message( &mut substream, diff --git a/swap/src/network/test.rs b/swap/src/network/test.rs index 71f2d538e..1aba14684 100644 --- a/swap/src/network/test.rs +++ b/swap/src/network/test.rs @@ -1,30 +1,19 @@ use async_trait::async_trait; -use futures::stream::FusedStream; -use futures::{future, Future, StreamExt}; +use futures::StreamExt; use libp2p::core::muxing::StreamMuxerBox; use libp2p::core::transport::upgrade::Version; use libp2p::core::transport::MemoryTransport; -use libp2p::core::{Multiaddr, PeerId, Transport}; +use libp2p::core::{Multiaddr, Transport}; use libp2p::identity; use libp2p::noise; -use libp2p::swarm::{Executor, NetworkBehaviour, Swarm, SwarmEvent}; -use libp2p::tcp::Config as TokioTcpConfig; +use libp2p::swarm::dial_opts::DialOpts; +use libp2p::swarm::{NetworkBehaviour, Swarm, SwarmEvent}; +use libp2p::tcp; use libp2p::yamux; use libp2p::SwarmBuilder; use std::fmt::Debug; -use std::pin::Pin; use std::time::Duration; -/// An adaptor struct for libp2p that spawns futures into the current -/// thread-local runtime. -struct GlobalSpawnTokioExecutor; - -impl Executor for GlobalSpawnTokioExecutor { - fn exec(&self, future: Pin + Send>>) { - tokio::spawn(future); - } -} - pub fn new_swarm(behaviour_fn: F) -> Swarm where B: NetworkBehaviour, @@ -33,11 +22,11 @@ where F: FnOnce(identity::Keypair) -> B, { let identity = identity::Keypair::generate_ed25519(); - let peer_id = PeerId::from(identity.public()); - let noise = noise::Config::new(&identity)?; + let noise = noise::Config::new(&identity).unwrap(); + let tcp = tcp::tokio::Transport::new(tcp::Config::new()); let transport = MemoryTransport::new() - .or_transport(TokioTcpConfig::new()) + .or_transport(tcp) .upgrade(Version::V1) .authenticate(noise) .multiplex(yamux::Config::default()) @@ -46,10 +35,11 @@ where .boxed(); SwarmBuilder::with_existing_identity(identity) - .with_executor(Box::new(GlobalSpawnTokioExecutor)) - .with_other_transport(|_| transport) - .with_behaviour(|keypair| behaviour_fn(keypair.clone())) - .with_swarm_config(|cfg| cfg.with_idle_connection_timeout(Duration::MAX)) + .with_tokio() + .with_other_transport(|_| Ok(transport)) + .unwrap() + .with_behaviour(|keypair| Ok(behaviour_fn(keypair.clone()))) + .unwrap() .build() } @@ -78,7 +68,7 @@ pub trait SwarmExt { /// until the connection is established. async fn block_on_connection(&mut self, other: &mut Swarm) where - T: NetworkBehaviour, + T: NetworkBehaviour + Send, ::ToSwarm: Debug; /// Listens on a random memory address, polling the [`Swarm`] until the @@ -93,18 +83,24 @@ pub trait SwarmExt { #[async_trait] impl SwarmExt for Swarm where - B: NetworkBehaviour, + B: NetworkBehaviour + Send, ::ToSwarm: Debug, { async fn block_on_connection(&mut self, other: &mut Swarm) where - T: NetworkBehaviour, + T: NetworkBehaviour + Send, ::ToSwarm: Debug, { - let addr_to_dial = other.external_addresses().next().unwrap().addr.clone(); + let addr_to_dial = other.external_addresses().next().unwrap().clone(); let local_peer_id = *other.local_peer_id(); - self.dial(addr_to_dial).unwrap(); + self.dial( + DialOpts::peer_id(local_peer_id) + .addresses(vec![addr_to_dial]) + .extend_addresses_through_behaviour() + .build(), + ) + .unwrap(); let mut dialer_done = false; let mut listener_done = false; @@ -118,7 +114,7 @@ where SwarmEvent::ConnectionEstablished { .. } => { dialer_done = true; } - SwarmEvent::OutgoingConnectionError { peer_id, error } if matches!(peer_id, Some(alice_peer_id) if alice_peer_id == local_peer_id) => { + SwarmEvent::OutgoingConnectionError { peer_id, error, .. } if matches!(peer_id, Some(alice_peer_id) if alice_peer_id == local_peer_id) => { panic!("Failed to dial address {}: {}", peer_id.unwrap(), error) } other => { From a8ea94a66d5cb53f2c3b2f17d848c8e641b9e407 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Tue, 29 Oct 2024 01:07:19 +0100 Subject: [PATCH 055/112] feat(libp2p): Send request response error through MSCP channel to invoker This commit changes the event loop such that errors in the request response protocol are send through the MSCP to the code that invoked the request This allows the invoker to catch a failure and retry if needed We also make some changes to the way the transfer proof buffering works: - Once we receive a request to send a transfer proof to a peer, we check if we are connected - If we are connected, we try to send the transfer proof. If the request fails (e.g timeout) that error is propogated through the MSCP channel to the invoker - If we are not connected, we add the transfer proof to the buffered_transfer_proof list - When we connect to a peer, we check if we have a buffered transfer proof and if so we try to send the proof by appending it to the queue --- swap/src/asb/event_loop.rs | 65 +++++++++++++++++----- swap/src/asb/network.rs | 13 ++++- swap/src/cli/behaviour.rs | 14 ++++- swap/src/network/impl_from_rr_event.rs | 76 ++++++-------------------- swap/src/network/transfer_proof.rs | 3 +- 5 files changed, 95 insertions(+), 76 deletions(-) diff --git a/swap/src/asb/event_loop.rs b/swap/src/asb/event_loop.rs index 81f1e065a..0e5f4cbe9 100644 --- a/swap/src/asb/event_loop.rs +++ b/swap/src/asb/event_loop.rs @@ -8,11 +8,11 @@ use crate::network::transfer_proof; use crate::protocol::alice::{AliceState, State3, Swap}; use crate::protocol::{Database, State}; use crate::{bitcoin, env, kraken, monero}; -use anyhow::{Context, Result}; +use anyhow::{anyhow, Context, Result}; use futures::future; use futures::future::{BoxFuture, FutureExt}; use futures::stream::{FuturesUnordered, StreamExt}; -use libp2p::request_response::{OutboundRequestId, ResponseChannel}; +use libp2p::request_response::{OutboundFailure, OutboundRequestId, ResponseChannel}; use libp2p::swarm::SwarmEvent; use libp2p::{PeerId, Swarm}; use rust_decimal::Decimal; @@ -30,8 +30,14 @@ use uuid::Uuid; /// the peer identified by the `PeerId`. Once the request has been acknowledged /// by the peer, i.e. a `()` response has been received, the `Responder` shall /// be used to let the original sender know about the successful transfer. -type OutgoingTransferProof = - BoxFuture<'static, Result<(PeerId, transfer_proof::Request, bmrng::Responder<()>)>>; +type OutgoingTransferProof = BoxFuture< + 'static, + Result<( + PeerId, + transfer_proof::Request, + bmrng::Responder>, + )>, +>; #[allow(missing_debug_implementations)] pub struct EventLoop @@ -58,11 +64,12 @@ where /// Tracks [`transfer_proof::Request`]s which could not yet be sent because /// we are currently disconnected from the peer. - buffered_transfer_proofs: HashMap)>>, + buffered_transfer_proofs: HashMap>)>>, /// Tracks [`transfer_proof::Request`]s which are currently inflight and /// awaiting an acknowledgement. - inflight_transfer_proofs: HashMap>, + inflight_transfer_proofs: + HashMap>>, } impl EventLoop @@ -202,7 +209,7 @@ where SwarmEvent::Behaviour(OutEvent::TransferProofAcknowledged { peer, id }) => { tracing::debug!(%peer, "Bob acknowledged transfer proof"); if let Some(responder) = self.inflight_transfer_proofs.remove(&id) { - let _ = responder.respond(()); + let _ = responder.respond(Ok(())); } } SwarmEvent::Behaviour(OutEvent::EncryptedSignatureReceived{ msg, channel, peer }) => { @@ -313,6 +320,24 @@ where SwarmEvent::Behaviour(OutEvent::Rendezvous(libp2p::rendezvous::client::Event::RegisterFailed { rendezvous_node, namespace, error })) => { tracing::error!("Registration with rendezvous node {} failed for namespace {}: {:?}", rendezvous_node, namespace, error); } + SwarmEvent::Behaviour(OutEvent::OutboundRequestResponseFailure {peer, error, request_id}) => { + tracing::error!( + %peer, + %request_id, + %error, + "Failed to send request to peer"); + + if let Some(responder) = self.inflight_transfer_proofs.remove(&request_id) { + let _ = responder.respond(Err(error)); + } + } + SwarmEvent::Behaviour(OutEvent::InboundRequestResponseFailure {peer, error, request_id}) => { + tracing::error!( + %peer, + %request_id, + %error, + "Failed to receive request from peer"); + } SwarmEvent::Behaviour(OutEvent::Failure {peer, error}) => { tracing::error!( %peer, @@ -325,8 +350,11 @@ where for (transfer_proof, responder) in transfer_proofs { tracing::debug!(%peer, "Found buffered transfer proof for peer"); - let id = self.swarm.behaviour_mut().transfer_proof.send_request(&peer, transfer_proof); - self.inflight_transfer_proofs.insert(id, responder); + // Once we have a connection, we can append the transfer proof to the stream + // + self.send_transfer_proof.push(async move { + Ok((peer, transfer_proof, responder)) + }.boxed()); } } } @@ -562,7 +590,8 @@ impl LatestRate for KrakenRate { #[derive(Debug)] pub struct EventLoopHandle { recv_encrypted_signature: Option>, - send_transfer_proof: Option>, + send_transfer_proof: + Option>>, } impl EventLoopHandle { @@ -582,14 +611,20 @@ impl EventLoopHandle { } pub async fn send_transfer_proof(&mut self, msg: monero::TransferProof) -> Result<()> { - self.send_transfer_proof - .take() - .context("Transfer proof was already sent")? + let sender = self + .send_transfer_proof + .as_ref() + .context("Transfer proof was already sent")?; + + let result = sender .send_receive(msg) .await - .context("Failed to send transfer proof")?; + .context("Failed to send transfer proof")? + .map_err(|e| anyhow!(e))?; + + self.send_transfer_proof.take(); - Ok(()) + Ok(result) } } diff --git a/swap/src/asb/network.rs b/swap/src/asb/network.rs index 9b9e44400..b412a8a81 100644 --- a/swap/src/asb/network.rs +++ b/swap/src/asb/network.rs @@ -37,7 +37,8 @@ pub mod transport { pub mod behaviour { use libp2p::{ - identify, identity, ping, request_response::OutboundRequestId, + identify, identity, ping, + request_response::{InboundFailure, InboundRequestId, OutboundFailure, OutboundRequestId}, swarm::behaviour::toggle::Toggle, }; @@ -77,6 +78,16 @@ pub mod behaviour { peer: PeerId, }, Rendezvous(libp2p::rendezvous::client::Event), + OutboundRequestResponseFailure { + peer: PeerId, + error: OutboundFailure, + request_id: OutboundRequestId, + }, + InboundRequestResponseFailure { + peer: PeerId, + error: InboundFailure, + request_id: InboundRequestId, + }, Failure { peer: PeerId, error: Error, diff --git a/swap/src/cli/behaviour.rs b/swap/src/cli/behaviour.rs index 5d3a06fc1..6c8b204a7 100644 --- a/swap/src/cli/behaviour.rs +++ b/swap/src/cli/behaviour.rs @@ -10,7 +10,9 @@ use crate::protocol::bob::State2; use crate::{bitcoin, env}; use anyhow::{anyhow, Error, Result}; use libp2p::core::Multiaddr; -use libp2p::request_response::{OutboundRequestId, ResponseChannel}; +use libp2p::request_response::{ + InboundFailure, InboundRequestId, OutboundFailure, OutboundRequestId, ResponseChannel, +}; use libp2p::swarm::NetworkBehaviour; use libp2p::{identify, identity, ping, PeerId}; use std::sync::Arc; @@ -48,6 +50,16 @@ pub enum OutEvent { peer: PeerId, error: Error, }, + OutboundRequestResponseFailure { + peer: PeerId, + error: OutboundFailure, + request_id: OutboundRequestId, + }, + InboundRequestResponseFailure { + peer: PeerId, + error: InboundFailure, + request_id: InboundRequestId, + }, /// "Fallback" variant that allows the event mapping code to swallow certain /// events that we don't want the caller to deal with. Other, diff --git a/swap/src/network/impl_from_rr_event.rs b/swap/src/network/impl_from_rr_event.rs index 907bd944c..6a68fea82 100644 --- a/swap/src/network/impl_from_rr_event.rs +++ b/swap/src/network/impl_from_rr_event.rs @@ -9,70 +9,30 @@ macro_rules! impl_from_rr_event { impl From<$protocol_event> for $behaviour_out_event { fn from(event: $protocol_event) -> Self { use ::libp2p::request_response::Event::*; - use anyhow::anyhow; match event { Message { message, peer, .. } => Self::from((peer, message)), ResponseSent { .. } => Self::Other, - InboundFailure { peer, error, .. } => { - use libp2p::request_response::InboundFailure::*; - - match error { - Timeout => { - Self::Failure { - error: anyhow!("{} failed because of an inbound timeout", $protocol), - peer, - } - } - ConnectionClosed => { - Self::Failure { - error: anyhow!("{} failed because the connection was closed before a response could be sent", $protocol), - peer, - } - } - Io(err) => { - Self::Failure { - error: anyhow!("{} failed because of an IO error: {}", $protocol, err), - peer, - } - } - UnsupportedProtocols => Self::Other, // TODO: Report this and disconnected / ban the peer? - ResponseOmission => Self::Other, - } - } - OutboundFailure { peer, error, .. } => { - use libp2p::request_response::OutboundFailure::*; - - match error { - Timeout => { - Self::Failure { - error: anyhow!("{} failed because we did not receive a response within the configured timeout", $protocol), - peer, - } - } - ConnectionClosed => { - Self::Failure { - error: anyhow!("{} failed because the connection was closed we received a response", $protocol), - peer, - } - } - UnsupportedProtocols => Self::Other, // TODO: Report this and disconnected / ban the peer? - DialFailure => { - Self::Failure { - error: anyhow!("{} failed because we failed to dial", $protocol), - peer, - } - } - Io(err) => { - Self::Failure { - error: anyhow!("{} failed because of an IO error: {}", $protocol, err), - peer, - } - } - } + InboundFailure { + peer, + error, + request_id, + } => Self::InboundRequestResponseFailure { + peer, + error, + request_id, + }, + OutboundFailure { + peer, + error, + request_id, + } => Self::OutboundRequestResponseFailure { + peer, + error, + request_id, }, } } } - } + }; } diff --git a/swap/src/network/transfer_proof.rs b/swap/src/network/transfer_proof.rs index 83cf52c44..15850359c 100644 --- a/swap/src/network/transfer_proof.rs +++ b/swap/src/network/transfer_proof.rs @@ -1,7 +1,7 @@ use std::time::Duration; use crate::{asb, cli, monero}; -use libp2p::request_response::{self, ProtocolSupport}; +use libp2p::request_response::{self, OutboundFailure, OutboundRequestId, ProtocolSupport}; use libp2p::{PeerId, StreamProtocol}; use serde::{Deserialize, Serialize}; use uuid::Uuid; @@ -52,6 +52,7 @@ impl From<(PeerId, Message)> for asb::OutEvent { } } } + crate::impl_from_rr_event!(OutEvent, asb::OutEvent, PROTOCOL); impl From<(PeerId, Message)> for cli::OutEvent { From d930ec667a6b2fb3e5442ee96b24d33cd5ace810 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Tue, 29 Oct 2024 01:13:49 +0100 Subject: [PATCH 056/112] docs: add some comments about the transfer proof buffering logic --- swap/src/asb/event_loop.rs | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/swap/src/asb/event_loop.rs b/swap/src/asb/event_loop.rs index 0e5f4cbe9..b5dbfc1b7 100644 --- a/swap/src/asb/event_loop.rs +++ b/swap/src/asb/event_loop.rs @@ -60,11 +60,22 @@ where recv_encrypted_signature: HashMap>, inflight_encrypted_signatures: FuturesUnordered>>, + /// Tracks [`transfer_proof::Request`]s which are in queue to be sent to a peer. + /// The future resolves to a tuple of `PeerId`, `transfer_proof::Request` and `Responder`. + /// The `PeerId` is the peer to which the request shall be sent, the `transfer_proof::Request` + /// is the request itself and the `Responder` is used to let the original sender know about + /// the success or failure of the transfer. send_transfer_proof: FuturesUnordered, /// Tracks [`transfer_proof::Request`]s which could not yet be sent because /// we are currently disconnected from the peer. - buffered_transfer_proofs: HashMap>)>>, + buffered_transfer_proofs: HashMap< + PeerId, + Vec<( + transfer_proof::Request, + bmrng::Responder>, + )>, + >, /// Tracks [`transfer_proof::Request`]s which are currently inflight and /// awaiting an acknowledgement. @@ -346,12 +357,14 @@ where SwarmEvent::ConnectionEstablished { peer_id: peer, endpoint, .. } => { tracing::debug!(%peer, address = %endpoint.get_remote_address(), "New connection established"); + // If we have buffered transfer proofs for this peer, we can now send them if let Some(transfer_proofs) = self.buffered_transfer_proofs.remove(&peer) { for (transfer_proof, responder) in transfer_proofs { tracing::debug!(%peer, "Found buffered transfer proof for peer"); - // Once we have a connection, we can append the transfer proof to the stream - // + // Once we have a connection, we can append transfer proof to the queue + // This is then polled in the next iteration of the event loop + // and attempted to be sent to the peer self.send_transfer_proof.push(async move { Ok((peer, transfer_proof, responder)) }.boxed()); @@ -376,12 +389,15 @@ where next_transfer_proof = self.send_transfer_proof.next() => { match next_transfer_proof { Some(Ok((peer, transfer_proof, responder))) => { + // If we are not connected to the peer, we buffer the transfer proof + // We remove the transfer proof from the queue (send_transfer_proof), and append it buffered_transfer_proofs if !self.swarm.behaviour_mut().transfer_proof.is_connected(&peer) { tracing::warn!(%peer, "No active connection to peer, buffering transfer proof"); self.buffered_transfer_proofs.entry(peer).or_default().push((transfer_proof, responder)); continue; } + // If we are connected to the peer, we attempt to send the transfer proof let id = self.swarm.behaviour_mut().transfer_proof.send_request(&peer, transfer_proof); self.inflight_transfer_proofs.insert(id, responder); }, From e3c48845bed6d7bc2cfa36f1fa378490b5282e95 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Tue, 29 Oct 2024 11:53:44 +0100 Subject: [PATCH 057/112] feat(asb): Retry sending transfer proof indefinitely --- swap/Cargo.toml | 2 +- swap/src/asb/event_loop.rs | 33 +++++++++++++++++++++++++++------ swap/src/cli/event_loop.rs | 1 + 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/swap/Cargo.toml b/swap/Cargo.toml index efb027fad..091672532 100644 --- a/swap/Cargo.toml +++ b/swap/Cargo.toml @@ -22,7 +22,7 @@ base64 = "0.22" bdk = "0.28" big-bytes = "1" bitcoin = { version = "0.29", features = [ "rand", "serde" ] } -bmrng = "0.5" +bmrng = "0.5.2" comfy-table = "7.1" config = { version = "0.14", default-features = false, features = [ "toml" ] } conquer-once = "0.4" diff --git a/swap/src/asb/event_loop.rs b/swap/src/asb/event_loop.rs index b5dbfc1b7..bef02b949 100644 --- a/swap/src/asb/event_loop.rs +++ b/swap/src/asb/event_loop.rs @@ -20,6 +20,7 @@ use std::collections::HashMap; use std::convert::{Infallible, TryInto}; use std::fmt::Debug; use std::sync::Arc; +use std::time::Duration; use tokio::sync::mpsc; use uuid::Uuid; @@ -61,7 +62,7 @@ where inflight_encrypted_signatures: FuturesUnordered>>, /// Tracks [`transfer_proof::Request`]s which are in queue to be sent to a peer. - /// The future resolves to a tuple of `PeerId`, `transfer_proof::Request` and `Responder`. + /// The future resolves to a tuple of [`PeerId`], [`transfer_proof::Request`] and [`Responder`]. /// The `PeerId` is the peer to which the request shall be sent, the `transfer_proof::Request` /// is the request itself and the `Responder` is used to let the original sender know about /// the success or failure of the transfer. @@ -69,6 +70,8 @@ where /// Tracks [`transfer_proof::Request`]s which could not yet be sent because /// we are currently disconnected from the peer. + /// + /// If we are not connected to the peer, the transfer proof is essentially moved from [`send_transfer_proof`] to here. buffered_transfer_proofs: HashMap< PeerId, Vec<( @@ -632,11 +635,29 @@ impl EventLoopHandle { .as_ref() .context("Transfer proof was already sent")?; - let result = sender - .send_receive(msg) - .await - .context("Failed to send transfer proof")? - .map_err(|e| anyhow!(e))?; + // We will retry indefinitely until we succeed + let backoff = backoff::ExponentialBackoffBuilder::new() + .with_max_elapsed_time(None) + .with_max_interval(Duration::from_secs(60)) + .build(); + + let result = backoff::future::retry(backoff, || async { + match sender.send_receive(msg.clone()).await { + Ok(Ok(_)) => Ok(()), + Ok(Err(err)) => { + // We encountered a libp2p error and failed to send the message + tracing::warn!(%err, "Failed to send transfer proof due to a network error. We will retry"); + Err(backoff::Error::transient(anyhow::anyhow!(err))) + } + Err(err) => { + // The MSCP channel has failed + // TODO(Libp2p Migration): Can we even retry here? Pointless? + tracing::error!(%err, "Failed to send transfer proof due to error in MSCP channel. We will retry"); + Err(backoff::Error::transient(anyhow::anyhow!(err))) + } + } + }) + .await?; self.send_transfer_proof.take(); diff --git a/swap/src/cli/event_loop.rs b/swap/src/cli/event_loop.rs index 104758a12..77c7a24ba 100644 --- a/swap/src/cli/event_loop.rs +++ b/swap/src/cli/event_loop.rs @@ -298,6 +298,7 @@ impl EventLoopHandle { tracing::debug!("Requesting quote"); Ok(self.quote.send_receive(()).await?) } + pub async fn request_cooperative_xmr_redeem(&mut self, swap_id: Uuid) -> Result { Ok(self.cooperative_xmr_redeem.send_receive(swap_id).await?) } From 1b3e0da729f0caeda248eaa98e19992ce5d52dea Mon Sep 17 00:00:00 2001 From: binarybaron Date: Tue, 29 Oct 2024 12:03:35 +0100 Subject: [PATCH 058/112] feat(asb, cli): Retry sending encrypted signature --- swap/src/asb/event_loop.rs | 6 ++-- swap/src/cli.rs | 2 +- swap/src/cli/event_loop.rs | 53 +++++++++++++++++++++++++++++------ swap/src/protocol/bob/swap.rs | 6 ++-- 4 files changed, 53 insertions(+), 14 deletions(-) diff --git a/swap/src/asb/event_loop.rs b/swap/src/asb/event_loop.rs index bef02b949..12f90fb57 100644 --- a/swap/src/asb/event_loop.rs +++ b/swap/src/asb/event_loop.rs @@ -339,7 +339,7 @@ where %peer, %request_id, %error, - "Failed to send request to peer"); + "Failed to send request-response request to peer"); if let Some(responder) = self.inflight_transfer_proofs.remove(&request_id) { let _ = responder.respond(Err(error)); @@ -350,7 +350,7 @@ where %peer, %request_id, %error, - "Failed to receive request from peer"); + "Failed to receive request-response request from peer"); } SwarmEvent::Behaviour(OutEvent::Failure {peer, error}) => { tracing::error!( @@ -652,7 +652,7 @@ impl EventLoopHandle { Err(err) => { // The MSCP channel has failed // TODO(Libp2p Migration): Can we even retry here? Pointless? - tracing::error!(%err, "Failed to send transfer proof due to error in MSCP channel. We will retry"); + tracing::error!(%err, "Failed to communicate transfer proof through event loop channel. We will retry"); Err(backoff::Error::transient(anyhow::anyhow!(err))) } } diff --git a/swap/src/cli.rs b/swap/src/cli.rs index bb4e0e502..a99202eb0 100644 --- a/swap/src/cli.rs +++ b/swap/src/cli.rs @@ -192,8 +192,8 @@ mod tests { StaticQuoteAsbBehaviourInnerEvent::Rendezvous(rendezvous_event) => { if let rendezvous::client::Event::Registered { .. } = rendezvous_event { self.registered = true; - return Poll::Pending; } + Poll::Ready(ToSwarm::GenerateEvent( StaticQuoteAsbBehaviourInnerEvent::Rendezvous(rendezvous_event), )) diff --git a/swap/src/cli/event_loop.rs b/swap/src/cli/event_loop.rs index 77c7a24ba..07ca67043 100644 --- a/swap/src/cli/event_loop.rs +++ b/swap/src/cli/event_loop.rs @@ -10,7 +10,7 @@ use crate::protocol::Database; use anyhow::{Context, Result}; use futures::future::{BoxFuture, OptionFuture}; use futures::{FutureExt, StreamExt}; -use libp2p::request_response::{OutboundRequestId, ResponseChannel}; +use libp2p::request_response::{OutboundFailure, OutboundRequestId, ResponseChannel}; use libp2p::swarm::dial_opts::DialOpts; use libp2p::swarm::SwarmEvent; use libp2p::{PeerId, Swarm}; @@ -29,14 +29,16 @@ pub struct EventLoop { // these streams represents outgoing requests that we have to make quote_requests: bmrng::RequestReceiverStream<(), BidQuote>, cooperative_xmr_redeem_requests: bmrng::RequestReceiverStream, - encrypted_signatures: bmrng::RequestReceiverStream, + encrypted_signatures: + bmrng::RequestReceiverStream>, swap_setup_requests: bmrng::RequestReceiverStream>, // these represents requests that are currently in-flight. // once we get a response to a matching [`RequestId`], we will use the responder to relay the // response. inflight_quote_requests: HashMap>, - inflight_encrypted_signature_requests: HashMap>, + inflight_encrypted_signature_requests: + HashMap>>, inflight_swap_setup: Option>>, inflight_cooperative_xmr_redeem_requests: HashMap>, @@ -179,7 +181,7 @@ impl EventLoop { } SwarmEvent::Behaviour(OutEvent::EncryptedSignatureAcknowledged { id }) => { if let Some(responder) = self.inflight_encrypted_signature_requests.remove(&id) { - let _ = responder.respond(()); + let _ = responder.respond(Ok(())); } } SwarmEvent::Behaviour(OutEvent::CooperativeXmrRedeemFulfilled { id, swap_id, s_a }) => { @@ -222,6 +224,24 @@ impl EventLoop { } } + SwarmEvent::Behaviour(OutEvent::OutboundRequestResponseFailure {peer, error, request_id}) => { + tracing::error!( + %peer, + %request_id, + %error, + "Failed to send request-response request to peer"); + + if let Some(responder) = self.inflight_encrypted_signature_requests.remove(&request_id) { + let _ = responder.respond(Err(error)); + } + } + SwarmEvent::Behaviour(OutEvent::InboundRequestResponseFailure {peer, error, request_id}) => { + tracing::error!( + %peer, + %request_id, + %error, + "Failed to receive request-response request from peer"); + } _ => {} } }, @@ -271,7 +291,7 @@ impl EventLoop { pub struct EventLoopHandle { swap_setup: bmrng::RequestSender>, transfer_proof: bmrng::RequestReceiver, - encrypted_signature: bmrng::RequestSender, + encrypted_signature: bmrng::RequestSender>, quote: bmrng::RequestSender<(), BidQuote>, cooperative_xmr_redeem: bmrng::RequestSender, } @@ -306,9 +326,26 @@ impl EventLoopHandle { pub async fn send_encrypted_signature( &mut self, tx_redeem_encsig: EncryptedSignature, - ) -> Result<(), bmrng::error::RequestError> { - self.encrypted_signature - .send_receive(tx_redeem_encsig) + ) -> Result<()> { + // We will retry indefinitely until we succeed + let backoff = backoff::ExponentialBackoffBuilder::new() + .with_max_elapsed_time(None) + .with_max_interval(Duration::from_secs(60)) + .build(); + + backoff::future::retry(backoff, || async { + match self.encrypted_signature.send_receive(tx_redeem_encsig.clone()).await { + Ok(Ok(_)) => Ok(()), + Ok(Err(err)) => { + tracing::warn!(%err, "Failed to send encrypted signature due to a network error. Will retry"); + Err(backoff::Error::transient(anyhow::anyhow!(err))) + } + Err(err) => { + tracing::error!(%err, "Failed to communicate encrypted signature through event loop channel. Will retry"); + Err(backoff::Error::transient(anyhow::anyhow!(err))) + } + } + }) .await } } diff --git a/swap/src/protocol/bob/swap.rs b/swap/src/protocol/bob/swap.rs index 04ad357d6..3b898924e 100644 --- a/swap/src/protocol/bob/swap.rs +++ b/swap/src/protocol/bob/swap.rs @@ -334,8 +334,10 @@ async fn next_state( result = event_loop_handle.send_encrypted_signature(state.tx_redeem_encsig()) => { match result { Ok(_) => BobState::EncSigSent(state), - Err(bmrng::error::RequestError::RecvError | bmrng::error::RequestError::SendError(_)) => bail!("Failed to communicate encrypted signature through event loop channel"), - Err(bmrng::error::RequestError::RecvTimeoutError) => unreachable!("We construct the channel with no timeout"), + Err(err) => { + tracing::error!(%err, "Failed to send encrypted signature to Alice"); + bail!("Failed to send encrypted signature to Alice"); + } } }, result = tx_lock_status.wait_until_confirmed_with(state.cancel_timelock) => { From 7ae58b137e6c7aa2e44874eac10bb7584ec3cd97 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Tue, 29 Oct 2024 14:45:23 +0100 Subject: [PATCH 059/112] fix(libp2p): Rename send_transfer_proof to outgoing_transfer_proof_queue --- swap/src/asb/event_loop.rs | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/swap/src/asb/event_loop.rs b/swap/src/asb/event_loop.rs index 12f90fb57..4f6778748 100644 --- a/swap/src/asb/event_loop.rs +++ b/swap/src/asb/event_loop.rs @@ -66,7 +66,7 @@ where /// The `PeerId` is the peer to which the request shall be sent, the `transfer_proof::Request` /// is the request itself and the `Responder` is used to let the original sender know about /// the success or failure of the transfer. - send_transfer_proof: FuturesUnordered, + outgoing_transfer_proof_queue: FuturesUnordered, /// Tracks [`transfer_proof::Request`]s which could not yet be sent because /// we are currently disconnected from the peer. @@ -117,7 +117,7 @@ where external_redeem_address, recv_encrypted_signature: Default::default(), inflight_encrypted_signatures: Default::default(), - send_transfer_proof: Default::default(), + outgoing_transfer_proof_queue: Default::default(), buffered_transfer_proofs: Default::default(), inflight_transfer_proofs: Default::default(), }; @@ -131,7 +131,7 @@ where pub async fn run(mut self) { // ensure that these streams are NEVER empty, otherwise it will // terminate forever. - self.send_transfer_proof.push(future::pending().boxed()); + self.outgoing_transfer_proof_queue.push(future::pending().boxed()); self.inflight_encrypted_signatures .push(future::pending().boxed()); @@ -368,7 +368,7 @@ where // Once we have a connection, we can append transfer proof to the queue // This is then polled in the next iteration of the event loop // and attempted to be sent to the peer - self.send_transfer_proof.push(async move { + self.outgoing_transfer_proof_queue.push(async move { Ok((peer, transfer_proof, responder)) }.boxed()); } @@ -389,7 +389,7 @@ where _ => {} } }, - next_transfer_proof = self.send_transfer_proof.next() => { + next_transfer_proof = self.outgoing_transfer_proof_queue.next() => { match next_transfer_proof { Some(Ok((peer, transfer_proof, responder))) => { // If we are not connected to the peer, we buffer the transfer proof @@ -437,7 +437,7 @@ where let xmr = Amount::from_piconero(balance.unlocked_balance); let max_bitcoin_for_monero = xmr.max_bitcoin_for_price(ask_price).ok_or_else(|| { - anyhow::anyhow!("Bitcoin price ({}) x Monero ({}) overflow", ask_price, xmr) + anyhow!("Bitcoin price ({}) x Monero ({}) overflow", ask_price, xmr) })?; tracing::debug!(%ask_price, %xmr, %max_bitcoin_for_monero); @@ -523,7 +523,7 @@ where self.recv_encrypted_signature .insert(swap_id, encrypted_signature.0); - self.send_transfer_proof.push( + self.outgoing_transfer_proof_queue.push( async move { let (transfer_proof, responder) = transfer_proof_receiver.recv().await?; @@ -539,7 +539,7 @@ where EventLoopHandle { recv_encrypted_signature: Some(encrypted_signature.1), - send_transfer_proof: Some(transfer_proof_sender), + transfer_proof_sender: Some(transfer_proof_sender), } } } @@ -609,7 +609,7 @@ impl LatestRate for KrakenRate { #[derive(Debug)] pub struct EventLoopHandle { recv_encrypted_signature: Option>, - send_transfer_proof: + transfer_proof_sender: Option>>, } @@ -631,7 +631,7 @@ impl EventLoopHandle { pub async fn send_transfer_proof(&mut self, msg: monero::TransferProof) -> Result<()> { let sender = self - .send_transfer_proof + .transfer_proof_sender .as_ref() .context("Transfer proof was already sent")?; @@ -647,19 +647,19 @@ impl EventLoopHandle { Ok(Err(err)) => { // We encountered a libp2p error and failed to send the message tracing::warn!(%err, "Failed to send transfer proof due to a network error. We will retry"); - Err(backoff::Error::transient(anyhow::anyhow!(err))) + Err(backoff::Error::transient(anyhow!(err))) } Err(err) => { // The MSCP channel has failed // TODO(Libp2p Migration): Can we even retry here? Pointless? tracing::error!(%err, "Failed to communicate transfer proof through event loop channel. We will retry"); - Err(backoff::Error::transient(anyhow::anyhow!(err))) + Err(backoff::Error::transient(anyhow!(err))) } } }) .await?; - self.send_transfer_proof.take(); + self.transfer_proof_sender.take(); Ok(result) } From f29b7ba874eff256264630e68df3f2a763107c90 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Wed, 30 Oct 2024 11:05:09 +0100 Subject: [PATCH 060/112] feat(cli, libp2p): Acknowledge transfer proof immediately if Bob has already processed it (according to state machine) --- swap/src/asb/event_loop.rs | 9 ++++---- swap/src/cli/event_loop.rs | 41 ++++++++++++++++++++++++++++++++--- swap/src/protocol/bob/swap.rs | 9 ++++++++ 3 files changed, 52 insertions(+), 7 deletions(-) diff --git a/swap/src/asb/event_loop.rs b/swap/src/asb/event_loop.rs index 4f6778748..1be8db16a 100644 --- a/swap/src/asb/event_loop.rs +++ b/swap/src/asb/event_loop.rs @@ -131,7 +131,8 @@ where pub async fn run(mut self) { // ensure that these streams are NEVER empty, otherwise it will // terminate forever. - self.outgoing_transfer_proof_queue.push(future::pending().boxed()); + self.outgoing_transfer_proof_queue + .push(future::pending().boxed()); self.inflight_encrypted_signatures .push(future::pending().boxed()); @@ -436,9 +437,9 @@ where // use unlocked monero balance for quote let xmr = Amount::from_piconero(balance.unlocked_balance); - let max_bitcoin_for_monero = xmr.max_bitcoin_for_price(ask_price).ok_or_else(|| { - anyhow!("Bitcoin price ({}) x Monero ({}) overflow", ask_price, xmr) - })?; + let max_bitcoin_for_monero = xmr + .max_bitcoin_for_price(ask_price) + .ok_or_else(|| anyhow!("Bitcoin price ({}) x Monero ({}) overflow", ask_price, xmr))?; tracing::debug!(%ask_price, %xmr, %max_bitcoin_for_monero); diff --git a/swap/src/cli/event_loop.rs b/swap/src/cli/event_loop.rs index 07ca67043..e953f0623 100644 --- a/swap/src/cli/event_loop.rs +++ b/swap/src/cli/event_loop.rs @@ -5,7 +5,8 @@ use crate::network::cooperative_xmr_redeem_after_punish::{Request, Response}; use crate::network::encrypted_signature; use crate::network::quote::BidQuote; use crate::network::swap_setup::bob::NewSwap; -use crate::protocol::bob::State2; +use crate::protocol::bob::swap::has_already_processed_transfer_proof; +use crate::protocol::bob::{BobState, State2}; use crate::protocol::Database; use anyhow::{Context, Result}; use futures::future::{BoxFuture, OptionFuture}; @@ -131,6 +132,29 @@ impl EventLoop { continue; } + // If we are in a state where it is clear that we have already processed the transfer proof, we will acknowledge it immediately + // We do this because, if Alice most likely did not receive the acknowledgment when we sent it before. + // Therefore, we will acknowledge the transfer proof immediately + if let Ok(state) = self.db.get_state(swap_id).await { + let state: BobState = state.try_into() + .expect("The CLI database only contains Bob states"); + + if has_already_processed_transfer_proof(&state) { + tracing::info!("Received transfer proof for swap {} in state {:?}. Acknowledging immediately.", swap_id, state); + + // We set this to a future that will resolve immediately, and returns the channel + // This will be resolved in the next iteration of the event loop, and a response will be sent to Alice + self.pending_transfer_proof = OptionFuture::from(Some(async move { + channel + }.boxed())); + + continue; + } + } else { + tracing::error!("Failed to retrieve state for swap {}. Ignoring transfer proof", swap_id); + continue; + } + let mut responder = match self.transfer_proof.send(msg.tx_lock_proof).await { Ok(responder) => responder, Err(e) => { @@ -267,9 +291,19 @@ impl EventLoop { }, Some(response_channel) = &mut self.pending_transfer_proof => { - let _ = self.swarm.behaviour_mut().transfer_proof.send_response(response_channel, ()); + if let Err(_) = self.swarm.behaviour_mut().transfer_proof.send_response(response_channel, ()) { + tracing::warn!("Failed to send transfer proof acknowledgment. We will retry in 10s"); + + // TOOD(Libp2p Migration): If we fail to respond we should send it again repeatedly until we succeed + + // self.pending_transfer_proof = OptionFuture::from(Some(async move { + // tokio::time::sleep(Duration::from_secs(10)).await; - self.pending_transfer_proof = OptionFuture::from(None); + // response_channel.clone() + // }.boxed())); + } else { + self.pending_transfer_proof = OptionFuture::from(None); + } }, Some((swap_id, responder)) = self.cooperative_xmr_redeem_requests.next().fuse(), if self.is_connected_to_alice() => { @@ -307,6 +341,7 @@ impl EventLoopHandle { .recv() .await .context("Failed to receive transfer proof")?; + responder .respond(()) .context("Failed to acknowledge receipt of transfer proof")?; diff --git a/swap/src/protocol/bob/swap.rs b/swap/src/protocol/bob/swap.rs index 3b898924e..d3281e165 100644 --- a/swap/src/protocol/bob/swap.rs +++ b/swap/src/protocol/bob/swap.rs @@ -19,6 +19,15 @@ pub fn is_complete(state: &BobState) -> bool { ) } +pub fn has_already_processed_transfer_proof(state: &BobState) -> bool { + // After the XmrLockProofReceived state, we have already processed the transfer proof + // This match statement MUST match all states before XmrLockProofReceived + !matches!( + state, + BobState::Started { .. } | BobState::SwapSetupCompleted { .. } | BobState::BtcLocked { .. } + ) +} + // Identifies states that should be run at most once before exiting. // This is used to prevent infinite retry loops while still allowing manual resumption. // From cccc0afdd17c4714e7247380d647c655b9aec135 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Wed, 30 Oct 2024 13:45:04 +0100 Subject: [PATCH 061/112] feat(asb): Listen for encrypted signature in XmrLocked state If we send Bob the transfer proof, but for whatever reason we do not receive an acknoledgement from him we would be stuck in this state forever (deadlock). By listening for the encrypted signature here we can still proceed to the next state even if Bob does not respond with an acknoledgement. --- swap/src/asb/event_loop.rs | 14 ++++++++------ swap/src/protocol/alice/swap.rs | 21 +++++++++++++++++++-- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/swap/src/asb/event_loop.rs b/swap/src/asb/event_loop.rs index 1be8db16a..c98d77c5a 100644 --- a/swap/src/asb/event_loop.rs +++ b/swap/src/asb/event_loop.rs @@ -616,17 +616,19 @@ pub struct EventLoopHandle { impl EventLoopHandle { pub async fn recv_encrypted_signature(&mut self) -> Result { - let (tx_redeem_encsig, responder) = self - .recv_encrypted_signature - .take() - .context("Encrypted signature was already received")? - .recv() - .await?; + let receiver = self.recv_encrypted_signature + .as_mut() + .context("Encrypted signature was already received")?; + + let (tx_redeem_encsig, responder) = receiver.recv().await?; responder .respond(()) .context("Failed to acknowledge receipt of encrypted signature")?; + // Only take after successful receipt and acknowledgement + self.recv_encrypted_signature.take(); + Ok(tx_redeem_encsig) } diff --git a/swap/src/protocol/alice/swap.rs b/swap/src/protocol/alice/swap.rs index 792365639..90d2a3271 100644 --- a/swap/src/protocol/alice/swap.rs +++ b/swap/src/protocol/alice/swap.rs @@ -165,8 +165,11 @@ where } => { let tx_lock_status = bitcoin_wallet.subscribe_to(state3.tx_lock.clone()).await; + let send_transfer_proof = event_loop_handle.send_transfer_proof(transfer_proof.clone()); + let recv_encrypted_signature = event_loop_handle.recv_encrypted_signature(); + tokio::select! { - result = event_loop_handle.send_transfer_proof(transfer_proof.clone()) => { + result = send_transfer_proof => { result?; AliceState::XmrLockTransferProofSent { @@ -175,6 +178,21 @@ where state3, } }, + // Why are we already receiving the encrypted signature here? + // + // If we send Bob the transfer proof, but for whatever reason we do not receive an acknoledgement from him + // we would be stuck in this state forever (deadlock). By listening for the encrypted signature here we + // can still proceed to the next state even if Bob does not respond with an acknoledgement. + enc_sig = recv_encrypted_signature => { + tracing::info!("Received encrypted signature"); + + AliceState::EncSigLearned { + monero_wallet_restore_blockheight, + transfer_proof, + encrypted_signature: Box::new(enc_sig?), + state3, + } + } result = tx_lock_status.wait_until_confirmed_with(state3.cancel_timelock) => { result?; AliceState::CancelTimelockExpired { @@ -194,7 +212,6 @@ where select! { biased; // make sure the cancel timelock expiry future is polled first - result = tx_lock_status.wait_until_confirmed_with(state3.cancel_timelock) => { result?; AliceState::CancelTimelockExpired { From 7f48045420abbbf2eb0570bdfb2a154ad0a6c09d Mon Sep 17 00:00:00 2001 From: binarybaron Date: Wed, 30 Oct 2024 14:53:29 +0100 Subject: [PATCH 062/112] fix: comment out compiler error --- swap/src/protocol/alice/swap.rs | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/swap/src/protocol/alice/swap.rs b/swap/src/protocol/alice/swap.rs index 90d2a3271..a8e7d8d1f 100644 --- a/swap/src/protocol/alice/swap.rs +++ b/swap/src/protocol/alice/swap.rs @@ -166,7 +166,6 @@ where let tx_lock_status = bitcoin_wallet.subscribe_to(state3.tx_lock.clone()).await; let send_transfer_proof = event_loop_handle.send_transfer_proof(transfer_proof.clone()); - let recv_encrypted_signature = event_loop_handle.recv_encrypted_signature(); tokio::select! { result = send_transfer_proof => { @@ -183,16 +182,16 @@ where // If we send Bob the transfer proof, but for whatever reason we do not receive an acknoledgement from him // we would be stuck in this state forever (deadlock). By listening for the encrypted signature here we // can still proceed to the next state even if Bob does not respond with an acknoledgement. - enc_sig = recv_encrypted_signature => { - tracing::info!("Received encrypted signature"); - - AliceState::EncSigLearned { - monero_wallet_restore_blockheight, - transfer_proof, - encrypted_signature: Box::new(enc_sig?), - state3, - } - } + // enc_sig = recv_encrypted_signature => { + // tracing::info!("Received encrypted signature"); + + // AliceState::EncSigLearned { + // monero_wallet_restore_blockheight, + // transfer_proof, + // encrypted_signature: Box::new(enc_sig?), + // state3, + // } + // } result = tx_lock_status.wait_until_confirmed_with(state3.cancel_timelock) => { result?; AliceState::CancelTimelockExpired { From b803412f153aa40f3ddac2afa0eb10ba19b80404 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Wed, 30 Oct 2024 14:54:36 +0100 Subject: [PATCH 063/112] fix(wip): rendezvous register --- swap/src/asb/network.rs | 8 +++++++- swap/src/network/swap_setup/alice.rs | 16 +++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/swap/src/asb/network.rs b/swap/src/asb/network.rs index b412a8a81..a7a148fde 100644 --- a/swap/src/asb/network.rs +++ b/swap/src/asb/network.rs @@ -380,11 +380,17 @@ pub mod rendezvous { if let Some(peer_id) = self.to_dial.pop_front() { return Poll::Ready(ToSwarm::Dial { opts: DialOpts::peer_id(peer_id) + .addresses(vec![self.rendezvous_nodes + .iter() + .find(|node| node.peer_id == peer_id) + .map(|node| node.address.clone()) + .unwrap()]) .condition(PeerCondition::Disconnected) + .extend_addresses_through_behaviour() .build(), }); } - // check the status of each rendezvous node + // Check the status of each rendezvous node for i in 0..self.rendezvous_nodes.len() { let connection_status = self.rendezvous_nodes[i].connection_status.clone(); match &mut self.rendezvous_nodes[i].registration_status { diff --git a/swap/src/network/swap_setup/alice.rs b/swap/src/network/swap_setup/alice.rs index be4eb178a..c3ec4f56c 100644 --- a/swap/src/network/swap_setup/alice.rs +++ b/swap/src/network/swap_setup/alice.rs @@ -207,7 +207,21 @@ where role_override: libp2p::core::Endpoint, ) -> std::result::Result, libp2p::swarm::ConnectionDenied> { // TODO: Libp2p ugprade: Is this true? - unreachable!("Alice does not support outbound connections") + // This sometimes crashes + // unreachable!("Alice does not support outbound connections") + // return Err(libp2p::swarm::ConnectionDenied::new(anyhow!("Alice does not support outbound connections"))); + + // I dont understand why we need to return a handler here but if we dont then rendezvous doesnt work + + let handler = Handler::new( + self.min_buy, + self.max_buy, + self.env_config, + self.latest_rate.clone(), + self.resume_only, + ); + + Ok(handler) } fn on_swarm_event(&mut self, event: libp2p::swarm::FromSwarm<'_>) { From 3591f71921d85221f27289ffd0b279215ade7c38 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Thu, 31 Oct 2024 13:53:33 +0100 Subject: [PATCH 064/112] Comments in asb/event_loop.rs, stop retrying sending transfer proof in case of bmrng channel error --- swap/src/asb/event_loop.rs | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/swap/src/asb/event_loop.rs b/swap/src/asb/event_loop.rs index c98d77c5a..30550fc01 100644 --- a/swap/src/asb/event_loop.rs +++ b/swap/src/asb/event_loop.rs @@ -366,9 +366,8 @@ where for (transfer_proof, responder) in transfer_proofs { tracing::debug!(%peer, "Found buffered transfer proof for peer"); - // Once we have a connection, we can append transfer proof to the queue - // This is then polled in the next iteration of the event loop - // and attempted to be sent to the peer + // We have an established connection to the peer, so we can add the transfer proof to the queue + // This is then polled in the next iteration of the event loop, and attempted to be sent to the peer self.outgoing_transfer_proof_queue.push(async move { Ok((peer, transfer_proof, responder)) }.boxed()); @@ -379,10 +378,10 @@ where tracing::warn!(%address, "Failed to set up connection with peer: {:#}", error); } SwarmEvent::ConnectionClosed { peer_id: peer, num_established: 0, endpoint, cause: Some(error), connection_id } => { - tracing::debug!(%peer, address = %endpoint.get_remote_address(), "Lost connection to peer: {:#}", error); + tracing::debug!(%peer, address = %endpoint.get_remote_address(), %connection_id, "Lost connection to peer: {:#}", error); } SwarmEvent::ConnectionClosed { peer_id: peer, num_established: 0, endpoint, cause: None, connection_id } => { - tracing::info!(%peer, address = %endpoint.get_remote_address(), "Successfully closed connection"); + tracing::info!(%peer, address = %endpoint.get_remote_address(), %connection_id, "Successfully closed connection"); } SwarmEvent::NewListenAddr{address, ..} => { tracing::info!(%address, "New listen address reported"); @@ -648,15 +647,26 @@ impl EventLoopHandle { match sender.send_receive(msg.clone()).await { Ok(Ok(_)) => Ok(()), Ok(Err(err)) => { - // We encountered a libp2p error and failed to send the message - tracing::warn!(%err, "Failed to send transfer proof due to a network error. We will retry"); + // We failed to send the transfer proof due to a network error + // We will retry by sending the transfer proof into the event loop channel again + tracing::warn!(%err, retry_interval_secs = backoff.current_interval.as_secs(), "Failed to send transfer proof due to a network error. We will retry"); Err(backoff::Error::transient(anyhow!(err))) } Err(err) => { - // The MSCP channel has failed - // TODO(Libp2p Migration): Can we even retry here? Pointless? - tracing::error!(%err, "Failed to communicate transfer proof through event loop channel. We will retry"); - Err(backoff::Error::transient(anyhow!(err))) + match err { + bmrng::error::RequestError::RecvTimeoutError => { + // TODO(Libp2p Migration): Is this correct? + unreachable!("We construct the channel without a timeout, so this should never happen") + } + bmrng::error::RequestError::RecvError | bmrng::error::RequestError::SendError(_) => { + // The MSCP channel has failed. We do not retry this because this error means that either the channel was closed or the receiver has been dropped. + // Both of these cases are permanent and we should not retry. + + // TODO(Libp2p Migration): Is this correct? + tracing::error!(%err, "Failed to communicate transfer proof through event loop channel. We will not retry."); + Err(backoff::Error::permanent(anyhow!(err).context("Failed to communicate transfer proof through event loop channel"))) + } + } } } }) From 55555ead316c7204612e801e63afa80e3e36dc85 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Thu, 31 Oct 2024 14:13:55 +0100 Subject: [PATCH 065/112] dprint fmt --- swap/src/asb/event_loop.rs | 6 ++++-- swap/src/asb/network.rs | 3 ++- swap/src/network/swap_setup/alice.rs | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/swap/src/asb/event_loop.rs b/swap/src/asb/event_loop.rs index 30550fc01..98c7e95ff 100644 --- a/swap/src/asb/event_loop.rs +++ b/swap/src/asb/event_loop.rs @@ -71,7 +71,7 @@ where /// Tracks [`transfer_proof::Request`]s which could not yet be sent because /// we are currently disconnected from the peer. /// - /// If we are not connected to the peer, the transfer proof is essentially moved from [`send_transfer_proof`] to here. + /// If we are not connected to the peer, the transfer proof is essentially moved from [`outgoing_transfer_proof_queue`] to here. buffered_transfer_proofs: HashMap< PeerId, Vec<( @@ -615,7 +615,8 @@ pub struct EventLoopHandle { impl EventLoopHandle { pub async fn recv_encrypted_signature(&mut self) -> Result { - let receiver = self.recv_encrypted_signature + let receiver = self + .recv_encrypted_signature .as_mut() .context("Encrypted signature was already received")?; @@ -649,6 +650,7 @@ impl EventLoopHandle { Ok(Err(err)) => { // We failed to send the transfer proof due to a network error // We will retry by sending the transfer proof into the event loop channel again + // TODO(Libp2p Migration): This does not work currently because there is a only a single receiver for the channel (spawned in new_handle). Once the first proof has been received, the receiver is dropped and we cannot send another proof tracing::warn!(%err, retry_interval_secs = backoff.current_interval.as_secs(), "Failed to send transfer proof due to a network error. We will retry"); Err(backoff::Error::transient(anyhow!(err))) } diff --git a/swap/src/asb/network.rs b/swap/src/asb/network.rs index a7a148fde..c16951248 100644 --- a/swap/src/asb/network.rs +++ b/swap/src/asb/network.rs @@ -380,7 +380,8 @@ pub mod rendezvous { if let Some(peer_id) = self.to_dial.pop_front() { return Poll::Ready(ToSwarm::Dial { opts: DialOpts::peer_id(peer_id) - .addresses(vec![self.rendezvous_nodes + .addresses(vec![self + .rendezvous_nodes .iter() .find(|node| node.peer_id == peer_id) .map(|node| node.address.clone()) diff --git a/swap/src/network/swap_setup/alice.rs b/swap/src/network/swap_setup/alice.rs index c3ec4f56c..395c3b2d6 100644 --- a/swap/src/network/swap_setup/alice.rs +++ b/swap/src/network/swap_setup/alice.rs @@ -212,7 +212,7 @@ where // return Err(libp2p::swarm::ConnectionDenied::new(anyhow!("Alice does not support outbound connections"))); // I dont understand why we need to return a handler here but if we dont then rendezvous doesnt work - + let handler = Handler::new( self.min_buy, self.max_buy, From 309fe769e83802fd6498eec596c55b0bc317474b Mon Sep 17 00:00:00 2001 From: binarybaron Date: Thu, 31 Oct 2024 15:29:06 +0100 Subject: [PATCH 066/112] feat(libp2p): Attach protocol name to Inbound/OutboundRequestResponseFailure OutEvent type --- swap/src/asb/event_loop.rs | 9 +++++---- swap/src/asb/network.rs | 2 ++ swap/src/cli/behaviour.rs | 8 +++++++- swap/src/network/impl_from_rr_event.rs | 2 ++ 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/swap/src/asb/event_loop.rs b/swap/src/asb/event_loop.rs index 98c7e95ff..456f54e66 100644 --- a/swap/src/asb/event_loop.rs +++ b/swap/src/asb/event_loop.rs @@ -335,22 +335,24 @@ where SwarmEvent::Behaviour(OutEvent::Rendezvous(libp2p::rendezvous::client::Event::RegisterFailed { rendezvous_node, namespace, error })) => { tracing::error!("Registration with rendezvous node {} failed for namespace {}: {:?}", rendezvous_node, namespace, error); } - SwarmEvent::Behaviour(OutEvent::OutboundRequestResponseFailure {peer, error, request_id}) => { + SwarmEvent::Behaviour(OutEvent::OutboundRequestResponseFailure {peer, error, request_id, protocol}) => { tracing::error!( %peer, %request_id, %error, + %protocol "Failed to send request-response request to peer"); if let Some(responder) = self.inflight_transfer_proofs.remove(&request_id) { let _ = responder.respond(Err(error)); } } - SwarmEvent::Behaviour(OutEvent::InboundRequestResponseFailure {peer, error, request_id}) => { + SwarmEvent::Behaviour(OutEvent::InboundRequestResponseFailure {peer, error, request_id, protocol}) => { tracing::error!( %peer, %request_id, %error, + %protocol, "Failed to receive request-response request from peer"); } SwarmEvent::Behaviour(OutEvent::Failure {peer, error}) => { @@ -651,13 +653,12 @@ impl EventLoopHandle { // We failed to send the transfer proof due to a network error // We will retry by sending the transfer proof into the event loop channel again // TODO(Libp2p Migration): This does not work currently because there is a only a single receiver for the channel (spawned in new_handle). Once the first proof has been received, the receiver is dropped and we cannot send another proof - tracing::warn!(%err, retry_interval_secs = backoff.current_interval.as_secs(), "Failed to send transfer proof due to a network error. We will retry"); + tracing::warn!(%err, "Failed to send transfer proof due to a network error. We will retry"); Err(backoff::Error::transient(anyhow!(err))) } Err(err) => { match err { bmrng::error::RequestError::RecvTimeoutError => { - // TODO(Libp2p Migration): Is this correct? unreachable!("We construct the channel without a timeout, so this should never happen") } bmrng::error::RequestError::RecvError | bmrng::error::RequestError::SendError(_) => { diff --git a/swap/src/asb/network.rs b/swap/src/asb/network.rs index c16951248..1c53f0961 100644 --- a/swap/src/asb/network.rs +++ b/swap/src/asb/network.rs @@ -82,11 +82,13 @@ pub mod behaviour { peer: PeerId, error: OutboundFailure, request_id: OutboundRequestId, + protocol: String, }, InboundRequestResponseFailure { peer: PeerId, error: InboundFailure, request_id: InboundRequestId, + protocol: String, }, Failure { peer: PeerId, diff --git a/swap/src/cli/behaviour.rs b/swap/src/cli/behaviour.rs index 6c8b204a7..d76680687 100644 --- a/swap/src/cli/behaviour.rs +++ b/swap/src/cli/behaviour.rs @@ -54,11 +54,13 @@ pub enum OutEvent { peer: PeerId, error: OutboundFailure, request_id: OutboundRequestId, + protocol: String, }, InboundRequestResponseFailure { peer: PeerId, error: InboundFailure, request_id: InboundRequestId, + protocol: String, }, /// "Fallback" variant that allows the event mapping code to swallow certain /// events that we don't want the caller to deal with. @@ -121,7 +123,11 @@ impl Behaviour { transfer_proof: transfer_proof::bob(), encrypted_signature: encrypted_signature::bob(), cooperative_xmr_redeem: cooperative_xmr_redeem_after_punish::bob(), - redial: redial::Behaviour::new(alice, Duration::from_secs(2)), + redial: redial::Behaviour::new( + alice, + Duration::from_secs(2), + Duration::from_secs(5 * 60), + ), ping: ping::Behaviour::new(pingConfig), identify: identify::Behaviour::new(identifyConfig), } diff --git a/swap/src/network/impl_from_rr_event.rs b/swap/src/network/impl_from_rr_event.rs index 6a68fea82..627fc9fe7 100644 --- a/swap/src/network/impl_from_rr_event.rs +++ b/swap/src/network/impl_from_rr_event.rs @@ -21,6 +21,7 @@ macro_rules! impl_from_rr_event { peer, error, request_id, + protocol: $protocol.to_string(), }, OutboundFailure { peer, @@ -30,6 +31,7 @@ macro_rules! impl_from_rr_event { peer, error, request_id, + protocol: $protocol.to_string(), }, } } From 2590a12d49ef34b1a493ea705877c64494d4b409 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Thu, 31 Oct 2024 15:29:48 +0100 Subject: [PATCH 067/112] feat(libp2p): Add some comments to network/swap_setup/* --- swap/src/cli.rs | 30 -------------------------- swap/src/env.rs | 2 +- swap/src/network/swap_setup/alice.rs | 32 ++++++++++++++++++++-------- swap/src/network/swap_setup/bob.rs | 20 ++++++++++------- 4 files changed, 36 insertions(+), 48 deletions(-) diff --git a/swap/src/cli.rs b/swap/src/cli.rs index a99202eb0..90373134c 100644 --- a/swap/src/cli.rs +++ b/swap/src/cli.rs @@ -222,41 +222,11 @@ mod tests { } } - // impl NetworkBehaviourEventProcess for StaticQuoteAsbBehaviour { - // fn inject_event(&mut self, event: rendezvous::client::Event) { - // if let rendezvous::client::Event::Registered { .. } = event { - // self.registered = true; - // } - // } - // } - - // impl NetworkBehaviourEventProcess for StaticQuoteAsbBehaviour { - // fn inject_event(&mut self, _: libp2p::ping::Event) {} - // } - - // impl NetworkBehaviourEventProcess for StaticQuoteAsbBehaviour { - // fn inject_event(&mut self, event: quote::OutEvent) { - // if let request_response::Event::Message { - // message: quote::Message::Request { channel, .. }, - // .. - // } = event - // { - // self.quote - // .send_response(channel, self.static_quote) - // .unwrap(); - // } - // } - // } - #[derive(libp2p::swarm::NetworkBehaviour)] struct RendezvousPointBehaviour { rendezvous: rendezvous::server::Behaviour, } - // impl NetworkBehaviourEventProcess for RendezvousPointBehaviour { - // fn inject_event(&mut self, _: rendezvous::server::Event) {} - // } - impl Default for RendezvousPointBehaviour { fn default() -> Self { RendezvousPointBehaviour { diff --git a/swap/src/env.rs b/swap/src/env.rs index fa8506012..1cb5961c0 100644 --- a/swap/src/env.rs +++ b/swap/src/env.rs @@ -50,7 +50,6 @@ impl GetConfig for Mainnet { bitcoin_lock_confirmed_timeout: 2.std_hours(), bitcoin_finality_confirmations: 1, bitcoin_avg_block_time: 10.std_minutes(), - // TODO(Libp2p Migration): This was temporarily increased for testing. testnet3 block time is too low at the moment bitcoin_cancel_timelock: CancelTimelock::new(72), bitcoin_punish_timelock: PunishTimelock::new(72), bitcoin_network: bitcoin::Network::Bitcoin, @@ -68,6 +67,7 @@ impl GetConfig for Testnet { bitcoin_lock_confirmed_timeout: 1.std_hours(), bitcoin_finality_confirmations: 1, bitcoin_avg_block_time: 10.std_minutes(), + // TODO(Libp2p Migration): This was temporarily increased for testing. testnet3 block time is too low at the moment bitcoin_cancel_timelock: CancelTimelock::new(72), bitcoin_punish_timelock: PunishTimelock::new(72), bitcoin_network: bitcoin::Network::Testnet, diff --git a/swap/src/network/swap_setup/alice.rs b/swap/src/network/swap_setup/alice.rs index 395c3b2d6..7e76b4f20 100644 --- a/swap/src/network/swap_setup/alice.rs +++ b/swap/src/network/swap_setup/alice.rs @@ -151,10 +151,13 @@ where fn handle_established_inbound_connection( &mut self, _connection_id: libp2p::swarm::ConnectionId, - peer: PeerId, - local_addr: &Multiaddr, - remote_addr: &Multiaddr, + _peer: PeerId, + _local_addr: &Multiaddr, + _remote_addr: &Multiaddr, ) -> std::result::Result, libp2p::swarm::ConnectionDenied> { + // A new inbound connection has been established by Bob + // He wants to negotiate a swap setup with us + // We create a new Handler to handle the negotiation let handler = Handler::new( self.min_buy, self.max_buy, @@ -172,6 +175,9 @@ where _: ConnectionId, event: HandlerOutEvent, ) { + // Here we receive events from the Handler, add some context and forward them to the swarm + // This is done by pushing the event to the [`events`] queue + // The queue is then polled in the [`poll`] function, and the events are sent to the swarm match event { HandlerOutEvent::Initiated(send_wallet_snapshot) => { self.events.push_back(OutEvent::Initiated { @@ -192,6 +198,7 @@ where } fn poll(&mut self, _cx: &mut std::task::Context<'_>) -> Poll> { + // Poll events from the queue and send them to the swarm if let Some(event) = self.events.pop_front() { return Poll::Ready(ToSwarm::GenerateEvent(event)); } @@ -224,8 +231,8 @@ where Ok(handler) } - fn on_swarm_event(&mut self, event: libp2p::swarm::FromSwarm<'_>) { - // TODO: Do we need to do anything here? + fn on_swarm_event(&mut self, _event: libp2p::swarm::FromSwarm<'_>) { + // We do not need to handle any swarm events here } } @@ -314,12 +321,14 @@ where bitcoin::Amount, WalletSnapshot, >(1, Duration::from_secs(5)); + let resume_only = self.resume_only; let min_buy = self.min_buy; let max_buy = self.max_buy; let latest_rate = self.latest_rate.latest_rate(); let env_config = self.env_config; + // We wrap the entire handshake in a timeout future let protocol = tokio::time::timeout(self.negotiation_timeout, async move { let request = swap_setup::read_cbor_message::(&mut substream) .await @@ -373,6 +382,7 @@ where let unlocked = Amount::from_piconero(wallet_snapshot.balance.unlocked_balance); + if unlocked < xmr + wallet_snapshot.lock_fee { return Err(Error::BalanceTooLow { balance: wallet_snapshot.balance, @@ -462,11 +472,9 @@ where unreachable!("Alice does not dial") } ConnectionEvent::FullyNegotiatedOutbound(..) => { - unreachable!("Alice does not support outbound in the handler") - } - _ => { - // TODO: not quite sure what to do here + unreachable!("Alice does not support outbound connections") } + _ => {} } } @@ -475,6 +483,8 @@ where } fn connection_keep_alive(&self) -> bool { + // If keep_alive_until is None, we keep the connection alive indefinitely + // If keep_alive_until is Some, we keep the connection alive until the given instant match self.keep_alive_until { None => true, Some(keep_alive_until) => Instant::now() < keep_alive_until, @@ -488,12 +498,16 @@ where ) -> Poll< ConnectionHandlerEvent, > { + // Send events in the queue to the behaviour + // This is currently only used to notify the behaviour that the negotiation phase has been initiated if let Some(event) = self.events.pop_front() { return Poll::Ready(ConnectionHandlerEvent::NotifyBehaviour(event)); } if let Some(result) = futures::ready!(self.inbound_stream.poll_unpin(cx)) { self.inbound_stream = OptionFuture::from(None); + + // Notify the behaviour that the negotiation phase has been completed return Poll::Ready(ConnectionHandlerEvent::NotifyBehaviour( HandlerOutEvent::Completed(result), )); diff --git a/swap/src/network/swap_setup/bob.rs b/swap/src/network/swap_setup/bob.rs index 6499990fe..cea1b9bfa 100644 --- a/swap/src/network/swap_setup/bob.rs +++ b/swap/src/network/swap_setup/bob.rs @@ -75,11 +75,7 @@ impl NetworkBehaviour for Behaviour { } fn on_swarm_event(&mut self, event: FromSwarm) { - match event { - FromSwarm::ConnectionEstablished(_) => {} - FromSwarm::ConnectionClosed(_) => {} - _ => {} - } + // We do not need to handle swarm events } fn on_connection_handler_event( @@ -95,10 +91,12 @@ impl NetworkBehaviour for Behaviour { &mut self, _cx: &mut Context<'_>, ) -> Poll>> { + // Send completed swaps to the swarm if let Some((_peer, completed)) = self.completed_swaps.pop_front() { return Poll::Ready(ToSwarm::GenerateEvent(completed)); } + // If there is a new swap to be started, send it to the connection handler if let Some((peer, event)) = self.new_swaps.pop_front() { return Poll::Ready(ToSwarm::NotifyHandler { peer_id: peer, @@ -156,6 +154,7 @@ impl ConnectionHandler for Handler { type OutboundOpenInfo = NewSwap; fn listen_protocol(&self) -> SubstreamProtocol { + // Bob does not support inbound substreams SubstreamProtocol::new(upgrade::DeniedUpgrade, ()) } @@ -173,8 +172,6 @@ impl ConnectionHandler for Handler { unreachable!("Bob does not support inbound substreams") } libp2p::swarm::handler::ConnectionEvent::FullyNegotiatedOutbound(outbound) => { - println!("swap_setup: bob: FullyNegotiatedOutbound reached"); - let mut substream = outbound.protocol; let info = outbound.info; @@ -241,7 +238,8 @@ impl ConnectionHandler for Handler { } libp2p::swarm::handler::ConnectionEvent::DialUpgradeError(dial_upgrade_err) => { // Handle dial upgrade error if needed - self.keep_alive = false; // Consider setting to false on error + // TOOD(Libp2p Migration): Is this correct? + self.keep_alive = false; } _ => {} } @@ -261,16 +259,22 @@ impl ConnectionHandler for Handler { ) -> Poll< ConnectionHandlerEvent, > { + // Check if there is a new swap to be started if let Some(new_swap) = self.new_swaps.pop_front() { self.keep_alive = true; + + // We instruct the swarm to start a new outbound substream return Poll::Ready(ConnectionHandlerEvent::OutboundSubstreamRequest { protocol: SubstreamProtocol::new(protocol::new(), new_swap), }); } + // Check if the outbound stream has completed if let Poll::Ready(Some(result)) = self.outbound_stream.poll_unpin(cx) { self.outbound_stream = None.into(); self.keep_alive = false; + + // We notify the swarm that the swap setup is completed / failed return Poll::Ready(ConnectionHandlerEvent::NotifyBehaviour(Completed( result.map_err(anyhow::Error::from), ))); From c9f8c5d372659e78a07e175b1c6b7dfaf643986f Mon Sep 17 00:00:00 2001 From: binarybaron Date: Thu, 31 Oct 2024 15:31:40 +0100 Subject: [PATCH 068/112] feat(libp2p, bob): Never stop re-dialing Alice --- swap/src/cli/behaviour.rs | 3 -- swap/src/cli/event_loop.rs | 16 +++++------ swap/src/network/redial.rs | 56 ++++++++++++++------------------------ 3 files changed, 27 insertions(+), 48 deletions(-) diff --git a/swap/src/cli/behaviour.rs b/swap/src/cli/behaviour.rs index d76680687..938dea46a 100644 --- a/swap/src/cli/behaviour.rs +++ b/swap/src/cli/behaviour.rs @@ -43,9 +43,6 @@ pub enum OutEvent { reason: CooperativeXmrRedeemRejectReason, swap_id: uuid::Uuid, }, - AllRedialAttemptsExhausted { - peer: PeerId, - }, Failure { peer: PeerId, error: Error, diff --git a/swap/src/cli/event_loop.rs b/swap/src/cli/event_loop.rs index e953f0623..cdd00a5dc 100644 --- a/swap/src/cli/event_loop.rs +++ b/swap/src/cli/event_loop.rs @@ -218,10 +218,6 @@ impl EventLoop { let _ = responder.respond(Response::Rejected { reason, swap_id }); } } - SwarmEvent::Behaviour(OutEvent::AllRedialAttemptsExhausted { peer }) if peer == self.alice_peer_id => { - tracing::error!("Exhausted all re-dial attempts to Alice"); - return; - } SwarmEvent::Behaviour(OutEvent::Failure { peer, error }) => { tracing::warn!(%peer, err = %error, "Communication error"); return; @@ -230,10 +226,10 @@ impl EventLoop { tracing::info!(peer_id = %endpoint.get_remote_address(), "Connected to Alice"); } SwarmEvent::Dialing { peer_id: Some(alice_peer_id), connection_id } if alice_peer_id == self.alice_peer_id => { - tracing::debug!(%alice_peer_id, "Dialling Alice"); + tracing::debug!(%alice_peer_id, %connection_id, "Dialing Alice"); } SwarmEvent::ConnectionClosed { peer_id, endpoint, num_established, cause: Some(error), connection_id } if peer_id == self.alice_peer_id && num_established == 0 => { - tracing::warn!(peer_id = %endpoint.get_remote_address(), cause = %error, "Lost connection to Alice"); + tracing::warn!(peer_id = %endpoint.get_remote_address(), cause = %error, %connection_id, "Lost connection to Alice"); } SwarmEvent::ConnectionClosed { peer_id, num_established, cause: None, .. } if peer_id == self.alice_peer_id && num_established == 0 => { // no error means the disconnection was requested @@ -241,29 +237,31 @@ impl EventLoop { return; } SwarmEvent::OutgoingConnectionError { peer_id: Some(alice_peer_id), error, connection_id } if alice_peer_id == self.alice_peer_id => { - tracing::warn!(%error, "Failed to dial Alice"); + tracing::warn!(%alice_peer_id, %connection_id, %error, "Failed to connect to Alice"); if let Some(duration) = self.swarm.behaviour_mut().redial.until_next_redial() { tracing::info!(seconds_until_next_redial = %duration.as_secs(), "Waiting for next redial attempt"); } } - SwarmEvent::Behaviour(OutEvent::OutboundRequestResponseFailure {peer, error, request_id}) => { + SwarmEvent::Behaviour(OutEvent::OutboundRequestResponseFailure {peer, error, request_id, protocol}) => { tracing::error!( %peer, %request_id, %error, + %protocol, "Failed to send request-response request to peer"); if let Some(responder) = self.inflight_encrypted_signature_requests.remove(&request_id) { let _ = responder.respond(Err(error)); } } - SwarmEvent::Behaviour(OutEvent::InboundRequestResponseFailure {peer, error, request_id}) => { + SwarmEvent::Behaviour(OutEvent::InboundRequestResponseFailure {peer, error, request_id, protocol}) => { tracing::error!( %peer, %request_id, %error, + %protocol, "Failed to receive request-response request from peer"); } _ => {} diff --git a/swap/src/network/redial.rs b/swap/src/network/redial.rs index fe377fef8..2a8a919d2 100644 --- a/swap/src/network/redial.rs +++ b/swap/src/network/redial.rs @@ -1,4 +1,3 @@ -use crate::cli; use backoff::backoff::Backoff; use backoff::ExponentialBackoff; use futures::future::FutureExt; @@ -12,10 +11,6 @@ use std::time::Duration; use tokio::time::{Instant, Sleep}; use void::Void; -pub enum OutEvent { - AllAttemptsExhausted { peer: PeerId }, -} - /// A [`NetworkBehaviour`] that tracks whether we are connected to the given /// peer and attempts to re-establish a connection with an exponential backoff /// if we lose the connection. @@ -29,16 +24,15 @@ pub struct Behaviour { } impl Behaviour { - pub fn new(peer: PeerId, interval: Duration) -> Self { + pub fn new(peer: PeerId, interval: Duration, max_interval: Duration) -> Self { Self { peer, sleep: None, backoff: ExponentialBackoff { initial_interval: interval, current_interval: interval, - // Never give up dialing - // TOOD: Libp2p Upgrade: Is this the right approach? - max_elapsed_time: None, + max_interval, + max_elapsed_time: None, // We never give up on re-dialling ..ExponentialBackoff::default() }, } @@ -57,7 +51,7 @@ impl Behaviour { impl NetworkBehaviour for Behaviour { type ConnectionHandler = libp2p::swarm::dummy::ConnectionHandler; - type ToSwarm = OutEvent; + type ToSwarm = (); fn handle_established_inbound_connection( &mut self, @@ -66,8 +60,10 @@ impl NetworkBehaviour for Behaviour { _local_addr: &Multiaddr, _remote_addr: &Multiaddr, ) -> Result, libp2p::swarm::ConnectionDenied> { + // We establish an inbound connection to the peer we are interested in. + // We stop re-dialling. if peer == self.peer { - self.sleep = None; // Cancel any active re-dialling + self.sleep = None; } Ok(Self::ConnectionHandler {}) } @@ -79,21 +75,24 @@ impl NetworkBehaviour for Behaviour { _addr: &Multiaddr, _role_override: libp2p::core::Endpoint, ) -> Result, libp2p::swarm::ConnectionDenied> { + // We establish an outbound connection to the peer we are interested in. + // We stop re-dialling. if peer == self.peer { - self.sleep = None; // Cancel any active re-dialling + self.sleep = None; } Ok(Self::ConnectionHandler {}) } fn on_swarm_event(&mut self, event: libp2p::swarm::FromSwarm<'_>) { - // TODO(Libp2p Migration): Maybe we also need to match for FromSwarm::DialFailure here? + let redial = match event { + libp2p::swarm::FromSwarm::ConnectionClosed(e) if e.peer_id == self.peer => true, + libp2p::swarm::FromSwarm::DialFailure(e) if e.peer_id == Some(self.peer) => true, + _ => false, + }; - if let libp2p::swarm::FromSwarm::ConnectionClosed(closed) = event { - if closed.peer_id == self.peer { - // Lost connection, trigger re-dialling with exponential backoff - self.backoff.reset(); - self.sleep = Some(Box::pin(tokio::time::sleep(self.backoff.initial_interval))); - } + if (redial) { + self.backoff.reset(); + self.sleep = Some(Box::pin(tokio::time::sleep(self.backoff.initial_interval))); } } @@ -108,9 +107,7 @@ impl NetworkBehaviour for Behaviour { let next_dial_in = match self.backoff.next_backoff() { Some(next_dial_in) => next_dial_in, None => { - return Poll::Ready(ToSwarm::GenerateEvent(OutEvent::AllAttemptsExhausted { - peer: self.peer, - })); + unreachable!("The backoff should never run out of attempts"); } }; @@ -129,19 +126,6 @@ impl NetworkBehaviour for Behaviour { _connection_id: libp2p::swarm::ConnectionId, _event: libp2p::swarm::THandlerOutEvent, ) { - // the dummy connection handler does not produce any events - // therefore we do not need to handle any events here - // TODO(Libp2p Migration): Is this correct? unreachable!("The re-dial dummy connection handler does not produce any events"); } -} - -impl From for cli::OutEvent { - fn from(event: OutEvent) -> Self { - match event { - OutEvent::AllAttemptsExhausted { peer } => { - cli::OutEvent::AllRedialAttemptsExhausted { peer } - } - } - } -} +} \ No newline at end of file From 3e457ed0af3397246f15fcccc056130f1d55ea57 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Thu, 31 Oct 2024 15:33:23 +0100 Subject: [PATCH 069/112] fix(libp2p): Remove timeout from transfer_proof bmrng channel, panic on timeout, dont retry on bmrng channel error --- swap/src/cli/event_loop.rs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/swap/src/cli/event_loop.rs b/swap/src/cli/event_loop.rs index cdd00a5dc..f7272e77b 100644 --- a/swap/src/cli/event_loop.rs +++ b/swap/src/cli/event_loop.rs @@ -63,7 +63,7 @@ impl EventLoop { db: Arc, ) -> Result<(Self, EventLoopHandle)> { let execution_setup = bmrng::channel_with_timeout(1, Duration::from_secs(60)); - let transfer_proof = bmrng::channel_with_timeout(1, Duration::from_secs(60)); + let transfer_proof = bmrng::channel(1); // TODO(Libp2p Migration): Is it okay to have a channel without a timeout here? let encrypted_signature = bmrng::channel(1); let quote = bmrng::channel_with_timeout(1, Duration::from_secs(60)); let cooperative_xmr_redeem = bmrng::channel_with_timeout(1, Duration::from_secs(60)); @@ -374,8 +374,18 @@ impl EventLoopHandle { Err(backoff::Error::transient(anyhow::anyhow!(err))) } Err(err) => { - tracing::error!(%err, "Failed to communicate encrypted signature through event loop channel. Will retry"); - Err(backoff::Error::transient(anyhow::anyhow!(err))) + match err { + bmrng::error::RequestError::RecvTimeoutError => { + unreachable!("We construct the channel without a timeout, so this should never happen") + } + bmrng::error::RequestError::RecvError | bmrng::error::RequestError::SendError(_) => { + // The MSCP channel has failed. We do not retry this because this error means that either the channel was closed or the receiver has been dropped. + // Both of these cases are permanent and we should not retry. + // TODO(Libp2p Migration): Is this correct? + tracing::error!(%err, "Failed to communicate transfer proof through event loop channel. We will not retry."); + Err(backoff::Error::permanent(anyhow::anyhow!(err).context("Failed to communicate transfer proof through event loop channel"))) + } + } } } }) From df681fc0f8a23be1d4927ea554aa6079dcf95808 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Thu, 31 Oct 2024 15:33:38 +0100 Subject: [PATCH 070/112] dprint fmt --- swap/src/network/redial.rs | 2 +- swap/src/network/swap_setup/alice.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/swap/src/network/redial.rs b/swap/src/network/redial.rs index 2a8a919d2..ae0c81d18 100644 --- a/swap/src/network/redial.rs +++ b/swap/src/network/redial.rs @@ -128,4 +128,4 @@ impl NetworkBehaviour for Behaviour { ) { unreachable!("The re-dial dummy connection handler does not produce any events"); } -} \ No newline at end of file +} diff --git a/swap/src/network/swap_setup/alice.rs b/swap/src/network/swap_setup/alice.rs index 7e76b4f20..6e478a11f 100644 --- a/swap/src/network/swap_setup/alice.rs +++ b/swap/src/network/swap_setup/alice.rs @@ -321,7 +321,7 @@ where bitcoin::Amount, WalletSnapshot, >(1, Duration::from_secs(5)); - + let resume_only = self.resume_only; let min_buy = self.min_buy; let max_buy = self.max_buy; From 92ce1b36ab2e93ea8e956c34b4fead804f846361 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Thu, 31 Oct 2024 17:05:25 +0100 Subject: [PATCH 071/112] fix missing comma, import cli in redial.rs --- swap/src/asb/event_loop.rs | 2 +- swap/src/network/redial.rs | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/swap/src/asb/event_loop.rs b/swap/src/asb/event_loop.rs index 456f54e66..800573f65 100644 --- a/swap/src/asb/event_loop.rs +++ b/swap/src/asb/event_loop.rs @@ -340,7 +340,7 @@ where %peer, %request_id, %error, - %protocol + %protocol, "Failed to send request-response request to peer"); if let Some(responder) = self.inflight_transfer_proofs.remove(&request_id) { diff --git a/swap/src/network/redial.rs b/swap/src/network/redial.rs index ae0c81d18..9a9a2313f 100644 --- a/swap/src/network/redial.rs +++ b/swap/src/network/redial.rs @@ -11,6 +11,8 @@ use std::time::Duration; use tokio::time::{Instant, Sleep}; use void::Void; +use crate::cli; + /// A [`NetworkBehaviour`] that tracks whether we are connected to the given /// peer and attempts to re-establish a connection with an exponential backoff /// if we lose the connection. @@ -63,6 +65,7 @@ impl NetworkBehaviour for Behaviour { // We establish an inbound connection to the peer we are interested in. // We stop re-dialling. if peer == self.peer { + self.backoff.reset(); self.sleep = None; } Ok(Self::ConnectionHandler {}) @@ -78,6 +81,7 @@ impl NetworkBehaviour for Behaviour { // We establish an outbound connection to the peer we are interested in. // We stop re-dialling. if peer == self.peer { + self.backoff.reset(); self.sleep = None; } Ok(Self::ConnectionHandler {}) @@ -90,7 +94,7 @@ impl NetworkBehaviour for Behaviour { _ => false, }; - if (redial) { + if redial && self.sleep.is_none() { self.backoff.reset(); self.sleep = Some(Box::pin(tokio::time::sleep(self.backoff.initial_interval))); } @@ -129,3 +133,9 @@ impl NetworkBehaviour for Behaviour { unreachable!("The re-dial dummy connection handler does not produce any events"); } } + +impl From<()> for cli::OutEvent { + fn from(_: ()) -> Self { + Self::Other + } +} \ No newline at end of file From 2ff8bc0099f8c3045439dc657cafcbeb3040376e Mon Sep 17 00:00:00 2001 From: binarybaron Date: Thu, 31 Oct 2024 17:35:30 +0100 Subject: [PATCH 072/112] fix: use Display to format state in tracing log in li/event_loop.rs --- swap/src/cli/event_loop.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swap/src/cli/event_loop.rs b/swap/src/cli/event_loop.rs index f7272e77b..994558c62 100644 --- a/swap/src/cli/event_loop.rs +++ b/swap/src/cli/event_loop.rs @@ -140,7 +140,7 @@ impl EventLoop { .expect("The CLI database only contains Bob states"); if has_already_processed_transfer_proof(&state) { - tracing::info!("Received transfer proof for swap {} in state {:?}. Acknowledging immediately.", swap_id, state); + tracing::warn!("Received transfer proof for swap {} but we are already in state {}. Acknowledging immediately. Alice most likely did not receive the acknowledgment when we sent it before", swap_id, state); // We set this to a future that will resolve immediately, and returns the channel // This will be resolved in the next iteration of the event loop, and a response will be sent to Alice From 7ecd03f52e83d396fcbfbfdb9f9e9615f0c9381b Mon Sep 17 00:00:00 2001 From: binarybaron Date: Thu, 31 Oct 2024 17:36:11 +0100 Subject: [PATCH 073/112] fix(libp2p, asb): increase bmrng channel timeout for wallet snapshot to 60seconds --- swap/src/network/swap_setup/alice.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swap/src/network/swap_setup/alice.rs b/swap/src/network/swap_setup/alice.rs index 6e478a11f..cb8e8e47f 100644 --- a/swap/src/network/swap_setup/alice.rs +++ b/swap/src/network/swap_setup/alice.rs @@ -320,7 +320,7 @@ where let (sender, receiver) = bmrng::channel_with_timeout::< bitcoin::Amount, WalletSnapshot, - >(1, Duration::from_secs(5)); + >(1, Duration::from_secs(60)); let resume_only = self.resume_only; let min_buy = self.min_buy; From 9c1f2e3bfa069f01e87c78b892be91f969de056a Mon Sep 17 00:00:00 2001 From: binarybaron Date: Thu, 31 Oct 2024 18:03:59 +0100 Subject: [PATCH 074/112] feat(libp2p, cli): Propogate quote request-response errors through BMRNG channel --- swap/src/cli/event_loop.rs | 19 +++++++++++++------ swap/src/network/redial.rs | 2 +- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/swap/src/cli/event_loop.rs b/swap/src/cli/event_loop.rs index 994558c62..883b5a450 100644 --- a/swap/src/cli/event_loop.rs +++ b/swap/src/cli/event_loop.rs @@ -28,7 +28,7 @@ pub struct EventLoop { db: Arc, // these streams represents outgoing requests that we have to make - quote_requests: bmrng::RequestReceiverStream<(), BidQuote>, + quote_requests: bmrng::RequestReceiverStream<(), Result>, cooperative_xmr_redeem_requests: bmrng::RequestReceiverStream, encrypted_signatures: bmrng::RequestReceiverStream>, @@ -37,7 +37,8 @@ pub struct EventLoop { // these represents requests that are currently in-flight. // once we get a response to a matching [`RequestId`], we will use the responder to relay the // response. - inflight_quote_requests: HashMap>, + inflight_quote_requests: + HashMap>>, inflight_encrypted_signature_requests: HashMap>>, inflight_swap_setup: Option>>, @@ -65,7 +66,7 @@ impl EventLoop { let execution_setup = bmrng::channel_with_timeout(1, Duration::from_secs(60)); let transfer_proof = bmrng::channel(1); // TODO(Libp2p Migration): Is it okay to have a channel without a timeout here? let encrypted_signature = bmrng::channel(1); - let quote = bmrng::channel_with_timeout(1, Duration::from_secs(60)); + let quote = bmrng::channel(1); let cooperative_xmr_redeem = bmrng::channel_with_timeout(1, Duration::from_secs(60)); let event_loop = EventLoop { swap_id, @@ -111,7 +112,7 @@ impl EventLoop { match swarm_event { SwarmEvent::Behaviour(OutEvent::QuoteReceived { id, response }) => { if let Some(responder) = self.inflight_quote_requests.remove(&id) { - let _ = responder.respond(response); + let _ = responder.respond(Ok(response)); } } SwarmEvent::Behaviour(OutEvent::SwapSetupCompleted(response)) => { @@ -254,6 +255,8 @@ impl EventLoop { if let Some(responder) = self.inflight_encrypted_signature_requests.remove(&request_id) { let _ = responder.respond(Err(error)); + } else if let Some(responder) = self.inflight_quote_requests.remove(&request_id) { + let _ = responder.respond(Err(error)); } } SwarmEvent::Behaviour(OutEvent::InboundRequestResponseFailure {peer, error, request_id, protocol}) => { @@ -324,7 +327,7 @@ pub struct EventLoopHandle { swap_setup: bmrng::RequestSender>, transfer_proof: bmrng::RequestReceiver, encrypted_signature: bmrng::RequestSender>, - quote: bmrng::RequestSender<(), BidQuote>, + quote: bmrng::RequestSender<(), Result>, cooperative_xmr_redeem: bmrng::RequestSender, } @@ -349,7 +352,11 @@ impl EventLoopHandle { pub async fn request_quote(&mut self) -> Result { tracing::debug!("Requesting quote"); - Ok(self.quote.send_receive(()).await?) + self.quote + .send_receive(()) + .await + .context("Failed to receive quote through event loop channel")? + .context("Failed to request quote over the network") } pub async fn request_cooperative_xmr_redeem(&mut self, swap_id: Uuid) -> Result { diff --git a/swap/src/network/redial.rs b/swap/src/network/redial.rs index 9a9a2313f..6fcd65bbb 100644 --- a/swap/src/network/redial.rs +++ b/swap/src/network/redial.rs @@ -138,4 +138,4 @@ impl From<()> for cli::OutEvent { fn from(_: ()) -> Self { Self::Other } -} \ No newline at end of file +} From 1a438fc9af0d84c7369f8cc52093994ecfbb2d7f Mon Sep 17 00:00:00 2001 From: binarybaron Date: Thu, 31 Oct 2024 22:07:53 +0100 Subject: [PATCH 075/112] fix: unnest the error handling in cli/event_loop.rs --- swap/src/cli/event_loop.rs | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/swap/src/cli/event_loop.rs b/swap/src/cli/event_loop.rs index 883b5a450..7798be153 100644 --- a/swap/src/cli/event_loop.rs +++ b/swap/src/cli/event_loop.rs @@ -380,19 +380,15 @@ impl EventLoopHandle { tracing::warn!(%err, "Failed to send encrypted signature due to a network error. Will retry"); Err(backoff::Error::transient(anyhow::anyhow!(err))) } + Err(bmrng::error::RequestError::RecvTimeoutError) => { + unreachable!("We construct the channel without a timeout, so this should never happen") + } Err(err) => { - match err { - bmrng::error::RequestError::RecvTimeoutError => { - unreachable!("We construct the channel without a timeout, so this should never happen") - } - bmrng::error::RequestError::RecvError | bmrng::error::RequestError::SendError(_) => { - // The MSCP channel has failed. We do not retry this because this error means that either the channel was closed or the receiver has been dropped. - // Both of these cases are permanent and we should not retry. - // TODO(Libp2p Migration): Is this correct? - tracing::error!(%err, "Failed to communicate transfer proof through event loop channel. We will not retry."); - Err(backoff::Error::permanent(anyhow::anyhow!(err).context("Failed to communicate transfer proof through event loop channel"))) - } - } + // The MSCP channel has failed. We do not retry this because this error means that either the channel was closed or the receiver has been dropped. + // Both of these cases are permanent and we should not retry. + // TODO(Libp2p Migration): Is this correct? + tracing::error!(%err, "Failed to communicate transfer proof through event loop channel. We will not retry."); + Err(backoff::Error::permanent(anyhow::anyhow!(err).context("Failed to communicate transfer proof through event loop channel"))) } } }) From dce37889d498edc90235e6e9a78d9d05ca1a9025 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Fri, 1 Nov 2024 00:34:42 +0100 Subject: [PATCH 076/112] wip: replace outgoing transfer proof FuturesUnordered with mpsc queue (not tested) --- swap/src/asb/event_loop.rs | 107 ++++++++++++++++++++----------------- swap/src/cli/event_loop.rs | 3 +- 2 files changed, 61 insertions(+), 49 deletions(-) diff --git a/swap/src/asb/event_loop.rs b/swap/src/asb/event_loop.rs index 800573f65..914e9ba16 100644 --- a/swap/src/asb/event_loop.rs +++ b/swap/src/asb/event_loop.rs @@ -61,12 +61,16 @@ where recv_encrypted_signature: HashMap>, inflight_encrypted_signatures: FuturesUnordered>>, - /// Tracks [`transfer_proof::Request`]s which are in queue to be sent to a peer. - /// The future resolves to a tuple of [`PeerId`], [`transfer_proof::Request`] and [`Responder`]. - /// The `PeerId` is the peer to which the request shall be sent, the `transfer_proof::Request` - /// is the request itself and the `Responder` is used to let the original sender know about - /// the success or failure of the transfer. - outgoing_transfer_proof_queue: FuturesUnordered, + outgoing_transfer_proofs: mpsc::UnboundedReceiver<( + PeerId, + transfer_proof::Request, + bmrng::Responder>, + )>, + outgoing_transfer_proofs_sender: mpsc::UnboundedSender<( + PeerId, + transfer_proof::Request, + bmrng::Responder>, + )>, /// Tracks [`transfer_proof::Request`]s which could not yet be sent because /// we are currently disconnected from the peer. @@ -103,6 +107,7 @@ where external_redeem_address: Option, ) -> Result<(Self, mpsc::Receiver)> { let swap_channel = MpscChannels::default(); + let (outgoing_transfer_proofs_sender, outgoing_transfer_proofs) = mpsc::unbounded_channel(); let event_loop = EventLoop { swarm, @@ -117,7 +122,8 @@ where external_redeem_address, recv_encrypted_signature: Default::default(), inflight_encrypted_signatures: Default::default(), - outgoing_transfer_proof_queue: Default::default(), + outgoing_transfer_proofs, + outgoing_transfer_proofs_sender, buffered_transfer_proofs: Default::default(), inflight_transfer_proofs: Default::default(), }; @@ -131,8 +137,6 @@ where pub async fn run(mut self) { // ensure that these streams are NEVER empty, otherwise it will // terminate forever. - self.outgoing_transfer_proof_queue - .push(future::pending().boxed()); self.inflight_encrypted_signatures .push(future::pending().boxed()); @@ -370,9 +374,9 @@ where // We have an established connection to the peer, so we can add the transfer proof to the queue // This is then polled in the next iteration of the event loop, and attempted to be sent to the peer - self.outgoing_transfer_proof_queue.push(async move { - Ok((peer, transfer_proof, responder)) - }.boxed()); + if let Err(e) = self.outgoing_transfer_proofs_sender.send((peer, transfer_proof, responder)) { + tracing::error!(%peer, error = %e, "Failed to forward buffered transfer proof to event loop channel"); + } } } } @@ -391,29 +395,18 @@ where _ => {} } }, - next_transfer_proof = self.outgoing_transfer_proof_queue.next() => { - match next_transfer_proof { - Some(Ok((peer, transfer_proof, responder))) => { - // If we are not connected to the peer, we buffer the transfer proof - // We remove the transfer proof from the queue (send_transfer_proof), and append it buffered_transfer_proofs - if !self.swarm.behaviour_mut().transfer_proof.is_connected(&peer) { - tracing::warn!(%peer, "No active connection to peer, buffering transfer proof"); - self.buffered_transfer_proofs.entry(peer).or_default().push((transfer_proof, responder)); - continue; - } - - // If we are connected to the peer, we attempt to send the transfer proof - let id = self.swarm.behaviour_mut().transfer_proof.send_request(&peer, transfer_proof); - self.inflight_transfer_proofs.insert(id, responder); - }, - Some(Err(error)) => { - tracing::debug!("A swap stopped without sending a transfer proof: {:#}", error); - } - None => { - unreachable!("stream of transfer proof receivers must never terminate") - } + Some((peer, transfer_proof, responder)) = self.outgoing_transfer_proofs.recv() => { + // If we are not connected to the peer, we buffer the transfer proof + if !self.swarm.behaviour_mut().transfer_proof.is_connected(&peer) { + tracing::warn!(%peer, "No active connection to peer, buffering transfer proof"); + self.buffered_transfer_proofs.entry(peer).or_default().push((transfer_proof, responder)); + continue; } - } + + // If we are connected to the peer, we attempt to send the transfer proof + let id = self.swarm.behaviour_mut().transfer_proof.send_request(&peer, transfer_proof); + self.inflight_transfer_proofs.insert(id, responder); + }, Some(response_channel) = self.inflight_encrypted_signatures.next() => { let _ = self.swarm.behaviour_mut().encrypted_signature.send_response(response_channel, ()); } @@ -516,28 +509,46 @@ where /// Create a new [`EventLoopHandle`] that is scoped for communication with /// the given peer. fn new_handle(&mut self, peer: PeerId, swap_id: Uuid) -> EventLoopHandle { - // we deliberately don't put timeouts on these channels because the swap always + // We deliberately don't put timeouts on these channels because the swap always // races these futures against a timelock - let (transfer_proof_sender, mut transfer_proof_receiver) = bmrng::channel(1); let encrypted_signature = bmrng::channel(1); self.recv_encrypted_signature .insert(swap_id, encrypted_signature.0); - self.outgoing_transfer_proof_queue.push( - async move { - let (transfer_proof, responder) = transfer_proof_receiver.recv().await?; - - let request = transfer_proof::Request { - swap_id, - tx_lock_proof: transfer_proof, - }; - - Ok((peer, request, responder)) + // Spawn a task that waits for transfer proofs and forwards them to the event loop + let outgoing_sender = self.outgoing_transfer_proofs_sender.clone(); + tokio::spawn(async move { + loop { + match transfer_proof_receiver.recv().await { + Ok((transfer_proof, responder)) => { + let request = transfer_proof::Request { + swap_id, + tx_lock_proof: transfer_proof, + }; + + if let Err(error) = outgoing_sender.send((peer, request, responder)) { + tracing::error!( + %swap_id, + %peer, + "Failed to forward transfer proof to event loop: {:#}", + error + ); + } + } + Err(error) => { + tracing::debug!( + %swap_id, + %peer, + "Transfer proof channel closed, stopping task: {:#}", + error + ); + break; + } + } } - .boxed(), - ); + }); EventLoopHandle { recv_encrypted_signature: Some(encrypted_signature.1), diff --git a/swap/src/cli/event_loop.rs b/swap/src/cli/event_loop.rs index 7798be153..d37958977 100644 --- a/swap/src/cli/event_loop.rs +++ b/swap/src/cli/event_loop.rs @@ -66,8 +66,9 @@ impl EventLoop { let execution_setup = bmrng::channel_with_timeout(1, Duration::from_secs(60)); let transfer_proof = bmrng::channel(1); // TODO(Libp2p Migration): Is it okay to have a channel without a timeout here? let encrypted_signature = bmrng::channel(1); - let quote = bmrng::channel(1); + let quote = bmrng::channel(1); // TODO(Libp2p Migration): WHY DOES THIS STILL TIMEOUT? let cooperative_xmr_redeem = bmrng::channel_with_timeout(1, Duration::from_secs(60)); + let event_loop = EventLoop { swap_id, swarm, From 5c2ac38b7c2ae3ae18e084b59c8d1a0d5be2e393 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Fri, 1 Nov 2024 12:33:34 +0100 Subject: [PATCH 077/112] feat(cli, libp2p): Propagate network errors for cooperative xmr redeem through event loop channel --- swap/src/cli/event_loop.rs | 64 ++++++++++++++++++++++++-------------- 1 file changed, 40 insertions(+), 24 deletions(-) diff --git a/swap/src/cli/event_loop.rs b/swap/src/cli/event_loop.rs index d37958977..831e1c27f 100644 --- a/swap/src/cli/event_loop.rs +++ b/swap/src/cli/event_loop.rs @@ -1,7 +1,7 @@ use crate::bitcoin::EncryptedSignature; use crate::cli::behaviour::{Behaviour, OutEvent}; use crate::monero; -use crate::network::cooperative_xmr_redeem_after_punish::{Request, Response}; +use crate::network::cooperative_xmr_redeem_after_punish::{self, Request, Response}; use crate::network::encrypted_signature; use crate::network::quote::BidQuote; use crate::network::swap_setup::bob::NewSwap; @@ -29,7 +29,10 @@ pub struct EventLoop { // these streams represents outgoing requests that we have to make quote_requests: bmrng::RequestReceiverStream<(), Result>, - cooperative_xmr_redeem_requests: bmrng::RequestReceiverStream, + cooperative_xmr_redeem_requests: bmrng::RequestReceiverStream< + Uuid, + Result, + >, encrypted_signatures: bmrng::RequestReceiverStream>, swap_setup_requests: bmrng::RequestReceiverStream>, @@ -42,8 +45,10 @@ pub struct EventLoop { inflight_encrypted_signature_requests: HashMap>>, inflight_swap_setup: Option>>, - inflight_cooperative_xmr_redeem_requests: - HashMap>, + inflight_cooperative_xmr_redeem_requests: HashMap< + OutboundRequestId, + bmrng::Responder>, + >, /// The sender we will use to relay incoming transfer proofs. transfer_proof: bmrng::RequestSender, /// The future representing the successful handling of an incoming transfer @@ -135,11 +140,11 @@ impl EventLoop { } // If we are in a state where it is clear that we have already processed the transfer proof, we will acknowledge it immediately - // We do this because, if Alice most likely did not receive the acknowledgment when we sent it before. + // We do this because: Alice most likely did not receive the acknowledgment when we sent it before. // Therefore, we will acknowledge the transfer proof immediately if let Ok(state) = self.db.get_state(swap_id).await { let state: BobState = state.try_into() - .expect("The CLI database only contains Bob states"); + .expect("Bobs database only contains Bob states"); if has_already_processed_transfer_proof(&state) { tracing::warn!("Received transfer proof for swap {} but we are already in state {}. Acknowledging immediately. Alice most likely did not receive the acknowledgment when we sent it before", swap_id, state); @@ -152,9 +157,6 @@ impl EventLoop { continue; } - } else { - tracing::error!("Failed to retrieve state for swap {}. Ignoring transfer proof", swap_id); - continue; } let mut responder = match self.transfer_proof.send(msg.tx_lock_proof).await { @@ -212,12 +214,12 @@ impl EventLoop { } SwarmEvent::Behaviour(OutEvent::CooperativeXmrRedeemFulfilled { id, swap_id, s_a }) => { if let Some(responder) = self.inflight_cooperative_xmr_redeem_requests.remove(&id) { - let _ = responder.respond(Response::Fullfilled { s_a, swap_id }); + let _ = responder.respond(Ok(Response::Fullfilled { s_a, swap_id })); } } SwarmEvent::Behaviour(OutEvent::CooperativeXmrRedeemRejected { id, swap_id, reason }) => { if let Some(responder) = self.inflight_cooperative_xmr_redeem_requests.remove(&id) { - let _ = responder.respond(Response::Rejected { reason, swap_id }); + let _ = responder.respond(Ok(Response::Rejected { reason, swap_id })); } } SwarmEvent::Behaviour(OutEvent::Failure { peer, error }) => { @@ -254,10 +256,25 @@ impl EventLoop { %protocol, "Failed to send request-response request to peer"); + // If we fail to send a request-response request, we should notify the responder that the request failed + // We will remove the responder from the inflight requests and respond with an error + + // Check for encrypted signature requests if let Some(responder) = self.inflight_encrypted_signature_requests.remove(&request_id) { let _ = responder.respond(Err(error)); - } else if let Some(responder) = self.inflight_quote_requests.remove(&request_id) { + continue; + } + + // Check for quote requests + if let Some(responder) = self.inflight_quote_requests.remove(&request_id) { + let _ = responder.respond(Err(error)); + continue; + } + + // Check for cooperative xmr redeem requests + if let Some(responder) = self.inflight_cooperative_xmr_redeem_requests.remove(&request_id) { let _ = responder.respond(Err(error)); + continue; } } SwarmEvent::Behaviour(OutEvent::InboundRequestResponseFailure {peer, error, request_id, protocol}) => { @@ -294,15 +311,7 @@ impl EventLoop { Some(response_channel) = &mut self.pending_transfer_proof => { if let Err(_) = self.swarm.behaviour_mut().transfer_proof.send_response(response_channel, ()) { - tracing::warn!("Failed to send transfer proof acknowledgment. We will retry in 10s"); - - // TOOD(Libp2p Migration): If we fail to respond we should send it again repeatedly until we succeed - - // self.pending_transfer_proof = OptionFuture::from(Some(async move { - // tokio::time::sleep(Duration::from_secs(10)).await; - - // response_channel.clone() - // }.boxed())); + tracing::warn!("Failed to send acknowledgment to Alice that we have received the transfer proof"); } else { self.pending_transfer_proof = OptionFuture::from(None); } @@ -329,7 +338,10 @@ pub struct EventLoopHandle { transfer_proof: bmrng::RequestReceiver, encrypted_signature: bmrng::RequestSender>, quote: bmrng::RequestSender<(), Result>, - cooperative_xmr_redeem: bmrng::RequestSender, + cooperative_xmr_redeem: bmrng::RequestSender< + Uuid, + Result, + >, } impl EventLoopHandle { @@ -357,11 +369,15 @@ impl EventLoopHandle { .send_receive(()) .await .context("Failed to receive quote through event loop channel")? - .context("Failed to request quote over the network") + .context("Failed to request quote due to a network error") } pub async fn request_cooperative_xmr_redeem(&mut self, swap_id: Uuid) -> Result { - Ok(self.cooperative_xmr_redeem.send_receive(swap_id).await?) + self.cooperative_xmr_redeem + .send_receive(swap_id) + .await + .context("Failed to request cooperative XMR redeem through event loop channel")? + .context("Failed to request cooperative XMR redeem due to a network error") } pub async fn send_encrypted_signature( From 58c27934b8f6040eded2c4d9f429b145d0aab411 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Fri, 1 Nov 2024 13:14:06 +0100 Subject: [PATCH 078/112] refactor: add comments to event_loop.rs to document channels used to forward transfer proofs and encrypted signatures --- swap/src/asb/event_loop.rs | 8 ++++++++ swap/src/cli/event_loop.rs | 9 +++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/swap/src/asb/event_loop.rs b/swap/src/asb/event_loop.rs index 914e9ba16..d83fd4949 100644 --- a/swap/src/asb/event_loop.rs +++ b/swap/src/asb/event_loop.rs @@ -59,6 +59,14 @@ where /// Stores incoming [`EncryptedSignature`]s per swap. recv_encrypted_signature: HashMap>, + /// Tracks acknowledgement futures for encrypted signatures that have been forwarded to swap handlers. + /// Initialized with a permanent pending() future to prevent collection from becoming empty. + /// + /// Flow: + /// 1. When signature forwarded via recv_encrypted_signature sender + /// 2. New future pushed here to await swap handler's acknowledgement + /// 3. When future completes, ResponseChannel used to confirm to original peer + /// 4. Future automatically removed from collection inflight_encrypted_signatures: FuturesUnordered>>, outgoing_transfer_proofs: mpsc::UnboundedReceiver<( diff --git a/swap/src/cli/event_loop.rs b/swap/src/cli/event_loop.rs index 831e1c27f..7dc0cce11 100644 --- a/swap/src/cli/event_loop.rs +++ b/swap/src/cli/event_loop.rs @@ -27,7 +27,8 @@ pub struct EventLoop { alice_peer_id: PeerId, db: Arc, - // these streams represents outgoing requests that we have to make + // These streams represents outgoing requests that we have to make + // These are essentially queues of requests that we will send to Alice once we are connected to her. quote_requests: bmrng::RequestReceiverStream<(), Result>, cooperative_xmr_redeem_requests: bmrng::RequestReceiverStream< Uuid, @@ -37,8 +38,9 @@ pub struct EventLoop { bmrng::RequestReceiverStream>, swap_setup_requests: bmrng::RequestReceiverStream>, - // these represents requests that are currently in-flight. - // once we get a response to a matching [`RequestId`], we will use the responder to relay the + // These represents requests that are currently in-flight. + // Meaning that we have sent them to Alice, but we have not yet received a response. + // Once we get a response to a matching [`RequestId`], we will use the responder to relay the // response. inflight_quote_requests: HashMap>>, @@ -246,7 +248,6 @@ impl EventLoop { if let Some(duration) = self.swarm.behaviour_mut().redial.until_next_redial() { tracing::info!(seconds_until_next_redial = %duration.as_secs(), "Waiting for next redial attempt"); } - } SwarmEvent::Behaviour(OutEvent::OutboundRequestResponseFailure {peer, error, request_id, protocol}) => { tracing::error!( From 317af9b248dfdc3b491de38c857b4627c6e9f079 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Fri, 1 Nov 2024 13:15:08 +0100 Subject: [PATCH 079/112] dprint fmt --- swap/src/asb/event_loop.rs | 2 +- swap/src/cli/event_loop.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/swap/src/asb/event_loop.rs b/swap/src/asb/event_loop.rs index d83fd4949..1b320ec84 100644 --- a/swap/src/asb/event_loop.rs +++ b/swap/src/asb/event_loop.rs @@ -61,7 +61,7 @@ where recv_encrypted_signature: HashMap>, /// Tracks acknowledgement futures for encrypted signatures that have been forwarded to swap handlers. /// Initialized with a permanent pending() future to prevent collection from becoming empty. - /// + /// /// Flow: /// 1. When signature forwarded via recv_encrypted_signature sender /// 2. New future pushed here to await swap handler's acknowledgement diff --git a/swap/src/cli/event_loop.rs b/swap/src/cli/event_loop.rs index 7dc0cce11..54fa917e8 100644 --- a/swap/src/cli/event_loop.rs +++ b/swap/src/cli/event_loop.rs @@ -53,6 +53,7 @@ pub struct EventLoop { >, /// The sender we will use to relay incoming transfer proofs. transfer_proof: bmrng::RequestSender, + /// The future representing the successful handling of an incoming transfer /// proof. /// From 614df5e72777442135836cad0afcf011018a8406 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Fri, 1 Nov 2024 13:16:17 +0100 Subject: [PATCH 080/112] fix(cli, libp2p): Remove timeout from event loop channel to relay cooperative xmr redeem requests. This is now handled by propagating network timeouts --- swap/src/cli/event_loop.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swap/src/cli/event_loop.rs b/swap/src/cli/event_loop.rs index 54fa917e8..182942728 100644 --- a/swap/src/cli/event_loop.rs +++ b/swap/src/cli/event_loop.rs @@ -75,7 +75,7 @@ impl EventLoop { let transfer_proof = bmrng::channel(1); // TODO(Libp2p Migration): Is it okay to have a channel without a timeout here? let encrypted_signature = bmrng::channel(1); let quote = bmrng::channel(1); // TODO(Libp2p Migration): WHY DOES THIS STILL TIMEOUT? - let cooperative_xmr_redeem = bmrng::channel_with_timeout(1, Duration::from_secs(60)); + let cooperative_xmr_redeem = bmrng::channel(1); let event_loop = EventLoop { swap_id, From 147c3c43332fa21b84915b3f31ec3317d450f512 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Fri, 1 Nov 2024 13:18:24 +0100 Subject: [PATCH 081/112] refactor: destructure bmrng channel in asb EventLoopHandle --- swap/src/asb/event_loop.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/swap/src/asb/event_loop.rs b/swap/src/asb/event_loop.rs index 1b320ec84..93046d13b 100644 --- a/swap/src/asb/event_loop.rs +++ b/swap/src/asb/event_loop.rs @@ -520,10 +520,10 @@ where // We deliberately don't put timeouts on these channels because the swap always // races these futures against a timelock let (transfer_proof_sender, mut transfer_proof_receiver) = bmrng::channel(1); - let encrypted_signature = bmrng::channel(1); + let (encrypted_signature_sender, encrypted_signature_receiver) = bmrng::channel(1); self.recv_encrypted_signature - .insert(swap_id, encrypted_signature.0); + .insert(swap_id, encrypted_signature_sender); // Spawn a task that waits for transfer proofs and forwards them to the event loop let outgoing_sender = self.outgoing_transfer_proofs_sender.clone(); @@ -559,7 +559,7 @@ where }); EventLoopHandle { - recv_encrypted_signature: Some(encrypted_signature.1), + recv_encrypted_signature: Some(encrypted_signature_receiver), transfer_proof_sender: Some(transfer_proof_sender), } } From 9ca133a29167f88979832490fa5737703010c111 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Fri, 1 Nov 2024 13:32:13 +0100 Subject: [PATCH 082/112] feat(asb, libp2p): Build transfer proof within EventLoopHandle, remove tokio task which was used to forward transfer proof from one channel to another, send transfer proof directly to event loop channel --- swap/src/asb/event_loop.rs | 102 ++++++++++++++++++------------------- 1 file changed, 49 insertions(+), 53 deletions(-) diff --git a/swap/src/asb/event_loop.rs b/swap/src/asb/event_loop.rs index 93046d13b..81fe726a1 100644 --- a/swap/src/asb/event_loop.rs +++ b/swap/src/asb/event_loop.rs @@ -57,8 +57,9 @@ where swap_sender: mpsc::Sender, - /// Stores incoming [`EncryptedSignature`]s per swap. + /// Stores channels to send [`EncryptedSignature`]s to the swap handler per swap. recv_encrypted_signature: HashMap>, + /// Tracks acknowledgement futures for encrypted signatures that have been forwarded to swap handlers. /// Initialized with a permanent pending() future to prevent collection from becoming empty. /// @@ -69,16 +70,20 @@ where /// 4. Future automatically removed from collection inflight_encrypted_signatures: FuturesUnordered>>, - outgoing_transfer_proofs: mpsc::UnboundedReceiver<( - PeerId, - transfer_proof::Request, - bmrng::Responder>, - )>, - outgoing_transfer_proofs_sender: mpsc::UnboundedSender<( - PeerId, - transfer_proof::Request, - bmrng::Responder>, - )>, + /// Channel for sending transfer proofs to peers. The sender is shared with swap execution + /// handlers while the receiver is polled by the event loop. When a transfer proof needs + /// to be sent: + /// 1. Swap handler sends (PeerId, Request) through sender + /// 2. Event loop receives and attempts to send to peer + /// 3. Result (Ok or network failure) is sent back to handler + outgoing_transfer_proofs: bmrng::unbounded::UnboundedRequestReceiver< + (PeerId, transfer_proof::Request), + Result<(), OutboundFailure>, + >, + outgoing_transfer_proofs_sender: bmrng::unbounded::UnboundedRequestSender< + (PeerId, transfer_proof::Request), + Result<(), OutboundFailure>, + >, /// Tracks [`transfer_proof::Request`]s which could not yet be sent because /// we are currently disconnected from the peer. @@ -88,14 +93,16 @@ where PeerId, Vec<( transfer_proof::Request, - bmrng::Responder>, + bmrng::unbounded::UnboundedResponder>, )>, >, /// Tracks [`transfer_proof::Request`]s which are currently inflight and /// awaiting an acknowledgement. - inflight_transfer_proofs: - HashMap>>, + inflight_transfer_proofs: HashMap< + OutboundRequestId, + bmrng::unbounded::UnboundedResponder>, + >, } impl EventLoop @@ -115,7 +122,8 @@ where external_redeem_address: Option, ) -> Result<(Self, mpsc::Receiver)> { let swap_channel = MpscChannels::default(); - let (outgoing_transfer_proofs_sender, outgoing_transfer_proofs) = mpsc::unbounded_channel(); + let (outgoing_transfer_proofs_sender, outgoing_transfer_proofs) = + bmrng::unbounded::channel(); let event_loop = EventLoop { swarm, @@ -382,7 +390,7 @@ where // We have an established connection to the peer, so we can add the transfer proof to the queue // This is then polled in the next iteration of the event loop, and attempted to be sent to the peer - if let Err(e) = self.outgoing_transfer_proofs_sender.send((peer, transfer_proof, responder)) { + if let Err(e) = self.outgoing_transfer_proofs_sender.send((peer, transfer_proof)) { tracing::error!(%peer, error = %e, "Failed to forward buffered transfer proof to event loop channel"); } } @@ -403,7 +411,7 @@ where _ => {} } }, - Some((peer, transfer_proof, responder)) = self.outgoing_transfer_proofs.recv() => { + Ok(((peer, transfer_proof), responder)) = self.outgoing_transfer_proofs.recv() => { // If we are not connected to the peer, we buffer the transfer proof if !self.swarm.behaviour_mut().transfer_proof.is_connected(&peer) { tracing::warn!(%peer, "No active connection to peer, buffering transfer proof"); @@ -519,46 +527,16 @@ where fn new_handle(&mut self, peer: PeerId, swap_id: Uuid) -> EventLoopHandle { // We deliberately don't put timeouts on these channels because the swap always // races these futures against a timelock - let (transfer_proof_sender, mut transfer_proof_receiver) = bmrng::channel(1); let (encrypted_signature_sender, encrypted_signature_receiver) = bmrng::channel(1); self.recv_encrypted_signature .insert(swap_id, encrypted_signature_sender); - // Spawn a task that waits for transfer proofs and forwards them to the event loop - let outgoing_sender = self.outgoing_transfer_proofs_sender.clone(); - tokio::spawn(async move { - loop { - match transfer_proof_receiver.recv().await { - Ok((transfer_proof, responder)) => { - let request = transfer_proof::Request { - swap_id, - tx_lock_proof: transfer_proof, - }; - - if let Err(error) = outgoing_sender.send((peer, request, responder)) { - tracing::error!( - %swap_id, - %peer, - "Failed to forward transfer proof to event loop: {:#}", - error - ); - } - } - Err(error) => { - tracing::debug!( - %swap_id, - %peer, - "Transfer proof channel closed, stopping task: {:#}", - error - ); - break; - } - } - } - }); + let transfer_proof_sender = self.outgoing_transfer_proofs_sender.clone(); EventLoopHandle { + swap_id, + peer, recv_encrypted_signature: Some(encrypted_signature_receiver), transfer_proof_sender: Some(transfer_proof_sender), } @@ -629,12 +607,28 @@ impl LatestRate for KrakenRate { #[derive(Debug)] pub struct EventLoopHandle { + swap_id: Uuid, + peer: PeerId, recv_encrypted_signature: Option>, - transfer_proof_sender: - Option>>, + transfer_proof_sender: Option< + bmrng::unbounded::UnboundedRequestSender< + (PeerId, transfer_proof::Request), + Result<(), OutboundFailure>, + >, + >, } impl EventLoopHandle { + fn build_transfer_proof_request( + &self, + transfer_proof: monero::TransferProof, + ) -> transfer_proof::Request { + transfer_proof::Request { + swap_id: self.swap_id, + tx_lock_proof: transfer_proof, + } + } + pub async fn recv_encrypted_signature(&mut self) -> Result { let receiver = self .recv_encrypted_signature @@ -665,8 +659,10 @@ impl EventLoopHandle { .with_max_interval(Duration::from_secs(60)) .build(); + let transfer_proof = self.build_transfer_proof_request(msg); + let result = backoff::future::retry(backoff, || async { - match sender.send_receive(msg.clone()).await { + match sender.send_receive((self.peer, transfer_proof.clone())).await { Ok(Ok(_)) => Ok(()), Ok(Err(err)) => { // We failed to send the transfer proof due to a network error From fcf81708a4ee7c855129550b3ed92aa7f2b5900a Mon Sep 17 00:00:00 2001 From: binarybaron Date: Fri, 1 Nov 2024 14:03:22 +0100 Subject: [PATCH 083/112] feat(asb, libp2p): Acknowledge encrypted signature if we are in a state where it is clear we have already processed it --- swap/src/asb/event_loop.rs | 24 ++++++++++++++++++++++++ swap/src/cli/event_loop.rs | 6 +++--- swap/src/protocol/alice/swap.rs | 12 ++++++++++++ swap/src/protocol/bob/swap.rs | 18 ++++++++++++++---- 4 files changed, 53 insertions(+), 7 deletions(-) diff --git a/swap/src/asb/event_loop.rs b/swap/src/asb/event_loop.rs index 81fe726a1..0e0d71e5c 100644 --- a/swap/src/asb/event_loop.rs +++ b/swap/src/asb/event_loop.rs @@ -5,6 +5,7 @@ use crate::network::cooperative_xmr_redeem_after_punish::Response::{Fullfilled, use crate::network::quote::BidQuote; use crate::network::swap_setup::alice::WalletSnapshot; use crate::network::transfer_proof; +use crate::protocol::alice::swap::has_already_processed_enc_sig; use crate::protocol::alice::{AliceState, State3, Swap}; use crate::protocol::{Database, State}; use crate::{bitcoin, env, kraken, monero}; @@ -273,10 +274,33 @@ where continue; } + // Immediately acknowledge if we've already processed this encrypted signature + // This handles the case where Bob didn't receive our previous acknowledgment + // and is retrying sending the encrypted signature + if let Ok(state) = self.db.get_state(swap_id).await { + let state: AliceState = state.try_into() + .expect("Alices database only contains Alice states"); + + // Check if we have already processed the encrypted signature + if has_already_processed_enc_sig(&state) { + tracing::info!(%swap_id, "Received encrypted signature for swap in state {}. We have already processed this encrypted signature. Acknowledging immediately.", state); + + // We push create a future that will resolve immediately, and returns the channel + // This will be resolved in the next iteration of the event loop, and the acknowledgment will be sent to Bob + self.inflight_encrypted_signatures.push(async move { + channel + }.boxed()); + + continue; + } + } + let sender = match self.recv_encrypted_signature.remove(&swap_id) { Some(sender) => sender, None => { // TODO: Don't just drop encsig if we currently don't have a running swap for it, save in db + // 1. Save the encrypted signature in the database + // 2. Acknowledge the receipt of the encrypted signature tracing::warn!(%swap_id, "No sender for encrypted signature, maybe already handled?"); continue; } diff --git a/swap/src/cli/event_loop.rs b/swap/src/cli/event_loop.rs index 182942728..a6792f8eb 100644 --- a/swap/src/cli/event_loop.rs +++ b/swap/src/cli/event_loop.rs @@ -142,9 +142,9 @@ impl EventLoop { continue; } - // If we are in a state where it is clear that we have already processed the transfer proof, we will acknowledge it immediately - // We do this because: Alice most likely did not receive the acknowledgment when we sent it before. - // Therefore, we will acknowledge the transfer proof immediately + // Immediately acknowledge if we've already processed this transfer proof + // This handles the case where Alice didn't receive our previous acknowledgment + // and is retrying sending the transfer proof if let Ok(state) = self.db.get_state(swap_id).await { let state: BobState = state.try_into() .expect("Bobs database only contains Bob states"); diff --git a/swap/src/protocol/alice/swap.rs b/swap/src/protocol/alice/swap.rs index a8e7d8d1f..0b1d6fde3 100644 --- a/swap/src/protocol/alice/swap.rs +++ b/swap/src/protocol/alice/swap.rs @@ -422,3 +422,15 @@ pub(crate) fn is_complete(state: &AliceState) -> bool { | AliceState::SafelyAborted ) } + +/// This function is used to check if Alice is in a state where it is clear that she has already received the encrypted signature from Bob. +/// This allows us to acknowledge the encrypted signature multiple times +/// If our acknowledgement does not reach Bob, he might send the encrypted signature again. +pub(crate) fn has_already_processed_enc_sig(state: &AliceState) -> bool { + matches!( + state, + AliceState::EncSigLearned { .. } + | AliceState::BtcRedeemTransactionPublished { .. } + | AliceState::BtcRedeemed + ) +} diff --git a/swap/src/protocol/bob/swap.rs b/swap/src/protocol/bob/swap.rs index d3281e165..c6dfd3092 100644 --- a/swap/src/protocol/bob/swap.rs +++ b/swap/src/protocol/bob/swap.rs @@ -19,12 +19,22 @@ pub fn is_complete(state: &BobState) -> bool { ) } +/// Identifies states that have already processed the transfer proof. +/// This is used to be able to acknowledge the transfer proof multiple times (if it was already processed). +/// This is necessary because sometimes our acknowledgement might not reach Alice. pub fn has_already_processed_transfer_proof(state: &BobState) -> bool { - // After the XmrLockProofReceived state, we have already processed the transfer proof - // This match statement MUST match all states before XmrLockProofReceived - !matches!( + // This match statement MUST match all states which Bob can enter after receiving the transfer proof. + matches!( state, - BobState::Started { .. } | BobState::SwapSetupCompleted { .. } | BobState::BtcLocked { .. } + BobState::XmrLockProofReceived { .. } + | BobState::XmrLocked(..) + | BobState::EncSigSent(..) + | BobState::BtcRedeemed(..) + | BobState::CancelTimelockExpired(..) + | BobState::BtcCancelled(..) + | BobState::BtcRefunded(..) + | BobState::XmrRedeemed { .. } + | BobState::BtcPunished { .. } ) } From 1c59eaba890abb811b1fcdf3c6e72864731521a7 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Fri, 1 Nov 2024 14:04:20 +0100 Subject: [PATCH 084/112] refactor: remove unused OutgoingTransferProof type --- swap/src/asb/event_loop.rs | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/swap/src/asb/event_loop.rs b/swap/src/asb/event_loop.rs index 0e0d71e5c..7eb7bf784 100644 --- a/swap/src/asb/event_loop.rs +++ b/swap/src/asb/event_loop.rs @@ -25,22 +25,6 @@ use std::time::Duration; use tokio::sync::mpsc; use uuid::Uuid; -/// A future that resolves to a tuple of `PeerId`, `transfer_proof::Request` and -/// `Responder`. -/// -/// When this future resolves, the `transfer_proof::Request` shall be sent to -/// the peer identified by the `PeerId`. Once the request has been acknowledged -/// by the peer, i.e. a `()` response has been received, the `Responder` shall -/// be used to let the original sender know about the successful transfer. -type OutgoingTransferProof = BoxFuture< - 'static, - Result<( - PeerId, - transfer_proof::Request, - bmrng::Responder>, - )>, ->; - #[allow(missing_debug_implementations)] pub struct EventLoop where From 0a5bde610a4f543ab3ad3670253d134498e6ca1c Mon Sep 17 00:00:00 2001 From: binarybaron Date: Fri, 1 Nov 2024 18:23:52 +0100 Subject: [PATCH 085/112] refactor: Use tokio oneshot channel to relay transfer proof acknowledgement to EventLoopHandler --- swap/src/asb/event_loop.rs | 104 ++++++++++++++++++++----------------- 1 file changed, 56 insertions(+), 48 deletions(-) diff --git a/swap/src/asb/event_loop.rs b/swap/src/asb/event_loop.rs index 7eb7bf784..2fee6ae1e 100644 --- a/swap/src/asb/event_loop.rs +++ b/swap/src/asb/event_loop.rs @@ -22,7 +22,7 @@ use std::convert::{Infallible, TryInto}; use std::fmt::Debug; use std::sync::Arc; use std::time::Duration; -use tokio::sync::mpsc; +use tokio::sync::{mpsc, oneshot}; use uuid::Uuid; #[allow(missing_debug_implementations)] @@ -61,14 +61,16 @@ where /// 1. Swap handler sends (PeerId, Request) through sender /// 2. Event loop receives and attempts to send to peer /// 3. Result (Ok or network failure) is sent back to handler - outgoing_transfer_proofs: bmrng::unbounded::UnboundedRequestReceiver< - (PeerId, transfer_proof::Request), - Result<(), OutboundFailure>, - >, - outgoing_transfer_proofs_sender: bmrng::unbounded::UnboundedRequestSender< - (PeerId, transfer_proof::Request), - Result<(), OutboundFailure>, - >, + outgoing_transfer_proofs: tokio::sync::mpsc::UnboundedReceiver<( + PeerId, + transfer_proof::Request, + oneshot::Sender>, + )>, + outgoing_transfer_proofs_sender: tokio::sync::mpsc::UnboundedSender<( + PeerId, + transfer_proof::Request, + oneshot::Sender>, + )>, /// Tracks [`transfer_proof::Request`]s which could not yet be sent because /// we are currently disconnected from the peer. @@ -78,16 +80,14 @@ where PeerId, Vec<( transfer_proof::Request, - bmrng::unbounded::UnboundedResponder>, + oneshot::Sender>, )>, >, /// Tracks [`transfer_proof::Request`]s which are currently inflight and /// awaiting an acknowledgement. - inflight_transfer_proofs: HashMap< - OutboundRequestId, - bmrng::unbounded::UnboundedResponder>, - >, + inflight_transfer_proofs: + HashMap>>, } impl EventLoop @@ -108,7 +108,7 @@ where ) -> Result<(Self, mpsc::Receiver)> { let swap_channel = MpscChannels::default(); let (outgoing_transfer_proofs_sender, outgoing_transfer_proofs) = - bmrng::unbounded::channel(); + tokio::sync::mpsc::unbounded_channel(); let event_loop = EventLoop { swarm, @@ -229,7 +229,7 @@ where SwarmEvent::Behaviour(OutEvent::TransferProofAcknowledged { peer, id }) => { tracing::debug!(%peer, "Bob acknowledged transfer proof"); if let Some(responder) = self.inflight_transfer_proofs.remove(&id) { - let _ = responder.respond(Ok(())); + let _ = responder.send(Ok(())); } } SwarmEvent::Behaviour(OutEvent::EncryptedSignatureReceived{ msg, channel, peer }) => { @@ -372,7 +372,7 @@ where "Failed to send request-response request to peer"); if let Some(responder) = self.inflight_transfer_proofs.remove(&request_id) { - let _ = responder.respond(Err(error)); + let _ = responder.send(Err(error)); } } SwarmEvent::Behaviour(OutEvent::InboundRequestResponseFailure {peer, error, request_id, protocol}) => { @@ -398,7 +398,7 @@ where // We have an established connection to the peer, so we can add the transfer proof to the queue // This is then polled in the next iteration of the event loop, and attempted to be sent to the peer - if let Err(e) = self.outgoing_transfer_proofs_sender.send((peer, transfer_proof)) { + if let Err(e) = self.outgoing_transfer_proofs_sender.send((peer, transfer_proof, responder)) { tracing::error!(%peer, error = %e, "Failed to forward buffered transfer proof to event loop channel"); } } @@ -419,7 +419,7 @@ where _ => {} } }, - Ok(((peer, transfer_proof), responder)) = self.outgoing_transfer_proofs.recv() => { + Some((peer, transfer_proof, responder)) = self.outgoing_transfer_proofs.recv() => { // If we are not connected to the peer, we buffer the transfer proof if !self.swarm.behaviour_mut().transfer_proof.is_connected(&peer) { tracing::warn!(%peer, "No active connection to peer, buffering transfer proof"); @@ -453,13 +453,20 @@ where let balance = self.monero_wallet.get_balance().await?; // use unlocked monero balance for quote - let xmr = Amount::from_piconero(balance.unlocked_balance); + let xmr_balance = Amount::from_piconero(balance.unlocked_balance); - let max_bitcoin_for_monero = xmr - .max_bitcoin_for_price(ask_price) - .ok_or_else(|| anyhow!("Bitcoin price ({}) x Monero ({}) overflow", ask_price, xmr))?; + let max_bitcoin_for_monero = + xmr_balance + .max_bitcoin_for_price(ask_price) + .ok_or_else(|| { + anyhow!( + "Bitcoin price ({}) x Monero ({}) overflow", + ask_price, + xmr_balance + ) + })?; - tracing::debug!(%ask_price, %xmr, %max_bitcoin_for_monero); + tracing::debug!(%ask_price, %xmr_balance, %max_bitcoin_for_monero, "Computed quote"); if min_buy > max_bitcoin_for_monero { tracing::warn!( @@ -619,10 +626,11 @@ pub struct EventLoopHandle { peer: PeerId, recv_encrypted_signature: Option>, transfer_proof_sender: Option< - bmrng::unbounded::UnboundedRequestSender< - (PeerId, transfer_proof::Request), - Result<(), OutboundFailure>, - >, + tokio::sync::mpsc::UnboundedSender<( + PeerId, + transfer_proof::Request, + oneshot::Sender>, + )>, >, } @@ -670,30 +678,30 @@ impl EventLoopHandle { let transfer_proof = self.build_transfer_proof_request(msg); let result = backoff::future::retry(backoff, || async { - match sender.send_receive((self.peer, transfer_proof.clone())).await { - Ok(Ok(_)) => Ok(()), - Ok(Err(err)) => { - // We failed to send the transfer proof due to a network error - // We will retry by sending the transfer proof into the event loop channel again - // TODO(Libp2p Migration): This does not work currently because there is a only a single receiver for the channel (spawned in new_handle). Once the first proof has been received, the receiver is dropped and we cannot send another proof - tracing::warn!(%err, "Failed to send transfer proof due to a network error. We will retry"); - Err(backoff::Error::transient(anyhow!(err))) - } - Err(err) => { - match err { - bmrng::error::RequestError::RecvTimeoutError => { - unreachable!("We construct the channel without a timeout, so this should never happen") + // Create a oneshot channel to receive the acknowledgment of the transfer proof + let (singular_sender, singular_receiver) = oneshot::channel(); + + match sender.send((self.peer, transfer_proof.clone(), singular_sender)) { + Ok(()) => { + match singular_receiver.await + .context("Failed to receive transfer proof acknowledgment")? { + Ok(()) => { + return Ok(()); } - bmrng::error::RequestError::RecvError | bmrng::error::RequestError::SendError(_) => { - // The MSCP channel has failed. We do not retry this because this error means that either the channel was closed or the receiver has been dropped. - // Both of these cases are permanent and we should not retry. - - // TODO(Libp2p Migration): Is this correct? - tracing::error!(%err, "Failed to communicate transfer proof through event loop channel. We will not retry."); - Err(backoff::Error::permanent(anyhow!(err).context("Failed to communicate transfer proof through event loop channel"))) + Err(err) => { + // We failed to send the transfer proof due to a network error + // We will retry by sending the transfer proof into the event loop channel again + // TODO(Libp2p Migration): This does not work currently because there is a only a single receiver for the channel (spawned in new_handle). Once the first proof has been received, the receiver is dropped and we cannot send another proof + tracing::warn!(%err, "Failed to send transfer proof due to a network error. We will retry"); + Err(backoff::Error::transient(anyhow!(err))) } } } + Err(err) => { + // TODO(Libp2p Migration): Is this correct? + tracing::error!(%err, "Failed to communicate transfer proof through event loop channel. We will not retry."); + Err(backoff::Error::permanent(anyhow!(err).context("Failed to communicate transfer proof through event loop channel"))) + } } }) .await?; From c3a4b104a4d3143d1d38319e62e297616d0840b4 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Sat, 2 Nov 2024 14:50:38 +0100 Subject: [PATCH 086/112] refactor: Add comments to transfer proof event loop logic --- swap/src/asb/event_loop.rs | 90 +++++++++++++++++++++----------------- 1 file changed, 50 insertions(+), 40 deletions(-) diff --git a/swap/src/asb/event_loop.rs b/swap/src/asb/event_loop.rs index 2fee6ae1e..c2d34ff2c 100644 --- a/swap/src/asb/event_loop.rs +++ b/swap/src/asb/event_loop.rs @@ -42,26 +42,34 @@ where swap_sender: mpsc::Sender, - /// Stores channels to send [`EncryptedSignature`]s to the swap handler per swap. + /// Stores where to send [`EncryptedSignature`]s to + /// The corresponding receiver for this channel is stored in the EventLoopHandle + /// that is responsible for the swap. + /// + /// Once a [`EncryptedSignature`] has been sent to the EventLoopHandle, + /// the sender is removed from this map. recv_encrypted_signature: HashMap>, - /// Tracks acknowledgement futures for encrypted signatures that have been forwarded to swap handlers. - /// Initialized with a permanent pending() future to prevent collection from becoming empty. + /// Once we receive an [`EncryptedSignature`] from Bob, we forward it to the EventLoopHandle. + /// Once the EventLoopHandle acknowledges the receipt of the [`EncryptedSignature`], we need to confirm this to Bob. + /// When the EventLoopHandle acknowledges the receipt, a future in this collection resolves and returns the libp2p channel + /// which we use to confirm to Bob that we have received the [`EncryptedSignature`]. /// /// Flow: /// 1. When signature forwarded via recv_encrypted_signature sender - /// 2. New future pushed here to await swap handler's acknowledgement - /// 3. When future completes, ResponseChannel used to confirm to original peer - /// 4. Future automatically removed from collection + /// 2. New future pushed here to await EventLoopHandle's acknowledgement + /// 3. When future completes, ResponseChannel used to confirm to Bob + /// 4. Future is removed from this collection inflight_encrypted_signatures: FuturesUnordered>>, - /// Channel for sending transfer proofs to peers. The sender is shared with swap execution - /// handlers while the receiver is polled by the event loop. When a transfer proof needs - /// to be sent: - /// 1. Swap handler sends (PeerId, Request) through sender + /// Channel for sending transfer proofs to Bobs. The sender is shared with every EventLoopHandle. + /// The receiver is polled by the event loop to send transfer proofs over the network to Bob. + /// + /// Flow: + /// 1. EventLoopHandle sends (PeerId, Request, Responder) through sender /// 2. Event loop receives and attempts to send to peer - /// 3. Result (Ok or network failure) is sent back to handler - outgoing_transfer_proofs: tokio::sync::mpsc::UnboundedReceiver<( + /// 3. Result (Ok or network failure) is sent back to EventLoopHandle + outgoing_transfer_proofs_receiver: tokio::sync::mpsc::UnboundedReceiver<( PeerId, transfer_proof::Request, oneshot::Sender>, @@ -72,10 +80,12 @@ where oneshot::Sender>, )>, - /// Tracks [`transfer_proof::Request`]s which could not yet be sent because - /// we are currently disconnected from the peer. + /// Temporarily stores transfer proof requests for peers that are currently disconnected. /// - /// If we are not connected to the peer, the transfer proof is essentially moved from [`outgoing_transfer_proof_queue`] to here. + /// When a transfer proof cannot be sent because there's no connection to the peer: + /// 1. It is moved from [`outgoing_transfer_proofs_receiver`] to this buffer + /// 2. Once a connection is established with the peer, the proof is send back into the [`outgoing_transfer_proofs_sender`] + /// 3. The buffered request is then removed from this collection buffered_transfer_proofs: HashMap< PeerId, Vec<( @@ -84,8 +94,13 @@ where )>, >, - /// Tracks [`transfer_proof::Request`]s which are currently inflight and - /// awaiting an acknowledgement. + /// Tracks [`transfer_proof::Request`]s which are currently inflight and awaiting an acknowledgement from Bob + /// + /// When a transfer proof is sent to Bob: + /// 1. A unique request ID is generated by libp2p + /// 2. The response channel is stored in this map with the request ID as key + /// 3. When Bob acknowledges the proof, we use the stored channel to notify the EventLoopHandle + /// 4. The entry is then removed from this map inflight_transfer_proofs: HashMap>>, } @@ -107,7 +122,7 @@ where external_redeem_address: Option, ) -> Result<(Self, mpsc::Receiver)> { let swap_channel = MpscChannels::default(); - let (outgoing_transfer_proofs_sender, outgoing_transfer_proofs) = + let (outgoing_transfer_proofs_sender, outgoing_transfer_proofs_receiver) = tokio::sync::mpsc::unbounded_channel(); let event_loop = EventLoop { @@ -123,7 +138,7 @@ where external_redeem_address, recv_encrypted_signature: Default::default(), inflight_encrypted_signatures: Default::default(), - outgoing_transfer_proofs, + outgoing_transfer_proofs_receiver, outgoing_transfer_proofs_sender, buffered_transfer_proofs: Default::default(), inflight_transfer_proofs: Default::default(), @@ -228,6 +243,7 @@ where } SwarmEvent::Behaviour(OutEvent::TransferProofAcknowledged { peer, id }) => { tracing::debug!(%peer, "Bob acknowledged transfer proof"); + if let Some(responder) = self.inflight_transfer_proofs.remove(&id) { let _ = responder.send(Ok(())); } @@ -267,7 +283,7 @@ where // Check if we have already processed the encrypted signature if has_already_processed_enc_sig(&state) { - tracing::info!(%swap_id, "Received encrypted signature for swap in state {}. We have already processed this encrypted signature. Acknowledging immediately.", state); + tracing::warn!(%swap_id, "Received encrypted signature for swap in state {}. We have already processed this encrypted signature. Acknowledging immediately.", state); // We push create a future that will resolve immediately, and returns the channel // This will be resolved in the next iteration of the event loop, and the acknowledgment will be sent to Bob @@ -419,7 +435,7 @@ where _ => {} } }, - Some((peer, transfer_proof, responder)) = self.outgoing_transfer_proofs.recv() => { + Some((peer, transfer_proof, responder)) = self.outgoing_transfer_proofs_receiver.recv() => { // If we are not connected to the peer, we buffer the transfer proof if !self.swarm.behaviour_mut().transfer_proof.is_connected(&peer) { tracing::warn!(%peer, "No active connection to peer, buffering transfer proof"); @@ -681,26 +697,20 @@ impl EventLoopHandle { // Create a oneshot channel to receive the acknowledgment of the transfer proof let (singular_sender, singular_receiver) = oneshot::channel(); - match sender.send((self.peer, transfer_proof.clone(), singular_sender)) { - Ok(()) => { - match singular_receiver.await - .context("Failed to receive transfer proof acknowledgment")? { - Ok(()) => { - return Ok(()); - } - Err(err) => { - // We failed to send the transfer proof due to a network error - // We will retry by sending the transfer proof into the event loop channel again - // TODO(Libp2p Migration): This does not work currently because there is a only a single receiver for the channel (spawned in new_handle). Once the first proof has been received, the receiver is dropped and we cannot send another proof - tracing::warn!(%err, "Failed to send transfer proof due to a network error. We will retry"); - Err(backoff::Error::transient(anyhow!(err))) - } - } + if let Err(err) = sender.send((self.peer, transfer_proof.clone(), singular_sender)) { + let err = anyhow!(err).context("Failed to communicate transfer proof through event loop channel"); + tracing::error!(%err, swap_id = %self.swap_id, "Failed to send transfer proof"); + return Err(backoff::Error::permanent(err)); + } + + match singular_receiver.await { + Ok(Ok(())) => Ok(()), + Ok(Err(err)) => { + tracing::warn!(%err, "Failed to send transfer proof due to a network error. We will retry"); + Err(backoff::Error::transient(anyhow!(err))) } - Err(err) => { - // TODO(Libp2p Migration): Is this correct? - tracing::error!(%err, "Failed to communicate transfer proof through event loop channel. We will not retry."); - Err(backoff::Error::permanent(anyhow!(err).context("Failed to communicate transfer proof through event loop channel"))) + Err(_) => { + unreachable!("The sender channel should never be closed without sending a response"); } } }) From f2c88d72700fb18003508df7833b14ced9275991 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Sat, 2 Nov 2024 14:55:59 +0100 Subject: [PATCH 087/112] refactor: add comments in asb/event_loop.rs::EventLoopHandle::recv_encrypted_signature --- swap/src/asb/event_loop.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/swap/src/asb/event_loop.rs b/swap/src/asb/event_loop.rs index c2d34ff2c..3ec802672 100644 --- a/swap/src/asb/event_loop.rs +++ b/swap/src/asb/event_loop.rs @@ -556,10 +556,13 @@ where /// Create a new [`EventLoopHandle`] that is scoped for communication with /// the given peer. fn new_handle(&mut self, peer: PeerId, swap_id: Uuid) -> EventLoopHandle { - // We deliberately don't put timeouts on these channels because the swap always - // races these futures against a timelock + // Create a new bmrng channel for receiving encrypted signatures from Bob + // The channel has a capacity of 1 since we only expect one signature per swap let (encrypted_signature_sender, encrypted_signature_receiver) = bmrng::channel(1); + // Store the sender in the EventLoop + // The receiver is stored in the EventLoopHandle + // When a signature is received, the EventLoop uses the stored channel to notify the EventLoopHandle self.recv_encrypted_signature .insert(swap_id, encrypted_signature_sender); @@ -669,6 +672,9 @@ impl EventLoopHandle { let (tx_redeem_encsig, responder) = receiver.recv().await?; + // Acknowledge receipt of the encrypted signature + // This notifies the EventLoop that the signature has been received + // The EventLoop can then send an acknowledgement back to Bob over the network responder .respond(()) .context("Failed to acknowledge receipt of encrypted signature")?; From 97206e7c9df480eb156ba43778258949f551181e Mon Sep 17 00:00:00 2001 From: binarybaron Date: Sat, 2 Nov 2024 15:26:44 +0100 Subject: [PATCH 088/112] refactor(cli/event_loop.rs): Rename variables in EventLoop, EventLoopHandle. Remove redundant swap_id parameter from cooperative xmr redeem channels --- swap/src/cli/event_loop.rs | 99 +++++++++++++++++++++++------------ swap/src/protocol/bob/swap.rs | 4 +- 2 files changed, 66 insertions(+), 37 deletions(-) diff --git a/swap/src/cli/event_loop.rs b/swap/src/cli/event_loop.rs index a6792f8eb..fa113a0d8 100644 --- a/swap/src/cli/event_loop.rs +++ b/swap/src/cli/event_loop.rs @@ -31,7 +31,7 @@ pub struct EventLoop { // These are essentially queues of requests that we will send to Alice once we are connected to her. quote_requests: bmrng::RequestReceiverStream<(), Result>, cooperative_xmr_redeem_requests: bmrng::RequestReceiverStream< - Uuid, + (), Result, >, encrypted_signatures: @@ -51,8 +51,10 @@ pub struct EventLoop { OutboundRequestId, bmrng::Responder>, >, - /// The sender we will use to relay incoming transfer proofs. - transfer_proof: bmrng::RequestSender, + + /// The sender we will use to relay incoming transfer proofs to the EventLoopHandle + /// The corresponding receiver is stored in the EventLoopHandle + transfer_proof_sender: bmrng::RequestSender, /// The future representing the successful handling of an incoming transfer /// proof. @@ -71,21 +73,25 @@ impl EventLoop { alice_peer_id: PeerId, db: Arc, ) -> Result<(Self, EventLoopHandle)> { - let execution_setup = bmrng::channel_with_timeout(1, Duration::from_secs(60)); - let transfer_proof = bmrng::channel(1); // TODO(Libp2p Migration): Is it okay to have a channel without a timeout here? - let encrypted_signature = bmrng::channel(1); - let quote = bmrng::channel(1); // TODO(Libp2p Migration): WHY DOES THIS STILL TIMEOUT? - let cooperative_xmr_redeem = bmrng::channel(1); + // We still use a timeout here, as it is unclear how the the swap_setup protocol enforces timeouts + let (execution_setup_sender, execution_setup_receiver) = + bmrng::channel_with_timeout(1, Duration::from_secs(60)); + + // It is okay to not have a timeout here, as timeouts are enforced by the request-response protocol + let (transfer_proof_sender, transfer_proof_receiver) = bmrng::channel(1); + let (encrypted_signature_sender, encrypted_signature_receiver) = bmrng::channel(1); + let (quote_sender, quote_receiver) = bmrng::channel(1); + let (cooperative_xmr_redeem_sender, cooperative_xmr_redeem_receiver) = bmrng::channel(1); let event_loop = EventLoop { swap_id, swarm, alice_peer_id, - swap_setup_requests: execution_setup.1.into(), - transfer_proof: transfer_proof.0, - encrypted_signatures: encrypted_signature.1.into(), - cooperative_xmr_redeem_requests: cooperative_xmr_redeem.1.into(), - quote_requests: quote.1.into(), + swap_setup_requests: execution_setup_receiver.into(), + transfer_proof_sender, + encrypted_signatures: encrypted_signature_receiver.into(), + cooperative_xmr_redeem_requests: cooperative_xmr_redeem_receiver.into(), + quote_requests: quote_receiver.into(), inflight_quote_requests: HashMap::default(), inflight_swap_setup: None, inflight_encrypted_signature_requests: HashMap::default(), @@ -95,11 +101,11 @@ impl EventLoop { }; let handle = EventLoopHandle { - swap_setup: execution_setup.0, - transfer_proof: transfer_proof.1, - encrypted_signature: encrypted_signature.0, - cooperative_xmr_redeem: cooperative_xmr_redeem.0, - quote: quote.0, + execution_setup_sender, + transfer_proof_receiver, + encrypted_signature_sender, + cooperative_xmr_redeem_sender, + quote_sender, }; Ok((event_loop, handle)) @@ -162,7 +168,7 @@ impl EventLoop { } } - let mut responder = match self.transfer_proof.send(msg.tx_lock_proof).await { + let mut responder = match self.transfer_proof_sender.send(msg.tx_lock_proof).await { Ok(responder) => responder, Err(e) => { tracing::warn!("Failed to pass on transfer proof: {:#}", e); @@ -319,9 +325,9 @@ impl EventLoop { } }, - Some((swap_id, responder)) = self.cooperative_xmr_redeem_requests.next().fuse(), if self.is_connected_to_alice() => { + Some((_, responder)) = self.cooperative_xmr_redeem_requests.next().fuse(), if self.is_connected_to_alice() => { let id = self.swarm.behaviour_mut().cooperative_xmr_redeem.send_request(&self.alice_peer_id, Request { - swap_id + swap_id: self.swap_id }); self.inflight_cooperative_xmr_redeem_requests.insert(id, responder); }, @@ -336,24 +342,49 @@ impl EventLoop { #[derive(Debug)] pub struct EventLoopHandle { - swap_setup: bmrng::RequestSender>, - transfer_proof: bmrng::RequestReceiver, - encrypted_signature: bmrng::RequestSender>, - quote: bmrng::RequestSender<(), Result>, - cooperative_xmr_redeem: bmrng::RequestSender< - Uuid, + /// When a NewSwap object is sent into this channel, the EventLoop will: + /// 1. Trigger the swap setup protocol with Alice to negotiate the swap parameters + /// 2. Return the resulting State2 if successful + /// 3. Return an anyhow error if the request fails + execution_setup_sender: bmrng::RequestSender>, + + /// Receiver for incoming Monero transfer proofs from Alice. + /// When a proof is received, we process it and acknowledge receipt back to the EventLoop + /// The EventLoop will then send an acknowledgment back to Alice over the network + transfer_proof_receiver: bmrng::RequestReceiver, + + /// When an encrypted signature is sent into this channel, the EventLoop will: + /// 1. Send the encrypted signature to Alice over the network + /// 2. Return Ok(()) if Alice acknowledges receipt, or + /// 3. Return an OutboundFailure error if the request fails + encrypted_signature_sender: + bmrng::RequestSender>, + + /// When a () is sent into this channel, the EventLoop will: + /// 1. Request a price quote from Alice + /// 2. Return the quote if successful + /// 3. Return an OutboundFailure error if the request fails + quote_sender: bmrng::RequestSender<(), Result>, + + /// When a () is sent into this channel, the EventLoop will: + /// 1. Request Alice's cooperation in redeeming the Monero + /// 2. Return the a response object (Fullfilled or Rejected), if the network request is successful + /// The Fullfilled object contains the keys required to redeem the Monero + /// 3. Return an OutboundFailure error if the network request fails + cooperative_xmr_redeem_sender: bmrng::RequestSender< + (), Result, >, } impl EventLoopHandle { pub async fn setup_swap(&mut self, swap: NewSwap) -> Result { - self.swap_setup.send_receive(swap).await? + self.execution_setup_sender.send_receive(swap).await? } pub async fn recv_transfer_proof(&mut self) -> Result { let (transfer_proof, responder) = self - .transfer_proof + .transfer_proof_receiver .recv() .await .context("Failed to receive transfer proof")?; @@ -367,16 +398,16 @@ impl EventLoopHandle { pub async fn request_quote(&mut self) -> Result { tracing::debug!("Requesting quote"); - self.quote + self.quote_sender .send_receive(()) .await .context("Failed to receive quote through event loop channel")? .context("Failed to request quote due to a network error") } - pub async fn request_cooperative_xmr_redeem(&mut self, swap_id: Uuid) -> Result { - self.cooperative_xmr_redeem - .send_receive(swap_id) + pub async fn request_cooperative_xmr_redeem(&mut self) -> Result { + self.cooperative_xmr_redeem_sender + .send_receive(()) .await .context("Failed to request cooperative XMR redeem through event loop channel")? .context("Failed to request cooperative XMR redeem due to a network error") @@ -393,7 +424,7 @@ impl EventLoopHandle { .build(); backoff::future::retry(backoff, || async { - match self.encrypted_signature.send_receive(tx_redeem_encsig.clone()).await { + match self.encrypted_signature_sender.send_receive(tx_redeem_encsig.clone()).await { Ok(Ok(_)) => Ok(()), Ok(Err(err)) => { tracing::warn!(%err, "Failed to send encrypted signature due to a network error. Will retry"); diff --git a/swap/src/protocol/bob/swap.rs b/swap/src/protocol/bob/swap.rs index c6dfd3092..34e18dc7b 100644 --- a/swap/src/protocol/bob/swap.rs +++ b/swap/src/protocol/bob/swap.rs @@ -478,9 +478,7 @@ async fn next_state( ); tracing::info!("Attempting to cooperatively redeem XMR after being punished"); - let response = event_loop_handle - .request_cooperative_xmr_redeem(swap_id) - .await; + let response = event_loop_handle.request_cooperative_xmr_redeem().await; match response { Ok(Fullfilled { s_a, .. }) => { From d328bf86c92228157b7ca653cc4835d856a6e35a Mon Sep 17 00:00:00 2001 From: binarybaron Date: Sat, 2 Nov 2024 16:50:36 +0100 Subject: [PATCH 089/112] refactor: Add comments in asb/event_loop.rs, swap_setup/bob.rs, alice/swap.rs --- swap/src/asb/event_loop.rs | 5 +++++ swap/src/network/swap_setup/bob.rs | 29 ++++++++++++++--------------- swap/src/protocol/alice/swap.rs | 2 ++ 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/swap/src/asb/event_loop.rs b/swap/src/asb/event_loop.rs index 3ec802672..3f253b605 100644 --- a/swap/src/asb/event_loop.rs +++ b/swap/src/asb/event_loop.rs @@ -664,6 +664,7 @@ impl EventLoopHandle { } } + /// Wait for an encrypted signature from Bob pub async fn recv_encrypted_signature(&mut self) -> Result { let receiver = self .recv_encrypted_signature @@ -685,6 +686,10 @@ impl EventLoopHandle { Ok(tx_redeem_encsig) } + /// Send a transfer proof to Bob + /// + /// This function will retry indefinitely until the transfer proof is sent successfully + /// and acknowledged by Bob pub async fn send_transfer_proof(&mut self, msg: monero::TransferProof) -> Result<()> { let sender = self .transfer_proof_sender diff --git a/swap/src/network/swap_setup/bob.rs b/swap/src/network/swap_setup/bob.rs index cea1b9bfa..a97cadeb2 100644 --- a/swap/src/network/swap_setup/bob.rs +++ b/swap/src/network/swap_setup/bob.rs @@ -60,7 +60,6 @@ impl NetworkBehaviour for Behaviour { _local_addr: &Multiaddr, _remote_addr: &Multiaddr, ) -> Result, ConnectionDenied> { - // TODO(Libp2p Migration): Is this correct? unreachable!("Bob does not support inbound connections") } @@ -74,7 +73,7 @@ impl NetworkBehaviour for Behaviour { Ok(Handler::new(self.env_config, self.bitcoin_wallet.clone())) } - fn on_swarm_event(&mut self, event: FromSwarm) { + fn on_swarm_event(&mut self, _event: FromSwarm<'_>) { // We do not need to handle swarm events } @@ -173,7 +172,7 @@ impl ConnectionHandler for Handler { } libp2p::swarm::handler::ConnectionEvent::FullyNegotiatedOutbound(outbound) => { let mut substream = outbound.protocol; - let info = outbound.info; + let new_swap_request = outbound.info; let bitcoin_wallet = self.bitcoin_wallet.clone(); let env_config = self.env_config; @@ -182,7 +181,7 @@ impl ConnectionHandler for Handler { write_cbor_message( &mut substream, SpotPriceRequest { - btc: info.btc, + btc: new_swap_request.btc, blockchain_network: BlockchainNetwork { bitcoin: env_config.bitcoin_network, monero: env_config.monero_network, @@ -196,16 +195,16 @@ impl ConnectionHandler for Handler { )?; let state0 = State0::new( - info.swap_id, + new_swap_request.swap_id, &mut rand::thread_rng(), - info.btc, + new_swap_request.btc, xmr, env_config.bitcoin_cancel_timelock, env_config.bitcoin_punish_timelock, - info.bitcoin_refund_address, + new_swap_request.bitcoin_refund_address, env_config.monero_finality_confirmations, - info.tx_refund_fee, - info.tx_cancel_fee, + new_swap_request.tx_refund_fee, + new_swap_request.tx_cancel_fee, ); write_cbor_message(&mut substream, state0.next_message()).await?; @@ -225,6 +224,7 @@ impl ConnectionHandler for Handler { }); let max_seconds = self.timeout.as_secs(); + self.outbound_stream = OptionFuture::from(Some(Box::pin(async move { protocol.await.map_err(|e| match e { tokio::time::error::Elapsed { .. } => Error::Timeout { @@ -234,12 +234,9 @@ impl ConnectionHandler for Handler { })? }) as OutboundStream)); - self.keep_alive = true; // Ensure the connection stays alive while processing - } - libp2p::swarm::handler::ConnectionEvent::DialUpgradeError(dial_upgrade_err) => { - // Handle dial upgrade error if needed - // TOOD(Libp2p Migration): Is this correct? - self.keep_alive = false; + + // Once the outbound stream is created, we keep the connection alive + self.keep_alive = true; } _ => {} } @@ -272,6 +269,8 @@ impl ConnectionHandler for Handler { // Check if the outbound stream has completed if let Poll::Ready(Some(result)) = self.outbound_stream.poll_unpin(cx) { self.outbound_stream = None.into(); + + // Once the outbound stream is completed, we no longer keep the connection alive self.keep_alive = false; // We notify the swarm that the swap setup is completed / failed diff --git a/swap/src/protocol/alice/swap.rs b/swap/src/protocol/alice/swap.rs index 0b1d6fde3..6fbc032ba 100644 --- a/swap/src/protocol/alice/swap.rs +++ b/swap/src/protocol/alice/swap.rs @@ -117,6 +117,7 @@ where // block 0 for scenarios where we create a refund wallet. let monero_wallet_restore_blockheight = monero_wallet.block_height().await?; + // TODO: We should retry the transfer if it fails let transfer_proof = monero_wallet .transfer(state3.lock_xmr_transfer_request()) .await?; @@ -240,6 +241,7 @@ where ExpiredTimelocks::None { .. } => { let tx_lock_status = bitcoin_wallet.subscribe_to(state3.tx_lock.clone()).await; match state3.signed_redeem_transaction(*encrypted_signature) { + // TODO: We should retry publishing the redeem transaction if it fails Ok(tx) => match bitcoin_wallet.broadcast(tx, "redeem").await { Ok((_, subscription)) => match subscription.wait_until_seen().await { Ok(_) => AliceState::BtcRedeemTransactionPublished { state3 }, From 00085ae3b18de9542ad46defd89f55b754970979 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Sat, 2 Nov 2024 18:04:24 +0100 Subject: [PATCH 090/112] refactor: comments in asb/event_loop.rs --- swap/src/asb/event_loop.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/swap/src/asb/event_loop.rs b/swap/src/asb/event_loop.rs index 3f253b605..73db37f1a 100644 --- a/swap/src/asb/event_loop.rs +++ b/swap/src/asb/event_loop.rs @@ -58,7 +58,7 @@ where /// Flow: /// 1. When signature forwarded via recv_encrypted_signature sender /// 2. New future pushed here to await EventLoopHandle's acknowledgement - /// 3. When future completes, ResponseChannel used to confirm to Bob + /// 3. When future completes, the EventLoop uses the ResponseChannel to send an acknowledgment to Bob /// 4. Future is removed from this collection inflight_encrypted_signatures: FuturesUnordered>>, @@ -556,13 +556,13 @@ where /// Create a new [`EventLoopHandle`] that is scoped for communication with /// the given peer. fn new_handle(&mut self, peer: PeerId, swap_id: Uuid) -> EventLoopHandle { - // Create a new bmrng channel for receiving encrypted signatures from Bob + // Create a new channel for receiving encrypted signatures from Bob // The channel has a capacity of 1 since we only expect one signature per swap let (encrypted_signature_sender, encrypted_signature_receiver) = bmrng::channel(1); - // Store the sender in the EventLoop + // The sender is stored in the EventLoop // The receiver is stored in the EventLoopHandle - // When a signature is received, the EventLoop uses the stored channel to notify the EventLoopHandle + // When a signature is received, the EventLoop uses the sender to notify the EventLoopHandle self.recv_encrypted_signature .insert(swap_id, encrypted_signature_sender); @@ -674,7 +674,7 @@ impl EventLoopHandle { let (tx_redeem_encsig, responder) = receiver.recv().await?; // Acknowledge receipt of the encrypted signature - // This notifies the EventLoop that the signature has been received + // This notifies the EventLoop that the signature has been processed // The EventLoop can then send an acknowledgement back to Bob over the network responder .respond(()) @@ -690,6 +690,10 @@ impl EventLoopHandle { /// /// This function will retry indefinitely until the transfer proof is sent successfully /// and acknowledged by Bob + /// + /// This will fail if + /// 1. the transfer proof has already been sent once + /// 2. there is an error with the bmrng channel pub async fn send_transfer_proof(&mut self, msg: monero::TransferProof) -> Result<()> { let sender = self .transfer_proof_sender From ce850e54e881f75455f0b5ccb5b806edf630dbc7 Mon Sep 17 00:00:00 2001 From: Einliterflasche Date: Sun, 3 Nov 2024 12:26:11 +0100 Subject: [PATCH 091/112] refactor(asb): make some code blocks in rendezvous::Behaviour more idiomatic, add handle_pending_outbound_connection --- swap/src/asb/network.rs | 103 +++++++++++++++++++++++++--------------- 1 file changed, 65 insertions(+), 38 deletions(-) diff --git a/swap/src/asb/network.rs b/swap/src/asb/network.rs index 1c53f0961..e65fcdceb 100644 --- a/swap/src/asb/network.rs +++ b/swap/src/asb/network.rs @@ -205,6 +205,7 @@ pub mod behaviour { pub mod rendezvous { use super::*; use libp2p::identity; + use libp2p::rendezvous::client::RegisterError; use libp2p::swarm::dial_opts::DialOpts; use libp2p::swarm::{ ConnectionDenied, ConnectionId, FromSwarm, THandler, THandlerInEvent, THandlerOutEvent, @@ -235,6 +236,7 @@ pub mod rendezvous { to_dial: VecDeque, } + /// A node running the rendezvous server protocol. pub struct RendezvousNode { pub address: Multiaddr, connection_status: ConnectionStatus, @@ -279,11 +281,13 @@ pub mod rendezvous { } } - /// Calls the rendezvous register method of the node at node_index in the Vec of rendezvous nodes - fn register(&mut self, node_index: usize) { - let node = &self.rendezvous_nodes[node_index]; - self.inner - .register(node.namespace.into(), node.peer_id, node.registration_ttl); + /// Registers the rendezvous node at the given index. + /// Also sets the registration status to [`RegistrationStatus::Pending`]. + pub fn register(&mut self, node_index: usize) -> Result<(), RegisterError> { + let node = &mut self.rendezvous_nodes[node_index]; + node.set_registration(RegistrationStatus::Pending); + let (namespace, peer_id, ttl) = (node.namespace.into(), node.peer_id, node.registration_ttl); + self.inner.register(namespace, peer_id, ttl) } } @@ -322,41 +326,59 @@ pub mod rendezvous { ) } + fn handle_pending_outbound_connection( + &mut self, + connection_id: ConnectionId, + maybe_peer: Option, + addresses: &[Multiaddr], + effective_role: libp2p::core::Endpoint, + ) -> std::result::Result, ConnectionDenied> { + self.inner.handle_pending_outbound_connection(connection_id, maybe_peer, addresses, effective_role) + } + fn on_swarm_event(&mut self, event: FromSwarm<'_>) { match event { - FromSwarm::ConnectionEstablished(e) => { - let peer_id = e.peer_id; - for i in 0..self.rendezvous_nodes.len() { - if &peer_id == &self.rendezvous_nodes[i].peer_id { - self.rendezvous_nodes[i].set_connection(ConnectionStatus::Connected); - match &self.rendezvous_nodes[i].registration_status { - RegistrationStatus::RegisterOnNextConnection => { - self.register(i); - self.rendezvous_nodes[i] - .set_registration(RegistrationStatus::Pending); - } - RegistrationStatus::Registered { .. } - | RegistrationStatus::Pending => {} - } + FromSwarm::ConnectionEstablished(peer) => { + let peer_id = peer.peer_id; + + // Find the rendezvous node that matches the peer id, else do nothing. + if let Some(index) = self.rendezvous_nodes + .iter_mut() + .position(|node| node.peer_id == peer_id) + { + let rendezvous_node = &mut self.rendezvous_nodes[index]; + rendezvous_node.set_connection(ConnectionStatus::Connected); + + if let RegistrationStatus::RegisterOnNextConnection = + rendezvous_node.registration_status + { + let _ = self.register(index) + .inspect_err(|err| { + tracing::error!( + error=%err, + rendezvous_node=%peer_id, + "Failed to register with rendezvous node"); + }); } } } - FromSwarm::ConnectionClosed(e) => { - let peer_id = e.peer_id; - for i in 0..self.rendezvous_nodes.len() { - let node = &mut self.rendezvous_nodes[i]; - if &peer_id == &node.peer_id { - node.connection_status = ConnectionStatus::Disconnected; - } + FromSwarm::ConnectionClosed(peer) => { + // Update the connection status of the rendezvous node that disconnected. + if let Some(node) = self.rendezvous_nodes + .iter_mut() + .find(|node| node.peer_id == peer.peer_id) + { + node.set_connection(ConnectionStatus::Disconnected); } } - FromSwarm::DialFailure(e) => { - if let Some(peer_id) = e.peer_id { - for i in 0..self.rendezvous_nodes.len() { - let node = &mut self.rendezvous_nodes[i]; - if peer_id == node.peer_id { - node.connection_status = ConnectionStatus::Disconnected; - } + FromSwarm::DialFailure(peer) => { + // Update the connection status of the rendezvous node that failed to connect. + if let Some(peer_id) = peer.peer_id { + if let Some(node) = self.rendezvous_nodes + .iter_mut() + .find(|node| node.peer_id == peer_id) + { + node.set_connection(ConnectionStatus::Disconnected); } } } @@ -389,6 +411,8 @@ pub mod rendezvous { .map(|node| node.address.clone()) .unwrap()]) .condition(PeerCondition::Disconnected) + // TODO: this makes the behaviour call `NetworkBehaviour::handle_pending_outbound_connection` + // but we don't implement it .extend_addresses_through_behaviour() .build(), }); @@ -404,17 +428,20 @@ pub mod rendezvous { } ConnectionStatus::Dialling => {} ConnectionStatus::Connected => { - self.rendezvous_nodes[i].set_registration(RegistrationStatus::Pending); - self.register(i); + let _ = self.register(i); } }, RegistrationStatus::Registered { re_register_in } => { if let Poll::Ready(()) = re_register_in.poll_unpin(cx) { match connection_status { ConnectionStatus::Connected => { - self.rendezvous_nodes[i] - .set_registration(RegistrationStatus::Pending); - self.register(i); + let _ = self.register(i) + .inspect_err(|err| { + tracing::error!( + error=%err, + rendezvous_node=%self.rendezvous_nodes[i].peer_id, + "Failed to register with rendezvous node"); + }); } ConnectionStatus::Disconnected => { self.rendezvous_nodes[i].set_registration( From fdd8a4270f93b1c8aa1715461a869486c553e1fc Mon Sep 17 00:00:00 2001 From: binarybaron Date: Sun, 3 Nov 2024 18:08:15 +0100 Subject: [PATCH 092/112] feat(libp2p): Increase ping timeout to 60s --- swap/src/asb/network.rs | 2 +- swap/src/cli/behaviour.rs | 2 +- swap/src/cli/list_sellers.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/swap/src/asb/network.rs b/swap/src/asb/network.rs index e65fcdceb..d7e37f1c2 100644 --- a/swap/src/asb/network.rs +++ b/swap/src/asb/network.rs @@ -156,7 +156,7 @@ pub mod behaviour { let identifyConfig = identify::Config::new(protocol_version, identity.public()) .with_agent_version(agent_version); - let pingConfig = ping::Config::new(); + let pingConfig = ping::Config::new().with_timeout(Duration::from_secs(60)); let behaviour = if rendezvous_nodes.is_empty() { None diff --git a/swap/src/cli/behaviour.rs b/swap/src/cli/behaviour.rs index 938dea46a..ec9bcffb0 100644 --- a/swap/src/cli/behaviour.rs +++ b/swap/src/cli/behaviour.rs @@ -112,7 +112,7 @@ impl Behaviour { let identifyConfig = identify::Config::new(protocolVersion, identify_params.0.public()) .with_agent_version(agentVersion); - let pingConfig = ping::Config::new(); + let pingConfig = ping::Config::new().with_timeout(Duration::from_secs(60)); Self { quote: quote::cli(), diff --git a/swap/src/cli/list_sellers.rs b/swap/src/cli/list_sellers.rs index 6f2528666..5464f233c 100644 --- a/swap/src/cli/list_sellers.rs +++ b/swap/src/cli/list_sellers.rs @@ -31,7 +31,7 @@ pub async fn list_sellers( let behaviour = Behaviour { rendezvous: rendezvous::client::Behaviour::new(identity.clone()), quote: quote::cli(), - ping: ping::Behaviour::new(ping::Config::new().with_interval(Duration::from_secs(86_400))), + ping: ping::Behaviour::new(ping::Config::new().with_timeout(Duration::from_secs(60))), }; let mut swarm = swarm::cli(identity, tor_socks5_port, behaviour).await?; From 688c72cd75eb06cdaf96429a7e9be4905e3c22f2 Mon Sep 17 00:00:00 2001 From: binarybaron Date: Mon, 4 Nov 2024 14:28:49 +0100 Subject: [PATCH 093/112] feat: add changelog entries --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f2fc78333..54c60361f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +- Breaking network protocol change: The libp2p version has been upgraded to 0.53 which includes breaking network protocol changes. ASBs and CLIs will not be able to swap if one of them is on the old version. +- ASB: Transfer proofs will be repeatedly sent until they are acknowledged by the other party. This fixes a bug where it'd seem to Bob as if the Alice never locked the Monero. Forcing the swap to be refunded. +- CLI: Encrypted signatures will be repeatedly sent until they are acknowledged by the other party - ASB + CLI: You can now use the `logs` command to retrieve logs stored in the past, redacting addresses and id's using `logs --redact`. - ASB: The `--disable-timestamp` flag has been removed - ASB: The `history` command can now be used while the asb is running. From 555d5f6fb1d798d897fc94f9f5e3861d999b44e1 Mon Sep 17 00:00:00 2001 From: Mohan Date: Fri, 8 Nov 2024 13:33:35 +0100 Subject: [PATCH 094/112] fix: bail instead of panic if fee returned by electrum server is negative --- swap/src/bitcoin/wallet.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/swap/src/bitcoin/wallet.rs b/swap/src/bitcoin/wallet.rs index af113d38d..f79bd5f9f 100644 --- a/swap/src/bitcoin/wallet.rs +++ b/swap/src/bitcoin/wallet.rs @@ -874,6 +874,11 @@ impl EstimateFeeRate for Client { // https://github.com/romanz/electrs/blob/f9cf5386d1b5de6769ee271df5eef324aa9491bc/src/rpc.rs#L213 // Returned estimated fees are per BTC/kb. let fee_per_byte = self.electrum.estimate_fee(target_block.into())?; + + if fee_per_byte < 0.0 { + bail!("Fee per byte returned by electrum server is negative: {}. This may indicate that fee estimation is not supported by this server", fee_per_byte); + } + // we do not expect fees being that high. #[allow(clippy::cast_possible_truncation)] Ok(FeeRate::from_btc_per_kvb(fee_per_byte as f32)) From 9114bb0aa50bbcb6157bf8f8370460dbc4ed6ac3 Mon Sep 17 00:00:00 2001 From: Binarybaron Date: Fri, 8 Nov 2024 17:30:52 +0100 Subject: [PATCH 095/112] fix(libp2p): Use Swarm::add_peer_address instead of Behaviour::add_address --- swap/src/cli/api/request.rs | 14 ++++++++++---- swap/src/cli/behaviour.rs | 7 ------- swap/src/network/swap_setup/bob.rs | 2 +- swap/tests/harness/mod.rs | 4 +--- 4 files changed, 12 insertions(+), 15 deletions(-) diff --git a/swap/src/cli/api/request.rs b/swap/src/cli/api/request.rs index 1dad5aed9..c56a7b000 100644 --- a/swap/src/cli/api/request.rs +++ b/swap/src/cli/api/request.rs @@ -606,7 +606,7 @@ pub async fn buy_xmr( ) .await?; - swarm.behaviour_mut().add_address(seller_peer_id, seller); + swarm.add_peer_address(seller_peer_id, seller); context .db @@ -796,9 +796,7 @@ pub async fn resume_swap( // Fetch the seller's addresses from the database and add them to the swarm for seller_address in seller_addresses { - swarm - .behaviour_mut() - .add_address(seller_peer_id, seller_address); + swarm.add_peer_address(seller_peer_id, seller_address); } let (event_loop, event_loop_handle) = @@ -1202,9 +1200,17 @@ where } loop { + println!("max_giveable: {}", max_giveable); + println!("bid_quote.min_quantity: {}", bid_quote.min_quantity); let min_outstanding = bid_quote.min_quantity - max_giveable; + println!("min_outstanding: {}", min_outstanding); let min_bitcoin_lock_tx_fee = estimate_fee(min_outstanding).await?; + println!("min_bitcoin_lock_tx_fee: {}", min_bitcoin_lock_tx_fee); let min_deposit_until_swap_will_start = min_outstanding + min_bitcoin_lock_tx_fee; + println!( + "min_deposit_until_swap_will_start: {}", + min_deposit_until_swap_will_start + ); let max_deposit_until_maximum_amount_is_reached = maximum_amount - max_giveable + min_bitcoin_lock_tx_fee; diff --git a/swap/src/cli/behaviour.rs b/swap/src/cli/behaviour.rs index ec9bcffb0..eafbbea1f 100644 --- a/swap/src/cli/behaviour.rs +++ b/swap/src/cli/behaviour.rs @@ -129,13 +129,6 @@ impl Behaviour { identify: identify::Behaviour::new(identifyConfig), } } - - /// Add a known address for the given peer - pub fn add_address(&mut self, peer_id: PeerId, address: Multiaddr) { - self.quote.add_address(&peer_id, address.clone()); - self.transfer_proof.add_address(&peer_id, address.clone()); - self.encrypted_signature.add_address(&peer_id, address); - } } impl From for OutEvent { diff --git a/swap/src/network/swap_setup/bob.rs b/swap/src/network/swap_setup/bob.rs index a97cadeb2..9fa544489 100644 --- a/swap/src/network/swap_setup/bob.rs +++ b/swap/src/network/swap_setup/bob.rs @@ -224,7 +224,7 @@ impl ConnectionHandler for Handler { }); let max_seconds = self.timeout.as_secs(); - + self.outbound_stream = OptionFuture::from(Some(Box::pin(async move { protocol.await.map_err(|e| match e { tokio::time::error::Elapsed { .. } => Error::Timeout { diff --git a/swap/tests/harness/mod.rs b/swap/tests/harness/mod.rs index 99a0a78be..99b52dfae 100644 --- a/swap/tests/harness/mod.rs +++ b/swap/tests/harness/mod.rs @@ -505,9 +505,7 @@ impl BobParams { (identity.clone(), XmrBtcNamespace::Testnet), ); let mut swarm = swarm::cli(identity.clone(), tor_socks5_port, behaviour).await?; - swarm - .behaviour_mut() - .add_address(self.alice_peer_id, self.alice_address.clone()); + swarm.add_peer_address(self.alice_peer_id, self.alice_address.clone()); cli::EventLoop::new(swap_id, swarm, self.alice_peer_id, db.clone()) } From df1720bd04cd912e4a2c2e1d119587efad476713 Mon Sep 17 00:00:00 2001 From: Binarybaron Date: Fri, 8 Nov 2024 17:32:18 +0100 Subject: [PATCH 096/112] fix(gui): Initiate context only after redux persist has been loaded. Otherwise the context might be initialized before the setting are fully loaded --- src-gui/src/renderer/components/App.tsx | 58 +++++++++++++++++++++++++ src-gui/src/renderer/index.tsx | 52 +--------------------- 2 files changed, 59 insertions(+), 51 deletions(-) diff --git a/src-gui/src/renderer/components/App.tsx b/src-gui/src/renderer/components/App.tsx index 1d612f29b..e0acab905 100644 --- a/src-gui/src/renderer/components/App.tsx +++ b/src-gui/src/renderer/components/App.tsx @@ -9,6 +9,15 @@ import HistoryPage from "./pages/history/HistoryPage"; import SwapPage from "./pages/swap/SwapPage"; import WalletPage from "./pages/wallet/WalletPage"; import GlobalSnackbarProvider from "./snackbar/GlobalSnackbarProvider"; +import { useEffect } from "react"; +import { fetchProvidersViaHttp, fetchAlertsViaHttp, fetchXmrPrice, fetchBtcPrice, fetchXmrBtcRate } from "renderer/api"; +import { initEventListeners } from "renderer/rpc"; +import { store } from "renderer/store/storeRenderer"; +import { checkForAppUpdates } from "renderer/updater"; +import { setAlerts } from "store/features/alertsSlice"; +import { setRegistryProviders, registryConnectionFailed } from "store/features/providersSlice"; +import { setXmrPrice, setBtcPrice, setXmrBtcRate } from "store/features/ratesSlice"; +import logger from "utils/logger"; const useStyles = makeStyles((theme) => ({ innerContent: { @@ -51,6 +60,12 @@ function InnerContent() { } export default function App() { + useEffect(() => { + fetchInitialData(); + initEventListeners(); + checkForAppUpdates(); + }, []); + return ( @@ -63,3 +78,46 @@ export default function App() { ); } + +async function fetchInitialData() { + try { + const providerList = await fetchProvidersViaHttp(); + store.dispatch(setRegistryProviders(providerList)); + + logger.info( + { providerList }, + "Fetched providers via UnstoppableSwap HTTP API", + ); + } catch (e) { + store.dispatch(registryConnectionFailed()); + logger.error(e, "Failed to fetch providers via UnstoppableSwap HTTP API"); + } + + try { + const alerts = await fetchAlertsViaHttp(); + store.dispatch(setAlerts(alerts)); + logger.info({ alerts }, "Fetched alerts via UnstoppableSwap HTTP API"); + } catch (e) { + logger.error(e, "Failed to fetch alerts via UnstoppableSwap HTTP API"); + } + + try { + const xmrPrice = await fetchXmrPrice(); + store.dispatch(setXmrPrice(xmrPrice)); + logger.info({ xmrPrice }, "Fetched XMR price"); + + const btcPrice = await fetchBtcPrice(); + store.dispatch(setBtcPrice(btcPrice)); + logger.info({ btcPrice }, "Fetched BTC price"); + } catch (e) { + logger.error(e, "Error retrieving fiat prices"); + } + + try { + const xmrBtcRate = await fetchXmrBtcRate(); + store.dispatch(setXmrBtcRate(xmrBtcRate)); + logger.info({ xmrBtcRate }, "Fetched XMR/BTC rate"); + } catch (e) { + logger.error(e, "Error retrieving XMR/BTC rate"); + } +} diff --git a/src-gui/src/renderer/index.tsx b/src-gui/src/renderer/index.tsx index bb2719e00..7297b36b0 100644 --- a/src-gui/src/renderer/index.tsx +++ b/src-gui/src/renderer/index.tsx @@ -16,10 +16,7 @@ import { fetchXmrPrice, } from "./api"; import App from "./components/App"; -import { initEventListeners } from "./rpc"; import { persistor, store } from "./store/storeRenderer"; -import { Box } from "@material-ui/core"; -import { checkForAppUpdates } from "./updater"; const container = document.getElementById("root"); const root = createRoot(container!); @@ -30,51 +27,4 @@ root.render( , -); - -async function fetchInitialData() { - try { - const providerList = await fetchProvidersViaHttp(); - store.dispatch(setRegistryProviders(providerList)); - - logger.info( - { providerList }, - "Fetched providers via UnstoppableSwap HTTP API", - ); - } catch (e) { - store.dispatch(registryConnectionFailed()); - logger.error(e, "Failed to fetch providers via UnstoppableSwap HTTP API"); - } - - try { - const alerts = await fetchAlertsViaHttp(); - store.dispatch(setAlerts(alerts)); - logger.info({ alerts }, "Fetched alerts via UnstoppableSwap HTTP API"); - } catch (e) { - logger.error(e, "Failed to fetch alerts via UnstoppableSwap HTTP API"); - } - - try { - const xmrPrice = await fetchXmrPrice(); - store.dispatch(setXmrPrice(xmrPrice)); - logger.info({ xmrPrice }, "Fetched XMR price"); - - const btcPrice = await fetchBtcPrice(); - store.dispatch(setBtcPrice(btcPrice)); - logger.info({ btcPrice }, "Fetched BTC price"); - } catch (e) { - logger.error(e, "Error retrieving fiat prices"); - } - - try { - const xmrBtcRate = await fetchXmrBtcRate(); - store.dispatch(setXmrBtcRate(xmrBtcRate)); - logger.info({ xmrBtcRate }, "Fetched XMR/BTC rate"); - } catch (e) { - logger.error(e, "Error retrieving XMR/BTC rate"); - } -} - -fetchInitialData(); -initEventListeners(); -checkForAppUpdates(); +); \ No newline at end of file From e3bff9215cd606f140de76f041d5fe1b8869f60a Mon Sep 17 00:00:00 2001 From: Binarybaron Date: Fri, 8 Nov 2024 17:34:28 +0100 Subject: [PATCH 097/112] fix: clippy warnings --- swap/src/asb/event_loop.rs | 4 +- swap/src/asb/network.rs | 61 ++++++++++++++++------------ swap/src/cli.rs | 2 +- swap/src/cli/behaviour.rs | 1 - swap/src/network/swap_setup/alice.rs | 6 +-- swap/src/network/swap_setup/bob.rs | 8 ++-- swap/src/network/tor_transport.rs | 6 +-- swap/src/network/transfer_proof.rs | 2 +- 8 files changed, 47 insertions(+), 43 deletions(-) diff --git a/swap/src/asb/event_loop.rs b/swap/src/asb/event_loop.rs index 73db37f1a..cf7e6d560 100644 --- a/swap/src/asb/event_loop.rs +++ b/swap/src/asb/event_loop.rs @@ -690,9 +690,9 @@ impl EventLoopHandle { /// /// This function will retry indefinitely until the transfer proof is sent successfully /// and acknowledged by Bob - /// + /// /// This will fail if - /// 1. the transfer proof has already been sent once + /// 1. the transfer proof has already been sent once /// 2. there is an error with the bmrng channel pub async fn send_transfer_proof(&mut self, msg: monero::TransferProof) -> Result<()> { let sender = self diff --git a/swap/src/asb/network.rs b/swap/src/asb/network.rs index d7e37f1c2..6f0ece53e 100644 --- a/swap/src/asb/network.rs +++ b/swap/src/asb/network.rs @@ -281,12 +281,13 @@ pub mod rendezvous { } } - /// Registers the rendezvous node at the given index. + /// Registers the rendezvous node at the given index. /// Also sets the registration status to [`RegistrationStatus::Pending`]. pub fn register(&mut self, node_index: usize) -> Result<(), RegisterError> { let node = &mut self.rendezvous_nodes[node_index]; node.set_registration(RegistrationStatus::Pending); - let (namespace, peer_id, ttl) = (node.namespace.into(), node.peer_id, node.registration_ttl); + let (namespace, peer_id, ttl) = + (node.namespace.into(), node.peer_id, node.registration_ttl); self.inner.register(namespace, peer_id, ttl) } } @@ -327,13 +328,18 @@ pub mod rendezvous { } fn handle_pending_outbound_connection( - &mut self, - connection_id: ConnectionId, - maybe_peer: Option, - addresses: &[Multiaddr], - effective_role: libp2p::core::Endpoint, - ) -> std::result::Result, ConnectionDenied> { - self.inner.handle_pending_outbound_connection(connection_id, maybe_peer, addresses, effective_role) + &mut self, + connection_id: ConnectionId, + maybe_peer: Option, + addresses: &[Multiaddr], + effective_role: libp2p::core::Endpoint, + ) -> std::result::Result, ConnectionDenied> { + self.inner.handle_pending_outbound_connection( + connection_id, + maybe_peer, + addresses, + effective_role, + ) } fn on_swarm_event(&mut self, event: FromSwarm<'_>) { @@ -342,9 +348,10 @@ pub mod rendezvous { let peer_id = peer.peer_id; // Find the rendezvous node that matches the peer id, else do nothing. - if let Some(index) = self.rendezvous_nodes + if let Some(index) = self + .rendezvous_nodes .iter_mut() - .position(|node| node.peer_id == peer_id) + .position(|node| node.peer_id == peer_id) { let rendezvous_node = &mut self.rendezvous_nodes[index]; rendezvous_node.set_connection(ConnectionStatus::Connected); @@ -352,21 +359,21 @@ pub mod rendezvous { if let RegistrationStatus::RegisterOnNextConnection = rendezvous_node.registration_status { - let _ = self.register(index) - .inspect_err(|err| { - tracing::error!( - error=%err, - rendezvous_node=%peer_id, + let _ = self.register(index).inspect_err(|err| { + tracing::error!( + error=%err, + rendezvous_node=%peer_id, "Failed to register with rendezvous node"); - }); + }); } } } FromSwarm::ConnectionClosed(peer) => { // Update the connection status of the rendezvous node that disconnected. - if let Some(node) = self.rendezvous_nodes + if let Some(node) = self + .rendezvous_nodes .iter_mut() - .find(|node| node.peer_id == peer.peer_id) + .find(|node| node.peer_id == peer.peer_id) { node.set_connection(ConnectionStatus::Disconnected); } @@ -374,9 +381,10 @@ pub mod rendezvous { FromSwarm::DialFailure(peer) => { // Update the connection status of the rendezvous node that failed to connect. if let Some(peer_id) = peer.peer_id { - if let Some(node) = self.rendezvous_nodes + if let Some(node) = self + .rendezvous_nodes .iter_mut() - .find(|node| node.peer_id == peer_id) + .find(|node| node.peer_id == peer_id) { node.set_connection(ConnectionStatus::Disconnected); } @@ -435,13 +443,12 @@ pub mod rendezvous { if let Poll::Ready(()) = re_register_in.poll_unpin(cx) { match connection_status { ConnectionStatus::Connected => { - let _ = self.register(i) - .inspect_err(|err| { - tracing::error!( - error=%err, - rendezvous_node=%self.rendezvous_nodes[i].peer_id, + let _ = self.register(i).inspect_err(|err| { + tracing::error!( + error=%err, + rendezvous_node=%self.rendezvous_nodes[i].peer_id, "Failed to register with rendezvous node"); - }); + }); } ConnectionStatus::Disconnected => { self.rendezvous_nodes[i].set_registration( diff --git a/swap/src/cli.rs b/swap/src/cli.rs index 90373134c..ce7f5e401 100644 --- a/swap/src/cli.rs +++ b/swap/src/cli.rs @@ -169,7 +169,7 @@ mod tests { ) } - fn on_swarm_event(&mut self, event: FromSwarm) { + fn on_swarm_event(&mut self, event: FromSwarm<'_>) { self.inner.on_swarm_event(event); } diff --git a/swap/src/cli/behaviour.rs b/swap/src/cli/behaviour.rs index eafbbea1f..2546c129d 100644 --- a/swap/src/cli/behaviour.rs +++ b/swap/src/cli/behaviour.rs @@ -9,7 +9,6 @@ use crate::network::{ use crate::protocol::bob::State2; use crate::{bitcoin, env}; use anyhow::{anyhow, Error, Result}; -use libp2p::core::Multiaddr; use libp2p::request_response::{ InboundFailure, InboundRequestId, OutboundFailure, OutboundRequestId, ResponseChannel, }; diff --git a/swap/src/network/swap_setup/alice.rs b/swap/src/network/swap_setup/alice.rs index cb8e8e47f..96467c1cf 100644 --- a/swap/src/network/swap_setup/alice.rs +++ b/swap/src/network/swap_setup/alice.rs @@ -209,9 +209,9 @@ where fn handle_established_outbound_connection( &mut self, _connection_id: libp2p::swarm::ConnectionId, - peer: PeerId, - addr: &Multiaddr, - role_override: libp2p::core::Endpoint, + _peer: PeerId, + _addr: &Multiaddr, + _role_override: libp2p::core::Endpoint, ) -> std::result::Result, libp2p::swarm::ConnectionDenied> { // TODO: Libp2p ugprade: Is this true? // This sometimes crashes diff --git a/swap/src/network/swap_setup/bob.rs b/swap/src/network/swap_setup/bob.rs index 9fa544489..bf34d3401 100644 --- a/swap/src/network/swap_setup/bob.rs +++ b/swap/src/network/swap_setup/bob.rs @@ -160,6 +160,7 @@ impl ConnectionHandler for Handler { fn on_connection_event( &mut self, event: libp2p::swarm::handler::ConnectionEvent< + '_, Self::InboundProtocol, Self::OutboundProtocol, Self::InboundOpenInfo, @@ -226,11 +227,8 @@ impl ConnectionHandler for Handler { let max_seconds = self.timeout.as_secs(); self.outbound_stream = OptionFuture::from(Some(Box::pin(async move { - protocol.await.map_err(|e| match e { - tokio::time::error::Elapsed { .. } => Error::Timeout { - seconds: max_seconds, - }, - _ => Error::Other, + protocol.await.map_err(|_| Error::Timeout { + seconds: max_seconds, })? }) as OutboundStream)); diff --git a/swap/src/network/tor_transport.rs b/swap/src/network/tor_transport.rs index d66ddd4ed..9170afc78 100644 --- a/swap/src/network/tor_transport.rs +++ b/swap/src/network/tor_transport.rs @@ -30,7 +30,7 @@ impl Transport for TorDialOnlyTransport { fn listen_on( &mut self, - id: ListenerId, + _id: ListenerId, addr: Multiaddr, ) -> Result<(), TransportError> { Err(TransportError::MultiaddrNotSupported(addr)) @@ -89,7 +89,7 @@ impl Transport for TorDialOnlyTransport { })) } - fn remove_listener(&mut self, id: ListenerId) -> bool { + fn remove_listener(&mut self, _id: ListenerId) -> bool { // TODO(Libp2p Migration): What do we need to do here? // I believe nothing because we are not using the transport to listen. false @@ -97,7 +97,7 @@ impl Transport for TorDialOnlyTransport { fn poll( self: std::pin::Pin<&mut Self>, - cx: &mut std::task::Context<'_>, + _cx: &mut std::task::Context<'_>, ) -> std::task::Poll> { // TODO(Libp2p Migration): What do we need to do here? diff --git a/swap/src/network/transfer_proof.rs b/swap/src/network/transfer_proof.rs index 15850359c..7b935dd4e 100644 --- a/swap/src/network/transfer_proof.rs +++ b/swap/src/network/transfer_proof.rs @@ -1,7 +1,7 @@ use std::time::Duration; use crate::{asb, cli, monero}; -use libp2p::request_response::{self, OutboundFailure, OutboundRequestId, ProtocolSupport}; +use libp2p::request_response::{self, ProtocolSupport}; use libp2p::{PeerId, StreamProtocol}; use serde::{Deserialize, Serialize}; use uuid::Uuid; From 74e211da3ebba2a2b4472eeb772f912026165597 Mon Sep 17 00:00:00 2001 From: Binarybaron Date: Fri, 8 Nov 2024 22:53:24 +0100 Subject: [PATCH 098/112] refactor(libp2p): Print errors during negotiation in swap_setup/bob.rs --- swap/src/network/swap_setup/bob.rs | 145 ++++++++++++++++------------- 1 file changed, 82 insertions(+), 63 deletions(-) diff --git a/swap/src/network/swap_setup/bob.rs b/swap/src/network/swap_setup/bob.rs index bf34d3401..a097bce4b 100644 --- a/swap/src/network/swap_setup/bob.rs +++ b/swap/src/network/swap_setup/bob.rs @@ -2,7 +2,7 @@ use crate::network::swap_setup::{protocol, BlockchainNetwork, SpotPriceError, Sp use crate::protocol::bob::{State0, State2}; use crate::protocol::{Message1, Message3}; use crate::{bitcoin, cli, env, monero}; -use anyhow::Result; +use anyhow::{Context, Result}; use futures::future::{BoxFuture, OptionFuture}; use futures::AsyncWriteExt; use futures::FutureExt; @@ -14,7 +14,7 @@ use libp2p::swarm::{ use libp2p::{Multiaddr, PeerId}; use std::collections::VecDeque; use std::sync::Arc; -use std::task::{Context, Poll}; +use std::task::Poll; use std::time::Duration; use uuid::Uuid; @@ -88,7 +88,7 @@ impl NetworkBehaviour for Behaviour { fn poll( &mut self, - _cx: &mut Context<'_>, + _cx: &mut std::task::Context<'_>, ) -> Poll>> { // Send completed swaps to the swarm if let Some((_peer, completed)) = self.completed_swaps.pop_front() { @@ -179,49 +179,85 @@ impl ConnectionHandler for Handler { let env_config = self.env_config; let protocol = tokio::time::timeout(self.timeout, async move { - write_cbor_message( - &mut substream, - SpotPriceRequest { - btc: new_swap_request.btc, - blockchain_network: BlockchainNetwork { - bitcoin: env_config.bitcoin_network, - monero: env_config.monero_network, + let result = async { + // Here we request the spot price from Alice + write_cbor_message( + &mut substream, + SpotPriceRequest { + btc: new_swap_request.btc, + blockchain_network: BlockchainNetwork { + bitcoin: env_config.bitcoin_network, + monero: env_config.monero_network, + }, }, - }, - ) - .await?; - - let xmr = Result::from( - read_cbor_message::(&mut substream).await?, - )?; - - let state0 = State0::new( - new_swap_request.swap_id, - &mut rand::thread_rng(), - new_swap_request.btc, - xmr, - env_config.bitcoin_cancel_timelock, - env_config.bitcoin_punish_timelock, - new_swap_request.bitcoin_refund_address, - env_config.monero_finality_confirmations, - new_swap_request.tx_refund_fee, - new_swap_request.tx_cancel_fee, - ); - - write_cbor_message(&mut substream, state0.next_message()).await?; - let message1 = read_cbor_message::(&mut substream).await?; - let state1 = state0.receive(bitcoin_wallet.as_ref(), message1).await?; - - write_cbor_message(&mut substream, state1.next_message()).await?; - let message3 = read_cbor_message::(&mut substream).await?; - let state2 = state1.receive(message3)?; - - write_cbor_message(&mut substream, state2.next_message()).await?; - - substream.flush().await?; - substream.close().await?; - - Ok(state2) + ) + .await + .context("Failed to send spot price request to Alice")?; + + // Here we read the spot price response from Alice + // The outer ? checks if Alice responded with an error (SpotPriceError) + let xmr = Result::from( + // The inner ? is for the read_cbor_message function + // It will return an error if the deserialization fails + read_cbor_message::(&mut substream) + .await + .context("Failed to read spot price response from Alice")?, + )?; + + let state0 = State0::new( + new_swap_request.swap_id, + &mut rand::thread_rng(), + new_swap_request.btc, + xmr, + env_config.bitcoin_cancel_timelock, + env_config.bitcoin_punish_timelock, + new_swap_request.bitcoin_refund_address, + env_config.monero_finality_confirmations, + new_swap_request.tx_refund_fee, + new_swap_request.tx_cancel_fee, + ); + + write_cbor_message(&mut substream, state0.next_message()) + .await + .context("Failed to send state0 message to Alice")?; + let message1 = read_cbor_message::(&mut substream) + .await + .context("Failed to read message1 from Alice")?; + let state1 = state0 + .receive(bitcoin_wallet.as_ref(), message1) + .await + .context("Failed to receive state1")?; + write_cbor_message(&mut substream, state1.next_message()) + .await + .context("Failed to send state1 message")?; + let message3 = read_cbor_message::(&mut substream) + .await + .context("Failed to read message3 from Alice")?; + let state2 = state1 + .receive(message3) + .context("Failed to receive state2")?; + + write_cbor_message(&mut substream, state2.next_message()) + .await + .context("Failed to send state2 message")?; + + substream + .flush() + .await + .context("Failed to flush substream")?; + substream + .close() + .await + .context("Failed to close substream")?; + + Ok(state2) + } + .await; + + result.map_err(|e: anyhow::Error| { + tracing::error!("Error occurred during swap setup protocol: {:#}", e); + Error::Other + }) }); let max_seconds = self.timeout.as_secs(); @@ -250,7 +286,7 @@ impl ConnectionHandler for Handler { fn poll( &mut self, - cx: &mut Context<'_>, + cx: &mut std::task::Context<'_>, ) -> Poll< ConnectionHandlerEvent, > { @@ -340,20 +376,3 @@ impl From for Error { } } } - -impl From for Error { - fn from(error: anyhow::Error) -> Self { - // This is not good we are just swallowing the error here - // TODO(Libp2p Migration): We should find a better way to convert these errors in the entire file here into each other - // This doesnt seem optimal at all - // Incredibly ugly code and we lose a lot of valueale information here - Error::Other - } -} - -impl From for Error { - fn from(error: std::io::Error) -> Self { - // This is not good we are just swallowing the error here - Error::Other - } -} From b21f58ca83d240823eb3955374247354663bcacf Mon Sep 17 00:00:00 2001 From: Binarybaron Date: Sat, 9 Nov 2024 14:54:02 +0100 Subject: [PATCH 099/112] fix(asb): Remove websocket listen address from default config --- swap/src/asb/config.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/swap/src/asb/config.rs b/swap/src/asb/config.rs index 555eee71f..4f595dcde 100644 --- a/swap/src/asb/config.rs +++ b/swap/src/asb/config.rs @@ -23,7 +23,6 @@ pub struct Defaults { pub config_path: PathBuf, data_dir: PathBuf, listen_address_tcp: Multiaddr, - listen_address_ws: Multiaddr, electrum_rpc_url: Url, monero_wallet_rpc_url: Url, price_ticker_ws_url: Url, @@ -38,7 +37,6 @@ impl GetDefaults for Testnet { .join("config.toml"), data_dir: default_asb_data_dir()?.join("testnet"), listen_address_tcp: Multiaddr::from_str("/ip4/0.0.0.0/tcp/9939")?, - listen_address_ws: Multiaddr::from_str("/ip4/0.0.0.0/tcp/9940/ws")?, electrum_rpc_url: Url::parse("ssl://electrum.blockstream.info:60002")?, monero_wallet_rpc_url: Url::parse("http://127.0.0.1:38083/json_rpc")?, price_ticker_ws_url: Url::parse("wss://ws.kraken.com")?, @@ -57,7 +55,6 @@ impl GetDefaults for Mainnet { .join("config.toml"), data_dir: default_asb_data_dir()?.join("mainnet"), listen_address_tcp: Multiaddr::from_str("/ip4/0.0.0.0/tcp/9939")?, - listen_address_ws: Multiaddr::from_str("/ip4/0.0.0.0/tcp/9940/ws")?, electrum_rpc_url: Url::parse("ssl://blockstream.info:700")?, monero_wallet_rpc_url: Url::parse("http://127.0.0.1:18083/json_rpc")?, price_ticker_ws_url: Url::parse("wss://ws.kraken.com")?, @@ -299,7 +296,7 @@ pub fn query_user_for_initial_config(testnet: bool) -> Result { let listen_addresses = Input::with_theme(&ColorfulTheme::default()) .with_prompt("Enter multiaddresses (comma separated) on which asb should list for peer-to-peer communications or hit return to use default") - .default( format!("{},{}", defaults.listen_address_tcp, defaults.listen_address_ws)) + .default( format!("{}", defaults.listen_address_tcp)) .interact_text()?; let listen_addresses = listen_addresses .split(',') @@ -429,7 +426,7 @@ mod tests { network: bitcoin::Network::Testnet, }, network: Network { - listen: vec![defaults.listen_address_tcp, defaults.listen_address_ws], + listen: vec![defaults.listen_address_tcp], rendezvous_point: vec![], external_addresses: vec![], }, @@ -473,7 +470,7 @@ mod tests { network: bitcoin::Network::Bitcoin, }, network: Network { - listen: vec![defaults.listen_address_tcp, defaults.listen_address_ws], + listen: vec![defaults.listen_address_tcp], rendezvous_point: vec![], external_addresses: vec![], }, From 988fd57e0a1883981117ae0d4b4e170ffbfc2758 Mon Sep 17 00:00:00 2001 From: Binarybaron Date: Sat, 9 Nov 2024 14:57:42 +0100 Subject: [PATCH 100/112] refactor(cli): Do not match cancel/refund states as has_already_processed_transfer_proof --- swap/src/protocol/bob/swap.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/swap/src/protocol/bob/swap.rs b/swap/src/protocol/bob/swap.rs index 34e18dc7b..0639e5a3c 100644 --- a/swap/src/protocol/bob/swap.rs +++ b/swap/src/protocol/bob/swap.rs @@ -24,17 +24,14 @@ pub fn is_complete(state: &BobState) -> bool { /// This is necessary because sometimes our acknowledgement might not reach Alice. pub fn has_already_processed_transfer_proof(state: &BobState) -> bool { // This match statement MUST match all states which Bob can enter after receiving the transfer proof. + // We do not match any of the cancel / refund states because in those, the swap cannot be successfull anymore. matches!( state, BobState::XmrLockProofReceived { .. } | BobState::XmrLocked(..) | BobState::EncSigSent(..) | BobState::BtcRedeemed(..) - | BobState::CancelTimelockExpired(..) - | BobState::BtcCancelled(..) - | BobState::BtcRefunded(..) | BobState::XmrRedeemed { .. } - | BobState::BtcPunished { .. } ) } From c39d097efd502a9c482a05ca80ceecf3cb70ce62 Mon Sep 17 00:00:00 2001 From: Binarybaron Date: Sat, 9 Nov 2024 14:58:17 +0100 Subject: [PATCH 101/112] refactor(asb): Add TODO for listening to enc signature before acknowledgement --- swap/src/protocol/alice/swap.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/swap/src/protocol/alice/swap.rs b/swap/src/protocol/alice/swap.rs index 6fbc032ba..f1573a604 100644 --- a/swap/src/protocol/alice/swap.rs +++ b/swap/src/protocol/alice/swap.rs @@ -178,11 +178,13 @@ where state3, } }, - // Why are we already receiving the encrypted signature here? + // TODO: We should already listen for the encrypted signature here. // // If we send Bob the transfer proof, but for whatever reason we do not receive an acknoledgement from him // we would be stuck in this state forever (deadlock). By listening for the encrypted signature here we // can still proceed to the next state even if Bob does not respond with an acknoledgement. + // + // This currently does not work due to borrow checker issues. // enc_sig = recv_encrypted_signature => { // tracing::info!("Received encrypted signature"); From 3f95985e2079219fe2583411fbd78433ef4b0b62 Mon Sep 17 00:00:00 2001 From: Binarybaron Date: Sat, 9 Nov 2024 15:00:35 +0100 Subject: [PATCH 102/112] refactor: Remove Cargo.lock from subdirectory --- src-tauri/Cargo.lock | 4346 ------------------------------------------ 1 file changed, 4346 deletions(-) delete mode 100644 src-tauri/Cargo.lock diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock deleted file mode 100644 index 8bb2da796..000000000 --- a/src-tauri/Cargo.lock +++ /dev/null @@ -1,4346 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "addr2line" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "alloc-no-stdlib" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" - -[[package]] -name = "alloc-stdlib" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" -dependencies = [ - "alloc-no-stdlib", -] - -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "anyhow" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" - -[[package]] -name = "atk" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4af014b17dd80e8af9fa689b2d4a211ddba6eb583c1622f35d0cb543f6b17e4" -dependencies = [ - "atk-sys", - "glib", - "libc", -] - -[[package]] -name = "atk-sys" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "251e0b7d90e33e0ba930891a505a9a35ece37b2dd37a14f3ffc306c13b980009" -dependencies = [ - "glib-sys", - "gobject-sys", - "libc", - "system-deps", -] - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "backtrace" -version = "0.3.73" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" -dependencies = [ - "addr2line", - "cc", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", -] - -[[package]] -name = "base64" -version = "0.21.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" - -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" -dependencies = [ - "serde", -] - -[[package]] -name = "block" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - -[[package]] -name = "block2" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f" -dependencies = [ - "objc2", -] - -[[package]] -name = "brotli" -version = "3.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d640d25bc63c50fb1f0b545ffd80207d2e10a4c965530809b40ba3386825c391" -dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", - "brotli-decompressor", -] - -[[package]] -name = "brotli-decompressor" -version = "2.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e2e4afe60d7dd600fdd3de8d0f08c2b7ec039712e3b6137ff98b7004e82de4f" -dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", -] - -[[package]] -name = "bumpalo" -version = "3.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" - -[[package]] -name = "bytemuck" -version = "1.16.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b236fc92302c97ed75b38da1f4917b5cdda4984745740f153a5d3059e48d725e" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "bytes" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" -dependencies = [ - "serde", -] - -[[package]] -name = "cairo-rs" -version = "0.18.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ca26ef0159422fb77631dc9d17b102f253b876fe1586b03b803e63a309b4ee2" -dependencies = [ - "bitflags 2.6.0", - "cairo-sys-rs", - "glib", - "libc", - "once_cell", - "thiserror", -] - -[[package]] -name = "cairo-sys-rs" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "685c9fa8e590b8b3d678873528d83411db17242a73fccaed827770ea0fedda51" -dependencies = [ - "glib-sys", - "libc", - "system-deps", -] - -[[package]] -name = "camino" -version = "1.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0ec6b951b160caa93cc0c7b209e5a3bff7aae9062213451ac99493cd844c239" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo-platform" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo_metadata" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" -dependencies = [ - "camino", - "cargo-platform", - "semver", - "serde", - "serde_json", - "thiserror", -] - -[[package]] -name = "cargo_toml" -version = "0.17.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a969e13a7589e9e3e4207e153bae624ade2b5622fb4684a4923b23ec3d57719" -dependencies = [ - "serde", - "toml 0.8.2", -] - -[[package]] -name = "cc" -version = "1.0.104" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74b6a57f98764a267ff415d50a25e6e166f3831a5071af4995296ea97d210490" - -[[package]] -name = "cesu8" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" - -[[package]] -name = "cfb" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d38f2da7a0a2c4ccf0065be06397cc26a81f4e528be095826eee9d4adbb8c60f" -dependencies = [ - "byteorder", - "fnv", - "uuid", -] - -[[package]] -name = "cfg-expr" -version = "0.15.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" -dependencies = [ - "smallvec", - "target-lexicon", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "cfg_aliases" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" - -[[package]] -name = "chrono" -version = "0.4.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "num-traits", - "serde", - "windows-targets 0.52.6", -] - -[[package]] -name = "cocoa" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6140449f97a6e97f9511815c5632d84c8aacf8ac271ad77c559218161a1373c" -dependencies = [ - "bitflags 1.3.2", - "block", - "cocoa-foundation", - "core-foundation", - "core-graphics", - "foreign-types", - "libc", - "objc", -] - -[[package]] -name = "cocoa-foundation" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c6234cbb2e4c785b456c0644748b1ac416dd045799740356f8363dfe00c93f7" -dependencies = [ - "bitflags 1.3.2", - "block", - "core-foundation", - "core-graphics-types", - "libc", - "objc", -] - -[[package]] -name = "combine" -version = "4.6.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" -dependencies = [ - "bytes", - "memchr", -] - -[[package]] -name = "convert_case" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" - -[[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-sys" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" - -[[package]] -name = "core-graphics" -version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c07782be35f9e1140080c6b96f0d44b739e2278479f64e02fdab4e32dfd8b081" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "core-graphics-types", - "foreign-types", - "libc", -] - -[[package]] -name = "core-graphics-types" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "libc", -] - -[[package]] -name = "cpufeatures" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" -dependencies = [ - "libc", -] - -[[package]] -name = "crc32fast" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crossbeam-channel" -version = "0.5.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "cssparser" -version = "0.27.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "754b69d351cdc2d8ee09ae203db831e005560fc6030da058f86ad60c92a9cb0a" -dependencies = [ - "cssparser-macros", - "dtoa-short", - "itoa 0.4.8", - "matches", - "phf 0.8.0", - "proc-macro2", - "quote", - "smallvec", - "syn 1.0.109", -] - -[[package]] -name = "cssparser-macros" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" -dependencies = [ - "quote", - "syn 2.0.68", -] - -[[package]] -name = "ctor" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" -dependencies = [ - "quote", - "syn 2.0.68", -] - -[[package]] -name = "darling" -version = "0.20.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83b2eb4d90d12bdda5ed17de686c2acb4c57914f8f921b8da7e112b5a36f3fe1" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.20.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622687fe0bac72a04e5599029151f5796111b90f1baaa9b544d807a5e31cd120" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn 2.0.68", -] - -[[package]] -name = "darling_macro" -version = "0.20.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" -dependencies = [ - "darling_core", - "quote", - "syn 2.0.68", -] - -[[package]] -name = "deranged" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" -dependencies = [ - "powerfmt", - "serde", -] - -[[package]] -name = "derive_more" -version = "0.99.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" -dependencies = [ - "convert_case", - "proc-macro2", - "quote", - "rustc_version", - "syn 2.0.68", -] - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer", - "crypto-common", -] - -[[package]] -name = "dirs" -version = "5.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" -dependencies = [ - "dirs-sys", -] - -[[package]] -name = "dirs-sys" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" -dependencies = [ - "libc", - "option-ext", - "redox_users", - "windows-sys 0.48.0", -] - -[[package]] -name = "dispatch" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" - -[[package]] -name = "dlopen2" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1297103d2bbaea85724fcee6294c2d50b1081f9ad47d0f6f6f61eda65315a6" -dependencies = [ - "dlopen2_derive", - "libc", - "once_cell", - "winapi", -] - -[[package]] -name = "dlopen2_derive" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b99bf03862d7f545ebc28ddd33a665b50865f4dfd84031a393823879bd4c54" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.68", -] - -[[package]] -name = "dpi" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f25c0e292a7ca6d6498557ff1df68f32c99850012b6ea401cf8daf771f22ff53" -dependencies = [ - "serde", -] - -[[package]] -name = "dtoa" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcbb2bf8e87535c23f7a8a321e364ce21462d0ff10cb6407820e8e96dfff6653" - -[[package]] -name = "dtoa-short" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd1511a7b6a56299bd043a9c167a6d2bfb37bf84a6dfceaba651168adfb43c87" -dependencies = [ - "dtoa", -] - -[[package]] -name = "dunce" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" - -[[package]] -name = "dyn-clone" -version = "1.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" - -[[package]] -name = "embed-resource" -version = "2.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6985554d0688b687c5cb73898a34fbe3ad6c24c58c238a4d91d5e840670ee9d" -dependencies = [ - "cc", - "memchr", - "rustc_version", - "toml 0.8.2", - "vswhom", - "winreg", -] - -[[package]] -name = "embed_plist" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ef6b89e5b37196644d8796de5268852ff179b44e96276cf4290264843743bb7" - -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "erased-serde" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24e2389d65ab4fab27dc2a5de7b191e1f6617d1f1c8855c0dc569c94a4cbb18d" -dependencies = [ - "serde", - "typeid", -] - -[[package]] -name = "fdeflate" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f9bfee30e4dedf0ab8b422f03af778d9612b63f502710fc500a334ebe2de645" -dependencies = [ - "simd-adler32", -] - -[[package]] -name = "field-offset" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38e2275cc4e4fc009b0669731a1e5ab7ebf11f469eaede2bab9309a5b4d6057f" -dependencies = [ - "memoffset", - "rustc_version", -] - -[[package]] -name = "flate2" -version = "1.0.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "foreign-types" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" -dependencies = [ - "foreign-types-macros", - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-macros" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.68", -] - -[[package]] -name = "foreign-types-shared" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" - -[[package]] -name = "form_urlencoded" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "futf" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df420e2e84819663797d1ec6544b13c5be84629e7bb00dc960d6917db2987843" -dependencies = [ - "mac", - "new_debug_unreachable", -] - -[[package]] -name = "futures-channel" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" -dependencies = [ - "futures-core", -] - -[[package]] -name = "futures-core" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" - -[[package]] -name = "futures-executor" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-io" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" - -[[package]] -name = "futures-macro" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.68", -] - -[[package]] -name = "futures-sink" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" - -[[package]] -name = "futures-task" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" - -[[package]] -name = "futures-util" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" -dependencies = [ - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", -] - -[[package]] -name = "fxhash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" -dependencies = [ - "byteorder", -] - -[[package]] -name = "gdk" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5ba081bdef3b75ebcdbfc953699ed2d7417d6bd853347a42a37d76406a33646" -dependencies = [ - "cairo-rs", - "gdk-pixbuf", - "gdk-sys", - "gio", - "glib", - "libc", - "pango", -] - -[[package]] -name = "gdk-pixbuf" -version = "0.18.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50e1f5f1b0bfb830d6ccc8066d18db35c487b1b2b1e8589b5dfe9f07e8defaec" -dependencies = [ - "gdk-pixbuf-sys", - "gio", - "glib", - "libc", - "once_cell", -] - -[[package]] -name = "gdk-pixbuf-sys" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9839ea644ed9c97a34d129ad56d38a25e6756f99f3a88e15cd39c20629caf7" -dependencies = [ - "gio-sys", - "glib-sys", - "gobject-sys", - "libc", - "system-deps", -] - -[[package]] -name = "gdk-sys" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31ff856cb3386dae1703a920f803abafcc580e9b5f711ca62ed1620c25b51ff2" -dependencies = [ - "cairo-sys-rs", - "gdk-pixbuf-sys", - "gio-sys", - "glib-sys", - "gobject-sys", - "libc", - "pango-sys", - "pkg-config", - "system-deps", -] - -[[package]] -name = "gdkwayland-sys" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a90fbf5c033c65d93792192a49a8efb5bb1e640c419682a58bb96f5ae77f3d4a" -dependencies = [ - "gdk-sys", - "glib-sys", - "gobject-sys", - "libc", - "pkg-config", - "system-deps", -] - -[[package]] -name = "gdkx11" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2ea8a4909d530f79921290389cbd7c34cb9d623bfe970eaae65ca5f9cd9cce" -dependencies = [ - "gdk", - "gdkx11-sys", - "gio", - "glib", - "libc", - "x11", -] - -[[package]] -name = "gdkx11-sys" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fee8f00f4ee46cad2939b8990f5c70c94ff882c3028f3cc5abf950fa4ab53043" -dependencies = [ - "gdk-sys", - "glib-sys", - "libc", - "system-deps", - "x11", -] - -[[package]] -name = "generator" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc16584ff22b460a382b7feec54b23d2908d858152e5739a120b949293bd74e" -dependencies = [ - "cc", - "libc", - "log", - "rustversion", - "windows 0.48.0", -] - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" -dependencies = [ - "cfg-if", - "libc", - "wasi 0.9.0+wasi-snapshot-preview1", -] - -[[package]] -name = "getrandom" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" -dependencies = [ - "cfg-if", - "libc", - "wasi 0.11.0+wasi-snapshot-preview1", -] - -[[package]] -name = "gimli" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" - -[[package]] -name = "gio" -version = "0.18.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fc8f532f87b79cbc51a79748f16a6828fb784be93145a322fa14d06d354c73" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-util", - "gio-sys", - "glib", - "libc", - "once_cell", - "pin-project-lite", - "smallvec", - "thiserror", -] - -[[package]] -name = "gio-sys" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37566df850baf5e4cb0dfb78af2e4b9898d817ed9263d1090a2df958c64737d2" -dependencies = [ - "glib-sys", - "gobject-sys", - "libc", - "system-deps", - "winapi", -] - -[[package]] -name = "glib" -version = "0.18.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233daaf6e83ae6a12a52055f568f9d7cf4671dabb78ff9560ab6da230ce00ee5" -dependencies = [ - "bitflags 2.6.0", - "futures-channel", - "futures-core", - "futures-executor", - "futures-task", - "futures-util", - "gio-sys", - "glib-macros", - "glib-sys", - "gobject-sys", - "libc", - "memchr", - "once_cell", - "smallvec", - "thiserror", -] - -[[package]] -name = "glib-macros" -version = "0.18.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bb0228f477c0900c880fd78c8759b95c7636dbd7842707f49e132378aa2acdc" -dependencies = [ - "heck 0.4.1", - "proc-macro-crate 2.0.2", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 2.0.68", -] - -[[package]] -name = "glib-sys" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "063ce2eb6a8d0ea93d2bf8ba1957e78dbab6be1c2220dd3daca57d5a9d869898" -dependencies = [ - "libc", - "system-deps", -] - -[[package]] -name = "glob" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" - -[[package]] -name = "gobject-sys" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0850127b514d1c4a4654ead6dedadb18198999985908e6ffe4436f53c785ce44" -dependencies = [ - "glib-sys", - "libc", - "system-deps", -] - -[[package]] -name = "gtk" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93c4f5e0e20b60e10631a5f06da7fe3dda744b05ad0ea71fee2f47adf865890c" -dependencies = [ - "atk", - "cairo-rs", - "field-offset", - "futures-channel", - "gdk", - "gdk-pixbuf", - "gio", - "glib", - "gtk-sys", - "gtk3-macros", - "libc", - "pango", - "pkg-config", -] - -[[package]] -name = "gtk-sys" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "771437bf1de2c1c0b496c11505bdf748e26066bbe942dfc8f614c9460f6d7722" -dependencies = [ - "atk-sys", - "cairo-sys-rs", - "gdk-pixbuf-sys", - "gdk-sys", - "gio-sys", - "glib-sys", - "gobject-sys", - "libc", - "pango-sys", - "system-deps", -] - -[[package]] -name = "gtk3-macros" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6063efb63db582968fb7df72e1ae68aa6360dcfb0a75143f34fc7d616bad75e" -dependencies = [ - "proc-macro-crate 1.3.1", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 2.0.68", -] - -[[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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - -[[package]] -name = "hermit-abi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "html5ever" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bea68cab48b8459f17cf1c944c67ddc572d272d9f2b274140f223ecb1da4a3b7" -dependencies = [ - "log", - "mac", - "markup5ever", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "http" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" -dependencies = [ - "bytes", - "fnv", - "itoa 1.0.11", -] - -[[package]] -name = "http-body" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" -dependencies = [ - "bytes", - "http", -] - -[[package]] -name = "http-body-util" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" -dependencies = [ - "bytes", - "futures-util", - "http", - "http-body", - "pin-project-lite", -] - -[[package]] -name = "httparse" -version = "1.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" - -[[package]] -name = "hyper" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4fe55fb7a772d59a5ff1dfbff4fe0258d19b89fec4b233e75d35d5d2316badc" -dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "http", - "http-body", - "httparse", - "itoa 1.0.11", - "pin-project-lite", - "smallvec", - "tokio", - "want", -] - -[[package]] -name = "hyper-util" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ab92f4f49ee4fb4f997c784b7a2e0fa70050211e0b6a287f898c3c9785ca956" -dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "http", - "http-body", - "hyper", - "pin-project-lite", - "socket2", - "tokio", - "tower", - "tower-service", - "tracing", -] - -[[package]] -name = "iana-time-zone" -version = "0.1.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core 0.52.0", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "ico" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3804960be0bb5e4edb1e1ad67afd321a9ecfd875c3e65c099468fd2717d7cae" -dependencies = [ - "byteorder", - "png", -] - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "idna" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - -[[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.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" -dependencies = [ - "equivalent", - "hashbrown 0.14.5", - "serde", -] - -[[package]] -name = "infer" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb33622da908807a06f9513c19b3c1ad50fab3e4137d82a78107d502075aa199" -dependencies = [ - "cfb", -] - -[[package]] -name = "instant" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "ipnet" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" - -[[package]] -name = "is-docker" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "928bae27f42bc99b60d9ac7334e3a21d10ad8f1835a4e12ec3ec0464765ed1b3" -dependencies = [ - "once_cell", -] - -[[package]] -name = "is-wsl" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "173609498df190136aa7dea1a91db051746d339e18476eed5ca40521f02d7aa5" -dependencies = [ - "is-docker", - "once_cell", -] - -[[package]] -name = "itoa" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "javascriptcore-rs" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca5671e9ffce8ffba57afc24070e906da7fc4b1ba66f2cabebf61bf2ea257fcc" -dependencies = [ - "bitflags 1.3.2", - "glib", - "javascriptcore-rs-sys", -] - -[[package]] -name = "javascriptcore-rs-sys" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af1be78d14ffa4b75b66df31840478fef72b51f8c2465d4ca7c194da9f7a5124" -dependencies = [ - "glib-sys", - "gobject-sys", - "libc", - "system-deps", -] - -[[package]] -name = "jni" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" -dependencies = [ - "cesu8", - "cfg-if", - "combine", - "jni-sys", - "log", - "thiserror", - "walkdir", - "windows-sys 0.45.0", -] - -[[package]] -name = "jni-sys" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" - -[[package]] -name = "js-sys" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "json-patch" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec9ad60d674508f3ca8f380a928cfe7b096bc729c4e2dbfe3852bc45da3ab30b" -dependencies = [ - "serde", - "serde_json", - "thiserror", -] - -[[package]] -name = "keyboard-types" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b750dcadc39a09dbadd74e118f6dd6598df77fa01df0cfcdc52c28dece74528a" -dependencies = [ - "bitflags 2.6.0", - "serde", - "unicode-segmentation", -] - -[[package]] -name = "kuchikiki" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e4755b7b995046f510a7520c42b2fed58b77bd94d5a87a8eb43d2fd126da8" -dependencies = [ - "cssparser", - "html5ever", - "indexmap 1.9.3", - "matches", - "selectors", -] - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - -[[package]] -name = "libappindicator" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03589b9607c868cc7ae54c0b2a22c8dc03dd41692d48f2d7df73615c6a95dc0a" -dependencies = [ - "glib", - "gtk", - "gtk-sys", - "libappindicator-sys", - "log", -] - -[[package]] -name = "libappindicator-sys" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e9ec52138abedcc58dc17a7c6c0c00a2bdb4f3427c7f63fa97fd0d859155caf" -dependencies = [ - "gtk-sys", - "libloading", - "once_cell", -] - -[[package]] -name = "libc" -version = "0.2.155" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" - -[[package]] -name = "libloading" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" -dependencies = [ - "cfg-if", - "winapi", -] - -[[package]] -name = "libredox" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" -dependencies = [ - "bitflags 2.6.0", - "libc", -] - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" - -[[package]] -name = "loom" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff50ecb28bb86013e935fb6683ab1f6d3a20016f123c76fd4c27470076ac30f5" -dependencies = [ - "cfg-if", - "generator", - "scoped-tls", - "serde", - "serde_json", - "tracing", - "tracing-subscriber", -] - -[[package]] -name = "mac" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" - -[[package]] -name = "malloc_buf" -version = "0.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" -dependencies = [ - "libc", -] - -[[package]] -name = "markup5ever" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a2629bb1404f3d34c2e921f21fd34ba00b206124c81f65c50b43b6aaefeb016" -dependencies = [ - "log", - "phf 0.10.1", - "phf_codegen 0.10.0", - "string_cache", - "string_cache_codegen", - "tendril", -] - -[[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 = "matches" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" - -[[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "memoffset" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" -dependencies = [ - "autocfg", -] - -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - -[[package]] -name = "miniz_oxide" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" -dependencies = [ - "adler", - "simd-adler32", -] - -[[package]] -name = "mio" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" -dependencies = [ - "libc", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.48.0", -] - -[[package]] -name = "muda" -version = "0.13.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b959f97c97044e4c96e32e1db292a7d594449546a3c6b77ae613dc3a5b5145" -dependencies = [ - "cocoa", - "crossbeam-channel", - "dpi", - "gtk", - "keyboard-types", - "objc", - "once_cell", - "png", - "serde", - "thiserror", - "windows-sys 0.52.0", -] - -[[package]] -name = "ndk" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "451422b7e4718271c8b5b3aadf5adedba43dc76312454b387e98fae0fc951aa0" -dependencies = [ - "bitflags 1.3.2", - "jni-sys", - "ndk-sys", - "num_enum", - "raw-window-handle 0.5.2", - "thiserror", -] - -[[package]] -name = "ndk-context" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" - -[[package]] -name = "ndk-sys" -version = "0.4.1+23.1.7779620" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cf2aae958bd232cac5069850591667ad422d263686d75b52a065f9badeee5a3" -dependencies = [ - "jni-sys", -] - -[[package]] -name = "new_debug_unreachable" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" - -[[package]] -name = "nodrop" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" - -[[package]] -name = "nu-ansi-term" -version = "0.46.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" -dependencies = [ - "overload", - "winapi", -] - -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "num_enum" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" -dependencies = [ - "num_enum_derive", -] - -[[package]] -name = "num_enum_derive" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" -dependencies = [ - "proc-macro-crate 1.3.1", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "objc" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" -dependencies = [ - "malloc_buf", - "objc_exception", -] - -[[package]] -name = "objc-sys" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb91bdd390c7ce1a8607f35f3ca7151b65afc0ff5ff3b34fa350f7d7c7e4310" - -[[package]] -name = "objc2" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46a785d4eeff09c14c487497c162e92766fbb3e4059a71840cecc03d9a50b804" -dependencies = [ - "objc-sys", - "objc2-encode", -] - -[[package]] -name = "objc2-app-kit" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff" -dependencies = [ - "bitflags 2.6.0", - "block2", - "libc", - "objc2", - "objc2-core-data", - "objc2-core-image", - "objc2-foundation", - "objc2-quartz-core", -] - -[[package]] -name = "objc2-core-data" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef" -dependencies = [ - "bitflags 2.6.0", - "block2", - "objc2", - "objc2-foundation", -] - -[[package]] -name = "objc2-core-image" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55260963a527c99f1819c4f8e3b47fe04f9650694ef348ffd2227e8196d34c80" -dependencies = [ - "block2", - "objc2", - "objc2-foundation", - "objc2-metal", -] - -[[package]] -name = "objc2-encode" -version = "4.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7891e71393cd1f227313c9379a26a584ff3d7e6e7159e988851f0934c993f0f8" - -[[package]] -name = "objc2-foundation" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" -dependencies = [ - "bitflags 2.6.0", - "block2", - "dispatch", - "libc", - "objc2", -] - -[[package]] -name = "objc2-metal" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" -dependencies = [ - "bitflags 2.6.0", - "block2", - "objc2", - "objc2-foundation", -] - -[[package]] -name = "objc2-quartz-core" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" -dependencies = [ - "bitflags 2.6.0", - "block2", - "objc2", - "objc2-foundation", - "objc2-metal", -] - -[[package]] -name = "objc_exception" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4" -dependencies = [ - "cc", -] - -[[package]] -name = "objc_id" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b" -dependencies = [ - "objc", -] - -[[package]] -name = "object" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce" -dependencies = [ - "memchr", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "open" -version = "5.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d2c909a3fce3bd80efef4cd1c6c056bd9376a8fe06fcfdbebaf32cb485a7e37" -dependencies = [ - "is-wsl", - "libc", - "pathdiff", -] - -[[package]] -name = "option-ext" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" - -[[package]] -name = "os_pipe" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29d73ba8daf8fac13b0501d1abeddcfe21ba7401ada61a819144b6c2a4f32209" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "overload" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" - -[[package]] -name = "pango" -version = "0.18.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ca27ec1eb0457ab26f3036ea52229edbdb74dee1edd29063f5b9b010e7ebee4" -dependencies = [ - "gio", - "glib", - "libc", - "once_cell", - "pango-sys", -] - -[[package]] -name = "pango-sys" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436737e391a843e5933d6d9aa102cb126d501e815b83601365a948a518555dc5" -dependencies = [ - "glib-sys", - "gobject-sys", - "libc", - "system-deps", -] - -[[package]] -name = "parking_lot" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-targets 0.52.6", -] - -[[package]] -name = "pathdiff" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" - -[[package]] -name = "percent-encoding" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" - -[[package]] -name = "phf" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dfb61232e34fcb633f43d12c58f83c1df82962dcdfa565a4e866ffc17dafe12" -dependencies = [ - "phf_macros 0.8.0", - "phf_shared 0.8.0", - "proc-macro-hack", -] - -[[package]] -name = "phf" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259" -dependencies = [ - "phf_shared 0.10.0", -] - -[[package]] -name = "phf" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" -dependencies = [ - "phf_macros 0.11.2", - "phf_shared 0.11.2", -] - -[[package]] -name = "phf_codegen" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbffee61585b0411840d3ece935cce9cb6321f01c45477d30066498cd5e1a815" -dependencies = [ - "phf_generator 0.8.0", - "phf_shared 0.8.0", -] - -[[package]] -name = "phf_codegen" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb1c3a8bc4dd4e5cfce29b44ffc14bedd2ee294559a294e2a4d4c9e9a6a13cd" -dependencies = [ - "phf_generator 0.10.0", - "phf_shared 0.10.0", -] - -[[package]] -name = "phf_generator" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17367f0cc86f2d25802b2c26ee58a7b23faeccf78a396094c13dced0d0182526" -dependencies = [ - "phf_shared 0.8.0", - "rand 0.7.3", -] - -[[package]] -name = "phf_generator" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6" -dependencies = [ - "phf_shared 0.10.0", - "rand 0.8.5", -] - -[[package]] -name = "phf_generator" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" -dependencies = [ - "phf_shared 0.11.2", - "rand 0.8.5", -] - -[[package]] -name = "phf_macros" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f6fde18ff429ffc8fe78e2bf7f8b7a5a5a6e2a8b58bc5a9ac69198bbda9189c" -dependencies = [ - "phf_generator 0.8.0", - "phf_shared 0.8.0", - "proc-macro-hack", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "phf_macros" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" -dependencies = [ - "phf_generator 0.11.2", - "phf_shared 0.11.2", - "proc-macro2", - "quote", - "syn 2.0.68", -] - -[[package]] -name = "phf_shared" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c00cf8b9eafe68dde5e9eaa2cef8ee84a9336a47d566ec55ca16589633b65af7" -dependencies = [ - "siphasher", -] - -[[package]] -name = "phf_shared" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" -dependencies = [ - "siphasher", -] - -[[package]] -name = "phf_shared" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" -dependencies = [ - "siphasher", -] - -[[package]] -name = "pin-project" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.68", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "pkg-config" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" - -[[package]] -name = "plist" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42cf17e9a1800f5f396bc67d193dc9411b59012a5876445ef450d449881e1016" -dependencies = [ - "base64 0.22.1", - "indexmap 2.2.6", - "quick-xml", - "serde", - "time", -] - -[[package]] -name = "png" -version = "0.17.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06e4b0d3d1312775e782c86c91a111aa1f910cbb65e1337f9975b5f9a554b5e1" -dependencies = [ - "bitflags 1.3.2", - "crc32fast", - "fdeflate", - "flate2", - "miniz_oxide", -] - -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - -[[package]] -name = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - -[[package]] -name = "precomputed-hash" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" - -[[package]] -name = "proc-macro-crate" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" -dependencies = [ - "once_cell", - "toml_edit 0.19.15", -] - -[[package]] -name = "proc-macro-crate" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b00f26d3400549137f92511a46ac1cd8ce37cb5598a96d382381458b992a5d24" -dependencies = [ - "toml_datetime", - "toml_edit 0.20.2", -] - -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - -[[package]] -name = "proc-macro-hack" -version = "0.5.20+deprecated" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" - -[[package]] -name = "proc-macro2" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quick-xml" -version = "0.32.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d3a6e5838b60e0e8fa7a43f22ade549a37d61f8bdbe636d0d7816191de969c2" -dependencies = [ - "memchr", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rand" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" -dependencies = [ - "getrandom 0.1.16", - "libc", - "rand_chacha 0.2.2", - "rand_core 0.5.1", - "rand_hc", - "rand_pcg", -] - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_chacha" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" -dependencies = [ - "ppv-lite86", - "rand_core 0.5.1", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_core" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" -dependencies = [ - "getrandom 0.1.16", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom 0.2.15", -] - -[[package]] -name = "rand_hc" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -dependencies = [ - "rand_core 0.5.1", -] - -[[package]] -name = "rand_pcg" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429" -dependencies = [ - "rand_core 0.5.1", -] - -[[package]] -name = "raw-window-handle" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9" - -[[package]] -name = "raw-window-handle" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" - -[[package]] -name = "redox_syscall" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" -dependencies = [ - "bitflags 2.6.0", -] - -[[package]] -name = "redox_users" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" -dependencies = [ - "getrandom 0.2.15", - "libredox", - "thiserror", -] - -[[package]] -name = "regex" -version = "1.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata 0.4.7", - "regex-syntax 0.8.4", -] - -[[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.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax 0.8.4", -] - -[[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.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" - -[[package]] -name = "reqwest" -version = "0.12.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" -dependencies = [ - "base64 0.22.1", - "bytes", - "futures-core", - "futures-util", - "http", - "http-body", - "http-body-util", - "hyper", - "hyper-util", - "ipnet", - "js-sys", - "log", - "mime", - "once_cell", - "percent-encoding", - "pin-project-lite", - "serde", - "serde_json", - "serde_urlencoded", - "sync_wrapper", - "tokio", - "tokio-util", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "wasm-streams", - "web-sys", - "winreg", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" - -[[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - -[[package]] -name = "rustversion" -version = "1.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[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 = "schemars" -version = "0.8.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" -dependencies = [ - "dyn-clone", - "indexmap 1.9.3", - "schemars_derive", - "serde", - "serde_json", - "url", -] - -[[package]] -name = "schemars_derive" -version = "0.8.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" -dependencies = [ - "proc-macro2", - "quote", - "serde_derive_internals", - "syn 2.0.68", -] - -[[package]] -name = "scoped-tls" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "selectors" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df320f1889ac4ba6bc0cdc9c9af7af4bd64bb927bccdf32d81140dc1f9be12fe" -dependencies = [ - "bitflags 1.3.2", - "cssparser", - "derive_more", - "fxhash", - "log", - "matches", - "phf 0.8.0", - "phf_codegen 0.8.0", - "precomputed-hash", - "servo_arc", - "smallvec", - "thin-slice", -] - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" -dependencies = [ - "serde", -] - -[[package]] -name = "serde" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde-untagged" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2676ba99bd82f75cae5cbd2c8eda6fa0b8760f18978ea840e980dd5567b5c5b6" -dependencies = [ - "erased-serde", - "serde", - "typeid", -] - -[[package]] -name = "serde_derive" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.68", -] - -[[package]] -name = "serde_derive_internals" -version = "0.29.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.68", -] - -[[package]] -name = "serde_json" -version = "1.0.120" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" -dependencies = [ - "itoa 1.0.11", - "ryu", - "serde", -] - -[[package]] -name = "serde_repr" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.68", -] - -[[package]] -name = "serde_spanned" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" -dependencies = [ - "serde", -] - -[[package]] -name = "serde_urlencoded" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" -dependencies = [ - "form_urlencoded", - "itoa 1.0.11", - "ryu", - "serde", -] - -[[package]] -name = "serde_with" -version = "3.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e73139bc5ec2d45e6c5fd85be5a46949c1c39a4c18e56915f5eb4c12f975e377" -dependencies = [ - "base64 0.22.1", - "chrono", - "hex", - "indexmap 1.9.3", - "indexmap 2.2.6", - "serde", - "serde_derive", - "serde_json", - "serde_with_macros", - "time", -] - -[[package]] -name = "serde_with_macros" -version = "3.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b80d3d6b56b64335c0180e5ffde23b3c5e08c14c585b51a15bd0e95393f46703" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn 2.0.68", -] - -[[package]] -name = "serialize-to-javascript" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9823f2d3b6a81d98228151fdeaf848206a7855a7a042bbf9bf870449a66cafb" -dependencies = [ - "serde", - "serde_json", - "serialize-to-javascript-impl", -] - -[[package]] -name = "serialize-to-javascript-impl" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74064874e9f6a15f04c1f3cb627902d0e6b410abbf36668afa873c61889f1763" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "servo_arc" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d98238b800e0d1576d8b6e3de32827c2d74bee68bb97748dcf5071fb53965432" -dependencies = [ - "nodrop", - "stable_deref_trait", -] - -[[package]] -name = "sha2" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "sharded-slab" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "shared_child" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0d94659ad3c2137fef23ae75b03d5241d633f8acded53d672decfa0e6e0caef" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "simd-adler32" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" - -[[package]] -name = "siphasher" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" - -[[package]] -name = "slab" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "socket2" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "softbuffer" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d623bff5d06f60d738990980d782c8c866997d9194cfe79ecad00aa2f76826dd" -dependencies = [ - "bytemuck", - "cfg_aliases", - "core-graphics", - "foreign-types", - "js-sys", - "log", - "objc2", - "objc2-app-kit", - "objc2-foundation", - "objc2-quartz-core", - "raw-window-handle 0.6.2", - "redox_syscall", - "wasm-bindgen", - "web-sys", - "windows-sys 0.52.0", -] - -[[package]] -name = "soup3" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "471f924a40f31251afc77450e781cb26d55c0b650842efafc9c6cbd2f7cc4f9f" -dependencies = [ - "futures-channel", - "gio", - "glib", - "libc", - "soup3-sys", -] - -[[package]] -name = "soup3-sys" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebe8950a680a12f24f15ebe1bf70db7af98ad242d9db43596ad3108aab86c27" -dependencies = [ - "gio-sys", - "glib-sys", - "gobject-sys", - "libc", - "system-deps", -] - -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - -[[package]] -name = "state" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b8c4a4445d81357df8b1a650d0d0d6fbbbfe99d064aa5e02f3e4022061476d8" -dependencies = [ - "loom", -] - -[[package]] -name = "string_cache" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" -dependencies = [ - "new_debug_unreachable", - "once_cell", - "parking_lot", - "phf_shared 0.10.0", - "precomputed-hash", - "serde", -] - -[[package]] -name = "string_cache_codegen" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bb30289b722be4ff74a408c3cc27edeaad656e06cb1fe8fa9231fa59c728988" -dependencies = [ - "phf_generator 0.10.0", - "phf_shared 0.10.0", - "proc-macro2", - "quote", -] - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "swift-rs" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bbdb58577b6301f8d17ae2561f32002a5bae056d444e0f69e611e504a276204" -dependencies = [ - "base64 0.21.7", - "serde", - "serde_json", -] - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.68" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "sync_wrapper" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" - -[[package]] -name = "system-deps" -version = "6.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349" -dependencies = [ - "cfg-expr", - "heck 0.5.0", - "pkg-config", - "toml 0.8.2", - "version-compare", -] - -[[package]] -name = "tao" -version = "0.28.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea538df05fbc2dcbbd740ba0cfe8607688535f4798d213cbbfa13ce494f3451f" -dependencies = [ - "bitflags 2.6.0", - "cocoa", - "core-foundation", - "core-graphics", - "crossbeam-channel", - "dispatch", - "dlopen2", - "dpi", - "gdkwayland-sys", - "gdkx11-sys", - "gtk", - "instant", - "jni", - "lazy_static", - "libc", - "log", - "ndk", - "ndk-context", - "ndk-sys", - "objc", - "once_cell", - "parking_lot", - "raw-window-handle 0.6.2", - "scopeguard", - "tao-macros", - "unicode-segmentation", - "url", - "windows 0.57.0", - "windows-core 0.57.0", - "windows-version", - "x11-dl", -] - -[[package]] -name = "tao-macros" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec114582505d158b669b136e6851f85840c109819d77c42bb7c0709f727d18c2" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "target-lexicon" -version = "0.12.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" - -[[package]] -name = "tauri" -version = "2.0.0-beta.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68725c4f17f62f0fb1fa2eecaf391200bf00a9414c84f30783ddca10570690c3" -dependencies = [ - "anyhow", - "bytes", - "cocoa", - "dirs", - "dunce", - "embed_plist", - "futures-util", - "getrandom 0.2.15", - "glob", - "gtk", - "heck 0.5.0", - "http", - "jni", - "libc", - "log", - "mime", - "muda", - "objc", - "percent-encoding", - "raw-window-handle 0.6.2", - "reqwest", - "serde", - "serde_json", - "serde_repr", - "serialize-to-javascript", - "state", - "swift-rs", - "tauri-build", - "tauri-macros", - "tauri-runtime", - "tauri-runtime-wry", - "tauri-utils", - "thiserror", - "tokio", - "tray-icon", - "url", - "urlpattern", - "webkit2gtk", - "webview2-com", - "window-vibrancy", - "windows 0.57.0", -] - -[[package]] -name = "tauri-build" -version = "2.0.0-beta.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1822847744f663babbfc8b7532a104734e9cf99e3408bba7109018bf9177917" -dependencies = [ - "anyhow", - "cargo_toml", - "dirs", - "glob", - "heck 0.5.0", - "json-patch", - "schemars", - "semver", - "serde", - "serde_json", - "tauri-utils", - "tauri-winres", - "toml 0.8.2", - "walkdir", -] - -[[package]] -name = "tauri-codegen" -version = "2.0.0-beta.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e36fa3c2e3bd935827fef1eed459885414fb27c82f687d8b9a15112c8a5c8f0" -dependencies = [ - "base64 0.22.1", - "brotli", - "ico", - "json-patch", - "plist", - "png", - "proc-macro2", - "quote", - "semver", - "serde", - "serde_json", - "sha2", - "syn 2.0.68", - "tauri-utils", - "thiserror", - "time", - "url", - "uuid", - "walkdir", -] - -[[package]] -name = "tauri-macros" -version = "2.0.0-beta.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34aba4bed4648c3cb17d421af5783c7c29a033a94ab8597ef3791dadea69289d" -dependencies = [ - "heck 0.5.0", - "proc-macro2", - "quote", - "syn 2.0.68", - "tauri-codegen", - "tauri-utils", -] - -[[package]] -name = "tauri-plugin" -version = "2.0.0-beta.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "431ac9636bf81e7a04042399918ffa6b9d2413926dabc9366a24f6b487f64653" -dependencies = [ - "anyhow", - "glob", - "plist", - "schemars", - "serde", - "serde_json", - "tauri-utils", - "toml 0.8.2", - "walkdir", -] - -[[package]] -name = "tauri-plugin-shell" -version = "2.0.0-beta.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85f0347c4d056cca543b5f2dd74c33b64182553e03d1dba2738fe2a95f0ec9ef" -dependencies = [ - "encoding_rs", - "log", - "open", - "os_pipe", - "regex", - "schemars", - "serde", - "serde_json", - "shared_child", - "tauri", - "tauri-plugin", - "thiserror", - "tokio", -] - -[[package]] -name = "tauri-runtime" -version = "2.0.0-beta.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5fa872242a432195b814e87f91ce10f293ae5b01fbd1eb139455496260aa7c9" -dependencies = [ - "dpi", - "gtk", - "http", - "jni", - "raw-window-handle 0.6.2", - "serde", - "serde_json", - "tauri-utils", - "thiserror", - "url", - "windows 0.57.0", -] - -[[package]] -name = "tauri-runtime-wry" -version = "2.0.0-beta.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ad6d5ef3c05d1c4b6cf97b9eac1ca1ad8ff2a7057ad0a92b3e4c476f009341e" -dependencies = [ - "cocoa", - "gtk", - "http", - "jni", - "log", - "percent-encoding", - "raw-window-handle 0.6.2", - "softbuffer", - "tao", - "tauri-runtime", - "tauri-utils", - "url", - "webkit2gtk", - "webview2-com", - "windows 0.57.0", - "wry", -] - -[[package]] -name = "tauri-utils" -version = "2.0.0-beta.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f81a672883c9a67eb24727c99cce583625c919a5fb696c661603b426c463c72" -dependencies = [ - "brotli", - "cargo_metadata", - "ctor", - "dunce", - "glob", - "html5ever", - "infer", - "json-patch", - "kuchikiki", - "log", - "memchr", - "phf 0.11.2", - "proc-macro2", - "quote", - "regex", - "schemars", - "semver", - "serde", - "serde-untagged", - "serde_json", - "serde_with", - "swift-rs", - "thiserror", - "toml 0.8.2", - "url", - "urlpattern", - "walkdir", -] - -[[package]] -name = "tauri-winres" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5993dc129e544393574288923d1ec447c857f3f644187f4fbf7d9a875fbfc4fb" -dependencies = [ - "embed-resource", - "toml 0.7.8", -] - -[[package]] -name = "tendril" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d24a120c5fc464a3458240ee02c299ebcb9d67b5249c8848b09d639dca8d7bb0" -dependencies = [ - "futf", - "mac", - "utf-8", -] - -[[package]] -name = "thin-slice" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c" - -[[package]] -name = "thiserror" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.68", -] - -[[package]] -name = "thread_local" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" -dependencies = [ - "cfg-if", - "once_cell", -] - -[[package]] -name = "time" -version = "0.3.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" -dependencies = [ - "deranged", - "itoa 1.0.11", - "num-conv", - "powerfmt", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" - -[[package]] -name = "time-macros" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" -dependencies = [ - "num-conv", - "time-core", -] - -[[package]] -name = "tinyvec" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6b6a2fb3a985e99cebfaefa9faa3024743da73304ca1c683a36429613d3d22" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - -[[package]] -name = "tokio" -version = "1.38.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" -dependencies = [ - "backtrace", - "bytes", - "libc", - "mio", - "num_cpus", - "pin-project-lite", - "socket2", - "windows-sys 0.48.0", -] - -[[package]] -name = "tokio-util" -version = "0.7.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - -[[package]] -name = "toml" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" -dependencies = [ - "serde", - "serde_spanned", - "toml_datetime", - "toml_edit 0.19.15", -] - -[[package]] -name = "toml" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d" -dependencies = [ - "serde", - "serde_spanned", - "toml_datetime", - "toml_edit 0.20.2", -] - -[[package]] -name = "toml_datetime" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" -dependencies = [ - "serde", -] - -[[package]] -name = "toml_edit" -version = "0.19.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" -dependencies = [ - "indexmap 2.2.6", - "serde", - "serde_spanned", - "toml_datetime", - "winnow", -] - -[[package]] -name = "toml_edit" -version = "0.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" -dependencies = [ - "indexmap 2.2.6", - "serde", - "serde_spanned", - "toml_datetime", - "winnow", -] - -[[package]] -name = "tower" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" -dependencies = [ - "futures-core", - "futures-util", - "pin-project", - "pin-project-lite", - "tokio", - "tower-layer", - "tower-service", -] - -[[package]] -name = "tower-layer" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" - -[[package]] -name = "tower-service" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.68", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", - "valuable", -] - -[[package]] -name = "tracing-log" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" -dependencies = [ - "log", - "once_cell", - "tracing-core", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" -dependencies = [ - "matchers", - "nu-ansi-term", - "once_cell", - "regex", - "sharded-slab", - "smallvec", - "thread_local", - "tracing", - "tracing-core", - "tracing-log", -] - -[[package]] -name = "tray-icon" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ad8319cca93189ea9ab1b290de0595960529750b6b8b501a399ed1ec3775d60" -dependencies = [ - "cocoa", - "core-graphics", - "crossbeam-channel", - "dirs", - "libappindicator", - "muda", - "objc", - "once_cell", - "png", - "serde", - "thiserror", - "windows-sys 0.52.0", -] - -[[package]] -name = "try-lock" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" - -[[package]] -name = "typeid" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "059d83cc991e7a42fc37bd50941885db0888e34209f8cfd9aab07ddec03bc9cf" - -[[package]] -name = "typenum" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" - -[[package]] -name = "unic-char-property" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8c57a407d9b6fa02b4795eb81c5b6652060a15a7903ea981f3d723e6c0be221" -dependencies = [ - "unic-char-range", -] - -[[package]] -name = "unic-char-range" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0398022d5f700414f6b899e10b8348231abf9173fa93144cbc1a43b9793c1fbc" - -[[package]] -name = "unic-common" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d7ff825a6a654ee85a63e80f92f054f904f21e7d12da4e22f9834a4aaa35bc" - -[[package]] -name = "unic-ucd-ident" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e230a37c0381caa9219d67cf063aa3a375ffed5bf541a452db16e744bdab6987" -dependencies = [ - "unic-char-property", - "unic-char-range", - "unic-ucd-version", -] - -[[package]] -name = "unic-ucd-version" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96bd2f2237fe450fcd0a1d2f5f4e91711124f7857ba2e964247776ebeeb7b0c4" -dependencies = [ - "unic-common", -] - -[[package]] -name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-normalization" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "unstoppableswap-gui-rs" -version = "0.0.0" -dependencies = [ - "serde", - "serde_json", - "tauri", - "tauri-build", - "tauri-plugin-shell", -] - -[[package]] -name = "url" -version = "2.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", - "serde", -] - -[[package]] -name = "urlpattern" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9bd5ff03aea02fa45b13a7980151fe45009af1980ba69f651ec367121a31609" -dependencies = [ - "derive_more", - "regex", - "serde", - "unic-ucd-ident", - "url", -] - -[[package]] -name = "utf-8" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" - -[[package]] -name = "uuid" -version = "1.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de17fd2f7da591098415cff336e12965a28061ddace43b59cb3c430179c9439" -dependencies = [ - "getrandom 0.2.15", -] - -[[package]] -name = "valuable" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" - -[[package]] -name = "version-compare" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852e951cb7832cb45cb1169900d19760cfa39b82bc0ea9c0e5a14ae88411c98b" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "vswhom" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be979b7f07507105799e854203b470ff7c78a1639e330a58f183b5fea574608b" -dependencies = [ - "libc", - "vswhom-sys", -] - -[[package]] -name = "vswhom-sys" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3b17ae1f6c8a2b28506cd96d412eebf83b4a0ff2cbefeeb952f2f9dfa44ba18" -dependencies = [ - "cc", - "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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" -dependencies = [ - "try-lock", -] - -[[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "wasm-bindgen" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn 2.0.68", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" -dependencies = [ - "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.68", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" - -[[package]] -name = "wasm-streams" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b65dc4c90b63b118468cf747d8bf3566c1913ef60be765b5730ead9e0a3ba129" -dependencies = [ - "futures-util", - "js-sys", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - -[[package]] -name = "web-sys" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "webkit2gtk" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76b1bc1e54c581da1e9f179d0b38512ba358fb1af2d634a1affe42e37172361a" -dependencies = [ - "bitflags 1.3.2", - "cairo-rs", - "gdk", - "gdk-sys", - "gio", - "gio-sys", - "glib", - "glib-sys", - "gobject-sys", - "gtk", - "gtk-sys", - "javascriptcore-rs", - "libc", - "once_cell", - "soup3", - "webkit2gtk-sys", -] - -[[package]] -name = "webkit2gtk-sys" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62daa38afc514d1f8f12b8693d30d5993ff77ced33ce30cd04deebc267a6d57c" -dependencies = [ - "bitflags 1.3.2", - "cairo-sys-rs", - "gdk-sys", - "gio-sys", - "glib-sys", - "gobject-sys", - "gtk-sys", - "javascriptcore-rs-sys", - "libc", - "pkg-config", - "soup3-sys", - "system-deps", -] - -[[package]] -name = "webview2-com" -version = "0.31.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6516cfa64c6b3212686080eeec378e662c2af54bb2a5b2a22749673f5cb2226f" -dependencies = [ - "webview2-com-macros", - "webview2-com-sys", - "windows 0.57.0", - "windows-core 0.57.0", - "windows-implement", - "windows-interface", -] - -[[package]] -name = "webview2-com-macros" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1345798ecd8122468840bcdf1b95e5dc6d2206c5e4b0eafa078d061f59c9bc" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.68", -] - -[[package]] -name = "webview2-com-sys" -version = "0.31.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c76d5b77320ff155660be1df3e6588bc85c75f1a9feef938cc4dc4dd60d1d7cf" -dependencies = [ - "thiserror", - "windows 0.57.0", - "windows-core 0.57.0", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "window-vibrancy" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33082acd404763b315866e14a0d5193f3422c81086657583937a750cdd3ec340" -dependencies = [ - "cocoa", - "objc", - "raw-window-handle 0.6.2", - "windows-sys 0.52.0", - "windows-version", -] - -[[package]] -name = "windows" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows" -version = "0.57.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12342cb4d8e3b046f3d80effd474a7a02447231330ef77d71daa6fbc40681143" -dependencies = [ - "windows-core 0.57.0", - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-core" -version = "0.57.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2ed2439a290666cd67ecce2b0ffaad89c2a56b976b736e6ece670297897832d" -dependencies = [ - "windows-implement", - "windows-interface", - "windows-result", - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-implement" -version = "0.57.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.68", -] - -[[package]] -name = "windows-interface" -version = "0.57.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.68", -] - -[[package]] -name = "windows-result" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", -] - -[[package]] -name = "windows-version" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6998aa457c9ba8ff2fb9f13e9d2a930dabcea28f1d0ab94d687d8b3654844515" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" - -[[package]] -name = "winnow" -version = "0.5.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" -dependencies = [ - "memchr", -] - -[[package]] -name = "winreg" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - -[[package]] -name = "wry" -version = "0.41.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b00c945786b02d7805d09a969fa36d0eee4e0bd4fb3ec2a79d2bf45a1b44cd" -dependencies = [ - "base64 0.22.1", - "block", - "cocoa", - "core-graphics", - "crossbeam-channel", - "dpi", - "dunce", - "gdkx11", - "gtk", - "html5ever", - "http", - "javascriptcore-rs", - "jni", - "kuchikiki", - "libc", - "ndk", - "ndk-context", - "ndk-sys", - "objc", - "objc_id", - "once_cell", - "percent-encoding", - "raw-window-handle 0.6.2", - "sha2", - "soup3", - "tao-macros", - "thiserror", - "webkit2gtk", - "webkit2gtk-sys", - "webview2-com", - "windows 0.57.0", - "windows-core 0.57.0", - "windows-version", - "x11-dl", -] - -[[package]] -name = "x11" -version = "2.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "502da5464ccd04011667b11c435cb992822c2c0dbde1770c988480d312a0db2e" -dependencies = [ - "libc", - "pkg-config", -] - -[[package]] -name = "x11-dl" -version = "2.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38735924fedd5314a6e548792904ed8c6de6636285cb9fec04d5b1db85c1516f" -dependencies = [ - "libc", - "once_cell", - "pkg-config", -] From 88614a7f3566aad6b379cc7ff22d4726077701e5 Mon Sep 17 00:00:00 2001 From: Binarybaron Date: Sat, 9 Nov 2024 15:25:43 +0100 Subject: [PATCH 103/112] refactor: Fix clippy errors --- swap/src/asb/event_loop.rs | 10 +++++++--- swap/src/asb/network.rs | 2 +- swap/src/cli/event_loop.rs | 2 +- swap/src/common/tracing_util.rs | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/swap/src/asb/event_loop.rs b/swap/src/asb/event_loop.rs index cf7e6d560..b3137ea39 100644 --- a/swap/src/asb/event_loop.rs +++ b/swap/src/asb/event_loop.rs @@ -69,11 +69,13 @@ where /// 1. EventLoopHandle sends (PeerId, Request, Responder) through sender /// 2. Event loop receives and attempts to send to peer /// 3. Result (Ok or network failure) is sent back to EventLoopHandle + #[allow(clippy::type_complexity)] outgoing_transfer_proofs_receiver: tokio::sync::mpsc::UnboundedReceiver<( PeerId, transfer_proof::Request, oneshot::Sender>, )>, + #[allow(clippy::type_complexity)] outgoing_transfer_proofs_sender: tokio::sync::mpsc::UnboundedSender<( PeerId, transfer_proof::Request, @@ -86,6 +88,7 @@ where /// 1. It is moved from [`outgoing_transfer_proofs_receiver`] to this buffer /// 2. Once a connection is established with the peer, the proof is send back into the [`outgoing_transfer_proofs_sender`] /// 3. The buffered request is then removed from this collection + #[allow(clippy::type_complexity)] buffered_transfer_proofs: HashMap< PeerId, Vec<( @@ -644,6 +647,7 @@ pub struct EventLoopHandle { swap_id: Uuid, peer: PeerId, recv_encrypted_signature: Option>, + #[allow(clippy::type_complexity)] transfer_proof_sender: Option< tokio::sync::mpsc::UnboundedSender<( PeerId, @@ -708,7 +712,7 @@ impl EventLoopHandle { let transfer_proof = self.build_transfer_proof_request(msg); - let result = backoff::future::retry(backoff, || async { + backoff::future::retry(backoff, || async { // Create a oneshot channel to receive the acknowledgment of the transfer proof let (singular_sender, singular_receiver) = oneshot::channel(); @@ -725,7 +729,7 @@ impl EventLoopHandle { Err(backoff::Error::transient(anyhow!(err))) } Err(_) => { - unreachable!("The sender channel should never be closed without sending a response"); + Err(backoff::Error::permanent(anyhow!("The sender channel should never be closed without sending a response"))) } } }) @@ -733,7 +737,7 @@ impl EventLoopHandle { self.transfer_proof_sender.take(); - Ok(result) + Ok(()) } } diff --git a/swap/src/asb/network.rs b/swap/src/asb/network.rs index 6f0ece53e..a2a0df51c 100644 --- a/swap/src/asb/network.rs +++ b/swap/src/asb/network.rs @@ -417,7 +417,7 @@ pub mod rendezvous { .iter() .find(|node| node.peer_id == peer_id) .map(|node| node.address.clone()) - .unwrap()]) + .expect("We should have a rendezvous node for the peer id")]) .condition(PeerCondition::Disconnected) // TODO: this makes the behaviour call `NetworkBehaviour::handle_pending_outbound_connection` // but we don't implement it diff --git a/swap/src/cli/event_loop.rs b/swap/src/cli/event_loop.rs index fa113a0d8..d6c801f7b 100644 --- a/swap/src/cli/event_loop.rs +++ b/swap/src/cli/event_loop.rs @@ -318,7 +318,7 @@ impl EventLoop { }, Some(response_channel) = &mut self.pending_transfer_proof => { - if let Err(_) = self.swarm.behaviour_mut().transfer_proof.send_response(response_channel, ()) { + if self.swarm.behaviour_mut().transfer_proof.send_response(response_channel, ()).is_err() { tracing::warn!("Failed to send acknowledgment to Alice that we have received the transfer proof"); } else { self.pending_transfer_proof = OptionFuture::from(None); diff --git a/swap/src/common/tracing_util.rs b/swap/src/common/tracing_util.rs index 1cdde3dac..42e0ec623 100644 --- a/swap/src/common/tracing_util.rs +++ b/swap/src/common/tracing_util.rs @@ -85,7 +85,7 @@ fn env_filter(level_filter: LevelFilter) -> Result { .add_directive(Directive::from_str(&format!("asb={}", &level_filter))?) .add_directive(Directive::from_str(&format!("swap={}", &level_filter))?) // TODO(libp2p upgrade): Disable this again once we merge https://github.com/UnstoppableSwap/core/pull/109 - .add_directive(Directive::from_str(&"libp2p=debug".to_string())?) + .add_directive(Directive::from_str("libp2p=debug")?) .add_directive(Directive::from_str(&format!( "unstoppableswap-gui-rs={}", &level_filter From aa8c1a93e27738927e6d6478933fe179d2ff7776 Mon Sep 17 00:00:00 2001 From: Binarybaron Date: Sat, 9 Nov 2024 19:59:39 +0100 Subject: [PATCH 104/112] fix(clippy): Remove redundant .into() --- swap/src/cli.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swap/src/cli.rs b/swap/src/cli.rs index ce7f5e401..3ea3a9471 100644 --- a/swap/src/cli.rs +++ b/swap/src/cli.rs @@ -117,7 +117,7 @@ mod tests { }); Seller { - multiaddr: asb_address.with(Protocol::P2p(asb_peer_id.into())), + multiaddr: asb_address.with(Protocol::P2p(asb_peer_id)), status: Status::Online(static_quote), } } From aec6bacadbd4613c1437342627651f1f6650965d Mon Sep 17 00:00:00 2001 From: Binarybaron Date: Sat, 9 Nov 2024 20:02:27 +0100 Subject: [PATCH 105/112] feat(asb): Warn instead of bail, if we cannot listen on a particular network interface The reason for this is to ensure the asb does not crash if the websocket listen address is still present in the config file. Support for it has been removed. --- swap/src/bin/asb.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/swap/src/bin/asb.rs b/swap/src/bin/asb.rs index 6cb64b5e7..2ef273fbf 100644 --- a/swap/src/bin/asb.rs +++ b/swap/src/bin/asb.rs @@ -185,8 +185,9 @@ pub async fn main() -> Result<()> { )?; for listen in config.network.listen.clone() { - Swarm::listen_on(&mut swarm, listen.clone()) - .with_context(|| format!("Failed to listen on network interface {}", listen))?; + if let Err(e) = Swarm::listen_on(&mut swarm, listen.clone()) { + tracing::warn!("Failed to listen on network interface {}: {}. Consider removing it from the config.", listen, e); + } } tracing::info!(peer_id = %swarm.local_peer_id(), "Network layer initialized"); From 0163eab5b0d1b307d2d399a3878c53876d6b5ca7 Mon Sep 17 00:00:00 2001 From: Binarybaron Date: Sun, 10 Nov 2024 22:12:57 +0100 Subject: [PATCH 106/112] feat(cli, libp2p): Retry outgoing requests - Remove connection guards and channel timeout from request handling, dial directly - Implement retries for quote, swap setup and cooperative redeem requests. Max 60s timeout. Max interval 5s - Make NewSwap derive Clone to support retrying requests --- swap/src/asb/event_loop.rs | 10 +- swap/src/cli/event_loop.rs | 162 ++++++++++++++++++++--------- swap/src/network/swap_setup/bob.rs | 2 +- 3 files changed, 117 insertions(+), 57 deletions(-) diff --git a/swap/src/asb/event_loop.rs b/swap/src/asb/event_loop.rs index b3137ea39..117d68eec 100644 --- a/swap/src/asb/event_loop.rs +++ b/swap/src/asb/event_loop.rs @@ -70,7 +70,7 @@ where /// 2. Event loop receives and attempts to send to peer /// 3. Result (Ok or network failure) is sent back to EventLoopHandle #[allow(clippy::type_complexity)] - outgoing_transfer_proofs_receiver: tokio::sync::mpsc::UnboundedReceiver<( + outgoing_transfer_proofs_requests: tokio::sync::mpsc::UnboundedReceiver<( PeerId, transfer_proof::Request, oneshot::Sender>, @@ -85,7 +85,7 @@ where /// Temporarily stores transfer proof requests for peers that are currently disconnected. /// /// When a transfer proof cannot be sent because there's no connection to the peer: - /// 1. It is moved from [`outgoing_transfer_proofs_receiver`] to this buffer + /// 1. It is moved from [`outgoing_transfer_proofs_requests`] to this buffer /// 2. Once a connection is established with the peer, the proof is send back into the [`outgoing_transfer_proofs_sender`] /// 3. The buffered request is then removed from this collection #[allow(clippy::type_complexity)] @@ -125,7 +125,7 @@ where external_redeem_address: Option, ) -> Result<(Self, mpsc::Receiver)> { let swap_channel = MpscChannels::default(); - let (outgoing_transfer_proofs_sender, outgoing_transfer_proofs_receiver) = + let (outgoing_transfer_proofs_sender, outgoing_transfer_proofs_requests) = tokio::sync::mpsc::unbounded_channel(); let event_loop = EventLoop { @@ -141,7 +141,7 @@ where external_redeem_address, recv_encrypted_signature: Default::default(), inflight_encrypted_signatures: Default::default(), - outgoing_transfer_proofs_receiver, + outgoing_transfer_proofs_requests, outgoing_transfer_proofs_sender, buffered_transfer_proofs: Default::default(), inflight_transfer_proofs: Default::default(), @@ -438,7 +438,7 @@ where _ => {} } }, - Some((peer, transfer_proof, responder)) = self.outgoing_transfer_proofs_receiver.recv() => { + Some((peer, transfer_proof, responder)) = self.outgoing_transfer_proofs_requests.recv() => { // If we are not connected to the peer, we buffer the transfer proof if !self.swarm.behaviour_mut().transfer_proof.is_connected(&peer) { tracing::warn!(%peer, "No active connection to peer, buffering transfer proof"); diff --git a/swap/src/cli/event_loop.rs b/swap/src/cli/event_loop.rs index d6c801f7b..313129781 100644 --- a/swap/src/cli/event_loop.rs +++ b/swap/src/cli/event_loop.rs @@ -8,7 +8,7 @@ use crate::network::swap_setup::bob::NewSwap; use crate::protocol::bob::swap::has_already_processed_transfer_proof; use crate::protocol::bob::{BobState, State2}; use crate::protocol::Database; -use anyhow::{Context, Result}; +use anyhow::{anyhow, Context, Result}; use futures::future::{BoxFuture, OptionFuture}; use futures::{FutureExt, StreamExt}; use libp2p::request_response::{OutboundFailure, OutboundRequestId, ResponseChannel}; @@ -34,9 +34,9 @@ pub struct EventLoop { (), Result, >, - encrypted_signatures: + encrypted_signatures_requests: bmrng::RequestReceiverStream>, - swap_setup_requests: bmrng::RequestReceiverStream>, + execution_setup_requests: bmrng::RequestReceiverStream>, // These represents requests that are currently in-flight. // Meaning that we have sent them to Alice, but we have not yet received a response. @@ -73,9 +73,10 @@ impl EventLoop { alice_peer_id: PeerId, db: Arc, ) -> Result<(Self, EventLoopHandle)> { - // We still use a timeout here, as it is unclear how the the swap_setup protocol enforces timeouts + // We still use a timeout here, because this protocol does not dial Alice itself + // and we want to fail if we cannot reach Alice let (execution_setup_sender, execution_setup_receiver) = - bmrng::channel_with_timeout(1, Duration::from_secs(60)); + bmrng::channel_with_timeout(1, Duration::from_secs(120)); // It is okay to not have a timeout here, as timeouts are enforced by the request-response protocol let (transfer_proof_sender, transfer_proof_receiver) = bmrng::channel(1); @@ -87,9 +88,9 @@ impl EventLoop { swap_id, swarm, alice_peer_id, - swap_setup_requests: execution_setup_receiver.into(), + execution_setup_requests: execution_setup_receiver.into(), transfer_proof_sender, - encrypted_signatures: encrypted_signature_receiver.into(), + encrypted_signatures_requests: encrypted_signature_receiver.into(), cooperative_xmr_redeem_requests: cooperative_xmr_redeem_receiver.into(), quote_requests: quote_receiver.into(), inflight_quote_requests: HashMap::default(), @@ -297,17 +298,12 @@ impl EventLoop { } }, - // Handle to-be-sent requests for all our network protocols. - // Use `self.is_connected_to_alice` as a guard to "buffer" requests until we are connected. - Some(((), responder)) = self.quote_requests.next().fuse(), if self.is_connected_to_alice() => { + // Handle to-be-sent outgoing requests for all our network protocols. + Some(((), responder)) = self.quote_requests.next().fuse() => { let id = self.swarm.behaviour_mut().quote.send_request(&self.alice_peer_id, ()); self.inflight_quote_requests.insert(id, responder); }, - Some((swap, responder)) = self.swap_setup_requests.next().fuse(), if self.is_connected_to_alice() => { - self.swarm.behaviour_mut().swap_setup.start(self.alice_peer_id, swap).await; - self.inflight_swap_setup = Some(responder); - }, - Some((tx_redeem_encsig, responder)) = self.encrypted_signatures.next().fuse(), if self.is_connected_to_alice() => { + Some((tx_redeem_encsig, responder)) = self.encrypted_signatures_requests.next().fuse() => { let request = encrypted_signature::Request { swap_id: self.swap_id, tx_redeem_encsig @@ -316,21 +312,33 @@ impl EventLoop { let id = self.swarm.behaviour_mut().encrypted_signature.send_request(&self.alice_peer_id, request); self.inflight_encrypted_signature_requests.insert(id, responder); }, + Some((_, responder)) = self.cooperative_xmr_redeem_requests.next().fuse() => { + let id = self.swarm.behaviour_mut().cooperative_xmr_redeem.send_request(&self.alice_peer_id, Request { + swap_id: self.swap_id + }); + self.inflight_cooperative_xmr_redeem_requests.insert(id, responder); + }, + + // We use `self.is_connected_to_alice` as a guard to "buffer" requests until we are connected. + // because I don't think the protocol forces a dial to Alice. + // (unlike request-response above) + Some((swap, responder)) = self.execution_setup_requests.next().fuse(), if self.is_connected_to_alice() => { + self.swarm.behaviour_mut().swap_setup.start(self.alice_peer_id, swap).await; + self.inflight_swap_setup = Some(responder); + }, - Some(response_channel) = &mut self.pending_transfer_proof => { + // Send an acknowledgement to Alice once the EventLoopHandle has processed a received transfer proof + // We use `self.is_connected_to_alice` as a guard to "buffer" requests until we are connected. + // + // Why do we do this here but not for the other request-response channels? + // This is the only request, we don't have a retry mechanism for. We lazily send this. + Some(response_channel) = &mut self.pending_transfer_proof, if self.is_connected_to_alice() => { if self.swarm.behaviour_mut().transfer_proof.send_response(response_channel, ()).is_err() { tracing::warn!("Failed to send acknowledgment to Alice that we have received the transfer proof"); } else { self.pending_transfer_proof = OptionFuture::from(None); } }, - - Some((_, responder)) = self.cooperative_xmr_redeem_requests.next().fuse(), if self.is_connected_to_alice() => { - let id = self.swarm.behaviour_mut().cooperative_xmr_redeem.send_request(&self.alice_peer_id, Request { - swap_id: self.swap_id - }); - self.inflight_cooperative_xmr_redeem_requests.insert(id, responder); - }, } } } @@ -378,8 +386,39 @@ pub struct EventLoopHandle { } impl EventLoopHandle { + fn create_retry_config(max_elapsed_time: Duration) -> backoff::ExponentialBackoff { + backoff::ExponentialBackoffBuilder::new() + .with_max_elapsed_time(max_elapsed_time.into()) + .with_max_interval(Duration::from_secs(5)) + .build() + } + pub async fn setup_swap(&mut self, swap: NewSwap) -> Result { - self.execution_setup_sender.send_receive(swap).await? + tracing::debug!(swap = ?swap, "Sending swap setup request"); + + let backoff = Self::create_retry_config(Duration::from_secs(60)); + + backoff::future::retry(backoff, || async { + match self.execution_setup_sender.send_receive(swap.clone()).await { + Ok(Ok(state2)) => Ok(state2), + // These are errors thrown by the swap_setup/bob behaviour + Ok(Err(err)) => { + tracing::warn!(%err, "Failed to setup swap. Will retry"); + Err(backoff::Error::transient(err)) + } + // This will happen if we don't establish a connection to Alice within the timeout of the MPSC channel + // The protocol does not dial Alice it self + // This is handled by redial behaviour + Err(bmrng::error::RequestError::RecvTimeoutError) => { + Err(backoff::Error::permanent(anyhow!("We failed to setup the swap in the allotted time by the event loop channel"))) + } + Err(_) => { + unreachable!("We never drop the receiver of the execution setup channel, so this should never happen") + } + } + }) + .await + .context("Failed to setup swap after retries") } pub async fn recv_transfer_proof(&mut self) -> Result { @@ -398,25 +437,52 @@ impl EventLoopHandle { pub async fn request_quote(&mut self) -> Result { tracing::debug!("Requesting quote"); - self.quote_sender - .send_receive(()) - .await - .context("Failed to receive quote through event loop channel")? - .context("Failed to request quote due to a network error") + + let backoff = Self::create_retry_config(Duration::from_secs(60)); + + backoff::future::retry(backoff, || async { + match self.quote_sender.send_receive(()).await { + Ok(Ok(quote)) => Ok(quote), + Ok(Err(err)) => { + tracing::warn!(%err, "Failed to request quote due to network error. Will retry"); + Err(backoff::Error::transient(err)) + } + Err(_) => { + unreachable!("We initiate the quote channel without a timeout and store both the sender and receiver in the same struct, so this should never happen"); + } + } + }) + .await + .context("Failed to request quote after retries") } pub async fn request_cooperative_xmr_redeem(&mut self) -> Result { - self.cooperative_xmr_redeem_sender - .send_receive(()) - .await - .context("Failed to request cooperative XMR redeem through event loop channel")? - .context("Failed to request cooperative XMR redeem due to a network error") + tracing::debug!("Requesting cooperative XMR redeem"); + + let backoff = Self::create_retry_config(Duration::from_secs(60)); + + backoff::future::retry(backoff, || async { + match self.cooperative_xmr_redeem_sender.send_receive(()).await { + Ok(Ok(response)) => Ok(response), + Ok(Err(err)) => { + tracing::warn!(%err, "Failed to request cooperative XMR redeem due to network error. Will retry"); + Err(backoff::Error::transient(err)) + } + Err(_) => { + unreachable!("We initiate the cooperative xmr redeem channel without a timeout and store both the sender and receiver in the same struct, so this should never happen"); + } + } + }) + .await + .context("Failed to request cooperative XMR redeem after retries") } pub async fn send_encrypted_signature( &mut self, tx_redeem_encsig: EncryptedSignature, ) -> Result<()> { + tracing::debug!("Sending encrypted signature"); + // We will retry indefinitely until we succeed let backoff = backoff::ExponentialBackoffBuilder::new() .with_max_elapsed_time(None) @@ -425,23 +491,17 @@ impl EventLoopHandle { backoff::future::retry(backoff, || async { match self.encrypted_signature_sender.send_receive(tx_redeem_encsig.clone()).await { - Ok(Ok(_)) => Ok(()), - Ok(Err(err)) => { - tracing::warn!(%err, "Failed to send encrypted signature due to a network error. Will retry"); - Err(backoff::Error::transient(anyhow::anyhow!(err))) - } - Err(bmrng::error::RequestError::RecvTimeoutError) => { - unreachable!("We construct the channel without a timeout, so this should never happen") - } - Err(err) => { - // The MSCP channel has failed. We do not retry this because this error means that either the channel was closed or the receiver has been dropped. - // Both of these cases are permanent and we should not retry. - // TODO(Libp2p Migration): Is this correct? - tracing::error!(%err, "Failed to communicate transfer proof through event loop channel. We will not retry."); - Err(backoff::Error::permanent(anyhow::anyhow!(err).context("Failed to communicate transfer proof through event loop channel"))) - } + Ok(Ok(_)) => Ok(()), + Ok(Err(err)) => { + tracing::warn!(%err, "Failed to send encrypted signature due to a network error. Will retry"); + Err(backoff::Error::transient(err)) } - }) - .await + Err(_) => { + unreachable!("We initiate the encrypted signature channel without a timeout and store both the sender and receiver in the same struct, so this should never happen"); + } + } + }) + .await + .context("Failed to send encrypted signature after retries") } } diff --git a/swap/src/network/swap_setup/bob.rs b/swap/src/network/swap_setup/bob.rs index a097bce4b..7128d0592 100644 --- a/swap/src/network/swap_setup/bob.rs +++ b/swap/src/network/swap_setup/bob.rs @@ -132,7 +132,7 @@ impl Handler { } } -#[derive(Debug)] +#[derive(Debug, Clone)] pub struct NewSwap { pub swap_id: Uuid, pub btc: bitcoin::Amount, From 601f375e1cfa07e31b47f3aadc531bea130e0b3b Mon Sep 17 00:00:00 2001 From: Binarybaron Date: Sun, 10 Nov 2024 23:08:49 +0100 Subject: [PATCH 107/112] refactor(cli/event_loop.rs): Move timeouts into static --- swap/src/cli/event_loop.rs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/swap/src/cli/event_loop.rs b/swap/src/cli/event_loop.rs index 313129781..9fb207e6b 100644 --- a/swap/src/cli/event_loop.rs +++ b/swap/src/cli/event_loop.rs @@ -20,6 +20,9 @@ use std::sync::Arc; use std::time::Duration; use uuid::Uuid; +static REQUEST_RESPONSE_PROTOCOL_TIMEOUT: Duration = Duration::from_secs(60); +static EXECUTION_SETUP_PROTOCOL_TIMEOUT: Duration = Duration::from_secs(120); + #[allow(missing_debug_implementations)] pub struct EventLoop { swap_id: Uuid, @@ -76,7 +79,7 @@ impl EventLoop { // We still use a timeout here, because this protocol does not dial Alice itself // and we want to fail if we cannot reach Alice let (execution_setup_sender, execution_setup_receiver) = - bmrng::channel_with_timeout(1, Duration::from_secs(120)); + bmrng::channel_with_timeout(1, EXECUTION_SETUP_PROTOCOL_TIMEOUT); // It is okay to not have a timeout here, as timeouts are enforced by the request-response protocol let (transfer_proof_sender, transfer_proof_receiver) = bmrng::channel(1); @@ -320,7 +323,7 @@ impl EventLoop { }, // We use `self.is_connected_to_alice` as a guard to "buffer" requests until we are connected. - // because I don't think the protocol forces a dial to Alice. + // because the protocol does not dial Alice itself // (unlike request-response above) Some((swap, responder)) = self.execution_setup_requests.next().fuse(), if self.is_connected_to_alice() => { self.swarm.behaviour_mut().swap_setup.start(self.alice_peer_id, swap).await; @@ -396,7 +399,7 @@ impl EventLoopHandle { pub async fn setup_swap(&mut self, swap: NewSwap) -> Result { tracing::debug!(swap = ?swap, "Sending swap setup request"); - let backoff = Self::create_retry_config(Duration::from_secs(60)); + let backoff = Self::create_retry_config(EXECUTION_SETUP_PROTOCOL_TIMEOUT); backoff::future::retry(backoff, || async { match self.execution_setup_sender.send_receive(swap.clone()).await { @@ -438,7 +441,7 @@ impl EventLoopHandle { pub async fn request_quote(&mut self) -> Result { tracing::debug!("Requesting quote"); - let backoff = Self::create_retry_config(Duration::from_secs(60)); + let backoff = Self::create_retry_config(REQUEST_RESPONSE_PROTOCOL_TIMEOUT); backoff::future::retry(backoff, || async { match self.quote_sender.send_receive(()).await { @@ -459,7 +462,7 @@ impl EventLoopHandle { pub async fn request_cooperative_xmr_redeem(&mut self) -> Result { tracing::debug!("Requesting cooperative XMR redeem"); - let backoff = Self::create_retry_config(Duration::from_secs(60)); + let backoff = Self::create_retry_config(REQUEST_RESPONSE_PROTOCOL_TIMEOUT); backoff::future::retry(backoff, || async { match self.cooperative_xmr_redeem_sender.send_receive(()).await { @@ -486,7 +489,7 @@ impl EventLoopHandle { // We will retry indefinitely until we succeed let backoff = backoff::ExponentialBackoffBuilder::new() .with_max_elapsed_time(None) - .with_max_interval(Duration::from_secs(60)) + .with_max_interval(REQUEST_RESPONSE_PROTOCOL_TIMEOUT) .build(); backoff::future::retry(backoff, || async { From 04cac993f84f591e66b8962a03d9da4d7f783c12 Mon Sep 17 00:00:00 2001 From: Binarybaron Date: Sun, 10 Nov 2024 23:09:31 +0100 Subject: [PATCH 108/112] fix(libp2p): Redial behaviour - Remove redundant code - Only reset backoff interval when we connect --- swap/src/network/redial.rs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/swap/src/network/redial.rs b/swap/src/network/redial.rs index 6fcd65bbb..e5448879a 100644 --- a/swap/src/network/redial.rs +++ b/swap/src/network/redial.rs @@ -64,6 +64,7 @@ impl NetworkBehaviour for Behaviour { ) -> Result, libp2p::swarm::ConnectionDenied> { // We establish an inbound connection to the peer we are interested in. // We stop re-dialling. + // Reset the backoff state to start with the initial interval again once we disconnect again if peer == self.peer { self.backoff.reset(); self.sleep = None; @@ -80,6 +81,7 @@ impl NetworkBehaviour for Behaviour { ) -> Result, libp2p::swarm::ConnectionDenied> { // We establish an outbound connection to the peer we are interested in. // We stop re-dialling. + // Reset the backoff state to start with the initial interval again once we disconnect again if peer == self.peer { self.backoff.reset(); self.sleep = None; @@ -95,7 +97,6 @@ impl NetworkBehaviour for Behaviour { }; if redial && self.sleep.is_none() { - self.backoff.reset(); self.sleep = Some(Box::pin(tokio::time::sleep(self.backoff.initial_interval))); } } @@ -108,15 +109,6 @@ impl NetworkBehaviour for Behaviour { futures::ready!(sleep.poll_unpin(cx)); - let next_dial_in = match self.backoff.next_backoff() { - Some(next_dial_in) => next_dial_in, - None => { - unreachable!("The backoff should never run out of attempts"); - } - }; - - self.sleep = Some(Box::pin(tokio::time::sleep(next_dial_in))); - Poll::Ready(ToSwarm::Dial { opts: DialOpts::peer_id(self.peer) .condition(PeerCondition::Disconnected) From 32b6ee35a34def57e2b7a8820f2b271a470ca206 Mon Sep 17 00:00:00 2001 From: Binarybaron Date: Sun, 10 Nov 2024 23:23:21 +0100 Subject: [PATCH 109/112] fix(swap_setup/alice.rs): Create swap_setup ConnectionHandler even for outbound connections --- swap/src/network/swap_setup/alice.rs | 45 +++++++++++++--------------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/swap/src/network/swap_setup/alice.rs b/swap/src/network/swap_setup/alice.rs index 96467c1cf..c02672b20 100644 --- a/swap/src/network/swap_setup/alice.rs +++ b/swap/src/network/swap_setup/alice.rs @@ -169,6 +169,26 @@ where Ok(handler) } + fn handle_established_outbound_connection( + &mut self, + _connection_id: libp2p::swarm::ConnectionId, + _peer: PeerId, + _addr: &Multiaddr, + _role_override: libp2p::core::Endpoint, + ) -> std::result::Result, libp2p::swarm::ConnectionDenied> { + // A new outbound connection has been established (probably to a rendezvous node because we dont dial Bob) + // We still return a handler, because we dont want to close the connection + let handler = Handler::new( + self.min_buy, + self.max_buy, + self.env_config, + self.latest_rate.clone(), + self.resume_only, + ); + + Ok(handler) + } + fn on_connection_handler_event( &mut self, peer_id: PeerId, @@ -206,31 +226,6 @@ where Poll::Pending } - fn handle_established_outbound_connection( - &mut self, - _connection_id: libp2p::swarm::ConnectionId, - _peer: PeerId, - _addr: &Multiaddr, - _role_override: libp2p::core::Endpoint, - ) -> std::result::Result, libp2p::swarm::ConnectionDenied> { - // TODO: Libp2p ugprade: Is this true? - // This sometimes crashes - // unreachable!("Alice does not support outbound connections") - // return Err(libp2p::swarm::ConnectionDenied::new(anyhow!("Alice does not support outbound connections"))); - - // I dont understand why we need to return a handler here but if we dont then rendezvous doesnt work - - let handler = Handler::new( - self.min_buy, - self.max_buy, - self.env_config, - self.latest_rate.clone(), - self.resume_only, - ); - - Ok(handler) - } - fn on_swarm_event(&mut self, _event: libp2p::swarm::FromSwarm<'_>) { // We do not need to handle any swarm events here } From 005e869f987c14aab3ce7980651314c20ec1fc6b Mon Sep 17 00:00:00 2001 From: Binarybaron Date: Sun, 10 Nov 2024 23:26:55 +0100 Subject: [PATCH 110/112] fix(swap_setup/bob.rs): Do not panic on inbound connection as it is denied by ConnectionHandler anyway --- swap/src/network/swap_setup/bob.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swap/src/network/swap_setup/bob.rs b/swap/src/network/swap_setup/bob.rs index 7128d0592..6099ed2a8 100644 --- a/swap/src/network/swap_setup/bob.rs +++ b/swap/src/network/swap_setup/bob.rs @@ -60,7 +60,7 @@ impl NetworkBehaviour for Behaviour { _local_addr: &Multiaddr, _remote_addr: &Multiaddr, ) -> Result, ConnectionDenied> { - unreachable!("Bob does not support inbound connections") + Ok(Handler::new(self.env_config, self.bitcoin_wallet.clone())) } fn handle_established_outbound_connection( From 230265afcb66cf0099f53c5e4456f954f7aa45d2 Mon Sep 17 00:00:00 2001 From: Binarybaron Date: Mon, 11 Nov 2024 00:07:26 +0100 Subject: [PATCH 111/112] remaining leftovers --- swap/src/cli/event_loop.rs | 4 ++++ swap/src/common/tracing_util.rs | 2 -- swap/src/env.rs | 5 ++--- swap/src/network/redial.rs | 10 ++++++++++ swap/src/network/swap_setup/bob.rs | 2 +- swap/src/protocol/alice/swap.rs | 16 +--------------- 6 files changed, 18 insertions(+), 21 deletions(-) diff --git a/swap/src/cli/event_loop.rs b/swap/src/cli/event_loop.rs index 9fb207e6b..45f704c50 100644 --- a/swap/src/cli/event_loop.rs +++ b/swap/src/cli/event_loop.rs @@ -247,6 +247,10 @@ impl EventLoop { } SwarmEvent::ConnectionClosed { peer_id, endpoint, num_established, cause: Some(error), connection_id } if peer_id == self.alice_peer_id && num_established == 0 => { tracing::warn!(peer_id = %endpoint.get_remote_address(), cause = %error, %connection_id, "Lost connection to Alice"); + + if let Some(duration) = self.swarm.behaviour_mut().redial.until_next_redial() { + tracing::info!(seconds_until_next_redial = %duration.as_secs(), "Waiting for next redial attempt"); + } } SwarmEvent::ConnectionClosed { peer_id, num_established, cause: None, .. } if peer_id == self.alice_peer_id && num_established == 0 => { // no error means the disconnection was requested diff --git a/swap/src/common/tracing_util.rs b/swap/src/common/tracing_util.rs index 42e0ec623..7719df57f 100644 --- a/swap/src/common/tracing_util.rs +++ b/swap/src/common/tracing_util.rs @@ -84,8 +84,6 @@ fn env_filter(level_filter: LevelFilter) -> Result { Ok(EnvFilter::from_default_env() .add_directive(Directive::from_str(&format!("asb={}", &level_filter))?) .add_directive(Directive::from_str(&format!("swap={}", &level_filter))?) - // TODO(libp2p upgrade): Disable this again once we merge https://github.com/UnstoppableSwap/core/pull/109 - .add_directive(Directive::from_str("libp2p=debug")?) .add_directive(Directive::from_str(&format!( "unstoppableswap-gui-rs={}", &level_filter diff --git a/swap/src/env.rs b/swap/src/env.rs index 1cb5961c0..1ba8c4326 100644 --- a/swap/src/env.rs +++ b/swap/src/env.rs @@ -67,9 +67,8 @@ impl GetConfig for Testnet { bitcoin_lock_confirmed_timeout: 1.std_hours(), bitcoin_finality_confirmations: 1, bitcoin_avg_block_time: 10.std_minutes(), - // TODO(Libp2p Migration): This was temporarily increased for testing. testnet3 block time is too low at the moment - bitcoin_cancel_timelock: CancelTimelock::new(72), - bitcoin_punish_timelock: PunishTimelock::new(72), + bitcoin_cancel_timelock: CancelTimelock::new(12), + bitcoin_punish_timelock: PunishTimelock::new(6), bitcoin_network: bitcoin::Network::Testnet, monero_avg_block_time: 2.std_minutes(), monero_finality_confirmations: 10, diff --git a/swap/src/network/redial.rs b/swap/src/network/redial.rs index e5448879a..83ffde56c 100644 --- a/swap/src/network/redial.rs +++ b/swap/src/network/redial.rs @@ -98,6 +98,7 @@ impl NetworkBehaviour for Behaviour { if redial && self.sleep.is_none() { self.sleep = Some(Box::pin(tokio::time::sleep(self.backoff.initial_interval))); + tracing::info!(seconds_until_next_redial = %self.until_next_redial().unwrap().as_secs(), "Waiting for next redial attempt"); } } @@ -108,6 +109,15 @@ impl NetworkBehaviour for Behaviour { }; futures::ready!(sleep.poll_unpin(cx)); + + let next_dial_in = match self.backoff.next_backoff() { + Some(next_dial_in) => next_dial_in, + None => { + unreachable!("The backoff should never run out of attempts"); + } + }; + + self.sleep = Some(Box::pin(tokio::time::sleep(next_dial_in))); Poll::Ready(ToSwarm::Dial { opts: DialOpts::peer_id(self.peer) diff --git a/swap/src/network/swap_setup/bob.rs b/swap/src/network/swap_setup/bob.rs index 6099ed2a8..ed7351d81 100644 --- a/swap/src/network/swap_setup/bob.rs +++ b/swap/src/network/swap_setup/bob.rs @@ -90,7 +90,7 @@ impl NetworkBehaviour for Behaviour { &mut self, _cx: &mut std::task::Context<'_>, ) -> Poll>> { - // Send completed swaps to the swarm + // Forward completed swaps from the connection handler to the swarm if let Some((_peer, completed)) = self.completed_swaps.pop_front() { return Poll::Ready(ToSwarm::GenerateEvent(completed)); } diff --git a/swap/src/protocol/alice/swap.rs b/swap/src/protocol/alice/swap.rs index a98bb0e54..907cfe818 100644 --- a/swap/src/protocol/alice/swap.rs +++ b/swap/src/protocol/alice/swap.rs @@ -216,10 +216,8 @@ where } => { let tx_lock_status = bitcoin_wallet.subscribe_to(state3.tx_lock.clone()).await; - let send_transfer_proof = event_loop_handle.send_transfer_proof(transfer_proof.clone()); - tokio::select! { - result = send_transfer_proof => { + result = event_loop_handle.send_transfer_proof(transfer_proof.clone()) => { result?; AliceState::XmrLockTransferProofSent { @@ -233,18 +231,6 @@ where // If we send Bob the transfer proof, but for whatever reason we do not receive an acknoledgement from him // we would be stuck in this state forever (deadlock). By listening for the encrypted signature here we // can still proceed to the next state even if Bob does not respond with an acknoledgement. - // - // This currently does not work due to borrow checker issues. - // enc_sig = recv_encrypted_signature => { - // tracing::info!("Received encrypted signature"); - - // AliceState::EncSigLearned { - // monero_wallet_restore_blockheight, - // transfer_proof, - // encrypted_signature: Box::new(enc_sig?), - // state3, - // } - // } result = tx_lock_status.wait_until_confirmed_with(state3.cancel_timelock) => { result?; AliceState::CancelTimelockExpired { From 15b30e3871130426a7101b8307bdecb53304f607 Mon Sep 17 00:00:00 2001 From: Binarybaron Date: Mon, 11 Nov 2024 00:14:13 +0100 Subject: [PATCH 112/112] dprint fmt --- swap/src/network/redial.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swap/src/network/redial.rs b/swap/src/network/redial.rs index 83ffde56c..e5bd90d05 100644 --- a/swap/src/network/redial.rs +++ b/swap/src/network/redial.rs @@ -109,7 +109,7 @@ impl NetworkBehaviour for Behaviour { }; futures::ready!(sleep.poll_unpin(cx)); - + let next_dial_in = match self.backoff.next_backoff() { Some(next_dial_in) => next_dial_in, None => {