From f6e68b310d10a7108ad6e213005082163124c838 Mon Sep 17 00:00:00 2001 From: ackintosh Date: Mon, 27 Mar 2023 08:55:46 +0900 Subject: [PATCH 01/11] Add flood publishing --- flood_publishing/Cargo.lock | 4524 +++++++++++++++++++++++++++++++ flood_publishing/Cargo.toml | 21 + flood_publishing/Dockerfile | 46 + flood_publishing/README.md | 10 + flood_publishing/manifest.toml | 21 + flood_publishing/src/main.rs | 183 ++ flood_publishing/src/network.rs | 219 ++ 7 files changed, 5024 insertions(+) create mode 100644 flood_publishing/Cargo.lock create mode 100644 flood_publishing/Cargo.toml create mode 100644 flood_publishing/Dockerfile create mode 100644 flood_publishing/README.md create mode 100644 flood_publishing/manifest.toml create mode 100644 flood_publishing/src/main.rs create mode 100644 flood_publishing/src/network.rs diff --git a/flood_publishing/Cargo.lock b/flood_publishing/Cargo.lock new file mode 100644 index 0000000..759db97 --- /dev/null +++ b/flood_publishing/Cargo.lock @@ -0,0 +1,4524 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "aead" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fc95d1bdb8e6666b2b217308eeeb09f2d6728d104be3e31916cc74d15420331" +dependencies = [ + "generic-array", +] + +[[package]] +name = "aead" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" +dependencies = [ + "generic-array", + "rand_core 0.6.4", +] + +[[package]] +name = "aead" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c192eb8f11fc081b0fe4259ba5af04217d4e0faddd02417310a927911abd7c8" +dependencies = [ + "crypto-common", + "generic-array", +] + +[[package]] +name = "aes" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884391ef1066acaa41e766ba8f596341b96e93ce34f9a43e7d24bf0a0eaf0561" +dependencies = [ + "aes-soft", + "aesni", + "cipher 0.2.5", +] + +[[package]] +name = "aes" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" +dependencies = [ + "cfg-if", + "cipher 0.3.0", + "cpufeatures", + "opaque-debug", +] + +[[package]] +name = "aes" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "433cfd6710c9986c576a25ca913c39d66a6474107b406f34f91d4a8923395241" +dependencies = [ + "cfg-if", + "cipher 0.4.4", + "cpufeatures", +] + +[[package]] +name = "aes-gcm" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df5f85a83a7d8b0442b6aa7b504b8212c1733da07b98aae43d4bc21b2cb3cdf6" +dependencies = [ + "aead 0.4.3", + "aes 0.7.5", + "cipher 0.3.0", + "ctr 0.8.0", + "ghash 0.4.4", + "subtle", +] + +[[package]] +name = "aes-gcm" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82e1366e0c69c9f927b1fa5ce2c7bf9eafc8f9268c0b9800729e8b267612447c" +dependencies = [ + "aead 0.5.1", + "aes 0.8.2", + "cipher 0.4.4", + "ctr 0.9.2", + "ghash 0.5.0", + "subtle", +] + +[[package]] +name = "aes-soft" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be14c7498ea50828a38d0e24a765ed2effe92a705885b57d029cd67d45744072" +dependencies = [ + "cipher 0.2.5", + "opaque-debug", +] + +[[package]] +name = "aesni" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea2e11f5e94c2f7d386164cc2aa1f97823fed6f259e486940a71c174dd01b0ce" +dependencies = [ + "cipher 0.2.5", + "opaque-debug", +] + +[[package]] +name = "aho-corasick" +version = "0.7.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +dependencies = [ + "memchr", +] + +[[package]] +name = "anyhow" +version = "1.0.70" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7de8ce5e0f9f8d88245311066a578d72b7af3e7088f32783804676302df237e4" + +[[package]] +name = "arc-swap" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" + +[[package]] +name = "arrayref" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" + +[[package]] +name = "arrayvec" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" + +[[package]] +name = "asn1-rs" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30ff05a702273012438132f449575dbc804e27b2f3cbe3069aa237d26c98fa33" +dependencies = [ + "asn1-rs-derive 0.1.0", + "asn1-rs-impl", + "displaydoc", + "nom", + "num-traits", + "rusticata-macros", + "thiserror", + "time", +] + +[[package]] +name = "asn1-rs" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6fd5ddaf0351dff5b8da21b2fb4ff8e08ddd02857f0bf69c47639106c0fff0" +dependencies = [ + "asn1-rs-derive 0.4.0", + "asn1-rs-impl", + "displaydoc", + "nom", + "num-traits", + "rusticata-macros", + "thiserror", + "time", +] + +[[package]] +name = "asn1-rs-derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db8b7511298d5b7784b40b092d9e9dcd3a627a5707e4b5e507931ab0d44eeebf" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "synstructure", +] + +[[package]] +name = "asn1-rs-derive" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "synstructure", +] + +[[package]] +name = "asn1-rs-impl" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "asn1_der" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e22d1f4b888c298a027c99dc9048015fac177587de20fc30232a057dfbe24a21" + +[[package]] +name = "async-io" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" +dependencies = [ + "async-lock", + "autocfg", + "cfg-if", + "concurrent-queue", + "futures-lite", + "log", + "parking", + "polling", + "rustix 0.37.3", + "slab", + "socket2", + "waker-fn", +] + +[[package]] +name = "async-lock" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa24f727524730b077666307f2734b4a1a1c57acb79193127dcc8914d5242dd7" +dependencies = [ + "event-listener", +] + +[[package]] +name = "async-trait" +version = "0.1.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.10", +] + +[[package]] +name = "asynchronous-codec" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06a0daa378f5fd10634e44b0a29b2a87b890657658e072a30d6f26e57ddee182" +dependencies = [ + "bytes", + "futures-sink", + "futures-util", + "memchr", + "pin-project-lite", +] + +[[package]] +name = "atomic-waker" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "debc29dde2e69f9e47506b525f639ed42300fc014a3e007832592448fa8e4599" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "base-x" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" + +[[package]] +name = "base16ct" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ea22880d78093b0cbe17c89f64a7d457941e65759157ec6cb31a31d652b05e5" + +[[package]] +name = "base64" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" + +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest 0.10.6", +] + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array", +] + +[[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 = "block-modes" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57a0e8073e8baa88212fb5823574c02ebccb395136ba9a164ab89379ec6072f0" +dependencies = [ + "block-padding", + "cipher 0.2.5", +] + +[[package]] +name = "block-padding" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" + +[[package]] +name = "bs58" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" + +[[package]] +name = "bumpalo" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +dependencies = [ + "serde", +] + +[[package]] +name = "cc" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" + +[[package]] +name = "ccm" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aca1a8fbc20b50ac9673ff014abfb2b5f4085ee1a850d408f14a159c5853ac7" +dependencies = [ + "aead 0.3.2", + "cipher 0.2.5", + "subtle", +] + +[[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.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c80e5460aa66fe3b91d40bcbdab953a597b60053e34d684ac6903f863b680a6" +dependencies = [ + "cfg-if", + "cipher 0.3.0", + "cpufeatures", + "zeroize", +] + +[[package]] +name = "chacha20poly1305" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a18446b09be63d457bbec447509e85f662f32952b035ce892290396bc0b0cff5" +dependencies = [ + "aead 0.4.3", + "chacha20", + "cipher 0.3.0", + "poly1305", + "zeroize", +] + +[[package]] +name = "chrono" +version = "0.4.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e3c5919066adf22df73762e50cffcde3a758f2a848b113b586d1f86728b673b" +dependencies = [ + "num-integer", + "num-traits", + "serde", +] + +[[package]] +name = "cipher" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" +dependencies = [ + "generic-array", +] + +[[package]] +name = "cipher" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" +dependencies = [ + "generic-array", +] + +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "clap" +version = "3.2.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5" +dependencies = [ + "bitflags", + "clap_derive", + "clap_lex", + "indexmap", + "once_cell", + "textwrap", +] + +[[package]] +name = "clap_derive" +version = "3.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65" +dependencies = [ + "heck", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "clap_lex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +dependencies = [ + "os_str_bytes", +] + +[[package]] +name = "concurrent-queue" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c278839b831783b70278b14df4d45e1beb1aad306c07bb796637de9a0e323e8e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "const-oid" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520fbf3c07483f94e3e3ca9d0cfd913d7718ef2483d2cfd91c0d9e91474ab913" + +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" + +[[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.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "280a9f2d8b3a38871a3c8a46fb80db65e5e5ed97da80c4d08bf27fb63e35e181" +dependencies = [ + "libc", +] + +[[package]] +name = "crc" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" +dependencies = [ + "crc-catalog", +] + +[[package]] +name = "crc-catalog" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cace84e55f07e7301bae1c519df89cdad8cc3cd868413d3fdbdeca9ff3db484" + +[[package]] +name = "crossbeam-utils" +version = "0.8.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "crypto-bigint" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" +dependencies = [ + "generic-array", + "rand_core 0.6.4", + "subtle", + "zeroize", +] + +[[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 0.6.4", + "typenum", +] + +[[package]] +name = "crypto-mac" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "ctr" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" +dependencies = [ + "cipher 0.3.0", +] + +[[package]] +name = "ctr" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" +dependencies = [ + "cipher 0.4.4", +] + +[[package]] +name = "curve25519-dalek" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" +dependencies = [ + "byteorder", + "digest 0.9.0", + "rand_core 0.5.1", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek" +version = "4.0.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d4ba9852b42210c7538b75484f9daa0655e9a3ac04f693747bb0f02cf3cfe16" +dependencies = [ + "cfg-if", + "fiat-crypto", + "packed_simd_2", + "platforms", + "subtle", + "zeroize", +] + +[[package]] +name = "darling" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 1.0.109", +] + +[[package]] +name = "darling_macro" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" +dependencies = [ + "darling_core", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "data-encoding" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23d8666cb01533c39dde32bcbab8e227b4ed6679b2c925eba05feabea39508fb" + +[[package]] +name = "data-encoding-macro" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86927b7cd2fe88fa698b87404b287ab98d1a0063a34071d92e575b72d3029aca" +dependencies = [ + "data-encoding", + "data-encoding-macro-internal", +] + +[[package]] +name = "data-encoding-macro-internal" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5bbed42daaa95e780b60a50546aa345b8413a1e46f9a40a12907d3598f038db" +dependencies = [ + "data-encoding", + "syn 1.0.109", +] + +[[package]] +name = "der" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" +dependencies = [ + "const-oid", + "pem-rfc7468", + "zeroize", +] + +[[package]] +name = "der-parser" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe398ac75057914d7d07307bf67dc7f3f574a26783b4fc7805a20ffa9f506e82" +dependencies = [ + "asn1-rs 0.3.1", + "displaydoc", + "nom", + "num-bigint", + "num-traits", + "rusticata-macros", +] + +[[package]] +name = "der-parser" +version = "8.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbd676fbbab537128ef0278adb5576cf363cff6aa22a7b24effe97347cfab61e" +dependencies = [ + "asn1-rs 0.5.2", + "displaydoc", + "nom", + "num-bigint", + "num-traits", + "rusticata-macros", +] + +[[package]] +name = "derive_builder" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d07adf7be193b71cc36b193d0f5fe60b918a3a9db4dad0449f57bcfd519704a3" +dependencies = [ + "derive_builder_macro", +] + +[[package]] +name = "derive_builder_core" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f91d4cfa921f1c05904dc3c57b4a32c38aed3340cce209f3a6fd1478babafc4" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_builder_macro" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f0314b72bed045f3a68671b3c86328386762c93f82d98c65c3cb5e5f573dd68" +dependencies = [ + "derive_builder_core", + "syn 1.0.109", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "digest" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +dependencies = [ + "block-buffer 0.10.4", + "crypto-common", + "subtle", +] + +[[package]] +name = "displaydoc" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bf95dc3f046b9da4f2d51833c0d3547d8564ef6910f5c1ed130306a75b92886" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "dtoa" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65d09067bfacaa79114679b279d7f5885b53295b1e2cfb4e79c8e4bd3d633169" + +[[package]] +name = "ecdsa" +version = "0.14.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" +dependencies = [ + "der", + "elliptic-curve", + "rfc6979", + "signature", +] + +[[package]] +name = "ed25519" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" +dependencies = [ + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" +dependencies = [ + "curve25519-dalek 3.2.0", + "ed25519", + "rand 0.7.3", + "serde", + "sha2 0.9.9", + "zeroize", +] + +[[package]] +name = "either" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" + +[[package]] +name = "elliptic-curve" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" +dependencies = [ + "base16ct", + "crypto-bigint", + "der", + "digest 0.10.6", + "ff", + "generic-array", + "group", + "hkdf", + "pem-rfc7468", + "pkcs8", + "rand_core 0.6.4", + "sec1", + "subtle", + "zeroize", +] + +[[package]] +name = "encoding_rs" +version = "0.8.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "enum-as-inner" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9720bba047d567ffc8a3cba48bf19126600e249ab7f128e9233e6376976a116" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "errno" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" +dependencies = [ + "errno-dragonfly", + "libc", + "winapi", +] + +[[package]] +name = "errno" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50d6a0976c999d473fe89ad888d5a284e55366d9dc9038b1ba2aa15128c4afa0" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys 0.45.0", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + +[[package]] +name = "ff" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" +dependencies = [ + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "fiat-crypto" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93ace6ec7cc19c8ed33a32eaa9ea692d7faea05006b5356b9e2b668ec4bc3955" + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "flood_publishing" +version = "0.1.0" +dependencies = [ + "futures", + "libp2p", + "rand 0.8.5", + "serde", + "serde_json", + "sha2 0.10.6", + "testground", + "tokio", + "tracing", + "tracing-subscriber", +] + +[[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.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "531ac96c6ff5fd7c62263c5e3c67a603af4fcaee2e1a0ae5565ba3a11e69e549" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "164713a5a0dcc3e7b4b1ed7d3b433cabc18025386f9339346e8daf15963cf7ac" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86d7a0c1aa76363dac491de0ee99faf6941128376f1cf96f07db7603b7de69dd" + +[[package]] +name = "futures-executor" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1997dd9df74cdac935c76252744c1ed5794fac083242ea4fe77ef3ed60ba0f83" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", + "num_cpus", +] + +[[package]] +name = "futures-io" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89d422fa3cbe3b40dca574ab087abb5bc98258ea57eea3fd6f1fa7162c778b91" + +[[package]] +name = "futures-lite" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite", + "waker-fn", +] + +[[package]] +name = "futures-macro" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3eb14ed937631bd8b8b8977f2c198443447a8355b6e3ca599f38c975e5a963b6" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "futures-rustls" +version = "0.22.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2411eed028cdf8c8034eaf21f9915f956b6c3abec4d4c7949ee67f0721127bd" +dependencies = [ + "futures-io", + "rustls 0.20.8", + "webpki 0.22.0", +] + +[[package]] +name = "futures-sink" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec93083a4aecafb2a80a885c9de1f0ccae9dbd32c2bb54b0c3a65690e0b8d2f2" + +[[package]] +name = "futures-task" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd65540d33b37b16542a0438c12e6aeead10d4ac5d05bd3f805b8f35ab592879" + +[[package]] +name = "futures-timer" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" + +[[package]] +name = "futures-util" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ef6b17e481503ec85211fed8f39d1970f128935ca1f814cd32ac4a6842e84ab" +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.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "ghash" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1583cc1656d7839fd3732b80cf4f38850336cdb9b8ded1cd399ca62958de3c99" +dependencies = [ + "opaque-debug", + "polyval 0.5.3", +] + +[[package]] +name = "ghash" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d930750de5717d2dd0b8c0d42c076c0e884c81a73e6cab859bbd2339c71e3e40" +dependencies = [ + "opaque-debug", + "polyval 0.6.0", +] + +[[package]] +name = "group" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" +dependencies = [ + "ff", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "h2" +version = "0.3.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be7b54589b581f624f566bf5d8eb2bab1db736c51528720b6bd36b96b55924d" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex_fmt" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b07f60793ff0a4d9cef0f18e63b5357e06209987153a64648c972c1e5aff336f" + +[[package]] +name = "hkdf" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" +dependencies = [ + "hmac 0.12.1", +] + +[[package]] +name = "hmac" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" +dependencies = [ + "crypto-mac", + "digest 0.9.0", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.6", +] + +[[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.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" + +[[package]] +name = "hyper" +version = "0.14.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc5e554ff619822309ffd57d8734d77cd5ce6238bc956f037ea06c58238c9899" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +dependencies = [ + "matches", + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "idna" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "if-addrs" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbc0fa01ffc752e9dbc72818cdb072cd028b86be5e09dd04c5a643704fe101a9" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "if-watch" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba7abdbb86e485125dad06c2691e1e393bf3b08c7b743b43aa162a00fd39062e" +dependencies = [ + "async-io", + "core-foundation", + "fnv", + "futures", + "if-addrs", + "ipnet", + "log", + "rtnetlink", + "system-configuration", + "tokio", + "windows", +] + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown", +] + +[[package]] +name = "influxdb" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39023407f0546c3b30607950f8b600c7db4ef7621fbaa0159de733d73e68b23f" +dependencies = [ + "chrono", + "futures-util", + "http", + "influxdb_derive", + "lazy_static", + "regex", + "reqwest", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "influxdb_derive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d81efbf97cec06c647f05a8b5edcbc52434cdf980d8d4ace68e1028c90241d3" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "inout" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +dependencies = [ + "generic-array", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "interceptor" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e8a11ae2da61704edada656798b61c94b35ecac2c58eb955156987d5e6be90b" +dependencies = [ + "async-trait", + "bytes", + "log", + "rand 0.8.5", + "rtcp", + "rtp", + "thiserror", + "tokio", + "waitgroup", + "webrtc-srtp", + "webrtc-util", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09270fd4fa1111bc614ed2246c7ef56239a3063d5be0d1ec3b589c505d400aeb" +dependencies = [ + "hermit-abi 0.3.1", + "libc", + "windows-sys 0.45.0", +] + +[[package]] +name = "ipconfig" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd302af1b90f2463a98fa5ad469fc212c8e3175a41c3068601bfa2727591c5be" +dependencies = [ + "socket2", + "widestring", + "winapi", + "winreg", +] + +[[package]] +name = "ipnet" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30e22bd8629359895450b59ea7a776c850561b96a3b1d31321c1949d9e6c9146" + +[[package]] +name = "ipnetwork" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf466541e9d546596ee94f9f69590f89473455f88372423e0008fc1a7daf100e" +dependencies = [ + "serde", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" + +[[package]] +name = "js-sys" +version = "0.3.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" + +[[package]] +name = "libm" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" + +[[package]] +name = "libp2p" +version = "0.51.0" +source = "git+https://github.com/ackintosh/rust-libp2p.git?branch=prometheus-client-0.20.0#df09870c8c2294cbaeb881f58d4f9752125562bc" +dependencies = [ + "bytes", + "futures", + "futures-timer", + "getrandom 0.2.8", + "instant", + "libp2p-core", + "libp2p-dns", + "libp2p-gossipsub", + "libp2p-kad", + "libp2p-mdns", + "libp2p-metrics", + "libp2p-mplex", + "libp2p-noise", + "libp2p-quic", + "libp2p-swarm", + "libp2p-tcp", + "libp2p-webrtc", + "libp2p-yamux", + "multiaddr", + "parking_lot 0.12.1", + "pin-project", + "smallvec", +] + +[[package]] +name = "libp2p-core" +version = "0.39.0" +source = "git+https://github.com/ackintosh/rust-libp2p.git?branch=prometheus-client-0.20.0#df09870c8c2294cbaeb881f58d4f9752125562bc" +dependencies = [ + "asn1_der", + "bs58", + "ed25519-dalek", + "either", + "fnv", + "futures", + "futures-timer", + "instant", + "log", + "multiaddr", + "multihash", + "multistream-select", + "once_cell", + "parking_lot 0.12.1", + "pin-project", + "prost", + "prost-build", + "rand 0.8.5", + "rw-stream-sink", + "sec1", + "serde", + "sha2 0.10.6", + "smallvec", + "thiserror", + "unsigned-varint", + "void", + "zeroize", +] + +[[package]] +name = "libp2p-dns" +version = "0.39.0" +source = "git+https://github.com/ackintosh/rust-libp2p.git?branch=prometheus-client-0.20.0#df09870c8c2294cbaeb881f58d4f9752125562bc" +dependencies = [ + "futures", + "libp2p-core", + "log", + "parking_lot 0.12.1", + "smallvec", + "trust-dns-resolver", +] + +[[package]] +name = "libp2p-gossipsub" +version = "0.44.0" +source = "git+https://github.com/ackintosh/rust-libp2p.git?branch=prometheus-client-0.20.0#df09870c8c2294cbaeb881f58d4f9752125562bc" +dependencies = [ + "asynchronous-codec", + "base64 0.20.0", + "byteorder", + "bytes", + "fnv", + "futures", + "hex_fmt", + "instant", + "libp2p-core", + "libp2p-swarm", + "log", + "prometheus-client 0.20.0", + "prost", + "prost-build", + "prost-codec", + "rand 0.8.5", + "regex", + "serde", + "sha2 0.10.6", + "smallvec", + "thiserror", + "unsigned-varint", + "wasm-timer", +] + +[[package]] +name = "libp2p-kad" +version = "0.43.0" +source = "git+https://github.com/ackintosh/rust-libp2p.git?branch=prometheus-client-0.20.0#df09870c8c2294cbaeb881f58d4f9752125562bc" +dependencies = [ + "arrayvec", + "asynchronous-codec", + "bytes", + "either", + "fnv", + "futures", + "futures-timer", + "instant", + "libp2p-core", + "libp2p-swarm", + "log", + "prost", + "prost-build", + "rand 0.8.5", + "serde", + "sha2 0.10.6", + "smallvec", + "thiserror", + "uint", + "unsigned-varint", + "void", +] + +[[package]] +name = "libp2p-mdns" +version = "0.43.0" +source = "git+https://github.com/ackintosh/rust-libp2p.git?branch=prometheus-client-0.20.0#df09870c8c2294cbaeb881f58d4f9752125562bc" +dependencies = [ + "data-encoding", + "futures", + "if-watch", + "libp2p-core", + "libp2p-swarm", + "log", + "rand 0.8.5", + "smallvec", + "socket2", + "tokio", + "trust-dns-proto", + "void", +] + +[[package]] +name = "libp2p-metrics" +version = "0.12.0" +source = "git+https://github.com/ackintosh/rust-libp2p.git?branch=prometheus-client-0.20.0#df09870c8c2294cbaeb881f58d4f9752125562bc" +dependencies = [ + "libp2p-core", + "libp2p-gossipsub", + "libp2p-swarm", + "prometheus-client 0.19.0", +] + +[[package]] +name = "libp2p-mplex" +version = "0.39.0" +source = "git+https://github.com/ackintosh/rust-libp2p.git?branch=prometheus-client-0.20.0#df09870c8c2294cbaeb881f58d4f9752125562bc" +dependencies = [ + "asynchronous-codec", + "bytes", + "futures", + "libp2p-core", + "log", + "nohash-hasher", + "parking_lot 0.12.1", + "rand 0.8.5", + "smallvec", + "unsigned-varint", +] + +[[package]] +name = "libp2p-noise" +version = "0.42.0" +source = "git+https://github.com/ackintosh/rust-libp2p.git?branch=prometheus-client-0.20.0#df09870c8c2294cbaeb881f58d4f9752125562bc" +dependencies = [ + "bytes", + "curve25519-dalek 3.2.0", + "futures", + "libp2p-core", + "log", + "once_cell", + "prost", + "prost-build", + "rand 0.8.5", + "sha2 0.10.6", + "snow", + "static_assertions", + "thiserror", + "x25519-dalek 1.1.1", + "zeroize", +] + +[[package]] +name = "libp2p-quic" +version = "0.7.0-alpha.2" +source = "git+https://github.com/ackintosh/rust-libp2p.git?branch=prometheus-client-0.20.0#df09870c8c2294cbaeb881f58d4f9752125562bc" +dependencies = [ + "bytes", + "futures", + "futures-timer", + "if-watch", + "libp2p-core", + "libp2p-tls", + "log", + "parking_lot 0.12.1", + "quinn-proto", + "rand 0.8.5", + "rustls 0.20.8", + "thiserror", + "tokio", +] + +[[package]] +name = "libp2p-swarm" +version = "0.42.0" +source = "git+https://github.com/ackintosh/rust-libp2p.git?branch=prometheus-client-0.20.0#df09870c8c2294cbaeb881f58d4f9752125562bc" +dependencies = [ + "either", + "fnv", + "futures", + "futures-timer", + "instant", + "libp2p-core", + "log", + "pin-project", + "rand 0.8.5", + "smallvec", + "thiserror", + "tokio", + "void", +] + +[[package]] +name = "libp2p-tcp" +version = "0.39.0" +source = "git+https://github.com/ackintosh/rust-libp2p.git?branch=prometheus-client-0.20.0#df09870c8c2294cbaeb881f58d4f9752125562bc" +dependencies = [ + "futures", + "futures-timer", + "if-watch", + "libc", + "libp2p-core", + "log", + "socket2", + "tokio", +] + +[[package]] +name = "libp2p-tls" +version = "0.1.0-alpha.2" +source = "git+https://github.com/ackintosh/rust-libp2p.git?branch=prometheus-client-0.20.0#df09870c8c2294cbaeb881f58d4f9752125562bc" +dependencies = [ + "futures", + "futures-rustls", + "libp2p-core", + "rcgen 0.10.0", + "ring", + "rustls 0.20.8", + "thiserror", + "webpki 0.22.0", + "x509-parser 0.14.0", + "yasna", +] + +[[package]] +name = "libp2p-webrtc" +version = "0.4.0-alpha.2" +source = "git+https://github.com/ackintosh/rust-libp2p.git?branch=prometheus-client-0.20.0#df09870c8c2294cbaeb881f58d4f9752125562bc" +dependencies = [ + "async-trait", + "asynchronous-codec", + "bytes", + "futures", + "futures-timer", + "hex", + "if-watch", + "libp2p-core", + "libp2p-noise", + "log", + "multihash", + "prost", + "prost-build", + "prost-codec", + "rand 0.8.5", + "rcgen 0.9.3", + "serde", + "stun", + "thiserror", + "tinytemplate", + "tokio", + "tokio-util", + "webrtc", +] + +[[package]] +name = "libp2p-yamux" +version = "0.43.0" +source = "git+https://github.com/ackintosh/rust-libp2p.git?branch=prometheus-client-0.20.0#df09870c8c2294cbaeb881f58d4f9752125562bc" +dependencies = [ + "futures", + "libp2p-core", + "log", + "parking_lot 0.12.1", + "thiserror", + "yamux", +] + +[[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.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" + +[[package]] +name = "linux-raw-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd550e73688e6d578f0ac2119e32b797a327631a42f9433e59d02e139c8df60d" + +[[package]] +name = "lock_api" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if", +] + +[[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", +] + +[[package]] +name = "matches" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" + +[[package]] +name = "md-5" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" +dependencies = [ + "digest 0.10.6", +] + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "memoffset" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +dependencies = [ + "autocfg", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "mio" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" +dependencies = [ + "libc", + "log", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.45.0", +] + +[[package]] +name = "multiaddr" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b36f567c7099511fa8612bbbb52dda2419ce0bdbacf31714e3a5ffdb766d3bd" +dependencies = [ + "arrayref", + "byteorder", + "data-encoding", + "log", + "multibase", + "multihash", + "percent-encoding", + "serde", + "static_assertions", + "unsigned-varint", + "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.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835d6ff01d610179fbce3de1694d007e500bf33a7f29689838941d6bf783ae40" +dependencies = [ + "core2", + "digest 0.10.6", + "multihash-derive", + "serde", + "serde-big-array", + "sha2 0.10.6", + "unsigned-varint", +] + +[[package]] +name = "multihash-derive" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6d4752e6230d8ef7adf7bd5d8c4b1f6561c1014c5ba9a37445ccefe18aa1db" +dependencies = [ + "proc-macro-crate", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", + "synstructure", +] + +[[package]] +name = "multimap" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" + +[[package]] +name = "multistream-select" +version = "0.12.1" +source = "git+https://github.com/ackintosh/rust-libp2p.git?branch=prometheus-client-0.20.0#df09870c8c2294cbaeb881f58d4f9752125562bc" +dependencies = [ + "bytes", + "futures", + "log", + "pin-project", + "smallvec", + "unsigned-varint", +] + +[[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", + "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.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6471bf08e7ac0135876a9581bf3217ef0333c191c128d34878079f42ee150411" +dependencies = [ + "bytes", + "futures", + "libc", + "log", + "tokio", +] + +[[package]] +name = "nix" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" +dependencies = [ + "bitflags", + "cfg-if", + "libc", + "memoffset", +] + +[[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.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +dependencies = [ + "hermit-abi 0.2.6", + "libc", +] + +[[package]] +name = "oid-registry" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38e20717fa0541f39bd146692035c37bedfa532b3e5071b35761082407546b2a" +dependencies = [ + "asn1-rs 0.3.1", +] + +[[package]] +name = "oid-registry" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bedf36ffb6ba96c2eb7144ef6270557b52e54b20c0a8e1eb2ff99a6c6959bff" +dependencies = [ + "asn1-rs 0.5.2", +] + +[[package]] +name = "once_cell" +version = "1.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" + +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[package]] +name = "os_str_bytes" +version = "6.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ceedf44fb00f2d1984b0bc98102627ce622e083e49a5bacdb3e514fa4238e267" + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "p256" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51f44edd08f51e2ade572f141051021c5af22677e42b7dd28a88155151c33594" +dependencies = [ + "ecdsa", + "elliptic-curve", + "sha2 0.10.6", +] + +[[package]] +name = "p384" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc8c5bf642dde52bb9e87c0ecd8ca5a76faac2eeed98dedb7c717997e1080aa" +dependencies = [ + "ecdsa", + "elliptic-curve", + "sha2 0.10.6", +] + +[[package]] +name = "packed_simd_2" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1914cd452d8fccd6f9db48147b29fd4ae05bea9dc5d9ad578509f72415de282" +dependencies = [ + "cfg-if", + "libm", +] + +[[package]] +name = "parking" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" + +[[package]] +name = "parking_lot" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +dependencies = [ + "instant", + "lock_api", + "parking_lot_core 0.8.6", +] + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core 0.9.7", +] + +[[package]] +name = "parking_lot_core" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" +dependencies = [ + "cfg-if", + "instant", + "libc", + "redox_syscall", + "smallvec", + "winapi", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-sys 0.45.0", +] + +[[package]] +name = "paste" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79" + +[[package]] +name = "pem" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8" +dependencies = [ + "base64 0.13.1", +] + +[[package]] +name = "pem-rfc7468" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d159833a9105500e0398934e205e0773f0b27529557134ecfc51c27646adac" +dependencies = [ + "base64ct", +] + +[[package]] +name = "percent-encoding" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" + +[[package]] +name = "petgraph" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" +dependencies = [ + "fixedbitset", + "indexmap", +] + +[[package]] +name = "pin-project" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkcs8" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "platforms" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d7ddaed09e0eb771a79ab0fd64609ba0afb0a8366421957936ad14cbd13630" + +[[package]] +name = "polling" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e1f879b2998099c2d69ab9605d145d5b661195627eccc680002c4918a7fb6fa" +dependencies = [ + "autocfg", + "bitflags", + "cfg-if", + "concurrent-queue", + "libc", + "log", + "pin-project-lite", + "windows-sys 0.45.0", +] + +[[package]] +name = "poly1305" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "048aeb476be11a4b6ca432ca569e375810de9294ae78f4774e78ea98a9246ede" +dependencies = [ + "cpufeatures", + "opaque-debug", + "universal-hash 0.4.1", +] + +[[package]] +name = "polyval" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8419d2b623c7c0896ff2d5d96e2cb4ede590fed28fcc34934f4c33c036e620a1" +dependencies = [ + "cfg-if", + "cpufeatures", + "opaque-debug", + "universal-hash 0.4.1", +] + +[[package]] +name = "polyval" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ef234e08c11dfcb2e56f79fd70f6f2eb7f025c0ce2333e82f4f0518ecad30c6" +dependencies = [ + "cfg-if", + "cpufeatures", + "opaque-debug", + "universal-hash 0.5.0", +] + +[[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.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" +dependencies = [ + "proc-macro2", + "syn 1.0.109", +] + +[[package]] +name = "proc-macro-crate" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" +dependencies = [ + "thiserror", + "toml", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba466839c78239c09faf015484e5cc04860f88242cff4d03eb038f04b4699b73" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "prometheus-client" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d6fa99d535dd930d1249e6c79cb3c2915f9172a540fe2b02a4c8f9ca954721e" +dependencies = [ + "dtoa", + "itoa", + "parking_lot 0.12.1", + "prometheus-client-derive-encode 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "prometheus-client" +version = "0.20.0" +source = "git+https://github.com/ackintosh/client_rust.git?branch=fix/protobuf-labels#ace52c9fdd709b967ea1f65e8313a99677854ea3" +dependencies = [ + "dtoa", + "itoa", + "parking_lot 0.12.1", + "prometheus-client-derive-encode 0.4.1 (git+https://github.com/ackintosh/client_rust.git?branch=fix/protobuf-labels)", +] + +[[package]] +name = "prometheus-client-derive-encode" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b6a5217beb0ad503ee7fa752d451c905113d70721b937126158f3106a48cc1" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "prometheus-client-derive-encode" +version = "0.4.1" +source = "git+https://github.com/ackintosh/client_rust.git?branch=fix/protobuf-labels#ace52c9fdd709b967ea1f65e8313a99677854ea3" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "prost" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e48e50df39172a3e7eb17e14642445da64996989bc212b583015435d39a58537" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-build" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c828f93f5ca4826f97fedcbd3f9a536c16b12cff3dbbb4a007f932bbad95b12" +dependencies = [ + "bytes", + "heck", + "itertools", + "lazy_static", + "log", + "multimap", + "petgraph", + "prettyplease", + "prost", + "prost-types", + "regex", + "syn 1.0.109", + "tempfile", + "which", +] + +[[package]] +name = "prost-codec" +version = "0.3.0" +source = "git+https://github.com/ackintosh/rust-libp2p.git?branch=prometheus-client-0.20.0#df09870c8c2294cbaeb881f58d4f9752125562bc" +dependencies = [ + "asynchronous-codec", + "bytes", + "prost", + "thiserror", + "unsigned-varint", +] + +[[package]] +name = "prost-derive" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ea9b0f8cbe5e15a8a042d030bd96668db28ecb567ec37d691971ff5731d2b1b" +dependencies = [ + "anyhow", + "itertools", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "prost-types" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "379119666929a1afd7a043aa6cf96fa67a6dce9af60c88095a4686dbce4c9c88" +dependencies = [ + "prost", +] + +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + +[[package]] +name = "quinn-proto" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72ef4ced82a24bb281af338b9e8f94429b6eca01b4e66d899f40031f074e74c9" +dependencies = [ + "bytes", + "rand 0.8.5", + "ring", + "rustc-hash", + "rustls 0.20.8", + "slab", + "thiserror", + "tinyvec", + "tracing", + "webpki 0.22.0", +] + +[[package]] +name = "quote" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.8", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rcgen" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6413f3de1edee53342e6138e75b56d32e7bc6e332b3bd62d497b1929d4cfbcdd" +dependencies = [ + "pem", + "ring", + "time", + "x509-parser 0.13.2", + "yasna", +] + +[[package]] +name = "rcgen" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffbe84efe2f38dea12e9bfc1f65377fdf03e53a18cb3b995faedf7934c7e785b" +dependencies = [ + "pem", + "ring", + "time", + "yasna", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags", +] + +[[package]] +name = "regex" +version = "1.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b1f693b24f6ac912f4893ef08244d70b6067480d2f1a46e950c9691e6749d1d" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "reqwest" +version = "0.11.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ba30cc2c0cd02af1222ed216ba659cdb2f879dfe3181852fe7c50b1d0005949" +dependencies = [ + "base64 0.21.0", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "ipnet", + "js-sys", + "log", + "mime", + "once_cell", + "percent-encoding", + "pin-project-lite", + "serde", + "serde_json", + "serde_urlencoded", + "tokio", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg", +] + +[[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 = "rfc6979" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" +dependencies = [ + "crypto-bigint", + "hmac 0.12.1", + "zeroize", +] + +[[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", + "untrusted", + "web-sys", + "winapi", +] + +[[package]] +name = "rtcp" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1919efd6d4a6a85d13388f9487549bb8e359f17198cc03ffd72f79b553873691" +dependencies = [ + "bytes", + "thiserror", + "webrtc-util", +] + +[[package]] +name = "rtnetlink" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "322c53fd76a18698f1c27381d58091de3a043d356aa5bd0d510608b565f469a0" +dependencies = [ + "futures", + "log", + "netlink-packet-route", + "netlink-proto", + "nix", + "thiserror", + "tokio", +] + +[[package]] +name = "rtp" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2a095411ff00eed7b12e4c6a118ba984d113e1079582570d56a5ee723f11f80" +dependencies = [ + "async-trait", + "bytes", + "rand 0.8.5", + "serde", + "thiserror", + "webrtc-util", +] + +[[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.36.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db4165c9963ab29e422d6c26fbc1d37f15bace6b2810221f9d925023480fcf0e" +dependencies = [ + "bitflags", + "errno 0.2.8", + "io-lifetimes", + "libc", + "linux-raw-sys 0.1.4", + "windows-sys 0.45.0", +] + +[[package]] +name = "rustix" +version = "0.37.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b24138615de35e32031d041a09032ef3487a616d901ca4db224e7d557efae2" +dependencies = [ + "bitflags", + "errno 0.3.0", + "io-lifetimes", + "libc", + "linux-raw-sys 0.3.0", + "windows-sys 0.45.0", +] + +[[package]] +name = "rustls" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" +dependencies = [ + "base64 0.13.1", + "log", + "ring", + "sct 0.6.1", + "webpki 0.21.4", +] + +[[package]] +name = "rustls" +version = "0.20.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" +dependencies = [ + "log", + "ring", + "sct 0.7.0", + "webpki 0.22.0", +] + +[[package]] +name = "rw-stream-sink" +version = "0.3.0" +source = "git+https://github.com/ackintosh/rust-libp2p.git?branch=prometheus-client-0.20.0#df09870c8c2294cbaeb881f58d4f9752125562bc" +dependencies = [ + "futures", + "pin-project", + "static_assertions", +] + +[[package]] +name = "ryu" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "sct" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "sct" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "sdp" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d22a5ef407871893fd72b4562ee15e4742269b173959db4b8df6f538c414e13" +dependencies = [ + "rand 0.8.5", + "substring", + "thiserror", + "url", +] + +[[package]] +name = "sec1" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" +dependencies = [ + "base16ct", + "der", + "generic-array", + "pkcs8", + "subtle", + "zeroize", +] + +[[package]] +name = "semver" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" + +[[package]] +name = "serde" +version = "1.0.158" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "771d4d9c4163ee138805e12c710dd365e4f44be8be0503cb1bb9eb989425d9c9" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde-big-array" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd31f59f6fe2b0c055371bb2f16d7f0aa7d8881676c04a55b1596d1a17cd10a4" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_derive" +version = "1.0.158" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e801c1712f48475582b7696ac71e0ca34ebb30e09338425384269d9717c62cad" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.10", +] + +[[package]] +name = "serde_json" +version = "1.0.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c533a59c9d8a93a09c6ab31f0fd5e5f4dd1b8fc9434804029839884765d04ea" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_repr" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcec881020c684085e55a25f7fd888954d56609ef363479dc5a1305eb0d40cab" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.10", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_with" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85456ffac572dc8826334164f2fb6fb40a7c766aebe195a2a21ee69ee2885ecf" +dependencies = [ + "serde", + "serde_with_macros", +] + +[[package]] +name = "serde_with_macros" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cbcd6104f8a4ab6af7f6be2a0da6be86b9de3c401f6e86bb856ab2af739232f" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "sha-1" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "sha1" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.6", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "sha2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.6", +] + +[[package]] +name = "sharded-slab" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +dependencies = [ + "libc", +] + +[[package]] +name = "signature" +version = "1.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" +dependencies = [ + "digest 0.10.6", + "rand_core 0.6.4", +] + +[[package]] +name = "slab" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" + +[[package]] +name = "snow" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ccba027ba85743e09d15c03296797cad56395089b832b48b5a5217880f57733" +dependencies = [ + "aes-gcm 0.9.4", + "blake2", + "chacha20poly1305", + "curve25519-dalek 4.0.0-rc.1", + "rand_core 0.6.4", + "ring", + "rustc_version", + "sha2 0.10.6", + "subtle", +] + +[[package]] +name = "socket2" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "soketto" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2" +dependencies = [ + "base64 0.13.1", + "bytes", + "futures", + "httparse", + "log", + "rand 0.8.5", + "sha-1", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "spki" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" +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 = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "stun" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7e94b1ec00bad60e6410e058b52f1c66de3dc5fe4d62d09b3e52bb7d3b73e25" +dependencies = [ + "base64 0.13.1", + "crc", + "lazy_static", + "md-5", + "rand 0.8.5", + "ring", + "subtle", + "thiserror", + "tokio", + "url", + "webrtc-util", +] + +[[package]] +name = "substring" +version = "1.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ee6433ecef213b2e72f587ef64a2f5943e7cd16fbd82dbe8bc07486c534c86" +dependencies = [ + "autocfg", +] + +[[package]] +name = "subtle" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + +[[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.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aad1363ed6d37b84299588d62d3a7d95b5a5c2d9aad5c85609fda12afaa1f40" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "unicode-xid", +] + +[[package]] +name = "system-configuration" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d75182f12f490e953596550b65ee31bda7c8e043d9386174b353bda50838c3fd" +dependencies = [ + "bitflags", + "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.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af18f7ae1acd354b992402e9ec5864359d693cd8a79dcbef59f76891701c1e95" +dependencies = [ + "cfg-if", + "fastrand", + "redox_syscall", + "rustix 0.36.11", + "windows-sys 0.42.0", +] + +[[package]] +name = "testground" +version = "0.5.0" +source = "git+https://github.com/testground/sdk-rust.git?rev=1fd032ec29361a00b25c0c8a6bac5f19a43019eb#1fd032ec29361a00b25c0c8a6bac5f19a43019eb" +dependencies = [ + "chrono", + "clap", + "futures", + "if-addrs", + "influxdb", + "ipnetwork", + "log", + "serde", + "serde_json", + "serde_repr", + "serde_with", + "soketto", + "thiserror", + "tokio", + "tokio-stream", + "tokio-util", +] + +[[package]] +name = "textwrap" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" + +[[package]] +name = "thiserror" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.10", +] + +[[package]] +name = "thread_local" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "time" +version = "0.3.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd0cbfecb4d19b5ea75bb31ad904eb5b9fa13f21079c3b92017ebdf4999a5890" +dependencies = [ + "itoa", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" + +[[package]] +name = "time-macros" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd80a657e71da814b8e5d60d3374fc6d35045062245d80224748ae522dd76f36" +dependencies = [ + "time-core", +] + +[[package]] +name = "tinytemplate" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +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.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03201d01c3c27a29c8a5cee5b55a93ddae1ccf6f08f65365c2c918f8c1b76f64" +dependencies = [ + "autocfg", + "bytes", + "libc", + "memchr", + "mio", + "num_cpus", + "parking_lot 0.12.1", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.45.0", +] + +[[package]] +name = "tokio-macros" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "tokio-stream" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fb52b74f05dbf495a8fba459fdc331812b96aa086d9eb78101fa0d4569c3313" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5427d89453009325de0d8f342c9490009f76e999cb7672d77e46267448f7e6b2" +dependencies = [ + "bytes", + "futures-core", + "futures-io", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + +[[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.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "tracing-core" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +dependencies = [ + "lazy_static", + "log", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6176eae26dd70d0c919749377897b54a9276bd7061339665dd68777926b5a70" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "trust-dns-proto" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f7f83d1e4a0e4358ac54c5c3681e5d7da5efc5a7a632c90bb6d6669ddd9bc26" +dependencies = [ + "async-trait", + "cfg-if", + "data-encoding", + "enum-as-inner", + "futures-channel", + "futures-io", + "futures-util", + "idna 0.2.3", + "ipnet", + "lazy_static", + "rand 0.8.5", + "smallvec", + "socket2", + "thiserror", + "tinyvec", + "tokio", + "tracing", + "url", +] + +[[package]] +name = "trust-dns-resolver" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aff21aa4dcefb0a1afbfac26deb0adc93888c7d295fb63ab273ef276ba2b7cfe" +dependencies = [ + "cfg-if", + "futures-util", + "ipconfig", + "lazy_static", + "lru-cache", + "parking_lot 0.12.1", + "resolv-conf", + "smallvec", + "thiserror", + "tokio", + "tracing", + "trust-dns-proto", +] + +[[package]] +name = "try-lock" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" + +[[package]] +name = "turn" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4712ee30d123ec7ae26d1e1b218395a16c87cdbaf4b3925d170d684af62ea5e8" +dependencies = [ + "async-trait", + "base64 0.13.1", + "futures", + "log", + "md-5", + "rand 0.8.5", + "ring", + "stun", + "thiserror", + "tokio", + "webrtc-util", +] + +[[package]] +name = "typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + +[[package]] +name = "uint" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" + +[[package]] +name = "unicode-ident" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + +[[package]] +name = "universal-hash" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "universal-hash" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d3160b73c9a19f7e2939a2fdad446c57c1bbbbf4d919d3213ff1267a580d8b5" +dependencies = [ + "crypto-common", + "subtle", +] + +[[package]] +name = "unsigned-varint" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d86a8dc7f45e4c1b0d30e43038c38f274e77af056aa5f74b93c2cf9eb3c1c836" +dependencies = [ + "asynchronous-codec", + "bytes", +] + +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + +[[package]] +name = "url" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +dependencies = [ + "form_urlencoded", + "idna 0.3.0", + "percent-encoding", +] + +[[package]] +name = "uuid" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1674845326ee10d37ca60470760d4288a6f80f304007d92e5c53bab78c9cfd79" +dependencies = [ + "getrandom 0.2.8", +] + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[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 = "waitgroup" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1f50000a783467e6c0200f9d10642f4bc424e39efc1b770203e88b488f79292" +dependencies = [ + "atomic-waker", +] + +[[package]] +name = "waker-fn" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" + +[[package]] +name = "want" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +dependencies = [ + "log", + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 1.0.109", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f219e0d211ba40266969f6dbdd90636da12f75bee4fc9d6c23d1260dadb51454" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" + +[[package]] +name = "wasm-timer" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" +dependencies = [ + "futures", + "js-sys", + "parking_lot 0.11.2", + "pin-utils", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "web-sys" +version = "0.3.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki" +version = "0.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "webpki" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "webrtc" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d3bc9049bdb2cea52f5fd4f6f728184225bdb867ed0dc2410eab6df5bdd67bb" +dependencies = [ + "arc-swap", + "async-trait", + "bytes", + "hex", + "interceptor", + "lazy_static", + "log", + "rand 0.8.5", + "rcgen 0.9.3", + "regex", + "ring", + "rtcp", + "rtp", + "rustls 0.19.1", + "sdp", + "serde", + "serde_json", + "sha2 0.10.6", + "stun", + "thiserror", + "time", + "tokio", + "turn", + "url", + "waitgroup", + "webrtc-data", + "webrtc-dtls", + "webrtc-ice", + "webrtc-mdns", + "webrtc-media", + "webrtc-sctp", + "webrtc-srtp", + "webrtc-util", +] + +[[package]] +name = "webrtc-data" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ef36a4d12baa6e842582fe9ec16a57184ba35e1a09308307b67d43ec8883100" +dependencies = [ + "bytes", + "derive_builder", + "log", + "thiserror", + "tokio", + "webrtc-sctp", + "webrtc-util", +] + +[[package]] +name = "webrtc-dtls" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "942be5bd85f072c3128396f6e5a9bfb93ca8c1939ded735d177b7bcba9a13d05" +dependencies = [ + "aes 0.6.0", + "aes-gcm 0.10.1", + "async-trait", + "bincode", + "block-modes", + "byteorder", + "ccm", + "curve25519-dalek 3.2.0", + "der-parser 8.2.0", + "elliptic-curve", + "hkdf", + "hmac 0.12.1", + "log", + "oid-registry 0.6.1", + "p256", + "p384", + "rand 0.8.5", + "rand_core 0.6.4", + "rcgen 0.9.3", + "ring", + "rustls 0.19.1", + "sec1", + "serde", + "sha1", + "sha2 0.10.6", + "signature", + "subtle", + "thiserror", + "tokio", + "webpki 0.21.4", + "webrtc-util", + "x25519-dalek 2.0.0-pre.1", + "x509-parser 0.13.2", +] + +[[package]] +name = "webrtc-ice" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "465a03cc11e9a7d7b4f9f99870558fe37a102b65b93f8045392fef7c67b39e80" +dependencies = [ + "arc-swap", + "async-trait", + "crc", + "log", + "rand 0.8.5", + "serde", + "serde_json", + "stun", + "thiserror", + "tokio", + "turn", + "url", + "uuid", + "waitgroup", + "webrtc-mdns", + "webrtc-util", +] + +[[package]] +name = "webrtc-mdns" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f08dfd7a6e3987e255c4dbe710dde5d94d0f0574f8a21afa95d171376c143106" +dependencies = [ + "log", + "socket2", + "thiserror", + "tokio", + "webrtc-util", +] + +[[package]] +name = "webrtc-media" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee2a3c157a040324e5049bcbd644ffc9079e6738fa2cfab2bcff64e5cc4c00d7" +dependencies = [ + "byteorder", + "bytes", + "derive_builder", + "displaydoc", + "rand 0.8.5", + "rtp", + "thiserror", + "webrtc-util", +] + +[[package]] +name = "webrtc-sctp" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d47adcd9427eb3ede33d5a7f3424038f63c965491beafcc20bc650a2f6679c0" +dependencies = [ + "arc-swap", + "async-trait", + "bytes", + "crc", + "log", + "rand 0.8.5", + "thiserror", + "tokio", + "webrtc-util", +] + +[[package]] +name = "webrtc-srtp" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6183edc4c1c6c0175f8812eefdce84dfa0aea9c3ece71c2bf6ddd3c964de3da5" +dependencies = [ + "aead 0.4.3", + "aes 0.7.5", + "aes-gcm 0.9.4", + "async-trait", + "byteorder", + "bytes", + "ctr 0.8.0", + "hmac 0.11.0", + "log", + "rtcp", + "rtp", + "sha-1", + "subtle", + "thiserror", + "tokio", + "webrtc-util", +] + +[[package]] +name = "webrtc-util" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93f1db1727772c05cf7a2cfece52c3aca8045ca1e176cd517d323489aa3c6d87" +dependencies = [ + "async-trait", + "bitflags", + "bytes", + "cc", + "ipnet", + "lazy_static", + "libc", + "log", + "nix", + "rand 0.8.5", + "thiserror", + "tokio", + "winapi", +] + +[[package]] +name = "which" +version = "4.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" +dependencies = [ + "either", + "libc", + "once_cell", +] + +[[package]] +name = "widestring" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17882f045410753661207383517a6f62ec3dbeb6a4ed2acce01f0728238d1983" + +[[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.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45296b64204227616fdbf2614cefa4c236b98ee64dfaaaa435207ed99fe7829f" +dependencies = [ + "windows_aarch64_msvc 0.34.0", + "windows_i686_gnu 0.34.0", + "windows_i686_msvc 0.34.0", + "windows_x86_64_gnu 0.34.0", + "windows_x86_64_msvc 0.34.0", +] + +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17cffbe740121affb56fad0fc0e421804adf0ae00891205213b5cecd30db881d" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_i686_gnu" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2564fde759adb79129d9b4f54be42b32c89970c18ebf93124ca8870a498688ed" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_msvc" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cd9d32ba70453522332c14d38814bceeb747d80b3958676007acadd7e166956" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfce6deae227ee8d356d19effc141a509cc503dfd1f850622ec4b0f84428e1f4" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d19538ccc21819d01deaf88d6a17eae6596a12e9aafdbb97916fb49896d89de9" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "winreg" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +dependencies = [ + "winapi", +] + +[[package]] +name = "x25519-dalek" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a0c105152107e3b96f6a00a65e86ce82d9b125230e1c4302940eca58ff71f4f" +dependencies = [ + "curve25519-dalek 3.2.0", + "rand_core 0.5.1", + "zeroize", +] + +[[package]] +name = "x25519-dalek" +version = "2.0.0-pre.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5da623d8af10a62342bcbbb230e33e58a63255a58012f8653c578e54bab48df" +dependencies = [ + "curve25519-dalek 3.2.0", + "rand_core 0.6.4", + "zeroize", +] + +[[package]] +name = "x509-parser" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb9bace5b5589ffead1afb76e43e34cff39cd0f3ce7e170ae0c29e53b88eb1c" +dependencies = [ + "asn1-rs 0.3.1", + "base64 0.13.1", + "data-encoding", + "der-parser 7.0.0", + "lazy_static", + "nom", + "oid-registry 0.4.0", + "ring", + "rusticata-macros", + "thiserror", + "time", +] + +[[package]] +name = "x509-parser" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0ecbeb7b67ce215e40e3cc7f2ff902f94a223acf44995934763467e7b1febc8" +dependencies = [ + "asn1-rs 0.5.2", + "base64 0.13.1", + "data-encoding", + "der-parser 8.2.0", + "lazy_static", + "nom", + "oid-registry 0.6.1", + "rusticata-macros", + "thiserror", + "time", +] + +[[package]] +name = "yamux" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d9ba232399af1783a58d8eb26f6b5006fbefe2dc9ef36bd283324792d03ea5" +dependencies = [ + "futures", + "log", + "nohash-hasher", + "parking_lot 0.12.1", + "rand 0.8.5", + "static_assertions", +] + +[[package]] +name = "yasna" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aed2e7a52e3744ab4d0c05c20aa065258e84c49fd4226f5191b2ed29712710b4" +dependencies = [ + "time", +] + +[[package]] +name = "zeroize" +version = "1.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44bf07cb3e50ea2003396695d58bf46bc9887a1f362260446fad6bc4e79bd36c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "synstructure", +] diff --git a/flood_publishing/Cargo.toml b/flood_publishing/Cargo.toml new file mode 100644 index 0000000..bf59eb1 --- /dev/null +++ b/flood_publishing/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "flood_publishing" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +futures = "0.3" +# TODO: Update libp2p once the next version, which includes prometheus-client v0.20, has been released. +# See https://github.com/ackintosh/rust-libp2p/commit/df09870c8c2294cbaeb881f58d4f9752125562bc +libp2p = { git = "https://github.com/ackintosh/rust-libp2p.git", branch = "prometheus-client-0.20.0", default-features = false, features = ["gossipsub", "dns", "tcp", "tokio", "noise", "mplex", "yamux", "serde"] } +rand = { version = "0.8", features = ["small_rng"] } +serde = "1.0" +serde_json = "1.0" +sha2 = "0.10" +# TODO: Update testground once the next version(v0.5.0). +testground = { git = "https://github.com/testground/sdk-rust.git", rev = "1fd032ec29361a00b25c0c8a6bac5f19a43019eb" } +tokio = { version = "1.21", features = ["macros"] } +tracing = "0.1" +tracing-subscriber = { version = "0.3", features = ["env-filter"] } diff --git a/flood_publishing/Dockerfile b/flood_publishing/Dockerfile new file mode 100644 index 0000000..8ec157b --- /dev/null +++ b/flood_publishing/Dockerfile @@ -0,0 +1,46 @@ +# This Dockerfile is for the `docker:generic` builder. +# See https://docs.testground.ai/builder-library/docker-generic for details about the builder. +FROM rust:1.67-bullseye as builder +WORKDIR /usr/src/test-plan + +# * `prost-build`, a dependency of `libp2p-gossipsub`, requires cmake. +# There is a discussion for removing cmake from their dependency. +# https://github.com/tokio-rs/prost/pull/620 +# * Since `prost-build` v0.11, `protoc` is required. +# https://github.com/tokio-rs/prost/releases/tag/v0.11.0 +RUN apt-get update && apt-get install -y cmake && apt-get install -y protobuf-compiler + +# Cache dependencies between test runs, +# See https://blog.mgattozzi.dev/caching-rust-docker-builds/ +# And https://github.com/rust-lang/cargo/issues/2644 +RUN mkdir -p ./plan/src/ +# This is a placeholder main function to build only the dependencies. +RUN echo "fn main() { println!(\"If you see this message, you may want to clean up the target directory or the Docker build cache.\") }" > ./plan/src/main.rs +COPY ./plan/Cargo.toml ./plan/ +RUN cd ./plan/ && cargo build --release + +# Coping each files only needed instead of all of them(`COPY . .`) in order to avoid unnecessary compiling. +# e.g. compile triggered by modifiying `manifest.toml`. +# NOTE: +# `.dockerignore` is not effective because the build context is not this directory on the test run. +# See https://docs.testground.ai/builder-library/docker-generic#usage +COPY ./plan/src ./plan/src +COPY ./plan/Cargo.lock ./plan/ + +# This is in order to make sure `main.rs`s mtime timestamp is updated to avoid the dummy `main` +# remaining in the release binary. +# https://github.com/rust-lang/cargo/issues/9598 +RUN touch ./plan/src/main.rs + +# Note: In `docker:generic` builder, the root of the docker build context is one directory higher +# than this test plan. +# See https://docs.testground.ai/builder-library/docker-generic#usage +RUN cd ./plan/ && cargo build --release + +FROM debian:bullseye-slim +COPY --from=builder /usr/src/test-plan/plan/target/release/flood_publishing /usr/local/bin/flood_publishing + +# Configure Logging +ENV RUST_LOG=libp2p_gossipsub=debug,flood_publishing=info + +ENTRYPOINT ["flood_publishing"] diff --git a/flood_publishing/README.md b/flood_publishing/README.md new file mode 100644 index 0000000..9a84fce --- /dev/null +++ b/flood_publishing/README.md @@ -0,0 +1,10 @@ +# Flood Publishing Simulation + +## Running the Simulation + +This simulation can be run with the following command (from within the repos +root directory): + +```sh +testground run single --plan gossipsub-testground/flood_publishing --testcase flood_publishing --builder docker:generic --runner local:docker --instances 2 --wait +``` diff --git a/flood_publishing/manifest.toml b/flood_publishing/manifest.toml new file mode 100644 index 0000000..721b5ee --- /dev/null +++ b/flood_publishing/manifest.toml @@ -0,0 +1,21 @@ +name = "flood_publishing" + +[defaults] +builder = "docker:generic" +runner = "local:docker" +disable_metrics = false + +[builders."docker:generic"] +enabled = true + +[runners."local:docker"] +enabled = true + +[[testcases]] +name = "flood_publishing" +instances = { min = 3, max = 100, default = 3 } + [testcases.params] + # ########################################################################### + # Network config + # ########################################################################### + bandwidth = { type = "int", desc = "Bandwidth in MiB", unit = "MiB", default = 1 } diff --git a/flood_publishing/src/main.rs b/flood_publishing/src/main.rs new file mode 100644 index 0000000..96214ad --- /dev/null +++ b/flood_publishing/src/main.rs @@ -0,0 +1,183 @@ +mod network; + +use crate::network::Network; +use libp2p::futures::StreamExt; +use libp2p::identity::Keypair; +use libp2p::multiaddr::Protocol; +use libp2p::{Multiaddr, PeerId}; +use serde::de::DeserializeOwned; +use serde::Serialize; +use std::borrow::Cow; +use std::collections::HashMap; +use std::str::FromStr; +use std::time::Duration; +use testground::client::Client; +use testground::network_conf::{ + FilterAction, LinkShape, NetworkConfiguration, RoutingPolicyType, DEFAULT_DATA_NETWORK, +}; + +// States for `barrier()` +pub(crate) const BARRIER_NETWORK_READY: &str = "Network configured"; +pub(crate) const BARRIER_LIBP2P_READY: &str = "Started libp2p"; +pub(crate) const BARRIER_TOPOLOGY_READY: &str = "Topology generated"; +pub(crate) const BARRIER_SUBSCRIBED: &str = "Subscribed"; + +#[tokio::main] +async fn main() -> Result<(), Box> { + if let Ok(env_filter) = tracing_subscriber::EnvFilter::try_from_default_env() { + tracing_subscriber::fmt().with_env_filter(env_filter).init(); + } + + let client = Client::new_and_init().await?; + let bandwidth = get_param::("bandwidth", &client.run_parameters().test_instance_params)?; + + client + .configure_network(NetworkConfiguration { + network: DEFAULT_DATA_NETWORK.to_owned(), + ipv4: None, + ipv6: None, + enable: true, + default: LinkShape { + latency: 1 * 1_000_000, // 1 msec + jitter: 0, + bandwidth: bandwidth * 1024 * 1024, // MiB + filter: FilterAction::Accept, + loss: 0.0, + corrupt: 0.0, + corrupt_corr: 0.0, + reorder: 0.0, + reorder_corr: 0.0, + duplicate: 0.0, + duplicate_corr: 0.0, + }, + rules: None, + callback_state: BARRIER_NETWORK_READY.to_owned(), + callback_target: None, + routing_policy: RoutingPolicyType::DenyAll, + }) + .await?; + + client + .barrier( + BARRIER_NETWORK_READY, + client.run_parameters().test_instance_count, + ) + .await?; + + let node_seq = client.group_seq() as usize - 1; + let keypair = Keypair::generate_ed25519(); + let peer_id = PeerId::from(keypair.public()); + let multiaddr = { + let mut multiaddr = Multiaddr::from( + client + .run_parameters() + .data_network_ip()? + .expect("Should have an IP address for the data network"), + ); + multiaddr.push(Protocol::Tcp(9000)); + multiaddr + }; + + let participants = participants( + "peer_info", + &client, + (peer_id.clone(), multiaddr.clone()), + client.run_parameters().test_group_instance_count as usize, + ) + .await?; + + println!("participants: {:?}", participants); + + let mut network = Network::new( + keypair, + node_seq, + (peer_id, multiaddr), + client.clone(), + participants, + ); + + network.start_libp2p().await; + + client + .signal_and_wait( + BARRIER_LIBP2P_READY, + client.run_parameters().test_instance_count, + ) + .await?; + + network.dial_peers(); + + client + .signal_and_wait( + BARRIER_TOPOLOGY_READY, + client.run_parameters().test_instance_count, + ) + .await?; + + network.subscribe()?; + + client + .signal_and_wait( + BARRIER_SUBSCRIBED, + client.run_parameters().test_instance_count, + ) + .await?; + + network + .run_sim(Duration::from_secs(5), Duration::from_secs(20)) + .await; + + network.debug(); + + client.record_success().await?; + Ok(()) +} + +fn get_param(k: &str, instance_params: &HashMap) -> Result { + instance_params + .get(k) + .ok_or(format!("{k} is not specified."))? + .parse::() + .map_err(|_| format!("Failed to parse instance_param. key: {}", k)) +} + +async fn participants( + topic: &'static str, + client: &Client, + info: (PeerId, Multiaddr), + count: usize, +) -> Result, Box> { + let infos = publish_and_collect(topic, &client, info.clone(), count).await?; + + Ok(infos + .into_iter() + .filter(|(peer_id, _)| peer_id != &info.0) + .collect::>()) +} + +async fn publish_and_collect( + topic: &'static str, + client: &Client, + info: T, + count: usize, +) -> Result, Box> { + let serialized = Cow::Owned(serde_json::to_value(&info)?); + client.publish(topic, serialized).await?; + + let mut stream = client.subscribe(topic, count * 2).await; + + let mut vec: Vec = Vec::with_capacity(count); + + for _ in 0..count { + match stream.next().await { + Some(Ok(other)) => { + let info: T = serde_json::from_value(other)?; + vec.push(info); + } + Some(Err(e)) => return Err(Box::new(e)), + None => unreachable!(), + } + } + + Ok(vec) +} diff --git a/flood_publishing/src/network.rs b/flood_publishing/src/network.rs new file mode 100644 index 0000000..9e3bb8d --- /dev/null +++ b/flood_publishing/src/network.rs @@ -0,0 +1,219 @@ +use libp2p::core::muxing::StreamMuxerBox; +use libp2p::core::upgrade::{SelectUpgrade, Version}; +use libp2p::dns::TokioDnsConfig; +use libp2p::futures::StreamExt; +use libp2p::gossipsub::subscription_filter::AllowAllSubscriptionFilter; +use libp2p::gossipsub::{ + Behaviour, ConfigBuilder, GossipsubMessage, IdentTopic, IdentityTransform, MessageAuthenticity, + MessageId, PublishError, ValidationMode, +}; +use libp2p::identity::Keypair; +use libp2p::mplex::MplexConfig; +use libp2p::noise::NoiseConfig; +use libp2p::swarm::{SwarmBuilder, SwarmEvent}; +use libp2p::tcp::tokio::Transport as TcpTransport; +use libp2p::tcp::Config as TcpConfig; +use libp2p::yamux::YamuxConfig; +use libp2p::{Multiaddr, PeerId, Swarm, Transport}; +use rand::rngs::SmallRng; +use rand::{Rng, SeedableRng}; +use sha2::{Digest, Sha256}; +use std::sync::Arc; +use std::time::Duration; +use testground::client::Client; +use tokio::time::{interval, Interval}; +use tracing::{error, info}; + +pub(crate) const SLOT: u64 = 12; + +/// The backoff time for pruned peers. +const PRUNE_BACKOFF: u64 = 60; + +const TOPIC: &str = "t"; + +pub(crate) struct Network { + swarm: Swarm, + node_seq: usize, + node_info: (PeerId, Multiaddr), + client: Arc, + participants: Vec<(PeerId, Multiaddr)>, + publish_interval: Interval, + rng: SmallRng, +} + +impl Network { + pub(crate) fn new( + keypair: Keypair, + node_seq: usize, + node_info: (PeerId, Multiaddr), + client: Client, + participants: Vec<(PeerId, Multiaddr)>, + ) -> Self { + let gossip_message_id = move |message: &GossipsubMessage| { + MessageId::from( + &Sha256::digest([message.topic.as_str().as_bytes(), &message.data].concat())[..20], + ) + }; + + let gossipsub_config = ConfigBuilder::default() + // Following params are set based on lighthouse. + .max_transmit_size(10 * 1_048_576) // 10M + .prune_backoff(Duration::from_secs(PRUNE_BACKOFF)) + .fanout_ttl(Duration::from_secs(60)) + .history_length(12) + .max_messages_per_rpc(Some(500)) + .validate_messages() + .validation_mode(ValidationMode::Anonymous) + .duplicate_cache_time(Duration::from_secs(33 * SLOT + 1)) + .message_id_fn(gossip_message_id) + .allow_self_origin(true) + // Following params are set based on `NetworkLoad: 4 Average` which defined at lighthouse. + .heartbeat_interval(Duration::from_millis(700)) + .mesh_n(8) + .mesh_n_low(4) + .mesh_outbound_min(3) + .mesh_n_high(12) + .gossip_lazy(3) + .history_gossip(3) + .build() + .expect("Valid gossipsub configuration"); + + let gossipsub = Behaviour::new_with_subscription_filter_and_transform( + MessageAuthenticity::Anonymous, + gossipsub_config, + None, + AllowAllSubscriptionFilter {}, + IdentityTransform {}, + ) + .expect("Valid configuration"); + + let swarm = SwarmBuilder::with_tokio_executor( + build_transport(&keypair), + gossipsub, + PeerId::from(keypair.public()), + ) + .build(); + + Network { + swarm, + node_seq, + node_info, + client: Arc::new(client), + participants, + publish_interval: interval(Duration::from_secs(3)), + rng: SmallRng::from_entropy(), + } + } + + pub(crate) async fn start_libp2p(&mut self) { + self.swarm + .listen_on(self.node_info.1.clone()) + .expect("Swarm starts listening"); + + match self.swarm.next().await.unwrap() { + SwarmEvent::NewListenAddr { address, .. } => { + assert_eq!(address, self.node_info.1) + } + e => panic!("Unexpected event {:?}", e), + }; + } + + pub(crate) fn dial_peers(&mut self) { + for (peer_id, multiaddr) in self.participants.iter() { + info!("dialing {} on {}", peer_id, multiaddr); + + if let Err(e) = self.swarm.dial( + libp2p::swarm::dial_opts::DialOpts::peer_id(peer_id.clone()) + .addresses(vec![multiaddr.clone()]) + .build(), + ) { + panic!("Filed to dial {e}: {} {}", peer_id, multiaddr); + } + } + } + + pub(crate) fn subscribe(&mut self) -> Result<(), Box> { + self.swarm + .behaviour_mut() + .subscribe(&IdentTopic::new(TOPIC))?; + Ok(()) + } + + pub(crate) fn publish(&mut self) -> Result { + let mut message = vec![0; 500_0000]; + // Ranomize the first 8 bits to make sure the message is unique. + let first_bytes = &mut message[0..8]; + self.rng.fill(first_bytes); + self.swarm + .behaviour_mut() + .publish(IdentTopic::new(TOPIC), message) + } + + pub(crate) fn debug(&self) { + info!("all mesh peers"); + for p in self.swarm.behaviour().all_mesh_peers() { + info!("{p}"); + } + + info!("all peers"); + for (p, topic) in self.swarm.behaviour().all_peers() { + info!("{:?} {p}", topic); + } + } + + pub(crate) async fn run_sim(&mut self, warm_up: Duration, run_duration: Duration) { + let warm_up = tokio::time::sleep(warm_up); + let deadline = tokio::time::sleep(run_duration); + + let mut done_warm_up = false; + futures::pin_mut!(warm_up); + futures::pin_mut!(deadline); + + loop { + tokio::select! { + _ = deadline.as_mut() => { + // Sim complete + break; + } + _ = warm_up.as_mut() => { + done_warm_up = true + } + _ = self.publish_interval.tick() => { + if !done_warm_up { + continue; + } + if self.node_seq != 0 { + continue; + } + + if let Err(e) = self.publish() { + error!("Failed to publish message: {e}"); + } + } + event = self.swarm.select_next_some() => { + info!("Event: {event:?}"); + } + } + } + } +} + +/// Set up an encrypted TCP transport over the Mplex and Yamux protocols. +fn build_transport(keypair: &Keypair) -> libp2p::core::transport::Boxed<(PeerId, StreamMuxerBox)> { + let transport = TokioDnsConfig::system(TcpTransport::new(TcpConfig::default().nodelay(true))) + .expect("DNS config"); + + let noise_keys = libp2p::noise::Keypair::::new() + .into_authentic(keypair) + .expect("Signing libp2p-noise static DH keypair failed."); + + transport + .upgrade(Version::V1) + .authenticate(NoiseConfig::xx(noise_keys).into_authenticated()) + .multiplex(SelectUpgrade::new( + YamuxConfig::default(), + MplexConfig::default(), + )) + .timeout(Duration::from_secs(20)) + .boxed() +} From 5b091cf243fd41690405c46e401122acf63c018d Mon Sep 17 00:00:00 2001 From: ackintosh Date: Thu, 30 Mar 2023 09:03:12 +0900 Subject: [PATCH 02/11] Measure latency --- flood_publishing/Cargo.lock | 370 ++++++++++------------------ flood_publishing/Cargo.toml | 5 +- flood_publishing/Dockerfile | 2 +- flood_publishing/measure_latency.py | 120 +++++++++ flood_publishing/src/main.rs | 7 +- flood_publishing/src/network.rs | 14 +- 6 files changed, 261 insertions(+), 257 deletions(-) create mode 100644 flood_publishing/measure_latency.py diff --git a/flood_publishing/Cargo.lock b/flood_publishing/Cargo.lock index 759db97..24a2f94 100644 --- a/flood_publishing/Cargo.lock +++ b/flood_publishing/Cargo.lock @@ -213,12 +213,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "asn1_der" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e22d1f4b888c298a027c99dc9048015fac177587de20fc30232a057dfbe24a21" - [[package]] name = "async-io" version = "1.13.0" @@ -233,7 +227,7 @@ dependencies = [ "log", "parking", "polling", - "rustix 0.37.3", + "rustix", "slab", "socket2", "waker-fn", @@ -302,12 +296,6 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" -[[package]] -name = "base64" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea22880d78093b0cbe17c89f64a7d457941e65759157ec6cb31a31d652b05e5" - [[package]] name = "base64" version = "0.21.0" @@ -937,17 +925,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "errno" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" -dependencies = [ - "errno-dragonfly", - "libc", - "winapi", -] - [[package]] name = "errno" version = "0.3.0" @@ -956,7 +933,7 @@ checksum = "50d6a0976c999d473fe89ad888d5a284e55366d9dc9038b1ba2aa15128c4afa0" dependencies = [ "errno-dragonfly", "libc", - "windows-sys 0.45.0", + "windows-sys", ] [[package]] @@ -1000,12 +977,6 @@ version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93ace6ec7cc19c8ed33a32eaa9ea692d7faea05006b5356b9e2b668ec4bc3955" -[[package]] -name = "fixedbitset" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" - [[package]] name = "flood_publishing" version = "0.1.0" @@ -1517,7 +1488,7 @@ checksum = "09270fd4fa1111bc614ed2246c7ef56239a3063d5be0d1ec3b589c505d400aeb" dependencies = [ "hermit-abi 0.3.1", "libc", - "windows-sys 0.45.0", + "windows-sys", ] [[package]] @@ -1591,17 +1562,20 @@ checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" [[package]] name = "libp2p" -version = "0.51.0" -source = "git+https://github.com/ackintosh/rust-libp2p.git?branch=prometheus-client-0.20.0#df09870c8c2294cbaeb881f58d4f9752125562bc" +version = "0.51.2" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=0c4c4cd88bba487173bd0e7d4f1229d69517ba5c#0c4c4cd88bba487173bd0e7d4f1229d69517ba5c" dependencies = [ "bytes", "futures", "futures-timer", "getrandom 0.2.8", "instant", + "libp2p-allow-block-list", + "libp2p-connection-limits", "libp2p-core", "libp2p-dns", "libp2p-gossipsub", + "libp2p-identity", "libp2p-kad", "libp2p-mdns", "libp2p-metrics", @@ -1613,24 +1587,42 @@ dependencies = [ "libp2p-webrtc", "libp2p-yamux", "multiaddr", - "parking_lot 0.12.1", "pin-project", - "smallvec", +] + +[[package]] +name = "libp2p-allow-block-list" +version = "0.1.0" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=0c4c4cd88bba487173bd0e7d4f1229d69517ba5c#0c4c4cd88bba487173bd0e7d4f1229d69517ba5c" +dependencies = [ + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", + "void", +] + +[[package]] +name = "libp2p-connection-limits" +version = "0.1.0" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=0c4c4cd88bba487173bd0e7d4f1229d69517ba5c#0c4c4cd88bba487173bd0e7d4f1229d69517ba5c" +dependencies = [ + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", + "void", ] [[package]] name = "libp2p-core" -version = "0.39.0" -source = "git+https://github.com/ackintosh/rust-libp2p.git?branch=prometheus-client-0.20.0#df09870c8c2294cbaeb881f58d4f9752125562bc" +version = "0.39.1" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=0c4c4cd88bba487173bd0e7d4f1229d69517ba5c#0c4c4cd88bba487173bd0e7d4f1229d69517ba5c" dependencies = [ - "asn1_der", - "bs58", - "ed25519-dalek", "either", "fnv", "futures", "futures-timer", "instant", + "libp2p-identity", "log", "multiaddr", "multihash", @@ -1638,27 +1630,24 @@ dependencies = [ "once_cell", "parking_lot 0.12.1", "pin-project", - "prost", - "prost-build", + "quick-protobuf", "rand 0.8.5", "rw-stream-sink", - "sec1", "serde", - "sha2 0.10.6", "smallvec", "thiserror", "unsigned-varint", "void", - "zeroize", ] [[package]] name = "libp2p-dns" version = "0.39.0" -source = "git+https://github.com/ackintosh/rust-libp2p.git?branch=prometheus-client-0.20.0#df09870c8c2294cbaeb881f58d4f9752125562bc" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=0c4c4cd88bba487173bd0e7d4f1229d69517ba5c#0c4c4cd88bba487173bd0e7d4f1229d69517ba5c" dependencies = [ "futures", "libp2p-core", + "libp2p-identity", "log", "parking_lot 0.12.1", "smallvec", @@ -1667,11 +1656,11 @@ dependencies = [ [[package]] name = "libp2p-gossipsub" -version = "0.44.0" -source = "git+https://github.com/ackintosh/rust-libp2p.git?branch=prometheus-client-0.20.0#df09870c8c2294cbaeb881f58d4f9752125562bc" +version = "0.44.2" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=0c4c4cd88bba487173bd0e7d4f1229d69517ba5c#0c4c4cd88bba487173bd0e7d4f1229d69517ba5c" dependencies = [ "asynchronous-codec", - "base64 0.20.0", + "base64 0.21.0", "byteorder", "bytes", "fnv", @@ -1679,12 +1668,12 @@ dependencies = [ "hex_fmt", "instant", "libp2p-core", + "libp2p-identity", "libp2p-swarm", "log", - "prometheus-client 0.20.0", - "prost", - "prost-build", - "prost-codec", + "prometheus-client", + "quick-protobuf", + "quick-protobuf-codec", "rand 0.8.5", "regex", "serde", @@ -1695,10 +1684,28 @@ dependencies = [ "wasm-timer", ] +[[package]] +name = "libp2p-identity" +version = "0.1.1" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=0c4c4cd88bba487173bd0e7d4f1229d69517ba5c#0c4c4cd88bba487173bd0e7d4f1229d69517ba5c" +dependencies = [ + "bs58", + "ed25519-dalek", + "log", + "multiaddr", + "multihash", + "prost", + "quick-protobuf", + "rand 0.8.5", + "serde", + "thiserror", + "zeroize", +] + [[package]] name = "libp2p-kad" -version = "0.43.0" -source = "git+https://github.com/ackintosh/rust-libp2p.git?branch=prometheus-client-0.20.0#df09870c8c2294cbaeb881f58d4f9752125562bc" +version = "0.43.1" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=0c4c4cd88bba487173bd0e7d4f1229d69517ba5c#0c4c4cd88bba487173bd0e7d4f1229d69517ba5c" dependencies = [ "arrayvec", "asynchronous-codec", @@ -1709,10 +1716,10 @@ dependencies = [ "futures-timer", "instant", "libp2p-core", + "libp2p-identity", "libp2p-swarm", "log", - "prost", - "prost-build", + "quick-protobuf", "rand 0.8.5", "serde", "sha2 0.10.6", @@ -1726,12 +1733,13 @@ dependencies = [ [[package]] name = "libp2p-mdns" version = "0.43.0" -source = "git+https://github.com/ackintosh/rust-libp2p.git?branch=prometheus-client-0.20.0#df09870c8c2294cbaeb881f58d4f9752125562bc" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=0c4c4cd88bba487173bd0e7d4f1229d69517ba5c#0c4c4cd88bba487173bd0e7d4f1229d69517ba5c" dependencies = [ "data-encoding", "futures", "if-watch", "libp2p-core", + "libp2p-identity", "libp2p-swarm", "log", "rand 0.8.5", @@ -1745,23 +1753,25 @@ dependencies = [ [[package]] name = "libp2p-metrics" version = "0.12.0" -source = "git+https://github.com/ackintosh/rust-libp2p.git?branch=prometheus-client-0.20.0#df09870c8c2294cbaeb881f58d4f9752125562bc" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=0c4c4cd88bba487173bd0e7d4f1229d69517ba5c#0c4c4cd88bba487173bd0e7d4f1229d69517ba5c" dependencies = [ "libp2p-core", "libp2p-gossipsub", + "libp2p-identity", "libp2p-swarm", - "prometheus-client 0.19.0", + "prometheus-client", ] [[package]] name = "libp2p-mplex" version = "0.39.0" -source = "git+https://github.com/ackintosh/rust-libp2p.git?branch=prometheus-client-0.20.0#df09870c8c2294cbaeb881f58d4f9752125562bc" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=0c4c4cd88bba487173bd0e7d4f1229d69517ba5c#0c4c4cd88bba487173bd0e7d4f1229d69517ba5c" dependencies = [ "asynchronous-codec", "bytes", "futures", "libp2p-core", + "libp2p-identity", "log", "nohash-hasher", "parking_lot 0.12.1", @@ -1772,17 +1782,17 @@ dependencies = [ [[package]] name = "libp2p-noise" -version = "0.42.0" -source = "git+https://github.com/ackintosh/rust-libp2p.git?branch=prometheus-client-0.20.0#df09870c8c2294cbaeb881f58d4f9752125562bc" +version = "0.42.1" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=0c4c4cd88bba487173bd0e7d4f1229d69517ba5c#0c4c4cd88bba487173bd0e7d4f1229d69517ba5c" dependencies = [ "bytes", "curve25519-dalek 3.2.0", "futures", "libp2p-core", + "libp2p-identity", "log", "once_cell", - "prost", - "prost-build", + "quick-protobuf", "rand 0.8.5", "sha2 0.10.6", "snow", @@ -1794,14 +1804,15 @@ dependencies = [ [[package]] name = "libp2p-quic" -version = "0.7.0-alpha.2" -source = "git+https://github.com/ackintosh/rust-libp2p.git?branch=prometheus-client-0.20.0#df09870c8c2294cbaeb881f58d4f9752125562bc" +version = "0.7.0-alpha.3" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=0c4c4cd88bba487173bd0e7d4f1229d69517ba5c#0c4c4cd88bba487173bd0e7d4f1229d69517ba5c" dependencies = [ "bytes", "futures", "futures-timer", "if-watch", "libp2p-core", + "libp2p-identity", "libp2p-tls", "log", "parking_lot 0.12.1", @@ -1814,8 +1825,8 @@ dependencies = [ [[package]] name = "libp2p-swarm" -version = "0.42.0" -source = "git+https://github.com/ackintosh/rust-libp2p.git?branch=prometheus-client-0.20.0#df09870c8c2294cbaeb881f58d4f9752125562bc" +version = "0.42.1" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=0c4c4cd88bba487173bd0e7d4f1229d69517ba5c#0c4c4cd88bba487173bd0e7d4f1229d69517ba5c" dependencies = [ "either", "fnv", @@ -1823,11 +1834,10 @@ dependencies = [ "futures-timer", "instant", "libp2p-core", + "libp2p-identity", "log", - "pin-project", "rand 0.8.5", "smallvec", - "thiserror", "tokio", "void", ] @@ -1835,13 +1845,14 @@ dependencies = [ [[package]] name = "libp2p-tcp" version = "0.39.0" -source = "git+https://github.com/ackintosh/rust-libp2p.git?branch=prometheus-client-0.20.0#df09870c8c2294cbaeb881f58d4f9752125562bc" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=0c4c4cd88bba487173bd0e7d4f1229d69517ba5c#0c4c4cd88bba487173bd0e7d4f1229d69517ba5c" dependencies = [ "futures", "futures-timer", "if-watch", "libc", "libp2p-core", + "libp2p-identity", "log", "socket2", "tokio", @@ -1849,25 +1860,26 @@ dependencies = [ [[package]] name = "libp2p-tls" -version = "0.1.0-alpha.2" -source = "git+https://github.com/ackintosh/rust-libp2p.git?branch=prometheus-client-0.20.0#df09870c8c2294cbaeb881f58d4f9752125562bc" +version = "0.1.0" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=0c4c4cd88bba487173bd0e7d4f1229d69517ba5c#0c4c4cd88bba487173bd0e7d4f1229d69517ba5c" dependencies = [ "futures", "futures-rustls", "libp2p-core", + "libp2p-identity", "rcgen 0.10.0", "ring", "rustls 0.20.8", "thiserror", "webpki 0.22.0", - "x509-parser 0.14.0", + "x509-parser 0.15.0", "yasna", ] [[package]] name = "libp2p-webrtc" -version = "0.4.0-alpha.2" -source = "git+https://github.com/ackintosh/rust-libp2p.git?branch=prometheus-client-0.20.0#df09870c8c2294cbaeb881f58d4f9752125562bc" +version = "0.4.0-alpha.4" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=0c4c4cd88bba487173bd0e7d4f1229d69517ba5c#0c4c4cd88bba487173bd0e7d4f1229d69517ba5c" dependencies = [ "async-trait", "asynchronous-codec", @@ -1877,12 +1889,12 @@ dependencies = [ "hex", "if-watch", "libp2p-core", + "libp2p-identity", "libp2p-noise", "log", "multihash", - "prost", - "prost-build", - "prost-codec", + "quick-protobuf", + "quick-protobuf-codec", "rand 0.8.5", "rcgen 0.9.3", "serde", @@ -1897,12 +1909,11 @@ dependencies = [ [[package]] name = "libp2p-yamux" version = "0.43.0" -source = "git+https://github.com/ackintosh/rust-libp2p.git?branch=prometheus-client-0.20.0#df09870c8c2294cbaeb881f58d4f9752125562bc" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=0c4c4cd88bba487173bd0e7d4f1229d69517ba5c#0c4c4cd88bba487173bd0e7d4f1229d69517ba5c" dependencies = [ "futures", "libp2p-core", "log", - "parking_lot 0.12.1", "thiserror", "yamux", ] @@ -1913,12 +1924,6 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" -[[package]] -name = "linux-raw-sys" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" - [[package]] name = "linux-raw-sys" version = "0.3.0" @@ -2019,7 +2024,7 @@ dependencies = [ "libc", "log", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.45.0", + "windows-sys", ] [[package]] @@ -2081,16 +2086,10 @@ dependencies = [ "synstructure", ] -[[package]] -name = "multimap" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" - [[package]] name = "multistream-select" version = "0.12.1" -source = "git+https://github.com/ackintosh/rust-libp2p.git?branch=prometheus-client-0.20.0#df09870c8c2294cbaeb881f58d4f9752125562bc" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=0c4c4cd88bba487173bd0e7d4f1229d69517ba5c#0c4c4cd88bba487173bd0e7d4f1229d69517ba5c" dependencies = [ "bytes", "futures", @@ -2369,7 +2368,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-sys 0.45.0", + "windows-sys", ] [[package]] @@ -2402,16 +2401,6 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" -[[package]] -name = "petgraph" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" -dependencies = [ - "fixedbitset", - "indexmap", -] - [[package]] name = "pin-project" version = "1.0.12" @@ -2473,7 +2462,7 @@ dependencies = [ "libc", "log", "pin-project-lite", - "windows-sys 0.45.0", + "windows-sys", ] [[package]] @@ -2517,16 +2506,6 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" -[[package]] -name = "prettyplease" -version = "0.1.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" -dependencies = [ - "proc-macro2", - "syn 1.0.109", -] - [[package]] name = "proc-macro-crate" version = "1.1.3" @@ -2579,18 +2558,7 @@ dependencies = [ "dtoa", "itoa", "parking_lot 0.12.1", - "prometheus-client-derive-encode 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "prometheus-client" -version = "0.20.0" -source = "git+https://github.com/ackintosh/client_rust.git?branch=fix/protobuf-labels#ace52c9fdd709b967ea1f65e8313a99677854ea3" -dependencies = [ - "dtoa", - "itoa", - "parking_lot 0.12.1", - "prometheus-client-derive-encode 0.4.1 (git+https://github.com/ackintosh/client_rust.git?branch=fix/protobuf-labels)", + "prometheus-client-derive-encode", ] [[package]] @@ -2604,16 +2572,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "prometheus-client-derive-encode" -version = "0.4.1" -source = "git+https://github.com/ackintosh/client_rust.git?branch=fix/protobuf-labels#ace52c9fdd709b967ea1f65e8313a99677854ea3" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "prost" version = "0.11.8" @@ -2624,40 +2582,6 @@ dependencies = [ "prost-derive", ] -[[package]] -name = "prost-build" -version = "0.11.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c828f93f5ca4826f97fedcbd3f9a536c16b12cff3dbbb4a007f932bbad95b12" -dependencies = [ - "bytes", - "heck", - "itertools", - "lazy_static", - "log", - "multimap", - "petgraph", - "prettyplease", - "prost", - "prost-types", - "regex", - "syn 1.0.109", - "tempfile", - "which", -] - -[[package]] -name = "prost-codec" -version = "0.3.0" -source = "git+https://github.com/ackintosh/rust-libp2p.git?branch=prometheus-client-0.20.0#df09870c8c2294cbaeb881f58d4f9752125562bc" -dependencies = [ - "asynchronous-codec", - "bytes", - "prost", - "thiserror", - "unsigned-varint", -] - [[package]] name = "prost-derive" version = "0.11.8" @@ -2672,19 +2596,31 @@ dependencies = [ ] [[package]] -name = "prost-types" -version = "0.11.8" +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 = "379119666929a1afd7a043aa6cf96fa67a6dce9af60c88095a4686dbce4c9c88" +checksum = "9d6da84cc204722a989e01ba2f6e1e276e190f22263d0cb6ce8526fcdb0d2e1f" dependencies = [ - "prost", + "byteorder", ] [[package]] -name = "quick-error" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" +name = "quick-protobuf-codec" +version = "0.1.0" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=0c4c4cd88bba487173bd0e7d4f1229d69517ba5c#0c4c4cd88bba487173bd0e7d4f1229d69517ba5c" +dependencies = [ + "asynchronous-codec", + "bytes", + "quick-protobuf", + "thiserror", + "unsigned-varint", +] [[package]] name = "quinn-proto" @@ -2978,20 +2914,6 @@ dependencies = [ "nom", ] -[[package]] -name = "rustix" -version = "0.36.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db4165c9963ab29e422d6c26fbc1d37f15bace6b2810221f9d925023480fcf0e" -dependencies = [ - "bitflags", - "errno 0.2.8", - "io-lifetimes", - "libc", - "linux-raw-sys 0.1.4", - "windows-sys 0.45.0", -] - [[package]] name = "rustix" version = "0.37.3" @@ -2999,11 +2921,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62b24138615de35e32031d041a09032ef3487a616d901ca4db224e7d557efae2" dependencies = [ "bitflags", - "errno 0.3.0", + "errno", "io-lifetimes", "libc", - "linux-raw-sys 0.3.0", - "windows-sys 0.45.0", + "linux-raw-sys", + "windows-sys", ] [[package]] @@ -3034,7 +2956,7 @@ dependencies = [ [[package]] name = "rw-stream-sink" version = "0.3.0" -source = "git+https://github.com/ackintosh/rust-libp2p.git?branch=prometheus-client-0.20.0#df09870c8c2294cbaeb881f58d4f9752125562bc" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=0c4c4cd88bba487173bd0e7d4f1229d69517ba5c#0c4c4cd88bba487173bd0e7d4f1229d69517ba5c" dependencies = [ "futures", "pin-project", @@ -3440,19 +3362,6 @@ dependencies = [ "libc", ] -[[package]] -name = "tempfile" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af18f7ae1acd354b992402e9ec5864359d693cd8a79dcbef59f76891701c1e95" -dependencies = [ - "cfg-if", - "fastrand", - "redox_syscall", - "rustix 0.36.11", - "windows-sys 0.42.0", -] - [[package]] name = "testground" version = "0.5.0" @@ -3581,7 +3490,7 @@ dependencies = [ "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys 0.45.0", + "windows-sys", ] [[package]] @@ -4248,17 +4157,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "which" -version = "4.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" -dependencies = [ - "either", - "libc", - "once_cell", -] - [[package]] name = "widestring" version = "0.5.1" @@ -4300,21 +4198,6 @@ dependencies = [ "windows_x86_64_msvc 0.34.0", ] -[[package]] -name = "windows-sys" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc 0.42.2", -] - [[package]] name = "windows-sys" version = "0.45.0" @@ -4463,12 +4346,11 @@ dependencies = [ [[package]] name = "x509-parser" -version = "0.14.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0ecbeb7b67ce215e40e3cc7f2ff902f94a223acf44995934763467e7b1febc8" +checksum = "bab0c2f54ae1d92f4fcb99c0b7ccf0b1e3451cbd395e5f115ccbdbcb18d4f634" dependencies = [ "asn1-rs 0.5.2", - "base64 0.13.1", "data-encoding", "der-parser 8.2.0", "lazy_static", diff --git a/flood_publishing/Cargo.toml b/flood_publishing/Cargo.toml index bf59eb1..0796df2 100644 --- a/flood_publishing/Cargo.toml +++ b/flood_publishing/Cargo.toml @@ -7,9 +7,8 @@ edition = "2021" [dependencies] futures = "0.3" -# TODO: Update libp2p once the next version, which includes prometheus-client v0.20, has been released. -# See https://github.com/ackintosh/rust-libp2p/commit/df09870c8c2294cbaeb881f58d4f9752125562bc -libp2p = { git = "https://github.com/ackintosh/rust-libp2p.git", branch = "prometheus-client-0.20.0", default-features = false, features = ["gossipsub", "dns", "tcp", "tokio", "noise", "mplex", "yamux", "serde"] } +#libp2p = { version = "0.51.1", default-features = false, features = ["gossipsub", "dns", "tcp", "tokio", "noise", "mplex", "yamux", "serde"] } +libp2p = { git = "https://github.com/ackintosh/rust-libp2p.git", rev = "5a163900370b1720f5980b7a327d9ff272d12f37", default-features = false, features = ["gossipsub", "dns", "tcp", "tokio", "noise", "mplex", "yamux", "serde"] } rand = { version = "0.8", features = ["small_rng"] } serde = "1.0" serde_json = "1.0" diff --git a/flood_publishing/Dockerfile b/flood_publishing/Dockerfile index 8ec157b..1f79301 100644 --- a/flood_publishing/Dockerfile +++ b/flood_publishing/Dockerfile @@ -41,6 +41,6 @@ FROM debian:bullseye-slim COPY --from=builder /usr/src/test-plan/plan/target/release/flood_publishing /usr/local/bin/flood_publishing # Configure Logging -ENV RUST_LOG=libp2p_gossipsub=debug,flood_publishing=info +ENV RUST_LOG=libp2p_gossipsub=info,flood_publishing=info ENTRYPOINT ["flood_publishing"] diff --git a/flood_publishing/measure_latency.py b/flood_publishing/measure_latency.py new file mode 100644 index 0000000..e079b63 --- /dev/null +++ b/flood_publishing/measure_latency.py @@ -0,0 +1,120 @@ +import json +import sys + + +def parse_log(line): + label_index = line.index("[flood_publishing_test]") + log_str = line[label_index + len("[flood_publishing_test]"):] + log = json.loads(log_str) + log['node_id'] = extract_node_id(line) + return log + + +# Extract `node_id`, issued by Testground from a log. +# For example, this function returns `a04ed9` if a log like below is passed to: +# Mar 31 21:52:47.918675 INFO 0.8177s OTHER << single[002] (a04ed9) >> [flood_publishing_test]... +def extract_node_id(line): + label_sep = line.index(") >>") + return line[label_sep - 6:label_sep] + + +def node_id_to_peer_id(nodes, node_id): + for key, node in nodes.items(): + if key == node_id: + return node['peer_id'] + + print("node_id not found in nodes: " + node_id) + sys.exit(1) + + +def mean(latencies): + return sum(latencies) / len(latencies) + + +def median(latencies): + sorted_latencies = sorted(latencies) + length = len(sorted_latencies) + if length == 0: + return None + elif length % 2 == 0: + return (sorted_latencies[length // 2 - 1] + sorted_latencies[length // 2]) / 2 + else: + return sorted_latencies[length // 2] + + +# Example logs for debugging. +debug = '''Mar 31 21:57:30.155618 INFO 0.8585s OTHER << single[000] (3b20a6) >> [flood_publishing_test]{"event":"peer_id","peer_id":"12D3KooWN5f2YP3sKRykhAYEz48cfpGseW9dRfJxWDKXmKbb22c1","is_publisher":false} +Mar 31 21:57:30.157546 INFO 0.8605s OTHER << single[001] (a250a4) >> [flood_publishing_test]{"event":"peer_id","peer_id":"12D3KooWPf6ZJrYn1ojsp9iazfxJFRgYoHRC79yNDUviqSeS894x","is_publisher":true} +Mar 31 21:57:30.159084 INFO 0.8620s OTHER << single[002] (591350) >> [flood_publishing_test]{"event":"peer_id","peer_id":"12D3KooWAHNzQSmfpCF4r7WT8G7tWQFc2Yr6wES3Poz99r3RbkAy","is_publisher":false} +Mar 31 21:57:36.156824 INFO 6.8598s OTHER << single[001] (a250a4) >> [flood_publishing_test]{"event":"send","to":"12D3KooWN5f2YP3sKRykhAYEz48cfpGseW9dRfJxWDKXmKbb22c1","message_id":"c189ad462fb14701d0b1040139e119c60f3172b2","time":1680299856156} +Mar 31 21:57:36.156965 INFO 6.8599s OTHER << single[001] (a250a4) >> [flood_publishing_test]{"event":"send","to":"12D3KooWAHNzQSmfpCF4r7WT8G7tWQFc2Yr6wES3Poz99r3RbkAy","message_id":"c189ad462fb14701d0b1040139e119c60f3172b2","time":1680299856156} +Mar 31 21:57:36.862880 INFO 7.5658s OTHER << single[002] (591350) >> [flood_publishing_test]{"event":"receive","propagation_source":"12D3KooWPf6ZJrYn1ojsp9iazfxJFRgYoHRC79yNDUviqSeS894x","message_id":"c189ad462fb14701d0b1040139e119c60f3172b2","time":1680299856862} +Mar 31 21:57:36.928091 INFO 7.6310s OTHER << single[000] (3b20a6) >> [flood_publishing_test]{"event":"receive","propagation_source":"12D3KooWPf6ZJrYn1ojsp9iazfxJFRgYoHRC79yNDUviqSeS894x","message_id":"c189ad462fb14701d0b1040139e119c60f3172b2","time":1680299856927} +Mar 31 21:57:39.166998 INFO 9.8700s OTHER << single[001] (a250a4) >> [flood_publishing_test]{"event":"send","to":"12D3KooWN5f2YP3sKRykhAYEz48cfpGseW9dRfJxWDKXmKbb22c1","message_id":"25b377b39fd58a9b57f3a7c8fea759063fcfcc1a","time":1680299859158} +Mar 31 21:57:39.167076 INFO 9.8700s OTHER << single[001] (a250a4) >> [flood_publishing_test]{"event":"send","to":"12D3KooWAHNzQSmfpCF4r7WT8G7tWQFc2Yr6wES3Poz99r3RbkAy","message_id":"25b377b39fd58a9b57f3a7c8fea759063fcfcc1a","time":1680299859158} +Mar 31 21:57:39.899528 INFO 10.6025s OTHER << single[000] (3b20a6) >> [flood_publishing_test]{"event":"receive","propagation_source":"12D3KooWPf6ZJrYn1ojsp9iazfxJFRgYoHRC79yNDUviqSeS894x","message_id":"25b377b39fd58a9b57f3a7c8fea759063fcfcc1a","time":1680299859899} +Mar 31 21:57:39.941150 INFO 10.6441s OTHER << single[002] (591350) >> [flood_publishing_test]{"event":"receive","propagation_source":"12D3KooWPf6ZJrYn1ojsp9iazfxJFRgYoHRC79yNDUviqSeS894x","message_id":"25b377b39fd58a9b57f3a7c8fea759063fcfcc1a","time":1680299859940} +Mar 31 21:57:42.156844 INFO 12.8598s OTHER << single[001] (a250a4) >> [flood_publishing_test]{"event":"send","to":"12D3KooWAHNzQSmfpCF4r7WT8G7tWQFc2Yr6wES3Poz99r3RbkAy","message_id":"472b99c805f1d58a2155d4bf654cbcb58d12b75b","time":1680299862155} +Mar 31 21:57:42.157266 INFO 12.8602s OTHER << single[001] (a250a4) >> [flood_publishing_test]{"event":"send","to":"12D3KooWN5f2YP3sKRykhAYEz48cfpGseW9dRfJxWDKXmKbb22c1","message_id":"472b99c805f1d58a2155d4bf654cbcb58d12b75b","time":1680299862156} +Mar 31 21:57:42.873985 INFO 13.5770s OTHER << single[002] (591350) >> [flood_publishing_test]{"event":"receive","propagation_source":"12D3KooWPf6ZJrYn1ojsp9iazfxJFRgYoHRC79yNDUviqSeS894x","message_id":"472b99c805f1d58a2155d4bf654cbcb58d12b75b","time":1680299862873} +Mar 31 21:57:42.927309 INFO 13.6303s OTHER << single[000] (3b20a6) >> [flood_publishing_test]{"event":"receive","propagation_source":"12D3KooWPf6ZJrYn1ojsp9iazfxJFRgYoHRC79yNDUviqSeS894x","message_id":"472b99c805f1d58a2155d4bf654cbcb58d12b75b","time":1680299862926} +Mar 31 21:57:45.156938 INFO 15.8599s OTHER << single[001] (a250a4) >> [flood_publishing_test]{"event":"send","to":"12D3KooWAHNzQSmfpCF4r7WT8G7tWQFc2Yr6wES3Poz99r3RbkAy","message_id":"4ddbd9ff71a5ceebb8b1f3d4353a217594e11439","time":1680299865156} +Mar 31 21:57:45.157038 INFO 15.8600s OTHER << single[001] (a250a4) >> [flood_publishing_test]{"event":"send","to":"12D3KooWN5f2YP3sKRykhAYEz48cfpGseW9dRfJxWDKXmKbb22c1","message_id":"4ddbd9ff71a5ceebb8b1f3d4353a217594e11439","time":1680299865156} +Mar 31 21:57:45.858130 INFO 16.5611s OTHER << single[002] (591350) >> [flood_publishing_test]{"event":"receive","propagation_source":"12D3KooWPf6ZJrYn1ojsp9iazfxJFRgYoHRC79yNDUviqSeS894x","message_id":"4ddbd9ff71a5ceebb8b1f3d4353a217594e11439","time":1680299865851} +Mar 31 21:57:45.952577 INFO 16.6556s OTHER << single[000] (3b20a6) >> [flood_publishing_test]{"event":"receive","propagation_source":"12D3KooWPf6ZJrYn1ojsp9iazfxJFRgYoHRC79yNDUviqSeS894x","message_id":"4ddbd9ff71a5ceebb8b1f3d4353a217594e11439","time":1680299865928} +Mar 31 21:57:48.157564 INFO 18.8606s OTHER << single[001] (a250a4) >> [flood_publishing_test]{"event":"send","to":"12D3KooWAHNzQSmfpCF4r7WT8G7tWQFc2Yr6wES3Poz99r3RbkAy","message_id":"864403bdfd935b72df14701adf7fc44829c47357","time":1680299868156} +Mar 31 21:57:48.157612 INFO 18.8606s OTHER << single[001] (a250a4) >> [flood_publishing_test]{"event":"send","to":"12D3KooWN5f2YP3sKRykhAYEz48cfpGseW9dRfJxWDKXmKbb22c1","message_id":"864403bdfd935b72df14701adf7fc44829c47357","time":1680299868156} +Mar 31 21:57:48.863088 INFO 19.5661s OTHER << single[002] (591350) >> [flood_publishing_test]{"event":"receive","propagation_source":"12D3KooWPf6ZJrYn1ojsp9iazfxJFRgYoHRC79yNDUviqSeS894x","message_id":"864403bdfd935b72df14701adf7fc44829c47357","time":1680299868862} +Mar 31 21:57:48.927562 INFO 19.6306s OTHER << single[000] (3b20a6) >> [flood_publishing_test]{"event":"receive","propagation_source":"12D3KooWPf6ZJrYn1ojsp9iazfxJFRgYoHRC79yNDUviqSeS894x","message_id":"864403bdfd935b72df14701adf7fc44829c47357","time":1680299868927} +''' + + +def run(): + publisher = None + nodes = {} + + # The logs of events that the `publisher` sent a message. + send_logs = [] + # The logs of events that the `nodes` received a message from the `publisher`. + receive_logs = {} + + # for line in debug.split('\n'): # debugging + for line in sys.stdin: + if len(line) == 0: + continue + + log = parse_log(line.rstrip()) + if log['event'] == 'peer_id': + if log['is_publisher']: + publisher = log + else: + nodes[log['node_id']] = log + elif log['event'] == 'send': + if log['node_id'] == publisher['node_id']: + send_logs.append(log) + elif log['event'] == 'receive': + if log['node_id'] != publisher['node_id']: + key = node_id_to_peer_id(nodes, log['node_id']) + '_' + log['message_id'] + receive_logs[key] = log + else: + print("Unknown log: ", log) + sys.exit(1) + + print("\n\n*** measure_latency.py ***") + print('[publisher] node_id:', publisher['node_id'], ", peer_id:", publisher['peer_id']) + print('[nodes]', len(nodes) + 1) # nodes + publisher + print('[send_logs]', len(send_logs)) + + latencies = [] + + for send in send_logs: + receive = receive_logs[send['to'] + '_' + send['message_id']] + latencies.append(receive['time'] - send['time']) + + print('\n* Results (in milliseconds) *') + print('[mean]', mean(latencies)) + print('[median]', median(latencies)) + + +if __name__ == '__main__': + run() diff --git a/flood_publishing/src/main.rs b/flood_publishing/src/main.rs index 96214ad..4cee32d 100644 --- a/flood_publishing/src/main.rs +++ b/flood_publishing/src/main.rs @@ -64,7 +64,6 @@ async fn main() -> Result<(), Box> { ) .await?; - let node_seq = client.group_seq() as usize - 1; let keypair = Keypair::generate_ed25519(); let peer_id = PeerId::from(keypair.public()); let multiaddr = { @@ -88,9 +87,13 @@ async fn main() -> Result<(), Box> { println!("participants: {:?}", participants); + let is_publisher = client.group_seq() == 1; + + println!(r#"[flood_publishing_test]{{"event":"peer_id","peer_id":"{peer_id}","is_publisher":{}}}"#, is_publisher); + let mut network = Network::new( keypair, - node_seq, + is_publisher, (peer_id, multiaddr), client.clone(), participants, diff --git a/flood_publishing/src/network.rs b/flood_publishing/src/network.rs index 9e3bb8d..7088a9d 100644 --- a/flood_publishing/src/network.rs +++ b/flood_publishing/src/network.rs @@ -4,7 +4,7 @@ use libp2p::dns::TokioDnsConfig; use libp2p::futures::StreamExt; use libp2p::gossipsub::subscription_filter::AllowAllSubscriptionFilter; use libp2p::gossipsub::{ - Behaviour, ConfigBuilder, GossipsubMessage, IdentTopic, IdentityTransform, MessageAuthenticity, + Behaviour, ConfigBuilder, Message as GossipsubMessage, IdentTopic, IdentityTransform, MessageAuthenticity, MessageId, PublishError, ValidationMode, }; use libp2p::identity::Keypair; @@ -33,7 +33,7 @@ const TOPIC: &str = "t"; pub(crate) struct Network { swarm: Swarm, - node_seq: usize, + is_publisher: bool, node_info: (PeerId, Multiaddr), client: Arc, participants: Vec<(PeerId, Multiaddr)>, @@ -44,7 +44,7 @@ pub(crate) struct Network { impl Network { pub(crate) fn new( keypair: Keypair, - node_seq: usize, + is_publisher: bool, node_info: (PeerId, Multiaddr), client: Client, participants: Vec<(PeerId, Multiaddr)>, @@ -96,7 +96,7 @@ impl Network { Network { swarm, - node_seq, + is_publisher, node_info, client: Arc::new(client), participants, @@ -140,8 +140,8 @@ impl Network { } pub(crate) fn publish(&mut self) -> Result { - let mut message = vec![0; 500_0000]; - // Ranomize the first 8 bits to make sure the message is unique. + let mut message = vec![0; 50_000]; + // Randomize the first 8 bits to make sure the message is unique. let first_bytes = &mut message[0..8]; self.rng.fill(first_bytes); self.swarm @@ -182,7 +182,7 @@ impl Network { if !done_warm_up { continue; } - if self.node_seq != 0 { + if !self.is_publisher { continue; } From 0f1919f960018bc328152607872dcc6736ce326c Mon Sep 17 00:00:00 2001 From: ackintosh Date: Sat, 1 Apr 2023 08:42:54 +0900 Subject: [PATCH 03/11] a receive log may not be found due to latency --- flood_publishing/manifest.toml | 2 +- flood_publishing/measure_latency.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/flood_publishing/manifest.toml b/flood_publishing/manifest.toml index 721b5ee..15f2e78 100644 --- a/flood_publishing/manifest.toml +++ b/flood_publishing/manifest.toml @@ -18,4 +18,4 @@ instances = { min = 3, max = 100, default = 3 } # ########################################################################### # Network config # ########################################################################### - bandwidth = { type = "int", desc = "Bandwidth in MiB", unit = "MiB", default = 1 } + bandwidth = { type = "int", desc = "Bandwidth in MiB", unit = "MiB", default = 10 } diff --git a/flood_publishing/measure_latency.py b/flood_publishing/measure_latency.py index e079b63..c778fa2 100644 --- a/flood_publishing/measure_latency.py +++ b/flood_publishing/measure_latency.py @@ -108,8 +108,11 @@ def run(): latencies = [] for send in send_logs: - receive = receive_logs[send['to'] + '_' + send['message_id']] - latencies.append(receive['time'] - send['time']) + receive = receive_logs.get(send['to'] + '_' + send['message_id']) + # It's possible that a log may not be found even in normal cases, due to factors such as latency. + if receive is not None: + latencies.append(receive['time'] - send['time']) + print('[receive_logs]', len(latencies)) print('\n* Results (in milliseconds) *') print('[mean]', mean(latencies)) From 96f1d4eb6d8c0e28b38153e53d15df57d1cb1eb1 Mon Sep 17 00:00:00 2001 From: ackintosh Date: Sat, 1 Apr 2023 14:40:44 +0900 Subject: [PATCH 04/11] Add a test parameter `flood_publish` --- flood_publishing/Cargo.lock | 70 ++++++++++------------------- flood_publishing/Cargo.toml | 8 +++- flood_publishing/manifest.toml | 5 ++- flood_publishing/measure_latency.py | 2 +- flood_publishing/src/main.rs | 5 ++- flood_publishing/src/network.rs | 18 +++++++- 6 files changed, 53 insertions(+), 55 deletions(-) diff --git a/flood_publishing/Cargo.lock b/flood_publishing/Cargo.lock index 24a2f94..9d48d97 100644 --- a/flood_publishing/Cargo.lock +++ b/flood_publishing/Cargo.lock @@ -1562,16 +1562,14 @@ checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" [[package]] name = "libp2p" -version = "0.51.2" -source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=0c4c4cd88bba487173bd0e7d4f1229d69517ba5c#0c4c4cd88bba487173bd0e7d4f1229d69517ba5c" +version = "0.51.1" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=e49b2b27a21b26e1c90a08ff8fa2d38bc265539d#e49b2b27a21b26e1c90a08ff8fa2d38bc265539d" dependencies = [ "bytes", "futures", "futures-timer", "getrandom 0.2.8", "instant", - "libp2p-allow-block-list", - "libp2p-connection-limits", "libp2p-core", "libp2p-dns", "libp2p-gossipsub", @@ -1590,32 +1588,10 @@ dependencies = [ "pin-project", ] -[[package]] -name = "libp2p-allow-block-list" -version = "0.1.0" -source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=0c4c4cd88bba487173bd0e7d4f1229d69517ba5c#0c4c4cd88bba487173bd0e7d4f1229d69517ba5c" -dependencies = [ - "libp2p-core", - "libp2p-identity", - "libp2p-swarm", - "void", -] - -[[package]] -name = "libp2p-connection-limits" -version = "0.1.0" -source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=0c4c4cd88bba487173bd0e7d4f1229d69517ba5c#0c4c4cd88bba487173bd0e7d4f1229d69517ba5c" -dependencies = [ - "libp2p-core", - "libp2p-identity", - "libp2p-swarm", - "void", -] - [[package]] name = "libp2p-core" version = "0.39.1" -source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=0c4c4cd88bba487173bd0e7d4f1229d69517ba5c#0c4c4cd88bba487173bd0e7d4f1229d69517ba5c" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=e49b2b27a21b26e1c90a08ff8fa2d38bc265539d#e49b2b27a21b26e1c90a08ff8fa2d38bc265539d" dependencies = [ "either", "fnv", @@ -1643,7 +1619,7 @@ dependencies = [ [[package]] name = "libp2p-dns" version = "0.39.0" -source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=0c4c4cd88bba487173bd0e7d4f1229d69517ba5c#0c4c4cd88bba487173bd0e7d4f1229d69517ba5c" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=e49b2b27a21b26e1c90a08ff8fa2d38bc265539d#e49b2b27a21b26e1c90a08ff8fa2d38bc265539d" dependencies = [ "futures", "libp2p-core", @@ -1656,8 +1632,8 @@ dependencies = [ [[package]] name = "libp2p-gossipsub" -version = "0.44.2" -source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=0c4c4cd88bba487173bd0e7d4f1229d69517ba5c#0c4c4cd88bba487173bd0e7d4f1229d69517ba5c" +version = "0.44.1" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=e49b2b27a21b26e1c90a08ff8fa2d38bc265539d#e49b2b27a21b26e1c90a08ff8fa2d38bc265539d" dependencies = [ "asynchronous-codec", "base64 0.21.0", @@ -1687,7 +1663,7 @@ dependencies = [ [[package]] name = "libp2p-identity" version = "0.1.1" -source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=0c4c4cd88bba487173bd0e7d4f1229d69517ba5c#0c4c4cd88bba487173bd0e7d4f1229d69517ba5c" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=e49b2b27a21b26e1c90a08ff8fa2d38bc265539d#e49b2b27a21b26e1c90a08ff8fa2d38bc265539d" dependencies = [ "bs58", "ed25519-dalek", @@ -1705,7 +1681,7 @@ dependencies = [ [[package]] name = "libp2p-kad" version = "0.43.1" -source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=0c4c4cd88bba487173bd0e7d4f1229d69517ba5c#0c4c4cd88bba487173bd0e7d4f1229d69517ba5c" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=e49b2b27a21b26e1c90a08ff8fa2d38bc265539d#e49b2b27a21b26e1c90a08ff8fa2d38bc265539d" dependencies = [ "arrayvec", "asynchronous-codec", @@ -1733,7 +1709,7 @@ dependencies = [ [[package]] name = "libp2p-mdns" version = "0.43.0" -source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=0c4c4cd88bba487173bd0e7d4f1229d69517ba5c#0c4c4cd88bba487173bd0e7d4f1229d69517ba5c" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=e49b2b27a21b26e1c90a08ff8fa2d38bc265539d#e49b2b27a21b26e1c90a08ff8fa2d38bc265539d" dependencies = [ "data-encoding", "futures", @@ -1753,7 +1729,7 @@ dependencies = [ [[package]] name = "libp2p-metrics" version = "0.12.0" -source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=0c4c4cd88bba487173bd0e7d4f1229d69517ba5c#0c4c4cd88bba487173bd0e7d4f1229d69517ba5c" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=e49b2b27a21b26e1c90a08ff8fa2d38bc265539d#e49b2b27a21b26e1c90a08ff8fa2d38bc265539d" dependencies = [ "libp2p-core", "libp2p-gossipsub", @@ -1765,7 +1741,7 @@ dependencies = [ [[package]] name = "libp2p-mplex" version = "0.39.0" -source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=0c4c4cd88bba487173bd0e7d4f1229d69517ba5c#0c4c4cd88bba487173bd0e7d4f1229d69517ba5c" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=e49b2b27a21b26e1c90a08ff8fa2d38bc265539d#e49b2b27a21b26e1c90a08ff8fa2d38bc265539d" dependencies = [ "asynchronous-codec", "bytes", @@ -1783,7 +1759,7 @@ dependencies = [ [[package]] name = "libp2p-noise" version = "0.42.1" -source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=0c4c4cd88bba487173bd0e7d4f1229d69517ba5c#0c4c4cd88bba487173bd0e7d4f1229d69517ba5c" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=e49b2b27a21b26e1c90a08ff8fa2d38bc265539d#e49b2b27a21b26e1c90a08ff8fa2d38bc265539d" dependencies = [ "bytes", "curve25519-dalek 3.2.0", @@ -1805,7 +1781,7 @@ dependencies = [ [[package]] name = "libp2p-quic" version = "0.7.0-alpha.3" -source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=0c4c4cd88bba487173bd0e7d4f1229d69517ba5c#0c4c4cd88bba487173bd0e7d4f1229d69517ba5c" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=e49b2b27a21b26e1c90a08ff8fa2d38bc265539d#e49b2b27a21b26e1c90a08ff8fa2d38bc265539d" dependencies = [ "bytes", "futures", @@ -1825,8 +1801,8 @@ dependencies = [ [[package]] name = "libp2p-swarm" -version = "0.42.1" -source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=0c4c4cd88bba487173bd0e7d4f1229d69517ba5c#0c4c4cd88bba487173bd0e7d4f1229d69517ba5c" +version = "0.42.0" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=e49b2b27a21b26e1c90a08ff8fa2d38bc265539d#e49b2b27a21b26e1c90a08ff8fa2d38bc265539d" dependencies = [ "either", "fnv", @@ -1845,7 +1821,7 @@ dependencies = [ [[package]] name = "libp2p-tcp" version = "0.39.0" -source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=0c4c4cd88bba487173bd0e7d4f1229d69517ba5c#0c4c4cd88bba487173bd0e7d4f1229d69517ba5c" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=e49b2b27a21b26e1c90a08ff8fa2d38bc265539d#e49b2b27a21b26e1c90a08ff8fa2d38bc265539d" dependencies = [ "futures", "futures-timer", @@ -1861,7 +1837,7 @@ dependencies = [ [[package]] name = "libp2p-tls" version = "0.1.0" -source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=0c4c4cd88bba487173bd0e7d4f1229d69517ba5c#0c4c4cd88bba487173bd0e7d4f1229d69517ba5c" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=e49b2b27a21b26e1c90a08ff8fa2d38bc265539d#e49b2b27a21b26e1c90a08ff8fa2d38bc265539d" dependencies = [ "futures", "futures-rustls", @@ -1878,8 +1854,8 @@ dependencies = [ [[package]] name = "libp2p-webrtc" -version = "0.4.0-alpha.4" -source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=0c4c4cd88bba487173bd0e7d4f1229d69517ba5c#0c4c4cd88bba487173bd0e7d4f1229d69517ba5c" +version = "0.4.0-alpha.3" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=e49b2b27a21b26e1c90a08ff8fa2d38bc265539d#e49b2b27a21b26e1c90a08ff8fa2d38bc265539d" dependencies = [ "async-trait", "asynchronous-codec", @@ -1909,7 +1885,7 @@ dependencies = [ [[package]] name = "libp2p-yamux" version = "0.43.0" -source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=0c4c4cd88bba487173bd0e7d4f1229d69517ba5c#0c4c4cd88bba487173bd0e7d4f1229d69517ba5c" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=e49b2b27a21b26e1c90a08ff8fa2d38bc265539d#e49b2b27a21b26e1c90a08ff8fa2d38bc265539d" dependencies = [ "futures", "libp2p-core", @@ -2089,7 +2065,7 @@ dependencies = [ [[package]] name = "multistream-select" version = "0.12.1" -source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=0c4c4cd88bba487173bd0e7d4f1229d69517ba5c#0c4c4cd88bba487173bd0e7d4f1229d69517ba5c" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=e49b2b27a21b26e1c90a08ff8fa2d38bc265539d#e49b2b27a21b26e1c90a08ff8fa2d38bc265539d" dependencies = [ "bytes", "futures", @@ -2613,7 +2589,7 @@ dependencies = [ [[package]] name = "quick-protobuf-codec" version = "0.1.0" -source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=0c4c4cd88bba487173bd0e7d4f1229d69517ba5c#0c4c4cd88bba487173bd0e7d4f1229d69517ba5c" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=e49b2b27a21b26e1c90a08ff8fa2d38bc265539d#e49b2b27a21b26e1c90a08ff8fa2d38bc265539d" dependencies = [ "asynchronous-codec", "bytes", @@ -2956,7 +2932,7 @@ dependencies = [ [[package]] name = "rw-stream-sink" version = "0.3.0" -source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=0c4c4cd88bba487173bd0e7d4f1229d69517ba5c#0c4c4cd88bba487173bd0e7d4f1229d69517ba5c" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=e49b2b27a21b26e1c90a08ff8fa2d38bc265539d#e49b2b27a21b26e1c90a08ff8fa2d38bc265539d" dependencies = [ "futures", "pin-project", diff --git a/flood_publishing/Cargo.toml b/flood_publishing/Cargo.toml index 0796df2..e3f2d61 100644 --- a/flood_publishing/Cargo.toml +++ b/flood_publishing/Cargo.toml @@ -6,9 +6,13 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +# Staggered message sending. +# https://github.com/libp2p/rust-libp2p/pull/3666 +# The revision specified here adds some log output needed to measure latency. +# See: https://github.com/ackintosh/rust-libp2p/commit/92225acb661f47f996abdf7a4ea20e4846f7319c +libp2p = { git = "https://github.com/ackintosh/rust-libp2p.git", rev = "e49b2b27a21b26e1c90a08ff8fa2d38bc265539d", default-features = false, features = ["gossipsub", "dns", "tcp", "tokio", "noise", "mplex", "yamux", "serde"] } + futures = "0.3" -#libp2p = { version = "0.51.1", default-features = false, features = ["gossipsub", "dns", "tcp", "tokio", "noise", "mplex", "yamux", "serde"] } -libp2p = { git = "https://github.com/ackintosh/rust-libp2p.git", rev = "5a163900370b1720f5980b7a327d9ff272d12f37", default-features = false, features = ["gossipsub", "dns", "tcp", "tokio", "noise", "mplex", "yamux", "serde"] } rand = { version = "0.8", features = ["small_rng"] } serde = "1.0" serde_json = "1.0" diff --git a/flood_publishing/manifest.toml b/flood_publishing/manifest.toml index 15f2e78..1d1ac55 100644 --- a/flood_publishing/manifest.toml +++ b/flood_publishing/manifest.toml @@ -15,7 +15,8 @@ enabled = true name = "flood_publishing" instances = { min = 3, max = 100, default = 3 } [testcases.params] - # ########################################################################### # Network config - # ########################################################################### bandwidth = { type = "int", desc = "Bandwidth in MiB", unit = "MiB", default = 10 } + # Gossipsub config + flood_publish = { type = "string", desc = "The type of flood publishing: rapid / heartbeat" } + diff --git a/flood_publishing/measure_latency.py b/flood_publishing/measure_latency.py index c778fa2..be3f895 100644 --- a/flood_publishing/measure_latency.py +++ b/flood_publishing/measure_latency.py @@ -93,7 +93,7 @@ def run(): if log['node_id'] == publisher['node_id']: send_logs.append(log) elif log['event'] == 'receive': - if log['node_id'] != publisher['node_id']: + if log['node_id'] != publisher['node_id'] and log['propagation_source'] == publisher['peer_id']: key = node_id_to_peer_id(nodes, log['node_id']) + '_' + log['message_id'] receive_logs[key] = log else: diff --git a/flood_publishing/src/main.rs b/flood_publishing/src/main.rs index 4cee32d..fff2b2b 100644 --- a/flood_publishing/src/main.rs +++ b/flood_publishing/src/main.rs @@ -89,7 +89,10 @@ async fn main() -> Result<(), Box> { let is_publisher = client.group_seq() == 1; - println!(r#"[flood_publishing_test]{{"event":"peer_id","peer_id":"{peer_id}","is_publisher":{}}}"#, is_publisher); + println!( + r#"[flood_publishing_test]{{"event":"peer_id","peer_id":"{peer_id}","is_publisher":{}}}"#, + is_publisher + ); let mut network = Network::new( keypair, diff --git a/flood_publishing/src/network.rs b/flood_publishing/src/network.rs index 7088a9d..4ea78d1 100644 --- a/flood_publishing/src/network.rs +++ b/flood_publishing/src/network.rs @@ -1,11 +1,12 @@ +use crate::get_param; use libp2p::core::muxing::StreamMuxerBox; use libp2p::core::upgrade::{SelectUpgrade, Version}; use libp2p::dns::TokioDnsConfig; use libp2p::futures::StreamExt; use libp2p::gossipsub::subscription_filter::AllowAllSubscriptionFilter; use libp2p::gossipsub::{ - Behaviour, ConfigBuilder, Message as GossipsubMessage, IdentTopic, IdentityTransform, MessageAuthenticity, - MessageId, PublishError, ValidationMode, + Behaviour, ConfigBuilder, FloodPublish, IdentTopic, IdentityTransform, + Message as GossipsubMessage, MessageAuthenticity, MessageId, PublishError, ValidationMode, }; use libp2p::identity::Keypair; use libp2p::mplex::MplexConfig; @@ -49,6 +50,18 @@ impl Network { client: Client, participants: Vec<(PeerId, Multiaddr)>, ) -> Self { + let flood_publish = match get_param::( + "flood_publish", + &client.run_parameters().test_instance_params, + ) + .unwrap() + .as_str() + { + "rapid" => FloodPublish::Rapid, + "heartbeat" => FloodPublish::Heartbeat(0), + _ => panic!("Unknown flood publish type"), + }; + let gossip_message_id = move |message: &GossipsubMessage| { MessageId::from( &Sha256::digest([message.topic.as_str().as_bytes(), &message.data].concat())[..20], @@ -75,6 +88,7 @@ impl Network { .mesh_n_high(12) .gossip_lazy(3) .history_gossip(3) + .flood_publish(flood_publish) .build() .expect("Valid gossipsub configuration"); From b4ccb221f4840fb0c822a44a88b61556635c8eb3 Mon Sep 17 00:00:00 2001 From: ackintosh Date: Sat, 1 Apr 2023 15:08:15 +0900 Subject: [PATCH 05/11] Fix unused field, add comments --- flood_publishing/Cargo.toml | 2 +- flood_publishing/src/main.rs | 27 ++++++++++++++++++++++++++- flood_publishing/src/network.rs | 21 ++------------------- 3 files changed, 29 insertions(+), 21 deletions(-) diff --git a/flood_publishing/Cargo.toml b/flood_publishing/Cargo.toml index e3f2d61..809d027 100644 --- a/flood_publishing/Cargo.toml +++ b/flood_publishing/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" # Staggered message sending. # https://github.com/libp2p/rust-libp2p/pull/3666 # The revision specified here adds some log output needed to measure latency. -# See: https://github.com/ackintosh/rust-libp2p/commit/92225acb661f47f996abdf7a4ea20e4846f7319c +# See: https://github.com/ackintosh/rust-libp2p/commit/e49b2b27a21b26e1c90a08ff8fa2d38bc265539d libp2p = { git = "https://github.com/ackintosh/rust-libp2p.git", rev = "e49b2b27a21b26e1c90a08ff8fa2d38bc265539d", default-features = false, features = ["gossipsub", "dns", "tcp", "tokio", "noise", "mplex", "yamux", "serde"] } futures = "0.3" diff --git a/flood_publishing/src/main.rs b/flood_publishing/src/main.rs index fff2b2b..7124014 100644 --- a/flood_publishing/src/main.rs +++ b/flood_publishing/src/main.rs @@ -2,6 +2,7 @@ mod network; use crate::network::Network; use libp2p::futures::StreamExt; +use libp2p::gossipsub::FloodPublish; use libp2p::identity::Keypair; use libp2p::multiaddr::Protocol; use libp2p::{Multiaddr, PeerId}; @@ -29,8 +30,26 @@ async fn main() -> Result<(), Box> { } let client = Client::new_and_init().await?; + + // ///////////////////////////////////////////////////////////////////////////////////////////// + // Parse test parameters + // ///////////////////////////////////////////////////////////////////////////////////////////// let bandwidth = get_param::("bandwidth", &client.run_parameters().test_instance_params)?; + let flood_publish = match get_param::( + "flood_publish", + &client.run_parameters().test_instance_params, + ) + .unwrap() + .as_str() + { + "rapid" => FloodPublish::Rapid, + "heartbeat" => FloodPublish::Heartbeat(0), + _ => panic!("Unknown flood publish type"), + }; + // ///////////////////////////////////////////////////////////////////////////////////////////// + // Configure network + // ///////////////////////////////////////////////////////////////////////////////////////////// client .configure_network(NetworkConfiguration { network: DEFAULT_DATA_NETWORK.to_owned(), @@ -64,6 +83,9 @@ async fn main() -> Result<(), Box> { ) .await?; + // ///////////////////////////////////////////////////////////////////////////////////////////// + // Start libp2p and dial peers + // ///////////////////////////////////////////////////////////////////////////////////////////// let keypair = Keypair::generate_ed25519(); let peer_id = PeerId::from(keypair.public()); let multiaddr = { @@ -98,8 +120,8 @@ async fn main() -> Result<(), Box> { keypair, is_publisher, (peer_id, multiaddr), - client.clone(), participants, + flood_publish, ); network.start_libp2p().await; @@ -129,6 +151,9 @@ async fn main() -> Result<(), Box> { ) .await?; + // ///////////////////////////////////////////////////////////////////////////////////////////// + // Run simulation + // ///////////////////////////////////////////////////////////////////////////////////////////// network .run_sim(Duration::from_secs(5), Duration::from_secs(20)) .await; diff --git a/flood_publishing/src/network.rs b/flood_publishing/src/network.rs index 4ea78d1..0124887 100644 --- a/flood_publishing/src/network.rs +++ b/flood_publishing/src/network.rs @@ -1,4 +1,3 @@ -use crate::get_param; use libp2p::core::muxing::StreamMuxerBox; use libp2p::core::upgrade::{SelectUpgrade, Version}; use libp2p::dns::TokioDnsConfig; @@ -19,9 +18,7 @@ use libp2p::{Multiaddr, PeerId, Swarm, Transport}; use rand::rngs::SmallRng; use rand::{Rng, SeedableRng}; use sha2::{Digest, Sha256}; -use std::sync::Arc; use std::time::Duration; -use testground::client::Client; use tokio::time::{interval, Interval}; use tracing::{error, info}; @@ -36,7 +33,6 @@ pub(crate) struct Network { swarm: Swarm, is_publisher: bool, node_info: (PeerId, Multiaddr), - client: Arc, participants: Vec<(PeerId, Multiaddr)>, publish_interval: Interval, rng: SmallRng, @@ -47,21 +43,9 @@ impl Network { keypair: Keypair, is_publisher: bool, node_info: (PeerId, Multiaddr), - client: Client, participants: Vec<(PeerId, Multiaddr)>, + flood_publish: FloodPublish, ) -> Self { - let flood_publish = match get_param::( - "flood_publish", - &client.run_parameters().test_instance_params, - ) - .unwrap() - .as_str() - { - "rapid" => FloodPublish::Rapid, - "heartbeat" => FloodPublish::Heartbeat(0), - _ => panic!("Unknown flood publish type"), - }; - let gossip_message_id = move |message: &GossipsubMessage| { MessageId::from( &Sha256::digest([message.topic.as_str().as_bytes(), &message.data].concat())[..20], @@ -69,6 +53,7 @@ impl Network { }; let gossipsub_config = ConfigBuilder::default() + .flood_publish(flood_publish) // Following params are set based on lighthouse. .max_transmit_size(10 * 1_048_576) // 10M .prune_backoff(Duration::from_secs(PRUNE_BACKOFF)) @@ -88,7 +73,6 @@ impl Network { .mesh_n_high(12) .gossip_lazy(3) .history_gossip(3) - .flood_publish(flood_publish) .build() .expect("Valid gossipsub configuration"); @@ -112,7 +96,6 @@ impl Network { swarm, is_publisher, node_info, - client: Arc::new(client), participants, publish_interval: interval(Duration::from_secs(3)), rng: SmallRng::from_entropy(), From 0e121bebbacf4d999baa011a4c870f4af4f2327f Mon Sep 17 00:00:00 2001 From: ackintosh Date: Wed, 5 Apr 2023 08:45:36 +0900 Subject: [PATCH 06/11] Update README --- flood_publishing/README.md | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/flood_publishing/README.md b/flood_publishing/README.md index 9a84fce..23e5ea3 100644 --- a/flood_publishing/README.md +++ b/flood_publishing/README.md @@ -1,10 +1,45 @@ # Flood Publishing Simulation +This simulation creates a number of nodes in which flood publishing is enabled +and help users to measure the latency of messages. + +In this simulation, each node logs the time when send_message() and handle_received_message() +are called. (The functions are defined in rust-libp2p side. So this simulation uses +a forked rust-libp2p that includes the logging.) + +```mermaid +sequenceDiagram + participant Node1 + participant Node2 + participant Node3 + + loop Simulation + Note over Node1: send_message() + Node1->>Node2: message + Note over Node2: handle_received_message() + Note over Node1: send_message() + Node1->>Node3: message + Note over Node3: handle_received_message() + end +``` + +Using `measure_latency.py` we can measure the time between `send_message()` on the publisher side +and `handle_received_message()` on the receiver side. + ## Running the Simulation This simulation can be run with the following command (from within the repos root directory): ```sh -testground run single --plan gossipsub-testground/flood_publishing --testcase flood_publishing --builder docker:generic --runner local:docker --instances 2 --wait +testground run single \ + --plan gossipsub-testground/flood_publishing \ + --testcase flood_publishing \ + --builder docker:generic \ + --runner local:docker \ + --instances 50 \ + --wait \ + --test-param flood_publish=heartbeat \ + | grep flood_publishing_test \ + | python3 flood_publishing/measure_latency.py ``` From 07cc8fd91eeebdb7d07036c2f3955019db7131ed Mon Sep 17 00:00:00 2001 From: ackintosh Date: Wed, 5 Apr 2023 08:48:03 +0900 Subject: [PATCH 07/11] Add parameters --- flood_publishing/manifest.toml | 5 ++++- flood_publishing/src/main.rs | 24 +++++++++----------- flood_publishing/src/network.rs | 40 ++++++++++++++++----------------- 3 files changed, 33 insertions(+), 36 deletions(-) diff --git a/flood_publishing/manifest.toml b/flood_publishing/manifest.toml index 1d1ac55..985a7ed 100644 --- a/flood_publishing/manifest.toml +++ b/flood_publishing/manifest.toml @@ -15,8 +15,11 @@ enabled = true name = "flood_publishing" instances = { min = 3, max = 100, default = 3 } [testcases.params] + warm_up = { type = "int", desc = "Time to wait for nodes to form overlay mesh before beginning publishing", unit = "sec", default = 10 } + run = { type = "int", desc = "Time to run the simulation", unit = "sec", default = 20 } + publish_interval = { type = "int", desc = "Interval to publish a message", unit = "sec", default = 3 } # Network config - bandwidth = { type = "int", desc = "Bandwidth in MiB", unit = "MiB", default = 10 } + bandwidth = { type = "int", desc = "Bandwidth in MiB", unit = "MiB", default = 20 } # Gossipsub config flood_publish = { type = "string", desc = "The type of flood publishing: rapid / heartbeat" } diff --git a/flood_publishing/src/main.rs b/flood_publishing/src/main.rs index 7124014..43122e0 100644 --- a/flood_publishing/src/main.rs +++ b/flood_publishing/src/main.rs @@ -34,13 +34,15 @@ async fn main() -> Result<(), Box> { // ///////////////////////////////////////////////////////////////////////////////////////////// // Parse test parameters // ///////////////////////////////////////////////////////////////////////////////////////////// - let bandwidth = get_param::("bandwidth", &client.run_parameters().test_instance_params)?; - let flood_publish = match get_param::( - "flood_publish", - &client.run_parameters().test_instance_params, - ) - .unwrap() - .as_str() + let test_instance_params = client.run_parameters().test_instance_params; + let warm_up = Duration::from_secs(get_param::("warm_up", &test_instance_params)?); + let run = Duration::from_secs(get_param::("run", &test_instance_params)?); + let publish_interval = + Duration::from_secs(get_param::("publish_interval", &test_instance_params)?); + let bandwidth = get_param::("bandwidth", &test_instance_params)?; + let flood_publish = match get_param::("flood_publish", &test_instance_params) + .unwrap() + .as_str() { "rapid" => FloodPublish::Rapid, "heartbeat" => FloodPublish::Heartbeat(0), @@ -107,8 +109,6 @@ async fn main() -> Result<(), Box> { ) .await?; - println!("participants: {:?}", participants); - let is_publisher = client.group_seq() == 1; println!( @@ -154,11 +154,7 @@ async fn main() -> Result<(), Box> { // ///////////////////////////////////////////////////////////////////////////////////////////// // Run simulation // ///////////////////////////////////////////////////////////////////////////////////////////// - network - .run_sim(Duration::from_secs(5), Duration::from_secs(20)) - .await; - - network.debug(); + network.run_sim(warm_up, run, publish_interval).await; client.record_success().await?; Ok(()) diff --git a/flood_publishing/src/network.rs b/flood_publishing/src/network.rs index 0124887..a9bf24f 100644 --- a/flood_publishing/src/network.rs +++ b/flood_publishing/src/network.rs @@ -18,9 +18,10 @@ use libp2p::{Multiaddr, PeerId, Swarm, Transport}; use rand::rngs::SmallRng; use rand::{Rng, SeedableRng}; use sha2::{Digest, Sha256}; +use std::ops::Add; use std::time::Duration; -use tokio::time::{interval, Interval}; -use tracing::{error, info}; +use tokio::time::interval; +use tracing::{debug, error}; pub(crate) const SLOT: u64 = 12; @@ -34,7 +35,6 @@ pub(crate) struct Network { is_publisher: bool, node_info: (PeerId, Multiaddr), participants: Vec<(PeerId, Multiaddr)>, - publish_interval: Interval, rng: SmallRng, } @@ -97,7 +97,6 @@ impl Network { is_publisher, node_info, participants, - publish_interval: interval(Duration::from_secs(3)), rng: SmallRng::from_entropy(), } } @@ -117,7 +116,7 @@ impl Network { pub(crate) fn dial_peers(&mut self) { for (peer_id, multiaddr) in self.participants.iter() { - info!("dialing {} on {}", peer_id, multiaddr); + debug!("dialing {} on {}", peer_id, multiaddr); if let Err(e) = self.swarm.dial( libp2p::swarm::dial_opts::DialOpts::peer_id(peer_id.clone()) @@ -146,21 +145,15 @@ impl Network { .publish(IdentTopic::new(TOPIC), message) } - pub(crate) fn debug(&self) { - info!("all mesh peers"); - for p in self.swarm.behaviour().all_mesh_peers() { - info!("{p}"); - } - - info!("all peers"); - for (p, topic) in self.swarm.behaviour().all_peers() { - info!("{:?} {p}", topic); - } - } - - pub(crate) async fn run_sim(&mut self, warm_up: Duration, run_duration: Duration) { + pub(crate) async fn run_sim( + &mut self, + warm_up: Duration, + run: Duration, + publish_interval: Duration, + ) { + let deadline = tokio::time::sleep(run.add(warm_up)); let warm_up = tokio::time::sleep(warm_up); - let deadline = tokio::time::sleep(run_duration); + let mut publish_interval = interval(publish_interval); let mut done_warm_up = false; futures::pin_mut!(warm_up); @@ -173,9 +166,14 @@ impl Network { break; } _ = warm_up.as_mut() => { + debug!( + "all mesh peers: {}, all peers: {}", + self.swarm.behaviour().all_mesh_peers().count(), + self.swarm.behaviour().all_peers().count() + ); done_warm_up = true } - _ = self.publish_interval.tick() => { + _ = publish_interval.tick() => { if !done_warm_up { continue; } @@ -188,7 +186,7 @@ impl Network { } } event = self.swarm.select_next_some() => { - info!("Event: {event:?}"); + debug!("Event: {event:?}"); } } } From 8a4f79525013639ffa958cf2bbdab498bd299c84 Mon Sep 17 00:00:00 2001 From: ackintosh Date: Fri, 7 Apr 2023 08:44:37 +0900 Subject: [PATCH 08/11] Update README --- flood_publishing/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flood_publishing/README.md b/flood_publishing/README.md index 23e5ea3..4ae38fe 100644 --- a/flood_publishing/README.md +++ b/flood_publishing/README.md @@ -31,6 +31,9 @@ and `handle_received_message()` on the receiver side. This simulation can be run with the following command (from within the repos root directory): +The type of flood publishing can be switched via `--test-param flood_publish=heartbeat`. Please read +the `flood_publishing/manifest.toml` to understand test parameters. + ```sh testground run single \ --plan gossipsub-testground/flood_publishing \ From c33e6012202fed6b21f9772138a967a5c40ff308 Mon Sep 17 00:00:00 2001 From: ackintosh Date: Fri, 7 Apr 2023 08:45:01 +0900 Subject: [PATCH 09/11] Tweak warm_up --- flood_publishing/src/main.rs | 3 ++- flood_publishing/src/network.rs | 41 +++++++++++++++++---------------- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/flood_publishing/src/main.rs b/flood_publishing/src/main.rs index 43122e0..afd723c 100644 --- a/flood_publishing/src/main.rs +++ b/flood_publishing/src/main.rs @@ -143,6 +143,7 @@ async fn main() -> Result<(), Box> { .await?; network.subscribe()?; + network.warm_up(warm_up).await; client .signal_and_wait( @@ -154,7 +155,7 @@ async fn main() -> Result<(), Box> { // ///////////////////////////////////////////////////////////////////////////////////////////// // Run simulation // ///////////////////////////////////////////////////////////////////////////////////////////// - network.run_sim(warm_up, run, publish_interval).await; + network.run_sim(run, publish_interval).await; client.record_success().await?; Ok(()) diff --git a/flood_publishing/src/network.rs b/flood_publishing/src/network.rs index a9bf24f..d1bd751 100644 --- a/flood_publishing/src/network.rs +++ b/flood_publishing/src/network.rs @@ -18,7 +18,6 @@ use libp2p::{Multiaddr, PeerId, Swarm, Transport}; use rand::rngs::SmallRng; use rand::{Rng, SeedableRng}; use sha2::{Digest, Sha256}; -use std::ops::Add; use std::time::Duration; use tokio::time::interval; use tracing::{debug, error}; @@ -145,38 +144,40 @@ impl Network { .publish(IdentTopic::new(TOPIC), message) } - pub(crate) async fn run_sim( - &mut self, - warm_up: Duration, - run: Duration, - publish_interval: Duration, - ) { - let deadline = tokio::time::sleep(run.add(warm_up)); + pub(crate) async fn warm_up(&mut self, warm_up: Duration) { let warm_up = tokio::time::sleep(warm_up); - let mut publish_interval = interval(publish_interval); - - let mut done_warm_up = false; futures::pin_mut!(warm_up); - futures::pin_mut!(deadline); loop { tokio::select! { - _ = deadline.as_mut() => { - // Sim complete - break; - } _ = warm_up.as_mut() => { debug!( "all mesh peers: {}, all peers: {}", self.swarm.behaviour().all_mesh_peers().count(), self.swarm.behaviour().all_peers().count() ); - done_warm_up = true + break; + } + event = self.swarm.select_next_some() => { + debug!("Event: {event:?}"); + } + } + } + } + + pub(crate) async fn run_sim(&mut self, run: Duration, publish_interval: Duration) { + let deadline = tokio::time::sleep(run); + let mut publish_interval = interval(publish_interval); + + futures::pin_mut!(deadline); + + loop { + tokio::select! { + _ = deadline.as_mut() => { + // Sim complete + break; } _ = publish_interval.tick() => { - if !done_warm_up { - continue; - } if !self.is_publisher { continue; } From 3b2fe09a8e33798ebb2ee7004407ff6b7b673f44 Mon Sep 17 00:00:00 2001 From: ackintosh Date: Sat, 8 Apr 2023 16:35:08 +0900 Subject: [PATCH 10/11] Add cool_down parameter --- flood_publishing/manifest.toml | 7 ++--- flood_publishing/src/main.rs | 6 +++-- flood_publishing/src/network.rs | 45 ++++++++++++++++++++------------- 3 files changed, 36 insertions(+), 22 deletions(-) diff --git a/flood_publishing/manifest.toml b/flood_publishing/manifest.toml index 985a7ed..c42bc27 100644 --- a/flood_publishing/manifest.toml +++ b/flood_publishing/manifest.toml @@ -16,10 +16,11 @@ name = "flood_publishing" instances = { min = 3, max = 100, default = 3 } [testcases.params] warm_up = { type = "int", desc = "Time to wait for nodes to form overlay mesh before beginning publishing", unit = "sec", default = 10 } - run = { type = "int", desc = "Time to run the simulation", unit = "sec", default = 20 } - publish_interval = { type = "int", desc = "Interval to publish a message", unit = "sec", default = 3 } + run = { type = "int", desc = "Time to run simulation", unit = "sec", default = 20 } + cool_down = { type = "int", desc = "Time to wait after simulation", unit = "sec", default = 10 } + publish_interval = { type = "int", desc = "Interval to publish a message", unit = "sec", default = 5 } # Network config - bandwidth = { type = "int", desc = "Bandwidth in MiB", unit = "MiB", default = 20 } + bandwidth = { type = "int", desc = "Bandwidth in MiB", unit = "MiB", default = 30 } # Gossipsub config flood_publish = { type = "string", desc = "The type of flood publishing: rapid / heartbeat" } diff --git a/flood_publishing/src/main.rs b/flood_publishing/src/main.rs index afd723c..bfa889f 100644 --- a/flood_publishing/src/main.rs +++ b/flood_publishing/src/main.rs @@ -37,6 +37,7 @@ async fn main() -> Result<(), Box> { let test_instance_params = client.run_parameters().test_instance_params; let warm_up = Duration::from_secs(get_param::("warm_up", &test_instance_params)?); let run = Duration::from_secs(get_param::("run", &test_instance_params)?); + let cool_down = Duration::from_secs(get_param::("cool_down", &test_instance_params)?); let publish_interval = Duration::from_secs(get_param::("publish_interval", &test_instance_params)?); let bandwidth = get_param::("bandwidth", &test_instance_params)?; @@ -143,7 +144,6 @@ async fn main() -> Result<(), Box> { .await?; network.subscribe()?; - network.warm_up(warm_up).await; client .signal_and_wait( @@ -155,7 +155,9 @@ async fn main() -> Result<(), Box> { // ///////////////////////////////////////////////////////////////////////////////////////////// // Run simulation // ///////////////////////////////////////////////////////////////////////////////////////////// - network.run_sim(run, publish_interval).await; + network + .run_sim(warm_up, run, cool_down, publish_interval) + .await; client.record_success().await?; Ok(()) diff --git a/flood_publishing/src/network.rs b/flood_publishing/src/network.rs index d1bd751..bbd685f 100644 --- a/flood_publishing/src/network.rs +++ b/flood_publishing/src/network.rs @@ -135,7 +135,7 @@ impl Network { } pub(crate) fn publish(&mut self) -> Result { - let mut message = vec![0; 50_000]; + let mut message = vec![0; 10_000]; // Randomize the first 8 bits to make sure the message is unique. let first_bytes = &mut message[0..8]; self.rng.fill(first_bytes); @@ -144,15 +144,20 @@ impl Network { .publish(IdentTopic::new(TOPIC), message) } - pub(crate) async fn warm_up(&mut self, warm_up: Duration) { + pub(crate) async fn run_sim( + &mut self, + warm_up: Duration, + run: Duration, + cool_down: Duration, + publish_interval: Duration, + ) { let warm_up = tokio::time::sleep(warm_up); futures::pin_mut!(warm_up); - loop { tokio::select! { _ = warm_up.as_mut() => { debug!( - "all mesh peers: {}, all peers: {}", + "Warm-up complete. all mesh peers: {}, all peers: {}", self.swarm.behaviour().all_mesh_peers().count(), self.swarm.behaviour().all_peers().count() ); @@ -163,28 +168,34 @@ impl Network { } } } - } - pub(crate) async fn run_sim(&mut self, run: Duration, publish_interval: Duration) { let deadline = tokio::time::sleep(run); - let mut publish_interval = interval(publish_interval); - futures::pin_mut!(deadline); - + let mut publish_interval = interval(publish_interval); loop { tokio::select! { + _ = publish_interval.tick(), if self.is_publisher => { + if let Err(e) = self.publish() { + error!("Failed to publish message: {e}"); + } + } _ = deadline.as_mut() => { - // Sim complete + debug!("Simulation complete"); break; } - _ = publish_interval.tick() => { - if !self.is_publisher { - continue; - } + event = self.swarm.select_next_some() => { + debug!("Event: {event:?}"); + } + } + } - if let Err(e) = self.publish() { - error!("Failed to publish message: {e}"); - } + let cool_down = tokio::time::sleep(cool_down); + futures::pin_mut!(cool_down); + loop { + tokio::select! { + _ = cool_down.as_mut() => { + debug!("Cool-down complete.",); + break; } event = self.swarm.select_next_some() => { debug!("Event: {event:?}"); From 2eee7a803e54e3fde05a05f0a24e99a97e2168cf Mon Sep 17 00:00:00 2001 From: ackintosh Date: Sun, 9 Apr 2023 15:51:20 +0900 Subject: [PATCH 11/11] Add message_size parameter --- flood_publishing/Cargo.lock | 38 ++++++++++++++++----------------- flood_publishing/Cargo.toml | 2 +- flood_publishing/manifest.toml | 1 + flood_publishing/src/main.rs | 5 ++++- flood_publishing/src/network.rs | 12 +++++++---- 5 files changed, 33 insertions(+), 25 deletions(-) diff --git a/flood_publishing/Cargo.lock b/flood_publishing/Cargo.lock index 9d48d97..1faebd5 100644 --- a/flood_publishing/Cargo.lock +++ b/flood_publishing/Cargo.lock @@ -1563,7 +1563,7 @@ checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" [[package]] name = "libp2p" version = "0.51.1" -source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=e49b2b27a21b26e1c90a08ff8fa2d38bc265539d#e49b2b27a21b26e1c90a08ff8fa2d38bc265539d" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=6c303a5b19bae7949f435958087f443ac60d41e3#6c303a5b19bae7949f435958087f443ac60d41e3" dependencies = [ "bytes", "futures", @@ -1591,7 +1591,7 @@ dependencies = [ [[package]] name = "libp2p-core" version = "0.39.1" -source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=e49b2b27a21b26e1c90a08ff8fa2d38bc265539d#e49b2b27a21b26e1c90a08ff8fa2d38bc265539d" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=6c303a5b19bae7949f435958087f443ac60d41e3#6c303a5b19bae7949f435958087f443ac60d41e3" dependencies = [ "either", "fnv", @@ -1619,7 +1619,7 @@ dependencies = [ [[package]] name = "libp2p-dns" version = "0.39.0" -source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=e49b2b27a21b26e1c90a08ff8fa2d38bc265539d#e49b2b27a21b26e1c90a08ff8fa2d38bc265539d" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=6c303a5b19bae7949f435958087f443ac60d41e3#6c303a5b19bae7949f435958087f443ac60d41e3" dependencies = [ "futures", "libp2p-core", @@ -1633,7 +1633,7 @@ dependencies = [ [[package]] name = "libp2p-gossipsub" version = "0.44.1" -source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=e49b2b27a21b26e1c90a08ff8fa2d38bc265539d#e49b2b27a21b26e1c90a08ff8fa2d38bc265539d" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=6c303a5b19bae7949f435958087f443ac60d41e3#6c303a5b19bae7949f435958087f443ac60d41e3" dependencies = [ "asynchronous-codec", "base64 0.21.0", @@ -1663,7 +1663,7 @@ dependencies = [ [[package]] name = "libp2p-identity" version = "0.1.1" -source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=e49b2b27a21b26e1c90a08ff8fa2d38bc265539d#e49b2b27a21b26e1c90a08ff8fa2d38bc265539d" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=6c303a5b19bae7949f435958087f443ac60d41e3#6c303a5b19bae7949f435958087f443ac60d41e3" dependencies = [ "bs58", "ed25519-dalek", @@ -1681,7 +1681,7 @@ dependencies = [ [[package]] name = "libp2p-kad" version = "0.43.1" -source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=e49b2b27a21b26e1c90a08ff8fa2d38bc265539d#e49b2b27a21b26e1c90a08ff8fa2d38bc265539d" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=6c303a5b19bae7949f435958087f443ac60d41e3#6c303a5b19bae7949f435958087f443ac60d41e3" dependencies = [ "arrayvec", "asynchronous-codec", @@ -1709,7 +1709,7 @@ dependencies = [ [[package]] name = "libp2p-mdns" version = "0.43.0" -source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=e49b2b27a21b26e1c90a08ff8fa2d38bc265539d#e49b2b27a21b26e1c90a08ff8fa2d38bc265539d" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=6c303a5b19bae7949f435958087f443ac60d41e3#6c303a5b19bae7949f435958087f443ac60d41e3" dependencies = [ "data-encoding", "futures", @@ -1729,7 +1729,7 @@ dependencies = [ [[package]] name = "libp2p-metrics" version = "0.12.0" -source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=e49b2b27a21b26e1c90a08ff8fa2d38bc265539d#e49b2b27a21b26e1c90a08ff8fa2d38bc265539d" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=6c303a5b19bae7949f435958087f443ac60d41e3#6c303a5b19bae7949f435958087f443ac60d41e3" dependencies = [ "libp2p-core", "libp2p-gossipsub", @@ -1741,7 +1741,7 @@ dependencies = [ [[package]] name = "libp2p-mplex" version = "0.39.0" -source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=e49b2b27a21b26e1c90a08ff8fa2d38bc265539d#e49b2b27a21b26e1c90a08ff8fa2d38bc265539d" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=6c303a5b19bae7949f435958087f443ac60d41e3#6c303a5b19bae7949f435958087f443ac60d41e3" dependencies = [ "asynchronous-codec", "bytes", @@ -1759,7 +1759,7 @@ dependencies = [ [[package]] name = "libp2p-noise" version = "0.42.1" -source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=e49b2b27a21b26e1c90a08ff8fa2d38bc265539d#e49b2b27a21b26e1c90a08ff8fa2d38bc265539d" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=6c303a5b19bae7949f435958087f443ac60d41e3#6c303a5b19bae7949f435958087f443ac60d41e3" dependencies = [ "bytes", "curve25519-dalek 3.2.0", @@ -1781,7 +1781,7 @@ dependencies = [ [[package]] name = "libp2p-quic" version = "0.7.0-alpha.3" -source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=e49b2b27a21b26e1c90a08ff8fa2d38bc265539d#e49b2b27a21b26e1c90a08ff8fa2d38bc265539d" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=6c303a5b19bae7949f435958087f443ac60d41e3#6c303a5b19bae7949f435958087f443ac60d41e3" dependencies = [ "bytes", "futures", @@ -1802,7 +1802,7 @@ dependencies = [ [[package]] name = "libp2p-swarm" version = "0.42.0" -source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=e49b2b27a21b26e1c90a08ff8fa2d38bc265539d#e49b2b27a21b26e1c90a08ff8fa2d38bc265539d" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=6c303a5b19bae7949f435958087f443ac60d41e3#6c303a5b19bae7949f435958087f443ac60d41e3" dependencies = [ "either", "fnv", @@ -1821,7 +1821,7 @@ dependencies = [ [[package]] name = "libp2p-tcp" version = "0.39.0" -source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=e49b2b27a21b26e1c90a08ff8fa2d38bc265539d#e49b2b27a21b26e1c90a08ff8fa2d38bc265539d" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=6c303a5b19bae7949f435958087f443ac60d41e3#6c303a5b19bae7949f435958087f443ac60d41e3" dependencies = [ "futures", "futures-timer", @@ -1837,7 +1837,7 @@ dependencies = [ [[package]] name = "libp2p-tls" version = "0.1.0" -source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=e49b2b27a21b26e1c90a08ff8fa2d38bc265539d#e49b2b27a21b26e1c90a08ff8fa2d38bc265539d" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=6c303a5b19bae7949f435958087f443ac60d41e3#6c303a5b19bae7949f435958087f443ac60d41e3" dependencies = [ "futures", "futures-rustls", @@ -1855,7 +1855,7 @@ dependencies = [ [[package]] name = "libp2p-webrtc" version = "0.4.0-alpha.3" -source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=e49b2b27a21b26e1c90a08ff8fa2d38bc265539d#e49b2b27a21b26e1c90a08ff8fa2d38bc265539d" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=6c303a5b19bae7949f435958087f443ac60d41e3#6c303a5b19bae7949f435958087f443ac60d41e3" dependencies = [ "async-trait", "asynchronous-codec", @@ -1885,7 +1885,7 @@ dependencies = [ [[package]] name = "libp2p-yamux" version = "0.43.0" -source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=e49b2b27a21b26e1c90a08ff8fa2d38bc265539d#e49b2b27a21b26e1c90a08ff8fa2d38bc265539d" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=6c303a5b19bae7949f435958087f443ac60d41e3#6c303a5b19bae7949f435958087f443ac60d41e3" dependencies = [ "futures", "libp2p-core", @@ -2065,7 +2065,7 @@ dependencies = [ [[package]] name = "multistream-select" version = "0.12.1" -source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=e49b2b27a21b26e1c90a08ff8fa2d38bc265539d#e49b2b27a21b26e1c90a08ff8fa2d38bc265539d" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=6c303a5b19bae7949f435958087f443ac60d41e3#6c303a5b19bae7949f435958087f443ac60d41e3" dependencies = [ "bytes", "futures", @@ -2589,7 +2589,7 @@ dependencies = [ [[package]] name = "quick-protobuf-codec" version = "0.1.0" -source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=e49b2b27a21b26e1c90a08ff8fa2d38bc265539d#e49b2b27a21b26e1c90a08ff8fa2d38bc265539d" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=6c303a5b19bae7949f435958087f443ac60d41e3#6c303a5b19bae7949f435958087f443ac60d41e3" dependencies = [ "asynchronous-codec", "bytes", @@ -2932,7 +2932,7 @@ dependencies = [ [[package]] name = "rw-stream-sink" version = "0.3.0" -source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=e49b2b27a21b26e1c90a08ff8fa2d38bc265539d#e49b2b27a21b26e1c90a08ff8fa2d38bc265539d" +source = "git+https://github.com/ackintosh/rust-libp2p.git?rev=6c303a5b19bae7949f435958087f443ac60d41e3#6c303a5b19bae7949f435958087f443ac60d41e3" dependencies = [ "futures", "pin-project", diff --git a/flood_publishing/Cargo.toml b/flood_publishing/Cargo.toml index 809d027..c63b09e 100644 --- a/flood_publishing/Cargo.toml +++ b/flood_publishing/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" # https://github.com/libp2p/rust-libp2p/pull/3666 # The revision specified here adds some log output needed to measure latency. # See: https://github.com/ackintosh/rust-libp2p/commit/e49b2b27a21b26e1c90a08ff8fa2d38bc265539d -libp2p = { git = "https://github.com/ackintosh/rust-libp2p.git", rev = "e49b2b27a21b26e1c90a08ff8fa2d38bc265539d", default-features = false, features = ["gossipsub", "dns", "tcp", "tokio", "noise", "mplex", "yamux", "serde"] } +libp2p = { git = "https://github.com/ackintosh/rust-libp2p.git", rev = "6c303a5b19bae7949f435958087f443ac60d41e3", default-features = false, features = ["gossipsub", "dns", "tcp", "tokio", "noise", "mplex", "yamux", "serde"] } futures = "0.3" rand = { version = "0.8", features = ["small_rng"] } diff --git a/flood_publishing/manifest.toml b/flood_publishing/manifest.toml index c42bc27..de2e406 100644 --- a/flood_publishing/manifest.toml +++ b/flood_publishing/manifest.toml @@ -19,6 +19,7 @@ instances = { min = 3, max = 100, default = 3 } run = { type = "int", desc = "Time to run simulation", unit = "sec", default = 20 } cool_down = { type = "int", desc = "Time to wait after simulation", unit = "sec", default = 10 } publish_interval = { type = "int", desc = "Interval to publish a message", unit = "sec", default = 5 } + message_size = { type = "int", desc = "Size of messages to be published", unit = "bytes", default = 50000 } # Network config bandwidth = { type = "int", desc = "Bandwidth in MiB", unit = "MiB", default = 30 } # Gossipsub config diff --git a/flood_publishing/src/main.rs b/flood_publishing/src/main.rs index bfa889f..b9ffcf0 100644 --- a/flood_publishing/src/main.rs +++ b/flood_publishing/src/main.rs @@ -40,7 +40,10 @@ async fn main() -> Result<(), Box> { let cool_down = Duration::from_secs(get_param::("cool_down", &test_instance_params)?); let publish_interval = Duration::from_secs(get_param::("publish_interval", &test_instance_params)?); + let message_size = get_param::("message_size", &test_instance_params)?; + // Network config let bandwidth = get_param::("bandwidth", &test_instance_params)?; + // Gossipsub config let flood_publish = match get_param::("flood_publish", &test_instance_params) .unwrap() .as_str() @@ -156,7 +159,7 @@ async fn main() -> Result<(), Box> { // Run simulation // ///////////////////////////////////////////////////////////////////////////////////////////// network - .run_sim(warm_up, run, cool_down, publish_interval) + .run_sim(warm_up, run, cool_down, publish_interval, message_size) .await; client.record_success().await?; diff --git a/flood_publishing/src/network.rs b/flood_publishing/src/network.rs index bbd685f..aa7f976 100644 --- a/flood_publishing/src/network.rs +++ b/flood_publishing/src/network.rs @@ -134,9 +134,9 @@ impl Network { Ok(()) } - pub(crate) fn publish(&mut self) -> Result { - let mut message = vec![0; 10_000]; - // Randomize the first 8 bits to make sure the message is unique. + pub(crate) fn publish(&mut self, message_size: usize) -> Result { + let mut message = vec![0; message_size]; + // Randomize the first 8 bytes to make sure the message is unique. let first_bytes = &mut message[0..8]; self.rng.fill(first_bytes); self.swarm @@ -150,7 +150,9 @@ impl Network { run: Duration, cool_down: Duration, publish_interval: Duration, + message_size: usize, ) { + // Warm-up let warm_up = tokio::time::sleep(warm_up); futures::pin_mut!(warm_up); loop { @@ -169,13 +171,14 @@ impl Network { } } + // Run simulation let deadline = tokio::time::sleep(run); futures::pin_mut!(deadline); let mut publish_interval = interval(publish_interval); loop { tokio::select! { _ = publish_interval.tick(), if self.is_publisher => { - if let Err(e) = self.publish() { + if let Err(e) = self.publish(message_size) { error!("Failed to publish message: {e}"); } } @@ -189,6 +192,7 @@ impl Network { } } + // Cool-down let cool_down = tokio::time::sleep(cool_down); futures::pin_mut!(cool_down); loop {