feat: use dRPC's chain label as a last-resort name - #122
Merged
Conversation
Chains that only dRPC knows about ended up named "Chain <id>" (e.g.
chain 61900) because the name lookup only consulted chain-overrides.json,
Etherscan, Blockscout and chainid.network.
dRPC's chains.yaml does carry a name — a protocol-level `label` plus a
per-network `id` — we just weren't reading it. Extract it into
DrpcChainData.name and use it in generate.ts right before the
"Chain <id>" placeholder, so better-curated sources still win.
Joining label + network id needs two touch-ups: drop the label when the
network id already repeats it ("megaETH" + "MegaETH Testnet"), and
capitalise an all-lowercase network id ("mainnet"). Covered by a new
scripts/providers/drpc.test.ts, wired into `npm test`.
Against today's chains.yaml all 262 dRPC chains resolve to a name:
61900 -> Mova Mainnet, 1672 -> Pharos Mainnet, 2910 -> Morph Hoodi,
6281971 -> DogeOS Testnet.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
manuelwedler
approved these changes
Aug 6, 2026
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.
Changes
Chains discovered only through dRPC were named
Chain <id>— for example chain 61900 in #115. The name lookup ingenerate.tsonly consultedchain-overrides.json, Etherscan, Blockscout and chainid.network, and none of them know that chain.dRPC's
chains.yamldoes carry a name (a protocol-levellabelplus a per-networkid); we just weren't reading it.scripts/providers/drpc.ts: parselabel/idand exposeDrpcChainData.name.scripts/generate.ts: usedrpc?.namein thesourcifyNamefallback chain, right before theChain <id>placeholder — better-curated sources still win.megaETH+MegaETH Testnet→MegaETH Testnet), and capitalise an all-lowercase network id (mainnet→Mainnet).scripts/providers/drpc.test.ts, wired intonpm test.Against today's
chains.yamlall 262 dRPC chains resolve to a name. The placeholders currently insourcify-chains-default.jsonbecome:🤖 Generated with Claude Code