From 3a66644f6c730c4bf5e107848fb708b510393331 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 30 Apr 2024 16:37:43 -0700 Subject: [PATCH] v1.17: corrected to not use hardcoded connections count for unstaked (backport of #633) (#762) * corrected to not use hardcoded connections count for unstaked (#633) Co-authored-by: Lijun Wang <83639177+lijunwangs@users.noreply.github.com> --- streamer/src/nonblocking/quic.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/streamer/src/nonblocking/quic.rs b/streamer/src/nonblocking/quic.rs index 17c85adcdb03ae..50c81ff509e938 100644 --- a/streamer/src/nonblocking/quic.rs +++ b/streamer/src/nonblocking/quic.rs @@ -1,6 +1,6 @@ use { crate::{ - quic::{configure_server, QuicServerError, StreamStats, MAX_UNSTAKED_CONNECTIONS}, + quic::{configure_server, QuicServerError, StreamStats}, streamer::StakedNodes, tls_certificates::get_pubkey_from_tls_certificate, }, @@ -748,7 +748,7 @@ fn max_streams_for_connection_in_100ms( } else { Percentage::from(MAX_UNSTAKED_STREAMS_PERCENT) .apply_to(max_streams_per_interval) - .saturating_div(MAX_UNSTAKED_CONNECTIONS as u64) + .saturating_div(max_unstaked_connections as u64) }; let min_staked_streams_per_100ms = if max_unstaked_connections == 0 {