diff --git a/.github/workflows/rust-skipped.yml b/.github/workflows/rust-skipped.yml index 38177d41fb..bd2669ac17 100644 --- a/.github/workflows/rust-skipped.yml +++ b/.github/workflows/rust-skipped.yml @@ -3,7 +3,7 @@ name: rust on: pull_request: - branches: [main] + branches: [main, v3] paths-ignore: - 'rust/**' diff --git a/rust/config/testnet4_config.json b/rust/config/testnet4_config.json index 003213a879..d9cdb4d9f4 100644 --- a/rust/config/testnet4_config.json +++ b/rust/config/testnet4_config.json @@ -190,14 +190,14 @@ "aggregationHookFactory": "0xa1145B39F1c7Ef9aA593BC1DB1634b00CC020942", "routingIsmFactory": "0xea12ECFD1f241da323e93F12b4ed936403990190", "proxyAdmin": "0xb12282d2E838Aa5f2A4F9Ee5f624a77b7199A078", - "mailbox": "0x89280d0b68a246B276a910A518531E2a861CEb65", - "validatorAnnounce": "0x07b68177DE487200969261174b98FD067561Ab46", "defaultIsm": "0xEf7cacD303D1886b3dE396B45a184d16f39248E0", - "merkleTreeHook": "0xb6752a47541DAFaF17752FB2899BC1f138A03091", "storageGasOracle": "0x124EBCBC018A5D4Efe639f02ED86f95cdC3f6498", "interchainGasPaymaster": "0x0dD20e410bdB95404f71c5a4e7Fa67B892A5f949", "aggregationHook": "0x3d675bB93250Ab7603F40cbb9194bae210784627", "protocolFee": "0x3eF0a63B8976b838704Bcc93C78C56b6653E5a39", + "mailbox": "0xF9F6F5646F478d5ab4e20B0F910C92F1CCC9Cc6D", + "merkleTreeHook": "0xc6cbF39A747f5E28d1bDc8D9dfDAb2960Abd5A8f", + "validatorAnnounce": "0xf09701B0a93210113D175461b6135a96773B5465", "index": { "from": 33950052 } @@ -295,14 +295,14 @@ "aggregationHookFactory": "0x6bc243963f80AEa80948e8538bB114d4122DD9c5", "routingIsmFactory": "0xd16c3f34d6A2e62185aC61f76F83D3AA1E969018", "proxyAdmin": "0x0EdB3604D230963ecE9d83963164CFe2fDef576B", - "mailbox": "0xc4796aAbcE2A9D774Ce4603f5Db5fB1605791dbd", - "validatorAnnounce": "0x0bbE9b20372B29e65B3feF370b22369561893231", "defaultIsm": "0x8BbdB0023ef47992b3E83E2B1B290D72A7477EfE", - "merkleTreeHook": "0xeE2842C22F15e69cD443378aa8fbD1fE16E59Ed3", "storageGasOracle": "0xeC34c715ee6d050b2172E8aF650Db779561266C1", "interchainGasPaymaster": "0x0cD26594ea6c6526927C0F5225AC09F6288e7140", "aggregationHook": "0x2dF77b3efe9B8f9aEDf7bFC86f40B048178d8116", "protocolFee": "0x9293B8dAcA7933765de499C992B0Fa86Bb104b0f", + "merkleTreeHook": "0x28c294C61D3dE053462d2Cfa5d5f8c8D70605A59", + "mailbox": "0x49cfd6Ef774AcAb14814D699e3F7eE36Fdfba932", + "validatorAnnounce": "0x3c182AD9cA8A71bc107Ef440C2667E8360e1158E", "index": { "from": 9816044 } @@ -599,14 +599,14 @@ "aggregationHookFactory": "0x160C28C92cA453570aD7C031972b58d5Dd128F72", "routingIsmFactory": "0x3603458990BfEb30f99E61B58427d196814D8ce1", "proxyAdmin": "0x97Bbc6bBaFa5Ce3b2FA966c121Af63bD09e940f8", - "mailbox": "0x33AbaF6708be03Bdf0595DA0745A7111b01dB8c7", - "validatorAnnounce": "0x71B1BF7C99BEef0545eAFf441372cb6413d9367c", "defaultIsm": "0x97FE534674A0fA312b730C946A8A8AC9DcF90100", - "merkleTreeHook": "0xa5075B2AcA697944273d67B57a3340a0730632A3", "storageGasOracle": "0x71775B071F77F1ce52Ece810ce084451a3045FFe", "interchainGasPaymaster": "0x6f2756380FD49228ae25Aa7F2817993cB74Ecc56", "aggregationHook": "0xe3147d5618f5e2e100690B50ec923009a4cde14A", "protocolFee": "0x13AC3349Cb159fE86A22cf42DdA803D9f7309DB5", + "mailbox": "0xfFAEF09B3cd11D9b20d1a19bECca54EEC2884766", + "merkleTreeHook": "0x4917a9746A7B6E0A57159cCb7F5a6744247f2d0d", + "validatorAnnounce": "0xE6105C59480a1B7DD3E4f28153aFdbE12F4CfCD9", "index": { "from": 4432735 } diff --git a/typescript/helloworld/src/test/deploy.test.ts b/typescript/helloworld/src/test/deploy.test.ts index 7a75c4ba54..95c416c726 100644 --- a/typescript/helloworld/src/test/deploy.test.ts +++ b/typescript/helloworld/src/test/deploy.test.ts @@ -4,6 +4,8 @@ import { ethers } from 'hardhat'; import { ChainMap, HyperlaneContractsMap, + HyperlaneIsmFactory, + HyperlaneProxyFactoryDeployer, MultiProvider, TestCoreApp, TestCoreDeployer, @@ -26,8 +28,12 @@ describe('deploy', async () => { before(async () => { const [signer] = await ethers.getSigners(); multiProvider = MultiProvider.createTestMultiProvider({ signer }); - - const coreDeployer = new TestCoreDeployer(multiProvider); + const ismFactoryDeployer = new HyperlaneProxyFactoryDeployer(multiProvider); + const ismFactory = new HyperlaneIsmFactory( + await ismFactoryDeployer.deploy(multiProvider.mapKnownChains(() => ({}))), + multiProvider, + ); + const coreDeployer = new TestCoreDeployer(multiProvider, ismFactory); core = await coreDeployer.deployApp(); config = core.getRouterConfig(signer.address); deployer = new HelloWorldDeployer(multiProvider); diff --git a/typescript/helloworld/src/test/helloworld.test.ts b/typescript/helloworld/src/test/helloworld.test.ts index 07e8e6d804..5fdf43c6e6 100644 --- a/typescript/helloworld/src/test/helloworld.test.ts +++ b/typescript/helloworld/src/test/helloworld.test.ts @@ -5,6 +5,8 @@ import { ethers } from 'hardhat'; import { ChainMap, Chains, + HyperlaneIsmFactory, + HyperlaneProxyFactoryDeployer, MultiProvider, TestCoreApp, TestCoreDeployer, @@ -30,7 +32,12 @@ describe('HelloWorld', async () => { before(async () => { [signer] = await ethers.getSigners(); multiProvider = MultiProvider.createTestMultiProvider({ signer }); - coreApp = await new TestCoreDeployer(multiProvider).deployApp(); + const ismFactoryDeployer = new HyperlaneProxyFactoryDeployer(multiProvider); + const ismFactory = new HyperlaneIsmFactory( + await ismFactoryDeployer.deploy(multiProvider.mapKnownChains(() => ({}))), + multiProvider, + ); + coreApp = await new TestCoreDeployer(multiProvider, ismFactory).deployApp(); config = coreApp.getRouterConfig(signer.address); localDomain = multiProvider.getDomainId(localChain); diff --git a/typescript/infra/config/environments/testnet4/agent.ts b/typescript/infra/config/environments/testnet4/agent.ts index bea891f922..5b89cff47d 100644 --- a/typescript/infra/config/environments/testnet4/agent.ts +++ b/typescript/infra/config/environments/testnet4/agent.ts @@ -49,7 +49,7 @@ const hyperlane: RootAgentConfig = { rpcConsensusType: RpcConsensusType.Fallback, docker: { repo, - tag: 'cfaf553-20231009-174623', + tag: '65ac90a-20231020-192310', }, blacklist: [ ...releaseCandidateHelloworldMatchingList, @@ -66,7 +66,7 @@ const hyperlane: RootAgentConfig = { rpcConsensusType: RpcConsensusType.Fallback, docker: { repo, - tag: 'cfaf553-20231009-174623', + tag: '65ac90a-20231020-192310', }, chains: validatorChainConfig(Contexts.Hyperlane), }, @@ -74,7 +74,7 @@ const hyperlane: RootAgentConfig = { rpcConsensusType: RpcConsensusType.Fallback, docker: { repo, - tag: 'cfaf553-20231009-174623', + tag: '65ac90a-20231020-192310', }, }, }; diff --git a/typescript/sdk/src/core/TestCoreDeployer.ts b/typescript/sdk/src/core/TestCoreDeployer.ts index 33b91c09c2..abb61a7abc 100644 --- a/typescript/sdk/src/core/TestCoreDeployer.ts +++ b/typescript/sdk/src/core/TestCoreDeployer.ts @@ -1,45 +1,13 @@ -import { - TestInterchainGasPaymaster__factory, - TestMailbox__factory, - TestMultisigIsm__factory, -} from '@hyperlane-xyz/core'; - import { TestChains } from '../consts/chains'; import { HyperlaneContracts } from '../contracts/types'; -import { HyperlaneIsmFactory } from '../ism/HyperlaneIsmFactory'; -import { MultiProvider } from '../providers/MultiProvider'; import { testCoreConfig } from '../test/testUtils'; -import { ChainMap, ChainName } from '../types'; +import { ChainMap } from '../types'; import { HyperlaneCoreDeployer } from './HyperlaneCoreDeployer'; import { TestCoreApp } from './TestCoreApp'; -import { CoreFactories, coreFactories } from './contracts'; - -const testCoreFactories = { - ...coreFactories, - mailbox: new TestMailbox__factory(), - interchainGasPaymaster: new TestInterchainGasPaymaster__factory(), - testIsm: new TestMultisigIsm__factory(), -}; +import { CoreFactories } from './contracts'; export class TestCoreDeployer extends HyperlaneCoreDeployer { - constructor(public readonly multiProvider: MultiProvider) { - const ismFactory = new HyperlaneIsmFactory({}, multiProvider); - super(multiProvider, ismFactory); - } - - // deploy a test ISM instead of a real ISM - async deployIsm(chain: ChainName): Promise { - const testIsm = await this.deployContractFromFactory( - chain, - testCoreFactories.testIsm, - 'testIsm', - [], - ); - await testIsm.setAccept(true); - return testIsm.address; - } - async deploy(): Promise>> { return super.deploy(testCoreConfig(TestChains)); } diff --git a/typescript/sdk/src/core/testHyperlaneDeploy.hardhat-test.ts b/typescript/sdk/src/core/testHyperlaneDeploy.hardhat-test.ts index a6f900f30f..358764d6c2 100644 --- a/typescript/sdk/src/core/testHyperlaneDeploy.hardhat-test.ts +++ b/typescript/sdk/src/core/testHyperlaneDeploy.hardhat-test.ts @@ -8,6 +8,8 @@ import { TestMailbox, TestRecipient__factory } from '@hyperlane-xyz/core'; import { addressToBytes32 } from '@hyperlane-xyz/utils'; import { Chains } from '../consts/chains'; +import { HyperlaneProxyFactoryDeployer } from '../deploy/HyperlaneProxyFactoryDeployer'; +import { HyperlaneIsmFactory } from '../ism/HyperlaneIsmFactory'; import { MultiProvider } from '../providers/MultiProvider'; import { TestCoreApp } from './TestCoreApp'; @@ -27,7 +29,13 @@ describe('TestCoreDeployer', async () => { const [signer] = await ethers.getSigners(); const multiProvider = MultiProvider.createTestMultiProvider({ signer }); - const deployer = new TestCoreDeployer(multiProvider); + + const ismFactoryDeployer = new HyperlaneProxyFactoryDeployer(multiProvider); + const ismFactory = new HyperlaneIsmFactory( + await ismFactoryDeployer.deploy(multiProvider.mapKnownChains(() => ({}))), + multiProvider, + ); + const deployer = new TestCoreDeployer(multiProvider, ismFactory); testCoreApp = await deployer.deployApp(); const recipient = await new TestRecipient__factory(signer).deploy(); diff --git a/typescript/sdk/src/ism/HyperlaneIsmFactory.ts b/typescript/sdk/src/ism/HyperlaneIsmFactory.ts index 8523451599..f4117735fa 100644 --- a/typescript/sdk/src/ism/HyperlaneIsmFactory.ts +++ b/typescript/sdk/src/ism/HyperlaneIsmFactory.ts @@ -10,6 +10,7 @@ import { StaticAddressSetFactory, StaticAggregationIsm__factory, StaticThresholdAddressSetFactory, + TestMultisigIsm__factory, } from '@hyperlane-xyz/core'; import { Address, eqAddress, formatMessage, warn } from '@hyperlane-xyz/utils'; @@ -107,6 +108,8 @@ export class HyperlaneIsmFactory extends HyperlaneApp { } else if (config.type === ModuleType.AGGREGATION) { this.logger(`Deploying Aggregation ISM to ${chain}`); contract = await this.deployAggregationIsm(chain, config, origin); + } else if (config.type === ModuleType.TEST_ISM) { + contract = await this.deployTestIsm(chain); } else { throw new Error(`Unsupported ISM type`); } @@ -214,6 +217,13 @@ export class HyperlaneIsmFactory extends HyperlaneApp { return IAggregationIsm__factory.connect(address, signer); } + private async deployTestIsm(chain: ChainName) { + const signer = this.multiProvider.getSigner(chain); + const factory = new TestMultisigIsm__factory(signer); + const contract = await factory.deploy(); + return contract; + } + async deployStaticAddressSet( chain: ChainName, factory: StaticThresholdAddressSetFactory | StaticAddressSetFactory, @@ -355,6 +365,9 @@ export async function moduleCanCertainlyVerify( } return verified >= destModule.threshold; } + case ModuleType.TEST_ISM: { + return true; + } } } } @@ -513,6 +526,9 @@ export function collectValidators( aggregatedValidators.forEach((set) => { validators = validators.concat([...set]); }); + } else if (config.type === ModuleType.TEST_ISM) { + // This is just a TestISM + return new Set([]); } else { throw new Error('Unsupported ModuleType'); } diff --git a/typescript/sdk/src/ism/types.ts b/typescript/sdk/src/ism/types.ts index 23c6bdaca8..9e9c64758e 100644 --- a/typescript/sdk/src/ism/types.ts +++ b/typescript/sdk/src/ism/types.ts @@ -5,6 +5,7 @@ import { IRoutingIsm, StaticMerkleRootMultisigIsm, StaticMessageIdMultisigIsm, + TestMultisigIsm, } from '@hyperlane-xyz/core'; import type { Address } from '@hyperlane-xyz/utils'; @@ -16,7 +17,8 @@ export type DeployedIsm = | IAggregationIsm | IRoutingIsm | StaticMessageIdMultisigIsm - | StaticMerkleRootMultisigIsm; + | StaticMerkleRootMultisigIsm + | TestMultisigIsm; export enum ModuleType { UNUSED, @@ -25,6 +27,7 @@ export enum ModuleType { LEGACY_MULTISIG, // DEPRECATED MERKLE_ROOT_MULTISIG, MESSAGE_ID_MULTISIG, + TEST_ISM, } export type MultisigConfig = { @@ -36,6 +39,10 @@ export type MultisigIsmConfig = MultisigConfig & { type: ModuleType.MERKLE_ROOT_MULTISIG | ModuleType.MESSAGE_ID_MULTISIG; }; +export type TestMultisigIsmConfig = MultisigConfig & { + type: ModuleType.TEST_ISM; +}; + export type RoutingIsmConfig = { type: ModuleType.ROUTING; owner: Address; @@ -52,4 +59,5 @@ export type IsmConfig = | Address | RoutingIsmConfig | MultisigIsmConfig - | AggregationIsmConfig; + | AggregationIsmConfig + | TestMultisigIsmConfig; diff --git a/typescript/sdk/src/middleware/account/accounts.hardhat-test.ts b/typescript/sdk/src/middleware/account/accounts.hardhat-test.ts index 1984dc7bd8..f837eb3554 100644 --- a/typescript/sdk/src/middleware/account/accounts.hardhat-test.ts +++ b/typescript/sdk/src/middleware/account/accounts.hardhat-test.ts @@ -11,6 +11,8 @@ import { Chains } from '../../consts/chains'; import { HyperlaneContractsMap } from '../../contracts/types'; import { TestCoreApp } from '../../core/TestCoreApp'; import { TestCoreDeployer } from '../../core/TestCoreDeployer'; +import { HyperlaneProxyFactoryDeployer } from '../../deploy/HyperlaneProxyFactoryDeployer'; +import { HyperlaneIsmFactory } from '../../ism/HyperlaneIsmFactory'; import { MultiProvider } from '../../providers/MultiProvider'; import { RouterConfig } from '../../router/types'; import { ChainMap } from '../../types'; @@ -35,7 +37,12 @@ describe.skip('InterchainAccounts', async () => { before(async () => { [signer] = await ethers.getSigners(); multiProvider = MultiProvider.createTestMultiProvider({ signer }); - coreApp = await new TestCoreDeployer(multiProvider).deployApp(); + const ismFactoryDeployer = new HyperlaneProxyFactoryDeployer(multiProvider); + const ismFactory = new HyperlaneIsmFactory( + await ismFactoryDeployer.deploy(multiProvider.mapKnownChains(() => ({}))), + multiProvider, + ); + coreApp = await new TestCoreDeployer(multiProvider, ismFactory).deployApp(); config = coreApp.getRouterConfig(signer.address); }); diff --git a/typescript/sdk/src/middleware/liquidity-layer/liquidity-layer.hardhat-test.ts b/typescript/sdk/src/middleware/liquidity-layer/liquidity-layer.hardhat-test.ts index 14530723e3..e60c1d48f1 100644 --- a/typescript/sdk/src/middleware/liquidity-layer/liquidity-layer.hardhat-test.ts +++ b/typescript/sdk/src/middleware/liquidity-layer/liquidity-layer.hardhat-test.ts @@ -20,6 +20,8 @@ import { chainMetadata } from '../../consts/chainMetadata'; import { Chains } from '../../consts/chains'; import { TestCoreApp } from '../../core/TestCoreApp'; import { TestCoreDeployer } from '../../core/TestCoreDeployer'; +import { HyperlaneProxyFactoryDeployer } from '../../deploy/HyperlaneProxyFactoryDeployer'; +import { HyperlaneIsmFactory } from '../../ism/HyperlaneIsmFactory'; import { MultiProvider } from '../../providers/MultiProvider'; import { ChainMap } from '../../types'; @@ -53,7 +55,12 @@ describe.skip('LiquidityLayerRouter', async () => { before(async () => { [signer] = await ethers.getSigners(); multiProvider = MultiProvider.createTestMultiProvider({ signer }); - coreApp = await new TestCoreDeployer(multiProvider).deployApp(); + const ismFactoryDeployer = new HyperlaneProxyFactoryDeployer(multiProvider); + const ismFactory = new HyperlaneIsmFactory( + await ismFactoryDeployer.deploy(multiProvider.mapKnownChains(() => ({}))), + multiProvider, + ); + coreApp = await new TestCoreDeployer(multiProvider, ismFactory).deployApp(); const routerConfig = coreApp.getRouterConfig(signer.address); const mockTokenF = new MockToken__factory(signer); diff --git a/typescript/sdk/src/middleware/query/queries.hardhat-test.ts b/typescript/sdk/src/middleware/query/queries.hardhat-test.ts index 6a64b004f8..c2b1d99f50 100644 --- a/typescript/sdk/src/middleware/query/queries.hardhat-test.ts +++ b/typescript/sdk/src/middleware/query/queries.hardhat-test.ts @@ -14,6 +14,8 @@ import { Chains } from '../../consts/chains'; import { HyperlaneContractsMap } from '../../contracts/types'; import { TestCoreApp } from '../../core/TestCoreApp'; import { TestCoreDeployer } from '../../core/TestCoreDeployer'; +import { HyperlaneProxyFactoryDeployer } from '../../deploy/HyperlaneProxyFactoryDeployer'; +import { HyperlaneIsmFactory } from '../../ism/HyperlaneIsmFactory'; import { MultiProvider } from '../../providers/MultiProvider'; import { RouterConfig } from '../../router/types'; import { ChainMap } from '../../types'; @@ -41,7 +43,12 @@ describe.skip('InterchainQueryRouter', async () => { before(async () => { [signer] = await ethers.getSigners(); multiProvider = MultiProvider.createTestMultiProvider({ signer }); - coreApp = await new TestCoreDeployer(multiProvider).deployApp(); + const ismFactoryDeployer = new HyperlaneProxyFactoryDeployer(multiProvider); + const ismFactory = new HyperlaneIsmFactory( + await ismFactoryDeployer.deploy(multiProvider.mapKnownChains(() => ({}))), + multiProvider, + ); + coreApp = await new TestCoreDeployer(multiProvider, ismFactory).deployApp(); config = coreApp.getRouterConfig(signer.address); }); diff --git a/typescript/sdk/src/test/testUtils.ts b/typescript/sdk/src/test/testUtils.ts index 1f78cc7d37..f75b64d89d 100644 --- a/typescript/sdk/src/test/testUtils.ts +++ b/typescript/sdk/src/test/testUtils.ts @@ -14,7 +14,7 @@ import { CoinGeckoSimplePriceParams, } from '../gas/token-prices'; import { HookType } from '../hook/types'; -import { ModuleType, MultisigIsmConfig } from '../ism/types'; +import { ModuleType, TestMultisigIsmConfig } from '../ism/types'; import { RouterConfig } from '../router/types'; import { ChainMap, ChainName } from '../types'; @@ -45,8 +45,8 @@ const nonZeroAddress = ethers.constants.AddressZero.replace('00', '01'); // dummy config as TestInbox and TestOutbox do not use deployed ISM export function testCoreConfig(chains: ChainName[]): ChainMap { - const multisigIsm: MultisigIsmConfig = { - type: ModuleType.MERKLE_ROOT_MULTISIG, + const multisigIsm: TestMultisigIsmConfig = { + type: ModuleType.TEST_ISM, validators: [nonZeroAddress], threshold: 1, };