Skip to content

Commit

Permalink
Merge pull request #399 from SocketDotTech/fix-finality
Browse files Browse the repository at this point in the history
Fix finality
  • Loading branch information
arthcp authored Oct 9, 2024
2 parents 888ac7d + 3394295 commit f9f2509
Show file tree
Hide file tree
Showing 10 changed files with 81 additions and 125 deletions.
140 changes: 48 additions & 92 deletions deployments/prod_addresses.json
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,18 @@
"switchboard": "0x5490aBcD9949833FB68e4d222ee68dc225881c25"
}
},
"34443": {
"FAST": {
"capacitor": "0xf30B40f9B1773d14775f51443f8eB3610ffA317a",
"decapacitor": "0x054141bdD829B53F852A0D4c6FDF310331FFC79f",
"switchboard": "0xCedce2e52aa6551bC407f640D8Bd9179b528347C"
},
"OPTIMISTIC": {
"capacitor": "0xfeBf745DCd40aA8226f00C7C13113503bfdf375f",
"decapacitor": "0x2742367c023cE160e3912ebDF74EC4F6FC52100A",
"switchboard": "0x5490aBcD9949833FB68e4d222ee68dc225881c25"
}
},
"42161": {
"OPTIMISTIC": {
"capacitor": "0xa4A99bC9f562D803316E8457C93d5f3c01206C7C",
Expand Down Expand Up @@ -2290,6 +2302,18 @@
"switchboard": "0x57D1Aeafb6a2b7Bd4954e47a556622161A8c0A65"
}
},
"34443": {
"FAST": {
"capacitor": "0xe7496A237fD0E08Bbe2a8466523dD7a1F651dd75",
"decapacitor": "0x0B50BB965295ac8C1b212c37A77e86F3D282fd81",
"switchboard": "0x768A2A53e4318dA7714a0aA65a96D9A241603562"
},
"OPTIMISTIC": {
"capacitor": "0x3618D6E2a62b0A50e2A994F4A837FE2C7b7Aa2F5",
"decapacitor": "0x2C954D3F82f7134f95C6FF7385798e4ca6e6c111",
"switchboard": "0x57D1Aeafb6a2b7Bd4954e47a556622161A8c0A65"
}
},
"42161": {
"OPTIMISTIC": {
"capacitor": "0xA1A57BEdfCF75492Ee7CE8aB4D1B3E1A3837EF30",
Expand Down Expand Up @@ -2967,6 +2991,18 @@
"switchboard": "0xaa3d9fA3aB930aE635b001d00C612aa5b14d750e"
}
},
"56": {
"FAST": {
"capacitor": "0x190a805F8022A409B14F1B5884644EF9ad2F9Aa1",
"decapacitor": "0x2bFD6360a22e0b44BCCA9432a3E254Cdf31ce84e",
"switchboard": "0x57D1Aeafb6a2b7Bd4954e47a556622161A8c0A65"
},
"OPTIMISTIC": {
"capacitor": "0x0f62B88B7E125eb373977AAC21dBde1DD6E6A8cf",
"decapacitor": "0xa3A07b4ED75819e080C8Ac9Cc19113B7f6509838",
"switchboard": "0xaa3d9fA3aB930aE635b001d00C612aa5b14d750e"
}
},
"137": {
"FAST": {
"capacitor": "0x655ad5d7D8400cc84e8B6d26f2D9E0824128cDf1",
Expand All @@ -2991,6 +3027,18 @@
"switchboard": "0xaa3d9fA3aB930aE635b001d00C612aa5b14d750e"
}
},
"2999": {
"FAST": {
"capacitor": "0xA6f2809Cbb96396fdFe1C6Afa904d736407F3934",
"decapacitor": "0x5dE6dBfD35F566AA7C147A0eDe507e0b12094C17",
"switchboard": "0x57D1Aeafb6a2b7Bd4954e47a556622161A8c0A65"
},
"OPTIMISTIC": {
"capacitor": "0x2796A3c9FeAbA485b3a588a48757b98e9FF63C03",
"decapacitor": "0xd21922747Cd0970A392d21248373226d16c1d6e1",
"switchboard": "0xaa3d9fA3aB930aE635b001d00C612aa5b14d750e"
}
},
"8453": {
"FAST": {
"capacitor": "0xFFB1668F7978C67B385acB40AB9A9ada879a1271",
Expand Down Expand Up @@ -4077,18 +4125,6 @@
"switchboard": "0xEDF6dB2f3BC8deE014762e0141EE4CA19d685dBd"
}
},
"3397901": {
"FAST": {
"capacitor": "0x7D15eDF7b910F5D463f3Fb538dA0F33C6116977f",
"decapacitor": "0xC31d5a4DffD9A10CC315B0beE57EaCfB34ece95E",
"switchboard": "0xB9EDe9aaEaA40e35033ABBC872D141950d08cc4d"
},
"OPTIMISTIC": {
"capacitor": "0xeB11952971719E35644EeF6149B97f7A10734b56",
"decapacitor": "0x6c1F3dc38d28302d03b7f6d4C600a39E7225397a",
"switchboard": "0xEDF6dB2f3BC8deE014762e0141EE4CA19d685dBd"
}
},
"11155111": {
"NATIVE_BRIDGE": {
"switchboard": "0xAE9bE0eA6DD7B53C88665Cb2EFf7d40dFD51cf91",
Expand Down Expand Up @@ -4337,62 +4373,6 @@
"CapacitorSimulator": "0x06eD6DeCed1A93b7F5e4B27de7Ceb814A9f696db",
"ExecutionManagerDF": "0x9e196dff347e2bB4116C4e409AA025d427eB8fC6"
},
"3397901": {
"SignatureVerifier": "0x6D290609b3F5F02D52F28d97C75a443ED8564cBf",
"Hasher": "0x2b42AFFD4b7C14d9B7C2579229495c052672Ccd3",
"CapacitorFactory": "0x8537307810fC40F4073A12a38554D4Ff78EfFf41",
"Socket": "0x565810cbfa3Cf1390963E5aFa2fB953795686339",
"ExecutionManager": "0xc317144DE60E6bC9455363bB09852C00bd14CD61",
"TransmitManager": "0xbDf50eAe568ECef74796ed6022a0d453e8432410",
"FastSwitchboard": "0x8f9EaEe5c5df888aBA3c1Ab19689a0660d042c6d",
"OptimisticSwitchboard": "0x57D1Aeafb6a2b7Bd4954e47a556622161A8c0A65",
"SocketBatcher": "0x54CAA0946dA179425e1abB169C020004284d64D3",
"Counter": "0xd7627d03dEA4006cBe8E701F6932dBF75d3269B3",
"SocketSimulator": "0xdA089249ccE9d9726Fa6b755c5ec3d9C260C90C2",
"SimulatorUtils": "0x11695Ff9EE5E600b90BcbD651D1758A9B240A2d8",
"SwitchboardSimulator": "0x64107EB9DC50E79Fb3977b9D6C927f9B9C5Bd218",
"CapacitorSimulator": "0xca428E8aa22561190d5326280d7Dfe28C6c97829",
"startBlock": 1004951,
"integrations": {
"421614": {
"FAST": {
"capacitor": "0x8590b1DDb6a4A06145bF008e8e708A81f9fb53e6",
"decapacitor": "0x8DFD1D3b6EAF93dDf11AeC821a060e1bc4974CDf",
"switchboard": "0x8f9EaEe5c5df888aBA3c1Ab19689a0660d042c6d"
},
"OPTIMISTIC": {
"capacitor": "0x924b840ea9Cb97Aa103B6B37b5815676a0fA6076",
"decapacitor": "0x4648bA0745A1333eEF1e6790815c2e8d327C0686",
"switchboard": "0x57D1Aeafb6a2b7Bd4954e47a556622161A8c0A65"
}
},
"11155111": {
"FAST": {
"capacitor": "0xB1ecD6D2d1f52D5Abed57431508733d51BB4Cd6B",
"decapacitor": "0x67e8D09fE657332e312e0d649500c09E8A8c3A2C",
"switchboard": "0x8f9EaEe5c5df888aBA3c1Ab19689a0660d042c6d"
},
"OPTIMISTIC": {
"capacitor": "0x40AAe25992B0a734bEE0AB70bdd55D856aB498a2",
"decapacitor": "0xD999FAf610e1a18837965554AFd5aDf80a841CaC",
"switchboard": "0x57D1Aeafb6a2b7Bd4954e47a556622161A8c0A65"
}
},
"11155420": {
"FAST": {
"capacitor": "0x8746E279A2Bb21e12e17d0121fb1Bbc57234c0b2",
"decapacitor": "0x37A00337dae8F2A02B4513ae0a5267EAaEB55621",
"switchboard": "0x8f9EaEe5c5df888aBA3c1Ab19689a0660d042c6d"
},
"OPTIMISTIC": {
"capacitor": "0xA1A57BEdfCF75492Ee7CE8aB4D1B3E1A3837EF30",
"decapacitor": "0x8757Fd4c8CEEFB59ed4F69d841ca6Fa0C2744f0D",
"switchboard": "0x57D1Aeafb6a2b7Bd4954e47a556622161A8c0A65"
}
}
},
"ExecutionManagerDF": "0x663dc7E91157c58079f55C1BF5ee1BdB6401Ca7a"
},
"11155111": {
"SignatureVerifier": "0x10d9DA6AE85eff6D582A91829f78bde2a3EC2dCC",
"Hasher": "0x6ddF1d6B719323236f58B4c61D30E523fce1Fe06",
Expand Down Expand Up @@ -4519,18 +4499,6 @@
"switchboard": "0xd84fabe06806270Fb2dDFC2255102206e3B36865"
}
},
"3397901": {
"FAST": {
"capacitor": "0x1DeC9591eEB180cB25C23C5a8d919702240417F5",
"decapacitor": "0x3A226567B865b9D24F7dA8A834ee0aE9d01F09c7",
"switchboard": "0x501fCBa3e6F92b2D1d89038FeD56EdacaaF5f7c2"
},
"OPTIMISTIC": {
"capacitor": "0x2cCFD39F91D27d3ffc89a4626eE1E21f25353f38",
"decapacitor": "0x4759B3257e374710019bDB0abCD717a48FcFe2D4",
"switchboard": "0xd84fabe06806270Fb2dDFC2255102206e3B36865"
}
},
"11155112": {
"FAST": {
"capacitor": "0x5e3d9014a1B467Be149Cd6aA6fBDE1eda718c781",
Expand Down Expand Up @@ -4831,18 +4799,6 @@
"switchboard": "0xEDF6dB2f3BC8deE014762e0141EE4CA19d685dBd"
}
},
"3397901": {
"FAST": {
"capacitor": "0xa15d28D33FbD0eE67C456076F9d2A2B48F847804",
"decapacitor": "0x3B9c5A6991874525ba5E44cB113B871b818d2b44",
"switchboard": "0xB9EDe9aaEaA40e35033ABBC872D141950d08cc4d"
},
"OPTIMISTIC": {
"capacitor": "0x67e7D52de5F5eFb1aD4a9d095CC4DbDf27D1e5E0",
"decapacitor": "0x44e08e987184F67599C89B50Fc35D56090e48C24",
"switchboard": "0xEDF6dB2f3BC8deE014762e0141EE4CA19d685dBd"
}
},
"11155111": {
"NATIVE_BRIDGE": {
"switchboard": "0xAE9bE0eA6DD7B53C88665Cb2EFf7d40dFD51cf91",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@socket.tech/dl-core",
"license": "UNLICENSED",
"version": "2.27.0",
"version": "2.28.0",
"description": "Smart contracts for socket data layer.",
"main": "./dist/src/index.js",
"types": "./dist/src/index.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions scripts/constants/overrides.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ export const chainOverrides: {
gasPriceMultiplier: 1.5,
},
[ChainSlug.AEVO_TESTNET]: {
type: 2,
type: 1,
},
[ChainSlug.LYRA_TESTNET]: {
type: 2,
type: 1,
},
[ChainSlug.MODE_TESTNET]: {
type: 1,
Expand Down
2 changes: 1 addition & 1 deletion scripts/rpcConfig/constants/defaultFinalityBucket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { FinalityBucket } from "../../../src/socket-types";
export const getDefaultFinalityBucket = (
chainSlug: ChainSlug
): FinalityBucket => {
return defaultFinalityBucket[chainSlug] ?? FinalityBucket.fast;
return defaultFinalityBucket[chainSlug] ?? FinalityBucket.low;
};

export const defaultFinalityBucket = {
Expand Down
18 changes: 9 additions & 9 deletions scripts/rpcConfig/constants/disabledDFFeeChains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ import { ChainSlug } from "../../../src";

export const disabledDFFeeChains = [
// ChainSlug.AEVO,
ChainSlug.ARBITRUM,
ChainSlug.OPTIMISM,
ChainSlug.BSC,
ChainSlug.POLYGON_MAINNET,
ChainSlug.LYRA,
ChainSlug.MAINNET,
ChainSlug.MANTLE,
// ChainSlug.ARBITRUM,
// ChainSlug.OPTIMISM,
// ChainSlug.BSC,
// ChainSlug.POLYGON_MAINNET,
// ChainSlug.LYRA,
// ChainSlug.MAINNET,
// ChainSlug.MANTLE,
// ChainSlug.HOOK,
// ChainSlug.REYA,
ChainSlug.BASE,
// ChainSlug.BASE,
// ChainSlug.KINTO,
// ChainSlug.WINR,
ChainSlug.BLAST,
// ChainSlug.BLAST,
// ChainSlug.POLYNOMIAL,
// ChainSlug.SYNDR,
];
2 changes: 1 addition & 1 deletion scripts/rpcConfig/constants/feesUpdaterChainSlugs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { mode } from "../../deploy/config/config";
export const feesUpdaterSupportedChainSlugs = (): ChainSlug[] => {
if (mode === DeploymentMode.PROD) {
const feesUpdaterSupportedChainSlugs = [];
[...MainnetIds, ...TestnetIds].forEach((m) => {
[...MainnetIds].forEach((m) => {
if (batcherSupportedChainSlugs.includes(m)) {
feesUpdaterSupportedChainSlugs.push(m);
}
Expand Down
20 changes: 10 additions & 10 deletions scripts/rpcConfig/constants/finality.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,28 @@ export const finalityOverrides: {
[chainSlug in ChainSlug]?: ChainFinalityInfo;
} = {
[ChainSlug.POLYGON_MAINNET]: {
[FinalityBucket.fast]: 64,
[FinalityBucket.low]: 64,
[FinalityBucket.medium]: 256,
[FinalityBucket.slow]: 1000,
[FinalityBucket.high]: 1000,
},
[ChainSlug.NEOX_TESTNET]: {
[FinalityBucket.fast]: 1,
[FinalityBucket.low]: 1,
[FinalityBucket.medium]: 10,
[FinalityBucket.slow]: 100,
[FinalityBucket.high]: 100,
},
[ChainSlug.NEOX_T4_TESTNET]: {
[FinalityBucket.fast]: 1,
[FinalityBucket.low]: 1,
[FinalityBucket.medium]: 10,
[FinalityBucket.slow]: 100,
[FinalityBucket.high]: 100,
},
[ChainSlug.NEOX]: {
[FinalityBucket.fast]: 1,
[FinalityBucket.low]: 1,
[FinalityBucket.medium]: 10,
[FinalityBucket.slow]: 100,
[FinalityBucket.high]: 100,
},
[ChainSlug.LINEA]: {
[FinalityBucket.fast]: 1,
[FinalityBucket.low]: 1,
[FinalityBucket.medium]: 10,
[FinalityBucket.slow]: 100,
[FinalityBucket.high]: 100,
},
};
2 changes: 1 addition & 1 deletion scripts/rpcConfig/constants/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import { DeploymentMode } from "../../../src";

export const version = {
[DeploymentMode.DEV]: "1.0.5",
[DeploymentMode.PROD]: "1.0.52",
[DeploymentMode.PROD]: "1.0.57",
};
10 changes: 5 additions & 5 deletions src/socket-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,19 +216,19 @@ export enum ChainType {
}

export enum FinalityBucket {
fast = 1, // latest
medium = 2, // safe
slow = 3, // finalized
low = 1, // low confirmations / latest
medium = 2, // medium confirmations / data posted
high = 3, // high confirmations / data posted and finalized
}

export enum TransmissionParamFinalityType {
bucket = 1,
}

export type ChainFinalityInfo = {
[FinalityBucket.fast]: number;
[FinalityBucket.low]: number;
[FinalityBucket.medium]: number;
[FinalityBucket.slow]: number;
[FinalityBucket.high]: number;
};

export type TxData = {
Expand Down
6 changes: 3 additions & 3 deletions src/transmission-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
Transmission param format:
- first byte - version - current version is 1
- 2nd byte - finalityType (1: bucket)
- next 4 bytes - value - bucket (1:fast, 2:medium, 3:slow)
- next 4 bytes - value - bucket (1:low, 2:medium, 3:high)
eg : want to transmit message with slow speed -
eg : want to transmit message with high finality -
transmissionParam = 0x0101000000030000000000000000000000000000000000000000000000000000
eg : want to transmit message with fast speed -
eg : want to transmit message with low finality -
transmissionParam = 0x0101000000010000000000000000000000000000000000000000000000000000
if version is 0, or invalid finality type, or invalid value is mentioned, it will use the default Bucket for that chain
Expand Down

0 comments on commit f9f2509

Please sign in to comment.