From 264c5694980fded79ea0749d03f54a345d90c741 Mon Sep 17 00:00:00 2001 From: Simon Paitrault Date: Tue, 12 Mar 2024 15:00:46 +0100 Subject: [PATCH] chore: update deps (#474) --- Cargo.lock | 747 +++++++++--------- Cargo.toml | 16 +- crates/topos-core/Cargo.toml | 2 +- crates/topos-node/src/lib.rs | 22 +- crates/topos-p2p/Cargo.toml | 2 +- crates/topos-p2p/src/behaviour/discovery.rs | 5 +- crates/topos-p2p/src/behaviour/gossip.rs | 11 +- crates/topos-p2p/src/behaviour/grpc.rs | 7 +- .../topos-p2p/src/behaviour/grpc/handler.rs | 16 +- crates/topos-p2p/src/client.rs | 2 +- crates/topos-p2p/src/event.rs | 1 + crates/topos-p2p/src/lib.rs | 4 +- crates/topos-p2p/src/network.rs | 4 +- .../topos-p2p/src/runtime/handle_command.rs | 4 +- crates/topos-p2p/src/runtime/handle_event.rs | 50 +- .../src/runtime/handle_event/discovery.rs | 1 + crates/topos-p2p/src/tests/behaviour/grpc.rs | 16 +- crates/topos-tce-api/Cargo.toml | 4 +- .../tests/integration.rs | 2 - .../tests/integration/mock.rs | 28 - crates/topos-telemetry/Cargo.toml | 1 + crates/topos-telemetry/src/tracing.rs | 38 +- crates/topos/src/components/regtest/mod.rs | 8 +- 23 files changed, 492 insertions(+), 499 deletions(-) delete mode 100644 crates/topos-tce-synchronizer/src/checkpoints_collector/tests/integration/mock.rs diff --git a/Cargo.lock b/Cargo.lock index bc2c1e2f1..9c3afd32e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -530,6 +530,32 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "async-std" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" +dependencies = [ + "async-channel 1.9.0", + "async-global-executor", + "async-io 1.13.0", + "async-lock 2.8.0", + "crossbeam-utils", + "futures-channel", + "futures-core", + "futures-io", + "futures-lite 1.13.0", + "gloo-timers", + "kv-log-macro", + "log", + "memchr", + "once_cell", + "pin-project-lite", + "pin-utils", + "slab", + "wasm-bindgen-futures", +] + [[package]] name = "async-stream" version = "0.3.5" @@ -593,6 +619,19 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "asynchronous-codec" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a860072022177f903e59730004fb5dc13db9275b79bb2aef7ba8ce831956c233" +dependencies = [ + "bytes", + "futures-sink", + "futures-util", + "memchr", + "pin-project-lite", +] + [[package]] name = "atomic" version = "0.6.0" @@ -2057,18 +2096,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "enum-as-inner" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9720bba047d567ffc8a3cba48bf19126600e249ab7f128e9233e6376976a116" -dependencies = [ - "heck 0.4.1", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "enum-as-inner" version = "0.6.0" @@ -2710,9 +2737,9 @@ dependencies = [ [[package]] name = "futures-bounded" -version = "0.1.0" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b07bbbe7d7e78809544c6f718d875627addc73a7c3582447abc052cd3dc67e0" +checksum = "e1e2774cc104e198ef3d3e1ff4ab40f86fa3245d6cb6a3a46174f21463cee173" dependencies = [ "futures-timer", "futures-util", @@ -3152,6 +3179,52 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b07f60793ff0a4d9cef0f18e63b5357e06209987153a64648c972c1e5aff336f" +[[package]] +name = "hickory-proto" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "091a6fbccf4860009355e3efc52ff4acf37a63489aad7435372d44ceeb6fbbcf" +dependencies = [ + "async-trait", + "cfg-if", + "data-encoding", + "enum-as-inner", + "futures-channel", + "futures-io", + "futures-util", + "idna 0.4.0", + "ipnet", + "once_cell", + "rand", + "socket2 0.5.5", + "thiserror", + "tinyvec", + "tokio", + "tracing", + "url", +] + +[[package]] +name = "hickory-resolver" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35b8f021164e6a984c9030023544c57789c51760065cd510572fedcfb04164e8" +dependencies = [ + "cfg-if", + "futures-util", + "hickory-proto", + "ipconfig", + "lru-cache", + "once_cell", + "parking_lot", + "rand", + "resolv-conf", + "smallvec", + "thiserror", + "tokio", + "tracing", +] + [[package]] name = "hkdf" version = "0.12.4" @@ -3431,17 +3504,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" -[[package]] -name = "idna" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" -dependencies = [ - "matches", - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "idna" version = "0.4.0" @@ -3746,7 +3808,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6971da4d9c3aa03c3d8f3ff0f4155b534aad021292003895a469716b2a230378" dependencies = [ "base64 0.21.7", - "pem", + "pem 1.1.1", "ring 0.16.20", "serde", "serde_json", @@ -3786,6 +3848,15 @@ dependencies = [ "tiny-keccak 2.0.2", ] +[[package]] +name = "kv-log-macro" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" +dependencies = [ + "log", +] + [[package]] name = "lalrpop" version = "0.20.0" @@ -3850,9 +3921,9 @@ checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "libp2p" -version = "0.52.4" +version = "0.53.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94495eb319a85b70a68b85e2389a95bb3555c71c49025b78c691a854a7e6464" +checksum = "681fb3f183edfbedd7a57d32ebe5dcdc0b9f94061185acf3c30249349cc6fc99" dependencies = [ "bytes", "either", @@ -3885,9 +3956,9 @@ dependencies = [ [[package]] name = "libp2p-allow-block-list" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55b46558c5c0bf99d3e2a1a38fd54ff5476ca66dd1737b12466a1824dd219311" +checksum = "107b238b794cb83ab53b74ad5dcf7cca3200899b72fe662840cfb52f5b0a32e6" dependencies = [ "libp2p-core", "libp2p-identity", @@ -3897,9 +3968,9 @@ dependencies = [ [[package]] name = "libp2p-connection-limits" -version = "0.2.1" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f5107ad45cb20b2f6c3628c7b6014b996fcb13a88053f4569c872c6e30abf58" +checksum = "c7cd50a78ccfada14de94cbacd3ce4b0138157f376870f13d3a8422cd075b4fd" dependencies = [ "libp2p-core", "libp2p-identity", @@ -3909,9 +3980,9 @@ dependencies = [ [[package]] name = "libp2p-core" -version = "0.40.1" +version = "0.41.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd44289ab25e4c9230d9246c475a22241e301b23e8f4061d3bdef304a1a99713" +checksum = "8130a8269e65a2554d55131c770bdf4bcd94d2b8d4efb24ca23699be65066c05" dependencies = [ "either", "fnv", @@ -3919,7 +3990,6 @@ dependencies = [ "futures-timer", "instant", "libp2p-identity", - "log", "multiaddr", "multihash", "multistream-select", @@ -3932,33 +4002,34 @@ dependencies = [ "serde", "smallvec", "thiserror", - "unsigned-varint", + "tracing", + "unsigned-varint 0.8.0", "void", ] [[package]] name = "libp2p-dns" -version = "0.40.1" +version = "0.41.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6a18db73084b4da2871438f6239fef35190b05023de7656e877c18a00541a3b" +checksum = "d17cbcf7160ff35c3e8e560de4a068fe9d6cb777ea72840e48eb76ff9576c4b6" dependencies = [ "async-trait", "futures", + "hickory-resolver", "libp2p-core", "libp2p-identity", - "log", "parking_lot", "smallvec", - "trust-dns-resolver", + "tracing", ] [[package]] name = "libp2p-gossipsub" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1f9624e2a843b655f1c1b8262b8d5de6f309413fca4d66f01bb0662429f84dc" +checksum = "d665144a616dadebdc5fff186b1233488cdcd8bfb1223218ff084b6d052c94f7" dependencies = [ - "asynchronous-codec", + "asynchronous-codec 0.7.0", "base64 0.21.7", "byteorder", "bytes", @@ -3972,26 +4043,25 @@ dependencies = [ "libp2p-core", "libp2p-identity", "libp2p-swarm", - "log", "prometheus-client", "quick-protobuf", - "quick-protobuf-codec", + "quick-protobuf-codec 0.3.1", "rand", "regex", "serde", "sha2 0.10.8", "smallvec", - "unsigned-varint", + "tracing", "void", ] [[package]] name = "libp2p-identify" -version = "0.43.1" +version = "0.44.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45a96638a0a176bec0a4bcaebc1afa8cf909b114477209d7456ade52c61cd9cd" +checksum = "20499a945d2f0221fdc6269b3848892c0f370d2ee3e19c7f65a29d8f860f6126" dependencies = [ - "asynchronous-codec", + "asynchronous-codec 0.7.0", "either", "futures", "futures-bounded", @@ -3999,12 +4069,12 @@ dependencies = [ "libp2p-core", "libp2p-identity", "libp2p-swarm", - "log", "lru", "quick-protobuf", - "quick-protobuf-codec", + "quick-protobuf-codec 0.3.1", "smallvec", "thiserror", + "tracing", "void", ] @@ -4031,61 +4101,62 @@ dependencies = [ [[package]] name = "libp2p-kad" -version = "0.44.6" +version = "0.45.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16ea178dabba6dde6ffc260a8e0452ccdc8f79becf544946692fff9d412fc29d" +checksum = "5cc5767727d062c4eac74dd812c998f0e488008e82cce9c33b463d38423f9ad2" dependencies = [ "arrayvec", - "asynchronous-codec", + "asynchronous-codec 0.7.0", "bytes", "either", "fnv", "futures", + "futures-bounded", "futures-timer", "instant", "libp2p-core", "libp2p-identity", "libp2p-swarm", - "log", "quick-protobuf", - "quick-protobuf-codec", + "quick-protobuf-codec 0.3.1", "rand", "serde", "sha2 0.10.8", "smallvec", "thiserror", + "tracing", "uint", - "unsigned-varint", "void", ] [[package]] name = "libp2p-mdns" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42a2567c305232f5ef54185e9604579a894fd0674819402bb0ac0246da82f52a" +checksum = "49007d9a339b3e1d7eeebc4d67c05dbf23d300b7d091193ec2d3f26802d7faf2" dependencies = [ "data-encoding", "futures", + "hickory-proto", "if-watch", "libp2p-core", "libp2p-identity", "libp2p-swarm", - "log", "rand", "smallvec", "socket2 0.5.5", "tokio", - "trust-dns-proto 0.22.0", + "tracing", "void", ] [[package]] name = "libp2p-metrics" -version = "0.13.1" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239ba7d28f8d0b5d77760dc6619c05c7e88e74ec8fbbe97f856f20a56745e620" +checksum = "fdac91ae4f291046a3b2660c039a2830c931f84df2ee227989af92f7692d3357" dependencies = [ + "futures", "instant", "libp2p-core", "libp2p-gossipsub", @@ -4093,22 +4164,22 @@ dependencies = [ "libp2p-identity", "libp2p-kad", "libp2p-swarm", - "once_cell", + "pin-project", "prometheus-client", ] [[package]] name = "libp2p-noise" -version = "0.43.2" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2eeec39ad3ad0677551907dd304b2f13f17208ccebe333bef194076cd2e8921" +checksum = "8ecd0545ce077f6ea5434bcb76e8d0fe942693b4380aaad0d34a358c2bd05793" dependencies = [ + "asynchronous-codec 0.7.0", "bytes", "curve25519-dalek", "futures", "libp2p-core", "libp2p-identity", - "log", "multiaddr", "multihash", "once_cell", @@ -4118,31 +4189,32 @@ dependencies = [ "snow", "static_assertions", "thiserror", + "tracing", "x25519-dalek", "zeroize", ] [[package]] name = "libp2p-plaintext" -version = "0.40.1" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53cc5390cc2f77b7de2452fb6105892d0bb64e3cafa3bb346abb603f4cc93a09" +checksum = "67330af40b67217e746d42551913cfb7ad04c74fa300fb329660a56318590b3f" dependencies = [ - "asynchronous-codec", + "asynchronous-codec 0.6.2", "bytes", "futures", "libp2p-core", "libp2p-identity", - "log", "quick-protobuf", - "unsigned-varint", + "quick-protobuf-codec 0.2.0", + "tracing", ] [[package]] name = "libp2p-quic" -version = "0.9.3" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "130d451d83f21b81eb7b35b360bc7972aeafb15177784adc56528db082e6b927" +checksum = "a0375cdfee57b47b313ef1f0fdb625b78aed770d33a40cf1c294a371ff5e6666" dependencies = [ "bytes", "futures", @@ -4151,7 +4223,6 @@ dependencies = [ "libp2p-core", "libp2p-identity", "libp2p-tls", - "log", "parking_lot", "quinn", "rand", @@ -4160,32 +4231,36 @@ dependencies = [ "socket2 0.5.5", "thiserror", "tokio", + "tracing", ] [[package]] name = "libp2p-request-response" -version = "0.25.3" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8e3b4d67870478db72bac87bfc260ee6641d0734e0e3e275798f089c3fecfd4" +checksum = "e12823250fe0c45bdddea6eefa2be9a609aff1283ff4e1d8a294fdbb89572f6f" dependencies = [ "async-trait", "futures", + "futures-bounded", + "futures-timer", "instant", "libp2p-core", "libp2p-identity", "libp2p-swarm", - "log", "rand", "smallvec", + "tracing", "void", ] [[package]] name = "libp2p-swarm" -version = "0.43.7" +version = "0.44.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "580189e0074af847df90e75ef54f3f30059aedda37ea5a1659e8b9fca05c0141" +checksum = "e92532fc3c4fb292ae30c371815c9b10103718777726ea5497abc268a4761866" dependencies = [ + "async-std", "either", "fnv", "futures", @@ -4194,23 +4269,22 @@ dependencies = [ "libp2p-core", "libp2p-identity", "libp2p-swarm-derive", - "log", "multistream-select", "once_cell", "rand", "smallvec", "tokio", + "tracing", "void", ] [[package]] name = "libp2p-swarm-derive" -version = "0.33.0" +version = "0.34.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4d5ec2a3df00c7836d7696c136274c9c59705bac69133253696a6c932cd1d74" +checksum = "b644268b4acfdaa6a6100b31226ee7a36d96ab4c43287d113bfd2308607d8b6f" dependencies = [ "heck 0.4.1", - "proc-macro-warning", "proc-macro2", "quote", "syn 2.0.48", @@ -4218,9 +4292,9 @@ dependencies = [ [[package]] name = "libp2p-swarm-test" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61761099882b9c4fe02d4d0fc47641e81381dd2a95a7b4ddeb0dc02f3daaaf16" +checksum = "a73027f1bdabd15d08b2c7954911cd56a6265c476763b2ceb10d9dc5ea4366b2" dependencies = [ "async-trait", "futures", @@ -4231,15 +4305,15 @@ dependencies = [ "libp2p-swarm", "libp2p-tcp", "libp2p-yamux", - "log", "rand", + "tracing", ] [[package]] name = "libp2p-tcp" -version = "0.40.1" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b558dd40d1bcd1aaaed9de898e9ec6a436019ecc2420dd0016e712fbb61c5508" +checksum = "8b2460fc2748919adff99ecbc1aab296e4579e41f374fb164149bd2c9e529d4c" dependencies = [ "async-io 1.13.0", "futures", @@ -4248,16 +4322,16 @@ dependencies = [ "libc", "libp2p-core", "libp2p-identity", - "log", "socket2 0.5.5", "tokio", + "tracing", ] [[package]] name = "libp2p-tls" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8218d1d5482b122ccae396bbf38abdcb283ecc96fa54760e1dfd251f0546ac61" +checksum = "93ce7e3c2e7569d685d08ec795157981722ff96e9e9f9eae75df3c29d02b07a5" dependencies = [ "futures", "futures-rustls", @@ -4266,7 +4340,7 @@ dependencies = [ "rcgen", "ring 0.16.20", "rustls 0.21.10", - "rustls-webpki", + "rustls-webpki 0.101.7", "thiserror", "x509-parser", "yasna", @@ -4274,31 +4348,33 @@ dependencies = [ [[package]] name = "libp2p-upnp" -version = "0.1.1" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82775a47b34f10f787ad3e2a22e2c1541e6ebef4fe9f28f3ac553921554c94c1" +checksum = "b49cc89949bf0e06869297cd4fe2c132358c23fe93e76ad43950453df4da3d35" dependencies = [ "futures", "futures-timer", "igd-next", "libp2p-core", "libp2p-swarm", - "log", "tokio", + "tracing", "void", ] [[package]] name = "libp2p-yamux" -version = "0.44.1" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eedcb62824c4300efb9cfd4e2a6edaf3ca097b9e68b36dabe45a44469fd6a85" +checksum = "200cbe50349a44760927d50b431d77bed79b9c0a3959de1af8d24a63434b71e5" dependencies = [ + "either", "futures", "libp2p-core", - "log", "thiserror", - "yamux", + "tracing", + "yamux 0.12.1", + "yamux 0.13.1", ] [[package]] @@ -4420,6 +4496,9 @@ name = "log" version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +dependencies = [ + "value-bag", +] [[package]] name = "lru" @@ -4464,12 +4543,6 @@ dependencies = [ "regex-automata 0.1.10", ] -[[package]] -name = "matches" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" - [[package]] name = "matchit" version = "0.7.3" @@ -4626,7 +4699,7 @@ dependencies = [ "percent-encoding", "serde", "static_assertions", - "unsigned-varint", + "unsigned-varint 0.7.2", "url", ] @@ -4649,7 +4722,7 @@ checksum = "076d548d76a0e2a0d4ab471d0b1c36c577786dfc4471242035d97a12a735c492" dependencies = [ "core2", "serde", - "unsigned-varint", + "unsigned-varint 0.7.2", ] [[package]] @@ -4669,7 +4742,7 @@ dependencies = [ "log", "pin-project", "smallvec", - "unsigned-varint", + "unsigned-varint 0.7.2", ] [[package]] @@ -5014,76 +5087,71 @@ dependencies = [ [[package]] name = "opentelemetry" -version = "0.19.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4b8347cc26099d3aeee044065ecc3ae11469796b4d65d065a23a584ed92a6f" +checksum = "900d57987be3f2aeb70d385fff9b27fb74c5723cc9a52d904d4f9c807a0667bf" dependencies = [ - "opentelemetry_api", - "opentelemetry_sdk", + "futures-core", + "futures-sink", + "js-sys", + "once_cell", + "pin-project-lite", + "thiserror", + "urlencoding", ] [[package]] name = "opentelemetry-otlp" -version = "0.12.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8af72d59a4484654ea8eb183fea5ae4eb6a41d7ac3e3bae5f4d2a282a3a7d3ca" +checksum = "1a016b8d9495c639af2145ac22387dcb88e44118e45320d9238fbf4e7889abcb" dependencies = [ "async-trait", - "futures", - "futures-util", + "futures-core", "http 0.2.11", "opentelemetry", "opentelemetry-proto", - "prost 0.11.9", + "opentelemetry-semantic-conventions", + "opentelemetry_sdk", + "prost", "thiserror", "tokio", - "tonic 0.8.3", + "tonic", ] [[package]] name = "opentelemetry-proto" -version = "0.2.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "045f8eea8c0fa19f7d48e7bc3128a39c2e5c533d5c61298c548dfefc1064474c" +checksum = "3a8fddc9b68f5b80dae9d6f510b88e02396f006ad48cac349411fbecc80caae4" dependencies = [ - "futures", - "futures-util", "opentelemetry", - "prost 0.11.9", - "tonic 0.8.3", + "opentelemetry_sdk", + "prost", + "tonic", ] [[package]] -name = "opentelemetry_api" -version = "0.19.0" +name = "opentelemetry-semantic-conventions" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed41783a5bf567688eb38372f2b7a8530f5a607a4b49d38dd7573236c23ca7e2" -dependencies = [ - "fnv", - "futures-channel", - "futures-util", - "indexmap 1.9.3", - "once_cell", - "pin-project-lite", - "thiserror", - "urlencoding", -] +checksum = "f9ab5bd6c42fb9349dcf28af2ba9a0667f697f9bdcca045d39f2cec5543e2910" [[package]] name = "opentelemetry_sdk" -version = "0.19.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b3a2a91fdbfdd4d212c0dcc2ab540de2c2bcbbd90be17de7a7daf8822d010c1" +checksum = "9e90c7113be649e31e9a0f8b5ee24ed7a16923b322c3c5ab6367469c049d6b7e" dependencies = [ "async-trait", "crossbeam-channel", - "dashmap", - "fnv", "futures-channel", "futures-executor", "futures-util", + "glob", "once_cell", - "opentelemetry_api", + "opentelemetry", + "ordered-float", "percent-encoding", "rand", "thiserror", @@ -5097,6 +5165,15 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" +[[package]] +name = "ordered-float" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a76df7075c7d4d01fdcb46c912dd17fba5b60c78ea480b475f2b6ab6f666584e" +dependencies = [ + "num-traits", +] + [[package]] name = "os_str_bytes" version = "6.6.1" @@ -5274,6 +5351,16 @@ dependencies = [ "base64 0.13.1", ] +[[package]] +name = "pem" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b8fcc794035347fb64beda2d3b462595dd2753e3f268d89c5aae77e8cf2c310" +dependencies = [ + "base64 0.21.7", + "serde", +] + [[package]] name = "percent-encoding" version = "2.3.1" @@ -5699,17 +5786,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "proc-macro-warning" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1eaa7fa0aa1929ffdf7eeb6eac234dde6268914a14ad44d23521ab6a9b258e" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - [[package]] name = "proc-macro2" version = "1.0.78" @@ -5757,9 +5833,9 @@ dependencies = [ [[package]] name = "prometheus-client" -version = "0.21.2" +version = "0.22.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c99afa9a01501019ac3a14d71d9f94050346f55ca471ce90c799a15c58f61e2" +checksum = "c1ca959da22a332509f2a73ae9e5f23f9dcfc31fd3a54d71f159495bd5909baa" dependencies = [ "dtoa", "itoa", @@ -5794,16 +5870,6 @@ dependencies = [ "unarray", ] -[[package]] -name = "prost" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" -dependencies = [ - "bytes", - "prost-derive 0.11.9", -] - [[package]] name = "prost" version = "0.12.3" @@ -5811,7 +5877,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a" dependencies = [ "bytes", - "prost-derive 0.12.3", + "prost-derive", ] [[package]] @@ -5828,7 +5894,7 @@ dependencies = [ "once_cell", "petgraph", "prettyplease", - "prost 0.12.3", + "prost", "prost-types", "regex", "syn 2.0.48", @@ -5836,19 +5902,6 @@ dependencies = [ "which", ] -[[package]] -name = "prost-derive" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" -dependencies = [ - "anyhow", - "itertools 0.10.5", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "prost-derive" version = "0.12.3" @@ -5868,7 +5921,7 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "193898f59edcf43c26227dcd4c8427f00d99d61e95dcde58dabd49fa291d470e" dependencies = [ - "prost 0.12.3", + "prost", ] [[package]] @@ -5913,11 +5966,24 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8ededb1cd78531627244d51dd0c7139fbe736c7d57af0092a76f0ffb2f56e98" dependencies = [ - "asynchronous-codec", + "asynchronous-codec 0.6.2", "bytes", "quick-protobuf", "thiserror", - "unsigned-varint", + "unsigned-varint 0.7.2", +] + +[[package]] +name = "quick-protobuf-codec" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15a0580ab32b169745d7a39db2ba969226ca16738931be152a3209b409de2474" +dependencies = [ + "asynchronous-codec 0.7.0", + "bytes", + "quick-protobuf", + "thiserror", + "unsigned-varint 0.8.0", ] [[package]] @@ -6063,11 +6129,11 @@ dependencies = [ [[package]] name = "rcgen" -version = "0.10.0" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffbe84efe2f38dea12e9bfc1f65377fdf03e53a18cb3b995faedf7934c7e785b" +checksum = "52c4f3084aa3bc7dfbba4eff4fab2a54db4324965d8872ab933565e6fbd83bc6" dependencies = [ - "pem", + "pem 3.0.3", "ring 0.16.20", "time", "yasna", @@ -6169,7 +6235,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "rustls 0.21.10", - "rustls-pemfile", + "rustls-pemfile 1.0.4", "serde", "serde_json", "serde_urlencoded", @@ -6384,36 +6450,39 @@ dependencies = [ [[package]] name = "rustls" -version = "0.20.9" +version = "0.21.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" +checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" dependencies = [ "log", - "ring 0.16.20", + "ring 0.17.7", + "rustls-webpki 0.101.7", "sct", - "webpki", ] [[package]] name = "rustls" -version = "0.21.10" +version = "0.22.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +checksum = "e87c9956bd9807afa1f77e0f7594af32566e830e088a5576d27c5b6f30f49d41" dependencies = [ "log", "ring 0.17.7", - "rustls-webpki", - "sct", + "rustls-pki-types", + "rustls-webpki 0.102.2", + "subtle", + "zeroize", ] [[package]] name = "rustls-native-certs" -version = "0.6.3" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" +checksum = "8f1fb85efa936c42c6d5fc28d2629bb51e4b2f4b8a5211e297d599cc5a093792" dependencies = [ "openssl-probe", - "rustls-pemfile", + "rustls-pemfile 2.1.1", + "rustls-pki-types", "schannel", "security-framework", ] @@ -6427,6 +6496,22 @@ dependencies = [ "base64 0.21.7", ] +[[package]] +name = "rustls-pemfile" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f48172685e6ff52a556baa527774f61fcaa884f59daf3375c62a3f1cd2549dab" +dependencies = [ + "base64 0.21.7", + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ede67b28608b4c60685c7d54122d4400d90f62b40caee7700e700380a390fa8" + [[package]] name = "rustls-webpki" version = "0.101.7" @@ -6437,6 +6522,17 @@ dependencies = [ "untrusted 0.9.0", ] +[[package]] +name = "rustls-webpki" +version = "0.102.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610" +dependencies = [ + "ring 0.17.7", + "rustls-pki-types", + "untrusted 0.9.0", +] + [[package]] name = "rustversion" version = "1.0.14" @@ -7415,22 +7511,22 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.23.4" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.20.9", + "rustls 0.21.10", "tokio", - "webpki", ] [[package]] name = "tokio-rustls" -version = "0.24.1" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" dependencies = [ - "rustls 0.21.10", + "rustls 0.22.2", + "rustls-pki-types", "tokio", ] @@ -7568,44 +7664,9 @@ dependencies = [ [[package]] name = "tonic" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f219fad3b929bef19b1f86fbc0358d35daed8f2cac972037ac0dc10bbb8d5fb" -dependencies = [ - "async-stream", - "async-trait", - "axum 0.6.20", - "base64 0.13.1", - "bytes", - "futures-core", - "futures-util", - "h2 0.3.24", - "http 0.2.11", - "http-body 0.4.6", - "hyper 0.14.28", - "hyper-timeout", - "percent-encoding", - "pin-project", - "prost 0.11.9", - "prost-derive 0.11.9", - "rustls-native-certs", - "rustls-pemfile", - "tokio", - "tokio-rustls 0.23.4", - "tokio-stream", - "tokio-util", - "tower", - "tower-layer", - "tower-service", - "tracing", - "tracing-futures", -] - -[[package]] -name = "tonic" -version = "0.10.2" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d560933a0de61cf715926b9cac824d4c883c2c43142f787595e48280c40a1d0e" +checksum = "76c4eb7a4e9ef9d4763600161f12f5070b92a578e1b634db88a6887844c91a13" dependencies = [ "async-stream", "async-trait", @@ -7619,12 +7680,12 @@ dependencies = [ "hyper-timeout", "percent-encoding", "pin-project", - "prost 0.12.3", - "rustls 0.21.10", + "prost", "rustls-native-certs", - "rustls-pemfile", + "rustls-pemfile 2.1.1", + "rustls-pki-types", "tokio", - "tokio-rustls 0.24.1", + "tokio-rustls 0.25.0", "tokio-stream", "tower", "tower-layer", @@ -7634,9 +7695,9 @@ dependencies = [ [[package]] name = "tonic-build" -version = "0.10.2" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d021fc044c18582b9a2408cd0dd05b1596e3ecdb5c4df822bb0183545683889" +checksum = "be4ef6dd70a610078cb4e338a0f79d06bc759ff1b22d2120c2ff02ae264ba9c2" dependencies = [ "prettyplease", "proc-macro2", @@ -7647,28 +7708,28 @@ dependencies = [ [[package]] name = "tonic-health" -version = "0.10.2" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f80db390246dfb46553481f6024f0082ba00178ea495dbb99e70ba9a4fafb5e1" +checksum = "2cef6e24bc96871001a7e48e820ab240b3de2201e59b517cf52835df2f1d2350" dependencies = [ "async-stream", - "prost 0.12.3", + "prost", "tokio", "tokio-stream", - "tonic 0.10.2", + "tonic", ] [[package]] name = "tonic-reflection" -version = "0.10.2" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fa37c513df1339d197f4ba21d28c918b9ef1ac1768265f11ecb6b7f1cba1b76" +checksum = "548c227bd5c0fae5925812c4ec6c66ffcfced23ea370cb823f4d18f0fc1cb6a7" dependencies = [ - "prost 0.12.3", + "prost", "prost-types", "tokio", "tokio-stream", - "tonic 0.10.2", + "tonic", ] [[package]] @@ -7707,7 +7768,7 @@ dependencies = [ "tokio", "tokio-util", "toml 0.7.8", - "tonic 0.10.2", + "tonic", "topos-certificate-spammer", "topos-config", "topos-core", @@ -7725,7 +7786,7 @@ dependencies = [ "topos-wallet", "tower", "tracing", - "tracing-log", + "tracing-log 0.1.4", "tracing-opentelemetry", "tracing-subscriber", "url", @@ -7808,7 +7869,7 @@ dependencies = [ "tokio", "tokio-util", "toml 0.7.8", - "tonic 0.10.2", + "tonic", "topos-core", "topos-p2p", "topos-tce-api", @@ -7820,7 +7881,7 @@ dependencies = [ "topos-wallet", "tower", "tracing", - "tracing-log", + "tracing-log 0.1.4", "tracing-opentelemetry", "tracing-subscriber", "url", @@ -7840,14 +7901,14 @@ dependencies = [ "ethereum-types 0.13.1", "futures", "hex", - "prost 0.12.3", + "prost", "rstest", "serde", "test-log", "thiserror", "tokio", "tokio-stream", - "tonic 0.10.2", + "tonic", "tonic-build", "topos-crypto", "topos-test-sdk", @@ -7916,7 +7977,7 @@ dependencies = [ "tokio", "tokio-util", "toml 0.7.8", - "tonic 0.10.2", + "tonic", "topos-certificate-spammer", "topos-config", "topos-core", @@ -7933,7 +7994,7 @@ dependencies = [ "topos-wallet", "tower", "tracing", - "tracing-log", + "tracing-log 0.1.4", "tracing-opentelemetry", "tracing-subscriber", "url", @@ -7959,7 +8020,7 @@ dependencies = [ "libp2p-swarm-test", "pin-project", "prometheus-client", - "prost 0.12.3", + "prost", "rand", "rstest", "serde", @@ -7969,7 +8030,7 @@ dependencies = [ "tokio", "tokio-stream", "tokio-util", - "tonic 0.10.2", + "tonic", "topos-core", "topos-metrics", "topos-test-sdk", @@ -8067,7 +8128,7 @@ dependencies = [ "opentelemetry", "prometheus", "prometheus-client", - "prost 0.12.3", + "prost", "rand", "rand_core", "rand_distr", @@ -8078,7 +8139,7 @@ dependencies = [ "tokio", "tokio-stream", "tokio-util", - "tonic 0.10.2", + "tonic", "topos-config", "topos-core", "topos-crypto", @@ -8117,7 +8178,7 @@ dependencies = [ "hyper 0.14.28", "pin-project", "prometheus-client", - "prost 0.12.3", + "prost", "reqwest", "rstest", "serde", @@ -8127,7 +8188,7 @@ dependencies = [ "tokio", "tokio-stream", "tokio-util", - "tonic 0.10.2", + "tonic", "tonic-health", "tonic-reflection", "topos-core", @@ -8211,7 +8272,7 @@ dependencies = [ "thiserror", "tokio", "tokio-stream", - "tonic 0.10.2", + "tonic", "topos-core", "topos-tce", "topos-tce-storage", @@ -8267,7 +8328,7 @@ dependencies = [ "tokio", "tokio-stream", "tokio-util", - "tonic 0.10.2", + "tonic", "topos-config", "topos-core", "topos-p2p", @@ -8285,8 +8346,9 @@ version = "0.1.0" dependencies = [ "opentelemetry", "opentelemetry-otlp", + "opentelemetry_sdk", "serde", - "tonic 0.10.2", + "tonic", "tracing", "tracing-opentelemetry", "tracing-subscriber", @@ -8304,13 +8366,13 @@ dependencies = [ "lazy_static", "libp2p", "proc_macro_sdk", - "prost 0.12.3", + "prost", "rand", "rstest", "tokio", "tokio-stream", "tokio-util", - "tonic 0.10.2", + "tonic", "tonic-build", "topos-config", "topos-core", @@ -8461,18 +8523,33 @@ dependencies = [ "tracing-core", ] +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + [[package]] name = "tracing-opentelemetry" -version = "0.19.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00a39dcf9bfc1742fa4d6215253b33a6e474be78275884c216fc2a06267b3600" +checksum = "a9be14ba1bbe4ab79e9229f7f89fab8d120b865859f10527f31c033e599d2284" dependencies = [ + "js-sys", "once_cell", "opentelemetry", + "opentelemetry_sdk", + "smallvec", "tracing", "tracing-core", - "tracing-log", + "tracing-log 0.2.0", "tracing-subscriber", + "web-time", ] [[package]] @@ -8504,78 +8581,6 @@ dependencies = [ "tracing-serde", ] -[[package]] -name = "trust-dns-proto" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f7f83d1e4a0e4358ac54c5c3681e5d7da5efc5a7a632c90bb6d6669ddd9bc26" -dependencies = [ - "async-trait", - "cfg-if", - "data-encoding", - "enum-as-inner 0.5.1", - "futures-channel", - "futures-io", - "futures-util", - "idna 0.2.3", - "ipnet", - "lazy_static", - "rand", - "smallvec", - "socket2 0.4.10", - "thiserror", - "tinyvec", - "tokio", - "tracing", - "url", -] - -[[package]] -name = "trust-dns-proto" -version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3119112651c157f4488931a01e586aa459736e9d6046d3bd9105ffb69352d374" -dependencies = [ - "async-trait", - "cfg-if", - "data-encoding", - "enum-as-inner 0.6.0", - "futures-channel", - "futures-io", - "futures-util", - "idna 0.4.0", - "ipnet", - "once_cell", - "rand", - "smallvec", - "thiserror", - "tinyvec", - "tokio", - "tracing", - "url", -] - -[[package]] -name = "trust-dns-resolver" -version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a3e6c3aff1718b3c73e395d1f35202ba2ffa847c6a62eea0db8fb4cfe30be6" -dependencies = [ - "cfg-if", - "futures-util", - "ipconfig", - "lru-cache", - "once_cell", - "parking_lot", - "rand", - "resolv-conf", - "smallvec", - "thiserror", - "tokio", - "tracing", - "trust-dns-proto 0.23.2", -] - [[package]] name = "try-lock" version = "0.2.5" @@ -8713,10 +8718,16 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6889a77d49f1f013504cec6bf97a2c730394adedaeb1deb5ea08949a50541105" dependencies = [ - "asynchronous-codec", + "asynchronous-codec 0.6.2", "bytes", ] +[[package]] +name = "unsigned-varint" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb066959b24b5196ae73cb057f45598450d2c5f71460e98c49b738086eff9c06" + [[package]] name = "untrusted" version = "0.7.1" @@ -8784,6 +8795,12 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" +[[package]] +name = "value-bag" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "126e423afe2dd9ac52142e7e9d5ce4135d7e13776c529d27fd6bc49f19e3280b" + [[package]] name = "vcpkg" version = "0.2.15" @@ -8919,13 +8936,13 @@ dependencies = [ ] [[package]] -name = "webpki" -version = "0.22.4" +name = "web-time" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" dependencies = [ - "ring 0.17.7", - "untrusted 0.9.0", + "js-sys", + "wasm-bindgen", ] [[package]] @@ -9269,6 +9286,22 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "yamux" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad1d0148b89300047e72994bee99ecdabd15a9166a7b70c8b8c37c314dcc9002" +dependencies = [ + "futures", + "instant", + "log", + "nohash-hasher", + "parking_lot", + "pin-project", + "rand", + "static_assertions", +] + [[package]] name = "yansi" version = "0.5.1" diff --git a/Cargo.toml b/Cargo.toml index 75dfd2dd7..30f801338 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,19 +43,21 @@ tiny-keccak = {version = "1.5"} ethers = {version = "2.0.9", 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"] } +opentelemetry = { version = "0.22", features = ["metrics"] } +opentelemetry-otlp = { version = "0.15", features = ["grpc-tonic", "metrics", "tls-roots"] } +opentelemetry_sdk = { version = "0.22" } + prometheus = "0.13.3" -prometheus-client = "0.21" +prometheus-client = "0.22" tracing = { version = "0.1", default-features = false } tracing-attributes = "0.1" -tracing-opentelemetry = "0.19" +tracing-opentelemetry = "0.23" tracing-subscriber = { version = "0.3", default-features = false } # gRPC prost = {version = "0.12"} -tonic = { version = "0.10", default-features = false } -tonic-build = { version = "0.10", default-features = false, features = [ +tonic = { version = "0.11", default-features = false } +tonic-build = { version = "0.11", default-features = false, features = [ "prost", "transport" ] } @@ -67,7 +69,7 @@ http = "0.2.9" tower-http = { version = "0.4", features = ["cors"] } # P2P related -libp2p = { version = "0.52", default-features = false, features = ["noise"]} +libp2p = { version = "0.53", default-features = false, features = ["noise"]} # Serialization & Deserialization bincode = { version = "1.3", default-features = false } diff --git a/crates/topos-core/Cargo.toml b/crates/topos-core/Cargo.toml index 0d538e9aa..e026e5849 100644 --- a/crates/topos-core/Cargo.toml +++ b/crates/topos-core/Cargo.toml @@ -28,7 +28,7 @@ tracing.workspace = true uuid.workspace = true [build-dependencies] -tonic-build = { version = "0.10", default-features = false, features = [ +tonic-build = { version = "0.11", default-features = false, features = [ "prost", "transport" ] } diff --git a/crates/topos-node/src/lib.rs b/crates/topos-node/src/lib.rs index 3b9b6a5a3..07ded54b6 100644 --- a/crates/topos-node/src/lib.rs +++ b/crates/topos-node/src/lib.rs @@ -3,7 +3,7 @@ use std::process::ExitStatus; use futures::stream::FuturesUnordered; use futures::StreamExt; -use opentelemetry::{global, sdk::metrics::controllers::BasicController}; +use opentelemetry::global; use process::Errors; use tokio::{ signal::{self, unix::SignalKind}, @@ -19,7 +19,6 @@ use topos_config::{ use topos_telemetry::tracing::setup_tracing; use topos_wallet::SecretManager; use tracing::{debug, error, info}; -use tracing_opentelemetry::OpenTelemetrySpanExt; use tracing_subscriber::util::TryInitError; mod process; @@ -57,7 +56,7 @@ pub async fn start( ) -> Result<(), Error> { // Setup instrumentation if both otlp agent and otlp service name // are provided as arguments - let basic_controller = setup_tracing( + setup_tracing( verbose, no_color, otlp_agent, @@ -112,14 +111,14 @@ pub async fn start( tokio::select! { _ = sigterm_stream.recv() => { info!("Received SIGTERM, shutting down application..."); - shutdown(basic_controller, shutdown_trigger, shutdown_receiver).await; + shutdown(shutdown_trigger, shutdown_receiver).await; } _ = signal::ctrl_c() => { info!("Received ctrl_c, shutting down application..."); - shutdown(basic_controller, shutdown_trigger, shutdown_receiver).await; + shutdown( shutdown_trigger, shutdown_receiver).await; } Some(result) = processes.next() => { - shutdown(basic_controller, shutdown_trigger, shutdown_receiver).await; + shutdown(shutdown_trigger, shutdown_receiver).await; processes.clear(); match result { Ok(Ok(status)) => { @@ -214,11 +213,7 @@ fn spawn_processes( Ok(processes) } -async fn shutdown( - basic_controller: Option, - trigger: CancellationToken, - mut termination: mpsc::Receiver<()>, -) { +async fn shutdown(trigger: CancellationToken, mut termination: mpsc::Receiver<()>) { trigger.cancel(); // Wait that all sender get dropped info!("Waiting that all components dropped"); @@ -226,9 +221,4 @@ async fn shutdown( info!("Shutdown procedure finished, exiting..."); // Shutdown tracing global::shutdown_tracer_provider(); - if let Some(basic_controller) = basic_controller { - if let Err(e) = basic_controller.stop(&tracing::Span::current().context()) { - error!("Error stopping tracing: {e}"); - } - } } diff --git a/crates/topos-p2p/Cargo.toml b/crates/topos-p2p/Cargo.toml index 7cd6f150f..15be9dd8e 100644 --- a/crates/topos-p2p/Cargo.toml +++ b/crates/topos-p2p/Cargo.toml @@ -18,7 +18,6 @@ http.workspace = true lazy_static.workspace = true libp2p = { workspace = true, features = ["macros", "gossipsub", "tcp", "dns", "tokio", "request-response", "identify", "kad", "serde", "yamux", "secp256k1"] } pin-project = "1.1.3" -libp2p-swarm-test = "0.2.0" prometheus-client.workspace = true rand.workspace = true serde = { workspace = true, features = ["derive"] } @@ -39,6 +38,7 @@ prost.workspace = true topos-core = { path = "../topos-core/" } [dev-dependencies] +libp2p-swarm-test = "0.3.0" test-log.workspace = true env_logger.workspace = true rstest = { workspace = true, features = ["async-timeout"] } diff --git a/crates/topos-p2p/src/behaviour/discovery.rs b/crates/topos-p2p/src/behaviour/discovery.rs index b935ae158..af6344ecc 100644 --- a/crates/topos-p2p/src/behaviour/discovery.rs +++ b/crates/topos-p2p/src/behaviour/discovery.rs @@ -140,7 +140,7 @@ impl NetworkBehaviour for DiscoveryBehaviour { .handle_established_outbound_connection(connection_id, peer, addr, role_override) } - fn on_swarm_event(&mut self, event: libp2p::swarm::FromSwarm) { + fn on_swarm_event(&mut self, event: libp2p::swarm::FromSwarm) { self.inner.on_swarm_event(event) } @@ -157,7 +157,6 @@ impl NetworkBehaviour for DiscoveryBehaviour { fn poll( &mut self, cx: &mut std::task::Context<'_>, - params: &mut impl libp2p::swarm::PollParameters, ) -> Poll>> { // Poll the kademlia bootstrap interval future in order to define if we need to call the // `bootstrap` @@ -169,7 +168,7 @@ impl NetworkBehaviour for DiscoveryBehaviour { } } - if let Poll::Ready(event) = self.inner.poll(cx, params) { + if let Poll::Ready(event) = self.inner.poll(cx) { match event { // When a Bootstrap query ends, we reset the `query_id` ToSwarm::GenerateEvent(KademliaEvent::OutboundQueryProgressed { diff --git a/crates/topos-p2p/src/behaviour/gossip.rs b/crates/topos-p2p/src/behaviour/gossip.rs index 4f6ba24e3..d01c3bb75 100644 --- a/crates/topos-p2p/src/behaviour/gossip.rs +++ b/crates/topos-p2p/src/behaviour/gossip.rs @@ -15,7 +15,7 @@ use libp2p::{ use prost::Message as ProstMessage; use topos_core::api::grpc::tce::v1::Batch; use topos_metrics::{P2P_DUPLICATE_MESSAGE_ID_RECEIVED_TOTAL, P2P_GOSSIP_BATCH_SIZE}; -use tracing::{debug, error}; +use tracing::{debug, error, warn}; use crate::{constants, event::ComposedEvent, TOPOS_ECHO, TOPOS_GOSSIP, TOPOS_READY}; @@ -147,7 +147,7 @@ impl NetworkBehaviour for Behaviour { ) } - fn on_swarm_event(&mut self, event: libp2p::swarm::FromSwarm) { + fn on_swarm_event(&mut self, event: libp2p::swarm::FromSwarm) { self.gossipsub.on_swarm_event(event) } @@ -164,7 +164,6 @@ impl NetworkBehaviour for Behaviour { 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 @@ -186,7 +185,7 @@ impl NetworkBehaviour for Behaviour { } } - let event = match self.gossipsub.poll(cx, params) { + let event = match self.gossipsub.poll(cx) { Poll::Pending => return Poll::Pending, Poll::Ready(ToSwarm::GenerateEvent(event)) => Some(event), Poll::Ready(ToSwarm::ListenOn { opts }) => { @@ -225,6 +224,10 @@ impl NetworkBehaviour for Behaviour { Poll::Ready(ToSwarm::NewExternalAddrCandidate(addr)) => { return Poll::Ready(ToSwarm::NewExternalAddrCandidate(addr)) } + Poll::Ready(event) => { + warn!("Unhandled event in gossip behaviour: {:?}", event); + None + } }; if let Some(gossipsub::Event::Message { ref message_id, .. }) = event { diff --git a/crates/topos-p2p/src/behaviour/grpc.rs b/crates/topos-p2p/src/behaviour/grpc.rs index 0443e16ce..df2e4e805 100644 --- a/crates/topos-p2p/src/behaviour/grpc.rs +++ b/crates/topos-p2p/src/behaviour/grpc.rs @@ -313,9 +313,8 @@ impl Behaviour { peer_id, connection_id, endpoint, - handler, remaining_established, - }: ConnectionClosed<::ConnectionHandler>, + }: ConnectionClosed, ) { debug!("Connection {connection_id} closed with peer {peer_id}"); if let Some(connections) = self.connected.get_mut(&peer_id) { @@ -514,7 +513,7 @@ impl NetworkBehaviour for Behaviour { } } - fn on_swarm_event(&mut self, event: FromSwarm) { + fn on_swarm_event(&mut self, event: FromSwarm) { match event { FromSwarm::ConnectionEstablished(connection_established) => { self.on_connection_established(connection_established) @@ -535,13 +534,13 @@ impl NetworkBehaviour for Behaviour { | FromSwarm::ListenerError(_) | FromSwarm::NewExternalAddrCandidate(_) | FromSwarm::NewListenAddr(_) => (), + event => debug!("Unhandled event from swarm (grpc): {:?}", event), } } fn poll( &mut self, cx: &mut Context<'_>, - params: &mut impl libp2p::swarm::PollParameters, ) -> Poll>> { // Sending event to both `Swarm` and `ConnectionHandler` if let Some(ev) = self.pending_events.pop_front() { diff --git a/crates/topos-p2p/src/behaviour/grpc/handler.rs b/crates/topos-p2p/src/behaviour/grpc/handler.rs index 11b83095d..0f0d5b301 100644 --- a/crates/topos-p2p/src/behaviour/grpc/handler.rs +++ b/crates/topos-p2p/src/behaviour/grpc/handler.rs @@ -9,7 +9,7 @@ use std::{ use libp2p::swarm::{ handler::{ConnectionEvent, DialUpgradeError, FullyNegotiatedInbound, FullyNegotiatedOutbound}, - ConnectionHandler, ConnectionHandlerEvent, KeepAlive, SubstreamProtocol, + ConnectionHandler, ConnectionHandlerEvent, SubstreamProtocol, }; use tracing::{debug, warn}; @@ -36,7 +36,7 @@ pub struct Handler { /// Optional outbound request id outbound_request_id: Option, protocols: HashSet, - keep_alive: KeepAlive, + keep_alive: bool, } impl Handler { @@ -46,7 +46,7 @@ impl Handler { pending_events: VecDeque::new(), outbound_request_id: None, protocols, - keep_alive: KeepAlive::Yes, + keep_alive: true, } } } @@ -56,8 +56,6 @@ impl ConnectionHandler for Handler { type ToBehaviour = event::Event; - type Error = void::Void; - type InboundProtocol = GrpcUpgradeProtocol; type OutboundProtocol = GrpcUpgradeProtocol; @@ -77,7 +75,7 @@ impl ConnectionHandler for Handler { ) } - fn connection_keep_alive(&self) -> libp2p::swarm::KeepAlive { + fn connection_keep_alive(&self) -> bool { self.keep_alive } @@ -127,7 +125,7 @@ impl ConnectionHandler for Handler { self.pending_events.push_back(Event::OutboundTimeout(info)); // Closing the connection handler - self.keep_alive = KeepAlive::No; + self.keep_alive = false; } ConnectionEvent::DialUpgradeError(DialUpgradeError { info, @@ -137,13 +135,14 @@ impl ConnectionHandler for Handler { .push_back(Event::UnsupportedProtocol(info.request_id, info.protocol)); // Closing the connection handler - self.keep_alive = KeepAlive::No; + self.keep_alive = false; } ConnectionEvent::DialUpgradeError(_) | ConnectionEvent::AddressChange(_) | ConnectionEvent::ListenUpgradeError(_) | ConnectionEvent::LocalProtocolsChange(_) | ConnectionEvent::RemoteProtocolsChange(_) => (), + event => warn!("Unhandled connection event: {:?}", event), } } #[allow(deprecated)] @@ -155,7 +154,6 @@ impl ConnectionHandler for Handler { Self::OutboundProtocol, Self::OutboundOpenInfo, Self::ToBehaviour, - Self::Error, >, > { if let Some(event) = self.pending_events.pop_front() { diff --git a/crates/topos-p2p/src/client.rs b/crates/topos-p2p/src/client.rs index 47e4bcd25..1e2a1f667 100644 --- a/crates/topos-p2p/src/client.rs +++ b/crates/topos-p2p/src/client.rs @@ -4,7 +4,7 @@ use tokio::sync::{ mpsc::{self, error::SendError}, oneshot, }; -use tonic::transport::NamedService; +use tonic::server::NamedService; use topos_core::api::grpc::GrpcClient; use crate::{ diff --git a/crates/topos-p2p/src/event.rs b/crates/topos-p2p/src/event.rs index db18e1631..cb0dc02b9 100644 --- a/crates/topos-p2p/src/event.rs +++ b/crates/topos-p2p/src/event.rs @@ -17,6 +17,7 @@ pub enum ComposedEvent { Grpc(grpc::Event), Void, } + impl From for ComposedEvent { fn from(event: grpc::Event) -> Self { ComposedEvent::Grpc(event) diff --git a/crates/topos-p2p/src/lib.rs b/crates/topos-p2p/src/lib.rs index 864a3e682..a5e950025 100644 --- a/crates/topos-p2p/src/lib.rs +++ b/crates/topos-p2p/src/lib.rs @@ -26,8 +26,8 @@ pub use runtime::Runtime; use hyper::Body; use tonic::body::BoxBody; +use tonic::server::NamedService; use tonic::transport::server::Router; -use tonic::transport::NamedService; use topos_core::api::grpc::p2p::info_service_server::InfoService; use topos_core::api::grpc::p2p::info_service_server::InfoServiceServer; use tower::Service; @@ -89,7 +89,7 @@ pub mod utils { use libp2p::{identity, PeerId}; use tokio::{sync::mpsc, sync::oneshot}; - use tonic::transport::NamedService; + use tonic::server::NamedService; use topos_core::api::grpc::GrpcClient; use tracing::debug; diff --git a/crates/topos-p2p/src/network.rs b/crates/topos-p2p/src/network.rs index 2afdd4100..256903882 100644 --- a/crates/topos-p2p/src/network.rs +++ b/crates/topos-p2p/src/network.rs @@ -141,9 +141,7 @@ impl<'a> NetworkBuilder<'a> { dns_tcp.or_transport(tcp) }; - let mut multiplex_config = libp2p::yamux::Config::default(); - multiplex_config.set_window_update_mode(libp2p::yamux::WindowUpdateMode::on_read()); - multiplex_config.set_max_buffer_size(1024 * 1024 * 16); + let multiplex_config = libp2p::yamux::Config::default(); let transport = transport .upgrade(upgrade::Version::V1) diff --git a/crates/topos-p2p/src/runtime/handle_command.rs b/crates/topos-p2p/src/runtime/handle_command.rs index ce80eb89c..67e8d52a8 100644 --- a/crates/topos-p2p/src/runtime/handle_command.rs +++ b/crates/topos-p2p/src/runtime/handle_command.rs @@ -2,7 +2,7 @@ use crate::{ error::{CommandExecutionError, P2PError}, protocol_name, Command, Runtime, }; -use libp2p::{kad::record::Key, PeerId}; +use libp2p::{kad::RecordKey, PeerId}; use rand::{thread_rng, Rng}; use topos_metrics::P2P_MESSAGE_SENT_ON_GOSSIPSUB_TOTAL; use tracing::{debug, error, info, warn}; @@ -101,7 +101,7 @@ impl Runtime { let query_id = behaviour .discovery .inner - .get_record(Key::new(&to.to_string())); + .get_record(RecordKey::new(&to.to_string())); debug!("Created a get_record query {query_id:?} for discovering {to}"); if let Some(id) = self.pending_record_requests.insert(query_id, sender) { diff --git a/crates/topos-p2p/src/runtime/handle_event.rs b/crates/topos-p2p/src/runtime/handle_event.rs index 8d78118e0..94122e7a6 100644 --- a/crates/topos-p2p/src/runtime/handle_event.rs +++ b/crates/topos-p2p/src/runtime/handle_event.rs @@ -1,7 +1,4 @@ -use libp2p::{ - multiaddr::Protocol, - swarm::{derive_prelude::Either, SwarmEvent}, -}; +use libp2p::{multiaddr::Protocol, swarm::SwarmEvent}; use tracing::{debug, error, info, warn}; use crate::{event::ComposedEvent, Event, Runtime}; @@ -39,21 +36,8 @@ impl EventHandler for Runtime { } #[async_trait::async_trait] -impl - EventHandler< - SwarmEvent< - ComposedEvent, - Either, void::Void>, void::Void>, - >, - > for Runtime -{ - async fn handle( - &mut self, - event: SwarmEvent< - ComposedEvent, - Either, void::Void>, void::Void>, - >, - ) { +impl EventHandler> for Runtime { + async fn handle(&mut self, event: SwarmEvent) { match event { SwarmEvent::NewListenAddr { listener_id, @@ -67,9 +51,21 @@ impl self.active_listeners.insert(listener_id); } - SwarmEvent::OutgoingConnectionError { peer_id, error, .. } => { - if let Some(_peer_id) = peer_id { - error!("OutgoingConnectionError {error:?}"); + SwarmEvent::OutgoingConnectionError { + peer_id, + error, + connection_id, + } => { + if let Some(peer_id) = peer_id { + error!( + "OutgoingConnectionError peer_id: {peer_id} | error: {error:?} | \ + connection_id: {connection_id}" + ); + } else { + error!( + "OutgoingConnectionError for unknown peer | error: {error:?} | \ + connection_id: {connection_id}" + ); } } @@ -91,7 +87,10 @@ impl connection_id, send_back_addr, } => { - debug!("IncomingConnection {local_addr} | {connection_id} | {send_back_addr}") + debug!( + "IncomingConnection | local_addr: {local_addr} | connection_id: \ + {connection_id} | send_back_addr: {send_back_addr}" + ) } SwarmEvent::ListenerClosed { listener_id, @@ -113,7 +112,7 @@ impl peer_id, connection_id, } => { - debug!("Dialing {peer_id:?} | {connection_id}"); + debug!("Dialing peer_id: {peer_id:?} | connection_id: {connection_id}"); } SwarmEvent::Behaviour(event) => { @@ -128,6 +127,9 @@ impl SwarmEvent::ListenerError { listener_id, error } => { error!("Unhandled ListenerError {listener_id:?} | {error}") } + event => { + warn!("Unhandled SwarmEvent: {:?}", event); + } } } } diff --git a/crates/topos-p2p/src/runtime/handle_event/discovery.rs b/crates/topos-p2p/src/runtime/handle_event/discovery.rs index 0adc4b3cf..8aeac681f 100644 --- a/crates/topos-p2p/src/runtime/handle_event/discovery.rs +++ b/crates/topos-p2p/src/runtime/handle_event/discovery.rs @@ -103,6 +103,7 @@ impl EventHandler> for Runtime { Event::OutboundQueryProgressed { id, result, stats, .. } => {} + Event::ModeChanged { new_mode } => {} } } } diff --git a/crates/topos-p2p/src/tests/behaviour/grpc.rs b/crates/topos-p2p/src/tests/behaviour/grpc.rs index aa884d97d..e3307ed92 100644 --- a/crates/topos-p2p/src/tests/behaviour/grpc.rs +++ b/crates/topos-p2p/src/tests/behaviour/grpc.rs @@ -6,7 +6,8 @@ use rstest::rstest; use test_log::test; use tokio::spawn; use tokio_util::sync::CancellationToken; -use tonic::transport::{NamedService, Server}; +use tonic::server::NamedService; +use tonic::transport::Server; use topos_test_sdk::grpc::{ behaviour::{ helloworld::{ @@ -178,10 +179,13 @@ async fn execute_query() { let mut client_swarm = Swarm::new_ephemeral(|_| grpc::Behaviour::new(GrpcContext::default())); let mut server_swarm = Swarm::new_ephemeral(|_| grpc::Behaviour::new(router)); + let (multiaddr, _) = server_swarm.listen().await; let server_peer_id = *server_swarm.local_peer_id(); - server_swarm.listen().await; - client_swarm.connect(&mut server_swarm).await; + client_swarm + .behaviour_mut() + .add_address(&server_peer_id, multiaddr); + let outbound_connection = client_swarm.behaviour_mut().open_outbound_connection( &server_peer_id, protocol_name!(GreeterServer::::NAME), @@ -273,8 +277,10 @@ async fn incompatible_protocol() { let server_peer_id = *server_swarm.local_peer_id(); - server_swarm.listen().await; - client_swarm.connect(&mut server_swarm).await; + let (multiaddr, _) = server_swarm.listen().await; + client_swarm + .behaviour_mut() + .add_address(&server_peer_id, multiaddr); let outbound_connection = client_swarm.behaviour_mut().open_outbound_connection( &server_peer_id, diff --git a/crates/topos-tce-api/Cargo.toml b/crates/topos-tce-api/Cargo.toml index c3277c160..31db45562 100644 --- a/crates/topos-tce-api/Cargo.toml +++ b/crates/topos-tce-api/Cargo.toml @@ -34,8 +34,8 @@ tower.workspace = true tracing.workspace = true uuid.workspace = true -tonic-health = "0.10.0" -tonic-reflection = "0.10.0" +tonic-health = "0.11.0" +tonic-reflection = "0.11.0" pin-project = "1.0.12" async-recursion = "1.0" diff --git a/crates/topos-tce-synchronizer/src/checkpoints_collector/tests/integration.rs b/crates/topos-tce-synchronizer/src/checkpoints_collector/tests/integration.rs index e2401929b..25dd85100 100644 --- a/crates/topos-tce-synchronizer/src/checkpoints_collector/tests/integration.rs +++ b/crates/topos-tce-synchronizer/src/checkpoints_collector/tests/integration.rs @@ -16,8 +16,6 @@ use topos_test_sdk::{ }; use uuid::Uuid; -mod mock; - use crate::SynchronizerService; #[rstest] diff --git a/crates/topos-tce-synchronizer/src/checkpoints_collector/tests/integration/mock.rs b/crates/topos-tce-synchronizer/src/checkpoints_collector/tests/integration/mock.rs deleted file mode 100644 index 5b9158a0b..000000000 --- a/crates/topos-tce-synchronizer/src/checkpoints_collector/tests/integration/mock.rs +++ /dev/null @@ -1,28 +0,0 @@ -use async_trait::async_trait; -use tonic::Request; -use topos_core::api::grpc::tce::v1::{ - synchronizer_service_server::SynchronizerService, CheckpointRequest, FetchCertificatesRequest, -}; - -struct MockSynchronizerServer {} - -#[async_trait] -impl SynchronizerService for MockSynchronizerServer { - async fn fetch_checkpoint( - &self, - _request: Request, - ) -> Result, tonic::Status> - { - todo!() - } - - async fn fetch_certificates( - &self, - _request: Request, - ) -> Result< - tonic::Response, - tonic::Status, - > { - todo!() - } -} diff --git a/crates/topos-telemetry/Cargo.toml b/crates/topos-telemetry/Cargo.toml index 32060784c..d36247d4f 100644 --- a/crates/topos-telemetry/Cargo.toml +++ b/crates/topos-telemetry/Cargo.toml @@ -8,6 +8,7 @@ workspace = true [dependencies] opentelemetry.workspace = true +opentelemetry_sdk = { workspace = true, features = ["rt-tokio"] } tracing-opentelemetry.workspace = true tracing.workspace = true tonic.workspace = true diff --git a/crates/topos-telemetry/src/tracing.rs b/crates/topos-telemetry/src/tracing.rs index c8da45cdb..e464dec81 100644 --- a/crates/topos-telemetry/src/tracing.rs +++ b/crates/topos-telemetry/src/tracing.rs @@ -1,9 +1,8 @@ -use opentelemetry::sdk::metrics::controllers::BasicController; -use opentelemetry::sdk::trace::{BatchConfig, BatchSpanProcessor, SpanLimits}; -use opentelemetry::sdk::{propagation::TraceContextPropagator, trace::Sampler, Resource}; use opentelemetry::trace::TracerProvider; use opentelemetry::{global, KeyValue}; use opentelemetry_otlp::{SpanExporterBuilder, WithExportConfig}; +use opentelemetry_sdk::trace::{BatchConfigBuilder, BatchSpanProcessor, SpanLimits}; +use opentelemetry_sdk::{propagation::TraceContextPropagator, trace::Sampler, Resource}; use std::time::Duration; use tracing::Level; use tracing_subscriber::util::TryInitError; @@ -67,7 +66,7 @@ pub fn setup_tracing( otlp_agent: Option, otlp_service_name: Option, version: &'static str, -) -> Result, TryInitError> { +) -> Result<(), TryInitError> { let mut layers = Vec::new(); let ansi = !no_color; @@ -97,12 +96,10 @@ pub fn setup_tracing( ); // Setup instrumentation if both otlp agent and otlp service name are provided as arguments - let metrics: Option<_> = if let (Some(otlp_agent), Some(otlp_service_name)) = - (otlp_agent, otlp_service_name) - { + if let (Some(otlp_agent), Some(otlp_service_name)) = (otlp_agent, otlp_service_name) { let resources = build_resources(otlp_service_name, version); - let mut trace_config = opentelemetry::sdk::trace::config(); + let mut trace_config = opentelemetry_sdk::trace::config(); trace_config = trace_config.with_sampler(Sampler::AlwaysOn); trace_config = trace_config.with_max_events_per_span( @@ -150,10 +147,9 @@ pub fn setup_tracing( let exporter = opentelemetry_otlp::new_exporter() .tonic() - .with_env() .with_endpoint(otlp_agent); - let batch_processor_config = BatchConfig::default() + let batch_processor_config = BatchConfigBuilder::default() .with_scheduled_delay(match std::env::var("OTLP_BATCH_SCHEDULED_DELAY") { Ok(v) => Duration::from_millis(v.parse::().unwrap_or(5_000)), _ => Duration::from_millis(5_000), @@ -178,21 +174,25 @@ pub fn setup_tracing( ); let span_exporter: SpanExporterBuilder = exporter.into(); - let mut provider_builder = opentelemetry::sdk::trace::TracerProvider::builder() + let mut provider_builder = opentelemetry_sdk::trace::TracerProvider::builder() .with_span_processor( BatchSpanProcessor::builder( span_exporter.build_span_exporter().unwrap(), - opentelemetry::runtime::Tokio, + opentelemetry_sdk::runtime::Tokio, ) - .with_batch_config(batch_processor_config) + .with_batch_config(batch_processor_config.build()) .build(), ); provider_builder = provider_builder.with_config(trace_config); let provider = provider_builder.build(); - let tracer = - provider.versioned_tracer("opentelemetry-otlp", Some(env!("CARGO_PKG_VERSION")), None); + let tracer = provider.versioned_tracer( + "opentelemetry-otlp", + Some(env!("CARGO_PKG_VERSION")), + None::<&str>, + None, + ); let _ = global::set_tracer_provider(provider); @@ -206,13 +206,9 @@ pub fn setup_tracing( opentelemetry::global::set_text_map_propagator(TraceContextPropagator::new()); global::set_text_map_propagator(TraceContextPropagator::new()); - - None - } else { - None - }; + } tracing_subscriber::registry().with(layers).try_init()?; - Ok(metrics) + Ok(()) } diff --git a/crates/topos/src/components/regtest/mod.rs b/crates/topos/src/components/regtest/mod.rs index 7c2a71b4a..b6dbbf92c 100644 --- a/crates/topos/src/components/regtest/mod.rs +++ b/crates/topos/src/components/regtest/mod.rs @@ -8,7 +8,6 @@ use tokio::{ use topos_certificate_spammer::{error::Error, CertificateSpammerConfig}; use topos_telemetry::tracing::setup_tracing; use tracing::{error, info}; -use tracing_opentelemetry::OpenTelemetrySpanExt; pub(crate) mod commands; @@ -36,7 +35,7 @@ pub(crate) async fn handle_command( // Setup instrumentation if both otlp agent and otlp service name // are provided as arguments - let basic_controller = setup_tracing( + setup_tracing( verbose, false, cmd.otlp_agent, @@ -63,11 +62,6 @@ pub(crate) async fn handle_command( } result = &mut runtime =>{ global::shutdown_tracer_provider(); - if let Some(basic_controller) = basic_controller { - if let Err(e) = basic_controller.stop(&tracing::Span::current().context()) { - error!("Error stopping tracing: {e}"); - } - } if let Ok(Err(Error::BenchmarkConfig(ref msg))) = result { error!("Benchmark configuration error:\n{}", msg);