From f29b58cd37dc0c888537f4f34c3f07657b1364a7 Mon Sep 17 00:00:00 2001 From: jsy1218 <91580504+jsy1218@users.noreply.github.com> Date: Mon, 22 Apr 2024 11:02:18 -0700 Subject: [PATCH] fix: missing chains for outside of same map config (#549) - **What kind of change does this PR introduce?** (Bug fix, feature, docs update, ...) Bug fix - **What is the current behavior?** (You can also link to an open issue here) I was reviewing onchain quote provider config, and realized the same config map only contains Polygon. I populated for all networks to be safe for future references. Also I realized the [NETWORKS_WITH_SAME_UNISWAP_ADDRESSES](https://github.com/Uniswap/smart-order-router/blob/f73799d8025bddfea725df93f9dad6ecbe895d62/src/util/chains.ts#L53) doesn't contain all the production networks, so I need to manually populate them to be extra safe. - **What is the new behavior (if this is a feature change)?** Add the missing chains for the same config mapping. - **Other information**: --- src/util/addresses.ts | 6 ++++++ src/util/onchainQuoteProviderConfigs.ts | 25 +++++++++++++++---------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/src/util/addresses.ts b/src/util/addresses.ts index d2dbe17cb..c0f20744f 100644 --- a/src/util/addresses.ts +++ b/src/util/addresses.ts @@ -67,7 +67,13 @@ export const QUOTER_V2_ADDRESSES: AddressMap = { export const NEW_QUOTER_V2_ADDRESSES: AddressMap = { ...constructSameAddressMap('0x5e55C9e631FAE526cd4B0526C4818D6e0a9eF0e3'), + [ChainId.CELO]: '0x5e55C9e631FAE526cd4B0526C4818D6e0a9eF0e3', + [ChainId.CELO_ALFAJORES]: '0x5e55C9e631FAE526cd4B0526C4818D6e0a9eF0e3', + [ChainId.OPTIMISM_SEPOLIA]: '0x5e55C9e631FAE526cd4B0526C4818D6e0a9eF0e3', [ChainId.SEPOLIA]: '0xf0c802dcb0cf1c4f7b953756b49d940eed190221', + [ChainId.ARBITRUM_SEPOLIA]: '0x5e55C9e631FAE526cd4B0526C4818D6e0a9eF0e3', + [ChainId.BNB]: '0x5e55C9e631FAE526cd4B0526C4818D6e0a9eF0e3', + [ChainId.AVALANCHE]: '0xf0c802dcb0cf1c4f7b953756b49d940eed190221', [ChainId.POLYGON_MUMBAI]: '0x60e06b92bC94a665036C26feC5FF2A92E2d04c5f', [ChainId.BASE]: '0x222cA98F00eD15B1faE10B61c277703a194cf5d2', [ChainId.BLAST]: '0x9D0F15f2cf58655fDDcD1EE6129C547fDaeD01b1', diff --git a/src/util/onchainQuoteProviderConfigs.ts b/src/util/onchainQuoteProviderConfigs.ts index 927712a69..a40987e78 100644 --- a/src/util/onchainQuoteProviderConfigs.ts +++ b/src/util/onchainQuoteProviderConfigs.ts @@ -4,10 +4,12 @@ import { BatchParams, BlockNumberConfig, FailureOverrides, - QuoteRetryOptions + QuoteRetryOptions, } from '../providers'; -export const NETWORKS_WITH_SAME_RETRY_OPTIONS = [ChainId.POLYGON]; +export const NETWORKS_WITH_SAME_RETRY_OPTIONS = Object.values( + ChainId +) as ChainId[]; export function constructSameRetryOptionsMap( retryOptions: T, @@ -31,7 +33,9 @@ export const RETRY_OPTIONS = { ...constructSameRetryOptionsMap(DEFAULT_RETRY_OPTIONS), }; -export const NETWORKS_WITH_SAME_BATCH_PARAMS = [ChainId.POLYGON]; +export const NETWORKS_WITH_SAME_BATCH_PARAMS = Object.values( + ChainId +) as ChainId[]; export function constructSameBatchParamsMap( batchParams: T, @@ -55,7 +59,9 @@ export const BATCH_PARAMS = { ...constructSameBatchParamsMap(DEFAULT_BATCH_PARAMS), }; -export const NETWORKS_WITH_SAME_GAS_ERROR_FAILURE_OVERRIDES = [ChainId.POLYGON]; +export const NETWORKS_WITH_SAME_GAS_ERROR_FAILURE_OVERRIDES = Object.values( + ChainId +) as ChainId[]; export function constructSameGasErrorFailureOverridesMap< T extends FailureOverrides @@ -104,8 +110,7 @@ export function constructSameSuccessRateFailureOverridesMap< }, {}); } -export const DEFAULT_SUCCESS_RATE_FAILURE_OVERRIDES: FailureOverrides = -{ +export const DEFAULT_SUCCESS_RATE_FAILURE_OVERRIDES: FailureOverrides = { gasLimitOverride: 1_300_000, multicallChunk: 110, }; @@ -116,7 +121,9 @@ export const SUCCESS_RATE_FAILURE_OVERRIDES = { ), }; -export const NETWORKS_WITH_SAME_BLOCK_NUMBER_CONFIGS = [ChainId.POLYGON]; +export const NETWORKS_WITH_SAME_BLOCK_NUMBER_CONFIGS = Object.values( + ChainId +) as ChainId[]; export function constructSameBlockNumberConfigsMap( blockNumberConfigs: T, @@ -138,7 +145,5 @@ export const DEFAULT_BLOCK_NUMBER_CONFIGS: BlockNumberConfig = { }; export const BLOCK_NUMBER_CONFIGS = { - ...constructSameBlockNumberConfigsMap( - DEFAULT_BLOCK_NUMBER_CONFIGS - ), + ...constructSameBlockNumberConfigsMap(DEFAULT_BLOCK_NUMBER_CONFIGS), };