diff --git a/rust/agents/scraper/migration/src/m20230309_000001_create_table_domain.rs b/rust/agents/scraper/migration/src/m20230309_000001_create_table_domain.rs index 8d97a7e8e1..1ce834bc54 100644 --- a/rust/agents/scraper/migration/src/m20230309_000001_create_table_domain.rs +++ b/rust/agents/scraper/migration/src/m20230309_000001_create_table_domain.rs @@ -22,6 +22,14 @@ const DOMAINS: &[RawDomain] = &[ is_test_net: true, is_deprecated: false, }, + RawDomain { + name: "ancient8", + token: "ETH", + domain: 888888888, + chain_id: 888888888, + is_test_net: false, + is_deprecated: false, + }, RawDomain { name: "arbitrum", token: "ETH", diff --git a/typescript/infra/config/environments/mainnet3/agent.ts b/typescript/infra/config/environments/mainnet3/agent.ts index d4b60eb96a..a470caea86 100644 --- a/typescript/infra/config/environments/mainnet3/agent.ts +++ b/typescript/infra/config/environments/mainnet3/agent.ts @@ -88,7 +88,7 @@ export const hyperlaneContextAgentChainConfig: AgentChainConfig = { }, [Role.Scraper]: { [Chains.arbitrum]: true, - [Chains.ancient8]: false, + [Chains.ancient8]: true, [Chains.avalanche]: true, [Chains.bsc]: true, [Chains.celo]: true, @@ -143,11 +143,20 @@ const hyperlane: RootAgentConfig = { tag: '2a16200-20240408-214947', }, gasPaymentEnforcement: [ - // Temporary measure to ensure all inEVM warp route messages are delivered - - // we saw some issues with IGP indexing. + // To cover ourselves against IGP indexing issues and to ensure Nexus + // users have the best possible experience, we whitelist messages between + // warp routes that we know are certainly paying for gas. { type: GasPaymentEnforcementPolicyType.None, - matchingList: routerMatchingList(injectiveInevmInjAddresses), + matchingList: [ + ...routerMatchingList(injectiveInevmInjAddresses), + ...matchingList(inevmEthereumUsdcAddresses), + ...matchingList(inevmEthereumUsdtAddresses), + ...routerMatchingList(victionEthereumEthAddresses), + ...routerMatchingList(victionEthereumUsdcAddresses), + ...routerMatchingList(victionEthereumUsdtAddresses), + ...routerMatchingList(ancient8EthereumUsdcAddresses), + ], }, { type: GasPaymentEnforcementPolicyType.None, @@ -199,7 +208,7 @@ const hyperlane: RootAgentConfig = { validators: { docker: { repo, - tag: 'c1da894-20240321-175000', + tag: '2a16200-20240408-214947', }, rpcConsensusType: RpcConsensusType.Quorum, chains: validatorChainConfig(Contexts.Hyperlane), @@ -208,7 +217,7 @@ const hyperlane: RootAgentConfig = { rpcConsensusType: RpcConsensusType.Fallback, docker: { repo, - tag: 'ae0990a-20240313-215426', + tag: '2a16200-20240408-214947', }, }, }; @@ -222,7 +231,7 @@ const releaseCandidate: RootAgentConfig = { rpcConsensusType: RpcConsensusType.Fallback, docker: { repo, - tag: 'a72c3cf-20240314-173418', + tag: '2a16200-20240408-214947', }, whitelist: releaseCandidateHelloworldMatchingList, gasPaymentEnforcement, @@ -234,7 +243,7 @@ const releaseCandidate: RootAgentConfig = { validators: { docker: { repo, - tag: 'ae0990a-20240313-215426', + tag: '2a16200-20240408-214947', }, rpcConsensusType: RpcConsensusType.Quorum, chains: validatorChainConfig(Contexts.ReleaseCandidate), @@ -258,24 +267,14 @@ const neutron: RootAgentConfig = { rpcConsensusType: RpcConsensusType.Fallback, docker: { repo, - tag: 'a72c3cf-20240314-173418', + tag: '2a16200-20240408-214947', }, gasPaymentEnforcement: [ { type: GasPaymentEnforcementPolicyType.None, matchingList: [ - { - originDomain: getDomainId(chainMetadata.neutron), - destinationDomain: getDomainId(chainMetadata.mantapacific), - senderAddress: '*', - recipientAddress: '*', - }, - { - originDomain: getDomainId(chainMetadata.neutron), - destinationDomain: getDomainId(chainMetadata.arbitrum), - senderAddress: '*', - recipientAddress: '*', - }, + ...routerMatchingList(mantaTIAAddresses), + ...routerMatchingList(arbitrumTIAAddresses), ], }, ...gasPaymentEnforcement, diff --git a/typescript/infra/config/aw-multisig-hyperlane.json b/typescript/infra/config/environments/mainnet3/aw-validators/hyperlane.json similarity index 70% rename from typescript/infra/config/aw-multisig-hyperlane.json rename to typescript/infra/config/environments/mainnet3/aw-validators/hyperlane.json index 0cd93086dc..e0603dfdeb 100644 --- a/typescript/infra/config/aw-multisig-hyperlane.json +++ b/typescript/infra/config/environments/mainnet3/aw-validators/hyperlane.json @@ -1,11 +1,4 @@ { - "alfajores": { - "validators": [ - "0x2233a5ce12f814bd64c9cdd73410bb8693124d40", - "0xba279f965489d90f90490e3c49e860e0b43c2ae6", - "0x86485dcec5f7bb8478dd251676372d054dea6653" - ] - }, "ancient8": { "validators": ["0xbb5842ae0e05215b53df4787a29144efb7e67551"] }, @@ -37,13 +30,6 @@ "0x03047213365800f065356b4a2fe97c3c3a52296a" ] }, - "bsctestnet": { - "validators": [ - "0x242d8a855a8c932dec51f7999ae7d1e48b10c95e", - "0xf620f5e3d25a3ae848fec74bccae5de3edcd8796", - "0x1f030345963c54ff8229720dd3a711c15c554aeb" - ] - }, "celo": { "validators": [ "0x63478422679303c3e4fc611b771fa4a707ef7f4a", @@ -51,9 +37,6 @@ "0x7bf30afcb6a7d92146d5a910ea4c154fba38d25e" ] }, - "eclipsetestnet": { - "validators": ["0xf344f34abca9a444545b5295066348a0ae22dda3"] - }, "ethereum": { "validators": [ "0x03c842db86a6a3e524d4a6615390c1ea8e2b9541", @@ -61,13 +44,6 @@ "0x749d6e7ad949e522c92181dc77f7bbc1c5d71506" ] }, - "fuji": { - "validators": [ - "0xd8154f73d04cc7f7f0c332793692e6e6f6b2402e", - "0x895ae30bc83ff1493b9cf7781b0b813d23659857", - "0x43e915573d9f1383cbf482049e4a012290759e7f" - ] - }, "gnosis": { "validators": [ "0xd4df66a859585678f2ea8357161d896be19cc1ca", @@ -113,13 +89,6 @@ "0x779a17e035018396724a6dec8a59bda1b5adf738" ] }, - "plumetestnet": { - "validators": [ - "0xe765a214849f3ecdf00793b97d00422f2d408ea6", - "0xb59998f71efc65190a85ac5e81b66bd72a192a3b", - "0xc906470a73e6b5aad65a4ceb4acd73e3eaf80e2c" - ] - }, "polygon": { "validators": [ "0x12ecb319c7f4e8ac5eb5226662aeb8528c5cefac", @@ -141,23 +110,6 @@ "0x7210fa0a6be39a75cb14d682ebfb37e2b53ecbe5" ] }, - "scrollsepolia": { - "validators": [ - "0xbe18dbd758afb367180260b524e6d4bcd1cb6d05", - "0x9a11ed23ae962974018ab45bc133caabff7b3271", - "0x7867bea3c9761fe64e6d124b171f91fd5dd79644" - ] - }, - "sepolia": { - "validators": [ - "0xb22b65f202558adf86a8bb2847b76ae1036686a5", - "0x469f0940684d147defc44f3647146cb90dd0bc8e", - "0xd3c75dcf15056012a4d74c483a0c6ea11d8c2b83" - ] - }, - "solanatestnet": { - "validators": ["0xd4ce8fa138d4e083fc0e480cca0dbfa4f5f30bd5"] - }, "viction": { "validators": ["0x1f87c368f8e05a85ef9126d984a980a20930cb9c"] } diff --git a/typescript/infra/config/aw-multisig-rc.json b/typescript/infra/config/environments/mainnet3/aw-validators/rc.json similarity index 64% rename from typescript/infra/config/aw-multisig-rc.json rename to typescript/infra/config/environments/mainnet3/aw-validators/rc.json index 076251aeb7..7c65389fc4 100644 --- a/typescript/infra/config/aw-multisig-rc.json +++ b/typescript/infra/config/environments/mainnet3/aw-validators/rc.json @@ -1,11 +1,4 @@ { - "alfajores": { - "validators": [ - "0x2233a5ce12f814bd64c9cdd73410bb8693124d40", - "0xba279f965489d90f90490e3c49e860e0b43c2ae6", - "0x86485dcec5f7bb8478dd251676372d054dea6653" - ] - }, "ancient8": { "validators": ["0xaae4d879a04e3d8b956eb4ffbefd57fdbed09cae"] }, @@ -37,13 +30,6 @@ "0x50ff94984161976a13e9ec3b2a7647da5319448f" ] }, - "bsctestnet": { - "validators": [ - "0x242d8a855a8c932dec51f7999ae7d1e48b10c95e", - "0xf620f5e3d25a3ae848fec74bccae5de3edcd8796", - "0x1f030345963c54ff8229720dd3a711c15c554aeb" - ] - }, "celo": { "validators": [ "0xb51768c1388e976486a43dbbbbf9ce04cf45e990", @@ -51,9 +37,6 @@ "0xd796c1d4fcfb3c63acfa6e4113aa6ae1399b337c" ] }, - "eclipsetestnet": { - "validators": ["0xf344f34abca9a444545b5295066348a0ae22dda3"] - }, "ethereum": { "validators": [ "0x0580884289890805802012b9872afa5ae41a5fa6", @@ -61,13 +44,6 @@ "0x87cf8a85465118aff9ec728ca157798201b1e368" ] }, - "fuji": { - "validators": [ - "0xd8154f73d04cc7f7f0c332793692e6e6f6b2402e", - "0x895ae30bc83ff1493b9cf7781b0b813d23659857", - "0x43e915573d9f1383cbf482049e4a012290759e7f" - ] - }, "gnosis": { "validators": [ "0xd5122daa0c3dfc94a825ae928f3ea138cdb6a2e1", @@ -82,13 +58,6 @@ "0xe83d36fd00d9ef86243d9f7147b29e98d11df0ee" ] }, - "injective": { - "validators": [ - "0xbfb8911b72cfb138c7ce517c57d9c691535dc517", - "0x6faa139c33a7e6f53cb101f6b2ae392298283ed2", - "0x0115e3a66820fb99da30d30e2ce52a453ba99d92" - ] - }, "mantapacific": { "validators": [ "0x84fcb05e6e5961df2dfd9f36e8f2b3e87ede7d76", @@ -103,13 +72,6 @@ "0xcaa9c6e6efa35e4a8b47565f3ce98845fa638bf3" ] }, - "mumbai": { - "validators": [ - "0xebc301013b6cd2548e347c28d2dc43ec20c068f2", - "0x315db9868fc8813b221b1694f8760ece39f45447", - "0x17517c98358c5937c5d9ee47ce1f5b4c2b7fc9f5" - ] - }, "neutron": { "validators": [ "0x307a8fe091b8273c7ce3d277b161b4a2167279b1", @@ -124,13 +86,6 @@ "0x2d58cdb2bed9aac57b488b1bad06839ddc280a78" ] }, - "plumetestnet": { - "validators": [ - "0xe765a214849f3ecdf00793b97d00422f2d408ea6", - "0xb59998f71efc65190a85ac5e81b66bd72a192a3b", - "0xc906470a73e6b5aad65a4ceb4acd73e3eaf80e2c" - ] - }, "polygon": { "validators": [ "0xf0a990959f833ccde624c8bcd4c7669286a57a0f", @@ -152,23 +107,6 @@ "0x07c2f32a402543badc3141f6b98969d75ef2ac28" ] }, - "scrollsepolia": { - "validators": [ - "0xbe18dbd758afb367180260b524e6d4bcd1cb6d05", - "0x9a11ed23ae962974018ab45bc133caabff7b3271", - "0x7867bea3c9761fe64e6d124b171f91fd5dd79644" - ] - }, - "sepolia": { - "validators": [ - "0xb22b65f202558adf86a8bb2847b76ae1036686a5", - "0x469f0940684d147defc44f3647146cb90dd0bc8e", - "0xd3c75dcf15056012a4d74c483a0c6ea11d8c2b83" - ] - }, - "solanatestnet": { - "validators": ["0xd4ce8fa138d4e083fc0e480cca0dbfa4f5f30bd5"] - }, "viction": { "validators": [ "0xe858971cd865b11d3e8fb6b6af72db0d85881baf", diff --git a/typescript/infra/config/environments/mainnet3/warp/addresses.json b/typescript/infra/config/environments/mainnet3/warp/addresses.json index 74ba3a5929..feb5836384 100644 --- a/typescript/infra/config/environments/mainnet3/warp/addresses.json +++ b/typescript/infra/config/environments/mainnet3/warp/addresses.json @@ -5,6 +5,7 @@ }, "ethereum": { "HypERC20Collateral": "0x8b4192B9Ad1fCa440A5808641261e5289e6de95D", - "collateral": "0x8b4192B9Ad1fCa440A5808641261e5289e6de95D" + "collateral": "0x8b4192B9Ad1fCa440A5808641261e5289e6de95D", + "proxyAdmin": "0x7d0c8b23c5b35091972023ccc689cfedcd881c7d" } } diff --git a/typescript/infra/config/environments/mainnet3/warp/ancient8-USDC-deployments.yaml b/typescript/infra/config/environments/mainnet3/warp/ancient8-USDC-deployments.yaml new file mode 100644 index 0000000000..07be060273 --- /dev/null +++ b/typescript/infra/config/environments/mainnet3/warp/ancient8-USDC-deployments.yaml @@ -0,0 +1,22 @@ +# Configs and artifacts for the deployment of Hyperlane Warp Routes +# Between ancient8 and Ethereum +description: Hyperlane Warp Route artifacts +timestamp: '2024-04-15T16:00:00.000Z' +deployer: Abacus Works (Hyperlane) +data: + config: + ethereum: + protocolType: ethereum + type: collateral + hypAddress: '0x8b4192B9Ad1fCa440A5808641261e5289e6de95D' + tokenAddress: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' # USDC + name: USDC + symbol: USDC + decimals: 6 + ancient8: + protocolType: ethereum + type: synthetic + hypAddress: '0x97423A68BAe94b5De52d767a17aBCc54c157c0E5' + name: USDC + symbol: USDC + decimals: 6 diff --git a/typescript/infra/config/environments/mainnet3/warp/verification.json b/typescript/infra/config/environments/mainnet3/warp/verification.json index e77c33a7df..48f75ae1d8 100644 --- a/typescript/infra/config/environments/mainnet3/warp/verification.json +++ b/typescript/infra/config/environments/mainnet3/warp/verification.json @@ -23,6 +23,18 @@ "constructorArguments": "0000000000000000000000009fa986acb22953c504fcf5985dfa476d481c3b1b000000000000000000000000db670e1a1e312bf17425b08ce55bdf2cd8f8ed5400000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000144e80a7c79000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a7eccdb9be08178f896c26b7bbd8c3d4e844d9ba000000000000000000000000000000000000000000000000000000000000000855534420436f696e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004555344430000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "isProxy": true, "name": "TransparentUpgradeableProxy" + }, + { + "address": "0x086eF95a2F74582Ee30E7D698518a872fb18301f", + "constructorArguments": "", + "isProxy": false, + "name": "ProxyAdmin" + }, + { + "address": "0x8358D8291e3bEDb04804975eEa0fe9fe0fAfB147", + "constructorArguments": "", + "isProxy": false, + "name": "ProxyAdmin" } ], "arbitrum": [ diff --git a/typescript/infra/config/environments/testnet4/aw-validators/hyperlane.json b/typescript/infra/config/environments/testnet4/aw-validators/hyperlane.json new file mode 100644 index 0000000000..cc2846ca39 --- /dev/null +++ b/typescript/infra/config/environments/testnet4/aw-validators/hyperlane.json @@ -0,0 +1,50 @@ +{ + "alfajores": { + "validators": [ + "0x2233a5ce12f814bd64c9cdd73410bb8693124d40", + "0xba279f965489d90f90490e3c49e860e0b43c2ae6", + "0x86485dcec5f7bb8478dd251676372d054dea6653" + ] + }, + "bsctestnet": { + "validators": [ + "0x242d8a855a8c932dec51f7999ae7d1e48b10c95e", + "0xf620f5e3d25a3ae848fec74bccae5de3edcd8796", + "0x1f030345963c54ff8229720dd3a711c15c554aeb" + ] + }, + "eclipsetestnet": { + "validators": ["0xf344f34abca9a444545b5295066348a0ae22dda3"] + }, + "fuji": { + "validators": [ + "0xd8154f73d04cc7f7f0c332793692e6e6f6b2402e", + "0x895ae30bc83ff1493b9cf7781b0b813d23659857", + "0x43e915573d9f1383cbf482049e4a012290759e7f" + ] + }, + "plumetestnet": { + "validators": [ + "0xe765a214849f3ecdf00793b97d00422f2d408ea6", + "0xb59998f71efc65190a85ac5e81b66bd72a192a3b", + "0xc906470a73e6b5aad65a4ceb4acd73e3eaf80e2c" + ] + }, + "scrollsepolia": { + "validators": [ + "0xbe18dbd758afb367180260b524e6d4bcd1cb6d05", + "0x9a11ed23ae962974018ab45bc133caabff7b3271", + "0x7867bea3c9761fe64e6d124b171f91fd5dd79644" + ] + }, + "sepolia": { + "validators": [ + "0xb22b65f202558adf86a8bb2847b76ae1036686a5", + "0x469f0940684d147defc44f3647146cb90dd0bc8e", + "0xd3c75dcf15056012a4d74c483a0c6ea11d8c2b83" + ] + }, + "solanatestnet": { + "validators": ["0xd4ce8fa138d4e083fc0e480cca0dbfa4f5f30bd5"] + } +} diff --git a/typescript/infra/config/environments/testnet4/aw-validators/rc.json b/typescript/infra/config/environments/testnet4/aw-validators/rc.json new file mode 100644 index 0000000000..bcecd3ec6d --- /dev/null +++ b/typescript/infra/config/environments/testnet4/aw-validators/rc.json @@ -0,0 +1,44 @@ +{ + "alfajores": { + "validators": [ + "0xace978aaa61d9ee44fe3ab147fd227e0e66b8909", + "0x6c8bfdfb8c40aba10cc9fb2cf0e3e856e0e5dbb3", + "0x54c65eb7677e6086cdde3d5ccef89feb2103a11d" + ] + }, + "bsctestnet": { + "validators": [ + "0x6353c7402626054c824bd0eca721f82b725e2b4d", + "0xcb5be62b19c52b78cd3993c71c3fa74d821475ae", + "0xc50ddb8f03133611853b7f03ffe0a8098e08ae15" + ] + }, + "fuji": { + "validators": [ + "0xfc419f9ba3c56c55e28844ade491d428f5a77d55", + "0x0a636e76df4124b092cabb4321d6aaef9defb514", + "0xbf86037899efe97bca4cea865607e10b849b5878" + ] + }, + "plumetestnet": { + "validators": [ + "0xe6e6aeecbf7755cdbc50c2683df9f2d100f6399d", + "0x27946c13a475233a3b1eb47f0bd0f7cdec3a3983", + "0x2596413213368475c96ddfb1ae26666d22093a8b" + ] + }, + "scrollsepolia": { + "validators": [ + "0x50d939d66f114350f322eb8b2e9f01fbc401d4c9", + "0x10fa7a657a06a47bcca1bacc436d61619e5d104c", + "0xa0f1cf3b23bd0f8a5e2ad438657097b8287816b4" + ] + }, + "sepolia": { + "validators": [ + "0x49f253c0dab33be1573d6c2769b3d9e584d91f82", + "0x13b51805e9af68e154778d973165f32e10b7446b", + "0x7f699c3fc3de4928f1c0abfba1eac3fbb5a00d1b" + ] + } +} diff --git a/typescript/infra/config/environments/testnet4/validators.ts b/typescript/infra/config/environments/testnet4/validators.ts index c02745280d..d4e4be74aa 100644 --- a/typescript/infra/config/environments/testnet4/validators.ts +++ b/typescript/infra/config/environments/testnet4/validators.ts @@ -131,35 +131,6 @@ export const validatorChainConfig = ( 'plumetestnet', ), }, - injective: { - interval: 5, - reorgPeriod: getReorgPeriod(chainMetadata.injective), - validators: validatorsConfig( - { - [Contexts.Hyperlane]: ['0x10686BEe585491A0DA5bfCd5ABfbB95Ab4d6c86d'], - [Contexts.ReleaseCandidate]: [], - [Contexts.Neutron]: [], - }, - 'injective', - ), - }, - // proteustestnet: { - // interval: 5, - // reorgPeriod: getReorgPeriod(chainMetadata.proteustestnet), - // validators: validatorsConfig( - // { - // [Contexts.Hyperlane]: [ - // '0x79fc73656abb9eeaa5ee853c4569124f5bdaf9d8', - // '0x72840388d5ab57323bc4f6e6d3ddedfd5cc911f0', - // '0xd4b2a50c53fc6614bb3cd3198e0fdc03f5da973f', - // ], - // [Contexts.ReleaseCandidate]: [ - // '0xc2ccc4eab0e8d441235d661e39341ae16c3bf8cd', - // ], - // }, - // 'proteustestnet', - // ), - // }, solanatestnet: { interval: 1, reorgPeriod: getReorgPeriod(chainMetadata.solanatestnet), diff --git a/typescript/infra/config/warp.ts b/typescript/infra/config/warp.ts new file mode 100644 index 0000000000..831b7cafe4 --- /dev/null +++ b/typescript/infra/config/warp.ts @@ -0,0 +1,81 @@ +import { ethers } from 'ethers'; + +import { + ChainMap, + ERC20RouterConfig, + HyperlaneCore, + HyperlaneIsmFactory, + MultiProvider, + RouterConfig, + TokenConfig, + TokenType, + buildAggregationIsmConfigs, + defaultMultisigConfigs, +} from '@hyperlane-xyz/sdk'; + +import { Modules, getAddresses } from '../scripts/agent-utils'; +import { + EnvironmentConfig, + deployEnvToSdkEnv, +} from '../src/config/environment'; +import { tokens } from '../src/config/warp'; + +import { DEPLOYER } from './environments/mainnet3/owners'; + +export async function getWarpConfig( + multiProvider: MultiProvider, + envConfig: EnvironmentConfig, +): Promise> { + const core = HyperlaneCore.fromEnvironment( + deployEnvToSdkEnv[envConfig.environment], + multiProvider, + ); + const ismFactory = HyperlaneIsmFactory.fromAddressesMap( + getAddresses(envConfig.environment, Modules.PROXY_FACTORY), + multiProvider, + ); + + const owner = DEPLOYER; + + // "Manually" deploying an ISM because the warp deployer doesn't support + // ISM objects at the moment, and the deploy involves strictly recoverable ISMs. + const ism = await ismFactory.deploy({ + destination: 'ethereum', + config: buildAggregationIsmConfigs( + 'ethereum', + ['ancient8'], + defaultMultisigConfigs, + ).ancient8, + }); + + const routerConfig = core.getRouterConfig(envConfig.owners); + + const ethereum: TokenConfig & RouterConfig = { + ...routerConfig.ethereum, + type: TokenType.collateral, + token: tokens.ethereum.USDC, + interchainSecurityModule: ism.address, + // This hook was recovered from running the deploy script + // for the hook module. The hook configuration is the Ethereum + // default hook for the Ancient8 remote (no routing). + hook: '0x19b2cF952b70b217c90FC408714Fbc1acD29A6A8', + owner, + }; + + // @ts-ignore - The types as they stand require a synthetic to specify + // TokenMetadata, but in practice these are actually inferred from a + // collateral config. To avoid needing to specify the TokenMetadata, just + // ts-ignore for synthetic tokens. + const ancient8: TokenConfig & RouterConfig = { + ...routerConfig.ancient8, + type: TokenType.synthetic, + // Uses the default ISM + interchainSecurityModule: ethers.constants.AddressZero, + owner, + }; + + return { + ethereum, + ancient8, + }; +} diff --git a/typescript/infra/helm/warp-routes/templates/_helpers.tpl b/typescript/infra/helm/warp-routes/templates/_helpers.tpl index f4359eaf07..29afca86f6 100644 --- a/typescript/infra/helm/warp-routes/templates/_helpers.tpl +++ b/typescript/infra/helm/warp-routes/templates/_helpers.tpl @@ -58,6 +58,9 @@ The warp-routes container - name: warp-routes image: {{ .Values.image.repository }}:{{ .Values.image.tag }} imagePullPolicy: IfNotPresent + env: + - name: LOG_FORMAT + value: pretty command: - ./node_modules/.bin/tsx - ./typescript/infra/scripts/warp-routes/monitor-warp-routes-balances.ts diff --git a/typescript/infra/scripts/agent-utils.ts b/typescript/infra/scripts/agent-utils.ts index 1ea2658571..74cfe023a8 100644 --- a/typescript/infra/scripts/agent-utils.ts +++ b/typescript/infra/scripts/agent-utils.ts @@ -1,4 +1,5 @@ -import path from 'path'; +import path, { dirname, join } from 'path'; +import { fileURLToPath } from 'url'; import yargs, { Argv } from 'yargs'; import { @@ -40,6 +41,7 @@ import { Role } from '../src/roles.js'; import { assertContext, assertRole, + getInfraPath, readJSON, readJSONAtPath, } from '../src/utils/utils.js'; @@ -266,7 +268,11 @@ export function ensureValidatorConfigConsistency(agentConfig: RootAgentConfig) { ); if (symDiff.size > 0) { throw new Error( - `Validator config invalid. Validator context chain names: ${validatorContextChainNames}, validator config chains: ${validatorConfigChains}, diff: ${symDiff}`, + `Validator config invalid.\nValidator context chain names: ${[ + ...validatorContextChainNames, + ]}\nValidator config chains: ${[...validatorConfigChains]}\nDiff: ${[ + ...symDiff, + ]}`, ); } } @@ -430,3 +436,15 @@ export function getValidatorsByChain( } return validators; } + +export function getAWValidatorsPath( + environment: DeployEnvironment, + context: Contexts, +) { + return join( + getInfraPath(), + getEnvironmentDirectory(environment), + 'aw-validators', + `${context}.json`, + ); +} diff --git a/typescript/infra/scripts/check-deploy.ts b/typescript/infra/scripts/check-deploy.ts index 54b553b0a7..81720905ad 100644 --- a/typescript/infra/scripts/check-deploy.ts +++ b/typescript/infra/scripts/check-deploy.ts @@ -16,6 +16,7 @@ import { } from '@hyperlane-xyz/sdk'; import { Contexts } from '../config/contexts.js'; +import { getWarpConfig } from '../config/warp.js'; import { deployEnvToSdkEnv } from '../src/config/environment.js'; import { HyperlaneAppGovernor } from '../src/govern/HyperlaneAppGovernor.js'; import { HyperlaneCoreGovernor } from '../src/govern/HyperlaneCoreGovernor.js'; @@ -43,8 +44,8 @@ function getArgs() { async function check() { const { fork, govern, module, environment, context } = await getArgs(); - const config = getEnvironmentConfig(environment); - let multiProvider = await config.getMultiProvider(); + const envConfig = getEnvironmentConfig(environment); + let multiProvider = await envConfig.getMultiProvider(); // must rotate to forked provider before building core contracts if (fork) { @@ -58,7 +59,7 @@ async function check() { const owner = await resolveOrDeployAccountOwner( multiProvider, fork, - config.core[fork].owner, + envConfig.core[fork].owner, ); const signer = await impersonateAccount(owner, 1e18); @@ -69,7 +70,7 @@ async function check() { const env = deployEnvToSdkEnv[environment]; const core = HyperlaneCore.fromEnvironment(env, multiProvider); const ismFactory = HyperlaneIsmFactory.fromEnvironment(env, multiProvider); - const routerConfig = core.getRouterConfig(config.owners); + const routerConfig = core.getRouterConfig(envConfig.owners); const ica = InterchainAccount.fromEnvironment(env, multiProvider); let governor: HyperlaneAppGovernor; @@ -77,13 +78,13 @@ async function check() { const checker = new HyperlaneCoreChecker( multiProvider, core, - config.core, + envConfig.core, ismFactory, ); governor = new HyperlaneCoreGovernor(checker); } else if (module === Modules.INTERCHAIN_GAS_PAYMASTER) { const igp = HyperlaneIgp.fromEnvironment(env, multiProvider); - const checker = new HyperlaneIgpChecker(multiProvider, igp, config.igp); + const checker = new HyperlaneIgpChecker(multiProvider, igp, envConfig.igp); governor = new HyperlaneIgpGovernor(checker); } else if (module === Modules.INTERCHAIN_ACCOUNTS) { const checker = new InterchainAccountChecker( @@ -102,7 +103,7 @@ async function check() { governor = new ProxiedRouterGovernor(checker); } else if (module === Modules.HELLO_WORLD) { const app = await getHelloWorldApp( - config, + envConfig, context, Role.Deployer, Contexts.Hyperlane, // Owner should always be from the hyperlane context @@ -116,25 +117,7 @@ async function check() { ); governor = new ProxiedRouterGovernor(checker); } else if (module === Modules.WARP) { - // test config - const plumetestnet = { - ...routerConfig.plumetestnet, - type: TokenType.synthetic, - name: 'Wrapped Ether', - symbol: 'WETH', - decimals: 18, - totalSupply: '0', - gas: 0, - }; - const sepolia = { - ...routerConfig.sepolia, - type: TokenType.native, - gas: 0, - }; - const config = { - plumetestnet, - sepolia, - }; + const config = await getWarpConfig(multiProvider, envConfig); const addresses = getAddresses(environment, Modules.WARP); const filteredAddresses = Object.keys(addresses) // filter out changes not in config .filter((key) => key in config) diff --git a/typescript/infra/scripts/deploy.ts b/typescript/infra/scripts/deploy.ts index 6431b32d13..7d3d451972 100644 --- a/typescript/infra/scripts/deploy.ts +++ b/typescript/infra/scripts/deploy.ts @@ -21,7 +21,6 @@ import { InterchainQueryDeployer, LiquidityLayerDeployer, TestRecipientDeployer, - TokenType, hyperlaneEnvironments, } from '@hyperlane-xyz/sdk'; import { objMap } from '@hyperlane-xyz/utils'; @@ -29,8 +28,8 @@ import { objMap } from '@hyperlane-xyz/utils'; import { Contexts } from '../config/contexts.js'; import { core as coreConfig } from '../config/environments/mainnet3/core.js'; import { DEPLOYER } from '../config/environments/mainnet3/owners.js'; +import { getWarpConfig } from '../config/warp.js'; import { deployEnvToSdkEnv } from '../src/config/environment.js'; -import { tokens } from '../src/config/warp.js'; import { deployWithArtifacts } from '../src/deployment/deploy.js'; import { TestQuerySenderDeployer } from '../src/deployment/testcontracts/testquerysender.js'; import { @@ -120,48 +119,11 @@ async function main() { contractVerifier, ); } else if (module === Modules.WARP) { - const core = HyperlaneCore.fromEnvironment(env, multiProvider); const ismFactory = HyperlaneIsmFactory.fromAddressesMap( - getAddresses(environment, Modules.PROXY_FACTORY), + getAddresses(envConfig.environment, Modules.PROXY_FACTORY), multiProvider, ); - const routerConfig = core.getRouterConfig(envConfig.owners); - - const ethereum = { - ...routerConfig.ethereum, - type: TokenType.collateral, - token: tokens.ethereum.USDC, - // Really, this should be an object config from something like: - // buildAggregationIsmConfigs( - // 'ethereum', - // ['ancient8'], - // defaultMultisigConfigs, - // ).ancient8 - // However ISM objects are no longer able to be passed directly to the warp route - // deployer. As a temporary workaround, I'm using an ISM address from a previous - // ethereum <> ancient8 warp route deployment: - // $ cast call 0x9f5cF636b4F2DC6D83c9d21c8911876C235DbC9f 'interchainSecurityModule()(address)' --rpc-url https://rpc.ankr.com/eth - // 0xD17B4100cC66A2F1B9a452007ff26365aaeB7EC3 - interchainSecurityModule: '0xD17B4100cC66A2F1B9a452007ff26365aaeB7EC3', - // This hook was recovered from running the deploy script - // for the hook module. The hook configuration is the Ethereum - // default hook for the Ancient8 remote (no routing). - hook: '0x19b2cF952b70b217c90FC408714Fbc1acD29A6A8', - owner: DEPLOYER, - }; - - const ancient8 = { - ...routerConfig.ancient8, - type: TokenType.synthetic, - // Uses the default ISM - interchainSecurityModule: ethers.constants.AddressZero, - owner: DEPLOYER, - }; - - config = { - ethereum, - ancient8, - }; + config = await getWarpConfig(multiProvider, envConfig); deployer = new HypERC20Deployer( multiProvider, ismFactory, diff --git a/typescript/infra/scripts/middleware/circle-relayer.ts b/typescript/infra/scripts/middleware/circle-relayer.ts index 18bc68774b..b125a2eeb4 100644 --- a/typescript/infra/scripts/middleware/circle-relayer.ts +++ b/typescript/infra/scripts/middleware/circle-relayer.ts @@ -1,5 +1,4 @@ -import { dirname, join } from 'path'; -import { fileURLToPath } from 'url'; +import { join } from 'path'; import { LiquidityLayerApp, @@ -9,7 +8,7 @@ import { } from '@hyperlane-xyz/sdk'; import { objFilter, sleep } from '@hyperlane-xyz/utils'; -import { readJSON } from '../../src/utils/utils.js'; +import { getInfraPath, readJSON } from '../../src/utils/utils.js'; import { getArgs, getEnvironmentDirectory } from '../agent-utils.js'; import { getEnvironmentConfig } from '../core-utils.js'; @@ -23,8 +22,7 @@ async function check() { const multiProvider = await config.getMultiProvider(); const dir = join( - dirname(fileURLToPath(import.meta.url)), - '../../', + getInfraPath(), getEnvironmentDirectory(environment), 'middleware/liquidity-layer', ); diff --git a/typescript/infra/scripts/middleware/portal-relayer.ts b/typescript/infra/scripts/middleware/portal-relayer.ts index ed3a8e09bd..27e327fcec 100644 --- a/typescript/infra/scripts/middleware/portal-relayer.ts +++ b/typescript/infra/scripts/middleware/portal-relayer.ts @@ -1,5 +1,4 @@ -import { dirname, join } from 'path'; -import { fileURLToPath } from 'url'; +import { join } from 'path'; import { LiquidityLayerApp, @@ -9,7 +8,7 @@ import { import { rootLogger, sleep } from '@hyperlane-xyz/utils'; import { bridgeAdapterConfigs } from '../../config/environments/testnet4/token-bridge.js'; -import { readJSON } from '../../src/utils/utils.js'; +import { getInfraPath, readJSON } from '../../src/utils/utils.js'; import { getArgs, getEnvironmentDirectory } from '../agent-utils.js'; import { getEnvironmentConfig } from '../core-utils.js'; @@ -20,8 +19,7 @@ async function relayPortalTransfers() { const config = getEnvironmentConfig(environment); const multiProvider = await config.getMultiProvider(); const dir = join( - dirname(fileURLToPath(import.meta.url)), - '../../', + getInfraPath(), getEnvironmentDirectory(environment), 'middleware/liquidity-layer', ); diff --git a/typescript/infra/scripts/warp-routes/helm.ts b/typescript/infra/scripts/warp-routes/helm.ts index fa0cfb0c62..24905cbe7f 100644 --- a/typescript/infra/scripts/warp-routes/helm.ts +++ b/typescript/infra/scripts/warp-routes/helm.ts @@ -1,3 +1,5 @@ +import path from 'path'; + import { DeployEnvironment } from '../../src/config/environment.js'; import { HelmCommand, helmifyValues } from '../../src/utils/helm.js'; import { execCmd } from '../../src/utils/utils.js'; @@ -27,12 +29,16 @@ function getHelmReleaseName(route: string): string { } function getWarpRoutesHelmValues(configFilePath: string) { + // The path should be relative to the monorepo root + const pathRelativeToMonorepoRoot = configFilePath.includes('typescript/infra') + ? configFilePath + : path.join('typescript/infra', configFilePath); const values = { image: { repository: 'gcr.io/abacus-labs-dev/hyperlane-monorepo', - tag: '09344fc-20240321-203114', + tag: '135e6a8-20240415-135635', }, - configFilePath: configFilePath, + configFilePath: pathRelativeToMonorepoRoot, }; return helmifyValues(values); } diff --git a/typescript/infra/src/agents/index.ts b/typescript/infra/src/agents/index.ts index 186d35934a..6105536dc4 100644 --- a/typescript/infra/src/agents/index.ts +++ b/typescript/infra/src/agents/index.ts @@ -1,6 +1,5 @@ import fs from 'fs'; -import { dirname, join } from 'path'; -import { fileURLToPath } from 'url'; +import { join } from 'path'; import { ChainName, RpcConsensusType, chainMetadata } from '@hyperlane-xyz/sdk'; @@ -23,13 +22,17 @@ import { buildHelmChartDependencies, helmifyValues, } from '../utils/helm.js'; -import { execCmd, isEthereumProtocolChain } from '../utils/utils.js'; +import { + execCmd, + getInfraPath, + isEthereumProtocolChain, +} from '../utils/utils.js'; import { AgentGCPKey } from './gcp.js'; const HELM_CHART_PATH = join( - dirname(fileURLToPath(import.meta.url)), - '/../../../../rust/helm/hyperlane-agent/', + getInfraPath(), + '/../../rust/helm/hyperlane-agent/', ); if (!fs.existsSync(HELM_CHART_PATH + 'Chart.yaml')) diff --git a/typescript/infra/src/agents/key-utils.ts b/typescript/infra/src/agents/key-utils.ts index 256a24e6b9..e9d352e137 100644 --- a/typescript/infra/src/agents/key-utils.ts +++ b/typescript/infra/src/agents/key-utils.ts @@ -4,21 +4,20 @@ import { fileURLToPath } from 'url'; import { ChainMap, ChainName } from '@hyperlane-xyz/sdk'; import { Address, objMap, rootLogger } from '@hyperlane-xyz/utils'; -import localAWMultisigAddresses from '../../config/aw-multisig-hyperlane.json'; -// AW - Abacus Works import { Contexts } from '../../config/contexts.js'; import { helloworld } from '../../config/environments/helloworld.js'; import localKathyAddresses from '../../config/kathy.json'; import localRelayerAddresses from '../../config/relayer.json'; +import { getAWValidatorsPath } from '../../scripts/agent-utils.js'; import { getJustHelloWorldConfig } from '../../scripts/helloworld/utils.js'; import { AgentContextConfig, RootAgentConfig } from '../config/agent/agent'; import { DeployEnvironment } from '../config/environment'; import { Role } from '../roles.js'; import { execCmd, + getInfraPath, isEthereumProtocolChain, readJSON, - writeJSON, writeJsonAtPath, } from '../utils/utils.js'; @@ -34,8 +33,6 @@ export const relayerAddresses: LocalRoleAddresses = localRelayerAddresses as LocalRoleAddresses; export const kathyAddresses: LocalRoleAddresses = localKathyAddresses as LocalRoleAddresses; -export const awMultisigAddresses: ChainMap<{ validators: Address[] }> = - localAWMultisigAddresses as ChainMap<{ validators: Address[] }>; const debugLog = rootLogger.child({ module: 'infra:agents:key:utils' }).debug; @@ -44,10 +41,7 @@ export interface KeyAsAddress { address: string; } -const CONFIG_DIRECTORY_PATH = join( - dirname(fileURLToPath(import.meta.url)), - '../../config', -); +const CONFIG_DIRECTORY_PATH = join(getInfraPath(), 'config'); // ================== // Functions for getting keys @@ -435,10 +429,13 @@ async function persistAddressesLocally( relayerAddresses, ); - await persistValidatorAddressesToLocalArtifacts( - agentConfig.context, - multisigValidatorKeys, - ); + if (Object.keys(multisigValidatorKeys).length > 0) { + await persistValidatorAddressesToLocalArtifacts( + agentConfig.runEnv, + agentConfig.context, + multisigValidatorKeys, + ); + } } // non-validator roles @@ -452,29 +449,21 @@ export async function persistRoleAddressesToLocalArtifacts( addresses[environment][context] = updated; // Resolve the relative path - const filePath = join( - dirname(fileURLToPath(import.meta.url)), - `../../config/${role}.json`, - ); + const filePath = join(getInfraPath(), `config/${role}.json`); writeJsonAtPath(filePath, addresses); } // maintaining the multisigIsm schema sans threshold export async function persistValidatorAddressesToLocalArtifacts( + environment: DeployEnvironment, context: Contexts, fetchedValidatorAddresses: ChainMap<{ validators: Address[] }>, ) { - for (const chain of Object.keys(fetchedValidatorAddresses)) { - awMultisigAddresses[chain] = { - validators: fetchedValidatorAddresses[chain].validators, // fresh from aws - }; - } // Write the updated object back to the file - writeJSON( - CONFIG_DIRECTORY_PATH, - `aw-multisig-${context}.json`, - awMultisigAddresses, + writeJsonAtPath( + getAWValidatorsPath(environment, context), + fetchedValidatorAddresses, ); } diff --git a/typescript/infra/src/utils/utils.ts b/typescript/infra/src/utils/utils.ts index 8061ed75e6..ef908f9f2d 100644 --- a/typescript/infra/src/utils/utils.ts +++ b/typescript/infra/src/utils/utils.ts @@ -4,7 +4,8 @@ import { exec } from 'child_process'; import { ethers } from 'ethers'; import fs from 'fs'; import stringify from 'json-stable-stringify'; -import path from 'path'; +import path, { dirname, join } from 'path'; +import { fileURLToPath } from 'url'; import { parse as yamlParse } from 'yaml'; import { @@ -264,3 +265,7 @@ export function isEthereumProtocolChain(chainName: ChainName) { if (!chainMetadata[chainName]) throw new Error(`Unknown chain ${chainName}`); return chainMetadata[chainName].protocol === ProtocolType.Ethereum; } + +export function getInfraPath() { + return join(dirname(fileURLToPath(import.meta.url)), '../../'); +} diff --git a/typescript/sdk/src/consts/multisigIsm.ts b/typescript/sdk/src/consts/multisigIsm.ts index 1a63efe9e8..914e24ad9d 100644 --- a/typescript/sdk/src/consts/multisigIsm.ts +++ b/typescript/sdk/src/consts/multisigIsm.ts @@ -12,8 +12,12 @@ export const defaultMultisigConfigs: ChainMap = { }, ancient8: { - threshold: 1, - validators: ['0xbb5842ae0e05215b53df4787a29144efb7e67551'], + threshold: 2, + validators: [ + '0xbb5842ae0e05215b53df4787a29144efb7e67551', + '0xa5a56e97fb46f0ac3a3d261e404acb998d9a6969', // coin98 + '0x95c7bf235837cb5a609fe6c95870410b9f68bcff', // ancient8 + ], }, arbitrum: {