diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8ca69fc4c..4f268cecf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,7 +26,7 @@ jobs: - run: cargo nextest run --workspace --exclude topos-sequencer-subnet-runtime && cargo test --doc --workspace env: - RUST_LOG: topos=warn + RUST_LOG: warn,topos=info test_nightly: runs-on: ubuntu-latest-16-core diff --git a/Cargo.lock b/Cargo.lock index 8337549ca..0a5bd528a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -13,19 +13,19 @@ dependencies = [ ] [[package]] -name = "adler" -version = "1.0.2" +name = "addr2line" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +dependencies = [ + "gimli", +] [[package]] -name = "aead" -version = "0.3.2" +name = "adler" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fc95d1bdb8e6666b2b217308eeeb09f2d6728d104be3e31916cc74d15420331" -dependencies = [ - "generic-array", -] +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aead" @@ -34,28 +34,6 @@ 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.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" -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]] @@ -83,52 +61,18 @@ dependencies = [ [[package]] name = "aes-gcm" -version = "0.9.4" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df5f85a83a7d8b0442b6aa7b504b8212c1733da07b98aae43d4bc21b2cb3cdf6" +checksum = "bc3be92e19a7ef47457b8e6f90707e12b6ac5d20c6f3866584fa3be0787d839f" dependencies = [ - "aead 0.4.3", + "aead", "aes 0.7.5", "cipher 0.3.0", - "ctr 0.8.0", - "ghash 0.4.4", - "subtle", -] - -[[package]] -name = "aes-gcm" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "209b47e8954a928e1d72e86eca7000ebb6655fe1436d33eefc2201cad027e237" -dependencies = [ - "aead 0.5.2", - "aes 0.8.3", - "cipher 0.4.4", - "ctr 0.9.2", - "ghash 0.5.0", + "ctr 0.7.0", + "ghash", "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 = "ahash" version = "0.8.3" @@ -219,12 +163,6 @@ version = "1.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" -[[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" @@ -252,73 +190,6 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71938f30533e4d95a6d17aa530939da3842c2ab6f4f84b9dae68447e4129f74a" -[[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 = "assert_cmd" version = "2.0.11" @@ -352,7 +223,7 @@ dependencies = [ "futures-util", "handlebars", "http", - "indexmap", + "indexmap 1.9.3", "mime", "multer", "num-traits", @@ -419,7 +290,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d461325bfb04058070712296601dfe5e5bd6cdff84780a0a8c569ffb15c87eb3" dependencies = [ "bytes", - "indexmap", + "indexmap 1.9.3", "serde", "serde_json", ] @@ -438,7 +309,7 @@ dependencies = [ "log", "parking", "polling", - "rustix", + "rustix 0.37.23", "slab", "socket2 0.4.9", "waker-fn", @@ -461,7 +332,7 @@ checksum = "0e97ce7de6cf12de5d7226c73f5ba9811622f4db3a5b91b55c53e987e5f91cba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.23", ] [[package]] @@ -483,18 +354,18 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.23", ] [[package]] name = "async-trait" -version = "0.1.68" +version = "0.1.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" +checksum = "a564d521dd56509c4c47480d00b80ee55f7e385ae48db5744c67ad50c92d2ebf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.23", ] [[package]] @@ -527,12 +398,6 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c59bdb34bc650a32731b31bd8f0829cc15d24a708ee31559e0bb34f2bc320cba" -[[package]] -name = "atomic-waker" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1181e1e0d1fce796a03db1ae795d67167da795f9cf4a39c37589e85ef57f26d3" - [[package]] name = "atty" version = "0.2.14" @@ -653,16 +518,25 @@ dependencies = [ ] [[package]] -name = "base-x" -version = "0.2.11" +name = "backtrace" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" +checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] [[package]] -name = "base16ct" -version = "0.1.1" +name = "base-x" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" +checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" [[package]] name = "base16ct" @@ -746,9 +620,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.3.2" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dbe3c979c178231552ecba20214a8272df4e09f232a87aef4320cf06539aded" +checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" [[package]] name = "bitvec" @@ -799,22 +673,6 @@ 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 = "bollard" version = "0.13.0" @@ -862,15 +720,23 @@ dependencies = [ "sha2 0.9.9", ] +[[package]] +name = "bs58" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5353f36341f7451062466f0b755b96ac3a9547e4d7f6b70d603fc721a7d7896" +dependencies = [ + "tinyvec", +] + [[package]] name = "bstr" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a246e68bb43f6cd9db24bea052a53e40405417c5fb372e3d1a8a7f770a564ef5" +checksum = "6798148dccfbff0fae41c7574d2fa8f1ef3492fba0face179de5d8d447d67b05" dependencies = [ "memchr", - "once_cell", - "regex-automata", + "regex-automata 0.3.0", "serde", ] @@ -969,17 +835,6 @@ dependencies = [ "jobserver", ] -[[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 = "cexpr" version = "0.6.0" @@ -1013,7 +868,7 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a18446b09be63d457bbec447509e85f662f32952b035ce892290396bc0b0cff5" dependencies = [ - "aead 0.4.3", + "aead", "chacha20", "cipher 0.3.0", "poly1305", @@ -1030,15 +885,6 @@ dependencies = [ "num-traits", ] -[[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" @@ -1079,7 +925,7 @@ dependencies = [ "bitflags 1.3.2", "clap_derive 3.2.25", "clap_lex 0.2.4", - "indexmap", + "indexmap 1.9.3", "once_cell", "strsim", "termcolor", @@ -1088,9 +934,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.3.5" +version = "4.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2686c4115cb0810d9a984776e197823d08ec94f176549a89a9efded477c456dc" +checksum = "1640e5cc7fb47dbb8338fd471b105e7ed6c3cb2aeb00c2e067127ffd3764a05d" dependencies = [ "clap_builder", "clap_derive 4.3.2", @@ -1099,13 +945,12 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.3.5" +version = "4.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e53afce1efce6ed1f633cf0e57612fe51db54a1ee4fd8f8503d078fe02d69ae" +checksum = "98c59138d527eeaf9b53f35a77fcc1fad9d883116070c63d5de1c7dc7b00c72b" dependencies = [ "anstream", "anstyle", - "bitflags 1.3.2", "clap_lex 0.5.0", "strsim", ] @@ -1132,7 +977,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.23", ] [[package]] @@ -1157,11 +1002,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b30a84aab436fcb256a2ab3c80663d8aec686e6bae12827bb05fef3e1e439c9f" dependencies = [ "bincode", - "bs58", + "bs58 0.4.0", "coins-core", "digest 0.10.7", "getrandom 0.2.10", - "hmac 0.12.1", + "hmac", "k256", "lazy_static", "serde", @@ -1178,7 +1023,7 @@ dependencies = [ "bitvec 0.17.4", "coins-bip32", "getrandom 0.2.10", - "hmac 0.12.1", + "hmac", "once_cell", "pbkdf2 0.12.1", "rand 0.8.5", @@ -1194,7 +1039,7 @@ checksum = "9b949a1c63fb7eb591eb7ba438746326aedf0ae843e51ec92ba6bec5bb382c4f" dependencies = [ "base64 0.21.2", "bech32", - "bs58", + "bs58 0.4.0", "digest 0.10.7", "generic-array", "hex", @@ -1236,9 +1081,9 @@ dependencies = [ [[package]] name = "const-oid" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "520fbf3c07483f94e3e3ca9d0cfd913d7718ef2483d2cfd91c0d9e91474ab913" +checksum = "6340df57935414636969091153f35f68d9f00bbc8fb4a9c6054706c213e6c6bc" [[package]] name = "constant_time_eq" @@ -1273,28 +1118,13 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03e69e28e9f7f77debdedbaafa2866e1de9ba56df55a8bd7cfc724c25a09987c" +checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" 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 = "crc32fast" version = "1.3.2" @@ -1334,7 +1164,7 @@ dependencies = [ "autocfg", "cfg-if", "crossbeam-utils", - "memoffset 0.9.0", + "memoffset", "scopeguard", ] @@ -1353,18 +1183,6 @@ 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-bigint" version = "0.5.2" @@ -1384,20 +1202,9 @@ 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 = "ctor" version = "0.1.26" @@ -1410,9 +1217,9 @@ dependencies = [ [[package]] name = "ctr" -version = "0.8.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" +checksum = "a232f92a03f37dd7d7dd2adc67166c77e9cd88de5b019b9a9eecfaeaf7bfd481" dependencies = [ "cipher 0.3.0", ] @@ -1588,7 +1395,7 @@ dependencies = [ "hashbrown 0.12.3", "lock_api", "once_cell", - "parking_lot_core 0.9.8", + "parking_lot_core", ] [[package]] @@ -1619,84 +1426,14 @@ dependencies = [ [[package]] name = "der" -version = "0.6.1" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" +checksum = "0c7ed52955ce76b1554f509074bb357d3fb8ac9b51288a65a3fd480d1dfba946" dependencies = [ "const-oid", - "pem-rfc7468", "zeroize", ] -[[package]] -name = "der" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56acb310e15652100da43d130af8d97b509e95af61aab1c5a7939ef24337ee17" -dependencies = [ - "const-oid", - "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 0.14.4", - "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 = "derive_more" version = "0.99.17" @@ -1783,17 +1520,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "displaydoc" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.18", -] - [[package]] name = "doc-comment" version = "0.3.3" @@ -1824,9 +1550,9 @@ dependencies = [ [[package]] name = "dtoa" -version = "1.0.6" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65d09067bfacaa79114679b279d7f5885b53295b1e2cfb4e79c8e4bd3d633169" +checksum = "519b83cd10f5f6e969625a409f735182bea5558cd8b64c655806ceaae36f1999" [[package]] name = "dunce" @@ -1840,30 +1566,18 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68b0cf012f1230e43cd00ebb729c6bb58707ecfa8ad08b52ef3a4ccd2697fc30" -[[package]] -name = "ecdsa" -version = "0.14.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" -dependencies = [ - "der 0.6.1", - "elliptic-curve 0.12.3", - "rfc6979 0.3.1", - "signature 1.6.4", -] - [[package]] name = "ecdsa" version = "0.16.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0997c976637b606099b9985693efa3581e84e41f5c11ba5255f88711058ad428" dependencies = [ - "der 0.7.6", + "der", "digest 0.10.7", - "elliptic-curve 0.13.5", - "rfc6979 0.4.0", + "elliptic-curve", + "rfc6979", "signature 2.1.0", - "spki 0.7.2", + "spki", ] [[package]] @@ -1895,43 +1609,21 @@ 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 0.1.1", - "crypto-bigint 0.4.9", - "der 0.6.1", - "digest 0.10.7", - "ff 0.12.1", - "generic-array", - "group 0.12.1", - "hkdf", - "pem-rfc7468", - "pkcs8 0.9.0", - "rand_core 0.6.4", - "sec1 0.3.0", - "subtle", - "zeroize", -] - [[package]] name = "elliptic-curve" version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "968405c8fdc9b3bf4df0a6638858cc0b52462836ab6b1c87377785dd09cf1c0b" dependencies = [ - "base16ct 0.2.0", - "crypto-bigint 0.5.2", + "base16ct", + "crypto-bigint", "digest 0.10.7", - "ff 0.13.0", + "ff", "generic-array", - "group 0.13.0", - "pkcs8 0.10.2", + "group", + "pkcs8", "rand_core 0.6.4", - "sec1 0.7.2", + "sec1", "subtle", "zeroize", ] @@ -2016,6 +1708,12 @@ dependencies = [ "termcolor", ] +[[package]] +name = "equivalent" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88bffebc5d80432c9b140ee17875ff173a8ab62faad5b257da912bd2f6c1c0a1" + [[package]] name = "errno" version = "0.3.1" @@ -2047,7 +1745,7 @@ dependencies = [ "ctr 0.9.2", "digest 0.10.7", "hex", - "hmac 0.12.1", + "hmac", "pbkdf2 0.11.0", "rand 0.8.5", "scrypt", @@ -2193,16 +1891,16 @@ dependencies = [ "ethers-etherscan", "eyre", "hex", - "prettyplease 0.2.9", + "prettyplease 0.2.10", "proc-macro2", "quote", "regex", "reqwest", "serde", "serde_json", - "syn 2.0.18", + "syn 2.0.23", "tokio", - "toml 0.7.4", + "toml 0.7.6", "url", "walkdir", ] @@ -2220,7 +1918,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.18", + "syn 2.0.23", ] [[package]] @@ -2233,7 +1931,7 @@ dependencies = [ "bytes", "cargo_metadata", "chrono", - "elliptic-curve 0.13.5", + "elliptic-curve", "ethabi", "generic-array", "hex", @@ -2246,7 +1944,7 @@ dependencies = [ "serde", "serde_json", "strum", - "syn 2.0.18", + "syn 2.0.23", "tempfile", "thiserror", "tiny-keccak 2.0.2", @@ -2341,7 +2039,7 @@ dependencies = [ "async-trait", "coins-bip32", "coins-bip39", - "elliptic-curve 0.13.5", + "elliptic-curve", "eth-keystore", "ethers-core", "hex", @@ -2416,16 +2114,6 @@ 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 = "ff" version = "0.13.0" @@ -2452,7 +2140,7 @@ dependencies = [ "pear", "serde", "serde_yaml", - "toml 0.7.4", + "toml 0.7.6", "uncased", "version_check", ] @@ -2643,18 +2331,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", -] - -[[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", + "syn 2.0.23", ] [[package]] @@ -2669,6 +2346,17 @@ version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +[[package]] +name = "futures-ticker" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9763058047f713632a52e916cc7f6a4b3fc6e9fc1ff8c5b1dc49e5a89041682e" +dependencies = [ + "futures", + "futures-timer", + "instant", +] + [[package]] name = "futures-timer" version = "3.0.2" @@ -2748,17 +2436,7 @@ 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.1", + "polyval", ] [[package]] @@ -2780,15 +2458,21 @@ dependencies = [ [[package]] name = "ghost" -version = "0.1.9" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e77ac7b51b8e6313251737fcef4b1c01a2ea102bde68415b62c0ee9268fec357" +checksum = "55f62cab8c48c54b8aba6588bd75fd00cdfe8517e79797c3662c5ed0c011d257" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.23", ] +[[package]] +name = "gimli" +version = "0.27.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" + [[package]] name = "glob" version = "0.3.1" @@ -2831,33 +2515,22 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "group" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" -dependencies = [ - "ff 0.12.1", - "rand_core 0.6.4", - "subtle", -] - [[package]] name = "group" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ - "ff 0.13.0", + "ff", "rand_core 0.6.4", "subtle", ] [[package]] name = "h2" -version = "0.3.19" +version = "0.3.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d357c7ae988e7d2182f7d7871d0b963962420b0678b0997ce7de72001aeab782" +checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" dependencies = [ "bytes", "fnv", @@ -2865,7 +2538,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap", + "indexmap 1.9.3", "slab", "tokio", "tokio-util", @@ -2894,13 +2567,19 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.13.2" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +checksum = "33ff8ae62cd3a9102e5637afc8452c55acf3844001bd5374e0b0bd7b6616c038" dependencies = [ "ahash", ] +[[package]] +name = "hashbrown" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" + [[package]] name = "hashers" version = "1.0.1" @@ -2954,25 +2633,16 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" name = "hermit-abi" version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - -[[package]] -name = "hermit-abi" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" dependencies = [ "libc", ] [[package]] name = "hermit-abi" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" +checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" [[package]] name = "hex" @@ -2986,25 +2656,6 @@ 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" @@ -3091,9 +2742,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.26" +version = "0.14.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab302d72a6f11a3b910431ff93aae7e773078c769f0a3ef15fb9ec692ed147d4" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" dependencies = [ "bytes", "futures-channel", @@ -3115,13 +2766,14 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.24.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0646026eb1b3eea4cd9ba47912ea5ce9cc07713d105b1a14698f4e6433d348b7" +checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" dependencies = [ + "futures-util", "http", "hyper", - "rustls 0.21.2", + "rustls 0.21.3", "tokio", "tokio-rustls 0.24.1", ] @@ -3301,6 +2953,16 @@ dependencies = [ "serde", ] +[[package]] +name = "indexmap" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +dependencies = [ + "equivalent", + "hashbrown 0.14.0", +] + [[package]] name = "inflections" version = "1.1.1" @@ -3324,9 +2986,9 @@ dependencies = [ [[package]] name = "insta" -version = "1.29.0" +version = "1.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a28d25139df397cbca21408bb742cf6837e04cdbebf1b07b760caf971d6a972" +checksum = "28491f7753051e5704d4d0ae7860d45fae3238d7d235bc4289dcd45c48d3cec3" dependencies = [ "console", "lazy_static", @@ -3347,25 +3009,6 @@ 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 = "inventory" version = "0.2.3" @@ -3382,7 +3025,7 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "hermit-abi 0.3.1", + "hermit-abi 0.3.2", "libc", "windows-sys 0.48.0", ] @@ -3401,19 +3044,18 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.7.2" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12b6ee2129af8d4fb011108c73d99a1b83a85977f23b82460c0ae2e25bb4b57f" +checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" [[package]] name = "is-terminal" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" +checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ - "hermit-abi 0.3.1", - "io-lifetimes", - "rustix", + "hermit-abi 0.3.2", + "rustix 0.38.3", "windows-sys 0.48.0", ] @@ -3428,9 +3070,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.6" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" +checksum = "62b02a5381cc465bd3041d84623d0fa3b66738b52b8e2fc3bab8ad63ab032f4a" [[package]] name = "jobserver" @@ -3457,8 +3099,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc" dependencies = [ "cfg-if", - "ecdsa 0.16.7", - "elliptic-curve 0.13.5", + "ecdsa", + "elliptic-curve", "once_cell", "sha2 0.10.7", "signature 2.1.0", @@ -3525,9 +3167,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.146" +version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] name = "libloading" @@ -3553,9 +3195,9 @@ checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" [[package]] name = "libp2p" -version = "0.51.3" +version = "0.52.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f210d259724eae82005b5c48078619b7745edb7b76de370b03f8ba59ea103097" +checksum = "38039ba2df4f3255842050845daef4a004cc1f26da03dbc645535088b51910ef" dependencies = [ "bytes", "futures", @@ -3572,13 +3214,10 @@ dependencies = [ "libp2p-kad", "libp2p-mdns", "libp2p-metrics", - "libp2p-mplex", "libp2p-noise", - "libp2p-quic", "libp2p-request-response", "libp2p-swarm", "libp2p-tcp", - "libp2p-webrtc", "libp2p-yamux", "multiaddr", "pin-project", @@ -3586,9 +3225,9 @@ dependencies = [ [[package]] name = "libp2p-allow-block-list" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "510daa05efbc25184458db837f6f9a5143888f1caa742426d92e1833ddd38a50" +checksum = "55b46558c5c0bf99d3e2a1a38fd54ff5476ca66dd1737b12466a1824dd219311" dependencies = [ "libp2p-core", "libp2p-identity", @@ -3598,9 +3237,9 @@ dependencies = [ [[package]] name = "libp2p-connection-limits" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4caa33f1d26ed664c4fe2cca81a08c8e07d4c1c04f2f4ac7655c2dd85467fda0" +checksum = "d45dd90e8f0e1fa59e85ff5316dd4d1ac41a9a507e79cda1b0e9b7be43ad1a56" dependencies = [ "libp2p-core", "libp2p-identity", @@ -3610,9 +3249,9 @@ dependencies = [ [[package]] name = "libp2p-core" -version = "0.39.2" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c1df63c0b582aa434fb09b2d86897fa2b419ffeccf934b36f87fcedc8e835c2" +checksum = "ef7dd7b09e71aac9271c60031d0e558966cdb3253ba0308ab369bb2de80630d0" dependencies = [ "either", "fnv", @@ -3625,7 +3264,7 @@ dependencies = [ "multihash", "multistream-select", "once_cell", - "parking_lot 0.12.1", + "parking_lot", "pin-project", "quick-protobuf", "rand 0.8.5", @@ -3639,23 +3278,24 @@ dependencies = [ [[package]] name = "libp2p-dns" -version = "0.39.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "146ff7034daae62077c415c2376b8057368042df6ab95f5432ad5e88568b1554" +checksum = "fd4394c81c0c06d7b4a60f3face7e8e8a9b246840f98d2c80508d0721b032147" dependencies = [ "futures", "libp2p-core", + "libp2p-identity", "log", - "parking_lot 0.12.1", + "parking_lot", "smallvec", "trust-dns-resolver", ] [[package]] name = "libp2p-gossipsub" -version = "0.44.4" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70b34b6da8165c0bde35c82db8efda39b824776537e73973549e76cadb3a77c5" +checksum = "8e378da62e8c9251f6e885ed173a561663f29b251e745586cf6ae6150b295c37" dependencies = [ "asynchronous-codec", "base64 0.21.2", @@ -3664,6 +3304,8 @@ dependencies = [ "either", "fnv", "futures", + "futures-ticker", + "getrandom 0.2.10", "hex_fmt", "instant", "libp2p-core", @@ -3678,17 +3320,15 @@ dependencies = [ "serde", "sha2 0.10.7", "smallvec", - "thiserror", "unsigned-varint", "void", - "wasm-timer", ] [[package]] name = "libp2p-identify" -version = "0.42.2" +version = "0.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5455f472243e63b9c497ff320ded0314254a9eb751799a39c283c6f20b793f3c" +checksum = "6a29675a32dbcc87790db6cf599709e64308f1ae9d5ecea2d259155889982db8" dependencies = [ "asynchronous-codec", "either", @@ -3708,14 +3348,13 @@ dependencies = [ [[package]] name = "libp2p-identity" -version = "0.1.2" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e2d584751cecb2aabaa56106be6be91338a60a0f4e420cf2af639204f596fc1" +checksum = "d2874d9c6575f1d7a151022af5c42bb0ffdcdfbafe0a6fd039de870b384835a2" dependencies = [ - "bs58", + "bs58 0.5.0", "ed25519-dalek", "log", - "multiaddr", "multihash", "quick-protobuf", "rand 0.8.5", @@ -3727,9 +3366,9 @@ dependencies = [ [[package]] name = "libp2p-kad" -version = "0.43.3" +version = "0.44.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39d5ef876a2b2323d63c258e63c2f8e36f205fe5a11f0b3095d59635650790ff" +checksum = "5588b884dcb1dadc04e49de342f634f60cf28b6beaaca5a4fe3dd1f09bb30041" dependencies = [ "arrayvec", "asynchronous-codec", @@ -3756,9 +3395,9 @@ dependencies = [ [[package]] name = "libp2p-mdns" -version = "0.43.1" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19983e1f949f979a928f2c603de1cf180cc0dc23e4ac93a62651ccb18341460b" +checksum = "42a2567c305232f5ef54185e9604579a894fd0674819402bb0ac0246da82f52a" dependencies = [ "data-encoding", "futures", @@ -3769,7 +3408,7 @@ dependencies = [ "log", "rand 0.8.5", "smallvec", - "socket2 0.4.9", + "socket2 0.5.3", "tokio", "trust-dns-proto", "void", @@ -3777,41 +3416,26 @@ dependencies = [ [[package]] name = "libp2p-metrics" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a42ec91e227d7d0dafa4ce88b333cdf5f277253873ab087555c92798db2ddd46" +checksum = "3787ea81798dcc5bf1d8b40a8e8245cf894b168d04dd70aa48cb3ff2fff141d2" dependencies = [ + "instant", "libp2p-core", "libp2p-gossipsub", "libp2p-identify", + "libp2p-identity", "libp2p-kad", "libp2p-swarm", + "once_cell", "prometheus-client", ] -[[package]] -name = "libp2p-mplex" -version = "0.39.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d34780b514b159e6f3fd70ba3e72664ec89da28dca2d1e7856ee55e2c7031ba" -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.2" +version = "0.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c3673da89d29936bc6435bafc638e2f184180d554ce844db65915113f86ec5e" +checksum = "87945db2b3f977af09b62b9aa0a5f3e4870995a577ecd845cdeba94cdf6bbca7" dependencies = [ "bytes", "curve25519-dalek 3.2.0", @@ -3819,6 +3443,8 @@ dependencies = [ "libp2p-core", "libp2p-identity", "log", + "multiaddr", + "multihash", "once_cell", "quick-protobuf", "rand 0.8.5", @@ -3826,37 +3452,15 @@ dependencies = [ "snow", "static_assertions", "thiserror", - "x25519-dalek 1.1.1", + "x25519-dalek", "zeroize", ] -[[package]] -name = "libp2p-quic" -version = "0.7.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6b26abd81cd2398382a1edfe739b539775be8a90fa6914f39b2ab49571ec735" -dependencies = [ - "bytes", - "futures", - "futures-timer", - "if-watch", - "libp2p-core", - "libp2p-identity", - "libp2p-tls", - "log", - "parking_lot 0.12.1", - "quinn-proto", - "rand 0.8.5", - "rustls 0.20.8", - "thiserror", - "tokio", -] - [[package]] name = "libp2p-request-response" -version = "0.24.1" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffdb374267d42dc5ed5bc53f6e601d4a64ac5964779c6e40bb9e4f14c1e30d5" +checksum = "20bd837798cdcce4283d2675f08bcd3756a650d56eab4d4367e1b3f27eed6887" dependencies = [ "async-trait", "futures", @@ -3864,15 +3468,17 @@ dependencies = [ "libp2p-core", "libp2p-identity", "libp2p-swarm", + "log", "rand 0.8.5", "smallvec", + "void", ] [[package]] name = "libp2p-swarm" -version = "0.42.2" +version = "0.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "903b3d592d7694e56204d211f29d31bc004be99386644ba8731fc3e3ef27b296" +checksum = "a6f1fe3817492f88c5298c8b5fbaa5ff3a0c802ecf4e79be4e341cf07abfa82f" dependencies = [ "either", "fnv", @@ -3883,6 +3489,8 @@ dependencies = [ "libp2p-identity", "libp2p-swarm-derive", "log", + "multistream-select", + "once_cell", "rand 0.8.5", "smallvec", "tokio", @@ -3891,86 +3499,39 @@ dependencies = [ [[package]] name = "libp2p-swarm-derive" -version = "0.32.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fba456131824ab6acd4c7bf61e9c0f0a3014b5fc9868ccb8e10d344594cdc4f" +checksum = "c4d5ec2a3df00c7836d7696c136274c9c59705bac69133253696a6c932cd1d74" dependencies = [ "heck 0.4.1", + "proc-macro-warning", + "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.23", ] [[package]] name = "libp2p-tcp" -version = "0.39.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33d33698596d7722d85d3ab0c86c2c322254fce1241e91208e3679b4eb3026cf" +checksum = "09bfdfb6f945c5c014b87872a0bdb6e0aef90e92f380ef57cd9013f118f9289d" dependencies = [ "futures", "futures-timer", "if-watch", "libc", "libp2p-core", - "log", - "socket2 0.4.9", - "tokio", -] - -[[package]] -name = "libp2p-tls" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff08d13d0dc66e5e9ba6279c1de417b84fa0d0adc3b03e5732928c180ec02781" -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", - "yasna", -] - -[[package]] -name = "libp2p-webrtc" -version = "0.4.0-alpha.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dba48592edbc2f60b4bc7c10d65445b0c3964c07df26fdf493b6880d33be36f8" -dependencies = [ - "async-trait", - "asynchronous-codec", - "bytes", - "futures", - "futures-timer", - "hex", - "if-watch", - "libp2p-core", "libp2p-identity", - "libp2p-noise", "log", - "multihash", - "quick-protobuf", - "quick-protobuf-codec", - "rand 0.8.5", - "rcgen 0.9.3", - "serde", - "stun", - "thiserror", - "tinytemplate", + "socket2 0.5.3", "tokio", - "tokio-util", - "webrtc", ] [[package]] name = "libp2p-yamux" -version = "0.43.1" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dcd21d950662700a385d4c6d68e2f5f54d778e97068cdd718522222ef513bda" +checksum = "c0a9b42ab6de15c6f076d8fb11dc5f48d899a10b55a2e16b12be9012a05287b0" dependencies = [ "futures", "libp2p-core", @@ -4018,6 +3579,12 @@ version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" +[[package]] +name = "linux-raw-sys" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09fc20d2ca12cb9f044c93e3bd6d32d523e6e2ec3db4f7b2939cd99026ecd3f0" + [[package]] name = "lock_api" version = "0.4.10" @@ -4036,11 +3603,11 @@ checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" [[package]] name = "lru" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03f1160296536f10c833a82dca22267d5486734230d47bf00bf435885814ba1e" +checksum = "718e8fae447df0c7e1ba7f5189829e63fd536945c8988d61444c19039f16b670" dependencies = [ - "hashbrown 0.13.2", + "hashbrown 0.13.1", ] [[package]] @@ -4083,7 +3650,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" dependencies = [ - "regex-automata", + "regex-automata 0.1.10", ] [[package]] @@ -4113,15 +3680,6 @@ 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 = "memoffset" version = "0.9.0" @@ -4133,9 +3691,9 @@ dependencies = [ [[package]] name = "metrics" -version = "0.21.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa8ebbd1a9e57bbab77b9facae7f5136aea44c356943bf9a198f647da64285d6" +checksum = "fde3af1a009ed76a778cb84fdef9e7dbbdf5775ae3e4cc1f434a6a307f6f76c5" dependencies = [ "ahash", "metrics-macros", @@ -4150,7 +3708,7 @@ checksum = "8a4964177ddfdab1e3a2b37aec7cf320e14169abb0ed73999f558136409178d5" dependencies = [ "base64 0.21.2", "hyper", - "indexmap", + "indexmap 1.9.3", "ipnet", "metrics", "metrics-util", @@ -4168,18 +3726,18 @@ checksum = "ddece26afd34c31585c74a4db0630c376df271c285d682d1e55012197830b6df" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.23", ] [[package]] name = "metrics-util" -version = "0.15.0" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "111cb375987443c3de8d503580b536f77dc8416d32db62d9456db5d93bd7ac47" +checksum = "4de2ed6e491ed114b40b732e4d1659a9d53992ebd87490c44a6ffe23739d973e" dependencies = [ "crossbeam-epoch", "crossbeam-utils", - "hashbrown 0.13.2", + "hashbrown 0.13.1", "metrics", "num_cpus", "quanta", @@ -4238,14 +3796,14 @@ dependencies = [ [[package]] name = "multiaddr" -version = "0.17.1" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b36f567c7099511fa8612bbbb52dda2419ce0bdbacf31714e3a5ffdb766d3bd" +checksum = "92a651988b3ed3ad1bc8c87d016bb92f6f395b84ed1db9b926b32b1fc5a2c8b5" dependencies = [ "arrayref", "byteorder", "data-encoding", - "log", + "libp2p-identity", "multibase", "multihash", "percent-encoding", @@ -4268,33 +3826,15 @@ dependencies = [ [[package]] name = "multihash" -version = "0.17.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "835d6ff01d610179fbce3de1694d007e500bf33a7f29689838941d6bf783ae40" +checksum = "2fd59dcc2bbe70baabeac52cd22ae52c55eefe6c38ff11a9439f16a350a939f2" dependencies = [ "core2", - "digest 0.10.7", - "multihash-derive", "serde", - "serde-big-array", - "sha2 0.10.7", "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" @@ -4303,9 +3843,9 @@ checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" [[package]] name = "multistream-select" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8552ab875c1313b97b8d20cb857b9fd63e2d1d6a0a1b53ce9821e575405f27a" +checksum = "ea0df8e5eec2298a62b326ee4f0d7fe1a6b90a09dfcf9df37b38f947a8c42f19" dependencies = [ "bytes", "futures", @@ -4414,7 +3954,6 @@ dependencies = [ "bitflags 1.3.2", "cfg-if", "libc", - "memoffset 0.6.5", ] [[package]] @@ -4454,27 +3993,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "num-bigint" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-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" @@ -4487,11 +4005,11 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.2.6", + "hermit-abi 0.3.2", "libc", ] @@ -4513,25 +4031,16 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.18", -] - -[[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", + "syn 2.0.23", ] [[package]] -name = "oid-registry" -version = "0.6.1" +name = "object" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bedf36ffb6ba96c2eb7144ef6270557b52e54b20c0a8e1eb2ff99a6c6959bff" +checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" dependencies = [ - "asn1-rs 0.5.2", + "memchr", ] [[package]] @@ -4540,7 +4049,7 @@ version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" dependencies = [ - "parking_lot_core 0.9.8", + "parking_lot_core", ] [[package]] @@ -4597,7 +4106,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.23", ] [[package]] @@ -4668,7 +4177,7 @@ dependencies = [ "fnv", "futures-channel", "futures-util", - "indexmap", + "indexmap 1.9.3", "once_cell", "pin-project-lite", "thiserror", @@ -4715,28 +4224,6 @@ 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 0.14.8", - "elliptic-curve 0.12.3", - "sha2 0.10.7", -] - -[[package]] -name = "p384" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc8c5bf642dde52bb9e87c0ecd8ca5a76faac2eeed98dedb7c717997e1080aa" -dependencies = [ - "ecdsa 0.14.8", - "elliptic-curve 0.12.3", - "sha2 0.10.7", -] - [[package]] name = "packed_simd_2" version = "0.3.8" @@ -4749,9 +4236,9 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.6.1" +version = "3.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2287753623c76f953acd29d15d8100bcab84d29db78fb6f352adb3c53e83b967" +checksum = "756d439303e94fae44f288ba881ad29670c65b0c4b0e05674ca81061bb65f2c5" dependencies = [ "arrayvec", "bitvec 1.0.1", @@ -4763,9 +4250,9 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.1" +version = "3.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b6937b5e67bfba3351b87b040d48352a2fcb6ad72f81855412ce97b45c8f110" +checksum = "9d884d78fcf214d70b1e239fcd1c6e5e95aa3be1881918da2e488cc946c7a476" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -4779,17 +4266,6 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" -[[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" @@ -4797,21 +4273,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", - "parking_lot_core 0.9.8", -] - -[[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 0.2.16", - "smallvec", - "winapi", + "parking_lot_core", ] [[package]] @@ -4824,7 +4286,7 @@ dependencies = [ "libc", "redox_syscall 0.3.5", "smallvec", - "windows-targets 0.48.0", + "windows-targets 0.48.1", ] [[package]] @@ -4840,9 +4302,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79" +checksum = "b4b27ab7be369122c218afc2079489cdcb4b517c0a3fc386ff11e1fedfcc2b35" [[package]] name = "path-slash" @@ -4857,7 +4319,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" dependencies = [ "digest 0.10.7", - "hmac 0.12.1", + "hmac", "password-hash", "sha2 0.10.7", ] @@ -4869,7 +4331,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0ca0b5a68607598bf3bad68f32227a8164f6254833f84eafaac409cd6746c31" dependencies = [ "digest 0.10.7", - "hmac 0.12.1", + "hmac", ] [[package]] @@ -4892,7 +4354,7 @@ dependencies = [ "proc-macro2", "proc-macro2-diagnostics", "quote", - "syn 2.0.18", + "syn 2.0.23", ] [[package]] @@ -4928,24 +4390,6 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9555b1514d2d99d78150d3c799d4c357a3e2c2a8062cd108e93a06d9057629c5" -[[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.3.0" @@ -4954,9 +4398,9 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pest" -version = "2.6.1" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16833386b02953ca926d19f64af613b9bf742c48dcd5e09b32fbfc9740bf84e2" +checksum = "f73935e4d55e2abf7f130186537b19e7a4abc886a0252380b59248af473a3fc9" dependencies = [ "thiserror", "ucd-trie", @@ -4964,9 +4408,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.6.1" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7763190f9406839f99e5197afee8c9e759969f7dbfa40ad3b8dbee8757b745b5" +checksum = "aef623c9bbfa0eedf5a0efba11a5ee83209c326653ca31ff019bec3a95bfff2b" dependencies = [ "pest", "pest_generator", @@ -4974,22 +4418,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.6.1" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "249061b22e99973da1f5f5f1410284419e283bb60b79255bf5f42a94b66a2e00" +checksum = "b3e8cba4ec22bada7fc55ffe51e2deb6a0e0db2d0b7ab0b103acc80d2510c190" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.23", ] [[package]] name = "pest_meta" -version = "2.6.1" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "457c310cfc9cf3f22bc58901cc7f0d3410ac5d6298e432a4f9a6138565cb6df6" +checksum = "a01f71cb40bd8bb94232df14b946909e14660e33fc05db3e50ae2a82d7ea0ca0" dependencies = [ "once_cell", "pest", @@ -5003,7 +4447,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" dependencies = [ "fixedbitset", - "indexmap", + "indexmap 1.9.3", ] [[package]] @@ -5018,35 +4462,35 @@ dependencies = [ [[package]] name = "phf" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "928c6535de93548188ef63bb7c4036bd415cd8f36ad25af44b9789b2ee72a48c" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" dependencies = [ "phf_macros", - "phf_shared 0.11.1", + "phf_shared 0.11.2", ] [[package]] name = "phf_generator" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1181c94580fa345f50f19d738aaa39c0ed30a600d95cb2d3e23f94266f14fbf" +checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" dependencies = [ - "phf_shared 0.11.1", + "phf_shared 0.11.2", "rand 0.8.5", ] [[package]] name = "phf_macros" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92aacdc5f16768709a569e913f7451034034178b05bdc8acda226659a3dccc66" +checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" dependencies = [ "phf_generator", - "phf_shared 0.11.1", + "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.23", ] [[package]] @@ -5060,38 +4504,38 @@ dependencies = [ [[package]] name = "phf_shared" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1fb5f6f826b772a8d4c0394209441e7d37cbbb967ae9c7e0e8134365c9ee676" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" dependencies = [ "siphasher", ] [[package]] name = "pin-project" -version = "1.1.0" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c95a7476719eab1e366eaf73d0260af3021184f18177925b07f54b30089ceead" +checksum = "030ad2bc4db10a8944cb0d837f158bdfec4d4a4873ab701a95046770d11f8842" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.0" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07" +checksum = "ec2e072ecce94ec471b13398d5402c188e76ac03cf74dd1a975161b23a3f6d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.23", ] [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" [[package]] name = "pin-utils" @@ -5099,24 +4543,14 @@ 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 0.6.1", - "spki 0.6.0", -] - [[package]] name = "pkcs8" version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ - "der 0.7.6", - "spki 0.7.2", + "der", + "spki", ] [[package]] @@ -5155,7 +4589,7 @@ checksum = "048aeb476be11a4b6ca432ca569e375810de9294ae78f4774e78ea98a9246ede" dependencies = [ "cpufeatures", "opaque-debug", - "universal-hash 0.4.1", + "universal-hash", ] [[package]] @@ -5167,19 +4601,7 @@ dependencies = [ "cfg-if", "cpufeatures", "opaque-debug", - "universal-hash 0.4.1", -] - -[[package]] -name = "polyval" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52cff9d1d4dee5fe6d03729099f4a310a41179e0a10dbf542039873f2e826fb" -dependencies = [ - "cfg-if", - "cpufeatures", - "opaque-debug", - "universal-hash 0.5.1", + "universal-hash", ] [[package]] @@ -5240,12 +4662,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9825a04601d60621feed79c4e6b56d65db77cdca55cef43b46b0de1096d1c282" +checksum = "92139198957b410250d43fad93e630d956499a625c527eda65175c8680f83387" dependencies = [ "proc-macro2", - "syn 2.0.18", + "syn 2.0.23", ] [[package]] @@ -5277,12 +4699,12 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "1.1.3" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ - "thiserror", - "toml 0.5.11", + "once_cell", + "toml_edit", ] [[package]] @@ -5309,11 +4731,22 @@ dependencies = [ "version_check", ] +[[package]] +name = "proc-macro-warning" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70550716265d1ec349c41f70dd4f964b4fd88394efe4405f0c1da679c4799a07" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.23", +] + [[package]] name = "proc-macro2" -version = "1.0.60" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dec2b086b7a862cf4de201096214fa870344cf922b2b30c167badb3af3195406" +checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb" dependencies = [ "unicode-ident", ] @@ -5326,7 +4759,7 @@ checksum = "606c4ba35817e2922a308af55ad51bab3645b59eae5c570d4a6cf07e36bd493b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.23", "version_check", "yansi", ] @@ -5349,20 +4782,20 @@ dependencies = [ "fnv", "lazy_static", "memchr", - "parking_lot 0.12.1", + "parking_lot", "protobuf", "thiserror", ] [[package]] name = "prometheus-client" -version = "0.19.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d6fa99d535dd930d1249e6c79cb3c2915f9172a540fe2b02a4c8f9ca954721e" +checksum = "78c2f43e8969d51935d2a7284878ae053ba30034cd563f673cde37ba5205685e" dependencies = [ "dtoa", "itoa", - "parking_lot 0.12.1", + "parking_lot", "prometheus-client-derive-encode", ] @@ -5470,9 +4903,9 @@ dependencies = [ [[package]] name = "quick-protobuf-codec" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1693116345026436eb2f10b677806169c1a1260c1c60eaaffe3fb5a29ae23d8b" +checksum = "f8ededb1cd78531627244d51dd0c7139fbe736c7d57af0092a76f0ffb2f56e98" dependencies = [ "asynchronous-codec", "bytes", @@ -5481,29 +4914,11 @@ dependencies = [ "unsigned-varint", ] -[[package]] -name = "quinn-proto" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67c10f662eee9c94ddd7135043e544f3c82fa839a1e7b865911331961b53186c" -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.28" +version = "1.0.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" +checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" dependencies = [ "proc-macro2", ] @@ -5632,31 +5047,6 @@ dependencies = [ "num_cpus", ] -[[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" @@ -5688,13 +5078,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.8.4" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f" +checksum = "89089e897c013b3deb627116ae56a6955a72b8bed395c9526af31c9fe528b484" dependencies = [ "aho-corasick 1.0.2", "memchr", - "regex-syntax 0.7.2", + "regex-automata 0.3.0", + "regex-syntax 0.7.3", ] [[package]] @@ -5706,6 +5097,17 @@ dependencies = [ "regex-syntax 0.6.29", ] +[[package]] +name = "regex-automata" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa250384981ea14565685dea16a9ccc4d1c541a13f82b9c168572264d1df8c56" +dependencies = [ + "aho-corasick 1.0.2", + "memchr", + "regex-syntax 0.7.3", +] + [[package]] name = "regex-syntax" version = "0.6.29" @@ -5714,9 +5116,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" +checksum = "2ab07dc67230e4a4718e70fd5c20055a4334b121f1f9db8fe63ef39ce9b8c846" [[package]] name = "reqwest" @@ -5743,7 +5145,7 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.21.2", + "rustls 0.21.3", "rustls-pemfile", "serde", "serde_json", @@ -5770,24 +5172,13 @@ dependencies = [ "quick-error", ] -[[package]] -name = "rfc6979" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" -dependencies = [ - "crypto-bigint 0.4.9", - "hmac 0.12.1", - "zeroize", -] - [[package]] name = "rfc6979" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ - "hmac 0.12.1", + "hmac", "subtle", ] @@ -5873,17 +5264,6 @@ dependencies = [ "unicode-ident", ] -[[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" @@ -5900,18 +5280,10 @@ dependencies = [ ] [[package]] -name = "rtp" -version = "0.6.8" +name = "rustc-demangle" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2a095411ff00eed7b12e4c6a118ba984d113e1079582570d56a5ee723f11f80" -dependencies = [ - "async-trait", - "bytes", - "rand 0.8.5", - "serde", - "thiserror", - "webrtc-util", -] +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustc-hash" @@ -5934,40 +5306,31 @@ dependencies = [ "semver", ] -[[package]] -name = "rusticata-macros" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632" -dependencies = [ - "nom", -] - [[package]] name = "rustix" -version = "0.37.20" +version = "0.37.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b96e891d04aa506a6d1f318d2771bcb1c7dfda84e126660ace067c9b474bb2c0" +checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" dependencies = [ "bitflags 1.3.2", "errno", "io-lifetimes", "libc", - "linux-raw-sys", + "linux-raw-sys 0.3.8", "windows-sys 0.48.0", ] [[package]] -name = "rustls" -version = "0.19.1" +name = "rustix" +version = "0.38.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" +checksum = "ac5ffa1efe7548069688cd7028f32591853cd7b5b756d41bcffd2353e4fc75b4" dependencies = [ - "base64 0.13.1", - "log", - "ring", - "sct 0.6.1", - "webpki 0.21.4", + "bitflags 2.3.3", + "errno", + "libc", + "linux-raw-sys 0.4.3", + "windows-sys 0.48.0", ] [[package]] @@ -5978,20 +5341,20 @@ checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" dependencies = [ "log", "ring", - "sct 0.7.0", - "webpki 0.22.0", + "sct", + "webpki", ] [[package]] name = "rustls" -version = "0.21.2" +version = "0.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e32ca28af694bc1bbf399c33a516dbdf1c90090b8ab23c2bc24f834aa2247f5f" +checksum = "b19faa85ecb5197342b54f987b142fb3e30d0c90da40f80ef4fa9a726e6676ed" dependencies = [ "log", "ring", - "rustls-webpki", - "sct 0.7.0", + "rustls-webpki 0.101.1", + "sct", ] [[package]] @@ -6008,9 +5371,9 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" +checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" dependencies = [ "base64 0.21.2", ] @@ -6025,17 +5388,27 @@ dependencies = [ "untrusted", ] +[[package]] +name = "rustls-webpki" +version = "0.101.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15f36a6828982f422756984e47912a7a51dcbc2a197aa791158f8ca61cd8204e" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "rustversion" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06" +checksum = "dc31bd9b61a32c31f9650d18add92aa83a49ba979c143eefd27fe7177b05bd5f" [[package]] name = "rw-stream-sink" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26338f5e09bb721b85b135ea05af7767c90b52f6de4f087d4f4a3a9d64e7dc04" +checksum = "d8c9026ff5d2f23da5e45bbc283f156383001bfb09c4e44256d02c1a685fe9a1" dependencies = [ "futures", "pin-project", @@ -6044,9 +5417,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" +checksum = "fe232bdf6be8c8de797b22184ee71118d63780ea42ac85b61d1baa6d3b782ae9" [[package]] name = "salsa20" @@ -6068,9 +5441,9 @@ dependencies = [ [[package]] name = "scale-info" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad560913365790f17cbf12479491169f01b9d46d29cfc7422bf8c64bdc61b731" +checksum = "35c0a159d0c45c12b20c5a844feb1fe4bea86e28f17b92a5f0c42193634d3782" dependencies = [ "cfg-if", "derive_more", @@ -6080,9 +5453,9 @@ dependencies = [ [[package]] name = "scale-info-derive" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19df9bd9ace6cc2fe19387c96ce677e823e07d017ceed253e7bb3d1d1bd9c73b" +checksum = "912e55f6d20e0e80d63733872b40e1227c0bce1e1ab81ba67d696339bfd7fd29" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -6092,11 +5465,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.21" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" +checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" dependencies = [ - "windows-sys 0.42.0", + "windows-sys 0.48.0", ] [[package]] @@ -6111,22 +5484,12 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f9e24d2b632954ded8ab2ef9fea0a0c769ea56ea98bddbafbad22caeeadf45d" dependencies = [ - "hmac 0.12.1", + "hmac", "pbkdf2 0.11.0", "salsa20", "sha2 0.10.7", ] -[[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" @@ -6137,18 +5500,6 @@ dependencies = [ "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 = "sealed" version = "0.3.0" @@ -6173,30 +5524,16 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "sec1" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" -dependencies = [ - "base16ct 0.1.1", - "der 0.6.1", - "generic-array", - "pkcs8 0.9.0", - "subtle", - "zeroize", -] - [[package]] name = "sec1" version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0aec48e813d6b90b15f0b8948af3c63483992dee44c03e9930b3eebdabe046e" dependencies = [ - "base16ct 0.2.0", - "der 0.7.6", + "base16ct", + "der", "generic-array", - "pkcs8 0.10.2", + "pkcs8", "subtle", "zeroize", ] @@ -6274,38 +5611,29 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" -version = "1.0.164" +version = "1.0.167" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8c8cf938e98f769bc164923b06dce91cea1751522f46f8466461af04c9027d" +checksum = "7daf513456463b42aa1d94cff7e0c24d682b429f020b9afa4f5ba5c40a22b237" 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.164" +version = "1.0.167" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68" +checksum = "b69b106b68bc8054f0e974e70d19984040f8a5cf9215ca82626ea4853f82c4b9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.23", ] [[package]] name = "serde_json" -version = "1.0.97" +version = "1.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdf3bf93142acad5821c99197022e170842cdbc1c30482b98750c688c640842a" +checksum = "0f1e14e89be7aa4c4b78bdbdc9eb5bf8517829a600ae8eaa39a6e1d960b5185c" dependencies = [ "itoa", "ryu", @@ -6314,18 +5642,19 @@ dependencies = [ [[package]] name = "serde_path_to_error" -version = "0.1.11" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7f05c1d5476066defcdfacce1f52fc3cae3af1d3089727100c02ae92e5abbe0" +checksum = "8acc4422959dd87a76cb117c191dcbffc20467f06c9100b76721dab370f24d3a" dependencies = [ + "itoa", "serde", ] [[package]] name = "serde_spanned" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93107647184f6027e3b7dcb2e11034cf95ffa1e3a682c67951963ac69c1c007d" +checksum = "96426c9936fd7a0124915f9185ea1d20aa9445cc9821142f0a73bc9207a2e186" dependencies = [ "serde", ] @@ -6366,11 +5695,11 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.9.21" +version = "0.9.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9d684e3ec7de3bf5466b32bd75303ac16f0736426e5a4e0d6e489559ce1249c" +checksum = "452e67b9c20c37fa79df53201dc03839651086ed9bbe92b3ca585ca9fdaa7d85" dependencies = [ - "indexmap", + "indexmap 2.0.0", "itoa", "ryu", "serde", @@ -6387,7 +5716,7 @@ dependencies = [ "futures", "lazy_static", "log", - "parking_lot 0.12.1", + "parking_lot", "serial_test_derive", ] @@ -6403,19 +5732,6 @@ dependencies = [ "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" @@ -6490,10 +5806,6 @@ name = "signature" version = "1.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" -dependencies = [ - "digest 0.10.7", - "rand_core 0.6.4", -] [[package]] name = "signature" @@ -6534,9 +5846,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" [[package]] name = "snow" @@ -6544,7 +5856,7 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ccba027ba85743e09d15c03296797cad56395089b832b48b5a5217880f57733" dependencies = [ - "aes-gcm 0.9.4", + "aes-gcm", "blake2", "chacha20poly1305", "curve25519-dalek 4.0.0-rc.1", @@ -6601,16 +5913,6 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -[[package]] -name = "spki" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" -dependencies = [ - "base64ct", - "der 0.6.1", -] - [[package]] name = "spki" version = "0.7.2" @@ -6618,7 +5920,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" dependencies = [ "base64ct", - "der 0.7.6", + "der", ] [[package]] @@ -6635,7 +5937,7 @@ checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" dependencies = [ "new_debug_unreachable", "once_cell", - "parking_lot 0.12.1", + "parking_lot", "phf_shared 0.10.0", "precomputed-hash", ] @@ -6668,39 +5970,11 @@ dependencies = [ "syn 1.0.109", ] -[[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" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "svm-rs" @@ -6735,9 +6009,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.18" +version = "2.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" +checksum = "59fb7d6d8281a51045d62b8eb3a7d1ce347b76f312af50cd3dc0af39c87c1737" dependencies = [ "proc-macro2", "quote", @@ -6750,18 +6024,6 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" -[[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 = "synthez" version = "0.2.0" @@ -6843,7 +6105,7 @@ dependencies = [ "cfg-if", "fastrand", "redox_syscall 0.3.5", - "rustix", + "rustix 0.37.23", "windows-sys 0.48.0", ] @@ -6901,22 +6163,22 @@ checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" [[package]] name = "thiserror" -version = "1.0.40" +version = "1.0.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +checksum = "a35fc5b8971143ca348fa6df4f024d4d55264f3468c71ad1c2f365b0a4d58c42" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.40" +version = "1.0.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +checksum = "463fe12d7993d3b327787537ce8dd4dfa058de32fc2b195ef3cde03dc4771e8f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.23", ] [[package]] @@ -6935,10 +6197,8 @@ version = "0.3.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea9e1b3cf1243ae005d9e74085d4d542f3125458f3a81af210d901dcd7411efd" dependencies = [ - "itoa", "serde", "time-core", - "time-macros", ] [[package]] @@ -6947,15 +6207,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" -[[package]] -name = "time-macros" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "372950940a5f07bf38dbe211d7283c9e6d7327df53794992d293e534c733d09b" -dependencies = [ - "time-core", -] - [[package]] name = "tiny-keccak" version = "1.5.0" @@ -6970,18 +6221,8 @@ name = "tiny-keccak" version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" -dependencies = [ - "crunchy", -] - -[[package]] -name = "tinytemplate" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" -dependencies = [ - "serde", - "serde_json", +dependencies = [ + "crunchy", ] [[package]] @@ -7001,16 +6242,17 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.28.2" +version = "1.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94d7b1cfd2aa4011f2de74c2c4c63665e27a71006b0a192dcd2710272e73dfa2" +checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" dependencies = [ "autocfg", + "backtrace", "bytes", "libc", "mio", "num_cpus", - "parking_lot 0.12.1", + "parking_lot", "pin-project-lite", "signal-hook-registry", "socket2 0.4.9", @@ -7036,7 +6278,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.23", ] [[package]] @@ -7057,7 +6299,7 @@ checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" dependencies = [ "rustls 0.20.8", "tokio", - "webpki 0.22.0", + "webpki", ] [[package]] @@ -7066,7 +6308,7 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.2", + "rustls 0.21.3", "tokio", ] @@ -7102,7 +6344,7 @@ checksum = "ec509ac96e9a0c43427c74f003127d953a265737636129424288d27cb5c4b12c" dependencies = [ "futures-util", "log", - "rustls 0.21.2", + "rustls 0.21.3", "tokio", "tokio-rustls 0.24.1", "tungstenite 0.19.0", @@ -7135,9 +6377,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6135d499e69981f9ff0ef2167955a5333c35e36f6937d382974566b3d5b94ec" +checksum = "c17e963a819c331dcacd7ab957d80bc2b9a9c1e71c804826d2f283dd65306542" dependencies = [ "serde", "serde_spanned", @@ -7147,20 +6389,20 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a76a9312f5ba4c2dec6b9161fdf25d87ad8a09256ccea5a556fef03c706a10f" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.19.10" +version = "0.19.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2380d56e8670370eee6566b0bfd4265f65b3f432e8c6d85623f728d4fa31f739" +checksum = "c500344a19072298cd05a7224b3c0c629348b78692bf48466c5238656e315a78" dependencies = [ - "indexmap", + "indexmap 2.0.0", "serde", "serde_spanned", "toml_datetime", @@ -7276,7 +6518,7 @@ dependencies = [ "assert_cmd", "async-stream", "async-trait", - "clap 4.3.5", + "clap 4.3.11", "dirs", "env_logger 0.10.0", "figment", @@ -7297,7 +6539,7 @@ dependencies = [ "test-log", "thiserror", "tokio", - "toml 0.7.4", + "toml 0.7.6", "tonic 0.9.2", "topos-certificate-spammer", "topos-core", @@ -7317,7 +6559,7 @@ dependencies = [ "tracing-opentelemetry", "tracing-subscriber", "url", - "uuid 1.3.4", + "uuid 1.4.0", ] [[package]] @@ -7347,14 +6589,14 @@ dependencies = [ "tower", "tracing", "tracing-subscriber", - "uuid 1.3.4", + "uuid 1.4.0", ] [[package]] name = "topos-certificate-spammer" version = "0.1.0" dependencies = [ - "clap 4.3.5", + "clap 4.3.11", "futures", "hex", "opentelemetry", @@ -7373,7 +6615,7 @@ dependencies = [ "topos-tce-proxy", "tracing", "tracing-opentelemetry", - "uuid 1.3.4", + "uuid 1.4.0", ] [[package]] @@ -7419,7 +6661,9 @@ dependencies = [ "bincode", "env_logger 0.10.0", "futures", + "lazy_static", "libp2p", + "prometheus-client", "rstest", "serde", "test-log", @@ -7508,13 +6752,14 @@ dependencies = [ "axum", "axum-prometheus", "bincode", - "clap 4.3.5", + "clap 4.3.11", "cucumber", "futures", "hyper", "libp2p", "opentelemetry", "prometheus", + "prometheus-client", "rand 0.8.5", "rand_core 0.6.4", "rand_distr", @@ -7559,6 +6804,7 @@ dependencies = [ "hyper", "opentelemetry", "pin-project", + "prometheus-client", "prost", "reqwest", "rstest", @@ -7583,7 +6829,7 @@ dependencies = [ "tracing", "tracing-opentelemetry", "tracing-subscriber", - "uuid 1.3.4", + "uuid 1.4.0", ] [[package]] @@ -7593,6 +6839,7 @@ dependencies = [ "byteorder", "env_logger 0.10.0", "futures", + "lazy_static", "opentelemetry", "opentelemetry-otlp", "rand 0.8.5", @@ -7666,7 +6913,7 @@ dependencies = [ "tracing", "tracing-opentelemetry", "tracing-subscriber", - "uuid 1.3.4", + "uuid 1.4.0", ] [[package]] @@ -7678,6 +6925,7 @@ dependencies = [ "bincode", "env_logger 0.10.0", "futures", + "lazy_static", "once_cell", "rand 0.8.5", "rocksdb", @@ -7690,10 +6938,11 @@ dependencies = [ "tokio-stream", "topos-commands", "topos-core", + "topos-metrics", "topos-test-sdk", "tracing", "tracing-subscriber", - "uuid 1.3.4", + "uuid 1.4.0", ] [[package]] @@ -7708,14 +6957,14 @@ dependencies = [ "topos-p2p", "topos-tce-gatekeeper", "tracing", - "uuid 1.3.4", + "uuid 1.4.0", ] [[package]] name = "topos-tce-transport" version = "0.1.0" dependencies = [ - "clap 4.3.5", + "clap 4.3.11", "opentelemetry", "serde", "topos-core", @@ -7740,6 +6989,7 @@ name = "topos-test-sdk" version = "0.1.0" dependencies = [ "futures", + "lazy_static", "libp2p", "proc_macro_sdk", "rand 0.8.5", @@ -7777,7 +7027,7 @@ checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" dependencies = [ "futures-core", "futures-util", - "indexmap", + "indexmap 1.9.3", "pin-project", "pin-project-lite", "rand 0.8.5", @@ -7795,7 +7045,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8bd22a874a2d0b70452d5597b12c537331d49060824a95f49f108994f94aa4c" dependencies = [ - "bitflags 2.3.2", + "bitflags 2.3.3", "bytes", "futures-core", "futures-util", @@ -7834,13 +7084,13 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.25" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8803eee176538f94ae9a14b55b2804eb7e1441f8210b1c31290b3bccdccff73b" +checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.23", ] [[package]] @@ -7955,7 +7205,7 @@ dependencies = [ "ipconfig", "lazy_static", "lru-cache", - "parking_lot 0.12.1", + "parking_lot", "resolv-conf", "smallvec", "thiserror", @@ -8002,31 +7252,12 @@ dependencies = [ "httparse", "log", "rand 0.8.5", - "rustls 0.21.2", + "rustls 0.21.3", "sha1", "thiserror", "url", "utf-8", - "webpki 0.22.0", -] - -[[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", + "webpki", ] [[package]] @@ -8081,9 +7312,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" +checksum = "22049a19f4a68748a168c0fc439f9516686aa045927ff767eca0a85101fb6e73" [[package]] name = "unicode-normalization" @@ -8114,24 +7345,14 @@ checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "universal-hash" -version = "0.4.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" +checksum = "8326b2c654932e3e4f9196e69d08fdf7cfd718e1dc6f66b347e6024a0c961402" dependencies = [ "generic-array", "subtle", ] -[[package]] -name = "universal-hash" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" -dependencies = [ - "crypto-common", - "subtle", -] - [[package]] name = "unsafe-libyaml" version = "0.2.8" @@ -8195,9 +7416,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.3.4" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa2982af2eec27de306107c027578ff7f423d65f7250e40ce0fea8f45248b81" +checksum = "d023da39d1fde5a8a3fe1f3e01ca9632ada0a63e9797de55a879d6e2236277be" dependencies = [ "getrandom 0.2.10", "serde", @@ -8236,15 +7457,6 @@ dependencies = [ "libc", ] -[[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" @@ -8303,7 +7515,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.23", "wasm-bindgen-shared", ] @@ -8337,7 +7549,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.23", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -8348,21 +7560,6 @@ version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" -[[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.64" @@ -8373,16 +7570,6 @@ dependencies = [ "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" @@ -8399,7 +7586,7 @@ version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" dependencies = [ - "webpki 0.22.0", + "webpki", ] [[package]] @@ -8408,216 +7595,7 @@ version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b03058f88386e5ff5310d9111d53f48b17d732b401aeb83a8d5190f2ac459338" dependencies = [ - "rustls-webpki", -] - -[[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.7", - "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.2", - "async-trait", - "bincode", - "block-modes", - "byteorder", - "ccm", - "curve25519-dalek 3.2.0", - "der-parser 8.2.0", - "elliptic-curve 0.12.3", - "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 0.3.0", - "serde", - "sha1", - "sha2 0.10.7", - "signature 1.6.4", - "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 1.3.4", - "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 0.4.9", - "thiserror", - "tokio", - "webrtc-util", -] - -[[package]] -name = "webrtc-media" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f72e1650a8ae006017d1a5280efb49e2610c19ccc3c0905b03b648aee9554991" -dependencies = [ - "byteorder", - "bytes", - "rand 0.8.5", - "rtp", - "thiserror", -] - -[[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 1.3.2", - "bytes", - "cc", - "ipnet", - "lazy_static", - "libc", - "log", - "nix", - "rand 0.8.5", - "thiserror", - "tokio", - "winapi", + "rustls-webpki 0.100.1", ] [[package]] @@ -8681,21 +7659,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 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - [[package]] name = "windows-sys" version = "0.45.0" @@ -8711,7 +7674,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.0", + "windows-targets 0.48.1", ] [[package]] @@ -8731,9 +7694,9 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" dependencies = [ "windows_aarch64_gnullvm 0.48.0", "windows_aarch64_msvc 0.48.0", @@ -8860,9 +7823,9 @@ checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] name = "winnow" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca0ace3845f0d96209f0375e6d367e3eb87eb65d27d445bdc9f1843a26f39448" +checksum = "a9482fe6ceabdf32f3966bfdd350ba69256a97c30253dc616fe0005af24f164e" dependencies = [ "memchr", ] @@ -8925,54 +7888,6 @@ dependencies = [ "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 = "xattr" version = "0.2.3" @@ -9000,7 +7915,7 @@ dependencies = [ "futures", "log", "nohash-hasher", - "parking_lot 0.12.1", + "parking_lot", "rand 0.8.5", "static_assertions", ] @@ -9011,15 +7926,6 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" -[[package]] -name = "yasna" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" -dependencies = [ - "time", -] - [[package]] name = "zeroize" version = "1.6.0" @@ -9037,7 +7943,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.23", ] [[package]] @@ -9053,7 +7959,7 @@ dependencies = [ "crc32fast", "crossbeam-utils", "flate2", - "hmac 0.12.1", + "hmac", "pbkdf2 0.11.0", "sha1", "time", diff --git a/Cargo.toml b/Cargo.toml index b2835b41a..0c1632e39 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,7 @@ topos-crypto = { path = "./crates/topos-crypto", default-features = false } # Various utility crates clap = { version = "4.0", features = ["derive", "env", "string"] } +lazy_static = "1" rand = { version = "0.8", default-features = false } rand_core = { version = "0.6", default-features = false } rand_distr = { version = "0.4", default-features = false } @@ -31,6 +32,8 @@ ethers = {version = "2.0.4", features = ["legacy", "abigen-online"]} # Log, Tracing & telemetry opentelemetry = { version = "0.19", features = ["rt-tokio", "metrics"] } opentelemetry-otlp = { version = "0.12", features = ["grpc-tonic", "metrics", "tls-roots"] } +prometheus = "0.13.3" +prometheus-client = "0.21" tracing = { version = "0.1", default-features = false } tracing-attributes = "0.1" tracing-opentelemetry = "0.19" @@ -48,7 +51,7 @@ http = "0.2.9" tower-http = { version = "0.4", features = ["cors"] } # P2P related -libp2p = { version = "0.51", default-features = false, features = ["noise"]} +libp2p = { version = "0.52", default-features = false, features = ["noise"]} # Serialization & Deserialization bincode = { version = "1.3", default-features = false } diff --git a/crates/topos-certificate-spammer/src/lib.rs b/crates/topos-certificate-spammer/src/lib.rs index 86f31c49a..d81536fef 100644 --- a/crates/topos-certificate-spammer/src/lib.rs +++ b/crates/topos-certificate-spammer/src/lib.rs @@ -38,7 +38,7 @@ pub struct CertificateSpammerConfig { pub target_nodes: Option>, pub target_nodes_path: Option, pub local_key_seed: u64, - pub cert_per_batch: u8, + pub cert_per_batch: u64, pub nb_subnets: u8, pub nb_batches: Option, pub batch_interval: u64, diff --git a/crates/topos-metrics/Cargo.toml b/crates/topos-metrics/Cargo.toml index 5425515bb..6e31070da 100644 --- a/crates/topos-metrics/Cargo.toml +++ b/crates/topos-metrics/Cargo.toml @@ -4,5 +4,5 @@ version = "0.1.0" edition = "2021" [dependencies] -prometheus = "0.13.3" -lazy_static = "1.4" +lazy_static.workspace = true +prometheus.workspace = true diff --git a/crates/topos-metrics/src/double_echo.rs b/crates/topos-metrics/src/double_echo.rs new file mode 100644 index 000000000..5ae3d9277 --- /dev/null +++ b/crates/topos-metrics/src/double_echo.rs @@ -0,0 +1,52 @@ +use prometheus::{ + self, register_int_counter_with_registry, register_int_gauge_with_registry, IntCounter, + IntGauge, +}; + +use lazy_static::lazy_static; + +use crate::TOPOS_METRIC_REGISTRY; + +lazy_static! { + pub static ref DOUBLE_ECHO_COMMAND_CHANNEL_CAPACITY_TOTAL: IntCounter = + register_int_counter_with_registry!( + "double_echo_command_channel_capacity_total", + "Number of time the double echo command channel was at capacity.", + TOPOS_METRIC_REGISTRY + ) + .unwrap(); + pub static ref DOUBLE_ECHO_BUFFER_CAPACITY_TOTAL: IntCounter = + register_int_counter_with_registry!( + "double_echo_buffer_capacity_total", + "Number of time the double echo buffer was at capacity.", + TOPOS_METRIC_REGISTRY + ) + .unwrap(); + pub static ref DOUBLE_ECHO_CURRENT_BUFFER_SIZE: IntGauge = register_int_gauge_with_registry!( + "double_echo_current_buffer_size", + "Current size of the double echo buffer.", + TOPOS_METRIC_REGISTRY + ) + .unwrap(); + pub static ref DOUBLE_ECHO_BUFFERED_MESSAGE_COUNT: IntGauge = + register_int_gauge_with_registry!( + "double_echo_buffered_message_count", + "Number of message buffered in the double echo buffer.", + TOPOS_METRIC_REGISTRY + ) + .unwrap(); + pub static ref DOUBLE_ECHO_BROADCAST_CREATED_TOTAL: IntCounter = + register_int_counter_with_registry!( + "double_echo_broadcast_created_total", + "Number of broadcast created.", + TOPOS_METRIC_REGISTRY + ) + .unwrap(); + pub static ref DOUBLE_ECHO_BROADCAST_FINISHED_TOTAL: IntCounter = + register_int_counter_with_registry!( + "double_echo_broadcast_finished_total", + "Number of broadcast finished.", + TOPOS_METRIC_REGISTRY + ) + .unwrap(); +} diff --git a/crates/topos-metrics/src/lib.rs b/crates/topos-metrics/src/lib.rs index 9d666e06e..dc2793536 100644 --- a/crates/topos-metrics/src/lib.rs +++ b/crates/topos-metrics/src/lib.rs @@ -1,35 +1,46 @@ -use prometheus::{self, Encoder, IntCounter, TextEncoder}; +use prometheus::{ + self, register_int_counter_with_registry, Encoder, IntCounter, Registry, TextEncoder, +}; use lazy_static::lazy_static; -use prometheus::register_int_counter; + +mod double_echo; +mod p2p; +mod storage; + +pub use double_echo::*; +pub use p2p::*; +pub use storage::*; lazy_static! { - pub static ref MESSAGE_RECEIVED_ON_GOSSIP: IntCounter = - register_int_counter!("gossip_message_count", "Number of gossip message received.") - .unwrap(); - pub static ref MESSAGE_RECEIVED_ON_ECHO: IntCounter = - register_int_counter!("echo_message_count", "Number of echo message received.").unwrap(); - pub static ref MESSAGE_RECEIVED_ON_READY: IntCounter = - register_int_counter!("ready_message_count", "Number of ready message received.").unwrap(); - pub static ref MESSAGE_SENT_ON_GOSSIPSUB: IntCounter = register_int_counter!( - "gossipsub_message_sent_count", - "Number of gossipsub message sent." - ) - .unwrap(); - pub static ref CERTIFICATE_RECEIVED: IntCounter = - register_int_counter!("certificate_received", "Number of certificate received.").unwrap(); - pub static ref CERTIFICATE_RECEIVED_FROM_GOSSIP: IntCounter = register_int_counter!( - "certificate_received_from_gossip", - "Number of certificate received from gossip." + pub static ref TOPOS_METRIC_REGISTRY: Registry = + Registry::new_custom(Some("topos".to_string()), None).unwrap(); + pub static ref CERTIFICATE_RECEIVED_TOTAL: IntCounter = register_int_counter_with_registry!( + "certificate_received_total", + "Number of certificate received.", + TOPOS_METRIC_REGISTRY ) .unwrap(); - pub static ref CERTIFICATE_RECEIVED_FROM_API: IntCounter = register_int_counter!( - "certificate_received_from_api", - "Number of certificate received from api." + pub static ref CERTIFICATE_RECEIVED_FROM_GOSSIP_TOTAL: IntCounter = + register_int_counter_with_registry!( + "certificate_received_from_gossip_total", + "Number of certificate received from gossip.", + TOPOS_METRIC_REGISTRY + ) + .unwrap(); + pub static ref CERTIFICATE_RECEIVED_FROM_API_TOTAL: IntCounter = + register_int_counter_with_registry!( + "certificate_received_from_api_total", + "Number of certificate received from api.", + TOPOS_METRIC_REGISTRY + ) + .unwrap(); + pub static ref CERTIFICATE_DELIVERED_TOTAL: IntCounter = register_int_counter_with_registry!( + "certificate_delivered_total", + "Number of certificate delivered.", + TOPOS_METRIC_REGISTRY ) .unwrap(); - pub static ref CERTIFICATE_DELIVERED: IntCounter = - register_int_counter!("certificate_delivered", "Number of certificate delivered.").unwrap(); } pub fn gather_metrics() -> String { @@ -41,5 +52,25 @@ pub fn gather_metrics() -> String { // Encode them to send. encoder.encode(&metric_families, &mut buffer).unwrap(); + let topos_metrics = TOPOS_METRIC_REGISTRY.gather(); + encoder.encode(&topos_metrics, &mut buffer).unwrap(); + String::from_utf8(buffer.clone()).unwrap() } + +pub fn init_metrics() { + P2P_EVENT_STREAM_CAPACITY_TOTAL.reset(); + P2P_MESSAGE_RECEIVED_ON_GOSSIP_TOTAL.reset(); + P2P_MESSAGE_RECEIVED_ON_ECHO_TOTAL.reset(); + P2P_MESSAGE_RECEIVED_ON_READY_TOTAL.reset(); + P2P_MESSAGE_SENT_ON_GOSSIPSUB_TOTAL.reset(); + DOUBLE_ECHO_COMMAND_CHANNEL_CAPACITY_TOTAL.reset(); + DOUBLE_ECHO_BUFFER_CAPACITY_TOTAL.reset(); + DOUBLE_ECHO_CURRENT_BUFFER_SIZE.set(0); + DOUBLE_ECHO_BUFFERED_MESSAGE_COUNT.set(0); + CERTIFICATE_RECEIVED_TOTAL.reset(); + CERTIFICATE_RECEIVED_FROM_GOSSIP_TOTAL.reset(); + CERTIFICATE_RECEIVED_FROM_API_TOTAL.reset(); + CERTIFICATE_DELIVERED_TOTAL.reset(); + STORAGE_COMMAND_CHANNEL_CAPACITY_TOTAL.reset(); +} diff --git a/crates/topos-metrics/src/p2p.rs b/crates/topos-metrics/src/p2p.rs new file mode 100644 index 000000000..e7ee8561d --- /dev/null +++ b/crates/topos-metrics/src/p2p.rs @@ -0,0 +1,76 @@ +use prometheus::{ + self, register_histogram_with_registry, register_int_counter_vec_with_registry, + register_int_counter_with_registry, Histogram, IntCounter, IntCounterVec, +}; + +use lazy_static::lazy_static; + +use crate::TOPOS_METRIC_REGISTRY; + +lazy_static! { + pub static ref P2P_EVENT_STREAM_CAPACITY_TOTAL: IntCounter = + register_int_counter_with_registry!( + "p2p_event_stream_capacity_total", + "Number of time the p2p event stream was almost at capacity.", + TOPOS_METRIC_REGISTRY + ) + .unwrap(); + pub static ref P2P_DUPLICATE_MESSAGE_ID_RECEIVED_TOTAL: IntCounter = + register_int_counter_with_registry!( + "p2p_duplicate_message_id_received_total", + "Number of time a duplicate message id was received.", + TOPOS_METRIC_REGISTRY + ) + .unwrap(); + pub static ref P2P_MESSAGE_RECEIVED_ON_GOSSIP_TOTAL: IntCounter = + register_int_counter_with_registry!( + "p2p_gossip_message_total", + "Number of gossip message received.", + TOPOS_METRIC_REGISTRY + ) + .unwrap(); + pub static ref P2P_MESSAGE_RECEIVED_ON_ECHO_TOTAL: IntCounter = + register_int_counter_with_registry!( + "p2p_echo_message_total", + "Number of echo message received.", + TOPOS_METRIC_REGISTRY + ) + .unwrap(); + pub static ref P2P_MESSAGE_RECEIVED_ON_READY_TOTAL: IntCounter = + register_int_counter_with_registry!( + "p2p_ready_message_total", + "Number of ready message received.", + TOPOS_METRIC_REGISTRY + ) + .unwrap(); + pub static ref P2P_MESSAGE_SENT_ON_GOSSIPSUB_TOTAL: IntCounter = + register_int_counter_with_registry!( + "p2p_gossipsub_message_sent_total", + "Number of gossipsub message sent.", + TOPOS_METRIC_REGISTRY + ) + .unwrap(); + pub static ref P2P_GOSSIP_BATCH_SIZE: Histogram = register_histogram_with_registry!( + "p2p_gossip_batch_size", + "Number of message sent in a gossip batch.", + vec![1.0, 5.0, 10.0, 50.0, 100.0, 200.0, 500.0, 1000.0, 2000.0, 5000.0], + TOPOS_METRIC_REGISTRY + ) + .unwrap(); + pub static ref P2P_MESSAGE_DESERIALIZE_FAILURE_TOTAL: IntCounterVec = + register_int_counter_vec_with_registry!( + "p2p_message_deserialize_failure_total", + "Number of message deserialization failure.", + &["echo", "ready", "gossip"], + TOPOS_METRIC_REGISTRY + ) + .unwrap(); + pub static ref P2P_MESSAGE_SERIALIZE_FAILURE_TOTAL: IntCounterVec = + register_int_counter_vec_with_registry!( + "p2p_message_serialize_failure_total", + "Number of message serialization failure.", + &["echo", "ready", "gossip"], + TOPOS_METRIC_REGISTRY + ) + .unwrap(); +} diff --git a/crates/topos-metrics/src/storage.rs b/crates/topos-metrics/src/storage.rs new file mode 100644 index 000000000..82a3ef619 --- /dev/null +++ b/crates/topos-metrics/src/storage.rs @@ -0,0 +1,34 @@ +use prometheus::{ + self, register_histogram_with_registry, register_int_counter_with_registry, Histogram, + IntCounter, +}; + +use lazy_static::lazy_static; + +use crate::TOPOS_METRIC_REGISTRY; + +lazy_static! { + pub static ref STORAGE_COMMAND_CHANNEL_CAPACITY_TOTAL: IntCounter = + register_int_counter_with_registry!( + "storage_command_channel_capacity_total", + "Number of time the storage command channel was at capacity.", + TOPOS_METRIC_REGISTRY + ) + .unwrap(); + pub static ref STORAGE_PENDING_CERTIFICATE_EXISTENCE_LATENCY: Histogram = + register_histogram_with_registry!( + "storage_pending_certificate_existence_latency", + "Latency of the pending certificate existance check.", + vec![0.0001, 0.0005, 0.001, 0.005, 0.01, 0.05, 0.1, 0.5, 1.0, 2.0, 5.0], + TOPOS_METRIC_REGISTRY + ) + .unwrap(); + pub static ref STORAGE_ADDING_PENDING_CERTIFICATE_LATENCY: Histogram = + register_histogram_with_registry!( + "storage_adding_pending_certificate_latency", + "Latency of adding a pending certificate.", + vec![0.0001, 0.0005, 0.001, 0.005, 0.01, 0.05, 0.1, 0.5, 1.0, 2.0, 5.0], + TOPOS_METRIC_REGISTRY + ) + .unwrap(); +} diff --git a/crates/topos-p2p/Cargo.toml b/crates/topos-p2p/Cargo.toml index f41a3a3b5..d2d46ab96 100644 --- a/crates/topos-p2p/Cargo.toml +++ b/crates/topos-p2p/Cargo.toml @@ -7,13 +7,16 @@ edition = "2021" async-trait.workspace = true bincode.workspace = true futures.workspace = true +lazy_static.workspace = true +prometheus-client.workspace = true serde = { workspace = true, features = ["derive"] } thiserror.workspace = true -tokio-stream.workspace = true tokio = { workspace = true, features = ["full"] } +tokio-stream.workspace = true tracing = { workspace = true, features = ["attributes"] } -libp2p = { workspace = true, features = ["macros", "gossipsub", "tcp", "dns", "tokio", "request-response", "identify", "mplex", "kad", "serde", "yamux"] } +libp2p = { workspace = true, features = ["macros", "gossipsub", "tcp", "dns", "tokio", "request-response", "identify", "kad", "serde", "yamux"] } + void = "1" topos-metrics = { path = "../topos-metrics/" } diff --git a/crates/topos-p2p/src/behaviour.rs b/crates/topos-p2p/src/behaviour.rs index 70296ad7c..06fcd5414 100644 --- a/crates/topos-p2p/src/behaviour.rs +++ b/crates/topos-p2p/src/behaviour.rs @@ -12,12 +12,13 @@ use libp2p::{ }; pub(crate) mod discovery; +pub(crate) mod gossip; pub(crate) mod peer_info; pub(crate) mod topos; pub(crate) mod transmission; #[derive(NetworkBehaviour)] -#[behaviour(out_event = "ComposedEvent")] +#[behaviour(to_swarm = "ComposedEvent")] pub(crate) struct Behaviour { /// All the topos-specific protocols. // pub(crate) topos: ToposBehaviour, @@ -34,5 +35,5 @@ pub(crate) struct Behaviour { pub(crate) keep_alive: keep_alive::Behaviour, - pub(crate) gossipsub: gossipsub::Behaviour, + pub(crate) gossipsub: gossip::Behaviour, } diff --git a/crates/topos-p2p/src/behaviour/discovery.rs b/crates/topos-p2p/src/behaviour/discovery.rs index d3b485c33..e12a3ef42 100644 --- a/crates/topos-p2p/src/behaviour/discovery.rs +++ b/crates/topos-p2p/src/behaviour/discovery.rs @@ -2,15 +2,16 @@ use std::{borrow::Cow, collections::HashMap, num::NonZeroUsize, time::Duration}; use crate::{ config::DiscoveryConfig, + constant::TRANSMISSION_PROTOCOL, error::{CommandExecutionError, P2PError}, }; -use libp2p::kad::KademliaEvent; use libp2p::{ identity::Keypair, kad::{store::MemoryStore, Kademlia, KademliaBucketInserts, KademliaConfig}, swarm::{behaviour, NetworkBehaviour}, Multiaddr, PeerId, }; +use libp2p::{kad::KademliaEvent, StreamProtocol}; use tokio::sync::oneshot; use tracing::{debug, info, warn}; @@ -19,7 +20,7 @@ pub type PendingRecordRequest = oneshot::Sender, CommandEx /// DiscoveryBehaviour is responsible to discover and manage connections with peers #[derive(NetworkBehaviour)] -#[behaviour(out_event = "KademliaEvent")] +#[behaviour(to_swarm = "KademliaEvent")] pub(crate) struct DiscoveryBehaviour { pub(crate) inner: Kademlia, } @@ -34,7 +35,6 @@ impl DiscoveryBehaviour { ) -> Self { let local_peer_id = peer_key.public().to_peer_id(); let kademlia_config = KademliaConfig::default() - .set_protocol_names(vec![discovery_protocol]) .set_replication_factor(config.replication_factor) .set_kbucket_inserts(KademliaBucketInserts::Manual) .set_replication_interval(config.replication_interval) @@ -56,9 +56,9 @@ impl DiscoveryBehaviour { kademlia.add_address(&known_peer.0, known_peer.1.clone()); } - if let Err(store_error) = kademlia.start_providing("topos-tce".as_bytes().to_vec().into()) { - warn!(reason = %store_error, "Could not start providing Kademlia protocol `topos-tce`") - } + // if let Err(store_error) = kademlia.start_providing("topos-tce".as_bytes().to_vec().into()) { + // warn!(reason = %store_error, "Could not start providing Kademlia protocol `topos-tce`") + // } Self { inner: kademlia } } diff --git a/crates/topos-p2p/src/behaviour/gossip.rs b/crates/topos-p2p/src/behaviour/gossip.rs new file mode 100644 index 000000000..96f250c47 --- /dev/null +++ b/crates/topos-p2p/src/behaviour/gossip.rs @@ -0,0 +1,300 @@ +use std::{ + collections::{HashSet, VecDeque}, + env, + task::Poll, + time::Duration, +}; + +use libp2p::{ + gossipsub::{self, IdentTopic, Message, MessageAuthenticity, MessageId, Topic, TopicHash}, + identity::Keypair, + swarm::{NetworkBehaviour, THandlerInEvent, ToSwarm}, +}; +use serde::{Deserialize, Serialize}; +use topos_metrics::{ + P2P_DUPLICATE_MESSAGE_ID_RECEIVED_TOTAL, P2P_GOSSIP_BATCH_SIZE, + P2P_MESSAGE_SERIALIZE_FAILURE_TOTAL, +}; +use tracing::{debug, error, info}; + +use crate::{constant, event::ComposedEvent, TOPOS_ECHO, TOPOS_GOSSIP, TOPOS_READY}; + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub(crate) struct Batch { + pub(crate) data: Vec>, +} + +pub struct Behaviour { + batch_size: usize, + gossipsub: gossipsub::Behaviour, + echo_queue: VecDeque>, + ready_queue: VecDeque>, + tick: tokio::time::Interval, + cache: HashSet, +} + +impl Behaviour { + pub fn publish(&mut self, topic: &'static str, data: Vec) -> Result { + match topic { + TOPOS_GOSSIP => { + _ = self.gossipsub.publish(IdentTopic::new(topic), data); + } + TOPOS_ECHO => self.echo_queue.push_back(data), + TOPOS_READY => self.ready_queue.push_back(data), + _ => return Err("Invalid topic"), + } + + Ok(0) + } + + pub fn subscribe(&mut self) -> Result<(), &'static str> { + self.gossipsub + .subscribe(&gossipsub::IdentTopic::new(TOPOS_GOSSIP)) + .unwrap(); + + self.gossipsub + .subscribe(&gossipsub::IdentTopic::new(TOPOS_ECHO)) + .unwrap(); + + self.gossipsub + .subscribe(&gossipsub::IdentTopic::new(TOPOS_READY)) + .unwrap(); + + Ok(()) + } + + pub fn new(peer_key: Keypair) -> Self { + let batch_size = env::var("TOPOS_GOSSIP_BATCH_SIZE") + .map(|v| v.parse::()) + .unwrap_or(Ok(10)) + .unwrap(); + let gossipsub = gossipsub::ConfigBuilder::default() + .max_transmit_size(2 * 1024 * 1024) + .validation_mode(gossipsub::ValidationMode::Strict) + .build() + .unwrap(); + + let gossipsub = gossipsub::Behaviour::new_with_metrics( + MessageAuthenticity::Signed(peer_key), + gossipsub, + constant::METRIC_REGISTRY + .try_lock() + .expect("Failed to lock metric registry during gossipsub creation") + .sub_registry_with_prefix("libp2p_gossipsub"), + Default::default(), + ) + .unwrap(); + + Self { + batch_size, + gossipsub, + echo_queue: VecDeque::new(), + ready_queue: VecDeque::new(), + tick: tokio::time::interval(Duration::from_millis( + env::var("TOPOS_GOSSIP_INTERVAL") + .map(|v| v.parse::()) + .unwrap_or(Ok(100)) + .unwrap(), + )), + cache: HashSet::new(), + } + } +} + +impl NetworkBehaviour for Behaviour { + type ConnectionHandler = ::ConnectionHandler; + + type ToSwarm = ComposedEvent; + + fn handle_established_inbound_connection( + &mut self, + connection_id: libp2p::swarm::ConnectionId, + peer: libp2p::PeerId, + local_addr: &libp2p::Multiaddr, + remote_addr: &libp2p::Multiaddr, + ) -> Result, libp2p::swarm::ConnectionDenied> { + self.gossipsub.handle_established_inbound_connection( + connection_id, + peer, + local_addr, + remote_addr, + ) + } + + fn handle_established_outbound_connection( + &mut self, + connection_id: libp2p::swarm::ConnectionId, + peer: libp2p::PeerId, + addr: &libp2p::Multiaddr, + role_override: libp2p::core::Endpoint, + ) -> Result, libp2p::swarm::ConnectionDenied> { + self.gossipsub.handle_established_outbound_connection( + connection_id, + peer, + addr, + role_override, + ) + } + + fn on_swarm_event(&mut self, event: libp2p::swarm::FromSwarm) { + self.gossipsub.on_swarm_event(event) + } + + fn on_connection_handler_event( + &mut self, + peer_id: libp2p::PeerId, + connection_id: libp2p::swarm::ConnectionId, + event: libp2p::swarm::THandlerOutEvent, + ) { + self.gossipsub + .on_connection_handler_event(peer_id, connection_id, event) + } + + fn poll( + &mut self, + cx: &mut std::task::Context<'_>, + params: &mut impl libp2p::swarm::PollParameters, + ) -> Poll>> { + if self.tick.poll_tick(cx).is_ready() { + // Publish batch + if !self.echo_queue.is_empty() { + let mut echos = Batch { data: Vec::new() }; + for _ in 0..self.batch_size { + if let Some(data) = self.echo_queue.pop_front() { + echos.data.push(data); + } else { + break; + } + } + + debug!("Publishing {} echos", echos.data.len()); + if let Ok(msg) = bincode::serialize::(&echos) { + P2P_GOSSIP_BATCH_SIZE.observe(echos.data.len() as f64); + + match self.gossipsub.publish(IdentTopic::new(TOPOS_ECHO), msg) { + Ok(message_id) => debug!("Published echo {}", message_id), + Err(error) => error!("Failed to publish echo: {}", error), + } + } else { + P2P_MESSAGE_SERIALIZE_FAILURE_TOTAL + .with_label_values(&["echo"]) + .inc(); + } + } + + if !self.ready_queue.is_empty() { + let mut readies = Batch { data: Vec::new() }; + for _ in 0..self.batch_size { + if let Some(data) = self.ready_queue.pop_front() { + readies.data.push(data); + } else { + break; + } + } + + debug!("Publishing {} readies", readies.data.len()); + if let Ok(msg) = bincode::serialize::(&readies) { + P2P_GOSSIP_BATCH_SIZE.observe(readies.data.len() as f64); + _ = self.gossipsub.publish(IdentTopic::new(TOPOS_READY), msg); + } else { + P2P_MESSAGE_SERIALIZE_FAILURE_TOTAL + .with_label_values(&["ready"]) + .inc(); + } + } + } + + let event = match self.gossipsub.poll(cx, params) { + Poll::Pending => return Poll::Pending, + Poll::Ready(ToSwarm::GenerateEvent(event)) => Some(event), + Poll::Ready(ToSwarm::ListenOn { opts }) => { + return Poll::Ready(ToSwarm::ListenOn { opts }) + } + Poll::Ready(ToSwarm::RemoveListener { id }) => { + return Poll::Ready(ToSwarm::RemoveListener { id }) + } + Poll::Ready(ToSwarm::Dial { opts }) => return Poll::Ready(ToSwarm::Dial { opts }), + Poll::Ready(ToSwarm::NotifyHandler { + peer_id, + handler, + event, + }) => { + return Poll::Ready(ToSwarm::NotifyHandler { + peer_id, + handler, + event, + }) + } + Poll::Ready(ToSwarm::CloseConnection { + peer_id, + connection, + }) => { + return Poll::Ready(ToSwarm::CloseConnection { + peer_id, + connection, + }) + } + Poll::Ready(ToSwarm::ExternalAddrExpired(addr)) => { + return Poll::Ready(ToSwarm::ExternalAddrExpired(addr)) + } + Poll::Ready(ToSwarm::ExternalAddrConfirmed(addr)) => { + return Poll::Ready(ToSwarm::ExternalAddrConfirmed(addr)) + } + Poll::Ready(ToSwarm::NewExternalAddrCandidate(addr)) => { + return Poll::Ready(ToSwarm::NewExternalAddrCandidate(addr)) + } + }; + + if let Some(gossipsub::Event::Message { ref message_id, .. }) = event { + if self.cache.contains(message_id) { + P2P_DUPLICATE_MESSAGE_ID_RECEIVED_TOTAL.inc(); + } + } + + if let Some(gossipsub::Event::Message { + propagation_source, + message_id, + message: + Message { + source, + data, + sequence_number, + topic, + }, + }) = event + { + match topic.as_str() { + TOPOS_GOSSIP => { + return Poll::Ready(ToSwarm::GenerateEvent(ComposedEvent::Gossipsub( + crate::event::GossipEvent { + topic: TOPOS_GOSSIP, + message: data, + source, + }, + ))) + } + TOPOS_ECHO => { + return Poll::Ready(ToSwarm::GenerateEvent(ComposedEvent::Gossipsub( + crate::event::GossipEvent { + topic: TOPOS_ECHO, + message: data, + source, + }, + ))) + } + TOPOS_READY => { + return Poll::Ready(ToSwarm::GenerateEvent(ComposedEvent::Gossipsub( + crate::event::GossipEvent { + topic: TOPOS_READY, + message: data, + source, + }, + ))) + } + _ => {} + } + } + + Poll::Pending + } +} diff --git a/crates/topos-p2p/src/behaviour/peer_info.rs b/crates/topos-p2p/src/behaviour/peer_info.rs index 3528e1d77..a95337b15 100644 --- a/crates/topos-p2p/src/behaviour/peer_info.rs +++ b/crates/topos-p2p/src/behaviour/peer_info.rs @@ -4,7 +4,7 @@ use libp2p::{ }; #[derive(NetworkBehaviour)] -#[behaviour(out_event = "IdentifyEvent")] +#[behaviour(to_swarm = "IdentifyEvent")] pub struct PeerInfoBehaviour { identify: Identify, } diff --git a/crates/topos-p2p/src/behaviour/transmission.rs b/crates/topos-p2p/src/behaviour/transmission.rs index 9b8ec2b4d..68ff86903 100644 --- a/crates/topos-p2p/src/behaviour/transmission.rs +++ b/crates/topos-p2p/src/behaviour/transmission.rs @@ -1,8 +1,11 @@ -use crate::error::CommandExecutionError; +use crate::{constant::TRANSMISSION_PROTOCOL, error::CommandExecutionError}; use self::{codec::TransmissionCodec, protocol::TransmissionProtocol}; -use libp2p::request_response::{Behaviour, Config, ProtocolSupport, RequestId}; +use libp2p::{ + request_response::{Behaviour, Config, ProtocolSupport, RequestId}, + StreamProtocol, +}; use std::{collections::HashMap, iter, time::Duration}; use tokio::sync::oneshot; @@ -21,9 +24,12 @@ impl TransmissionBehaviour { cfg.set_connection_keep_alive(Duration::from_secs(60)); cfg.set_request_timeout(Duration::from_secs(30)); - Behaviour::new( + Behaviour::with_codec( TransmissionCodec(), - iter::once((TransmissionProtocol(), ProtocolSupport::Full)), + iter::once(( + StreamProtocol::new(TRANSMISSION_PROTOCOL), + ProtocolSupport::Full, + )), cfg, ) } diff --git a/crates/topos-p2p/src/behaviour/transmission/codec.rs b/crates/topos-p2p/src/behaviour/transmission/codec.rs index 3ab735c6b..ab72649ad 100644 --- a/crates/topos-p2p/src/behaviour/transmission/codec.rs +++ b/crates/topos-p2p/src/behaviour/transmission/codec.rs @@ -1,10 +1,13 @@ use std::io; +use crate::constant::TRANSMISSION_PROTOCOL; + use super::protocol::TransmissionProtocol; use futures::{AsyncRead, AsyncWrite, AsyncWriteExt}; use libp2p::{ core::upgrade::{read_length_prefixed, write_length_prefixed}, request_response::Codec, + StreamProtocol, }; #[derive(Clone)] @@ -18,7 +21,7 @@ pub struct TransmissionResponse(pub(crate) Vec); #[async_trait::async_trait] impl Codec for TransmissionCodec { - type Protocol = TransmissionProtocol; + type Protocol = StreamProtocol; type Request = TransmissionRequest; type Response = TransmissionResponse; diff --git a/crates/topos-p2p/src/behaviour/transmission/protocol.rs b/crates/topos-p2p/src/behaviour/transmission/protocol.rs index 38e89eb0c..eb1fd1a85 100644 --- a/crates/topos-p2p/src/behaviour/transmission/protocol.rs +++ b/crates/topos-p2p/src/behaviour/transmission/protocol.rs @@ -1,12 +1,4 @@ -use libp2p::core::ProtocolName; - use crate::constant::TRANSMISSION_PROTOCOL; #[derive(Debug, Clone)] pub(crate) struct TransmissionProtocol(); - -impl ProtocolName for TransmissionProtocol { - fn protocol_name(&self) -> &[u8] { - TRANSMISSION_PROTOCOL.as_bytes() - } -} diff --git a/crates/topos-p2p/src/config.rs b/crates/topos-p2p/src/config.rs index 1906d4e3a..a223e8676 100644 --- a/crates/topos-p2p/src/config.rs +++ b/crates/topos-p2p/src/config.rs @@ -45,3 +45,11 @@ impl Default for DiscoveryConfig { } } } + +impl DiscoveryConfig { + pub fn with_replication_factor(mut self, replication_factor: NonZeroUsize) -> Self { + self.replication_factor = replication_factor; + + self + } +} diff --git a/crates/topos-p2p/src/constant.rs b/crates/topos-p2p/src/constant.rs index 6466ae916..48212fb42 100644 --- a/crates/topos-p2p/src/constant.rs +++ b/crates/topos-p2p/src/constant.rs @@ -1,5 +1,29 @@ -// TODO: Investigate BUFFER SIZE -pub const EVENT_STREAM_BUFFER: usize = 2048; -pub const COMMAND_STREAM_BUFFER: usize = 2048; +use std::env; + +use lazy_static::lazy_static; +use prometheus_client::registry::Registry; +use tokio::sync::Mutex; + +lazy_static! { + /// Metric Registry used to register all the metrics from libp2p::gossipsub + pub static ref METRIC_REGISTRY: Mutex = Mutex::new(::with_prefix("topos")); + pub static ref EVENT_STREAM_BUFFER: usize = env::var("TCE_EVENT_STREAM_BUFFER") + .ok() + .and_then(|v| v.parse::().ok()) + .unwrap_or(2048 * 2); + pub static ref CAPACITY_EVENT_STREAM_BUFFER: usize = EVENT_STREAM_BUFFER + .checked_mul(10) + .map(|v| { + let r: usize = v.checked_div(100).unwrap_or(*EVENT_STREAM_BUFFER); + r + }) + .unwrap_or(*EVENT_STREAM_BUFFER); + pub static ref COMMAND_STREAM_BUFFER_SIZE: usize = env::var("TCE_COMMAND_STREAM_BUFFER_SIZE") + .ok() + .and_then(|v| v.parse::().ok()) + .unwrap_or(2048); +} + pub const TRANSMISSION_PROTOCOL: &str = "/tce-transmission/1"; pub const DISCOVERY_PROTOCOL: &str = "/tce-disco/1"; +pub const PEER_INFO_PROTOCOL: &str = "/tce-peer-info/1"; diff --git a/crates/topos-p2p/src/event.rs b/crates/topos-p2p/src/event.rs index 0363e1167..388025878 100644 --- a/crates/topos-p2p/src/event.rs +++ b/crates/topos-p2p/src/event.rs @@ -8,14 +8,19 @@ use libp2p::{ use crate::behaviour::transmission::codec::{TransmissionRequest, TransmissionResponse}; +#[derive(Debug)] +pub struct GossipEvent { + pub source: Option, + pub topic: &'static str, + pub message: Vec, +} + #[derive(Debug)] pub enum ComposedEvent { Kademlia(Box), Transmission(RequestResponseEvent), - #[allow(dead_code)] - OutEvent(Event), PeerInfo(Box), - Gossipsub(Box), + Gossipsub(GossipEvent), Void, } @@ -25,12 +30,6 @@ impl From for ComposedEvent { } } -impl From for ComposedEvent { - fn from(event: GossipsubEvent) -> Self { - ComposedEvent::Gossipsub(Box::new(event)) - } -} - impl From for ComposedEvent { fn from(event: identify::Event) -> Self { ComposedEvent::PeerInfo(Box::new(event)) diff --git a/crates/topos-p2p/src/lib.rs b/crates/topos-p2p/src/lib.rs index b0cfdf2c9..b07b3c872 100644 --- a/crates/topos-p2p/src/lib.rs +++ b/crates/topos-p2p/src/lib.rs @@ -4,7 +4,7 @@ mod behaviour; mod client; mod command; pub mod config; -mod constant; +pub mod constant; pub mod error; mod event; mod runtime; diff --git a/crates/topos-p2p/src/network.rs b/crates/topos-p2p/src/network.rs index 940d1fd69..891b20a47 100644 --- a/crates/topos-p2p/src/network.rs +++ b/crates/topos-p2p/src/network.rs @@ -1,12 +1,13 @@ use super::{Behaviour, Client, Event, Runtime}; use crate::{ behaviour::{ - discovery::DiscoveryBehaviour, peer_info::PeerInfoBehaviour, + discovery::DiscoveryBehaviour, gossip, peer_info::PeerInfoBehaviour, transmission::TransmissionBehaviour, }, - config::NetworkConfig, + config::{DiscoveryConfig, NetworkConfig}, constant::{ - COMMAND_STREAM_BUFFER, DISCOVERY_PROTOCOL, EVENT_STREAM_BUFFER, TRANSMISSION_PROTOCOL, + COMMAND_STREAM_BUFFER_SIZE, DISCOVERY_PROTOCOL, EVENT_STREAM_BUFFER, PEER_INFO_PROTOCOL, + TRANSMISSION_PROTOCOL, }, error::P2PError, TOPOS_ECHO, TOPOS_GOSSIP, TOPOS_READY, @@ -53,6 +54,12 @@ pub struct NetworkBuilder<'a> { } impl<'a> NetworkBuilder<'a> { + pub fn discovery_config(mut self, config: DiscoveryConfig) -> Self { + self.config.discovery = config; + + self + } + pub fn publish_retry(mut self, retry: usize) -> Self { self.config.publish_retry = retry; @@ -117,27 +124,13 @@ impl<'a> NetworkBuilder<'a> { let peer_key = self.peer_key.ok_or(P2PError::MissingPeerKey)?; let peer_id = peer_key.public().to_peer_id(); - // let noise_keys = noise::Keypair::::new().into_authentic(&peer_key)?; - - let (command_sender, command_receiver) = mpsc::channel(COMMAND_STREAM_BUFFER); - let (event_sender, event_receiver) = mpsc::channel(EVENT_STREAM_BUFFER); - - let gossipsub = gossipsub::ConfigBuilder::default() - .max_transmit_size(2 * 1024 * 1024) - .validation_mode(gossipsub::ValidationMode::Strict) - .build() - .unwrap(); - - let gossipsub = - gossipsub::Behaviour::new(MessageAuthenticity::Signed(peer_key.clone()), gossipsub) - .unwrap(); + let (command_sender, command_receiver) = mpsc::channel(*COMMAND_STREAM_BUFFER_SIZE); + let (event_sender, event_receiver) = mpsc::channel(*EVENT_STREAM_BUFFER); + let gossipsub = gossip::Behaviour::new(peer_key.clone()); let behaviour = Behaviour { gossipsub, - peer_info: PeerInfoBehaviour::new( - self.transmission_protocol.unwrap_or(TRANSMISSION_PROTOCOL), - &peer_key, - ), + peer_info: PeerInfoBehaviour::new(PEER_INFO_PROTOCOL, &peer_key), discovery: DiscoveryBehaviour::create( &self.config.discovery, diff --git a/crates/topos-p2p/src/runtime/handle_command.rs b/crates/topos-p2p/src/runtime/handle_command.rs index 1f22bf8be..43f6847bf 100644 --- a/crates/topos-p2p/src/runtime/handle_command.rs +++ b/crates/topos-p2p/src/runtime/handle_command.rs @@ -11,7 +11,7 @@ use libp2p::{ swarm::NetworkBehaviour, PeerId, }; -use topos_metrics::MESSAGE_SENT_ON_GOSSIPSUB; +use topos_metrics::P2P_MESSAGE_SENT_ON_GOSSIPSUB_TOTAL; use tracing::{debug, error, info, warn}; impl Runtime { pub(crate) async fn handle_command(&mut self, command: Command) { @@ -139,15 +139,10 @@ impl Runtime { } Command::Gossip { topic, data } => { - match self - .swarm - .behaviour_mut() - .gossipsub - .publish(IdentTopic::new(topic), data) - { + match self.swarm.behaviour_mut().gossipsub.publish(topic, data) { Ok(message_id) => { - info!("Published message {message_id:?} to {topic}"); - MESSAGE_SENT_ON_GOSSIPSUB.inc(); + debug!("Published message to {topic}"); + P2P_MESSAGE_SENT_ON_GOSSIPSUB_TOTAL.inc(); } Err(err) => error!("Failed to publish message to {topic}: {err}"), } diff --git a/crates/topos-p2p/src/runtime/handle_event.rs b/crates/topos-p2p/src/runtime/handle_event.rs index 7f688f06d..4ec582ec4 100644 --- a/crates/topos-p2p/src/runtime/handle_event.rs +++ b/crates/topos-p2p/src/runtime/handle_event.rs @@ -3,7 +3,7 @@ use std::io; use libp2p::{ core::either, multiaddr::Protocol, - swarm::{derive_prelude::Either, ConnectionHandlerUpgrErr, NetworkBehaviour, SwarmEvent}, + swarm::{derive_prelude::Either, NetworkBehaviour, SwarmEvent}, }; use tracing::{debug, error, info, warn}; @@ -36,7 +36,6 @@ impl EventHandler for Runtime { ComposedEvent::PeerInfo(event) => self.handle(event).await, ComposedEvent::Transmission(event) => self.handle(event).await, ComposedEvent::Gossipsub(event) => self.handle(event).await, - ComposedEvent::OutEvent(event) => self.handle(event).await, ComposedEvent::Void => (), } } @@ -48,10 +47,7 @@ impl SwarmEvent< ComposedEvent, Either< - Either< - Either, ConnectionHandlerUpgrErr>, - void::Void, - >, + Either, void::Void>, void::Void>, void::Void, >, >, @@ -62,10 +58,7 @@ impl event: SwarmEvent< ComposedEvent, Either< - Either< - Either, ConnectionHandlerUpgrErr>, - void::Void, - >, + Either, void::Void>, void::Void>, void::Void, >, >, @@ -78,7 +71,7 @@ impl } => { info!( "Local node is listening on {:?}", - address.with(Protocol::P2p(self.local_peer_id.into())), + address.with(Protocol::P2p(self.local_peer_id)), ); self.active_listeners.insert(listener_id); @@ -148,7 +141,7 @@ impl } } - SwarmEvent::Dialing(peer_id) => {} + SwarmEvent::Dialing { peer_id, .. } => {} SwarmEvent::Behaviour(event) => { self.handle(event).await; diff --git a/crates/topos-p2p/src/runtime/handle_event/gossipsub.rs b/crates/topos-p2p/src/runtime/handle_event/gossipsub.rs index 5d47d5c04..e317ad327 100644 --- a/crates/topos-p2p/src/runtime/handle_event/gossipsub.rs +++ b/crates/topos-p2p/src/runtime/handle_event/gossipsub.rs @@ -1,53 +1,89 @@ use libp2p::gossipsub::{Event as GossipsubEvent, Message}; use topos_metrics::{ - MESSAGE_RECEIVED_ON_ECHO, MESSAGE_RECEIVED_ON_GOSSIP, MESSAGE_RECEIVED_ON_READY, + P2P_EVENT_STREAM_CAPACITY_TOTAL, P2P_MESSAGE_DESERIALIZE_FAILURE_TOTAL, + P2P_MESSAGE_RECEIVED_ON_ECHO_TOTAL, P2P_MESSAGE_RECEIVED_ON_GOSSIP_TOTAL, + P2P_MESSAGE_RECEIVED_ON_READY_TOTAL, }; -use tracing::{error, info}; +use tracing::{debug, error}; -use crate::{Event, Runtime, TOPOS_ECHO, TOPOS_GOSSIP, TOPOS_READY}; +use crate::{ + behaviour::gossip::Batch, constant, event::GossipEvent, Event, Runtime, TOPOS_ECHO, + TOPOS_GOSSIP, TOPOS_READY, +}; use super::EventHandler; #[async_trait::async_trait] -impl EventHandler> for Runtime { - async fn handle(&mut self, event: Box) { - if let GossipsubEvent::Message { - message: - Message { - source: Some(source), - data, - topic, - .. - }, - message_id, - .. - } = *event +impl EventHandler for Runtime { + async fn handle(&mut self, event: GossipEvent) { + if let GossipEvent { + source: Some(source), + message, + topic, + } = event { - info!( - "Received message {:?} from {:?} on topic {:?}", - message_id, source, topic - ); - match topic.as_str() { + if self.event_sender.capacity() < *constant::CAPACITY_EVENT_STREAM_BUFFER { + P2P_EVENT_STREAM_CAPACITY_TOTAL.inc(); + } + + debug!("Received message from {:?} on topic {:?}", source, topic); + match topic { TOPOS_GOSSIP => { - MESSAGE_RECEIVED_ON_GOSSIP.inc(); + P2P_MESSAGE_RECEIVED_ON_GOSSIP_TOTAL.inc(); + + if let Err(e) = self + .event_sender + .send(Event::Gossip { + from: source, + data: message, + }) + .await + { + error!("Failed to send gossip event to runtime: {:?}", e); + } } TOPOS_ECHO => { - MESSAGE_RECEIVED_ON_ECHO.inc(); + P2P_MESSAGE_RECEIVED_ON_ECHO_TOTAL.inc(); + + if let Ok(msg) = bincode::deserialize::(&message) { + for data in msg.data { + if let Err(e) = self + .event_sender + .send(Event::Gossip { from: source, data }) + .await + { + error!("Failed to send gossip event to runtime: {:?}", e); + } + } + } else { + P2P_MESSAGE_DESERIALIZE_FAILURE_TOTAL + .with_label_values(&["echo"]) + .inc(); + } } TOPOS_READY => { - MESSAGE_RECEIVED_ON_READY.inc(); + P2P_MESSAGE_RECEIVED_ON_READY_TOTAL.inc(); + + if let Ok(msg) = bincode::deserialize::(&message) { + for data in msg.data { + if let Err(e) = self + .event_sender + .send(Event::Gossip { from: source, data }) + .await + { + error!("Failed to send gossip event to runtime: {:?}", e); + } + } + } else { + P2P_MESSAGE_DESERIALIZE_FAILURE_TOTAL + .with_label_values(&["ready"]) + .inc(); + } } _ => { error!("Received message on unknown topic {:?}", topic); } } - - if let Err(e) = self - .event_sender - .try_send(Event::Gossip { from: source, data }) - { - tracing::error!("Failed to send gossip event to runtime: {:?}", e); - } } } } diff --git a/crates/topos-p2p/src/runtime/handle_event/peer_info.rs b/crates/topos-p2p/src/runtime/handle_event/peer_info.rs index 97da53e4c..ad6bfdb2f 100644 --- a/crates/topos-p2p/src/runtime/handle_event/peer_info.rs +++ b/crates/topos-p2p/src/runtime/handle_event/peer_info.rs @@ -1,12 +1,11 @@ use std::borrow::Cow; -use libp2p::{ - identify::{Event as IdentifyEvent, Info as IdentifyInfo}, - request_response::ProtocolName, -}; +use libp2p::identify::{Event as IdentifyEvent, Info as IdentifyInfo}; use tracing::info; -use crate::{behaviour::transmission::protocol::TransmissionProtocol, Runtime}; +use crate::{ + behaviour::transmission::protocol::TransmissionProtocol, constant::PEER_INFO_PROTOCOL, Runtime, +}; use super::EventHandler; @@ -18,20 +17,15 @@ impl EventHandler> for Runtime { protocol_version, listen_addrs, protocols, + observed_addr, .. } = info; + // TODO: Check subprotocols for TransmissionProtocol if !self.peer_set.contains(&peer_id) - && protocol_version.as_bytes() == TransmissionProtocol().protocol_name() - && protocols.iter().any(|p| { - self.swarm - .behaviour() - .discovery - .inner - .protocol_names() - .contains(&Cow::Borrowed(p.as_bytes())) - }) + && protocol_version.as_bytes() == PEER_INFO_PROTOCOL.as_bytes() { + self.swarm.add_external_address(observed_addr); self.peer_set.insert(peer_id); for addr in listen_addrs { info!( diff --git a/crates/topos-p2p/src/runtime/mod.rs b/crates/topos-p2p/src/runtime/mod.rs index 18ed48ae2..ac00cf831 100644 --- a/crates/topos-p2p/src/runtime/mod.rs +++ b/crates/topos-p2p/src/runtime/mod.rs @@ -129,6 +129,10 @@ impl Runtime { if addr_query_id.is_none() && self.peer_set.len() >= self.config.minimum_cluster_size { + warn!( + "Publishing our addresses to the network ! We have {} peers", + self.peer_set.len() + ); let key = Key::new(&self.local_peer_id.to_string()); addr_query_id = if let Ok(query_id_record) = self.swarm.behaviour_mut().discovery.inner.put_record( @@ -165,11 +169,17 @@ impl Runtime { KademliaEvent::OutboundQueryProgressed { id, result: - QueryResult::PutRecord(Err(PutRecordError::QuorumFailed { .. })), - .. + QueryResult::PutRecord(Err(PutRecordError::QuorumFailed { + key, + success, + quorum, + })), + stats, + step, } if Some(id) == addr_query_id && publish_retry > 0 => { publish_retry -= 1; warn!("Failed to PutRecord in DHT, retry again, attempt number {publish_retry}"); + warn!("QuorumFailure on DHT addr publication: key: {key:?}, success: {success:?}, quorum: {quorum:?}, stats: {stats:?}"); let key = Key::new(&self.local_peer_id.to_string()); if let Ok(query_id_record) = self.swarm.behaviour_mut().discovery.inner.put_record( @@ -201,7 +211,14 @@ impl Runtime { .. } => {} - KademliaEvent::OutboundQueryProgressed { .. } => {} + KademliaEvent::OutboundQueryProgressed { + id, + result, + stats, + step, + } => { + println!("OutboundQueryProgressed: {id:?}, {result:?}, {stats:?}, {step:?}"); + } KademliaEvent::InboundRequest { .. } => {} KademliaEvent::RoutingUpdated { .. } => {} @@ -226,7 +243,7 @@ impl Runtime { )) => {} SwarmEvent::ConnectionEstablished { .. } => {} - SwarmEvent::Dialing(_) => {} + SwarmEvent::Dialing { .. } => {} SwarmEvent::IncomingConnection { .. } => {} SwarmEvent::NewListenAddr { .. } => {} SwarmEvent::Behaviour(ComposedEvent::Gossipsub(_)) => {} @@ -235,6 +252,7 @@ impl Runtime { local_addr, send_back_addr, error, + .. } => { warn!("IncomingConnectionError: local_addr: {local_addr:?}, send_back_addr: {send_back_addr:?}, error: {error:?}"); } @@ -247,17 +265,7 @@ impl Runtime { let gossipsub = &mut self.swarm.behaviour_mut().gossipsub; - gossipsub - .subscribe(&gossipsub::IdentTopic::new(TOPOS_GOSSIP)) - .unwrap(); - - gossipsub - .subscribe(&gossipsub::IdentTopic::new(TOPOS_ECHO)) - .unwrap(); - - gossipsub - .subscribe(&gossipsub::IdentTopic::new(TOPOS_READY)) - .unwrap(); + gossipsub.subscribe()?; Ok(self) } diff --git a/crates/topos-p2p/src/tests/dht.rs b/crates/topos-p2p/src/tests/dht.rs index 9bd6be06e..93be2c537 100644 --- a/crates/topos-p2p/src/tests/dht.rs +++ b/crates/topos-p2p/src/tests/dht.rs @@ -1,7 +1,8 @@ -use std::time::Duration; +use std::{num::NonZeroUsize, time::Duration}; use futures::StreamExt; use libp2p::{ + identify::{self, Info}, kad::{record::Key, KademliaEvent, PutRecordOk, QueryResult, Record}, swarm::SwarmEvent, }; @@ -10,15 +11,15 @@ use test_log::test; use topos_test_sdk::tce::NodeConfig; use crate::{ - event::ComposedEvent, network::NetworkBuilder, tests::support::local_peer, wait_for_event, - Client, Runtime, + config::DiscoveryConfig, event::ComposedEvent, network::NetworkBuilder, + tests::support::local_peer, wait_for_event, Client, Runtime, }; use super::support::{dummy_peer, PeerAddr}; #[rstest] #[test(tokio::test)] -#[timeout(Duration::from_secs(1))] +#[timeout(Duration::from_secs(5))] async fn put_value_in_dht() { let peer_1 = NodeConfig::from_seed(1); let peer_2 = NodeConfig::from_seed(2); @@ -27,19 +28,43 @@ async fn put_value_in_dht() { let (_, _, runtime) = crate::network::builder() .peer_key(peer_2.keypair.clone()) - .known_peers(&[]) + .known_peers(&[(peer_1.peer_id(), peer_1.addr.clone())]) .exposed_addresses(peer_2.addr.clone()) .listen_addr(peer_2.addr.clone()) - .minimum_cluster_size(0) + .minimum_cluster_size(1) + .discovery_config( + DiscoveryConfig::default().with_replication_factor(NonZeroUsize::new(1).unwrap()), + ) .build() .await .expect("Unable to create p2p network"); let mut runtime = runtime.bootstrap().await.unwrap(); + // runtime + // .swarm + // .behaviour_mut() + // .discovery + // .inner + // .add_address(&peer_1.keypair.public().to_peer_id(), peer_1.addr); + + // loop { + // if let Some(SwarmEvent::Behaviour(ComposedEvent::PeerInfo(event))) = + // runtime.swarm.next().await + // { + // println!("Event: {:?}", event); + // if let identify::Event::Received { + // peer_id, + // info: Info { observed_addr, .. }, + // } = *event + // { + // println!("Peer {} observed address: {}", peer_id, observed_addr); + // runtime.swarm.add_external_address(observed_addr); + // break; + // } + // } + // } let kad = &mut runtime.swarm.behaviour_mut().discovery; - kad.inner - .add_address(&peer_1.keypair.public().to_peer_id(), peer_1.addr); let input_key = Key::new(&runtime.local_peer_id.to_string()); _ = kad diff --git a/crates/topos-p2p/src/tests/support/macros.rs b/crates/topos-p2p/src/tests/support/macros.rs index 69233d31c..16f9c7de8 100644 --- a/crates/topos-p2p/src/tests/support/macros.rs +++ b/crates/topos-p2p/src/tests/support/macros.rs @@ -3,6 +3,7 @@ macro_rules! wait_for_event { ($node:ident, matches: $(|)? $( $pattern:pat_param )|+ $( if $guard: expr )? $(,)?) => { let assertion = async { while let Some(event) = $node.next().await { + println!("Event: {:?}", event); if matches!(event, $( $pattern )|+ $( if $guard )?) { break; } diff --git a/crates/topos-tce-api/Cargo.toml b/crates/topos-tce-api/Cargo.toml index e66c41cae..8fa2c74b1 100644 --- a/crates/topos-tce-api/Cargo.toml +++ b/crates/topos-tce-api/Cargo.toml @@ -11,27 +11,28 @@ topos-metrics = { path = "../topos-metrics" } topos-tce-storage = { path = "../topos-tce-storage" } topos-telemetry = { path = "../topos-telemetry" } -async-trait.workspace = true +async-graphql-axum.workspace = true +async-graphql.workspace = true async-stream.workspace = true +async-trait.workspace = true +axum.workspace = true +base64.workspace = true futures.workspace = true hex.workspace = true +http.workspace = true +hyper.workspace = true +opentelemetry.workspace = true +prometheus-client.workspace = true serde.workspace = true thiserror.workspace = true tokio-stream.workspace = true tokio.workspace = true tonic.workspace = true +tower-http.workspace = true tower.workspace = true +tracing-opentelemetry.workspace = true tracing.workspace = true uuid.workspace = true -base64.workspace = true -opentelemetry.workspace = true -tracing-opentelemetry.workspace = true -axum.workspace = true -async-graphql.workspace = true -async-graphql-axum.workspace = true -hyper.workspace = true -http.workspace = true -tower-http.workspace = true tonic-health = "0.9.0" tonic-reflection = "0.9.0" diff --git a/crates/topos-tce-api/src/lib.rs b/crates/topos-tce-api/src/lib.rs index 489e03067..37194c59c 100644 --- a/crates/topos-tce-api/src/lib.rs +++ b/crates/topos-tce-api/src/lib.rs @@ -8,4 +8,6 @@ mod stream; #[cfg(test)] mod tests; -pub use runtime::{error::RuntimeError, Runtime, RuntimeClient, RuntimeCommand, RuntimeEvent}; +pub use runtime::{ + error::RuntimeError, Runtime, RuntimeClient, RuntimeCommand, RuntimeContext, RuntimeEvent, +}; diff --git a/crates/topos-tce-api/src/metrics/builder.rs b/crates/topos-tce-api/src/metrics/builder.rs index 522c0179e..35f248730 100644 --- a/crates/topos-tce-api/src/metrics/builder.rs +++ b/crates/topos-tce-api/src/metrics/builder.rs @@ -20,7 +20,17 @@ impl ServerBuilder { pub async fn build( mut self, ) -> Server> { - let app = Router::new().route("/metrics", get(|| async { gather_metrics() })); + let app = Router::new().route( + "/metrics", + get(|| async { + let topos_metrics = gather_metrics(); + let mut libp2p_metrics = String::new(); + let reg = topos_p2p::constant::METRIC_REGISTRY.lock().await; + _ = prometheus_client::encoding::text::encode(&mut libp2p_metrics, ®); + + format!("{topos_metrics}{libp2p_metrics}") + }), + ); let serve_addr = self .serve_addr diff --git a/crates/topos-tce-api/src/runtime/builder.rs b/crates/topos-tce-api/src/runtime/builder.rs index e5261e80c..87c4be2db 100644 --- a/crates/topos-tce-api/src/runtime/builder.rs +++ b/crates/topos-tce-api/src/runtime/builder.rs @@ -60,7 +60,13 @@ impl RuntimeBuilder { self } - pub async fn build_and_launch(mut self) -> (RuntimeClient, impl Stream) { + pub async fn build_and_launch( + mut self, + ) -> ( + RuntimeClient, + impl Stream, + RuntimeContext, + ) { let (command_sender, internal_runtime_command_receiver) = mpsc::channel(2048); let (api_event_sender, api_event_receiver) = mpsc::channel(2048); @@ -71,18 +77,40 @@ impl RuntimeBuilder { .build() .await; - let graphql = GraphQLBuilder::default() - .storage(self.storage.clone()) - .serve_addr(self.graphql_socket_addr) - .build(); - - let metrics_server = MetricsBuilder::default() - .serve_addr(self.metrics_socket_addr) - .build(); - let (command_sender, runtime_command_receiver) = mpsc::channel(2048); let (shutdown_channel, shutdown_receiver) = mpsc::channel::>(1); + let grpc_handler = spawn(grpc); + + let graphql_handler = if let Some(graphql_addr) = self.graphql_socket_addr { + tracing::info!("Serving GraphQL on {}", graphql_addr); + + let graphql = GraphQLBuilder::default() + .storage(self.storage.clone()) + .serve_addr(Some(graphql_addr)) + .build(); + spawn(graphql.await) + } else { + spawn(async move { + tracing::info!("Not serving GraphQL"); + Ok(()) + }) + }; + + let metrics_handler = if let Some(metrics_addr) = self.metrics_socket_addr { + tracing::info!("Serving metrics on {}", metrics_addr); + + let metrics_server = MetricsBuilder::default() + .serve_addr(Some(metrics_addr)) + .build(); + spawn(metrics_server.await) + } else { + spawn(async move { + tracing::info!("Not serving metrics"); + Ok(()) + }) + }; + let runtime = Runtime { sync_tasks: HashMap::new(), // TODO: remove unwrap @@ -97,11 +125,7 @@ impl RuntimeBuilder { shutdown: shutdown_receiver, streams: Default::default(), }; - - spawn(grpc); - spawn(graphql.await); - spawn(metrics_server.await); - spawn(runtime.launch()); + let runtime_handler = spawn(runtime.launch()); ( RuntimeClient { @@ -110,6 +134,12 @@ impl RuntimeBuilder { shutdown_channel, }, ReceiverStream::new(api_event_receiver), + RuntimeContext { + grpc_handler, + graphql_handler, + metrics_handler, + runtime_handler, + }, ) } @@ -119,3 +149,22 @@ impl RuntimeBuilder { self } } + +#[derive(Debug)] +pub struct RuntimeContext { + grpc_handler: tokio::task::JoinHandle>, + graphql_handler: tokio::task::JoinHandle>, + metrics_handler: tokio::task::JoinHandle>, + runtime_handler: tokio::task::JoinHandle<()>, +} + +impl Drop for RuntimeContext { + fn drop(&mut self) { + println!("Dropping RuntimeContext"); + tracing::warn!("Dropping RuntimeContext"); + self.grpc_handler.abort(); + self.graphql_handler.abort(); + self.metrics_handler.abort(); + self.runtime_handler.abort(); + } +} diff --git a/crates/topos-tce-api/src/runtime/mod.rs b/crates/topos-tce-api/src/runtime/mod.rs index afeb9e367..65a98e291 100644 --- a/crates/topos-tce-api/src/runtime/mod.rs +++ b/crates/topos-tce-api/src/runtime/mod.rs @@ -30,7 +30,8 @@ use crate::{ stream::{StreamCommand, StreamError, StreamErrorKind}, }; -pub(crate) mod builder; +pub mod builder; +pub use builder::RuntimeContext; mod client; mod commands; pub mod error; diff --git a/crates/topos-tce-api/tests/runtime.rs b/crates/topos-tce-api/tests/runtime.rs index caa540fd6..d49e20424 100644 --- a/crates/topos-tce-api/tests/runtime.rs +++ b/crates/topos-tce-api/tests/runtime.rs @@ -33,7 +33,7 @@ use topos_test_sdk::tce::public_api::{create_public_api, PublicApiContext}; async fn runtime_can_dispatch_a_cert( #[future] create_public_api: (PublicApiContext, impl Stream), ) { - let (api_context, _) = create_public_api.await; + let (mut api_context, _) = create_public_api.await; let mut client = api_context.api_client; let (tx, rx) = oneshot::channel::(); @@ -103,6 +103,7 @@ async fn runtime_can_dispatch_a_cert( let certificate_received = rx.await.unwrap(); assert_eq!(cert, certificate_received); + drop(api_context.api_context.take()); } #[rstest] @@ -114,7 +115,7 @@ async fn can_catchup_with_old_certs( certificates: Vec, ) { let storage_client = storage_client::partial_1(certificates.clone()); - let (api_context, _) = create_public_api::partial_1(storage_client).await; + let (mut api_context, _) = create_public_api::partial_1(storage_client).await; let mut client = api_context.api_client; @@ -193,6 +194,7 @@ async fn can_catchup_with_old_certs( let certificate_received = rx.recv().await.unwrap(); assert_eq!(cert, certificate_received); + drop(api_context.api_context.take()); } #[rstest] @@ -216,7 +218,7 @@ async fn can_catchup_with_old_certs_with_position() { let _storage_join_handle = spawn(storage.into_future()); - let (runtime_client, _launcher) = Runtime::builder() + let (runtime_client, _launcher, _ctx) = Runtime::builder() .storage(storage_client) .serve_grpc_addr(addr) .serve_graphql_addr(graphql_addr) @@ -316,6 +318,7 @@ async fn can_catchup_with_old_certs_with_position() { let certificate_received = rx.recv().await.unwrap(); assert_eq!(cert, certificate_received); } + #[test(tokio::test)] #[ignore = "not yet implemented"] async fn can_listen_for_multiple_subnet_id() {} @@ -339,7 +342,7 @@ async fn boots_healthy_graphql_server() { let _storage_join_handle = spawn(storage.into_future()); - let (_runtime_client, _launcher) = Runtime::builder() + let (_runtime_client, _launcher, _ctx) = Runtime::builder() .storage(storage_client) .serve_grpc_addr(addr) .serve_graphql_addr(graphql_addr) @@ -379,7 +382,7 @@ async fn graphql_server_enables_cors() { let _storage_join_handle = spawn(storage.into_future()); - let (_runtime_client, _launcher) = Runtime::builder() + let (_runtime_client, _launcher, _ctx) = Runtime::builder() .storage(storage_client) .serve_grpc_addr(addr) .serve_graphql_addr(graphql_addr) @@ -443,7 +446,7 @@ async fn can_query_graphql_endpoint_for_certificates() { let _storage_join_handle = spawn(storage.into_future()); - let (runtime_client, _launcher) = Runtime::builder() + let (runtime_client, _launcher, _ctx) = Runtime::builder() .storage(storage_client) .serve_grpc_addr(addr) .serve_graphql_addr(graphql_addr) diff --git a/crates/topos-tce-broadcast/Cargo.toml b/crates/topos-tce-broadcast/Cargo.toml index 6ac3e035f..f86235b47 100644 --- a/crates/topos-tce-broadcast/Cargo.toml +++ b/crates/topos-tce-broadcast/Cargo.toml @@ -6,17 +6,18 @@ edition = "2021" [dependencies] byteorder.workspace = true futures.workspace = true +lazy_static.workspace = true +opentelemetry-otlp.workspace = true +opentelemetry.workspace = true rand.workspace = true rand_core.workspace = true serde.workspace = true thiserror.workspace = true tokio = { workspace = true, features = ["full"] } tokio-stream = { workspace = true, features = ["sync"] } -tracing.workspace = true -tracing-subscriber = { workspace = true, features = ["env-filter", "fmt"] } -opentelemetry.workspace = true tracing-opentelemetry.workspace = true -opentelemetry-otlp.workspace = true +tracing-subscriber = { workspace = true, features = ["env-filter", "fmt"] } +tracing.workspace = true tce_transport = { package = "topos-tce-transport", path = "../topos-tce-transport"} topos-core = { workspace = true, features = ["uci"] } diff --git a/crates/topos-tce-broadcast/src/constant.rs b/crates/topos-tce-broadcast/src/constant.rs new file mode 100644 index 000000000..ab5942117 --- /dev/null +++ b/crates/topos-tce-broadcast/src/constant.rs @@ -0,0 +1,24 @@ +use lazy_static::lazy_static; + +lazy_static! { + /// Size of the double echo command channel + pub static ref COMMAND_CHANNEL_SIZE: usize = + std::env::var("TOPOS_DOUBLE_ECHO_COMMAND_CHANNEL_SIZE") + .ok() + .and_then(|s| s.parse().ok()) + .unwrap_or(2048); + /// Capacity alert threshold for the double echo command channel + pub static ref COMMAND_CHANNEL_CAPACITY: usize = COMMAND_CHANNEL_SIZE + .checked_mul(10) + .map(|v| { + let r: usize = v.checked_div(100).unwrap_or(*COMMAND_CHANNEL_SIZE); + r + }) + .unwrap_or(*COMMAND_CHANNEL_SIZE); + /// Size of the double echo buffer + pub static ref TOPOS_DOUBLE_ECHO_MAX_BUFFER_SIZE: usize = + std::env::var("TOPOS_BROADCAST_MAX_BUFFER_SIZE") + .ok() + .and_then(|s| s.parse().ok()) + .unwrap_or(crate::double_echo::DoubleEcho::MAX_BUFFER_SIZE); +} diff --git a/crates/topos-tce-broadcast/src/double_echo/mod.rs b/crates/topos-tce-broadcast/src/double_echo/mod.rs index 644df898e..534c0dd66 100644 --- a/crates/topos-tce-broadcast/src/double_echo/mod.rs +++ b/crates/topos-tce-broadcast/src/double_echo/mod.rs @@ -1,6 +1,7 @@ -use crate::Errors; -use crate::{sampler::SampleType, tce_store::TceStore, DoubleEchoCommand, SubscriptionsView}; +use crate::constant; +use crate::{sampler::SampleType, DoubleEchoCommand, SubscriptionsView}; use opentelemetry::trace::TraceContextExt; +use std::collections::HashSet; use std::{ collections::{HashMap, VecDeque}, time, @@ -9,14 +10,15 @@ use tce_transport::{ProtocolEvents, ReliableBroadcastParams}; use tokio::sync::{broadcast, mpsc, oneshot}; use topos_core::uci::{Certificate, CertificateId}; use topos_metrics::{ - CERTIFICATE_RECEIVED, CERTIFICATE_RECEIVED_FROM_API, CERTIFICATE_RECEIVED_FROM_GOSSIP, + CERTIFICATE_RECEIVED_FROM_API_TOTAL, CERTIFICATE_RECEIVED_FROM_GOSSIP_TOTAL, + CERTIFICATE_RECEIVED_TOTAL, DOUBLE_ECHO_BROADCAST_CREATED_TOTAL, + DOUBLE_ECHO_BROADCAST_FINISHED_TOTAL, DOUBLE_ECHO_BUFFERED_MESSAGE_COUNT, + DOUBLE_ECHO_BUFFER_CAPACITY_TOTAL, DOUBLE_ECHO_CURRENT_BUFFER_SIZE, }; -use topos_p2p::Client as NetworkClient; use topos_p2p::PeerId; -use topos_tce_storage::{PendingCertificateId, StorageClient}; -use tracing::{ - debug, error, info, info_span, instrument, trace, warn, warn_span, Instrument, Span, -}; +#[cfg(not(feature = "direct"))] +use tracing::error; +use tracing::{debug, info, info_span, trace, warn, warn_span, Span}; use tracing_opentelemetry::OpenTelemetrySpanExt; /// Processing data associated to a Certificate candidate for delivery @@ -30,30 +32,43 @@ pub struct DeliveryState { } pub struct DoubleEcho { - last_pending_certificate: PendingCertificateId, - pub(crate) params: ReliableBroadcastParams, + /// Channel to receive commands command_receiver: mpsc::Receiver, + /// Channel to receive subscriptions updates subscriptions_view_receiver: mpsc::Receiver, + /// Channel to send events event_sender: broadcast::Sender, - store: Box, - storage: StorageClient, - #[allow(unused)] - network_client: NetworkClient, + /// Channel to receive shutdown signal + pub(crate) shutdown: mpsc::Receiver>, + + /// pending certificates state + pending_certificate_count: u64, + /// buffer of certificates to process + buffer: VecDeque<(bool, Certificate)>, + + /// known certificate ids to avoid processing twice the same certificate + known_certificates: HashSet, + /// delivered certificate ids to avoid processing twice the same certificate + delivered_certificates: HashSet, + + pub(crate) params: ReliableBroadcastParams, + + /// Current certificates being processed cert_candidate: HashMap, - pending_delivery: HashMap, + /// Span tracker for each certificate span_tracker: HashMap, - all_known_certs: Vec, + + /// Delivery time for each certificate (for metrics) delivery_time: HashMap, + pub(crate) subscriptions: SubscriptionsView, // My subscriptions for echo, ready and delivery feedback - buffer: VecDeque<(bool, Certificate)>, - pub(crate) shutdown: mpsc::Receiver>, local_peer_id: String, + /// Buffer of messages to be processed once the certificate payload is received buffered_messages: HashMap>, - max_buffer_size: usize, } impl DoubleEcho { @@ -65,42 +80,42 @@ impl DoubleEcho { command_receiver: mpsc::Receiver, subscriptions_view_receiver: mpsc::Receiver, event_sender: broadcast::Sender, - store: Box, - storage: StorageClient, - network_client: NetworkClient, shutdown: mpsc::Receiver>, local_peer_id: String, - last_pending_certificate: PendingCertificateId, - max_buffer_size: usize, + pending_certificate_count: u64, ) -> Self { Self { - last_pending_certificate, + pending_certificate_count, params, command_receiver, subscriptions_view_receiver, event_sender, - store, - storage, - network_client, cert_candidate: Default::default(), - pending_delivery: Default::default(), span_tracker: Default::default(), - all_known_certs: Default::default(), delivery_time: Default::default(), subscriptions: SubscriptionsView::default(), buffer: VecDeque::new(), shutdown, local_peer_id, buffered_messages: Default::default(), - max_buffer_size, + delivered_certificates: Default::default(), + known_certificates: Default::default(), } } + /// DoubleEcho main loop + /// - Listen for shutdown signal + /// - Read new messages from command_receiver + /// - If a new certificate is received, add it to the buffer + /// - If a new subscription view is received, update the subscriptions + /// - If a new Echo/Ready is received, update the state of the certificate or buffer + /// the message pub(crate) async fn run(mut self) { info!("DoubleEcho started"); let shutdowned: Option> = loop { tokio::select! { + shutdown = self.shutdown.recv() => { warn!("Double echo shutdown signal received {:?}", shutdown); break shutdown; @@ -108,160 +123,12 @@ impl DoubleEcho { Some(command) = self.command_receiver.recv() => { match command { - DoubleEchoCommand::DeliveredCerts { subnet_id, limit, sender } => { - - debug!("DoubleEchoCommand::DeliveredCerts, subnet_id: {:?}, limit: {}", &subnet_id, &limit); - let value = self - .store - .recent_certificates_for_subnet(&subnet_id, limit) - .iter() - .filter_map(|cert_id| self.store.cert_by_id(cert_id).ok()) - .collect(); - - // TODO: Catch send failure - let _ = sender.send(Ok(value)); - } - - DoubleEchoCommand::Broadcast { need_gossip, cert, ctx } => { - if self.storage.pending_certificate_exists(cert.id).await.is_err() && - self.storage.get_certificate(cert.id).await.is_err() - { - let span = warn_span!("Broadcast", peer_id = self.local_peer_id, certificate_id = cert.id.to_string()); - span.in_scope(|| { - warn!("Broadcast registered for {}", cert.id); - self.span_tracker.insert(cert.id, span.clone()); - CERTIFICATE_RECEIVED.inc(); - - if need_gossip { - CERTIFICATE_RECEIVED_FROM_API.inc(); - } else { - CERTIFICATE_RECEIVED_FROM_GOSSIP.inc(); - } - - }); - span.add_link(ctx.context().span().span_context().clone()); - let maybe_pending = self - .storage - .add_pending_certificate(cert.clone()) - .instrument(span.clone()) - .await; - - span.in_scope(||{ - info!("Certificate {} added to pending storage", cert.id); - debug!("DoubleEchoCommand::Broadcast certificate_id: {}", cert.id); - if self.buffer.len() < self.max_buffer_size { - self.buffer.push_back((need_gossip, cert)); - if let Ok(pending) = maybe_pending { - self.last_pending_certificate = pending; - } - } - }); - } - } - - DoubleEchoCommand::IsCertificateDelivered { certificate_id, sender } => { - let _ = sender.send(self.store.cert_by_id(&certificate_id).is_ok()); - } - - DoubleEchoCommand::GetSpanOfCert { certificate_id, sender } => { - if let Some(ctx) = self.span_tracker.get(&certificate_id) { - _ = sender.send(Ok(ctx.clone())); - } else { - _ = sender.send(Err(Errors::CertificateNotFound)); - } - } + DoubleEchoCommand::Broadcast { need_gossip, cert, ctx } => self.handle_broadcast(cert,need_gossip, ctx), command if self.subscriptions.is_some() => { match command { - DoubleEchoCommand::Echo { from_peer, certificate_id, ctx } => { - async { - let cert_delivered = self.store.cert_by_id(&certificate_id).is_ok(); - if !cert_delivered { - if self.storage - .pending_certificate_exists(certificate_id) - .await - .is_ok() - { - let span = if let Some(root) = self.span_tracker.get(&certificate_id) { - info!("DEBUG::Receive ECHO with root"); - info_span!(parent: root, "RECV Inbound Echo", peer = self.local_peer_id, certificate_id = certificate_id.to_string()) - } else { - info!("DEBUG::Receive ECHO without root"); - info_span!("RECV Inbound Echo", peer = self.local_peer_id, certificate_id = certificate_id.to_string()) - }; - - let _enter = span.enter(); - debug!("Handling DoubleEchoCommand::Echo from_peer: {} cert_id: {}", &from_peer, certificate_id); - self.handle_echo(from_peer, &certificate_id); - - self.state_change_follow_up(); - drop(_enter); - // need to deliver the certificate - } else if self.storage.get_certificate(certificate_id).await.is_err() { - info!("DEBUG::Receive ECHO BUFFERING"); - // need to buffer the Echo - self.buffered_messages - .entry(certificate_id) - .or_default() - .push(DoubleEchoCommand::Echo { - from_peer, - certificate_id, - ctx, - }); - } - } - }.await; - }, - DoubleEchoCommand::Ready { from_peer, certificate_id, ctx } => { - async { - let cert_delivered = self.store.cert_by_id(&certificate_id).is_ok(); - if !cert_delivered { - if self.storage - .pending_certificate_exists(certificate_id) - .await - .is_ok() - { - let span =if let Some(root) = self.span_tracker.get(&certificate_id) { - info_span!(parent: root, "RECV Inbound Ready", peer = self.local_peer_id, certificate_id = certificate_id.to_string()) - } else { - info_span!("RECV Inbound Ready", peer = self.local_peer_id, certificate_id = certificate_id.to_string()) - }; - - let _enter = span.enter(); - debug!("Handling DoubleEchoCommand::Ready from_peer: {} cert_id: {}", &from_peer, &certificate_id); - - self.handle_ready(from_peer, &certificate_id); - - self.state_change_follow_up(); - drop(_enter); - // need to deliver the certificate - } else if self.storage.get_certificate(certificate_id).await.is_err() { - // need to buffer the Ready - self.buffered_messages - .entry(certificate_id) - .or_default() - .push(DoubleEchoCommand::Ready { - from_peer, - certificate_id, - ctx, - }); - } - } - }.await; - }, - DoubleEchoCommand::Deliver { certificate_id, ctx, .. } => { - let span = info_span!(parent: &ctx, "Handling Deliver", peer = self.local_peer_id, certificate_id = certificate_id.to_string()); - - async { - info!("Handling DoubleEchoCommand::Deliver cert_id: {}", certificate_id); - if let Some((cert, _)) = self.cert_candidate.get(&certificate_id) { - self.handle_deliver(cert.clone()); - self.state_change_follow_up(); - } - }.instrument(span).await; - }, - - + DoubleEchoCommand::Echo { from_peer, certificate_id, ctx } => self.handle_echo(from_peer, certificate_id, ctx), + DoubleEchoCommand::Ready { from_peer, certificate_id, ctx } => self.handle_ready(from_peer, certificate_id, ctx), _ => {} } @@ -294,6 +161,7 @@ impl DoubleEcho { // TODO: Remove the unused_variables attribute when the feature direct is removed #[allow(unused_variables)] if let Some((need_gossip, cert)) = self.buffer.pop_front() { + DOUBLE_ECHO_CURRENT_BUFFER_SIZE.dec(); if let Some(ctx) = self.span_tracker.get(&cert.id) { let span = info_span!( parent: ctx, @@ -312,10 +180,11 @@ impl DoubleEcho { .send(ProtocolEvents::CertificateDelivered { certificate: cert }); } #[cfg(not(feature = "direct"))] - self.handle_broadcast(cert, need_gossip); + self.broadcast(cert, need_gossip); if let Some(messages) = self.buffered_messages.remove(&cert_id) { for message in messages { + DOUBLE_ECHO_BUFFERED_MESSAGE_COUNT.dec(); match message { DoubleEchoCommand::Echo { from_peer, @@ -340,7 +209,7 @@ impl DoubleEcho { }; let _enter = span.enter(); - self.handle_echo(from_peer, &certificate_id); + self.consume_echo(from_peer, &certificate_id); self.state_change_follow_up(); } DoubleEchoCommand::Ready { @@ -366,7 +235,7 @@ impl DoubleEcho { }; let _enter = span.enter(); - self.handle_ready(from_peer, &certificate_id); + self.consume_ready(from_peer, &certificate_id); self.state_change_follow_up(); } @@ -380,16 +249,6 @@ impl DoubleEcho { cert.id, cert.id ); } - if let Ok(Some((pending, certificate))) = self - .storage - .next_pending_certificate(Some(self.last_pending_certificate as usize)) - .await - { - self.last_pending_certificate = pending; - self.buffer.push_back((true, certificate)); - } else { - info!("No more certificate to broadcast"); - } } } }; @@ -403,43 +262,14 @@ impl DoubleEcho { } } +#[cfg(not(feature = "direct"))] impl DoubleEcho { - fn sample_consume_peer(from_peer: &PeerId, state: &mut DeliveryState, sample_type: SampleType) { - match sample_type { - SampleType::EchoSubscription => state.subscriptions.echo.remove(from_peer), - SampleType::ReadySubscription => state.subscriptions.ready.remove(from_peer), - _ => false, - }; - } - - pub(crate) fn handle_echo(&mut self, from_peer: PeerId, certificate_id: &CertificateId) { - if let Some((_certificate, state)) = self.cert_candidate.get_mut(certificate_id) { - Self::sample_consume_peer(&from_peer, state, SampleType::EchoSubscription); - } - } - - pub(crate) fn handle_ready(&mut self, from_peer: PeerId, certificate_id: &CertificateId) { - if let Some((_certificate, state)) = self.cert_candidate.get_mut(certificate_id) { - Self::sample_consume_peer(&from_peer, state, SampleType::ReadySubscription); - } - } - - #[cfg_attr(feature = "direct", allow(dead_code))] - pub(crate) fn handle_broadcast(&mut self, cert: Certificate, origin: bool) { - info!("🙌 Starting broadcasting the Certificate {}", &cert.id); - - self.dispatch(cert, origin); - } - - pub(crate) fn handle_deliver(&mut self, cert: Certificate) { - self.dispatch(cert, false) - } - /// Called to process potentially new certificate: /// - either submitted from API ( [tce_transport::TceCommands::Broadcast] command) /// - or received through the gossip (first step of protocol exchange) - #[instrument(skip_all)] - pub(crate) fn dispatch(&mut self, cert: Certificate, origin: bool) { + pub(crate) fn broadcast(&mut self, cert: Certificate, origin: bool) { + info!("🙌 Starting broadcasting the Certificate {}", &cert.id); + if self.cert_pre_broadcast_check(&cert).is_err() { error!("Failure on the pre-check for the Certificate {}", &cert.id); self.event_sender @@ -459,7 +289,7 @@ impl DoubleEcho { return; } - if self.store.cert_by_id(&cert.id).is_ok() { + if self.delivered_certificates.get(&cert.id).is_some() { self.event_sender .send(ProtocolEvents::AlreadyDelivered { certificate_id: cert.id, @@ -493,8 +323,6 @@ impl DoubleEcho { // Add new entry for the new Cert candidate match self.delivery_state_for_new_cert(&cert.id) { Some(delivery_state) => { - info!("DeliveryState is : {:?}", delivery_state.subscriptions); - self.cert_candidate .insert(cert.id, (cert.clone(), delivery_state)); @@ -508,7 +336,6 @@ impl DoubleEcho { return; } } - self.all_known_certs.push(cert.clone()); self.delivery_time .insert(cert.id, (time::SystemTime::now(), Default::default())); @@ -555,13 +382,185 @@ impl DoubleEcho { } } + /// Checks done before starting to broadcast + fn cert_pre_broadcast_check(&self, cert: &Certificate) -> Result<(), ()> { + if cert.check_signature().is_err() { + error!("Error on the signature"); + } + + if cert.check_proof().is_err() { + error!("Error on the proof"); + } + + Ok(()) + } +} + +impl DoubleEcho { + fn sample_consume_peer(from_peer: &PeerId, state: &mut DeliveryState, sample_type: SampleType) { + match sample_type { + SampleType::EchoSubscription => state.subscriptions.echo.remove(from_peer), + SampleType::ReadySubscription => state.subscriptions.ready.remove(from_peer), + _ => false, + }; + } + + pub(crate) fn handle_broadcast(&mut self, cert: Certificate, need_gossip: bool, ctx: Span) { + if !self.known_certificates.contains(&cert.id) { + let span = warn_span!( + "Broadcast", + peer_id = self.local_peer_id, + certificate_id = cert.id.to_string() + ); + DOUBLE_ECHO_BROADCAST_CREATED_TOTAL.inc(); + span.in_scope(|| { + warn!("Broadcast registered for {}", cert.id); + self.span_tracker.insert(cert.id, span.clone()); + CERTIFICATE_RECEIVED_TOTAL.inc(); + + if need_gossip { + CERTIFICATE_RECEIVED_FROM_API_TOTAL.inc(); + } else { + CERTIFICATE_RECEIVED_FROM_GOSSIP_TOTAL.inc(); + } + }); + span.add_link(ctx.context().span().span_context().clone()); + + self.known_certificates.insert(cert.id); + span.in_scope(|| { + debug!("DoubleEchoCommand::Broadcast certificate_id: {}", cert.id); + if self.buffer.len() < *constant::TOPOS_DOUBLE_ECHO_MAX_BUFFER_SIZE { + self.buffer.push_back((need_gossip, cert)); + DOUBLE_ECHO_CURRENT_BUFFER_SIZE.inc(); + } else { + DOUBLE_ECHO_BUFFER_CAPACITY_TOTAL.inc(); + // Adding one to the pending_certificate_count because we + // can't buffer it right now + _ = self.pending_certificate_count.checked_add(1); + } + }); + } + } + + pub(crate) fn handle_echo( + &mut self, + from_peer: PeerId, + certificate_id: CertificateId, + ctx: Span, + ) { + let cert_delivered = self.delivered_certificates.get(&certificate_id).is_some(); + if !cert_delivered { + if self.known_certificates.get(&certificate_id).is_some() { + let span = if let Some(root) = self.span_tracker.get(&certificate_id) { + info_span!( + parent: root, + "RECV Inbound Echo", + peer = self.local_peer_id, + certificate_id = certificate_id.to_string() + ) + } else { + info_span!( + "RECV Inbound Echo", + peer = self.local_peer_id, + certificate_id = certificate_id.to_string() + ) + }; + + let _enter = span.enter(); + debug!( + "Handling DoubleEchoCommand::Echo from_peer: {} cert_id: {}", + &from_peer, certificate_id + ); + self.consume_echo(from_peer, &certificate_id); + + self.state_change_follow_up(); + drop(_enter); + // need to deliver the certificate + } else if self.delivered_certificates.get(&certificate_id).is_none() { + // need to buffer the Echo + self.buffered_messages + .entry(certificate_id) + .or_default() + .push(DoubleEchoCommand::Echo { + from_peer, + certificate_id, + ctx, + }); + DOUBLE_ECHO_BUFFERED_MESSAGE_COUNT.inc(); + } + } + } + + pub(crate) fn handle_ready( + &mut self, + from_peer: PeerId, + certificate_id: CertificateId, + ctx: Span, + ) { + let cert_delivered = self.delivered_certificates.get(&certificate_id).is_some(); + if !cert_delivered { + if self.known_certificates.get(&certificate_id).is_some() { + let span = if let Some(root) = self.span_tracker.get(&certificate_id) { + info_span!( + parent: root, + "RECV Inbound Ready", + peer = self.local_peer_id, + certificate_id = certificate_id.to_string() + ) + } else { + info_span!( + "RECV Inbound Ready", + peer = self.local_peer_id, + certificate_id = certificate_id.to_string() + ) + }; + + let _enter = span.enter(); + debug!( + "Handling DoubleEchoCommand::Ready from_peer: {} cert_id: {}", + &from_peer, &certificate_id + ); + + self.consume_ready(from_peer, &certificate_id); + + self.state_change_follow_up(); + drop(_enter); + // need to deliver the certificate + } else if self.delivered_certificates.get(&certificate_id).is_none() { + // need to buffer the Ready + self.buffered_messages + .entry(certificate_id) + .or_default() + .push(DoubleEchoCommand::Ready { + from_peer, + certificate_id, + ctx, + }); + DOUBLE_ECHO_BUFFERED_MESSAGE_COUNT.inc(); + } + } + } + + pub(crate) fn consume_echo(&mut self, from_peer: PeerId, certificate_id: &CertificateId) { + if let Some((_certificate, state)) = self.cert_candidate.get_mut(certificate_id) { + Self::sample_consume_peer(&from_peer, state, SampleType::EchoSubscription); + } + } + + pub(crate) fn consume_ready(&mut self, from_peer: PeerId, certificate_id: &CertificateId) { + if let Some((_certificate, state)) = self.cert_candidate.get_mut(certificate_id) { + Self::sample_consume_peer(&from_peer, state, SampleType::ReadySubscription); + } + } + pub(crate) fn state_change_follow_up(&mut self) { debug!("StateChangeFollowUp called"); let mut state_modified = false; let mut gen_evts = Vec::::new(); + let mut delivered_certificates = Vec::<(Certificate, Span)>::new(); // For all current Cert on processing - for (certificate_id, (certificate, state_to_delivery)) in &mut self.cert_candidate { + for (certificate, state_to_delivery) in self.cert_candidate.values_mut() { // Check whether we should send Ready if !state_to_delivery.ready_sent && is_r_ready( @@ -588,10 +587,7 @@ impl DoubleEcho { state_to_delivery, ) { - self.pending_delivery.insert( - *certificate_id, - (certificate.clone(), state_to_delivery.ctx.clone()), - ); + delivered_certificates.push((certificate.clone(), state_to_delivery.ctx.clone())); state_to_delivery.delivered = true; state_modified = true; } @@ -629,38 +625,27 @@ impl DoubleEcho { self.cert_candidate .retain(|_, (_, state)| !state.delivered || !state.ready_sent); - let delivered_certificates = self - .pending_delivery - .iter() - .filter(|(_, (c, _))| self.cert_post_delivery_check(c).is_ok()) - .map(|(c, s)| (*c, s.clone())) - .collect::>(); - - for (certificate_id, (certificate, ctx)) in delivered_certificates { + for (certificate, ctx) in delivered_certificates { let span = info_span!(parent: &ctx, "Delivered"); span.in_scope(|| { let mut d = time::Duration::from_millis(0); - if let Some((from, duration)) = self.delivery_time.get_mut(&certificate_id) { + if let Some((from, duration)) = self.delivery_time.get_mut(&certificate.id) { *duration = from.elapsed().unwrap(); d = *duration; - info!("Certificate {} got delivered in {:?}", certificate_id, d); + info!("Certificate {} got delivered in {:?}", certificate.id, d); } - self.pending_delivery.remove(&certificate_id); - self.cert_candidate.remove(&certificate_id); - self.span_tracker.remove(&certificate_id); + self.cert_candidate.remove(&certificate.id); + self.span_tracker.remove(&certificate.id); - debug!("📝 Accepted[{}]\t Delivery time: {:?}", &certificate_id, d); + debug!("📝 Accepted[{}]\t Delivery time: {:?}", &certificate.id, d); + DOUBLE_ECHO_BROADCAST_FINISHED_TOTAL.inc(); + self.delivered_certificates.insert(certificate.id); _ = self .event_sender - .send(ProtocolEvents::CertificateDelivered { - certificate: certificate.clone(), - }); - - self.store - .add_cert_in_hist(&certificate.source_subnet_id, &certificate); + .send(ProtocolEvents::CertificateDelivered { certificate }); }); } } @@ -669,24 +654,6 @@ impl DoubleEcho { let _ = self.event_sender.send(evt); } } - - /// Checks done before starting to broadcast - fn cert_pre_broadcast_check(&self, cert: &Certificate) -> Result<(), ()> { - if cert.check_signature().is_err() { - error!("Error on the signature"); - } - - if cert.check_proof().is_err() { - error!("Error on the proof"); - } - - Ok(()) - } - - /// Here comes test that is necessarily done after delivery - fn cert_post_delivery_check(&self, _cert: &Certificate) -> Result<(), ()> { - Ok(()) - } } /// Predicate on whether we reached the threshold to deliver the Certificate diff --git a/crates/topos-tce-broadcast/src/lib.rs b/crates/topos-tce-broadcast/src/lib.rs index 4d05a907b..77a2cee1c 100644 --- a/crates/topos-tce-broadcast/src/lib.rs +++ b/crates/topos-tce-broadcast/src/lib.rs @@ -10,31 +10,27 @@ use thiserror::Error; use tokio::spawn; use tokio_stream::wrappers::BroadcastStream; -use futures::{Future, Stream, TryStreamExt}; -#[allow(unused)] -use opentelemetry::global; +use futures::{Stream, TryStreamExt}; use tokio::sync::mpsc::Sender; use tokio::sync::{broadcast, mpsc, oneshot}; use double_echo::DoubleEcho; use tce_transport::{ProtocolEvents, ReliableBroadcastParams}; -use topos_core::uci::{Certificate, CertificateId, SubnetId}; +use topos_core::uci::{Certificate, CertificateId}; +use topos_metrics::DOUBLE_ECHO_COMMAND_CHANNEL_CAPACITY_TOTAL; use topos_p2p::PeerId; use topos_tce_storage::StorageClient; use tracing::{debug, error, info, Span}; -use crate::mem_store::TceMemStore; use crate::sampler::SubscriptionsView; -use crate::tce_store::TceStore; pub use topos_core::uci; pub type Peer = String; +mod constant; pub mod double_echo; -pub mod mem_store; pub mod sampler; -pub mod tce_store; #[cfg(test)] mod tests; @@ -63,23 +59,6 @@ pub enum SamplerCommand { #[derive(Debug)] pub enum DoubleEchoCommand { - IsCertificateDelivered { - certificate_id: CertificateId, - sender: oneshot::Sender, - }, - - GetSpanOfCert { - certificate_id: CertificateId, - sender: oneshot::Sender>, - }, - - /// Received G-set message - Deliver { - from_peer: PeerId, - certificate_id: CertificateId, - ctx: Span, - }, - /// Entry point for new certificate to submit as initial sender Broadcast { need_gossip: bool, @@ -100,17 +79,12 @@ pub enum DoubleEchoCommand { certificate_id: CertificateId, ctx: Span, }, - DeliveredCerts { - subnet_id: SubnetId, - limit: u64, - sender: oneshot::Sender, Errors>>, - }, } /// Thread safe client to the protocol aggregate #[derive(Clone, Debug)] pub struct ReliableBroadcastClient { - broadcast_commands: mpsc::Sender, + command_sender: mpsc::Sender, pub(crate) subscriptions_view_sender: mpsc::Sender, pub(crate) double_echo_shutdown_channel: mpsc::Sender>, } @@ -124,45 +98,35 @@ impl ReliableBroadcastClient { config: ReliableBroadcastConfig, local_peer_id: String, storage: StorageClient, - network_client: topos_p2p::Client, ) -> (Self, impl Stream>) { let (subscriptions_view_sender, subscriptions_view_receiver) = mpsc::channel::(2048); let (event_sender, event_receiver) = broadcast::channel(2048); - let (broadcast_commands, command_receiver) = mpsc::channel(2048); + let (command_sender, command_receiver) = mpsc::channel(*constant::COMMAND_CHANNEL_SIZE); let (double_echo_shutdown_channel, double_echo_shutdown_receiver) = mpsc::channel::>(1); - let last_pending_certificate = storage - .next_pending_certificate(None) + let pending_certificate_count = storage + .get_pending_certificates() .await - .unwrap_or(None) - .map(|(id, _)| id) - .unwrap_or(0); + .map(|v| v.len()) + .unwrap_or(0) as u64; let double_echo = DoubleEcho::new( config.tce_params, command_receiver, subscriptions_view_receiver, event_sender, - #[allow(clippy::box_default)] - Box::new(TceMemStore::default()), - storage, - network_client, double_echo_shutdown_receiver, local_peer_id, - last_pending_certificate, - std::env::var("TOPOS_BROADCAST_MAX_BUFFER_SIZE") - .ok() - .and_then(|s| s.parse().ok()) - .unwrap_or(DoubleEcho::MAX_BUFFER_SIZE), + pending_certificate_count, ); spawn(double_echo.run()); ( Self { - broadcast_commands, + command_sender, subscriptions_view_sender, double_echo_shutdown_channel, }, @@ -182,65 +146,8 @@ impl ReliableBroadcastClient { .map_err(|_| ()) } - /// delivered certificates for given target chain after the given certificate - pub fn delivered_certs( - &self, - subnet_id: SubnetId, - _from_cert_id: CertificateId, - ) -> impl Future, Errors>> + 'static + Send { - let (sender, receiver) = oneshot::channel(); - - let broadcast_commands = self.broadcast_commands.clone(); - - async move { - if broadcast_commands - .send(DoubleEchoCommand::DeliveredCerts { - subnet_id, - limit: 10, - sender, - }) - .await - .is_err() - { - error!("Unable to execute delivered_certs"); - } - - receiver.await.map_err(Into::into).and_then(|result| result) - } - } - - /// delivered certificates for given target chain after the given certificate - pub async fn get_span_cert(&self, certificate_id: CertificateId) -> Result { - let (sender, receiver) = oneshot::channel(); - - let broadcast_commands = self.broadcast_commands.clone(); - - if broadcast_commands - .send(DoubleEchoCommand::GetSpanOfCert { - certificate_id, - sender, - }) - .await - .is_err() - { - error!("Unable to execute get_span_cert"); - } - - receiver.await.map_err(Into::into).and_then(|result| result) - } - - pub async fn delivered_certs_ids( - &self, - subnet_id: SubnetId, - from_cert_id: CertificateId, - ) -> Result, Errors> { - self.delivered_certs(subnet_id, from_cert_id) - .await - .map(|mut v| v.iter_mut().map(|c| c.id).collect()) - } - pub fn get_double_echo_channel(&self) -> Sender { - self.broadcast_commands.clone() + self.command_sender.clone() } /// Use to broadcast new certificate to the TCE network @@ -249,7 +156,11 @@ impl ReliableBroadcastClient { certificate: Certificate, origin: bool, ) -> Result<(), ()> { - let broadcast_commands = self.broadcast_commands.clone(); + let broadcast_commands = self.command_sender.clone(); + + if broadcast_commands.capacity() <= *constant::COMMAND_CHANNEL_CAPACITY { + DOUBLE_ECHO_COMMAND_CHANNEL_CAPACITY_TOTAL.inc(); + } info!("Send certificate to be broadcast"); if broadcast_commands @@ -267,28 +178,6 @@ impl ReliableBroadcastClient { Ok(()) } - pub async fn is_certificate_delivered_in_cache( - &self, - certificate_id: CertificateId, - ) -> Result { - let (sender, receiver) = oneshot::channel(); - - let broadcast_commands = self.broadcast_commands.clone(); - - if broadcast_commands - .send(DoubleEchoCommand::IsCertificateDelivered { - certificate_id, - sender, - }) - .await - .is_err() - { - error!("Unable to send is_certificate_delivered command, Receiver was dropped"); - } - - receiver.await.map_err(Into::into) - } - pub async fn shutdown(&self) -> Result<(), Errors> { debug!("Shutting down reliable broadcast client"); let (double_echo_sender, double_echo_receiver) = oneshot::channel(); @@ -306,7 +195,7 @@ impl ReliableBroadcastClient { #[derive(Error, Debug)] pub enum Errors { #[error("Error while sending a DoubleEchoCommand to DoubleEcho: {0:?}")] - DoubleEchoSend(#[from] mpsc::error::SendError), + DoubleEchoSend(#[from] Box>), #[error("Error while waiting for a DoubleEchoCommand response: {0:?}")] DoubleEchoRecv(#[from] oneshot::error::RecvError), diff --git a/crates/topos-tce-broadcast/src/mem_store.rs b/crates/topos-tce-broadcast/src/mem_store.rs deleted file mode 100644 index 2bfa7fe92..000000000 --- a/crates/topos-tce-broadcast/src/mem_store.rs +++ /dev/null @@ -1,110 +0,0 @@ -use crate::{Errors, TceStore}; -use std::collections::{BTreeSet, HashMap}; -use topos_core::uci::{Certificate, CertificateId, SubnetId, CERTIFICATE_ID_LENGTH}; - -/// Store implementation in RAM good enough for functional tests -/// Might need to split through a new layer of TCEState -/// between ReliableBroadcast and rocksdb -#[derive(Default, Clone)] -pub struct TceMemStore { - /// Global map of delivered and accepted certificates - all_certs: HashMap, - /// Mapping SubnetId -> Delivered certificated - history: HashMap>, - /// Consider for now that each TCE nodes is following all subnets - tracked_digest: HashMap>, - /// List of the subnets that we're part of - /// NOTE: Below is for later, for now we're considering - /// being part of all subnets, so following digest of everyone - followed_subnet: Vec, -} - -impl TceMemStore { - pub fn new(subnets: Vec) -> TceMemStore { - let mut store = TceMemStore { - all_certs: Default::default(), - history: Default::default(), - tracked_digest: Default::default(), - followed_subnet: subnets, - }; - for subnet in &store.followed_subnet { - store.tracked_digest.insert(*subnet, BTreeSet::new()); - store.history.insert(*subnet, BTreeSet::new()); - } - // Add the genesis - store.all_certs.insert( - CertificateId::from_array([0u8; CERTIFICATE_ID_LENGTH]), - Default::default(), - ); - store - } -} - -impl TceStore for TceMemStore { - // OTLP START DELIVERY TRACE [ cert, peer ] - fn apply_cert(&mut self, cert: &Certificate) -> Result<(), Errors> { - // Add the entry in the history - let _ = self.add_cert_in_hist(&cert.source_subnet_id, cert); - - // Add the cert into the history of each Target - for target_subnet_id in &cert.target_subnets { - self.add_cert_in_hist(target_subnet_id, cert); - self.add_cert_in_digest(target_subnet_id, &cert.id); - } - - Ok(()) - } - - fn add_cert_in_hist(&mut self, subnet_id: &SubnetId, cert: &Certificate) -> bool { - self.all_certs.insert(cert.id, cert.clone()); - self.history.entry(*subnet_id).or_default().insert(cert.id) - } - - fn add_cert_in_digest(&mut self, subnet_id: &SubnetId, cert_id: &CertificateId) -> bool { - self.tracked_digest - .entry(*subnet_id) - .or_default() - .insert(*cert_id) - } - - fn read_journal( - &self, - _subnet_id: SubnetId, - _from_offset: u64, - _max_results: u64, - ) -> Result<(Vec, u64), Errors> { - unimplemented!(); - } - - fn recent_certificates_for_subnet( - &self, - subnet_id: &SubnetId, - _last_n: u64, - ) -> Vec { - match self.history.get(subnet_id) { - Some(subnet_certs) => subnet_certs.iter().cloned().collect::>(), - None => Vec::new(), - } - } - - fn cert_by_id(&self, cert_id: &CertificateId) -> Result { - match self.all_certs.get(cert_id) { - Some(cert) => Ok(cert.clone()), - _ => Err(Errors::CertificateNotFound), - } - } - - fn check_precedence(&self, cert: &Certificate) -> Result<(), Errors> { - if cert.prev_id.as_array() == &[0u8; CERTIFICATE_ID_LENGTH] { - return Ok(()); - } - match self.cert_by_id(&cert.prev_id) { - Ok(_) => Ok(()), - _ => Err(Errors::CertificateNotFound), - } - } - - fn clone_box(&self) -> Box { - Box::new(self.clone()) - } -} diff --git a/crates/topos-tce-broadcast/src/tce_store.rs b/crates/topos-tce-broadcast/src/tce_store.rs deleted file mode 100644 index 97e7d06af..000000000 --- a/crates/topos-tce-broadcast/src/tce_store.rs +++ /dev/null @@ -1,44 +0,0 @@ -//! -//! Storage interface required to support TCE -//! -use topos_core::uci::{Certificate, CertificateId, SubnetId}; - -use crate::Errors; - -/// Defines abstract storage suitable for protocol handler. -/// -/// Implemented in node/store. -pub trait TceStore { - /// Saves (or replaces) the certificate - fn apply_cert(&mut self, cert: &Certificate) -> Result<(), Errors>; - - /// Saves journal item in history - fn add_cert_in_hist(&mut self, subnet_id: &SubnetId, cert_id: &Certificate) -> bool; - - /// Saves journal item in digest - fn add_cert_in_digest(&mut self, subnet_id: &SubnetId, cert_id: &CertificateId) -> bool; - - /// Reads journal entries - from old to new, paged - /// Returns tuple (data, last offset) - fn read_journal( - &self, - subnet_id: SubnetId, - from_offset: u64, - max_results: u64, - ) -> Result<(Vec, u64), Errors>; - - /// Easy access - fn recent_certificates_for_subnet( - &self, - subnet_id: &SubnetId, - last_n: u64, - ) -> Vec; - - /// Read certificate - fn cert_by_id(&self, cert_id: &CertificateId) -> Result; - - /// Check on the previous cert - fn check_precedence(&self, cert: &Certificate) -> Result<(), Errors>; - - fn clone_box(&self) -> Box; -} diff --git a/crates/topos-tce-broadcast/src/tests/mod.rs b/crates/topos-tce-broadcast/src/tests/mod.rs index 8cbee5f2f..0c24adf4d 100644 --- a/crates/topos-tce-broadcast/src/tests/mod.rs +++ b/crates/topos-tce-broadcast/src/tests/mod.rs @@ -1,14 +1,16 @@ use crate::double_echo::*; -use crate::mem_store::TceMemStore; use crate::*; use rstest::*; use std::collections::HashSet; use std::usize; use tce_transport::ReliableBroadcastParams; + +#[cfg(not(feature = "direct"))] use tokio::sync::broadcast::error::TryRecvError; use tokio::sync::broadcast::Receiver; use tokio::time::Duration; +#[cfg(not(feature = "direct"))] use topos_test_sdk::constants::*; const CHANNEL_SIZE: usize = 10; @@ -59,32 +61,14 @@ fn create_context(params: TceParams) -> (DoubleEcho, Context) { let (double_echo_shutdown_sender, double_echo_shutdown_receiver) = mpsc::channel::>(1); - let (sender, _) = mpsc::channel(CHANNEL_SIZE); - let (storage_sender, _) = mpsc::channel(CHANNEL_SIZE); - let (shutdown_sender_storage, _) = mpsc::channel(1); - let (shutdown_sender, _) = mpsc::channel(1); - let storage_client = topos_tce_storage::StorageClient { - sender: storage_sender, - shutdown_channel: shutdown_sender_storage, - }; - let network_client = topos_p2p::Client { - retry_ttl: 10, - local_peer_id: topos_test_sdk::p2p::local_peer(1).0.public().to_peer_id(), - sender, - shutdown_channel: shutdown_sender, - }; let mut double_echo = DoubleEcho::new( params.broadcast_params, cmd_receiver, subscriptions_view_receiver, event_sender, - Box::::default(), - storage_client, - network_client, double_echo_shutdown_receiver, String::new(), 0, - 1024, ); // List of peers @@ -113,6 +97,7 @@ fn create_context(params: TceParams) -> (DoubleEcho, Context) { ) } +#[cfg(not(feature = "direct"))] fn reach_echo_threshold(double_echo: &mut DoubleEcho, cert: &Certificate) { let selected = double_echo .subscriptions @@ -123,10 +108,11 @@ fn reach_echo_threshold(double_echo: &mut DoubleEcho, cert: &Certificate) { .collect::>(); for p in selected { - double_echo.handle_echo(p, &cert.id); + double_echo.consume_echo(p, &cert.id); } } +#[cfg(not(feature = "direct"))] fn reach_ready_threshold(double_echo: &mut DoubleEcho, cert: &Certificate) { let selected = double_echo .subscriptions @@ -137,10 +123,11 @@ fn reach_ready_threshold(double_echo: &mut DoubleEcho, cert: &Certificate) { .collect::>(); for p in selected { - double_echo.handle_ready(p, &cert.id); + double_echo.consume_ready(p, &cert.id); } } +#[cfg(not(feature = "direct"))] fn reach_delivery_threshold(double_echo: &mut DoubleEcho, cert: &Certificate) { let selected = double_echo .subscriptions @@ -151,7 +138,7 @@ fn reach_delivery_threshold(double_echo: &mut DoubleEcho, cert: &Certificate) { .collect::>(); for p in selected { - double_echo.handle_ready(p, &cert.id); + double_echo.consume_ready(p, &cert.id); } } @@ -160,6 +147,7 @@ fn reach_delivery_threshold(double_echo: &mut DoubleEcho, cert: &Certificate) { #[case(medium_config())] #[tokio::test] #[trace] +#[cfg(not(feature = "direct"))] async fn trigger_success_path_upon_reaching_threshold(#[case] params: TceParams) { let (mut double_echo, mut ctx) = create_context(params); @@ -175,7 +163,7 @@ async fn trigger_success_path_upon_reaching_threshold(#[case] params: TceParams) .expect("Dummy certificate"); // Trigger Echo upon dispatching - double_echo.handle_broadcast(dummy_cert.clone(), true); + double_echo.broadcast(dummy_cert.clone(), true); assert_eq!(ctx.event_receiver.len(), 3); @@ -224,6 +212,7 @@ async fn trigger_success_path_upon_reaching_threshold(#[case] params: TceParams) #[case(medium_config())] #[tokio::test] #[trace] +#[cfg(not(feature = "direct"))] async fn trigger_ready_when_reached_enough_ready(#[case] params: TceParams) { let (mut double_echo, mut ctx) = create_context(params); @@ -239,7 +228,7 @@ async fn trigger_ready_when_reached_enough_ready(#[case] params: TceParams) { .expect("Dummy certificate"); // Trigger Echo upon dispatching - double_echo.handle_broadcast(dummy_cert.clone(), true); + double_echo.broadcast(dummy_cert.clone(), true); assert_eq!(ctx.event_receiver.len(), 3); assert!(matches!( @@ -271,6 +260,7 @@ async fn trigger_ready_when_reached_enough_ready(#[case] params: TceParams) { #[case(medium_config())] #[tokio::test] #[trace] +#[cfg(not(feature = "direct"))] async fn process_after_delivery_until_sending_ready(#[case] params: TceParams) { let (mut double_echo, mut ctx) = create_context(params); @@ -286,7 +276,7 @@ async fn process_after_delivery_until_sending_ready(#[case] params: TceParams) { .expect("Dummy certificate"); // Trigger Echo upon dispatching - double_echo.handle_broadcast(dummy_cert.clone(), true); + double_echo.broadcast(dummy_cert.clone(), true); assert_eq!(ctx.event_receiver.len(), 3); assert!(matches!( diff --git a/crates/topos-tce-proxy/tests/tce_tests.rs b/crates/topos-tce-proxy/tests/tce_tests.rs index 33f2b09af..1696193dd 100644 --- a/crates/topos-tce-proxy/tests/tce_tests.rs +++ b/crates/topos-tce-proxy/tests/tce_tests.rs @@ -238,6 +238,7 @@ async fn test_tce_get_source_head_certificate( #[rstest] #[test(tokio::test)] +#[ignore = "Broken because of https://github.com/topos-protocol/topos/pull/248"] async fn test_tce_get_last_pending_certificates( #[future] start_node: TceContext, ) -> Result<(), Box> { diff --git a/crates/topos-tce-storage/Cargo.toml b/crates/topos-tce-storage/Cargo.toml index 060d6c263..4747c5db9 100644 --- a/crates/topos-tce-storage/Cargo.toml +++ b/crates/topos-tce-storage/Cargo.toml @@ -6,6 +6,7 @@ edition = "2021" [dependencies] topos-core = { workspace = true, features = ["uci", "api"] } topos-commands = { path = "../topos-commands/" } +topos-metrics = { path = "../topos-metrics/" } async-stream.workspace = true async-trait.workspace = true @@ -16,6 +17,7 @@ thiserror.workspace = true tokio = { workspace = true, features = ["full"] } tokio-stream.workspace = true tracing.workspace = true +lazy_static.workspace = true rocksdb = { version = "0.20.1", optional = true } serde_derive = "1.0.145" diff --git a/crates/topos-tce-storage/src/client.rs b/crates/topos-tce-storage/src/client.rs index 3db3715cd..fd38da1c4 100644 --- a/crates/topos-tce-storage/src/client.rs +++ b/crates/topos-tce-storage/src/client.rs @@ -1,7 +1,9 @@ use tokio::sync::{mpsc, oneshot}; use topos_core::uci::{Certificate, CertificateId, SubnetId, CERTIFICATE_ID_LENGTH}; +use topos_metrics::STORAGE_COMMAND_CHANNEL_CAPACITY_TOTAL; use crate::command::{GetNextPendingCertificate, GetPendingCertificates}; +use crate::constant; use crate::{ command::{ AddPendingCertificate, CertificateDelivered, CheckPendingCertificateExists, @@ -41,6 +43,9 @@ impl StorageClient { &self, certificate_id: CertificateId, ) -> Result<(PendingCertificateId, Certificate), StorageError> { + if self.sender.capacity() <= *constant::COMMAND_CHANNEL_CAPACITY { + STORAGE_COMMAND_CHANNEL_CAPACITY_TOTAL.inc(); + } CheckPendingCertificateExists { certificate_id } .send_to(&self.sender) .await @@ -50,6 +55,9 @@ impl StorageClient { &self, starting_at: Option, ) -> Result, StorageError> { + if self.sender.capacity() <= *constant::COMMAND_CHANNEL_CAPACITY { + STORAGE_COMMAND_CHANNEL_CAPACITY_TOTAL.inc(); + } GetNextPendingCertificate { starting_at } .send_to(&self.sender) .await @@ -61,6 +69,9 @@ impl StorageClient { &self, certificate: Certificate, ) -> Result { + if self.sender.capacity() <= *constant::COMMAND_CHANNEL_CAPACITY { + STORAGE_COMMAND_CHANNEL_CAPACITY_TOTAL.inc(); + } AddPendingCertificate { certificate } .send_to(&self.sender) .await @@ -91,10 +102,14 @@ impl StorageClient { pub async fn certificate_delivered( &self, certificate_id: CertificateId, + certificate: Option, ) -> Result { - CertificateDelivered { certificate_id } - .send_to(&self.sender) - .await + CertificateDelivered { + certificate_id, + certificate, + } + .send_to(&self.sender) + .await } pub async fn fetch_certificates( @@ -121,6 +136,9 @@ impl StorageClient { &self, certificate_id: CertificateId, ) -> Result { + if self.sender.capacity() <= *constant::COMMAND_CHANNEL_CAPACITY { + STORAGE_COMMAND_CHANNEL_CAPACITY_TOTAL.inc(); + } GetCertificate { certificate_id } .send_to(&self.sender) .await diff --git a/crates/topos-tce-storage/src/command.rs b/crates/topos-tce-storage/src/command.rs index 189a728b4..15890ab48 100644 --- a/crates/topos-tce-storage/src/command.rs +++ b/crates/topos-tce-storage/src/command.rs @@ -64,6 +64,7 @@ impl Command for GetNextPendingCertificate { #[derive(Debug)] pub struct CertificateDelivered { pub(crate) certificate_id: CertificateId, + pub(crate) certificate: Option, } impl Command for CertificateDelivered { diff --git a/crates/topos-tce-storage/src/connection.rs b/crates/topos-tce-storage/src/connection.rs index 2ab871548..ddd257346 100644 --- a/crates/topos-tce-storage/src/connection.rs +++ b/crates/topos-tce-storage/src/connection.rs @@ -35,8 +35,6 @@ pub struct Connection { #[allow(dead_code)] events: mpsc::Sender, - certificate_dispatcher: Option>, - pending_certificates: VecDeque, /// Storage shutdown signal receiver @@ -53,7 +51,6 @@ impl Connection { ) { let (sender, queries) = mpsc::channel(1024); let (events, events_stream) = mpsc::channel(1024); - let (certificate_dispatcher, _dispatchable_certificates) = mpsc::channel(10); let (shutdown_channel, shutdown_receiver) = mpsc::channel::>(1); ( @@ -61,7 +58,6 @@ impl Connection { storage_builder: Some(storage), queries, events, - certificate_dispatcher, shutdown_receiver, }, StorageClient::new(sender, shutdown_channel), @@ -97,20 +93,11 @@ impl IntoFuture for Connection { fn into_future(mut self) -> Self::IntoFuture { use crate::connection::StorageCommand::*; async move { - let certificate_dispatcher = self.certificate_dispatcher.take().ok_or( - StorageError::InternalStorage(InternalStorageError::UnableToStartStorage) - )?; - let shutdowned: Option> = loop { tokio::select! { shutdown = self.shutdown.recv() => { break shutdown; }, - Ok(permit) = certificate_dispatcher.reserve(), if !self.pending_certificates.is_empty() => { - - permit.send(self.pending_certificates.pop_front().unwrap()); - }, - Some(command) = self.queries.recv() => { macro_rules! HandleCommands { ($($command_type:ident),+) => { diff --git a/crates/topos-tce-storage/src/connection/builder.rs b/crates/topos-tce-storage/src/connection/builder.rs index 197b1bc41..bbe9fc021 100644 --- a/crates/topos-tce-storage/src/connection/builder.rs +++ b/crates/topos-tce-storage/src/connection/builder.rs @@ -5,8 +5,7 @@ use std::{collections::VecDeque, sync::Arc}; use tokio::sync::{mpsc, oneshot}; use crate::{ - command::StorageCommand, errors::StorageError, events::StorageEvent, Connection, - PendingCertificateId, Storage, + command::StorageCommand, errors::StorageError, events::StorageEvent, Connection, Storage, }; use super::MAX_PENDING_CERTIFICATES; @@ -17,7 +16,6 @@ pub struct ConnectionBuilder { pub(crate) storage_builder: Option>, pub(crate) queries: mpsc::Receiver, pub(crate) events: mpsc::Sender, - pub(crate) certificate_dispatcher: mpsc::Sender, pub(crate) shutdown_receiver: mpsc::Receiver>, } @@ -32,7 +30,6 @@ where storage: Arc::new(storage), queries: self.queries, events: self.events, - certificate_dispatcher: Some(self.certificate_dispatcher), // TODO: Move MAX_PENDING_CERTIFICATES into a configuration option pending_certificates: VecDeque::with_capacity(MAX_PENDING_CERTIFICATES), shutdown: self.shutdown_receiver, diff --git a/crates/topos-tce-storage/src/connection/handlers.rs b/crates/topos-tce-storage/src/connection/handlers.rs index 8821ecb48..7f704f9ce 100644 --- a/crates/topos-tce-storage/src/connection/handlers.rs +++ b/crates/topos-tce-storage/src/connection/handlers.rs @@ -135,12 +135,18 @@ where ) -> Result { let certificate_id = command.certificate_id; - let (pending_certificate_id, certificate) = - self.storage.get_pending_certificate(certificate_id).await?; + let (pending_certificate_id, certificate) = if let Some(certificate) = command.certificate { + (None, certificate) + } else { + self.storage + .get_pending_certificate(certificate_id) + .await + .map(|(id, cert)| (Some(id), cert))? + }; Ok(self .storage - .persist(&certificate, Some(pending_certificate_id)) + .persist(&certificate, pending_certificate_id) .await?) } } diff --git a/crates/topos-tce-storage/src/constant.rs b/crates/topos-tce-storage/src/constant.rs new file mode 100644 index 000000000..7b805bf74 --- /dev/null +++ b/crates/topos-tce-storage/src/constant.rs @@ -0,0 +1,16 @@ +use lazy_static::lazy_static; + +lazy_static! { + pub static ref COMMAND_CHANNEL_SIZE: usize = + std::env::var("TOPOS_STORAGE_COMMAND_CHANNEL_SIZE") + .ok() + .and_then(|s| s.parse().ok()) + .unwrap_or(2048); + pub static ref COMMAND_CHANNEL_CAPACITY: usize = COMMAND_CHANNEL_SIZE + .checked_mul(10) + .map(|v| { + let r: usize = v.checked_div(100).unwrap_or(*COMMAND_CHANNEL_SIZE); + r + }) + .unwrap_or(*COMMAND_CHANNEL_SIZE); +} diff --git a/crates/topos-tce-storage/src/lib.rs b/crates/topos-tce-storage/src/lib.rs index 1b57df9dd..a278d2f7f 100644 --- a/crates/topos-tce-storage/src/lib.rs +++ b/crates/topos-tce-storage/src/lib.rs @@ -8,6 +8,7 @@ use topos_core::uci::{Certificate, CertificateId, SubnetId}; pub mod client; pub(crate) mod command; pub(crate) mod connection; +mod constant; pub mod errors; pub mod events; diff --git a/crates/topos-tce/Cargo.toml b/crates/topos-tce/Cargo.toml index e4baf0d5c..5dfc40472 100644 --- a/crates/topos-tce/Cargo.toml +++ b/crates/topos-tce/Cargo.toml @@ -10,15 +10,17 @@ async-trait.workspace = true bincode.workspace = true clap.workspace = true futures.workspace = true +opentelemetry.workspace = true +prometheus-client.workspace = true +prometheus.workspace = true serde.workspace = true thiserror.workspace = true tokio.workspace = true topos-core.workspace = true -tracing-subscriber = { workspace = true, default-features = false, features = ["std", "env-filter", "fmt", "ansi"] } -tracing.workspace = true -opentelemetry.workspace = true tracing-attributes.workspace = true tracing-opentelemetry.workspace = true +tracing-subscriber = { workspace = true, default-features = false, features = ["std", "env-filter", "fmt", "ansi"] } +tracing.workspace = true tce_transport = { package = "topos-tce-transport", path = "../topos-tce-transport" } topos-p2p = { path = "../topos-p2p" } @@ -31,7 +33,6 @@ topos-tce-synchronizer = { path = "../topos-tce-synchronizer" } topos-telemetry = { path = "../topos-telemetry" } axum = "0.6.18" axum-prometheus = "0.3.3" -prometheus = "0.13.3" [dev-dependencies] async-stream.workspace = true diff --git a/crates/topos-tce/src/app_context.rs b/crates/topos-tce/src/app_context.rs index dbd7a15d9..e1df61de5 100644 --- a/crates/topos-tce/src/app_context.rs +++ b/crates/topos-tce/src/app_context.rs @@ -4,14 +4,13 @@ //! use futures::{Stream, StreamExt}; use opentelemetry::trace::{FutureExt as TraceFutureExt, TraceContextExt}; -use serde::{Deserialize, Serialize}; use std::collections::HashMap; use tce_transport::{ProtocolEvents, TceCommands}; use tokio::spawn; use tokio::sync::{mpsc, oneshot}; use topos_core::api::grpc::checkpoints::TargetStreamPosition; use topos_core::uci::{Certificate, CertificateId, SubnetId}; -use topos_metrics::CERTIFICATE_DELIVERED; +use topos_metrics::CERTIFICATE_DELIVERED_TOTAL; use topos_p2p::{Client as NetworkClient, Event as NetEvent}; use topos_tce_api::RuntimeEvent as ApiEvent; use topos_tce_api::{RuntimeClient as ApiClient, RuntimeError}; @@ -27,6 +26,7 @@ use tracing::{debug, error, info, info_span, trace, warn, Instrument}; use tracing_opentelemetry::OpenTelemetrySpanExt; use crate::events::Events; +use crate::NetworkMessage; /// Top-level transducer main app context & driver (alike) /// @@ -270,14 +270,17 @@ impl AppContext { ProtocolEvents::CertificateDelivered { certificate } => { warn!("Certificate delivered {}", certificate.id); - CERTIFICATE_DELIVERED.inc(); + CERTIFICATE_DELIVERED_TOTAL.inc(); let storage = self.pending_storage.clone(); let api_client = self.api_client.clone(); + let certificate_id = certificate.id; spawn(async move { - match storage.certificate_delivered(certificate.id).await { + match storage + .certificate_delivered(certificate_id, Some(certificate.clone())) + .await + { Ok(positions) => { - let certificate_id = certificate.id; api_client .dispatch_certificate( certificate, @@ -307,7 +310,12 @@ impl AppContext { } Err(StorageError::InternalStorage( InternalStorageError::CertificateNotFound(_), - )) => {} + )) => { + error!( + "Certificate {} not found in pending storage", + certificate_id + ); + } Err(e) => { error!("Pending storage error while delivering certificate: {e}"); } @@ -329,6 +337,7 @@ impl AppContext { ctx: PropagationContext::inject(&span.context()), }); + info!("Sending Gossip for certificate {}", cert_id); if let Err(e) = self .network_client .publish::(topos_p2p::TOPOS_GOSSIP, data) @@ -511,37 +520,3 @@ impl AppContext { Ok(()) } } - -/// Definition of networking payload. -/// -/// We assume that only Commands will go through the network, -/// [Response] is used to allow reporting of logic errors to the caller. -#[derive(Debug, Clone, Serialize, Deserialize)] -#[allow(clippy::large_enum_variant)] -enum NetworkMessage { - Cmd(TceCommands), - Bulk(Vec), - - NotReady(topos_p2p::NotReadyMessage), -} - -// deserializer -impl From> for NetworkMessage { - fn from(data: Vec) -> Self { - bincode::deserialize::(data.as_ref()).expect("msg deser") - } -} - -// serializer -impl From for Vec { - fn from(msg: NetworkMessage) -> Self { - bincode::serialize::(&msg).expect("msg ser") - } -} - -// transformer of protocol commands into network commands -impl From for NetworkMessage { - fn from(cmd: TceCommands) -> Self { - Self::Cmd(cmd) - } -} diff --git a/crates/topos-tce/src/lib.rs b/crates/topos-tce/src/lib.rs index 2c7fd0ae2..f2ede934b 100644 --- a/crates/topos-tce/src/lib.rs +++ b/crates/topos-tce/src/lib.rs @@ -7,7 +7,8 @@ use std::time::Duration; pub use app_context::AppContext; use opentelemetry::global; -use tce_transport::ReliableBroadcastParams; +use serde::{Deserialize, Serialize}; +use tce_transport::{ReliableBroadcastParams, TceCommands}; use tokio::{spawn, sync::mpsc, sync::oneshot}; use topos_p2p::utils::local_key_pair_from_slice; use topos_p2p::{utils::local_key_pair, Multiaddr, PeerId}; @@ -43,6 +44,7 @@ pub async fn run( config: &TceConfiguration, shutdown: mpsc::Receiver>, ) -> Result<(), Box> { + topos_metrics::init_metrics(); let key = config .local_key_seed .as_ref() @@ -105,7 +107,6 @@ pub async fn run( }, peer_id.to_string(), storage_client.clone(), - network_client.clone(), ) .await; debug!("Reliable broadcast started"); @@ -121,7 +122,7 @@ pub async fn run( debug!("Synchronizer started"); debug!("Starting gRPC api"); - let (api_client, api_stream) = topos_tce_api::Runtime::builder() + let (api_client, api_stream, _ctx) = topos_tce_api::Runtime::builder() .with_peer_id(peer_id.to_string()) .serve_grpc_addr(config.api_addr) .serve_graphql_addr(config.graphql_api_addr) @@ -155,3 +156,37 @@ pub async fn run( global::shutdown_tracer_provider(); Ok(()) } + +/// Definition of networking payload. +/// +/// We assume that only Commands will go through the network, +/// [Response] is used to allow reporting of logic errors to the caller. +#[derive(Debug, Clone, Serialize, Deserialize)] +#[allow(clippy::large_enum_variant)] +pub enum NetworkMessage { + Cmd(TceCommands), + Bulk(Vec), + + NotReady(topos_p2p::NotReadyMessage), +} + +// deserializer +impl From> for NetworkMessage { + fn from(data: Vec) -> Self { + bincode::deserialize::(data.as_ref()).expect("msg deser") + } +} + +// serializer +impl From for Vec { + fn from(msg: NetworkMessage) -> Self { + bincode::serialize::(&msg).expect("msg ser") + } +} + +// transformer of protocol commands into network commands +impl From for NetworkMessage { + fn from(cmd: TceCommands) -> Self { + Self::Cmd(cmd) + } +} diff --git a/crates/topos-test-sdk/Cargo.toml b/crates/topos-test-sdk/Cargo.toml index 2503f0644..59dc968df 100644 --- a/crates/topos-test-sdk/Cargo.toml +++ b/crates/topos-test-sdk/Cargo.toml @@ -16,6 +16,7 @@ topos-tce-broadcast = { path = "../topos-tce-broadcast/", optional = true } topos-tce-transport = { path = "../topos-tce-transport/", optional = true } futures.workspace = true +lazy_static = { version = "1.4.0" } libp2p.workspace = true proc_macro_sdk = { path = "./proc_macro_sdk/" } rand.workspace = true diff --git a/crates/topos-test-sdk/src/lib.rs b/crates/topos-test-sdk/src/lib.rs index 50adadecb..cc06d308f 100644 --- a/crates/topos-test-sdk/src/lib.rs +++ b/crates/topos-test-sdk/src/lib.rs @@ -8,6 +8,14 @@ pub mod p2p; pub mod sequencer; pub mod storage; +use std::{collections::HashSet, net::SocketAddr, sync::Mutex}; + +use lazy_static::lazy_static; + +lazy_static! { + pub static ref PORT_MAPPING: Mutex> = Mutex::new(HashSet::new()); +} + pub mod constants { use proc_macro_sdk::generate_certificate_ids; use proc_macro_sdk::generate_source_subnet_ids; @@ -45,3 +53,42 @@ macro_rules! wait_for_event { } }; } + +pub fn get_available_port() -> u16 { + get_available_addr().port() +} +pub fn get_available_addr() -> SocketAddr { + let mut port_mapping = PORT_MAPPING.lock().unwrap(); + + let mut addr = None; + for _ in 0..10 { + let new_addr = next_available_port(); + if port_mapping.insert(new_addr.port()) { + addr = Some(new_addr); + break; + } + } + + assert!(addr.is_some(), "Can't find an available port"); + addr.unwrap() +} + +fn next_available_port() -> SocketAddr { + // let socket = UdpSocket::bind("127.0.0.1:0").expect("Can't find an available port"); + // socket.local_addr().unwrap() + // + use std::net::{TcpListener, TcpStream}; + + let host = "127.0.0.1"; + // Request a random available port from the OS + let listener = TcpListener::bind((host, 0)).expect("Can't bind to an available port"); + let addr = listener.local_addr().expect("Can't find an available port"); + + // Create and accept a connection (which we'll promptly drop) in order to force the port + // into the TIME_WAIT state, ensuring that the port will be reserved from some limited + // amount of time (roughly 60s on some Linux systems) + let _sender = TcpStream::connect(addr).expect("Can't connect to an available port"); + let _incoming = listener.accept().expect("Can't accept an available port"); + + addr +} diff --git a/crates/topos-test-sdk/src/tce/mod.rs b/crates/topos-test-sdk/src/tce/mod.rs index c80ff7c89..84e6e1ed9 100644 --- a/crates/topos-test-sdk/src/tce/mod.rs +++ b/crates/topos-test-sdk/src/tce/mod.rs @@ -20,7 +20,8 @@ use topos_core::uci::Certificate; use topos_core::uci::SubnetId; use topos_p2p::{error::P2PError, Client, Event, Runtime}; use topos_tce::{events::Events, AppContext}; -use tracing::info; +use topos_tce_api::RuntimeContext; +use tracing::{info, warn}; use crate::p2p::local_peer; use crate::storage::create_rocksdb; @@ -44,6 +45,7 @@ pub struct TceContext { pub peer_id: PeerId, // P2P ID pub api_entrypoint: String, pub api_grpc_client: ApiServiceClient, // GRPC Client for this peer (tce node) + pub api_context: Option, pub console_grpc_client: ConsoleServiceClient, // Console TCE GRPC Client for this peer (tce node) pub runtime_join_handle: JoinHandle>, pub app_join_handle: JoinHandle<()>, @@ -54,6 +56,16 @@ pub struct TceContext { pub shutdown_sender: mpsc::Sender>, } +impl Drop for TceContext { + fn drop(&mut self) { + self.app_join_handle.abort(); + self.runtime_join_handle.abort(); + self.storage_join_handle.abort(); + self.gatekeeper_join_handle.abort(); + self.synchronizer_join_handle.abort(); + } +} + impl TceContext { pub async fn shutdown(self) -> Result<(), Box> { info!("Context performing shutdown..."); @@ -70,12 +82,13 @@ impl TceContext { } } -#[derive(Clone)] +#[derive(Debug, Clone)] pub struct NodeConfig { pub seed: u8, pub port: u16, pub keypair: Keypair, pub addr: Multiaddr, + pub minimum_cluster_size: usize, } impl Default for NodeConfig { @@ -93,9 +106,14 @@ impl NodeConfig { port, keypair, addr, + minimum_cluster_size: 1, } } + pub fn peer_id(&self) -> PeerId { + self.keypair.public().to_peer_id() + } + pub async fn bootstrap( &self, peers: &[NodeConfig], @@ -107,14 +125,28 @@ impl NodeConfig { ), Box, > { - bootstrap_network(self.seed, self.port, self.addr.clone(), peers, 2).await + bootstrap_network( + self.seed, + self.port, + self.addr.clone(), + peers, + self.minimum_cluster_size, + ) + .await } pub async fn create( &self, peers: &[NodeConfig], ) -> Result<(Client, impl Stream, Runtime), P2PError> { - create_network_worker(self.seed, self.port, self.addr.clone(), peers, 2).await + create_network_worker( + self.seed, + self.port, + self.addr.clone(), + peers, + self.minimum_cluster_size, + ) + .await } } @@ -127,10 +159,15 @@ pub async fn start_node( let peer_id = config.keypair.public().to_peer_id(); let peer_id_str = peer_id.to_base58(); - let (network_client, network_stream, runtime_join_handle) = - bootstrap_network(config.seed, config.port, config.addr.clone(), peers, 1) - .await - .expect("Unable to bootstrap tce network"); + let (network_client, network_stream, runtime_join_handle) = bootstrap_network( + config.seed, + config.port, + config.addr.clone(), + peers, + config.minimum_cluster_size, + ) + .await + .expect("Unable to bootstrap tce network"); let (_, (storage, storage_client, storage_stream)) = create_rocksdb(&peer_id_str, certificates).await; @@ -141,7 +178,6 @@ pub async fn start_node( create_reliable_broadcast_params(peers.len()), config.keypair.public().to_peer_id().to_string(), storage_client.clone(), - network_client.clone(), ) .await; @@ -179,6 +215,7 @@ pub async fn start_node( peer_id, api_entrypoint: api_context.entrypoint, api_grpc_client: api_context.api_client, + api_context: api_context.api_context, console_grpc_client: api_context.console_client, runtime_join_handle, app_join_handle, @@ -191,7 +228,14 @@ pub async fn start_node( } fn build_peer_config_pool(peer_number: u8) -> Vec { - (1..=peer_number).map(NodeConfig::from_seed).collect() + (1..=peer_number) + .map(NodeConfig::from_seed) + .map(|mut c| { + c.minimum_cluster_size = peer_number as usize / 2; + + c + }) + .collect() } pub async fn start_pool(peer_number: u8) -> HashMap { @@ -222,6 +266,7 @@ pub async fn create_network(peer_number: usize) -> HashMap { let mut peers_context = start_pool(peer_number as u8).await; let all_peers: Vec = peers_context.keys().cloned().collect(); + warn!("Pool created, waiting for peers to connect..."); // Force TCE nodes to recreate subscriptions and subscribers let mut await_peers = Vec::new(); for (peer_id, client) in peers_context.iter_mut() { @@ -245,6 +290,7 @@ pub async fn create_network(peer_number: usize) -> HashMap { } assert!(!join_all(await_peers).await.iter().any(|res| res.is_err())); + warn!("Peers connected"); for (peer_id, client) in peers_context.iter_mut() { wait_for_event!( @@ -255,6 +301,8 @@ pub async fn create_network(peer_number: usize) -> HashMap { ); } + warn!("Stable sample received"); + // Waiting for new network view let mut await_peers = Vec::new(); for (_peer_id, client) in peers_context.iter_mut() { @@ -268,5 +316,6 @@ pub async fn create_network(peer_number: usize) -> HashMap { .map(|r: tonic::Response<_>| r.into_inner().has_active_sample)) .any(|r| r.is_err() || !r.unwrap())); + warn!("GRPC status received and ok"); peers_context } diff --git a/crates/topos-test-sdk/src/tce/p2p.rs b/crates/topos-test-sdk/src/tce/p2p.rs index 23a8c456c..014f28db7 100644 --- a/crates/topos-test-sdk/src/tce/p2p.rs +++ b/crates/topos-test-sdk/src/tce/p2p.rs @@ -64,6 +64,5 @@ pub async fn bootstrap_network( let runtime = runtime.bootstrap().await?; let runtime_join_handle = spawn(runtime.run()); - Ok((network_client, network_stream, runtime_join_handle)) } diff --git a/crates/topos-test-sdk/src/tce/protocol.rs b/crates/topos-test-sdk/src/tce/protocol.rs index b7313c141..c60f63a7d 100644 --- a/crates/topos-test-sdk/src/tce/protocol.rs +++ b/crates/topos-test-sdk/src/tce/protocol.rs @@ -7,14 +7,13 @@ pub async fn create_reliable_broadcast_client( tce_params: ReliableBroadcastParams, peer_id: String, storage: topos_tce_storage::StorageClient, - network: topos_p2p::Client, ) -> ( ReliableBroadcastClient, impl Stream> + Unpin, ) { let config = ReliableBroadcastConfig { tce_params }; - ReliableBroadcastClient::new(config, peer_id, storage, network).await + ReliableBroadcastClient::new(config, peer_id, storage).await } pub fn create_reliable_broadcast_params(number_of_nodes: usize) -> ReliableBroadcastParams { diff --git a/crates/topos-test-sdk/src/tce/public_api.rs b/crates/topos-test-sdk/src/tce/public_api.rs index 989237a31..d4c462f2d 100644 --- a/crates/topos-test-sdk/src/tce/public_api.rs +++ b/crates/topos-test-sdk/src/tce/public_api.rs @@ -8,17 +8,21 @@ use topos_core::api::grpc::tce::v1::{ api_service_client::ApiServiceClient, console_service_client::ConsoleServiceClient, }; use topos_tce_api::RuntimeClient; +use topos_tce_api::RuntimeContext; use topos_tce_api::RuntimeEvent; use topos_tce_storage::StorageClient; +use tracing::warn; use crate::networking::get_available_addr; use crate::storage::storage_client; +use crate::PORT_MAPPING; pub struct PublicApiContext { pub entrypoint: String, pub client: RuntimeClient, pub api_client: ApiServiceClient, pub console_client: ConsoleServiceClient, + pub api_context: Option, } #[fixture] @@ -26,7 +30,6 @@ pub async fn create_public_api( #[future] storage_client: StorageClient, ) -> (PublicApiContext, impl Stream) { let storage_client = storage_client.await; - let grpc_addr = get_available_addr(); let graphql_addr = get_available_addr(); let metrics_addr = get_available_addr(); @@ -34,7 +37,12 @@ pub async fn create_public_api( let api_port = grpc_addr.port(); let api_endpoint = format!("http://0.0.0.0:{api_port}"); - let (client, stream) = topos_tce_api::Runtime::builder() + warn!("API endpoint: {}", api_endpoint); + warn!("gRPC endpoint: {}", grpc_addr); + warn!("GraphQL endpoint: {}", graphql_addr); + warn!("Metrics endpoint: {}", metrics_addr); + warn!("PORT MAPPING: {:?}", PORT_MAPPING.lock().unwrap()); + let (client, stream, ctx) = topos_tce_api::Runtime::builder() .serve_grpc_addr(grpc_addr) .serve_graphql_addr(graphql_addr) .serve_metrics_addr(metrics_addr) @@ -58,6 +66,7 @@ pub async fn create_public_api( client, api_client, console_client, + api_context: Some(ctx), }; (context, stream) diff --git a/crates/topos/src/components/network/commands/spam.rs b/crates/topos/src/components/network/commands/spam.rs index 4955695fc..3e7f5a871 100644 --- a/crates/topos/src/components/network/commands/spam.rs +++ b/crates/topos/src/components/network/commands/spam.rs @@ -32,7 +32,7 @@ pub struct Spam { env = "TOPOS_NETWORK_SPAMMER_CERT_PER_BATCH", default_value = "1" )] - pub cert_per_batch: u8, + pub cert_per_batch: u64, /// Number of subnets to use for certificate generation. For every certificate subnet id will be picked randomly. #[arg( long, diff --git a/crates/topos/tests/cert_delivery.rs b/crates/topos/tests/cert_delivery.rs index b7e51b296..a2b1ce504 100644 --- a/crates/topos/tests/cert_delivery.rs +++ b/crates/topos/tests/cert_delivery.rs @@ -19,7 +19,7 @@ use topos_core::{ uci::{Certificate, SubnetId, SUBNET_ID_LENGTH}, }; use topos_test_sdk::{certificates::create_certificate_chains, tce::create_network}; -use tracing::{debug, info}; +use tracing::{debug, info, warn}; const NUMBER_OF_SUBNETS_PER_CLIENT: usize = 1; @@ -37,7 +37,7 @@ fn get_subset_of_subnets(subnets: &[SubnetId], subset_size: usize) -> Vec = Vec::new(); @@ -56,7 +56,7 @@ async fn start_a_cluster() { #[rstest] #[tokio::test] -#[timeout(Duration::from_secs(60))] +#[timeout(Duration::from_secs(30))] // FIXME: This test is flaky, it fails sometimes because of gRPC connection error (StreamClosed) async fn cert_delivery() { let subscriber = tracing_subscriber::FmtSubscriber::builder() @@ -65,7 +65,7 @@ async fn cert_delivery() { .finish(); let _ = tracing::subscriber::set_global_default(subscriber); - let peer_number = 15; + let peer_number = 5; let number_of_certificates_per_subnet = 2; let number_of_subnets = 3; @@ -94,9 +94,12 @@ async fn cert_delivery() { } } } + + warn!("Starting the cluster..."); // List of peers (tce nodes) with their context let mut peers_context = create_network(peer_number).await; + warn!("Cluster started, starting clients..."); // Connected tce clients are passing received certificates to this mpsc::Receiver, collect all of them let mut clients_delivered_certificates: Vec> = Vec::new(); // (Peer Id, Subnet Id, Certificate) diff --git a/crates/topos/tests/push-certificate.rs b/crates/topos/tests/push-certificate.rs index 5a17824c5..bf8362280 100644 --- a/crates/topos/tests/push-certificate.rs +++ b/crates/topos/tests/push-certificate.rs @@ -4,6 +4,7 @@ use std::{thread, time::Duration}; use assert_cmd::Command; +use rstest::*; use topos_core::api::grpc::tce::v1::StatusRequest; use topos_test_sdk::tce::create_network; @@ -21,10 +22,12 @@ fn help_display() -> Result<(), Box> { Ok(()) } +#[rstest] #[test_log::test(tokio::test)] +#[timeout(Duration::from_secs(20))] // FIXME: This test is flaky, it fails sometimes because of sample failure async fn assert_delivery() -> Result<(), Box> { - let mut peers_context = create_network(10).await; + let mut peers_context = create_network(5).await; let mut status: Vec = Vec::new(); diff --git a/tools/config/prometheus/prometheus.yml b/tools/config/prometheus/prometheus.yml index d0802a512..f8d00d5de 100644 --- a/tools/config/prometheus/prometheus.yml +++ b/tools/config/prometheus/prometheus.yml @@ -36,10 +36,33 @@ scrape_configs: static_configs: - targets: ["localhost:9090"] - - job_name: "cadvisor" + + - job_name: "peers" # Override the global default and scrape targets from this job every 5 seconds. scrape_interval: 5s static_configs: - - targets: ["cadvisor:8080"] + - targets: [ + 'boot:3000', + 'tools-peer-1:3000', + 'tools-peer-2:3000', + 'tools-peer-3:3000', + 'tools-peer-4:3000', + 'tools-peer-5:3000', + 'tools-peer-6:3000', + 'tools-peer-7:3000', + 'tools-peer-8:3000', + 'tools-peer-9:3000', + 'tools-peer-10:3000', + 'tools-peer-11:3000', + 'tools-peer-12:3000', + 'tools-peer-13:3000', + 'tools-peer-14:3000', + ] + metric_relabel_configs: + - source_labels: ["instance"] + regex: ".*((boot|peer)[^:]*).*" + target_label: "job" + replacement: "$1" + diff --git a/tools/dashboard.json b/tools/dashboard.json new file mode 100644 index 000000000..dca8cfcd7 --- /dev/null +++ b/tools/dashboard.json @@ -0,0 +1,2503 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": 2, + "links": [], + "liveNow": false, + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 12, + "w": 4, + "x": 0, + "y": 0 + }, + "id": 25, + "options": { + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "10.0.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(topos_certificate_received_from_api_total{job=~\"$peer\"})", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "Certificate created", + "type": "gauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 12, + "w": 4, + "x": 4, + "y": 0 + }, + "id": 24, + "options": { + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "10.0.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(topos_certificate_delivered_total{job=~\"$peer\"})", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "Certificate delivered", + "type": "gauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "max": 100, + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "dark-red", + "value": null + }, + { + "color": "orange", + "value": 80 + }, + { + "color": "green", + "value": 100 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 12, + "w": 4, + "x": 8, + "y": 0 + }, + "id": 26, + "options": { + "orientation": "auto", + "reduceOptions": { + "calcs": [], + "fields": "/^Delivery$/", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": false + }, + "pluginVersion": "10.0.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(topos_certificate_received_from_api_total{job=~\"$peer\"})", + "hide": true, + "legendFormat": "__auto", + "range": true, + "refId": "A" + }, + { + "datasource": { + "name": "Expression", + "type": "__expr__", + "uid": "__expr__" + }, + "expression": "100 * ($B ) / ($A * 15) ", + "hide": false, + "refId": "Delivery", + "type": "math" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(topos_certificate_delivered_total{job=~\"$peer\"})", + "hide": true, + "legendFormat": "__auto", + "range": true, + "refId": "B" + } + ], + "title": "Full Delivery", + "type": "gauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 12, + "w": 12, + "x": 12, + "y": 0 + }, + "id": 9, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "topos_certificate_received_from_api_total{job=~\"$peer\"}", + "hide": true, + "legendFormat": "API {{job}}", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "topos_certificate_received_from_gossip_total{job=~\"$peer\"}", + "hide": false, + "legendFormat": "Gossip {{job}}", + "range": true, + "refId": "B" + } + ], + "title": "Certificate reception", + "type": "timeseries" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 12 + }, + "id": 32, + "panels": [], + "title": "Misc", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "description": "Latency between rounds", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 13 + }, + "id": 30, + "interval": "4", + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum by(hash) (increase(topos_libp2p_gossipsub_topic_msg_recv_counts_total{hash=\"topos_gossip\", job=~\"$peer\"}[$__rate_interval]))", + "legendFormat": "Gossip received", + "range": true, + "refId": "Gossip received" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum by(hash) (increase(topos_libp2p_gossipsub_topic_msg_published_total{hash=\"topos_echo\", job=~\"$peer\"}[$__rate_interval]))", + "hide": false, + "legendFormat": "Echo published", + "range": true, + "refId": "Echo published" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum by(hash) (increase(topos_libp2p_gossipsub_topic_iwant_msgs_total{hash=\"topos_gossip\", job=~\"$peer\"}[$__rate_interval]))", + "hide": false, + "legendFormat": "IWANT Gossip", + "range": true, + "refId": "A" + } + ], + "title": "Gossip received vs. Echo published", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "description": "Measure the redundancy", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byFrameRefID", + "options": "Ratio" + }, + "properties": [ + { + "id": "custom.axisPlacement", + "value": "right" + }, + { + "id": "custom.scaleDistribution", + "value": { + "log": 10, + "type": "log" + } + }, + { + "id": "custom.lineStyle", + "value": { + "dash": [ + 0, + 10 + ], + "fill": "dot" + } + }, + { + "id": "custom.lineWidth", + "value": 4 + } + ] + } + ] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 13 + }, + "id": 29, + "interval": "4", + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum by(instance) (avg by(hash) (topos_libp2p_gossipsub_topic_msg_recv_counts_total{job=~\"$peer\"}))", + "hide": false, + "legendFormat": "Filtered", + "range": true, + "refId": "filtered" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum by(instance) (avg by(hash) (topos_libp2p_gossipsub_topic_msg_recv_counts_unfiltered_total{job=~\"$peer\"}))", + "hide": false, + "legendFormat": "Unfiltered", + "range": true, + "refId": "unfiltered" + }, + { + "datasource": { + "name": "Expression", + "type": "__expr__", + "uid": "__expr__" + }, + "expression": "$unfiltered / $filtered", + "hide": false, + "refId": "Ratio", + "type": "math" + } + ], + "title": "Ratio payload recv unfiltered vs. filtered", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "description": "Latency between rounds", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 21 + }, + "id": 31, + "interval": "4", + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum by(hash) (increase(topos_libp2p_gossipsub_topic_msg_recv_counts_total{hash=\"topos_echo\", job=~\"$peer\"}[$__rate_interval]))", + "legendFormat": "Echo received", + "range": true, + "refId": "Gossip received" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum by(hash) (increase(topos_libp2p_gossipsub_topic_msg_published_total{hash=\"topos_ready\", job=~\"$peer\"}[$__rate_interval]))", + "hide": false, + "legendFormat": "Ready published", + "range": true, + "refId": "Echo published" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum by(hash) (increase(topos_libp2p_gossipsub_topic_iwant_msgs_total{hash=\"topos_echo\", job=~\"$peer\"}[$__rate_interval]))", + "hide": false, + "legendFormat": "IWANT Echo", + "range": true, + "refId": "A" + } + ], + "title": "Echo received vs. Ready published", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "continuous-GrYlRd" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 16, + "w": 12, + "x": 12, + "y": 21 + }, + "id": 27, + "options": { + "displayMode": "basic", + "minVizHeight": 10, + "minVizWidth": 0, + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showUnfilled": true, + "valueMode": "color" + }, + "pluginVersion": "10.0.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "topos_certificate_delivered_total{job=~\"$peer\"}", + "legendFormat": "{{job}}", + "range": true, + "refId": "A" + } + ], + "title": "Certificate delivered per peer", + "type": "bargauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "description": "Latency between rounds", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byFrameRefID", + "options": "Missing delivery" + }, + "properties": [ + { + "id": "custom.axisPlacement", + "value": "right" + }, + { + "id": "custom.drawStyle", + "value": "line" + }, + { + "id": "custom.lineStyle", + "value": { + "dash": [ + 0, + 10 + ], + "fill": "dot" + } + }, + { + "id": "custom.lineWidth", + "value": 3 + } + ] + } + ] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 29 + }, + "id": 33, + "interval": "4", + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum by(hash) (increase(topos_libp2p_gossipsub_topic_msg_recv_counts_total{hash=\"topos_ready\", job=~\"$peer\"}[$__rate_interval]))", + "legendFormat": "Ready received", + "range": true, + "refId": "Ready received" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum by(hash) (increase(topos_libp2p_gossipsub_topic_msg_published_total{hash=\"topos_ready\", job=~\"$peer\"}[$__rate_interval]))", + "hide": false, + "legendFormat": "Ready published", + "range": true, + "refId": "Ready published" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum by(hash) (increase(topos_libp2p_gossipsub_topic_iwant_msgs_total{hash=\"topos_ready\", job=~\"$peer\"}[$__rate_interval]))", + "hide": false, + "legendFormat": "IWANT Ready", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(topos_certificate_received_from_api_total{job=~\"$peer\"})", + "hide": true, + "legendFormat": "__auto", + "range": true, + "refId": "total_cert" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "builder", + "expr": "avg(topos_certificate_delivered_total)", + "hide": true, + "legendFormat": "__auto", + "range": true, + "refId": "cert_delivered" + }, + { + "datasource": { + "name": "Expression", + "type": "__expr__", + "uid": "__expr__" + }, + "expression": "$total_cert - $cert_delivered", + "hide": false, + "refId": "Missing delivery", + "type": "math" + } + ], + "title": "Ready received vs. Ready published vs. Delivered certificate", + "type": "timeseries" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 37 + }, + "id": 19, + "panels": [], + "title": "P2P - Gossip protocol", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 38 + }, + "id": 20, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "irate(topos_libp2p_gossipsub_topic_iwant_msgs_total{ job=~\"$peer\"}[$__interval])", + "legendFormat": "IWANT {{hash}} - {{job}}", + "range": true, + "refId": "A" + } + ], + "title": "IWANT msg", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 38 + }, + "id": 21, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "irate(topos_libp2p_gossipsub_topic_msg_recv_counts_total{ job=~\"$peer\"}[$__interval])", + "legendFormat": "{{hash}} {{job}}", + "range": true, + "refId": "A" + } + ], + "title": "MSG recv filtered", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 46 + }, + "id": 22, + "options": { + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "10.0.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum by(hash) (topos_libp2p_gossipsub_topic_msg_recv_counts_total{ job=~\"$peer\"})", + "legendFormat": "{{hash}} ", + "range": true, + "refId": "A" + } + ], + "title": "MSG recv total per topic", + "type": "gauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "fillOpacity": 80, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineWidth": 1, + "scaleDistribution": { + "type": "linear" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 46 + }, + "id": 23, + "options": { + "barRadius": 0, + "barWidth": 0.97, + "fullHighlight": false, + "groupWidth": 0.7, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "orientation": "auto", + "showValue": "auto", + "stacking": "none", + "tooltip": { + "mode": "single", + "sort": "none" + }, + "xTickLabelRotation": 0, + "xTickLabelSpacing": 0 + }, + "pluginVersion": "9.5.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": false, + "expr": "max by(hash, job) (topos_libp2p_gossipsub_topic_msg_sent_counts_total{ job=~\"$peer\"})", + "format": "heatmap", + "instant": true, + "legendFormat": "{{job}} {{hash}}", + "range": false, + "refId": "A" + } + ], + "title": "MSG sent total per topic", + "type": "barchart" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 54 + }, + "id": 15, + "panels": [], + "title": "Storage layer", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 55 + }, + "id": 16, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "irate(topos_storage_command_channel_capacity_total{ job=~\"$peer\"}[$__interval])", + "legendFormat": "{{job}}", + "range": true, + "refId": "A" + } + ], + "title": "Command channel at capacity", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 55 + }, + "id": 17, + "options": { + "displayMode": "gradient", + "minVizHeight": 10, + "minVizWidth": 0, + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showUnfilled": true, + "valueMode": "color" + }, + "pluginVersion": "10.0.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(increase(topos_storage_pending_certificate_existance_latency_bucket{ job=~\"$peer\"}[$__range])) by (le)", + "format": "heatmap", + "legendFormat": "{{le}}", + "range": true, + "refId": "A" + } + ], + "title": "Pending existance latency", + "type": "bargauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 63 + }, + "id": 18, + "options": { + "displayMode": "gradient", + "minVizHeight": 10, + "minVizWidth": 0, + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showUnfilled": true, + "valueMode": "color" + }, + "pluginVersion": "10.0.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(increase(topos_storage_adding_pending_certificate_latency_bucket{ job=~\"$peer\"}[$__range])) by (le)", + "format": "heatmap", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "Adding to pending latency", + "type": "bargauge" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 71 + }, + "id": 11, + "panels": [], + "title": "P2P layer", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 12, + "w": 12, + "x": 0, + "y": 72 + }, + "id": 3, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "irate(topos_p2p_event_stream_capacity_total{ job=~\"$peer\"}[$__interval])", + "legendFormat": "{{job}}", + "range": true, + "refId": "A" + } + ], + "title": "P2P Channel at capacity", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 12, + "w": 12, + "x": 12, + "y": 72 + }, + "id": 2, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "irate(topos_p2p_echo_message_total{ job=~\"$peer\"}[$__interval])", + "legendFormat": "Echo {{job}}", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "irate(topos_p2p_ready_message_total{ job=~\"$peer\"}[$__interval])", + "hide": false, + "legendFormat": "Ready {{job}}", + "range": true, + "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "irate(topos_p2p_gossip_message_total{ job=~\"$peer\"}[$__interval])", + "hide": false, + "legendFormat": "Gossip {{job}}", + "range": true, + "refId": "C" + } + ], + "title": "Message received", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 12, + "w": 12, + "x": 0, + "y": 84 + }, + "id": 1, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(topos_p2p_gossipsub_message_sent_total{ job=~\"$peer\"})", + "legendFormat": "{{job}}", + "range": true, + "refId": "A" + } + ], + "title": "Gossip message sent", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 12, + "w": 12, + "x": 12, + "y": 84 + }, + "id": 7, + "options": { + "displayMode": "gradient", + "minVizHeight": 10, + "minVizWidth": 0, + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showUnfilled": true, + "valueMode": "color" + }, + "pluginVersion": "10.0.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": false, + "expr": "sum(increase(topos_p2p_gossip_batch_size_bucket{ job=~\"$peer\"}[$__range])) by (le)", + "format": "heatmap", + "instant": false, + "legendFormat": "{{le}}", + "range": true, + "refId": "A" + } + ], + "title": "Gossip message sent", + "type": "bargauge" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 96 + }, + "id": 12, + "panels": [], + "title": "Double Echo - external", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 97 + }, + "id": 13, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "irate(topos_double_echo_command_channel_capacity_total{ job=~\"$peer\"}[$__interval])", + "legendFormat": "{{job}}", + "range": true, + "refId": "A" + } + ], + "title": "Command channel capacity", + "type": "timeseries" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 105 + }, + "id": 10, + "panels": [], + "title": "Double Echo - internal", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 106 + }, + "id": 4, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "topos_double_echo_current_buffer_size{ job=~\"$peer\"}", + "hide": false, + "legendFormat": "{{job}}", + "range": true, + "refId": "B" + } + ], + "title": "Double echo - Buffer size", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 106 + }, + "id": 5, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "irate(topos_double_echo_buffer_capacity_total{ job=~\"$peer\"}[$__interval])", + "legendFormat": "{{job}}", + "range": true, + "refId": "A" + } + ], + "title": "Double Echo Buffer at capacity", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 114 + }, + "id": 6, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "topos_double_echo_buffered_message_count{ job=~\"$peer\"}", + "hide": false, + "legendFormat": "{{job}}", + "range": true, + "refId": "B" + } + ], + "title": "Double echo - Buffered messages", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 114 + }, + "id": 8, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "topos_double_echo_current_buffer_size{ job=~\"$peer\"}", + "hide": false, + "legendFormat": "{{job}}", + "range": true, + "refId": "B" + } + ], + "title": "Double echo - Buffer size", + "type": "timeseries" + } + ], + "refresh": "", + "schemaVersion": 38, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "current": { + "selected": true, + "text": [ + "boot" + ], + "value": [ + "boot" + ] + }, + "definition": "label_values(topos_certificate_received_total,job)", + "hide": 0, + "includeAll": true, + "multi": true, + "name": "peer", + "options": [], + "query": { + "query": "label_values(topos_certificate_received_total,job)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": { + "selected": false, + "text": "Prometheus", + "value": "Prometheus" + }, + "hide": 0, + "includeAll": false, + "label": "Datasource", + "multi": false, + "name": "datasource", + "options": [], + "query": "prometheus", + "queryValue": "", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + } + ] + }, + "time": { + "from": "now-5m", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Benchmarks Copy", + "uid": "e3d3b025-4b36-454a-a724-818f85806b6e", + "version": 3, + "weekStart": "" +} diff --git a/tools/docker-compose.yml b/tools/docker-compose.yml index a83a0f1f4..8c1c5fb2f 100644 --- a/tools/docker-compose.yml +++ b/tools/docker-compose.yml @@ -8,6 +8,7 @@ services: init: true labels: "autoheal": "true" + "prometheus-job": "boot" healthcheck: test: ./topos tce push-peer-list --node http://localhost:1340 --format json /tmp/shared/peer_ids.json && ./topos tce status --node http://localhost:1340 interval: 15s @@ -57,6 +58,7 @@ services: ports: - "9090" - "1340" + - "3000" - "4000" deploy: replicas: 14 @@ -122,14 +124,47 @@ services: - AUTOHEAL_INTERVAL=30 - CURL_TIMEOUT=30 -volumes: - shared: - prometheus_data: {} - grafana_data: {} - + prometheus: + image: prom/prometheus + container_name: prometheus + command: + - '--config.file=/etc/prometheus/prometheus.yml' + ports: + - 9090:9090 + restart: unless-stopped + volumes: + - ./config/prometheus:/etc/prometheus + - prom_data:/prometheus -networks: - monitoring: - driver: bridge + cadvisor: + image: gcr.io/cadvisor/cadvisor + volumes: + - /:/rootfs:ro + - /var/run:/var/run:rw + - /sys:/sys:ro + - /var/lib/docker/:/var/lib/docker:ro + ports: + - 8080:8080 + restart: always + deploy: + mode: global + grafana: + image: grafana/grafana + container_name: grafana + depends_on: + - prometheus + ports: + - 3030:3000 + restart: unless-stopped + environment: + - GF_SECURITY_ADMIN_USER=admin + - GF_SECURITY_ADMIN_PASSWORD=grafana + - GF_USERS_ALLOW_SIGN_UP=false + - GF_INSTALL_PLUGINS=grafana-piechart-panel + volumes: + - ./config/grafana/provisioning/:/etc/grafana/provisioning/ +volumes: + shared: + prom_data: diff --git a/tools/env/base.env b/tools/env/base.env index ad590a804..dff3066d2 100644 --- a/tools/env/base.env +++ b/tools/env/base.env @@ -1,3 +1,3 @@ -RUST_LOG=info +RUST_LOG=warn TOOLCHAIN_VERSION=stable RUST_BACKTRACE=full diff --git a/tools/env/node.env b/tools/env/node.env index 328a3ddfa..38462418e 100644 --- a/tools/env/node.env +++ b/tools/env/node.env @@ -1,4 +1,4 @@ -RUST_LOG=warn,topos=debug +RUST_LOG=warn,topos=warn LOCAL_TEST_NET=true TCE_DB_PATH=/tmp/default-db @@ -16,5 +16,5 @@ TCE_ECHO_THRESHOLD=11 TCE_READY_THRESHOLD=6 TCE_DELIVERY_THRESHOLD=10 -TOPOS_OTLP_SERVICE_NAME=simon-tce-node -TOPOS_OTLP_TAGS=run_id=simon-local-0019,number_of_peer_nodes=15,cert_per_batch=10,node_kind=boot,number_of_batches=60 +TOPOS_OTLP_SERVICE_NAME=tce-local-benchmarks +TOPOS_OTLP_TAGS=run_id=tce-local-benchmarks-0001,number_of_peer_nodes=15,cert_per_batch=10,node_kind=boot,number_of_batches=60 diff --git a/tools/env/spammer.env b/tools/env/spammer.env index 3a6ea0bbb..a8bd7d4ee 100644 --- a/tools/env/spammer.env +++ b/tools/env/spammer.env @@ -1,7 +1,7 @@ RUST_LOG=info -TOPOS_NETWORK_SPAMMER_CERT_PER_BATCH=50 +TOPOS_NETWORK_SPAMMER_CERT_PER_BATCH=20 TOPOS_NETWORK_SPAMMER_BATCH_INTERVAL=1000 TOPOS_NETWORK_SPAMMER_TARGET_NODES_PATH=/tmp/shared/peer_nodes.json TOPOS_NETWORK_SPAMMER_NUMBER_OF_SUBNETS=1 -TOPOS_NETWORK_SPAMMER_NUMBER_OF_BATCHES=10 -TOPOS_OTLP_SERVICE_NAME=simon-spammer +TOPOS_NETWORK_SPAMMER_NUMBER_OF_BATCHES=60 +TOPOS_OTLP_SERVICE_NAME=tce-local-benchmarks diff --git a/tools/prometheus.yaml b/tools/prometheus.yaml deleted file mode 100644 index a8477547e..000000000 --- a/tools/prometheus.yaml +++ /dev/null @@ -1,6 +0,0 @@ -scrape_configs: - - job_name: 'otel-collector' - scrape_interval: 10s - static_configs: - - targets: ['otel-collector:8889'] - - targets: ['otel-collector:8888']