From f8d17923766c069c1ac9b5712899f877bebaa62e Mon Sep 17 00:00:00 2001 From: Yorke Rhodes Date: Fri, 24 Jan 2025 05:31:09 -0500 Subject: [PATCH 1/3] feat: recurse in safe timelock parser (#5278) ### Description Parse inner transactions on timelocks ### Testing Manual ```sh $ yarn tsx scripts/safes/parse-txs.ts --chains ethereum ``` ```yaml ethereum-0xc096af73952e18fe1201b457a95b598d680d7f185747b28153da2c175532ca8f: chain: ethereum to: Timelock Controller (ethereum 0x59cf937Ea9FA9D7398223E3aA33d92F7f5f986A2) insight: 'Schedule for Sun Jan 26 2025 18:05:17 GMT-0500 (Eastern Standard Time): {"chain":"ethereum","to":"Timelock Controller (ethereum 0x59cf937Ea9FA9D7398223E3aA33d92F7f5f986A2)","args":{"newDelay":{"type":"BigNumber","hex":"0x00"}}}' ``` --- .../infra/config/environments/mainnet3/owners.ts | 1 + typescript/infra/src/tx/govern-transaction-reader.ts | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/typescript/infra/config/environments/mainnet3/owners.ts b/typescript/infra/config/environments/mainnet3/owners.ts index 45b707218f..b6d00132b7 100644 --- a/typescript/infra/config/environments/mainnet3/owners.ts +++ b/typescript/infra/config/environments/mainnet3/owners.ts @@ -8,6 +8,7 @@ import { supportedChainNames } from './supportedChainNames.js'; export const timelocks: ChainMap
= { arbitrum: '0xAC98b0cD1B64EA4fe133C6D2EDaf842cE5cF4b01', + ethereum: '0x59cf937Ea9FA9D7398223E3aA33d92F7f5f986A2', // symbiotic network timelock }; export function localAccountRouters(): ChainMap
{ diff --git a/typescript/infra/src/tx/govern-transaction-reader.ts b/typescript/infra/src/tx/govern-transaction-reader.ts index 7e21335a17..eaff106a43 100644 --- a/typescript/infra/src/tx/govern-transaction-reader.ts +++ b/typescript/infra/src/tx/govern-transaction-reader.ts @@ -202,8 +202,16 @@ export class GovernTransactionReader { 'schedule(address,uint256,bytes,bytes32,bytes32,uint256)' ].name ) { - const [target, value, data, eta, executor, delay] = decoded.args; - insight = `Schedule ${target} to be executed at ${eta} with ${value} ${data}. Executor: ${executor}, Delay: ${delay}`; + const [target, value, data, _predecessor, _salt, delay] = decoded.args; + const inner = await this.read(chain, { + to: target, + data, + value, + }); + + const eta = new Date(Date.now() + delay.toNumber() * 1000); + + insight = `Schedule for ${eta}: ${JSON.stringify(inner)}`; } if ( From 4413717c2f326722d1af1cb6c51b41540ffb66a6 Mon Sep 17 00:00:00 2001 From: Lee <6251863+ltyu@users.noreply.github.com> Date: Fri, 24 Jan 2025 06:15:30 -0500 Subject: [PATCH 2/3] feat: Add exportConfigs Infra script (#5235) ### Description Add infra script that adds every config Getter to the FileSystem Registry ### Related issues - Fixes https://github.com/hyperlane-xyz/hyperlane-monorepo/issues/5262 ### Backward compatibility Yes ### Testing Manual --- typescript/cli/package.json | 2 +- typescript/helloworld/package.json | 2 +- typescript/infra/package.json | 2 +- .../warp-routes/export-warp-configs.ts | 33 +++++++++++++++++++ typescript/infra/src/utils/utils.ts | 2 +- typescript/utils/src/objects.ts | 5 ++- typescript/widgets/package.json | 2 +- yarn.lock | 16 ++++----- 8 files changed, 50 insertions(+), 14 deletions(-) create mode 100644 typescript/infra/scripts/warp-routes/export-warp-configs.ts diff --git a/typescript/cli/package.json b/typescript/cli/package.json index 8d27e3b2fb..a567392e42 100644 --- a/typescript/cli/package.json +++ b/typescript/cli/package.json @@ -5,7 +5,7 @@ "dependencies": { "@aws-sdk/client-kms": "^3.577.0", "@aws-sdk/client-s3": "^3.577.0", - "@hyperlane-xyz/registry": "6.18.0", + "@hyperlane-xyz/registry": "7.1.0", "@hyperlane-xyz/sdk": "8.3.0", "@hyperlane-xyz/utils": "8.3.0", "@inquirer/core": "9.0.10", diff --git a/typescript/helloworld/package.json b/typescript/helloworld/package.json index 7725a94bab..8a25b053d7 100644 --- a/typescript/helloworld/package.json +++ b/typescript/helloworld/package.json @@ -4,7 +4,7 @@ "version": "8.3.0", "dependencies": { "@hyperlane-xyz/core": "5.10.0", - "@hyperlane-xyz/registry": "6.18.0", + "@hyperlane-xyz/registry": "7.1.0", "@hyperlane-xyz/sdk": "8.3.0", "@openzeppelin/contracts-upgradeable": "^4.9.3", "ethers": "^5.7.2" diff --git a/typescript/infra/package.json b/typescript/infra/package.json index eec556fd90..952bd4351c 100644 --- a/typescript/infra/package.json +++ b/typescript/infra/package.json @@ -14,7 +14,7 @@ "@ethersproject/providers": "*", "@google-cloud/secret-manager": "^5.5.0", "@hyperlane-xyz/helloworld": "8.3.0", - "@hyperlane-xyz/registry": "6.18.0", + "@hyperlane-xyz/registry": "7.1.0", "@hyperlane-xyz/sdk": "8.3.0", "@hyperlane-xyz/utils": "8.3.0", "@inquirer/prompts": "3.3.2", diff --git a/typescript/infra/scripts/warp-routes/export-warp-configs.ts b/typescript/infra/scripts/warp-routes/export-warp-configs.ts new file mode 100644 index 0000000000..9fee050577 --- /dev/null +++ b/typescript/infra/scripts/warp-routes/export-warp-configs.ts @@ -0,0 +1,33 @@ +import { getRegistry } from '../../config/registry.js'; +import { getWarpConfig, warpConfigGetterMap } from '../../config/warp.js'; +import { getArgs, withOutputFile } from '../agent-utils.js'; +import { getEnvironmentConfig, getHyperlaneCore } from '../core-utils.js'; + +// Writes the warp configs into the Registry +async function main() { + const { environment } = await withOutputFile(getArgs()).argv; + const { multiProvider } = await getHyperlaneCore(environment); + const envConfig = getEnvironmentConfig(environment); + const registry = getRegistry(); + + const warpIdsToCheck = Object.keys(warpConfigGetterMap); + for (const warpRouteId of warpIdsToCheck) { + console.log(`Generating Warp config for ${warpRouteId}`); + + const warpConfig = await getWarpConfig( + multiProvider, + envConfig, + warpRouteId, + ); + + const configFileName = `${warpRouteId}-deploy.yaml`; + registry.addWarpRouteConfig(warpConfig, configFileName); + + // TODO: Use registry.getWarpRoutesPath() to dynamically generate path by removing "protected" + console.log( + `Warp config successfully created at ${registry.getUri()}/deployments/warp_routes/${configFileName}`, + ); + } +} + +main().catch((err) => console.error('Error:', err)); diff --git a/typescript/infra/src/utils/utils.ts b/typescript/infra/src/utils/utils.ts index 50e0e364ed..db1830f444 100644 --- a/typescript/infra/src/utils/utils.ts +++ b/typescript/infra/src/utils/utils.ts @@ -169,7 +169,7 @@ export function writeJsonAtPath(filepath: string, obj: any) { } export function writeYamlAtPath(filepath: string, obj: any) { - const content = stringifyObject(obj, 'yaml'); + const content = stringifyObject(obj, 'yaml', 2); writeToFile(filepath, content); } diff --git a/typescript/utils/src/objects.ts b/typescript/utils/src/objects.ts index 97d9d99db6..17fd134a18 100644 --- a/typescript/utils/src/objects.ts +++ b/typescript/utils/src/objects.ts @@ -224,7 +224,10 @@ export function stringifyObject( if (format === 'json') { return json; } - return yamlStringify(JSON.parse(json), null, space); + return yamlStringify(JSON.parse(json), null, { + indent: space ?? 2, + sortMapEntries: true, + }); } interface ObjectDiffOutput { diff --git a/typescript/widgets/package.json b/typescript/widgets/package.json index e96b6c6faa..46bfc8bbc3 100644 --- a/typescript/widgets/package.json +++ b/typescript/widgets/package.json @@ -27,7 +27,7 @@ "@emotion/react": "^11.13.3", "@emotion/styled": "^11.13.0", "@eslint/js": "^9.15.0", - "@hyperlane-xyz/registry": "6.18.0", + "@hyperlane-xyz/registry": "7.1.0", "@storybook/addon-essentials": "^7.6.14", "@storybook/addon-interactions": "^7.6.14", "@storybook/addon-links": "^7.6.14", diff --git a/yarn.lock b/yarn.lock index acf43f2e9b..4bc9fd18fd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7320,7 +7320,7 @@ __metadata: "@eslint/js": "npm:^9.15.0" "@ethersproject/abi": "npm:*" "@ethersproject/providers": "npm:*" - "@hyperlane-xyz/registry": "npm:6.18.0" + "@hyperlane-xyz/registry": "npm:7.1.0" "@hyperlane-xyz/sdk": "npm:8.3.0" "@hyperlane-xyz/utils": "npm:8.3.0" "@inquirer/core": "npm:9.0.10" @@ -7424,7 +7424,7 @@ __metadata: dependencies: "@eslint/js": "npm:^9.15.0" "@hyperlane-xyz/core": "npm:5.10.0" - "@hyperlane-xyz/registry": "npm:6.18.0" + "@hyperlane-xyz/registry": "npm:7.1.0" "@hyperlane-xyz/sdk": "npm:8.3.0" "@nomiclabs/hardhat-ethers": "npm:^2.2.3" "@nomiclabs/hardhat-waffle": "npm:^2.0.6" @@ -7475,7 +7475,7 @@ __metadata: "@ethersproject/providers": "npm:*" "@google-cloud/secret-manager": "npm:^5.5.0" "@hyperlane-xyz/helloworld": "npm:8.3.0" - "@hyperlane-xyz/registry": "npm:6.18.0" + "@hyperlane-xyz/registry": "npm:7.1.0" "@hyperlane-xyz/sdk": "npm:8.3.0" "@hyperlane-xyz/utils": "npm:8.3.0" "@inquirer/prompts": "npm:3.3.2" @@ -7537,13 +7537,13 @@ __metadata: languageName: unknown linkType: soft -"@hyperlane-xyz/registry@npm:6.18.0": - version: 6.18.0 - resolution: "@hyperlane-xyz/registry@npm:6.18.0" +"@hyperlane-xyz/registry@npm:7.1.0": + version: 7.1.0 + resolution: "@hyperlane-xyz/registry@npm:7.1.0" dependencies: yaml: "npm:2.4.5" zod: "npm:^3.21.2" - checksum: 10/0090afeffa60cf1891b1c7178d5f91d80db96a85595ba9a4ad7160cdc830737efc54022e11d416da4f4d9f7c032fde6f7aef678ae99e4a1f6142cdc06c50ccbc + checksum: 10/94b594ecd5734bc564e1a9ad220f4e5c9f04a98cd768cd4472afbaffe91009ae0680b8c4ffb01c13dbe913030dd730b22d5a73d7bfc88d6405df1e9f842ef939 languageName: node linkType: hard @@ -7642,7 +7642,7 @@ __metadata: "@emotion/styled": "npm:^11.13.0" "@eslint/js": "npm:^9.15.0" "@headlessui/react": "npm:^2.1.8" - "@hyperlane-xyz/registry": "npm:6.18.0" + "@hyperlane-xyz/registry": "npm:7.1.0" "@hyperlane-xyz/sdk": "npm:8.3.0" "@hyperlane-xyz/utils": "npm:8.3.0" "@interchain-ui/react": "npm:^1.23.28" From 47ae33c6a4c58c350b6bd724a177289635d4bdd2 Mon Sep 17 00:00:00 2001 From: Paul Balaji <10051819+paulbalaji@users.noreply.github.com> Date: Fri, 24 Jan 2025 12:45:59 +0000 Subject: [PATCH 3/3] docs(changeset): Revert zksync changes. (#5281) ### Description changeset for zksync revert https://github.com/hyperlane-xyz/hyperlane-monorepo/pull/5274 https://github.com/hyperlane-xyz/hyperlane-monorepo/pull/5275 ### Drive-by changes ### Related issues ### Backward compatibility ### Testing --- .changeset/fluffy-grapes-deliver.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/fluffy-grapes-deliver.md diff --git a/.changeset/fluffy-grapes-deliver.md b/.changeset/fluffy-grapes-deliver.md new file mode 100644 index 0000000000..3257e579b9 --- /dev/null +++ b/.changeset/fluffy-grapes-deliver.md @@ -0,0 +1,5 @@ +--- +'@hyperlane-xyz/core': minor +--- + +Revert zksync changes.