From 8a322955fab9d82682bb3c99eaf2ce485117e3ae Mon Sep 17 00:00:00 2001 From: Svyatoslav Nikolsky Date: Tue, 10 Jan 2023 08:34:28 +0300 Subject: [PATCH 1/7] expose relay version metric --- Cargo.lock | 2 + relays/bin-substrate/Cargo.toml | 1 + relays/bin-substrate/src/cli/mod.rs | 53 ++++++++++++++++--- relays/bin-substrate/src/cli/relay_headers.rs | 3 +- .../src/cli/relay_headers_and_messages/mod.rs | 2 +- .../bin-substrate/src/cli/relay_messages.rs | 2 +- .../bin-substrate/src/cli/relay_parachains.rs | 3 +- relays/utils/Cargo.toml | 1 + relays/utils/src/metrics.rs | 41 +++++++++++--- 9 files changed, 92 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fcbc05b6487..224f042b11b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8627,6 +8627,7 @@ dependencies = [ "jsonpath_lib", "log", "num-traits", + "semver 1.0.4", "serde_json", "sp-runtime", "substrate-prometheus-endpoint", @@ -11665,6 +11666,7 @@ dependencies = [ "relay-wococo-client", "rialto-parachain-runtime", "rialto-runtime", + "semver 1.0.4", "signal-hook", "signal-hook-async-std", "sp-core", diff --git a/relays/bin-substrate/Cargo.toml b/relays/bin-substrate/Cargo.toml index de1807cdc97..0fd0304b539 100644 --- a/relays/bin-substrate/Cargo.toml +++ b/relays/bin-substrate/Cargo.toml @@ -15,6 +15,7 @@ hex = "0.4" log = "0.4.17" num-format = "0.4" num-traits = "0.2" +semver = "1.0" structopt = "0.3" signal-hook = "0.3.14" signal-hook-async-std = "0.2.2" diff --git a/relays/bin-substrate/src/cli/mod.rs b/relays/bin-substrate/src/cli/mod.rs index e049a050c47..fbc06a1c06d 100644 --- a/relays/bin-substrate/src/cli/mod.rs +++ b/relays/bin-substrate/src/cli/mod.rs @@ -21,6 +21,7 @@ use std::convert::TryInto; use async_std::prelude::*; use codec::{Decode, Encode}; use futures::{select, FutureExt}; +use semver::Version; use signal_hook::consts::*; use signal_hook_async_std::Signals; use structopt::{clap::arg_enum, StructOpt}; @@ -254,17 +255,57 @@ pub struct PrometheusParams { pub prometheus_port: u16, } -impl From for relay_utils::metrics::MetricsParams { - fn from(cli_params: PrometheusParams) -> relay_utils::metrics::MetricsParams { - if !cli_params.no_prometheus { +impl PrometheusParams { + /// Tries to convert cli metrics params into metrics params, used by the relay. + pub fn into_metrics_params(self) -> anyhow::Result { + let metrics_address = if !self.no_prometheus { Some(relay_utils::metrics::MetricsAddress { - host: cli_params.prometheus_host, - port: cli_params.prometheus_port, + host: self.prometheus_host, + port: self.prometheus_port, }) .into() } else { None.into() - } + }; + + // let's not halt the relay if we were unable to detect package version or git commit - it + // maybe some local build with broken version + + let env_relay_version = option_env!("CARGO_PKG_VERSION").unwrap_or_else(|| { + log::debug!( + target: "bridge", + "Missing CARGO_PKG_VERSION variable while compiling. Using default value", + ); + + "0.0.0" + }); + let relay_version = Version::parse(&env_relay_version).unwrap_or_else(|e| { + log::debug!( + target: "bridge", + "Failed to parse CARGO_PKG_VERSION variable {}: {}", + env_relay_version, + e, + ); + + Version::new(0, 0, 0) + }); + + // we'll assume that we're running on GitLab, for local builds we don't care + let relay_commit = option_env!("CI_COMMIT_SHA").unwrap_or_else(|| { + log::debug!( + target: "bridge", + "Missing CARGO_PKG_VERSION variable while compiling. Using no-git value", + ); + + "no-git" + }); + + relay_utils::metrics::MetricsParams::new( + metrics_address, + relay_version.into(), + relay_commit.into(), + ) + .map_err(|e| anyhow::format_err!("{:?}", e)) } } diff --git a/relays/bin-substrate/src/cli/relay_headers.rs b/relays/bin-substrate/src/cli/relay_headers.rs index 37b805d720b..239ab8d62fd 100644 --- a/relays/bin-substrate/src/cli/relay_headers.rs +++ b/relays/bin-substrate/src/cli/relay_headers.rs @@ -77,7 +77,8 @@ where let target_transactions_mortality = data.target_sign.target_transactions_mortality; let target_sign = data.target_sign.to_keypair::()?; - let metrics_params: relay_utils::metrics::MetricsParams = data.prometheus_params.into(); + let metrics_params: relay_utils::metrics::MetricsParams = + data.prometheus_params.into_metrics_params()?; GlobalMetrics::new()?.register_and_spawn(&metrics_params.registry)?; let target_transactions_params = substrate_relay_helper::TransactionParams { diff --git a/relays/bin-substrate/src/cli/relay_headers_and_messages/mod.rs b/relays/bin-substrate/src/cli/relay_headers_and_messages/mod.rs index fd8a032066d..ea6d6ad9f51 100644 --- a/relays/bin-substrate/src/cli/relay_headers_and_messages/mod.rs +++ b/relays/bin-substrate/src/cli/relay_headers_and_messages/mod.rs @@ -110,7 +110,7 @@ impl, ) -> anyhow::Result { // Create metrics registry. - let metrics_params = shared.prometheus_params.clone().into(); + let metrics_params = shared.prometheus_params.clone().into_metrics_params()?; let metrics_params = relay_utils::relay_metrics(metrics_params).into_params(); Ok(Self { shared, left, right, metrics_params }) diff --git a/relays/bin-substrate/src/cli/relay_messages.rs b/relays/bin-substrate/src/cli/relay_messages.rs index 6af042670e7..e0250ef1e47 100644 --- a/relays/bin-substrate/src/cli/relay_messages.rs +++ b/relays/bin-substrate/src/cli/relay_messages.rs @@ -83,7 +83,7 @@ where source_to_target_headers_relay: None, target_to_source_headers_relay: None, lane_id: data.lane.into(), - metrics_params: data.prometheus_params.into(), + metrics_params: data.prometheus_params.into_metrics_params()?, }) .await .map_err(|e| anyhow::format_err!("{}", e)) diff --git a/relays/bin-substrate/src/cli/relay_parachains.rs b/relays/bin-substrate/src/cli/relay_parachains.rs index 1a0bba3fd1f..1234b3a3309 100644 --- a/relays/bin-substrate/src/cli/relay_parachains.rs +++ b/relays/bin-substrate/src/cli/relay_parachains.rs @@ -98,7 +98,8 @@ where target_transaction_params, ); - let metrics_params: relay_utils::metrics::MetricsParams = data.prometheus_params.into(); + let metrics_params: relay_utils::metrics::MetricsParams = + data.prometheus_params.into_metrics_params()?; GlobalMetrics::new()?.register_and_spawn(&metrics_params.registry)?; parachains_relay::parachains_loop::run( diff --git a/relays/utils/Cargo.toml b/relays/utils/Cargo.toml index 09cec370900..927a3eb8a05 100644 --- a/relays/utils/Cargo.toml +++ b/relays/utils/Cargo.toml @@ -17,6 +17,7 @@ futures = "0.3.5" jsonpath_lib = "0.2" log = "0.4.17" num-traits = "0.2" +semver = "1.0" serde_json = "1.0" sysinfo = "0.15" time = { version = "0.3", features = ["formatting", "local-offset", "std"] } diff --git a/relays/utils/src/metrics.rs b/relays/utils/src/metrics.rs index fa7a79a71c1..2549cbd68b6 100644 --- a/relays/utils/src/metrics.rs +++ b/relays/utils/src/metrics.rs @@ -23,6 +23,7 @@ pub use substrate_prometheus_endpoint::{ use async_std::sync::{Arc, RwLock}; use async_trait::async_trait; +use semver::Version; use std::{fmt::Debug, time::Duration}; mod float_json_value; @@ -99,6 +100,40 @@ impl Default for MetricsAddress { } impl MetricsParams { + /// Creates metrics params from metrics address. + pub fn new( + address: Option, + relay_version: Version, + relay_commit: String, + ) -> Result { + const BUILD_INFO_METRIC: &'static str = "substrate_relay_build_info"; + + let registry = Registry::new(); + let relay_version = format!("{}", relay_version); + register( + Gauge::::with_opts( + Opts::new( + BUILD_INFO_METRIC, + "A metric with a constant '1' value labeled by version", + ) + .const_label("version", &relay_version) + .const_label("commit", &relay_commit), + )?, + ®istry, + )? + .set(1); + + log::info!( + target: "bridge", + "Exposed {} metrtic: version={} commit={}", + BUILD_INFO_METRIC, + relay_version, + relay_commit, + ); + + Ok(MetricsParams { address, registry }) + } + /// Creates metrics params so that metrics are not exposed. pub fn disabled() -> Self { MetricsParams { address: None, registry: Registry::new() } @@ -112,12 +147,6 @@ impl MetricsParams { } } -impl From> for MetricsParams { - fn from(address: Option) -> Self { - MetricsParams { address, registry: Registry::new() } - } -} - /// Returns metric name optionally prefixed with given prefix. pub fn metric_name(prefix: Option<&str>, name: &str) -> String { if let Some(prefix) = prefix { From b3fa1c27ae2505650e277af6c2b6dc7a175c4e14 Mon Sep 17 00:00:00 2001 From: Svyatoslav Nikolsky Date: Tue, 10 Jan 2023 08:39:55 +0300 Subject: [PATCH 2/7] spelling --- relays/bin-substrate/src/cli/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/relays/bin-substrate/src/cli/mod.rs b/relays/bin-substrate/src/cli/mod.rs index fbc06a1c06d..fe67c48ff6f 100644 --- a/relays/bin-substrate/src/cli/mod.rs +++ b/relays/bin-substrate/src/cli/mod.rs @@ -256,7 +256,7 @@ pub struct PrometheusParams { } impl PrometheusParams { - /// Tries to convert cli metrics params into metrics params, used by the relay. + /// Tries to convert CLI metrics params into metrics params, used by the relay. pub fn into_metrics_params(self) -> anyhow::Result { let metrics_address = if !self.no_prometheus { Some(relay_utils::metrics::MetricsAddress { From 7f21777b0e66d5a8655374ddaa145625bfa6f90d Mon Sep 17 00:00:00 2001 From: Svyatoslav Nikolsky Date: Tue, 10 Jan 2023 09:18:56 +0300 Subject: [PATCH 3/7] and clippy --- relays/utils/src/metrics.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/relays/utils/src/metrics.rs b/relays/utils/src/metrics.rs index 2549cbd68b6..a2ecc80792e 100644 --- a/relays/utils/src/metrics.rs +++ b/relays/utils/src/metrics.rs @@ -106,10 +106,10 @@ impl MetricsParams { relay_version: Version, relay_commit: String, ) -> Result { - const BUILD_INFO_METRIC: &'static str = "substrate_relay_build_info"; + const BUILD_INFO_METRIC: &str = "substrate_relay_build_info"; let registry = Registry::new(); - let relay_version = format!("{}", relay_version); + let relay_version = format!("{relay_version}"); register( Gauge::::with_opts( Opts::new( From 144daf2c47618a8fac11b2be3823a7cd5f7b990c Mon Sep 17 00:00:00 2001 From: Svyatoslav Nikolsky Date: Tue, 10 Jan 2023 09:50:59 +0300 Subject: [PATCH 4/7] clippy --- relays/bin-substrate/src/cli/mod.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/relays/bin-substrate/src/cli/mod.rs b/relays/bin-substrate/src/cli/mod.rs index fe67c48ff6f..10615dd4758 100644 --- a/relays/bin-substrate/src/cli/mod.rs +++ b/relays/bin-substrate/src/cli/mod.rs @@ -263,9 +263,8 @@ impl PrometheusParams { host: self.prometheus_host, port: self.prometheus_port, }) - .into() } else { - None.into() + None }; // let's not halt the relay if we were unable to detect package version or git commit - it @@ -279,7 +278,7 @@ impl PrometheusParams { "0.0.0" }); - let relay_version = Version::parse(&env_relay_version).unwrap_or_else(|e| { + let relay_version = Version::parse(env_relay_version).unwrap_or_else(|e| { log::debug!( target: "bridge", "Failed to parse CARGO_PKG_VERSION variable {}: {}", @@ -302,7 +301,7 @@ impl PrometheusParams { relay_utils::metrics::MetricsParams::new( metrics_address, - relay_version.into(), + relay_version, relay_commit.into(), ) .map_err(|e| anyhow::format_err!("{:?}", e)) From 2b34caa6f0f972656d5ccbb62d29be57eee3984e Mon Sep 17 00:00:00 2001 From: Svyatoslav Nikolsky Date: Tue, 10 Jan 2023 12:27:41 +0300 Subject: [PATCH 5/7] typo --- relays/bin-substrate/src/cli/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/relays/bin-substrate/src/cli/mod.rs b/relays/bin-substrate/src/cli/mod.rs index 10615dd4758..8e4008072e9 100644 --- a/relays/bin-substrate/src/cli/mod.rs +++ b/relays/bin-substrate/src/cli/mod.rs @@ -293,7 +293,7 @@ impl PrometheusParams { let relay_commit = option_env!("CI_COMMIT_SHA").unwrap_or_else(|| { log::debug!( target: "bridge", - "Missing CARGO_PKG_VERSION variable while compiling. Using no-git value", + "Missing CI_COMMIT_SHA variable while compiling. Using no-git value", ); "no-git" From 7751233ef39bcdd96596f4fcc53e05bae6824771 Mon Sep 17 00:00:00 2001 From: Svyatoslav Nikolsky Date: Tue, 10 Jan 2023 16:44:41 +0300 Subject: [PATCH 6/7] use version directly and determine git commit --- Cargo.lock | 436 ++++++++++++++++------------ relays/bin-substrate/Cargo.toml | 2 +- relays/bin-substrate/src/cli/mod.rs | 42 +-- relays/utils/Cargo.toml | 1 - relays/utils/src/metrics.rs | 3 +- 5 files changed, 255 insertions(+), 229 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 224f042b11b..86c74a4688d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -184,8 +184,8 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3203e79f4dd9bdda415ed03cf14dae5a2bf775c683a00f94e9cd1faf0f596e5" dependencies = [ - "quote", - "syn", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -339,9 +339,9 @@ version = "0.1.58" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e805d94e6b5001b651426cf4cd446b1ab5f319d27bab5c644f61de0a804360c" dependencies = [ - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -563,8 +563,8 @@ dependencies = [ "lazy_static", "lazycell", "peeking_take_while", - "proc-macro2", - "quote", + "proc-macro2 1.0.47", + "quote 1.0.21", "regex", "rustc-hash", "shlex", @@ -1296,9 +1296,9 @@ checksum = "0177313f9f02afc995627906bbd8967e2be069f5261954222dac78290c2b9014" dependencies = [ "heck 0.4.0", "proc-macro-error", - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -1628,8 +1628,8 @@ version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ccc0a48a9b826acdf4028595adc9db92caea352f7af011a3034acd172a52a0aa" dependencies = [ - "quote", - "syn", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -1864,9 +1864,9 @@ version = "0.1.0" source = "git+https://github.com/paritytech//cumulus?branch=cumulus-locked-for-gav-xcm-v3-and-bridges#6ece1b652f805ffa7bd0052c77a38bd9fce11542" dependencies = [ "proc-macro-crate", - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -2176,10 +2176,10 @@ dependencies = [ "cc", "codespan-reporting", "once_cell", - "proc-macro2", - "quote", + "proc-macro2 1.0.47", + "quote 1.0.21", "scratch", - "syn", + "syn 1.0.103", ] [[package]] @@ -2194,9 +2194,9 @@ version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a08a6e2fcc370a089ad3b4aaf54db3b1b4cee38ddabce5896b33eb693275f470" dependencies = [ - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -2222,7 +2222,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a5bbed42daaa95e780b60a50546aa345b8413a1e46f9a40a12907d3598f038db" dependencies = [ "data-encoding", - "syn", + "syn 1.0.103", ] [[package]] @@ -2240,9 +2240,9 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -2252,10 +2252,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ "convert_case", - "proc-macro2", - "quote", + "proc-macro2 1.0.47", + "quote 1.0.21", "rustc_version 0.4.0", - "syn", + "syn 1.0.103", ] [[package]] @@ -2384,9 +2384,9 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "558e40ea573c374cf53507fd240b7ee2f5477df7cfebdb97323ec61c719399c5" dependencies = [ - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -2484,9 +2484,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c9720bba047d567ffc8a3cba48bf19126600e249ab7f128e9233e6376976a116" dependencies = [ "heck 0.4.0", - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -2504,9 +2504,9 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f58dc3c5e468259f19f2d46304a6b28f1c3d034442e14b322d2b850e36f6d5ae" dependencies = [ - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -2515,9 +2515,9 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "038b1afa59052df211f9efd58f8b1d84c242935ede1c3dbaed26b018a9e06ae2" dependencies = [ - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -2636,8 +2636,8 @@ checksum = "a718c0675c555c5f976fff4ea9e2c150fa06cefa201cadef87cfbf9324075881" dependencies = [ "blake3", "fs-err", - "proc-macro2", - "quote", + "proc-macro2 1.0.47", + "quote 1.0.21", ] [[package]] @@ -2648,9 +2648,9 @@ checksum = "3774182a5df13c3d1690311ad32fbe913feef26baba609fa2dd5f72042bd2ab6" dependencies = [ "blake2", "fs-err", - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -2693,9 +2693,9 @@ dependencies = [ "expander 0.0.4", "indexmap", "proc-macro-crate", - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", "thiserror", ] @@ -2932,9 +2932,9 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech//substrate?branch=sv-locked-for-gav-xcm-v3-and-bridges#87f3fdea8f227d33322c439d45a9e1796637e972" dependencies = [ "proc-macro-crate", - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -3022,9 +3022,9 @@ dependencies = [ "cfg-expr", "frame-support-procedural-tools", "itertools", - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -3034,9 +3034,9 @@ source = "git+https://github.com/paritytech//substrate?branch=sv-locked-for-gav- dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -3044,9 +3044,9 @@ name = "frame-support-procedural-tools-derive" version = "3.0.0" source = "git+https://github.com/paritytech//substrate?branch=sv-locked-for-gav-xcm-v3-and-bridges#87f3fdea8f227d33322c439d45a9e1796637e972" dependencies = [ - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -3201,9 +3201,9 @@ version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42cd15d1c7456c04dbdf7e88bcd69760d74f3a798d6444e16974b505b0e62f17" dependencies = [ - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -3704,9 +3704,9 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" dependencies = [ - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -3946,9 +3946,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd67957d4280217247588ac86614ead007b301ca2fa9f19c19f880a536f029e3" dependencies = [ "proc-macro-crate", - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -4473,8 +4473,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a0eddc4497a8b5a506013c40e8189864f9c3a00db2b25671f428ae9007f3ba32" dependencies = [ "heck 0.4.0", - "quote", - "syn", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -5035,9 +5035,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "832663583d5fa284ca8810bf7015e46c9fff9622d3cf34bd1eea5003fec06dd0" dependencies = [ "cfg-if 1.0.0", - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -5094,9 +5094,9 @@ checksum = "fc076939022111618a5026d3be019fd8b366e76314538ff9a1b59ffbcbf98bcd" dependencies = [ "proc-macro-crate", "proc-macro-error", - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", "synstructure", ] @@ -5144,9 +5144,9 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01fcc0b8149b4632adc89ac3b7b31a12fb6099a0317a4eb2ebff574ef7de7218" dependencies = [ - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -5485,9 +5485,9 @@ dependencies = [ "itertools", "petgraph", "proc-macro-crate", - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -6316,9 +6316,9 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech//substrate?branch=sv-locked-for-gav-xcm-v3-and-bridges#87f3fdea8f227d33322c439d45a9e1796637e972" dependencies = [ "proc-macro-crate", - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -6574,9 +6574,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9299338969a3d2f491d65f140b00ddec470858402f888af98e8642fb5e8965cd" dependencies = [ "proc-macro-crate", - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -6609,8 +6609,8 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f557c32c6d268a07c921471619c0295f5efad3a0e76d4f97a05c091a51d110b2" dependencies = [ - "proc-macro2", - "syn", + "proc-macro2 1.0.47", + "syn 1.0.103", "synstructure", ] @@ -6737,9 +6737,9 @@ checksum = "99b8db626e31e5b81787b9783425769681b347011cc59471e33ea46d2ea0cf55" dependencies = [ "pest", "pest_meta", - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -6778,9 +6778,9 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -7549,7 +7549,7 @@ dependencies = [ "polkadot-erasure-coding", "polkadot-node-core-pvf", "polkadot-node-primitives", - "quote", + "quote 1.0.21", "thiserror", ] @@ -8058,9 +8058,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", "version_check", ] @@ -8070,11 +8070,20 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.47", + "quote 1.0.21", "version_check", ] +[[package]] +name = "proc-macro2" +version = "0.4.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" +dependencies = [ + "unicode-xid 0.1.0", +] + [[package]] name = "proc-macro2" version = "1.0.47" @@ -8116,9 +8125,9 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "66a455fbcb954c1a7decf3c586e860fd7889cddf4b8e164be736dbac95a953cd" dependencies = [ - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -8172,9 +8181,9 @@ checksum = "7345d5f0e08c0536d7ac7229952590239e77abf0a0100a1b1d890add6ea96364" dependencies = [ "anyhow", "itertools", - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -8219,13 +8228,22 @@ dependencies = [ "pin-project-lite 0.1.12", ] +[[package]] +name = "quote" +version = "0.6.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" +dependencies = [ + "proc-macro2 0.4.30", +] + [[package]] name = "quote" version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" dependencies = [ - "proc-macro2", + "proc-macro2 1.0.47", ] [[package]] @@ -8365,6 +8383,26 @@ dependencies = [ "num_cpus", ] +[[package]] +name = "rbtag" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72c64936fcc0b811890a9d90020f3df5cec9c604efde88af7db6a35d365132a3" +dependencies = [ + "rbtag_derive", +] + +[[package]] +name = "rbtag_derive" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b75511b710ccca8adbb211e04763bd8c78fed585b0ec188a20ed9b0dd95567c4" +dependencies = [ + "proc-macro2 0.4.30", + "quote 0.6.13", + "syn 0.15.44", +] + [[package]] name = "redox_syscall" version = "0.2.10" @@ -8412,9 +8450,9 @@ version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c38e3aecd2b21cb3959637b883bb3714bc7e43f0268b9a29d3743ee3e55cdd2" dependencies = [ - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -8627,7 +8665,6 @@ dependencies = [ "jsonpath_lib", "log", "num-traits", - "semver 1.0.4", "serde_json", "sp-runtime", "substrate-prometheus-endpoint", @@ -9193,9 +9230,9 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech//substrate?branch=sv-locked-for-gav-xcm-v3-and-bridges#87f3fdea8f227d33322c439d45a9e1796637e972" dependencies = [ "proc-macro-crate", - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -10113,9 +10150,9 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech//substrate?branch=sv-locked-for-gav-xcm-v3-and-bridges#87f3fdea8f227d33322c439d45a9e1796637e972" dependencies = [ "proc-macro-crate", - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -10193,9 +10230,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdcd47b380d8c4541044e341dcd9475f55ba37ddc50c908d945fc036a8642496" dependencies = [ "proc-macro-crate", - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -10359,9 +10396,9 @@ version = "1.0.144" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94ed3a816fb1d101812f83e789f888322c34e291f894f19590dc310963e87a00" dependencies = [ - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -10648,9 +10685,9 @@ source = "git+https://github.com/paritytech//substrate?branch=sv-locked-for-gav- dependencies = [ "blake2", "proc-macro-crate", - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -10888,10 +10925,10 @@ name = "sp-core-hashing-proc-macro" version = "5.0.0" source = "git+https://github.com/paritytech//substrate?branch=sv-locked-for-gav-xcm-v3-and-bridges#87f3fdea8f227d33322c439d45a9e1796637e972" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.47", + "quote 1.0.21", "sp-core-hashing", - "syn", + "syn 1.0.103", ] [[package]] @@ -10908,9 +10945,9 @@ name = "sp-debug-derive" version = "4.0.0" source = "git+https://github.com/paritytech//substrate?branch=sv-locked-for-gav-xcm-v3-and-bridges#87f3fdea8f227d33322c439d45a9e1796637e972" dependencies = [ - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -11127,9 +11164,9 @@ source = "git+https://github.com/paritytech//substrate?branch=sv-locked-for-gav- dependencies = [ "Inflector", "proc-macro-crate", - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -11323,9 +11360,9 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech//substrate?branch=sv-locked-for-gav-xcm-v3-and-bridges#87f3fdea8f227d33322c439d45a9e1796637e972" dependencies = [ "parity-scale-codec", - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -11381,11 +11418,11 @@ checksum = "1de151faef619cb7b5c26b32d42bc7ddccac0d202beb7a84344b44e9232b92f7" dependencies = [ "Inflector", "num-format", - "proc-macro2", - "quote", + "proc-macro2 1.0.47", + "quote 1.0.21", "serde", "serde_json", - "unicode-xid", + "unicode-xid 0.2.2", ] [[package]] @@ -11435,9 +11472,9 @@ checksum = "f2261c91034a1edc3fc4d1b80e89d82714faede0515c14a75da10cb941546bbf" dependencies = [ "cfg_aliases", "memchr", - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -11448,9 +11485,9 @@ checksum = "70a2595fc3aa78f2d0e45dd425b22282dd863273761cc77780914b2cf3003acf" dependencies = [ "cfg_aliases", "memchr", - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -11512,9 +11549,9 @@ checksum = "dcb5ae327f9cc13b68763b5749770cb9e048a99bd9dfdfa58d0cf05d5f64afe0" dependencies = [ "heck 0.3.3", "proc-macro-error", - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -11542,9 +11579,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d06aaeeee809dbc59eb4556183dd927df67db1540de5be8d3ec0b6636358a5ec" dependencies = [ "heck 0.3.3", - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -11554,10 +11591,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6878079b17446e4d3eba6192bb0a2950d5b14f0ed8424b852310e5a94345d0ef" dependencies = [ "heck 0.4.0", - "proc-macro2", - "quote", + "proc-macro2 1.0.47", + "quote 1.0.21", "rustversion", - "syn", + "syn 1.0.103", ] [[package]] @@ -11654,6 +11691,7 @@ dependencies = [ "polkadot-primitives", "polkadot-runtime-common", "polkadot-runtime-parachains", + "rbtag", "relay-bridge-hub-rococo-client", "relay-bridge-hub-wococo-client", "relay-millau-client", @@ -11666,7 +11704,6 @@ dependencies = [ "relay-wococo-client", "rialto-parachain-runtime", "rialto-runtime", - "semver 1.0.4", "signal-hook", "signal-hook-async-std", "sp-core", @@ -11782,14 +11819,25 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +[[package]] +name = "syn" +version = "0.15.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" +dependencies = [ + "proc-macro2 0.4.30", + "quote 0.6.13", + "unicode-xid 0.1.0", +] + [[package]] name = "syn" version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d" dependencies = [ - "proc-macro2", - "quote", + "proc-macro2 1.0.47", + "quote 1.0.21", "unicode-ident", ] @@ -11799,10 +11847,10 @@ version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ - "proc-macro2", - "quote", - "syn", - "unicode-xid", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", + "unicode-xid 0.2.2", ] [[package]] @@ -11908,9 +11956,9 @@ version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" dependencies = [ - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -12052,9 +12100,9 @@ version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b557f72f448c511a979e2564e55d74e6c4432fc96ff4f6241bc6bded342643b7" dependencies = [ - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -12141,9 +12189,9 @@ version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" dependencies = [ - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -12184,9 +12232,9 @@ source = "git+https://github.com/paritytech//polkadot?branch=locked-for-gav-xcm- dependencies = [ "expander 0.0.6", "proc-macro-crate", - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -12414,6 +12462,12 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" +[[package]] +name = "unicode-xid" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" + [[package]] name = "unicode-xid" version = "0.2.2" @@ -12563,9 +12617,9 @@ dependencies = [ "bumpalo", "lazy_static", "log", - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", "wasm-bindgen-shared", ] @@ -12587,7 +12641,7 @@ version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9" dependencies = [ - "quote", + "quote 1.0.21", "wasm-bindgen-macro-support", ] @@ -12597,9 +12651,9 @@ version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab" dependencies = [ - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -13248,9 +13302,9 @@ version = "0.9.31" source = "git+https://github.com/paritytech//polkadot?branch=locked-for-gav-xcm-v3-and-bridges#9fc6b88ccc7abc1418ff5260e8cc492e647306a0" dependencies = [ "Inflector", - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", ] [[package]] @@ -13282,9 +13336,9 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f8f187641dad4f680d25c4bfc4225b418165984179f26ca76ec4fb6441d3a17" dependencies = [ - "proc-macro2", - "quote", - "syn", + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.103", "synstructure", ] diff --git a/relays/bin-substrate/Cargo.toml b/relays/bin-substrate/Cargo.toml index 0fd0304b539..ba6a7884b44 100644 --- a/relays/bin-substrate/Cargo.toml +++ b/relays/bin-substrate/Cargo.toml @@ -15,7 +15,7 @@ hex = "0.4" log = "0.4.17" num-format = "0.4" num-traits = "0.2" -semver = "1.0" +rbtag = "0.3" structopt = "0.3" signal-hook = "0.3.14" signal-hook-async-std = "0.2.2" diff --git a/relays/bin-substrate/src/cli/mod.rs b/relays/bin-substrate/src/cli/mod.rs index 8e4008072e9..9081a397b6b 100644 --- a/relays/bin-substrate/src/cli/mod.rs +++ b/relays/bin-substrate/src/cli/mod.rs @@ -21,7 +21,7 @@ use std::convert::TryInto; use async_std::prelude::*; use codec::{Decode, Encode}; use futures::{select, FutureExt}; -use semver::Version; +use rbtag::BuildInfo; use signal_hook::consts::*; use signal_hook_async_std::Signals; use structopt::{clap::arg_enum, StructOpt}; @@ -255,6 +255,10 @@ pub struct PrometheusParams { pub prometheus_port: u16, } +/// Struct to get git commit info and build time. +#[derive(BuildInfo)] +struct SubstrateRelayBuildInfo; + impl PrometheusParams { /// Tries to convert CLI metrics params into metrics params, used by the relay. pub fn into_metrics_params(self) -> anyhow::Result { @@ -267,41 +271,11 @@ impl PrometheusParams { None }; - // let's not halt the relay if we were unable to detect package version or git commit - it - // maybe some local build with broken version - - let env_relay_version = option_env!("CARGO_PKG_VERSION").unwrap_or_else(|| { - log::debug!( - target: "bridge", - "Missing CARGO_PKG_VERSION variable while compiling. Using default value", - ); - - "0.0.0" - }); - let relay_version = Version::parse(env_relay_version).unwrap_or_else(|e| { - log::debug!( - target: "bridge", - "Failed to parse CARGO_PKG_VERSION variable {}: {}", - env_relay_version, - e, - ); - - Version::new(0, 0, 0) - }); - - // we'll assume that we're running on GitLab, for local builds we don't care - let relay_commit = option_env!("CI_COMMIT_SHA").unwrap_or_else(|| { - log::debug!( - target: "bridge", - "Missing CI_COMMIT_SHA variable while compiling. Using no-git value", - ); - - "no-git" - }); - + let relay_version = option_env!("CARGO_PKG_VERSION").unwrap_or("unknown"); + let relay_commit = SubstrateRelayBuildInfo.get_build_commit(); relay_utils::metrics::MetricsParams::new( metrics_address, - relay_version, + relay_version.into(), relay_commit.into(), ) .map_err(|e| anyhow::format_err!("{:?}", e)) diff --git a/relays/utils/Cargo.toml b/relays/utils/Cargo.toml index 927a3eb8a05..09cec370900 100644 --- a/relays/utils/Cargo.toml +++ b/relays/utils/Cargo.toml @@ -17,7 +17,6 @@ futures = "0.3.5" jsonpath_lib = "0.2" log = "0.4.17" num-traits = "0.2" -semver = "1.0" serde_json = "1.0" sysinfo = "0.15" time = { version = "0.3", features = ["formatting", "local-offset", "std"] } diff --git a/relays/utils/src/metrics.rs b/relays/utils/src/metrics.rs index a2ecc80792e..dcc92f94fbf 100644 --- a/relays/utils/src/metrics.rs +++ b/relays/utils/src/metrics.rs @@ -23,7 +23,6 @@ pub use substrate_prometheus_endpoint::{ use async_std::sync::{Arc, RwLock}; use async_trait::async_trait; -use semver::Version; use std::{fmt::Debug, time::Duration}; mod float_json_value; @@ -103,7 +102,7 @@ impl MetricsParams { /// Creates metrics params from metrics address. pub fn new( address: Option, - relay_version: Version, + relay_version: String, relay_commit: String, ) -> Result { const BUILD_INFO_METRIC: &str = "substrate_relay_build_info"; From bec3f4c68323d2f12011687298cfb20ae1a653ad Mon Sep 17 00:00:00 2001 From: Svyatoslav Nikolsky Date: Wed, 11 Jan 2023 09:22:56 +0300 Subject: [PATCH 7/7] typos and leftovers --- relays/utils/src/metrics.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/relays/utils/src/metrics.rs b/relays/utils/src/metrics.rs index dcc92f94fbf..2e6c8236da4 100644 --- a/relays/utils/src/metrics.rs +++ b/relays/utils/src/metrics.rs @@ -108,7 +108,6 @@ impl MetricsParams { const BUILD_INFO_METRIC: &str = "substrate_relay_build_info"; let registry = Registry::new(); - let relay_version = format!("{relay_version}"); register( Gauge::::with_opts( Opts::new( @@ -124,7 +123,7 @@ impl MetricsParams { log::info!( target: "bridge", - "Exposed {} metrtic: version={} commit={}", + "Exposed {} metric: version={} commit={}", BUILD_INFO_METRIC, relay_version, relay_commit,