From 8eb8710c8b02abd24ef36ea5c950506db6b27e6b Mon Sep 17 00:00:00 2001 From: Akash Date: Tue, 18 Jun 2024 18:49:35 +0530 Subject: [PATCH] fix : rename confirmations,polygon finality update --- scripts/rpcConfig/constants/defaultFinalityBucket.ts | 2 +- scripts/rpcConfig/constants/finality.ts | 4 ++-- scripts/rpcConfig/constants/index.ts | 2 +- .../constants/{confirmations.ts => reSyncInterval.ts} | 2 +- scripts/rpcConfig/rpcConfig.ts | 8 ++++---- src/socket-types.ts | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) rename scripts/rpcConfig/constants/{confirmations.ts => reSyncInterval.ts} (77%) diff --git a/scripts/rpcConfig/constants/defaultFinalityBucket.ts b/scripts/rpcConfig/constants/defaultFinalityBucket.ts index 2ef68df1..0e07a4e0 100644 --- a/scripts/rpcConfig/constants/defaultFinalityBucket.ts +++ b/scripts/rpcConfig/constants/defaultFinalityBucket.ts @@ -3,6 +3,6 @@ import { ChainSlug } from "../../../src/enums/chainSlug"; import { FinalityBucket } from "../../../src/socket-types"; export const defaultFinalityBucket = { - [ChainSlug.POLYGON_MAINNET]: FinalityBucket.slow, + [ChainSlug.POLYGON_MAINNET]: FinalityBucket.medium, [ChainSlug.MAINNET]: FinalityBucket.medium, }; diff --git a/scripts/rpcConfig/constants/finality.ts b/scripts/rpcConfig/constants/finality.ts index d82a83aa..75a1a162 100644 --- a/scripts/rpcConfig/constants/finality.ts +++ b/scripts/rpcConfig/constants/finality.ts @@ -13,7 +13,7 @@ export const finalityOverrides: { } = { [ChainSlug.POLYGON_MAINNET]: { [FinalityBucket.fast]: 64, - [FinalityBucket.medium]: 150, - [FinalityBucket.slow]: 256, + [FinalityBucket.medium]: 256, + [FinalityBucket.slow]: 1000, }, }; diff --git a/scripts/rpcConfig/constants/index.ts b/scripts/rpcConfig/constants/index.ts index 9213ce92..701451b6 100644 --- a/scripts/rpcConfig/constants/index.ts +++ b/scripts/rpcConfig/constants/index.ts @@ -1,5 +1,5 @@ export * from "./batcherSupportedChainSlug"; -export * from "./confirmations"; +export * from "./reSyncInterval"; export * from "./explorers"; export * from "./icons"; export * from "./rpc"; diff --git a/scripts/rpcConfig/constants/confirmations.ts b/scripts/rpcConfig/constants/reSyncInterval.ts similarity index 77% rename from scripts/rpcConfig/constants/confirmations.ts rename to scripts/rpcConfig/constants/reSyncInterval.ts index 72099c9b..91ecbcd9 100644 --- a/scripts/rpcConfig/constants/confirmations.ts +++ b/scripts/rpcConfig/constants/reSyncInterval.ts @@ -1,6 +1,6 @@ import { ChainSlug } from "../../../src"; -export const confirmations = { +export const reSyncInterval = { [ChainSlug.POLYGON_MAINNET]: 256, [ChainSlug.MAINNET]: 6, }; diff --git a/scripts/rpcConfig/rpcConfig.ts b/scripts/rpcConfig/rpcConfig.ts index 801b8646..cdc8d210 100644 --- a/scripts/rpcConfig/rpcConfig.ts +++ b/scripts/rpcConfig/rpcConfig.ts @@ -20,7 +20,7 @@ import { FinalityBucket, } from "../../src"; import { - confirmations, + reSyncInterval, explorers, icons, batcherSupportedChainSlugs, @@ -94,7 +94,7 @@ const getChainData = async ( chainTxData: await getChainTxData(chainSlug, txData), nativeToken: getCurrency(chainSlug), chainType: getChainType(chainSlug), - confirmations: getConfirmations(chainSlug), + reSyncInterval: getReSyncInterval(chainSlug), finalityInfo: getFinality(chainSlug), defaultFinalityBucket: getDefaultFinalityBucket(chainSlug), icon: icons[chainSlug], @@ -170,6 +170,6 @@ export const getDefaultFinalityBucket = ( return defaultFinalityBucket[chainSlug] ?? FinalityBucket.fast; }; -export const getConfirmations = (chainSlug: ChainSlug) => { - return confirmations[chainSlug] ?? 0; +export const getReSyncInterval = (chainSlug: ChainSlug) => { + return reSyncInterval[chainSlug] ?? 0; }; diff --git a/src/socket-types.ts b/src/socket-types.ts index 584313cf..afb2b056 100644 --- a/src/socket-types.ts +++ b/src/socket-types.ts @@ -236,7 +236,7 @@ export interface ChainTxData { export interface S3ChainConfig { rpc: string; blockNumber: number; - confirmations: number; + reSyncInterval: number; siblings: ChainSlug[]; chainName: string; eventBlockRange?: number;