From 69a684869c44e90d4d2ffaf88b6fad51d97e899f Mon Sep 17 00:00:00 2001 From: Trevor Porter Date: Thu, 16 Jan 2025 11:10:32 +0000 Subject: [PATCH] feat: TONY warp deploy, fix CLI warp deploys with non-EVM chains (#5186) ### Description - Deploys TONY - There was an issue with a non-EVM chain being in the warp deploy config. I made the fix but ultimately we should have a unit test to prevent this. Would prefer someone closer to the feature to do this, I just did a band aid fix ### Drive-by changes ### Related issues ### Backward compatibility ### Testing --- .changeset/real-actors-grow.md | 5 ++ .registryrc | 2 +- .../TONY-base-solanamainnet/program-ids.json | 10 ++++ .../TONY-base-solanamainnet/token-config.json | 17 +++++++ .../signer/MultiProtocolSignerManager.ts | 14 +++++- .../getBaseSolanamainnetTONYWarpConfig.ts | 46 +++++++++++++++++++ .../environments/mainnet3/warp/warpIds.ts | 1 + typescript/infra/config/warp.ts | 2 + typescript/infra/src/config/warp.ts | 1 + typescript/infra/src/warp/helm.ts | 2 +- 10 files changed, 97 insertions(+), 3 deletions(-) create mode 100644 .changeset/real-actors-grow.md create mode 100644 rust/sealevel/environments/mainnet3/warp-routes/TONY-base-solanamainnet/program-ids.json create mode 100644 rust/sealevel/environments/mainnet3/warp-routes/TONY-base-solanamainnet/token-config.json create mode 100644 typescript/infra/config/environments/mainnet3/warp/configGetters/getBaseSolanamainnetTONYWarpConfig.ts diff --git a/.changeset/real-actors-grow.md b/.changeset/real-actors-grow.md new file mode 100644 index 0000000000..b7764b2bc2 --- /dev/null +++ b/.changeset/real-actors-grow.md @@ -0,0 +1,5 @@ +--- +'@hyperlane-xyz/sdk': minor +--- + +Don't try to build signers for non-EVM chains in MultiProtocolSignerManager diff --git a/.registryrc b/.registryrc index 1cc1eb1ad9..07fa36dc52 100644 --- a/.registryrc +++ b/.registryrc @@ -1 +1 @@ -47aba98bdd78ecb5a3f756dca6dc2e28325bab43 +5e7227c712cca3d2b576fe7e67a434294fcc0a7f diff --git a/rust/sealevel/environments/mainnet3/warp-routes/TONY-base-solanamainnet/program-ids.json b/rust/sealevel/environments/mainnet3/warp-routes/TONY-base-solanamainnet/program-ids.json new file mode 100644 index 0000000000..a3862b5b63 --- /dev/null +++ b/rust/sealevel/environments/mainnet3/warp-routes/TONY-base-solanamainnet/program-ids.json @@ -0,0 +1,10 @@ +{ + "base": { + "hex": "0x00000000000000000000000054624ca8abea68645b3b39211f90b804d53db680", + "base58": "1111111111112BBkkpUZNJgdH8DEmyDxFt74d4bH" + }, + "solanamainnet": { + "hex": "0x2efbd8ff6417a50dbcedc18bab4235d4a2aac61af89214ac59545d30e0f86991", + "base58": "4AQVPTCAeLswnjksQdutxUDuxEJxUBwoWmVimGuPtGSt" + } +} \ No newline at end of file diff --git a/rust/sealevel/environments/mainnet3/warp-routes/TONY-base-solanamainnet/token-config.json b/rust/sealevel/environments/mainnet3/warp-routes/TONY-base-solanamainnet/token-config.json new file mode 100644 index 0000000000..1cc9275f26 --- /dev/null +++ b/rust/sealevel/environments/mainnet3/warp-routes/TONY-base-solanamainnet/token-config.json @@ -0,0 +1,17 @@ +{ + "base": { + "type": "collateral", + "decimals": 18, + "token": "0xb22a793a81ff5b6ad37f40d5fe1e0ac4184d52f3", + "foreignDeployment": "0x54624CA8ABEa68645b3B39211F90B804D53dB680" + }, + "solanamainnet": { + "type": "synthetic", + "decimals": 9, + "remoteDecimals": 18, + "interchainGasPaymaster": "AkeHBbE5JkwVppujCQQ6WuxsVsJtruBAjUo6fDCFp6fF", + "name": "Big Tony", + "symbol": "TONY", + "uri": "https://raw.githubusercontent.com/hyperlane-xyz/hyperlane-registry/e95e1d64a0d36c3c69bb09ed4e29acc8350848b6/deployments/warp_routes/TONY/metadata.json" + } +} diff --git a/typescript/cli/src/context/strategies/signer/MultiProtocolSignerManager.ts b/typescript/cli/src/context/strategies/signer/MultiProtocolSignerManager.ts index f8e411bad1..394e0b1391 100644 --- a/typescript/cli/src/context/strategies/signer/MultiProtocolSignerManager.ts +++ b/typescript/cli/src/context/strategies/signer/MultiProtocolSignerManager.ts @@ -6,7 +6,7 @@ import { ChainSubmissionStrategy, MultiProvider, } from '@hyperlane-xyz/sdk'; -import { assert, rootLogger } from '@hyperlane-xyz/utils'; +import { ProtocolType, assert, rootLogger } from '@hyperlane-xyz/utils'; import { ENV } from '../../../utils/env.js'; @@ -48,6 +48,12 @@ export class MultiProtocolSignerManager { */ protected initializeStrategies(): void { for (const chain of this.chains) { + if (this.multiProvider.getProtocol(chain) !== ProtocolType.Ethereum) { + this.logger.debug( + `Skipping signer strategy initialization for non-EVM chain ${chain}`, + ); + continue; + } const strategy = MultiProtocolSignerFactory.getSignerStrategy( chain, this.submissionStrategy, @@ -62,6 +68,12 @@ export class MultiProtocolSignerManager { */ async getMultiProvider(): Promise { for (const chain of this.chains) { + if (this.multiProvider.getProtocol(chain) !== ProtocolType.Ethereum) { + this.logger.debug( + `Skipping signer initialization for non-EVM chain ${chain}`, + ); + continue; + } const signer = await this.initSigner(chain); this.multiProvider.setSigner(chain, signer); } diff --git a/typescript/infra/config/environments/mainnet3/warp/configGetters/getBaseSolanamainnetTONYWarpConfig.ts b/typescript/infra/config/environments/mainnet3/warp/configGetters/getBaseSolanamainnetTONYWarpConfig.ts new file mode 100644 index 0000000000..dc16268fa7 --- /dev/null +++ b/typescript/infra/config/environments/mainnet3/warp/configGetters/getBaseSolanamainnetTONYWarpConfig.ts @@ -0,0 +1,46 @@ +import { ethers } from 'ethers'; + +import { + ChainMap, + HypTokenRouterConfig, + OwnableConfig, + TokenType, +} from '@hyperlane-xyz/sdk'; + +import { + RouterConfigWithoutOwner, + tokens, +} from '../../../../../src/config/warp.js'; +import { SEALEVEL_WARP_ROUTE_HANDLER_GAS_AMOUNT } from '../consts.js'; + +// Cod3x SAFE +const baseOwner = '0xfEfcb2fb19b9A70B30646Fdc1A0860Eb12F7ff8b'; +// Cod3x Squads vault +const solanamainnetOwner = '7dRAVvdmV3dy4JieuRAirBQ9oSpYaHgmYwupoK5YZcFR'; + +export async function getBaseSolanamainnetTONYWarpConfig( + routerConfig: ChainMap, + _abacusWorksEnvOwnerConfig: ChainMap, +): Promise> { + let base: HypTokenRouterConfig = { + mailbox: routerConfig.base.mailbox, + owner: baseOwner, + type: TokenType.collateral, + token: tokens.base.TONY, + interchainSecurityModule: ethers.constants.AddressZero, + }; + + const solanamainnet: HypTokenRouterConfig = { + mailbox: routerConfig.solanamainnet.mailbox, + owner: solanamainnetOwner, + type: TokenType.synthetic, + foreignDeployment: '4AQVPTCAeLswnjksQdutxUDuxEJxUBwoWmVimGuPtGSt', + gas: SEALEVEL_WARP_ROUTE_HANDLER_GAS_AMOUNT, + interchainSecurityModule: ethers.constants.AddressZero, + }; + + return { + base, + solanamainnet, + }; +} diff --git a/typescript/infra/config/environments/mainnet3/warp/warpIds.ts b/typescript/infra/config/environments/mainnet3/warp/warpIds.ts index 00e8dbd882..98cc569ce4 100644 --- a/typescript/infra/config/environments/mainnet3/warp/warpIds.ts +++ b/typescript/infra/config/environments/mainnet3/warp/warpIds.ts @@ -7,6 +7,7 @@ export enum WarpRouteIds { ArbitrumNeutronTIA = 'TIA/arbitrum-neutron', ArbitrumTreasureMAGIC = 'MAGIC/arbitrum-treasure', BscEthereumLumiaPrismPNDR = 'PNDR/bsc-ethereum-lumiaprism', + BaseSolanamainnetTONY = 'TONY/base-solanamainnet', EclipseEthereumApxEth = 'APXETH/eclipsemainnet-ethereum', EclipseEthereumSolanaUSDC = 'USDC/eclipsemainnet-ethereum-solanamainnet', EclipseEthereumSolanaUSDT = 'USDT/eclipsemainnet-ethereum-solanamainnet', diff --git a/typescript/infra/config/warp.ts b/typescript/infra/config/warp.ts index 05cc0bf9ad..e9a6fc3401 100644 --- a/typescript/infra/config/warp.ts +++ b/typescript/infra/config/warp.ts @@ -24,6 +24,7 @@ import { getArtelaBaseUSDCWarpConfig } from './environments/mainnet3/warp/config import { getArtelaBaseWETHWarpConfig } from './environments/mainnet3/warp/configGetters/getArtelaBaseWETHWarpConfig.js'; import { getBaseFormAIXBTWarpConfig } from './environments/mainnet3/warp/configGetters/getBaseFormAIXBTWarpConfig.js'; import { getBaseFormGAMEWarpConfig } from './environments/mainnet3/warp/configGetters/getBaseFormGAMEWarpConfig.js'; +import { getBaseSolanamainnetTONYWarpConfig } from './environments/mainnet3/warp/configGetters/getBaseSolanamainnetTONYWarpConfig.js'; import { getBaseZeroNetworkCBBTCWarpConfig } from './environments/mainnet3/warp/configGetters/getBaseZeroNetworkCBBTCWarpConfig.js'; import { getBobaBsquaredSwellUBTCWarpConfig } from './environments/mainnet3/warp/configGetters/getBobaBsquaredSwellUBTCWarpConfig.js'; import { getBscEthereumLumiaPrismPNDRWarpConfig } from './environments/mainnet3/warp/configGetters/getBscEthereumLumiaPNDRWarpConfig.js'; @@ -75,6 +76,7 @@ export const warpConfigGetterMap: Record = { [WarpRouteIds.ArbitrumBaseBlastBscEthereumFraxtalLineaModeOptimismSeiSwellTaikoZircuitEZETH]: getRenzoEZETHWarpConfig, [WarpRouteIds.InevmInjectiveINJ]: getInevmInjectiveINJWarpConfig, + [WarpRouteIds.BaseSolanamainnetTONY]: getBaseSolanamainnetTONYWarpConfig, [WarpRouteIds.BscEthereumLumiaPrismPNDR]: getBscEthereumLumiaPrismPNDRWarpConfig, [WarpRouteIds.EthereumFlowCbBTC]: getEthereumFlowCbBTCWarpConfig, diff --git a/typescript/infra/src/config/warp.ts b/typescript/infra/src/config/warp.ts index 8ff0b53554..0954bb71af 100644 --- a/typescript/infra/src/config/warp.ts +++ b/typescript/infra/src/config/warp.ts @@ -27,6 +27,7 @@ export const tokens: ChainMap> = { AIXBT: '0x4F9Fd6Be4a90f2620860d680c0d4d5Fb53d1A825', GAME: '0x1C4CcA7C5DB003824208aDDA61Bd749e55F463a3', WETH: '0x4200000000000000000000000000000000000006', + TONY: '0xb22a793a81ff5b6ad37f40d5fe1e0ac4184d52f3', }, bsquared: { uBTC: '0x796e4D53067FF374B89b2Ac101ce0c1f72ccaAc2', diff --git a/typescript/infra/src/warp/helm.ts b/typescript/infra/src/warp/helm.ts index 5ef21a3f3b..a773d4462a 100644 --- a/typescript/infra/src/warp/helm.ts +++ b/typescript/infra/src/warp/helm.ts @@ -28,7 +28,7 @@ export class WarpRouteMonitorHelmManager extends HelmManager { return { image: { repository: 'gcr.io/abacus-labs-dev/hyperlane-monorepo', - tag: 'b18ab47-20250114-203624', + tag: '700e53a-20250115-183228', }, warpRouteId: this.warpRouteId, fullnameOverride: this.helmReleaseName,