From fe79f2edf1ca494213ac327ebb62c98c04ca1958 Mon Sep 17 00:00:00 2001 From: ChefJoJo <94336009+chef-jojo@users.noreply.github.com> Date: Fri, 28 Jul 2023 16:02:10 +0800 Subject: [PATCH] chore: Lower multicall for zkevm (#7440) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### 🤖 Generated by Copilot at 056c778 ### Summary 🌐🚀🔧 Reduced `batchSize` for multicall requests on Polygon ZK-EVM network in `viem.ts`. This improves performance and stability on the network with lower gas limit. > _`batchSize` shrinks_ > _for Polygon ZK-EVM_ > _autumn leaves fall fast_ ### Walkthrough * Reduce the multicall batch size to 128 on Polygon ZK-EVM network to improve performance and stability ([link](https://github.com/pancakeswap/pancake-frontend/pull/7440/files?diff=unified&w=0#diff-183d744228d84d3639e7b8c1f87acfe1fbea6a869359deb8313a0bb51c523c5cL23-R23)) --- apps/web/src/config/nodes.ts | 2 +- apps/web/src/utils/viem.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/web/src/config/nodes.ts b/apps/web/src/config/nodes.ts index 7e9720114867d..90054ce069638 100644 --- a/apps/web/src/config/nodes.ts +++ b/apps/web/src/config/nodes.ts @@ -59,7 +59,7 @@ export const PUBLIC_NODES = { [ChainId.ARBITRUM_ONE]: arbitrum.rpcUrls.public.http, [ChainId.ARBITRUM_GOERLI]: arbitrumGoerli.rpcUrls.public.http, [ChainId.POLYGON_ZKEVM]: [ - getNodeRealUrlV2(ChainId.POLYGON_ZKEVM, process.env.NEXT_PUBLIC_NODE_REAL_API_ETH), + // getNodeRealUrlV2(ChainId.POLYGON_ZKEVM, process.env.NEXT_PUBLIC_NODE_REAL_API_ETH), ...POLYGON_ZKEVM_NODES, ], [ChainId.POLYGON_ZKEVM_TESTNET]: [ diff --git a/apps/web/src/utils/viem.ts b/apps/web/src/utils/viem.ts index 98328ba1649dd..4df9df1bf44fa 100644 --- a/apps/web/src/utils/viem.ts +++ b/apps/web/src/utils/viem.ts @@ -20,7 +20,7 @@ export const viemClients = CHAINS.reduce((prev, cur) => { ), batch: { multicall: { - batchSize: 1024 * 200, + batchSize: cur.id === ChainId.POLYGON_ZKEVM ? 128 : 1024 * 200, }, }, }),