Skip to content

Commit

Permalink
perf: cap default poll interval (foundry-rs#9250)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored and rplusq committed Nov 29, 2024
1 parent c6f1383 commit e0fb1a7
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 e0fb1a7

Please sign in to comment.