Skip to content

Commit

Permalink
Fixed: Whitelist HTTP 403 Forbidden for dRPC as a retryable error
Browse files Browse the repository at this point in the history
  • Loading branch information
miohtama committed May 24, 2024
1 parent ab31c55 commit 3148126
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
6 changes: 6 additions & 0 deletions eth_defi/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 3148126

Please sign in to comment.