From f2956c398883515b5a4f648cb1f6484754fdc7a5 Mon Sep 17 00:00:00 2001 From: Mariusz Reichert Date: Fri, 20 Sep 2024 11:59:06 +0200 Subject: [PATCH 1/6] Introducing opentelemetry tracing dependencies --- Cargo.lock | 1603 +++++++++++++++++++++++++++++++++++++++++----------- Cargo.toml | 8 +- 2 files changed, 1279 insertions(+), 332 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1f95506c1..dd1c6118c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,24 +4,24 @@ version = 3 [[package]] name = "addr2line" -version = "0.21.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] [[package]] -name = "adler" -version = "1.0.2" +name = "adler2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "aes" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" dependencies = [ "cfg-if", "cipher", @@ -30,9 +30,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] @@ -69,9 +69,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.79" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" +checksum = "c1fd03a028ef38ba2276dce7e33fcd6369c158a1bca17946c4b1b701891c1ff7" [[package]] name = "arraydeque" @@ -81,9 +81,9 @@ checksum = "7d902e3d592a523def97af8f317b08ce16b7ab854c1985a0c671e6f15cebc236" [[package]] name = "arrayref" -version = "0.3.7" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" [[package]] name = "ascii" @@ -91,6 +91,17 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d92bec98840b8f03a5ff5413de5293bfcd8bf96467cf5452609f939ec6f5de16" +[[package]] +name = "async-trait" +version = "0.1.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] + [[package]] name = "atty" version = "0.2.14" @@ -104,23 +115,68 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.1.0" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "axum" +version = "0.6.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" +dependencies = [ + "async-trait", + "axum-core", + "bitflags 1.3.2", + "bytes", + "futures-util", + "http", + "http-body", + "hyper", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "sync_wrapper", + "tower", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum-core" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http", + "http-body", + "mime", + "rustversion", + "tower-layer", + "tower-service", +] [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", "miniz_oxide", "object", "rustc-demangle", + "windows-targets 0.52.6", ] [[package]] @@ -152,9 +208,9 @@ checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64" -version = "0.22.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64-compat" @@ -210,7 +266,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.48", + "syn 2.0.90", ] [[package]] @@ -340,9 +396,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.2" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "block-buffer" @@ -355,9 +411,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "byteorder" @@ -367,9 +423,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.5.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" [[package]] name = "bzip2" @@ -400,11 +456,13 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.0.85" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b918671670962b48bc23753aef0c51d072dca6f52f01f800854ada6ddb7f7d3" +checksum = "27f657647bcff5394bf56c7317665bbf790a137a50eaaa5c6bfbb9e27a518f2d" dependencies = [ + "jobserver", "libc", + "shlex", ] [[package]] @@ -434,16 +492,16 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.34" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", "wasm-bindgen", - "windows-targets 0.52.0", + "windows-targets 0.52.6", ] [[package]] @@ -491,9 +549,9 @@ dependencies = [ [[package]] name = "clang-sys" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" dependencies = [ "glob", "libc", @@ -538,9 +596,9 @@ dependencies = [ [[package]] name = "const_fn" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbdcdcb6d86f71c5e97409ad45898af11cbc995b4ee8112d59095a28d376c935" +checksum = "373e9fafaa20882876db20562275ff58d50e0caa2590077fe7ce7bef90211d0d" [[package]] name = "constant_time_eq" @@ -575,26 +633,36 @@ dependencies = [ "url", ] +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" dependencies = [ "libc", ] [[package]] name = "crc32fast" -version = "1.4.0" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] @@ -650,9 +718,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.12" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab3db02a9c5b5121e1e42fbdb1aeb65f5e02624cc58c43f2884c6ccac0b82f95" +checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" dependencies = [ "crossbeam-utils", ] @@ -687,9 +755,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crunchy" @@ -765,11 +833,22 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] + [[package]] name = "either" -version = "1.10.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "electrs" @@ -777,7 +856,7 @@ version = "0.4.1" dependencies = [ "arraydeque", "arrayref", - "base64 0.22.0", + "base64 0.22.1", "bincode", "bitcoin 0.31.2", "bitcoin-test-data", @@ -800,6 +879,9 @@ dependencies = [ "libc", "log", "num_cpus", + "opentelemetry", + "opentelemetry-otlp", + "opentelemetry-semantic-conventions", "page_size", "prometheus", "rayon", @@ -813,10 +895,13 @@ dependencies = [ "stderrlog", "sysconf", "tempfile", - "time 0.3.36", + "time 0.3.37", "tiny_http", "tokio", - "ureq 2.9.6", + "tracing", + "tracing-opentelemetry", + "tracing-subscriber", + "ureq 2.12.1", "url", "zmq", ] @@ -875,6 +960,15 @@ dependencies = [ "tar", ] +[[package]] +name = "encoding_rs" +version = "0.8.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" +dependencies = [ + "cfg-if", +] + [[package]] name = "equivalent" version = "1.0.1" @@ -894,12 +988,12 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.8" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -924,27 +1018,27 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.1" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "filetime" -version = "0.2.23" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" dependencies = [ "cfg-if", "libc", - "redox_syscall", - "windows-sys 0.52.0", + "libredox", + "windows-sys 0.59.0", ] [[package]] name = "flate2" -version = "1.0.28" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" dependencies = [ "crc32fast", "miniz_oxide", @@ -973,45 +1067,71 @@ checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", ] [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-executor" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.90", ] +[[package]] +name = "futures-sink" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" + [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-core", + "futures-io", "futures-macro", + "futures-sink", "futures-task", + "memchr", "pin-project-lite", "pin-utils", "slab", @@ -1035,9 +1155,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -1046,9 +1166,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.1" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "glob" @@ -1056,6 +1176,25 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +[[package]] +name = "h2" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap 2.7.0", + "slab", + "tokio", + "tokio-util", + "tracing", +] + [[package]] name = "half" version = "2.4.1" @@ -1074,9 +1213,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.5" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" [[package]] name = "heck" @@ -1095,9 +1234,15 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.5" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + +[[package]] +name = "hermit-abi" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c62115964e08cb8039170eb33c1d0e2388a256930279edca206fff675f82c3" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" [[package]] name = "hex" @@ -1107,9 +1252,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-conservative" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ed443af458ccb6d81c1e7e661545f94d3176752fb1df2f543b902a1e0f51e2" +checksum = "212ab92002354b4819390025006c897e8140934349e8635c9b077f47b4dcbd20" [[package]] name = "hex_lit" @@ -1137,9 +1282,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ "bytes", "fnv", @@ -1159,9 +1304,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "httpdate" @@ -1171,14 +1316,15 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "0.14.28" +version = "0.14.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +checksum = "8c08302e8fa335b151b788c775ff56e7a03ae64ff85c548ee820fecb70356e85" dependencies = [ "bytes", "futures-channel", "futures-core", "futures-util", + "h2", "http", "http-body", "httparse", @@ -1192,6 +1338,18 @@ dependencies = [ "want", ] +[[package]] +name = "hyper-timeout" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" +dependencies = [ + "hyper", + "pin-project-lite", + "tokio", + "tokio-io-timeout", +] + [[package]] name = "hyperlocal" version = "0.8.0" @@ -1207,9 +1365,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.60" +version = "0.1.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -1228,6 +1386,124 @@ dependencies = [ "cc", ] +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] + [[package]] name = "idna" version = "0.2.3" @@ -1241,12 +1517,23 @@ dependencies = [ [[package]] name = "idna" -version = "0.5.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", ] [[package]] @@ -1261,12 +1548,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.5.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", - "hashbrown 0.14.5", + "hashbrown 0.15.2", ] [[package]] @@ -1278,13 +1565,19 @@ dependencies = [ "generic-array", ] +[[package]] +name = "ipnet" +version = "2.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" + [[package]] name = "is-terminal" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" +checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" dependencies = [ - "hermit-abi 0.3.5", + "hermit-abi 0.4.0", "libc", "windows-sys 0.52.0", ] @@ -1309,16 +1602,26 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.10" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" + +[[package]] +name = "jobserver" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +dependencies = [ + "libc", +] [[package]] name = "js-sys" -version = "0.3.68" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" +checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7" dependencies = [ + "once_cell", "wasm-bindgen", ] @@ -1366,9 +1669,9 @@ dependencies = [ [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "lazycell" @@ -1378,27 +1681,27 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.153" +version = "0.2.168" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d" [[package]] name = "libloading" -version = "0.8.1" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" dependencies = [ "cfg-if", - "windows-sys 0.48.0", + "windows-targets 0.52.6", ] [[package]] name = "libredox" -version = "0.0.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "libc", "redox_syscall", ] @@ -1421,9 +1724,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.15" +version = "1.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "037731f5d3aaa87a5675e895b63ddff1a87624bc29f77004ea829809654e48f6" +checksum = "d2d16453e800a8cf6dd2fc3eb4bc99b786a9b90c663b8559a5b1a041bf89e472" dependencies = [ "cc", "pkg-config", @@ -1432,15 +1735,21 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" + +[[package]] +name = "litemap" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -1448,31 +1757,52 @@ dependencies = [ [[package]] name = "log" -version = "0.4.21" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "lz4-sys" -version = "1.9.4" +version = "1.11.1+lz4-1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d27b317e207b10f69f5e75494119e391a96f48861ae870d1da6edac98ca900" +checksum = "6bd8c0d6c6ed0cd30b3652886bb8711dc4bb01d637a68105a3d5158039b418e6" dependencies = [ "cc", "libc", ] +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + [[package]] name = "matches" version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" +[[package]] +name = "matchit" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" + [[package]] name = "memchr" -version = "2.7.1" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "minimal-lexical" @@ -1482,35 +1812,35 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.2" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" dependencies = [ - "adler", + "adler2", ] [[package]] name = "minreq" -version = "2.11.0" +version = "2.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb3371dfc7b772c540da1380123674a8e20583aca99907087d990ca58cf44203" +checksum = "36a8e50e917e18a37d500d27d40b7bc7d127e71c0c94fb2d83f43b4afd308390" dependencies = [ "log", "once_cell", - "rustls 0.21.10", + "rustls 0.21.12", "rustls-webpki", "webpki-roots 0.25.4", ] [[package]] name = "mio" -version = "0.8.10" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ "libc", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1523,6 +1853,16 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi 0.3.9", +] + [[package]] name = "num-conv" version = "0.1.0" @@ -1531,9 +1871,9 @@ checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" [[package]] name = "num-traits" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] @@ -1544,24 +1884,24 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.5", + "hermit-abi 0.3.9", "libc", ] [[package]] name = "object" -version = "0.32.2" +version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "oorandom" @@ -1570,16 +1910,135 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" [[package]] -name = "option-ext" -version = "0.2.0" +name = "opentelemetry" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" +checksum = "9591d937bc0e6d2feb6f71a559540ab300ea49955229c347a517a28d27784c54" +dependencies = [ + "opentelemetry_api", + "opentelemetry_sdk", +] [[package]] -name = "os_str_bytes" -version = "6.6.1" +name = "opentelemetry-http" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" +checksum = "c7594ec0e11d8e33faf03530a4c49af7064ebba81c1480e01be67d90b356508b" +dependencies = [ + "async-trait", + "bytes", + "http", + "opentelemetry_api", + "reqwest", +] + +[[package]] +name = "opentelemetry-otlp" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e5e5a5c4135864099f3faafbe939eb4d7f9b80ebf68a8448da961b32a7c1275" +dependencies = [ + "async-trait", + "futures-core", + "http", + "opentelemetry-http", + "opentelemetry-proto", + "opentelemetry-semantic-conventions", + "opentelemetry_api", + "opentelemetry_sdk", + "prost", + "reqwest", + "thiserror", + "tokio", + "tonic", +] + +[[package]] +name = "opentelemetry-proto" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1e3f814aa9f8c905d0ee4bde026afd3b2577a97c10e1699912e3e44f0c4cbeb" +dependencies = [ + "opentelemetry_api", + "opentelemetry_sdk", + "prost", + "tonic", +] + +[[package]] +name = "opentelemetry-semantic-conventions" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73c9f9340ad135068800e7f1b24e9e09ed9e7143f5bf8518ded3d3ec69789269" +dependencies = [ + "opentelemetry", +] + +[[package]] +name = "opentelemetry_api" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a81f725323db1b1206ca3da8bb19874bbd3f57c3bcd59471bfb04525b265b9b" +dependencies = [ + "futures-channel", + "futures-util", + "indexmap 1.9.3", + "js-sys", + "once_cell", + "pin-project-lite", + "thiserror", + "urlencoding", +] + +[[package]] +name = "opentelemetry_sdk" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa8e705a0612d48139799fcbaba0d4a90f06277153e43dd2bdc16c6f0edd8026" +dependencies = [ + "async-trait", + "crossbeam-channel", + "futures-channel", + "futures-executor", + "futures-util", + "once_cell", + "opentelemetry_api", + "ordered-float", + "percent-encoding", + "rand 0.8.5", + "regex", + "serde_json", + "thiserror", + "tokio", + "tokio-stream", +] + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "ordered-float" +version = "3.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1e1c390732d15f1d48471625cd92d154e66db2c56645e29a9cd26f4699f72dc" +dependencies = [ + "num-traits", +] + +[[package]] +name = "os_str_bytes" +version = "6.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "page_size" @@ -1593,9 +2052,9 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core", @@ -1603,15 +2062,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.9" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] [[package]] @@ -1651,29 +2110,29 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project" -version = "1.1.4" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0302c4a0442c456bd56f841aee5c3bfd17967563f6fadc9ceb9f9c23cf3807e0" +checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.4" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" +checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.90", ] [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" [[package]] name = "pin-utils" @@ -1683,15 +2142,15 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.29" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "plotters" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a15b6eccb8484002195a3e44fe65a4ce8e93a625797a063735536fd59cb01cf3" +checksum = "5aeb6f403d7a4911efb1e33402027fc44f29b5bf6def3effcc22d7bb75f2b747" dependencies = [ "num-traits", "plotters-backend", @@ -1702,15 +2161,15 @@ dependencies = [ [[package]] name = "plotters-backend" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "414cec62c6634ae900ea1c56128dfe87cf63e7caece0852ec76aba307cebadb7" +checksum = "df42e13c12958a16b3f7f4386b9ab1f3e7933914ecea48da7139435263a4172a" [[package]] name = "plotters-svg" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81b30686a7d9c3e010b84284bdd26a29f2138574f52f5eb6f794fc0ad924e705" +checksum = "51bae2ac328883f7acdfea3d66a7c35751187f870bc81f94563733a154d7a670" dependencies = [ "plotters-backend", ] @@ -1723,18 +2182,21 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] [[package]] name = "prettyplease" -version = "0.2.16" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" +checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" dependencies = [ "proc-macro2", - "syn 2.0.48", + "syn 2.0.90", ] [[package]] @@ -1745,18 +2207,18 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] [[package]] name = "prometheus" -version = "0.13.3" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "449811d15fbdf5ceb5c1144416066429cf82316e2ec8ce0c1f6f8a02e7bbcf8c" +checksum = "3d33c28a30771f7f96db69893f78b857f7450d7e0237e9c8fc6427a81bae7ed1" dependencies = [ "cfg-if", "fnv", @@ -1767,6 +2229,29 @@ dependencies = [ "thiserror", ] +[[package]] +name = "prost" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" +dependencies = [ + "bytes", + "prost-derive", +] + +[[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 = "protobuf" version = "2.28.0" @@ -1794,9 +2279,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.35" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -1900,18 +2385,18 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.4.1" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", ] [[package]] name = "redox_users" -version = "0.4.4" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom", "libredox", @@ -1920,32 +2405,83 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.3" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", - "regex-automata", - "regex-syntax", + "regex-automata 0.4.9", + "regex-syntax 0.8.5", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", ] [[package]] name = "regex-automata" -version = "0.4.5" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", - "regex-syntax", + "regex-syntax 0.8.5", ] [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "reqwest" +version = "0.11.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" +dependencies = [ + "base64 0.21.7", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "ipnet", + "js-sys", + "log", + "mime", + "once_cell", + "percent-encoding", + "pin-project-lite", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "system-configuration", + "tokio", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg", +] [[package]] name = "ring" @@ -1964,16 +2500,17 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.7" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", + "cfg-if", "getrandom", "libc", "spin 0.9.8", "untrusted 0.9.0", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -2001,9 +2538,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" @@ -2028,15 +2565,15 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.31" +version = "0.38.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" +checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" dependencies = [ - "bitflags 2.4.2", - "errno 0.3.8", + "bitflags 2.6.0", + "errno 0.3.10", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -2067,12 +2604,12 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.10" +version = "0.21.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", - "ring 0.17.7", + "ring 0.17.8", "rustls-webpki", "sct 0.7.1", ] @@ -2083,15 +2620,21 @@ version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring 0.17.7", + "ring 0.17.8", "untrusted 0.9.0", ] +[[package]] +name = "rustversion" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" + [[package]] name = "ryu" -version = "1.0.16" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "same-file" @@ -2124,7 +2667,7 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring 0.17.7", + "ring 0.17.8", "untrusted 0.9.0", ] @@ -2208,41 +2751,54 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.197" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.197" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.90", ] [[package]] name = "serde_json" -version = "1.0.115" +version = "1.0.133" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12dc5c46daa8e9fdf4f5e71b6cf9a53f2487da0e86e55808e2d35539666497dd" +checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] [[package]] name = "serde_spanned" -version = "0.6.7" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ + "form_urlencoded", + "itoa", + "ryu", "serde", ] @@ -2268,9 +2824,9 @@ dependencies = [ [[package]] name = "sha1_smol" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" +checksum = "bbfa15b3dddfee50a0fff136974b3e1bde555604ba463834a7eb7deb6417705d" [[package]] name = "sha2" @@ -2283,6 +2839,15 @@ dependencies = [ "digest", ] +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + [[package]] name = "shlex" version = "1.3.0" @@ -2301,9 +2866,9 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] @@ -2319,15 +2884,15 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.1" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" -version = "0.5.6" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" dependencies = [ "libc", "windows-sys 0.52.0", @@ -2356,6 +2921,12 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "standback" version = "0.2.17" @@ -2435,9 +3006,9 @@ checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" [[package]] name = "subtle" -version = "2.5.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -2452,15 +3023,32 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.48" +version = "2.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] + [[package]] name = "sysconf" version = "0.3.4" @@ -2473,6 +3061,27 @@ dependencies = [ "winapi 0.2.8", ] +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "system-deps" version = "6.2.2" @@ -2488,9 +3097,9 @@ dependencies = [ [[package]] name = "tar" -version = "0.4.40" +version = "0.4.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16afcea1f22891c49a00c751c7b63b2233284064f11a200fc624137c51e2ddb" +checksum = "c65998313f8e17d0d553d28f91a0df93e4dbbbf770279c7bc21ca0f09ea1a1f6" dependencies = [ "filetime", "libc", @@ -2505,14 +3114,15 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tempfile" -version = "3.10.1" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" dependencies = [ "cfg-if", "fastrand", + "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -2541,29 +3151,29 @@ checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" [[package]] name = "thiserror" -version = "1.0.57" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.57" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.90", ] [[package]] name = "thread_local" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ "cfg-if", "once_cell", @@ -2597,9 +3207,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.36" +version = "0.3.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" dependencies = [ "deranged", "itoa", @@ -2607,7 +3217,7 @@ dependencies = [ "powerfmt", "serde", "time-core", - "time-macros 0.2.18", + "time-macros 0.2.19", ] [[package]] @@ -2628,9 +3238,9 @@ dependencies = [ [[package]] name = "time-macros" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de" dependencies = [ "num-conv", "time-core", @@ -2661,6 +3271,16 @@ dependencies = [ "log", ] +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinytemplate" version = "1.2.1" @@ -2673,9 +3293,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ "tinyvec_macros", ] @@ -2688,29 +3308,63 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.37.0" +version = "1.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" +checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551" dependencies = [ "backtrace", + "bytes", "libc", "mio", - "num_cpus", "pin-project-lite", "socket2", "tokio-macros", - "windows-sys 0.48.0", + "windows-sys 0.52.0", +] + +[[package]] +name = "tokio-io-timeout" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" +dependencies = [ + "pin-project-lite", + "tokio", ] [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.90", +] + +[[package]] +name = "tokio-stream" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", ] [[package]] @@ -2736,40 +3390,164 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.21" +version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b072cee73c449a636ffd6f32bd8de3a9f7119139aff882f44943ce2986dc5cf" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ - "indexmap 2.5.0", + "indexmap 2.7.0", "serde", "serde_spanned", "toml_datetime", "winnow", ] +[[package]] +name = "tonic" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3082666a3a6433f7f511c7192923fa1fe07c69332d3c6a2e6bb040b569199d5a" +dependencies = [ + "async-trait", + "axum", + "base64 0.21.7", + "bytes", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-timeout", + "percent-encoding", + "pin-project", + "prost", + "tokio", + "tokio-stream", + "tower", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "indexmap 1.9.3", + "pin-project", + "pin-project-lite", + "rand 0.8.5", + "slab", + "tokio", + "tokio-util", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ + "log", "pin-project-lite", + "tracing-attributes", "tracing-core", ] +[[package]] +name = "tracing-attributes" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] + [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f751112709b4e791d8ce53e32c4ed2d353565a795ce84da2285393f41557bdf2" +dependencies = [ + "log", + "once_cell", + "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.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75327c6b667828ddc28f5e3f169036cb793c3f588d83bf0f262a7f062ffed3c8" +dependencies = [ + "once_cell", + "opentelemetry", + "opentelemetry_sdk", + "smallvec", + "tracing", + "tracing-core", + "tracing-log 0.1.4", + "tracing-subscriber", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" dependencies = [ + "matchers", + "nu-ansi-term", "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log 0.2.0", ] [[package]] @@ -2786,30 +3564,30 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unicode-bidi" -version = "0.3.15" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" +checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" dependencies = [ "tinyvec", ] [[package]] name = "unicode-width" -version = "0.1.11" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] name = "untrusted" @@ -2844,11 +3622,11 @@ dependencies = [ [[package]] name = "ureq" -version = "2.9.6" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11f214ce18d8b2cbe84ed3aa6486ed3f5b285cf8d8fbdbce9f3f767a724adc35" +checksum = "02d1a66277ed75f640d608235660df48c8e3c19f3b4edb6a263315626cc3c01d" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "log", "once_cell", "serde", @@ -2858,15 +3636,39 @@ dependencies = [ [[package]] name = "url" -version = "2.5.0" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", - "idna 0.5.0", + "idna 1.0.3", "percent-encoding", ] +[[package]] +name = "urlencoding" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" + +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + [[package]] name = "vcpkg" version = "0.2.15" @@ -2887,9 +3689,9 @@ checksum = "852e951cb7832cb45cb1169900d19760cfa39b82bc0ea9c0e5a14ae88411c98b" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "walkdir" @@ -2924,34 +3726,47 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.91" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" +checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.91" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" +checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" dependencies = [ "bumpalo", "log", - "once_cell", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.90", "wasm-bindgen-shared", ] +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.49" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38176d9b44ea84e9184eff0bc34cc167ed044f816accfe5922e54d84cf48eca2" +dependencies = [ + "cfg-if", + "js-sys", + "once_cell", + "wasm-bindgen", + "web-sys", +] + [[package]] name = "wasm-bindgen-macro" -version = "0.2.91" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" +checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2959,28 +3774,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.91" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" +checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.90", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.91" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" +checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" [[package]] name = "web-sys" -version = "0.3.68" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446" +checksum = "04dd7223427d52553d3702c004d3b2fe07c148165faa56313cb00211e31c12bc" dependencies = [ "js-sys", "wasm-bindgen", @@ -3062,11 +3877,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.6" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "winapi 0.3.9", + "windows-sys 0.59.0", ] [[package]] @@ -3081,7 +3896,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.6", ] [[package]] @@ -3099,7 +3914,16 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", ] [[package]] @@ -3119,17 +3943,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -3140,9 +3965,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -3152,9 +3977,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -3164,9 +3989,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -3176,9 +4007,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -3188,9 +4019,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -3200,9 +4031,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -3212,19 +4043,41 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.18" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" dependencies = [ "memchr", ] +[[package]] +name = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + [[package]] name = "xattr" version = "1.3.1" @@ -3236,6 +4089,72 @@ dependencies = [ "rustix", ] +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] + +[[package]] +name = "zerofrom" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", + "synstructure", +] + [[package]] name = "zeromq-src" version = "0.2.6+4.3.4" @@ -3246,6 +4165,28 @@ dependencies = [ "dircpy", ] +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] + [[package]] name = "zip" version = "0.6.6" @@ -3262,7 +4203,7 @@ dependencies = [ "hmac", "pbkdf2", "sha1 0.10.6", - "time 0.3.36", + "time 0.3.37", "zstd", ] @@ -3309,9 +4250,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.9+zstd.1.5.5" +version = "2.0.13+zstd.1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" +checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" dependencies = [ "cc", "pkg-config", diff --git a/Cargo.toml b/Cargo.toml index a4fcd78b2..276dbd328 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -53,7 +53,13 @@ url = "2.2.0" hyper = "0.14" hyperlocal = "0.8" # close to same tokio version as dependent by hyper v0.14 and hyperlocal 0.8 -- things can go awry if they mismatch -tokio = { version = "1", features = ["sync", "macros"] } +tokio = { version = "1", features = ["sync", "macros", "rt-multi-thread", "rt"] } +opentelemetry = { version = "0.20.0", features = ["rt-tokio"] } +tracing-opentelemetry = "0.21.0" +opentelemetry-otlp = { version = "0.13.0", default-features = false, features = ["http-proto", "reqwest-client"] } +tracing-subscriber = { version = "0.3.17", features = ["env-filter"] } +opentelemetry-semantic-conventions = "0.12.0" +tracing = { version = "0.1.40", features = ["async-await", "log"] } # optional dependencies for electrum-discovery electrum-client = { version = "0.8", optional = true } From 3422bd55977275bf1ec2df470b065f6c4a66def2 Mon Sep 17 00:00:00 2001 From: Mariusz Reichert Date: Fri, 20 Sep 2024 12:00:00 +0200 Subject: [PATCH 2/6] Opentelemetry instrumentation implementation --- Cargo.lock | 33 +------------- Cargo.toml | 24 ++++++++--- src/bin/electrs.rs | 17 +++++++- src/config.rs | 1 + src/daemon.rs | 35 +++++++++++++++ src/electrum/discovery.rs | 44 +++++++++++-------- src/electrum/server.rs | 11 +++++ src/lib.rs | 9 ++++ src/new_index/fetch.rs | 8 ++++ src/new_index/mempool.rs | 34 ++++++++++++--- src/new_index/precache.rs | 4 ++ src/new_index/query.rs | 20 +++++++++ src/new_index/schema.rs | 3 +- src/otlp_trace.rs | 85 +++++++++++++++++++++++++++++++++++++ src/rest.rs | 4 ++ src/util/block.rs | 7 +++ src/util/electrum_merkle.rs | 6 ++- src/util/fees.rs | 3 ++ 18 files changed, 284 insertions(+), 64 deletions(-) create mode 100644 src/otlp_trace.rs diff --git a/Cargo.lock b/Cargo.lock index dd1c6118c..94f68464d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1853,16 +1853,6 @@ dependencies = [ "minimal-lexical", ] -[[package]] -name = "nu-ansi-term" -version = "0.46.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" -dependencies = [ - "overload", - "winapi 0.3.9", -] - [[package]] name = "num-conv" version = "0.1.0" @@ -2034,12 +2024,6 @@ version = "6.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" -[[package]] -name = "overload" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" - [[package]] name = "page_size" version = "0.6.0" @@ -3467,7 +3451,6 @@ version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ - "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -3505,17 +3488,6 @@ 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.21.0" @@ -3528,7 +3500,7 @@ dependencies = [ "smallvec", "tracing", "tracing-core", - "tracing-log 0.1.4", + "tracing-log", "tracing-subscriber", ] @@ -3539,15 +3511,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" dependencies = [ "matchers", - "nu-ansi-term", "once_cell", "regex", "sharded-slab", - "smallvec", "thread_local", "tracing", "tracing-core", - "tracing-log 0.2.0", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 276dbd328..f7d21a7c2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,6 +16,18 @@ default-run = "electrs" liquid = ["elements"] electrum-discovery = ["electrum-client"] bench = [] +default = ["no-otlp-tracing"] +otlp-tracing = [ + "tracing/max_level_trace", + "tracing-subscriber", + "opentelemetry", + "tracing-opentelemetry", + "opentelemetry-otlp", + "opentelemetry-semantic-conventions" +] +no-otlp-tracing = [ + "tracing/max_level_off" +] [dependencies] arraydeque = "0.5.1" @@ -54,12 +66,12 @@ hyper = "0.14" hyperlocal = "0.8" # close to same tokio version as dependent by hyper v0.14 and hyperlocal 0.8 -- things can go awry if they mismatch tokio = { version = "1", features = ["sync", "macros", "rt-multi-thread", "rt"] } -opentelemetry = { version = "0.20.0", features = ["rt-tokio"] } -tracing-opentelemetry = "0.21.0" -opentelemetry-otlp = { version = "0.13.0", default-features = false, features = ["http-proto", "reqwest-client"] } -tracing-subscriber = { version = "0.3.17", features = ["env-filter"] } -opentelemetry-semantic-conventions = "0.12.0" -tracing = { version = "0.1.40", features = ["async-await", "log"] } +opentelemetry = { version = "0.20.0", features = ["rt-tokio"], optional = true } +tracing-opentelemetry = { version = "0.21.0", optional = true } +opentelemetry-otlp = { version = "0.13.0", default-features = false, features = ["http-proto", "reqwest-client"], optional = true } +tracing-subscriber = { version = "0.3.17", default-features = false, features = ["env-filter", "fmt"], optional = true } +opentelemetry-semantic-conventions = { version = "0.12.0", optional = true } +tracing = { version = "0.1.40", default-features = false, features = ["attributes"] } # optional dependencies for electrum-discovery electrum-client = { version = "0.8", optional = true } diff --git a/src/bin/electrs.rs b/src/bin/electrs.rs index 59d3b5383..31e2aaf9b 100644 --- a/src/bin/electrs.rs +++ b/src/bin/electrs.rs @@ -21,6 +21,9 @@ use electrs::{ signal::Waiter, }; +#[cfg(feature = "otlp-tracing")] +use electrs::otlp_trace; + #[cfg(feature = "liquid")] use electrs::elements::AssetRegistry; use electrs::metrics::MetricOpts; @@ -148,10 +151,22 @@ fn run_server(config: Arc) -> Result<()> { Ok(()) } -fn main() { +fn main_() { let config = Arc::new(Config::from_args()); if let Err(e) = run_server(config) { error!("server failed: {}", e.display_chain()); process::exit(1); } } + +#[cfg(feature = "no-otlp-tracing")] +fn main() { + main_(); +} + +#[cfg(feature = "otlp-tracing")] +#[tokio::main] +async fn main() { + let _tracing_guard = otlp_trace::init_tracing("electrs"); + main_() +} diff --git a/src/config.rs b/src/config.rs index 17c94aaab..d083e988f 100644 --- a/src/config.rs +++ b/src/config.rs @@ -405,6 +405,7 @@ impl Config { stderrlog::Timestamp::Off }); log.init().expect("logging initialization failed"); + let config = Config { log, network_type, diff --git a/src/daemon.rs b/src/daemon.rs index 3aa1f0f3c..1dfe02212 100644 --- a/src/daemon.rs +++ b/src/daemon.rs @@ -20,6 +20,8 @@ use bitcoin::consensus::encode::{deserialize, serialize_hex}; #[cfg(feature = "liquid")] use elements::encode::{deserialize, serialize_hex}; +use tracing::instrument; + use crate::chain::{Block, BlockHash, BlockHeader, Network, Transaction, Txid}; use crate::metrics::{HistogramOpts, HistogramVec, Metrics}; use crate::signal::Waiter; @@ -42,6 +44,7 @@ lazy_static! { const MAX_ATTEMPTS: u32 = 5; const RETRY_WAIT_DURATION: Duration = Duration::from_secs(1); +#[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] fn parse_hash(value: &Value) -> Result where T: FromStr, @@ -55,6 +58,7 @@ where .chain_err(|| format!("non-hex value: {}", value))?) } +#[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] fn header_from_value(value: Value) -> Result { let header_hex = value .as_str() @@ -149,6 +153,7 @@ struct Connection { signal: Waiter, } +#[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] fn tcp_connect(addr: SocketAddr, signal: &Waiter) -> Result { loop { match TcpStream::connect_timeout(&addr, *DAEMON_CONNECTION_TIMEOUT) { @@ -171,6 +176,7 @@ fn tcp_connect(addr: SocketAddr, signal: &Waiter) -> Result { } impl Connection { + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] fn new( addr: SocketAddr, cookie_getter: Arc, @@ -190,10 +196,12 @@ impl Connection { }) } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] fn reconnect(&self) -> Result { Connection::new(self.addr, self.cookie_getter.clone(), self.signal.clone()) } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] fn send(&mut self, request: &str) -> Result<()> { let cookie = &self.cookie_getter.get()?; let msg = format!( @@ -207,6 +215,7 @@ impl Connection { }) } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] fn recv(&mut self) -> Result { // TODO: use proper HTTP parser. let mut in_header = true; @@ -372,6 +381,7 @@ impl Daemon { Ok(daemon) } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn reconnect(&self) -> Result { Ok(Daemon { daemon_dir: self.daemon_dir.clone(), @@ -386,6 +396,7 @@ impl Daemon { }) } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn list_blk_files(&self) -> Result> { let path = self.blocks_dir.join("blk*.dat"); debug!("listing block files at {:?}", path); @@ -421,6 +432,7 @@ impl Daemon { self.network.magic() } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] fn call_jsonrpc(&self, method: &str, request: &Value) -> Result { let mut conn = self.conn.lock().unwrap(); let timer = self.latency.with_label_values(&[method]).start_timer(); @@ -438,6 +450,7 @@ impl Daemon { Ok(result) } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!(), method = %method))] fn handle_request(&self, method: &str, params: &Value) -> Result { let id = self.message_id.next(); let req = json!({"method": method, "params": params, "id": id}); @@ -460,10 +473,12 @@ impl Daemon { } } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] fn request(&self, method: &str, params: Value) -> Result { self.retry_request(method, ¶ms) } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] fn retry_reconnect(&self) -> Daemon { // XXX add a max reconnection attempts limit? loop { @@ -478,12 +493,14 @@ impl Daemon { // Send requests in parallel over multiple RPC connections as individual JSON-RPC requests (with no JSON-RPC batching), // buffering the replies into a vector. If any of the requests fail, processing is terminated and an Err is returned. + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] fn requests(&self, method: &str, params_list: Vec) -> Result> { self.requests_iter(method, params_list).collect() } // Send requests in parallel over multiple RPC connections, iterating over the results without buffering them. // Errors are included in the iterator and do not terminate other pending requests. + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] fn requests_iter<'a>( &'a self, method: &'a str, @@ -506,24 +523,29 @@ impl Daemon { // bitcoind JSONRPC API: + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn getblockchaininfo(&self) -> Result { let info: Value = self.request("getblockchaininfo", json!([]))?; Ok(from_value(info).chain_err(|| "invalid blockchain info")?) } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] fn getnetworkinfo(&self) -> Result { let info: Value = self.request("getnetworkinfo", json!([]))?; Ok(from_value(info).chain_err(|| "invalid network info")?) } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn getbestblockhash(&self) -> Result { parse_hash(&self.request("getbestblockhash", json!([]))?) } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn getblockheader(&self, blockhash: &BlockHash) -> Result { header_from_value(self.request("getblockheader", json!([blockhash, /*verbose=*/ false]))?) } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn getblockheaders(&self, heights: &[usize]) -> Result> { let heights: Vec = heights.iter().map(|height| json!([height])).collect(); let params_list: Vec = self @@ -538,6 +560,7 @@ impl Daemon { Ok(result) } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn getblock(&self, blockhash: &BlockHash) -> Result { let block = block_from_value(self.request("getblock", json!([blockhash, /*verbose=*/ false]))?)?; @@ -545,10 +568,12 @@ impl Daemon { Ok(block) } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn getblock_raw(&self, blockhash: &BlockHash, verbose: u32) -> Result { self.request("getblock", json!([blockhash, verbose])) } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn getblocks(&self, blockhashes: &[BlockHash]) -> Result> { let params_list: Vec = blockhashes .iter() @@ -585,6 +610,7 @@ impl Daemon { /// Fetch the given transactions in parallel over multiple threads and RPC connections, /// ignoring any missing ones and returning whatever is available. + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn gettransactions_available(&self, txids: &[&Txid]) -> Result> { const RPC_INVALID_ADDRESS_OR_KEY: i64 = -5; @@ -609,6 +635,7 @@ impl Daemon { .collect() } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn gettransaction_raw( &self, txid: &Txid, @@ -618,20 +645,24 @@ impl Daemon { self.request("getrawtransaction", json!([txid, verbose, blockhash])) } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn getmempooltx(&self, txhash: &Txid) -> Result { let value = self.request("getrawtransaction", json!([txhash, /*verbose=*/ false]))?; tx_from_value(value) } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn getmempooltxids(&self) -> Result> { let res = self.request("getrawmempool", json!([/*verbose=*/ false]))?; Ok(serde_json::from_value(res).chain_err(|| "invalid getrawmempool reply")?) } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn broadcast(&self, tx: &Transaction) -> Result { self.broadcast_raw(&serialize_hex(tx)) } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn broadcast_raw(&self, txhex: &str) -> Result { let txid = self.request("sendrawtransaction", json!([txhex]))?; Ok( @@ -643,6 +674,7 @@ impl Daemon { // Get estimated feerates for the provided confirmation targets using a batch RPC request // Missing estimates are logged but do not cause a failure, whatever is available is returned #[allow(clippy::float_cmp)] + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn estimatesmartfee_batch(&self, conf_targets: &[u16]) -> Result> { let params_list: Vec = conf_targets .iter() @@ -677,6 +709,7 @@ impl Daemon { .collect()) } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] fn get_all_headers(&self, tip: &BlockHash) -> Result> { let info: Value = self.request("getblockheader", json!([tip]))?; let tip_height = info @@ -704,6 +737,7 @@ impl Daemon { } // Returns a list of BlockHeaders in ascending height (i.e. the tip is last). + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn get_new_headers( &self, indexed_headers: &HeaderList, @@ -736,6 +770,7 @@ impl Daemon { Ok(new_headers) } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn get_relayfee(&self) -> Result { let relayfee = self.getnetworkinfo()?.relayfee; diff --git a/src/electrum/discovery.rs b/src/electrum/discovery.rs index 172bba8d0..0e28b2aec 100644 --- a/src/electrum/discovery.rs +++ b/src/electrum/discovery.rs @@ -548,23 +548,33 @@ mod tests { false, None, )); - discovery.add_default_server( - "electrum.blockstream.info".into(), - vec![Service::Tcp(60001)], - ).unwrap(); - discovery.add_default_server("testnet.hsmiths.com".into(), vec![Service::Ssl(53012)]).unwrap(); - discovery.add_default_server( - "tn.not.fyi".into(), - vec![Service::Tcp(55001), Service::Ssl(55002)], - ).unwrap(); - discovery.add_default_server( - "electrum.blockstream.info".into(), - vec![Service::Tcp(60001), Service::Ssl(60002)], - ).unwrap(); - discovery.add_default_server( - "explorerzydxu5ecjrkwceayqybizmpjjznk5izmitf2modhcusuqlid.onion".into(), - vec![Service::Tcp(143)], - ).unwrap(); + discovery + .add_default_server( + "electrum.blockstream.info".into(), + vec![Service::Tcp(60001)], + ) + .unwrap(); + discovery + .add_default_server("testnet.hsmiths.com".into(), vec![Service::Ssl(53012)]) + .unwrap(); + discovery + .add_default_server( + "tn.not.fyi".into(), + vec![Service::Tcp(55001), Service::Ssl(55002)], + ) + .unwrap(); + discovery + .add_default_server( + "electrum.blockstream.info".into(), + vec![Service::Tcp(60001), Service::Ssl(60002)], + ) + .unwrap(); + discovery + .add_default_server( + "explorerzydxu5ecjrkwceayqybizmpjjznk5izmitf2modhcusuqlid.onion".into(), + vec![Service::Tcp(143)], + ) + .unwrap(); debug!("{:#?}", discovery); diff --git a/src/electrum/server.rs b/src/electrum/server.rs index 2beae0855..dac8b4636 100644 --- a/src/electrum/server.rs +++ b/src/electrum/server.rs @@ -13,6 +13,8 @@ use error_chain::ChainedError; use hex::{self, DisplayHex}; use serde_json::{from_str, Value}; +use tracing::instrument; + #[cfg(not(feature = "liquid"))] use bitcoin::consensus::encode::serialize_hex; #[cfg(feature = "liquid")] @@ -69,6 +71,7 @@ fn bool_from_value_or(val: Option<&Value>, name: &str, default: bool) -> Result< } // TODO: implement caching and delta updates +#[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] fn get_status_hash(txs: Vec<(Txid, Option)>, query: &Query) -> Option { if txs.is_empty() { None @@ -261,6 +264,7 @@ impl Connection { })) } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] fn blockchain_estimatefee(&self, params: &[Value]) -> Result { let conf_target = usize_from_value(params.get(0), "blocks_count")?; let fee_rate = self @@ -388,6 +392,7 @@ impl Connection { Ok(json!(rawtx.to_lower_hex_string())) } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] fn blockchain_transaction_get_merkle(&self, params: &[Value]) -> Result { let txid = Txid::from(hash_from_value(params.get(0)).chain_err(|| "bad tx_hash")?); let height = usize_from_value(params.get(1), "height")?; @@ -425,12 +430,14 @@ impl Connection { })) } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!(), method = %method))] fn handle_command(&mut self, method: &str, params: &[Value], id: &Value) -> Result { let timer = self .stats .latency .with_label_values(&[method]) .start_timer(); + let result = match method { "blockchain.block.header" => self.blockchain_block_header(¶ms), "blockchain.block.headers" => self.blockchain_block_headers(¶ms), @@ -480,6 +487,7 @@ impl Connection { }) } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] fn update_subscriptions(&mut self) -> Result> { let timer = self .stats @@ -537,6 +545,7 @@ impl Connection { Ok(()) } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] fn handle_replies(&mut self, receiver: Receiver) -> Result<()> { let empty_params = json!([]); loop { @@ -601,6 +610,7 @@ impl Connection { } } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] fn parse_requests(mut reader: BufReader, tx: &SyncSender) -> Result<()> { loop { let mut line = Vec::::new(); @@ -663,6 +673,7 @@ impl Connection { } } +#[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] fn get_history( query: &Query, scripthash: &[u8], diff --git a/src/lib.rs b/src/lib.rs index 834758a96..a2c6e0a28 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -29,3 +29,12 @@ pub mod util; #[cfg(feature = "liquid")] pub mod elements; + +#[cfg(not(any(feature = "otlp-tracing", feature = "no-otlp-tracing")))] +compile_error!("Must enable one of the 'otlp-tracing' or 'no-otlp-tracing' features"); + +#[cfg(all(feature = "otlp-tracing", feature = "no-otlp-tracing"))] +compile_error!("Cannot enable both the 'otlp-tracing' and 'no-otlp-tracing' (default) features"); + +#[cfg(feature = "otlp-tracing")] +pub mod otlp_trace; diff --git a/src/new_index/fetch.rs b/src/new_index/fetch.rs index 3778a8848..7bcdc6d33 100644 --- a/src/new_index/fetch.rs +++ b/src/new_index/fetch.rs @@ -14,6 +14,8 @@ use std::path::PathBuf; use std::sync::mpsc::Receiver; use std::thread; +use tracing::instrument; + use crate::chain::{Block, BlockHash}; use crate::daemon::Daemon; use crate::errors::*; @@ -25,6 +27,7 @@ pub enum FetchFrom { BlkFiles, } +#[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn start_fetcher( from: FetchFrom, daemon: &Daemon, @@ -67,6 +70,7 @@ impl Fetcher { } } +#[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] fn bitcoind_fetcher( daemon: &Daemon, new_headers: Vec, @@ -105,6 +109,7 @@ fn bitcoind_fetcher( )) } +#[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] fn blkfiles_fetcher( daemon: &Daemon, new_headers: Vec, @@ -152,6 +157,7 @@ fn blkfiles_fetcher( )) } +#[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] fn blkfiles_reader(blk_files: Vec, xor_key: Option<[u8; 8]>) -> Fetcher> { let chan = SyncChannel::new(1); let sender = chan.sender(); @@ -182,6 +188,7 @@ fn blkfile_apply_xor_key(xor_key: [u8; 8], blob: &mut [u8]) { } } +#[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] fn blkfiles_parser(blobs: Fetcher>, magic: u32) -> Fetcher> { let chan = SyncChannel::new(1); let sender = chan.sender(); @@ -200,6 +207,7 @@ fn blkfiles_parser(blobs: Fetcher>, magic: u32) -> Fetcher, magic: u32) -> Result> { let mut cursor = Cursor::new(&blob); let mut slices = vec![]; diff --git a/src/new_index/mempool.rs b/src/new_index/mempool.rs index 4a243d7b8..f768fb8d9 100644 --- a/src/new_index/mempool.rs +++ b/src/new_index/mempool.rs @@ -11,6 +11,7 @@ use std::iter::FromIterator; use std::sync::{Arc, RwLock}; use std::time::{Duration, Instant}; +use tracing::instrument; use crate::chain::{deserialize, BlockHash, Network, OutPoint, Transaction, TxOut, Txid}; use crate::config::Config; use crate::daemon::Daemon; @@ -107,6 +108,7 @@ impl Mempool { self.txstore.get(txid).map(serialize) } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn lookup_spend(&self, outpoint: &OutPoint) -> Option { self.edges.get(outpoint).map(|(txid, vin)| SpendingInput { txid: *txid, @@ -123,6 +125,7 @@ impl Mempool { Some(self.feeinfo.get(txid)?.fee) } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn has_unconfirmed_parents(&self, txid: &Txid) -> bool { let tx = match self.txstore.get(txid) { Some(tx) => tx, @@ -133,6 +136,7 @@ impl Mempool { .any(|txin| self.txstore.contains_key(&txin.previous_output.txid)) } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn history(&self, scripthash: &[u8], limit: usize) -> Vec { let _timer = self.latency.with_label_values(&["history"]).start_timer(); self.history @@ -140,6 +144,7 @@ impl Mempool { .map_or_else(|| vec![], |entries| self._history(entries, limit)) } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] fn _history(&self, entries: &[TxHistoryInfo], limit: usize) -> Vec { entries .iter() @@ -151,6 +156,7 @@ impl Mempool { .collect() } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn history_txids(&self, scripthash: &[u8], limit: usize) -> Vec { let _timer = self .latency @@ -167,6 +173,7 @@ impl Mempool { } } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn utxo(&self, scripthash: &[u8]) -> Vec { let _timer = self.latency.with_label_values(&["utxo"]).start_timer(); let entries = match self.history.get(scripthash) { @@ -209,6 +216,7 @@ impl Mempool { .collect() } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] // @XXX avoid code duplication with ChainQuery::stats()? pub fn stats(&self, scripthash: &[u8]) -> ScriptStats { let _timer = self.latency.with_label_values(&["stats"]).start_timer(); @@ -258,12 +266,14 @@ impl Mempool { stats } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] // Get all txids in the mempool pub fn txids(&self) -> Vec<&Txid> { let _timer = self.latency.with_label_values(&["txids"]).start_timer(); self.txstore.keys().collect() } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] // Get an overview of the most recent transactions pub fn recent_txs_overview(&self) -> Vec<&TxOverview> { // We don't bother ever deleting elements from the recent list. @@ -272,14 +282,17 @@ impl Mempool { self.recent.iter().collect() } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn backlog_stats(&self) -> &BacklogStats { &self.backlog_stats.0 } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn txids_set(&self) -> HashSet { return HashSet::from_iter(self.txstore.keys().cloned()); } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn update_backlog_stats(&mut self) { let _timer = self .latency @@ -288,6 +301,7 @@ impl Mempool { self.backlog_stats = (BacklogStats::new(&self.feeinfo), Instant::now()); } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn add_by_txid(&mut self, daemon: &Daemon, txid: Txid) -> Result<()> { if self.txstore.get(&txid).is_none() { if let Ok(tx) = daemon.getmempooltx(&txid) { @@ -302,6 +316,7 @@ impl Mempool { } } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] fn add(&mut self, txs_map: HashMap) -> Result<()> { self.delta .with_label_values(&["add"]) @@ -414,12 +429,14 @@ impl Mempool { Ok(()) } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] fn lookup_txo(&self, outpoint: &OutPoint) -> Option { self.txstore .get(&outpoint.txid) .and_then(|tx| tx.output.get(outpoint.vout as usize).cloned()) } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn lookup_txos(&self, outpoints: BTreeSet) -> Result> { let _timer = self .latency @@ -427,12 +444,13 @@ impl Mempool { .start_timer(); // Get the txos available in the mempool, skipping over (and collecting) missing ones - let (mut txos, remain_outpoints): (HashMap<_, _>, _) = outpoints - .into_iter() - .partition_map(|outpoint| match self.lookup_txo(&outpoint) { - Some(txout) => Either::Left((outpoint, txout)), - None => Either::Right(outpoint), - }); + let (mut txos, remain_outpoints): (HashMap<_, _>, _) = + outpoints + .into_iter() + .partition_map(|outpoint| match self.lookup_txo(&outpoint) { + Some(txout) => Either::Left((outpoint, txout)), + None => Either::Right(outpoint), + }); // Get the remaining txos from the chain (fails if any are missing) txos.extend(self.chain.lookup_txos(remain_outpoints)?); @@ -440,6 +458,7 @@ impl Mempool { Ok(txos) } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] fn remove(&mut self, to_remove: HashSet<&Txid>) { self.delta .with_label_values(&["remove"]) @@ -475,6 +494,7 @@ impl Mempool { } #[cfg(feature = "liquid")] + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn asset_history(&self, asset_id: &AssetId, limit: usize) -> Vec { let _timer = self .latency @@ -487,6 +507,7 @@ impl Mempool { /// Sync our local view of the mempool with the bitcoind Daemon RPC. If the chain tip moves before /// the mempool is fetched in full, syncing is aborted and an Ok(false) is returned. + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn update( mempool: &Arc>, daemon: &Daemon, @@ -598,6 +619,7 @@ impl BacklogStats { } } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] fn new(feeinfo: &HashMap) -> Self { let (count, vsize, total_fee) = feeinfo .values() diff --git a/src/new_index/precache.rs b/src/new_index/precache.rs index 4db40c27d..402f107dd 100644 --- a/src/new_index/precache.rs +++ b/src/new_index/precache.rs @@ -13,6 +13,9 @@ use std::io; use std::io::prelude::*; use std::str::FromStr; +use tracing::instrument; + +#[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn precache(chain: &ChainQuery, scripthashes: Vec) { let total = scripthashes.len(); info!("Pre-caching stats and utxo set for {} scripthashes", total); @@ -36,6 +39,7 @@ pub fn precache(chain: &ChainQuery, scripthashes: Vec) { }); } +#[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn scripthashes_from_file(path: String) -> Result> { let reader = io::BufReader::new(File::open(path).chain_err(|| "cannot open precache scripthash file")?); diff --git a/src/new_index/query.rs b/src/new_index/query.rs index 26d983734..d10c468e4 100644 --- a/src/new_index/query.rs +++ b/src/new_index/query.rs @@ -11,6 +11,8 @@ use crate::errors::*; use crate::new_index::{ChainQuery, Mempool, ScriptStats, SpendingInput, Utxo}; use crate::util::{is_spendable, BlockId, Bytes, TransactionStatus}; +use tracing::instrument; + #[cfg(feature = "liquid")] use crate::{ chain::AssetId, @@ -69,6 +71,7 @@ impl Query { self.mempool.read().unwrap() } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn broadcast_raw(&self, txhex: &str) -> Result { let txid = self.daemon.broadcast_raw(txhex)?; let _ = self @@ -79,6 +82,7 @@ impl Query { Ok(txid) } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn utxo(&self, scripthash: &[u8]) -> Result> { let mut utxos = self.chain.utxo(scripthash, self.config.utxos_limit)?; let mempool = self.mempool(); @@ -87,6 +91,7 @@ impl Query { Ok(utxos) } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn history_txids(&self, scripthash: &[u8], limit: usize) -> Vec<(Txid, Option)> { let confirmed_txids = self.chain.history_txids(scripthash, limit); let confirmed_len = confirmed_txids.len(); @@ -108,17 +113,21 @@ impl Query { ) } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn lookup_txn(&self, txid: &Txid) -> Option { self.chain .lookup_txn(txid, None) .or_else(|| self.mempool().lookup_txn(txid)) } + + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn lookup_raw_txn(&self, txid: &Txid) -> Option { self.chain .lookup_raw_txn(txid, None) .or_else(|| self.mempool().lookup_raw_txn(txid)) } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn lookup_txos(&self, outpoints: BTreeSet) -> HashMap { // the mempool lookup_txos() internally looks up confirmed txos as well self.mempool() @@ -126,12 +135,14 @@ impl Query { .expect("failed loading txos") } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn lookup_spend(&self, outpoint: &OutPoint) -> Option { self.chain .lookup_spend(outpoint) .or_else(|| self.mempool().lookup_spend(outpoint)) } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn lookup_tx_spends(&self, tx: Transaction) -> Vec> { let txid = tx.txid(); @@ -151,18 +162,22 @@ impl Query { .collect() } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn get_tx_status(&self, txid: &Txid) -> TransactionStatus { TransactionStatus::from(self.chain.tx_confirming_block(txid)) } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn get_mempool_tx_fee(&self, txid: &Txid) -> Option { self.mempool().get_tx_fee(txid) } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn has_unconfirmed_parents(&self, txid: &Txid) -> bool { self.mempool().has_unconfirmed_parents(txid) } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn estimate_fee(&self, conf_target: u16) -> Option { if self.config.network_type.is_regtest() { return self.get_relayfee().ok(); @@ -182,6 +197,7 @@ impl Query { .copied() } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn estimate_fee_map(&self) -> HashMap { if let (ref cache, Some(cache_time)) = *self.cached_estimates.read().unwrap() { if cache_time.elapsed() < Duration::from_secs(FEE_ESTIMATES_TTL) { @@ -193,6 +209,7 @@ impl Query { self.cached_estimates.read().unwrap().0.clone() } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] fn update_fee_estimates(&self) { match self.daemon.estimatesmartfee_batch(&CONF_TARGETS) { Ok(estimates) => { @@ -204,6 +221,7 @@ impl Query { } } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn get_relayfee(&self) -> Result { if let Some(cached) = *self.cached_relayfee.read().unwrap() { return Ok(cached); @@ -234,11 +252,13 @@ impl Query { } #[cfg(feature = "liquid")] + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn lookup_asset(&self, asset_id: &AssetId) -> Result> { lookup_asset(&self, self.asset_db.as_ref(), asset_id, None) } #[cfg(feature = "liquid")] + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn list_registry_assets( &self, start_index: usize, diff --git a/src/new_index/schema.rs b/src/new_index/schema.rs index 1ea2a97ef..c2de00f8c 100644 --- a/src/new_index/schema.rs +++ b/src/new_index/schema.rs @@ -377,7 +377,6 @@ impl ChainQuery { pub fn get_block_txids(&self, hash: &BlockHash) -> Option> { let _timer = self.start_timer("get_block_txids"); - if self.light_mode { // TODO fetch block as binary from REST API instead of as hex let mut blockinfo = self.daemon.getblock_raw(hash, 1).ok()?; @@ -458,6 +457,7 @@ impl ChainQuery { &TxHistoryRow::prefix_height(code, &hash[..], start_height as u32), ) } + fn history_iter_scan_reverse(&self, code: u8, hash: &[u8]) -> ReverseScanIterator { self.store.history_db.iter_scan_reverse( &TxHistoryRow::filter(code, &hash[..]), @@ -879,6 +879,7 @@ impl ChainQuery { }) }) } + pub fn tx_confirming_block(&self, txid: &Txid) -> Option { let _timer = self.start_timer("tx_confirming_block"); let headers = self.store.indexed_headers.read().unwrap(); diff --git a/src/otlp_trace.rs b/src/otlp_trace.rs new file mode 100644 index 000000000..834d56737 --- /dev/null +++ b/src/otlp_trace.rs @@ -0,0 +1,85 @@ +use opentelemetry::{ + runtime, + sdk::{ + trace::{BatchConfig, RandomIdGenerator, Sampler, Tracer}, + Resource, + }, + KeyValue, +}; +use opentelemetry_otlp::{ExportConfig, Protocol, WithExportConfig}; +use opentelemetry_semantic_conventions::{ + resource::{SERVICE_NAME, SERVICE_VERSION}, + SCHEMA_URL, +}; +use std::env::var; +use std::time::Duration; +use tracing_opentelemetry::OpenTelemetryLayer; +use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter}; + +fn init_tracer(resource: Resource, endpoint: &str) -> Tracer { + let export_config = ExportConfig { + endpoint: endpoint.to_string(), + timeout: Duration::from_secs(3), + protocol: Protocol::Grpc, + }; + + opentelemetry_otlp::new_pipeline() + .tracing() + .with_trace_config( + opentelemetry::sdk::trace::Config::default() + .with_sampler(Sampler::ParentBased(Box::new(Sampler::TraceIdRatioBased( + 1.0, + )))) + .with_id_generator(RandomIdGenerator::default()) + .with_resource(resource), + ) + .with_batch_config(BatchConfig::default()) + .with_exporter( + opentelemetry_otlp::new_exporter() + .tonic() + .with_endpoint(endpoint) + .with_export_config(export_config), + ) + .install_batch(runtime::Tokio) + .unwrap() +} + +fn init_tracing_subscriber(service_name: &str) -> OtelGuard { + let resource = Resource::from_schema_url( + [ + KeyValue::new(SERVICE_NAME, service_name.to_owned()), + KeyValue::new(SERVICE_VERSION, "0.4.1"), + ], + SCHEMA_URL, + ); + + let env_filter = EnvFilter::from_default_env(); + + let reg = tracing_subscriber::registry().with(env_filter).with( + tracing_subscriber::fmt::layer() + .with_thread_ids(true) + .with_ansi(false) + .compact(), + ); + let _ = if let Ok(endpoint) = var("OTLP_ENDPOINT") { + reg.with(OpenTelemetryLayer::new(init_tracer(resource, &endpoint))) + .try_init() + } else { + reg.try_init() + }; + + log::debug!("Initialized tracing"); + + OtelGuard {} +} + +pub fn init_tracing(service_name: &str) -> OtelGuard { + init_tracing_subscriber(service_name) +} + +pub struct OtelGuard {} +impl Drop for OtelGuard { + fn drop(&mut self) { + opentelemetry::global::shutdown_tracer_provider(); + } +} diff --git a/src/rest.rs b/src/rest.rs index 0d05a4334..d38dcb0a3 100644 --- a/src/rest.rs +++ b/src/rest.rs @@ -24,6 +24,8 @@ use tokio::sync::oneshot; use std::fs; use std::str::FromStr; +use tracing::instrument; + #[cfg(feature = "liquid")] use { crate::elements::{ebcompact::*, peg::PegoutValue, AssetSorting, IssuanceValue}, @@ -579,6 +581,7 @@ impl Handle { } } +#[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] fn handle_request( method: Method, uri: hyper::Uri, @@ -1152,6 +1155,7 @@ fn json_response(value: T, ttl: u32) -> Result, Htt .unwrap()) } +#[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] fn blocks(query: &Query, start_height: Option) -> Result, HttpError> { let mut values = Vec::new(); let mut current_hash = match start_height { diff --git a/src/util/block.rs b/src/util/block.rs index de28cd389..bbd219895 100644 --- a/src/util/block.rs +++ b/src/util/block.rs @@ -9,6 +9,8 @@ use std::slice; use time::format_description::well_known::Rfc3339; use time::OffsetDateTime as DateTime; +use tracing::instrument; + const MTP_SPAN: usize = 11; lazy_static! { @@ -92,6 +94,7 @@ impl HeaderList { } } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn new( mut headers_map: HashMap, tip_hash: BlockHash, @@ -129,6 +132,7 @@ impl HeaderList { headers } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn order(&self, new_headers: Vec) -> Vec { // header[i] -> header[i-1] (i.e. header.last() is the tip) struct HashedHeader { @@ -168,6 +172,7 @@ impl HeaderList { .collect() } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn apply(&mut self, new_headers: Vec) { // new_headers[i] -> new_headers[i - 1] (i.e. new_headers.last() is the tip) for i in 1..new_headers.len() { @@ -205,6 +210,7 @@ impl HeaderList { } } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn header_by_blockhash(&self, blockhash: &BlockHash) -> Option<&HeaderEntry> { let height = self.heights.get(blockhash)?; let header = self.headers.get(*height)?; @@ -215,6 +221,7 @@ impl HeaderList { } } + #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn header_by_height(&self, height: usize) -> Option<&HeaderEntry> { self.headers.get(height).map(|entry| { assert_eq!(entry.height(), height); diff --git a/src/util/electrum_merkle.rs b/src/util/electrum_merkle.rs index 954782a7d..0ad6eeae0 100644 --- a/src/util/electrum_merkle.rs +++ b/src/util/electrum_merkle.rs @@ -3,6 +3,9 @@ use crate::errors::*; use crate::new_index::ChainQuery; use bitcoin::hashes::{sha256d::Hash as Sha256dHash, Hash}; +use tracing::instrument; + +#[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn get_tx_merkle_proof( chain: &ChainQuery, tx_hash: &Txid, @@ -21,6 +24,7 @@ pub fn get_tx_merkle_proof( Ok((branch, pos)) } +#[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn get_header_merkle_proof( chain: &ChainQuery, height: usize, @@ -49,7 +53,7 @@ pub fn get_header_merkle_proof( let header_hashes = header_hashes.into_iter().map(Sha256dHash::from).collect(); Ok(create_merkle_branch_and_root(header_hashes, height)) } - +#[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn get_id_from_pos( chain: &ChainQuery, height: usize, diff --git a/src/util/fees.rs b/src/util/fees.rs index 9cbe6c1d7..a3f62c351 100644 --- a/src/util/fees.rs +++ b/src/util/fees.rs @@ -1,6 +1,8 @@ use crate::chain::{Network, Transaction, TxOut}; use std::collections::HashMap; +use tracing::instrument; + const VSIZE_BIN_WIDTH: u64 = 50_000; // in vbytes pub struct TxFeeInfo { @@ -46,6 +48,7 @@ pub fn get_tx_fee(tx: &Transaction, _prevouts: &HashMap, network: N tx.fee_in(*network.native_asset()) } +#[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] pub fn make_fee_histogram(mut entries: Vec<&TxFeeInfo>) -> Vec<(f64, u64)> { entries.sort_unstable_by(|e1, e2| e1.fee_per_vbyte.partial_cmp(&e2.fee_per_vbyte).unwrap()); From 4e39879f941953f2e62533c32b48dc92c7b13d1e Mon Sep 17 00:00:00 2001 From: Mariusz Reichert Date: Mon, 13 Jan 2025 12:25:28 +0100 Subject: [PATCH 3/6] instrumented macro implementation --- Cargo.lock | 10 ++++++++++ Cargo.toml | 3 ++- instrumented_macro/Cargo.toml | 12 ++++++++++++ instrumented_macro/src/lib.rs | 26 ++++++++++++++++++++++++++ 4 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 instrumented_macro/Cargo.toml create mode 100644 instrumented_macro/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index 94f68464d..67717888f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -874,6 +874,7 @@ dependencies = [ "hex-conservative", "hyper", "hyperlocal", + "instrumented_macro", "itertools 0.12.1", "lazy_static", "libc", @@ -1565,6 +1566,15 @@ dependencies = [ "generic-array", ] +[[package]] +name = "instrumented_macro" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] + [[package]] name = "ipnet" version = "2.10.1" diff --git a/Cargo.toml b/Cargo.toml index f7d21a7c2..9e3b423d8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,3 +1,4 @@ +workspace = { members = ["instrumented_macro"] } [package] name = "electrs" version = "0.4.1" @@ -76,7 +77,7 @@ tracing = { version = "0.1.40", default-features = false, features = ["attribute # optional dependencies for electrum-discovery electrum-client = { version = "0.8", optional = true } zmq = "0.10.0" - +instrumented_macro = { path = "instrumented_macro" } [dev-dependencies] bitcoind = { version = "0.34.3", features = ["25_0"] } diff --git a/instrumented_macro/Cargo.toml b/instrumented_macro/Cargo.toml new file mode 100644 index 000000000..a97eebf1a --- /dev/null +++ b/instrumented_macro/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "instrumented_macro" +version = "0.1.0" +edition = "2021" + +[lib] +proc-macro = true + +[dependencies] +syn = "2.0" +quote = "1.0" +proc-macro2 = "1.0" diff --git a/instrumented_macro/src/lib.rs b/instrumented_macro/src/lib.rs new file mode 100644 index 000000000..543f25165 --- /dev/null +++ b/instrumented_macro/src/lib.rs @@ -0,0 +1,26 @@ +use proc_macro::TokenStream; +use quote::quote; +use syn::{parse_macro_input, ItemFn}; + +#[proc_macro_attribute] +pub fn instrumented(attr: TokenStream, item: TokenStream) -> TokenStream { + let additional_fields = if !attr.is_empty() { + let attr_tokens: proc_macro2::TokenStream = attr.into(); + quote! {, #attr_tokens } + } else { + quote! {} + }; + + let function = parse_macro_input!(item as ItemFn); + + let fields_tokens = quote! { + fields(module = module_path!(), file = file!(), line = line!() #additional_fields) + }; + + let expanded = quote! { + #[tracing::instrument(skip_all, #fields_tokens)] + #function + }; + + expanded.into() +} \ No newline at end of file From a579e79c6a044f8901c2cf505eef0b9134cd98b3 Mon Sep 17 00:00:00 2001 From: Mariusz Reichert Date: Mon, 13 Jan 2025 12:26:21 +0100 Subject: [PATCH 4/6] instrumented macro usage --- src/daemon.rs | 68 ++++++++++++++++++------------------- src/electrum/server.rs | 18 +++++----- src/lib.rs | 1 - src/new_index/fetch.rs | 14 ++++---- src/new_index/mempool.rs | 42 +++++++++++------------ src/new_index/precache.rs | 6 ++-- src/new_index/query.rs | 36 ++++++++++---------- src/rest.rs | 6 ++-- src/util/block.rs | 12 +++---- src/util/electrum_merkle.rs | 8 ++--- src/util/fees.rs | 4 +-- 11 files changed, 107 insertions(+), 108 deletions(-) diff --git a/src/daemon.rs b/src/daemon.rs index 1dfe02212..8cef8feaa 100644 --- a/src/daemon.rs +++ b/src/daemon.rs @@ -20,7 +20,7 @@ use bitcoin::consensus::encode::{deserialize, serialize_hex}; #[cfg(feature = "liquid")] use elements::encode::{deserialize, serialize_hex}; -use tracing::instrument; +use instrumented_macro::instrumented; use crate::chain::{Block, BlockHash, BlockHeader, Network, Transaction, Txid}; use crate::metrics::{HistogramOpts, HistogramVec, Metrics}; @@ -44,7 +44,7 @@ lazy_static! { const MAX_ATTEMPTS: u32 = 5; const RETRY_WAIT_DURATION: Duration = Duration::from_secs(1); -#[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] +#[instrumented] fn parse_hash(value: &Value) -> Result where T: FromStr, @@ -58,7 +58,7 @@ where .chain_err(|| format!("non-hex value: {}", value))?) } -#[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] +#[instrumented] fn header_from_value(value: Value) -> Result { let header_hex = value .as_str() @@ -153,7 +153,7 @@ struct Connection { signal: Waiter, } -#[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] +#[instrumented] fn tcp_connect(addr: SocketAddr, signal: &Waiter) -> Result { loop { match TcpStream::connect_timeout(&addr, *DAEMON_CONNECTION_TIMEOUT) { @@ -176,7 +176,7 @@ fn tcp_connect(addr: SocketAddr, signal: &Waiter) -> Result { } impl Connection { - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] fn new( addr: SocketAddr, cookie_getter: Arc, @@ -196,12 +196,12 @@ impl Connection { }) } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] fn reconnect(&self) -> Result { Connection::new(self.addr, self.cookie_getter.clone(), self.signal.clone()) } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] fn send(&mut self, request: &str) -> Result<()> { let cookie = &self.cookie_getter.get()?; let msg = format!( @@ -215,7 +215,7 @@ impl Connection { }) } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] fn recv(&mut self) -> Result { // TODO: use proper HTTP parser. let mut in_header = true; @@ -381,7 +381,7 @@ impl Daemon { Ok(daemon) } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn reconnect(&self) -> Result { Ok(Daemon { daemon_dir: self.daemon_dir.clone(), @@ -396,7 +396,7 @@ impl Daemon { }) } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn list_blk_files(&self) -> Result> { let path = self.blocks_dir.join("blk*.dat"); debug!("listing block files at {:?}", path); @@ -432,7 +432,7 @@ impl Daemon { self.network.magic() } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] fn call_jsonrpc(&self, method: &str, request: &Value) -> Result { let mut conn = self.conn.lock().unwrap(); let timer = self.latency.with_label_values(&[method]).start_timer(); @@ -450,7 +450,7 @@ impl Daemon { Ok(result) } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!(), method = %method))] + #[instrumented(method = %method)] fn handle_request(&self, method: &str, params: &Value) -> Result { let id = self.message_id.next(); let req = json!({"method": method, "params": params, "id": id}); @@ -473,12 +473,12 @@ impl Daemon { } } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] fn request(&self, method: &str, params: Value) -> Result { self.retry_request(method, ¶ms) } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] fn retry_reconnect(&self) -> Daemon { // XXX add a max reconnection attempts limit? loop { @@ -493,14 +493,14 @@ impl Daemon { // Send requests in parallel over multiple RPC connections as individual JSON-RPC requests (with no JSON-RPC batching), // buffering the replies into a vector. If any of the requests fail, processing is terminated and an Err is returned. - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] fn requests(&self, method: &str, params_list: Vec) -> Result> { self.requests_iter(method, params_list).collect() } // Send requests in parallel over multiple RPC connections, iterating over the results without buffering them. // Errors are included in the iterator and do not terminate other pending requests. - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] fn requests_iter<'a>( &'a self, method: &'a str, @@ -523,29 +523,29 @@ impl Daemon { // bitcoind JSONRPC API: - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn getblockchaininfo(&self) -> Result { let info: Value = self.request("getblockchaininfo", json!([]))?; Ok(from_value(info).chain_err(|| "invalid blockchain info")?) } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] fn getnetworkinfo(&self) -> Result { let info: Value = self.request("getnetworkinfo", json!([]))?; Ok(from_value(info).chain_err(|| "invalid network info")?) } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn getbestblockhash(&self) -> Result { parse_hash(&self.request("getbestblockhash", json!([]))?) } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn getblockheader(&self, blockhash: &BlockHash) -> Result { header_from_value(self.request("getblockheader", json!([blockhash, /*verbose=*/ false]))?) } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn getblockheaders(&self, heights: &[usize]) -> Result> { let heights: Vec = heights.iter().map(|height| json!([height])).collect(); let params_list: Vec = self @@ -560,7 +560,7 @@ impl Daemon { Ok(result) } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn getblock(&self, blockhash: &BlockHash) -> Result { let block = block_from_value(self.request("getblock", json!([blockhash, /*verbose=*/ false]))?)?; @@ -568,12 +568,12 @@ impl Daemon { Ok(block) } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn getblock_raw(&self, blockhash: &BlockHash, verbose: u32) -> Result { self.request("getblock", json!([blockhash, verbose])) } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn getblocks(&self, blockhashes: &[BlockHash]) -> Result> { let params_list: Vec = blockhashes .iter() @@ -610,7 +610,7 @@ impl Daemon { /// Fetch the given transactions in parallel over multiple threads and RPC connections, /// ignoring any missing ones and returning whatever is available. - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn gettransactions_available(&self, txids: &[&Txid]) -> Result> { const RPC_INVALID_ADDRESS_OR_KEY: i64 = -5; @@ -635,7 +635,7 @@ impl Daemon { .collect() } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn gettransaction_raw( &self, txid: &Txid, @@ -645,24 +645,24 @@ impl Daemon { self.request("getrawtransaction", json!([txid, verbose, blockhash])) } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn getmempooltx(&self, txhash: &Txid) -> Result { let value = self.request("getrawtransaction", json!([txhash, /*verbose=*/ false]))?; tx_from_value(value) } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn getmempooltxids(&self) -> Result> { let res = self.request("getrawmempool", json!([/*verbose=*/ false]))?; Ok(serde_json::from_value(res).chain_err(|| "invalid getrawmempool reply")?) } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn broadcast(&self, tx: &Transaction) -> Result { self.broadcast_raw(&serialize_hex(tx)) } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn broadcast_raw(&self, txhex: &str) -> Result { let txid = self.request("sendrawtransaction", json!([txhex]))?; Ok( @@ -674,7 +674,7 @@ impl Daemon { // Get estimated feerates for the provided confirmation targets using a batch RPC request // Missing estimates are logged but do not cause a failure, whatever is available is returned #[allow(clippy::float_cmp)] - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn estimatesmartfee_batch(&self, conf_targets: &[u16]) -> Result> { let params_list: Vec = conf_targets .iter() @@ -709,7 +709,7 @@ impl Daemon { .collect()) } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] fn get_all_headers(&self, tip: &BlockHash) -> Result> { let info: Value = self.request("getblockheader", json!([tip]))?; let tip_height = info @@ -737,7 +737,7 @@ impl Daemon { } // Returns a list of BlockHeaders in ascending height (i.e. the tip is last). - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn get_new_headers( &self, indexed_headers: &HeaderList, @@ -770,7 +770,7 @@ impl Daemon { Ok(new_headers) } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn get_relayfee(&self) -> Result { let relayfee = self.getnetworkinfo()?.relayfee; diff --git a/src/electrum/server.rs b/src/electrum/server.rs index dac8b4636..f5403ad98 100644 --- a/src/electrum/server.rs +++ b/src/electrum/server.rs @@ -13,7 +13,7 @@ use error_chain::ChainedError; use hex::{self, DisplayHex}; use serde_json::{from_str, Value}; -use tracing::instrument; +use instrumented_macro::instrumented; #[cfg(not(feature = "liquid"))] use bitcoin::consensus::encode::serialize_hex; @@ -71,7 +71,7 @@ fn bool_from_value_or(val: Option<&Value>, name: &str, default: bool) -> Result< } // TODO: implement caching and delta updates -#[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] +#[instrumented] fn get_status_hash(txs: Vec<(Txid, Option)>, query: &Query) -> Option { if txs.is_empty() { None @@ -264,7 +264,7 @@ impl Connection { })) } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] fn blockchain_estimatefee(&self, params: &[Value]) -> Result { let conf_target = usize_from_value(params.get(0), "blocks_count")?; let fee_rate = self @@ -392,7 +392,7 @@ impl Connection { Ok(json!(rawtx.to_lower_hex_string())) } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] fn blockchain_transaction_get_merkle(&self, params: &[Value]) -> Result { let txid = Txid::from(hash_from_value(params.get(0)).chain_err(|| "bad tx_hash")?); let height = usize_from_value(params.get(1), "height")?; @@ -430,7 +430,7 @@ impl Connection { })) } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!(), method = %method))] + #[instrumented(method = %method)] fn handle_command(&mut self, method: &str, params: &[Value], id: &Value) -> Result { let timer = self .stats @@ -487,7 +487,7 @@ impl Connection { }) } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] fn update_subscriptions(&mut self) -> Result> { let timer = self .stats @@ -545,7 +545,7 @@ impl Connection { Ok(()) } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] fn handle_replies(&mut self, receiver: Receiver) -> Result<()> { let empty_params = json!([]); loop { @@ -610,7 +610,7 @@ impl Connection { } } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] fn parse_requests(mut reader: BufReader, tx: &SyncSender) -> Result<()> { loop { let mut line = Vec::::new(); @@ -673,7 +673,7 @@ impl Connection { } } -#[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] +#[instrumented] fn get_history( query: &Query, scripthash: &[u8], diff --git a/src/lib.rs b/src/lib.rs index a2c6e0a28..1bdad259e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -12,7 +12,6 @@ extern crate log; extern crate serde_derive; #[macro_use] extern crate serde_json; - #[macro_use] extern crate lazy_static; diff --git a/src/new_index/fetch.rs b/src/new_index/fetch.rs index 7bcdc6d33..d7aaae5fb 100644 --- a/src/new_index/fetch.rs +++ b/src/new_index/fetch.rs @@ -14,7 +14,7 @@ use std::path::PathBuf; use std::sync::mpsc::Receiver; use std::thread; -use tracing::instrument; +use instrumented_macro::instrumented; use crate::chain::{Block, BlockHash}; use crate::daemon::Daemon; @@ -27,7 +27,7 @@ pub enum FetchFrom { BlkFiles, } -#[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] +#[instrumented] pub fn start_fetcher( from: FetchFrom, daemon: &Daemon, @@ -70,7 +70,7 @@ impl Fetcher { } } -#[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] +#[instrumented] fn bitcoind_fetcher( daemon: &Daemon, new_headers: Vec, @@ -109,7 +109,7 @@ fn bitcoind_fetcher( )) } -#[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] +#[instrumented] fn blkfiles_fetcher( daemon: &Daemon, new_headers: Vec, @@ -157,7 +157,7 @@ fn blkfiles_fetcher( )) } -#[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] +#[instrumented] fn blkfiles_reader(blk_files: Vec, xor_key: Option<[u8; 8]>) -> Fetcher> { let chan = SyncChannel::new(1); let sender = chan.sender(); @@ -188,7 +188,7 @@ fn blkfile_apply_xor_key(xor_key: [u8; 8], blob: &mut [u8]) { } } -#[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] +#[instrumented] fn blkfiles_parser(blobs: Fetcher>, magic: u32) -> Fetcher> { let chan = SyncChannel::new(1); let sender = chan.sender(); @@ -207,7 +207,7 @@ fn blkfiles_parser(blobs: Fetcher>, magic: u32) -> Fetcher, magic: u32) -> Result> { let mut cursor = Cursor::new(&blob); let mut slices = vec![]; diff --git a/src/new_index/mempool.rs b/src/new_index/mempool.rs index f768fb8d9..3d1b328f2 100644 --- a/src/new_index/mempool.rs +++ b/src/new_index/mempool.rs @@ -11,7 +11,7 @@ use std::iter::FromIterator; use std::sync::{Arc, RwLock}; use std::time::{Duration, Instant}; -use tracing::instrument; +use instrumented_macro::instrumented; use crate::chain::{deserialize, BlockHash, Network, OutPoint, Transaction, TxOut, Txid}; use crate::config::Config; use crate::daemon::Daemon; @@ -108,7 +108,7 @@ impl Mempool { self.txstore.get(txid).map(serialize) } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn lookup_spend(&self, outpoint: &OutPoint) -> Option { self.edges.get(outpoint).map(|(txid, vin)| SpendingInput { txid: *txid, @@ -125,7 +125,7 @@ impl Mempool { Some(self.feeinfo.get(txid)?.fee) } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn has_unconfirmed_parents(&self, txid: &Txid) -> bool { let tx = match self.txstore.get(txid) { Some(tx) => tx, @@ -136,7 +136,7 @@ impl Mempool { .any(|txin| self.txstore.contains_key(&txin.previous_output.txid)) } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn history(&self, scripthash: &[u8], limit: usize) -> Vec { let _timer = self.latency.with_label_values(&["history"]).start_timer(); self.history @@ -144,7 +144,7 @@ impl Mempool { .map_or_else(|| vec![], |entries| self._history(entries, limit)) } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] fn _history(&self, entries: &[TxHistoryInfo], limit: usize) -> Vec { entries .iter() @@ -156,7 +156,7 @@ impl Mempool { .collect() } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn history_txids(&self, scripthash: &[u8], limit: usize) -> Vec { let _timer = self .latency @@ -173,7 +173,7 @@ impl Mempool { } } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn utxo(&self, scripthash: &[u8]) -> Vec { let _timer = self.latency.with_label_values(&["utxo"]).start_timer(); let entries = match self.history.get(scripthash) { @@ -216,7 +216,7 @@ impl Mempool { .collect() } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] // @XXX avoid code duplication with ChainQuery::stats()? pub fn stats(&self, scripthash: &[u8]) -> ScriptStats { let _timer = self.latency.with_label_values(&["stats"]).start_timer(); @@ -266,14 +266,14 @@ impl Mempool { stats } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] // Get all txids in the mempool pub fn txids(&self) -> Vec<&Txid> { let _timer = self.latency.with_label_values(&["txids"]).start_timer(); self.txstore.keys().collect() } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] // Get an overview of the most recent transactions pub fn recent_txs_overview(&self) -> Vec<&TxOverview> { // We don't bother ever deleting elements from the recent list. @@ -282,17 +282,17 @@ impl Mempool { self.recent.iter().collect() } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn backlog_stats(&self) -> &BacklogStats { &self.backlog_stats.0 } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn txids_set(&self) -> HashSet { return HashSet::from_iter(self.txstore.keys().cloned()); } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn update_backlog_stats(&mut self) { let _timer = self .latency @@ -301,7 +301,7 @@ impl Mempool { self.backlog_stats = (BacklogStats::new(&self.feeinfo), Instant::now()); } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn add_by_txid(&mut self, daemon: &Daemon, txid: Txid) -> Result<()> { if self.txstore.get(&txid).is_none() { if let Ok(tx) = daemon.getmempooltx(&txid) { @@ -316,7 +316,7 @@ impl Mempool { } } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] fn add(&mut self, txs_map: HashMap) -> Result<()> { self.delta .with_label_values(&["add"]) @@ -429,14 +429,14 @@ impl Mempool { Ok(()) } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] fn lookup_txo(&self, outpoint: &OutPoint) -> Option { self.txstore .get(&outpoint.txid) .and_then(|tx| tx.output.get(outpoint.vout as usize).cloned()) } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn lookup_txos(&self, outpoints: BTreeSet) -> Result> { let _timer = self .latency @@ -458,7 +458,7 @@ impl Mempool { Ok(txos) } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] fn remove(&mut self, to_remove: HashSet<&Txid>) { self.delta .with_label_values(&["remove"]) @@ -494,7 +494,7 @@ impl Mempool { } #[cfg(feature = "liquid")] - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn asset_history(&self, asset_id: &AssetId, limit: usize) -> Vec { let _timer = self .latency @@ -507,7 +507,7 @@ impl Mempool { /// Sync our local view of the mempool with the bitcoind Daemon RPC. If the chain tip moves before /// the mempool is fetched in full, syncing is aborted and an Ok(false) is returned. - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn update( mempool: &Arc>, daemon: &Daemon, @@ -619,7 +619,7 @@ impl BacklogStats { } } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] fn new(feeinfo: &HashMap) -> Self { let (count, vsize, total_fee) = feeinfo .values() diff --git a/src/new_index/precache.rs b/src/new_index/precache.rs index 402f107dd..a439c355b 100644 --- a/src/new_index/precache.rs +++ b/src/new_index/precache.rs @@ -13,9 +13,9 @@ use std::io; use std::io::prelude::*; use std::str::FromStr; -use tracing::instrument; +use instrumented_macro::instrumented; -#[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] +#[instrumented] pub fn precache(chain: &ChainQuery, scripthashes: Vec) { let total = scripthashes.len(); info!("Pre-caching stats and utxo set for {} scripthashes", total); @@ -39,7 +39,7 @@ pub fn precache(chain: &ChainQuery, scripthashes: Vec) { }); } -#[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] +#[instrumented] pub fn scripthashes_from_file(path: String) -> Result> { let reader = io::BufReader::new(File::open(path).chain_err(|| "cannot open precache scripthash file")?); diff --git a/src/new_index/query.rs b/src/new_index/query.rs index d10c468e4..b5da380f8 100644 --- a/src/new_index/query.rs +++ b/src/new_index/query.rs @@ -11,7 +11,7 @@ use crate::errors::*; use crate::new_index::{ChainQuery, Mempool, ScriptStats, SpendingInput, Utxo}; use crate::util::{is_spendable, BlockId, Bytes, TransactionStatus}; -use tracing::instrument; +use instrumented_macro::instrumented; #[cfg(feature = "liquid")] use crate::{ @@ -71,7 +71,7 @@ impl Query { self.mempool.read().unwrap() } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn broadcast_raw(&self, txhex: &str) -> Result { let txid = self.daemon.broadcast_raw(txhex)?; let _ = self @@ -82,7 +82,7 @@ impl Query { Ok(txid) } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn utxo(&self, scripthash: &[u8]) -> Result> { let mut utxos = self.chain.utxo(scripthash, self.config.utxos_limit)?; let mempool = self.mempool(); @@ -91,7 +91,7 @@ impl Query { Ok(utxos) } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn history_txids(&self, scripthash: &[u8], limit: usize) -> Vec<(Txid, Option)> { let confirmed_txids = self.chain.history_txids(scripthash, limit); let confirmed_len = confirmed_txids.len(); @@ -113,21 +113,21 @@ impl Query { ) } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn lookup_txn(&self, txid: &Txid) -> Option { self.chain .lookup_txn(txid, None) .or_else(|| self.mempool().lookup_txn(txid)) } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn lookup_raw_txn(&self, txid: &Txid) -> Option { self.chain .lookup_raw_txn(txid, None) .or_else(|| self.mempool().lookup_raw_txn(txid)) } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn lookup_txos(&self, outpoints: BTreeSet) -> HashMap { // the mempool lookup_txos() internally looks up confirmed txos as well self.mempool() @@ -135,14 +135,14 @@ impl Query { .expect("failed loading txos") } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn lookup_spend(&self, outpoint: &OutPoint) -> Option { self.chain .lookup_spend(outpoint) .or_else(|| self.mempool().lookup_spend(outpoint)) } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn lookup_tx_spends(&self, tx: Transaction) -> Vec> { let txid = tx.txid(); @@ -162,22 +162,22 @@ impl Query { .collect() } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn get_tx_status(&self, txid: &Txid) -> TransactionStatus { TransactionStatus::from(self.chain.tx_confirming_block(txid)) } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn get_mempool_tx_fee(&self, txid: &Txid) -> Option { self.mempool().get_tx_fee(txid) } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn has_unconfirmed_parents(&self, txid: &Txid) -> bool { self.mempool().has_unconfirmed_parents(txid) } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn estimate_fee(&self, conf_target: u16) -> Option { if self.config.network_type.is_regtest() { return self.get_relayfee().ok(); @@ -197,7 +197,7 @@ impl Query { .copied() } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn estimate_fee_map(&self) -> HashMap { if let (ref cache, Some(cache_time)) = *self.cached_estimates.read().unwrap() { if cache_time.elapsed() < Duration::from_secs(FEE_ESTIMATES_TTL) { @@ -209,7 +209,7 @@ impl Query { self.cached_estimates.read().unwrap().0.clone() } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] fn update_fee_estimates(&self) { match self.daemon.estimatesmartfee_batch(&CONF_TARGETS) { Ok(estimates) => { @@ -221,7 +221,7 @@ impl Query { } } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn get_relayfee(&self) -> Result { if let Some(cached) = *self.cached_relayfee.read().unwrap() { return Ok(cached); @@ -252,13 +252,13 @@ impl Query { } #[cfg(feature = "liquid")] - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn lookup_asset(&self, asset_id: &AssetId) -> Result> { lookup_asset(&self, self.asset_db.as_ref(), asset_id, None) } #[cfg(feature = "liquid")] - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn list_registry_assets( &self, start_index: usize, diff --git a/src/rest.rs b/src/rest.rs index d38dcb0a3..471395912 100644 --- a/src/rest.rs +++ b/src/rest.rs @@ -24,7 +24,7 @@ use tokio::sync::oneshot; use std::fs; use std::str::FromStr; -use tracing::instrument; +use instrumented_macro::instrumented; #[cfg(feature = "liquid")] use { @@ -581,7 +581,7 @@ impl Handle { } } -#[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] +#[instrumented] fn handle_request( method: Method, uri: hyper::Uri, @@ -1155,7 +1155,7 @@ fn json_response(value: T, ttl: u32) -> Result, Htt .unwrap()) } -#[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] +#[instrumented] fn blocks(query: &Query, start_height: Option) -> Result, HttpError> { let mut values = Vec::new(); let mut current_hash = match start_height { diff --git a/src/util/block.rs b/src/util/block.rs index bbd219895..a8a6aee03 100644 --- a/src/util/block.rs +++ b/src/util/block.rs @@ -9,7 +9,7 @@ use std::slice; use time::format_description::well_known::Rfc3339; use time::OffsetDateTime as DateTime; -use tracing::instrument; +use instrumented_macro::instrumented; const MTP_SPAN: usize = 11; @@ -94,7 +94,7 @@ impl HeaderList { } } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn new( mut headers_map: HashMap, tip_hash: BlockHash, @@ -132,7 +132,7 @@ impl HeaderList { headers } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn order(&self, new_headers: Vec) -> Vec { // header[i] -> header[i-1] (i.e. header.last() is the tip) struct HashedHeader { @@ -172,7 +172,7 @@ impl HeaderList { .collect() } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn apply(&mut self, new_headers: Vec) { // new_headers[i] -> new_headers[i - 1] (i.e. new_headers.last() is the tip) for i in 1..new_headers.len() { @@ -210,7 +210,7 @@ impl HeaderList { } } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn header_by_blockhash(&self, blockhash: &BlockHash) -> Option<&HeaderEntry> { let height = self.heights.get(blockhash)?; let header = self.headers.get(*height)?; @@ -221,7 +221,7 @@ impl HeaderList { } } - #[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] + #[instrumented] pub fn header_by_height(&self, height: usize) -> Option<&HeaderEntry> { self.headers.get(height).map(|entry| { assert_eq!(entry.height(), height); diff --git a/src/util/electrum_merkle.rs b/src/util/electrum_merkle.rs index 0ad6eeae0..8b146705e 100644 --- a/src/util/electrum_merkle.rs +++ b/src/util/electrum_merkle.rs @@ -3,9 +3,9 @@ use crate::errors::*; use crate::new_index::ChainQuery; use bitcoin::hashes::{sha256d::Hash as Sha256dHash, Hash}; -use tracing::instrument; +use instrumented_macro::instrumented; -#[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] +#[instrumented] pub fn get_tx_merkle_proof( chain: &ChainQuery, tx_hash: &Txid, @@ -24,7 +24,7 @@ pub fn get_tx_merkle_proof( Ok((branch, pos)) } -#[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] +#[instrumented] pub fn get_header_merkle_proof( chain: &ChainQuery, height: usize, @@ -53,7 +53,7 @@ pub fn get_header_merkle_proof( let header_hashes = header_hashes.into_iter().map(Sha256dHash::from).collect(); Ok(create_merkle_branch_and_root(header_hashes, height)) } -#[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] +#[instrumented] pub fn get_id_from_pos( chain: &ChainQuery, height: usize, diff --git a/src/util/fees.rs b/src/util/fees.rs index a3f62c351..eb3d61b15 100644 --- a/src/util/fees.rs +++ b/src/util/fees.rs @@ -1,7 +1,7 @@ use crate::chain::{Network, Transaction, TxOut}; use std::collections::HashMap; -use tracing::instrument; +use instrumented_macro::instrumented; const VSIZE_BIN_WIDTH: u64 = 50_000; // in vbytes @@ -48,7 +48,7 @@ pub fn get_tx_fee(tx: &Transaction, _prevouts: &HashMap, network: N tx.fee_in(*network.native_asset()) } -#[instrument(skip_all, fields(module = module_path!(), file = file!(), line = line!()))] +#[instrumented] pub fn make_fee_histogram(mut entries: Vec<&TxFeeInfo>) -> Vec<(f64, u64)> { entries.sort_unstable_by(|e1, e2| e1.fee_per_vbyte.partial_cmp(&e2.fee_per_vbyte).unwrap()); From 750af6e173c127cc3c992e6e88df25dcb8ca233f Mon Sep 17 00:00:00 2001 From: Mariusz Reichert Date: Wed, 15 Jan 2025 10:26:36 +0100 Subject: [PATCH 5/6] Instrumented macro refactoring --- Cargo.lock | 20 +++--- Cargo.toml | 4 +- .../Cargo.toml | 2 +- .../src/lib.rs | 2 +- src/daemon.rs | 68 +++++++++---------- src/electrum/server.rs | 18 ++--- src/new_index/fetch.rs | 14 ++-- src/new_index/mempool.rs | 42 ++++++------ src/new_index/precache.rs | 6 +- src/new_index/query.rs | 36 +++++----- src/rest.rs | 6 +- src/util/block.rs | 12 ++-- src/util/electrum_merkle.rs | 8 +-- src/util/fees.rs | 4 +- 14 files changed, 121 insertions(+), 121 deletions(-) rename {instrumented_macro => electrs_macros}/Cargo.toml (82%) rename {instrumented_macro => electrs_macros}/src/lib.rs (89%) diff --git a/Cargo.lock b/Cargo.lock index 67717888f..05b3a38f9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -865,6 +865,7 @@ dependencies = [ "criterion", "crossbeam-channel", "dirs", + "electrs_macros", "electrum-client", "electrumd", "elements", @@ -874,7 +875,6 @@ dependencies = [ "hex-conservative", "hyper", "hyperlocal", - "instrumented_macro", "itertools 0.12.1", "lazy_static", "libc", @@ -907,6 +907,15 @@ dependencies = [ "zmq", ] +[[package]] +name = "electrs_macros" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] + [[package]] name = "electrum-client" version = "0.8.0" @@ -1566,15 +1575,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "instrumented_macro" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.90", -] - [[package]] name = "ipnet" version = "2.10.1" diff --git a/Cargo.toml b/Cargo.toml index 9e3b423d8..09c3dddb1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,4 +1,4 @@ -workspace = { members = ["instrumented_macro"] } +workspace = { members = ["electrs_macros"] } [package] name = "electrs" version = "0.4.1" @@ -77,7 +77,7 @@ tracing = { version = "0.1.40", default-features = false, features = ["attribute # optional dependencies for electrum-discovery electrum-client = { version = "0.8", optional = true } zmq = "0.10.0" -instrumented_macro = { path = "instrumented_macro" } +electrs_macros = { path = "electrs_macros" } [dev-dependencies] bitcoind = { version = "0.34.3", features = ["25_0"] } diff --git a/instrumented_macro/Cargo.toml b/electrs_macros/Cargo.toml similarity index 82% rename from instrumented_macro/Cargo.toml rename to electrs_macros/Cargo.toml index a97eebf1a..3c7400c47 100644 --- a/instrumented_macro/Cargo.toml +++ b/electrs_macros/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "instrumented_macro" +name = "electrs_macros" version = "0.1.0" edition = "2021" diff --git a/instrumented_macro/src/lib.rs b/electrs_macros/src/lib.rs similarity index 89% rename from instrumented_macro/src/lib.rs rename to electrs_macros/src/lib.rs index 543f25165..bf15f8f9d 100644 --- a/instrumented_macro/src/lib.rs +++ b/electrs_macros/src/lib.rs @@ -3,7 +3,7 @@ use quote::quote; use syn::{parse_macro_input, ItemFn}; #[proc_macro_attribute] -pub fn instrumented(attr: TokenStream, item: TokenStream) -> TokenStream { +pub fn trace(attr: TokenStream, item: TokenStream) -> TokenStream { let additional_fields = if !attr.is_empty() { let attr_tokens: proc_macro2::TokenStream = attr.into(); quote! {, #attr_tokens } diff --git a/src/daemon.rs b/src/daemon.rs index 8cef8feaa..2abdc46a9 100644 --- a/src/daemon.rs +++ b/src/daemon.rs @@ -20,7 +20,7 @@ use bitcoin::consensus::encode::{deserialize, serialize_hex}; #[cfg(feature = "liquid")] use elements::encode::{deserialize, serialize_hex}; -use instrumented_macro::instrumented; +use electrs_macros::trace; use crate::chain::{Block, BlockHash, BlockHeader, Network, Transaction, Txid}; use crate::metrics::{HistogramOpts, HistogramVec, Metrics}; @@ -44,7 +44,7 @@ lazy_static! { const MAX_ATTEMPTS: u32 = 5; const RETRY_WAIT_DURATION: Duration = Duration::from_secs(1); -#[instrumented] +#[trace] fn parse_hash(value: &Value) -> Result where T: FromStr, @@ -58,7 +58,7 @@ where .chain_err(|| format!("non-hex value: {}", value))?) } -#[instrumented] +#[trace] fn header_from_value(value: Value) -> Result { let header_hex = value .as_str() @@ -153,7 +153,7 @@ struct Connection { signal: Waiter, } -#[instrumented] +#[trace] fn tcp_connect(addr: SocketAddr, signal: &Waiter) -> Result { loop { match TcpStream::connect_timeout(&addr, *DAEMON_CONNECTION_TIMEOUT) { @@ -176,7 +176,7 @@ fn tcp_connect(addr: SocketAddr, signal: &Waiter) -> Result { } impl Connection { - #[instrumented] + #[trace] fn new( addr: SocketAddr, cookie_getter: Arc, @@ -196,12 +196,12 @@ impl Connection { }) } - #[instrumented] + #[trace] fn reconnect(&self) -> Result { Connection::new(self.addr, self.cookie_getter.clone(), self.signal.clone()) } - #[instrumented] + #[trace] fn send(&mut self, request: &str) -> Result<()> { let cookie = &self.cookie_getter.get()?; let msg = format!( @@ -215,7 +215,7 @@ impl Connection { }) } - #[instrumented] + #[trace] fn recv(&mut self) -> Result { // TODO: use proper HTTP parser. let mut in_header = true; @@ -381,7 +381,7 @@ impl Daemon { Ok(daemon) } - #[instrumented] + #[trace] pub fn reconnect(&self) -> Result { Ok(Daemon { daemon_dir: self.daemon_dir.clone(), @@ -396,7 +396,7 @@ impl Daemon { }) } - #[instrumented] + #[trace] pub fn list_blk_files(&self) -> Result> { let path = self.blocks_dir.join("blk*.dat"); debug!("listing block files at {:?}", path); @@ -432,7 +432,7 @@ impl Daemon { self.network.magic() } - #[instrumented] + #[trace] fn call_jsonrpc(&self, method: &str, request: &Value) -> Result { let mut conn = self.conn.lock().unwrap(); let timer = self.latency.with_label_values(&[method]).start_timer(); @@ -450,7 +450,7 @@ impl Daemon { Ok(result) } - #[instrumented(method = %method)] + #[trace(method = %method)] fn handle_request(&self, method: &str, params: &Value) -> Result { let id = self.message_id.next(); let req = json!({"method": method, "params": params, "id": id}); @@ -473,12 +473,12 @@ impl Daemon { } } - #[instrumented] + #[trace] fn request(&self, method: &str, params: Value) -> Result { self.retry_request(method, ¶ms) } - #[instrumented] + #[trace] fn retry_reconnect(&self) -> Daemon { // XXX add a max reconnection attempts limit? loop { @@ -493,14 +493,14 @@ impl Daemon { // Send requests in parallel over multiple RPC connections as individual JSON-RPC requests (with no JSON-RPC batching), // buffering the replies into a vector. If any of the requests fail, processing is terminated and an Err is returned. - #[instrumented] + #[trace] fn requests(&self, method: &str, params_list: Vec) -> Result> { self.requests_iter(method, params_list).collect() } // Send requests in parallel over multiple RPC connections, iterating over the results without buffering them. // Errors are included in the iterator and do not terminate other pending requests. - #[instrumented] + #[trace] fn requests_iter<'a>( &'a self, method: &'a str, @@ -523,29 +523,29 @@ impl Daemon { // bitcoind JSONRPC API: - #[instrumented] + #[trace] pub fn getblockchaininfo(&self) -> Result { let info: Value = self.request("getblockchaininfo", json!([]))?; Ok(from_value(info).chain_err(|| "invalid blockchain info")?) } - #[instrumented] + #[trace] fn getnetworkinfo(&self) -> Result { let info: Value = self.request("getnetworkinfo", json!([]))?; Ok(from_value(info).chain_err(|| "invalid network info")?) } - #[instrumented] + #[trace] pub fn getbestblockhash(&self) -> Result { parse_hash(&self.request("getbestblockhash", json!([]))?) } - #[instrumented] + #[trace] pub fn getblockheader(&self, blockhash: &BlockHash) -> Result { header_from_value(self.request("getblockheader", json!([blockhash, /*verbose=*/ false]))?) } - #[instrumented] + #[trace] pub fn getblockheaders(&self, heights: &[usize]) -> Result> { let heights: Vec = heights.iter().map(|height| json!([height])).collect(); let params_list: Vec = self @@ -560,7 +560,7 @@ impl Daemon { Ok(result) } - #[instrumented] + #[trace] pub fn getblock(&self, blockhash: &BlockHash) -> Result { let block = block_from_value(self.request("getblock", json!([blockhash, /*verbose=*/ false]))?)?; @@ -568,12 +568,12 @@ impl Daemon { Ok(block) } - #[instrumented] + #[trace] pub fn getblock_raw(&self, blockhash: &BlockHash, verbose: u32) -> Result { self.request("getblock", json!([blockhash, verbose])) } - #[instrumented] + #[trace] pub fn getblocks(&self, blockhashes: &[BlockHash]) -> Result> { let params_list: Vec = blockhashes .iter() @@ -610,7 +610,7 @@ impl Daemon { /// Fetch the given transactions in parallel over multiple threads and RPC connections, /// ignoring any missing ones and returning whatever is available. - #[instrumented] + #[trace] pub fn gettransactions_available(&self, txids: &[&Txid]) -> Result> { const RPC_INVALID_ADDRESS_OR_KEY: i64 = -5; @@ -635,7 +635,7 @@ impl Daemon { .collect() } - #[instrumented] + #[trace] pub fn gettransaction_raw( &self, txid: &Txid, @@ -645,24 +645,24 @@ impl Daemon { self.request("getrawtransaction", json!([txid, verbose, blockhash])) } - #[instrumented] + #[trace] pub fn getmempooltx(&self, txhash: &Txid) -> Result { let value = self.request("getrawtransaction", json!([txhash, /*verbose=*/ false]))?; tx_from_value(value) } - #[instrumented] + #[trace] pub fn getmempooltxids(&self) -> Result> { let res = self.request("getrawmempool", json!([/*verbose=*/ false]))?; Ok(serde_json::from_value(res).chain_err(|| "invalid getrawmempool reply")?) } - #[instrumented] + #[trace] pub fn broadcast(&self, tx: &Transaction) -> Result { self.broadcast_raw(&serialize_hex(tx)) } - #[instrumented] + #[trace] pub fn broadcast_raw(&self, txhex: &str) -> Result { let txid = self.request("sendrawtransaction", json!([txhex]))?; Ok( @@ -674,7 +674,7 @@ impl Daemon { // Get estimated feerates for the provided confirmation targets using a batch RPC request // Missing estimates are logged but do not cause a failure, whatever is available is returned #[allow(clippy::float_cmp)] - #[instrumented] + #[trace] pub fn estimatesmartfee_batch(&self, conf_targets: &[u16]) -> Result> { let params_list: Vec = conf_targets .iter() @@ -709,7 +709,7 @@ impl Daemon { .collect()) } - #[instrumented] + #[trace] fn get_all_headers(&self, tip: &BlockHash) -> Result> { let info: Value = self.request("getblockheader", json!([tip]))?; let tip_height = info @@ -737,7 +737,7 @@ impl Daemon { } // Returns a list of BlockHeaders in ascending height (i.e. the tip is last). - #[instrumented] + #[trace] pub fn get_new_headers( &self, indexed_headers: &HeaderList, @@ -770,7 +770,7 @@ impl Daemon { Ok(new_headers) } - #[instrumented] + #[trace] pub fn get_relayfee(&self) -> Result { let relayfee = self.getnetworkinfo()?.relayfee; diff --git a/src/electrum/server.rs b/src/electrum/server.rs index f5403ad98..1c425d35e 100644 --- a/src/electrum/server.rs +++ b/src/electrum/server.rs @@ -13,7 +13,7 @@ use error_chain::ChainedError; use hex::{self, DisplayHex}; use serde_json::{from_str, Value}; -use instrumented_macro::instrumented; +use electrs_macros::trace; #[cfg(not(feature = "liquid"))] use bitcoin::consensus::encode::serialize_hex; @@ -71,7 +71,7 @@ fn bool_from_value_or(val: Option<&Value>, name: &str, default: bool) -> Result< } // TODO: implement caching and delta updates -#[instrumented] +#[trace] fn get_status_hash(txs: Vec<(Txid, Option)>, query: &Query) -> Option { if txs.is_empty() { None @@ -264,7 +264,7 @@ impl Connection { })) } - #[instrumented] + #[trace] fn blockchain_estimatefee(&self, params: &[Value]) -> Result { let conf_target = usize_from_value(params.get(0), "blocks_count")?; let fee_rate = self @@ -392,7 +392,7 @@ impl Connection { Ok(json!(rawtx.to_lower_hex_string())) } - #[instrumented] + #[trace] fn blockchain_transaction_get_merkle(&self, params: &[Value]) -> Result { let txid = Txid::from(hash_from_value(params.get(0)).chain_err(|| "bad tx_hash")?); let height = usize_from_value(params.get(1), "height")?; @@ -430,7 +430,7 @@ impl Connection { })) } - #[instrumented(method = %method)] + #[trace(method = %method)] fn handle_command(&mut self, method: &str, params: &[Value], id: &Value) -> Result { let timer = self .stats @@ -487,7 +487,7 @@ impl Connection { }) } - #[instrumented] + #[trace] fn update_subscriptions(&mut self) -> Result> { let timer = self .stats @@ -545,7 +545,7 @@ impl Connection { Ok(()) } - #[instrumented] + #[trace] fn handle_replies(&mut self, receiver: Receiver) -> Result<()> { let empty_params = json!([]); loop { @@ -610,7 +610,7 @@ impl Connection { } } - #[instrumented] + #[trace] fn parse_requests(mut reader: BufReader, tx: &SyncSender) -> Result<()> { loop { let mut line = Vec::::new(); @@ -673,7 +673,7 @@ impl Connection { } } -#[instrumented] +#[trace] fn get_history( query: &Query, scripthash: &[u8], diff --git a/src/new_index/fetch.rs b/src/new_index/fetch.rs index d7aaae5fb..fd92ffedc 100644 --- a/src/new_index/fetch.rs +++ b/src/new_index/fetch.rs @@ -14,7 +14,7 @@ use std::path::PathBuf; use std::sync::mpsc::Receiver; use std::thread; -use instrumented_macro::instrumented; +use electrs_macros::trace; use crate::chain::{Block, BlockHash}; use crate::daemon::Daemon; @@ -27,7 +27,7 @@ pub enum FetchFrom { BlkFiles, } -#[instrumented] +#[trace] pub fn start_fetcher( from: FetchFrom, daemon: &Daemon, @@ -70,7 +70,7 @@ impl Fetcher { } } -#[instrumented] +#[trace] fn bitcoind_fetcher( daemon: &Daemon, new_headers: Vec, @@ -109,7 +109,7 @@ fn bitcoind_fetcher( )) } -#[instrumented] +#[trace] fn blkfiles_fetcher( daemon: &Daemon, new_headers: Vec, @@ -157,7 +157,7 @@ fn blkfiles_fetcher( )) } -#[instrumented] +#[trace] fn blkfiles_reader(blk_files: Vec, xor_key: Option<[u8; 8]>) -> Fetcher> { let chan = SyncChannel::new(1); let sender = chan.sender(); @@ -188,7 +188,7 @@ fn blkfile_apply_xor_key(xor_key: [u8; 8], blob: &mut [u8]) { } } -#[instrumented] +#[trace] fn blkfiles_parser(blobs: Fetcher>, magic: u32) -> Fetcher> { let chan = SyncChannel::new(1); let sender = chan.sender(); @@ -207,7 +207,7 @@ fn blkfiles_parser(blobs: Fetcher>, magic: u32) -> Fetcher, magic: u32) -> Result> { let mut cursor = Cursor::new(&blob); let mut slices = vec![]; diff --git a/src/new_index/mempool.rs b/src/new_index/mempool.rs index 3d1b328f2..99d5289fd 100644 --- a/src/new_index/mempool.rs +++ b/src/new_index/mempool.rs @@ -11,7 +11,7 @@ use std::iter::FromIterator; use std::sync::{Arc, RwLock}; use std::time::{Duration, Instant}; -use instrumented_macro::instrumented; +use electrs_macros::trace; use crate::chain::{deserialize, BlockHash, Network, OutPoint, Transaction, TxOut, Txid}; use crate::config::Config; use crate::daemon::Daemon; @@ -108,7 +108,7 @@ impl Mempool { self.txstore.get(txid).map(serialize) } - #[instrumented] + #[trace] pub fn lookup_spend(&self, outpoint: &OutPoint) -> Option { self.edges.get(outpoint).map(|(txid, vin)| SpendingInput { txid: *txid, @@ -125,7 +125,7 @@ impl Mempool { Some(self.feeinfo.get(txid)?.fee) } - #[instrumented] + #[trace] pub fn has_unconfirmed_parents(&self, txid: &Txid) -> bool { let tx = match self.txstore.get(txid) { Some(tx) => tx, @@ -136,7 +136,7 @@ impl Mempool { .any(|txin| self.txstore.contains_key(&txin.previous_output.txid)) } - #[instrumented] + #[trace] pub fn history(&self, scripthash: &[u8], limit: usize) -> Vec { let _timer = self.latency.with_label_values(&["history"]).start_timer(); self.history @@ -144,7 +144,7 @@ impl Mempool { .map_or_else(|| vec![], |entries| self._history(entries, limit)) } - #[instrumented] + #[trace] fn _history(&self, entries: &[TxHistoryInfo], limit: usize) -> Vec { entries .iter() @@ -156,7 +156,7 @@ impl Mempool { .collect() } - #[instrumented] + #[trace] pub fn history_txids(&self, scripthash: &[u8], limit: usize) -> Vec { let _timer = self .latency @@ -173,7 +173,7 @@ impl Mempool { } } - #[instrumented] + #[trace] pub fn utxo(&self, scripthash: &[u8]) -> Vec { let _timer = self.latency.with_label_values(&["utxo"]).start_timer(); let entries = match self.history.get(scripthash) { @@ -216,7 +216,7 @@ impl Mempool { .collect() } - #[instrumented] + #[trace] // @XXX avoid code duplication with ChainQuery::stats()? pub fn stats(&self, scripthash: &[u8]) -> ScriptStats { let _timer = self.latency.with_label_values(&["stats"]).start_timer(); @@ -266,14 +266,14 @@ impl Mempool { stats } - #[instrumented] + #[trace] // Get all txids in the mempool pub fn txids(&self) -> Vec<&Txid> { let _timer = self.latency.with_label_values(&["txids"]).start_timer(); self.txstore.keys().collect() } - #[instrumented] + #[trace] // Get an overview of the most recent transactions pub fn recent_txs_overview(&self) -> Vec<&TxOverview> { // We don't bother ever deleting elements from the recent list. @@ -282,17 +282,17 @@ impl Mempool { self.recent.iter().collect() } - #[instrumented] + #[trace] pub fn backlog_stats(&self) -> &BacklogStats { &self.backlog_stats.0 } - #[instrumented] + #[trace] pub fn txids_set(&self) -> HashSet { return HashSet::from_iter(self.txstore.keys().cloned()); } - #[instrumented] + #[trace] pub fn update_backlog_stats(&mut self) { let _timer = self .latency @@ -301,7 +301,7 @@ impl Mempool { self.backlog_stats = (BacklogStats::new(&self.feeinfo), Instant::now()); } - #[instrumented] + #[trace] pub fn add_by_txid(&mut self, daemon: &Daemon, txid: Txid) -> Result<()> { if self.txstore.get(&txid).is_none() { if let Ok(tx) = daemon.getmempooltx(&txid) { @@ -316,7 +316,7 @@ impl Mempool { } } - #[instrumented] + #[trace] fn add(&mut self, txs_map: HashMap) -> Result<()> { self.delta .with_label_values(&["add"]) @@ -429,14 +429,14 @@ impl Mempool { Ok(()) } - #[instrumented] + #[trace] fn lookup_txo(&self, outpoint: &OutPoint) -> Option { self.txstore .get(&outpoint.txid) .and_then(|tx| tx.output.get(outpoint.vout as usize).cloned()) } - #[instrumented] + #[trace] pub fn lookup_txos(&self, outpoints: BTreeSet) -> Result> { let _timer = self .latency @@ -458,7 +458,7 @@ impl Mempool { Ok(txos) } - #[instrumented] + #[trace] fn remove(&mut self, to_remove: HashSet<&Txid>) { self.delta .with_label_values(&["remove"]) @@ -494,7 +494,7 @@ impl Mempool { } #[cfg(feature = "liquid")] - #[instrumented] + #[trace] pub fn asset_history(&self, asset_id: &AssetId, limit: usize) -> Vec { let _timer = self .latency @@ -507,7 +507,7 @@ impl Mempool { /// Sync our local view of the mempool with the bitcoind Daemon RPC. If the chain tip moves before /// the mempool is fetched in full, syncing is aborted and an Ok(false) is returned. - #[instrumented] + #[trace] pub fn update( mempool: &Arc>, daemon: &Daemon, @@ -619,7 +619,7 @@ impl BacklogStats { } } - #[instrumented] + #[trace] fn new(feeinfo: &HashMap) -> Self { let (count, vsize, total_fee) = feeinfo .values() diff --git a/src/new_index/precache.rs b/src/new_index/precache.rs index a439c355b..58c454f20 100644 --- a/src/new_index/precache.rs +++ b/src/new_index/precache.rs @@ -13,9 +13,9 @@ use std::io; use std::io::prelude::*; use std::str::FromStr; -use instrumented_macro::instrumented; +use electrs_macros::trace; -#[instrumented] +#[trace] pub fn precache(chain: &ChainQuery, scripthashes: Vec) { let total = scripthashes.len(); info!("Pre-caching stats and utxo set for {} scripthashes", total); @@ -39,7 +39,7 @@ pub fn precache(chain: &ChainQuery, scripthashes: Vec) { }); } -#[instrumented] +#[trace] pub fn scripthashes_from_file(path: String) -> Result> { let reader = io::BufReader::new(File::open(path).chain_err(|| "cannot open precache scripthash file")?); diff --git a/src/new_index/query.rs b/src/new_index/query.rs index b5da380f8..0ddd436a0 100644 --- a/src/new_index/query.rs +++ b/src/new_index/query.rs @@ -11,7 +11,7 @@ use crate::errors::*; use crate::new_index::{ChainQuery, Mempool, ScriptStats, SpendingInput, Utxo}; use crate::util::{is_spendable, BlockId, Bytes, TransactionStatus}; -use instrumented_macro::instrumented; +use electrs_macros::trace; #[cfg(feature = "liquid")] use crate::{ @@ -71,7 +71,7 @@ impl Query { self.mempool.read().unwrap() } - #[instrumented] + #[trace] pub fn broadcast_raw(&self, txhex: &str) -> Result { let txid = self.daemon.broadcast_raw(txhex)?; let _ = self @@ -82,7 +82,7 @@ impl Query { Ok(txid) } - #[instrumented] + #[trace] pub fn utxo(&self, scripthash: &[u8]) -> Result> { let mut utxos = self.chain.utxo(scripthash, self.config.utxos_limit)?; let mempool = self.mempool(); @@ -91,7 +91,7 @@ impl Query { Ok(utxos) } - #[instrumented] + #[trace] pub fn history_txids(&self, scripthash: &[u8], limit: usize) -> Vec<(Txid, Option)> { let confirmed_txids = self.chain.history_txids(scripthash, limit); let confirmed_len = confirmed_txids.len(); @@ -113,21 +113,21 @@ impl Query { ) } - #[instrumented] + #[trace] pub fn lookup_txn(&self, txid: &Txid) -> Option { self.chain .lookup_txn(txid, None) .or_else(|| self.mempool().lookup_txn(txid)) } - #[instrumented] + #[trace] pub fn lookup_raw_txn(&self, txid: &Txid) -> Option { self.chain .lookup_raw_txn(txid, None) .or_else(|| self.mempool().lookup_raw_txn(txid)) } - #[instrumented] + #[trace] pub fn lookup_txos(&self, outpoints: BTreeSet) -> HashMap { // the mempool lookup_txos() internally looks up confirmed txos as well self.mempool() @@ -135,14 +135,14 @@ impl Query { .expect("failed loading txos") } - #[instrumented] + #[trace] pub fn lookup_spend(&self, outpoint: &OutPoint) -> Option { self.chain .lookup_spend(outpoint) .or_else(|| self.mempool().lookup_spend(outpoint)) } - #[instrumented] + #[trace] pub fn lookup_tx_spends(&self, tx: Transaction) -> Vec> { let txid = tx.txid(); @@ -162,22 +162,22 @@ impl Query { .collect() } - #[instrumented] + #[trace] pub fn get_tx_status(&self, txid: &Txid) -> TransactionStatus { TransactionStatus::from(self.chain.tx_confirming_block(txid)) } - #[instrumented] + #[trace] pub fn get_mempool_tx_fee(&self, txid: &Txid) -> Option { self.mempool().get_tx_fee(txid) } - #[instrumented] + #[trace] pub fn has_unconfirmed_parents(&self, txid: &Txid) -> bool { self.mempool().has_unconfirmed_parents(txid) } - #[instrumented] + #[trace] pub fn estimate_fee(&self, conf_target: u16) -> Option { if self.config.network_type.is_regtest() { return self.get_relayfee().ok(); @@ -197,7 +197,7 @@ impl Query { .copied() } - #[instrumented] + #[trace] pub fn estimate_fee_map(&self) -> HashMap { if let (ref cache, Some(cache_time)) = *self.cached_estimates.read().unwrap() { if cache_time.elapsed() < Duration::from_secs(FEE_ESTIMATES_TTL) { @@ -209,7 +209,7 @@ impl Query { self.cached_estimates.read().unwrap().0.clone() } - #[instrumented] + #[trace] fn update_fee_estimates(&self) { match self.daemon.estimatesmartfee_batch(&CONF_TARGETS) { Ok(estimates) => { @@ -221,7 +221,7 @@ impl Query { } } - #[instrumented] + #[trace] pub fn get_relayfee(&self) -> Result { if let Some(cached) = *self.cached_relayfee.read().unwrap() { return Ok(cached); @@ -252,13 +252,13 @@ impl Query { } #[cfg(feature = "liquid")] - #[instrumented] + #[trace] pub fn lookup_asset(&self, asset_id: &AssetId) -> Result> { lookup_asset(&self, self.asset_db.as_ref(), asset_id, None) } #[cfg(feature = "liquid")] - #[instrumented] + #[trace] pub fn list_registry_assets( &self, start_index: usize, diff --git a/src/rest.rs b/src/rest.rs index 471395912..3f4d544b8 100644 --- a/src/rest.rs +++ b/src/rest.rs @@ -24,7 +24,7 @@ use tokio::sync::oneshot; use std::fs; use std::str::FromStr; -use instrumented_macro::instrumented; +use electrs_macros::trace; #[cfg(feature = "liquid")] use { @@ -581,7 +581,7 @@ impl Handle { } } -#[instrumented] +#[trace] fn handle_request( method: Method, uri: hyper::Uri, @@ -1155,7 +1155,7 @@ fn json_response(value: T, ttl: u32) -> Result, Htt .unwrap()) } -#[instrumented] +#[trace] fn blocks(query: &Query, start_height: Option) -> Result, HttpError> { let mut values = Vec::new(); let mut current_hash = match start_height { diff --git a/src/util/block.rs b/src/util/block.rs index a8a6aee03..0c0804aa5 100644 --- a/src/util/block.rs +++ b/src/util/block.rs @@ -9,7 +9,7 @@ use std::slice; use time::format_description::well_known::Rfc3339; use time::OffsetDateTime as DateTime; -use instrumented_macro::instrumented; +use electrs_macros::trace; const MTP_SPAN: usize = 11; @@ -94,7 +94,7 @@ impl HeaderList { } } - #[instrumented] + #[trace] pub fn new( mut headers_map: HashMap, tip_hash: BlockHash, @@ -132,7 +132,7 @@ impl HeaderList { headers } - #[instrumented] + #[trace] pub fn order(&self, new_headers: Vec) -> Vec { // header[i] -> header[i-1] (i.e. header.last() is the tip) struct HashedHeader { @@ -172,7 +172,7 @@ impl HeaderList { .collect() } - #[instrumented] + #[trace] pub fn apply(&mut self, new_headers: Vec) { // new_headers[i] -> new_headers[i - 1] (i.e. new_headers.last() is the tip) for i in 1..new_headers.len() { @@ -210,7 +210,7 @@ impl HeaderList { } } - #[instrumented] + #[trace] pub fn header_by_blockhash(&self, blockhash: &BlockHash) -> Option<&HeaderEntry> { let height = self.heights.get(blockhash)?; let header = self.headers.get(*height)?; @@ -221,7 +221,7 @@ impl HeaderList { } } - #[instrumented] + #[trace] pub fn header_by_height(&self, height: usize) -> Option<&HeaderEntry> { self.headers.get(height).map(|entry| { assert_eq!(entry.height(), height); diff --git a/src/util/electrum_merkle.rs b/src/util/electrum_merkle.rs index 8b146705e..52e0a825a 100644 --- a/src/util/electrum_merkle.rs +++ b/src/util/electrum_merkle.rs @@ -3,9 +3,9 @@ use crate::errors::*; use crate::new_index::ChainQuery; use bitcoin::hashes::{sha256d::Hash as Sha256dHash, Hash}; -use instrumented_macro::instrumented; +use electrs_macros::trace; -#[instrumented] +#[trace] pub fn get_tx_merkle_proof( chain: &ChainQuery, tx_hash: &Txid, @@ -24,7 +24,7 @@ pub fn get_tx_merkle_proof( Ok((branch, pos)) } -#[instrumented] +#[trace] pub fn get_header_merkle_proof( chain: &ChainQuery, height: usize, @@ -53,7 +53,7 @@ pub fn get_header_merkle_proof( let header_hashes = header_hashes.into_iter().map(Sha256dHash::from).collect(); Ok(create_merkle_branch_and_root(header_hashes, height)) } -#[instrumented] +#[trace] pub fn get_id_from_pos( chain: &ChainQuery, height: usize, diff --git a/src/util/fees.rs b/src/util/fees.rs index eb3d61b15..0b7f7ada7 100644 --- a/src/util/fees.rs +++ b/src/util/fees.rs @@ -1,7 +1,7 @@ use crate::chain::{Network, Transaction, TxOut}; use std::collections::HashMap; -use instrumented_macro::instrumented; +use electrs_macros::trace; const VSIZE_BIN_WIDTH: u64 = 50_000; // in vbytes @@ -48,7 +48,7 @@ pub fn get_tx_fee(tx: &Transaction, _prevouts: &HashMap, network: N tx.fee_in(*network.native_asset()) } -#[instrumented] +#[trace] pub fn make_fee_histogram(mut entries: Vec<&TxFeeInfo>) -> Vec<(f64, u64)> { entries.sort_unstable_by(|e1, e2| e1.fee_per_vbyte.partial_cmp(&e2.fee_per_vbyte).unwrap()); From 843e1875b9de424a483efd034f1ff6523a73a462 Mon Sep 17 00:00:00 2001 From: Mariusz Reichert Date: Wed, 15 Jan 2025 23:13:02 +0100 Subject: [PATCH 6/6] lookup_txo trace removal --- src/new_index/mempool.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/new_index/mempool.rs b/src/new_index/mempool.rs index 99d5289fd..57a5fa5d8 100644 --- a/src/new_index/mempool.rs +++ b/src/new_index/mempool.rs @@ -429,7 +429,6 @@ impl Mempool { Ok(()) } - #[trace] fn lookup_txo(&self, outpoint: &OutPoint) -> Option { self.txstore .get(&outpoint.txid)