Fix env tests for new multisig variants (#2283)

Fixes env tests failing in CI
https://github.com/hyperlane-xyz/hyperlane-monorepo/actions/runs/5081007361/jobs/9128835519.
Adds logging to ism factory deployer and ism deployments.
pull/2304/head agents-2023-05-25
Yorke Rhodes 2 years ago committed by GitHub
parent 50f04db1fa
commit 8d9ee49f67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      typescript/infra/fork.sh
  2. 3
      typescript/sdk/src/HyperlaneApp.ts
  3. 9
      typescript/sdk/src/consts/environments/mainnet.json
  4. 9
      typescript/sdk/src/consts/environments/testnet.json
  5. 16
      typescript/sdk/src/core/HyperlaneCoreDeployer.ts
  6. 29
      typescript/sdk/src/ism/HyperlaneIsmFactory.ts

@ -17,7 +17,7 @@ else
exit 1 exit 1
fi fi
anvil --fork-url $RPC_URL --block-time 3 --silent > /dev/null & anvil --fork-url $RPC_URL --block-time 1 --silent > /dev/null &
ANVIL_PID=$! ANVIL_PID=$!
while ! cast bn &> /dev/null; do while ! cast bn &> /dev/null; do

@ -1,3 +1,5 @@
import debug from 'debug';
import { import {
HyperlaneAddresses, HyperlaneAddresses,
HyperlaneContracts, HyperlaneContracts,
@ -17,6 +19,7 @@ export class HyperlaneApp<
constructor( constructor(
public readonly contractsMap: HyperlaneContractsMap<Factories>, public readonly contractsMap: HyperlaneContractsMap<Factories>,
public readonly multiProvider: MultiProvider, public readonly multiProvider: MultiProvider,
public readonly logger = debug('hyperlane:App'),
) { ) {
const connectedContractsMap = objMap(contractsMap, (chain, contracts) => const connectedContractsMap = objMap(contractsMap, (chain, contracts) =>
connectContracts(contracts, multiProvider.getSignerOrProvider(chain)), connectContracts(contracts, multiProvider.getSignerOrProvider(chain)),

@ -11,7 +11,6 @@
"interchainQueryRouter": "0x234b19282985882d6d6fd54dEBa272271f4eb784", "interchainQueryRouter": "0x234b19282985882d6d6fd54dEBa272271f4eb784",
"interchainAccountRouter": "0xB193eBf06faD5D66492BB41DBbCd202640aE83fF", "interchainAccountRouter": "0xB193eBf06faD5D66492BB41DBbCd202640aE83fF",
"interchainAccountIsm": "0x5e8ee6840caa4f367aff1FF28aA36D5B1b836d35", "interchainAccountIsm": "0x5e8ee6840caa4f367aff1FF28aA36D5B1b836d35",
"multisigIsmFactory": "0x9bf473968629b8f8cF4ab59Aeb9640b0c93411dd",
"aggregationIsmFactory": "0xc864fa3B662613cA5051f41e157d0a997f9a5A87", "aggregationIsmFactory": "0xc864fa3B662613cA5051f41e157d0a997f9a5A87",
"routingIsmFactory": "0x1fdfD1486b8339638C6b92f8a96D698D8182D2b1" "routingIsmFactory": "0x1fdfD1486b8339638C6b92f8a96D698D8182D2b1"
}, },
@ -27,7 +26,6 @@
"interchainQueryRouter": "0x234b19282985882d6d6fd54dEBa272271f4eb784", "interchainQueryRouter": "0x234b19282985882d6d6fd54dEBa272271f4eb784",
"interchainAccountRouter": "0x5fD075C2157567F7F80e6cB20dDd75F40905bd87", "interchainAccountRouter": "0x5fD075C2157567F7F80e6cB20dDd75F40905bd87",
"interchainAccountIsm": "0x943303Ad7D2B87BB363E0BACC901486337d9B316", "interchainAccountIsm": "0x943303Ad7D2B87BB363E0BACC901486337d9B316",
"multisigIsmFactory": "0xfD548D8a8EB8366D802F24e1bC6D1d21dB057EF1",
"aggregationIsmFactory": "0x30B3Ef3e98B1FF72f03f71f68115E18F203Ec794", "aggregationIsmFactory": "0x30B3Ef3e98B1FF72f03f71f68115E18F203Ec794",
"routingIsmFactory": "0xBF30B4F328d1F6AC47ecCcF23836F3CbB2422c9f" "routingIsmFactory": "0xBF30B4F328d1F6AC47ecCcF23836F3CbB2422c9f"
}, },
@ -43,7 +41,6 @@
"interchainQueryRouter": "0x234b19282985882d6d6fd54dEBa272271f4eb784", "interchainQueryRouter": "0x234b19282985882d6d6fd54dEBa272271f4eb784",
"interchainAccountRouter": "0x77c509140A45B4B85E1A28f8c21AaEB3Ca8788B3", "interchainAccountRouter": "0x77c509140A45B4B85E1A28f8c21AaEB3Ca8788B3",
"interchainAccountIsm": "0x88C01B64dCe0032796a1967E2b3447B397c6c7AC", "interchainAccountIsm": "0x88C01B64dCe0032796a1967E2b3447B397c6c7AC",
"multisigIsmFactory": "0x270d0334bC98a02f7A4e2328B319EDEDcd7a2000",
"aggregationIsmFactory": "0x070d4f61b05eD9e20C9194f29Df073f2110705fc", "aggregationIsmFactory": "0x070d4f61b05eD9e20C9194f29Df073f2110705fc",
"routingIsmFactory": "0x0FC1A9DFAca9b6Ba11bC470Bf284Da7c107fDfF2" "routingIsmFactory": "0x0FC1A9DFAca9b6Ba11bC470Bf284Da7c107fDfF2"
}, },
@ -59,7 +56,6 @@
"interchainQueryRouter": "0x234b19282985882d6d6fd54dEBa272271f4eb784", "interchainQueryRouter": "0x234b19282985882d6d6fd54dEBa272271f4eb784",
"interchainAccountRouter": "0x4a4D878c41C7F71eCff182F526b7691aDC6e4150", "interchainAccountRouter": "0x4a4D878c41C7F71eCff182F526b7691aDC6e4150",
"interchainAccountIsm": "0xCd8ACf2254641bD3Eaa32C1B8D36f0983de8C0E6", "interchainAccountIsm": "0xCd8ACf2254641bD3Eaa32C1B8D36f0983de8C0E6",
"multisigIsmFactory": "0xfF4872B62225c1f029a894D4682b250dD5577AC7",
"aggregationIsmFactory": "0x10Add66Db9C837000A43F3601aa9c54c6744F4c8", "aggregationIsmFactory": "0x10Add66Db9C837000A43F3601aa9c54c6744F4c8",
"routingIsmFactory": "0x0B48a744698ba8dFa514742dFEB6728f52fD66f7" "routingIsmFactory": "0x0B48a744698ba8dFa514742dFEB6728f52fD66f7"
}, },
@ -75,7 +71,6 @@
"interchainQueryRouter": "0x234b19282985882d6d6fd54dEBa272271f4eb784", "interchainQueryRouter": "0x234b19282985882d6d6fd54dEBa272271f4eb784",
"interchainAccountRouter": "0xF9A4e3BA5e532906c241310f6832d2Ee8D1c5609", "interchainAccountRouter": "0xF9A4e3BA5e532906c241310f6832d2Ee8D1c5609",
"interchainAccountIsm": "0x1d3Bdf44887744007C7C62c85924c445C9e825DE", "interchainAccountIsm": "0x1d3Bdf44887744007C7C62c85924c445C9e825DE",
"multisigIsmFactory": "0x4F5db88EEdEBd6a8303ed13491169d4229D9A735",
"aggregationIsmFactory": "0x4084054Fc83af652A1f21EA2FF2a668D796e2514", "aggregationIsmFactory": "0x4084054Fc83af652A1f21EA2FF2a668D796e2514",
"routingIsmFactory": "0x85392758524EEE2323Bd3029E77aFc9bA9E60216" "routingIsmFactory": "0x85392758524EEE2323Bd3029E77aFc9bA9E60216"
}, },
@ -91,7 +86,6 @@
"interchainQueryRouter": "0x234b19282985882d6d6fd54dEBa272271f4eb784", "interchainQueryRouter": "0x234b19282985882d6d6fd54dEBa272271f4eb784",
"interchainAccountRouter": "0xAC2BE81884C66E6c05B80C05C907B54C74eA2C49", "interchainAccountRouter": "0xAC2BE81884C66E6c05B80C05C907B54C74eA2C49",
"interchainAccountIsm": "0xC1d10a99C382Dd224d7F513C7e0f74D7689071f4", "interchainAccountIsm": "0xC1d10a99C382Dd224d7F513C7e0f74D7689071f4",
"multisigIsmFactory": "0x2A87BF6aE678569545B258fA11087C6F57dd9012",
"aggregationIsmFactory": "0x9E3075E067932d744119e583B34d11b144CE1e4A", "aggregationIsmFactory": "0x9E3075E067932d744119e583B34d11b144CE1e4A",
"routingIsmFactory": "0xcC2fA09fa13857942fae408EcCEc8De307344e99" "routingIsmFactory": "0xcC2fA09fa13857942fae408EcCEc8De307344e99"
}, },
@ -107,7 +101,6 @@
"interchainQueryRouter": "0x234b19282985882d6d6fd54dEBa272271f4eb784", "interchainQueryRouter": "0x234b19282985882d6d6fd54dEBa272271f4eb784",
"interchainAccountRouter": "0x652e2F475Af7b1154817E09f5408f9011037492a", "interchainAccountRouter": "0x652e2F475Af7b1154817E09f5408f9011037492a",
"interchainAccountIsm": "0x3de63b62BeF9Da290F51f856cA9F3dB4225EDc05", "interchainAccountIsm": "0x3de63b62BeF9Da290F51f856cA9F3dB4225EDc05",
"multisigIsmFactory": "0x21581dE0CB0Ce91E87b9d5124543C75Fa01ED9CC",
"aggregationIsmFactory": "0xb7d42f065E32eB6fCAac7ef83902c56164328fE2", "aggregationIsmFactory": "0xb7d42f065E32eB6fCAac7ef83902c56164328fE2",
"routingIsmFactory": "0x4ef980034E631CC0CFb3b065aB793611f1B6511A" "routingIsmFactory": "0x4ef980034E631CC0CFb3b065aB793611f1B6511A"
}, },
@ -123,7 +116,6 @@
"interchainQueryRouter": "0x234b19282985882d6d6fd54dEBa272271f4eb784", "interchainQueryRouter": "0x234b19282985882d6d6fd54dEBa272271f4eb784",
"interchainAccountRouter": "0x5b6311e0417CfD3Fb10318108897E63777CFE8D7", "interchainAccountRouter": "0x5b6311e0417CfD3Fb10318108897E63777CFE8D7",
"interchainAccountIsm": "0x88d346eEc75b6D22428bbaB569b6eBB0bE183c4F", "interchainAccountIsm": "0x88d346eEc75b6D22428bbaB569b6eBB0bE183c4F",
"multisigIsmFactory": "0xe3DB9EdafBA60629308166B21DE2B4970bF94969",
"aggregationIsmFactory": "0x20E1897CD584C3788A3C24f5e424345a55ADf90C", "aggregationIsmFactory": "0x20E1897CD584C3788A3C24f5e424345a55ADf90C",
"routingIsmFactory": "0xB5ec4e94ec47A70C6A38370666F713423816ce4c" "routingIsmFactory": "0xB5ec4e94ec47A70C6A38370666F713423816ce4c"
}, },
@ -140,7 +132,6 @@
"interchainQueryRouter": "0x234b19282985882d6d6fd54dEBa272271f4eb784", "interchainQueryRouter": "0x234b19282985882d6d6fd54dEBa272271f4eb784",
"interchainAccountRouter": "0x32e77b20bf0cf034eB80ea9DD02De881016B01B3", "interchainAccountRouter": "0x32e77b20bf0cf034eB80ea9DD02De881016B01B3",
"interchainAccountIsm": "0x8AB7A6FaC052518A39628497735C855a2Beb515B", "interchainAccountIsm": "0x8AB7A6FaC052518A39628497735C855a2Beb515B",
"multisigIsmFactory": "0xb58257cc81E47EC72fD38aE16297048de23163b4",
"aggregationIsmFactory": "0xb4fc9B5fD57499Ef6FfF3995728a55F7A618ef86", "aggregationIsmFactory": "0xb4fc9B5fD57499Ef6FfF3995728a55F7A618ef86",
"routingIsmFactory": "0xbB22547D1dc681fe925f568f637Ff67aC06c20fc" "routingIsmFactory": "0xbB22547D1dc681fe925f568f637Ff67aC06c20fc"
} }

