From 36451607c02149eb48d082a19fda75eb01be79f9 Mon Sep 17 00:00:00 2001 From: Jos Dehaes Date: Thu, 15 Feb 2024 11:33:20 +0100 Subject: [PATCH 1/2] feat: more metrics - gateway messages received - certified batches --- Cargo.toml | 5 +- node/bft/events/Cargo.toml | 2 +- node/bft/events/src/helpers/codec.rs | 9 ++- node/bft/src/primary.rs | 3 + node/metrics/snarkOS-grafana.json | 108 ++++++++++++++++++++++----- node/metrics/src/names.rs | 8 +- 6 files changed, 111 insertions(+), 24 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e7c47953bf..b0743a59b9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,8 +45,9 @@ version = "=0.1.24" default-features = false [workspace.dependencies.snarkvm] -git = "https://github.com/AleoHQ/snarkVM.git" -rev = "6e182c6" +git = "https://github.com/joske/snarkVM.git" +branch = "feat/histogram_labels" +#rev = "6e182c6" #version = "=0.16.18" features = [ "circuit", "console", "rocks" ] diff --git a/node/bft/events/Cargo.toml b/node/bft/events/Cargo.toml index 5eb134b4c7..afb195706b 100644 --- a/node/bft/events/Cargo.toml +++ b/node/bft/events/Cargo.toml @@ -18,7 +18,7 @@ edition = "2021" [features] default = [ ] -metrics = [ "dep:metrics" ] +metrics = ["dep:metrics", "snarkvm/metrics"] [dependencies.anyhow] version = "1.0" diff --git a/node/bft/events/src/helpers/codec.rs b/node/bft/events/src/helpers/codec.rs index 0d0c273d18..f7185c8a65 100644 --- a/node/bft/events/src/helpers/codec.rs +++ b/node/bft/events/src/helpers/codec.rs @@ -13,6 +13,7 @@ // limitations under the License. use crate::Event; +use metrics::histogram_label; use snarkvm::prelude::{FromBytes, Network, ToBytes}; use bytes::{Buf, BufMut, Bytes, BytesMut}; @@ -83,11 +84,15 @@ impl Decoder for EventCodec { Some(bytes) => bytes, None => return Ok(None), }; - + let bytes_len = bytes.len() as f64; // Convert the bytes to an event, or fail if it is not valid. let reader = bytes.reader(); match Event::read_le(reader) { - Ok(event) => Ok(Some(event)), + Ok(event) => { + #[cfg(feature = "metrics")] + histogram_label(metrics::tcp::TCP_GATEWAY, "event", String::from(event.name().clone()), bytes_len); + Ok(Some(event)) + } Err(error) => { error!("Failed to deserialize an event: {}", error); Err(std::io::ErrorKind::InvalidData.into()) diff --git a/node/bft/src/primary.rs b/node/bft/src/primary.rs index ac9cad8e30..4d2cd1e019 100644 --- a/node/bft/src/primary.rs +++ b/node/bft/src/primary.rs @@ -698,6 +698,9 @@ impl Primary { self.reinsert_transmissions_into_workers(proposal)?; return Err(e); } + + #[cfg(feature = "metrics")] + metrics::increment_gauge(metrics::bft::CERTIFIED_BATCHES, 1.0); Ok(()) } diff --git a/node/metrics/snarkOS-grafana.json b/node/metrics/snarkOS-grafana.json index 87070f09a4..25bd765970 100644 --- a/node/metrics/snarkOS-grafana.json +++ b/node/metrics/snarkOS-grafana.json @@ -979,13 +979,84 @@ "title": "Elected Leaders", "type": "stat" }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 0, + "y": 42 + }, + "id": 40, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.2.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "disableTextWrap": false, + "editorMode": "builder", + "expr": "snarkos_bft_primary_certified_batches", + "fullMetaSearch": false, + "includeNullMetadata": true, + "instant": false, + "legendFormat": "__auto", + "range": true, + "refId": "A", + "useBackend": false + } + ], + "title": "Certified Batches", + "type": "stat" + }, { "collapsed": false, "gridPos": { "h": 1, "w": 24, "x": 0, - "y": 42 + "y": 50 }, "id": 10, "panels": [], @@ -1057,7 +1128,7 @@ "h": 8, "w": 9, "x": 0, - "y": 43 + "y": 51 }, "id": 8, "options": { @@ -1181,7 +1252,7 @@ "h": 8, "w": 9, "x": 9, - "y": 43 + "y": 51 }, "id": 14, "options": { @@ -1274,8 +1345,7 @@ "value": 80 } ] - }, - "unit": "s" + } }, "overrides": [] }, @@ -1283,7 +1353,7 @@ "h": 8, "w": 12, "x": 6, - "y": 51 + "y": 59 }, "id": 38, "options": { @@ -1325,7 +1395,7 @@ "h": 1, "w": 24, "x": 0, - "y": 59 + "y": 67 }, "id": 4, "panels": [], @@ -1396,7 +1466,7 @@ "h": 8, "w": 12, "x": 6, - "y": 60 + "y": 68 }, "id": 37, "options": { @@ -1480,7 +1550,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -1496,7 +1567,7 @@ "h": 8, "w": 12, "x": 0, - "y": 68 + "y": 76 }, "id": 32, "options": { @@ -1580,7 +1651,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -1596,7 +1668,7 @@ "h": 8, "w": 12, "x": 12, - "y": 68 + "y": 76 }, "id": 33, "options": { @@ -1683,7 +1755,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -1699,7 +1772,7 @@ "h": 8, "w": 12, "x": 0, - "y": 76 + "y": 84 }, "id": 34, "options": { @@ -1783,7 +1856,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -1799,7 +1873,7 @@ "h": 8, "w": 12, "x": 12, - "y": 76 + "y": 84 }, "id": 35, "options": { @@ -1867,6 +1941,6 @@ "timezone": "", "title": "snarkOS", "uid": "ahTJm4-4k", - "version": 1, + "version": 2, "weekStart": "" } \ No newline at end of file diff --git a/node/metrics/src/names.rs b/node/metrics/src/names.rs index 6f244e5f40..8194341846 100644 --- a/node/metrics/src/names.rs +++ b/node/metrics/src/names.rs @@ -14,11 +14,12 @@ pub(super) const COUNTER_NAMES: [&str; 1] = [bft::LEADERS_ELECTED]; -pub(super) const GAUGE_NAMES: [&str; 12] = [ +pub(super) const GAUGE_NAMES: [&str; 13] = [ bft::CONNECTED, bft::CONNECTING, bft::LAST_STORED_ROUND, bft::PROPOSAL_ROUND, + bft::CERTIFIED_BATCHES, blocks::HEIGHT, blocks::TRANSACTIONS, consensus::COMMITTED_CERTIFICATES, @@ -29,7 +30,7 @@ pub(super) const GAUGE_NAMES: [&str; 12] = [ tcp::TCP_TASKS, ]; -pub(super) const HISTOGRAM_NAMES: [&str; 7] = [ +pub(super) const HISTOGRAM_NAMES: [&str; 8] = [ bft::COMMIT_ROUNDS_LATENCY, consensus::CERTIFICATE_COMMIT_LATENCY, consensus::BLOCK_LATENCY, @@ -37,6 +38,7 @@ pub(super) const HISTOGRAM_NAMES: [&str; 7] = [ tcp::NOISE_CODEC_DECRYPTION_TIME, tcp::NOISE_CODEC_ENCRYPTION_SIZE, tcp::NOISE_CODEC_DECRYPTION_SIZE, + tcp::TCP_GATEWAY, ]; pub mod bft { @@ -46,6 +48,7 @@ pub mod bft { pub const LAST_STORED_ROUND: &str = "snarkos_bft_last_stored_round"; pub const LEADERS_ELECTED: &str = "snarkos_bft_leaders_elected_total"; pub const PROPOSAL_ROUND: &str = "snarkos_bft_primary_proposal_round"; + pub const CERTIFIED_BATCHES: &str = "snarkos_bft_primary_certified_batches"; } pub mod blocks { @@ -72,4 +75,5 @@ pub mod tcp { pub const NOISE_CODEC_ENCRYPTION_SIZE: &str = "snarkos_tcp_noise_codec_encryption_size"; pub const NOISE_CODEC_DECRYPTION_SIZE: &str = "snarkos_tcp_noise_codec_decryption_size"; pub const TCP_TASKS: &str = "snarkos_tcp_tasks_total"; + pub const TCP_GATEWAY: &str = "snarkos_tcp_gateway_messages_received"; } From f7eaf849e7a67a0c1807310f7ee46f2e8804106b Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Thu, 15 Feb 2024 13:16:25 -0800 Subject: [PATCH 2/2] Fix rev and add feature flag guard --- Cargo.lock | 116 +++++++++++++-------------- Cargo.toml | 5 +- node/bft/events/src/helpers/codec.rs | 11 ++- 3 files changed, 68 insertions(+), 64 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f8cde5e5e5..28ac9c23bc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3517,7 +3517,7 @@ dependencies = [ [[package]] name = "snarkvm" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "anstyle", "anyhow", @@ -3548,7 +3548,7 @@ dependencies = [ [[package]] name = "snarkvm-algorithms" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "aleo-std", "anyhow", @@ -3578,7 +3578,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "snarkvm-circuit-account", "snarkvm-circuit-algorithms", @@ -3592,7 +3592,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-account" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "snarkvm-circuit-algorithms", "snarkvm-circuit-network", @@ -3603,7 +3603,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-algorithms" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "snarkvm-circuit-types", "snarkvm-console-algorithms", @@ -3613,7 +3613,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-collections" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "snarkvm-circuit-algorithms", "snarkvm-circuit-types", @@ -3623,7 +3623,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-environment" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "indexmap 2.2.3", "itertools 0.11.0", @@ -3641,12 +3641,12 @@ dependencies = [ [[package]] name = "snarkvm-circuit-environment-witness" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" [[package]] name = "snarkvm-circuit-network" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "snarkvm-circuit-algorithms", "snarkvm-circuit-collections", @@ -3657,7 +3657,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-program" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "paste", "snarkvm-circuit-account", @@ -3672,7 +3672,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-address", @@ -3687,7 +3687,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-address" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -3700,7 +3700,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-boolean" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "snarkvm-circuit-environment", "snarkvm-console-types-boolean", @@ -3709,7 +3709,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-field" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -3719,7 +3719,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-group" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -3731,7 +3731,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-integers" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -3743,7 +3743,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-scalar" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -3754,7 +3754,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-string" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -3766,7 +3766,7 @@ dependencies = [ [[package]] name = "snarkvm-console" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "snarkvm-console-account", "snarkvm-console-algorithms", @@ -3779,7 +3779,7 @@ dependencies = [ [[package]] name = "snarkvm-console-account" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "bs58", "snarkvm-console-network", @@ -3790,7 +3790,7 @@ dependencies = [ [[package]] name = "snarkvm-console-algorithms" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "blake2s_simd", "smallvec", @@ -3803,7 +3803,7 @@ dependencies = [ [[package]] name = "snarkvm-console-collections" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "aleo-std", "rayon", @@ -3814,7 +3814,7 @@ dependencies = [ [[package]] name = "snarkvm-console-network" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "anyhow", "indexmap 2.2.3", @@ -3837,7 +3837,7 @@ dependencies = [ [[package]] name = "snarkvm-console-network-environment" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "anyhow", "bech32", @@ -3855,7 +3855,7 @@ dependencies = [ [[package]] name = "snarkvm-console-program" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "enum_index", "enum_index_derive", @@ -3876,7 +3876,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "snarkvm-console-network-environment", "snarkvm-console-types-address", @@ -3891,7 +3891,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-address" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "snarkvm-console-network-environment", "snarkvm-console-types-boolean", @@ -3902,7 +3902,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-boolean" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "snarkvm-console-network-environment", ] @@ -3910,7 +3910,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-field" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "snarkvm-console-network-environment", "snarkvm-console-types-boolean", @@ -3920,7 +3920,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-group" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "snarkvm-console-network-environment", "snarkvm-console-types-boolean", @@ -3931,7 +3931,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-integers" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "snarkvm-console-network-environment", "snarkvm-console-types-boolean", @@ -3942,7 +3942,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-scalar" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "snarkvm-console-network-environment", "snarkvm-console-types-boolean", @@ -3953,7 +3953,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-string" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "snarkvm-console-network-environment", "snarkvm-console-types-boolean", @@ -3964,7 +3964,7 @@ dependencies = [ [[package]] name = "snarkvm-curves" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "rand", "rayon", @@ -3978,7 +3978,7 @@ dependencies = [ [[package]] name = "snarkvm-fields" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "aleo-std", "anyhow", @@ -3995,7 +3995,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "aleo-std", "anyhow", @@ -4020,7 +4020,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-authority" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "anyhow", "rand", @@ -4032,7 +4032,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-block" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "indexmap 2.2.3", "rayon", @@ -4051,7 +4051,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-coinbase" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "aleo-std", "anyhow", @@ -4071,7 +4071,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-committee" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "anyhow", "indexmap 2.2.3", @@ -4089,7 +4089,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "snarkvm-ledger-narwhal-batch-certificate", "snarkvm-ledger-narwhal-batch-header", @@ -4102,7 +4102,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-batch-certificate" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "indexmap 2.2.3", "rayon", @@ -4115,7 +4115,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-batch-header" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "indexmap 2.2.3", "serde_json", @@ -4127,7 +4127,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-data" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "bytes", "serde_json", @@ -4138,7 +4138,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-subdag" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "indexmap 2.2.3", "rayon", @@ -4153,7 +4153,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-transmission" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "bytes", "serde_json", @@ -4166,7 +4166,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-transmission-id" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "snarkvm-console", "snarkvm-ledger-coinbase", @@ -4175,7 +4175,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-query" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "async-trait", "reqwest", @@ -4188,7 +4188,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-store" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "aleo-std-storage", "anyhow", @@ -4214,7 +4214,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-test-helpers" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "once_cell", "snarkvm-circuit", @@ -4229,7 +4229,7 @@ dependencies = [ [[package]] name = "snarkvm-metrics" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "metrics", "metrics-exporter-prometheus", @@ -4238,7 +4238,7 @@ dependencies = [ [[package]] name = "snarkvm-parameters" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "aleo-std", "anyhow", @@ -4263,7 +4263,7 @@ dependencies = [ [[package]] name = "snarkvm-synthesizer" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "aleo-std", "anyhow", @@ -4288,7 +4288,7 @@ dependencies = [ [[package]] name = "snarkvm-synthesizer-process" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "aleo-std", "colored", @@ -4311,7 +4311,7 @@ dependencies = [ [[package]] name = "snarkvm-synthesizer-program" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "indexmap 2.2.3", "paste", @@ -4325,7 +4325,7 @@ dependencies = [ [[package]] name = "snarkvm-synthesizer-snark" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "bincode", "once_cell", @@ -4338,7 +4338,7 @@ dependencies = [ [[package]] name = "snarkvm-utilities" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "aleo-std", "anyhow", @@ -4359,7 +4359,7 @@ dependencies = [ [[package]] name = "snarkvm-utilities-derives" version = "0.16.19" -source = "git+https://github.com/AleoHQ/snarkVM.git?rev=6e182c6#6e182c6d6c9ec92a0140dbf543e9149699b68c60" +source = "git+https://github.com/AleoHQ/snarkVM.git?rev=b396a51#b396a51396cfca0cc4de0a0f794063cee8aea719" dependencies = [ "proc-macro2", "quote 1.0.35", diff --git a/Cargo.toml b/Cargo.toml index b0743a59b9..58de9ea971 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,9 +45,8 @@ version = "=0.1.24" default-features = false [workspace.dependencies.snarkvm] -git = "https://github.com/joske/snarkVM.git" -branch = "feat/histogram_labels" -#rev = "6e182c6" +git = "https://github.com/AleoHQ/snarkVM.git" +rev = "b396a51" #version = "=0.16.18" features = [ "circuit", "console", "rocks" ] diff --git a/node/bft/events/src/helpers/codec.rs b/node/bft/events/src/helpers/codec.rs index f7185c8a65..e9498427ec 100644 --- a/node/bft/events/src/helpers/codec.rs +++ b/node/bft/events/src/helpers/codec.rs @@ -13,7 +13,6 @@ // limitations under the License. use crate::Event; -use metrics::histogram_label; use snarkvm::prelude::{FromBytes, Network, ToBytes}; use bytes::{Buf, BufMut, Bytes, BytesMut}; @@ -84,13 +83,19 @@ impl Decoder for EventCodec { Some(bytes) => bytes, None => return Ok(None), }; - let bytes_len = bytes.len() as f64; + #[cfg(feature = "metrics")] + let num_bytes = bytes.len() as f64; // Convert the bytes to an event, or fail if it is not valid. let reader = bytes.reader(); match Event::read_le(reader) { Ok(event) => { #[cfg(feature = "metrics")] - histogram_label(metrics::tcp::TCP_GATEWAY, "event", String::from(event.name().clone()), bytes_len); + metrics::histogram_label( + metrics::tcp::TCP_GATEWAY, + "event", + String::from(event.name().clone()), + num_bytes, + ); Ok(Some(event)) } Err(error) => {