From 32f750591bf1ae82e48e7983575551bb1798e109 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Garillot?= Date: Sat, 13 Jan 2024 10:42:45 -0500 Subject: [PATCH 1/4] chore: Update proptest-derive - Updated the `proptest-derive` dependency in Cargo.toml to the latest version (`0.4.0`) --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 7ef70a0bf5..b2bcadef57 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -132,7 +132,7 @@ once_cell = "1.18.0" pairing = { version = "0.23" } pasta_curves = { git = "https://github.com/lurk-lab/pasta_curves", branch = "dev" } proptest = "1.2.0" -proptest-derive = "0.3" +proptest-derive = "0.4.0" rand = "0.8" serde = "1.0" serde_json = { version = "1.0" } From a01bdca822ea26f2120ae318ef2ee252098c6eef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Garillot?= Date: Sat, 13 Jan 2024 11:01:58 -0500 Subject: [PATCH 2/4] chore: Update metrics library and adapt usage - Updated the `metrics` package to `0.22.0` from `0.21.1` and updated API. - Modified `MetricsSink` initialization to utilize `set_global_recorder` for setting the metrics recorder. - Tweaked the manner of incrementing metrics in tests to use `.increment(n)` for counters and `.set(value)` - Expanded `MetricsRecorder` struct to now include `Metadata` within its `register_counter`, `register_gauge`, and `register_histogram` methods. --- Cargo.toml | 2 +- lurk-metrics/src/lib.rs | 28 ++++++++++++++-------------- lurk-metrics/src/recorder.rs | 8 ++++---- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b2bcadef57..0516add24b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -125,7 +125,7 @@ bellpepper-core = { git = "https://github.com/lurk-lab/bellpepper", branch = "de bincode = "1.3.3" clap = "4.3.17" ff = "0.13" -metrics = "0.21.1" +metrics = "0.22.0" neptune = { git = "https://github.com/lurk-lab/neptune", branch = "dev", features = ["abomonation"] } nova = { git = "https://github.com/lurk-lab/arecibo", branch = "dev", package = "arecibo" } once_cell = "1.18.0" diff --git a/lurk-metrics/src/lib.rs b/lurk-metrics/src/lib.rs index 0989bb4f0e..d3b1d17023 100644 --- a/lurk-metrics/src/lib.rs +++ b/lurk-metrics/src/lib.rs @@ -77,7 +77,7 @@ impl MetricsSink { }; sink.install(); - metrics::set_recorder(&MetricsRecorder).unwrap(); + metrics::set_global_recorder(MetricsRecorder).unwrap(); handle } @@ -181,19 +181,19 @@ mod tests { let threads = Arc::clone(&sink.threads); sink.install(); - metrics::set_recorder(&MetricsRecorder).unwrap(); - - metrics::counter!("test_counter", 1, "type" => "foo"); - metrics::counter!("test_counter", 1, "type" => "bar"); - metrics::counter!("test_counter", 2, "type" => "foo"); - metrics::counter!("test_counter", 2, "type" => "bar"); - metrics::counter!("test_counter", 3, "type" => "foo"); - metrics::counter!("test_counter", 4, "type" => "bar"); - - metrics::gauge!("test_gauge", 5.0, "type" => "foo"); - metrics::gauge!("test_gauge", 5.0, "type" => "bar"); - metrics::gauge!("test_gauge", 2.0, "type" => "foo"); - metrics::gauge!("test_gauge", 3.0, "type" => "bar"); + metrics::set_global_recorder(MetricsRecorder).unwrap(); + + metrics::counter!("test_counter", "type" => "foo").increment(1); + metrics::counter!("test_counter", "type" => "bar").increment(1); + metrics::counter!("test_counter", "type" => "foo").increment(2); + metrics::counter!("test_counter", "type" => "bar").increment(2); + metrics::counter!("test_counter", "type" => "foo").increment(3); + metrics::counter!("test_counter", "type" => "bar").increment(4); + + metrics::gauge!("test_gauge", "type" => "foo").set(5.0); + metrics::gauge!("test_gauge", "type" => "bar").set(5.0); + metrics::gauge!("test_gauge", "type" => "foo").set(2.0); + metrics::gauge!("test_gauge", "type" => "bar").set(3.0); let metrics = MetricsSink::aggregate(&threads); assert_eq!(metrics.iter().count(), 4); diff --git a/lurk-metrics/src/recorder.rs b/lurk-metrics/src/recorder.rs index 5d7b9ed57c..f3aba8c7a2 100644 --- a/lurk-metrics/src/recorder.rs +++ b/lurk-metrics/src/recorder.rs @@ -1,5 +1,5 @@ use metrics::{ - Counter, CounterFn, Gauge, GaugeFn, Histogram, HistogramFn, Key, KeyName, Recorder, + Counter, CounterFn, Gauge, GaugeFn, Histogram, HistogramFn, Key, KeyName, Metadata, Recorder, SharedString, Unit, }; @@ -18,15 +18,15 @@ impl Recorder for MetricsRecorder { fn describe_histogram(&self, _key: KeyName, _unit: Option, _description: SharedString) {} - fn register_counter(&self, key: &Key) -> Counter { + fn register_counter(&self, key: &Key, _metadata: &Metadata<'_>) -> Counter { Counter::from_arc(Arc::new(CounterImpl(key.clone()))) } - fn register_gauge(&self, key: &Key) -> Gauge { + fn register_gauge(&self, key: &Key, _metadata: &Metadata<'_>) -> Gauge { Gauge::from_arc(Arc::new(GaugeImpl(key.clone()))) } - fn register_histogram(&self, key: &Key) -> Histogram { + fn register_histogram(&self, key: &Key, _metadata: &Metadata<'_>) -> Histogram { Histogram::from_arc(Arc::new(HistogramImpl(key.clone()))) } } From 12eecf9e4f675d86f00a8d7e1d92a4ee2d1bb57c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Garillot?= Date: Sat, 13 Jan 2024 11:04:57 -0500 Subject: [PATCH 3/4] chore: Remove base64 dependency from Cargo.toml - Removed base64 dependency from the workspace - Eliminated base64 from the members list in Cargo.toml --- Cargo.toml | 2 -- 1 file changed, 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 0516add24b..11f215fc15 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,6 @@ ahash = "0.8.6" anyhow = { workspace = true } anymap = "1.0.0-beta.2" base32ct = { version = "0.2.0", features = ["std"] } -base64 = { workspace = true } base-x = "0.2.11" bellpepper = { workspace = true } bellpepper-core = { workspace = true } @@ -119,7 +118,6 @@ members = ["lurk-macros", "lurk-metrics"] [workspace.dependencies] abomonation = "0.7.3" anyhow = "1.0.72" -base64 = "0.13.1" bellpepper = { git = "https://github.com/lurk-lab/bellpepper", branch = "dev" } bellpepper-core = { git = "https://github.com/lurk-lab/bellpepper", branch = "dev" } bincode = "1.3.3" From 1f9f6fb6884a2c5471bb39fdaba1ef66dc2a6c7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Garillot?= Date: Sat, 20 Jan 2024 16:45:48 -0500 Subject: [PATCH 4/4] chore: Upgrade Rust toolchain and add typo exceptions - Upgraded the Rust toolchain version to `1.75` for enhanced performance and updated functionalities - Initialized a new file `_typos.toml` to handle and ignore specified typos like "[Aa]bomonation" to improve code readability and quality. Closes #1072 --- _typos.toml | 4 ++++ rust-toolchain.toml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 _typos.toml diff --git a/_typos.toml b/_typos.toml new file mode 100644 index 0000000000..00a38370c4 --- /dev/null +++ b/_typos.toml @@ -0,0 +1,4 @@ +[default] +extend-ignore-identifiers-re = [ + "[Aa]bomonation", +] diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 1ffa70ccd0..7d67641fa1 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,6 +1,6 @@ [toolchain] # The default profile includes rustc, rust-std, cargo, rust-docs, rustfmt and clippy. profile = "default" -channel = "1.73" +channel = "1.75" targets = [ "wasm32-unknown-unknown" ]