fix(utils): retry on JSON-RPC 429 error code in batch requests#4453
Closed
D2758695161 wants to merge 2 commits intowevm:mainfrom
Closed
fix(utils): retry on JSON-RPC 429 error code in batch requests#4453D2758695161 wants to merge 2 commits intowevm:mainfrom
D2758695161 wants to merge 2 commits intowevm:mainfrom
Conversation
added 2 commits
April 2, 2026 20:38
Batch requests return HTTP 200 with JSON-RPC error code 429 when rate limited. shouldRetry only checked LimitExceededRpcError.code (-32005) but not 429. This caused retries to not fire for batched requests hitting rate limits. Fixes wevm#3680
🦋 Changeset detectedLatest commit: 46effbe The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Author
|
Bump — PR is mergeable and ready. Happy to address any feedback or make changes! |
Author
|
Note: PR #4440 by @luanxu-dev also fixes this issue with good tests. My PR has the .changeset file needed for release. Happy to close mine in favor of theirs! |
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.
Summary
Adds
error.code === 429to theshouldRetrylogic for batched JSON-RPC requests. When rate limited, batch requests return HTTP 200 with a JSON-RPC error code 429 — these now trigger a retry instead of being silently dropped.Changes
src/utils/— Added 429 to the retry condition in the batch request handler:Testing
Existing retry tests should cover this. The change is additive only.
Issue: #3680
Changeset: ✅ Included (viem: patch)
Payment: ETH/BSC —
0xaae0101ac77a2e4e0ea826eb4d309374f029b0a6