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

chore : refactor #387

Merged
merged 2 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
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
6 changes: 4 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ BLAST_RPC=''
# SOCKET_OWNER_ADDRESS=""
# SOCKET_SIGNER_KEY=xxx

POLYNOMIAL_RPC=' '

POLYNOMIAL_RPC=''
SYNDR_RPC=' '

DL_API_DEV_URL=''
DL_API_PROD_URL=''
15 changes: 7 additions & 8 deletions scripts/deploy/helpers/send-msg/allPathTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ interface RequestObj {

const API_BASE_URL =
mode == DeploymentMode.DEV
? "https://raf5spoep4.execute-api.us-east-1.amazonaws.com/dev/v1"
: "https://prod.dlapi.socket.tech";

? process.env.DL_API_DEV_URL
: process.env.DL_API_PROD_URL;
const getSiblingSlugs = (chainSlug: ChainSlug): ChainSlug[] => {
console.log(chainSlug, isMainnet(chainSlug));
if (isTestnet(chainSlug))
Expand Down Expand Up @@ -160,16 +159,16 @@ export const sendMessagesToAllPaths = async (params: {
let executionParams =
"0x0000000000000000000000000000000000000000000000000000000000000000";
let transmissionParams =
"0x0000000000000000000000000000000000000000000000000000000000000000";
"0x0101000000010000000000000000000000000000000000000000000000000000";
let data = counter.interface.encodeFunctionData(
"remoteAddOperation",
[
siblingSlug,
amount,
msgGasLimit,
// executionParams,
ethers.constants.HashZero,
ethers.constants.HashZero,
executionParams,
// ethers.constants.HashZero,
transmissionParams,
]
);
let to = counter.address;
Expand All @@ -191,7 +190,7 @@ export const sendMessagesToAllPaths = async (params: {
const gasLimit: number | string | undefined =
chainSlug === ChainSlug.ARBITRUM ||
chainSlug === ChainSlug.ARBITRUM_SEPOLIA
? 200000
? 2000000
: overrides(chainSlug)?.gasLimit
? overrides(chainSlug).gasLimit.toString()
: undefined;
Expand Down
6 changes: 6 additions & 0 deletions scripts/rpcConfig/constants/defaultFinalityBucket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ import { ChainSlug } from "../../../src/enums/chainSlug";

import { FinalityBucket } from "../../../src/socket-types";

export const getDefaultFinalityBucket = (
chainSlug: ChainSlug
): FinalityBucket => {
return defaultFinalityBucket[chainSlug] ?? FinalityBucket.fast;
};

export const defaultFinalityBucket = {
[ChainSlug.POLYGON_MAINNET]: FinalityBucket.medium,
[ChainSlug.MAINNET]: FinalityBucket.medium,
Expand Down
1 change: 1 addition & 0 deletions scripts/rpcConfig/constants/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export * from "./batcherSupportedChainSlug";
export * from "./reSyncInterval";
export * from "./defaultFinalityBucket";
export * from "./explorers";
export * from "./icons";
export * from "./rpc";
Expand Down
6 changes: 5 additions & 1 deletion scripts/rpcConfig/constants/reSyncInterval.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { ChainSlug } from "../../../src";
import { ChainSlug } from "../../../src/enums/chainSlug";

export const getReSyncInterval = (chainSlug: ChainSlug) => {
return reSyncInterval[chainSlug] ?? 0;
};

export const reSyncInterval = {
[ChainSlug.POLYGON_MAINNET]: 256,
Expand Down
14 changes: 2 additions & 12 deletions scripts/rpcConfig/rpcConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ import {
} from "../../src";
import { getSiblings } from "../common";
import {
reSyncInterval,
explorers,
icons,
batcherSupportedChainSlugs,
rpcs,
version,
getFinality,
getReSyncInterval,
getDefaultFinalityBucket,
} from "./constants";
import { defaultFinalityBucket } from "./constants/defaultFinalityBucket";
import { feesUpdaterSupportedChainSlugs } from "./constants/feesUpdaterChainSlugs";
import { getChainTxData } from "./txdata-builder/generate-calldata";

Expand Down Expand Up @@ -164,13 +164,3 @@ export const generateProdConfig = async (txData: TxData): Promise<S3Config> => {
disabledDFFeeChains: [],
};
};

export const getDefaultFinalityBucket = (
chainSlug: ChainSlug
): FinalityBucket => {
return defaultFinalityBucket[chainSlug] ?? FinalityBucket.fast;
};

export const getReSyncInterval = (chainSlug: ChainSlug) => {
return reSyncInterval[chainSlug] ?? 0;
};
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { DeploymentMode } from "./socket-types";
export { getFinality } from "../scripts/rpcConfig/constants/finality";
export { getDefaultFinalityBucket } from "../scripts/rpcConfig/constants/defaultFinalityBucket";
export { getReSyncInterval } from "../scripts/rpcConfig/constants/reSyncInterval";

export * from "./socket-types";
export * from "./enums";
export * from "./addresses";
Expand Down
Loading