Skip to content

Commit

Permalink
chore: new retryable ratelimit error
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse committed Jan 9, 2024
1 parent 4adcae5 commit 15b26de
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/common/src/provider/retry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ fn should_retry_json_rpc_error(error: &ErrorPayload) -> bool {
return true
}

if *code == -32005 && message.contains("archive request rate exceeded") {
return true
}

// quick node rate limit error: `100/second request limit reached - reduce calls per second or
// upgrade your account at quicknode.com` <https://github.com/foundry-rs/foundry/issues/4894>
if *code == -32007 && message.contains("request limit reached") {
Expand All @@ -97,6 +101,7 @@ fn should_retry_json_rpc_error(error: &ErrorPayload) -> bool {
"daily request count exceeded, request rate limited" => true,
msg => {
msg.contains("rate limit") ||
msg.contains("rate exceeded") ||
msg.contains("too many requests") ||
msg.contains("request limit")
}
Expand Down

0 comments on commit 15b26de

Please sign in to comment.