From 3148126167e7452fc3769b55d82fbc8987281602 Mon Sep 17 00:00:00 2001 From: Mikko Ohtamaa Date: Fri, 24 May 2024 11:42:53 +0200 Subject: [PATCH] Fixed: Whitelist HTTP 403 Forbidden for dRPC as a retryable error --- CHANGELOG.md | 3 ++- eth_defi/middleware.py | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f98d80a..6b8cdb30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Current -- dRPC ` x-drpc-provider-id` header support for troubleshooting issues with decentralised node providers +- Add:dRPC ` x-drpc-provider-id` header support for troubleshooting issues with decentralised node providers +- Fixed: Whitelist HTTP 403 Forbidden for dRPC as a retryable error # 0.25.7 diff --git a/eth_defi/middleware.py b/eth_defi/middleware.py index ca195801..0c74966a 100644 --- a/eth_defi/middleware.py +++ b/eth_defi/middleware.py @@ -64,6 +64,7 @@ # requests.exceptions.ChunkedEncodingError: ("Connection broken: InvalidChunkLength(got length b'', 0 bytes read)", InvalidChunkLength(got length b'', 0 bytes read)) # ChunkedEncodingError, + ) #: List of HTTP status codes we know we might want to retry after a timeout @@ -78,6 +79,11 @@ 525, # Returned by Alchemy - SSL handshake failed - cause unknown, internal Alchemy failure suspected https://http.dev/525 520, # Returned by Alchemy - CloudFlare: Unknown error 410, # happens on dRPC: requests.exceptions.HTTPError: 410 Client Error: Gone for url: https://lb.drpc.org/ogrpc?network=avalanche&dkey=xxx + + # dRPC error + # requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://lb.drpc.org/ogrpc?network=polygon&dkey=x/ + 403, + ) #: List of ValueError status codes we know we might want to retry after a timeout