Skip to content

Commit

Permalink
Worldchain mainnet and Ink testnet support
Browse files Browse the repository at this point in the history
  • Loading branch information
bruce-riley committed Nov 13, 2024
1 parent cf4d642 commit aff68b3
Show file tree
Hide file tree
Showing 12 changed files with 305 additions and 287 deletions.
2 changes: 2 additions & 0 deletions common/src/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export const INITIAL_DEPLOYMENT_BLOCK_BY_NETWORK_AND_CHAIN: NetworkChainBlockMap
Sei: '238594',
Wormchain: '4510119', // https://bigdipper.live/wormhole/transactions/4D861F1BE86325D227FA006CA2745BBC6748AF5B5E0811DE536D02792928472A },
Snaxchain: '306315',
Worldchain: '5805110', // https://worldscan.org/tx/0x568eb14596296bda3022527cf0e915bfec073613b27c495e695fb9e08652f6fc
},
['Testnet']: {
Ethereum: '0',
Expand Down Expand Up @@ -86,6 +87,7 @@ export const INITIAL_DEPLOYMENT_BLOCK_BY_NETWORK_AND_CHAIN: NetworkChainBlockMap
Unichain: '254961', // Block of contract creation
Worldchain: '4487948', // Block of contract creation
MonadDevnet: '3670467', // Block of contract creation
Ink: '1907965', // Block of contract creation
},
['Devnet']: {},
};
Expand Down
8 changes: 8 additions & 0 deletions common/src/explorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ export const explorerBlock = (network: Network, chainId: ChainId, block: string)
? `https://snaxchain.io/${block}`
: chainId === chainToChainId('Wormchain')
? `https://bigdipper.live/wormhole/blocks/${block}`
: chainId === chainToChainId('Worldchain')
? `https://worldscan.org/block/${block}`
: ''
: chainId === chainToChainId('Solana')
? `https://explorer.solana.com/${block}?cluster=testnet`
Expand Down Expand Up @@ -138,6 +140,8 @@ export const explorerBlock = (network: Network, chainId: ChainId, block: string)
? `https://worldchain-sepolia.explorer.alchemy.com/block/${block}`
: chainId === chainToChainId('MonadDevnet')
? `${process.env.MONAD_DEVNET_EXPLORER_URL}/block/${block}`
: chainId === chainToChainId('Ink')
? `https://explorer-sepolia.inkonchain.com/block/${block}`
: // : chainId === chainToChainId('Wormscan') <-- not supported on testnet dashboard
'';

Expand Down Expand Up @@ -207,6 +211,8 @@ export const explorerTx = (network: Network, chainId: ChainId, tx: string) =>
? `https://snaxchain.io/tx/${tx}`
: chainId === chainToChainId('Wormchain')
? `https://bigdipper.live/wormhole/transactions/${tx}`
: chainId === chainToChainId('Worldchain')
? `https://worldscan.org/tx/${tx}`
: ''
: chainId === chainToChainId('Solana')
? `https://solscan.io/txs/${tx}?cluster=testnet`
Expand Down Expand Up @@ -271,6 +277,8 @@ export const explorerTx = (network: Network, chainId: ChainId, tx: string) =>
? `https://worldchain-sepolia.explorer.alchemy.com/tx/${tx}`
: chainId === chainToChainId('MonadDevnet')
? `${process.env.MONAD_DEVNET_EXPLORER_URL}/tx/${tx}`
: chainId === chainToChainId('Ink')
? `https://explorer-sepolia.inkonchain.com/tx/${tx}`
: // chainId === chainToChainId('Wormscan') <-- not supported on testnet dashboard
'';

Expand Down
2 changes: 1 addition & 1 deletion dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@types/node": "^18.6.4",
"@types/react": "^18.0.15",
"@types/react-dom": "^18.0.6",
"@wormhole-foundation/sdk-icons": "^0.14.0",
"@wormhole-foundation/sdk-icons": "^1.1.0",
"buffer": "^6.0.3",
"numeral": "^2.0.6",
"react": "^18.2.0",
Expand Down
2 changes: 1 addition & 1 deletion database/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@injectivelabs/sdk-ts": "^1.0.368",
"@mysten/sui.js": "^0.50.1",
"@terra-money/terra.js": "^3.1.3",
"@wormhole-foundation/sdk": "^0.14.0",
"@wormhole-foundation/sdk": "^1.1.0",
"@xpla/xpla.js": "^0.2.3",
"aptos": "1.5.0",
"dotenv": "^16.0.3",
Expand Down
4 changes: 2 additions & 2 deletions fly/cmd/historical_uptime/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ var (
)

// [0, MAX_CHAIN_ID] is the range of chain id that we will track for the uptime monitor
// in this case it's snaxchain since it's the largest mainnet chain idj
const MAX_CHAIN_ID = vaa.ChainIDSnaxchain
// in this case it's worldchain since it's the largest mainnet chain idj
const MAX_CHAIN_ID = vaa.ChainIDWorldchain

