Skip to content

Commit

Permalink
fix(cli): artifacts symbol for warp deploy and update registry packag…
Browse files Browse the repository at this point in the history
…es (#5212)

### Description

<!--
What's included in this PR?
-->
Fixes #5164 

Fixed an issue where symbols were not taken into account when creating
artifacts through warp deploy.

### Drive-by changes

<!--
Are there any minor or drive-by changes also included?
-->

Update registry packages

### Related issues

<!--
- Fixes #[issue number here]
-->
Related issue: [registry
fix](hyperlane-xyz/hyperlane-registry#499)


### Backward compatibility

<!--
Are these changes backward compatible? Are there any infrastructure
implications, e.g. changes that would prohibit deploying older commits
using this infra tooling?

Yes/No
-->
Yes

### Testing

<!--
What kind of testing have these changes undergone?

None/Manual/Unit Tests
-->
CLI
Manual
  • Loading branch information
Xaroz authored Jan 20, 2025
1 parent d8eb4a8 commit 228f7c3
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 21 deletions.
5 changes: 5 additions & 0 deletions .changeset/proud-waves-camp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@hyperlane-xyz/cli': minor
---

Fix issue where warp deploy artifacts did not include correct symbols.
2 changes: 1 addition & 1 deletion typescript/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
28 changes: 19 additions & 9 deletions typescript/cli/src/deploy/warp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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!);
}
Expand Down Expand Up @@ -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));
}
Expand Down Expand Up @@ -417,7 +418,10 @@ async function createWarpHook({
async function getWarpCoreConfig(
{ warpDeployConfig, context }: DeployParams,
contracts: HyperlaneContractsMap<TokenFactories>,
): Promise<WarpCoreConfig> {
): Promise<{
warpCoreConfig: WarpCoreConfig;
addWarpRouteOptions?: AddWarpRouteOptions;
}> {
const warpCoreConfig: WarpCoreConfig = { tokens: [] };

// TODO: replace with warp read
Expand All @@ -443,7 +447,7 @@ async function getWarpCoreConfig(

fullyConnectTokens(warpCoreConfig);

return warpCoreConfig;
return { warpCoreConfig, addWarpRouteOptions: { symbol } };
}

/**
Expand All @@ -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]
Expand Down Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion typescript/helloworld/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion typescript/infra/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion typescript/widgets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
16 changes: 8 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 228f7c3

Please sign in to comment.