Skip to content

Commit

Permalink
Add backup RPCs for some EVM chains (#139)
Browse files Browse the repository at this point in the history
### Description

Update RPCs for blast, cyber, fraxtal, inevm, manta, mode Soften
explorer health test requirements

### Backward compatibility

Yes

### Related issue


hyperlane-xyz/issues#1160 (comment)
  • Loading branch information
jmrossy committed Aug 13, 2024
1 parent 883d75f commit 65ef674
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .changeset/hot-shirts-act.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@hyperlane-xyz/registry': patch
---

Add backup RPCs for some EVM chains
1 change: 1 addition & 0 deletions chains/blast/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ nativeToken:
protocol: ethereum
rpcUrls:
- http: https://rpc.blast.io
- http: https://rpc.ankr.com/blast
technicalStack: other
3 changes: 2 additions & 1 deletion chains/cyber/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ nativeToken:
symbol: ETH
protocol: ethereum
rpcUrls:
- http: https://cyber-mainnet-archive.alt.technology
- http: https://rpc.cyber.co
- http: https://cyber.alt.technology
1 change: 1 addition & 0 deletions chains/fraxtal/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ nativeToken:
protocol: ethereum
rpcUrls:
- http: https://rpc.frax.com
- http: https://fraxtal.drpc.org
1 change: 1 addition & 0 deletions chains/inevm/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ nativeToken:
protocol: ethereum
rpcUrls:
- http: https://inevm.calderachain.xyz/http
- http: https://mainnet.rpc.inevm.com/http
technicalStack: arbitrumnitro
1 change: 1 addition & 0 deletions chains/linea/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ nativeToken:
protocol: ethereum
rpcUrls:
- http: https://rpc.linea.build
- http: https://linea.drpc.org
1 change: 1 addition & 0 deletions chains/mantapacific/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ nativeToken:
protocol: ethereum
rpcUrls:
- http: https://pacific-rpc.manta.network/http
- http: https://manta.nirvanalabs.xyz/mantapublic
9 changes: 8 additions & 1 deletion chains/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ blast:
protocol: ethereum
rpcUrls:
- http: https://rpc.blast.io
- http: https://rpc.ankr.com/blast
technicalStack: other
bob:
blockExplorers:
Expand Down Expand Up @@ -497,7 +498,8 @@ cyber:
symbol: ETH
protocol: ethereum
rpcUrls:
- http: https://cyber-mainnet-archive.alt.technology
- http: https://rpc.cyber.co
- http: https://cyber.alt.technology
degenchain:
blockExplorers:
- apiUrl: https://explorer.degen.tips/api/eth-rpc
Expand Down Expand Up @@ -726,6 +728,7 @@ fraxtal:
protocol: ethereum
rpcUrls:
- http: https://rpc.frax.com
- http: https://fraxtal.drpc.org
fuji:
blockExplorers:
- apiUrl: https://api.routescan.io/v2/network/testnet/evm/43113/etherscan/api
Expand Down Expand Up @@ -907,6 +910,7 @@ inevm:
protocol: ethereum
rpcUrls:
- http: https://inevm.calderachain.xyz/http
- http: https://mainnet.rpc.inevm.com/http
technicalStack: arbitrumnitro
injective:
bech32Prefix: inj
Expand Down Expand Up @@ -1017,6 +1021,7 @@ linea:
protocol: ethereum
rpcUrls:
- http: https://rpc.linea.build
- http: https://linea.drpc.org
lisk:
blockExplorers:
- apiUrl: https://blockscout.lisk.com/api/eth-rpc
Expand Down Expand Up @@ -1122,6 +1127,7 @@ mantapacific:
protocol: ethereum
rpcUrls:
- http: https://pacific-rpc.manta.network/http
- http: https://manta.nirvanalabs.xyz/mantapublic
mantle:
blockExplorers:
- apiUrl: https://explorer.mantle.xyz/api
Expand Down Expand Up @@ -1273,6 +1279,7 @@ mode:
protocol: ethereum
rpcUrls:
- http: https://mainnet.mode.network
- http: https://mode.drpc.org
technicalStack: other
moonbeam:
blockExplorers:
Expand Down
1 change: 1 addition & 0 deletions chains/mode/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ nativeToken:
protocol: ethereum
rpcUrls:
- http: https://mainnet.mode.network
- http: https://mode.drpc.org
technicalStack: other
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"prepare": "husky",
"release": "yarn build && yarn changeset publish",
"test:unit": "yarn build && mocha --config .mocharc.json './test/unit/*.test.ts' --exit",
"test:health": "yarn build && mocha --config .mocharc.json './test/health/*.test.ts' --exit",
"test:health": "yarn build && mocha --config .mocharc.json './test/health/*.test.ts' --exit --parallel",
"version:prepare": "yarn changeset version && yarn install --no-immutable",
"version:check": "yarn changeset status"
},
Expand Down
14 changes: 8 additions & 6 deletions test/health/explorer-health.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,21 @@ import {
getExplorerTxUrl,
} from '../../node_modules/@hyperlane-xyz/sdk/dist/metadata/blockExplorer.js';

const HEALTH_CHECK_TIMEOUT = 10_000; // 10s
const HEALTH_CHECK_DELAY = 3_000; // 3s
const CHAINS_TO_SKIP = [
'base', // explorer works but has extremely strict rate limits
];

const HEALTH_CHECK_TIMEOUT = 15_000; // 15s
const HEALTH_CHECK_DELAY = 5_000; // 5s

const PROTOCOL_TO_ADDRESS: Record<ProtocolType, Address> = {
[ProtocolType.Ethereum]: '0x0000000000000000000000000000000000000000',
[ProtocolType.Sealevel]: '11111111111111111111111111111111',
[ProtocolType.Cosmos]: 'cosmos100000000000000000000000000000000000000',
};

const PROTOCOL_TO_TX_HASH: Record<ProtocolType, Address> = {
const PROTOCOL_TO_TX_HASH: Partial<Record<ProtocolType, Address>> = {
[ProtocolType.Ethereum]: '0x0000000000000000000000000000000000000000000000000000000000000000',
[ProtocolType.Sealevel]:
'1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111',
[ProtocolType.Cosmos]: '0000000000000000000000000000000000000000000000000000000000000000',
};

Expand Down Expand Up @@ -63,7 +65,7 @@ export async function isBlockExplorerHealthy(

describe('Chain block explorer health', async () => {
for (const [chain, metadata] of Object.entries(chainMetadata)) {
if (!metadata.blockExplorers?.length) continue;
if (!metadata.blockExplorers?.length || CHAINS_TO_SKIP.includes(chain)) continue;
it(`${chain} default explorer is healthy`, async () => {
const isHealthy = await isBlockExplorerHealthy(
metadata,
Expand Down
5 changes: 5 additions & 0 deletions test/health/rpc-health.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ import { chainAddresses, chainMetadata } from '../../dist/index.js';

import { Mailbox__factory } from '@hyperlane-xyz/core';

const CHAINS_TO_SKIP = [
'worldchain', // only allows private RPC access
];

const HEALTH_CHECK_TIMEOUT = 10_000; // 10s
const HEALTH_CHECK_DELAY = 3_000; // 3s

Expand Down Expand Up @@ -78,6 +82,7 @@ async function isCosmJsProviderHealthy(

describe('Chain RPC health', async () => {
for (const [chain, metadata] of Object.entries(chainMetadata)) {
if (CHAINS_TO_SKIP.includes(chain)) continue;
metadata.rpcUrls.map((rpc, i) => {
it(`${chain} RPC number ${i} is healthy`, async () => {
const isHealthy = await isRpcHealthy(rpc, metadata);
Expand Down

0 comments on commit 65ef674

Please sign in to comment.