Skip to content

feat(ens): use Universal Resolver for ENS resolution#3822

Open
Dhaiwat10 wants to merge 1 commit intoethereum:mainfrom
Dhaiwat10:feat/universal-resolver
Open

feat(ens): use Universal Resolver for ENS resolution#3822
Dhaiwat10 wants to merge 1 commit intoethereum:mainfrom
Dhaiwat10:feat/universal-resolver

Conversation

@Dhaiwat10
Copy link
Copy Markdown

Hey! I'm Dhaiwat from the DevRel team at ENS Labs. We're working on getting libraries across the ecosystem ready for ENSv2.

What was wrong?

ENS read operations (address, name, get_text, resolver) query the ENS Registry directly instead of using the Universal Resolver. The Universal Resolver (0xeEeEEEeE14D718C2B47D9923Deab1335E144EeEe) is the canonical entry point for ENS resolution on Ethereum Mainnet and is required for ENSv2 readiness. Once ENSv2 is live, libraries that don't use the Universal Resolver will resolve some names to incorrect or stale addresses.

How was it fixed?

Updated all ENS read operations to use the Universal Resolver instead of querying the ENS Registry directly. Write operations (setup_address, setup_name, set_text) are unchanged.

  • Add UNIVERSAL_RESOLVER_ADDR constant
  • Add UNIVERSAL_RESOLVER ABI with resolve(), reverse(), and findResolver() functions
  • Update _resolve(), address(), resolver(), and get_text() to call the Universal Resolver
  • Remove legacy registry-based read path (_get_resolver, _resolve_legacy, _resolver_supports_interface, _validate_resolver_and_interface_id, _type_aware_resolver)
  • Update test fixtures with a UR mock shim for the eth_tester environment
  • All 212 existing ENS tests pass

With this PR, web3.py goes from 3/9 to 6/9 on our official resolution-tests suite for libraries:

Test Before After
universal-resolver
forward-base-onchain
forward-eth-offchain
forward-text-onchain
forward-text-offchain
forward-contenthash
forward-dns-offchain
reverse-eth
reverse-l2

More details on ENSv2 readiness: https://docs.ens.domains/web/ensv2-readiness

Todo:

  • Clean up commit history
  • Add or update documentation related to these changes
  • Add entry to the release notes (newsfragment included, needs PR number)

@Dhaiwat10 Dhaiwat10 marked this pull request as ready for review April 8, 2026 12:08
@Dhaiwat10 Dhaiwat10 force-pushed the feat/universal-resolver branch 2 times, most recently from 9c3e554 to 4fdc20a Compare April 8, 2026 12:54
Use the ENS Universal Resolver (0xeEeEEEeE14D718C2B47D9923Deab1335E144EeEe)
as the sole resolution path for all read operations. Per ENS docs, the UR is
"the canonical entrypoint to ENS for name resolution."

This fixes ENSv2 readiness by:
- Eliminating the supportsInterface gate that blocked CCIP-Read/offchain resolution
- Supporting DNS name resolution and cross-chain (L2) address lookups
- Reducing RPC round-trips (single UR call vs registry→resolver→call)

Deleted legacy code: _get_resolver, _resolve_legacy, _resolver_supports_interface,
_validate_resolver_and_interface_id, _type_aware_resolver, UnsupportedFunction.

Write operations unchanged — still use the registry directly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Dhaiwat10 Dhaiwat10 force-pushed the feat/universal-resolver branch from 4fdc20a to ac32e5e Compare April 8, 2026 14:20
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.

1 participant