From 1be7ca7db6e7befee3fa3a5277f65fe15a047498 Mon Sep 17 00:00:00 2001 From: Pascal van Leeuwen Date: Tue, 19 Nov 2024 13:53:36 +0000 Subject: [PATCH 1/3] fix: update sandbox to use F-chain EVM chain IDs --- app/utils/chainUtils.ts | 88 +++++++++++++++++------------------------ 1 file changed, 37 insertions(+), 51 deletions(-) diff --git a/app/utils/chainUtils.ts b/app/utils/chainUtils.ts index 053537b6..6fbbb2e2 100644 --- a/app/utils/chainUtils.ts +++ b/app/utils/chainUtils.ts @@ -60,56 +60,42 @@ export const CHAIN_DOCS_URL: KeyValuePair = { } export const evmChains = [ - "amoy-testnet-archival", - "arbitrum-one", - "arbitrum-sepolia-archival", - "avax-archival", - "avax-dfk", - "avax-mainnet", - "base-mainnet", - "base-testnet", - "blast-archival", - "boba-mainnet", - "bsc-archival", - "bsc-mainnet", - "celo-mainnet", - "eth-archival", - "eth-goerli", - "eth-mainnet", - "eth-trace", - "evmos-mainnet", - "fraxtal-archival", - "fantom-mainnet", - "fuse-mainnet", - "fuse-archival", - "gnosischain-mainnet", - "gnosischain-archival", - "goerli-archival", - "harmony-0", - "holesky-fullnode-testnet", - "iotex-mainnet", - "kava-mainnet", - "kava-mainnet-archival", - "klaytn-mainnet", - "metis-mainnet", - "moonbeam-mainnet", - "moonriver-mainnet", - "oKc-mainnet", - "oasys-mainnet", - "oasys-mainnet-archival", - "opbnb-archival", - "optimism-mainnet", - "optimism-archival", - "optimism-sepolia-archival", - "poly-mainnet", - "poly-archival", - "polygon-mumbai", - "polygon-zkevm-mainnet", - "scroll-mainnet", - "scroll-testnet", - "sepolia", - "sepolia-archival", - "zksync-era-mainnet", + "F003", // avax + "F02B", // zksync-era + "F004", // avax-dfk + "F005", // base + "F006", // base-testnet + "F008", // blast + "F009", // bsc + "F00A", // boba + "F00B", // celo + "F00C", // eth + "F00D", // eth-holesky-testnet + "F00E", // eth-sepolia-testnet + "F00F", // evmos + "F010", // fantom + "F011", // fraxtal + "F012", // fuse + "F013", // gnosis + "F014", // harmony + "F015", // iotex + "F016", // kaia + "F017", // kava + "F018", // metis + "F019", // moonbeam + "F01A", // moonriver + "F01C", // oasys + "F01D", // optimism + "F01E", // optimism-sepolia-testnet + "F01F", // opbnb + "F021", // polygon + "F022", // polygon-amoy-testnet + "F024", // scroll + "F027", // taiko + "F028", // taiko-hekla-testnet + "F029", // polygon-zkevm + "F002", // arbitrum-sepolia-testnet + "F001", // arbitrum-one ] export const evmMethods = [ @@ -147,7 +133,7 @@ export const evmMethods = [ ] export const isEvmChain = (chain: Blockchain | null): boolean => - !!chain && evmChains.includes(chain.blockchain) + !!chain && evmChains.includes(chain.id) export const getAppEndpointUrl = ( chain: Blockchain | undefined | null, From 7d1b6f884aff618dc0c3b751c45eb575cd24b96c Mon Sep 17 00:00:00 2001 From: Pascal van Leeuwen Date: Tue, 19 Nov 2024 18:54:38 +0000 Subject: [PATCH 2/3] chore: update comments --- app/utils/chainUtils.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/utils/chainUtils.ts b/app/utils/chainUtils.ts index 6fbbb2e2..492b6e9e 100644 --- a/app/utils/chainUtils.ts +++ b/app/utils/chainUtils.ts @@ -59,6 +59,11 @@ export const CHAIN_DOCS_URL: KeyValuePair = { "zklink-nova-archival": "zklink-nova-api/endpoints/zklink-nova-archival", } +// evmChains is an array of the relay chain IDs for EVM chains. +// It must be updated whenever a new EVM chain is added to the relay. +// +// The current list of chain IDs on the protocol may be fetched with: +// pocket query params --remoteCLIURL https://pocket-rpc.liquify.com | tail -n +2 | jq '.pocket_params[] | select(.param_key == "pocketcore/SupportedBlockchains")' export const evmChains = [ "F003", // avax "F02B", // zksync-era @@ -132,6 +137,9 @@ export const evmMethods = [ "eth_syncing", ] +// isEvmChain uses the relay chain IDs defined in the evmChains array in this file +// Using the chain ID is more reliable than using the blockchain alias as it is strictly +// one to one. export const isEvmChain = (chain: Blockchain | null): boolean => !!chain && evmChains.includes(chain.id) From b4f2c52a80b86829fc84828f34f9eda758b0c5f7 Mon Sep 17 00:00:00 2001 From: commoddity <47662958+commoddity@users.noreply.github.com> Date: Thu, 21 Nov 2024 12:19:04 +0000 Subject: [PATCH 3/3] Update chainUtils.ts Add "F02A", // zklink --- app/utils/chainUtils.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/app/utils/chainUtils.ts b/app/utils/chainUtils.ts index 492b6e9e..f440d1b5 100644 --- a/app/utils/chainUtils.ts +++ b/app/utils/chainUtils.ts @@ -66,6 +66,7 @@ export const CHAIN_DOCS_URL: KeyValuePair = { // pocket query params --remoteCLIURL https://pocket-rpc.liquify.com | tail -n +2 | jq '.pocket_params[] | select(.param_key == "pocketcore/SupportedBlockchains")' export const evmChains = [ "F003", // avax + "F02A", // zklink "F02B", // zksync-era "F004", // avax-dfk "F005", // base