From 5d140a4e7d35088c9ad87eb8dcae627485c0c035 Mon Sep 17 00:00:00 2001 From: Adrian Henry Date: Thu, 19 Mar 2026 17:20:20 +0000 Subject: [PATCH] fix: Reduce cache size for slot hashes --- rust/hyperstack-server/src/health.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rust/hyperstack-server/src/health.rs b/rust/hyperstack-server/src/health.rs index b6c046ac..fc75728b 100644 --- a/rust/hyperstack-server/src/health.rs +++ b/rust/hyperstack-server/src/health.rs @@ -39,11 +39,11 @@ impl SlotTracker { pub async fn record_slot_hash(&self, slot: u64, slot_hash: String) { let mut hashes = self.slot_hashes.write().await; hashes.insert(slot, slot_hash); - + // Prune old entries to prevent unbounded growth (keep last 10000 slots) let slots_to_remove: Vec = hashes .keys() - .filter(|&&s| s < slot.saturating_sub(10000)) + .filter(|&&s| s < slot.saturating_sub(1000)) .copied() .collect(); for s in slots_to_remove {