diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4e73c79..bb67b4c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: oven-sh/setup-bun@v1 + - uses: oven-sh/setup-bun@v2 + with: + bun-version: latest - name: Install dependencies run: bun install @@ -24,7 +26,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: oven-sh/setup-bun@v1 + - uses: oven-sh/setup-bun@v2 + with: + bun-version: latest - name: Install dependencies run: bun install diff --git a/.github/workflows/fetch-data.yml b/.github/workflows/fetch-data.yml index f82a2c3..19bb0dd 100644 --- a/.github/workflows/fetch-data.yml +++ b/.github/workflows/fetch-data.yml @@ -13,7 +13,14 @@ jobs: ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }} steps: - uses: actions/checkout@v4 - - uses: oven-sh/setup-bun@v1 + - uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + + - name: Print versions + run: | + bun --version + bun -p process.version - name: Install dependencies run: bun install diff --git a/bun.lockb b/bun.lockb index 0260b75..20e64bb 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/script/archive/precompile-check.ts b/script/archive/precompile-check.ts index 283eaa4..6dcd862 100644 --- a/script/archive/precompile-check.ts +++ b/script/archive/precompile-check.ts @@ -4,7 +4,7 @@ // they are precompiles or predeploys, and prints the result. // Example usage: // bun script/precompile-check.ts optimism -import { http, type Address, createPublicClient, getAddress } from 'viem'; +import { http, type Address, createPublicClient, getAddress, type GetBytecodeReturnType } from 'viem'; import { type Chain, arbitrum, optimism } from 'viem/chains'; type ChainConfig = { @@ -74,8 +74,11 @@ async function main() { const transport = http(rpcUrl, { batch: true }); const client = createPublicClient({ chain, transport }); - const promises = addresses.map((address) => client.getBytecode({ address })); - const codes = await Promise.all(promises); + const codes: GetBytecodeReturnType[] = [] + for (const address of addresses) { + const code = await client.getBytecode({ address }); + codes.push(code); + } const kinds = codes.map((code) => code === '0x' || code === '0xfe' ? 'precompile' : 'predeploy', ); diff --git a/script/checks/deployed-contracts.ts b/script/checks/deployed-contracts.ts index 91e4f47..46d2f26 100644 --- a/script/checks/deployed-contracts.ts +++ b/script/checks/deployed-contracts.ts @@ -5,12 +5,13 @@ const NO_CODE_HASH = keccak256('0x'); export async function checkDeployedContracts( client: PublicClient, ): Promise<{ name: string; address: Address; codeHash: Hex; hasCode: boolean }[]> { - const result = deployedContracts.map(async ({ name, address }) => { + const result = []; + for (const { name, address } of deployedContracts) { const code = await client.getBytecode({ address }); const codeHash = (code && keccak256(code)) || NO_CODE_HASH; - return { name, address, codeHash, hasCode: codeHash !== NO_CODE_HASH }; - }); - return await Promise.all(result); + result.push({ name, address, codeHash, hasCode: codeHash !== NO_CODE_HASH }); + } + return result; } export const deployedContracts: { name: string; address: Address }[] = [ diff --git a/script/checks/evm-stack-addresses.ts b/script/checks/evm-stack-addresses.ts index b4f0b6d..f661751 100644 --- a/script/checks/evm-stack-addresses.ts +++ b/script/checks/evm-stack-addresses.ts @@ -26,13 +26,13 @@ export async function checkEvmStackAddresses( for (const stack of Object.keys(evmStackAddresses)) { const stackPredploys = evmStackAddresses[stack as EVMStack]; - const res = stackPredploys.map(async ({ name, address, kind }) => { + result[stack as EVMStack] = []; + for (const { name, address, kind } of stackPredploys) { const code = await client.getBytecode({ address }); const codeHash = (code && keccak256(code)) || NO_CODE_HASH; const exists = evmStackAddressExists(stack as EVMStack, codeHash); - return { name, address, kind, codeHash, exists }; - }); - result[stack as EVMStack] = await Promise.all(res); + result[stack as EVMStack].push({ name, address, kind, codeHash, exists }); + } } return result; diff --git a/script/checks/opcodes.ts b/script/checks/opcodes.ts index e5f04cd..fe19718 100644 --- a/script/checks/opcodes.ts +++ b/script/checks/opcodes.ts @@ -1,13 +1,15 @@ import { type Hex, type PublicClient, toHex } from 'viem'; type Opcode = number; -type CallError = { details: string }; export async function checkOpcodes( client: PublicClient, ): Promise<{ number: Hex; name: string; supported: boolean | string }[]> { const opcodes = Array.from(Array(0xff + 1).keys()); - const supported = await Promise.all(opcodes.map(async (opcode) => checkOpcode(opcode, client))); + const supported: Array = []; + for (const opcode of opcodes) { + supported.push(await checkOpcode(opcode, client)); + } const result: { number: Hex; name: string; supported: boolean | string }[] = []; opcodes.forEach((opcode, index) => { @@ -29,15 +31,34 @@ async function checkOpcode(opcode: Opcode, client: PublicClient): Promise = { 0x1b: 'SHL', 0x1c: 'SHR', 0x1d: 'SAR', + 0x1e: 'CLZ', 0x20: 'KECCAK256', 0x30: 'ADDRESS', 0x31: 'BALANCE', diff --git a/script/checks/precompiles.ts b/script/checks/precompiles.ts index 8350833..3b86d76 100644 --- a/script/checks/precompiles.ts +++ b/script/checks/precompiles.ts @@ -3,17 +3,19 @@ import type { Address, Hex, PublicClient } from 'viem'; export async function checkPrecompiles( client: PublicClient, ): Promise<{ name: string; address: Address; implemented: boolean }[]> { - const result = precompiles.map(async ({ name, address, testCalldata, expectedResponse }) => { + const result = []; + + for (const { name, address, testCalldata, expectedResponse } of precompiles) { try { const res = await client.call({ to: address, data: testCalldata }); const implemented = res.data === expectedResponse; - return { name, address, implemented }; + result.push({ name, address, implemented }); } catch (e) { // If the call fails, the precompile is not implemented. - return { name, address, implemented: false }; + result.push({ name, address, implemented: false }); } - }); - return await Promise.all(result); + } + return result; } // By default a call to an EOA succeeds and returns no data, therefore we cannot simply use a diff --git a/script/data/chain/1.json b/script/data/chain/1.json index 7ad7e8f..f48d3fd 100644 --- a/script/data/chain/1.json +++ b/script/data/chain/1.json @@ -77,6 +77,7 @@ { "number": "0x1b", "name": "SHL", "supported": true }, { "number": "0x1c", "name": "SHR", "supported": true }, { "number": "0x1d", "name": "SAR", "supported": true }, + { "number": "0x1e", "name": "CLZ", "supported": true }, { "number": "0x20", "name": "KECCAK256", "supported": true }, { "number": "0x30", "name": "ADDRESS", "supported": true }, { "number": "0x31", "name": "BALANCE", "supported": true }, @@ -299,7 +300,7 @@ { "name": "secp256r1", "address": "0x0000000000000000000000000000000000000100", - "implemented": false + "implemented": true } ], "evmStackAddresses": { diff --git a/script/data/chain/10.json b/script/data/chain/10.json index 3314ff4..325cfca 100644 --- a/script/data/chain/10.json +++ b/script/data/chain/10.json @@ -63,6 +63,7 @@ { "number": "0x1b", "name": "SHL", "supported": true }, { "number": "0x1c", "name": "SHR", "supported": true }, { "number": "0x1d", "name": "SAR", "supported": true }, + { "number": "0x1e", "name": "CLZ", "supported": false }, { "number": "0x20", "name": "KECCAK256", "supported": true }, { "number": "0x30", "name": "ADDRESS", "supported": true }, { "number": "0x31", "name": "BALANCE", "supported": true }, diff --git a/script/data/chain/137.json b/script/data/chain/137.json index 0bd2cbc..969710f 100644 --- a/script/data/chain/137.json +++ b/script/data/chain/137.json @@ -63,6 +63,7 @@ { "number": "0x1b", "name": "SHL", "supported": true }, { "number": "0x1c", "name": "SHR", "supported": true }, { "number": "0x1d", "name": "SAR", "supported": true }, + { "number": "0x1e", "name": "CLZ", "supported": false }, { "number": "0x20", "name": "KECCAK256", "supported": true }, { "number": "0x30", "name": "ADDRESS", "supported": true }, { "number": "0x31", "name": "BALANCE", "supported": true }, @@ -280,7 +281,7 @@ { "name": "point evaluation", "address": "0x000000000000000000000000000000000000000a", - "implemented": false + "implemented": true }, { "name": "secp256r1", diff --git a/script/data/chain/34443.json b/script/data/chain/34443.json index a58d412..4e36d45 100644 --- a/script/data/chain/34443.json +++ b/script/data/chain/34443.json @@ -13,7 +13,12 @@ ], "faucets": [], "icon": "mode", - "rpc": ["https://mainnet.mode.network", "https://mode.drpc.org", "wss://mode.drpc.org"] + "rpc": [ + "https://mainnet.mode.network", + "https://mode.drpc.org", + "wss://mode.drpc.org", + "https://mode-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}" + ] }, "opcodes": [ { "number": "0x00", "name": "STOP", "supported": true }, @@ -42,6 +47,7 @@ { "number": "0x1b", "name": "SHL", "supported": true }, { "number": "0x1c", "name": "SHR", "supported": true }, { "number": "0x1d", "name": "SAR", "supported": true }, + { "number": "0x1e", "name": "CLZ", "supported": false }, { "number": "0x20", "name": "KECCAK256", "supported": true }, { "number": "0x30", "name": "ADDRESS", "supported": true }, { "number": "0x31", "name": "BALANCE", "supported": true }, diff --git a/script/data/chain/42161.json b/script/data/chain/42161.json index c3e73ca..be543af 100644 --- a/script/data/chain/42161.json +++ b/script/data/chain/42161.json @@ -58,6 +58,7 @@ { "number": "0x1b", "name": "SHL", "supported": true }, { "number": "0x1c", "name": "SHR", "supported": true }, { "number": "0x1d", "name": "SAR", "supported": true }, + { "number": "0x1e", "name": "CLZ", "supported": true }, { "number": "0x20", "name": "KECCAK256", "supported": true }, { "number": "0x30", "name": "ADDRESS", "supported": true }, { "number": "0x31", "name": "BALANCE", "supported": true }, diff --git a/script/data/chain/43114.json b/script/data/chain/43114.json index d743627..6d07881 100644 --- a/script/data/chain/43114.json +++ b/script/data/chain/43114.json @@ -21,7 +21,8 @@ "wss://avalanche-c-chain-rpc.publicnode.com", "https://rpc.ankr.com/avalanche", "https://ava-mainnet.public.blastapi.io/ext/bc/C/rpc", - "https://avalanche-mainnet.infura.io/v3/${INFURA_API_KEY}" + "https://avalanche-mainnet.infura.io/v3/${INFURA_API_KEY}", + "https://avax-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}" ], "slip44": 9005 }, @@ -52,6 +53,7 @@ { "number": "0x1b", "name": "SHL", "supported": true }, { "number": "0x1c", "name": "SHR", "supported": true }, { "number": "0x1d", "name": "SAR", "supported": true }, + { "number": "0x1e", "name": "CLZ", "supported": false }, { "number": "0x20", "name": "KECCAK256", "supported": true }, { "number": "0x30", "name": "ADDRESS", "supported": true }, { "number": "0x31", "name": "BALANCE", "supported": true }, @@ -274,7 +276,7 @@ { "name": "secp256r1", "address": "0x0000000000000000000000000000000000000100", - "implemented": false + "implemented": true } ], "evmStackAddresses": { diff --git a/script/data/chain/534352.json b/script/data/chain/534352.json index 71ba0d6..5f29fe5 100644 --- a/script/data/chain/534352.json +++ b/script/data/chain/534352.json @@ -52,6 +52,7 @@ { "number": "0x1b", "name": "SHL", "supported": true }, { "number": "0x1c", "name": "SHR", "supported": true }, { "number": "0x1d", "name": "SAR", "supported": true }, + { "number": "0x1e", "name": "CLZ", "supported": true }, { "number": "0x20", "name": "KECCAK256", "supported": true }, { "number": "0x30", "name": "ADDRESS", "supported": true }, { "number": "0x31", "name": "BALANCE", "supported": true }, @@ -274,7 +275,7 @@ { "name": "secp256r1", "address": "0x0000000000000000000000000000000000000100", - "implemented": false + "implemented": true } ], "evmStackAddresses": { diff --git a/script/data/chain/59144.json b/script/data/chain/59144.json index 6c679d9..5d2238d 100644 --- a/script/data/chain/59144.json +++ b/script/data/chain/59144.json @@ -68,6 +68,7 @@ { "number": "0x1b", "name": "SHL", "supported": true }, { "number": "0x1c", "name": "SHR", "supported": true }, { "number": "0x1d", "name": "SAR", "supported": true }, + { "number": "0x1e", "name": "CLZ", "supported": true }, { "number": "0x20", "name": "KECCAK256", "supported": true }, { "number": "0x30", "name": "ADDRESS", "supported": true }, { "number": "0x31", "name": "BALANCE", "supported": true }, @@ -94,8 +95,8 @@ { "number": "0x46", "name": "CHAINID", "supported": true }, { "number": "0x47", "name": "SELFBALANCE", "supported": true }, { "number": "0x48", "name": "BASEFEE", "supported": true }, - { "number": "0x49", "name": "BLOBHASH", "supported": false }, - { "number": "0x4a", "name": "BLOBBASEFEE", "supported": false }, + { "number": "0x49", "name": "BLOBHASH", "supported": true }, + { "number": "0x4a", "name": "BLOBBASEFEE", "supported": true }, { "number": "0x50", "name": "POP", "supported": true }, { "number": "0x51", "name": "MLOAD", "supported": true }, { "number": "0x52", "name": "MSTORE", "supported": true }, @@ -108,10 +109,10 @@ { "number": "0x59", "name": "MSIZE", "supported": true }, { "number": "0x5a", "name": "GAS", "supported": true }, { "number": "0x5b", "name": "JUMPDEST", "supported": true }, - { "number": "0x5c", "name": "TLOAD", "supported": false }, - { "number": "0x5d", "name": "TSTORE", "supported": false }, - { "number": "0x5e", "name": "MCOPY", "supported": false }, - { "number": "0x5f", "name": "PUSH0", "supported": false }, + { "number": "0x5c", "name": "TLOAD", "supported": true }, + { "number": "0x5d", "name": "TSTORE", "supported": true }, + { "number": "0x5e", "name": "MCOPY", "supported": true }, + { "number": "0x5f", "name": "PUSH0", "supported": true }, { "number": "0x60", "name": "PUSH1", "supported": true }, { "number": "0x61", "name": "PUSH2", "supported": true }, { "number": "0x62", "name": "PUSH3", "supported": true }, @@ -285,12 +286,12 @@ { "name": "point evaluation", "address": "0x000000000000000000000000000000000000000a", - "implemented": false + "implemented": true }, { "name": "secp256r1", "address": "0x0000000000000000000000000000000000000100", - "implemented": false + "implemented": true } ], "evmStackAddresses": { diff --git a/script/data/chain/8453.json b/script/data/chain/8453.json index 6e1ed59..40b8e8b 100644 --- a/script/data/chain/8453.json +++ b/script/data/chain/8453.json @@ -64,6 +64,7 @@ { "number": "0x1b", "name": "SHL", "supported": true }, { "number": "0x1c", "name": "SHR", "supported": true }, { "number": "0x1d", "name": "SAR", "supported": true }, + { "number": "0x1e", "name": "CLZ", "supported": false }, { "number": "0x20", "name": "KECCAK256", "supported": true }, { "number": "0x30", "name": "ADDRESS", "supported": true }, { "number": "0x31", "name": "BALANCE", "supported": true }, diff --git a/script/data/feature/metadata.json b/script/data/feature/metadata.json index d3a1c0f..e3f657d 100644 --- a/script/data/feature/metadata.json +++ b/script/data/feature/metadata.json @@ -176,7 +176,12 @@ ], "faucets": [], "icon": "mode", - "rpc": ["https://mainnet.mode.network", "https://mode.drpc.org", "wss://mode.drpc.org"] + "rpc": [ + "https://mainnet.mode.network", + "https://mode.drpc.org", + "wss://mode.drpc.org", + "https://mode-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}" + ] }, "42161": { "name": "Arbitrum One", @@ -232,7 +237,8 @@ "wss://avalanche-c-chain-rpc.publicnode.com", "https://rpc.ankr.com/avalanche", "https://ava-mainnet.public.blastapi.io/ext/bc/C/rpc", - "https://avalanche-mainnet.infura.io/v3/${INFURA_API_KEY}" + "https://avalanche-mainnet.infura.io/v3/${INFURA_API_KEY}", + "https://avax-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}" ], "slip44": 9005 }, diff --git a/script/data/feature/opcodes.json b/script/data/feature/opcodes.json index a883d76..44ebf39 100644 --- a/script/data/feature/opcodes.json +++ b/script/data/feature/opcodes.json @@ -26,6 +26,7 @@ { "number": "0x1b", "name": "SHL", "supported": true }, { "number": "0x1c", "name": "SHR", "supported": true }, { "number": "0x1d", "name": "SAR", "supported": true }, + { "number": "0x1e", "name": "CLZ", "supported": true }, { "number": "0x20", "name": "KECCAK256", "supported": true }, { "number": "0x30", "name": "ADDRESS", "supported": true }, { "number": "0x31", "name": "BALANCE", "supported": true }, @@ -177,6 +178,7 @@ { "number": "0x1b", "name": "SHL", "supported": true }, { "number": "0x1c", "name": "SHR", "supported": true }, { "number": "0x1d", "name": "SAR", "supported": true }, + { "number": "0x1e", "name": "CLZ", "supported": false }, { "number": "0x20", "name": "KECCAK256", "supported": true }, { "number": "0x30", "name": "ADDRESS", "supported": true }, { "number": "0x31", "name": "BALANCE", "supported": true }, @@ -328,6 +330,7 @@ { "number": "0x1b", "name": "SHL", "supported": true }, { "number": "0x1c", "name": "SHR", "supported": true }, { "number": "0x1d", "name": "SAR", "supported": true }, + { "number": "0x1e", "name": "CLZ", "supported": false }, { "number": "0x20", "name": "KECCAK256", "supported": true }, { "number": "0x30", "name": "ADDRESS", "supported": true }, { "number": "0x31", "name": "BALANCE", "supported": true }, @@ -479,6 +482,7 @@ { "number": "0x1b", "name": "SHL", "supported": true }, { "number": "0x1c", "name": "SHR", "supported": true }, { "number": "0x1d", "name": "SAR", "supported": true }, + { "number": "0x1e", "name": "CLZ", "supported": false }, { "number": "0x20", "name": "KECCAK256", "supported": true }, { "number": "0x30", "name": "ADDRESS", "supported": true }, { "number": "0x31", "name": "BALANCE", "supported": true }, @@ -630,6 +634,7 @@ { "number": "0x1b", "name": "SHL", "supported": true }, { "number": "0x1c", "name": "SHR", "supported": true }, { "number": "0x1d", "name": "SAR", "supported": true }, + { "number": "0x1e", "name": "CLZ", "supported": false }, { "number": "0x20", "name": "KECCAK256", "supported": true }, { "number": "0x30", "name": "ADDRESS", "supported": true }, { "number": "0x31", "name": "BALANCE", "supported": true }, @@ -781,6 +786,7 @@ { "number": "0x1b", "name": "SHL", "supported": true }, { "number": "0x1c", "name": "SHR", "supported": true }, { "number": "0x1d", "name": "SAR", "supported": true }, + { "number": "0x1e", "name": "CLZ", "supported": true }, { "number": "0x20", "name": "KECCAK256", "supported": true }, { "number": "0x30", "name": "ADDRESS", "supported": true }, { "number": "0x31", "name": "BALANCE", "supported": true }, @@ -932,6 +938,7 @@ { "number": "0x1b", "name": "SHL", "supported": true }, { "number": "0x1c", "name": "SHR", "supported": true }, { "number": "0x1d", "name": "SAR", "supported": true }, + { "number": "0x1e", "name": "CLZ", "supported": false }, { "number": "0x20", "name": "KECCAK256", "supported": true }, { "number": "0x30", "name": "ADDRESS", "supported": true }, { "number": "0x31", "name": "BALANCE", "supported": true }, @@ -1083,6 +1090,7 @@ { "number": "0x1b", "name": "SHL", "supported": true }, { "number": "0x1c", "name": "SHR", "supported": true }, { "number": "0x1d", "name": "SAR", "supported": true }, + { "number": "0x1e", "name": "CLZ", "supported": true }, { "number": "0x20", "name": "KECCAK256", "supported": true }, { "number": "0x30", "name": "ADDRESS", "supported": true }, { "number": "0x31", "name": "BALANCE", "supported": true }, @@ -1109,8 +1117,8 @@ { "number": "0x46", "name": "CHAINID", "supported": true }, { "number": "0x47", "name": "SELFBALANCE", "supported": true }, { "number": "0x48", "name": "BASEFEE", "supported": true }, - { "number": "0x49", "name": "BLOBHASH", "supported": false }, - { "number": "0x4a", "name": "BLOBBASEFEE", "supported": false }, + { "number": "0x49", "name": "BLOBHASH", "supported": true }, + { "number": "0x4a", "name": "BLOBBASEFEE", "supported": true }, { "number": "0x50", "name": "POP", "supported": true }, { "number": "0x51", "name": "MLOAD", "supported": true }, { "number": "0x52", "name": "MSTORE", "supported": true }, @@ -1123,10 +1131,10 @@ { "number": "0x59", "name": "MSIZE", "supported": true }, { "number": "0x5a", "name": "GAS", "supported": true }, { "number": "0x5b", "name": "JUMPDEST", "supported": true }, - { "number": "0x5c", "name": "TLOAD", "supported": false }, - { "number": "0x5d", "name": "TSTORE", "supported": false }, - { "number": "0x5e", "name": "MCOPY", "supported": false }, - { "number": "0x5f", "name": "PUSH0", "supported": false }, + { "number": "0x5c", "name": "TLOAD", "supported": true }, + { "number": "0x5d", "name": "TSTORE", "supported": true }, + { "number": "0x5e", "name": "MCOPY", "supported": true }, + { "number": "0x5f", "name": "PUSH0", "supported": true }, { "number": "0x60", "name": "PUSH1", "supported": true }, { "number": "0x61", "name": "PUSH2", "supported": true }, { "number": "0x62", "name": "PUSH3", "supported": true }, @@ -1234,6 +1242,7 @@ { "number": "0x1b", "name": "SHL", "supported": true }, { "number": "0x1c", "name": "SHR", "supported": true }, { "number": "0x1d", "name": "SAR", "supported": true }, + { "number": "0x1e", "name": "CLZ", "supported": true }, { "number": "0x20", "name": "KECCAK256", "supported": true }, { "number": "0x30", "name": "ADDRESS", "supported": true }, { "number": "0x31", "name": "BALANCE", "supported": true }, diff --git a/script/data/feature/precompiles.json b/script/data/feature/precompiles.json index 8485c68..25b9280 100644 --- a/script/data/feature/precompiles.json +++ b/script/data/feature/precompiles.json @@ -53,7 +53,7 @@ { "name": "secp256r1", "address": "0x0000000000000000000000000000000000000100", - "implemented": false + "implemented": true } ], "10": [ @@ -162,7 +162,7 @@ { "name": "point evaluation", "address": "0x000000000000000000000000000000000000000a", - "implemented": false + "implemented": true }, { "name": "secp256r1", @@ -395,7 +395,7 @@ { "name": "secp256r1", "address": "0x0000000000000000000000000000000000000100", - "implemented": false + "implemented": true } ], "59144": [ @@ -447,12 +447,12 @@ { "name": "point evaluation", "address": "0x000000000000000000000000000000000000000a", - "implemented": false + "implemented": true }, { "name": "secp256r1", "address": "0x0000000000000000000000000000000000000100", - "implemented": false + "implemented": true } ], "534352": [ @@ -509,7 +509,7 @@ { "name": "secp256r1", "address": "0x0000000000000000000000000000000000000100", - "implemented": false + "implemented": true } ] } diff --git a/script/index.ts b/script/index.ts index ad91ca4..32dd956 100644 --- a/script/index.ts +++ b/script/index.ts @@ -40,12 +40,12 @@ async function main() { const client = initClient(rpcUrls); // Fetch data. - const [opcodes, deployedContracts, precompiles, evmStackAddresses] = await Promise.all([ - checkOpcodes(client), - checkDeployedContracts(client), - checkPrecompiles(client), - checkEvmStackAddresses(client), - ]); + const [opcodes, deployedContracts, precompiles, evmStackAddresses] = [ + await checkOpcodes(client), + await checkDeployedContracts(client), + await checkPrecompiles(client), + await checkEvmStackAddresses(client), + ]; // Format and save the output. const chain: Chain = { @@ -126,37 +126,22 @@ function selectRpcUrls(rpcUrls: string[]): string[] { return str; }; - // These domains have various issues that make them unsuitable for our purposes. - const domainsToSkip = [ - 'drpc.org', // Required "to" is empty. - 'blocknative.com', // Transaction creation failed. - 'flashbots.net', // 403 (also on eth_call with no to). - 'mevblocker.io', // 429's easily. - 'matic-mainnet-full-rpc.bwarelabs.com', // "This endpoint is deprecated". - 'publicnode.com', // Transaction creation failed. - 'cloudflare', // Requested resource not found. - 'api.avax.network', // Unrecognized token '<', 429's easily. - 'rpc.linea.build', // All error messages are identical so can't distinguish opcode support. - ]; - const filteredRpcUrls = rpcUrls.filter( - (url) => !domainsToSkip.some((domain) => url.includes(domain)), - ); - - // Check for URLs with placeholders and replace with API key if available. In this case, we - // return this URL as the selected RPC URL. Preferring URLs with API keys this way helps - // avoid rate limits and other issues. + // Use only URLs with placeholders and replace with API key if available. In this case, we + // return this URL as the selected RPC URL. const replacedUrls: string[] = []; - const normalUrls: string[] = []; - for (const url of filteredRpcUrls) { + for (const url of rpcUrls) { if (hasPlaceholder(url)) { const replacedUrl = replacePlaceholder(url); if (replacedUrl !== url) replacedUrls.push(replacedUrl); - } else { - normalUrls.push(url); } } - return [...replacedUrls, ...normalUrls]; // Prefer URLs with API keys. + if (replacedUrls.length === 0) { + console.error('No RPC URLs with API keys found for this chain'); + process.exit(1); + } + + return replacedUrls; } main().catch((error) => { diff --git a/script/input.json b/script/input.json index 922c9bb..eea1e8a 100644 --- a/script/input.json +++ b/script/input.json @@ -22,11 +22,14 @@ }, { "chainId": 8453, - "rpcUrls": ["https://base-mainnet.infura.io/v3/${INFURA_API_KEY}"] + "rpcUrls": [ + "https://base-mainnet.infura.io/v3/${INFURA_API_KEY}", + "https://base-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}" + ] }, { "chainId": 34443, - "rpcUrls": [] + "rpcUrls": ["https://mode-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}"] }, { "chainId": 42161, @@ -41,7 +44,8 @@ "https://avalanche-c-chain-rpc.publicnode.com", "https://rpc.ankr.com/avalanche", "https://ava-mainnet.public.blastapi.io/ext/bc/C/rpc", - "https://avalanche-mainnet.infura.io/v3/${INFURA_API_KEY}" + "https://avalanche-mainnet.infura.io/v3/${INFURA_API_KEY}", + "https://avax-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}" ] }, { diff --git a/script/prepare-chain-data.sh b/script/prepare-chain-data.sh index bb68ad6..8ae31a9 100644 --- a/script/prepare-chain-data.sh +++ b/script/prepare-chain-data.sh @@ -1,6 +1,9 @@ #!/bin/bash set -euo pipefail +# Ensure deterministic glob ordering across environments +export LC_ALL=C + # First we get list of all chains. CHAIN_DIR="./script/data/chain" OUTPUT_FILE="./src/lib/chains.json"