Fix checkConfig in HyperlaneRouterDeployer (#2469)

- Fix checkConfig in HyperlaneRouterDeployer
- Bump packages to 1.3.7
dan/aggregation-ism-rc v1.3.7
J M Rossy 1 year ago committed by GitHub
parent 6ee5868353
commit 7ff83bbd0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      solidity/package.json
  2. 4
      typescript/helloworld/package.json
  3. 8
      typescript/infra/package.json
  4. 6
      typescript/sdk/package.json
  5. 1
      typescript/sdk/src/index.ts
  6. 15
      typescript/sdk/src/ism/HyperlaneIsmFactory.ts
  7. 30
      typescript/sdk/src/router/HyperlaneRouterDeployer.ts
  8. 8
      typescript/token/package.json
  9. 2
      typescript/utils/package.json
  10. 28
      yarn.lock

@ -1,9 +1,9 @@
{
"name": "@hyperlane-xyz/core",
"description": "Core solidity contracts for Hyperlane",
"version": "1.3.6",
"version": "1.3.7",
"dependencies": {
"@hyperlane-xyz/utils": "1.3.6",
"@hyperlane-xyz/utils": "1.3.7",
"@openzeppelin/contracts": "^4.8.0",
"@openzeppelin/contracts-upgradeable": "^4.8.0"
},

@ -1,9 +1,9 @@
{
"name": "@hyperlane-xyz/helloworld",
"description": "A basic skeleton of an Hyperlane app",
"version": "1.3.6",
"version": "1.3.7",
"dependencies": {
"@hyperlane-xyz/sdk": "1.3.6",
"@hyperlane-xyz/sdk": "1.3.7",
"@openzeppelin/contracts-upgradeable": "^4.8.0",
"ethers": "^5.7.2"
},

@ -1,7 +1,7 @@
{
"name": "@hyperlane-xyz/infra",
"description": "Infrastructure utilities for the Hyperlane Network",
"version": "1.3.6",
"version": "1.3.7",
"dependencies": {
"@arbitrum/sdk": "^3.0.0",
"@aws-sdk/client-iam": "^3.74.0",
@ -14,9 +14,9 @@
"@gnosis.pm/safe-core-sdk": "^2.3.2",
"@gnosis.pm/safe-ethers-lib": "^1.4.0",
"@gnosis.pm/safe-service-client": "^1.2.0",
"@hyperlane-xyz/helloworld": "1.3.6",
"@hyperlane-xyz/sdk": "1.3.6",
"@hyperlane-xyz/utils": "1.3.6",
"@hyperlane-xyz/helloworld": "1.3.7",
"@hyperlane-xyz/sdk": "1.3.7",
"@hyperlane-xyz/utils": "1.3.7",
"@nomiclabs/hardhat-etherscan": "^3.0.3",
"@safe-global/safe-core-sdk": "3.2.0",
"@safe-global/safe-ethers-lib": "^1.7.0",

@ -1,10 +1,10 @@
{
"name": "@hyperlane-xyz/sdk",
"description": "The official SDK for the Hyperlane Network",
"version": "1.3.6",
"version": "1.3.7",
"dependencies": {
"@hyperlane-xyz/core": "1.3.6",
"@hyperlane-xyz/utils": "1.3.6",
"@hyperlane-xyz/core": "1.3.7",
"@hyperlane-xyz/utils": "1.3.7",
"@types/coingecko-api": "^1.0.10",
"@types/debug": "^4.1.7",
"@wagmi/chains": "^0.2.6",

@ -94,6 +94,7 @@ export {
export { HyperlaneIsmFactoryDeployer } from './ism/HyperlaneIsmFactoryDeployer';
export {
AggregationIsmConfig,
DeployedIsm,
IsmConfig,
ModuleType,
MultisigIsmConfig,

@ -227,7 +227,7 @@ export class HyperlaneIsmFactory extends HyperlaneApp<IsmFactoryFactories> {
// body specific logic, as the sample message used when querying the ISM
// sets all of these to zero.
export async function moduleCanCertainlyVerify(
moduleAddress: types.Address,
destModuleAddress: types.Address,
multiProvider: MultiProvider,
origin: ChainName,
destination: ChainName,
@ -243,7 +243,7 @@ export async function moduleCanCertainlyVerify(
);
const provider = multiProvider.getSignerOrProvider(destination);
const module = IInterchainSecurityModule__factory.connect(
moduleAddress,
destModuleAddress,
provider,
);
try {
@ -254,7 +254,7 @@ export async function moduleCanCertainlyVerify(
moduleType === ModuleType.MESSAGE_ID_MULTISIG
) {
const multisigModule = IMultisigIsm__factory.connect(
moduleAddress,
destModuleAddress,
provider,
);
@ -263,7 +263,10 @@ export async function moduleCanCertainlyVerify(
);
return threshold > 0;
} else if (moduleType === ModuleType.ROUTING) {
const routingIsm = IRoutingIsm__factory.connect(moduleAddress, provider);
const routingIsm = IRoutingIsm__factory.connect(
destModuleAddress,
provider,
);
const subModule = await routingIsm.route(message);
return moduleCanCertainlyVerify(
subModule,
@ -273,7 +276,7 @@ export async function moduleCanCertainlyVerify(
);
} else if (moduleType === ModuleType.AGGREGATION) {
const aggregationIsm = IAggregationIsm__factory.connect(
moduleAddress,
destModuleAddress,
provider,
);
const [subModules, threshold] = await aggregationIsm.modulesAndThreshold(
@ -296,7 +299,7 @@ export async function moduleCanCertainlyVerify(
throw new Error(`Unsupported module type: ${moduleType}`);
}
} catch (e) {
logging.warn(`Error checking module ${moduleAddress}: ${e}`);
logging.warn(`Error checking module ${destModuleAddress}: ${e}`);
return false;
}
}

@ -27,42 +27,44 @@ export abstract class HyperlaneRouterDeployer<
// recipient, or body-specific logic. Folks that wish to deploy using
// such ISMs *may* need to override checkConfig to disable this check.
async checkConfig(configMap: ChainMap<Config>): Promise<void> {
const chains = Object.keys(configMap);
for (const [chain, config] of Object.entries(configMap)) {
const signerOrProvider = this.multiProvider.getSignerOrProvider(chain);
const igp = IInterchainGasPaymaster__factory.connect(
for (const [local, config] of Object.entries(configMap)) {
const signerOrProvider = this.multiProvider.getSignerOrProvider(local);
const localIgp = IInterchainGasPaymaster__factory.connect(
config.interchainGasPaymaster,
signerOrProvider,
);
const mailbox = Mailbox__factory.connect(
const localMailbox = Mailbox__factory.connect(
config.mailbox,
signerOrProvider,
);
const ism =
config.interchainSecurityModule ?? (await mailbox.defaultIsm());
const remotes = chains.filter((c) => c !== chain);
const localIsm =
config.interchainSecurityModule ?? (await localMailbox.defaultIsm());
const remotes = Object.keys(configMap).filter((c) => c !== local);
for (const remote of remotes) {
// Try to confirm that the IGP supports delivery to all remotes
try {
await igp.quoteGasPayment(this.multiProvider.getDomainId(remote), 1);
await localIgp.quoteGasPayment(
this.multiProvider.getDomainId(remote),
1,
);
} catch (e) {
throw new Error(
`The specified or default IGP with address ${igp.address} on ` +
`${chain} is not configured to deliver messages to ${remote}, ` +
`The specified or default IGP with address ${localIgp.address} on ` +
`${local} is not configured to deliver messages to ${remote}, ` +
`did you mean to specify a different one?`,
);
}
// Try to confirm that the specified or default ISM can verify messages to all remotes
const canVerify = await moduleCanCertainlyVerify(
ism,
localIsm,
this.multiProvider,
chain,
remote,
local,
);
if (!canVerify) {
throw new Error(
`The specified or default ISM with address ${ism} on ${chain} ` +
`The specified or default ISM with address ${localIsm} on ${local} ` +
`cannot verify messages from ${remote}, did you forget to ` +
`specify an ISM, or mean to specify a different one?`,
);

@ -1,11 +1,11 @@
{
"name": "@hyperlane-xyz/hyperlane-token",
"description": "A template for interchain ERC20 and ERC721 tokens using Hyperlane",
"version": "1.3.6",
"version": "1.3.7",
"dependencies": {
"@hyperlane-xyz/core": "1.3.6",
"@hyperlane-xyz/sdk": "1.3.6",
"@hyperlane-xyz/utils": "1.3.6",
"@hyperlane-xyz/core": "1.3.7",
"@hyperlane-xyz/sdk": "1.3.7",
"@hyperlane-xyz/utils": "1.3.7",
"@openzeppelin/contracts-upgradeable": "^4.8.0",
"ethers": "^5.7.2"
},

@ -1,7 +1,7 @@
{
"name": "@hyperlane-xyz/utils",
"description": "General utilities for the Hyperlane network",
"version": "1.3.6",
"version": "1.3.7",
"dependencies": {
"ethers": "^5.7.2"
},

@ -3931,11 +3931,11 @@ __metadata:
languageName: node
linkType: hard
"@hyperlane-xyz/core@1.3.6, @hyperlane-xyz/core@workspace:solidity":
"@hyperlane-xyz/core@1.3.7, @hyperlane-xyz/core@workspace:solidity":
version: 0.0.0-use.local
resolution: "@hyperlane-xyz/core@workspace:solidity"
dependencies:
"@hyperlane-xyz/utils": 1.3.6
"@hyperlane-xyz/utils": 1.3.7
"@nomiclabs/hardhat-ethers": ^2.2.1
"@nomiclabs/hardhat-waffle": ^2.0.3
"@openzeppelin/contracts": ^4.8.0
@ -3958,11 +3958,11 @@ __metadata:
languageName: unknown
linkType: soft
"@hyperlane-xyz/helloworld@1.3.6, @hyperlane-xyz/helloworld@workspace:typescript/helloworld":
"@hyperlane-xyz/helloworld@1.3.7, @hyperlane-xyz/helloworld@workspace:typescript/helloworld":
version: 0.0.0-use.local
resolution: "@hyperlane-xyz/helloworld@workspace:typescript/helloworld"
dependencies:
"@hyperlane-xyz/sdk": 1.3.6
"@hyperlane-xyz/sdk": 1.3.7
"@nomiclabs/hardhat-ethers": ^2.2.1
"@nomiclabs/hardhat-waffle": ^2.0.3
"@openzeppelin/contracts-upgradeable": ^4.8.0
@ -3994,9 +3994,9 @@ __metadata:
version: 0.0.0-use.local
resolution: "@hyperlane-xyz/hyperlane-token@workspace:typescript/token"
dependencies:
"@hyperlane-xyz/core": 1.3.6
"@hyperlane-xyz/sdk": 1.3.6
"@hyperlane-xyz/utils": 1.3.6
"@hyperlane-xyz/core": 1.3.7
"@hyperlane-xyz/sdk": 1.3.7
"@hyperlane-xyz/utils": 1.3.7
"@nomiclabs/hardhat-ethers": ^2.2.1
"@nomiclabs/hardhat-waffle": ^2.0.3
"@openzeppelin/contracts-upgradeable": ^4.8.0
@ -4039,9 +4039,9 @@ __metadata:
"@gnosis.pm/safe-core-sdk": ^2.3.2
"@gnosis.pm/safe-ethers-lib": ^1.4.0
"@gnosis.pm/safe-service-client": ^1.2.0
"@hyperlane-xyz/helloworld": 1.3.6
"@hyperlane-xyz/sdk": 1.3.6
"@hyperlane-xyz/utils": 1.3.6
"@hyperlane-xyz/helloworld": 1.3.7
"@hyperlane-xyz/sdk": 1.3.7
"@hyperlane-xyz/utils": 1.3.7
"@nomiclabs/hardhat-ethers": ^2.2.1
"@nomiclabs/hardhat-etherscan": ^3.0.3
"@nomiclabs/hardhat-waffle": ^2.0.3
@ -4084,12 +4084,12 @@ __metadata:
languageName: unknown
linkType: soft
"@hyperlane-xyz/sdk@1.3.6, @hyperlane-xyz/sdk@workspace:typescript/sdk":
"@hyperlane-xyz/sdk@1.3.7, @hyperlane-xyz/sdk@workspace:typescript/sdk":
version: 0.0.0-use.local
resolution: "@hyperlane-xyz/sdk@workspace:typescript/sdk"
dependencies:
"@hyperlane-xyz/core": 1.3.6
"@hyperlane-xyz/utils": 1.3.6
"@hyperlane-xyz/core": 1.3.7
"@hyperlane-xyz/utils": 1.3.7
"@nomiclabs/hardhat-ethers": ^2.2.1
"@nomiclabs/hardhat-waffle": ^2.0.3
"@types/coingecko-api": ^1.0.10
@ -4115,7 +4115,7 @@ __metadata:
languageName: unknown
linkType: soft
"@hyperlane-xyz/utils@1.3.6, @hyperlane-xyz/utils@workspace:typescript/utils":
"@hyperlane-xyz/utils@1.3.7, @hyperlane-xyz/utils@workspace:typescript/utils":
version: 0.0.0-use.local
resolution: "@hyperlane-xyz/utils@workspace:typescript/utils"
dependencies:

Loading…
Cancel
Save