From e0fb1a759951f0beeeea4ea51bfd1b4e3b229eb9 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Sat, 2 Nov 2024 10:33:19 +0100 Subject: [PATCH] perf: cap default poll interval (#9250) --- crates/common/src/provider/mod.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/common/src/provider/mod.rs b/crates/common/src/provider/mod.rs index fe7fd4ccc9d91..4fb9e29aec0ce 100644 --- a/crates/common/src/provider/mod.rs +++ b/crates/common/src/provider/mod.rs @@ -270,6 +270,9 @@ impl ProviderBuilder { client.set_poll_interval( chain .average_blocktime_hint() + // we cap the poll interval because if not provided, chain would default to + // mainnet + .map(|hint| hint.min(DEFAULT_UNKNOWN_CHAIN_BLOCK_TIME)) .unwrap_or(DEFAULT_UNKNOWN_CHAIN_BLOCK_TIME) .mul_f32(POLL_INTERVAL_BLOCK_TIME_SCALE_FACTOR), );