Repository navigation
fix: surface CCIP-Read gateway error messages - #5614
Merged
Merged
Conversation
|
@mortezashojaei is attempting to deploy a commit to the Wevm Team on Vercel. A member of the Team first needs to authorize it. |
🦋 Changeset detectedLatest commit: 456f44e 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 |
mortezashojaei
force-pushed
the
fix/ccip-gateway-error-message
branch
from
November 19, 2026 23:00
9516aee to
456f44e
Compare
Merged
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.
When a CCIP-Read gateway returns a 4xx or 5xx response,
ccipRequestdrops the gateway's error message and reports only the HTTP status text.EIP-3668 defines the error body: "If the Content-Type of a 4xx or 5xx response is
application/json, it MUST adhere to the following JSON schema", which has a single stringmessagefield (example:{"message": "Gateway address not supported."}).ccipRequestinstead readsJSON.parse(body).data.error, a shape gateways don't send, so it always falls back toresponse.statusText.The common gateway libraries use the spec shape.
@chainlink/ccip-read-serverresponds with{ message: "No implementation for function with selector …" }(404),{ message: "Invalid request format" }(400) and{ message: "Internal server error: …" }(500).@ensdomains/ccip-read-routerusesjson({ message }, { status }). ethers v6 readsmessagefrom the same body.OffchainLookupErrortakes its details from this error, so forreadContract,calland ENS actions that go through CCIP-Read, users currently seeDetails: Not FoundorDetails: Internal Server Errorinstead of the gateway's explanation. Where the status text is empty (as is common over HTTP/2), the details are likely blank.This reads
messagefrom JSON error bodies, when it is a string, and uses it as the details. Otherwise the details fall back to the status text as before. JSON bodies are parsed exactly as before, and the existingdata.errorlookup, non-JSON responses, the success path and the URL retry order are unchanged.error: gateway error messagetest toccipRequestinsrc/utils/ccip.test.ts, with a local gateway that returns404and{"message":"Gateway address not supported."}. It fails without this change (Details: Not Found).Checks run:
pnpm test --run --project core src/utils/ccip.test.ts -t "ccipRequest": 22 passed, 4 skipped. TheoffchainLookuptests need Anvil and were not run locally.src/utils/ccip.tsfor those tests: the new branches are covered.tsconsrc/utils/ccip.ts. The fullpnpm check:typeswas not run locally because it runs out of memory on my machine.