Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: TONY warp deploy, fix CLI warp deploys with non-EVM chains #5186

Merged
merged 8 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/real-actors-grow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@hyperlane-xyz/sdk': minor
---

Don't try to build signers for non-EVM chains in MultiProtocolSignerManager
2 changes: 1 addition & 1 deletion .registryrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
47aba98bdd78ecb5a3f756dca6dc2e28325bab43
5e7227c712cca3d2b576fe7e67a434294fcc0a7f
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"base": {
"hex": "0x00000000000000000000000054624ca8abea68645b3b39211f90b804d53db680",
"base58": "1111111111112BBkkpUZNJgdH8DEmyDxFt74d4bH"
},
"solanamainnet": {
"hex": "0x2efbd8ff6417a50dbcedc18bab4235d4a2aac61af89214ac59545d30e0f86991",
"base58": "4AQVPTCAeLswnjksQdutxUDuxEJxUBwoWmVimGuPtGSt"
}
}
Original file line number Diff line number Diff line change
@@ -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"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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,
Expand All @@ -62,6 +68,12 @@ export class MultiProtocolSignerManager {
*/
async getMultiProvider(): Promise<MultiProvider> {
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);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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<RouterConfigWithoutOwner>,
_abacusWorksEnvOwnerConfig: ChainMap<OwnableConfig>,
): Promise<ChainMap<HypTokenRouterConfig>> {
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,
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 2 additions & 0 deletions typescript/infra/config/warp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -75,6 +76,7 @@ export const warpConfigGetterMap: Record<string, WarpConfigGetter> = {
[WarpRouteIds.ArbitrumBaseBlastBscEthereumFraxtalLineaModeOptimismSeiSwellTaikoZircuitEZETH]:
getRenzoEZETHWarpConfig,
[WarpRouteIds.InevmInjectiveINJ]: getInevmInjectiveINJWarpConfig,
[WarpRouteIds.BaseSolanamainnetTONY]: getBaseSolanamainnetTONYWarpConfig,
[WarpRouteIds.BscEthereumLumiaPrismPNDR]:
getBscEthereumLumiaPrismPNDRWarpConfig,
[WarpRouteIds.EthereumFlowCbBTC]: getEthereumFlowCbBTCWarpConfig,
Expand Down
1 change: 1 addition & 0 deletions typescript/infra/src/config/warp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const tokens: ChainMap<Record<string, Address>> = {
AIXBT: '0x4F9Fd6Be4a90f2620860d680c0d4d5Fb53d1A825',
GAME: '0x1C4CcA7C5DB003824208aDDA61Bd749e55F463a3',
WETH: '0x4200000000000000000000000000000000000006',
TONY: '0xb22a793a81ff5b6ad37f40d5fe1e0ac4184d52f3',
},
bsquared: {
uBTC: '0x796e4D53067FF374B89b2Ac101ce0c1f72ccaAc2',
Expand Down
2 changes: 1 addition & 1 deletion typescript/infra/src/warp/helm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading