feat: add direct Base L2 support for Basenames (*.base.eth) - #63
Merged
Merged
Conversation
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>
2 tasks
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>
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. |
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 |
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.
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(staleINameServicesignature,dist/imports, missinggetChainId(), un-awaitedgetContentHashFallback). Beyond the rebase:BasenamesServicequeries the Basenames registry (0xB94704422c2a1E396835A571837Aa5AE53285a95) for the name's assigned resolver viaresolver(namehash(name)), then readscontenthashfrom it.BASE_L2_BYPASS_ENABLEDflag (defaulttrue): checked at request time inNameServiceFactory; whenfalse,*.base.ethfalls back to standard L1 ENS resolution.BASE_RPC_ENDPOINT(defaulthttps://mainnet.base.org) via a newIConfigurationBaseinterface, following the repo's configuration conventions.null(which would have been cached as a negative "no record" result). Zero-address resolver / empty0xcontenthash still returnnullas genuine no-record cases.getNameServiceForCointypeis intentionally untouched (no in-repo callers).Test plan
cases.jsonentries (example.base.eth,norecord.base.eth) run through the full permutation matrix with a dedicated Basenames test resolver in the harnessBASE_L2_BYPASS_ENABLED=false,*.base.ethfalls back to L1 ENS (Basenames resolver left poisoned to prove routing)bin/integrationTests.sh) with an empty Basenames scaffold🤖 Generated with Claude Code