// guardianChainHeights indexes current chain height by chain id and guardian name
var guardianChainHeights = make(common.GuardianChainHeights)
Expand Down
552 changes: 276 additions & 276 deletions package-lock.json

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
},
"dependencies": {
"@google-cloud/functions-framework": "^3.4.0",
"@wormhole-foundation/sdk-base": "^0.14.0",
"@wormhole-foundation/sdk-definitions": "^0.14.0",
"@wormhole-foundation/sdk-evm": "^0.14.0",
"@wormhole-foundation/sdk-evm-core": "^0.14.0",
"@wormhole-foundation/sdk-icons": "^0.14.0",
"@wormhole-foundation/sdk-solana": "^0.14.0",
"@wormhole-foundation/sdk-solana-core": "^0.14.0",
"@wormhole-foundation/sdk-base": "^1.1.0",
"@wormhole-foundation/sdk-definitions": "^1.1.0",
"@wormhole-foundation/sdk-evm": "^1.1.0",
"@wormhole-foundation/sdk-evm-core": "^1.1.0",
"@wormhole-foundation/sdk-icons": "^1.1.0",
"@wormhole-foundation/sdk-solana": "^1.1.0",
"@wormhole-foundation/sdk-solana-core": "^1.1.0",
"axios": "^1.5.0"
}
}
2 changes: 2 additions & 0 deletions watcher/src/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export const RPCS_BY_CHAIN: { [key in Network]: { [key in Chain]?: string } } =
Wormchain: process.env.WORMCHAIN_RPC || 'https://wormchain-rpc.quickapi.com',
Xlayer: process.env.XLAYER_RPC || 'https://rpc.ankr.com/xlayer',
Snaxchain: process.env.SNAXCHAIN_RPC || 'https://snaxchain.io',
Worldchain: process.env.WORLDCHAIN_RPC || 'https://worldchain-mainnet.g.alchemy.com/public',
},
['Testnet']: {
Ethereum: process.env.ETH_RPC,
Expand Down Expand Up @@ -104,6 +105,7 @@ export const RPCS_BY_CHAIN: { [key in Network]: { [key in Chain]?: string } } =
Unichain: process.env.UNICHAIN_RPC || 'https://sepolia.unichain.org',
Worldchain: process.env.WORLDCHAIN_RPC || 'https://worldchain-sepolia.g.alchemy.com/public',
MonadDevnet: process.env.MONAD_DEVNET_RPC, // TODO: There is no Monad Devnet public endpoint.
Ink: process.env.INK_RPC || 'https://rpc-qnd-sepolia.inkonchain.com',
},
['Devnet']: {},
};
Expand Down
2 changes: 2 additions & 0 deletions watcher/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const supportedChains: Chain[] =
'Unichain',
'Worldchain',
'MonadDevnet',
'Ink',
]
: [
// This is the list of chains supported in MAINNET.
Expand Down Expand Up @@ -89,6 +90,7 @@ const supportedChains: Chain[] =
'Blast',
'Xlayer',
'Snaxchain',
'Worldchain',
'Wormchain',
];

Expand Down
2 changes: 2 additions & 0 deletions watcher/src/watchers/CosmwasmWatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export class CosmwasmWatcher extends Watcher {
return SHA256.hash(Base64.parse(data)).toString().toUpperCase();
}

/* These two tests are failing for Terra2. Opened an issue to address it: https://github.com/wormhole-foundation/wormhole-dashboard/issues/386
async getFinalizedBlockNumber(): Promise<number> {
const result = (await axios.get(`${this.rpc}/${this.latestBlockTag}`, AXIOS_CONFIG_JSON)).data;
if (result && result.block.header.height) {
Expand Down Expand Up @@ -155,6 +156,7 @@ export class CosmwasmWatcher extends Watcher {
}
return vaasByBlock;
}
*/
}

export type CosmwasmBlockResult = {
Expand Down
1 change: 1 addition & 0 deletions watcher/src/watchers/EVMWatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export class EVMWatcher extends Watcher {
chain === 'Unichain' ||
chain === 'Worldchain' ||
chain === 'MonadDevnet' ||
chain === 'Ink' ||
chain === 'Xlayer'
) {
this.maximumBatchSize = 10;
Expand Down
1 change: 1 addition & 0 deletions watcher/src/watchers/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export function makeFinalizedWatcher(network: Network, chainName: Chain): Watche
chainName === 'Unichain' ||
chainName === 'Worldchain' ||
chainName === 'MonadDevnet' ||
chainName === 'Ink' ||
chainName === 'Base'
) {
return new EVMWatcher(network, chainName);
Expand Down

0 comments on commit aff68b3

Please sign in to comment.