From 5b50b83a5c45edab00e3b7d9078ad6da30cb3c9f Mon Sep 17 00:00:00 2001 From: Le Yu Date: Sun, 9 Jun 2024 22:46:06 -0400 Subject: [PATCH 1/3] Fix createDefaultWarpIsmConfig to default to trusted relayer and fallback routing --- typescript/cli/src/config/warp.ts | 33 ++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/typescript/cli/src/config/warp.ts b/typescript/cli/src/config/warp.ts index c3de78eff0..aea6659163 100644 --- a/typescript/cli/src/config/warp.ts +++ b/typescript/cli/src/config/warp.ts @@ -12,7 +12,7 @@ import { WarpRouteDeployConfig, WarpRouteDeployConfigSchema, } from '@hyperlane-xyz/sdk'; -import { assert, objMap, promiseObjAll } from '@hyperlane-xyz/utils'; +import { Address, assert, objMap, promiseObjAll } from '@hyperlane-xyz/utils'; import { CommandContext } from '../context/types.js'; import { errorRed, log, logBlue, logGreen } from '../logger.js'; @@ -26,11 +26,7 @@ import { writeYamlOrJson, } from '../utils/files.js'; -import { - createAdvancedIsmConfig, - createRoutingConfig, - createTrustedRelayerConfig, -} from './ism.js'; +import { createAdvancedIsmConfig } from './ism.js'; const TYPE_DESCRIPTIONS: Record = { [TokenType.synthetic]: 'A new ERC20 with remote transfer functionality', @@ -151,7 +147,7 @@ export async function createWarpRouteDeployConfig({ const interchainSecurityModule = advanced ? await createAdvancedIsmConfig(context) - : await createDefaultWarpIsmConfig(context); + : await createDefaultWarpIsmConfig(owner); switch (type) { case TokenType.collateral: @@ -205,14 +201,27 @@ export function readWarpRouteConfig(filePath: string): WarpCoreConfig { return WarpCoreConfigSchema.parse(config); } -async function createDefaultWarpIsmConfig( - context: CommandContext, -): Promise { +/** + * Creates a default configuration for an ISM with a TRUSTED_RELAYER and FALLBACK_ROUTING. + * + * Properties relayer and owner and both set as input owner. + * + * @param owner - The address of the owner of the ISM. + * @returns The default Aggregation ISM configuration. + */ +async function createDefaultWarpIsmConfig(owner: Address): Promise { return { type: IsmType.AGGREGATION, modules: [ - await createTrustedRelayerConfig(context), - await createRoutingConfig(context, IsmType.FALLBACK_ROUTING), + { + type: IsmType.TRUSTED_RELAYER, + relayer: owner, + }, + { + type: IsmType.FALLBACK_ROUTING, + domains: {}, + owner, + }, ], threshold: 1, }; From a162c696a5805d6c1317fe9f4e735039161a3404 Mon Sep 17 00:00:00 2001 From: Le Yu Date: Sun, 9 Jun 2024 22:47:23 -0400 Subject: [PATCH 2/3] Add changeset --- .changeset/sharp-geckos-wash.md | 5 +++++ typescript/cli/src/config/warp.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/sharp-geckos-wash.md diff --git a/.changeset/sharp-geckos-wash.md b/.changeset/sharp-geckos-wash.md new file mode 100644 index 0000000000..88ee03c287 --- /dev/null +++ b/.changeset/sharp-geckos-wash.md @@ -0,0 +1,5 @@ +--- +'@hyperlane-xyz/cli': minor +--- + +Fix createDefaultWarpIsmConfig to default to trusted relayer and fallback routing without prompts diff --git a/typescript/cli/src/config/warp.ts b/typescript/cli/src/config/warp.ts index aea6659163..6eb8fbd6f9 100644 --- a/typescript/cli/src/config/warp.ts +++ b/typescript/cli/src/config/warp.ts @@ -204,7 +204,7 @@ export function readWarpRouteConfig(filePath: string): WarpCoreConfig { /** * Creates a default configuration for an ISM with a TRUSTED_RELAYER and FALLBACK_ROUTING. * - * Properties relayer and owner and both set as input owner. + * Properties relayer and owner are both set as input owner. * * @param owner - The address of the owner of the ISM. * @returns The default Aggregation ISM configuration. From 1dbe2e1d8733cb938774f84720fa89e8ee35ec15 Mon Sep 17 00:00:00 2001 From: Le Yu Date: Mon, 10 Jun 2024 10:41:06 -0400 Subject: [PATCH 3/3] Remove async from deploy ism --- typescript/cli/src/config/warp.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/typescript/cli/src/config/warp.ts b/typescript/cli/src/config/warp.ts index 6eb8fbd6f9..826622155a 100644 --- a/typescript/cli/src/config/warp.ts +++ b/typescript/cli/src/config/warp.ts @@ -147,7 +147,7 @@ export async function createWarpRouteDeployConfig({ const interchainSecurityModule = advanced ? await createAdvancedIsmConfig(context) - : await createDefaultWarpIsmConfig(owner); + : createDefaultWarpIsmConfig(owner); switch (type) { case TokenType.collateral: @@ -209,7 +209,7 @@ export function readWarpRouteConfig(filePath: string): WarpCoreConfig { * @param owner - The address of the owner of the ISM. * @returns The default Aggregation ISM configuration. */ -async function createDefaultWarpIsmConfig(owner: Address): Promise { +function createDefaultWarpIsmConfig(owner: Address): IsmConfig { return { type: IsmType.AGGREGATION, modules: [