Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: core deploy apply admin proxy ownership fixes #4767

Merged
merged 36 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
c675dbb
feat(sdk): updated the RouterConfigSchema to have an optional proxyAd…
xeno097 Oct 21, 2024
b978591
refactor(sdk): defined the DeployedOwnableConfig and DeployedOwnableS…
xeno097 Oct 21, 2024
747b008
feat(sdk): updated the EvmWarpReader to add a fetchAdminProxyData met…
xeno097 Oct 21, 2024
85843da
feat(sdk): added the updateProxyAdminOwnershipTxs method to the EvmE…
xeno097 Oct 21, 2024
a55dc01
feat(cli): implemented the setExistingProxyAdmin to promt users to us…
xeno097 Oct 21, 2024
e8e9fc0
Merge branch 'main' of github.com:hyperlane-xyz/hyperlane-monorepo in…
xeno097 Oct 21, 2024
b192810
Merge branch 'main' of github.com:hyperlane-xyz/hyperlane-monorepo in…
xeno097 Oct 22, 2024
50d2047
docs(changeset): Add optional proxy admin reuse in warp route deploym…
xeno097 Oct 22, 2024
552bbb5
chore: paul pr review suggestion
xeno097 Oct 22, 2024
8082d17
fix(sdk): fixed methdo cann for fetchProxyAdminConfig
xeno097 Oct 22, 2024
cf5f0aa
feat(cli): added proxy admin and ica router ownership configurability…
xeno097 Oct 23, 2024
9440e50
feat(sdk): updated the EvmCoreModule.deploy method to check if the co…
xeno097 Oct 23, 2024
a8f4683
Merge branch 'main' of github.com:hyperlane-xyz/hyperlane-monorepo in…
xeno097 Oct 23, 2024
62c2067
chore: lee pr review changes + e2e test fix for warp route apply
xeno097 Oct 24, 2024
a03e1d0
Merge branch 'main' of github.com:hyperlane-xyz/hyperlane-monorepo in…
xeno097 Oct 24, 2024
c59ad8b
fix(sdk): fixed deriveTokenMetadata return value to exlcude fields no…
xeno097 Oct 24, 2024
7fc834d
Merge branch 'main' of github.com:hyperlane-xyz/hyperlane-monorepo in…
xeno097 Oct 24, 2024
7c5d84d
Merge branch 'xeno/warp-deploy-apply-ownership-fixes' of github.com:h…
xeno097 Oct 24, 2024
e396abc
feat(sdk): updated the EvmCoreReader to fetch the admin proxy data fo…
xeno097 Oct 24, 2024
cca3416
refactor(sdk): implemented the proxyAdminOwnershipUpdateTxs to dedup …
xeno097 Oct 25, 2024
1c8c682
test(cli): implemented testing utils for core commands testing
xeno097 Oct 25, 2024
3623d06
refactor(sdk,infra): remvoed duplicated impls of randomAddress
xeno097 Oct 25, 2024
86178c9
test(cli): updated the test e2e script to also run a anvil 1 chain on…
xeno097 Oct 25, 2024
cdadfe4
test(cli): added e2e tests for the hyperlane core commands
xeno097 Oct 25, 2024
16f9b46
Merge branch 'main' of github.com:hyperlane-xyz/hyperlane-monorepo in…
xeno097 Oct 25, 2024
7c48117
Merge branch 'main' of github.com:hyperlane-xyz/hyperlane-monorepo in…
xeno097 Oct 25, 2024
300af54
Merge branch 'xeno/warp-deploy-apply-ownership-fixes' of github.com:h…
xeno097 Oct 25, 2024
46c1dfb
refactor(cli): removed ica router proxy admin setting from core init …
xeno097 Oct 25, 2024
d58f6a7
docs(changeset): Add support for updating the mailbox proxy admin owner
xeno097 Oct 25, 2024
4a7798d
Merge branch 'main' of github.com:hyperlane-xyz/hyperlane-monorepo in…
xeno097 Nov 1, 2024
1e7c304
chore: fix main merge dup code
xeno097 Nov 1, 2024
872cb39
chore: lee pr changes
xeno097 Nov 1, 2024
f204163
test: maybe fix e2e test issues
xeno097 Nov 2, 2024
30cd02e
feat(sdk,cli): added logic to update proxy admin contract + test
xeno097 Nov 4, 2024
7798c00
fix: maybe fix e2e test part 3
xeno097 Nov 4, 2024
52936e1
Merge branch 'main' of github.com:hyperlane-xyz/hyperlane-monorepo in…
xeno097 Nov 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat(cli): implemented the setExistingProxyAdmin to promt users to us…
…e an already existing proxy admi ncontract for deployments
  • Loading branch information
xeno097 committed Oct 21, 2024
commit a55dc016ba1d0a009d10917625c727992fd68fd3
21 changes: 19 additions & 2 deletions typescript/cli/src/config/warp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { stringify as yamlStringify } from 'yaml';

import {
ChainMap,
DeployedOwnableConfig,
IsmConfig,
IsmType,
MailboxClientConfig,
Expand All @@ -28,7 +29,10 @@ import {
readYamlOrJson,
writeYamlOrJson,
} from '../utils/files.js';
import { detectAndConfirmOrPrompt } from '../utils/input.js';
import {
detectAndConfirmOrPrompt,
setExistingProxyAdmin,
} from '../utils/input.js';

import { createAdvancedIsmConfig } from './ism.js';

Expand Down Expand Up @@ -129,7 +133,9 @@ export async function createWarpRouteDeployConfig({
chainMetadata: context.chainMetadata,
message: 'Select chains to connect',
requireNumber: 1,
requiresConfirmation: true,
// If the user supplied the --yes flag we skip asking selection
// confirmation
requiresConfirmation: !context.skipConfirmation,
});

const result: WarpRouteDeployConfig = {};
Expand All @@ -147,6 +153,12 @@ export async function createWarpRouteDeployConfig({
message: `Could not retrieve mailbox address from the registry for chain "${chain}". Please enter a valid mailbox address:`,
}));

const proxyAdmin: DeployedOwnableConfig | undefined =
// default to deploying a new ProxyAdmin if the user supplied the --yes flag
!context.skipConfirmation
? await setExistingProxyAdmin(context, chain)
: undefined;

/**
* The logic from the cli is as follows:
* --advanced flag is provided: the user will have to build their own configuration using the available ISM types
Expand Down Expand Up @@ -190,6 +202,7 @@ export async function createWarpRouteDeployConfig({
mailbox,
type,
owner,
proxyAdmin,
isNft,
interchainSecurityModule,
token: await input({
Expand All @@ -203,6 +216,7 @@ export async function createWarpRouteDeployConfig({
type,
owner,
isNft,
proxyAdmin,
collateralChainName: '', // This will be derived correctly by zod.parse() below
interchainSecurityModule,
};
Expand All @@ -216,6 +230,7 @@ export async function createWarpRouteDeployConfig({
mailbox,
type,
owner,
proxyAdmin,
isNft,
interchainSecurityModule,
token: await input({
Expand All @@ -230,6 +245,7 @@ export async function createWarpRouteDeployConfig({
mailbox,
type,
owner,
proxyAdmin,
isNft,
interchainSecurityModule,
token: await input({
Expand All @@ -242,6 +258,7 @@ export async function createWarpRouteDeployConfig({
mailbox,
type,
owner,
proxyAdmin,
isNft,
interchainSecurityModule,
};
Expand Down
36 changes: 36 additions & 0 deletions typescript/cli/src/utils/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ import type { PartialDeep } from '@inquirer/type';
import ansiEscapes from 'ansi-escapes';
import chalk from 'chalk';

import { ProxyAdmin__factory } from '@hyperlane-xyz/core';
import { ChainName, DeployedOwnableConfig } from '@hyperlane-xyz/sdk';
import { isAddress } from '@hyperlane-xyz/utils';

import { CommandContext } from '../context/types.js';
import { logGray } from '../logger.js';

import { indentYamlOrJson } from './files.js';
Expand Down Expand Up @@ -72,6 +77,37 @@ export async function inputWithInfo({
return answer;
}

/**
* Prompts the user to optionally set an existing ProxyAdmin contract address to be used in a WarpToken deployment.
*/
export async function setExistingProxyAdmin(
context: CommandContext,
chain: ChainName,
): Promise<DeployedOwnableConfig | undefined> {
const useExistingProxy = await confirm({
message: `Use an existing Proxy Admin contract for the warp route deployment on chain "${chain}"?`,
});

if (!useExistingProxy) {
return;
}

const proxyAdminAddress = await input({
message: `Please enter the address of the Proxy Admin contract to be used on chain "${chain}":`,
validate: isAddress,
});

const proxy = ProxyAdmin__factory.connect(
proxyAdminAddress,
context.multiProvider.getProvider(chain),
);
const ownerAddress = await proxy.owner();
return {
address: proxyAdminAddress,
owner: ownerAddress,
};
}

/**
* Searchable checkbox code
*
Expand Down
1 change: 1 addition & 0 deletions typescript/sdk/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export { HyperlaneProxyFactoryDeployer } from './deploy/HyperlaneProxyFactoryDep
export {
CheckerViolation,
OwnableConfig,
DeployedOwnableConfig,
OwnerViolation,
ProxyAdminViolation,
ViolationType,
Expand Down