From eee5cab08f441f5ed92411794299e6f416b4dfe6 Mon Sep 17 00:00:00 2001 From: Lijun Wang <83639177+lijunwangs@users.noreply.github.com> Date: Sat, 15 Feb 2025 14:20:11 -0800 Subject: [PATCH] increased quic connection timeout (#29) * increased quic connection timeout and keep_alive interval to reduce ping traffic overhead * keep QUIC_KEEP_ALIVE for now --- quic-definitions/src/lib.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/quic-definitions/src/lib.rs b/quic-definitions/src/lib.rs index 24407321..1ddbd1c1 100644 --- a/quic-definitions/src/lib.rs +++ b/quic-definitions/src/lib.rs @@ -16,7 +16,14 @@ pub const QUIC_TOTAL_STAKED_CONCURRENT_STREAMS: usize = 100_000; // forwarded packets from staked nodes. pub const QUIC_MAX_STAKED_CONCURRENT_STREAMS: usize = 512; -pub const QUIC_MAX_TIMEOUT: Duration = Duration::from_secs(2); +/// QUIC connection idle timeout. The connection will be closed if +/// there are no activities on it within the timeout window. +pub const QUIC_MAX_TIMEOUT: Duration = Duration::from_secs(60); + +/// To avoid idle timeout, the QUIC endpoint sends a ping every +/// QUIC_KEEP_ALIVE. This shouldn't be too low to avoid unnecessary ping traffic. +/// For upgrade purpose, we keep the original one. Once the network is upgraded +/// to the one having higher QUIC_MAX_TIMEOUT, this value can be increased. pub const QUIC_KEEP_ALIVE: Duration = Duration::from_secs(1); // Disable Quic send fairness.