Skip to content

Commit

Permalink
perf: cap default poll interval (#9250)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Nov 2, 2024
1 parent 56639cd commit 97be9b9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/common/src/provider/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
);
Expand Down

0 comments on commit 97be9b9

Please sign in to comment.