@ -11,7 +11,6 @@
"interchainQueryRouter": "0xF782C6C4A02f2c71BB8a1Db0166FAB40ea956818", "interchainQueryRouter": "0xF782C6C4A02f2c71BB8a1Db0166FAB40ea956818",
"interchainAccountRouter": "0xDb91D575F17d8AAf1aFEC0eaDBD5Ac9e5Cef4ad0", "interchainAccountRouter": "0xDb91D575F17d8AAf1aFEC0eaDBD5Ac9e5Cef4ad0",
"interchainAccountIsm": "0x0aA320a1bD450152B4C500613335CeBA4f6073cF", "interchainAccountIsm": "0x0aA320a1bD450152B4C500613335CeBA4f6073cF",
"multisigIsmFactory": "0x9AF85731EDd41E2E50F81Ef8a0A69D2fB836EDf9",
"aggregationIsmFactory": "0xBEd8Fd6d5c6cBd878479C25f4725C7c842a43821", "aggregationIsmFactory": "0xBEd8Fd6d5c6cBd878479C25f4725C7c842a43821",
"routingIsmFactory": "0x98F44EA5b9cA6aa02a5B75f31E0621083d9096a2" "routingIsmFactory": "0x98F44EA5b9cA6aa02a5B75f31E0621083d9096a2"
}, },
@ -27,7 +26,6 @@
"interchainQueryRouter": "0xF782C6C4A02f2c71BB8a1Db0166FAB40ea956818", "interchainQueryRouter": "0xF782C6C4A02f2c71BB8a1Db0166FAB40ea956818",
"interchainAccountRouter": "0xf82b58Bf348a6CEA6e19413e9DE040dB1a363128", "interchainAccountRouter": "0xf82b58Bf348a6CEA6e19413e9DE040dB1a363128",
"interchainAccountIsm": "0x333C9A8c70Ea4F0498Fb58bEe40DEa40e63a9962", "interchainAccountIsm": "0x333C9A8c70Ea4F0498Fb58bEe40DEa40e63a9962",
"multisigIsmFactory": "0x094652a8ea2153A03916771a778E7b66839A4F58",
"aggregationIsmFactory": "0x9fB5D10C07569F2EBdc8ec4432B3a52b6d0ad9A0", "aggregationIsmFactory": "0x9fB5D10C07569F2EBdc8ec4432B3a52b6d0ad9A0",
"routingIsmFactory": "0xB24C91238eA30D59CF58CEB8dd5e4eaf70544d47" "routingIsmFactory": "0xB24C91238eA30D59CF58CEB8dd5e4eaf70544d47"
}, },
@ -43,7 +41,6 @@
"interchainQueryRouter": "0xF782C6C4A02f2c71BB8a1Db0166FAB40ea956818", "interchainQueryRouter": "0xF782C6C4A02f2c71BB8a1Db0166FAB40ea956818",
"interchainAccountRouter": "0x6a9CeD0e13E738517558aA283DA0E93e5904D49b", "interchainAccountRouter": "0x6a9CeD0e13E738517558aA283DA0E93e5904D49b",
"interchainAccountIsm": "0x40c2d6cA6F5A8857705C128b2c1A5f0Ae20880dc", "interchainAccountIsm": "0x40c2d6cA6F5A8857705C128b2c1A5f0Ae20880dc",
"multisigIsmFactory": "0x32268e45724626972650837A26eEF0Dd9E6aEEE3",
"aggregationIsmFactory": "0xD095B3ADa705e171f40187e10eD07Ee5fe291704", "aggregationIsmFactory": "0xD095B3ADa705e171f40187e10eD07Ee5fe291704",
"routingIsmFactory": "0xdc8BC001FB649EfD51eEDD33151d428b917AaE3d" "routingIsmFactory": "0xdc8BC001FB649EfD51eEDD33151d428b917AaE3d"
}, },
@ -59,7 +56,6 @@
"interchainQueryRouter": "0xF782C6C4A02f2c71BB8a1Db0166FAB40ea956818", "interchainQueryRouter": "0xF782C6C4A02f2c71BB8a1Db0166FAB40ea956818",
"interchainAccountRouter": "0x951c74D83a85833b53A448caaB7397bd3fa6CFB2", "interchainAccountRouter": "0x951c74D83a85833b53A448caaB7397bd3fa6CFB2",
"interchainAccountIsm": "0x9034f60Dec10cFa162369444081685F542d0C24D", "interchainAccountIsm": "0x9034f60Dec10cFa162369444081685F542d0C24D",
"multisigIsmFactory": "0xfb6B94750e1307719892fBC21AC7A0C74A467869",
"aggregationIsmFactory": "0xda72972291172B9966Dec7606d45d72e2b9f2470", "aggregationIsmFactory": "0xda72972291172B9966Dec7606d45d72e2b9f2470",
"routingIsmFactory": "0x0CA314006fe0e7EF88ad2Bb69a7421aB2f1C5288" "routingIsmFactory": "0x0CA314006fe0e7EF88ad2Bb69a7421aB2f1C5288"
}, },
@ -75,7 +71,6 @@
"interchainQueryRouter": "0xF782C6C4A02f2c71BB8a1Db0166FAB40ea956818", "interchainQueryRouter": "0xF782C6C4A02f2c71BB8a1Db0166FAB40ea956818",
"interchainAccountRouter": "0xCb0ba89F564e31180A101Df54b7971206e03ee9b", "interchainAccountRouter": "0xCb0ba89F564e31180A101Df54b7971206e03ee9b",
"interchainAccountIsm": "0x70835F3C2845394842DEA9f40cbe8087b2cE5712", "interchainAccountIsm": "0x70835F3C2845394842DEA9f40cbe8087b2cE5712",
"multisigIsmFactory": "0xFa13bd2BD45644bAF0797e41D1a4D56601a4059a",
"aggregationIsmFactory": "0x11413a6Ea76a55eAec950894ba8fdd7683E41b06", "aggregationIsmFactory": "0x11413a6Ea76a55eAec950894ba8fdd7683E41b06",
"routingIsmFactory": "0x129A80Fe557153B5F48B4292F8C177bACdcf7dB3" "routingIsmFactory": "0x129A80Fe557153B5F48B4292F8C177bACdcf7dB3"
}, },
@ -91,7 +86,6 @@
"interchainQueryRouter": "0xF782C6C4A02f2c71BB8a1Db0166FAB40ea956818", "interchainQueryRouter": "0xF782C6C4A02f2c71BB8a1Db0166FAB40ea956818",
"interchainAccountRouter": "0x209Ccdbe13BB913104117B1D6f7801684e98FA1F", "interchainAccountRouter": "0x209Ccdbe13BB913104117B1D6f7801684e98FA1F",
"interchainAccountIsm": "0xD699ff94f3FFd60A3a09bBff96181325B6C73FB8", "interchainAccountIsm": "0xD699ff94f3FFd60A3a09bBff96181325B6C73FB8",
"multisigIsmFactory": "0x4266D8Dd66D8Eb3934c8942968d1e54214D072d3",
"aggregationIsmFactory": "0x759c4Eb4575B651a9f0Fb46653dd7B2F32fD7310", "aggregationIsmFactory": "0x759c4Eb4575B651a9f0Fb46653dd7B2F32fD7310",
"routingIsmFactory": "0x561331FafB7f2ABa77E77780178ADdD1A37bdaBD" "routingIsmFactory": "0x561331FafB7f2ABa77E77780178ADdD1A37bdaBD"
}, },
@ -107,7 +101,6 @@
"interchainQueryRouter": "0xF782C6C4A02f2c71BB8a1Db0166FAB40ea956818", "interchainQueryRouter": "0xF782C6C4A02f2c71BB8a1Db0166FAB40ea956818",
"interchainAccountRouter": "0x12EBd8cb561c68b587C392e0c5405B9866FD5820", "interchainAccountRouter": "0x12EBd8cb561c68b587C392e0c5405B9866FD5820",
"interchainAccountIsm": "0x82F5a960a4e4Cc0614253e4977bb3BE10344a30C", "interchainAccountIsm": "0x82F5a960a4e4Cc0614253e4977bb3BE10344a30C",
"multisigIsmFactory": "0x0bA75fBC56FEb7e4F5EF4a8F042272cfec152ABc",
"aggregationIsmFactory": "0x919AD6f6DFE1C17b89DAC2eE526F153C08afE305", "aggregationIsmFactory": "0x919AD6f6DFE1C17b89DAC2eE526F153C08afE305",
"routingIsmFactory": "0x1D7b8aBa2494Ec82e80D6206d2B3df9f8C3F1862" "routingIsmFactory": "0x1D7b8aBa2494Ec82e80D6206d2B3df9f8C3F1862"
}, },
@ -123,7 +116,6 @@
"interchainQueryRouter": "0xF782C6C4A02f2c71BB8a1Db0166FAB40ea956818", "interchainQueryRouter": "0xF782C6C4A02f2c71BB8a1Db0166FAB40ea956818",
"interchainAccountRouter": "0x4266D8Dd66D8Eb3934c8942968d1e54214D072d3", "interchainAccountRouter": "0x4266D8Dd66D8Eb3934c8942968d1e54214D072d3",
"interchainAccountIsm": "0xA8978fdB093b1C5b892291A36e8527b34B749d6f", "interchainAccountIsm": "0xA8978fdB093b1C5b892291A36e8527b34B749d6f",
"multisigIsmFactory": "0x71cCc98689B48Dd50Fd5950815A56d76477349B2",
"aggregationIsmFactory": "0xa27F4a2bD624CF1cB3605c532E95E27BB0AC0BB3", "aggregationIsmFactory": "0xa27F4a2bD624CF1cB3605c532E95E27BB0AC0BB3",
"routingIsmFactory": "0xa68022e53Fd28119D07C8336a8eC84A298Fd38Fd" "routingIsmFactory": "0xa68022e53Fd28119D07C8336a8eC84A298Fd38Fd"
}, },
@ -138,7 +130,6 @@
"testRecipient": "0xBC3cFeca7Df5A45d61BC60E7898E63670e1654aE", "testRecipient": "0xBC3cFeca7Df5A45d61BC60E7898E63670e1654aE",
"interchainAccountRouter": "0xB057Fb841027a8554521DcCdeC3c3474CaC99AB5", "interchainAccountRouter": "0xB057Fb841027a8554521DcCdeC3c3474CaC99AB5",
"interchainAccountIsm": "0x7483faD0Bc297667664A43A064bA7c9911659f57", "interchainAccountIsm": "0x7483faD0Bc297667664A43A064bA7c9911659f57",
"multisigIsmFactory": "0xD356C996277eFb7f75Ee8bd61b31cC781A12F54f",
"aggregationIsmFactory": "0x01812D60958798695391dacF092BAc4a715B1718", "aggregationIsmFactory": "0x01812D60958798695391dacF092BAc4a715B1718",
"routingIsmFactory": "0xE67CfA164cDa449Ae38a0a09391eF6bCDf8e4e2c" "routingIsmFactory": "0xE67CfA164cDa449Ae38a0a09391eF6bCDf8e4e2c"
} }

