Use shared mainnet RPC env helper for verifier ENS TXT resolution#328
Merged
GsCommand merged 1 commit intoMay 24, 2026
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Motivation
lib/verifyReceipt.jspreviously did not build a provider from production RPC env vars, causing ENS TXT lookups (used by/api/verify) to miss configured RPC endpoints and reportens_key_unavailabledespite RPC envs being present.Description
lib/mainnetRpc.jsexportinggetMainnetRpcUrl(env = process.env)andcreateMainnetProvider(env = process.env)with the requested resolution order:ETHEREUM_RPC_URL,MAINNET_RPC_URL,ALCHEMY_ETHEREUM_RPC_URL,ALCHEMY_ETH_RPC_URL,ETH_RPC_URL, and finally mappingALCHEMY_API_KEYtohttps://eth-mainnet.g.alchemy.com/v2/<key>.lib/verifyReceipt.jsto use a default ENS TXT resolver that constructs a provider viacreateMainnetProvider(or uses an injectedprovider/textResolver) so ENS TXT fields (cl.sig.pub,cl.sig.kid,cl.sig.canonical,cl.receipt.signer) are resolved via configured RPC by default while preserving ENS-first semantics and local fallback gating.api/ens/owned.jsto consume the sharedgetMainnetRpcUrl/createMainnetProviderhelper and removed duplicate env/provider logic there, and allowed deterministic test injection by forwardingreq.verifyOptionsfromapi/verify.jsandapi/agents/verifyagent.jsintoverifyReceipt.docs/ops/environment.mdto noteETHEREUM_RPC_URLis used by both ENS owned lookup and verifier, and added/adjusted teststests/mainnet-rpc.test.js,tests/verifyReceipt-runtime.test.js, andtests/api-verify.test.jsto cover RPC precedence, Alchemy key mapping, provider-path ENS TXT resolution, injected resolver verification, missing TXT, resolver errors, and fallback gating.Testing
npm testand all automated tests passed (117tests run,117passed,0failed).npm run check:linksand it completed successfully with local link checks passing.erc8211.merkle.v1and found no matches (no occurrences).Codex Task