From 9e16fa274fab672f6cacac410bf6fea1b388a443 Mon Sep 17 00:00:00 2001 From: Felipe Manzano Date: Tue, 25 Mar 2025 16:57:25 -0300 Subject: [PATCH 01/28] Do not reset the fee counter at each epoch --- src/metrics/fees.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/metrics/fees.rs b/src/metrics/fees.rs index d5776d1..bd9ef17 100644 --- a/src/metrics/fees.rs +++ b/src/metrics/fees.rs @@ -1,16 +1,16 @@ use crate::state::State; /// ## Fees Metric. (fees) -/// This metric tracks the total transaction fees paid per block and per token. It helps monitor the gas costs of transactions on +/// This metric tracks the total transaction fees paid per token. It helps monitor the gas costs of transactions on /// the network, providing insight into network congestion and transaction fee trends. /// * The metric is a counter, meaning it only increases over time. -/// * Fees are labeled by the block height and the token used for gas payments. +/// * Fees are labeled by the token used for gas payments. /// ### Example /// ``` -/// # HELP namada_fees Total fees paid per block and per token +/// # HELP namada_fees Total fees paid per token over time /// # TYPE namada_fees counter -/// namada_fees{height="777604",token="tnam1q9gr66cvu4hrzm0sd5kmlnjje82gs3xlfg3v6nu7",chain_id="housefire-alpaca.cc0d3e0c033be"} 0.5845009999999999 -/// namada_fees{height="777605",token="tnam1q9gr66cvu4hrzm0sd5kmlnjje82gs3xlfg3v6nu7",chain_id="housefire-alpaca.cc0d3e0c033be"} 0.154409 +/// namada_fees{token="tnam1q9gr66cvu4hrzm0sd5kmlnjje82gs3xlfg3v6nu7",chain_id="housefire-alpaca.cc0d3e0c033be"} 0.5845009999999999 +/// namada_fees{token="tnam1q9gr66cvu4hrzm0sd5kmlnjje82gs3xlfg3v6nu7",chain_id="housefire-alpaca.cc0d3e0c033be"} 0.154409 /// ``` use prometheus_exporter::prometheus::core::{AtomicF64, GenericCounterVec}; use prometheus_exporter::prometheus::{CounterVec, Opts, Registry}; @@ -33,9 +33,6 @@ impl MetricTrait for Fees { } fn update(&self, pre_state: &State, post_state: &State) { - if pre_state.get_epoch() != post_state.get_epoch() { - self.reset(post_state); - } let block = post_state.get_last_block(); for tx in &block.transactions { let amount_per_gas = tx.fee.amount_per_gas_unit.parse::(); From b6e277202a953fa9289cc9830482b3c49d4460ae Mon Sep 17 00:00:00 2001 From: Felipe Manzano Date: Wed, 26 Mar 2025 10:10:04 -0300 Subject: [PATCH 02/28] Move fee to gauge --- composer/.env | 6 ++++-- src/metrics/fees.rs | 28 +++++++++++++--------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/composer/.env b/composer/.env index c6ef410..68e5605 100644 --- a/composer/.env +++ b/composer/.env @@ -1,4 +1,6 @@ #CHAIN_ID=housefire-alpaca.cc0d3e0c033be #RPC=https://proxy.public.heliax.work/housefire-alpaca.cc0d3e0c033be -CHAIN_ID=campfire-square.ff09671d333707 -RPC=https://proxy.public.heliax.work/campfire-square.ff09671d333707 +#CHAIN_ID=campfire-square.ff09671d333707 +#RPC=https://proxy.public.heliax.work/campfire-square.ff09671d333707 +CHAIN_ID=local.e899ac5a83d8bc66af576aaf +RPC=http://host.docker.internal:27657 diff --git a/src/metrics/fees.rs b/src/metrics/fees.rs index bd9ef17..26f815d 100644 --- a/src/metrics/fees.rs +++ b/src/metrics/fees.rs @@ -12,14 +12,13 @@ use crate::state::State; /// namada_fees{token="tnam1q9gr66cvu4hrzm0sd5kmlnjje82gs3xlfg3v6nu7",chain_id="housefire-alpaca.cc0d3e0c033be"} 0.5845009999999999 /// namada_fees{token="tnam1q9gr66cvu4hrzm0sd5kmlnjje82gs3xlfg3v6nu7",chain_id="housefire-alpaca.cc0d3e0c033be"} 0.154409 /// ``` -use prometheus_exporter::prometheus::core::{AtomicF64, GenericCounterVec}; -use prometheus_exporter::prometheus::{CounterVec, Opts, Registry}; +use prometheus_exporter::prometheus::{GaugeVec, Registry, Opts}; use super::MetricTrait; pub struct Fees { - /// fees counter - fees: GenericCounterVec, + /// fees counters + fees: GaugeVec, } impl MetricTrait for Fees { @@ -28,12 +27,8 @@ impl MetricTrait for Fees { Ok(()) } - fn reset(&self, _state: &State) { - self.fees.reset(); - } - - fn update(&self, pre_state: &State, post_state: &State) { - let block = post_state.get_last_block(); + fn reset(&self, state: &State) { + let block = state.get_last_block(); for tx in &block.transactions { let amount_per_gas = tx.fee.amount_per_gas_unit.parse::(); let gas_limit = tx.fee.gas.parse::(); @@ -45,17 +40,20 @@ impl MetricTrait for Fees { self.fees .with_label_values(&[&tx.fee.gas_token]) - .inc_by(fee); + .set(fee); } } + + fn update(&self, _pre_state: &State, post_state: &State) { + self.reset(post_state); + } } impl Default for Fees { fn default() -> Self { - let fees_opts = Opts::new("fees", "Total fees paid per block and per token"); - let fees = CounterVec::new(fees_opts, &["token"]) - .expect("unable to create int counter for transaction kinds"); - + let fees_opts = Opts::new("fees", "Total fees paid per token over time"); + let fees = GaugeVec::new(fees_opts, &["token"]) + .expect("unable to create gauge vector for transaction fees"); Self { fees } } } From b6669e4f7898a56088da319fdc8b70650c6232a0 Mon Sep 17 00:00:00 2001 From: Felipe Manzano Date: Wed, 26 Mar 2025 10:11:01 -0300 Subject: [PATCH 03/28] Try prometheus rules linter --- .github/workflows/pint.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/pint.yml diff --git a/.github/workflows/pint.yml b/.github/workflows/pint.yml new file mode 100644 index 0000000..d1982b2 --- /dev/null +++ b/.github/workflows/pint.yml @@ -0,0 +1,27 @@ +name: pint + +on: + push: + branches: + - main + pull_request: + branches: + - main + +permissions: + pull-requests: write + +jobs: + pint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Run pint + uses: prymitive/pint-action@v1 + with: + token: ${{ github.token }} + workdir: 'composer/provisioning/prometheus' + requireOwner: 'true' From 38a09c223973c712ed3751224c633cf170e6dd16 Mon Sep 17 00:00:00 2001 From: Felipe Manzano Date: Wed, 26 Mar 2025 10:30:23 -0300 Subject: [PATCH 04/28] point pint ci to config --- .github/workflows/pint.yml | 3 ++- .pint.hcl | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 .pint.hcl diff --git a/.github/workflows/pint.yml b/.github/workflows/pint.yml index d1982b2..5f422c4 100644 --- a/.github/workflows/pint.yml +++ b/.github/workflows/pint.yml @@ -23,5 +23,6 @@ jobs: uses: prymitive/pint-action@v1 with: token: ${{ github.token }} - workdir: 'composer/provisioning/prometheus' + workdir: 'composer/provisioning/prometheus/namada-alerts.yml' requireOwner: 'true' + config: '.pint.hcl' diff --git a/.pint.hcl b/.pint.hcl new file mode 100644 index 0000000..f3eaebb --- /dev/null +++ b/.pint.hcl @@ -0,0 +1,9 @@ +parser { + include = ["composer/prometheus/*alert*.yaml"] + relaxed = [".*"] +} + +ci { + include = ["composer/prometheus/*alert*.yaml"] + relaxed = [".*"] +} \ No newline at end of file From 891590254efed7e4ca93ddbcbd7877e8f981e5ee Mon Sep 17 00:00:00 2001 From: Felipe Manzano Date: Wed, 26 Mar 2025 10:35:40 -0300 Subject: [PATCH 05/28] Try prometheus rules linter --- .pint.hcl | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.pint.hcl b/.pint.hcl index f3eaebb..c82741f 100644 --- a/.pint.hcl +++ b/.pint.hcl @@ -1,9 +1,4 @@ parser { include = ["composer/prometheus/*alert*.yaml"] relaxed = [".*"] -} - -ci { - include = ["composer/prometheus/*alert*.yaml"] - relaxed = [".*"] -} \ No newline at end of file +}:wq \ No newline at end of file From 04bc0235f2535b11abd655248b623fd624246652 Mon Sep 17 00:00:00 2001 From: Felipe Manzano Date: Wed, 26 Mar 2025 10:37:01 -0300 Subject: [PATCH 06/28] Try prometheus rules linter --- .pint.hcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pint.hcl b/.pint.hcl index c82741f..e901a48 100644 --- a/.pint.hcl +++ b/.pint.hcl @@ -1,4 +1,4 @@ parser { include = ["composer/prometheus/*alert*.yaml"] relaxed = [".*"] -}:wq \ No newline at end of file +} From 08019407236232ed059bbf80ea584d52677c26cc Mon Sep 17 00:00:00 2001 From: Felipe Manzano Date: Wed, 26 Mar 2025 10:39:27 -0300 Subject: [PATCH 07/28] Try prometheus rules linter --- .pint.hcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pint.hcl b/.pint.hcl index e901a48..9b881fd 100644 --- a/.pint.hcl +++ b/.pint.hcl @@ -1,4 +1,4 @@ parser { - include = ["composer/prometheus/*alert*.yaml"] + include = ["composer/prometheus/.*alert.*.yaml"] relaxed = [".*"] } From 6c8c21e65546fba5c473ddebc9fc8e9506ef2496 Mon Sep 17 00:00:00 2001 From: Felipe Manzano Date: Wed, 26 Mar 2025 10:43:50 -0300 Subject: [PATCH 08/28] Try prometheus rules linter --- .pint.hcl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.pint.hcl b/.pint.hcl index 9b881fd..688800a 100644 --- a/.pint.hcl +++ b/.pint.hcl @@ -1,4 +1,7 @@ parser { - include = ["composer/prometheus/.*alert.*.yaml"] - relaxed = [".*"] + include = [".*alert.*.yaml"] } + +ci { + include = [".*alert.*.yaml"] +} \ No newline at end of file From 42d8ad7d60e137967e3aa83f9d94d251e1fa4bba Mon Sep 17 00:00:00 2001 From: Felipe Manzano Date: Wed, 26 Mar 2025 10:45:12 -0300 Subject: [PATCH 09/28] Try prometheus rules linter --- .pint.hcl | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.pint.hcl b/.pint.hcl index 688800a..3ab9a0b 100644 --- a/.pint.hcl +++ b/.pint.hcl @@ -1,7 +1,3 @@ parser { include = [".*alert.*.yaml"] } - -ci { - include = [".*alert.*.yaml"] -} \ No newline at end of file From e14a862376ff2e95d7cd667bcb16a448a037bbe7 Mon Sep 17 00:00:00 2001 From: Felipe Manzano Date: Wed, 26 Mar 2025 10:54:02 -0300 Subject: [PATCH 10/28] Try prometheus rules linter --- .pint.hcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pint.hcl b/.pint.hcl index 3ab9a0b..b12b24d 100644 --- a/.pint.hcl +++ b/.pint.hcl @@ -1,3 +1,3 @@ parser { - include = [".*alert.*.yaml"] + include = [".*alert.*.(yaml|yml)"] } From 0e2b7a65a683a6e34e6f5e79025ae0ed86e0441d Mon Sep 17 00:00:00 2001 From: Felipe Manzano Date: Wed, 26 Mar 2025 10:55:49 -0300 Subject: [PATCH 11/28] Try prometheus rules linter --- .github/workflows/pint.yml | 2 +- .pint.hcl | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pint.yml b/.github/workflows/pint.yml index 5f422c4..a927b77 100644 --- a/.github/workflows/pint.yml +++ b/.github/workflows/pint.yml @@ -24,5 +24,5 @@ jobs: with: token: ${{ github.token }} workdir: 'composer/provisioning/prometheus/namada-alerts.yml' - requireOwner: 'true' + requireOwner: 'false' config: '.pint.hcl' diff --git a/.pint.hcl b/.pint.hcl index b12b24d..4adcfb8 100644 --- a/.pint.hcl +++ b/.pint.hcl @@ -1,3 +1,4 @@ parser { include = [".*alert.*.(yaml|yml)"] + relaxed = [".*"] } From 210a4a019df7cf7bbd95a74b5c51c25c40d6c0fc Mon Sep 17 00:00:00 2001 From: Felipe Manzano Date: Wed, 26 Mar 2025 10:59:20 -0300 Subject: [PATCH 12/28] Try prometheus rules linter --- .github/workflows/pint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pint.yml b/.github/workflows/pint.yml index a927b77..e547b71 100644 --- a/.github/workflows/pint.yml +++ b/.github/workflows/pint.yml @@ -23,6 +23,6 @@ jobs: uses: prymitive/pint-action@v1 with: token: ${{ github.token }} - workdir: 'composer/provisioning/prometheus/namada-alerts.yml' + workdir: 'composer/provisioning/prometheus' requireOwner: 'false' config: '.pint.hcl' From f13e3061a6e49ea8eb57abdf2443955ec7fe0270 Mon Sep 17 00:00:00 2001 From: Felipe Manzano Date: Wed, 26 Mar 2025 11:02:48 -0300 Subject: [PATCH 13/28] Try prometheus rules linter --- .github/workflows/pint.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pint.yml b/.github/workflows/pint.yml index e547b71..75b792c 100644 --- a/.github/workflows/pint.yml +++ b/.github/workflows/pint.yml @@ -24,5 +24,4 @@ jobs: with: token: ${{ github.token }} workdir: 'composer/provisioning/prometheus' - requireOwner: 'false' config: '.pint.hcl' From 52c24bf29fd9a203700f2bf5c797a474545b4622 Mon Sep 17 00:00:00 2001 From: Felipe Manzano Date: Thu, 27 Mar 2025 11:16:59 -0300 Subject: [PATCH 14/28] WIP slashes test --- Cargo.lock | 1080 +++++++++++------ Cargo.toml | 4 +- composer/.env | 6 +- .../provisioning/prometheus/namada-alerts.yml | 14 +- src/main.rs | 4 +- src/rpc.rs | 97 +- src/state.rs | 10 +- 7 files changed, 843 insertions(+), 372 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 14e2267..f5a08c7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -54,11 +54,23 @@ version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" dependencies = [ - "getrandom", + "getrandom 0.2.15", "once_cell", "version_check", ] +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + [[package]] name = "aho-corasick" version = "1.1.3" @@ -147,84 +159,124 @@ checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" [[package]] name = "ark-bls12-381" -version = "0.3.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65be532f9dd1e98ad0150b037276cde464c6f371059e6dd02c0222395761f6aa" +checksum = "3df4dcc01ff89867cd86b0da835f23c3f02738353aaee7dde7495af71363b8d5" dependencies = [ "ark-ec", "ark-ff", + "ark-serialize", "ark-std", ] [[package]] name = "ark-ec" -version = "0.3.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dea978406c4b1ca13c2db2373b05cc55429c3575b8b21f1b9ee859aa5b03dd42" +checksum = "43d68f2d516162846c1238e755a7c4d131b892b70cc70c471a8e3ca3ed818fce" dependencies = [ + "ahash 0.8.11", "ark-ff", + "ark-poly", "ark-serialize", "ark-std", - "derivative", + "educe", + "fnv", + "hashbrown 0.15.2", + "itertools 0.13.0", + "num-bigint", + "num-integer", "num-traits", "zeroize", ] [[package]] name = "ark-ff" -version = "0.3.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b3235cc41ee7a12aaaf2c575a2ad7b46713a8a50bda2fc3b003a04845c05dd6" +checksum = "a177aba0ed1e0fbb62aa9f6d0502e9b46dad8c2eab04c14258a1212d2557ea70" dependencies = [ "ark-ff-asm", "ark-ff-macros", "ark-serialize", "ark-std", - "derivative", + "arrayvec", + "digest 0.10.7", + "educe", + "itertools 0.13.0", "num-bigint", "num-traits", "paste", - "rustc_version 0.3.3", "zeroize", ] [[package]] name = "ark-ff-asm" -version = "0.3.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db02d390bf6643fb404d3d22d31aee1c4bc4459600aef9113833d17e786c6e44" +checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" dependencies = [ "quote", - "syn 1.0.109", + "syn 2.0.96", ] [[package]] name = "ark-ff-macros" -version = "0.3.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fd794a08ccb318058009eefdf15bcaaaaf6f8161eb3345f907222bac38b20" +checksum = "09be120733ee33f7693ceaa202ca41accd5653b779563608f1234f78ae07c4b3" dependencies = [ "num-bigint", "num-traits", + "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.96", +] + +[[package]] +name = "ark-poly" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579305839da207f02b89cd1679e50e67b4331e2f9294a57693e5051b7703fe27" +dependencies = [ + "ahash 0.8.11", + "ark-ff", + "ark-serialize", + "ark-std", + "educe", + "fnv", + "hashbrown 0.15.2", ] [[package]] name = "ark-serialize" -version = "0.3.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d6c2b318ee6e10f8c2853e73a83adc0ccb88995aa978d8a3408d492ab2ee671" +checksum = "3f4d068aaf107ebcd7dfb52bc748f8030e0fc930ac8e360146ca54c1203088f7" dependencies = [ + "ark-serialize-derive", "ark-std", - "digest 0.9.0", + "arrayvec", + "digest 0.10.7", + "num-bigint", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213888f660fddcca0d257e88e54ac05bca01885f258ccdf695bafd77031bb69d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", ] [[package]] name = "ark-std" -version = "0.3.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" +checksum = "246a225cc6131e9ee4f24619af0f19d67761fff15d7ccc22e42b80846e69449a" dependencies = [ "num-traits", "rand", @@ -276,7 +328,7 @@ checksum = "b6d7b9decdf35d8908a7e3ef02f64c5e9b1695e230154c0e8de3969142d9b94c" dependencies = [ "futures", "pharos", - "rustc_version 0.4.1", + "rustc_version", ] [[package]] @@ -288,6 +340,12 @@ dependencies = [ "critical-section", ] +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "auto_impl" version = "1.2.1" @@ -358,15 +416,15 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "bech32" -version = "0.8.1" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9ff0bbfd639f15c74af777d81383cf53efb7c93613f6cab67c6c11e05bbf8b" +checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" [[package]] name = "bech32" -version = "0.9.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" +checksum = "d965446196e3b7decd44aa7ee49e31d630118f90ef12f97900f262eb915c951d" [[package]] name = "bellman" @@ -522,6 +580,16 @@ dependencies = [ "subtle", ] +[[package]] +name = "bnum" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29ed1ec45f6ef6e8d1125cc2c2fec8f8fe7d4fa5b262f15885fdccb9e26f0f15" +dependencies = [ + "num-integer", + "num-traits", +] + [[package]] name = "borsh" version = "1.5.5" @@ -651,7 +719,7 @@ checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" dependencies = [ "camino", "cargo-platform", - "semver 1.0.25", + "semver", "serde", "serde_json", "thiserror 1.0.69", @@ -1279,14 +1347,14 @@ dependencies = [ [[package]] name = "duration-str" -version = "0.10.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c1a2e028bbf7921549873b291ddc0cfe08b673d9489da81ac28898cd5a0e6e0" +checksum = "64ad6b66883f70e2f38f1ee99e3797b9d7e7b7fb051ed2e23e027c81753056c8" dependencies = [ "chrono", "rust_decimal", "serde", - "thiserror 1.0.69", + "thiserror 2.0.11", "time", "winnow", ] @@ -1337,6 +1405,18 @@ dependencies = [ "zeroize", ] +[[package]] +name = "educe" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417" +dependencies = [ + "enum-ordinalize", + "proc-macro2", + "quote", + "syn 2.0.96", +] + [[package]] name = "either" version = "1.13.0" @@ -1411,6 +1491,26 @@ dependencies = [ "zeroize", ] +[[package]] +name = "enum-ordinalize" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5" +dependencies = [ + "enum-ordinalize-derive", +] + +[[package]] +name = "enum-ordinalize-derive" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + [[package]] name = "equivalent" version = "1.0.1" @@ -1595,11 +1695,11 @@ dependencies = [ "proc-macro2", "quote", "regex", - "reqwest", + "reqwest 0.11.27", "serde", "serde_json", "syn 2.0.96", - "toml 0.8.19", + "toml", "walkdir", ] @@ -1657,8 +1757,8 @@ checksum = "e79e5973c26d4baf0ce55520bd732314328cabe53193286671b47144145b9649" dependencies = [ "chrono", "ethers-core", - "reqwest", - "semver 1.0.25", + "reqwest 0.11.27", + "semver", "serde", "serde_json", "thiserror 1.0.69", @@ -1682,7 +1782,7 @@ dependencies = [ "futures-locks", "futures-util", "instant", - "reqwest", + "reqwest 0.11.27", "serde", "serde_json", "thiserror 1.0.69", @@ -1714,7 +1814,7 @@ dependencies = [ "jsonwebtoken", "once_cell", "pin-project", - "reqwest", + "reqwest 0.11.27", "serde", "serde_json", "thiserror 1.0.69", @@ -1767,7 +1867,7 @@ dependencies = [ "path-slash", "rayon", "regex", - "semver 1.0.25", + "semver", "serde", "serde_json", "solang-parser", @@ -1798,13 +1898,13 @@ checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "fd-lock" -version = "3.0.13" +version = "4.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef033ed5e9bad94e55838ca0ca906db0e043f517adda0c8b79c7a8c66c93c1b5" +checksum = "0ce92ff622d6dadf7349484f42c93271a0d49b7cc4d466a936405bacbe10aa78" dependencies = [ "cfg-if", - "rustix", - "windows-sys 0.48.0", + "rustix 1.0.3", + "windows-sys 0.59.0", ] [[package]] @@ -1818,6 +1918,12 @@ dependencies = [ "subtle", ] +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + [[package]] name = "fixed-hash" version = "0.8.0" @@ -2108,7 +2214,21 @@ dependencies = [ "cfg-if", "js-sys", "libc", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "r-efi", + "wasi 0.14.2+wasi-0.2.4", "wasm-bindgen", ] @@ -2160,7 +2280,26 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.7.1", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "h2" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5017294ff4bb30944501348f6f8e42e6ad28f42c8bbef7a74029aff064a4e3c2" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http 1.2.0", + "indexmap", "slab", "tokio", "tokio-util", @@ -2182,7 +2321,7 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "ahash", + "ahash 0.7.8", ] [[package]] @@ -2213,7 +2352,7 @@ checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f" dependencies = [ "atomic-polyfill", "hash32", - "rustc_version 0.4.1", + "rustc_version", "serde", "spin 0.9.8", "stable_deref_trait", @@ -2294,6 +2433,29 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http 1.2.0", +] + +[[package]] +name = "http-body-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" +dependencies = [ + "bytes", + "futures-core", + "http 1.2.0", + "http-body 1.0.1", + "pin-project-lite", +] + [[package]] name = "httparse" version = "1.9.5" @@ -2316,9 +2478,9 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", - "h2", + "h2 0.3.26", "http 0.2.12", - "http-body", + "http-body 0.4.6", "httparse", "httpdate", "itoa", @@ -2330,6 +2492,26 @@ dependencies = [ "want", ] +[[package]] +name = "hyper" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "h2 0.4.8", + "http 1.2.0", + "http-body 1.0.1", + "httparse", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + [[package]] name = "hyper-rustls" version = "0.24.2" @@ -2338,10 +2520,27 @@ checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http 0.2.12", - "hyper", - "rustls", + "hyper 0.14.32", + "rustls 0.21.12", + "tokio", + "tokio-rustls 0.24.1", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" +dependencies = [ + "futures-util", + "http 1.2.0", + "hyper 1.6.0", + "hyper-util", + "rustls 0.23.25", + "rustls-pki-types", "tokio", - "tokio-rustls", + "tokio-rustls 0.26.2", + "tower-service", ] [[package]] @@ -2351,10 +2550,45 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ "bytes", - "hyper", + "hyper 0.14.32", + "native-tls", + "tokio", + "tokio-native-tls", +] + +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper 1.6.0", + "hyper-util", "native-tls", "tokio", "tokio-native-tls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http 1.2.0", + "http-body 1.0.1", + "hyper 1.6.0", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", ] [[package]] @@ -3120,13 +3354,13 @@ dependencies = [ [[package]] name = "impl-num-traits" -version = "0.1.2" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "951641f13f873bff03d4bf19ae8bec531935ac0ac2cc775f84d7edfdcfed3f17" +checksum = "803d15461ab0dcc56706adf266158acbc44ccf719bf7d0af30705f58b90a4b8c" dependencies = [ "integer-sqrt", "num-traits", - "uint 0.9.5", + "uint 0.10.0", ] [[package]] @@ -3182,16 +3416,6 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", -] - [[package]] name = "indexmap" version = "2.7.1" @@ -3269,15 +3493,6 @@ dependencies = [ "either", ] -[[package]] -name = "itertools" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.13.0" @@ -3366,12 +3581,12 @@ dependencies = [ [[package]] name = "kdam" -version = "0.5.2" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "526586ea01a9a132b5f8d3a60f6d6b41b411550236f5ee057795f20b37316957" +checksum = "7ed2186610f797a95b55e61c420a81d3b9079ac9776d382f41cf35ce0643a90a" dependencies = [ "terminal_size", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -3467,6 +3682,12 @@ version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" +[[package]] +name = "linux-raw-sys" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe7db12097d22ec582439daf8618b8fdd1a7bef6270e9af3b1ebcd30893cf413" + [[package]] name = "litemap" version = "0.7.4" @@ -3559,7 +3780,7 @@ dependencies = [ "bellman", "blake2b_simd", "directories", - "getrandom", + "getrandom 0.2.15", "group", "itertools 0.14.0", "lazy_static", @@ -3638,8 +3859,8 @@ checksum = "36a8e50e917e18a37d500d27d40b7bc7d127e71c0c94fb2d83f43b4afd308390" dependencies = [ "log", "once_cell", - "rustls", - "rustls-webpki", + "rustls 0.21.12", + "rustls-webpki 0.101.7", "webpki-roots", ] @@ -3650,7 +3871,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ "libc", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys 0.52.0", ] @@ -3780,7 +4001,7 @@ dependencies = [ "lru", "namada_sdk", "prometheus_exporter", - "reqwest", + "reqwest 0.11.27", "serde", "serde_json", "subtle-encoding", @@ -3796,9 +4017,9 @@ dependencies = [ [[package]] name = "namada_account" -version = "0.47.2" +version = "0.47.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36327365adb3633d0f2648632ab6bae7bbec716a629d9586261ea0e65ac878f9" +checksum = "df13eb11542131b4b821da19e1a30e816fa9b43d2997ff35337f464bfe4967c7" dependencies = [ "borsh", "namada_core", @@ -3809,22 +4030,22 @@ dependencies = [ [[package]] name = "namada_controller" -version = "0.47.2" +version = "0.47.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8496f7a6f0bd5f75ea45b31878f6104a94fc2c06e24024c200facde3948a2a8b" +checksum = "e346c20510aee8c66a437cd47b0dcbf2207e0d88d3b08239c62ad8002b5dc422" dependencies = [ "namada_core", "smooth-operator", - "thiserror 1.0.69", + "thiserror 2.0.11", ] [[package]] name = "namada_core" -version = "0.47.2" +version = "0.47.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37e1e7d7a14314f4a6e38a5b06dbdc951f4e52c90798fa9110bdbe656035f7f9" +checksum = "305f82e07d088d0f98bb9100fc31616b10151d95ba77577d4b0c67db2f43c664" dependencies = [ - "bech32 0.8.1", + "bech32 0.11.0", "borsh", "chrono", "data-encoding", @@ -3854,15 +4075,15 @@ dependencies = [ "ripemd", "serde", "serde_json", - "sha2 0.9.9", + "sha2 0.10.8", "smooth-operator", "tendermint", "tendermint-proto", - "thiserror 1.0.69", + "thiserror 2.0.11", "tiny-keccak", "tokio", "tracing", - "uint 0.9.5", + "uint 0.10.0", "usize-set", "wasmtimer", "zeroize", @@ -3870,14 +4091,14 @@ dependencies = [ [[package]] name = "namada_ethereum_bridge" -version = "0.47.2" +version = "0.47.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469ed0e3e893a5f087b789a0e3867999018ab71a2f4bcabed8d986de2b11bccf" +checksum = "eeb49f7a94c8bac46f7d4a78bb432412340996b83355cd333b406acb6a166204" dependencies = [ "borsh", "ethers", "eyre", - "itertools 0.12.1", + "itertools 0.14.0", "konst", "namada_core", "namada_events", @@ -3893,47 +4114,47 @@ dependencies = [ "namada_vp_env", "serde", "smooth-operator", - "thiserror 1.0.69", + "thiserror 2.0.11", "tracing", ] [[package]] name = "namada_events" -version = "0.47.2" +version = "0.47.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f28f84187fbc44791275fa4952be63294694de7db3f2ea81bc746aae9245ab7" +checksum = "cffb996dc93beed802b0ebc9093f7480cf16ad3c73fd9176af7fad705886583b" dependencies = [ "borsh", "namada_core", "namada_macros", "serde", "serde_json", - "thiserror 1.0.69", + "thiserror 2.0.11", "tracing", ] [[package]] name = "namada_gas" -version = "0.47.2" +version = "0.47.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5607513be0283bc05f8e725f5066baadbefeb4ee17f2a24c251d7cb0956e0708" +checksum = "429b267efddcb8b7ade3fbb16ceaa543eafe5bc22b2aeda6fbca21ca0c4368f3" dependencies = [ "borsh", "namada_core", "namada_events", "namada_macros", "serde", - "thiserror 1.0.69", + "thiserror 2.0.11", ] [[package]] name = "namada_governance" -version = "0.47.2" +version = "0.47.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50a233e8f2546d63f3b589f2c245bc6829e9e6efdd2cc665c24c939588e71cc1" +checksum = "9d8fb47a3a9ad5217470c68e9b47d0f0d0c81b906c26999044eca3750e36a30c" dependencies = [ "borsh", - "itertools 0.12.1", + "itertools 0.14.0", "konst", "namada_account", "namada_core", @@ -3946,15 +4167,15 @@ dependencies = [ "serde", "serde_json", "smooth-operator", - "thiserror 1.0.69", + "thiserror 2.0.11", "tracing", ] [[package]] name = "namada_ibc" -version = "0.47.2" +version = "0.47.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f369f565635018e2e8179b827e0561f8eba8e056d317f62d6dc00f1dcf3ba4b" +checksum = "66f077333e403267091ed9db4a0b786273ea8da8a1164bb86f3ba398e2139087" dependencies = [ "borsh", "data-encoding", @@ -3980,44 +4201,44 @@ dependencies = [ "prost", "serde", "serde_json", - "sha2 0.9.9", + "sha2 0.10.8", "smooth-operator", - "thiserror 1.0.69", + "thiserror 2.0.11", "tracing", ] [[package]] name = "namada_io" -version = "0.47.2" +version = "0.47.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e6bca372c83fa8b35edd1dbdece4988cf08d504e1c352459d3d14e3721439c4" +checksum = "83a83bee0d6793e8f5a3ebe83e1a16119fa998bada374b1ce7da3082fb4e372b" dependencies = [ "async-trait", "kdam", "namada_core", "tendermint-rpc", - "thiserror 1.0.69", + "thiserror 2.0.11", "tokio", ] [[package]] name = "namada_macros" -version = "0.47.2" +version = "0.47.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd5c0e9b0b36223a9c26534264aa7927ce20c87b915c77b86cff731b4cbd3a3d" +checksum = "713a7c58a2f3e801d4bfb11ff04bed7c674368800ea4b4edf00d1f1a77e7500a" dependencies = [ "data-encoding", "proc-macro2", "quote", - "sha2 0.9.9", - "syn 1.0.109", + "sha2 0.10.8", + "syn 2.0.96", ] [[package]] name = "namada_merkle_tree" -version = "0.47.2" +version = "0.47.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a001376a4c0ea072732b2cd4d5d3f78695e82380a94325a8776b242a29607536" +checksum = "015d5bd2c06167f7f6bf47017c0221956e05399af2cf7481802e883178152d10" dependencies = [ "borsh", "eyre", @@ -4026,14 +4247,14 @@ dependencies = [ "namada_core", "namada_macros", "prost", - "thiserror 1.0.69", + "thiserror 2.0.11", ] [[package]] name = "namada_parameters" -version = "0.47.2" +version = "0.47.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60bd7fa7200709ae0aa7240538a832747fcf2462ad77cea567f695e2da2b4ee9" +checksum = "3505786793edaa9efb6810b1bed10db9848d58d97481e4306646311d7f53c53a" dependencies = [ "namada_core", "namada_macros", @@ -4042,17 +4263,17 @@ dependencies = [ "namada_tx", "namada_vp_env", "smooth-operator", - "thiserror 1.0.69", + "thiserror 2.0.11", ] [[package]] name = "namada_proof_of_stake" -version = "0.47.2" +version = "0.47.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef905f3a1090618dd0a58ea34bd5616dc6e4bd21257ff6fb1261559a09060ea2" +checksum = "de1a71a1e875d6716c43217870c4b0f48a2f6e9bd64440ba4ec4c0257e8c1ebe" dependencies = [ "borsh", - "itertools 0.12.1", + "itertools 0.14.0", "konst", "namada_account", "namada_controller", @@ -4066,27 +4287,27 @@ dependencies = [ "once_cell", "serde", "smooth-operator", - "thiserror 1.0.69", + "thiserror 2.0.11", "tracing", ] [[package]] name = "namada_replay_protection" -version = "0.47.2" +version = "0.47.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80038ab8e44ada228fa734dd879b370086c9583f93d32e006ce6391f6c058246" +checksum = "d0be426ad51a235dc34d29422ee5568d9c5bbae89ae057614ce076541a0a6687" dependencies = [ "namada_core", ] [[package]] name = "namada_sdk" -version = "0.47.2" +version = "0.47.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74830a07f38ef718ae5c2fe0bc2eb050a707893281029f9e0f6c9bc47bbf608f" +checksum = "09a20424b35946d2b4bc71bebf5da7d29d9e940ee1d4bb63be0ca1bcd2c6bebd" dependencies = [ "async-trait", - "bech32 0.8.1", + "bech32 0.11.0", "bimap", "borsh", "circular-queue", @@ -4099,8 +4320,9 @@ dependencies = [ "eyre", "fd-lock", "futures", + "getrandom 0.3.2", "init-once", - "itertools 0.12.1", + "itertools 0.14.0", "lazy_static", "masp_primitives", "masp_proofs", @@ -4133,18 +4355,18 @@ dependencies = [ "rand_core", "rayon", "regex", - "reqwest", + "reqwest 0.12.15", "rustversion", "serde", "serde_json", - "sha2 0.9.9", + "sha2 0.10.8", "smooth-operator", "tempfile", "tendermint-rpc", - "thiserror 1.0.69", + "thiserror 2.0.11", "tiny-bip39", "tokio", - "toml 0.5.11", + "toml", "tracing", "xorf", "zeroize", @@ -4152,16 +4374,16 @@ dependencies = [ [[package]] name = "namada_shielded_token" -version = "0.47.2" +version = "0.47.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dad515f349f1ae992653c9666f6b7558c09453ef99e92969f266a224b42238b3" +checksum = "365100d5249f320f43bef27af0f10bbcb1a34660e787a4370e01a6a4ff48e80c" dependencies = [ "async-trait", "borsh", "eyre", "flume", "futures", - "itertools 0.12.1", + "itertools 0.14.0", "lazy_static", "masp_primitives", "masp_proofs", @@ -4183,10 +4405,10 @@ dependencies = [ "ripemd", "serde", "serde_json", - "sha2 0.9.9", + "sha2 0.10.8", "smooth-operator", "tempfile", - "thiserror 1.0.69", + "thiserror 2.0.11", "tracing", "typed-builder", "xorf", @@ -4194,13 +4416,13 @@ dependencies = [ [[package]] name = "namada_state" -version = "0.47.2" +version = "0.47.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f868b0d64963623d77b6b1dbdd0624c7e6eb29ca3f20fd586af817d4ccb1d5c" +checksum = "9d33311b2c0e69cffca41ea02d766842d8c76b0ee4709d9979ae18a7f5a57f66" dependencies = [ "borsh", "clru", - "itertools 0.12.1", + "itertools 0.14.0", "namada_core", "namada_events", "namada_gas", @@ -4212,18 +4434,18 @@ dependencies = [ "namada_tx", "patricia_tree", "smooth-operator", - "thiserror 1.0.69", + "thiserror 2.0.11", "tracing", ] [[package]] name = "namada_storage" -version = "0.47.2" +version = "0.47.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fee1f0c36142fa626092aed6a7d0c5307b01273db69acb5c1916786a0140682" +checksum = "fd75a52a7cf559552531f426540e65d5319d1205d6720b0e73c86a8d3b54b745" dependencies = [ "borsh", - "itertools 0.12.1", + "itertools 0.14.0", "namada_core", "namada_gas", "namada_macros", @@ -4232,15 +4454,15 @@ dependencies = [ "regex", "serde", "smooth-operator", - "thiserror 1.0.69", + "thiserror 2.0.11", "tracing", ] [[package]] name = "namada_systems" -version = "0.47.2" +version = "0.47.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a88db174b1c8c35d161d454defdf73b8476d1ab7e6aee4d2d26f96a3776e0cc4" +checksum = "8efe52efb02d8f690a3ff8e66e5ca76c3f20ca08f1c51727f7e5df24af5bfbc5" dependencies = [ "namada_core", "namada_events", @@ -4249,9 +4471,9 @@ dependencies = [ [[package]] name = "namada_token" -version = "0.47.2" +version = "0.47.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47a21856a13cc72aba5d3fb4618d540be9bed82a9f683ca7dd1827df02159729" +checksum = "40936e9c720b2c8dc1a485785dd0eb3c7b303b39f4354a938e118b98b8ed146b" dependencies = [ "borsh", "namada_core", @@ -4268,9 +4490,9 @@ dependencies = [ [[package]] name = "namada_trans_token" -version = "0.47.2" +version = "0.47.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2981eec5a1504a6ac9af1ccb27ea8ea94c623626afd9e925e7119c8e56c7814d" +checksum = "e08c1df33aa4945fe1930e3fbeaf82eef23cc03a7947ed39446c1eae077a3406" dependencies = [ "konst", "namada_core", @@ -4280,15 +4502,15 @@ dependencies = [ "namada_tx", "namada_tx_env", "namada_vp_env", - "thiserror 1.0.69", + "thiserror 2.0.11", "tracing", ] [[package]] name = "namada_tx" -version = "0.47.2" +version = "0.47.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aefda89026758e610f6d70a3ae170b8026b1bb5486fa98cf42795b892c9ad24a" +checksum = "17c34662abcf0ec42b31d24db4947b9b6a1ed358a607deb12caccb11f40845d1" dependencies = [ "ark-bls12-381", "bitflags 2.8.0", @@ -4302,23 +4524,23 @@ dependencies = [ "namada_events", "namada_gas", "namada_macros", - "num-derive 0.4.2", + "num-derive", "num-traits", "prost", "prost-types", "rand_core", "serde", "serde_json", - "sha2 0.9.9", - "thiserror 1.0.69", + "sha2 0.10.8", + "thiserror 2.0.11", "tonic-build", ] [[package]] name = "namada_tx_env" -version = "0.47.2" +version = "0.47.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18caae5ad2bcf23351b8d0ce1bc514275fdaefbdac70020ba85a2104965bc84e" +checksum = "2adc84a3facc292913273aed31308901f4768da7094a9421cb9f0b26c33901ac" dependencies = [ "namada_core", "namada_events", @@ -4327,9 +4549,9 @@ dependencies = [ [[package]] name = "namada_vm" -version = "0.47.2" +version = "0.47.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f61b7368a19e88b5e9f609c9570f2a9e6e136a3a98b7e28a52b3acc293b91070" +checksum = "a1ebf6fb3200ed683021f02055733c6f3e83d8e4c1e3495c04f0809345cddc32" dependencies = [ "borsh", "clru", @@ -4343,16 +4565,16 @@ dependencies = [ "namada_tx", "namada_vp", "smooth-operator", - "thiserror 1.0.69", + "thiserror 2.0.11", "tracing", "wasmparser", ] [[package]] name = "namada_vote_ext" -version = "0.47.2" +version = "0.47.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8c5c26dc325095b5f05c8d757ee1cba15d0ba4b322951f60846dd9051dbb142" +checksum = "a1e9d839db71e00bba201e40a4901a07dd90b2247cb29dc865d71947cc9b1ffe" dependencies = [ "borsh", "namada_core", @@ -4363,9 +4585,9 @@ dependencies = [ [[package]] name = "namada_vp" -version = "0.47.2" +version = "0.47.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b243c5cb002be038b86f0b06d54235d2038dfc377520f65821bd18e2799b577" +checksum = "c44d0dfc36cac54942b616811b8dcaa87a0570a44d40790ecafa4a0879b0fa06" dependencies = [ "namada_core", "namada_events", @@ -4374,15 +4596,15 @@ dependencies = [ "namada_tx", "namada_vp_env", "smooth-operator", - "thiserror 1.0.69", + "thiserror 2.0.11", "tracing", ] [[package]] name = "namada_vp_env" -version = "0.47.2" +version = "0.47.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f848379196686d56976f7312b2b76779977225030f5321be8979dd91b0862058" +checksum = "d91311bee2c290bd8fe85dd958fa9786b4c318bebd3fd7f0e41754a021ccbe68" dependencies = [ "derivative", "masp_primitives", @@ -4396,16 +4618,16 @@ dependencies = [ [[package]] name = "namada_wallet" -version = "0.47.2" +version = "0.47.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "357cee6871d1a25ecd0ab2a580db1fbca820d74d2d3138bac6a9e8fade8985a4" +checksum = "e5850c17a1caae8363f6f27cde53637c6254c917d97a35505f12dfe094456557" dependencies = [ "bimap", "borsh", "data-encoding", "derivation-path", "fd-lock", - "itertools 0.12.1", + "itertools 0.14.0", "masp_primitives", "nam-tiny-hderive", "namada_core", @@ -4417,9 +4639,9 @@ dependencies = [ "serde", "slip10_ed25519", "smooth-operator", - "thiserror 1.0.69", + "thiserror 2.0.11", "tiny-bip39", - "toml 0.5.11", + "toml", "zeroize", ] @@ -4429,7 +4651,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" dependencies = [ - "getrandom", + "getrandom 0.2.15", ] [[package]] @@ -4487,20 +4709,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "num" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" -dependencies = [ - "num-bigint", - "num-complex", - "num-integer", - "num-iter", - "num-rational", - "num-traits", -] - [[package]] name = "num-bigint" version = "0.4.6" @@ -4511,32 +4719,12 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-complex" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" -dependencies = [ - "num-traits", -] - [[package]] name = "num-conv" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" -[[package]] -name = "num-derive" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "num-derive" version = "0.4.2" @@ -4557,17 +4745,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-iter" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - [[package]] name = "num-rational" version = "0.4.2" @@ -4590,16 +4767,14 @@ dependencies = [ [[package]] name = "num256" -version = "0.3.5" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa9b5179e82f0867b23e0b9b822493821f9345561f271364f409c8e4a058367d" +checksum = "85228c87555ed4e5ddf024e9ef1908b27458b97e56b195af0d9cf1d7db890023" dependencies = [ - "lazy_static", - "num", - "num-derive 0.3.3", + "bnum", + "num-integer", "num-traits", "serde", - "serde_derive", ] [[package]] @@ -4740,12 +4915,13 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "orion" -version = "0.16.1" +version = "0.17.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6624905ddd92e460ff0685567539ed1ac985b2dee4c92c7edcd64fce905b00c" +checksum = "bf2e0b749a7c5fb3d43f06f19eff59b253b5480fa146533676cea27c3606530b" dependencies = [ "ct-codecs", - "getrandom", + "fiat-crypto", + "getrandom 0.3.2", "subtle", "zeroize", ] @@ -4758,9 +4934,9 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "owo-colors" -version = "3.5.0" +version = "4.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" +checksum = "1036865bb9422d3300cf723f657c2851d0e9ab12567854b1f4eba3d77decf564" [[package]] name = "pairing" @@ -4943,17 +5119,6 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" -[[package]] -name = "pest" -version = "2.7.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b7cafe60d6cf8e62e1b9b2ea516a089c008945bb5a275416789e7db0bc199dc" -dependencies = [ - "memchr", - "thiserror 2.0.11", - "ucd-trie", -] - [[package]] name = "petgraph" version = "0.6.5" @@ -4961,7 +5126,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.7.1", + "indexmap", ] [[package]] @@ -4971,7 +5136,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e9567389417feee6ce15dd6527a8a1ecac205ef62c2932bcf3d9f6fc5b78b414" dependencies = [ "futures", - "rustc_version 0.4.1", + "rustc_version", ] [[package]] @@ -5303,6 +5468,12 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "r-efi" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" + [[package]] name = "radium" version = "0.7.0" @@ -5336,7 +5507,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom", + "getrandom 0.2.15", ] [[package]] @@ -5383,7 +5554,7 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ - "getrandom", + "getrandom 0.2.15", "libredox", "thiserror 1.0.69", ] @@ -5452,12 +5623,12 @@ dependencies = [ "encoding_rs", "futures-core", "futures-util", - "h2", + "h2 0.3.26", "http 0.2.12", - "http-body", - "hyper", - "hyper-rustls", - "hyper-tls", + "http-body 0.4.6", + "hyper 0.14.32", + "hyper-rustls 0.24.2", + "hyper-tls 0.5.0", "ipnet", "js-sys", "log", @@ -5466,17 +5637,17 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls", + "rustls 0.21.12", "rustls-native-certs", - "rustls-pemfile", + "rustls-pemfile 1.0.4", "serde", "serde_json", "serde_urlencoded", - "sync_wrapper", - "system-configuration", + "sync_wrapper 0.1.2", + "system-configuration 0.5.1", "tokio", "tokio-native-tls", - "tokio-rustls", + "tokio-rustls 0.24.1", "tower-service", "url", "wasm-bindgen", @@ -5486,6 +5657,50 @@ dependencies = [ "winreg", ] +[[package]] +name = "reqwest" +version = "0.12.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d19c46a6fdd48bc4dab94b6103fccc55d34c67cc0ad04653aad4ea2a07cd7bbb" +dependencies = [ + "base64 0.22.1", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2 0.4.8", + "http 1.2.0", + "http-body 1.0.1", + "http-body-util", + "hyper 1.6.0", + "hyper-rustls 0.27.5", + "hyper-tls 0.6.0", + "hyper-util", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls-pemfile 2.2.0", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper 1.0.2", + "system-configuration 0.6.1", + "tokio", + "tokio-native-tls", + "tower", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "windows-registry", +] + [[package]] name = "rfc6979" version = "0.4.0" @@ -5519,7 +5734,7 @@ checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", "cfg-if", - "getrandom", + "getrandom 0.2.15", "libc", "spin 0.9.8", "untrusted 0.9.0", @@ -5622,32 +5837,36 @@ checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" [[package]] name = "rustc_version" -version = "0.3.3" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver 0.11.0", + "semver", ] [[package]] -name = "rustc_version" -version = "0.4.1" +name = "rustix" +version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ - "semver 1.0.25", + "bitflags 2.8.0", + "errno", + "libc", + "linux-raw-sys 0.4.15", + "windows-sys 0.59.0", ] [[package]] name = "rustix" -version = "0.38.44" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +checksum = "e56a18552996ac8d29ecc3b190b4fdbb2d91ca4ec396de7bbffaf43f3d637e96" dependencies = [ "bitflags 2.8.0", "errno", "libc", - "linux-raw-sys", + "linux-raw-sys 0.9.3", "windows-sys 0.59.0", ] @@ -5659,10 +5878,23 @@ checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", "ring 0.17.8", - "rustls-webpki", + "rustls-webpki 0.101.7", "sct", ] +[[package]] +name = "rustls" +version = "0.23.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "822ee9188ac4ec04a2f0531e55d035fb2de73f18b41a63c70c2712503b6fb13c" +dependencies = [ + "once_cell", + "rustls-pki-types", + "rustls-webpki 0.103.1", + "subtle", + "zeroize", +] + [[package]] name = "rustls-native-certs" version = "0.6.3" @@ -5670,7 +5902,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", - "rustls-pemfile", + "rustls-pemfile 1.0.4", "schannel", "security-framework", ] @@ -5684,6 +5916,21 @@ dependencies = [ "base64 0.21.7", ] +[[package]] +name = "rustls-pemfile" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c" + [[package]] name = "rustls-webpki" version = "0.101.7" @@ -5694,6 +5941,17 @@ dependencies = [ "untrusted 0.9.0", ] +[[package]] +name = "rustls-webpki" +version = "0.103.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fef8b8769aaccf73098557a87cd1816b4f9c7c16811c9c77142aa695c16f2c03" +dependencies = [ + "ring 0.17.8", + "rustls-pki-types", + "untrusted 0.9.0", +] + [[package]] name = "rustversion" version = "1.0.19" @@ -5853,15 +6111,6 @@ dependencies = [ "libc", ] -[[package]] -name = "semver" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" -dependencies = [ - "semver-parser", -] - [[package]] name = "semver" version = "1.0.25" @@ -5871,15 +6120,6 @@ dependencies = [ "serde", ] -[[package]] -name = "semver-parser" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9900206b54a3527fdc7b8a938bffd94a568bac4f4aa8113b209df75a09c0dec2" -dependencies = [ - "pest", -] - [[package]] name = "send_wrapper" version = "0.4.0" @@ -6281,8 +6521,8 @@ dependencies = [ "fs2", "hex", "once_cell", - "reqwest", - "semver 1.0.25", + "reqwest 0.11.27", + "semver", "serde", "serde_json", "sha2 0.10.8", @@ -6319,6 +6559,15 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + [[package]] name = "synstructure" version = "0.13.1" @@ -6338,7 +6587,18 @@ checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" dependencies = [ "bitflags 1.3.2", "core-foundation", - "system-configuration-sys", + "system-configuration-sys 0.5.0", +] + +[[package]] +name = "system-configuration" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" +dependencies = [ + "bitflags 2.8.0", + "core-foundation", + "system-configuration-sys 0.6.0", ] [[package]] @@ -6351,6 +6611,16 @@ dependencies = [ "libc", ] +[[package]] +name = "system-configuration-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "tap" version = "1.0.1" @@ -6365,9 +6635,9 @@ checksum = "9a8a559c81686f576e8cd0290cd2a24a2a9ad80c98b3478856500fcbd7acd704" dependencies = [ "cfg-if", "fastrand", - "getrandom", + "getrandom 0.2.15", "once_cell", - "rustix", + "rustix 0.38.44", "windows-sys 0.59.0", ] @@ -6411,7 +6681,7 @@ dependencies = [ "serde", "serde_json", "tendermint", - "toml 0.8.19", + "toml", "url", ] @@ -6457,12 +6727,12 @@ dependencies = [ "bytes", "flex-error", "futures", - "getrandom", + "getrandom 0.2.15", "peg", "pin-project", "rand", - "reqwest", - "semver 1.0.25", + "reqwest 0.11.27", + "semver", "serde", "serde_bytes", "serde_json", @@ -6493,12 +6763,12 @@ dependencies = [ [[package]] name = "terminal_size" -version = "0.3.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" +checksum = "45c6481c4829e4cc63825e62c49186a34538b7b2750b73b266581ffb612fb5ed" dependencies = [ - "rustix", - "windows-sys 0.48.0", + "rustix 1.0.3", + "windows-sys 0.59.0", ] [[package]] @@ -6725,7 +6995,17 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls", + "rustls 0.21.12", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e727b36a1a0e8b74c376ac2211e40c2c8af09fb4013c60d910495810f008e9b" +dependencies = [ + "rustls 0.23.25", "tokio", ] @@ -6737,9 +7017,9 @@ checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" dependencies = [ "futures-util", "log", - "rustls", + "rustls 0.21.12", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", "tungstenite", "webpki-roots", ] @@ -6757,15 +7037,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "toml" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" -dependencies = [ - "serde", -] - [[package]] name = "toml" version = "0.8.19" @@ -6793,7 +7064,7 @@ version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ - "indexmap 2.7.1", + "indexmap", "serde", "serde_spanned", "toml_datetime", @@ -6814,6 +7085,27 @@ dependencies = [ "syn 2.0.96", ] +[[package]] +name = "tower" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper 1.0.2", + "tokio", + "tower-layer", + "tower-service", +] + +[[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.3" @@ -6923,7 +7215,7 @@ dependencies = [ "httparse", "log", "rand", - "rustls", + "rustls 0.21.12", "sha1", "thiserror 1.0.69", "url", @@ -6932,18 +7224,18 @@ dependencies = [ [[package]] name = "typed-builder" -version = "0.19.1" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06fbd5b8de54c5f7c91f6fe4cebb949be2125d7758e630bb58b1d831dbce600" +checksum = "cd9d30e3a08026c78f246b173243cf07b3696d274debd26680773b6773c2afc7" dependencies = [ "typed-builder-macro", ] [[package]] name = "typed-builder-macro" -version = "0.19.1" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9534daa9fd3ed0bd911d462a37f172228077e7abf18c18a5f67199d959205f8" +checksum = "3c36781cc0e46a83726d9879608e4cf6c2505237e263a8eb8c24502989cfdb28" dependencies = [ "proc-macro2", "quote", @@ -6971,12 +7263,6 @@ version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e36a83ea2b3c704935a01b4642946aadd445cea40b10935e3f8bd8052b8193d6" -[[package]] -name = "ucd-trie" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" - [[package]] name = "uint" version = "0.9.5" @@ -7101,7 +7387,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" dependencies = [ - "getrandom", + "getrandom 0.2.15", "serde", ] @@ -7177,6 +7463,15 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasi" +version = "0.14.2+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +dependencies = [ + "wit-bindgen-rt", +] + [[package]] name = "wasm-bindgen" version = "0.2.100" @@ -7250,19 +7545,20 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.107.0" +version = "0.121.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29e3ac9b780c7dda0cac7a52a5d6d2d6707cc6e3451c9db209b6c758f40d7acb" +checksum = "9dbe55c8f9d0dbd25d9447a5a889ff90c0cc3feaa7395310d3d826b2c703eaab" dependencies = [ - "indexmap 1.9.3", - "semver 1.0.25", + "bitflags 2.8.0", + "indexmap", + "semver", ] [[package]] name = "wasmtimer" -version = "0.2.1" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7ed9d8b15c7fb594d72bfb4b5a276f3d2029333cd93a932f376f5937f6f80ee" +checksum = "0048ad49a55b9deb3953841fa1fc5858f0efbcb7a18868c899a360269fac1b23" dependencies = [ "futures", "js-sys", @@ -7328,6 +7624,41 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-link" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" + +[[package]] +name = "windows-registry" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4286ad90ddb45071efd1a66dfa43eb02dd0dfbae1545ad6cc3c51cf34d7e8ba3" +dependencies = [ + "windows-result", + "windows-strings", + "windows-targets 0.53.0", +] + +[[package]] +name = "windows-result" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c64fd11a4fd95df68efcfee5f44a294fe71b8bc6a91993e2791938abcc712252" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87fa48cc5d406560701792be122a10132491cff9d0aeb23583cc2dcafc847319" +dependencies = [ + "windows-link", +] + [[package]] name = "windows-sys" version = "0.48.0" @@ -7379,13 +7710,29 @@ dependencies = [ "windows_aarch64_gnullvm 0.52.6", "windows_aarch64_msvc 0.52.6", "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", + "windows_i686_gnullvm 0.52.6", "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]] +name = "windows-targets" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1e4c7e8ceaaf9cb7d7507c974735728ab453b67ef8f18febdd7c11fe59dca8b" +dependencies = [ + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -7398,6 +7745,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -7410,6 +7763,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -7422,12 +7781,24 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + [[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_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -7440,6 +7811,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -7452,6 +7829,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -7464,6 +7847,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -7476,6 +7865,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + [[package]] name = "winnow" version = "0.6.24" @@ -7495,6 +7890,15 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "wit-bindgen-rt" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" +dependencies = [ + "bitflags 2.8.0", +] + [[package]] name = "write16" version = "1.0.0" @@ -7518,7 +7922,7 @@ dependencies = [ "js-sys", "log", "pharos", - "rustc_version 0.4.1", + "rustc_version", "send_wrapper 0.6.0", "thiserror 1.0.69", "wasm-bindgen", diff --git a/Cargo.toml b/Cargo.toml index 0149c03..8971fef 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,6 +12,7 @@ clap-verbosity-flag = "2.1.1" namada_sdk = { version = "0.47.1", default-features = false, features = ["std", "async-send", "download-params"] } tendermint-config = "0.40.1" tendermint-rpc = { version = "0.40.1", features = ["http-client"] } + tokio = {version = "1.8.2", default-features = false} async-trait = "0.1.74" reqwest = { version = "0.11.22", features = ["json"] } @@ -30,4 +31,5 @@ thiserror = "1.0.56" tokio-retry2 = { version = "0.5", features = ["jitter", "tracing"] } [build-dependencies] -vergen = { version = "8.0.0", features = ["build", "git", "gitcl"] } \ No newline at end of file +vergen = { version = "8.0.0", features = ["build", "git", "gitcl"] } + diff --git a/composer/.env b/composer/.env index c6ef410..e6d0315 100644 --- a/composer/.env +++ b/composer/.env @@ -1,4 +1,6 @@ #CHAIN_ID=housefire-alpaca.cc0d3e0c033be #RPC=https://proxy.public.heliax.work/housefire-alpaca.cc0d3e0c033be -CHAIN_ID=campfire-square.ff09671d333707 -RPC=https://proxy.public.heliax.work/campfire-square.ff09671d333707 +#CHAIN_ID=campfire-square.ff09671d333707 +#RPC=https://proxy.public.heliax.work/campfire-square.ff09671d333707 +CHAIN_ID=e2e-test.8a8f0fa0d30fe8ebe1bc3 +RPC=http://host.docker.internal:27735 \ No newline at end of file diff --git a/composer/provisioning/prometheus/namada-alerts.yml b/composer/provisioning/prometheus/namada-alerts.yml index 7604783..2d60c6e 100644 --- a/composer/provisioning/prometheus/namada-alerts.yml +++ b/composer/provisioning/prometheus/namada-alerts.yml @@ -2,7 +2,7 @@ groups: - name: namada-validator-alerts rules: - alert: NamadaBlockHeightStalled - expr: increase(namada_block_height{ chain_id="$$CHAIN_ID$$" }[1m]) == 0 + expr: rate(namada_block_height{ chain_id="$$CHAIN_ID$$" }[1m]) == 0 labels: severity: critical annotations: @@ -81,7 +81,7 @@ groups: - alert: NamadaTransactionBatchSpike expr: | - rate(namada_transaction_batch_size_count{ chain_id="$$CHAIN_ID$$" }[10m]) > (2 * quantile(0.50, rate(namada_transaction_batch_size_count[7d]))) + rate(namada_transaction_batch_size_count{ chain_id="$$CHAIN_ID$$" }[10m]) > (2 * quantile(0.50, rate(namada_transaction_batch_size_count{ chain_id="$$CHAIN_ID$$" }[7d]))) labels: severity: warning annotations: @@ -106,9 +106,9 @@ groups: - alert: AbnormalInnerTransactionFailureRate expr: | - (rate(namada_transaction_kind{chain_id="$$CHAIN_ID$$", failed="true"}[10m]) / rate(namada_transaction_kind{ chain_id="$$CHAIN_ID$$" }[10m])) + (rate(namada_transaction_kind{chain_id="$$CHAIN_ID$$", failed="true"}[10m]) / rate(namada_transaction_kind{chain_id="$$CHAIN_ID$$"}[10m])) > - (2 * quantile(0.50, rate(namada_transaction_kind{chain_id="$$CHAIN_ID$$", failed="true"}[7d:]) / rate(namada_transaction_kind{chain_id="$$CHAIN_ID$$"}[7d:]))) + (2 * quantile(0.50, rate(namada_transaction_kind{chain_id="$$CHAIN_ID$$", failed="true"}[7d:]) / rate(namada_transaction_kind{chain_id="$$CHAIN_ID$$"}[7d:])) by (chain_id)) labels: severity: critical annotations: @@ -120,14 +120,14 @@ groups: - alert: WhaleTransactionDetected expr: | - increase(namada_transfer_amount{chain_id="$$CHAIN_ID$$"}[1m]) > - avg_over_time(increase(namada_transfer_amount{chain_id="$$CHAIN_ID$$"}[1w])[1w:1m]) + rate(namada_transfer_amount{chain_id="$$CHAIN_ID$$"}[1m]) > + avg_over_time(rate(namada_transfer_amount{chain_id="$$CHAIN_ID$$"}[1w])[1w:1m]) labels: severity: warning annotations: summary: "Potential Whale Detected in {{ $labels.token }}" description: | - Token {{ $labels.token }} experienced a large transfer in last minute ({{ with query "increase(namada_transfer_amount{chain_id=\"$$CHAIN_ID$$\"}[1m])" }}{{ printf "%.0f" (. | first | value) }}{{ end }}) + Token {{ $labels.token }} experienced a large transfer in last minute ({{ with query "rate(namada_transfer_amount{chain_id=\"$$CHAIN_ID$$\"}[1m])" }}{{ printf "%.0f" (. | first | value) }}{{ end }}) The amount is unusually high compared to the typical increases over the past week. Transfer Amount: {{ $value }} {{ $labels.token }} Block height: {{ with query "namada_block_height{chain_id=\"$$CHAIN_ID$$\"} " }}{{ printf "%.0f" (. | first | value) }}{{ end }} diff --git a/src/main.rs b/src/main.rs index a0b9ec6..b54e200 100644 --- a/src/main.rs +++ b/src/main.rs @@ -68,7 +68,7 @@ async fn get_state_from_rpc(rpc: &Rpc, height: u64) -> anyhow::Result { .await .into_retry_error()?; let validators = rpc.query_validators(epoch).await.into_retry_error()?; - // let (id, peers) = rpc.query_peers().await.into_retry_error()?; + let slashes_count = rpc.query_count_slashes_before(height).await.into_retry_error()? as u64; Ok(State::new( block, native_token, @@ -77,7 +77,7 @@ async fn get_state_from_rpc(rpc: &Rpc, height: u64) -> anyhow::Result { validators, future_bonds, future_unbonds, - // peers, + slashes_count, )) } diff --git a/src/rpc.rs b/src/rpc.rs index f42d263..08fbc87 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -3,14 +3,16 @@ use futures::FutureExt; use namada_sdk::{ address::Address as NamadaAddress, hash::Hash, - io::Client, proof_of_stake::types::ValidatorState, rpc, state::{BlockHeight, Epoch as NamadaEpoch, Key}, tendermint::node::Id, + tendermint_rpc::Client, +// tendermint_rpc::{endpoint::net_info::PeerInfo, Url}, }; use std::{future::Future, str::FromStr}; -use tendermint_rpc::{endpoint::net_info::PeerInfo, HttpClient, Url}; +use tendermint_rpc::{endpoint::net_info::PeerInfo, HttpClient, Url, HttpClientUrl}; +use tendermint_rpc::client::CompatMode; use crate::shared::{ checksums::Checksums, @@ -28,12 +30,23 @@ impl Rpc { .iter() .map(|url| { let url = Url::from_str(url).unwrap(); - HttpClient::new(url).unwrap() + HttpClient::builder(HttpClientUrl::try_from(url).unwrap()) + .compat_mode(CompatMode::V0_37) + .build() + .unwrap() }) .collect(), } } + pub async fn get_abci_info(&self) -> anyhow::Result<()> { + for client in &self.clients { + let abci_info = client.abci_info().await?; + println!("abci_info: {:?}", abci_info); + } + Ok(()) + } + pub async fn get_chain_id(&self) -> anyhow::Result { let mut chain_id = None; for client in &self.clients { @@ -107,6 +120,7 @@ impl Rpc { .context("Should be able to get epoch") } + pub async fn query_lastest_height(&self) -> anyhow::Result { let futures = self .clients @@ -120,36 +134,77 @@ impl Rpc { .context("Should be able to query for block") } + pub async fn query_count_slashes_before(&self, height: Height) -> anyhow::Result { + // To count the slashes at height we need to get the slashes for the validators + // at the tip and filter the slashes that happened after the target height :chefkiss: + let pos_query = namada_sdk::queries::RPC.vp().pos(); + let futures = self + .clients + .iter() + .map(|client| { + Box::pin(pos_query.slashes(client)) + }) + .collect(); + + let res = self.concurrent_requests(futures).await; + + res.map(|response| { + response + .into_iter() + .filter(|(_, slashes)| slashes.iter().any(|slash| slash.block_height < height)) + .count() + }) + .context("Should be able to query for block") + } + pub async fn query_block( &self, block_height: Height, checksums: &Checksums, epoch: Epoch, ) -> anyhow::Result { - let block_futures = self - .clients - .iter() - .map(|client| client.block(block_height)) - .collect(); + let block_height = namada_sdk::tendermint::block::Height::try_from(block_height).unwrap(); + let events_futures = self .clients .iter() .map(|client| client.block_results(block_height)) .collect(); - let res = self.concurrent_requests(block_futures).await; - let events_res = self.concurrent_requests(events_futures).await; + let events_res = self.concurrent_requests(events_futures).await; let events = events_res.map(BlockResult::from).context(format!( "Should be able to query for block events for height: {}", block_height ))?; - res.map(|response| Block::from(response, events, checksums, epoch)) - .context(format!( - "Should be able to query for block for height: {}", - block_height - )) + let block_height = namada_sdk::tendermint::block::Height::try_from(block_height).unwrap(); + let events_futures = self + .clients + .iter() + .map(|client| client.block_results(block_height)) + .collect(); + + + let events_res = self.concurrent_requests(events_futures).await; + let events = events_res.map(BlockResult::from).context(format!( + "Should be able to query for block events for height: {}", + block_height + ))?; + + let block_height = namada_sdk::tendermint::block::Height::try_from(block_height).unwrap(); + + let block_futures = self + .clients + .iter() + .map(|client| + client.block(block_height)) + .collect(); + + let block_res = self.concurrent_requests(block_futures).await; + block_res.map(|response| + Block::from(response, events, checksums, epoch)) + .context(format!("Should be able to query for block for height: {}",block_height)) } pub async fn query_validator_state( @@ -333,7 +388,7 @@ impl Rpc { }) } - async fn concurrent_requests( + async fn concurrent_requests( &self, futures: Vec> + Unpin>, ) -> Option { @@ -342,17 +397,21 @@ impl Rpc { .map(|(_idx, value)| value) } - async fn concurrent_requests_idx( + async fn concurrent_requests_idx( &self, - mut futures: Vec> + Unpin>, + futures: Vec> + Unpin>, ) -> Option<(usize, T)> { + let mut futures: Vec<_> = futures; while !futures.is_empty() { let (result, index, remaining) = futures::future::select_all(futures).await; match result { Ok(value) => return Some((index, value)), - Err(_) => futures = remaining, + Err(_err) => futures = remaining, } } None } + + + } diff --git a/src/state.rs b/src/state.rs index 41cd3fe..8b9bdae 100644 --- a/src/state.rs +++ b/src/state.rs @@ -1,6 +1,6 @@ use anyhow::anyhow; -use crate::shared::namada::{Address, Block, Height, Transfer, Validator}; +use crate::{shared::namada::{Address, Block, Height, Transfer, Validator}}; #[derive(Debug, Clone)] pub struct State { @@ -11,6 +11,7 @@ pub struct State { validators: Vec, future_bonds: u64, future_unbonds: u64, + slashes_count: u64, } impl State { @@ -23,6 +24,7 @@ impl State { validators: Vec, future_bonds: u64, future_unbonds: u64, + slashes_count: u64, ) -> Self { Self { block, @@ -32,6 +34,7 @@ impl State { validators, future_bonds, future_unbonds, + slashes_count, } } @@ -122,8 +125,9 @@ impl State { .unwrap_or_default() } - pub fn get_slashes(&self) -> u64 { - self.block.block.evidence.iter().len() as u64 + pub fn get_slashes(&self) -> u64 { + self.block.block.evidence.iter().len() as u64 + //self.slashes_count } pub fn get_epoch(&self) -> u64 { From 6834ad7a0de562046d70d2a3c71c4625a34b1cc4 Mon Sep 17 00:00:00 2001 From: Felipe Manzano Date: Mon, 31 Mar 2025 09:35:10 -0300 Subject: [PATCH 15/28] Cleanup --- src/main.rs | 4 +-- src/metrics/block_height.rs | 6 ++-- src/metrics/fees.rs | 9 +++++- src/rpc.rs | 55 ++++++++++++------------------------- src/state.rs | 10 ++----- 5 files changed, 33 insertions(+), 51 deletions(-) diff --git a/src/main.rs b/src/main.rs index b54e200..b17e927 100644 --- a/src/main.rs +++ b/src/main.rs @@ -68,7 +68,6 @@ async fn get_state_from_rpc(rpc: &Rpc, height: u64) -> anyhow::Result { .await .into_retry_error()?; let validators = rpc.query_validators(epoch).await.into_retry_error()?; - let slashes_count = rpc.query_count_slashes_before(height).await.into_retry_error()? as u64; Ok(State::new( block, native_token, @@ -76,8 +75,7 @@ async fn get_state_from_rpc(rpc: &Rpc, height: u64) -> anyhow::Result { total_supply_native, validators, future_bonds, - future_unbonds, - slashes_count, + future_unbonds )) } diff --git a/src/metrics/block_height.rs b/src/metrics/block_height.rs index 35d55e7..881249b 100644 --- a/src/metrics/block_height.rs +++ b/src/metrics/block_height.rs @@ -1,5 +1,5 @@ /// ## Block Height (block_height) -/// This metric tracks the latest block height of the Namada blockchain. It provides a real-time view of +/// This metric tracks the latest block height of a Namada blockchain. It provides a real-time view of /// block progression, and helps monitor chain liveness and ensure continuous block production. /// It is updated at each block by fetching the latest block height from the blockchain state. /// @@ -11,9 +11,9 @@ /// ``` /// /// ## Alert: Block Height Stalled: -/// If no blocks are registered in 10 minutes, the block height has stalled. Alert the team to investigate the issue. +/// If no blocks are registered in 5 minutes, the block height has stalled. Alert the team to investigate the issue. /// ``` -/// increase(namada_block_height[10m]) == 0 +/// (time() - min_over_time(time()[5m])) > 300 and (absent_over_time(namada_block_height[5m]) or increase(namada_block_height[5m]) == 0) /// ``` use crate::state::State; use anyhow::Result; diff --git a/src/metrics/fees.rs b/src/metrics/fees.rs index d5776d1..a880fd3 100644 --- a/src/metrics/fees.rs +++ b/src/metrics/fees.rs @@ -45,10 +45,17 @@ impl MetricTrait for Fees { (Ok(amount_per_gas), Ok(gas_limit)) => amount_per_gas * gas_limit, _ => continue, }; - + self.fees .with_label_values(&[&tx.fee.gas_token]) .inc_by(fee); + + tracing::debug!( + "Transaction fee: {} {}", + fee, + tx.fee.gas_token + ); + } } } diff --git a/src/rpc.rs b/src/rpc.rs index 08fbc87..c3856de 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -8,11 +8,10 @@ use namada_sdk::{ state::{BlockHeight, Epoch as NamadaEpoch, Key}, tendermint::node::Id, tendermint_rpc::Client, -// tendermint_rpc::{endpoint::net_info::PeerInfo, Url}, }; use std::{future::Future, str::FromStr}; -use tendermint_rpc::{endpoint::net_info::PeerInfo, HttpClient, Url, HttpClientUrl}; use tendermint_rpc::client::CompatMode; +use tendermint_rpc::{endpoint::net_info::PeerInfo, HttpClient, HttpClientUrl, Url}; use crate::shared::{ checksums::Checksums, @@ -120,7 +119,6 @@ impl Rpc { .context("Should be able to get epoch") } - pub async fn query_lastest_height(&self) -> anyhow::Result { let futures = self .clients @@ -141,18 +139,16 @@ impl Rpc { let futures = self .clients .iter() - .map(|client| { - Box::pin(pos_query.slashes(client)) - }) + .map(|client| Box::pin(pos_query.slashes(client))) .collect(); let res = self.concurrent_requests(futures).await; res.map(|response| { response - .into_iter() - .filter(|(_, slashes)| slashes.iter().any(|slash| slash.block_height < height)) - .count() + .into_iter() + .filter(|(_, slashes)| slashes.iter().any(|slash| slash.block_height < height)) + .count() }) .context("Should be able to query for block") } @@ -172,39 +168,27 @@ impl Rpc { .collect(); + let block_height = namada_sdk::tendermint::block::Height::try_from(block_height).unwrap(); + let events_res = self.concurrent_requests(events_futures).await; let events = events_res.map(BlockResult::from).context(format!( "Should be able to query for block events for height: {}", block_height ))?; - let block_height = namada_sdk::tendermint::block::Height::try_from(block_height).unwrap(); - let events_futures = self - .clients - .iter() - .map(|client| client.block_results(block_height)) - .collect(); - - - let events_res = self.concurrent_requests(events_futures).await; - let events = events_res.map(BlockResult::from).context(format!( - "Should be able to query for block events for height: {}", - block_height - ))?; - - let block_height = namada_sdk::tendermint::block::Height::try_from(block_height).unwrap(); - let block_futures = self .clients .iter() - .map(|client| - client.block(block_height)) + .map(|client| client.block(block_height)) .collect(); let block_res = self.concurrent_requests(block_futures).await; - block_res.map(|response| - Block::from(response, events, checksums, epoch)) - .context(format!("Should be able to query for block for height: {}",block_height)) + block_res + .map(|response| Block::from(response, events, checksums, epoch)) + .context(format!( + "Should be able to query for block for height: {}", + block_height + )) } pub async fn query_validator_state( @@ -388,7 +372,7 @@ impl Rpc { }) } - async fn concurrent_requests( + async fn concurrent_requests( &self, futures: Vec> + Unpin>, ) -> Option { @@ -397,21 +381,18 @@ impl Rpc { .map(|(_idx, value)| value) } - async fn concurrent_requests_idx( + async fn concurrent_requests_idx( &self, futures: Vec> + Unpin>, ) -> Option<(usize, T)> { - let mut futures: Vec<_> = futures; + let mut futures = futures; while !futures.is_empty() { let (result, index, remaining) = futures::future::select_all(futures).await; match result { Ok(value) => return Some((index, value)), - Err(_err) => futures = remaining, + Err(_) => futures = remaining, } } None } - - - } diff --git a/src/state.rs b/src/state.rs index 8b9bdae..41cd3fe 100644 --- a/src/state.rs +++ b/src/state.rs @@ -1,6 +1,6 @@ use anyhow::anyhow; -use crate::{shared::namada::{Address, Block, Height, Transfer, Validator}}; +use crate::shared::namada::{Address, Block, Height, Transfer, Validator}; #[derive(Debug, Clone)] pub struct State { @@ -11,7 +11,6 @@ pub struct State { validators: Vec, future_bonds: u64, future_unbonds: u64, - slashes_count: u64, } impl State { @@ -24,7 +23,6 @@ impl State { validators: Vec, future_bonds: u64, future_unbonds: u64, - slashes_count: u64, ) -> Self { Self { block, @@ -34,7 +32,6 @@ impl State { validators, future_bonds, future_unbonds, - slashes_count, } } @@ -125,9 +122,8 @@ impl State { .unwrap_or_default() } - pub fn get_slashes(&self) -> u64 { - self.block.block.evidence.iter().len() as u64 - //self.slashes_count + pub fn get_slashes(&self) -> u64 { + self.block.block.evidence.iter().len() as u64 } pub fn get_epoch(&self) -> u64 { From 9680b4308bbf5154ca9824c4051776a124f2898a Mon Sep 17 00:00:00 2001 From: Felipe Manzano Date: Tue, 1 Apr 2025 13:41:40 -0300 Subject: [PATCH 16/28] Low level alerts including trivial fee checks --- Dockerfile | 2 +- src/config.rs | 2 +- src/main.rs | 24 +++++-- src/metrics/alert.rs | 146 +++++++++++++++++++++++++++++++++++++++++++ src/metrics/fees.rs | 3 +- src/metrics/mod.rs | 2 + src/rpc.rs | 9 ++- 7 files changed, 176 insertions(+), 12 deletions(-) create mode 100644 src/metrics/alert.rs diff --git a/Dockerfile b/Dockerfile index 0f727ca..e45b690 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ RUN cargo chef prepare --recipe-path recipe.json FROM lukemathwalker/cargo-chef:latest-rust-1.82.0 AS cacher WORKDIR /app COPY --from=planner /app/recipe.json recipe.json -RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --assume-yes \ +RUN apt-get clean && apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --assume-yes \ libprotobuf-dev \ build-essential \ clang-tools-16 \ diff --git a/src/config.rs b/src/config.rs index eed9658..fb82d2a 100644 --- a/src/config.rs +++ b/src/config.rs @@ -23,7 +23,7 @@ pub struct AppConfig { #[clap(long, env, default_value_t = u64::MAX)] pub last_block_height: u64, - #[clap(long, env, default_value_t = 1000)] + #[clap(long, env, default_value_t = 500)] pub sleep_for: u64, #[clap(flatten)] diff --git a/src/main.rs b/src/main.rs index b17e927..866d2af 100644 --- a/src/main.rs +++ b/src/main.rs @@ -35,19 +35,19 @@ async fn get_checksums_at_height(rpc: &Rpc, height: u64) -> anyhow::Result anyhow::Result { - let checksums = get_checksums_at_height(rpc, height).await?; +async fn get_state_from_rpc(rpc: &Rpc, height: u64, checksums: Checksums) -> anyhow::Result { let native_token = rpc.query_native_token().await.into_retry_error()?; - let epoch = rpc .query_current_epoch(height) .await .into_retry_error()? .unwrap_or(0); + let block = rpc .query_block(height, &checksums, epoch) .await .into_retry_error()?; + if block.height != height { return Err(anyhow::anyhow!( "Block height mismatch: expected {}, got {}", @@ -55,6 +55,7 @@ async fn get_state_from_rpc(rpc: &Rpc, height: u64) -> anyhow::Result { block.height )); } + let max_block_time_estimate = rpc .query_max_block_time_estimate() .await @@ -68,6 +69,7 @@ async fn get_state_from_rpc(rpc: &Rpc, height: u64) -> anyhow::Result { .await .into_retry_error()?; let validators = rpc.query_validators(epoch).await.into_retry_error()?; + Ok(State::new( block, native_token, @@ -106,11 +108,14 @@ async fn main() -> anyhow::Result<()> { let last_block_height = config.last_block_height; let metrics = MetricsExporter::default_metrics(&config); - let state = get_state_from_rpc(&rpc, initial_block_height).await?; + let checksums = get_checksums_at_height(&rpc, initial_block_height).await?; + let state = get_state_from_rpc(&rpc, initial_block_height, checksums.clone()).await?; metrics.reset(&state); metrics.start_exporter()?; let current_state = Arc::new(RwLock::new(state)); + let current_checksums = Arc::new(RwLock::new(checksums)); + loop { Retry::spawn_notify( retry_strategy.clone(), @@ -120,13 +125,20 @@ async fn main() -> anyhow::Result<()> { // immediate next block let block_height = pre_state.next_block_height(); - let post_state = get_state_from_rpc(&rpc, block_height) + let checksums= current_checksums.read().await.clone(); + let post_state = get_state_from_rpc(&rpc, block_height, checksums) .await .into_retry_error()?; + if post_state.get_epoch() != pre_state.get_epoch() { + // update checksums + *current_checksums.write().await = get_checksums_at_height(&rpc, initial_block_height).await.into_retry_error()?; + } if block_height <= last_block_height { // update metrics metrics.update(&pre_state, &post_state); + }else { + tracing::info!("Last block height reached: {}", block_height); } // post_state is the new current state @@ -142,7 +154,7 @@ async fn main() -> anyhow::Result<()> { } fn retry_strategy(max_delay_milis: u64) -> ExponentialBackoff { - ExponentialBackoff::from_millis(1000) + ExponentialBackoff::from_millis(100) .factor(1) .max_delay_millis(max_delay_milis) } diff --git a/src/metrics/alert.rs b/src/metrics/alert.rs new file mode 100644 index 0000000..877721b --- /dev/null +++ b/src/metrics/alert.rs @@ -0,0 +1,146 @@ +/// Low level alert metric hack +use std::collections::HashMap; +use crate::config::AppConfig; +use crate::state::State; +use anyhow::Result; +use prometheus_exporter::prometheus::core::{AtomicU64, GenericCounterVec}; +use prometheus_exporter::prometheus::{Opts, Registry}; +use super::MetricTrait; + + +type Token = String; +struct FeeThreshold { + name: String, + value: f64, +} + +pub struct Alert { + explorer: String, + thresholds: HashMap, + alert_counter: GenericCounterVec, +} + +impl MetricTrait for Alert { + fn register(&self, registry: &Registry) -> Result<()> { + registry.register(Box::new(self.alert_counter.clone()))?; + Ok(()) + } + + fn reset(&self, _state: &State) { + } + + fn update(&self, _pre_state: &State, post_state: &State) { + if self.thresholds.is_empty() { + return; + } + + let block = post_state.get_last_block(); + for tx in &block.transactions { + let amount_per_gas = tx.fee.amount_per_gas_unit.parse::(); + let gas_limit = tx.fee.gas.parse::(); + + let fee = match (amount_per_gas, gas_limit) { + (Ok(amount_per_gas), Ok(gas_limit)) => amount_per_gas * gas_limit, + _ => continue, + }; + // Using the thresholds in self check if any tx paid more than the threshold considering the token matches + let fee_threshold = self.thresholds.get(&tx.fee.gas_token); + if fee_threshold.is_none() { + continue; + } + let fee_threshold = fee_threshold.unwrap(); + if fee < fee_threshold.value { + continue; + } + let gas_token_name = fee_threshold.name.clone(); + let summary = format!("A tx({}) at height {} paid {} {} which is more than the alert configured threshold {}. Link: {}{}", + tx.id, + block.height, + fee, + gas_token_name, + fee_threshold.value, + self.explorer, + tx.id + ); + self.alert_counter.with_label_values(&[&summary]).inc(); + + tracing::debug!( + "Low Level Alert {}", summary + ); + + } + + } +} + +impl Default for Alert { + fn default() -> Self { + + let alert_counter_ops = Opts::new( + "fee_alert", + "Low level trivial alerts", + ); + let alert_counter = GenericCounterVec::::new( + alert_counter_ops, + &["summary"], + ).expect("Failed to create GenericCounterVec"); + Self { + alert_counter, + thresholds: HashMap::new(), + explorer: "https://explorer75.org/namada/tx/".to_string(), + } + } +} + + +impl Alert { + pub fn new(config: &AppConfig) -> Self { + let mut instance = Self::default(); + instance.populate_thresholds(&config.chain_id.clone().unwrap()); + instance + } + fn populate_thresholds(&mut self, chain_id: &str) { + if chain_id == "campfire-square.ff09671d333707" { + self.thresholds.insert("tnam1qy4pd2j2wkp34c49epd5wy9ny83qsedekgac6gyr".to_string(), FeeThreshold { name: "apfel".to_string(), value: 0.1 }); + self.thresholds.insert("tnam1qy4u69pe54hyssg9g42equq0z2vrj9rlnsrfcu6l".to_string(), FeeThreshold { name: "btc".to_string(), value: 0.1 }); + self.thresholds.insert("tnam1qyzv6anc548dyj0nqvezrxxd6679d0a02y78k3xx".to_string(), FeeThreshold { name: "dot".to_string(), value: 0.1 }); + self.thresholds.insert("tnam1q9046ls453j29xp0g90vm05dpped9adweyjnplkl".to_string(), FeeThreshold { name: "eth".to_string(), value: 0.1 }); + self.thresholds.insert("tnam1q982u50dxneydrlne6nfhrcwxc5mlxtpssjjdp3q".to_string(), FeeThreshold { name: "kartoffel".to_string(), value: 0.1 }); + self.thresholds.insert("tnam1qy440ynh9fwrx8aewjvvmu38zxqgukgc259fzp6h".to_string(), FeeThreshold { name: "nam".to_string(), value: 0.1 }); + self.thresholds.insert("tnam1qxkdfqv2shgyllcf7dq5qlvf8gt6a2kr0s33ye26".to_string(), FeeThreshold { name: "schnitzel".to_string(), value: 0.1 }); + self.thresholds.insert("tnam1phks0geerggjk96ezhxclt6r5tdgu3usa5zteyyc".to_string(), FeeThreshold { name: "transfer/channel-0/uosmo".to_string(), value: 0.05 }); + //https://github.com/Luminara-Hub/namada-ecosystem/blob/main/user-and-dev-tools/testnet/housefire/explorers.json + self.explorer = "https://explorer75.org/namada-campfire/tx/".to_string(); + } + + if chain_id == "housefire-alpaca.cc0d3e0c033be" { + self.thresholds.insert("tnam1q9gr66cvu4hrzm0sd5kmlnjje82gs3xlfg3v6nu7".to_string(), FeeThreshold { name: "nam".to_string(), value: 0.0 }); + self.thresholds.insert("tnam1phks0geerggjk96ezhxclt6r5tdgu3usa5zteyyc".to_string(), FeeThreshold { name: "transfer/channel-0/uosmo".to_string(), value: 0.0 }); + self.thresholds.insert("tnam1phzvlar06m0rtjjv7n8qx8ny8j8aexayhyq98r7s".to_string(), FeeThreshold { name: "transfer/channel-1/uatom".to_string(), value: 0.0 }); + self.thresholds.insert("tnam1phdf4sns3dx653kjfeejgymnehxg2z7xgs4z956n".to_string(), FeeThreshold { name: "transfer/channel-10/utia".to_string(), value: 0.02 }); + self.thresholds.insert("tnam1pk22zc02efq85wvgnu6q3zfe07sz828p35xntldz".to_string(), FeeThreshold { name: "transfer/channel-4/stuatom".to_string(), value: 0.0 }); + self.thresholds.insert("tnam1p4ak7rgnqatppd0hjnfsvu7dray8twf0sv2rvq3f".to_string(), FeeThreshold { name: "transfer/channel-4/stuosmo".to_string(), value: 0.0 }); + self.thresholds.insert("tnam1ph4d4cdwu3tvj8rj6n75lrp3q0pg0yym7gpf75az".to_string(), FeeThreshold { name: "transfer/channel-4/stutia".to_string(), value: 0.0 }); + self.thresholds.insert("tnam1p4r2835fw404zme26y88uxex8lnp5rdv4s9yjtu7".to_string(), FeeThreshold { name: "transfer/channel-5/utia".to_string(), value: 0.0 }); + self.thresholds.insert("tnam1phavrw42dmxuhzzq3fhwagf663ekmf58lqedrqcv".to_string(), FeeThreshold { name: "transfer/channel-7/uosmo".to_string(), value: 0.02 }); + self.thresholds.insert("tnam1pkmcvjcruxul6ncyjfp7j24ady2cda5zzvudakty".to_string(), FeeThreshold { name: "transfer/channel-8/stuatom".to_string(), value: 0.02 }); + self.thresholds.insert("tnam1p46jfxscmma7le2lswcuwr9dydxlze83wsjdkygq".to_string(), FeeThreshold { name: "transfer/channel-8/stuosmo".to_string(), value: 0.02 }); + self.thresholds.insert("tnam1p4jknczaacetxwwe9p49903nml80e9ex0ufqh3kr".to_string(), FeeThreshold { name: "transfer/channel-8/stutia".to_string(), value: 0.02 }); + self.thresholds.insert("tnam1p4zuqqd94csj6zv8n0jxylz9kex4vdsgvg3uglw9".to_string(), FeeThreshold { name: "transfer/channel-9/uatom".to_string(), value: 0.02 }); + self.explorer = "https://namada-explorer.sproutstake.space/test/transactions/".to_string(); + } + + if chain_id == "namada.5f5de2dd1b88cba30586420" { + self.thresholds.insert("tnam1q9gr66cvu4hrzm0sd5kmlnjje82gs3xlfg3v6nu7".to_string(), FeeThreshold { name: "nam".to_string(), value: 0.0 }); + self.thresholds.insert("tnam1p5z5538v3kdk3wdx7r2hpqm4uq9926dz3ughcp7n".to_string(), FeeThreshold { name: "transfer/channel-0/stuatom".to_string(), value: 0.0 }); + self.thresholds.insert("tnam1p4px8sw3am4qvetj7eu77gftm4fz4hcw2ulpldc7".to_string(), FeeThreshold { name: "transfer/channel-0/stuosmo".to_string(), value: 0.0 }); + self.thresholds.insert("tnam1ph6xhf0defk65hm7l5ursscwqdj8ehrcdv300u4g".to_string(), FeeThreshold { name: "transfer/channel-0/stutia".to_string(), value: 0.0 }); + self.thresholds.insert("tnam1p5z8ruwyu7ha8urhq2l0dhpk2f5dv3ts7uyf2n75".to_string(), FeeThreshold { name: "transfer/channel-1/uosmo".to_string(), value: 0.0 }); + self.thresholds.insert("tnam1pkg30gnt4q0zn7j00r6hms4ajrxn6f5ysyyl7w9m".to_string(), FeeThreshold { name: "transfer/channel-2/uatom".to_string(), value: 0.0 }); + self.thresholds.insert("tnam1pklj3kwp0cpsdvv56584rsajty974527qsp8n0nm".to_string(), FeeThreshold { name: "transfer/channel-3/utia".to_string(), value: 0.0 }); + self.explorer = "https://explorer75.org/namada/tx/".to_string(); + } + + + } +} \ No newline at end of file diff --git a/src/metrics/fees.rs b/src/metrics/fees.rs index f0e0533..f9baef3 100644 --- a/src/metrics/fees.rs +++ b/src/metrics/fees.rs @@ -12,7 +12,7 @@ use crate::state::State; /// namada_fees{token="tnam1q9gr66cvu4hrzm0sd5kmlnjje82gs3xlfg3v6nu7",chain_id="housefire-alpaca.cc0d3e0c033be"} 0.5845009999999999 /// namada_fees{token="tnam1q9gr66cvu4hrzm0sd5kmlnjje82gs3xlfg3v6nu7",chain_id="housefire-alpaca.cc0d3e0c033be"} 0.154409 /// ``` -use prometheus_exporter::prometheus::{CounterVec, GaugeVec, HistogramVec, HistogramOpts, Opts, Registry}; +use prometheus_exporter::prometheus::{CounterVec, HistogramVec, HistogramOpts, Opts, Registry}; use super::MetricTrait; @@ -56,6 +56,7 @@ impl MetricTrait for Fees { } fn update(&self, _pre_state: &State, post_state: &State) { + println!("updating fees"); self.reset(post_state); } } diff --git a/src/metrics/mod.rs b/src/metrics/mod.rs index 1ed6502..9e44aa1 100644 --- a/src/metrics/mod.rs +++ b/src/metrics/mod.rs @@ -10,6 +10,7 @@ mod transactions; mod transfers; mod validator; mod voting_power; +mod alert; use std::{collections::HashMap, net::SocketAddr}; @@ -81,6 +82,7 @@ impl MetricsExporter { Box::::default() as Box, Box::::default() as Box, Box::::default() as Box, + Box::new(alert::Alert::new(config)) as Box, ]; Self::new(config, metrics) diff --git a/src/rpc.rs b/src/rpc.rs index c3856de..2864609 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -372,7 +372,7 @@ impl Rpc { }) } - async fn concurrent_requests( + async fn concurrent_requests( &self, futures: Vec> + Unpin>, ) -> Option { @@ -381,7 +381,7 @@ impl Rpc { .map(|(_idx, value)| value) } - async fn concurrent_requests_idx( + async fn concurrent_requests_idx( &self, futures: Vec> + Unpin>, ) -> Option<(usize, T)> { @@ -390,7 +390,10 @@ impl Rpc { let (result, index, remaining) = futures::future::select_all(futures).await; match result { Ok(value) => return Some((index, value)), - Err(_) => futures = remaining, + Err(_e) => { + //tracing::error!("Error: {:?}", _e); + futures = remaining + }, } } None From 4e7e3b78199d2680fc478ca2495ffd52ab0996b3 Mon Sep 17 00:00:00 2001 From: Felipe Manzano Date: Tue, 1 Apr 2025 13:42:17 -0300 Subject: [PATCH 17/28] Set chainid to config object --- src/main.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.rs b/src/main.rs index 866d2af..881a536 100644 --- a/src/main.rs +++ b/src/main.rs @@ -99,6 +99,8 @@ async fn main() -> anyhow::Result<()> { } _ => config.chain_id = Some(chain_id), } + // Others may use the chaind from here + config.chain_id = Some(chain_id); let initial_block_height = match config.initial_block_height { u64::MAX => rpc.query_lastest_height().await?, From 742641b9aa516984dd7f370e356c8284d4aec97c Mon Sep 17 00:00:00 2001 From: Felipe Manzano Date: Tue, 1 Apr 2025 13:42:42 -0300 Subject: [PATCH 18/28] Set chainid to config object --- src/main.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 881a536..866d2af 100644 --- a/src/main.rs +++ b/src/main.rs @@ -99,8 +99,6 @@ async fn main() -> anyhow::Result<()> { } _ => config.chain_id = Some(chain_id), } - // Others may use the chaind from here - config.chain_id = Some(chain_id); let initial_block_height = match config.initial_block_height { u64::MAX => rpc.query_lastest_height().await?, From ae638d784e947c657c7d53162c971d2da10439ab Mon Sep 17 00:00:00 2001 From: Felipe Manzano Date: Tue, 1 Apr 2025 14:28:21 -0300 Subject: [PATCH 19/28] fmt --- .../provisioning/prometheus/namada-alerts.yml | 41 +-- src/main.rs | 11 +- src/metrics/alert.rs | 262 ++++++++++++++---- src/metrics/fees.rs | 28 +- src/metrics/mod.rs | 2 +- src/rpc.rs | 7 +- 6 files changed, 239 insertions(+), 112 deletions(-) diff --git a/composer/provisioning/prometheus/namada-alerts.yml b/composer/provisioning/prometheus/namada-alerts.yml index 2d60c6e..036a89b 100644 --- a/composer/provisioning/prometheus/namada-alerts.yml +++ b/composer/provisioning/prometheus/namada-alerts.yml @@ -11,34 +11,6 @@ groups: Validators appear to be stalled as the block height has not increased for 1 minute! Last recorded block height: {{ with query "namada_block_height{chain_id=\"$$CHAIN_ID$$\"}" }} {{ printf "%.0f" (. | first | value)}}{{ end }} - - alert: NamadaBlockProcessingSlow - expr: | - ( - avg_over_time(namada_block_time_sum{chain_id="$$CHAIN_ID$$"}[5m]) - / avg_over_time(namada_block_time_count{chain_id="$$CHAIN_ID$$"}[5m]) - ) - > - ( - avg_over_time(namada_block_time_sum{chain_id="$$CHAIN_ID$$"}[1w]) - / avg_over_time(namada_block_time_count{chain_id="$$CHAIN_ID$$"}[1w]) - ) - + - ( - 2 * ( - stddev_over_time(namada_block_time_sum{chain_id="$$CHAIN_ID$$"}[1w]) - / avg_over_time(namada_block_time_count{chain_id="$$CHAIN_ID$$"}[1w]) - ) - ) - labels: - severity: warning - annotations: - summary: "Namada block processing time is abnormal" - description: | - The average block processing time in the last 5 minutes is significantly higher than normal. - Current 5-minute average block time: {{ with query "(avg_over_time(namada_block_time_sum{chain_id=\"$$CHAIN_ID$$\"}[5m]) / avg_over_time(namada_block_time_count{chain_id=\"$$CHAIN_ID$$\"}[5m]))" }}{{ printf "%ds" (. | first | value) }}{{ end }} - Expected to be below: {{ with query "avg_over_time(namada_block_time_sum{chain_id=\"$$CHAIN_ID$$\"}[1w]) / avg_over_time(namada_block_time_count{chain_id=\"$$CHAIN_ID$$\"}[1w]) + (2 * (stddev_over_time(namada_block_time_sum{chain_id=\"$$CHAIN_ID$$\"}[1w]) / stddev_over_time(namada_block_time_count{chain_id=\"$$CHAIN_ID$$\"}[1w])))" }}{{ printf "%ds" (. | first | value) }}{{ end }} - Block height: {{ with query "namada_block_height{chain_id=\"$$CHAIN_ID$$\"}" }}{{ printf "%.0f" (. | first | value) }}{{ end }} - - alert: NamadaVotingPowerConcentration expr: namada_one_third_threshold{ chain_id="$$CHAIN_ID$$" } > 0.6 * namada_two_third_threshold{ chain_id="$$CHAIN_ID$$" } labels: @@ -92,16 +64,14 @@ groups: - alert: HighTransactionFees expr: | - (sum by (token) (namada_fees{chain_id="$$CHAIN_ID$$"})) > (sum by (token) (avg_over_time(namada_fees{chain_id="$$CHAIN_ID$$"}[10m]))) + 2 * (sum by (token) (stddev_over_time(namada_fees{chain_id="$$CHAIN_ID$$"}[10m]))) + max_over_time(namada_fees[1m]) > avg_over_time(namada_fees[7d]) + 2 * stddev_over_time(namada_fees[7d]) labels: severity: warning annotations: summary: "Namada transaction fees have spiked" description: | The transaction fees in Namada have increased significantly beyond normal levels. - Current fees: {{ with query "sum by (token) (namada_fees{chain_id=\"$$CHAIN_ID$$\"})" }}{{ printf "%.2f" (. | first | value) }}{{ end }} - Expected normal range (10-minute avg + 2x std deviation): {{ with query "(sum by (token) (avg_over_time(namada_fees{chain_id=\"$$CHAIN_ID$$\"}[10m]))) + 2 * (sum by (token) (stddev_over_time(namada_fees{chain_id=\"$$CHAIN_ID$$\"}[10m])))" }}{{ printf "%.2f" (. | first | value) }}{{ end }} - Block height: {{ with query "namada_block_height{chain_id=\"$$CHAIN_ID$$\"}" }}{{ printf "%.0f" (. | first | value) }}{{ end }} + Check Block Heights Immediatelly Before: {{ with query "namada_block_height{chain_id=\"$$CHAIN_ID$$\"}" }}{{ printf "%.0f" (. | first | value) }}{{ end }} - alert: AbnormalInnerTransactionFailureRate @@ -213,3 +183,10 @@ groups: description: | The number of validators below capacity has increased abnormally. Block height: {{ with query "namada_block_height{chain_id=\"$$CHAIN_ID$$\"}" }}{{ printf "%.0f" (. | first | value) }}{{ end }} + + - alert: LowLevelAlert + expr: namada_fee_alert{chain_id="$$CHAIN_ID$$"} >0 + labels: + severity: critical + annotations: + description: "{{ $labels.summary }}" \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 866d2af..5f35dce 100644 --- a/src/main.rs +++ b/src/main.rs @@ -77,7 +77,7 @@ async fn get_state_from_rpc(rpc: &Rpc, height: u64, checksums: Checksums) -> any total_supply_native, validators, future_bonds, - future_unbonds + future_unbonds, )) } @@ -125,19 +125,22 @@ async fn main() -> anyhow::Result<()> { // immediate next block let block_height = pre_state.next_block_height(); - let checksums= current_checksums.read().await.clone(); + let checksums = current_checksums.read().await.clone(); let post_state = get_state_from_rpc(&rpc, block_height, checksums) .await .into_retry_error()?; if post_state.get_epoch() != pre_state.get_epoch() { // update checksums - *current_checksums.write().await = get_checksums_at_height(&rpc, initial_block_height).await.into_retry_error()?; + *current_checksums.write().await = + get_checksums_at_height(&rpc, initial_block_height) + .await + .into_retry_error()?; } if block_height <= last_block_height { // update metrics metrics.update(&pre_state, &post_state); - }else { + } else { tracing::info!("Last block height reached: {}", block_height); } diff --git a/src/metrics/alert.rs b/src/metrics/alert.rs index 877721b..e22e272 100644 --- a/src/metrics/alert.rs +++ b/src/metrics/alert.rs @@ -1,12 +1,11 @@ -/// Low level alert metric hack -use std::collections::HashMap; +use super::MetricTrait; use crate::config::AppConfig; use crate::state::State; use anyhow::Result; use prometheus_exporter::prometheus::core::{AtomicU64, GenericCounterVec}; use prometheus_exporter::prometheus::{Opts, Registry}; -use super::MetricTrait; - +/// Low level alert metric hack +use std::collections::HashMap; type Token = String; struct FeeThreshold { @@ -26,8 +25,7 @@ impl MetricTrait for Alert { Ok(()) } - fn reset(&self, _state: &State) { - } + fn reset(&self, _state: &State) {} fn update(&self, _pre_state: &State, post_state: &State) { if self.thresholds.is_empty() { @@ -35,7 +33,7 @@ impl MetricTrait for Alert { } let block = post_state.get_last_block(); - for tx in &block.transactions { + for tx in &block.transactions { let amount_per_gas = tx.fee.amount_per_gas_unit.parse::(); let gas_limit = tx.fee.gas.parse::(); @@ -64,26 +62,16 @@ impl MetricTrait for Alert { ); self.alert_counter.with_label_values(&[&summary]).inc(); - tracing::debug!( - "Low Level Alert {}", summary - ); - + tracing::debug!("Low Level Alert {}", summary); } - } } impl Default for Alert { fn default() -> Self { - - let alert_counter_ops = Opts::new( - "fee_alert", - "Low level trivial alerts", - ); - let alert_counter = GenericCounterVec::::new( - alert_counter_ops, - &["summary"], - ).expect("Failed to create GenericCounterVec"); + let alert_counter_ops = Opts::new("fee_alert", "Low level trivial alerts"); + let alert_counter = GenericCounterVec::::new(alert_counter_ops, &["summary"]) + .expect("Failed to create GenericCounterVec"); Self { alert_counter, thresholds: HashMap::new(), @@ -92,7 +80,6 @@ impl Default for Alert { } } - impl Alert { pub fn new(config: &AppConfig) -> Self { let mut instance = Self::default(); @@ -101,46 +88,213 @@ impl Alert { } fn populate_thresholds(&mut self, chain_id: &str) { if chain_id == "campfire-square.ff09671d333707" { - self.thresholds.insert("tnam1qy4pd2j2wkp34c49epd5wy9ny83qsedekgac6gyr".to_string(), FeeThreshold { name: "apfel".to_string(), value: 0.1 }); - self.thresholds.insert("tnam1qy4u69pe54hyssg9g42equq0z2vrj9rlnsrfcu6l".to_string(), FeeThreshold { name: "btc".to_string(), value: 0.1 }); - self.thresholds.insert("tnam1qyzv6anc548dyj0nqvezrxxd6679d0a02y78k3xx".to_string(), FeeThreshold { name: "dot".to_string(), value: 0.1 }); - self.thresholds.insert("tnam1q9046ls453j29xp0g90vm05dpped9adweyjnplkl".to_string(), FeeThreshold { name: "eth".to_string(), value: 0.1 }); - self.thresholds.insert("tnam1q982u50dxneydrlne6nfhrcwxc5mlxtpssjjdp3q".to_string(), FeeThreshold { name: "kartoffel".to_string(), value: 0.1 }); - self.thresholds.insert("tnam1qy440ynh9fwrx8aewjvvmu38zxqgukgc259fzp6h".to_string(), FeeThreshold { name: "nam".to_string(), value: 0.1 }); - self.thresholds.insert("tnam1qxkdfqv2shgyllcf7dq5qlvf8gt6a2kr0s33ye26".to_string(), FeeThreshold { name: "schnitzel".to_string(), value: 0.1 }); - self.thresholds.insert("tnam1phks0geerggjk96ezhxclt6r5tdgu3usa5zteyyc".to_string(), FeeThreshold { name: "transfer/channel-0/uosmo".to_string(), value: 0.05 }); + self.thresholds.insert( + "tnam1qy4pd2j2wkp34c49epd5wy9ny83qsedekgac6gyr".to_string(), + FeeThreshold { + name: "apfel".to_string(), + value: 0.1, + }, + ); + self.thresholds.insert( + "tnam1qy4u69pe54hyssg9g42equq0z2vrj9rlnsrfcu6l".to_string(), + FeeThreshold { + name: "btc".to_string(), + value: 0.1, + }, + ); + self.thresholds.insert( + "tnam1qyzv6anc548dyj0nqvezrxxd6679d0a02y78k3xx".to_string(), + FeeThreshold { + name: "dot".to_string(), + value: 0.1, + }, + ); + self.thresholds.insert( + "tnam1q9046ls453j29xp0g90vm05dpped9adweyjnplkl".to_string(), + FeeThreshold { + name: "eth".to_string(), + value: 0.1, + }, + ); + self.thresholds.insert( + "tnam1q982u50dxneydrlne6nfhrcwxc5mlxtpssjjdp3q".to_string(), + FeeThreshold { + name: "kartoffel".to_string(), + value: 0.1, + }, + ); + self.thresholds.insert( + "tnam1qy440ynh9fwrx8aewjvvmu38zxqgukgc259fzp6h".to_string(), + FeeThreshold { + name: "nam".to_string(), + value: 0.1, + }, + ); + self.thresholds.insert( + "tnam1qxkdfqv2shgyllcf7dq5qlvf8gt6a2kr0s33ye26".to_string(), + FeeThreshold { + name: "schnitzel".to_string(), + value: 0.1, + }, + ); + self.thresholds.insert( + "tnam1phks0geerggjk96ezhxclt6r5tdgu3usa5zteyyc".to_string(), + FeeThreshold { + name: "transfer/channel-0/uosmo".to_string(), + value: 0.05, + }, + ); //https://github.com/Luminara-Hub/namada-ecosystem/blob/main/user-and-dev-tools/testnet/housefire/explorers.json self.explorer = "https://explorer75.org/namada-campfire/tx/".to_string(); } if chain_id == "housefire-alpaca.cc0d3e0c033be" { - self.thresholds.insert("tnam1q9gr66cvu4hrzm0sd5kmlnjje82gs3xlfg3v6nu7".to_string(), FeeThreshold { name: "nam".to_string(), value: 0.0 }); - self.thresholds.insert("tnam1phks0geerggjk96ezhxclt6r5tdgu3usa5zteyyc".to_string(), FeeThreshold { name: "transfer/channel-0/uosmo".to_string(), value: 0.0 }); - self.thresholds.insert("tnam1phzvlar06m0rtjjv7n8qx8ny8j8aexayhyq98r7s".to_string(), FeeThreshold { name: "transfer/channel-1/uatom".to_string(), value: 0.0 }); - self.thresholds.insert("tnam1phdf4sns3dx653kjfeejgymnehxg2z7xgs4z956n".to_string(), FeeThreshold { name: "transfer/channel-10/utia".to_string(), value: 0.02 }); - self.thresholds.insert("tnam1pk22zc02efq85wvgnu6q3zfe07sz828p35xntldz".to_string(), FeeThreshold { name: "transfer/channel-4/stuatom".to_string(), value: 0.0 }); - self.thresholds.insert("tnam1p4ak7rgnqatppd0hjnfsvu7dray8twf0sv2rvq3f".to_string(), FeeThreshold { name: "transfer/channel-4/stuosmo".to_string(), value: 0.0 }); - self.thresholds.insert("tnam1ph4d4cdwu3tvj8rj6n75lrp3q0pg0yym7gpf75az".to_string(), FeeThreshold { name: "transfer/channel-4/stutia".to_string(), value: 0.0 }); - self.thresholds.insert("tnam1p4r2835fw404zme26y88uxex8lnp5rdv4s9yjtu7".to_string(), FeeThreshold { name: "transfer/channel-5/utia".to_string(), value: 0.0 }); - self.thresholds.insert("tnam1phavrw42dmxuhzzq3fhwagf663ekmf58lqedrqcv".to_string(), FeeThreshold { name: "transfer/channel-7/uosmo".to_string(), value: 0.02 }); - self.thresholds.insert("tnam1pkmcvjcruxul6ncyjfp7j24ady2cda5zzvudakty".to_string(), FeeThreshold { name: "transfer/channel-8/stuatom".to_string(), value: 0.02 }); - self.thresholds.insert("tnam1p46jfxscmma7le2lswcuwr9dydxlze83wsjdkygq".to_string(), FeeThreshold { name: "transfer/channel-8/stuosmo".to_string(), value: 0.02 }); - self.thresholds.insert("tnam1p4jknczaacetxwwe9p49903nml80e9ex0ufqh3kr".to_string(), FeeThreshold { name: "transfer/channel-8/stutia".to_string(), value: 0.02 }); - self.thresholds.insert("tnam1p4zuqqd94csj6zv8n0jxylz9kex4vdsgvg3uglw9".to_string(), FeeThreshold { name: "transfer/channel-9/uatom".to_string(), value: 0.02 }); - self.explorer = "https://namada-explorer.sproutstake.space/test/transactions/".to_string(); + self.thresholds.insert( + "tnam1q9gr66cvu4hrzm0sd5kmlnjje82gs3xlfg3v6nu7".to_string(), + FeeThreshold { + name: "nam".to_string(), + value: 0.0, + }, + ); + self.thresholds.insert( + "tnam1phks0geerggjk96ezhxclt6r5tdgu3usa5zteyyc".to_string(), + FeeThreshold { + name: "transfer/channel-0/uosmo".to_string(), + value: 0.0, + }, + ); + self.thresholds.insert( + "tnam1phzvlar06m0rtjjv7n8qx8ny8j8aexayhyq98r7s".to_string(), + FeeThreshold { + name: "transfer/channel-1/uatom".to_string(), + value: 0.0, + }, + ); + self.thresholds.insert( + "tnam1phdf4sns3dx653kjfeejgymnehxg2z7xgs4z956n".to_string(), + FeeThreshold { + name: "transfer/channel-10/utia".to_string(), + value: 0.02, + }, + ); + self.thresholds.insert( + "tnam1pk22zc02efq85wvgnu6q3zfe07sz828p35xntldz".to_string(), + FeeThreshold { + name: "transfer/channel-4/stuatom".to_string(), + value: 0.0, + }, + ); + self.thresholds.insert( + "tnam1p4ak7rgnqatppd0hjnfsvu7dray8twf0sv2rvq3f".to_string(), + FeeThreshold { + name: "transfer/channel-4/stuosmo".to_string(), + value: 0.0, + }, + ); + self.thresholds.insert( + "tnam1ph4d4cdwu3tvj8rj6n75lrp3q0pg0yym7gpf75az".to_string(), + FeeThreshold { + name: "transfer/channel-4/stutia".to_string(), + value: 0.0, + }, + ); + self.thresholds.insert( + "tnam1p4r2835fw404zme26y88uxex8lnp5rdv4s9yjtu7".to_string(), + FeeThreshold { + name: "transfer/channel-5/utia".to_string(), + value: 0.0, + }, + ); + self.thresholds.insert( + "tnam1phavrw42dmxuhzzq3fhwagf663ekmf58lqedrqcv".to_string(), + FeeThreshold { + name: "transfer/channel-7/uosmo".to_string(), + value: 0.02, + }, + ); + self.thresholds.insert( + "tnam1pkmcvjcruxul6ncyjfp7j24ady2cda5zzvudakty".to_string(), + FeeThreshold { + name: "transfer/channel-8/stuatom".to_string(), + value: 0.02, + }, + ); + self.thresholds.insert( + "tnam1p46jfxscmma7le2lswcuwr9dydxlze83wsjdkygq".to_string(), + FeeThreshold { + name: "transfer/channel-8/stuosmo".to_string(), + value: 0.02, + }, + ); + self.thresholds.insert( + "tnam1p4jknczaacetxwwe9p49903nml80e9ex0ufqh3kr".to_string(), + FeeThreshold { + name: "transfer/channel-8/stutia".to_string(), + value: 0.02, + }, + ); + self.thresholds.insert( + "tnam1p4zuqqd94csj6zv8n0jxylz9kex4vdsgvg3uglw9".to_string(), + FeeThreshold { + name: "transfer/channel-9/uatom".to_string(), + value: 0.02, + }, + ); + self.explorer = + "https://namada-explorer.sproutstake.space/test/transactions/".to_string(); } if chain_id == "namada.5f5de2dd1b88cba30586420" { - self.thresholds.insert("tnam1q9gr66cvu4hrzm0sd5kmlnjje82gs3xlfg3v6nu7".to_string(), FeeThreshold { name: "nam".to_string(), value: 0.0 }); - self.thresholds.insert("tnam1p5z5538v3kdk3wdx7r2hpqm4uq9926dz3ughcp7n".to_string(), FeeThreshold { name: "transfer/channel-0/stuatom".to_string(), value: 0.0 }); - self.thresholds.insert("tnam1p4px8sw3am4qvetj7eu77gftm4fz4hcw2ulpldc7".to_string(), FeeThreshold { name: "transfer/channel-0/stuosmo".to_string(), value: 0.0 }); - self.thresholds.insert("tnam1ph6xhf0defk65hm7l5ursscwqdj8ehrcdv300u4g".to_string(), FeeThreshold { name: "transfer/channel-0/stutia".to_string(), value: 0.0 }); - self.thresholds.insert("tnam1p5z8ruwyu7ha8urhq2l0dhpk2f5dv3ts7uyf2n75".to_string(), FeeThreshold { name: "transfer/channel-1/uosmo".to_string(), value: 0.0 }); - self.thresholds.insert("tnam1pkg30gnt4q0zn7j00r6hms4ajrxn6f5ysyyl7w9m".to_string(), FeeThreshold { name: "transfer/channel-2/uatom".to_string(), value: 0.0 }); - self.thresholds.insert("tnam1pklj3kwp0cpsdvv56584rsajty974527qsp8n0nm".to_string(), FeeThreshold { name: "transfer/channel-3/utia".to_string(), value: 0.0 }); + self.thresholds.insert( + "tnam1q9gr66cvu4hrzm0sd5kmlnjje82gs3xlfg3v6nu7".to_string(), + FeeThreshold { + name: "nam".to_string(), + value: 0.0, + }, + ); + self.thresholds.insert( + "tnam1p5z5538v3kdk3wdx7r2hpqm4uq9926dz3ughcp7n".to_string(), + FeeThreshold { + name: "transfer/channel-0/stuatom".to_string(), + value: 0.0, + }, + ); + self.thresholds.insert( + "tnam1p4px8sw3am4qvetj7eu77gftm4fz4hcw2ulpldc7".to_string(), + FeeThreshold { + name: "transfer/channel-0/stuosmo".to_string(), + value: 0.0, + }, + ); + self.thresholds.insert( + "tnam1ph6xhf0defk65hm7l5ursscwqdj8ehrcdv300u4g".to_string(), + FeeThreshold { + name: "transfer/channel-0/stutia".to_string(), + value: 0.0, + }, + ); + self.thresholds.insert( + "tnam1p5z8ruwyu7ha8urhq2l0dhpk2f5dv3ts7uyf2n75".to_string(), + FeeThreshold { + name: "transfer/channel-1/uosmo".to_string(), + value: 0.0, + }, + ); + self.thresholds.insert( + "tnam1pkg30gnt4q0zn7j00r6hms4ajrxn6f5ysyyl7w9m".to_string(), + FeeThreshold { + name: "transfer/channel-2/uatom".to_string(), + value: 0.0, + }, + ); + self.thresholds.insert( + "tnam1pklj3kwp0cpsdvv56584rsajty974527qsp8n0nm".to_string(), + FeeThreshold { + name: "transfer/channel-3/utia".to_string(), + value: 0.0, + }, + ); self.explorer = "https://explorer75.org/namada/tx/".to_string(); } - - } -} \ No newline at end of file +} diff --git a/src/metrics/fees.rs b/src/metrics/fees.rs index f9baef3..2aa860e 100644 --- a/src/metrics/fees.rs +++ b/src/metrics/fees.rs @@ -12,7 +12,7 @@ use crate::state::State; /// namada_fees{token="tnam1q9gr66cvu4hrzm0sd5kmlnjje82gs3xlfg3v6nu7",chain_id="housefire-alpaca.cc0d3e0c033be"} 0.5845009999999999 /// namada_fees{token="tnam1q9gr66cvu4hrzm0sd5kmlnjje82gs3xlfg3v6nu7",chain_id="housefire-alpaca.cc0d3e0c033be"} 0.154409 /// ``` -use prometheus_exporter::prometheus::{CounterVec, HistogramVec, HistogramOpts, Opts, Registry}; +use prometheus_exporter::prometheus::{CounterVec, HistogramOpts, HistogramVec, Opts, Registry}; use super::MetricTrait; @@ -40,24 +40,21 @@ impl MetricTrait for Fees { (Ok(amount_per_gas), Ok(gas_limit)) => amount_per_gas * gas_limit, _ => continue, }; - + self.fees .with_label_values(&[&tx.fee.gas_token]) .inc_by(fee); - self.fees_by_tx.with_label_values(&[&tx.fee.gas_token]).observe(fee); - tracing::debug!( - "Transaction fee: {} {}", - fee, - tx.fee.gas_token - ); - + self.fees_by_tx + .with_label_values(&[&tx.fee.gas_token]) + .observe(fee); + tracing::debug!("Transaction fee: {} {}", fee, tx.fee.gas_token); } } fn update(&self, _pre_state: &State, post_state: &State) { println!("updating fees"); - self.reset(post_state); + self.reset(post_state); } } @@ -67,13 +64,10 @@ impl Default for Fees { let fees = CounterVec::new(fees_opts, &["token"]) .expect("unable to create gauge vector for transaction fees"); - let fees_by_tx_opts = HistogramOpts::new( - "fees_by_tx", - "Total fees paid per transaction", - ) - .buckets(vec![ - 0.01, 0.02, 0.05, 0.1, 0.5, 1.0, 2.0, 5.0, 10.0, 20.0, 50.0, 100.0, - ]); + let fees_by_tx_opts = HistogramOpts::new("fees_by_tx", "Total fees paid per transaction") + .buckets(vec![ + 0.01, 0.02, 0.05, 0.1, 0.5, 1.0, 2.0, 5.0, 10.0, 20.0, 50.0, 100.0, + ]); let fees_by_tx = HistogramVec::new(fees_by_tx_opts, &["token"]) .expect("unable to create histogram vec for transaction fees by tx"); diff --git a/src/metrics/mod.rs b/src/metrics/mod.rs index 9e44aa1..39d2bfa 100644 --- a/src/metrics/mod.rs +++ b/src/metrics/mod.rs @@ -1,3 +1,4 @@ +mod alert; mod block_height; mod block_time; mod bonds; @@ -10,7 +11,6 @@ mod transactions; mod transfers; mod validator; mod voting_power; -mod alert; use std::{collections::HashMap, net::SocketAddr}; diff --git a/src/rpc.rs b/src/rpc.rs index 2864609..a779512 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -167,7 +167,6 @@ impl Rpc { .map(|client| client.block_results(block_height)) .collect(); - let block_height = namada_sdk::tendermint::block::Height::try_from(block_height).unwrap(); let events_res = self.concurrent_requests(events_futures).await; @@ -372,7 +371,7 @@ impl Rpc { }) } - async fn concurrent_requests( + async fn concurrent_requests( &self, futures: Vec> + Unpin>, ) -> Option { @@ -381,7 +380,7 @@ impl Rpc { .map(|(_idx, value)| value) } - async fn concurrent_requests_idx( + async fn concurrent_requests_idx( &self, futures: Vec> + Unpin>, ) -> Option<(usize, T)> { @@ -393,7 +392,7 @@ impl Rpc { Err(_e) => { //tracing::error!("Error: {:?}", _e); futures = remaining - }, + } } } None From f859ceb4a59ccf41d91f0c8d295b50f5ea93fd84 Mon Sep 17 00:00:00 2001 From: Felipe Manzano Date: Tue, 1 Apr 2025 18:16:21 -0300 Subject: [PATCH 20/28] Lowlevel alert rule --- .../provisioning/prometheus/namada-alerts.yml | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/composer/provisioning/prometheus/namada-alerts.yml b/composer/provisioning/prometheus/namada-alerts.yml index 036a89b..3376c50 100644 --- a/composer/provisioning/prometheus/namada-alerts.yml +++ b/composer/provisioning/prometheus/namada-alerts.yml @@ -6,7 +6,7 @@ groups: labels: severity: critical annotations: - summary: "Namada block height is not increasing" + summary: "Namada block height is not increasing - $$CHAIN_ID$$" description: | Validators appear to be stalled as the block height has not increased for 1 minute! Last recorded block height: {{ with query "namada_block_height{chain_id=\"$$CHAIN_ID$$\"}" }} {{ printf "%.0f" (. | first | value)}}{{ end }} @@ -16,7 +16,7 @@ groups: labels: severity: critical annotations: - summary: "Voting power is too concentrated" + summary: "Voting power is too concentrated - $$CHAIN_ID$$" description: | The number of validators needed for 1/3 of the voting power is greater than 60% of the number of validators neededed for 2/3 voting power. Block height: {{ with query "namada_block_height{ chain_id=\"$$CHAIN_ID$$\" }" }}{{ printf "%.0f" (. | first | value)}}{{ end }} @@ -26,7 +26,7 @@ groups: labels: severity: critical annotations: - summary: "Very low validator participation detected" + summary: "Very low validator participation detected - $$CHAIN_ID$$" description: | The number of validators needed for 1/3 or 2/3 consensus is at zero, which indicates a potential network failure. Block height: {{ with query "namada_block_height{ chain_id=\"$$CHAIN_ID$$\" }" }}{{ printf "%.0f" (. | first | value)}}{{ end }} @@ -36,7 +36,7 @@ groups: labels: severity: warning annotations: - summary: "Unusual increase in bonding activity" + summary: "Unusual increase in bonding activity - $$CHAIN_ID$$" description: | Bonding per epoch has increased significantly over the last 10 minutes compared to the average of last 7 days. Block height: {{ with query "namada_block_height{ chain_id=\"$$CHAIN_ID$$\" }" }}{{ printf "%.0f" (. | first | value)}}{{ end }} @@ -46,7 +46,7 @@ groups: labels: severity: warning annotations: - summary: "Unusual increase in unbonding activity" + summary: "Unusual increase in unbonding activity - $$CHAIN_ID$$" description: | Unbonding per epoch has increased significantly over the last 10 minutes compared to the average of last 7 days. Block height: {{ with query "namada_block_height{ chain_id=\"$$CHAIN_ID$$\" }" }}{{ printf "%.0f" (. | first | value)}}{{ end }} @@ -57,7 +57,7 @@ groups: labels: severity: warning annotations: - summary: "Spike in transaction batch size" + summary: "Spike in transaction batch size - $$CHAIN_ID$$" description: | Transaction batching has significantly increased over the last 10 minutes compared to the 7-day median. Block height: {{ with query "namada_block_height{ chain_id=\"$$CHAIN_ID$$\" }" }}{{ printf "%.0f" (. | first | value)}}{{ end }} @@ -68,7 +68,7 @@ groups: labels: severity: warning annotations: - summary: "Namada transaction fees have spiked" + summary: "Namada transaction fees have spiked - $$CHAIN_ID$$" description: | The transaction fees in Namada have increased significantly beyond normal levels. Check Block Heights Immediatelly Before: {{ with query "namada_block_height{chain_id=\"$$CHAIN_ID$$\"}" }}{{ printf "%.0f" (. | first | value) }}{{ end }} @@ -82,7 +82,7 @@ groups: labels: severity: critical annotations: - summary: "Unusual spike in inner transaction failures" + summary: "Unusual spike in inner transaction failures - $$CHAIN_ID$$" description: | The failure rate of inner transactions has spiked abnormally compared against the median in the last 7 days. Block height: {{ with query "namada_block_height{chain_id=\"$$CHAIN_ID$$\"}" }}{{ printf "%.0f" (. | first | value) }}{{ end }} @@ -95,7 +95,7 @@ groups: labels: severity: warning annotations: - summary: "Potential Whale Detected in {{ $labels.token }}" + summary: "Potential Whale Detected in {{ $labels.token }} - $$CHAIN_ID$$" description: | Token {{ $labels.token }} experienced a large transfer in last minute ({{ with query "rate(namada_transfer_amount{chain_id=\"$$CHAIN_ID$$\"}[1m])" }}{{ printf "%.0f" (. | first | value) }}{{ end }}) The amount is unusually high compared to the typical increases over the past week. @@ -108,7 +108,7 @@ groups: labels: severity: critical annotations: - summary: "Unusual number of validator slashes" + summary: "Unusual number of validator slashes - $$CHAIN_ID$$" description: | Slashing detected. Block height: {{ with query "namada_block_height{chain_id=\"$$CHAIN_ID$$\"}" }}{{ printf "%.0f" (. | first | value) }}{{ end }} @@ -122,7 +122,7 @@ groups: labels: severity: warning annotations: - summary: "Abnormal increase/decrease in consensus validators" + summary: "Abnormal increase/decrease in consensus validators - $$CHAIN_ID$$" description: | The number of validators in the consensus state has increased/decreased abnormally. Block height: {{ with query "namada_block_height{chain_id=\"$$CHAIN_ID$$\"}" }}{{ printf "%.0f" (. | first | value) }}{{ end }} @@ -136,7 +136,7 @@ groups: labels: severity: warning annotations: - summary: "Abnormal increase in inactive validators" + summary: "Abnormal increase in inactive validators - $$CHAIN_ID$$" description: | The number of inactive validators has increased abnormally. Block height: {{ with query "namada_block_height{chain_id=\"$$CHAIN_ID$$\"}" }}{{ printf "%.0f" (. | first | value) }}{{ end }} @@ -150,7 +150,7 @@ groups: labels: severity: critical annotations: - summary: "Abnormal increase in jailed validators" + summary: "Abnormal increase in jailed validators - $$CHAIN_ID$$" description: | The number of jailed validators has increased abnormally. Block height: {{ with query "namada_block_height{chain_id=\"$$CHAIN_ID$$\"}" }}{{ printf "%.0f" (. | first | value) }}{{ end }} @@ -165,7 +165,7 @@ groups: labels: severity: warning annotations: - summary: "Abnormal increase in below-threshold validators" + summary: "Abnormal increase in below-threshold validators - $$CHAIN_ID$$" description: | The number of validators below the threshold has increased abnormally. Block height: {{ with query "namada_block_height{chain_id=\"$$CHAIN_ID$$\"}" }}{{ printf "%.0f" (. | first | value) }}{{ end }} @@ -179,14 +179,15 @@ groups: labels: severity: warning annotations: - summary: "Abnormal increase in below-capacity validators" + summary: "Abnormal increase in below-capacity validators - $$CHAIN_ID$$" description: | The number of validators below capacity has increased abnormally. Block height: {{ with query "namada_block_height{chain_id=\"$$CHAIN_ID$$\"}" }}{{ printf "%.0f" (. | first | value) }}{{ end }} - alert: LowLevelAlert - expr: namada_fee_alert{chain_id="$$CHAIN_ID$$"} >0 + expr: (namada_fee_alert{chain_id="$$CHAIN_ID$$"} > 0 unless namada_fee_alert{chain_id="$$CHAIN_ID$$"} offset 7s) labels: severity: critical annotations: + summary: "Low level alert - $$CHAIN_ID$$" description: "{{ $labels.summary }}" \ No newline at end of file From c4097377d68311e31496f9741fbd96f6813c9d2b Mon Sep 17 00:00:00 2001 From: Felipe Manzano Date: Tue, 1 Apr 2025 19:09:24 -0300 Subject: [PATCH 21/28] Lint --- src/rpc.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/rpc.rs b/src/rpc.rs index a779512..18c8a0a 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -12,7 +12,7 @@ use namada_sdk::{ use std::{future::Future, str::FromStr}; use tendermint_rpc::client::CompatMode; use tendermint_rpc::{endpoint::net_info::PeerInfo, HttpClient, HttpClientUrl, Url}; - +use namada_sdk::tendermint::block::Height as TenderHeight; use crate::shared::{ checksums::Checksums, namada::{Address, Block, BlockResult, Epoch, Height, Validator}, @@ -159,7 +159,7 @@ impl Rpc { checksums: &Checksums, epoch: Epoch, ) -> anyhow::Result { - let block_height = namada_sdk::tendermint::block::Height::try_from(block_height).unwrap(); + let block_height = TenderHeight::try_from(block_height).unwrap(); let events_futures = self .clients @@ -167,8 +167,6 @@ impl Rpc { .map(|client| client.block_results(block_height)) .collect(); - let block_height = namada_sdk::tendermint::block::Height::try_from(block_height).unwrap(); - let events_res = self.concurrent_requests(events_futures).await; let events = events_res.map(BlockResult::from).context(format!( "Should be able to query for block events for height: {}", From 0231c3cad2a055be44ddf39e6d75b4218fad1f68 Mon Sep 17 00:00:00 2001 From: Felipe Manzano Date: Wed, 2 Apr 2025 10:34:29 -0300 Subject: [PATCH 22/28] remove unnecesary changes --- Dockerfile | 2 +- src/rpc.rs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index e45b690..0f727ca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ RUN cargo chef prepare --recipe-path recipe.json FROM lukemathwalker/cargo-chef:latest-rust-1.82.0 AS cacher WORKDIR /app COPY --from=planner /app/recipe.json recipe.json -RUN apt-get clean && apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --assume-yes \ +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --assume-yes \ libprotobuf-dev \ build-essential \ clang-tools-16 \ diff --git a/src/rpc.rs b/src/rpc.rs index 18c8a0a..955debc 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -1,5 +1,10 @@ +use crate::shared::{ + checksums::Checksums, + namada::{Address, Block, BlockResult, Epoch, Height, Validator}, +}; use anyhow::Context; use futures::FutureExt; +use namada_sdk::tendermint::block::Height as TenderHeight; use namada_sdk::{ address::Address as NamadaAddress, hash::Hash, @@ -12,11 +17,6 @@ use namada_sdk::{ use std::{future::Future, str::FromStr}; use tendermint_rpc::client::CompatMode; use tendermint_rpc::{endpoint::net_info::PeerInfo, HttpClient, HttpClientUrl, Url}; -use namada_sdk::tendermint::block::Height as TenderHeight; -use crate::shared::{ - checksums::Checksums, - namada::{Address, Block, BlockResult, Epoch, Height, Validator}, -}; pub struct Rpc { pub clients: Vec, From d8fa7fe4696904c26d4ec1cf5734d9cdeb6ebabb Mon Sep 17 00:00:00 2001 From: Felipe Manzano Date: Wed, 2 Apr 2025 10:40:53 -0300 Subject: [PATCH 23/28] Fix rules and doc --- composer/provisioning/prometheus/namada-alerts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer/provisioning/prometheus/namada-alerts.yml b/composer/provisioning/prometheus/namada-alerts.yml index 3376c50..bc19da4 100644 --- a/composer/provisioning/prometheus/namada-alerts.yml +++ b/composer/provisioning/prometheus/namada-alerts.yml @@ -78,7 +78,7 @@ groups: expr: | (rate(namada_transaction_kind{chain_id="$$CHAIN_ID$$", failed="true"}[10m]) / rate(namada_transaction_kind{chain_id="$$CHAIN_ID$$"}[10m])) > - (2 * quantile(0.50, rate(namada_transaction_kind{chain_id="$$CHAIN_ID$$", failed="true"}[7d:]) / rate(namada_transaction_kind{chain_id="$$CHAIN_ID$$"}[7d:])) by (chain_id)) + (2 * quantile(0.50, rate(namada_transaction_kind{chain_id="$$CHAIN_ID$$", failed="true"}[7d:]) / rate(namada_transaction_kind{chain_id="$$CHAIN_ID$$"}[7d:])) labels: severity: critical annotations: From be35a8a7b635f2a6b36522017014735734deee62 Mon Sep 17 00:00:00 2001 From: Felipe Manzano Date: Wed, 2 Apr 2025 10:43:04 -0300 Subject: [PATCH 24/28] Parenthesis in rules --- composer/provisioning/prometheus/namada-alerts.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer/provisioning/prometheus/namada-alerts.yml b/composer/provisioning/prometheus/namada-alerts.yml index bc19da4..3835fa2 100644 --- a/composer/provisioning/prometheus/namada-alerts.yml +++ b/composer/provisioning/prometheus/namada-alerts.yml @@ -78,7 +78,7 @@ groups: expr: | (rate(namada_transaction_kind{chain_id="$$CHAIN_ID$$", failed="true"}[10m]) / rate(namada_transaction_kind{chain_id="$$CHAIN_ID$$"}[10m])) > - (2 * quantile(0.50, rate(namada_transaction_kind{chain_id="$$CHAIN_ID$$", failed="true"}[7d:]) / rate(namada_transaction_kind{chain_id="$$CHAIN_ID$$"}[7d:])) + (2 * quantile(0.50, rate(namada_transaction_kind{chain_id="$$CHAIN_ID$$", failed="true"}[7d:]) / rate(namada_transaction_kind{chain_id="$$CHAIN_ID$$"}[7d:]))) labels: severity: critical annotations: @@ -99,7 +99,7 @@ groups: description: | Token {{ $labels.token }} experienced a large transfer in last minute ({{ with query "rate(namada_transfer_amount{chain_id=\"$$CHAIN_ID$$\"}[1m])" }}{{ printf "%.0f" (. | first | value) }}{{ end }}) The amount is unusually high compared to the typical increases over the past week. - Transfer Amount: {{ $value }} {{ $labels.token }} + Transfering {{ $labels.token }} Block height: {{ with query "namada_block_height{chain_id=\"$$CHAIN_ID$$\"} " }}{{ printf "%.0f" (. | first | value) }}{{ end }} - alert: HighSlashingRate From f3d55dd0a188275bdd8fe62db723d358be2d8806 Mon Sep 17 00:00:00 2001 From: Felipe Manzano Date: Wed, 2 Apr 2025 10:48:57 -0300 Subject: [PATCH 25/28] Added checking if block are absent --- composer/provisioning/prometheus/namada-alerts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer/provisioning/prometheus/namada-alerts.yml b/composer/provisioning/prometheus/namada-alerts.yml index 3835fa2..1b36831 100644 --- a/composer/provisioning/prometheus/namada-alerts.yml +++ b/composer/provisioning/prometheus/namada-alerts.yml @@ -2,7 +2,7 @@ groups: - name: namada-validator-alerts rules: - alert: NamadaBlockHeightStalled - expr: rate(namada_block_height{ chain_id="$$CHAIN_ID$$" }[1m]) == 0 + expr: (absent_over_time(namada_block_height{ chain_id="$$CHAIN_ID$$" }[1m]) or rate(namada_block_height{ chain_id="$$CHAIN_ID$$" }[1m]) == 0) labels: severity: critical annotations: From a5b09f6aa2a67223f9cd744cef3d90a019b576e6 Mon Sep 17 00:00:00 2001 From: Felipe Manzano Date: Wed, 2 Apr 2025 11:22:06 -0300 Subject: [PATCH 26/28] lint --- composer/provisioning/prometheus/namada-alerts.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/composer/provisioning/prometheus/namada-alerts.yml b/composer/provisioning/prometheus/namada-alerts.yml index 1b36831..96b266f 100644 --- a/composer/provisioning/prometheus/namada-alerts.yml +++ b/composer/provisioning/prometheus/namada-alerts.yml @@ -73,7 +73,6 @@ groups: The transaction fees in Namada have increased significantly beyond normal levels. Check Block Heights Immediatelly Before: {{ with query "namada_block_height{chain_id=\"$$CHAIN_ID$$\"}" }}{{ printf "%.0f" (. | first | value) }}{{ end }} - - alert: AbnormalInnerTransactionFailureRate expr: | (rate(namada_transaction_kind{chain_id="$$CHAIN_ID$$", failed="true"}[10m]) / rate(namada_transaction_kind{chain_id="$$CHAIN_ID$$"}[10m])) From be6a76c080d1d43fb4511610267dd51dd73850f7 Mon Sep 17 00:00:00 2001 From: Felipe Manzano Date: Wed, 2 Apr 2025 11:28:10 -0300 Subject: [PATCH 27/28] Fees metric reset by block --- Cargo.toml | 2 -- src/config.rs | 2 +- src/main.rs | 2 +- src/metrics/fees.rs | 1 + src/metrics/transfers.rs | 4 ++-- src/rpc.rs | 5 +++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8971fef..d1ba258 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,6 @@ clap-verbosity-flag = "2.1.1" namada_sdk = { version = "0.47.1", default-features = false, features = ["std", "async-send", "download-params"] } tendermint-config = "0.40.1" tendermint-rpc = { version = "0.40.1", features = ["http-client"] } - tokio = {version = "1.8.2", default-features = false} async-trait = "0.1.74" reqwest = { version = "0.11.22", features = ["json"] } @@ -32,4 +31,3 @@ tokio-retry2 = { version = "0.5", features = ["jitter", "tracing"] } [build-dependencies] vergen = { version = "8.0.0", features = ["build", "git", "gitcl"] } - diff --git a/src/config.rs b/src/config.rs index fb82d2a..eed9658 100644 --- a/src/config.rs +++ b/src/config.rs @@ -23,7 +23,7 @@ pub struct AppConfig { #[clap(long, env, default_value_t = u64::MAX)] pub last_block_height: u64, - #[clap(long, env, default_value_t = 500)] + #[clap(long, env, default_value_t = 1000)] pub sleep_for: u64, #[clap(flatten)] diff --git a/src/main.rs b/src/main.rs index 5f35dce..78715b9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -157,7 +157,7 @@ async fn main() -> anyhow::Result<()> { } fn retry_strategy(max_delay_milis: u64) -> ExponentialBackoff { - ExponentialBackoff::from_millis(100) + ExponentialBackoff::from_millis(1000) .factor(1) .max_delay_millis(max_delay_milis) } diff --git a/src/metrics/fees.rs b/src/metrics/fees.rs index 2aa860e..ae9fba6 100644 --- a/src/metrics/fees.rs +++ b/src/metrics/fees.rs @@ -32,6 +32,7 @@ impl MetricTrait for Fees { fn reset(&self, state: &State) { let block = state.get_last_block(); + self.fees.reset(); for tx in &block.transactions { let amount_per_gas = tx.fee.amount_per_gas_unit.parse::(); let gas_limit = tx.fee.gas.parse::(); diff --git a/src/metrics/transfers.rs b/src/metrics/transfers.rs index d11288a..dd9ecf6 100644 --- a/src/metrics/transfers.rs +++ b/src/metrics/transfers.rs @@ -1,6 +1,6 @@ /// ## Transfer Amount (transfer_amount) -/// This metric tracks the total amount of tokens transferred per epoch. It helps monitor token movement trends and detect unusual -/// transfer activity. +/// This metric tracks the total amount of tokens transferred since the monitoring started. +/// It helps monitor token movement trends and detect unusual transfer activity. /// /// ### Example /// ``` diff --git a/src/rpc.rs b/src/rpc.rs index 955debc..ea0fc9c 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -168,6 +168,7 @@ impl Rpc { .collect(); let events_res = self.concurrent_requests(events_futures).await; + let events = events_res.map(BlockResult::from).context(format!( "Should be able to query for block events for height: {}", block_height @@ -387,8 +388,8 @@ impl Rpc { let (result, index, remaining) = futures::future::select_all(futures).await; match result { Ok(value) => return Some((index, value)), - Err(_e) => { - //tracing::error!("Error: {:?}", _e); + Err(e) => { + tracing::error!("Error: {:?}", e); futures = remaining } } From a9a9ffbd837e642ecd3f5b29b3df30afcf04dc86 Mon Sep 17 00:00:00 2001 From: Felipe Manzano Date: Mon, 7 Apr 2025 12:43:55 -0300 Subject: [PATCH 28/28] Make slashes alert trigger on increases (not just the first time) --- composer/provisioning/prometheus/namada-alerts.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer/provisioning/prometheus/namada-alerts.yml b/composer/provisioning/prometheus/namada-alerts.yml index 96b266f..1c3cb71 100644 --- a/composer/provisioning/prometheus/namada-alerts.yml +++ b/composer/provisioning/prometheus/namada-alerts.yml @@ -103,14 +103,14 @@ groups: - alert: HighSlashingRate expr: | - slashes{chain_id="$$CHAIN_ID$$"} > 0 + rate(namada_slashes{chain_id="$$CHAIN_ID$$"}[1m]) > 0 labels: severity: critical annotations: summary: "Unusual number of validator slashes - $$CHAIN_ID$$" description: | Slashing detected. - Block height: {{ with query "namada_block_height{chain_id=\"$$CHAIN_ID$$\"}" }}{{ printf "%.0f" (. | first | value) }}{{ end }} + Block height when the alert was processed: {{ with query "namada_block_height{chain_id=\"$$CHAIN_ID$$\"}" }}{{ printf "%.0f" (. | first | value) }}{{ end }} - alert: AbnormalConsensusValidatorChange expr: | @@ -184,7 +184,7 @@ groups: Block height: {{ with query "namada_block_height{chain_id=\"$$CHAIN_ID$$\"}" }}{{ printf "%.0f" (. | first | value) }}{{ end }} - alert: LowLevelAlert - expr: (namada_fee_alert{chain_id="$$CHAIN_ID$$"} > 0 unless namada_fee_alert{chain_id="$$CHAIN_ID$$"} offset 7s) + expr: (namada_fee_alert{chain_id="$$CHAIN_ID$$"} > 0 unless namada_fee_alert{chain_id="$$CHAIN_ID$$"} offset 5m) labels: severity: critical annotations: