Skip to content

fix(config): replace dead RPC endpoints, use public RPCs, and add chainId validation to hardhat networks - #383

Merged
sijuu merged 1 commit into
masterfrom
cecho-2476-fix-dead-rpc-urls-add-chainid-guards
Oct 16, 2026
Merged

sijuu merged 1 commit into
masterfrom
cecho-2476-fix-dead-rpc-urls-add-chainid-guards

Conversation

@parasgarg-bitgo

Copy link
Copy Markdown
Contributor

Summary

Full RPC liveness audit of all 121 remote networks in hardhat.config.ts (tracked in CECHO-2476). This PR replaces 5 dead/misconfigured RPC URLs, moves 8 secret-backed RPC URLs to public endpoints, adds chainId validation to every remote network, and fixes the swapped BERA/BERA_TESTNET constants.

Problem

  • chiliz → rpc.ankr.com/chiliz: Ankr removed keyless access (401 from external probes; docs now require a key)
  • bobaeth → boba-ethereum.gateway.tenderly.co and tworld → worldchain-sepolia.gateway.tenderly.co: Tenderly discontinued the free public gateway routes (404 externally)
  • phrs → testnet.dplabs-internal.com: DNS repurposed to ZAN infrastructure (serves a *.zan.top TLS cert — deterministic handshake failure); also a mainnet network pointed at a testnet hostname (TODO WIN-5781)
  • tcelo → sepolia.celoscan.io: never an RPC — it is the Celoscan explorer website (returns HTML)
  • 8 networks loaded RPC URLs from GitHub secrets although verified public endpoints exist
  • No chainId on network declarations → Hardhat cannot fail fast if a URL points at the wrong chain
  • CHAIN_IDS.BERA held 80069 (Bepolia testnet) and BERA_TESTNET held 80094 (mainnet) — values swapped

Changes

Dead URL replacements (each verified live via eth_chainId, matching config/chainIds.ts):

Network New URL chainId
tcelo https://forno.celo-sepolia.celo-testnet.org 11142220
tworld https://worldchain-sepolia.g.alchemy.com/public 4801
phrs https://rpc.pharos.xyz 1672 (resolves TODO WIN-5781)
chiliz https://rpc.chiliz.com 88888
bobaeth https://mainnet.boba.network 288

Secret → public RPC URLs: tarbeth → https://sepolia-rollup.arbitrum.io/rpc (421614), topeth → https://sepolia.optimism.io (11155420), opeth → https://mainnet.optimism.io (10), tzketh → https://sepolia.era.zksync.dev (300), bera → https://rpc.berachain.com (80094), tstt → https://dream-rpc.somnia.network (50312), mon → https://rpc.monad.xyz (143), plasma → https://rpc.plasma.to (9745). The orphaned env-var destructuring entries are removed.

chainId guards: chainId: CHAIN_IDS.* added to all 117 networks that lacked one. Hardhat now wraps each provider in ChainIdValidatorProvider, which aborts with NETWORK.INVALID_GLOBAL_CHAIN_ID on the first request if the RPC's chain doesn't match — turning wrong-chain deploys/transfers into immediate hard failures. dogeos is intentionally left unguarded: CHAIN_IDS.DOGEOS is a placeholder (123456, WIN-8075) that would fail validation against the testnet RPC it currently points to.

BERA swap fix: BERA: 80094 (mainnet), BERA_TESTNET: 80069 (Bepolia) in config/chainIds.ts, with the two customChains usages swapped in lockstep so the same numbers keep flowing to the matching Routescan APIs.

Also included: rename the polygonAmoy hardhat network to tmatic (aligns with the network tags the deploy workflows already match on) and map its etherscan verification to POLYGONSCAN_API_KEY.

Verification

  • Every new URL probed with POST eth_chainId; all values match config/chainIds.ts
  • Consistency check across 121/121 networks (declared chainId vs live-probed value): all pass
  • npx hardhat compile clean; npm run lint (prettier) clean
  • Runtime validator smoke: tcelo → 11142220, bera → 80094, tbera → 80069 (a mismatch aborts before any request executes)

Out of scope / follow-ups (CECHO-2476)

  • Drop the now-unused RPC secret env lines from the 5 workflows that pass them (transfer_batcher_ownership, update_transfer_gas_limit, deploy_and_release, deploy_batcher_contract, push) — deliberately not done in this PR
  • Add dogeos chainId once the mainnet RPC exists (WIN-8075)
  • Per-chain prerequisites for running transfer-batcher-ownership (deployed Batcher at BATCHER_ADDRESS, current on-chain owner = deployer key, owner-address secrets present in both GitHub environments); for chiliz/bobaeth/tworld/phrs/tcelo, confirm a Batcher is actually deployed on-chain first

Ticket: CECHO-2476

…inId validation to hardhat networks

- replace 5 dead/misconfigured RPC URLs with verified public endpoints:
  chiliz (rpc.chiliz.com), bobaeth (mainnet.boba.network), tworld
  (worldchain-sepolia.g.alchemy.com/public), phrs (rpc.pharos.xyz, also
  resolves TODO WIN-5781), tcelo (forno.celo-sepolia.celo-testnet.org)
- switch 8 secret-backed RPC URLs (QuickNode/Bera/Monad/Somnia env vars)
  to public endpoints and remove the now-orphaned env destructuring
- add chainId: CHAIN_IDS.* to every remote network so Hardhat's
  ChainIdValidatorProvider fails fast on URL/chain mismatch; dogeos left
  unguarded until mainnet details exist (WIN-8075)
- fix swapped BERA/BERA_TESTNET chainId values (80094 mainnet, 80069
  Bepolia) and swap the matching customChains usages in lockstep
- rename polygonAmoy network to tmatic to match the deploy workflows'
  network tags, and map its etherscan verification to POLYGONSCAN_API_KEY

Ticket: CECHO-2476
@linear-code

linear-code Bot commented Oct 16, 2026

Copy link
Copy Markdown

CECHO-2476

@sijuu
sijuu merged commit 9566bcd into master Oct 16, 2026
6 checks passed
@sijuu
sijuu deleted the cecho-2476-fix-dead-rpc-urls-add-chainid-guards branch October 16, 2026 10:28

This branch was previously deployed

1 inactive deployment
dev — a389abbb Deployed Oct 16, 2026 by parasgarg-bitgo via lint-and-test (18.x) #1961
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.

4 participants