Skip to content

Fix text record resolution and enhance CCIP-Read handling#111

Open
Douglasacost wants to merge 16 commits intomainfrom
fix/gateway-text-record-resolution
Open

Fix text record resolution and enhance CCIP-Read handling#111
Douglasacost wants to merge 16 commits intomainfrom
fix/gateway-text-record-resolution

Conversation

@Douglasacost
Copy link
Copy Markdown
Collaborator

This pull request introduces a new signed-gateway UniversalResolver integration for ENS offchain resolution, adding a /resolve endpoint 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:

  • Added /resolve route 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]
  • Implemented resolveFromL2 utility to parse DNS-encoded ENS names, support addr, addr-multichain, and text lookups, and return ABI-encoded results.
  • Added signResolutionResponse for EIP-712 signing of resolution results, matching the L1 UniversalResolver contract.

Configuration and Setup Updates:

  • Extended setup.ts to 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]
  • Updated the ENS NameService interface to include the getTextRecord function needed by the gateway.

Deployment Script Changes:

  • Refactored the L1 deployment script to support the new signed-gateway UniversalResolver, removing the StorageProofVerifier/SparseMerkleTree logic and adding support for setting the ENS resolver in a single broadcast if desired. [1] [2] [3]

These changes collectively enable secure, offchain ENS resolution via a gateway that signs responses for L1 verification, modernizing the resolver infrastructure and deployment flow.

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.
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 13, 2026

LCOV of commit ad92b93 during checks #658

Summary coverage rate:
  lines......: 31.8% (771 of 2426 lines)
  functions..: 27.8% (105 of 378 functions)
  branches...: 37.2% (140 of 376 branches)

Files changed coverage rate:
                                                  |Lines       |Functions  |Branches    
  Filename                                        |Rate     Num|Rate    Num|Rate     Num
  ======================================================================================
  script/DeployL1Ens.s.sol                        | 0.0%     21| 0.0%     1| 0.0%      3
  src/nameservice/UniversalResolver.sol           | 0.0%     79| 0.0%     9| 0.0%     17

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 UniversalResolver with EIP-712 signature verification and trusted signer rotation.
  • Added a new gateway /resolve endpoint plus L2 resolution + signing utilities to support addr, addr-multichain, and text.
  • 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.

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