Conversation
spalen0
marked this pull request as ready for review
September 25, 2026 14:07
Route utils.http_client.fetch_json through request_with_retry, drop the duplicate ethena fetch_json, and simplify infinifi fetch_api_data. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Routes the remaining bare
requestscalls throughrequest_with_retryfromutils.http_client, so transient SSL/connection errors, timeouts, 429s and 5xx responses are retried with backoff.For example, this fixes one-off
SSLError(SSLEOFError(... UNEXPECTED_EOF_WHILE_READING ...))failures fromatlas.api.instadapp.io(Fluid).SSLErroris a subclass ofConnectionError, so it gets retried.Updated callers:
protocols/spark/proposals.py: Snapshot GraphQLprotocols/compound/proposals.py: Tally GraphQLprotocols/maker/proposals.py: Sky executive APIprotocols/fluid/proposals.py: Fluid APIprotocols/ethena/ethena.py: Ethena transparency API (privatefetch_jsoncopy removed, now uses the shared helper)protocols/infinifi/main.py: Infinifi protocol API (now uses the sharedfetch_json)protocols/yearn/kong.py: Kong GraphQL API (request failures are wrapped inKongRequestError)utils/tenderly/tenderly.py: Tenderly alerts APIutils/http_client.py:fetch_jsonnow usesrequest_with_retry, so its callers get retries too: Tenderly simulation, Etherscan source context, Sourcify, Swiss Knife, the calldata decoder and the infinifi LLM context. It still returnsNoneon failure. It now accepts any 2xx response, where before it accepted only 200.request_with_retrylogs the status code, URL and the first 200 characters of the response body before raising on a non-retryable 4xx. This keeps the debugging detail that the per-caller error logging used to provide.Tests have been updated to mock
request_with_retryinstead ofrequests.get/requests.post.🤖 Generated with Claude Code