Skip to content

feat: add direct Base L2 support for Basenames (*.base.eth) - #63

Merged
eth-limo merged 3 commits into
mainfrom
feat/basenames-l2-bypass
Aug 13, 2026
Merged

eth-limo merged 3 commits into
mainfrom
feat/basenames-l2-bypass

Conversation

@Dwiib

@Dwiib Dwiib commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Supersedes #20 — rewritten on top of current main, preserving @vickcharles's authorship on the commit.

Summary

Resolves contenthash records for Basenames (*.base.eth) by querying the Basenames registry on Base L2 directly, bypassing the Coinbase CCIP gateway which does not serve contenthash records.

Changes vs #20

The original PR predates the ENSv2 refactor (#52) and no longer compiled against main (stale INameService signature, dist/ imports, missing getChainId(), un-awaited getContentHashFallback). Beyond the rebase:

  • Registry lookup: BasenamesService queries the Basenames registry (0xB94704422c2a1E396835A571837Aa5AE53285a95) for the name's assigned resolver via resolver(namehash(name)), then reads contenthash from it.
  • BASE_L2_BYPASS_ENABLED flag (default true): checked at request time in NameServiceFactory; when false, *.base.eth falls back to standard L1 ENS resolution.
  • BASE_RPC_ENDPOINT (default https://mainnet.base.org) via a new IConfigurationBase interface, following the repo's configuration conventions.
  • Errors are not swallowed: RPC failures propagate to the resolver's failure path instead of being returned as null (which would have been cached as a negative "no record" result). Zero-address resolver / empty 0x contenthash still return null as genuine no-record cases.
  • getNameServiceForCointype is intentionally untouched (no in-repo callers).

Test plan

  • Two new cases.json entries (example.base.eth, norecord.base.eth) run through the full permutation matrix with a dedicated Basenames test resolver in the harness
  • Explicit test: Basename resolves via the Basenames service
  • Explicit test: with BASE_L2_BYPASS_ENABLED=false, *.base.eth falls back to L1 ENS (Basenames resolver left poisoned to prove routing)
  • All 2737 server + 54 resolver tests pass
  • Live integration test script ported from dweb-api (bin/integrationTests.sh) with an empty Basenames scaffold

🤖 Generated with Claude Code

Resolve contenthash records for Basenames by querying the Basenames
registry on Base L2 directly, bypassing the Coinbase CCIP gateway which
does not serve contenthash records.

- Add BasenamesService: looks up the name's resolver through the
  Basenames registry (rather than hardcoding the default L2Resolver)
  and reads contenthash from it; RPC errors propagate to the resolver
  failure path instead of being treated as an empty record
- Route *.base.eth in NameServiceFactory, gated behind
  BASE_L2_BYPASS_ENABLED (default true); when disabled, names fall
  back to standard L1 ENS resolution
- Add IConfigurationBase and BASE_RPC_ENDPOINT (default
  https://mainnet.base.org)
- Add integration test coverage and README documentation

Rewritten on top of current main from #20 (pre-ENSv2 interface).

Co-authored-by: Richard Dwi <richarddwi@pm.me>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Ported from dweb-api's bin/integrationTests.sh (this fork never carried
it): resolves real names against a locally running server on mainnet.
The Basenames section is empty for now: no known *.base.eth name has a
contenthash on its registry-assigned resolver (existing records live on
the superseded default L2Resolver and are deliberately not honored).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Dwiib

Dwiib commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

@vickcharles Can you verify your contenthash is set on the correct resolver? It looks like maybe you set it on the implementation contract and not the proxy contract. Querying your basename on the Base registry shows a different resolver.

@Dwiib

Dwiib commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

@vickcharles I'm going to mark this ready to merge. When you fix your contenthash open up an issue and we'll add it to our internal integration test suite

@eth-limo
eth-limo merged commit d9a839b into main Aug 13, 2026
3 checks passed
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.

3 participants