Skip to content

remove 19 rpcs that answer eth_chainId with a different chain than their key - #3169

Open
0xshubhs wants to merge 1 commit into
DefiLlama:mainfrom
0xshubhs:rpc-chainid-mismatch
Open

0xshubhs wants to merge 1 commit into
DefiLlama:mainfrom
0xshubhs:rpc-chainid-mismatch

Conversation

@0xshubhs

Copy link
Copy Markdown
Contributor

Evidence and the full table are in #3168.

Posted eth_chainId to all 2,651 http rpcs in constants/extraRpcs.js. 924 answered with the chainId they are filed under, 19 answered with a different one, and 1,708 were unreachable or errored and are ignored, since an unreachable host proves nothing.

What this removes:

  • Wrong-network endpoints on real chains. 11 Metadium Mainnet pointed at api.metadium.com/dev, which returns 12. 4002 Fantom Testnet carried fantom.api.onfinality.io/public, which returns 250, while the correct testnet url is one line away. 1516, 5124, 16600, 224400, 224433 and 8691942025 are the same shape.
  • The 12123 to 12131 block, a run of drpc endpoints written to sequential keys rather than to the chains they belong to. 12124 to 12131 are absent from the upstream chain list, so nothing rendered them; 12123 is BRC Chain Mainnet whose only entry was hoodi.drpc.org returning 560048. Every url in that block is valid for the chain named in its own hostname, just filed in the wrong place, so removing the keys leaves upstream's own rpcs intact.
  • 2014 and 5577 had no other rpc, so the key goes with the entry.

Left alone deliberately: 2522 Fraxtal Testnet. Both its endpoints now return 2523, which exists upstream as Fraxtal Hoodi Testnet, so whether they should move to 2523 or be dropped is your call rather than mine.

Deletions only apart from one inline array element. node tests/check-duplicate-keys.js passes, the module still parses, and no key is left with an empty rpcs.

Fixes #3168

@0xshubhs

Copy link
Copy Markdown
Contributor Author

Heads-up on ordering: this and #3106 both edit constants/extraRpcs.js.

They remove disjoint sets of urls, so there is no disagreement between them, but they do touch the
same entry in one place. Chain 16600 currently looks like this:

0  https://evmrpc-testnet.0g.ai                      <- this PR removes it, returns 16602
1  https://0g-json-rpc-public.originstake.com        <- #3106 removes the duplicate of this
2  https://og-testnet-jsonrpc.blockhub.id
3  https://0g-json-rpc-public.originstake.com        <- the duplicate

Adjacent lines, so whichever merges second will likely want a trivial rebase. Merge them in either
order and tell me which one to rebase, or I can rebase #3106 onto this now if you would rather take
this one first.

…eir key

posted eth_chainId to all 2651 http rpcs in extraRpcs.js. 924 answered with the chainId they are
filed under, 19 answered with a different one, and the rest were unreachable and are ignored since
that proves nothing.

most are a mainnet endpoint under a testnet key or the reverse: 11 metadium mainnet pointed at
api.metadium.com/dev which returns 12, and 4002 fantom testnet carried
fantom.api.onfinality.io/public which returns 250 while the correct testnet url sits one line away.
224400 and 224433 both pointed at hosts returning 224422, and 16600 and 8691942025 return ids that
moved upstream.

12123 to 12131 were a block of drpc endpoints written to a run of sequential keys rather than to
the chains they belong to. 12124 to 12131 are not in the upstream chain list at all so nothing
rendered them, and 12123 is brc chain mainnet whose only entry was hoodi.drpc.org returning 560048.
each of those urls is valid for the chain named in its own hostname, just filed in the wrong place,
so removing the keys leaves upstream's own rpcs in place.

2014 and 5577 had no other rpc so the keys go with the entry. left 2522 fraxtal testnet alone: both
its endpoints now return 2523, which exists upstream as fraxtal hoodi testnet, so whether they move
or get dropped is a call for you.

Fixes DefiLlama#3168

This branch has not been deployed

No deployments
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.

19 rpc entries in extraRpcs.js answer eth_chainId with a different chain than the key they are filed under

2 participants