Repository navigation
fix: bound CCIP-Read gateway fetches - #5351
Closed
mortezashojaei wants to merge 2 commits into
Closed
mortezashojaei wants to merge 2 commits into
mortezashojaei wants to merge 2 commits into
Conversation
|
@mortezashojaei is attempting to deploy a commit to the Wevm Team on Vercel. A member of the Team first needs to authorize it. |
|
Deployment failed for project viem with the following error: |
🦋 Changeset detectedLatest commit: 1b9c306 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 |
Use the HTTP transport timeout and response cap for gateway requests, allow only HTTP(S) URLs, and stop one lookup after 4 nested callbacks, including a nested local batch.
mortezashojaei
force-pushed
the
fix/ccip-read-limits
branch
from
October 30, 2026 22:21
f9519b1 to
eea44c8
Compare
A nested local batch continues the callback depth of the same lookup, and gateway fetches use the timeout from the client transport.
3 tasks done
Member
|
Thanks @mortezashojaei! Superseded by #5364, which keeps your gateway timeout, response cap and scheme check, and adds a shared query/concurrency budget per lookup with explicit callback depth tracking. |
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
A CCIP-Read gateway fetch is the other HTTP call the client makes, and the contract chooses the URL. Viem keeps the limits it already uses for its own HTTP transport, and the lookup depth EIP-3668 requires.
What belongs in the library:
timeoutoverride, as the HTTP transport. A gateway that never finishes would hang the call the same way a stalled RPC would.10_485_760).httpandhttpsonly. EIP-3668 defines the gateway call as an HTTP GET or POST, and it only specifies HTTPS URLs.x-batch-gateway:trueagain shares that depth. A query past it comes back as a failure, so the batch result stays the same length as the request list.How many URLs to try, how many batch queries to run, and whether to follow a redirect stay with the caller, through
ccipRead.request.ccipRead: falseskips contract-chosen fetches entirely.There is no address blocklist. A literal private address is one way to spell a URL the contract is allowed to choose. A public hostname can resolve to that same address, and blocking
10/8or192.168/16also breaks a gateway on a LAN. A caller who wants a resolver check suppliesccipRead.request.Related: #5024. The scheme check overlaps with that issue. The host parser and the redirect refusal stay out.
Test plan
SKIP_GLOBAL_SETUP=true pnpm exec vitest run -c ./test/vitest.config.ts --project core src/utils/ccip.test.ts src/utils/ens/localBatchGatewayRequest.test.tsGateway unit tests passed. The three
offchainLookupcases need a local Anvil (ECONNREFUSED 127.0.0.1:8545here).offchainLookupcases