From 5795c0adee7d4981897a1af06729390b1c3669f1 Mon Sep 17 00:00:00 2001 From: Alex Kvartz Date: Mon, 23 Mar 2026 11:07:53 -0400 Subject: [PATCH] Update heartbeat-boot.patch for upstream heartbeat.rs changes Upstream snarkOS renamed HEARTBEAT_IN_SECS to HEARTBEAT_INTERVAL and added MINIMUM_TIME_BETWEEN_CONNECTION_ATTEMPTS and STARTUP_GRACE_PERIOD constants, which shifted context lines and broke git apply. --- patches/heartbeat-boot.patch | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/patches/heartbeat-boot.patch b/patches/heartbeat-boot.patch index 002ea70..3b5a1a6 100644 --- a/patches/heartbeat-boot.patch +++ b/patches/heartbeat-boot.patch @@ -2,11 +2,13 @@ diff --git a/node/router/src/heartbeat.rs b/node/router/src/heartbeat.rs --- a/node/router/src/heartbeat.rs +++ b/node/router/src/heartbeat.rs @@ -39,13 +39,13 @@ pub trait Heartbeat: Outbound { - /// The duration in seconds to sleep in between heartbeat executions. - const HEARTBEAT_IN_SECS: u64 = 25; // 25 seconds /// The minimum number of peers required to maintain connections with. - const MINIMUM_NUMBER_OF_PEERS: usize = 3; + const MINIMUM_NUMBER_OF_PEERS: usize = 4; + /// The minimum time between connection attempts to a peer. + const MINIMUM_TIME_BETWEEN_CONNECTION_ATTEMPTS: Duration = Duration::from_secs(10); + /// The time we consider the node to be starting up and avoid certain warnings such as "No connected peers". + const STARTUP_GRACE_PERIOD: Duration = Duration::from_secs(60); /// The median number of peers to maintain connections with. const MEDIAN_NUMBER_OF_PEERS: usize = max(Self::MAXIMUM_NUMBER_OF_PEERS / 2, Self::MINIMUM_NUMBER_OF_PEERS); /// The maximum number of peers permitted to maintain connections with. @@ -18,4 +20,3 @@ diff --git a/node/router/src/heartbeat.rs b/node/router/src/heartbeat.rs /// The amount of time an IP address is prohibited from connecting. - const IP_BAN_TIME_IN_SECS: u64 = 300; + const IP_BAN_TIME_IN_SECS: u64 = 600; -