Fix text record resolution and enhance CCIP-Read handling#111
Open
Douglasacost wants to merge 16 commits intomainfrom
Open
Fix text record resolution and enhance CCIP-Read handling#111Douglasacost wants to merge 16 commits intomainfrom
Douglasacost wants to merge 16 commits intomainfrom
Conversation
Text records returned empty because NAME_SERVICE_INTERFACE was missing the getTextRecord read fragment — ethers treated the method as non-existent and the resolver's catch-all swallowed the error as "no record". CCIP-Read POSTs from the ENS app were also rejected because they send Content-Type: text/plain to skip CORS preflight, which express.json() ignored by default.
…olver This commit introduces a comprehensive RFC-style documentation for the Signed-Gateway UniversalResolver, detailing its architecture, interfaces, and EIP-712 payload. The document outlines the resolver's functionality, including its integration with the L2 NameService and the trusted-gateway signature model, replacing the previous zkSync storage proof design.
LCOV of commit
|
There was a problem hiding this comment.
Pull request overview
This PR migrates ENS offchain resolution to a signed-gateway CCIP-Read (ERC-3668) model: the L1 UniversalResolver reverts with OffchainLookup, the gateway resolves against L2 NameService, then returns an EIP-712 signed payload that the L1 resolver verifies.
Changes:
- Replaced storage-proof based verification in
UniversalResolverwith EIP-712 signature verification and trusted signer rotation. - Added a new gateway
/resolveendpoint plus L2 resolution + signing utilities to supportaddr,addr-multichain, andtext. - Added protocol documentation and a Foundry test suite covering core success/failure paths and signer rotation.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
src/nameservice/UniversalResolver.sol |
Switches resolver to CCIP-Read + EIP-712 signed responses; adds trusted signers and URL rotation. |
clk-gateway/src/routes/resolve.ts |
Implements the CCIP-Read callback endpoint (/resolve) that decodes (name,data), resolves via L2, and signs responses. |
clk-gateway/src/resolver/resolveFromL2.ts |
Adds L2 resolution dispatcher for addr, addr-multichain, and text and returns ABI-encoded results. |
clk-gateway/src/resolver/signResolution.ts |
Adds EIP-712 signing for Resolution(name,data,result,expiresAt) and ABI-encodes the callback response payload. |
clk-gateway/src/setup.ts |
Wires env/config for resolver signer, L1 resolver address, chainId, and signature TTL. |
clk-gateway/src/index.ts |
Extends JSON parsing to accept text/plain and registers the new /resolve router. |
clk-gateway/src/interfaces.ts |
Extends NameService interface with getTextRecord. |
script/DeployL1Ens.s.sol |
Refactors deployment for signed-gateway resolver model and adds optional ENS setResolver step. |
test/nameservice/UniversalResolver.t.sol |
Adds Foundry tests for signature verification, TTL bounds, signer rotation, and interface support. |
src/nameservice/doc/signed-resolver-protocol.md |
Adds RFC-style protocol specification for the signed-gateway resolver model. |
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.
This pull request introduces a new signed-gateway UniversalResolver integration for ENS offchain resolution, adding a
/resolveendpoint that supports CCIP-Read (ERC-3668) with EIP-712 signatures, and refactors deployment scripts and configuration to support the new model. The changes include new resolver logic, EIP-712 signing, configuration wiring, and a simplified deployment script.New ENS Gateway Resolution Functionality:
/resolveroute that implements the CCIP-Read (ERC-3668) callback endpoint, decoding ENS resolution requests, routing them to the correct L2 NameService, and returning EIP-712 signed responses for use with the L1 UniversalResolver. [1] [2] [3]resolveFromL2utility to parse DNS-encoded ENS names, supportaddr,addr-multichain, andtextlookups, and return ABI-encoded results.signResolutionResponsefor EIP-712 signing of resolution results, matching the L1 UniversalResolver contract.Configuration and Setup Updates:
setup.tsto wire up the new resolver signer, L1 resolver address, and signature TTL, and export them for use in the new route. [1] [2] [3] [4]getTextRecordfunction needed by the gateway.Deployment Script Changes:
These changes collectively enable secure, offchain ENS resolution via a gateway that signs responses for L1 verification, modernizing the resolver infrastructure and deployment flow.