@ -66,23 +66,23 @@ export class HyperlaneCoreDeployer extends HyperlaneDeployer<
const cachedMailbox = this.deployedContracts[chain]?.mailbox; const cachedMailbox = this.deployedContracts[chain]?.mailbox;
if (cachedMailbox) { if (cachedMailbox) {
const module = await cachedMailbox.defaultIsm(); const module = await cachedMailbox.defaultIsm();
const matches = await moduleMatchesConfig( if (
await moduleMatchesConfig(
chain, chain,
module, module,
config, config,
this.ismFactory.multiProvider, this.ismFactory.multiProvider,
this.ismFactory.getContracts(chain), this.ismFactory.getContracts(chain),
); )
if (!matches) { ) {
const ism = await this.ismFactory.deploy(chain, config); this.logger(`Default ISM matches config for ${chain}`);
return ism.address;
}
return module; return module;
} else { }
}
this.logger(`Deploying new ISM to ${chain}`);
const ism = await this.ismFactory.deploy(chain, config); const ism = await this.ismFactory.deploy(chain, config);
return ism.address; return ism.address;
} }
}
async deployContracts( async deployContracts(
chain: ChainName, chain: ChainName,

@ -1,3 +1,4 @@
import { debug } from 'debug';
import { ethers } from 'ethers'; import { ethers } from 'ethers';
import { import {
@ -56,7 +57,11 @@ export class HyperlaneIsmFactory extends HyperlaneApp<IsmFactoryFactories> {
ismFactoryFactories, ismFactoryFactories,
multiProvider, multiProvider,
); );
return new HyperlaneIsmFactory(helper.contractsMap, helper.multiProvider); return new HyperlaneIsmFactory(
helper.contractsMap,
helper.multiProvider,
debug('hyperlane:IsmFactoryApp'),
);
} }
async deploy( async deploy(
@ -69,10 +74,17 @@ export class HyperlaneIsmFactory extends HyperlaneApp<IsmFactoryFactories> {
config.type === ModuleType.MESSAGE_ID_MULTISIG || config.type === ModuleType.MESSAGE_ID_MULTISIG ||
config.type === ModuleType.LEGACY_MULTISIG config.type === ModuleType.LEGACY_MULTISIG
) { ) {
this.logger(`Deploying Multisig ISM to ${chain} for verifying ${origin}`);
return this.deployMultisigIsm(chain, config, origin); return this.deployMultisigIsm(chain, config, origin);
} else if (config.type === ModuleType.ROUTING) { } else if (config.type === ModuleType.ROUTING) {
this.logger(
`Deploying Routing ISM to ${chain} for verifying ${Object.keys(
config.domains,
)}`,
);
return this.deployRoutingIsm(chain, config); return this.deployRoutingIsm(chain, config);
} else if (config.type === ModuleType.AGGREGATION) { } else if (config.type === ModuleType.AGGREGATION) {
this.logger(`Deploying Aggregation ISM to ${chain}`);
return this.deployAggregationIsm(chain, config); return this.deployAggregationIsm(chain, config);
} else { } else {
throw new Error(`Unsupported ISM type`); throw new Error(`Unsupported ISM type`);
@ -87,7 +99,7 @@ export class HyperlaneIsmFactory extends HyperlaneApp<IsmFactoryFactories> {
const signer = this.multiProvider.getSigner(chain); const signer = this.multiProvider.getSigner(chain);
let address: string; let address: string;
if (config.type === ModuleType.LEGACY_MULTISIG) { if (config.type === ModuleType.LEGACY_MULTISIG) {
if (process.env.E2E_CI_MODE !== 'true') { if (process.env.CI !== 'true') {
throw new Error( throw new Error(
'Legacy multisig ISM is being deprecated, do not deploy', 'Legacy multisig ISM is being deprecated, do not deploy',
); );
@ -184,7 +196,14 @@ export class HyperlaneIsmFactory extends HyperlaneApp<IsmFactoryFactories> {
const provider = this.multiProvider.getProvider(chain); const provider = this.multiProvider.getProvider(chain);
const code = await provider.getCode(address); const code = await provider.getCode(address);
if (code === '0x') { if (code === '0x') {
this.logger(
`Deploying new ${threshold} of ${values.length} address set to ${chain}`,
);
await factory.deploy(sorted, threshold); await factory.deploy(sorted, threshold);
} else {
this.logger(
`Recovered ${threshold} of ${values.length} address set on ${chain}`,
);
} }
return address; return address;
} }
@ -388,7 +407,11 @@ export function collectValidators(
config: IsmConfig, config: IsmConfig,
): Set<string> { ): Set<string> {
let validators: string[] = []; let validators: string[] = [];
if (config.type === ModuleType.MERKLE_ROOT_MULTISIG) { if (
config.type === ModuleType.MERKLE_ROOT_MULTISIG ||
config.type === ModuleType.MESSAGE_ID_MULTISIG ||
config.type === ModuleType.LEGACY_MULTISIG
) {
validators = config.validators; validators = config.validators;
} else if (config.type === ModuleType.ROUTING) { } else if (config.type === ModuleType.ROUTING) {
if (Object.keys(config.domains).includes(origin)) { if (Object.keys(config.domains).includes(origin)) {

Loading…
Cancel
Save