From 1f5fbd2b341dd157313d5af3b0e560a98c1e27a0 Mon Sep 17 00:00:00 2001 From: Andre-Philippe Paquet Date: Thu, 29 Aug 2024 20:25:02 -0400 Subject: [PATCH 1/4] Bump deps --- Cargo.lock | 142 +++++++++++++++++++++++++++-------------------------- Cargo.toml | 4 -- 2 files changed, 72 insertions(+), 74 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 995952b0..bd010d69 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -241,7 +241,7 @@ checksum = "965c2d33e53cb6b267e148a4cb0760bc01f4904c1cd4bb4002a085bb016d1490" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", "synstructure", ] @@ -253,7 +253,7 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -275,7 +275,7 @@ dependencies = [ "futures-lite", "parking", "polling", - "rustix 0.38.34", + "rustix 0.38.35", "slab", "tracing", "windows-sys 0.59.0", @@ -300,7 +300,7 @@ checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -666,9 +666,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.1.13" +version = "1.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72db2f7947ecee9b03b510377e8bb9077afa27176fdbff55c51027e976fdcc48" +checksum = "57b6a275aa2903740dc87da01c62040406b8812552e97129a63ea8850a17c6e6" dependencies = [ "jobserver", "libc", @@ -825,7 +825,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -918,9 +918,9 @@ dependencies = [ [[package]] name = "constant_time_eq" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" +checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" [[package]] name = "core-foundation" @@ -1239,7 +1239,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -1411,7 +1411,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -1478,7 +1478,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -1621,7 +1621,7 @@ dependencies = [ "futures", "log", "quote", - "syn 2.0.75", + "syn 2.0.76", "thiserror", ] @@ -1917,9 +1917,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "fd-lock" @@ -1928,7 +1928,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e5768da2206272c81ef0b5e951a41862938a6070da63bcea197899942d3b947" dependencies = [ "cfg-if", - "rustix 0.38.34", + "rustix 0.38.35", "windows-sys 0.52.0", ] @@ -1956,9 +1956,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.32" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c0596c1eac1f9e04ed902702e9878208b336edc9d6fddc8a48387349bab3666" +checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253" dependencies = [ "crc32fast", "miniz_oxide 0.8.0", @@ -1997,7 +1997,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d167b646a876ba8fda6b50ac645cfd96242553cbaf0ca4fccaa39afcbf0801f" dependencies = [ "io-lifetimes 1.0.11", - "rustix 0.38.34", + "rustix 0.38.35", "windows-sys 0.48.0", ] @@ -2088,7 +2088,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -3243,7 +3243,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -3563,7 +3563,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" dependencies = [ - "rustix 0.38.34", + "rustix 0.38.35", ] [[package]] @@ -3715,7 +3715,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", "synstructure", ] @@ -3923,9 +3923,9 @@ dependencies = [ [[package]] name = "oid-registry" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c958dd45046245b9c3c2547369bb634eb461670b2e7e0de552905801a648d1d" +checksum = "a8d8034d9489cdaf79228eb9f6a3b8d7bb32ba00d6645ebd48eef4077ceb5bd9" dependencies = [ "asn1-rs", ] @@ -4092,7 +4092,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -4133,7 +4133,7 @@ dependencies = [ "concurrent-queue", "hermit-abi 0.4.0", "pin-project-lite", - "rustix 0.38.34", + "rustix 0.38.35", "tracing", "windows-sys 0.59.0", ] @@ -4184,12 +4184,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.20" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" +checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" dependencies = [ "proc-macro2", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -4255,7 +4255,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -4285,7 +4285,7 @@ dependencies = [ "prost", "prost-types", "regex", - "syn 2.0.75", + "syn 2.0.76", "tempfile", ] @@ -4299,7 +4299,7 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -4430,9 +4430,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -4752,9 +4752,9 @@ checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ "semver", ] @@ -4800,9 +4800,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.34" +version = "0.38.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "a85d50532239da68e9addb745ba38ff4612a242c1c7ceea689c4bc7c2f43c36f" dependencies = [ "bitflags 2.6.0", "errno", @@ -4820,7 +4820,7 @@ dependencies = [ "once_cell", "ring 0.17.8", "rustls-pki-types", - "rustls-webpki 0.102.6", + "rustls-webpki 0.102.7", "subtle", "zeroize", ] @@ -4853,9 +4853,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.6" +version = "0.102.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e6b52d4fda176fd835fdc55a835d4a89b8499cad995885a21149d5ad62f852e" +checksum = "84678086bd54edf2b415183ed7a94d0efb049f1b646a33e22a36f3794be6ae56" dependencies = [ "ring 0.17.8", "rustls-pki-types", @@ -4917,9 +4917,9 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" -version = "1.0.208" +version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff085d2cb684faa248efb494c39b68e522822ac0de72ccf08109abde717cfb2" +checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" dependencies = [ "serde_derive", ] @@ -4936,20 +4936,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.208" +version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf" +checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] name = "serde_json" -version = "1.0.125" +version = "1.0.127" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83c8e735a073ccf5be70aa8066aa984eaf2fa000db6c8d0100ae605b366d31ed" +checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" dependencies = [ "itoa", "memchr", @@ -5224,9 +5224,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.75" +version = "2.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6af063034fc1935ede7be0122941bafa9bacb949334d090b77ca98b5817c7d9" +checksum = "578e081a14e0cefc3279b0472138c513f37b41a08d5a3cca9b6e4e8ceb6cd525" dependencies = [ "proc-macro2", "quote", @@ -5250,13 +5250,14 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] name = "system-configuration" version = "0.5.1" -source = "git+https://github.com/tmpfs/system-configuration-rs?rev=572913bf0c74ed996b2beeac3d61ed681075cbd4#572913bf0c74ed996b2beeac3d61ed681075cbd4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" dependencies = [ "bitflags 1.3.2", "core-foundation", @@ -5266,7 +5267,8 @@ dependencies = [ [[package]] name = "system-configuration-sys" version = "0.5.0" -source = "git+https://github.com/tmpfs/system-configuration-rs?rev=572913bf0c74ed996b2beeac3d61ed681075cbd4#572913bf0c74ed996b2beeac3d61ed681075cbd4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" dependencies = [ "core-foundation-sys", "libc", @@ -5283,7 +5285,7 @@ dependencies = [ "cap-std", "fd-lock", "io-lifetimes 2.0.3", - "rustix 0.38.34", + "rustix 0.38.35", "windows-sys 0.48.0", "winx 0.36.3", ] @@ -5393,7 +5395,7 @@ dependencies = [ "cfg-if", "fastrand", "once_cell", - "rustix 0.38.34", + "rustix 0.38.35", "windows-sys 0.59.0", ] @@ -5429,7 +5431,7 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -5524,7 +5526,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -5624,7 +5626,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -5919,7 +5921,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", "wasm-bindgen-shared", ] @@ -5953,7 +5955,7 @@ checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -5966,9 +5968,9 @@ checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" [[package]] name = "wasm-encoder" -version = "0.215.0" +version = "0.216.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb56df3e06b8e6b77e37d2969a50ba51281029a9aeb3855e76b7f49b6418847" +checksum = "04c23aebea22c8a75833ae08ed31ccc020835b12a41999e58c31464271b94a88" dependencies = [ "leb128", ] @@ -6231,9 +6233,9 @@ dependencies = [ [[package]] name = "wast" -version = "215.0.0" +version = "216.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ff1d00d893593249e60720be04a7c1f42f1c4dc3806a2869f4e66ab61eb54cb" +checksum = "f7eb1f2eecd913fdde0dc6c3439d0f24530a98ac6db6cb3d14d92a5328554a08" dependencies = [ "bumpalo", "leb128", @@ -6244,11 +6246,11 @@ dependencies = [ [[package]] name = "wat" -version = "1.215.0" +version = "1.216.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "670bf4d9c8cf76ae242d70ded47c546525b6dafaa6871f9bcb065344bf2b4e3d" +checksum = "ac0409090fb5154f95fb5ba3235675fd9e579e731524d63b6a2f653e1280c82a" dependencies = [ - "wast 215.0.0", + "wast 216.0.0", ] [[package]] @@ -6812,7 +6814,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -6832,7 +6834,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index c6e0ac03..6cb17623 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -81,7 +81,3 @@ lto = "thin" [profile.release] debug = true - -[patch.crates-io] -# See https://github.com/mullvad/system-configuration-rs/issues/41 -system-configuration = { git = "https://github.com/tmpfs/system-configuration-rs", rev = "572913bf0c74ed996b2beeac3d61ed681075cbd4"} From 046df55c8999ee8ece38ec90ac399f1f3bf0ece7 Mon Sep 17 00:00:00 2001 From: Andre-Philippe Paquet Date: Sat, 31 Aug 2024 13:53:52 -0400 Subject: [PATCH 2/4] Bump deps --- Cargo.lock | 198 +++++++++++++++------------------ Cargo.toml | 4 + apps/macros/Cargo.toml | 4 +- apps/sdk/Cargo.toml | 4 +- chain/Cargo.toml | 4 +- clients/c/Cargo.toml | 2 +- core/Cargo.toml | 12 +- discovery/Cargo.toml | 8 +- exo/Cargo.toml | 8 +- protos/Cargo.toml | 6 +- store/Cargo.toml | 8 +- transport/Cargo.toml | 6 +- transport/src/p2p/behaviour.rs | 3 +- 13 files changed, 125 insertions(+), 142 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bd010d69..ef39caff 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -241,7 +241,7 @@ checksum = "965c2d33e53cb6b267e148a4cb0760bc01f4904c1cd4bb4002a085bb016d1490" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", "synstructure", ] @@ -253,7 +253,7 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -300,20 +300,7 @@ checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", -] - -[[package]] -name = "asynchronous-codec" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4057f2c32adbb2fc158e22fb38433c8e9bbf76b75a4732c7c0cbaf695fb65568" -dependencies = [ - "bytes", - "futures-sink", - "futures-util", - "memchr", - "pin-project-lite", + "syn 2.0.77", ] [[package]] @@ -384,12 +371,6 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" -[[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" @@ -825,7 +806,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -1239,7 +1220,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -1411,7 +1392,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -1478,7 +1459,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -1621,7 +1602,7 @@ dependencies = [ "futures", "log", "quote", - "syn 2.0.76", + "syn 2.0.77", "thiserror", ] @@ -2088,7 +2069,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -2907,16 +2888,15 @@ checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" [[package]] name = "libp2p" -version = "0.53.2" +version = "0.54.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "681fb3f183edfbedd7a57d32ebe5dcdc0b9f94061185acf3c30249349cc6fc99" +checksum = "bbbe80f9c7e00526cd6b838075b9c171919404a4732cb2fa8ece0a093223bfc4" dependencies = [ "bytes", "either", "futures", "futures-timer", "getrandom 0.2.15", - "instant", "libp2p-allow-block-list", "libp2p-connection-limits", "libp2p-core", @@ -2943,9 +2923,9 @@ dependencies = [ [[package]] name = "libp2p-allow-block-list" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "107b238b794cb83ab53b74ad5dcf7cca3200899b72fe662840cfb52f5b0a32e6" +checksum = "d1027ccf8d70320ed77e984f273bc8ce952f623762cb9bf2d126df73caef8041" dependencies = [ "libp2p-core", "libp2p-identity", @@ -2955,9 +2935,9 @@ dependencies = [ [[package]] name = "libp2p-connection-limits" -version = "0.3.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7cd50a78ccfada14de94cbacd3ce4b0138157f376870f13d3a8422cd075b4fd" +checksum = "8d003540ee8baef0d254f7b6bfd79bac3ddf774662ca0abf69186d517ef82ad8" dependencies = [ "libp2p-core", "libp2p-identity", @@ -2967,9 +2947,9 @@ dependencies = [ [[package]] name = "libp2p-core" -version = "0.41.3" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5a8920cbd8540059a01950c1e5c96ea8d89eb50c51cd366fc18bdf540a6e48f" +checksum = "a61f26c83ed111104cd820fe9bc3aaabbac5f1652a1d213ed6e900b7918a1298" dependencies = [ "either", "fnv", @@ -2995,9 +2975,9 @@ dependencies = [ [[package]] name = "libp2p-dns" -version = "0.41.1" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d17cbcf7160ff35c3e8e560de4a068fe9d6cb777ea72840e48eb76ff9576c4b6" +checksum = "97f37f30d5c7275db282ecd86e54f29dd2176bd3ac656f06abf43bedb21eb8bd" dependencies = [ "async-trait", "futures", @@ -3011,12 +2991,12 @@ dependencies = [ [[package]] name = "libp2p-gossipsub" -version = "0.46.1" +version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d665144a616dadebdc5fff186b1233488cdcd8bfb1223218ff084b6d052c94f7" +checksum = "b4e830fdf24ac8c444c12415903174d506e1e077fbe3875c404a78c5935a8543" dependencies = [ - "asynchronous-codec 0.7.0", - "base64 0.21.7", + "asynchronous-codec", + "base64 0.22.1", "byteorder", "bytes", "either", @@ -3025,7 +3005,6 @@ dependencies = [ "futures-ticker", "getrandom 0.2.15", "hex_fmt", - "instant", "libp2p-core", "libp2p-identity", "libp2p-swarm", @@ -3038,15 +3017,16 @@ dependencies = [ "smallvec", "tracing", "void", + "web-time", ] [[package]] name = "libp2p-identify" -version = "0.44.2" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5d635ebea5ca0c3c3e77d414ae9b67eccf2a822be06091b9c1a0d13029a1e2f" +checksum = "1711b004a273be4f30202778856368683bd9a83c4c7dcc8f848847606831a4e3" dependencies = [ - "asynchronous-codec 0.7.0", + "asynchronous-codec", "either", "futures", "futures-bounded", @@ -3085,9 +3065,9 @@ dependencies = [ [[package]] name = "libp2p-mdns" -version = "0.45.1" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49007d9a339b3e1d7eeebc4d67c05dbf23d300b7d091193ec2d3f26802d7faf2" +checksum = "14b8546b6644032565eb29046b42744aee1e9f261ed99671b2c93fb140dba417" dependencies = [ "data-encoding", "futures", @@ -3106,12 +3086,11 @@ dependencies = [ [[package]] name = "libp2p-metrics" -version = "0.14.1" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdac91ae4f291046a3b2660c039a2830c931f84df2ee227989af92f7692d3357" +checksum = "77ebafa94a717c8442d8db8d3ae5d1c6a15e30f2d347e0cd31d057ca72e42566" dependencies = [ "futures", - "instant", "libp2p-core", "libp2p-identify", "libp2p-identity", @@ -3119,15 +3098,16 @@ dependencies = [ "libp2p-swarm", "pin-project", "prometheus-client", + "web-time", ] [[package]] name = "libp2p-mplex" -version = "0.41.0" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e895765e27e30217b25f7cb7ac4686dad1ff80bf2fdeffd1d898566900a924" +checksum = "41187ab8f6c835ad864edf94224f666f636ee2d270601422c1441f739e0abccc" dependencies = [ - "asynchronous-codec 0.6.2", + "asynchronous-codec", "bytes", "futures", "libp2p-core", @@ -3137,16 +3117,16 @@ dependencies = [ "rand 0.8.5", "smallvec", "tracing", - "unsigned-varint 0.7.2", + "unsigned-varint 0.8.0", ] [[package]] name = "libp2p-noise" -version = "0.44.0" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecd0545ce077f6ea5434bcb76e8d0fe942693b4380aaad0d34a358c2bd05793" +checksum = "36b137cb1ae86ee39f8e5d6245a296518912014eaa87427d24e6ff58cfc1b28c" dependencies = [ - "asynchronous-codec 0.7.0", + "asynchronous-codec", "bytes", "curve25519-dalek", "futures", @@ -3168,27 +3148,27 @@ dependencies = [ [[package]] name = "libp2p-ping" -version = "0.44.1" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1de5a6cf64fba7f7e8f2102711c9c6c043a8e56b86db8cd306492c517da3fb3" +checksum = "005a34420359223b974ee344457095f027e51346e992d1e0dcd35173f4cdd422" dependencies = [ "either", "futures", "futures-timer", - "instant", "libp2p-core", "libp2p-identity", "libp2p-swarm", "rand 0.8.5", "tracing", "void", + "web-time", ] [[package]] name = "libp2p-quic" -version = "0.10.3" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c67296ad4e092e23f92aea3d2bdb6f24eab79c0929ed816dfb460ea2f4567d2b" +checksum = "46352ac5cd040c70e88e7ff8257a2ae2f891a4076abad2c439584a31c15fd24e" dependencies = [ "bytes", "futures", @@ -3210,16 +3190,15 @@ dependencies = [ [[package]] name = "libp2p-swarm" -version = "0.44.2" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80cae6cb75f89dbca53862f9ebe0b9f463aa7b302762fcfaafb9e51dcc9b0f7e" +checksum = "d7dd6741793d2c1fb2088f67f82cf07261f25272ebe3c0b0c311e0c6b50e851a" dependencies = [ "either", "fnv", "futures", "futures-timer", "getrandom 0.2.15", - "instant", "libp2p-core", "libp2p-identity", "libp2p-swarm-derive", @@ -3232,25 +3211,26 @@ dependencies = [ "tracing", "void", "wasm-bindgen-futures", + "web-time", ] [[package]] name = "libp2p-swarm-derive" -version = "0.34.2" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5daceb9dd908417b6dfcfe8e94098bc4aac54500c282e78120b885dadc09b999" +checksum = "206e0aa0ebe004d778d79fb0966aa0de996c19894e2c0605ba2f8524dd4443d8" dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] name = "libp2p-tcp" -version = "0.41.0" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b2460fc2748919adff99ecbc1aab296e4579e41f374fb164149bd2c9e529d4c" +checksum = "ad964f312c59dcfcac840acd8c555de8403e295d39edf96f5240048b5fcaa314" dependencies = [ "futures", "futures-timer", @@ -3265,9 +3245,9 @@ dependencies = [ [[package]] name = "libp2p-tls" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b7b831e55ce2aa6c354e6861a85fdd4dd0a2b97d5e276fabac0e4810a71776" +checksum = "47b23dddc2b9c355f73c1e36eb0c3ae86f7dc964a3715f0731cfad352db4d847" dependencies = [ "futures", "futures-rustls", @@ -3284,9 +3264,9 @@ dependencies = [ [[package]] name = "libp2p-upnp" -version = "0.2.2" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccf04b0e3ff3de52d07d5fd6c3b061d0e7f908ffc683c32d9638caedce86fc8" +checksum = "01bf2d1b772bd3abca049214a3304615e6a36fa6ffc742bdd1ba774486200b8f" dependencies = [ "futures", "futures-timer", @@ -3300,9 +3280,9 @@ dependencies = [ [[package]] name = "libp2p-websocket" -version = "0.43.2" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b953b6803a1f3161a989538974d72511c4e48a4af355337b6fb90723c56c05" +checksum = "888b2ff2e5d8dcef97283daab35ad1043d18952b65e05279eecbe02af4c6e347" dependencies = [ "either", "futures", @@ -3321,9 +3301,9 @@ dependencies = [ [[package]] name = "libp2p-websocket-websys" -version = "0.3.3" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f95cd8a32fcf94ad1e5c2de37c2a05a5a4188d8358b005859a0fc9e63b6953bc" +checksum = "38cf9b429dd07be52cd82c4c484b1694df4209210a7db3b9ffb00c7606e230c8" dependencies = [ "bytes", "futures", @@ -3339,9 +3319,9 @@ dependencies = [ [[package]] name = "libp2p-yamux" -version = "0.45.2" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddd5265f6b80f94d48a3963541aad183cc598a645755d2f1805a373e41e0716b" +checksum = "788b61c80789dba9760d8c669a5bedb642c8267555c803fabd8396e4ca5c5882" dependencies = [ "either", "futures", @@ -3715,7 +3695,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", "synstructure", ] @@ -4092,7 +4072,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -4189,7 +4169,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" dependencies = [ "proc-macro2", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -4255,7 +4235,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -4285,7 +4265,7 @@ dependencies = [ "prost", "prost-types", "regex", - "syn 2.0.76", + "syn 2.0.77", "tempfile", ] @@ -4299,7 +4279,7 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -4372,7 +4352,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "15a0580ab32b169745d7a39db2ba969226ca16738931be152a3209b409de2474" dependencies = [ - "asynchronous-codec 0.7.0", + "asynchronous-codec", "bytes", "quick-protobuf", "thiserror", @@ -4942,7 +4922,7 @@ checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -5224,9 +5204,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.76" +version = "2.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578e081a14e0cefc3279b0472138c513f37b41a08d5a3cca9b6e4e8ceb6cd525" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" dependencies = [ "proc-macro2", "quote", @@ -5250,14 +5230,13 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] name = "system-configuration" version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +source = "git+https://github.com/tmpfs/system-configuration-rs?rev=572913bf0c74ed996b2beeac3d61ed681075cbd4#572913bf0c74ed996b2beeac3d61ed681075cbd4" dependencies = [ "bitflags 1.3.2", "core-foundation", @@ -5267,8 +5246,7 @@ dependencies = [ [[package]] name = "system-configuration-sys" version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +source = "git+https://github.com/tmpfs/system-configuration-rs?rev=572913bf0c74ed996b2beeac3d61ed681075cbd4#572913bf0c74ed996b2beeac3d61ed681075cbd4" dependencies = [ "core-foundation-sys", "libc", @@ -5431,7 +5409,7 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -5504,9 +5482,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.39.3" +version = "1.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9babc99b9923bfa4804bd74722ff02c0381021eafa4db9949217e3be8e84fff5" +checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" dependencies = [ "backtrace", "bytes", @@ -5526,7 +5504,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -5626,7 +5604,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -5731,16 +5709,16 @@ name = "unsigned-varint" version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6889a77d49f1f013504cec6bf97a2c730394adedaeb1deb5ea08949a50541105" -dependencies = [ - "asynchronous-codec 0.6.2", - "bytes", -] [[package]] name = "unsigned-varint" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb066959b24b5196ae73cb057f45598450d2c5f71460e98c49b738086eff9c06" +dependencies = [ + "asynchronous-codec", + "bytes", +] [[package]] name = "untrusted" @@ -5921,7 +5899,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", "wasm-bindgen-shared", ] @@ -5955,7 +5933,7 @@ checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -6814,7 +6792,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -6834,7 +6812,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 6cb17623..c6e0ac03 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -81,3 +81,7 @@ lto = "thin" [profile.release] debug = true + +[patch.crates-io] +# See https://github.com/mullvad/system-configuration-rs/issues/41 +system-configuration = { git = "https://github.com/tmpfs/system-configuration-rs", rev = "572913bf0c74ed996b2beeac3d61ed681075cbd4"} diff --git a/apps/macros/Cargo.toml b/apps/macros/Cargo.toml index d13b1059..a652d345 100644 --- a/apps/macros/Cargo.toml +++ b/apps/macros/Cargo.toml @@ -16,6 +16,6 @@ proc-macro = true anyhow = "1.0.86" futures = "0.3.30" log = "0.4.22" -quote = "1.0.36" -syn = { version = "2.0.75", features = ["full", "fold"] } +quote = "1.0.37" +syn = { version = "2.0.77", features = ["full", "fold"] } thiserror = "1.0.63" diff --git a/apps/sdk/Cargo.toml b/apps/sdk/Cargo.toml index 18423c55..fe6af41f 100644 --- a/apps/sdk/Cargo.toml +++ b/apps/sdk/Cargo.toml @@ -17,9 +17,9 @@ exocore-store = {version = "0.1.25", path = "../../store", default-features = fa futures = "0.3.30" lazy_static = "1.5.0" log = "0.4.22" -quote = "1.0.36" +quote = "1.0.37" thiserror = "1.0.63" chrono = { version = "0.4.38", default-features = false, features = [] } [dev-dependencies] -tokio = { version = "1.39.3", features = ["macros"], default-features = false } +tokio = { version = "1.40.0", features = ["macros"], default-features = false } diff --git a/chain/Cargo.toml b/chain/Cargo.toml index f2f84c0a..461c2ddd 100644 --- a/chain/Cargo.toml +++ b/chain/Cargo.toml @@ -26,7 +26,7 @@ exocore-transport = {version = "0.1.25", path = "../transport", default-features futures = "0.3.30" itertools = "0.13.0" log = "0.4.22" -serde = { version = "1.0.208", features = ["derive"] } +serde = { version = "1.0.209", features = ["derive"] } thiserror = "1.0.63" bytes = "1.7.1" @@ -41,7 +41,7 @@ tempfile = { version = "3.12.0", optional = true } exocore-core = {version = "0.1.25", path = "../core", features = ["tests-utils"]} exocore-transport = {version = "0.1.25", path = "../transport", features = ["tests-utils"]} tempfile = "3.12.0" -tokio = { version = "1.39.3", features = ["macros"], default-features = false } +tokio = { version = "1.40.0", features = ["macros"], default-features = false } [[test]] name = "engine" diff --git a/clients/c/Cargo.toml b/clients/c/Cargo.toml index ed64e377..efa3a48d 100644 --- a/clients/c/Cargo.toml +++ b/clients/c/Cargo.toml @@ -19,4 +19,4 @@ futures = "0.3.30" libc = "0.2.158" log = "0.4.22" log4rs = "1.3.0" -serde_json = "1.0.125" +serde_json = "1.0.127" diff --git a/core/Cargo.toml b/core/Cargo.toml index 573e022d..c886a14e 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -35,7 +35,7 @@ bytes = "1.7.1" chrono = "0.4.38" exocore-protos = {version = "0.1.25", path = "../protos"} futures = { version = "0.3.30", features = ["async-await"] } -libp2p = { version = "0.53.2", features = ["noise", "secp256k1"], default-features = false } +libp2p = { version = "0.54.1", features = ["noise", "secp256k1"], default-features = false } libp2p-identity = { version = "0.2.9", features = ["secp256k1", "ed25519"], default-features = false } log = "0.4.22" log4rs = { version = "1.3.0", optional = true } @@ -44,9 +44,9 @@ multihash-codetable = {version="0.1.3", features=["sha3"]} multihash-derive = {version="0.9"} petname = "1.1.3" rand = "0.8" -serde = "1.0.208" -serde_derive = "1.0.208" -serde_json = "1.0.125" +serde = "1.0.209" +serde_derive = "1.0.209" +serde_json = "1.0.127" serde_yaml = "0.9.34" shadow-rs = { version = "0.27.1", default-features = false } thiserror = "1.0.63" @@ -64,7 +64,7 @@ wasm-bindgen-futures = "0.4.43" chrono = { version = "0.4.38", default-features = false, features = [] } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -tokio = { version = "1.39.3", features = ["rt"], default-features = false } +tokio = { version = "1.40.0", features = ["rt"], default-features = false } [build-dependencies] shadow-rs = { version = "0.27.1", default-features = false } @@ -73,7 +73,7 @@ shadow-rs = { version = "0.27.1", default-features = false } criterion_bencher_compat = "0.4.0" log4rs = "1.3.0" tempfile = "3.12.0" -tokio = { version = "1.39.3", features = ["macros", "rt", "rt-multi-thread", "time"], default-features = false } +tokio = { version = "1.40.0", features = ["macros", "rt", "rt-multi-thread", "time"], default-features = false } [[bench]] harness = false diff --git a/discovery/Cargo.toml b/discovery/Cargo.toml index d7bb717a..9b9e57af 100644 --- a/discovery/Cargo.toml +++ b/discovery/Cargo.toml @@ -21,15 +21,15 @@ futures = "0.3.30" log = "0.4.22" rand = "0.8" reqwest = { version = "0.12.7", default-features = false, features = ["json", "rustls-tls"] } -serde = "1.0.208" -serde_derive = "1.0.208" -serde_json = "1.0.125" +serde = "1.0.209" +serde_derive = "1.0.209" +serde_json = "1.0.127" thiserror = "1.0.63" wasm-timer = "0.2.5" # For server hyper = { version = "0.14.30", features = ["full"], optional = true } -tokio = { version = "1.39.3", default-features = false, features = ["macros", "time"], optional = true } +tokio = { version = "1.40.0", default-features = false, features = ["macros", "time"], optional = true } [[test]] name = "discovery" diff --git a/exo/Cargo.toml b/exo/Cargo.toml index 589fbf01..608b8933 100644 --- a/exo/Cargo.toml +++ b/exo/Cargo.toml @@ -29,11 +29,11 @@ log = "0.4.22" log4rs = "1.3.0" rand = "0.8" reqwest = { version = "0.12.7", default-features = false, features = ["rustls-tls"] } -serde = "1.0.208" -serde_derive = "1.0.208" -serde_json = "1.0.125" +serde = "1.0.209" +serde_derive = "1.0.209" +serde_json = "1.0.127" tempfile = "3.12.0" thiserror = "1.0.63" -tokio = { version = "1.39.3", features = ["macros"], default-features = false } +tokio = { version = "1.40.0", features = ["macros"], default-features = false } url = "2.5.2" zip = { version = "0.6.6", features = ["deflate"], default-features = false } diff --git a/protos/Cargo.toml b/protos/Cargo.toml index 12cf2049..6e80fb8b 100644 --- a/protos/Cargo.toml +++ b/protos/Cargo.toml @@ -17,9 +17,9 @@ chrono = "0.4.38" prost = "0.12.6" prost-types = "0.12.6" protobuf = "3.5.1" -serde = "1.0.208" -serde_derive = "1.0.208" -serde_json = "1.0.125" +serde = "1.0.209" +serde_derive = "1.0.209" +serde_json = "1.0.127" thiserror = "1.0.63" [build-dependencies] diff --git a/store/Cargo.toml b/store/Cargo.toml index 79a1381d..943cc389 100644 --- a/store/Cargo.toml +++ b/store/Cargo.toml @@ -49,13 +49,13 @@ byteorder = {version = "1.5.0", optional = true} crc = {version = "3.2.1", optional = true} extsort = {version = "0.4.2", optional = true} lru = {version = "0.12.4", optional = true} -serde = {version = "1.0.208", optional = true} -serde_derive = {version = "1.0.208", optional = true} -serde_json = {version = "1.0.125", optional = true} +serde = {version = "1.0.209", optional = true} +serde_derive = {version = "1.0.209", optional = true} +serde_json = {version = "1.0.127", optional = true} tantivy = {version = "0.19.2", optional = true} [dev-dependencies] exocore-chain = {version = "0.1.25", path = "../chain", features = ["tests-utils"]} exocore-core = {version = "0.1.25", path = "../core", features = ["tests-utils"]} tempfile = "3.12.0" -tokio = {version = "1.39.3", features = ["macros"], default-features = false} +tokio = {version = "1.40.0", features = ["macros"], default-features = false} diff --git a/transport/Cargo.toml b/transport/Cargo.toml index 9ae39ebb..c9ef7ede 100644 --- a/transport/Cargo.toml +++ b/transport/Cargo.toml @@ -25,9 +25,9 @@ exocore-core = {version = "0.1.25", path = "../core"} exocore-protos = {version = "0.1.25", path = "../protos"} futures = "0.3.30" hyper = {version = "0.14.30", features = ["full"], optional = true} -libp2p = {version = "0.53.2", optional = true, default-features = false, features = ["noise", "websocket", "yamux", "ping", "identify", "macros", "tokio", "dns"]} +libp2p = {version = "0.54.1", optional = true, default-features = false, features = ["noise", "websocket", "yamux", "ping", "identify", "macros", "tokio", "dns"]} libp2p-identity = { version = "0.2.9", features = ["secp256k1", "ed25519"], default-features = false } -libp2p-mplex = {version = "0.41.0", optional = true} +libp2p-mplex = {version = "0.42.0", optional = true} log = "0.4.22" pin-project = "1.1.5" thiserror = "1.0.63" @@ -35,4 +35,4 @@ url = {version = "2.5.2", optional = true} [dev-dependencies] exocore-core = {version = "0.1.25", path = "../core", features = ["tests-utils"]} -tokio = {version = "1.39.3", features = ["macros"], default-features = false} +tokio = {version = "1.40.0", features = ["macros"], default-features = false} diff --git a/transport/src/p2p/behaviour.rs b/transport/src/p2p/behaviour.rs index d554c18c..5b76f116 100644 --- a/transport/src/p2p/behaviour.rs +++ b/transport/src/p2p/behaviour.rs @@ -6,7 +6,7 @@ use std::{ use exocore_core::{cell::Node, time::Instant}; use futures::task::{Context, Poll}; use libp2p::{ - core::Multiaddr, + core::{transport::PortUse, Multiaddr}, swarm::{ dial_opts::{DialOpts, PeerCondition}, CloseConnection, ConnectionId, FromSwarm, NetworkBehaviour, NotifyHandler, THandler, @@ -243,6 +243,7 @@ impl NetworkBehaviour for ExocoreBehaviour { peer: PeerId, _addr: &Multiaddr, _role_override: libp2p::core::Endpoint, + _port_use: PortUse, ) -> Result, libp2p::swarm::ConnectionDenied> { self.mark_peer_connected(&peer); Ok(ExocoreProtoHandler::default()) From d31e98159ebf6874fbc5200173eb7772e778bb09 Mon Sep 17 00:00:00 2001 From: Andre-Philippe Paquet Date: Sat, 31 Aug 2024 14:10:24 -0400 Subject: [PATCH 3/4] Bump deps --- .gitignore | 1 - 3rd/if-watch/.github/workflows/ci.yml | 109 +++++++++ 3rd/if-watch/.gitignore | 2 + 3rd/if-watch/CHANGELOG.md | 71 ++++++ 3rd/if-watch/Cargo.toml | 50 ++++ 3rd/if-watch/README.md | 16 ++ 3rd/if-watch/examples/if_watch.rs | 13 + 3rd/if-watch/src/apple.rs | 151 ++++++++++++ 3rd/if-watch/src/fallback.rs | 116 +++++++++ 3rd/if-watch/src/lib.rs | 120 ++++++++++ 3rd/if-watch/src/linux.rs | 174 ++++++++++++++ 3rd/if-watch/src/win.rs | 191 +++++++++++++++ Cargo.lock | 328 ++++++++++++++++++++++++-- Cargo.toml | 46 ++-- 14 files changed, 1343 insertions(+), 45 deletions(-) create mode 100644 3rd/if-watch/.github/workflows/ci.yml create mode 100644 3rd/if-watch/.gitignore create mode 100644 3rd/if-watch/CHANGELOG.md create mode 100644 3rd/if-watch/Cargo.toml create mode 100644 3rd/if-watch/README.md create mode 100644 3rd/if-watch/examples/if_watch.rs create mode 100644 3rd/if-watch/src/apple.rs create mode 100644 3rd/if-watch/src/fallback.rs create mode 100644 3rd/if-watch/src/lib.rs create mode 100644 3rd/if-watch/src/linux.rs create mode 100644 3rd/if-watch/src/win.rs diff --git a/.gitignore b/.gitignore index 2992fd60..72220b26 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ # Project specific -3rd local_conf # Rust diff --git a/3rd/if-watch/.github/workflows/ci.yml b/3rd/if-watch/.github/workflows/ci.yml new file mode 100644 index 00000000..d8d5f742 --- /dev/null +++ b/3rd/if-watch/.github/workflows/ci.yml @@ -0,0 +1,109 @@ +on: [pull_request] + +name: if-watch + +jobs: + ci: + strategy: + fail-fast: false + matrix: + toolchain: + - rust: stable + #- rust: nightly + platform: + - target: x86_64-unknown-linux-gnu + host: ubuntu-latest + cross: false + + - target: x86_64-apple-darwin + host: macos-latest + cross: false + + - target: x86_64-pc-windows-msvc + host: windows-latest + cross: false + + - target: armv7-linux-androideabi + host: ubuntu-latest + cross: true + - target: aarch64-linux-android + host: ubuntu-latest + cross: true + + - target: aarch64-apple-ios + host: macos-latest + cross: true + env: + RUST_BACKTRACE: 1 + CARGO_INCREMENTAL: 0 + LLVM_CONFIG_PATH: /usr/local/opt/llvm/bin/llvm-config + NDK_HOME: /usr/local/lib/android/sdk/ndk-bundle + + runs-on: ${{ matrix.platform.host }} + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Cache cargo folder + uses: actions/cache@v1 + with: + path: ~/.cargo + key: ${{ matrix.platform.target }}-cargo-${{ matrix.toolchain.rust }} + + - name: Install dependencies ubuntu + if: matrix.platform.host == 'ubuntu-latest' + run: sudo apt-get install llvm-dev + + - name: Install dependencies macos + if: matrix.platform.host == 'macos-latest' + run: brew install llvm + + - name: Install dependencies windows + if: matrix.platform.host == 'windows-latest' + run: choco install llvm + + - name: Install rust toolchain + uses: hecrj/setup-rust-action@v1 + with: + rust-version: ${{ matrix.toolchain.rust }} + targets: ${{ matrix.platform.target }} + + - name: Install cargo-apk + if: contains(matrix.platform.target, 'android') + run: cargo install cargo-apk + + - name: Build + if: contains(matrix.platform.target, 'android') == false + run: cargo build --workspace --all-features --target ${{ matrix.platform.target }} + + - name: Build android + if: contains(matrix.platform.target, 'android') + run: cargo apk build --target ${{ matrix.platform.target }} --all-features + + - name: Rust tests + if: matrix.platform.cross == false + run: cargo test --workspace --all-features + + lint-rust: + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Cache cargo folder + uses: actions/cache@v1 + with: + path: ~/.cargo + key: lint-cargo + + - name: Install rust toolchain + uses: hecrj/setup-rust-action@v1 + with: + rust-version: stable + components: clippy, rustfmt + + - name: cargo fmt + run: cargo fmt --all -- --check + + - name: cargo clippy + run: cargo clippy --workspace --all-features --examples --tests -- -D warnings diff --git a/3rd/if-watch/.gitignore b/3rd/if-watch/.gitignore new file mode 100644 index 00000000..96ef6c0b --- /dev/null +++ b/3rd/if-watch/.gitignore @@ -0,0 +1,2 @@ +/target +Cargo.lock diff --git a/3rd/if-watch/CHANGELOG.md b/3rd/if-watch/CHANGELOG.md new file mode 100644 index 00000000..223afafe --- /dev/null +++ b/3rd/if-watch/CHANGELOG.md @@ -0,0 +1,71 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [3.2.0] + +### Fixed + +- Update `async-io`, `if-addrs` crates. + See [PR 33](https://github.com/mxinden/if-watch/pull/33). + +## [3.1.0] + +### Fixed + +- Update `windows` crate. + See [PR 32](https://github.com/mxinden/if-watch/pull/32). + +## [3.0.1] + +### Fixed + +- For all architectures running the fallback option (e.g. Android) reverse the logic when checking if a recorded interface still exists in the new list to avoid reporting all interfaces as down and then up in the same resync(). + See [PR 31]. + +[PR 31]: https://github.com/mxinden/if-watch/pull/31 + +## [3.0.0] + +### Changed +- Feature gate async runtime, allowing opting between Tokio or smol. For every OS each `IfWatcher` is + under the `tokio` or `smol` module. This makes it a breaking change as there + is no more a default implementation. See [PR 27](https://github.com/mxinden/if-watch/pull/27). + +## [2.0.0] + +### Changed +- Add `IfWatcher::poll_if_event`. Implement `Stream` instead of `Future` for `IfWatcher`. + See [PR 23] and [PR 25]. +- Make `IfWatcher::new` synchronous. See [PR 24]. + +[PR 23]: https://github.com/mxinden/if-watch/pull/23 +[PR 24]: https://github.com/mxinden/if-watch/pull/24 +[PR 25]: https://github.com/mxinden/if-watch/pull/25 + +## [1.1.1] + +### Fixed +- Update to `rtnetlink` `v0.10`. See [PR 19]. + +[PR 19]: https://github.com/mxinden/if-watch/pull/19 + +## [1.1.0] +### Added +- Return socket closure as error. See [PR 15]. + +### Fixed +- Update to `windows` `v0.34`. See [PR 16]. + +[PR 15]: https://github.com/mxinden/if-watch/pull/15 +[PR 16]: https://github.com/mxinden/if-watch/pull/16 + +## [1.0.0] - 2022-01-12 +### Added +- macos/ios backend + +### Changed +- linux backend rewritten to use rtnetlink +- windows backend rewritten to use windows crate instead of winapi diff --git a/3rd/if-watch/Cargo.toml b/3rd/if-watch/Cargo.toml new file mode 100644 index 00000000..a07d7fdd --- /dev/null +++ b/3rd/if-watch/Cargo.toml @@ -0,0 +1,50 @@ +[package] +name = "if-watch" +version = "3.2.0" +authors = ["David Craven ", "Parity Technologies Limited "] +edition = "2021" +keywords = ["asynchronous", "routing"] +license = "MIT OR Apache-2.0" +description = "crossplatform asynchronous network watcher" +repository = "https://github.com/mxinden/if-watch" + +[lib] +crate-type = ["cdylib", "lib"] + +[features] +default = ["tokio"] +tokio = ["dep:tokio", "rtnetlink/tokio_socket"] +smol = ["dep:smol", "rtnetlink/smol_socket"] + +[dependencies] +fnv = "1.0.7" +futures = "0.3.19" +ipnet = "2.3.1" +log = "0.4.14" + +[target.'cfg(target_os = "linux")'.dependencies] +rtnetlink = { version = "0.10.0", default-features = false } + +[target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies] +core-foundation = "0.9.2" +if-addrs = "0.10.0" +system-configuration = "0.6.0" +tokio = { version = "1.21.2", features = ["rt"], optional = true } +smol = { version = "1.2.5", optional = true } + +[target.'cfg(target_os = "windows")'.dependencies] +if-addrs = "0.10.0" +windows = { version = "0.51.0", features = ["Win32_NetworkManagement_IpHelper", "Win32_Foundation", "Win32_NetworkManagement_Ndis", "Win32_Networking_WinSock"] } + +[target.'cfg(not(any(target_os = "ios", target_os = "linux", target_os = "macos", target_os = "windows")))'.dependencies] +async-io = "2.0.0" +if-addrs = "0.10.0" + +[dev-dependencies] +env_logger = "0.10.0" +smol = "1.2.5" +tokio = { version = "1.21.2", features = ["rt", "macros"] } + +[[example]] +name = "if_watch" +required-features = ["smol"] diff --git a/3rd/if-watch/README.md b/3rd/if-watch/README.md new file mode 100644 index 00000000..cae001ba --- /dev/null +++ b/3rd/if-watch/README.md @@ -0,0 +1,16 @@ +# Cross platform asynchronous network watcher + +```sh +cargo run --example if_watch +Got event Ok(Up(127.0.0.1/8)) +Got event Ok(Up(192.168.6.65/24)) +Got event Ok(Up(::1/128)) +Got event Ok(Up(2a01:8b81:7000:9700:cef9:e4ff:fe9e:b23b/64)) +Got event Ok(Up(fe80::cef9:e4ff:fe9e:b23b/64)) +``` + +Supported platforms at the moment are: +Linux, Windows and Android with a fallback for Macos and ios that polls for changes every 10s. + +## License +MIT OR Apache-2.0 diff --git a/3rd/if-watch/examples/if_watch.rs b/3rd/if-watch/examples/if_watch.rs new file mode 100644 index 00000000..012eed17 --- /dev/null +++ b/3rd/if-watch/examples/if_watch.rs @@ -0,0 +1,13 @@ +use futures::StreamExt; +use if_watch::smol::IfWatcher; + +fn main() { + env_logger::init(); + smol::block_on(async { + let mut set = IfWatcher::new().unwrap(); + loop { + let event = set.select_next_some().await; + println!("Got event {:?}", event); + } + }); +} diff --git a/3rd/if-watch/src/apple.rs b/3rd/if-watch/src/apple.rs new file mode 100644 index 00000000..c3099a42 --- /dev/null +++ b/3rd/if-watch/src/apple.rs @@ -0,0 +1,151 @@ +use crate::{IfEvent, IpNet, Ipv4Net, Ipv6Net}; +use core_foundation::array::CFArray; +use core_foundation::runloop::{kCFRunLoopCommonModes, CFRunLoop}; +use core_foundation::string::CFString; +use fnv::FnvHashSet; +use futures::channel::mpsc; +use futures::stream::{FusedStream, Stream}; +use if_addrs::IfAddr; +use std::collections::VecDeque; +use std::io::Result; +use std::pin::Pin; +use std::task::{Context, Poll}; +use system_configuration::dynamic_store::{ + SCDynamicStore, SCDynamicStoreBuilder, SCDynamicStoreCallBackContext, +}; + +#[cfg(feature = "tokio")] +pub mod tokio { + //! An interface watcher. + //! **On Apple Platforms there is no difference between `tokio` and `smol` features,** + //! **this was done to maintain the api compatible with other platforms**. + + /// Watches for interface changes. + pub type IfWatcher = super::IfWatcher; +} + +#[cfg(feature = "smol")] +pub mod smol { + //! An interface watcher. + //! **On Apple platforms there is no difference between `tokio` and `smol` features,** + //! **this was done to maintain the api compatible with other platforms**. + + /// Watches for interface changes. + pub type IfWatcher = super::IfWatcher; +} + +#[derive(Debug)] +pub struct IfWatcher { + addrs: FnvHashSet, + queue: VecDeque, + rx: mpsc::Receiver<()>, +} + +impl IfWatcher { + pub fn new() -> Result { + let (tx, rx) = mpsc::channel(1); + std::thread::spawn(|| background_task(tx)); + let mut watcher = Self { + addrs: Default::default(), + queue: Default::default(), + rx, + }; + watcher.resync()?; + Ok(watcher) + } + + fn resync(&mut self) -> Result<()> { + let addrs = if_addrs::get_if_addrs()?; + for old_addr in self.addrs.clone() { + if addrs + .iter() + .find(|addr| addr.ip() == old_addr.addr()) + .is_none() + { + self.addrs.remove(&old_addr); + self.queue.push_back(IfEvent::Down(old_addr)); + } + } + for new_addr in addrs { + let ipnet = ifaddr_to_ipnet(new_addr.addr); + if self.addrs.insert(ipnet) { + self.queue.push_back(IfEvent::Up(ipnet)); + } + } + Ok(()) + } + + /// Iterate over current networks. + pub fn iter(&self) -> impl Iterator { + self.addrs.iter() + } + + /// Poll for an address change event. + pub fn poll_if_event(&mut self, cx: &mut Context) -> Poll> { + loop { + if let Some(event) = self.queue.pop_front() { + return Poll::Ready(Ok(event)); + } + if Pin::new(&mut self.rx).poll_next(cx).is_pending() { + return Poll::Pending; + } + if let Err(error) = self.resync() { + return Poll::Ready(Err(error)); + } + } + } +} + +impl Stream for IfWatcher { + type Item = Result; + fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + Pin::into_inner(self).poll_if_event(cx).map(Some) + } +} + +impl FusedStream for IfWatcher { + fn is_terminated(&self) -> bool { + false + } +} + +fn ifaddr_to_ipnet(addr: IfAddr) -> IpNet { + match addr { + IfAddr::V4(ip) => { + let prefix_len = (!u32::from_be_bytes(ip.netmask.octets())).leading_zeros(); + IpNet::V4( + Ipv4Net::new(ip.ip, prefix_len as u8).expect("if_addrs returned a valid prefix"), + ) + } + IfAddr::V6(ip) => { + let prefix_len = (!u128::from_be_bytes(ip.netmask.octets())).leading_zeros(); + IpNet::V6( + Ipv6Net::new(ip.ip, prefix_len as u8).expect("if_addrs returned a valid prefix"), + ) + } + } +} + +fn callback(_store: SCDynamicStore, _changed_keys: CFArray, info: &mut mpsc::Sender<()>) { + match info.try_send(()) { + Err(err) if err.is_disconnected() => CFRunLoop::get_current().stop(), + _ => {} + } +} + +fn background_task(tx: mpsc::Sender<()>) { + let store = SCDynamicStoreBuilder::new("global-network-watcher") + .callback_context(SCDynamicStoreCallBackContext { + callout: callback, + info: tx, + }) + .build(); + store.set_notification_keys( + &CFArray::::from_CFTypes(&[]), + &CFArray::from_CFTypes(&[CFString::new("State:/Network/Interface/.*/IPv.")]), + ); + let source = store.create_run_loop_source(); + let run_loop = CFRunLoop::get_current(); + run_loop.add_source(&source, unsafe { kCFRunLoopCommonModes }); + CFRunLoop::run_current(); +} diff --git a/3rd/if-watch/src/fallback.rs b/3rd/if-watch/src/fallback.rs new file mode 100644 index 00000000..5c6fca6f --- /dev/null +++ b/3rd/if-watch/src/fallback.rs @@ -0,0 +1,116 @@ +use crate::IfEvent; +use async_io::Timer; +use futures::stream::{FusedStream, Stream}; +use if_addrs::IfAddr; +use ipnet::{IpNet, Ipv4Net, Ipv6Net}; +use std::collections::{HashSet, VecDeque}; +use std::io::Result; +use std::pin::Pin; +use std::task::{Context, Poll}; +use std::time::{Duration, Instant}; + +#[cfg(feature = "tokio")] +pub mod tokio { + //! An interface watcher. + //! **On this platform there is no difference between `tokio` and `smol` features,** + //! **this was done to maintain the api compatible with other platforms**. + + /// Watches for interface changes. + pub type IfWatcher = super::IfWatcher; +} + +#[cfg(feature = "smol")] +pub mod smol { + //! An interface watcher. + //! **On this platform there is no difference between `tokio` and `smol` features,** + //! **this was done to maintain the api compatible with other platforms**. + + /// Watches for interface changes. + pub type IfWatcher = super::IfWatcher; +} + +/// An address set/watcher +#[derive(Debug)] +pub struct IfWatcher { + addrs: HashSet, + queue: VecDeque, + ticker: Timer, +} + +impl IfWatcher { + /// Create a watcher. + pub fn new() -> Result { + Ok(Self { + addrs: Default::default(), + queue: Default::default(), + ticker: Timer::interval_at(Instant::now(), Duration::from_secs(10)), + }) + } + + fn resync(&mut self) -> Result<()> { + let addrs = if_addrs::get_if_addrs()?; + for old_addr in self.addrs.clone() { + if !addrs.iter().any(|addr| addr.ip() == old_addr.addr()) { + self.addrs.remove(&old_addr); + self.queue.push_back(IfEvent::Down(old_addr)); + } + } + for new_addr in addrs { + let ipnet = ifaddr_to_ipnet(new_addr.addr); + if self.addrs.insert(ipnet) { + self.queue.push_back(IfEvent::Up(ipnet)); + } + } + Ok(()) + } + + /// Iterate over current networks. + pub fn iter(&self) -> impl Iterator { + self.addrs.iter() + } + + /// Poll for an address change event. + pub fn poll_if_event(&mut self, cx: &mut Context) -> Poll> { + loop { + if let Some(event) = self.queue.pop_front() { + return Poll::Ready(Ok(event)); + } + if Pin::new(&mut self.ticker).poll_next(cx).is_pending() { + return Poll::Pending; + } + if let Err(err) = self.resync() { + return Poll::Ready(Err(err)); + } + } + } +} + +impl Stream for IfWatcher { + type Item = Result; + fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + Pin::into_inner(self).poll_if_event(cx).map(Some) + } +} + +impl FusedStream for IfWatcher { + fn is_terminated(&self) -> bool { + false + } +} + +fn ifaddr_to_ipnet(addr: IfAddr) -> IpNet { + match addr { + IfAddr::V4(ip) => { + let prefix_len = (!u32::from_be_bytes(ip.netmask.octets())).leading_zeros(); + IpNet::V4( + Ipv4Net::new(ip.ip, prefix_len as u8).expect("if_addrs returned a valid prefix"), + ) + } + IfAddr::V6(ip) => { + let prefix_len = (!u128::from_be_bytes(ip.netmask.octets())).leading_zeros(); + IpNet::V6( + Ipv6Net::new(ip.ip, prefix_len as u8).expect("if_addrs returned a valid prefix"), + ) + } + } +} diff --git a/3rd/if-watch/src/lib.rs b/3rd/if-watch/src/lib.rs new file mode 100644 index 00000000..4a352303 --- /dev/null +++ b/3rd/if-watch/src/lib.rs @@ -0,0 +1,120 @@ +//! IP address watching. +#![deny(missing_docs)] +#![deny(warnings)] + +pub use ipnet::{IpNet, Ipv4Net, Ipv6Net}; + +#[cfg(target_os = "macos")] +mod apple; +#[cfg(target_os = "ios")] +mod apple; +#[cfg(not(any( + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "windows", +)))] +mod fallback; +#[cfg(target_os = "linux")] +mod linux; +#[cfg(target_os = "windows")] +mod win; + +#[cfg(any(target_os = "macos", target_os = "ios"))] +#[cfg(feature = "tokio")] +pub use apple::tokio; + +#[cfg(any(target_os = "macos", target_os = "ios"))] +#[cfg(feature = "smol")] +pub use apple::smol; + +#[cfg(feature = "smol")] +#[cfg(not(any( + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "windows", +)))] +pub use fallback::smol; + +#[cfg(feature = "tokio")] +#[cfg(not(any( + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "windows", +)))] +pub use fallback::tokio; + +#[cfg(target_os = "windows")] +#[cfg(feature = "tokio")] +pub use win::tokio; + +#[cfg(target_os = "windows")] +#[cfg(feature = "smol")] +pub use win::smol; + +#[cfg(target_os = "linux")] +#[cfg(feature = "tokio")] +pub use linux::tokio; + +#[cfg(target_os = "linux")] +#[cfg(feature = "smol")] +pub use linux::smol; + +/// An address change event. +#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] +pub enum IfEvent { + /// A new local address has been added. + Up(IpNet), + /// A local address has been deleted. + Down(IpNet), +} + +// #[cfg(test)] +// mod tests { +// use futures::StreamExt; +// use std::pin::Pin; + +// #[test] +// fn test_smol_ip_watch() { +// use super::smol::IfWatcher; + +// smol::block_on(async { +// let mut set = IfWatcher::new().unwrap(); +// let event = set.select_next_some().await.unwrap(); +// println!("Got event {:?}", event); +// }); +// } + +// #[tokio::test] +// async fn test_tokio_ip_watch() { +// use super::tokio::IfWatcher; + +// let mut set = IfWatcher::new().unwrap(); +// let event = set.select_next_some().await.unwrap(); +// println!("Got event {:?}", event); +// } + +// #[test] +// fn test_smol_is_send() { +// use super::smol::IfWatcher; + +// smol::block_on(async { +// fn is_send(_: T) {} +// is_send(IfWatcher::new()); +// is_send(IfWatcher::new().unwrap()); +// is_send(Pin::new(&mut IfWatcher::new().unwrap())); +// }); +// } + +// #[tokio::test] +// async fn test_tokio_is_send() { +// use super::tokio::IfWatcher; + +// fn is_send(_: T) {} +// is_send(IfWatcher::new()); +// is_send(IfWatcher::new().unwrap()); +// is_send(Pin::new(&mut IfWatcher::new().unwrap())); +// } +// } diff --git a/3rd/if-watch/src/linux.rs b/3rd/if-watch/src/linux.rs new file mode 100644 index 00000000..6fa3ab11 --- /dev/null +++ b/3rd/if-watch/src/linux.rs @@ -0,0 +1,174 @@ +use crate::{IfEvent, IpNet, Ipv4Net, Ipv6Net}; +use fnv::FnvHashSet; +use futures::ready; +use futures::stream::{FusedStream, Stream, TryStreamExt}; +use futures::StreamExt; +use rtnetlink::constants::{RTMGRP_IPV4_IFADDR, RTMGRP_IPV6_IFADDR}; +use rtnetlink::packet::address::nlas::Nla; +use rtnetlink::packet::{AddressMessage, RtnlMessage}; +use rtnetlink::proto::{Connection, NetlinkPayload}; +use rtnetlink::sys::{AsyncSocket, SocketAddr}; +use std::collections::VecDeque; +use std::future::Future; +use std::io::{Error, ErrorKind, Result}; +use std::net::{Ipv4Addr, Ipv6Addr}; +use std::pin::Pin; +use std::task::{Context, Poll}; + +#[cfg(feature = "tokio")] +pub mod tokio { + //! An interface watcher that uses `rtnetlink`'s [`TokioSocket`](rtnetlink::sys::TokioSocket) + use rtnetlink::sys::TokioSocket; + + /// Watches for interface changes. + pub type IfWatcher = super::IfWatcher; +} + +#[cfg(feature = "smol")] +pub mod smol { + //! An interface watcher that uses `rtnetlink`'s [`SmolSocket`](rtnetlink::sys::SmolSocket) + use rtnetlink::sys::SmolSocket; + + /// Watches for interface changes. + pub type IfWatcher = super::IfWatcher; +} + +pub struct IfWatcher { + conn: Connection, + messages: Pin> + Send>>, + addrs: FnvHashSet, + queue: VecDeque, +} + +impl std::fmt::Debug for IfWatcher { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.debug_struct("IfWatcher") + .field("addrs", &self.addrs) + .finish_non_exhaustive() + } +} + +impl IfWatcher +where + T: AsyncSocket + Unpin, +{ + /// Create a watcher. + pub fn new() -> Result { + let (mut conn, handle, messages) = rtnetlink::new_connection_with_socket::()?; + let groups = RTMGRP_IPV4_IFADDR | RTMGRP_IPV6_IFADDR; + let addr = SocketAddr::new(0, groups); + conn.socket_mut().socket_mut().bind(&addr)?; + let get_addrs_stream = handle + .address() + .get() + .execute() + .map_ok(RtnlMessage::NewAddress) + .map_err(|err| Error::new(ErrorKind::Other, err)); + let msg_stream = messages.filter_map(|(msg, _)| async { + match msg.payload { + NetlinkPayload::Error(err) => Some(Err(err.to_io())), + NetlinkPayload::InnerMessage(msg) => Some(Ok(msg)), + _ => None, + } + }); + let messages = get_addrs_stream.chain(msg_stream).boxed(); + let addrs = FnvHashSet::default(); + let queue = VecDeque::default(); + Ok(Self { + conn, + messages, + addrs, + queue, + }) + } + + /// Iterate over current networks. + pub fn iter(&self) -> impl Iterator { + self.addrs.iter() + } + + fn add_address(&mut self, msg: AddressMessage) { + for net in iter_nets(msg) { + if self.addrs.insert(net) { + self.queue.push_back(IfEvent::Up(net)); + } + } + } + + fn rem_address(&mut self, msg: AddressMessage) { + for net in iter_nets(msg) { + if self.addrs.remove(&net) { + self.queue.push_back(IfEvent::Down(net)); + } + } + } + + /// Poll for an address change event. + pub fn poll_if_event(&mut self, cx: &mut Context) -> Poll> { + loop { + if let Some(event) = self.queue.pop_front() { + return Poll::Ready(Ok(event)); + } + if Pin::new(&mut self.conn).poll(cx).is_ready() { + return Poll::Ready(Err(socket_err())); + } + let message = ready!(self.messages.poll_next_unpin(cx)).ok_or_else(socket_err)??; + match message { + RtnlMessage::NewAddress(msg) => self.add_address(msg), + RtnlMessage::DelAddress(msg) => self.rem_address(msg), + _ => {} + } + } + } +} + +fn socket_err() -> std::io::Error { + std::io::Error::new(ErrorKind::BrokenPipe, "rtnetlink socket closed") +} + +fn iter_nets(msg: AddressMessage) -> impl Iterator { + let prefix = msg.header.prefix_len; + let family = msg.header.family; + msg.nlas.into_iter().filter_map(move |nla| { + if let Nla::Address(octets) = nla { + match family { + 2 => { + let mut addr = [0; 4]; + addr.copy_from_slice(&octets); + Some(IpNet::V4( + Ipv4Net::new(Ipv4Addr::from(addr), prefix).unwrap(), + )) + } + 10 => { + let mut addr = [0; 16]; + addr.copy_from_slice(&octets); + Some(IpNet::V6( + Ipv6Net::new(Ipv6Addr::from(addr), prefix).unwrap(), + )) + } + _ => None, + } + } else { + None + } + }) +} + +impl Stream for IfWatcher +where + T: AsyncSocket + Unpin, +{ + type Item = Result; + fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + Pin::into_inner(self).poll_if_event(cx).map(Some) + } +} + +impl FusedStream for IfWatcher +where + T: AsyncSocket + AsyncSocket + Unpin, +{ + fn is_terminated(&self) -> bool { + false + } +} diff --git a/3rd/if-watch/src/win.rs b/3rd/if-watch/src/win.rs new file mode 100644 index 00000000..b0a2bce5 --- /dev/null +++ b/3rd/if-watch/src/win.rs @@ -0,0 +1,191 @@ +use crate::{IfEvent, IpNet, Ipv4Net, Ipv6Net}; +use fnv::FnvHashSet; +use futures::stream::{FusedStream, Stream}; +use futures::task::AtomicWaker; +use if_addrs::IfAddr; +use std::collections::VecDeque; +use std::ffi::c_void; +use std::io::{Error, ErrorKind, Result}; +use std::pin::Pin; +use std::sync::atomic::{AtomicBool, Ordering}; +use std::sync::Arc; +use std::task::{Context, Poll}; +use windows::Win32::Foundation::{BOOLEAN, HANDLE}; +use windows::Win32::NetworkManagement::IpHelper::{ + CancelMibChangeNotify2, NotifyIpInterfaceChange, MIB_IPINTERFACE_ROW, MIB_NOTIFICATION_TYPE, +}; +use windows::Win32::Networking::WinSock::AF_UNSPEC; + +#[cfg(feature = "tokio")] +pub mod tokio { + //! An interface watcher. + //! **On Windows there is no difference between `tokio` and `smol` features,** + //! **this was done to maintain the api compatible with other platforms**. + + /// Watches for interface changes. + pub type IfWatcher = super::IfWatcher; +} + +#[cfg(feature = "smol")] +pub mod smol { + //! An interface watcher. + //! **On Windows there is no difference between `tokio` and `smol` features,** + //! **this was done to maintain the api compatible with other platforms**. + + /// Watches for interface changes. + pub type IfWatcher = super::IfWatcher; +} + +/// An address set/watcher +#[derive(Debug)] +pub struct IfWatcher { + addrs: FnvHashSet, + queue: VecDeque, + #[allow(unused)] + notif: IpChangeNotification, + waker: Arc, + resync: Arc, +} + +impl IfWatcher { + /// Create a watcher. + pub fn new() -> Result { + let resync = Arc::new(AtomicBool::new(true)); + let waker = Arc::new(AtomicWaker::new()); + Ok(Self { + addrs: Default::default(), + queue: Default::default(), + waker: waker.clone(), + resync: resync.clone(), + notif: IpChangeNotification::new(Box::new(move |_, _| { + resync.store(true, Ordering::Relaxed); + waker.wake(); + }))?, + }) + } + + fn resync(&mut self) -> Result<()> { + let addrs = if_addrs::get_if_addrs()?; + for old_addr in self.addrs.clone() { + if addrs + .iter() + .find(|addr| addr.ip() == old_addr.addr()) + .is_none() + { + self.addrs.remove(&old_addr); + self.queue.push_back(IfEvent::Down(old_addr)); + } + } + for new_addr in addrs { + let ipnet = ifaddr_to_ipnet(new_addr.addr); + if self.addrs.insert(ipnet) { + self.queue.push_back(IfEvent::Up(ipnet)); + } + } + Ok(()) + } + + /// Iterate over current networks. + pub fn iter(&self) -> impl Iterator { + self.addrs.iter() + } + + /// Poll for an address change event. + pub fn poll_if_event(&mut self, cx: &mut Context) -> Poll> { + loop { + if let Some(event) = self.queue.pop_front() { + return Poll::Ready(Ok(event)); + } + if !self.resync.swap(false, Ordering::Relaxed) { + self.waker.register(cx.waker()); + return Poll::Pending; + } + if let Err(error) = self.resync() { + return Poll::Ready(Err(error)); + } + } + } +} + +impl Stream for IfWatcher { + type Item = Result; + fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + Pin::into_inner(self).poll_if_event(cx).map(Some) + } +} + +impl FusedStream for IfWatcher { + fn is_terminated(&self) -> bool { + false + } +} + +fn ifaddr_to_ipnet(addr: IfAddr) -> IpNet { + match addr { + IfAddr::V4(ip) => { + let prefix_len = (!u32::from_be_bytes(ip.netmask.octets())).leading_zeros(); + IpNet::V4( + Ipv4Net::new(ip.ip, prefix_len as u8).expect("if_addrs returned a valid prefix"), + ) + } + IfAddr::V6(ip) => { + let prefix_len = (!u128::from_be_bytes(ip.netmask.octets())).leading_zeros(); + IpNet::V6( + Ipv6Net::new(ip.ip, prefix_len as u8).expect("if_addrs returned a valid prefix"), + ) + } + } +} + +/// IP change notifications +struct IpChangeNotification { + handle: HANDLE, + callback: *mut IpChangeCallback, +} + +impl std::fmt::Debug for IpChangeNotification { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + write!(f, "IpChangeNotification") + } +} + +type IpChangeCallback = Box; + +impl IpChangeNotification { + /// Register for route change notifications + fn new(cb: IpChangeCallback) -> Result { + unsafe extern "system" fn global_callback( + caller_context: *const c_void, + row: *const MIB_IPINTERFACE_ROW, + notification_type: MIB_NOTIFICATION_TYPE, + ) { + (**(caller_context as *const IpChangeCallback))(&*row, notification_type) + } + let mut handle = HANDLE::default(); + let callback = Box::into_raw(Box::new(cb)); + unsafe { + NotifyIpInterfaceChange( + AF_UNSPEC, + Some(global_callback), + Some(callback as _), + BOOLEAN(0), + &mut handle as _, + ) + .map_err(|err| Error::new(ErrorKind::Other, err.to_string()))?; + } + Ok(Self { callback, handle }) + } +} + +impl Drop for IpChangeNotification { + fn drop(&mut self) { + unsafe { + if let Err(err) = CancelMibChangeNotify2(self.handle) { + log::error!("error deregistering notification: {}", err); + } + drop(Box::from_raw(self.callback)); + } + } +} + +unsafe impl Send for IpChangeNotification {} diff --git a/Cargo.lock b/Cargo.lock index ef39caff..f9971771 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -262,36 +262,180 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "155a5a185e42c6b77ac7b88a15143d930a9e9727a5b7b77eed417404ab15c247" +[[package]] +name = "async-channel" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" +dependencies = [ + "concurrent-queue", + "event-listener 2.5.3", + "futures-core", +] + +[[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-executor" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7ebdfa2ebdab6b1760375fa7d6f382b9f486eac35fc994625a00e89280bdbb7" +dependencies = [ + "async-task", + "concurrent-queue", + "fastrand 2.1.1", + "futures-lite 2.3.0", + "slab", +] + +[[package]] +name = "async-fs" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "279cf904654eeebfa37ac9bb1598880884924aab82e290aa65c9e77a0e142e06" +dependencies = [ + "async-lock 2.8.0", + "autocfg", + "blocking", + "futures-lite 1.13.0", +] + +[[package]] +name = "async-global-executor" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" +dependencies = [ + "async-channel 2.3.1", + "async-executor", + "async-io 2.3.4", + "async-lock 3.4.0", + "blocking", + "futures-lite 2.3.0", + "once_cell", +] + +[[package]] +name = "async-io" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" +dependencies = [ + "async-lock 2.8.0", + "autocfg", + "cfg-if", + "concurrent-queue", + "futures-lite 1.13.0", + "log", + "parking", + "polling 2.8.0", + "rustix 0.37.27", + "slab", + "socket2 0.4.10", + "waker-fn", +] + [[package]] name = "async-io" version = "2.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "444b0228950ee6501b3568d3c93bf1176a1fdbc3b758dcd9475046d30f4dc7e8" dependencies = [ - "async-lock", + "async-lock 3.4.0", "cfg-if", "concurrent-queue", "futures-io", - "futures-lite", + "futures-lite 2.3.0", "parking", - "polling", + "polling 3.7.3", "rustix 0.38.35", "slab", "tracing", "windows-sys 0.59.0", ] +[[package]] +name = "async-lock" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" +dependencies = [ + "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", + "event-listener 5.3.1", "event-listener-strategy", "pin-project-lite", ] +[[package]] +name = "async-net" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0434b1ed18ce1cf5769b8ac540e33f01fa9471058b5e89da9e06f3c882a8c12f" +dependencies = [ + "async-io 1.13.0", + "blocking", + "futures-lite 1.13.0", +] + +[[package]] +name = "async-process" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea6438ba0a08d81529c69b36700fa2f95837bfe3e776ab39cde9c14d9149da88" +dependencies = [ + "async-io 1.13.0", + "async-lock 2.8.0", + "async-signal", + "blocking", + "cfg-if", + "event-listener 3.1.0", + "futures-lite 1.13.0", + "rustix 0.38.35", + "windows-sys 0.48.0", +] + +[[package]] +name = "async-signal" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "637e00349800c0bdf8bfc21ebbc0b6524abea702b0da4168ac00d070d0c0b9f3" +dependencies = [ + "async-io 2.3.4", + "async-lock 3.4.0", + "atomic-waker", + "cfg-if", + "futures-core", + "futures-io", + "rustix 0.38.35", + "signal-hook-registry", + "slab", + "windows-sys 0.59.0", +] + +[[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.81" @@ -316,6 +460,12 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "attohttpc" version = "0.24.1" @@ -494,6 +644,19 @@ dependencies = [ "generic-array", ] +[[package]] +name = "blocking" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" +dependencies = [ + "async-channel 2.3.1", + "async-task", + "futures-io", + "futures-lite 2.3.0", + "piper", +] + [[package]] name = "bs58" version = "0.5.1" @@ -1500,6 +1663,23 @@ dependencies = [ "version_check", ] +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "event-listener" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d93877bcde0eb80ca09131a08d23f0a5c18a620b01db137dba666d18cd9b30c2" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + [[package]] name = "event-listener" version = "5.3.1" @@ -1517,7 +1697,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" dependencies = [ - "event-listener", + "event-listener 5.3.1", "pin-project-lite", ] @@ -1896,6 +2076,15 @@ dependencies = [ "tantivy-common", ] +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + [[package]] name = "fastrand" version = "2.1.1" @@ -2051,13 +2240,31 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +[[package]] +name = "futures-lite" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" +dependencies = [ + "fastrand 1.9.0", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite", + "waker-fn", +] + [[package]] name = "futures-lite" version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" dependencies = [ + "fastrand 2.1.1", "futures-core", + "futures-io", + "parking", "pin-project-lite", ] @@ -2328,7 +2535,7 @@ dependencies = [ "ipnet", "once_cell", "rand 0.8.5", - "socket2", + "socket2 0.5.7", "thiserror", "tinyvec", "tokio", @@ -2504,7 +2711,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2", + "socket2 0.5.7", "tokio", "tower-service", "tracing", @@ -2561,7 +2768,7 @@ dependencies = [ "http-body 1.0.1", "hyper 1.4.1", "pin-project-lite", - "socket2", + "socket2 0.5.7", "tokio", "tower", "tower-service", @@ -2624,17 +2831,17 @@ dependencies = [ [[package]] name = "if-watch" version = "3.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6b0422c86d7ce0e97169cc42e04ae643caf278874a7a3c87b8150a220dc7e1e" dependencies = [ - "async-io", + "async-io 2.3.4", "core-foundation", + "env_logger", "fnv", "futures", "if-addrs", "ipnet", "log", "rtnetlink", + "smol", "system-configuration", "tokio", "windows", @@ -2747,7 +2954,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2", + "socket2 0.5.7", "widestring", "windows-sys 0.48.0", "winreg", @@ -3078,7 +3285,7 @@ dependencies = [ "libp2p-swarm", "rand 0.8.5", "smallvec", - "socket2", + "socket2 0.5.7", "tokio", "tracing", "void", @@ -3182,7 +3389,7 @@ dependencies = [ "rand 0.8.5", "ring 0.17.8", "rustls", - "socket2", + "socket2 0.5.7", "thiserror", "tokio", "tracing", @@ -3238,7 +3445,7 @@ dependencies = [ "libc", "libp2p-core", "libp2p-identity", - "socket2", + "socket2 0.5.7", "tokio", "tracing", ] @@ -3787,6 +3994,7 @@ version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "416060d346fbaf1f23f9512963e3e878f1a78e707cb699ba9215761754244307" dependencies = [ + "async-io 1.13.0", "bytes", "futures", "libc", @@ -4087,6 +4295,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 2.1.1", + "futures-io", +] + [[package]] name = "pkcs8" version = "0.10.2" @@ -4103,6 +4322,22 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +[[package]] +name = "polling" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" +dependencies = [ + "autocfg", + "bitflags 1.3.2", + "cfg-if", + "concurrent-queue", + "libc", + "log", + "pin-project-lite", + "windows-sys 0.48.0", +] + [[package]] name = "polling" version = "3.7.3" @@ -4372,7 +4607,7 @@ dependencies = [ "quinn-udp", "rustc-hash 2.0.0", "rustls", - "socket2", + "socket2 0.5.7", "thiserror", "tokio", "tracing", @@ -4403,7 +4638,7 @@ checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" dependencies = [ "libc", "once_cell", - "socket2", + "socket2 0.5.7", "tracing", "windows-sys 0.52.0", ] @@ -4693,6 +4928,7 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "322c53fd76a18698f1c27381d58091de3a043d356aa5bd0d510608b565f469a0" dependencies = [ + "async-global-executor", "futures", "log", "netlink-packet-route", @@ -5039,6 +5275,15 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +[[package]] +name = "signal-hook-registry" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +dependencies = [ + "libc", +] + [[package]] name = "signature" version = "2.2.0" @@ -5084,6 +5329,23 @@ version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +[[package]] +name = "smol" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13f2b548cd8447f8de0fdf1c592929f70f4fc7039a05e47404b0d096ec6987a1" +dependencies = [ + "async-channel 1.9.0", + "async-executor", + "async-fs", + "async-io 1.13.0", + "async-lock 2.8.0", + "async-net", + "async-process", + "blocking", + "futures-lite 1.13.0", +] + [[package]] name = "snow" version = "0.9.6" @@ -5101,6 +5363,16 @@ dependencies = [ "subtle", ] +[[package]] +name = "socket2" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "socket2" version = "0.5.7" @@ -5235,18 +5507,20 @@ dependencies = [ [[package]] name = "system-configuration" -version = "0.5.1" -source = "git+https://github.com/tmpfs/system-configuration-rs?rev=572913bf0c74ed996b2beeac3d61ed681075cbd4#572913bf0c74ed996b2beeac3d61ed681075cbd4" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", "core-foundation", "system-configuration-sys", ] [[package]] name = "system-configuration-sys" -version = "0.5.0" -source = "git+https://github.com/tmpfs/system-configuration-rs?rev=572913bf0c74ed996b2beeac3d61ed681075cbd4#572913bf0c74ed996b2beeac3d61ed681075cbd4" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" dependencies = [ "core-foundation-sys", "libc", @@ -5371,7 +5645,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" dependencies = [ "cfg-if", - "fastrand", + "fastrand 2.1.1", "once_cell", "rustix 0.38.35", "windows-sys 0.59.0", @@ -5491,7 +5765,7 @@ dependencies = [ "libc", "mio", "pin-project-lite", - "socket2", + "socket2 0.5.7", "tokio-macros", "windows-sys 0.52.0", ] @@ -5784,6 +6058,12 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" +[[package]] +name = "waker-fn" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7" + [[package]] name = "walkdir" version = "2.5.0" diff --git a/Cargo.toml b/Cargo.toml index c6e0ac03..c9eabb5b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,11 @@ [package] authors = ["Andre-Philippe Paquet "] -categories = ["database-implementations", "command-line-interface", "wasm", "web-programming"] +categories = [ + "database-implementations", + "command-line-interface", + "wasm", + "web-programming", +] description = "Distributed applications framework" edition = "2021" exclude = ["examples", "tools"] @@ -11,18 +16,17 @@ repository = "https://github.com/appaquet/exocore" version = "0.1.25" [features] -default = [ - "apps-sdk", - "client", - "logger", - "web", -] +default = ["apps-sdk", "client", "logger", "web"] # Top level features apps-sdk = ["exocore-apps-sdk", "exocore-store", "protos"] client = ["core-runtime", "transport-p2p", "store-remote", "protos", "anyhow"] logger = ["core-logger"] -tests-utils = ["exocore-core/tests-utils", "exocore-transport/tests-utils", "exocore-store/tests-utils"] +tests-utils = [ + "exocore-core/tests-utils", + "exocore-transport/tests-utils", + "exocore-store/tests-utils", +] web = ["transport-p2p-web", "protos", "exocore-core/web"] # Underlying crates features @@ -41,22 +45,22 @@ transport-p2p-web = ["exocore-transport/p2p-web"] [dependencies] anyhow = { version = "1.0.86", optional = true } -exocore-apps-sdk = {version = "0.1.25", path = "./apps/sdk", default-features = false, optional = true} -exocore-chain = {version = "0.1.25", path = "./chain", default-features = false, optional = true} -exocore-core = {version = "0.1.25", path = "./core", default-features = false, optional = true} -exocore-discovery = {version = "0.1.25", path = "./discovery", default-features = false, optional = true} -exocore-protos = {version = "0.1.25", path = "./protos", default-features = false, optional = true} -exocore-store = {version = "0.1.25", path = "./store", default-features = false, optional = true} -exocore-transport = {version = "0.1.25", path = "./transport", default-features = false, optional = true} +exocore-apps-sdk = { version = "0.1.25", path = "./apps/sdk", default-features = false, optional = true } +exocore-chain = { version = "0.1.25", path = "./chain", default-features = false, optional = true } +exocore-core = { version = "0.1.25", path = "./core", default-features = false, optional = true } +exocore-discovery = { version = "0.1.25", path = "./discovery", default-features = false, optional = true } +exocore-protos = { version = "0.1.25", path = "./protos", default-features = false, optional = true } +exocore-store = { version = "0.1.25", path = "./store", default-features = false, optional = true } +exocore-transport = { version = "0.1.25", path = "./transport", default-features = false, optional = true } log = "0.4.22" [dev-dependencies] -exocore-core = {version = "0.1.25", path = "./core", features = ["tests-utils"]} +exocore-core = { version = "0.1.25", path = "./core", features = [ + "tests-utils", +] } [workspace] -exclude = [ - "3rd", -] +exclude = ["3rd"] members = [ "core", "protos", @@ -72,6 +76,7 @@ members = [ "clients/web", "clients/android", "clients/c", + "3rd/if-watch", ] [profile.production] @@ -84,4 +89,5 @@ debug = true [patch.crates-io] # See https://github.com/mullvad/system-configuration-rs/issues/41 -system-configuration = { git = "https://github.com/tmpfs/system-configuration-rs", rev = "572913bf0c74ed996b2beeac3d61ed681075cbd4"} +# system-configuration = { git = "https://github.com/tmpfs/system-configuration-rs", rev = "572913bf0c74ed996b2beeac3d61ed681075cbd4"} +if-watch = { path = "./3rd/if-watch" } From 4aa50d85c0121e9b08c45e43eb6be1f829b3af67 Mon Sep 17 00:00:00 2001 From: Andre-Philippe Paquet Date: Sat, 31 Aug 2024 14:19:07 -0400 Subject: [PATCH 4/4] revert lip2p --- Cargo.lock | 134 +++++++++++++++++++-------------- Cargo.toml | 3 +- README.md | 2 +- core/Cargo.toml | 2 +- transport/Cargo.toml | 4 +- transport/src/p2p/behaviour.rs | 3 +- 6 files changed, 83 insertions(+), 65 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f9971771..1dce7efc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -447,6 +447,19 @@ dependencies = [ "syn 2.0.77", ] +[[package]] +name = "asynchronous-codec" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4057f2c32adbb2fc158e22fb38433c8e9bbf76b75a4732c7c0cbaf695fb65568" +dependencies = [ + "bytes", + "futures-sink", + "futures-util", + "memchr", + "pin-project-lite", +] + [[package]] name = "asynchronous-codec" version = "0.7.0" @@ -521,6 +534,12 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +[[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" @@ -3095,15 +3114,16 @@ checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" [[package]] name = "libp2p" -version = "0.54.1" +version = "0.53.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbbe80f9c7e00526cd6b838075b9c171919404a4732cb2fa8ece0a093223bfc4" +checksum = "681fb3f183edfbedd7a57d32ebe5dcdc0b9f94061185acf3c30249349cc6fc99" dependencies = [ "bytes", "either", "futures", "futures-timer", "getrandom 0.2.15", + "instant", "libp2p-allow-block-list", "libp2p-connection-limits", "libp2p-core", @@ -3130,9 +3150,9 @@ dependencies = [ [[package]] name = "libp2p-allow-block-list" -version = "0.4.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1027ccf8d70320ed77e984f273bc8ce952f623762cb9bf2d126df73caef8041" +checksum = "107b238b794cb83ab53b74ad5dcf7cca3200899b72fe662840cfb52f5b0a32e6" dependencies = [ "libp2p-core", "libp2p-identity", @@ -3142,9 +3162,9 @@ dependencies = [ [[package]] name = "libp2p-connection-limits" -version = "0.4.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d003540ee8baef0d254f7b6bfd79bac3ddf774662ca0abf69186d517ef82ad8" +checksum = "c7cd50a78ccfada14de94cbacd3ce4b0138157f376870f13d3a8422cd075b4fd" dependencies = [ "libp2p-core", "libp2p-identity", @@ -3154,9 +3174,9 @@ dependencies = [ [[package]] name = "libp2p-core" -version = "0.42.0" +version = "0.41.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a61f26c83ed111104cd820fe9bc3aaabbac5f1652a1d213ed6e900b7918a1298" +checksum = "a5a8920cbd8540059a01950c1e5c96ea8d89eb50c51cd366fc18bdf540a6e48f" dependencies = [ "either", "fnv", @@ -3182,9 +3202,9 @@ dependencies = [ [[package]] name = "libp2p-dns" -version = "0.42.0" +version = "0.41.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97f37f30d5c7275db282ecd86e54f29dd2176bd3ac656f06abf43bedb21eb8bd" +checksum = "d17cbcf7160ff35c3e8e560de4a068fe9d6cb777ea72840e48eb76ff9576c4b6" dependencies = [ "async-trait", "futures", @@ -3198,12 +3218,12 @@ dependencies = [ [[package]] name = "libp2p-gossipsub" -version = "0.47.0" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4e830fdf24ac8c444c12415903174d506e1e077fbe3875c404a78c5935a8543" +checksum = "d665144a616dadebdc5fff186b1233488cdcd8bfb1223218ff084b6d052c94f7" dependencies = [ - "asynchronous-codec", - "base64 0.22.1", + "asynchronous-codec 0.7.0", + "base64 0.21.7", "byteorder", "bytes", "either", @@ -3212,6 +3232,7 @@ dependencies = [ "futures-ticker", "getrandom 0.2.15", "hex_fmt", + "instant", "libp2p-core", "libp2p-identity", "libp2p-swarm", @@ -3224,16 +3245,15 @@ dependencies = [ "smallvec", "tracing", "void", - "web-time", ] [[package]] name = "libp2p-identify" -version = "0.45.0" +version = "0.44.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1711b004a273be4f30202778856368683bd9a83c4c7dcc8f848847606831a4e3" +checksum = "b5d635ebea5ca0c3c3e77d414ae9b67eccf2a822be06091b9c1a0d13029a1e2f" dependencies = [ - "asynchronous-codec", + "asynchronous-codec 0.7.0", "either", "futures", "futures-bounded", @@ -3272,9 +3292,9 @@ dependencies = [ [[package]] name = "libp2p-mdns" -version = "0.46.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14b8546b6644032565eb29046b42744aee1e9f261ed99671b2c93fb140dba417" +checksum = "49007d9a339b3e1d7eeebc4d67c05dbf23d300b7d091193ec2d3f26802d7faf2" dependencies = [ "data-encoding", "futures", @@ -3293,11 +3313,12 @@ dependencies = [ [[package]] name = "libp2p-metrics" -version = "0.15.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ebafa94a717c8442d8db8d3ae5d1c6a15e30f2d347e0cd31d057ca72e42566" +checksum = "fdac91ae4f291046a3b2660c039a2830c931f84df2ee227989af92f7692d3357" dependencies = [ "futures", + "instant", "libp2p-core", "libp2p-identify", "libp2p-identity", @@ -3305,16 +3326,15 @@ dependencies = [ "libp2p-swarm", "pin-project", "prometheus-client", - "web-time", ] [[package]] name = "libp2p-mplex" -version = "0.42.0" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41187ab8f6c835ad864edf94224f666f636ee2d270601422c1441f739e0abccc" +checksum = "a5e895765e27e30217b25f7cb7ac4686dad1ff80bf2fdeffd1d898566900a924" dependencies = [ - "asynchronous-codec", + "asynchronous-codec 0.6.2", "bytes", "futures", "libp2p-core", @@ -3324,16 +3344,16 @@ dependencies = [ "rand 0.8.5", "smallvec", "tracing", - "unsigned-varint 0.8.0", + "unsigned-varint 0.7.2", ] [[package]] name = "libp2p-noise" -version = "0.45.0" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36b137cb1ae86ee39f8e5d6245a296518912014eaa87427d24e6ff58cfc1b28c" +checksum = "8ecd0545ce077f6ea5434bcb76e8d0fe942693b4380aaad0d34a358c2bd05793" dependencies = [ - "asynchronous-codec", + "asynchronous-codec 0.7.0", "bytes", "curve25519-dalek", "futures", @@ -3355,27 +3375,27 @@ dependencies = [ [[package]] name = "libp2p-ping" -version = "0.45.0" +version = "0.44.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "005a34420359223b974ee344457095f027e51346e992d1e0dcd35173f4cdd422" +checksum = "a1de5a6cf64fba7f7e8f2102711c9c6c043a8e56b86db8cd306492c517da3fb3" dependencies = [ "either", "futures", "futures-timer", + "instant", "libp2p-core", "libp2p-identity", "libp2p-swarm", "rand 0.8.5", "tracing", "void", - "web-time", ] [[package]] name = "libp2p-quic" -version = "0.11.1" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46352ac5cd040c70e88e7ff8257a2ae2f891a4076abad2c439584a31c15fd24e" +checksum = "c67296ad4e092e23f92aea3d2bdb6f24eab79c0929ed816dfb460ea2f4567d2b" dependencies = [ "bytes", "futures", @@ -3397,15 +3417,16 @@ dependencies = [ [[package]] name = "libp2p-swarm" -version = "0.45.1" +version = "0.44.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7dd6741793d2c1fb2088f67f82cf07261f25272ebe3c0b0c311e0c6b50e851a" +checksum = "80cae6cb75f89dbca53862f9ebe0b9f463aa7b302762fcfaafb9e51dcc9b0f7e" dependencies = [ "either", "fnv", "futures", "futures-timer", "getrandom 0.2.15", + "instant", "libp2p-core", "libp2p-identity", "libp2p-swarm-derive", @@ -3418,14 +3439,13 @@ dependencies = [ "tracing", "void", "wasm-bindgen-futures", - "web-time", ] [[package]] name = "libp2p-swarm-derive" -version = "0.35.0" +version = "0.34.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "206e0aa0ebe004d778d79fb0966aa0de996c19894e2c0605ba2f8524dd4443d8" +checksum = "5daceb9dd908417b6dfcfe8e94098bc4aac54500c282e78120b885dadc09b999" dependencies = [ "heck 0.5.0", "proc-macro2", @@ -3435,9 +3455,9 @@ dependencies = [ [[package]] name = "libp2p-tcp" -version = "0.42.0" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad964f312c59dcfcac840acd8c555de8403e295d39edf96f5240048b5fcaa314" +checksum = "8b2460fc2748919adff99ecbc1aab296e4579e41f374fb164149bd2c9e529d4c" dependencies = [ "futures", "futures-timer", @@ -3452,9 +3472,9 @@ dependencies = [ [[package]] name = "libp2p-tls" -version = "0.5.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47b23dddc2b9c355f73c1e36eb0c3ae86f7dc964a3715f0731cfad352db4d847" +checksum = "72b7b831e55ce2aa6c354e6861a85fdd4dd0a2b97d5e276fabac0e4810a71776" dependencies = [ "futures", "futures-rustls", @@ -3471,9 +3491,9 @@ dependencies = [ [[package]] name = "libp2p-upnp" -version = "0.3.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01bf2d1b772bd3abca049214a3304615e6a36fa6ffc742bdd1ba774486200b8f" +checksum = "cccf04b0e3ff3de52d07d5fd6c3b061d0e7f908ffc683c32d9638caedce86fc8" dependencies = [ "futures", "futures-timer", @@ -3487,9 +3507,9 @@ dependencies = [ [[package]] name = "libp2p-websocket" -version = "0.44.0" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "888b2ff2e5d8dcef97283daab35ad1043d18952b65e05279eecbe02af4c6e347" +checksum = "85b953b6803a1f3161a989538974d72511c4e48a4af355337b6fb90723c56c05" dependencies = [ "either", "futures", @@ -3508,9 +3528,9 @@ dependencies = [ [[package]] name = "libp2p-websocket-websys" -version = "0.4.0" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38cf9b429dd07be52cd82c4c484b1694df4209210a7db3b9ffb00c7606e230c8" +checksum = "f95cd8a32fcf94ad1e5c2de37c2a05a5a4188d8358b005859a0fc9e63b6953bc" dependencies = [ "bytes", "futures", @@ -3526,9 +3546,9 @@ dependencies = [ [[package]] name = "libp2p-yamux" -version = "0.46.0" +version = "0.45.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "788b61c80789dba9760d8c669a5bedb642c8267555c803fabd8396e4ca5c5882" +checksum = "ddd5265f6b80f94d48a3963541aad183cc598a645755d2f1805a373e41e0716b" dependencies = [ "either", "futures", @@ -4587,7 +4607,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "15a0580ab32b169745d7a39db2ba969226ca16738931be152a3209b409de2474" dependencies = [ - "asynchronous-codec", + "asynchronous-codec 0.7.0", "bytes", "quick-protobuf", "thiserror", @@ -5983,16 +6003,16 @@ name = "unsigned-varint" version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6889a77d49f1f013504cec6bf97a2c730394adedaeb1deb5ea08949a50541105" +dependencies = [ + "asynchronous-codec 0.6.2", + "bytes", +] [[package]] name = "unsigned-varint" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb066959b24b5196ae73cb057f45598450d2c5f71460e98c49b738086eff9c06" -dependencies = [ - "asynchronous-codec", - "bytes", -] [[package]] name = "untrusted" diff --git a/Cargo.toml b/Cargo.toml index c9eabb5b..a18e5bf6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -88,6 +88,5 @@ lto = "thin" debug = true [patch.crates-io] -# See https://github.com/mullvad/system-configuration-rs/issues/41 -# system-configuration = { git = "https://github.com/tmpfs/system-configuration-rs", rev = "572913bf0c74ed996b2beeac3d61ed681075cbd4"} +# Unmaintained... Will have to get rid of libp2p anyway if-watch = { path = "./3rd/if-watch" } diff --git a/README.md b/README.md index c0636d27..bf86de36 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Exocore [![codecov](https://codecov.io/gh/appaquet/exocore/branch/master/graph/badge.svg?token=OKZAHfPlaP)](https://codecov.io/gh/appaquet/exocore) -![Build](https://github.com/appaquet/exocore/workflows/Push%20tester/badge.svg) +[![Build](https://github.com/appaquet/exocore/actions/workflows/push-tester.yml/badge.svg)](https://github.com/appaquet/exocore/actions/workflows/push-tester.yml) **Warning: Exocore is at a very early development stage, hence incomplete, unstable, and probably totally unsafe. Use at your own risk.** diff --git a/core/Cargo.toml b/core/Cargo.toml index c886a14e..ca09695c 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -35,7 +35,7 @@ bytes = "1.7.1" chrono = "0.4.38" exocore-protos = {version = "0.1.25", path = "../protos"} futures = { version = "0.3.30", features = ["async-await"] } -libp2p = { version = "0.54.1", features = ["noise", "secp256k1"], default-features = false } +libp2p = { version = "0.53.2", features = ["noise", "secp256k1"], default-features = false } libp2p-identity = { version = "0.2.9", features = ["secp256k1", "ed25519"], default-features = false } log = "0.4.22" log4rs = { version = "1.3.0", optional = true } diff --git a/transport/Cargo.toml b/transport/Cargo.toml index c9ef7ede..20c0d3f0 100644 --- a/transport/Cargo.toml +++ b/transport/Cargo.toml @@ -25,9 +25,9 @@ exocore-core = {version = "0.1.25", path = "../core"} exocore-protos = {version = "0.1.25", path = "../protos"} futures = "0.3.30" hyper = {version = "0.14.30", features = ["full"], optional = true} -libp2p = {version = "0.54.1", optional = true, default-features = false, features = ["noise", "websocket", "yamux", "ping", "identify", "macros", "tokio", "dns"]} +libp2p = {version = "0.53.2", optional = true, default-features = false, features = ["noise", "websocket", "yamux", "ping", "identify", "macros", "tokio", "dns"]} libp2p-identity = { version = "0.2.9", features = ["secp256k1", "ed25519"], default-features = false } -libp2p-mplex = {version = "0.42.0", optional = true} +libp2p-mplex = {version = "0.41.0", optional = true} log = "0.4.22" pin-project = "1.1.5" thiserror = "1.0.63" diff --git a/transport/src/p2p/behaviour.rs b/transport/src/p2p/behaviour.rs index 5b76f116..d554c18c 100644 --- a/transport/src/p2p/behaviour.rs +++ b/transport/src/p2p/behaviour.rs @@ -6,7 +6,7 @@ use std::{ use exocore_core::{cell::Node, time::Instant}; use futures::task::{Context, Poll}; use libp2p::{ - core::{transport::PortUse, Multiaddr}, + core::Multiaddr, swarm::{ dial_opts::{DialOpts, PeerCondition}, CloseConnection, ConnectionId, FromSwarm, NetworkBehaviour, NotifyHandler, THandler, @@ -243,7 +243,6 @@ impl NetworkBehaviour for ExocoreBehaviour { peer: PeerId, _addr: &Multiaddr, _role_override: libp2p::core::Endpoint, - _port_use: PortUse, ) -> Result, libp2p::swarm::ConnectionDenied> { self.mark_peer_connected(&peer); Ok(ExocoreProtoHandler::default())