From 0319dd0e5522ec3ec8db4d9fff818a4840c44b32 Mon Sep 17 00:00:00 2001 From: GroovieGermanikus Date: Tue, 10 Dec 2024 18:46:24 +0100 Subject: [PATCH 1/6] use nightly without explicit version for clippy --- .github/workflows/clippy_test.yml | 6 +++--- run_clippy_fmt.sh | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/clippy_test.yml b/.github/workflows/clippy_test.yml index 31617818..1c2727d5 100644 --- a/.github/workflows/clippy_test.yml +++ b/.github/workflows/clippy_test.yml @@ -28,7 +28,7 @@ jobs: - uses: actions-rust-lang/setup-rust-toolchain@v1 with: # use toolchain version from rust-toolchain.toml - toolchain: nightly-2023-10-05 + toolchain: nightly components: rustfmt, clippy cache: true # avoid the default "-D warnings" which thrashes cache @@ -48,5 +48,5 @@ jobs: - name: Run fmt+clippy run: | - cargo +nightly-2023-10-05 fmt --all --check - cargo +nightly-2023-10-05 clippy --locked --workspace --all-targets -- -D warnings + cargo +nightly fmt --all --check + cargo +nightly clippy --locked --workspace --all-targets -- -D warnings diff --git a/run_clippy_fmt.sh b/run_clippy_fmt.sh index 4b1c613b..2a037cc3 100755 --- a/run_clippy_fmt.sh +++ b/run_clippy_fmt.sh @@ -1,2 +1,2 @@ -cargo +nightly-2023-10-05 fmt --all -cargo +nightly-2023-10-05 clippy --locked --workspace --all-targets -- -D warnings \ No newline at end of file +cargo +nightly fmt --all +cargo +nightly clippy --locked --workspace --all-targets -- -D warnings \ No newline at end of file From 5cc78fe8d5cf5de077899dee4bdeda1f0ec9381d Mon Sep 17 00:00:00 2001 From: GroovieGermanikus Date: Tue, 10 Dec 2024 18:53:01 +0100 Subject: [PATCH 2/6] make cargo fmt happy --- util/src/histogram_percentiles.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/util/src/histogram_percentiles.rs b/util/src/histogram_percentiles.rs index 09df7fda..85d1a2c9 100644 --- a/util/src/histogram_percentiles.rs +++ b/util/src/histogram_percentiles.rs @@ -24,7 +24,6 @@ pub struct HistValue { } /// `quantile` function is the same as the median if q=50, the same as the minimum if q=0 and the same as the maximum if q=100. - pub fn calculate_percentiles(input: &[f64]) -> Percentiles { if input.is_empty() { // note: percentile for empty array is undefined From f90193d41cc4e8900f766a0d52f576ed619b7e28 Mon Sep 17 00:00:00 2001 From: GroovieGermanikus Date: Tue, 10 Dec 2024 19:04:35 +0100 Subject: [PATCH 3/6] make cargo fmt happy --- services/src/tpu_utils/quinn_auto_reconnect.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/src/tpu_utils/quinn_auto_reconnect.rs b/services/src/tpu_utils/quinn_auto_reconnect.rs index 32f05367..c1a81f45 100644 --- a/services/src/tpu_utils/quinn_auto_reconnect.rs +++ b/services/src/tpu_utils/quinn_auto_reconnect.rs @@ -8,7 +8,7 @@ use tokio::sync::RwLock; use tokio::time::timeout; use tracing::debug; -/// copy of quic-proxy AutoReconnect - used that for reference +// copy of quic-proxy AutoReconnect - used that for reference const SEND_TIMEOUT: Duration = Duration::from_secs(5); const MAX_RETRY_ATTEMPTS: u32 = 10; From 9acf68febacb62293e7b137720ede69d9fb170e2 Mon Sep 17 00:00:00 2001 From: GroovieGermanikus Date: Tue, 10 Dec 2024 20:10:14 +0100 Subject: [PATCH 4/6] make cargo fmt happy --- quic-forward-proxy/src/quinn_auto_reconnect.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/quic-forward-proxy/src/quinn_auto_reconnect.rs b/quic-forward-proxy/src/quinn_auto_reconnect.rs index fa528c18..5a5fc5b9 100644 --- a/quic-forward-proxy/src/quinn_auto_reconnect.rs +++ b/quic-forward-proxy/src/quinn_auto_reconnect.rs @@ -8,14 +8,14 @@ use tokio::sync::RwLock; use tokio::time::timeout; use tracing::debug; -/// connection manager with automatic reconnect; designated for connection to Solana TPU nodes -/// -/// assumptions: -/// * connection to TPU node is reliable -/// * manager and TPU nodes run both in data centers with fast internet connectivity -/// * ping times vary between 50ms and 400ms depending on the location -/// * TPU address might be wrong which then is a permanent problem -/// * the ActiveConnection instance gets renewed on leader schedule change +//! connection manager with automatic reconnect; designated for connection to Solana TPU nodes +//! +//! assumptions: +//! * connection to TPU node is reliable +//! * manager and TPU nodes run both in data centers with fast internet connectivity +//! * ping times vary between 50ms and 400ms depending on the location +//! * TPU address might be wrong which then is a permanent problem +//! * the ActiveConnection instance gets renewed on leader schedule change const SEND_TIMEOUT: Duration = Duration::from_secs(5); const MAX_RETRY_ATTEMPTS: u32 = 10; From 8d552fc52f405d4d5fe73be626c85b6db644f84e Mon Sep 17 00:00:00 2001 From: GroovieGermanikus Date: Tue, 10 Dec 2024 21:47:13 +0100 Subject: [PATCH 5/6] make cargo fmt happy --- quic-forward-proxy/src/quinn_auto_reconnect.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/quic-forward-proxy/src/quinn_auto_reconnect.rs b/quic-forward-proxy/src/quinn_auto_reconnect.rs index 5a5fc5b9..bb76430b 100644 --- a/quic-forward-proxy/src/quinn_auto_reconnect.rs +++ b/quic-forward-proxy/src/quinn_auto_reconnect.rs @@ -8,14 +8,14 @@ use tokio::sync::RwLock; use tokio::time::timeout; use tracing::debug; -//! connection manager with automatic reconnect; designated for connection to Solana TPU nodes -//! -//! assumptions: -//! * connection to TPU node is reliable -//! * manager and TPU nodes run both in data centers with fast internet connectivity -//! * ping times vary between 50ms and 400ms depending on the location -//! * TPU address might be wrong which then is a permanent problem -//! * the ActiveConnection instance gets renewed on leader schedule change +// connection manager with automatic reconnect; designated for connection to Solana TPU nodes +// +// assumptions: +// * connection to TPU node is reliable +// * manager and TPU nodes run both in data centers with fast internet connectivity +// * ping times vary between 50ms and 400ms depending on the location +// * TPU address might be wrong which then is a permanent problem +// * the ActiveConnection instance gets renewed on leader schedule change const SEND_TIMEOUT: Duration = Duration::from_secs(5); const MAX_RETRY_ATTEMPTS: u32 = 10; From fd49a74fe386dd99c6c02b49c09f5ff8bdd3d696 Mon Sep 17 00:00:00 2001 From: GroovieGermanikus Date: Tue, 10 Dec 2024 21:59:28 +0100 Subject: [PATCH 6/6] clippy+fmt --- bench/src/benchnew.rs | 1 - lite-rpc/src/cli.rs | 2 +- prioritization_fees/src/stats_calculation.rs | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/bench/src/benchnew.rs b/bench/src/benchnew.rs index f25bb743..04643eee 100644 --- a/bench/src/benchnew.rs +++ b/bench/src/benchnew.rs @@ -14,7 +14,6 @@ use clap::{Parser, Subcommand}; #[derive(Parser, Debug)] #[clap(version, about)] - struct Arguments { #[clap(subcommand)] subcommand: SubCommand, diff --git a/lite-rpc/src/cli.rs b/lite-rpc/src/cli.rs index ed20ea35..e2c0e592 100644 --- a/lite-rpc/src/cli.rs +++ b/lite-rpc/src/cli.rs @@ -331,7 +331,7 @@ impl Debug for GrpcSource { fn url_obfuscate_api_token(url: &str) -> Cow { if let Ok(mut parsed) = Url::parse(url) { if parsed.path() == "/" { - return Cow::Borrowed(url); + Cow::Borrowed(url) } else { parsed.set_path("omitted-secret"); Cow::Owned(parsed.to_string()) diff --git a/prioritization_fees/src/stats_calculation.rs b/prioritization_fees/src/stats_calculation.rs index 83f02010..0cce04d0 100644 --- a/prioritization_fees/src/stats_calculation.rs +++ b/prioritization_fees/src/stats_calculation.rs @@ -2,7 +2,7 @@ use crate::{prioritization_fee_data::PrioFeesData, rpc_data::FeePoint}; use itertools::Itertools; use std::iter::zip; -/// `quantile` function is the same as the median if q=50, the same as the minimum if q=0 and the same as the maximum if q=100. +// `quantile` function is the same as the median if q=50, the same as the minimum if q=0 and the same as the maximum if q=100. pub fn calculate_supp_percentiles( // Vec(prioritization_fees, cu_consumed)