Skip to content

Commit

Permalink
Add IGP deploy cache exclusion
Browse files Browse the repository at this point in the history
  • Loading branch information
jmrossy committed May 1, 2024
1 parent 84c1140 commit e84e32e
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions typescript/cli/src/deploy/core.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { confirm } from '@inquirer/prompts';
import { ethers } from 'ethers';

import { IRegistry } from '@hyperlane-xyz/registry';
import { ChainAddresses, IRegistry } from '@hyperlane-xyz/registry';
import {
ChainMap,
ChainName,
Expand Down Expand Up @@ -51,6 +51,8 @@ import {
runPreflightChecksForChains,
} from './utils.js';

const CONTRACT_CACHE_EXCLUSIONS = ['interchainGasPaymaster'];

/**
* Executes the core deploy command.
*/
Expand Down Expand Up @@ -235,7 +237,8 @@ async function executeDeploy({
logBlue('All systems ready, captain! Beginning deployment...');
const { signer, multiProvider, registry } = context;

const chainAddresses = await registry.getAddresses();
let chainAddresses = await registry.getAddresses();
chainAddresses = filterAddressesToCache(chainAddresses);

const owner = await signer.getAddress();
let artifacts: HyperlaneAddressesMap<any> = {};
Expand Down Expand Up @@ -303,6 +306,20 @@ async function executeDeploy({
logBlue('Deployment is complete!');
}

function filterAddressesToCache(addressesMap: ChainMap<ChainAddresses>) {
// Filter out the certain addresses that must always be
// deployed when deploying to a PI chain.
// See https://github.com/hyperlane-xyz/hyperlane-monorepo/pull/2983
// And https://github.com/hyperlane-xyz/hyperlane-monorepo/pull/3183
return objMap(addressesMap, (_chain, addresses) =>
objFilter(
addresses,
(contract, _address): _address is string =>
!CONTRACT_CACHE_EXCLUSIONS.includes(contract),
),
);
}

function buildIsmConfig(
owner: Address,
local: ChainName,
Expand Down

0 comments on commit e84e32e

Please sign in to comment.