Skip to content

Add CCIP-Read Tunneling#4551

Open
adraffy wants to merge 5 commits into
wevm:mainfrom
adraffy:feat/ccip-tunnel
Open

Add CCIP-Read Tunneling#4551
adraffy wants to merge 5 commits into
wevm:mainfrom
adraffy:feat/ccip-tunnel

Conversation

@adraffy
Copy link
Copy Markdown
Contributor

@adraffy adraffy commented Apr 25, 2026

  • added utils/ccipTunnel.ts and tests
    • exposes ccipReadTunnel()

Usage:

// <meta http-equiv="Content-Security-Policy" content="connect-src 'self' <batchGateway>;">
createClient({
   ccipRead: ccipReadTunnel({ batchGateways: [<batchGateway>] })
});

→ routes ALL CCIP-Read OffchainLookup requests through <batchGateway>.


Note: CCIP-Read is not ENS-specific.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 25, 2026

⚠️ No Changeset found

Latest commit: 6fb38ab

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 25, 2026

@adraffy is attempting to deploy a commit to the Wevm Team on Vercel.

A member of the Team first needs to authorize it.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 25, 2026

Open in StackBlitz

npm i https://pkg.pr.new/viem@4551

commit: 6fb38ab

Comment thread src/utils/ccipTunnel.ts Outdated
Copy link
Copy Markdown
Member

@jxom jxom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one small nit

Co-authored-by: jxom <7336481+jxom@users.noreply.github.com>
@adraffy
Copy link
Copy Markdown
Contributor Author

adraffy commented May 4, 2026

Oh cool, does the idea make sense? It could technically be an external library since the code is independent but I think it's actually useful for frontend applications (and will get use as there's an increased desire to lock frontends down) and the new code is only a small addition.

I have a matching solution for ethers for solving the same problem (CSP).


This will be standardized as part of ENSIP-21 but I'm thinking about writing an ERC, since it's actually a security improvement on ERC-3668 (although ENSIP-21 itself was too, and I didn't write one.)

Comment thread src/utils/ccipTunnel.ts
error = new HttpRequestError({
body: { message: res.args[1] },
status: res.args[0],
url: urls.join(' | '),
Copy link
Copy Markdown
Contributor Author

@adraffy adraffy May 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was unsure what to put here.

Basically, the batch gateway failed to fetch all of the URLs, so it's not clear which one gets the blame.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants