Skip to content

Commit

Permalink
Metadata Health Checks (#3030)
Browse files Browse the repository at this point in the history
### Description

- Create test to ensure SDK metadata RPCs and Explorers are healthy
- Exercise explorer link utils 
- Enable `sort-keys` eslint rule for SDK metadata
- Cleanup metadata and remove unhealthy RPC urls
- Remove NeutronTestnet

### Related issues

Fixes #2997

### Backward compatibility

Yes
  • Loading branch information
jmrossy authored Dec 7, 2023
1 parent 95ab709 commit 79c96d7
Show file tree
Hide file tree
Showing 18 changed files with 1,138 additions and 767 deletions.
5 changes: 5 additions & 0 deletions .changeset/wise-mangos-crash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@hyperlane-xyz/sdk': patch
---

Remove healthy RPC URLs and remove NeutronTestnet
28 changes: 28 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,34 @@ jobs:
- name: Unit Tests
run: yarn test

metadata-check:
runs-on: ubuntu-latest
needs: [yarn-build]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0

- name: yarn-cache
uses: actions/cache@v3
with:
path: |
**/node_modules
.yarn
key: ${{ runner.os }}-yarn-cache-${{ hashFiles('./yarn.lock') }}

- name: build-cache
uses: actions/cache@v3
with:
path: |
./*
!./rust
key: ${{ github.sha }}

- name: Metadata Health Check
run: yarn workspace @hyperlane-xyz/sdk run test:metadata

e2e:
runs-on: larger-runner
needs: [yarn-build]
Expand Down
2 changes: 1 addition & 1 deletion typescript/infra/config/environments/testnet4/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const neutron: RootAgentConfig = {
context: Contexts.Neutron,
rolesWithKeys: [Role.Relayer],
contextChainNames: {
relayer: [Chains.neutrontestnet, Chains.goerli],
relayer: [Chains.goerli],
validator: [],
scraper: [],
},
Expand Down
16 changes: 0 additions & 16 deletions typescript/infra/config/environments/testnet4/validators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,21 +323,5 @@ export const validatorChainConfig = (
// 'solanadevnet',
// ),
// },
neutrontestnet: {
interval: 5,
reorgPeriod: chainMetadata.neutrontestnet.blocks!.reorgPeriod!,
validators: validatorsConfig(
{
[Contexts.Hyperlane]: [
'0x5d2a99d67cd294a821de4fb25da6901ea8f89814',
'0xb57486243ce3bb3c38c50a582b8bbd20cb393589',
'0x661faee997654d14ead4ae48035883f05c3150cf',
],
[Contexts.ReleaseCandidate]: [],
[Contexts.Neutron]: [],
},
'neutrontestnet',
),
},
};
};
2 changes: 2 additions & 0 deletions typescript/infra/scripts/check-rpc-urls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { getSecretRpcEndpoint } from '../src/agents';

import { getArgs, getEnvironmentConfig } from './utils';

// TODO remove this script as part of migration to CLI
// It's redundant with metadata-check.ts in the SDK
async function main() {
const { environment } = await getArgs().argv;
const config = await getEnvironmentConfig(environment);
Expand Down
3 changes: 2 additions & 1 deletion typescript/sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@
"prettier": "prettier --write ./src",
"test": "yarn test:unit && yarn test:hardhat",
"test:unit": "mocha --config .mocharc.json './src/**/*.test.ts'",
"test:hardhat": "hardhat test $(find ./src -name \"*.hardhat-test.ts\")"
"test:hardhat": "hardhat test $(find ./src -name \"*.hardhat-test.ts\")",
"test:metadata": "ts-node ./src/test/metadata-check.ts"
},
"types": "dist/index.d.ts",
"peerDependencies": {
Expand Down
5 changes: 5 additions & 0 deletions typescript/sdk/src/consts/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"rules": {
"sort-keys": ["error"]
}
}
Loading

0 comments on commit 79c96d7

Please sign in to comment.