From 228f7c3d16098f217a8cd9663df27265a2ea8561 Mon Sep 17 00:00:00 2001 From: Jason Guo <33064781+Xaroz@users.noreply.github.com> Date: Mon, 20 Jan 2025 14:05:40 -0600 Subject: [PATCH] fix(cli): artifacts symbol for warp deploy and update registry packages (#5212) ### Description Fixes #5164 Fixed an issue where symbols were not taken into account when creating artifacts through warp deploy. ### Drive-by changes Update registry packages ### Related issues Related issue: [registry fix](https://github.com/hyperlane-xyz/hyperlane-registry/pull/499) ### Backward compatibility Yes ### Testing CLI Manual --- .changeset/proud-waves-camp.md | 5 +++++ typescript/cli/package.json | 2 +- typescript/cli/src/deploy/warp.ts | 28 +++++++++++++++++++--------- typescript/helloworld/package.json | 2 +- typescript/infra/package.json | 2 +- typescript/widgets/package.json | 2 +- yarn.lock | 16 ++++++++-------- 7 files changed, 36 insertions(+), 21 deletions(-) create mode 100644 .changeset/proud-waves-camp.md diff --git a/.changeset/proud-waves-camp.md b/.changeset/proud-waves-camp.md new file mode 100644 index 0000000000..a7cab11392 --- /dev/null +++ b/.changeset/proud-waves-camp.md @@ -0,0 +1,5 @@ +--- +'@hyperlane-xyz/cli': minor +--- + +Fix issue where warp deploy artifacts did not include correct symbols. diff --git a/typescript/cli/package.json b/typescript/cli/package.json index e82cfc5b64..1c9b87d5c6 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.6.0", + "@hyperlane-xyz/registry": "6.18.0", "@hyperlane-xyz/sdk": "8.2.0", "@hyperlane-xyz/utils": "8.2.0", "@inquirer/core": "9.0.10", diff --git a/typescript/cli/src/deploy/warp.ts b/typescript/cli/src/deploy/warp.ts index e94bd709da..eabcf15f90 100644 --- a/typescript/cli/src/deploy/warp.ts +++ b/typescript/cli/src/deploy/warp.ts @@ -4,7 +4,7 @@ import { stringify as yamlStringify } from 'yaml'; import { ProxyAdmin__factory } from '@hyperlane-xyz/core'; import { buildArtifact as coreBuildArtifact } from '@hyperlane-xyz/core/buildArtifact.js'; -import { ChainAddresses } from '@hyperlane-xyz/registry'; +import { AddWarpRouteOptions, ChainAddresses } from '@hyperlane-xyz/registry'; import { AggregationIsmConfig, AnnotatedEV5Transaction, @@ -153,12 +153,12 @@ export async function runWarpRouteDeploy({ const deployedContracts = await executeDeploy(deploymentParams, apiKeys); - const warpCoreConfig = await getWarpCoreConfig( + const { warpCoreConfig, addWarpRouteOptions } = await getWarpCoreConfig( deploymentParams, deployedContracts, ); - await writeDeploymentArtifacts(warpCoreConfig, context); + await writeDeploymentArtifacts(warpCoreConfig, context, addWarpRouteOptions); await completeDeploy(context, 'warp', initialBalances, null, ethereumChains!); } @@ -226,10 +226,11 @@ async function executeDeploy( async function writeDeploymentArtifacts( warpCoreConfig: WarpCoreConfig, context: WriteCommandContext, + addWarpRouteOptions?: AddWarpRouteOptions, ) { if (!context.isDryRun) { log('Writing deployment artifacts...'); - await context.registry.addWarpRoute(warpCoreConfig); + await context.registry.addWarpRoute(warpCoreConfig, addWarpRouteOptions); } log(indentYamlOrJson(yamlStringify(warpCoreConfig, null, 2), 4)); } @@ -417,7 +418,10 @@ async function createWarpHook({ async function getWarpCoreConfig( { warpDeployConfig, context }: DeployParams, contracts: HyperlaneContractsMap, -): Promise { +): Promise<{ + warpCoreConfig: WarpCoreConfig; + addWarpRouteOptions?: AddWarpRouteOptions; +}> { const warpCoreConfig: WarpCoreConfig = { tokens: [] }; // TODO: replace with warp read @@ -443,7 +447,7 @@ async function getWarpCoreConfig( fullyConnectTokens(warpCoreConfig); - return warpCoreConfig; + return { warpCoreConfig, addWarpRouteOptions: { symbol } }; } /** @@ -467,7 +471,7 @@ function generateTokenConfigs( chainName, standard: TOKEN_TYPE_TO_STANDARD[config.type], decimals, - symbol, + symbol: config.symbol || symbol, name, addressOrDenom: contract[warpDeployConfig[chainName].type as keyof TokenFactories] @@ -592,9 +596,15 @@ async function extendWarpRoute( warpCoreConfigByChain, ); - const updatedWarpCoreConfig = await getWarpCoreConfig(params, mergedRouters); + const { warpCoreConfig: updatedWarpCoreConfig, addWarpRouteOptions } = + await getWarpCoreConfig(params, mergedRouters); WarpCoreConfigSchema.parse(updatedWarpCoreConfig); - await writeDeploymentArtifacts(updatedWarpCoreConfig, params.context); + + await writeDeploymentArtifacts( + updatedWarpCoreConfig, + params.context, + addWarpRouteOptions, + ); return enrollRemoteRouters(params, mergedRouters); } diff --git a/typescript/helloworld/package.json b/typescript/helloworld/package.json index 8db5c68f1c..f3863608a0 100644 --- a/typescript/helloworld/package.json +++ b/typescript/helloworld/package.json @@ -4,7 +4,7 @@ "version": "8.2.0", "dependencies": { "@hyperlane-xyz/core": "5.9.2", - "@hyperlane-xyz/registry": "6.6.0", + "@hyperlane-xyz/registry": "6.18.0", "@hyperlane-xyz/sdk": "8.2.0", "@openzeppelin/contracts-upgradeable": "^4.9.3", "ethers": "^5.7.2" diff --git a/typescript/infra/package.json b/typescript/infra/package.json index d101047359..e48a843230 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.2.0", - "@hyperlane-xyz/registry": "6.6.0", + "@hyperlane-xyz/registry": "6.18.0", "@hyperlane-xyz/sdk": "8.2.0", "@hyperlane-xyz/utils": "8.2.0", "@inquirer/prompts": "3.3.2", diff --git a/typescript/widgets/package.json b/typescript/widgets/package.json index 2db355e56e..ab1c0ed5fd 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.6.0", + "@hyperlane-xyz/registry": "6.18.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 bef5c6d94d..cf72bf2284 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.6.0" + "@hyperlane-xyz/registry": "npm:6.18.0" "@hyperlane-xyz/sdk": "npm:8.2.0" "@hyperlane-xyz/utils": "npm:8.2.0" "@inquirer/core": "npm:9.0.10" @@ -7424,7 +7424,7 @@ __metadata: dependencies: "@eslint/js": "npm:^9.15.0" "@hyperlane-xyz/core": "npm:5.9.2" - "@hyperlane-xyz/registry": "npm:6.6.0" + "@hyperlane-xyz/registry": "npm:6.18.0" "@hyperlane-xyz/sdk": "npm:8.2.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.2.0" - "@hyperlane-xyz/registry": "npm:6.6.0" + "@hyperlane-xyz/registry": "npm:6.18.0" "@hyperlane-xyz/sdk": "npm:8.2.0" "@hyperlane-xyz/utils": "npm:8.2.0" "@inquirer/prompts": "npm:3.3.2" @@ -7537,13 +7537,13 @@ __metadata: languageName: unknown linkType: soft -"@hyperlane-xyz/registry@npm:6.6.0": - version: 6.6.0 - resolution: "@hyperlane-xyz/registry@npm:6.6.0" +"@hyperlane-xyz/registry@npm:6.18.0": + version: 6.18.0 + resolution: "@hyperlane-xyz/registry@npm:6.18.0" dependencies: yaml: "npm:2.4.5" zod: "npm:^3.21.2" - checksum: 10/4e8c955054a3872439f8a52ba208db848da1e46cdf920d4c0cf42080a147c4185d6fed2b00dec0320dfebeb7287578c8a95d3f2f81c2ba713a83a426a1793525 + checksum: 10/0090afeffa60cf1891b1c7178d5f91d80db96a85595ba9a4ad7160cdc830737efc54022e11d416da4f4d9f7c032fde6f7aef678ae99e4a1f6142cdc06c50ccbc 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.6.0" + "@hyperlane-xyz/registry": "npm:6.18.0" "@hyperlane-xyz/sdk": "npm:8.2.0" "@hyperlane-xyz/utils": "npm:8.2.0" "@interchain-ui/react": "npm:^1.23.28"