Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update sandbox to use F-chain EVM chain IDs #685

Merged
merged 3 commits into from
Nov 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 46 additions & 51 deletions app/utils/chainUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,57 +59,49 @@ export const CHAIN_DOCS_URL: KeyValuePair<string> = {
"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 = [
commoddity marked this conversation as resolved.
Show resolved Hide resolved
"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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving it up to @fredteumer for manual review.

This is what we have onchain right now.

{
  "param_key": "pocketcore/SupportedBlockchains",
  "param_value": "[\"0001\",\"0003\",\"0004\",\"0005\",\"0006\",\"0009\",\"000A\",\"000B\",\"000C\",\"000F\",\"0010\",\"0012\",\"0021\",\"0022\",\"0024\",\"0025\",\"0026\",\"0027\",\"0028\",\"0040\",\"0044\",\"0046\",\"0047\",\"0048\",\"0049\",\"0050\",\"0051\",\"0052\",\"0053\",\"0054\",\"0056\",\"0057\",\"0058\",\"0059\",\"0060\",\"0061\",\"0063\",\"0065\",\"0066\",\"0067\",\"0068\",\"0069\",\"0070\",\"0071\",\"0072\",\"0074\",\"0075\",\"0076\",\"0077\",\"0078\",\"0079\",\"0080\",\"0081\",\"0082\",\"0083\",\"0084\",\"03DF\",\"7A00\",\"7A10\",\"A001\",\"A003\",\"A053\",\"A085\",\"A086\",\"A087\",\"A088\",\"A089\",\"A090\",\"A091\",\"A092\",\"A0CA\",\"A0CB\",\"A0CC\",\"A0CD\",\"B021\",\"B081\",\"BE2A\",\"C006\",\"E021\",\"F000\",\"F001\",\"F002\",\"F003\",\"F004\",\"F005\",\"F006\",\"F007\",\"F008\",\"F009\",\"F00A\",\"F00B\",\"F00C\",\"F00D\",\"F00E\",\"F00F\",\"F010\",\"F011\",\"F012\",\"F013\",\"F014\",\"F015\",\"F016\",\"F017\",\"F018\",\"F019\",\"F01A\",\"F01B\",\"F01C\",\"F01D\",\"F01E\",\"F01F\",\"F020\",\"F021\",\"F022\",\"F023\",\"F024\",\"F025\",\"F026\",\"F027\",\"F028\",\"F029\",\"F02A\",\"F02B\"]"
}

Copy link
Contributor

@fredteumer fredteumer Nov 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@commoddity please add:
"F02A", // zklink

only one miss, looks good otherwise!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@commoddity please add: "F02A", // zklink

only one miss, looks good otherwise!

Added to the file, PTAL.

"F02A", // zklink
"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 = [
Expand Down Expand Up @@ -146,8 +138,11 @@ export const evmMethods = [
"eth_syncing",
]

// isEvmChain uses the relay chain IDs defined in the evmChains array in this file
commoddity marked this conversation as resolved.
Show resolved Hide resolved
// 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.blockchain)
!!chain && evmChains.includes(chain.id)
commoddity marked this conversation as resolved.
Show resolved Hide resolved

export const getAppEndpointUrl = (
chain: Blockchain | undefined | null,
Expand Down
Loading