From 732a58a0afdcb98e861d161e463b971b10ad0ce9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=B3=CE=BB?= Date: Thu, 28 Nov 2024 14:31:36 +0700 Subject: [PATCH] Feat: Initial Kad node setup (#184) * feat: remove rendevous + add initial kad setup * Fix up whitespace * Comment out unused constants * Use mdns and kademlia to get integration test working * Remove tcp as tests pass * Add test for networking layer * Add net test * Revert folder rename * Add comment * Formatting * Remove expect * Remove constants * Formatting * Test docs * Plumb config to dial peers * Fix formating * Extract matching function * Refactor NetworkPeer * Rename file * Rename P2p -> NetworkRelay * Rename p2p -> net * Formatting * Remove expect * Remove expect * Don't use privelaged * Tidy code * Use multistage to reduce test image size (#187) --------- Co-authored-by: chad Co-authored-by: Hamza Khalid <36852564+hmzakhalid@users.noreply.github.com> --- packages/ciphernode/.dockerignore | 30 + packages/ciphernode/Cargo.lock | 548 +-- packages/ciphernode/Cargo.toml | 13 +- packages/ciphernode/config/src/app_config.rs | 8 + packages/ciphernode/core/src/eventbus.rs | 2 +- packages/ciphernode/enclave_node/Cargo.toml | 2 +- .../ciphernode/enclave_node/src/aggregator.rs | 8 +- .../ciphernode/enclave_node/src/ciphernode.rs | 6 +- .../ciphernode/enclave_node/src/shutdown.rs | 5 +- packages/ciphernode/{p2p => net}/Cargo.toml | 13 +- packages/ciphernode/net/src/bin/p2p_test.rs | 119 + packages/ciphernode/net/src/lib.rs | 8 + packages/ciphernode/net/src/network_peer.rs | 218 + .../src/p2p.rs => net/src/network_relay.rs} | 68 +- packages/ciphernode/net/tests/Dockerfile | 20 + .../ciphernode/net/tests/docker-compose.yaml | 55 + packages/ciphernode/net/tests/entrypoint.sh | 11 + packages/ciphernode/net/tests/run.sh | 20 + packages/ciphernode/p2p/src/lib.rs | 9 - packages/ciphernode/p2p/src/libp2p_router.rs | 168 - packages/ciphernode/rendezvous/Cargo.lock | 3958 ----------------- packages/ciphernode/rendezvous/Cargo.toml | 30 - .../ciphernode/rendezvous/src/bin/discover.rs | 110 - .../rendezvous/src/bin/discovery.rs | 110 - .../ciphernode/rendezvous/src/bin/identify.rs | 122 - .../ciphernode/rendezvous/src/bin/register.rs | 115 - packages/ciphernode/rendezvous/src/main.rs | 84 - packages/ciphernode/tests/Cargo.toml | 2 +- .../tests/test_aggregation_and_decryption.rs | 10 +- tests/basic_integration/README.md | 21 + tests/basic_integration/fns.sh | 2 + tests/basic_integration/net.sh | 5 + tests/basic_integration/test.sh | 1 + 33 files changed, 693 insertions(+), 5208 deletions(-) create mode 100644 packages/ciphernode/.dockerignore rename packages/ciphernode/{p2p => net}/Cargo.toml (93%) create mode 100644 packages/ciphernode/net/src/bin/p2p_test.rs create mode 100644 packages/ciphernode/net/src/lib.rs create mode 100644 packages/ciphernode/net/src/network_peer.rs rename packages/ciphernode/{p2p/src/p2p.rs => net/src/network_relay.rs} (65%) create mode 100644 packages/ciphernode/net/tests/Dockerfile create mode 100644 packages/ciphernode/net/tests/docker-compose.yaml create mode 100755 packages/ciphernode/net/tests/entrypoint.sh create mode 100755 packages/ciphernode/net/tests/run.sh delete mode 100644 packages/ciphernode/p2p/src/lib.rs delete mode 100644 packages/ciphernode/p2p/src/libp2p_router.rs delete mode 100644 packages/ciphernode/rendezvous/Cargo.lock delete mode 100644 packages/ciphernode/rendezvous/Cargo.toml delete mode 100644 packages/ciphernode/rendezvous/src/bin/discover.rs delete mode 100644 packages/ciphernode/rendezvous/src/bin/discovery.rs delete mode 100644 packages/ciphernode/rendezvous/src/bin/identify.rs delete mode 100644 packages/ciphernode/rendezvous/src/bin/register.rs delete mode 100644 packages/ciphernode/rendezvous/src/main.rs create mode 100644 tests/basic_integration/README.md create mode 100755 tests/basic_integration/net.sh diff --git a/packages/ciphernode/.dockerignore b/packages/ciphernode/.dockerignore new file mode 100644 index 00000000..7d50aa6c --- /dev/null +++ b/packages/ciphernode/.dockerignore @@ -0,0 +1,30 @@ +# First ignore everything +* +**/* + +# Then allow cargo workspace files +!Cargo.toml +!Cargo.lock + +# Allow core crate +!core/ +!core/Cargo.toml +!core/src/**/*.rs + +# net +!net/ +!net/Cargo.toml +!net/src/**/*.rs + + +# Allow all other workspace members (adjust paths as needed) +!*/Cargo.toml +!*/src/**/*.rs + +# Explicitly ignore build artifacts everywhere +**/target/ +**/.git/ +**/.gitignore +**/.DS_Store +**/tests/tmp/ +**/*.log diff --git a/packages/ciphernode/Cargo.lock b/packages/ciphernode/Cargo.lock index f4882352..c8f87742 100644 --- a/packages/ciphernode/Cargo.lock +++ b/packages/ciphernode/Cargo.lock @@ -756,7 +756,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be77579633ebbc1266ae6fd7694f75c408beb1aeb6865d0b18f22893c265a061" dependencies = [ "alloy-json-rpc", - "base64 0.22.1", + "base64", "futures-util", "futures-utils-wasm", "serde", @@ -1334,19 +1334,6 @@ dependencies = [ "rustc_version 0.4.0", ] -[[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" @@ -1430,12 +1417,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" -[[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" @@ -1625,30 +1606,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "chacha20" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818" -dependencies = [ - "cfg-if", - "cipher 0.4.4", - "cpufeatures", -] - -[[package]] -name = "chacha20poly1305" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10cd79432192d1c0f4e1a0fef9527696cc039165d729fb41b3f4f4f354c2dc35" -dependencies = [ - "aead", - "chacha20", - "cipher 0.4.4", - "poly1305", - "zeroize", -] - [[package]] name = "cipher" version = "0.1.0" @@ -1671,7 +1628,6 @@ checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" dependencies = [ "crypto-common", "inout", - "zeroize", ] [[package]] @@ -2257,7 +2213,7 @@ dependencies = [ "fhe 0.1.0", "keyshare", "logger", - "p2p", + "net", "rand", "rand_chacha", "router", @@ -3415,33 +3371,30 @@ checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[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", - "instant", "libp2p-allow-block-list", "libp2p-connection-limits", - "libp2p-core 0.41.3", + "libp2p-core", "libp2p-dns", - "libp2p-gossipsub 0.46.1", - "libp2p-identify 0.44.2", + "libp2p-gossipsub", + "libp2p-identify", "libp2p-identity", + "libp2p-kad", "libp2p-mdns", "libp2p-metrics", - "libp2p-noise", - "libp2p-ping 0.44.1", + "libp2p-ping", "libp2p-quic", - "libp2p-rendezvous", - "libp2p-swarm 0.44.2", + "libp2p-swarm", "libp2p-tcp", "libp2p-upnp", - "libp2p-yamux", "multiaddr", "pin-project", "rw-stream-sink", @@ -3450,54 +3403,26 @@ 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 0.41.3", + "libp2p-core", "libp2p-identity", - "libp2p-swarm 0.44.2", + "libp2p-swarm", "void", ] [[package]] name = "libp2p-connection-limits" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7cd50a78ccfada14de94cbacd3ce4b0138157f376870f13d3a8422cd075b4fd" -dependencies = [ - "libp2p-core 0.41.3", - "libp2p-identity", - "libp2p-swarm 0.44.2", - "void", -] - -[[package]] -name = "libp2p-core" -version = "0.41.3" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5a8920cbd8540059a01950c1e5c96ea8d89eb50c51cd366fc18bdf540a6e48f" +checksum = "8d003540ee8baef0d254f7b6bfd79bac3ddf774662ca0abf69186d517ef82ad8" dependencies = [ - "either", - "fnv", - "futures", - "futures-timer", + "libp2p-core", "libp2p-identity", - "multiaddr", - "multihash", - "multistream-select", - "once_cell", - "parking_lot 0.12.3", - "pin-project", - "quick-protobuf", - "rand", - "rw-stream-sink", - "smallvec", - "thiserror", - "tracing", - "unsigned-varint 0.8.0", + "libp2p-swarm", "void", - "web-time", ] [[package]] @@ -3530,60 +3455,29 @@ 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-std-resolver", "async-trait", "futures", "hickory-resolver", - "libp2p-core 0.41.3", + "libp2p-core", "libp2p-identity", "parking_lot 0.12.3", "smallvec", "tracing", ] -[[package]] -name = "libp2p-gossipsub" -version = "0.46.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d665144a616dadebdc5fff186b1233488cdcd8bfb1223218ff084b6d052c94f7" -dependencies = [ - "asynchronous-codec 0.7.0", - "base64 0.21.7", - "byteorder", - "bytes", - "either", - "fnv", - "futures", - "futures-ticker", - "getrandom", - "hex_fmt", - "instant", - "libp2p-core 0.41.3", - "libp2p-identity", - "libp2p-swarm 0.44.2", - "prometheus-client", - "quick-protobuf", - "quick-protobuf-codec 0.3.1", - "rand", - "regex", - "sha2", - "smallvec", - "tracing", - "void", -] - [[package]] name = "libp2p-gossipsub" version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4e830fdf24ac8c444c12415903174d506e1e077fbe3875c404a78c5935a8543" dependencies = [ - "asynchronous-codec 0.7.0", - "base64 0.22.1", + "asynchronous-codec", + "base64", "byteorder", "bytes", "either", @@ -3592,12 +3486,12 @@ dependencies = [ "futures-ticker", "getrandom", "hex_fmt", - "libp2p-core 0.42.0", + "libp2p-core", "libp2p-identity", - "libp2p-swarm 0.45.1", + "libp2p-swarm", "prometheus-client", "quick-protobuf", - "quick-protobuf-codec 0.3.1", + "quick-protobuf-codec", "rand", "regex", "sha2", @@ -3607,46 +3501,23 @@ dependencies = [ "web-time", ] -[[package]] -name = "libp2p-identify" -version = "0.44.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5d635ebea5ca0c3c3e77d414ae9b67eccf2a822be06091b9c1a0d13029a1e2f" -dependencies = [ - "asynchronous-codec 0.7.0", - "either", - "futures", - "futures-bounded", - "futures-timer", - "libp2p-core 0.41.3", - "libp2p-identity", - "libp2p-swarm 0.44.2", - "lru", - "quick-protobuf", - "quick-protobuf-codec 0.3.1", - "smallvec", - "thiserror", - "tracing", - "void", -] - [[package]] name = "libp2p-identify" version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1711b004a273be4f30202778856368683bd9a83c4c7dcc8f848847606831a4e3" dependencies = [ - "asynchronous-codec 0.7.0", + "asynchronous-codec", "either", "futures", "futures-bounded", "futures-timer", - "libp2p-core 0.42.0", + "libp2p-core", "libp2p-identity", - "libp2p-swarm 0.45.1", + "libp2p-swarm", "lru", "quick-protobuf", - "quick-protobuf-codec 0.3.1", + "quick-protobuf-codec", "smallvec", "thiserror", "tracing", @@ -3671,11 +3542,40 @@ dependencies = [ "zeroize", ] +[[package]] +name = "libp2p-kad" +version = "0.46.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced237d0bd84bbebb7c2cad4c073160dacb4fe40534963c32ed6d4c6bb7702a3" +dependencies = [ + "arrayvec", + "asynchronous-codec", + "bytes", + "either", + "fnv", + "futures", + "futures-bounded", + "futures-timer", + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", + "quick-protobuf", + "quick-protobuf-codec", + "rand", + "sha2", + "smallvec", + "thiserror", + "tracing", + "uint", + "void", + "web-time", +] + [[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 = [ "async-io 2.3.3", "async-std", @@ -3683,9 +3583,9 @@ dependencies = [ "futures", "hickory-proto", "if-watch", - "libp2p-core 0.41.3", + "libp2p-core", "libp2p-identity", - "libp2p-swarm 0.44.2", + "libp2p-swarm", "rand", "smallvec", "socket2 0.5.7", @@ -3696,66 +3596,23 @@ dependencies = [ [[package]] name = "libp2p-metrics" -version = "0.14.2" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a70afa7692c81ee03e89c40d1e8638d634f18baef6aeeea30fd245edfae4d3fd" +checksum = "77ebafa94a717c8442d8db8d3ae5d1c6a15e30f2d347e0cd31d057ca72e42566" dependencies = [ "futures", - "libp2p-core 0.42.0", - "libp2p-gossipsub 0.47.0", - "libp2p-identify 0.45.0", + "libp2p-core", + "libp2p-gossipsub", + "libp2p-identify", "libp2p-identity", - "libp2p-ping 0.45.0", - "libp2p-swarm 0.45.1", + "libp2p-kad", + "libp2p-ping", + "libp2p-swarm", "pin-project", "prometheus-client", "web-time", ] -[[package]] -name = "libp2p-noise" -version = "0.44.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecd0545ce077f6ea5434bcb76e8d0fe942693b4380aaad0d34a358c2bd05793" -dependencies = [ - "asynchronous-codec 0.7.0", - "bytes", - "curve25519-dalek", - "futures", - "libp2p-core 0.41.3", - "libp2p-identity", - "multiaddr", - "multihash", - "once_cell", - "quick-protobuf", - "rand", - "sha2", - "snow", - "static_assertions", - "thiserror", - "tracing", - "x25519-dalek", - "zeroize", -] - -[[package]] -name = "libp2p-ping" -version = "0.44.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1de5a6cf64fba7f7e8f2102711c9c6c043a8e56b86db8cd306492c517da3fb3" -dependencies = [ - "either", - "futures", - "futures-timer", - "instant", - "libp2p-core 0.41.3", - "libp2p-identity", - "libp2p-swarm 0.44.2", - "rand", - "tracing", - "void", -] - [[package]] name = "libp2p-ping" version = "0.45.0" @@ -3765,9 +3622,9 @@ dependencies = [ "either", "futures", "futures-timer", - "libp2p-core 0.42.0", + "libp2p-core", "libp2p-identity", - "libp2p-swarm 0.45.1", + "libp2p-swarm", "rand", "tracing", "void", @@ -3776,16 +3633,16 @@ dependencies = [ [[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 = [ "async-std", "bytes", "futures", "futures-timer", "if-watch", - "libp2p-core 0.41.3", + "libp2p-core", "libp2p-identity", "libp2p-tls", "parking_lot 0.12.3", @@ -3799,63 +3656,18 @@ dependencies = [ "tracing", ] -[[package]] -name = "libp2p-rendezvous" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168a444a16f569771bcb48aa081a32724079156e64a730dd900276391ccb6385" -dependencies = [ - "async-trait", - "asynchronous-codec 0.6.2", - "bimap", - "futures", - "futures-timer", - "instant", - "libp2p-core 0.41.3", - "libp2p-identity", - "libp2p-request-response", - "libp2p-swarm 0.44.2", - "quick-protobuf", - "quick-protobuf-codec 0.2.0", - "rand", - "thiserror", - "tracing", - "void", -] - -[[package]] -name = "libp2p-request-response" -version = "0.26.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c314fe28368da5e3a262553fb0ad575c1c8934c461e10de10265551478163836" -dependencies = [ - "async-trait", - "futures", - "futures-bounded", - "futures-timer", - "instant", - "libp2p-core 0.41.3", - "libp2p-identity", - "libp2p-swarm 0.44.2", - "rand", - "smallvec", - "tracing", - "void", -] - [[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 = [ "async-std", "either", "fnv", "futures", "futures-timer", - "instant", - "libp2p-core 0.41.3", + "libp2p-core", "libp2p-identity", "libp2p-swarm-derive", "lru", @@ -3866,35 +3678,14 @@ dependencies = [ "tokio", "tracing", "void", -] - -[[package]] -name = "libp2p-swarm" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7dd6741793d2c1fb2088f67f82cf07261f25272ebe3c0b0c311e0c6b50e851a" -dependencies = [ - "either", - "fnv", - "futures", - "futures-timer", - "libp2p-core 0.42.0", - "libp2p-identity", - "lru", - "multistream-select", - "once_cell", - "rand", - "smallvec", - "tracing", - "void", "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", @@ -3904,16 +3695,16 @@ dependencies = [ [[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 = [ - "async-io 1.13.0", + "async-io 2.3.3", "futures", "futures-timer", "if-watch", "libc", - "libp2p-core 0.41.3", + "libp2p-core", "libp2p-identity", "socket2 0.5.7", "tokio", @@ -3922,13 +3713,13 @@ 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", - "libp2p-core 0.41.3", + "libp2p-core", "libp2p-identity", "rcgen", "ring 0.17.8", @@ -3941,35 +3732,20 @@ 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", "igd-next", - "libp2p-core 0.41.3", - "libp2p-swarm 0.44.2", + "libp2p-core", + "libp2p-swarm", "tokio", "tracing", "void", ] -[[package]] -name = "libp2p-yamux" -version = "0.45.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddd5265f6b80f94d48a3963541aad183cc598a645755d2f1805a373e41e0716b" -dependencies = [ - "either", - "futures", - "libp2p-core 0.41.3", - "thiserror", - "tracing", - "yamux 0.12.1", - "yamux 0.13.3", -] - [[package]] name = "libredox" version = "0.1.3" @@ -4022,7 +3798,7 @@ name = "logger" version = "0.1.0" dependencies = [ "actix", - "base64 0.22.1", + "base64", "enclave-core", "tracing", ] @@ -4199,6 +3975,22 @@ dependencies = [ "rawpointer", ] +[[package]] +name = "net" +version = "0.1.0" +dependencies = [ + "actix", + "anyhow", + "async-std", + "async-trait", + "enclave-core", + "futures", + "libp2p", + "tokio", + "tracing", + "tracing-subscriber", +] + [[package]] name = "netlink-packet-core" version = "0.4.2" @@ -4277,12 +4069,6 @@ dependencies = [ "libc", ] -[[package]] -name = "nohash-hasher" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" - [[package]] name = "nom" version = "7.1.3" @@ -4516,22 +4302,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" -[[package]] -name = "p2p" -version = "0.1.0" -dependencies = [ - "actix", - "anyhow", - "async-std", - "async-trait", - "enclave-core", - "futures", - "libp2p", - "tokio", - "tracing", - "tracing-subscriber", -] - [[package]] name = "parity-scale-codec" version = "3.6.12" @@ -4635,7 +4405,7 @@ version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e459365e590736a54c3fa561947c84837534b8e9af6fc5bf781307e82658fae" dependencies = [ - "base64 0.22.1", + "base64", "serde", ] @@ -4766,17 +4536,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "poly1305" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" -dependencies = [ - "cpufeatures", - "opaque-debug", - "universal-hash", -] - [[package]] name = "polyval" version = "0.6.2" @@ -5000,26 +4759,13 @@ dependencies = [ "byteorder", ] -[[package]] -name = "quick-protobuf-codec" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ededb1cd78531627244d51dd0c7139fbe736c7d57af0092a76f0ffb2f56e98" -dependencies = [ - "asynchronous-codec 0.6.2", - "bytes", - "quick-protobuf", - "thiserror", - "unsigned-varint 0.7.2", -] - [[package]] name = "quick-protobuf-codec" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "15a0580ab32b169745d7a39db2ba969226ca16738931be152a3209b409de2474" dependencies = [ - "asynchronous-codec 0.7.0", + "asynchronous-codec", "bytes", "quick-protobuf", "thiserror", @@ -5235,7 +4981,7 @@ version = "0.12.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" dependencies = [ - "base64 0.22.1", + "base64", "bytes", "futures-core", "futures-util", @@ -5507,7 +5253,7 @@ version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" dependencies = [ - "base64 0.22.1", + "base64", "rustls-pki-types", ] @@ -5847,23 +5593,6 @@ dependencies = [ "futures-lite 1.13.0", ] -[[package]] -name = "snow" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "850948bee068e713b8ab860fe1adc4d109676ab4c3b621fd8147f06b261f2f85" -dependencies = [ - "aes-gcm", - "blake2", - "chacha20poly1305", - "curve25519-dalek", - "rand_core", - "ring 0.17.8", - "rustc_version 0.4.0", - "sha2", - "subtle", -] - [[package]] name = "socket2" version = "0.4.10" @@ -6100,7 +5829,7 @@ dependencies = [ "alloy-primitives 0.6.4", "anyhow", "async-std", - "base64 0.22.1", + "base64", "bfv", "bincode", "cipher 0.1.0", @@ -6114,7 +5843,7 @@ dependencies = [ "fhe-util", "keyshare", "logger", - "p2p", + "net", "rand", "rand_chacha", "router", @@ -6546,10 +6275,6 @@ 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" @@ -7033,18 +6758,6 @@ dependencies = [ "tap", ] -[[package]] -name = "x25519-dalek" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7e468321c81fb07fa7f4c636c3972b9100f0346e5b6a9f2bd0603a52f7ed277" -dependencies = [ - "curve25519-dalek", - "rand_core", - "serde", - "zeroize", -] - [[package]] name = "x509-parser" version = "0.16.0" @@ -7077,37 +6790,6 @@ dependencies = [ "xml-rs", ] -[[package]] -name = "yamux" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed0164ae619f2dc144909a9f082187ebb5893693d8c0196e8085283ccd4b776" -dependencies = [ - "futures", - "log", - "nohash-hasher", - "parking_lot 0.12.3", - "pin-project", - "rand", - "static_assertions", -] - -[[package]] -name = "yamux" -version = "0.13.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31b5e376a8b012bee9c423acdbb835fc34d45001cfa3106236a624e4b738028" -dependencies = [ - "futures", - "log", - "nohash-hasher", - "parking_lot 0.12.3", - "pin-project", - "rand", - "static_assertions", - "web-time", -] - [[package]] name = "yasna" version = "0.5.2" diff --git a/packages/ciphernode/Cargo.toml b/packages/ciphernode/Cargo.toml index 2765678e..a47e6edf 100644 --- a/packages/ciphernode/Cargo.toml +++ b/packages/ciphernode/Cargo.toml @@ -3,7 +3,7 @@ members = [ "core", "enclave", "enclave_node", - "p2p", + "net", "bfv", "data", "evm", @@ -28,7 +28,7 @@ alloy-primitives = { version = "0.6", default-features = false, features = [ "std", ] } alloy-sol-types = { version = "0.6" } -argon2 = "0.5.2" +argon2 = "0.5.2" anyhow = "1.0.86" async-std = { version = "1.12", features = ["attributes"] } async-trait = "0.1" @@ -54,18 +54,13 @@ sha2 = "0.10.8" tokio = { version = "1.38", features = ["full"] } tracing = "0.1.37" tracing-subscriber = { version = "0.3", features = ["env-filter"] } -libp2p = { version = "0.53.2", features = [ +libp2p = { version = "0.54.1", features = [ "async-std", "identify", "macros", - "noise", "ping", - "rendezvous", - "tcp", "tokio", - "yamux", - "mdns", "gossipsub", "quic", ] } -zeroize = "1.6.0" +zeroize = "1.6.0" diff --git a/packages/ciphernode/config/src/app_config.rs b/packages/ciphernode/config/src/app_config.rs index dc02e724..ec340ccb 100644 --- a/packages/ciphernode/config/src/app_config.rs +++ b/packages/ciphernode/config/src/app_config.rs @@ -71,6 +71,8 @@ pub struct AppConfig { data_dir: PathBuf, /// Ethereum Address for the node address: Option
, + /// A list of libp2p multiaddrs to dial to as peers when joining the network + peers: Vec, } impl Default for AppConfig { @@ -83,6 +85,8 @@ impl Default for AppConfig { data_dir: OsDirs::data_dir(), // ~/.config/enclave config_file: PathBuf::from("config.yaml"), // ~/.config/enclave/config.yaml cwd: env::current_dir().unwrap_or_default(), + peers: vec![], // NOTE: This should remain empty and we should look at config + // generation via ipns fetch for the latest nodes address: None, } } @@ -155,6 +159,10 @@ impl AppConfig { pub fn cwd(&self) -> PathBuf { self.cwd.to_owned() } + + pub fn peers(&self) -> Vec { + self.peers.clone() + } } /// Load the config at the config_file or the default location if not provided diff --git a/packages/ciphernode/core/src/eventbus.rs b/packages/ciphernode/core/src/eventbus.rs index f1a07a37..849e5e8c 100644 --- a/packages/ciphernode/core/src/eventbus.rs +++ b/packages/ciphernode/core/src/eventbus.rs @@ -35,7 +35,7 @@ pub struct ResetHistory; /// Central EventBus for each node. Actors publish events to this bus by sending it EnclaveEvents. /// All events sent to this bus are assumed to be published over the network via pubsub. -/// Other actors such as the P2p and Evm actor connect to outside services and control which events +/// Other actors such as the NetworkRelay and Evm actor connect to outside services and control which events /// actually get published as well as ensure that local events are not rebroadcast locally after /// being published. pub struct EventBus { diff --git a/packages/ciphernode/enclave_node/Cargo.toml b/packages/ciphernode/enclave_node/Cargo.toml index 9862a1c8..ad03d445 100644 --- a/packages/ciphernode/enclave_node/Cargo.toml +++ b/packages/ciphernode/enclave_node/Cargo.toml @@ -24,7 +24,7 @@ evm = { path = "../evm" } fhe = { path = "../fhe" } keyshare = { path = "../keyshare" } logger = { path = "../logger" } -p2p = { path = "../p2p" } +net = { path = "../net" } rand = { workspace = true } rand_chacha = { workspace = true } router = { path = "../router" } diff --git a/packages/ciphernode/enclave_node/src/aggregator.rs b/packages/ciphernode/enclave_node/src/aggregator.rs index 45ee6358..bdb4b8c5 100644 --- a/packages/ciphernode/enclave_node/src/aggregator.rs +++ b/packages/ciphernode/enclave_node/src/aggregator.rs @@ -1,5 +1,5 @@ use actix::{Actor, Addr}; -use anyhow::{bail, Result}; +use anyhow::Result; use cipher::Cipher; use config::AppConfig; use enclave_core::EventBus; @@ -11,7 +11,7 @@ use evm::{ CiphernodeRegistrySol, EnclaveSol, RegistryFilterSol, }; use logger::SimpleLogger; -use p2p::P2p; +use net::NetworkRelay; use rand::SeedableRng; use rand_chacha::{rand_core::OsRng, ChaCha20Rng}; use router::{ @@ -29,7 +29,7 @@ pub async fn setup_aggregator( config: AppConfig, pubkey_write_path: Option<&str>, plaintext_write_path: Option<&str>, -) -> Result<(Addr, JoinHandle<()>, String)> { +) -> Result<(Addr, JoinHandle>, String)> { let bus = EventBus::new(true).start(); let rng = Arc::new(Mutex::new( ChaCha20Rng::from_rng(OsRng).expect("Failed to create RNG"), @@ -82,7 +82,7 @@ pub async fn setup_aggregator( .build() .await?; - let (_, join_handle, peer_id) = P2p::spawn_libp2p(bus.clone()).expect("Failed to setup libp2p"); + let (_, join_handle, peer_id) = NetworkRelay::setup_with_peer(bus.clone(), config.peers())?; if let Some(path) = pubkey_write_path { PublicKeyWriter::attach(path, bus.clone()); diff --git a/packages/ciphernode/enclave_node/src/ciphernode.rs b/packages/ciphernode/enclave_node/src/ciphernode.rs index f1fd54cd..c8dedf14 100644 --- a/packages/ciphernode/enclave_node/src/ciphernode.rs +++ b/packages/ciphernode/enclave_node/src/ciphernode.rs @@ -9,7 +9,7 @@ use evm::{ CiphernodeRegistrySol, EnclaveSolReader, }; use logger::SimpleLogger; -use p2p::P2p; +use net::NetworkRelay; use rand::SeedableRng; use rand_chacha::rand_core::OsRng; use router::{ @@ -26,7 +26,7 @@ use crate::setup_datastore; pub async fn setup_ciphernode( config: AppConfig, address: Address, -) -> Result<(Addr, JoinHandle<()>, String)> { +) -> Result<(Addr, JoinHandle>, String)> { let rng = Arc::new(Mutex::new( rand_chacha::ChaCha20Rng::from_rng(OsRng).expect("Failed to create RNG"), )); @@ -71,7 +71,7 @@ pub async fn setup_ciphernode( .build() .await?; - let (_, join_handle, peer_id) = P2p::spawn_libp2p(bus.clone()).expect("Failed to setup libp2p"); + let (_, join_handle, peer_id) = NetworkRelay::setup_with_peer(bus.clone(), config.peers())?; let nm = format!("CIPHER({})", &address.to_string()[0..5]); SimpleLogger::attach(&nm, bus.clone()); diff --git a/packages/ciphernode/enclave_node/src/shutdown.rs b/packages/ciphernode/enclave_node/src/shutdown.rs index a30aaab3..58771dc5 100644 --- a/packages/ciphernode/enclave_node/src/shutdown.rs +++ b/packages/ciphernode/enclave_node/src/shutdown.rs @@ -1,13 +1,14 @@ use actix::Recipient; +use anyhow::Result; use enclave_core::{EnclaveEvent, Shutdown}; use std::time::Duration; use tokio::{ signal::unix::{signal, SignalKind}, task::JoinHandle, }; -use tracing::{error, info}; +use tracing::info; -pub async fn listen_for_shutdown(bus: Recipient, handle: JoinHandle<()>) { +pub async fn listen_for_shutdown(bus: Recipient, handle: JoinHandle>) { let mut sigterm = signal(SignalKind::terminate()).expect("Failed to create SIGTERM signal stream"); diff --git a/packages/ciphernode/p2p/Cargo.toml b/packages/ciphernode/net/Cargo.toml similarity index 93% rename from packages/ciphernode/p2p/Cargo.toml rename to packages/ciphernode/net/Cargo.toml index fa79f116..a8a7c7c8 100644 --- a/packages/ciphernode/p2p/Cargo.toml +++ b/packages/ciphernode/net/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "p2p" +name = "net" version = "0.1.0" edition = "2021" description = ": coordinates the encryption and decryption of enclave computations" @@ -13,17 +13,14 @@ async-trait = { workspace = true } futures = { workspace = true } libp2p = { workspace = true, features = [ "async-std", + "gossipsub", "identify", + "kad", "macros", - "noise", - "ping", - "rendezvous", - "tcp", - "tokio", - "yamux", "mdns", - "gossipsub", + "ping", "quic", + "tokio", ] } tokio = { workspace = true, features = ["full"] } tracing = { workspace = true } diff --git a/packages/ciphernode/net/src/bin/p2p_test.rs b/packages/ciphernode/net/src/bin/p2p_test.rs new file mode 100644 index 00000000..15435f2a --- /dev/null +++ b/packages/ciphernode/net/src/bin/p2p_test.rs @@ -0,0 +1,119 @@ +use anyhow::Result; +use net::NetworkPeer; +use std::time::Duration; +use std::{collections::HashSet, env, process}; +use tokio::time::{sleep, timeout}; +use tracing_subscriber::{prelude::*, EnvFilter}; + +// So this is a simple test to test our networking configuration +// Here we ensure we can send a gossipsub message to all connected nodes +// Each node is assigned a name alice, bob or charlie and expects to receive the other two +// names via gossipsub or the node will exit with an error code +// We have a docker test harness that runs the nodes and blocks things like mdns ports to ensure +// that basic discovery is working + +#[tokio::main] +async fn main() -> Result<()> { + tracing_subscriber::registry() + .with(EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("info"))) + .with(tracing_subscriber::fmt::layer()) + .init(); + let name = env::args().nth(1).expect("need name"); + + println!("{} starting up", name); + + let udp_port = env::var("QUIC_PORT") + .ok() + .and_then(|p| p.parse::().ok()); + + let dial_to = env::var("DIAL_TO") + .ok() + .and_then(|p| p.parse::().ok()); + + let peers: Vec = dial_to.iter().cloned().collect(); + + let id = libp2p::identity::Keypair::generate_ed25519(); + let mut peer = NetworkPeer::new(&id, peers, udp_port, "test-topic")?; + + // Extract input and outputs + let tx = peer.tx(); + let mut rx = peer.rx().unwrap(); + + let router_task = tokio::spawn({ + let name = name.clone(); + async move { + println!("{} starting router task", name); + if let Err(e) = peer.start().await { + println!("{} router task failed: {}", name, e); + } + println!("{} router task finished", name); + } + }); + + // Give network time to initialize + sleep(Duration::from_secs(3)).await; + + // Send our message first + println!("{} sending message", name); + tx.send(name.as_bytes().to_vec()).await?; + println!("{} message sent", name); + + let expected: HashSet = vec![ + "alice".to_string(), + "bob".to_string(), + "charlie".to_string(), + ] + .into_iter() + .filter(|n| *n != name) + .collect(); + println!("{} waiting for messages from: {:?}", name, expected); + + // Then wait to receive from others with a timeout + let mut received = HashSet::new(); + + // Wrap the message receiving loop in a timeout + let receive_result = timeout(Duration::from_secs(10), async { + while received != expected { + if let Some(msg) = rx.recv().await { + match String::from_utf8(msg) { + Ok(msg) => { + if !received.contains(&msg) { + println!("{} received '{}'", name, msg); + received.insert(msg); + } + } + Err(e) => println!("{} received invalid UTF8: {}", name, e), + } + } + } + Ok::<(), anyhow::Error>(()) + }) + .await; + + match receive_result { + Ok(Ok(())) => { + println!("{} received all expected messages", name); + } + Ok(Err(e)) => { + println!("{} error while receiving messages: {}", name, e); + process::exit(1); + } + Err(_) => { + println!( + "{} timeout waiting for messages. Received only: {:?}", + name, received + ); + process::exit(1); + } + } + + // Make sure router task is still running + if router_task.is_finished() { + println!("{} warning: router task finished early", name); + } + + // Give some time for final message propagation + sleep(Duration::from_secs(1)).await; + println!("{} finished successfully", name); + Ok(()) +} diff --git a/packages/ciphernode/net/src/lib.rs b/packages/ciphernode/net/src/lib.rs new file mode 100644 index 00000000..e1f2cde5 --- /dev/null +++ b/packages/ciphernode/net/src/lib.rs @@ -0,0 +1,8 @@ +#![crate_name = "net"] +#![crate_type = "lib"] + +mod network_peer; +mod network_relay; + +pub use network_peer::*; +pub use network_relay::*; diff --git a/packages/ciphernode/net/src/network_peer.rs b/packages/ciphernode/net/src/network_peer.rs new file mode 100644 index 00000000..8e1d80d6 --- /dev/null +++ b/packages/ciphernode/net/src/network_peer.rs @@ -0,0 +1,218 @@ +use anyhow::Result; +use libp2p::{ + connection_limits::{self, ConnectionLimits}, + futures::StreamExt, + gossipsub, + identify::{self, Behaviour as IdentifyBehaviour}, + identity::Keypair, + kad::{store::MemoryStore, Behaviour as KademliaBehaviour}, + mdns, + swarm::{NetworkBehaviour, SwarmEvent}, + Multiaddr, Swarm, +}; +use std::hash::{Hash, Hasher}; +use std::{hash::DefaultHasher, io::Error, time::Duration}; +use tokio::{ + select, + sync::mpsc::{self, channel, Receiver, Sender}, +}; +use tracing::{debug, error, info, trace, warn}; + +#[derive(NetworkBehaviour)] +pub struct NodeBehaviour { + gossipsub: gossipsub::Behaviour, + kademlia: KademliaBehaviour, + connection_limits: connection_limits::Behaviour, + mdns: mdns::tokio::Behaviour, + identify: IdentifyBehaviour, +} + +pub struct NetworkPeer { + swarm: Swarm, + peers: Vec, + udp_port: Option, + topic: gossipsub::IdentTopic, + to_bus_tx: Sender>, // to event bus + from_net_rx: Option>>, // from network + to_net_tx: Sender>, // to network + from_bus_rx: Receiver>, // from event bus +} + +impl NetworkPeer { + pub fn new( + id: &Keypair, + peers: Vec, + udp_port: Option, + topic: &str, + ) -> Result { + let (to_bus_tx, from_net_rx) = channel(100); // TODO : tune this param + let (to_net_tx, from_bus_rx) = channel(100); // TODO : tune this param + + let swarm = libp2p::SwarmBuilder::with_existing_identity(id.clone()) + .with_tokio() + .with_quic() + .with_behaviour(create_mdns_kad_behaviour())? + .with_swarm_config(|c| c.with_idle_connection_timeout(Duration::from_secs(60))) + .build(); + + // TODO: Use topics to manage network traffic instead of just using a single topic + let topic = gossipsub::IdentTopic::new(topic); + + Ok(Self { + swarm, + peers, + udp_port, + topic, + to_bus_tx, + from_net_rx: Some(from_net_rx), + to_net_tx, + from_bus_rx, + }) + } + + pub fn rx(&mut self) -> Option>> { + self.from_net_rx.take() + } + + pub fn tx(&self) -> Sender> { + self.to_net_tx.clone() + } + + pub async fn start(&mut self) -> Result<()> { + let addr = match self.udp_port { + Some(port) => format!("/ip4/0.0.0.0/udp/{}/quic-v1", port), + None => "/ip4/0.0.0.0/udp/0/quic-v1".to_string(), + }; + info!("Requesting node.listen_on('{}')", addr); + + self.swarm + .behaviour_mut() + .gossipsub + .subscribe(&self.topic)?; + self.swarm.listen_on(addr.parse()?)?; + + info!("Peers to dial: {:?}", self.peers); + for addr in self.peers.clone() { + let multiaddr: Multiaddr = addr.parse()?; + self.swarm.dial(multiaddr)?; + } + + loop { + select! { + Some(line) = self.from_bus_rx.recv() => { + if let Err(e) = self.swarm + .behaviour_mut().gossipsub + .publish(self.topic.clone(), line) { + error!(error=?e, "Error publishing line to swarm"); + } + } + + event = self.swarm.select_next_some() => { + process_swarm_event(&mut self.swarm, &mut self.to_bus_tx, event).await? + } + } + } + } +} + +fn create_mdns_kad_behaviour() -> impl FnOnce( + &Keypair, +) -> std::result::Result< + NodeBehaviour, + Box, +> { + |key| { + let connection_limits = connection_limits::Behaviour::new(ConnectionLimits::default()); + let identify_config = IdentifyBehaviour::new( + identify::Config::new("/kad/0.1.0".into(), key.public()) + .with_interval(Duration::from_secs(60)), // do this so we can get timeouts for dropped WebRTC connections + ); + let message_id_fn = |message: &gossipsub::Message| { + let mut s = DefaultHasher::new(); + message.data.hash(&mut s); + gossipsub::MessageId::from(s.finish().to_string()) + }; + + // TODO: Allow for config inputs to new() + let gossipsub_config = gossipsub::ConfigBuilder::default() + .heartbeat_interval(Duration::from_secs(10)) + .validation_mode(gossipsub::ValidationMode::Strict) + .message_id_fn(message_id_fn) + .build() + .map_err(|msg| Error::new(std::io::ErrorKind::Other, msg))?; + + let gossipsub = gossipsub::Behaviour::new( + gossipsub::MessageAuthenticity::Signed(key.clone()), + gossipsub_config, + )?; + + let mdns = mdns::tokio::Behaviour::new(mdns::Config::default(), key.public().to_peer_id())?; + + Ok(NodeBehaviour { + gossipsub, + kademlia: KademliaBehaviour::new( + key.public().to_peer_id(), + MemoryStore::new(key.public().to_peer_id()), + ), + mdns, + connection_limits, + identify: identify_config, + }) + } +} + +async fn process_swarm_event( + swarm: &mut Swarm, + to_bus_tx: &mut Sender>, + event: SwarmEvent, +) -> Result<()> { + match event { + SwarmEvent::ConnectionEstablished { peer_id, .. } => { + info!("Connected to {peer_id}"); + } + + SwarmEvent::OutgoingConnectionError { peer_id, error, .. } => { + warn!("Failed to dial {peer_id:?}: {error}"); + } + + SwarmEvent::IncomingConnectionError { error, .. } => { + warn!("{:#}", anyhow::Error::from(error)) + } + + SwarmEvent::Behaviour(NodeBehaviourEvent::Kademlia(e)) => { + debug!("Kademlia event: {:?}", e); + } + + SwarmEvent::Behaviour(NodeBehaviourEvent::Mdns(mdns::Event::Discovered(list))) => { + for (peer_id, _multiaddr) in list { + trace!("mDNS discovered a new peer: {peer_id}"); + swarm.behaviour_mut().gossipsub.add_explicit_peer(&peer_id); + } + } + + SwarmEvent::Behaviour(NodeBehaviourEvent::Mdns(mdns::Event::Expired(list))) => { + for (peer_id, _multiaddr) in list { + trace!("mDNS discover peer has expired: {peer_id}"); + swarm + .behaviour_mut() + .gossipsub + .remove_explicit_peer(&peer_id); + } + } + + SwarmEvent::Behaviour(NodeBehaviourEvent::Gossipsub(gossipsub::Event::Message { + propagation_source: peer_id, + message_id: id, + message, + })) => { + trace!("Got message with id: {id} from peer: {peer_id}",); + trace!("{:?}", message); + to_bus_tx.send(message.data).await?; + } + SwarmEvent::NewListenAddr { address, .. } => { + warn!("Local node is listening on {address}"); + } + _ => {} + }; + Ok(()) +} diff --git a/packages/ciphernode/p2p/src/p2p.rs b/packages/ciphernode/net/src/network_relay.rs similarity index 65% rename from packages/ciphernode/p2p/src/p2p.rs rename to packages/ciphernode/net/src/network_relay.rs index 53bbd559..fe2b8add 100644 --- a/packages/ciphernode/p2p/src/p2p.rs +++ b/packages/ciphernode/net/src/network_relay.rs @@ -1,22 +1,24 @@ use std::{collections::HashSet, error::Error}; -use crate::libp2p_router::EnclaveRouter; +use crate::NetworkPeer; /// Actor for connecting to an libp2p client via it's mpsc channel interface /// This Actor should be responsible for use actix::prelude::*; -use tokio::sync::mpsc::{Receiver, Sender}; - +use anyhow::anyhow; +use anyhow::Result; use enclave_core::{EnclaveEvent, EventBus, EventId, Subscribe}; +use tokio::sync::mpsc::{Receiver, Sender}; use tracing::{error, trace}; -/// P2p Actor converts between EVentBus events and Libp2p events -pub struct P2p { +/// NetworkRelay Actor converts between EventBus events and Libp2p events forwarding them to a +/// NetworkPeer for propagation over the p2p network +pub struct NetworkRelay { bus: Addr, tx: Sender>, sent_events: HashSet, } -impl Actor for P2p { +impl Actor for NetworkRelay { type Context = Context; } @@ -24,8 +26,8 @@ impl Actor for P2p { #[rtype(result = "anyhow::Result<()>")] struct LibP2pEvent(pub Vec); -impl P2p { - /// Create a new P2p actor +impl NetworkRelay { + /// Create a new NetworkRelay actor pub fn new(bus: Addr, tx: Sender>) -> Self { Self { bus, @@ -34,51 +36,47 @@ impl P2p { } } - /// Start a new P2p actor listening for libp2p messages on the given Receiver and forwarding - /// them to the actor - pub fn spawn_and_listen( + pub fn setup( bus: Addr, - tx: Sender>, // Transmit byte events to the network - mut rx: Receiver>, // Receive byte events from the network + tx: Sender>, + mut rx: Receiver>, ) -> Addr { - // Create a new Actor - let p2p = P2p::new(bus.clone(), tx).start(); + let addr = NetworkRelay::new(bus.clone(), tx).start(); // Listen on all events bus.do_send(Subscribe { event_type: String::from("*"), - listener: p2p.clone().recipient(), + listener: addr.clone().recipient(), }); - // Clone this to go in the spawned future - let p2p_addr = p2p.clone(); - tokio::spawn(async move { - while let Some(msg) = rx.recv().await { - p2p_addr.do_send(LibP2pEvent(msg)) + tokio::spawn({ + let addr = addr.clone(); + + async move { + while let Some(msg) = rx.recv().await { + addr.do_send(LibP2pEvent(msg)) + } } }); - // Return the address - p2p + addr } - /// Spawn a Libp2p instance. Calls spawn and listen - pub fn spawn_libp2p( + /// Spawn a Libp2p peer and hook it up to this actor + pub fn setup_with_peer( bus: Addr, - ) -> Result<(Addr, tokio::task::JoinHandle<()>, String), Box> { - let (mut libp2p, tx, rx) = EnclaveRouter::new()?; + peers: Vec, + ) -> Result<(Addr, tokio::task::JoinHandle>, String)> { let keypair = libp2p::identity::Keypair::generate_ed25519(); - libp2p.with_identity(&keypair); - libp2p.connect_swarm("mdns".to_string())?; - libp2p.join_topic("enclave-keygen-01")?; - - let p2p_addr = Self::spawn_and_listen(bus, tx, rx); - let handle = tokio::spawn(async move { libp2p.start().await.unwrap() }); + let mut peer = NetworkPeer::new(&keypair, peers, None, "tmp-enclave-gossip-topic")?; + let rx = peer.rx().ok_or(anyhow!("Peer rx already taken"))?; + let p2p_addr = NetworkRelay::setup(bus, peer.tx(), rx); + let handle = tokio::spawn(async move { Ok(peer.start().await?) }); Ok((p2p_addr, handle, keypair.public().to_peer_id().to_string())) } } -impl Handler for P2p { +impl Handler for NetworkRelay { type Result = anyhow::Result<()>; fn handle(&mut self, msg: LibP2pEvent, _: &mut Self::Context) -> Self::Result { let LibP2pEvent(bytes) = msg; @@ -93,7 +91,7 @@ impl Handler for P2p { } } -impl Handler for P2p { +impl Handler for NetworkRelay { type Result = ResponseFuture<()>; fn handle(&mut self, event: EnclaveEvent, _: &mut Self::Context) -> Self::Result { let sent_events = self.sent_events.clone(); diff --git a/packages/ciphernode/net/tests/Dockerfile b/packages/ciphernode/net/tests/Dockerfile new file mode 100644 index 00000000..d983a17d --- /dev/null +++ b/packages/ciphernode/net/tests/Dockerfile @@ -0,0 +1,20 @@ +# Stage 1: Build +FROM rust:1.81 AS builder + +WORKDIR /app +COPY . . +RUN cargo build --release --bin p2p_test + +# Stage 2: Runtime +FROM debian:bookworm-slim + +WORKDIR /app + +RUN apt-get update && apt-get install -y --no-install-recommends iptables ca-certificates && \ + apt-get clean && rm -rf /var/lib/apt/lists/* + +COPY --from=builder /app/target/release/p2p_test /app/ +COPY net/tests/entrypoint.sh /app/ +RUN chmod +x /app/entrypoint.sh + +ENTRYPOINT ["/app/entrypoint.sh"] diff --git a/packages/ciphernode/net/tests/docker-compose.yaml b/packages/ciphernode/net/tests/docker-compose.yaml new file mode 100644 index 00000000..f55d3698 --- /dev/null +++ b/packages/ciphernode/net/tests/docker-compose.yaml @@ -0,0 +1,55 @@ +services: + alice: + build: + dockerfile: net/tests/Dockerfile + context: ../.. + image: p2p-test-image + networks: + app_net: + ipv4_address: 172.16.238.10 + command: ["/app/p2p_test", "alice"] + environment: + QUIC_PORT: 9091 + DIAL_TO: "/ip4/172.16.238.12/udp/9091/quic-v1" + BLOCK_MDNS: "${BLOCK_MDNS:-false}" + entrypoint: ["/app/entrypoint.sh"] + cap_add: + - NET_ADMIN + - NET_RAW + + bob: + image: p2p-test-image + networks: + app_net: + ipv4_address: 172.16.238.11 + command: ["/app/p2p_test", "bob"] + environment: + QUIC_PORT: 9091 + DIAL_TO: "/ip4/172.16.238.12/udp/9091/quic-v1" + BLOCK_MDNS: "${BLOCK_MDNS:-false}" + entrypoint: ["/app/entrypoint.sh"] + cap_add: + - NET_ADMIN + - NET_RAW + + charlie: + image: p2p-test-image + networks: + app_net: + ipv4_address: 172.16.238.12 + command: ["/app/p2p_test", "charlie"] + environment: + QUIC_PORT: 9091 + BLOCK_MDNS: "${BLOCK_MDNS:-false}" + entrypoint: ["/app/entrypoint.sh"] + cap_add: + - NET_ADMIN + - NET_RAW + +networks: + app_net: + driver: bridge + ipam: + driver: default + config: + - subnet: 172.16.238.0/24 diff --git a/packages/ciphernode/net/tests/entrypoint.sh b/packages/ciphernode/net/tests/entrypoint.sh new file mode 100755 index 00000000..dfc54f53 --- /dev/null +++ b/packages/ciphernode/net/tests/entrypoint.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -e + +if [ "${BLOCK_MDNS:-false}" = "true" ]; then + iptables -A INPUT -p udp --dport 5353 -j DROP + iptables -A OUTPUT -p udp --dport 5353 -j DROP + iptables -L | grep DROP +fi + +# Execute the original command +exec "$@" diff --git a/packages/ciphernode/net/tests/run.sh b/packages/ciphernode/net/tests/run.sh new file mode 100755 index 00000000..3b0e3359 --- /dev/null +++ b/packages/ciphernode/net/tests/run.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +set -e + +echo "" +echo "Building docker image" +echo "" +docker compose build + +echo "" +echo "TEST 1: Using MDNS with separate IP addresses" +echo "" +docker compose up --build --abort-on-container-exit + +echo "" +echo "TEST 2: Blocking MDNS traffic for each service" +echo "" +echo "Note this should display some libp2p_mdns::behaviour::iface errors in output" +echo "" +BLOCK_MDNS=true docker compose up --build --abort-on-container-exit diff --git a/packages/ciphernode/p2p/src/lib.rs b/packages/ciphernode/p2p/src/lib.rs deleted file mode 100644 index cc7025e7..00000000 --- a/packages/ciphernode/p2p/src/lib.rs +++ /dev/null @@ -1,9 +0,0 @@ -#![crate_name = "p2p"] -#![crate_type = "lib"] -#![warn(missing_docs, unused_imports)] - -mod libp2p_router; -mod p2p; - -pub use libp2p_router::*; -pub use p2p::*; diff --git a/packages/ciphernode/p2p/src/libp2p_router.rs b/packages/ciphernode/p2p/src/libp2p_router.rs deleted file mode 100644 index d270402f..00000000 --- a/packages/ciphernode/p2p/src/libp2p_router.rs +++ /dev/null @@ -1,168 +0,0 @@ -use futures::stream::StreamExt; -use libp2p::{ - gossipsub, identity, mdns, noise, swarm::NetworkBehaviour, swarm::SwarmEvent, tcp, yamux, -}; -use std::collections::hash_map::DefaultHasher; -use std::error::Error; -use std::hash::{Hash, Hasher}; -use std::time::Duration; -use tokio::sync::mpsc::{channel, Receiver, Sender}; -use tokio::{io, select}; -use tracing::{error, info, trace}; - -#[derive(NetworkBehaviour)] -pub struct MyBehaviour { - gossipsub: gossipsub::Behaviour, - mdns: mdns::tokio::Behaviour, -} - -pub struct EnclaveRouter { - pub identity: Option, - pub gossipsub_config: gossipsub::Config, - pub swarm: Option>, - pub topic: Option, - evt_tx: Sender>, - cmd_rx: Receiver>, -} - -impl EnclaveRouter { - pub fn new() -> Result<(Self, Sender>, Receiver>), Box> { - let (evt_tx, evt_rx) = channel(100); // TODO : tune this param - let (cmd_tx, cmd_rx) = channel(100); // TODO : tune this param - let message_id_fn = |message: &gossipsub::Message| { - let mut s = DefaultHasher::new(); - message.data.hash(&mut s); - gossipsub::MessageId::from(s.finish().to_string()) - }; - - // TODO: Allow for config inputs to new() - let gossipsub_config = gossipsub::ConfigBuilder::default() - .heartbeat_interval(Duration::from_secs(10)) - .validation_mode(gossipsub::ValidationMode::Strict) - .message_id_fn(message_id_fn) - .build() - .map_err(|msg| io::Error::new(io::ErrorKind::Other, msg))?; - - Ok(( - Self { - identity: None, - gossipsub_config, - swarm: None, - topic: None, - evt_tx, - cmd_rx, - }, - cmd_tx, - evt_rx, - )) - } - - pub fn with_identity(&mut self, keypair: &identity::Keypair) { - self.identity = Some(keypair.clone()); - } - - pub fn connect_swarm(&mut self, discovery_type: String) -> Result<&Self, Box> { - match discovery_type.as_str() { - "mdns" => { - // TODO: Use key if assigned already - - let swarm = self - .identity - .clone() - .map_or_else( - || libp2p::SwarmBuilder::with_new_identity(), - |id| libp2p::SwarmBuilder::with_existing_identity(id), - ) - .with_tokio() - .with_tcp( - tcp::Config::default(), - noise::Config::new, - yamux::Config::default, - )? - .with_quic() - .with_behaviour(|key| { - let gossipsub = gossipsub::Behaviour::new( - gossipsub::MessageAuthenticity::Signed(key.clone()), - self.gossipsub_config.clone(), - )?; - - let mdns = mdns::tokio::Behaviour::new( - mdns::Config::default(), - key.public().to_peer_id(), - )?; - Ok(MyBehaviour { gossipsub, mdns }) - })? - .with_swarm_config(|c| c.with_idle_connection_timeout(Duration::from_secs(60))) - .build(); - - self.swarm = Some(swarm); - } - _ => info!("Defaulting to MDNS discovery"), - } - Ok(self) - } - - pub fn join_topic(&mut self, topic_name: &str) -> Result<&Self, Box> { - let topic = gossipsub::IdentTopic::new(topic_name); - self.topic = Some(topic.clone()); - self.swarm - .as_mut() - .unwrap() - .behaviour_mut() - .gossipsub - .subscribe(&topic)?; - Ok(self) - } - - /// Listen on the default multiaddr - pub async fn start(&mut self) -> Result<(), Box> { - self.swarm - .as_mut() - .unwrap() - .listen_on("/ip4/0.0.0.0/udp/0/quic-v1".parse()?)?; - self.swarm - .as_mut() - .unwrap() - .listen_on("/ip4/0.0.0.0/tcp/0".parse()?)?; - loop { - select! { - Some(line) = self.cmd_rx.recv() => { - if let Err(e) = self.swarm.as_mut().unwrap() - .behaviour_mut().gossipsub - .publish(self.topic.as_mut().unwrap().clone(), line) { - error!(error=?e, "Error publishing line to swarm"); - } - } - event = self.swarm.as_mut().unwrap().select_next_some() => match event { - SwarmEvent::Behaviour(MyBehaviourEvent::Mdns(mdns::Event::Discovered(list))) => { - for (peer_id, _multiaddr) in list { - trace!("mDNS discovered a new peer: {peer_id}"); - self.swarm.as_mut().unwrap().behaviour_mut().gossipsub.add_explicit_peer(&peer_id); - } - }, - SwarmEvent::Behaviour(MyBehaviourEvent::Mdns(mdns::Event::Expired(list))) => { - for (peer_id, _multiaddr) in list { - trace!("mDNS discover peer has expired: {peer_id}"); - self.swarm.as_mut().unwrap().behaviour_mut().gossipsub.remove_explicit_peer(&peer_id); - } - }, - SwarmEvent::Behaviour(MyBehaviourEvent::Gossipsub(gossipsub::Event::Message { - propagation_source: peer_id, - message_id: id, - message, - })) => { - trace!( - "Got message with id: {id} from peer: {peer_id}", - ); - trace!("{:?}", message); - self.evt_tx.send(message.data).await?; - }, - SwarmEvent::NewListenAddr { address, .. } => { - trace!("Local node is listening on {address}"); - } - _ => {} - } - } - } - } -} diff --git a/packages/ciphernode/rendezvous/Cargo.lock b/packages/ciphernode/rendezvous/Cargo.lock deleted file mode 100644 index 989852de..00000000 --- a/packages/ciphernode/rendezvous/Cargo.lock +++ /dev/null @@ -1,3958 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "addr2line" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "aead" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" -dependencies = [ - "crypto-common", - "generic-array", -] - -[[package]] -name = "aes" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" -dependencies = [ - "cfg-if", - "cipher", - "cpufeatures", -] - -[[package]] -name = "aes-gcm" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" -dependencies = [ - "aead", - "aes", - "cipher", - "ctr", - "ghash", - "subtle", -] - -[[package]] -name = "ahash" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "allocator-api2" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" - -[[package]] -name = "anyhow" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" - -[[package]] -name = "arrayref" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d151e35f61089500b617991b791fc8bfd237ae50cd5950803758a179b41e67a" - -[[package]] -name = "asn1-rs" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ad1373757efa0f70ec53939aabc7152e1591cb485208052993070ac8d2429d" -dependencies = [ - "asn1-rs-derive", - "asn1-rs-impl", - "displaydoc", - "nom", - "num-traits", - "rusticata-macros", - "thiserror", - "time", -] - -[[package]] -name = "asn1-rs-derive" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7378575ff571966e99a744addeff0bff98b8ada0dedf1956d59e634db95eaac1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", - "synstructure", -] - -[[package]] -name = "asn1-rs-impl" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "async-attributes" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3203e79f4dd9bdda415ed03cf14dae5a2bf775c683a00f94e9cd1faf0f596e5" -dependencies = [ - "quote", - "syn 1.0.109", -] - -[[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.0", - "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.3", - "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.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6baa8f0178795da0e71bc42c9e5d13261aac7ee549853162e66a241ba17964" -dependencies = [ - "async-lock 3.4.0", - "cfg-if", - "concurrent-queue", - "futures-io", - "futures-lite 2.3.0", - "parking", - "polling 3.7.2", - "rustix 0.38.34", - "slab", - "tracing", - "windows-sys 0.52.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 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.34", - "windows-sys 0.48.0", -] - -[[package]] -name = "async-signal" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfb3634b73397aa844481f814fad23bbf07fdb0eabec10f2eb95e58944b1ec32" -dependencies = [ - "async-io 2.3.3", - "async-lock 3.4.0", - "atomic-waker", - "cfg-if", - "futures-core", - "futures-io", - "rustix 0.38.34", - "signal-hook-registry", - "slab", - "windows-sys 0.52.0", -] - -[[package]] -name = "async-std" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" -dependencies = [ - "async-attributes", - "async-channel 1.9.0", - "async-global-executor", - "async-io 1.13.0", - "async-lock 2.8.0", - "async-process", - "crossbeam-utils", - "futures-channel", - "futures-core", - "futures-io", - "futures-lite 1.13.0", - "gloo-timers", - "kv-log-macro", - "log", - "memchr", - "once_cell", - "pin-project-lite", - "pin-utils", - "slab", - "wasm-bindgen-futures", -] - -[[package]] -name = "async-std-resolver" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc3b454643291f9a4a3bbdb35fa62efa4ba7be5ea13fe243e3be4352182ff4b8" -dependencies = [ - "async-std", - "async-trait", - "futures-io", - "futures-util", - "hickory-resolver", - "pin-utils", - "socket2 0.5.7", -] - -[[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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a860072022177f903e59730004fb5dc13db9275b79bb2aef7ba8ce831956c233" -dependencies = [ - "bytes", - "futures-sink", - "futures-util", - "memchr", - "pin-project-lite", -] - -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - -[[package]] -name = "attohttpc" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d9a9bf8b79a749ee0b911b91b671cc2b6c670bdbc7e3dfd537576ddc94bb2a2" -dependencies = [ - "http", - "log", - "url", -] - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "backtrace" -version = "0.3.73" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" -dependencies = [ - "addr2line", - "cc", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", -] - -[[package]] -name = "base-x" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" - -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - -[[package]] -name = "base64ct" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" - -[[package]] -name = "bimap" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "230c5f1ca6a325a32553f8640d31ac9b49f2411e901e427570154868b46da4f7" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" - -[[package]] -name = "blake2" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" -dependencies = [ - "digest", -] - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - -[[package]] -name = "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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "bumpalo" -version = "3.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "bytes" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a12916984aab3fa6e39d655a33e09c0071eb36d6ab3aea5c2d78551f1df6d952" - -[[package]] -name = "cc" -version = "1.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aba8f4e9906c7ce3c73463f62a7f0c65183ada1a2d47e397cc8810827f9694f" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "chacha20" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818" -dependencies = [ - "cfg-if", - "cipher", - "cpufeatures", -] - -[[package]] -name = "chacha20poly1305" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10cd79432192d1c0f4e1a0fef9527696cc039165d729fb41b3f4f4f354c2dc35" -dependencies = [ - "aead", - "chacha20", - "cipher", - "poly1305", - "zeroize", -] - -[[package]] -name = "cipher" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" -dependencies = [ - "crypto-common", - "inout", - "zeroize", -] - -[[package]] -name = "concurrent-queue" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "const-oid" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" - -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" - -[[package]] -name = "core2" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b49ba7ef1ad6107f8824dbe97de947cbaac53c44e7f9756a1fba0d37c1eec505" -dependencies = [ - "memchr", -] - -[[package]] -name = "cpufeatures" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" -dependencies = [ - "libc", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "rand_core", - "typenum", -] - -[[package]] -name = "ctr" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" -dependencies = [ - "cipher", -] - -[[package]] -name = "curve25519-dalek" -version = "4.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" -dependencies = [ - "cfg-if", - "cpufeatures", - "curve25519-dalek-derive", - "digest", - "fiat-crypto", - "rustc_version", - "subtle", - "zeroize", -] - -[[package]] -name = "curve25519-dalek-derive" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "data-encoding" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" - -[[package]] -name = "data-encoding-macro" -version = "0.1.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1559b6cba622276d6d63706db152618eeb15b89b3e4041446b05876e352e639" -dependencies = [ - "data-encoding", - "data-encoding-macro-internal", -] - -[[package]] -name = "data-encoding-macro-internal" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "332d754c0af53bc87c108fed664d121ecf59207ec4196041f04d6ab9002ad33f" -dependencies = [ - "data-encoding", - "syn 1.0.109", -] - -[[package]] -name = "der" -version = "0.7.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" -dependencies = [ - "const-oid", - "zeroize", -] - -[[package]] -name = "der-parser" -version = "9.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cd0a5c643689626bec213c4d8bd4d96acc8ffdb4ad4bb6bc16abf27d5f4b553" -dependencies = [ - "asn1-rs", - "displaydoc", - "nom", - "num-bigint", - "num-traits", - "rusticata-macros", -] - -[[package]] -name = "deranged" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" -dependencies = [ - "powerfmt", -] - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer", - "crypto-common", - "subtle", -] - -[[package]] -name = "displaydoc" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "doc-comment" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" - -[[package]] -name = "dtoa" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcbb2bf8e87535c23f7a8a321e364ce21462d0ff10cb6407820e8e96dfff6653" - -[[package]] -name = "ed25519" -version = "2.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" -dependencies = [ - "pkcs8", - "signature", -] - -[[package]] -name = "ed25519-dalek" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" -dependencies = [ - "curve25519-dalek", - "ed25519", - "rand_core", - "serde", - "sha2", - "subtle", - "zeroize", -] - -[[package]] -name = "either" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" - -[[package]] -name = "enclave-rendezvous" -version = "0.1.0" -dependencies = [ - "async-std", - "async-trait", - "fhe", - "fhe-traits", - "fhe-util", - "futures", - "libp2p", - "tokio", - "tracing", - "tracing-subscriber", -] - -[[package]] -name = "enum-as-inner" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ffccbb6966c05b32ef8fbac435df276c4ae4d3dc55a8cd0eb9745e6c12f546a" -dependencies = [ - "heck 0.4.1", - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "ethnum" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b90ca2580b73ab6a1f724b76ca11ab632df820fd6040c336200d2c1df7b3c82c" - -[[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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "event-listener-strategy" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" -dependencies = [ - "event-listener 5.3.1", - "pin-project-lite", -] - -[[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.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" - -[[package]] -name = "fhe" -version = "0.1.0-beta.7" -source = "git+https://github.com/gnosisguild/fhe.rs#9624766dcfbb40ecfb01147f59c2f6292c447707" -dependencies = [ - "doc-comment", - "fhe-math", - "fhe-traits", - "fhe-util", - "itertools", - "ndarray", - "num-bigint", - "num-traits", - "prost", - "prost-build", - "rand", - "rand_chacha", - "serde", - "thiserror", - "zeroize", - "zeroize_derive", -] - -[[package]] -name = "fhe-math" -version = "0.1.0-beta.7" -source = "git+https://github.com/gnosisguild/fhe.rs#9624766dcfbb40ecfb01147f59c2f6292c447707" -dependencies = [ - "ethnum", - "fhe-traits", - "fhe-util", - "itertools", - "ndarray", - "num-bigint", - "num-bigint-dig", - "num-traits", - "prost", - "prost-build", - "rand", - "rand_chacha", - "sha2", - "thiserror", - "zeroize", -] - -[[package]] -name = "fhe-traits" -version = "0.1.0-beta.7" -source = "git+https://github.com/gnosisguild/fhe.rs#9624766dcfbb40ecfb01147f59c2f6292c447707" -dependencies = [ - "rand", -] - -[[package]] -name = "fhe-util" -version = "0.1.0-beta.7" -source = "git+https://github.com/gnosisguild/fhe.rs#9624766dcfbb40ecfb01147f59c2f6292c447707" -dependencies = [ - "itertools", - "num-bigint-dig", - "num-traits", - "rand", -] - -[[package]] -name = "fiat-crypto" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" - -[[package]] -name = "fixedbitset" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "form_urlencoded" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "futures" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-bounded" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91f328e7fb845fc832912fb6a34f40cf6d1888c92f974d1893a54e97b5ff542e" -dependencies = [ - "futures-timer", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" - -[[package]] -name = "futures-executor" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", - "num_cpus", -] - -[[package]] -name = "futures-io" -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.0", - "futures-core", - "futures-io", - "parking", - "pin-project-lite", -] - -[[package]] -name = "futures-macro" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "futures-rustls" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f2f12607f92c69b12ed746fabf9ca4f5c482cba46679c1a75b874ed7c26adb" -dependencies = [ - "futures-io", - "rustls", - "rustls-pki-types", -] - -[[package]] -name = "futures-sink" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" - -[[package]] -name = "futures-task" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" - -[[package]] -name = "futures-timer" -version = "3.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" - -[[package]] -name = "futures-util" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", -] - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "ghash" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0d8a4362ccb29cb0b265253fb0a2728f592895ee6854fd9bc13f2ffda266ff1" -dependencies = [ - "opaque-debug", - "polyval", -] - -[[package]] -name = "gimli" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" - -[[package]] -name = "gloo-timers" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" -dependencies = [ - "futures-channel", - "futures-core", - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "h2" -version = "0.3.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" -dependencies = [ - "ahash", - "allocator-api2", -] - -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - -[[package]] -name = "hermit-abi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - -[[package]] -name = "hermit-abi" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" - -[[package]] -name = "hickory-proto" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07698b8420e2f0d6447a436ba999ec85d8fbf2a398bbd737b82cac4a2e96e512" -dependencies = [ - "async-trait", - "cfg-if", - "data-encoding", - "enum-as-inner", - "futures-channel", - "futures-io", - "futures-util", - "idna 0.4.0", - "ipnet", - "once_cell", - "rand", - "socket2 0.5.7", - "thiserror", - "tinyvec", - "tokio", - "tracing", - "url", -] - -[[package]] -name = "hickory-resolver" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28757f23aa75c98f254cf0405e6d8c25b831b32921b050a66692427679b1f243" -dependencies = [ - "cfg-if", - "futures-util", - "hickory-proto", - "ipconfig", - "lru-cache", - "once_cell", - "parking_lot", - "rand", - "resolv-conf", - "smallvec", - "thiserror", - "tokio", - "tracing", -] - -[[package]] -name = "hkdf" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" -dependencies = [ - "hmac", -] - -[[package]] -name = "hmac" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" -dependencies = [ - "digest", -] - -[[package]] -name = "hostname" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" -dependencies = [ - "libc", - "match_cfg", - "winapi", -] - -[[package]] -name = "http" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http-body" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" -dependencies = [ - "bytes", - "http", - "pin-project-lite", -] - -[[package]] -name = "httparse" -version = "1.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" - -[[package]] -name = "httpdate" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" - -[[package]] -name = "hyper" -version = "0.14.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2 0.5.7", - "tokio", - "tower-service", - "tracing", - "want", -] - -[[package]] -name = "idna" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "idna" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "if-addrs" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cabb0019d51a643781ff15c9c8a3e5dedc365c47211270f4e8f82812fedd8f0a" -dependencies = [ - "libc", - "windows-sys 0.48.0", -] - -[[package]] -name = "if-watch" -version = "3.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6b0422c86d7ce0e97169cc42e04ae643caf278874a7a3c87b8150a220dc7e1e" -dependencies = [ - "async-io 2.3.3", - "core-foundation", - "fnv", - "futures", - "if-addrs", - "ipnet", - "log", - "rtnetlink", - "smol", - "system-configuration", - "tokio", - "windows", -] - -[[package]] -name = "igd-next" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "064d90fec10d541084e7b39ead8875a5a80d9114a2b18791565253bae25f49e4" -dependencies = [ - "async-trait", - "attohttpc", - "bytes", - "futures", - "http", - "hyper", - "log", - "rand", - "tokio", - "url", - "xmltree", -] - -[[package]] -name = "indexmap" -version = "2.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" -dependencies = [ - "equivalent", - "hashbrown", -] - -[[package]] -name = "inout" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" -dependencies = [ - "generic-array", -] - -[[package]] -name = "instant" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "io-lifetimes" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" -dependencies = [ - "hermit-abi 0.3.9", - "libc", - "windows-sys 0.48.0", -] - -[[package]] -name = "ipconfig" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" -dependencies = [ - "socket2 0.5.7", - "widestring", - "windows-sys 0.48.0", - "winreg", -] - -[[package]] -name = "ipnet" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" - -[[package]] -name = "itertools" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "js-sys" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "kv-log-macro" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" -dependencies = [ - "log", -] - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" -dependencies = [ - "spin 0.9.8", -] - -[[package]] -name = "libc" -version = "0.2.155" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" - -[[package]] -name = "libm" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" - -[[package]] -name = "libp2p" -version = "0.53.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "681fb3f183edfbedd7a57d32ebe5dcdc0b9f94061185acf3c30249349cc6fc99" -dependencies = [ - "bytes", - "either", - "futures", - "futures-timer", - "getrandom", - "instant", - "libp2p-allow-block-list", - "libp2p-connection-limits", - "libp2p-core", - "libp2p-dns", - "libp2p-identify", - "libp2p-identity", - "libp2p-mdns", - "libp2p-metrics", - "libp2p-noise", - "libp2p-ping", - "libp2p-quic", - "libp2p-rendezvous", - "libp2p-swarm", - "libp2p-tcp", - "libp2p-upnp", - "libp2p-yamux", - "multiaddr", - "pin-project", - "rw-stream-sink", - "thiserror", -] - -[[package]] -name = "libp2p-allow-block-list" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "107b238b794cb83ab53b74ad5dcf7cca3200899b72fe662840cfb52f5b0a32e6" -dependencies = [ - "libp2p-core", - "libp2p-identity", - "libp2p-swarm", - "void", -] - -[[package]] -name = "libp2p-connection-limits" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7cd50a78ccfada14de94cbacd3ce4b0138157f376870f13d3a8422cd075b4fd" -dependencies = [ - "libp2p-core", - "libp2p-identity", - "libp2p-swarm", - "void", -] - -[[package]] -name = "libp2p-core" -version = "0.41.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5a8920cbd8540059a01950c1e5c96ea8d89eb50c51cd366fc18bdf540a6e48f" -dependencies = [ - "either", - "fnv", - "futures", - "futures-timer", - "libp2p-identity", - "multiaddr", - "multihash", - "multistream-select", - "once_cell", - "parking_lot", - "pin-project", - "quick-protobuf", - "rand", - "rw-stream-sink", - "smallvec", - "thiserror", - "tracing", - "unsigned-varint 0.8.0", - "void", - "web-time", -] - -[[package]] -name = "libp2p-dns" -version = "0.41.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d17cbcf7160ff35c3e8e560de4a068fe9d6cb777ea72840e48eb76ff9576c4b6" -dependencies = [ - "async-std-resolver", - "async-trait", - "futures", - "hickory-resolver", - "libp2p-core", - "libp2p-identity", - "parking_lot", - "smallvec", - "tracing", -] - -[[package]] -name = "libp2p-identify" -version = "0.44.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5d635ebea5ca0c3c3e77d414ae9b67eccf2a822be06091b9c1a0d13029a1e2f" -dependencies = [ - "asynchronous-codec 0.7.0", - "either", - "futures", - "futures-bounded", - "futures-timer", - "libp2p-core", - "libp2p-identity", - "libp2p-swarm", - "lru", - "quick-protobuf", - "quick-protobuf-codec 0.3.1", - "smallvec", - "thiserror", - "tracing", - "void", -] - -[[package]] -name = "libp2p-identity" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cca1eb2bc1fd29f099f3daaab7effd01e1a54b7c577d0ed082521034d912e8" -dependencies = [ - "bs58", - "ed25519-dalek", - "hkdf", - "multihash", - "quick-protobuf", - "rand", - "sha2", - "thiserror", - "tracing", - "zeroize", -] - -[[package]] -name = "libp2p-mdns" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49007d9a339b3e1d7eeebc4d67c05dbf23d300b7d091193ec2d3f26802d7faf2" -dependencies = [ - "async-io 2.3.3", - "async-std", - "data-encoding", - "futures", - "hickory-proto", - "if-watch", - "libp2p-core", - "libp2p-identity", - "libp2p-swarm", - "rand", - "smallvec", - "socket2 0.5.7", - "tokio", - "tracing", - "void", -] - -[[package]] -name = "libp2p-metrics" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdac91ae4f291046a3b2660c039a2830c931f84df2ee227989af92f7692d3357" -dependencies = [ - "futures", - "instant", - "libp2p-core", - "libp2p-identify", - "libp2p-identity", - "libp2p-ping", - "libp2p-swarm", - "pin-project", - "prometheus-client", -] - -[[package]] -name = "libp2p-noise" -version = "0.44.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecd0545ce077f6ea5434bcb76e8d0fe942693b4380aaad0d34a358c2bd05793" -dependencies = [ - "asynchronous-codec 0.7.0", - "bytes", - "curve25519-dalek", - "futures", - "libp2p-core", - "libp2p-identity", - "multiaddr", - "multihash", - "once_cell", - "quick-protobuf", - "rand", - "sha2", - "snow", - "static_assertions", - "thiserror", - "tracing", - "x25519-dalek", - "zeroize", -] - -[[package]] -name = "libp2p-ping" -version = "0.44.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1de5a6cf64fba7f7e8f2102711c9c6c043a8e56b86db8cd306492c517da3fb3" -dependencies = [ - "either", - "futures", - "futures-timer", - "instant", - "libp2p-core", - "libp2p-identity", - "libp2p-swarm", - "rand", - "tracing", - "void", -] - -[[package]] -name = "libp2p-quic" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c67296ad4e092e23f92aea3d2bdb6f24eab79c0929ed816dfb460ea2f4567d2b" -dependencies = [ - "async-std", - "bytes", - "futures", - "futures-timer", - "if-watch", - "libp2p-core", - "libp2p-identity", - "libp2p-tls", - "parking_lot", - "quinn", - "rand", - "ring 0.17.8", - "rustls", - "socket2 0.5.7", - "thiserror", - "tokio", - "tracing", -] - -[[package]] -name = "libp2p-rendezvous" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168a444a16f569771bcb48aa081a32724079156e64a730dd900276391ccb6385" -dependencies = [ - "async-trait", - "asynchronous-codec 0.6.2", - "bimap", - "futures", - "futures-timer", - "instant", - "libp2p-core", - "libp2p-identity", - "libp2p-request-response", - "libp2p-swarm", - "quick-protobuf", - "quick-protobuf-codec 0.2.0", - "rand", - "thiserror", - "tracing", - "void", -] - -[[package]] -name = "libp2p-request-response" -version = "0.26.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c314fe28368da5e3a262553fb0ad575c1c8934c461e10de10265551478163836" -dependencies = [ - "async-trait", - "futures", - "futures-bounded", - "futures-timer", - "instant", - "libp2p-core", - "libp2p-identity", - "libp2p-swarm", - "rand", - "smallvec", - "tracing", - "void", -] - -[[package]] -name = "libp2p-swarm" -version = "0.44.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80cae6cb75f89dbca53862f9ebe0b9f463aa7b302762fcfaafb9e51dcc9b0f7e" -dependencies = [ - "async-std", - "either", - "fnv", - "futures", - "futures-timer", - "instant", - "libp2p-core", - "libp2p-identity", - "libp2p-swarm-derive", - "lru", - "multistream-select", - "once_cell", - "rand", - "smallvec", - "tokio", - "tracing", - "void", -] - -[[package]] -name = "libp2p-swarm-derive" -version = "0.34.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5daceb9dd908417b6dfcfe8e94098bc4aac54500c282e78120b885dadc09b999" -dependencies = [ - "heck 0.5.0", - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "libp2p-tcp" -version = "0.41.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b2460fc2748919adff99ecbc1aab296e4579e41f374fb164149bd2c9e529d4c" -dependencies = [ - "async-io 1.13.0", - "futures", - "futures-timer", - "if-watch", - "libc", - "libp2p-core", - "libp2p-identity", - "socket2 0.5.7", - "tokio", - "tracing", -] - -[[package]] -name = "libp2p-tls" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b7b831e55ce2aa6c354e6861a85fdd4dd0a2b97d5e276fabac0e4810a71776" -dependencies = [ - "futures", - "futures-rustls", - "libp2p-core", - "libp2p-identity", - "rcgen", - "ring 0.17.8", - "rustls", - "rustls-webpki 0.101.7", - "thiserror", - "x509-parser", - "yasna", -] - -[[package]] -name = "libp2p-upnp" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccf04b0e3ff3de52d07d5fd6c3b061d0e7f908ffc683c32d9638caedce86fc8" -dependencies = [ - "futures", - "futures-timer", - "igd-next", - "libp2p-core", - "libp2p-swarm", - "tokio", - "tracing", - "void", -] - -[[package]] -name = "libp2p-yamux" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "200cbe50349a44760927d50b431d77bed79b9c0a3959de1af8d24a63434b71e5" -dependencies = [ - "either", - "futures", - "libp2p-core", - "thiserror", - "tracing", - "yamux 0.12.1", - "yamux 0.13.3", -] - -[[package]] -name = "linked-hash-map" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" - -[[package]] -name = "linux-raw-sys" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" - -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" -dependencies = [ - "value-bag", -] - -[[package]] -name = "lru" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" -dependencies = [ - "hashbrown", -] - -[[package]] -name = "lru-cache" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" -dependencies = [ - "linked-hash-map", -] - -[[package]] -name = "match_cfg" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" - -[[package]] -name = "matchers" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" -dependencies = [ - "regex-automata 0.1.10", -] - -[[package]] -name = "matrixmultiply" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7574c1cf36da4798ab73da5b215bbf444f50718207754cb522201d78d1cd0ff2" -dependencies = [ - "autocfg", - "rawpointer", -] - -[[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - -[[package]] -name = "miniz_oxide" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" -dependencies = [ - "adler", -] - -[[package]] -name = "mio" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4569e456d394deccd22ce1c1913e6ea0e54519f577285001215d33557431afe4" -dependencies = [ - "hermit-abi 0.3.9", - "libc", - "wasi", - "windows-sys 0.52.0", -] - -[[package]] -name = "multiaddr" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b852bc02a2da5feed68cd14fa50d0774b92790a5bdbfa932a813926c8472070" -dependencies = [ - "arrayref", - "byteorder", - "data-encoding", - "libp2p-identity", - "multibase", - "multihash", - "percent-encoding", - "serde", - "static_assertions", - "unsigned-varint 0.7.2", - "url", -] - -[[package]] -name = "multibase" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b3539ec3c1f04ac9748a260728e855f261b4977f5c3406612c884564f329404" -dependencies = [ - "base-x", - "data-encoding", - "data-encoding-macro", -] - -[[package]] -name = "multihash" -version = "0.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "076d548d76a0e2a0d4ab471d0b1c36c577786dfc4471242035d97a12a735c492" -dependencies = [ - "core2", - "unsigned-varint 0.7.2", -] - -[[package]] -name = "multimap" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" - -[[package]] -name = "multistream-select" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea0df8e5eec2298a62b326ee4f0d7fe1a6b90a09dfcf9df37b38f947a8c42f19" -dependencies = [ - "bytes", - "futures", - "log", - "pin-project", - "smallvec", - "unsigned-varint 0.7.2", -] - -[[package]] -name = "ndarray" -version = "0.15.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb12d4e967ec485a5f71c6311fe28158e9d6f4bc4a447b474184d0f91a8fa32" -dependencies = [ - "matrixmultiply", - "num-complex", - "num-integer", - "num-traits", - "rawpointer", -] - -[[package]] -name = "netlink-packet-core" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "345b8ab5bd4e71a2986663e88c56856699d060e78e152e6e9d7966fcd5491297" -dependencies = [ - "anyhow", - "byteorder", - "libc", - "netlink-packet-utils", -] - -[[package]] -name = "netlink-packet-route" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9ea4302b9759a7a88242299225ea3688e63c85ea136371bb6cf94fd674efaab" -dependencies = [ - "anyhow", - "bitflags 1.3.2", - "byteorder", - "libc", - "netlink-packet-core", - "netlink-packet-utils", -] - -[[package]] -name = "netlink-packet-utils" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ede8a08c71ad5a95cdd0e4e52facd37190977039a4704eb82a283f713747d34" -dependencies = [ - "anyhow", - "byteorder", - "paste", - "thiserror", -] - -[[package]] -name = "netlink-proto" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65b4b14489ab424703c092062176d52ba55485a89c076b4f9db05092b7223aa6" -dependencies = [ - "bytes", - "futures", - "log", - "netlink-packet-core", - "netlink-sys", - "thiserror", - "tokio", -] - -[[package]] -name = "netlink-sys" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "416060d346fbaf1f23f9512963e3e878f1a78e707cb699ba9215761754244307" -dependencies = [ - "async-io 1.13.0", - "bytes", - "futures", - "libc", - "log", - "tokio", -] - -[[package]] -name = "nix" -version = "0.24.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" -dependencies = [ - "bitflags 1.3.2", - "cfg-if", - "libc", -] - -[[package]] -name = "nohash-hasher" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" - -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - -[[package]] -name = "nu-ansi-term" -version = "0.46.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" -dependencies = [ - "overload", - "winapi", -] - -[[package]] -name = "num-bigint" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" -dependencies = [ - "num-integer", - "num-traits", -] - -[[package]] -name = "num-bigint-dig" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" -dependencies = [ - "byteorder", - "lazy_static", - "libm", - "num-integer", - "num-iter", - "num-traits", - "rand", - "serde", - "smallvec", -] - -[[package]] -name = "num-complex" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - -[[package]] -name = "num-integer" -version = "0.1.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-iter" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi 0.3.9", - "libc", -] - -[[package]] -name = "object" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce" -dependencies = [ - "memchr", -] - -[[package]] -name = "oid-registry" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c958dd45046245b9c3c2547369bb634eb461670b2e7e0de552905801a648d1d" -dependencies = [ - "asn1-rs", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "opaque-debug" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" - -[[package]] -name = "overload" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" - -[[package]] -name = "parking" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" - -[[package]] -name = "parking_lot" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-targets 0.52.6", -] - -[[package]] -name = "paste" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" - -[[package]] -name = "pem" -version = "3.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e459365e590736a54c3fa561947c84837534b8e9af6fc5bf781307e82658fae" -dependencies = [ - "base64", - "serde", -] - -[[package]] -name = "percent-encoding" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" - -[[package]] -name = "petgraph" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" -dependencies = [ - "fixedbitset", - "indexmap", -] - -[[package]] -name = "pin-project" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "piper" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1d5c74c9876f070d3e8fd503d748c7d974c3e48da8f41350fa5222ef9b4391" -dependencies = [ - "atomic-waker", - "fastrand 2.1.0", - "futures-io", -] - -[[package]] -name = "pkcs8" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" -dependencies = [ - "der", - "spki", -] - -[[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.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3ed00ed3fbf728b5816498ecd316d1716eecaced9c0c8d2c5a6740ca214985b" -dependencies = [ - "cfg-if", - "concurrent-queue", - "hermit-abi 0.4.0", - "pin-project-lite", - "rustix 0.38.34", - "tracing", - "windows-sys 0.52.0", -] - -[[package]] -name = "poly1305" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" -dependencies = [ - "cpufeatures", - "opaque-debug", - "universal-hash", -] - -[[package]] -name = "polyval" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25" -dependencies = [ - "cfg-if", - "cpufeatures", - "opaque-debug", - "universal-hash", -] - -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - -[[package]] -name = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - -[[package]] -name = "prettyplease" -version = "0.2.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" -dependencies = [ - "proc-macro2", - "syn 2.0.72", -] - -[[package]] -name = "proc-macro2" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "prometheus-client" -version = "0.22.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "504ee9ff529add891127c4827eb481bd69dc0ebc72e9a682e187db4caa60c3ca" -dependencies = [ - "dtoa", - "itoa", - "parking_lot", - "prometheus-client-derive-encode", -] - -[[package]] -name = "prometheus-client-derive-encode" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "prost" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" -dependencies = [ - "bytes", - "prost-derive", -] - -[[package]] -name = "prost-build" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" -dependencies = [ - "bytes", - "heck 0.5.0", - "itertools", - "log", - "multimap", - "once_cell", - "petgraph", - "prettyplease", - "prost", - "prost-types", - "regex", - "syn 2.0.72", - "tempfile", -] - -[[package]] -name = "prost-derive" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" -dependencies = [ - "anyhow", - "itertools", - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "prost-types" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" -dependencies = [ - "prost", -] - -[[package]] -name = "quick-error" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" - -[[package]] -name = "quick-protobuf" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d6da84cc204722a989e01ba2f6e1e276e190f22263d0cb6ce8526fcdb0d2e1f" -dependencies = [ - "byteorder", -] - -[[package]] -name = "quick-protobuf-codec" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ededb1cd78531627244d51dd0c7139fbe736c7d57af0092a76f0ffb2f56e98" -dependencies = [ - "asynchronous-codec 0.6.2", - "bytes", - "quick-protobuf", - "thiserror", - "unsigned-varint 0.7.2", -] - -[[package]] -name = "quick-protobuf-codec" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15a0580ab32b169745d7a39db2ba969226ca16738931be152a3209b409de2474" -dependencies = [ - "asynchronous-codec 0.7.0", - "bytes", - "quick-protobuf", - "thiserror", - "unsigned-varint 0.8.0", -] - -[[package]] -name = "quinn" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4ceeeeabace7857413798eb1ffa1e9c905a9946a57d81fb69b4b71c4d8eb3ad" -dependencies = [ - "async-io 2.3.3", - "async-std", - "bytes", - "futures-io", - "pin-project-lite", - "quinn-proto", - "quinn-udp", - "rustc-hash", - "rustls", - "thiserror", - "tokio", - "tracing", -] - -[[package]] -name = "quinn-proto" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddf517c03a109db8100448a4be38d498df8a210a99fe0e1b9eaf39e78c640efe" -dependencies = [ - "bytes", - "rand", - "ring 0.17.8", - "rustc-hash", - "rustls", - "slab", - "thiserror", - "tinyvec", - "tracing", -] - -[[package]] -name = "quinn-udp" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" -dependencies = [ - "libc", - "once_cell", - "socket2 0.5.7", - "windows-sys 0.52.0", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] - -[[package]] -name = "rawpointer" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" - -[[package]] -name = "rcgen" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52c4f3084aa3bc7dfbba4eff4fab2a54db4324965d8872ab933565e6fbd83bc6" -dependencies = [ - "pem", - "ring 0.16.20", - "time", - "yasna", -] - -[[package]] -name = "redox_syscall" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" -dependencies = [ - "bitflags 2.6.0", -] - -[[package]] -name = "regex" -version = "1.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata 0.4.7", - "regex-syntax 0.8.4", -] - -[[package]] -name = "regex-automata" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" -dependencies = [ - "regex-syntax 0.6.29", -] - -[[package]] -name = "regex-automata" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax 0.8.4", -] - -[[package]] -name = "regex-syntax" -version = "0.6.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" - -[[package]] -name = "regex-syntax" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" - -[[package]] -name = "resolv-conf" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00" -dependencies = [ - "hostname", - "quick-error", -] - -[[package]] -name = "ring" -version = "0.16.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" -dependencies = [ - "cc", - "libc", - "once_cell", - "spin 0.5.2", - "untrusted 0.7.1", - "web-sys", - "winapi", -] - -[[package]] -name = "ring" -version = "0.17.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" -dependencies = [ - "cc", - "cfg-if", - "getrandom", - "libc", - "spin 0.9.8", - "untrusted 0.9.0", - "windows-sys 0.52.0", -] - -[[package]] -name = "rtnetlink" -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", - "netlink-proto", - "nix", - "thiserror", - "tokio", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - -[[package]] -name = "rusticata-macros" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632" -dependencies = [ - "nom", -] - -[[package]] -name = "rustix" -version = "0.37.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" -dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.3.8", - "windows-sys 0.48.0", -] - -[[package]] -name = "rustix" -version = "0.38.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags 2.6.0", - "errno", - "libc", - "linux-raw-sys 0.4.14", - "windows-sys 0.52.0", -] - -[[package]] -name = "rustls" -version = "0.23.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c58f8c84392efc0a126acce10fa59ff7b3d2ac06ab451a33f2741989b806b044" -dependencies = [ - "once_cell", - "ring 0.17.8", - "rustls-pki-types", - "rustls-webpki 0.102.6", - "subtle", - "zeroize", -] - -[[package]] -name = "rustls-pki-types" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" - -[[package]] -name = "rustls-webpki" -version = "0.101.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" -dependencies = [ - "ring 0.17.8", - "untrusted 0.9.0", -] - -[[package]] -name = "rustls-webpki" -version = "0.102.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e6b52d4fda176fd835fdc55a835d4a89b8499cad995885a21149d5ad62f852e" -dependencies = [ - "ring 0.17.8", - "rustls-pki-types", - "untrusted 0.9.0", -] - -[[package]] -name = "rw-stream-sink" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8c9026ff5d2f23da5e45bbc283f156383001bfb09c4e44256d02c1a685fe9a1" -dependencies = [ - "futures", - "pin-project", - "static_assertions", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - -[[package]] -name = "serde" -version = "1.0.204" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.204" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "sha2" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "sharded-slab" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" -dependencies = [ - "rand_core", -] - -[[package]] -name = "slab" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "850948bee068e713b8ab860fe1adc4d109676ab4c3b621fd8147f06b261f2f85" -dependencies = [ - "aes-gcm", - "blake2", - "chacha20poly1305", - "curve25519-dalek", - "rand_core", - "ring 0.17.8", - "rustc_version", - "sha2", - "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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "spin" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" - -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" - -[[package]] -name = "spki" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" -dependencies = [ - "base64ct", - "der", -] - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "subtle" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.72" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "synstructure" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "system-configuration" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" -dependencies = [ - "cfg-if", - "fastrand 2.1.0", - "rustix 0.38.34", - "windows-sys 0.52.0", -] - -[[package]] -name = "thiserror" -version = "1.0.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "thread_local" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" -dependencies = [ - "cfg-if", - "once_cell", -] - -[[package]] -name = "time" -version = "0.3.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" -dependencies = [ - "deranged", - "itoa", - "num-conv", - "powerfmt", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" - -[[package]] -name = "time-macros" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" -dependencies = [ - "num-conv", - "time-core", -] - -[[package]] -name = "tinyvec" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - -[[package]] -name = "tokio" -version = "1.39.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d040ac2b29ab03b09d4129c2f5bbd012a3ac2f79d38ff506a4bf8dd34b0eac8a" -dependencies = [ - "backtrace", - "bytes", - "libc", - "mio", - "pin-project-lite", - "socket2 0.5.7", - "tokio-macros", - "windows-sys 0.52.0", -] - -[[package]] -name = "tokio-macros" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "tokio-util" -version = "0.7.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - -[[package]] -name = "tower-service" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", - "valuable", -] - -[[package]] -name = "tracing-log" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" -dependencies = [ - "log", - "once_cell", - "tracing-core", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" -dependencies = [ - "matchers", - "nu-ansi-term", - "once_cell", - "regex", - "sharded-slab", - "smallvec", - "thread_local", - "tracing", - "tracing-core", - "tracing-log", -] - -[[package]] -name = "try-lock" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" - -[[package]] -name = "typenum" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" - -[[package]] -name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-normalization" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "universal-hash" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" -dependencies = [ - "crypto-common", - "subtle", -] - -[[package]] -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" - -[[package]] -name = "untrusted" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" - -[[package]] -name = "untrusted" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" - -[[package]] -name = "url" -version = "2.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" -dependencies = [ - "form_urlencoded", - "idna 0.5.0", - "percent-encoding", -] - -[[package]] -name = "valuable" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" - -[[package]] -name = "value-bag" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a84c137d37ab0142f0f2ddfe332651fdbf252e7b7dbb4e67b6c1f1b2e925101" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "void" -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 = "want" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" -dependencies = [ - "try-lock", -] - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "wasm-bindgen" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn 2.0.72", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" -dependencies = [ - "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" - -[[package]] -name = "web-sys" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "web-time" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "widestring" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7219d36b6eac893fa81e84ebe06485e7dcbb616177469b142df14f1f4deb1311" - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows" -version = "0.51.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" -dependencies = [ - "windows-core", - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-core" -version = "0.51.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" - -[[package]] -name = "winreg" -version = "0.50.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - -[[package]] -name = "x25519-dalek" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7e468321c81fb07fa7f4c636c3972b9100f0346e5b6a9f2bd0603a52f7ed277" -dependencies = [ - "curve25519-dalek", - "rand_core", - "serde", - "zeroize", -] - -[[package]] -name = "x509-parser" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcbc162f30700d6f3f82a24bf7cc62ffe7caea42c0b2cba8bf7f3ae50cf51f69" -dependencies = [ - "asn1-rs", - "data-encoding", - "der-parser", - "lazy_static", - "nom", - "oid-registry", - "rusticata-macros", - "thiserror", - "time", -] - -[[package]] -name = "xml-rs" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "791978798f0597cfc70478424c2b4fdc2b7a8024aaff78497ef00f24ef674193" - -[[package]] -name = "xmltree" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7d8a75eaf6557bb84a65ace8609883db44a29951042ada9b393151532e41fcb" -dependencies = [ - "xml-rs", -] - -[[package]] -name = "yamux" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed0164ae619f2dc144909a9f082187ebb5893693d8c0196e8085283ccd4b776" -dependencies = [ - "futures", - "log", - "nohash-hasher", - "parking_lot", - "pin-project", - "rand", - "static_assertions", -] - -[[package]] -name = "yamux" -version = "0.13.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31b5e376a8b012bee9c423acdbb835fc34d45001cfa3106236a624e4b738028" -dependencies = [ - "futures", - "log", - "nohash-hasher", - "parking_lot", - "pin-project", - "rand", - "static_assertions", - "web-time", -] - -[[package]] -name = "yasna" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" -dependencies = [ - "time", -] - -[[package]] -name = "zerocopy" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "zeroize" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" -dependencies = [ - "zeroize_derive", -] - -[[package]] -name = "zeroize_derive" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] diff --git a/packages/ciphernode/rendezvous/Cargo.toml b/packages/ciphernode/rendezvous/Cargo.toml deleted file mode 100644 index 2d573bd6..00000000 --- a/packages/ciphernode/rendezvous/Cargo.toml +++ /dev/null @@ -1,30 +0,0 @@ -[package] -name = "rendezvous" -version = "0.1.0" -edition = "2021" -description = ": coordinates the encryption and decryption of enclave computations" -repository = "https://github.com/gnosisguild/enclave/packages/ciphernode" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -fhe = { workspace = true } -fhe-traits = { workspace = true } -fhe-util = { workspace = true } -async-std = { workspace = true, features = ["attributes"] } -async-trait = { workspace = true } -futures = { workspace = true } -libp2p = { workspace = true, features = [ - "async-std", - "identify", - "macros", - "noise", - "ping", - "rendezvous", - "tcp", - "tokio", - "yamux", -] } -tokio = { workspace = true, features = ["rt-multi-thread", "macros", "time"] } -tracing = { workspace = true } -tracing-subscriber = { workspace = true, features = ["env-filter"] } diff --git a/packages/ciphernode/rendezvous/src/bin/discover.rs b/packages/ciphernode/rendezvous/src/bin/discover.rs deleted file mode 100644 index b0be0ada..00000000 --- a/packages/ciphernode/rendezvous/src/bin/discover.rs +++ /dev/null @@ -1,110 +0,0 @@ -use futures::StreamExt; -use libp2p::{ - multiaddr::Protocol, - noise, ping, rendezvous, - swarm::{NetworkBehaviour, SwarmEvent}, - tcp, yamux, Multiaddr, -}; -use std::error::Error; -use std::time::Duration; -use tracing_subscriber::EnvFilter; - -const NAMESPACE: &str = "rendezvous"; - -#[tokio::main] -async fn main() -> Result<(), Box> { - let _ = tracing_subscriber::fmt() - .with_env_filter(EnvFilter::from_default_env()) - .try_init(); - - let rendezvous_point_address = "/ip4/127.0.0.1/tcp/62649".parse::().unwrap(); - let rendezvous_point = "12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN" - .parse() - .unwrap(); - - let mut swarm = libp2p::SwarmBuilder::with_new_identity() - .with_tokio() - .with_tcp( - tcp::Config::default(), - noise::Config::new, - yamux::Config::default, - )? - .with_behaviour(|key| MyBehaviour { - rendezvous: rendezvous::client::Behaviour::new(key.clone()), - ping: ping::Behaviour::new(ping::Config::new().with_interval(Duration::from_secs(1))), - })? - .with_swarm_config(|cfg| cfg.with_idle_connection_timeout(Duration::from_secs(5))) - .build(); - - swarm.dial(rendezvous_point_address.clone()).unwrap(); - - let mut discover_tick = tokio::time::interval(Duration::from_secs(30)); - let mut cookie = None; - - loop { - tokio::select! { - event = swarm.select_next_some() => match event { - SwarmEvent::ConnectionEstablished { peer_id, .. } if peer_id == rendezvous_point => { - tracing::info!( - "Connected to rendezvous point, discovering nodes in '{}' namespace ...", - NAMESPACE - ); - - swarm.behaviour_mut().rendezvous.discover( - Some(rendezvous::Namespace::new(NAMESPACE.to_string()).unwrap()), - None, - None, - rendezvous_point, - ); - } - SwarmEvent::Behaviour(MyBehaviourEvent::Rendezvous(rendezvous::client::Event::Discovered { - registrations, - cookie: new_cookie, - .. - })) => { - cookie.replace(new_cookie); - - for registration in registrations { - for address in registration.record.addresses() { - let peer = registration.record.peer_id(); - tracing::info!(%peer, %address, "Discovered peer"); - - let p2p_suffix = Protocol::P2p(peer); - let address_with_p2p = - if !address.ends_with(&Multiaddr::empty().with(p2p_suffix.clone())) { - address.clone().with(p2p_suffix) - } else { - address.clone() - }; - - swarm.dial(address_with_p2p).unwrap(); - } - } - } - SwarmEvent::Behaviour(MyBehaviourEvent::Ping(ping::Event { - peer, - result: Ok(rtt), - .. - })) if peer != rendezvous_point => { - tracing::info!(%peer, "Ping is {}ms", rtt.as_millis()) - } - other => { - tracing::debug!("Unhandled {:?}", other); - } - }, - _ = discover_tick.tick(), if cookie.is_some() => - swarm.behaviour_mut().rendezvous.discover( - Some(rendezvous::Namespace::new(NAMESPACE.to_string()).unwrap()), - cookie.clone(), - None, - rendezvous_point - ) - } - } -} - -#[derive(NetworkBehaviour)] -struct MyBehaviour { - rendezvous: rendezvous::client::Behaviour, - ping: ping::Behaviour, -} \ No newline at end of file diff --git a/packages/ciphernode/rendezvous/src/bin/discovery.rs b/packages/ciphernode/rendezvous/src/bin/discovery.rs deleted file mode 100644 index b0be0ada..00000000 --- a/packages/ciphernode/rendezvous/src/bin/discovery.rs +++ /dev/null @@ -1,110 +0,0 @@ -use futures::StreamExt; -use libp2p::{ - multiaddr::Protocol, - noise, ping, rendezvous, - swarm::{NetworkBehaviour, SwarmEvent}, - tcp, yamux, Multiaddr, -}; -use std::error::Error; -use std::time::Duration; -use tracing_subscriber::EnvFilter; - -const NAMESPACE: &str = "rendezvous"; - -#[tokio::main] -async fn main() -> Result<(), Box> { - let _ = tracing_subscriber::fmt() - .with_env_filter(EnvFilter::from_default_env()) - .try_init(); - - let rendezvous_point_address = "/ip4/127.0.0.1/tcp/62649".parse::().unwrap(); - let rendezvous_point = "12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN" - .parse() - .unwrap(); - - let mut swarm = libp2p::SwarmBuilder::with_new_identity() - .with_tokio() - .with_tcp( - tcp::Config::default(), - noise::Config::new, - yamux::Config::default, - )? - .with_behaviour(|key| MyBehaviour { - rendezvous: rendezvous::client::Behaviour::new(key.clone()), - ping: ping::Behaviour::new(ping::Config::new().with_interval(Duration::from_secs(1))), - })? - .with_swarm_config(|cfg| cfg.with_idle_connection_timeout(Duration::from_secs(5))) - .build(); - - swarm.dial(rendezvous_point_address.clone()).unwrap(); - - let mut discover_tick = tokio::time::interval(Duration::from_secs(30)); - let mut cookie = None; - - loop { - tokio::select! { - event = swarm.select_next_some() => match event { - SwarmEvent::ConnectionEstablished { peer_id, .. } if peer_id == rendezvous_point => { - tracing::info!( - "Connected to rendezvous point, discovering nodes in '{}' namespace ...", - NAMESPACE - ); - - swarm.behaviour_mut().rendezvous.discover( - Some(rendezvous::Namespace::new(NAMESPACE.to_string()).unwrap()), - None, - None, - rendezvous_point, - ); - } - SwarmEvent::Behaviour(MyBehaviourEvent::Rendezvous(rendezvous::client::Event::Discovered { - registrations, - cookie: new_cookie, - .. - })) => { - cookie.replace(new_cookie); - - for registration in registrations { - for address in registration.record.addresses() { - let peer = registration.record.peer_id(); - tracing::info!(%peer, %address, "Discovered peer"); - - let p2p_suffix = Protocol::P2p(peer); - let address_with_p2p = - if !address.ends_with(&Multiaddr::empty().with(p2p_suffix.clone())) { - address.clone().with(p2p_suffix) - } else { - address.clone() - }; - - swarm.dial(address_with_p2p).unwrap(); - } - } - } - SwarmEvent::Behaviour(MyBehaviourEvent::Ping(ping::Event { - peer, - result: Ok(rtt), - .. - })) if peer != rendezvous_point => { - tracing::info!(%peer, "Ping is {}ms", rtt.as_millis()) - } - other => { - tracing::debug!("Unhandled {:?}", other); - } - }, - _ = discover_tick.tick(), if cookie.is_some() => - swarm.behaviour_mut().rendezvous.discover( - Some(rendezvous::Namespace::new(NAMESPACE.to_string()).unwrap()), - cookie.clone(), - None, - rendezvous_point - ) - } - } -} - -#[derive(NetworkBehaviour)] -struct MyBehaviour { - rendezvous: rendezvous::client::Behaviour, - ping: ping::Behaviour, -} \ No newline at end of file diff --git a/packages/ciphernode/rendezvous/src/bin/identify.rs b/packages/ciphernode/rendezvous/src/bin/identify.rs deleted file mode 100644 index c492de16..00000000 --- a/packages/ciphernode/rendezvous/src/bin/identify.rs +++ /dev/null @@ -1,122 +0,0 @@ -use futures::StreamExt; -use libp2p::{ - identify, noise, ping, rendezvous, - swarm::{NetworkBehaviour, SwarmEvent}, - tcp, yamux, Multiaddr, -}; -use std::time::Duration; -use tracing_subscriber::EnvFilter; - -#[tokio::main] -async fn main() { - let _ = tracing_subscriber::fmt() - .with_env_filter(EnvFilter::from_default_env()) - .try_init(); - - let rendezvous_point_address = "/ip4/127.0.0.1/tcp/62649".parse::().unwrap(); - let rendezvous_point = "12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN" - .parse() - .unwrap(); - - let mut swarm = libp2p::SwarmBuilder::with_new_identity() - .with_tokio() - .with_tcp( - tcp::Config::default(), - noise::Config::new, - yamux::Config::default, - ) - .unwrap() - .with_behaviour(|key| MyBehaviour { - identify: identify::Behaviour::new(identify::Config::new( - "rendezvous-example/1.0.0".to_string(), - key.public(), - )), - rendezvous: rendezvous::client::Behaviour::new(key.clone()), - ping: ping::Behaviour::new(ping::Config::new().with_interval(Duration::from_secs(1))), - }) - .unwrap() - .with_swarm_config(|cfg| cfg.with_idle_connection_timeout(Duration::from_secs(5))) - .build(); - - let _ = swarm.listen_on("/ip4/0.0.0.0/tcp/0".parse().unwrap()); - - swarm.dial(rendezvous_point_address.clone()).unwrap(); - - while let Some(event) = swarm.next().await { - match event { - SwarmEvent::NewListenAddr { address, .. } => { - tracing::info!("Listening on {}", address); - } - SwarmEvent::ConnectionClosed { - peer_id, - cause: Some(error), - .. - } if peer_id == rendezvous_point => { - tracing::error!("Lost connection to rendezvous point {}", error); - } - // once `/identify` did its job, we know our external address and can register - SwarmEvent::Behaviour(MyBehaviourEvent::Identify(identify::Event::Received { - info, - .. - })) => { - // Register our external address. Needs to be done explicitly - // for this case, as it's a local address. - swarm.add_external_address(info.observed_addr); - if let Err(error) = swarm.behaviour_mut().rendezvous.register( - rendezvous::Namespace::from_static("rendezvous"), - rendezvous_point, - None, - ) { - tracing::error!("Failed to register: {error}"); - return; - } - } - SwarmEvent::Behaviour(MyBehaviourEvent::Rendezvous( - rendezvous::client::Event::Registered { - namespace, - ttl, - rendezvous_node, - }, - )) => { - tracing::info!( - "Registered for namespace '{}' at rendezvous point {} for the next {} seconds", - namespace, - rendezvous_node, - ttl - ); - } - SwarmEvent::Behaviour(MyBehaviourEvent::Rendezvous( - rendezvous::client::Event::RegisterFailed { - rendezvous_node, - namespace, - error, - }, - )) => { - tracing::error!( - "Failed to register: rendezvous_node={}, namespace={}, error_code={:?}", - rendezvous_node, - namespace, - error - ); - return; - } - SwarmEvent::Behaviour(MyBehaviourEvent::Ping(ping::Event { - peer, - result: Ok(rtt), - .. - })) if peer != rendezvous_point => { - tracing::info!("Ping to {} is {}ms", peer, rtt.as_millis()) - } - other => { - tracing::debug!("Unhandled {:?}", other); - } - } - } -} - -#[derive(NetworkBehaviour)] -struct MyBehaviour { - identify: identify::Behaviour, - rendezvous: rendezvous::client::Behaviour, - ping: ping::Behaviour, -} \ No newline at end of file diff --git a/packages/ciphernode/rendezvous/src/bin/register.rs b/packages/ciphernode/rendezvous/src/bin/register.rs deleted file mode 100644 index 350c9816..00000000 --- a/packages/ciphernode/rendezvous/src/bin/register.rs +++ /dev/null @@ -1,115 +0,0 @@ -use futures::StreamExt; -use libp2p::{ - noise, ping, rendezvous, - swarm::{NetworkBehaviour, SwarmEvent}, - tcp, yamux, Multiaddr, -}; -use std::time::Duration; -use tracing_subscriber::EnvFilter; - -#[tokio::main] -async fn main() { - let _ = tracing_subscriber::fmt() - .with_env_filter(EnvFilter::from_default_env()) - .try_init(); - - let rendezvous_point_address = "/ip4/127.0.0.1/tcp/62649".parse::().unwrap(); - let rendezvous_point = "12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN" - .parse() - .unwrap(); - - let mut swarm = libp2p::SwarmBuilder::with_new_identity() - .with_tokio() - .with_tcp( - tcp::Config::default(), - noise::Config::new, - yamux::Config::default, - ) - .unwrap() - .with_behaviour(|key| MyBehaviour { - rendezvous: rendezvous::client::Behaviour::new(key.clone()), - ping: ping::Behaviour::new(ping::Config::new().with_interval(Duration::from_secs(1))), - }) - .unwrap() - .with_swarm_config(|cfg| cfg.with_idle_connection_timeout(Duration::from_secs(5))) - .build(); - - // In production the external address should be the publicly facing IP address of the rendezvous point. - // This address is recorded in the registration entry by the rendezvous point. - let external_address = "/ip4/127.0.0.1/tcp/0".parse::().unwrap(); - swarm.add_external_address(external_address); - - swarm.dial(rendezvous_point_address.clone()).unwrap(); - - while let Some(event) = swarm.next().await { - match event { - SwarmEvent::NewListenAddr { address, .. } => { - tracing::info!("Listening on {}", address); - } - SwarmEvent::ConnectionClosed { - peer_id, - cause: Some(error), - .. - } if peer_id == rendezvous_point => { - tracing::error!("Lost connection to rendezvous point {}", error); - } - SwarmEvent::ConnectionEstablished { peer_id, .. } if peer_id == rendezvous_point => { - if let Err(error) = swarm.behaviour_mut().rendezvous.register( - rendezvous::Namespace::from_static("rendezvous"), - rendezvous_point, - None, - ) { - tracing::error!("Failed to register: {error}"); - return; - } - tracing::info!("Connection established with rendezvous point {}", peer_id); - } - // once `/identify` did its job, we know our external address and can register - SwarmEvent::Behaviour(MyBehaviourEvent::Rendezvous( - rendezvous::client::Event::Registered { - namespace, - ttl, - rendezvous_node, - }, - )) => { - tracing::info!( - "Registered for namespace '{}' at rendezvous point {} for the next {} seconds", - namespace, - rendezvous_node, - ttl - ); - } - SwarmEvent::Behaviour(MyBehaviourEvent::Rendezvous( - rendezvous::client::Event::RegisterFailed { - rendezvous_node, - namespace, - error, - }, - )) => { - tracing::error!( - "Failed to register: rendezvous_node={}, namespace={}, error_code={:?}", - rendezvous_node, - namespace, - error - ); - return; - } - SwarmEvent::Behaviour(MyBehaviourEvent::Ping(ping::Event { - peer, - result: Ok(rtt), - .. - })) if peer != rendezvous_point => { - tracing::info!("Ping to {} is {}ms", peer, rtt.as_millis()) - } - other => { - tracing::debug!("Unhandled {:?}", other); - } - } - } -} - -#[derive(NetworkBehaviour)] -struct MyBehaviour { - rendezvous: rendezvous::client::Behaviour, - ping: ping::Behaviour, -} \ No newline at end of file diff --git a/packages/ciphernode/rendezvous/src/main.rs b/packages/ciphernode/rendezvous/src/main.rs deleted file mode 100644 index efd92bbd..00000000 --- a/packages/ciphernode/rendezvous/src/main.rs +++ /dev/null @@ -1,84 +0,0 @@ -use futures::StreamExt; -use libp2p::{ - identify, noise, ping, rendezvous, - swarm::{NetworkBehaviour, SwarmEvent}, - tcp, yamux, -}; -use std::error::Error; -use std::time::Duration; -use tracing_subscriber::EnvFilter; - -#[tokio::main] -async fn main() -> Result<(), Box> { - let _ = tracing_subscriber::fmt() - .with_env_filter(EnvFilter::from_default_env()) - .try_init(); - - // Results in PeerID 12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN which is - // used as the rendezvous point by the other peer examples. - let keypair = libp2p::identity::Keypair::ed25519_from_bytes([0; 32]).unwrap(); - - let mut swarm = libp2p::SwarmBuilder::with_existing_identity(keypair) - .with_tokio() - .with_tcp( - tcp::Config::default(), - noise::Config::new, - yamux::Config::default, - )? - .with_behaviour(|key| MyBehaviour { - identify: identify::Behaviour::new(identify::Config::new( - "rendezvous-example/1.0.0".to_string(), - key.public(), - )), - rendezvous: rendezvous::server::Behaviour::new(rendezvous::server::Config::default()), - ping: ping::Behaviour::new(ping::Config::new().with_interval(Duration::from_secs(1))), - })? - .with_swarm_config(|cfg| cfg.with_idle_connection_timeout(Duration::from_secs(5))) - .build(); - - let _ = swarm.listen_on("/ip4/0.0.0.0/tcp/62649".parse().unwrap()); - - while let Some(event) = swarm.next().await { - match event { - SwarmEvent::ConnectionEstablished { peer_id, .. } => { - tracing::info!("Connected to {}", peer_id); - } - SwarmEvent::ConnectionClosed { peer_id, .. } => { - tracing::info!("Disconnected from {}", peer_id); - } - SwarmEvent::Behaviour(MyBehaviourEvent::Rendezvous( - rendezvous::server::Event::PeerRegistered { peer, registration }, - )) => { - tracing::info!( - "Peer {} registered for namespace '{}'", - peer, - registration.namespace - ); - } - SwarmEvent::Behaviour(MyBehaviourEvent::Rendezvous( - rendezvous::server::Event::DiscoverServed { - enquirer, - registrations, - }, - )) => { - tracing::info!( - "Served peer {} with {} registrations", - enquirer, - registrations.len() - ); - } - other => { - tracing::debug!("Unhandled {:?}", other); - } - } - } - - Ok(()) -} - -#[derive(NetworkBehaviour)] -struct MyBehaviour { - identify: identify::Behaviour, - rendezvous: rendezvous::server::Behaviour, - ping: ping::Behaviour, -} diff --git a/packages/ciphernode/tests/Cargo.toml b/packages/ciphernode/tests/Cargo.toml index cf370b21..9bc1d083 100644 --- a/packages/ciphernode/tests/Cargo.toml +++ b/packages/ciphernode/tests/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [dependencies] -p2p = { path = "../p2p" } +net = { path = "../net" } bfv = { path = "../bfv" } sortition = { path = "../sortition" } enclave-core = { path = "../core" } diff --git a/packages/ciphernode/tests/tests/test_aggregation_and_decryption.rs b/packages/ciphernode/tests/tests/test_aggregation_and_decryption.rs index 9e12fab6..4839877c 100644 --- a/packages/ciphernode/tests/tests/test_aggregation_and_decryption.rs +++ b/packages/ciphernode/tests/tests/test_aggregation_and_decryption.rs @@ -8,7 +8,7 @@ use enclave_core::{ }; use fhe::{setup_crp_params, ParamsWithCrp, SharedRng}; use logger::SimpleLogger; -use p2p::P2p; +use net::NetworkRelay; use router::{ CiphernodeSelector, E3RequestRouter, FheFeature, KeyshareFeature, PlaintextAggregatorFeature, PublicKeyAggregatorFeature, RepositoriesFactory, @@ -468,7 +468,7 @@ async fn test_p2p_actor_forwards_events_to_network() -> Result<()> { let (tx, mut output) = channel(100); // Transmit byte events to the network let (input, rx) = channel(100); // Receive byte events from the network let bus = EventBus::new(true).start(); - P2p::spawn_and_listen(bus.clone(), tx.clone(), rx); + NetworkRelay::setup(bus.clone(), tx.clone(), rx); // Capture messages from output on msgs vec let msgs: Arc>>> = Arc::new(Mutex::new(Vec::new())); @@ -514,14 +514,14 @@ async fn test_p2p_actor_forwards_events_to_network() -> Result<()> { assert_eq!( *msgs.lock().await, vec![evt_1.to_bytes()?, evt_2.to_bytes()?], // notice no local events - "P2p did not transmit correct events to the network" + "NetworkRelay did not transmit correct events to the network" ); assert_eq!( history, vec![evt_1, evt_2, local_evt_3], // all local events that have been broadcast but no // events from the loopback - "P2p must not retransmit forwarded event to event bus" + "NetworkRelay must not retransmit forwarded event to event bus" ); Ok(()) @@ -535,7 +535,7 @@ async fn test_p2p_actor_forwards_events_to_bus() -> Result<()> { let (tx, _) = channel(100); // Transmit byte events to the network let (input, rx) = channel(100); // Receive byte events from the network let bus = EventBus::new(true).start(); - P2p::spawn_and_listen(bus.clone(), tx.clone(), rx); + NetworkRelay::setup(bus.clone(), tx.clone(), rx); // Capture messages from output on msgs vec let event = EnclaveEvent::from(E3Requested { diff --git a/tests/basic_integration/README.md b/tests/basic_integration/README.md new file mode 100644 index 00000000..273f1f54 --- /dev/null +++ b/tests/basic_integration/README.md @@ -0,0 +1,21 @@ +# Integration Tests + +You can run these tests like so: + +Run all tests: + +``` +yarn test:integration +``` + +Run an individual test: + +``` +yarn test:integration +``` + +Eg. + +``` +yarn test:integration net +``` diff --git a/tests/basic_integration/fns.sh b/tests/basic_integration/fns.sh index 78f45a8e..720fcd80 100644 --- a/tests/basic_integration/fns.sh +++ b/tests/basic_integration/fns.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash +set -euo pipefail # Stricter error handling # Get the script's location SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" diff --git a/tests/basic_integration/net.sh b/tests/basic_integration/net.sh new file mode 100755 index 00000000..f7f32ad9 --- /dev/null +++ b/tests/basic_integration/net.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +set -eu + +cd ./packages/ciphernode/net/tests && ./run.sh diff --git a/tests/basic_integration/test.sh b/tests/basic_integration/test.sh index 5377d3b7..7e7ad3fd 100755 --- a/tests/basic_integration/test.sh +++ b/tests/basic_integration/test.sh @@ -7,6 +7,7 @@ THIS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" if [ $# -eq 0 ]; then "$THIS_DIR/persist.sh" "$THIS_DIR/base.sh" + "$THIS_DIR/net.sh" else "$THIS_DIR/$1.sh" fi