From f886d379a4fe273d8a828e1ef7a2d2fd5c5e14aa Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Fri, 2 Dec 2022 22:30:56 +0100 Subject: [PATCH] feat: add infura error code to retry detection (#1921) --- ethers-providers/src/transports/retry.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ethers-providers/src/transports/retry.rs b/ethers-providers/src/transports/retry.rs index cba50972..005fe0b5 100644 --- a/ethers-providers/src/transports/retry.rs +++ b/ethers-providers/src/transports/retry.rs @@ -354,6 +354,11 @@ impl RetryPolicy for HttpRateLimitRetryPolicy { return true } + // This is an infura error code for `exceeded project rate limit` + if *code == -32005 { + return true + } + // alternative alchemy error for specific IPs if *code == -32016 && message.contains("rate limit") { return true