Fix core contract caching and recovery (#2932)

- Fix core contract recovery
- Simplify deployment plan text
- Soften balance warning message
pull/2936/head
J M Rossy 1 year ago committed by GitHub
parent 98faec86ed
commit bbe8071941
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      .github/workflows/node.yml
  2. 4
      solidity/package.json
  3. 4
      typescript/cli/package.json
  4. 28
      typescript/cli/src/deploy/core.ts
  5. 3
      typescript/cli/src/send/message.ts
  6. 2
      typescript/cli/src/utils/balances.ts
  7. 6
      typescript/helloworld/package.json
  8. 8
      typescript/infra/package.json
  9. 6
      typescript/sdk/package.json
  10. 2
      typescript/sdk/src/consts/chainMetadata.ts
  11. 2
      typescript/utils/package.json
  12. 26
      yarn.lock

@ -3,9 +3,9 @@ name: node
on:
# Triggers the workflow on push or pull request against main
push:
branches: [v3]
branches: [main]
pull_request:
branches: [v3]
branches: [main]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

@ -1,10 +1,10 @@
{
"name": "@hyperlane-xyz/core",
"description": "Core solidity contracts for Hyperlane",
"version": "3.1.3",
"version": "3.1.7",
"dependencies": {
"@eth-optimism/contracts": "^0.6.0",
"@hyperlane-xyz/utils": "3.1.3",
"@hyperlane-xyz/utils": "3.1.7",
"@openzeppelin/contracts": "^4.9.3",
"@openzeppelin/contracts-upgradeable": "^v4.9.3"
},

@ -1,9 +1,9 @@
{
"name": "@hyperlane-xyz/cli",
"version": "3.1.3",
"version": "3.1.7",
"description": "A command-line utility for common Hyperlane operations",
"dependencies": {
"@hyperlane-xyz/sdk": "3.1.3",
"@hyperlane-xyz/sdk": "3.1.7",
"@inquirer/prompts": "^3.0.0",
"bignumber.js": "^9.1.1",
"chalk": "^5.3.0",

@ -213,22 +213,17 @@ async function runDeployPlanStep({
skipConfirmation,
}: DeployParams) {
const address = await signer.getAddress();
logBlue('\nDeployment plan');
logGray('===============');
log(`Transaction signer and owner of new contracts will be ${address}`);
log(`Deploying to ${chains.join(', ')}`);
const numContracts = Object.keys(
Object.values(sdkContractAddressesMap)[0],
).length;
log(`There are ${numContracts} contracts for each chain`);
if (artifacts)
log('But contracts with an address in the artifacts file will be skipped');
for (const chain of chains) {
const chainArtifacts = artifacts?.[chain] || {};
const numRequired = numContracts - Object.keys(chainArtifacts).length;
log(`${chain} will require ${numRequired} of ${numContracts}`);
}
log('The default interchain security module will be a Multisig.');
log(
`There are several contracts required for each chain but contracts in the Hyperlane SDK ${
artifacts ? 'or your artifacts ' : ''
}will be skipped`,
);
if (skipConfirmation) return;
const isConfirmed = await confirm({
message: 'Is this deployment plan correct?',
@ -284,11 +279,6 @@ async function executeDeploy({
const ismContracts: ChainMap<{ multisigIsm: DeployedIsm }> = {};
const defaultIsms: ChainMap<Address> = {};
for (const ismOrigin of chains) {
if (artifacts[ismOrigin].multisigIsm) {
log(`ISM contract recovered, skipping ISM deployment to ${ismOrigin}`);
defaultIsms[ismOrigin] = artifacts[ismOrigin].multisigIsm;
continue;
}
logBlue(`Deploying ISM to ${ismOrigin}`);
const ismConfig = buildIsmConfig(owner, ismOrigin, chains, multisigConfig);
ismContracts[ismOrigin] = {
@ -302,7 +292,7 @@ async function executeDeploy({
// 4. Deploy core contracts to chains
logBlue(`Deploying core contracts to ${chains.join(', ')}`);
const coreDeployer = new HyperlaneCoreDeployer(multiProvider, ismFactory);
coreDeployer.cacheAddressesMap(artifacts);
coreDeployer.cacheAddressesMap(mergedContractAddrs as any);
const coreConfigs = buildCoreConfigMap(
owner,
chains,
@ -317,7 +307,7 @@ async function executeDeploy({
log('Deploying test recipient contracts');
const testRecipientConfig = buildTestRecipientConfigMap(chains, artifacts);
const testRecipientDeployer = new TestRecipientDeployer(multiProvider);
testRecipientDeployer.cacheAddressesMap(artifacts);
testRecipientDeployer.cacheAddressesMap(mergedContractAddrs);
const testRecipients = await testRecipientDeployer.deploy(
testRecipientConfig,
);

@ -111,7 +111,8 @@ async function executeDelivery({
txReceipt = await multiProvider.handleTx(origin, messageTx);
const message = core.getDispatchedMessages(txReceipt)[0];
logBlue(`Sent message from ${origin} to ${recipient} on ${destination}.`);
logBlue(`Message: ${JSON.stringify(message)}`);
logBlue(`Message ID: ${message.id}`);
log(`Message: ${JSON.stringify(message)}`);
} catch (e) {
errorRed(
`Encountered error sending message from ${origin} to ${destination}`,

@ -22,7 +22,7 @@ export async function assertNativeBalances(
if (balanceWei.lt(minBalanceWei)) {
const symbol =
multiProvider.getChainMetadata(chain).nativeToken?.symbol ?? 'ETH';
const error = `${address} has insufficient balance on ${chain}. At least ${minBalance} required but found ${balance.toString()} ${symbol}`;
const error = `${address} has low balance on ${chain}. At least ${minBalance} recommended but found ${balance.toString()} ${symbol}`;
const isResume = await confirm({
message: `WARNING: ${error} Continue?`,
});

@ -1,10 +1,10 @@
{
"name": "@hyperlane-xyz/helloworld",
"description": "A basic skeleton of an Hyperlane app",
"version": "3.1.3",
"version": "3.1.7",
"dependencies": {
"@hyperlane-xyz/core": "3.1.3",
"@hyperlane-xyz/sdk": "3.1.3",
"@hyperlane-xyz/core": "3.1.7",
"@hyperlane-xyz/sdk": "3.1.7",
"@openzeppelin/contracts-upgradeable": "^4.9.3",
"ethers": "^5.7.2"
},

@ -1,7 +1,7 @@
{
"name": "@hyperlane-xyz/infra",
"description": "Infrastructure utilities for the Hyperlane Network",
"version": "3.1.3",
"version": "3.1.5",
"dependencies": {
"@arbitrum/sdk": "^3.0.0",
"@aws-sdk/client-iam": "^3.74.0",
@ -11,9 +11,9 @@
"@ethersproject/experimental": "^5.7.0",
"@ethersproject/hardware-wallets": "^5.7.0",
"@ethersproject/providers": "^5.7.2",
"@hyperlane-xyz/helloworld": "3.1.3",
"@hyperlane-xyz/sdk": "3.1.3",
"@hyperlane-xyz/utils": "3.1.3",
"@hyperlane-xyz/helloworld": "3.1.7",
"@hyperlane-xyz/sdk": "3.1.7",
"@hyperlane-xyz/utils": "3.1.7",
"@nomiclabs/hardhat-etherscan": "^3.0.3",
"@safe-global/api-kit": "^1.3.0",
"@safe-global/protocol-kit": "^1.2.0",

@ -1,12 +1,12 @@
{
"name": "@hyperlane-xyz/sdk",
"description": "The official SDK for the Hyperlane Network",
"version": "3.1.3",
"version": "3.1.7",
"dependencies": {
"@cosmjs/cosmwasm-stargate": "^0.31.3",
"@cosmjs/stargate": "^0.31.3",
"@hyperlane-xyz/core": "3.1.3",
"@hyperlane-xyz/utils": "3.1.3",
"@hyperlane-xyz/core": "3.1.7",
"@hyperlane-xyz/utils": "3.1.7",
"@solana/spl-token": "^0.3.8",
"@solana/web3.js": "^1.78.0",
"@types/coingecko-api": "^1.0.10",

@ -961,6 +961,7 @@ export const polygonzkevmtestnet: ChainMetadata = {
domainId: 1442,
name: Chains.polygonzkevmtestnet,
displayName: 'Polygon zkEVM Testnet',
displayNameShort: 'ZkEvm Testnet',
nativeToken: etherToken,
rpcUrls: [{ http: 'https://rpc.public.zkevm-test.net' }],
blockExplorers: [
@ -985,6 +986,7 @@ export const polygonzkevm: ChainMetadata = {
domainId: 1101,
name: Chains.polygonzkevm,
displayName: 'Polygon zkEVM',
displayNameShort: 'zkEVM',
nativeToken: etherToken,
rpcUrls: [
{ http: 'https://polygonzkevm-mainnet.g.alchemy.com/v2/demo' },

@ -1,7 +1,7 @@
{
"name": "@hyperlane-xyz/utils",
"description": "General utilities and types for the Hyperlane network",
"version": "3.1.3",
"version": "3.1.7",
"dependencies": {
"@cosmjs/encoding": "^0.31.3",
"@solana/web3.js": "^1.78.0",

@ -3987,7 +3987,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@hyperlane-xyz/cli@workspace:typescript/cli"
dependencies:
"@hyperlane-xyz/sdk": "npm:3.1.3"
"@hyperlane-xyz/sdk": "npm:3.1.7"
"@inquirer/prompts": "npm:^3.0.0"
"@types/node": "npm:^18.14.5"
"@types/yargs": "npm:^17.0.24"
@ -4009,12 +4009,12 @@ __metadata:
languageName: unknown
linkType: soft
"@hyperlane-xyz/core@npm:3.1.3, @hyperlane-xyz/core@workspace:solidity":
"@hyperlane-xyz/core@npm:3.1.7, @hyperlane-xyz/core@workspace:solidity":
version: 0.0.0-use.local
resolution: "@hyperlane-xyz/core@workspace:solidity"
dependencies:
"@eth-optimism/contracts": "npm:^0.6.0"
"@hyperlane-xyz/utils": "npm:3.1.3"
"@hyperlane-xyz/utils": "npm:3.1.7"
"@nomiclabs/hardhat-ethers": "npm:^2.2.1"
"@nomiclabs/hardhat-waffle": "npm:^2.0.6"
"@openzeppelin/contracts": "npm:^4.9.3"
@ -4041,12 +4041,12 @@ __metadata:
languageName: unknown
linkType: soft
"@hyperlane-xyz/helloworld@npm:3.1.3, @hyperlane-xyz/helloworld@workspace:typescript/helloworld":
"@hyperlane-xyz/helloworld@npm:3.1.7, @hyperlane-xyz/helloworld@workspace:typescript/helloworld":
version: 0.0.0-use.local
resolution: "@hyperlane-xyz/helloworld@workspace:typescript/helloworld"
dependencies:
"@hyperlane-xyz/core": "npm:3.1.3"
"@hyperlane-xyz/sdk": "npm:3.1.3"
"@hyperlane-xyz/core": "npm:3.1.7"
"@hyperlane-xyz/sdk": "npm:3.1.7"
"@nomiclabs/hardhat-ethers": "npm:^2.2.1"
"@nomiclabs/hardhat-waffle": "npm:^2.0.6"
"@openzeppelin/contracts-upgradeable": "npm:^4.9.3"
@ -4091,9 +4091,9 @@ __metadata:
"@ethersproject/experimental": "npm:^5.7.0"
"@ethersproject/hardware-wallets": "npm:^5.7.0"
"@ethersproject/providers": "npm:^5.7.2"
"@hyperlane-xyz/helloworld": "npm:3.1.3"
"@hyperlane-xyz/sdk": "npm:3.1.3"
"@hyperlane-xyz/utils": "npm:3.1.3"
"@hyperlane-xyz/helloworld": "npm:3.1.7"
"@hyperlane-xyz/sdk": "npm:3.1.7"
"@hyperlane-xyz/utils": "npm:3.1.7"
"@nomiclabs/hardhat-ethers": "npm:^2.2.1"
"@nomiclabs/hardhat-etherscan": "npm:^3.0.3"
"@nomiclabs/hardhat-waffle": "npm:^2.0.6"
@ -4140,14 +4140,14 @@ __metadata:
languageName: unknown
linkType: soft
"@hyperlane-xyz/sdk@npm:3.1.3, @hyperlane-xyz/sdk@workspace:typescript/sdk":
"@hyperlane-xyz/sdk@npm:3.1.7, @hyperlane-xyz/sdk@workspace:typescript/sdk":
version: 0.0.0-use.local
resolution: "@hyperlane-xyz/sdk@workspace:typescript/sdk"
dependencies:
"@cosmjs/cosmwasm-stargate": "npm:^0.31.3"
"@cosmjs/stargate": "npm:^0.31.3"
"@hyperlane-xyz/core": "npm:3.1.3"
"@hyperlane-xyz/utils": "npm:3.1.3"
"@hyperlane-xyz/core": "npm:3.1.7"
"@hyperlane-xyz/utils": "npm:3.1.7"
"@nomiclabs/hardhat-ethers": "npm:^2.2.1"
"@nomiclabs/hardhat-waffle": "npm:^2.0.6"
"@solana/spl-token": "npm:^0.3.8"
@ -4183,7 +4183,7 @@ __metadata:
languageName: unknown
linkType: soft
"@hyperlane-xyz/utils@npm:3.1.3, @hyperlane-xyz/utils@workspace:typescript/utils":
"@hyperlane-xyz/utils@npm:3.1.7, @hyperlane-xyz/utils@workspace:typescript/utils":
version: 0.0.0-use.local
resolution: "@hyperlane-xyz/utils@workspace:typescript/utils"
dependencies:

Loading…
Cancel
Save