From 3f013d1d8df61ee716fae5a8e79eeefe0150b335 Mon Sep 17 00:00:00 2001 From: Trevor Porter Date: Mon, 25 Nov 2024 14:41:16 +0000 Subject: [PATCH] chore: transfer ownership for cbBTC warp deploy on Flow <> Ethereum (#4893) ### Description - Transfers ownership of the cbBTC warp route between flow and ethereum - A fix to ensure that proxy admin ownership is set ### Drive-by changes - a driveby to prevent rebuilding the multiprovider tons of times in the check warp deploy script ### Related issues ### Backward compatibility ### Testing --- .../getEthereumFlowCbBTCWarpConfig.ts | 15 +++++++++------ typescript/infra/scripts/check/check-utils.ts | 7 ++++++- .../infra/scripts/check/check-warp-deploy.ts | 7 +++++++ typescript/infra/src/config/environment.ts | 4 +++- 4 files changed, 25 insertions(+), 8 deletions(-) diff --git a/typescript/infra/config/environments/mainnet3/warp/configGetters/getEthereumFlowCbBTCWarpConfig.ts b/typescript/infra/config/environments/mainnet3/warp/configGetters/getEthereumFlowCbBTCWarpConfig.ts index 3a1cd937ee..3c33919e1c 100644 --- a/typescript/infra/config/environments/mainnet3/warp/configGetters/getEthereumFlowCbBTCWarpConfig.ts +++ b/typescript/infra/config/environments/mainnet3/warp/configGetters/getEthereumFlowCbBTCWarpConfig.ts @@ -12,11 +12,14 @@ import { RouterConfigWithoutOwner, tokens, } from '../../../../../src/config/warp.js'; -import { DEPLOYER } from '../../owners.js'; -// Keep on our deployer for now until we get an address from Flow -const owner = DEPLOYER; -const ownerConfig = getOwnerConfigForAddress(owner); +// Flow team Safe +const ethereumOwner = '0x58C3FB862a4F5f038C24F8506BE378e9415c5B6C'; +const ethereumOwnerConfig = getOwnerConfigForAddress(ethereumOwner); + +// Flow team Safe +const flowOwner = '0xa507DFccA02727B46cBdC600C57E89b2b55E5330'; +const flowOwnerConfig = getOwnerConfigForAddress(flowOwner); export const getEthereumFlowCbBTCWarpConfig = async ( routerConfig: ChainMap, @@ -24,7 +27,7 @@ export const getEthereumFlowCbBTCWarpConfig = async ( ): Promise> => { const ethereum: TokenRouterConfig = { ...routerConfig.ethereum, - ...ownerConfig, + ...ethereumOwnerConfig, type: TokenType.collateral, token: tokens.ethereum.cbBTC, interchainSecurityModule: ethers.constants.AddressZero, @@ -32,7 +35,7 @@ export const getEthereumFlowCbBTCWarpConfig = async ( const flowmainnet: TokenRouterConfig = { ...routerConfig.flowmainnet, - ...ownerConfig, + ...flowOwnerConfig, type: TokenType.synthetic, interchainSecurityModule: ethers.constants.AddressZero, }; diff --git a/typescript/infra/scripts/check/check-utils.ts b/typescript/infra/scripts/check/check-utils.ts index 5925832fbd..bac0229f57 100644 --- a/typescript/infra/scripts/check/check-utils.ts +++ b/typescript/infra/scripts/check/check-utils.ts @@ -14,6 +14,7 @@ import { InterchainAccountConfig, InterchainQuery, InterchainQueryChecker, + MultiProvider, attachContractsMapAndGetForeignDeployments, hypERC20factories, proxiedFactories, @@ -72,9 +73,13 @@ export async function getGovernor( chains?: string[], fork?: string, govern?: boolean, + multiProvider: MultiProvider | undefined = undefined, ) { const envConfig = getEnvironmentConfig(environment); - let multiProvider = await envConfig.getMultiProvider(); + // If the multiProvider is not passed in, get it from the environment + if (!multiProvider) { + multiProvider = await envConfig.getMultiProvider(); + } // must rotate to forked provider before building core contracts if (fork) { diff --git a/typescript/infra/scripts/check/check-warp-deploy.ts b/typescript/infra/scripts/check/check-warp-deploy.ts index aa51c70165..f32d53c2b0 100644 --- a/typescript/infra/scripts/check/check-warp-deploy.ts +++ b/typescript/infra/scripts/check/check-warp-deploy.ts @@ -4,6 +4,7 @@ import { Gauge, Registry } from 'prom-client'; import { warpConfigGetterMap } from '../../config/warp.js'; import { submitMetrics } from '../../src/utils/metrics.js'; import { Modules } from '../agent-utils.js'; +import { getEnvironmentConfig } from '../core-utils.js'; import { getCheckWarpDeployArgs, @@ -16,6 +17,10 @@ async function main() { const { environment, asDeployer, chains, fork, context, pushMetrics } = await getCheckWarpDeployArgs().argv; + const envConfig = getEnvironmentConfig(environment); + // Get the multiprovider once to avoid recreating it for each warp route + const multiProvider = await envConfig.getMultiProvider(); + const metricsRegister = new Registry(); const checkerViolationsGauge = new Gauge( getCheckerViolationsGaugeObj(metricsRegister), @@ -38,6 +43,8 @@ async function main() { warpRouteId, chains, fork, + false, + multiProvider, ); await governor.check(); diff --git a/typescript/infra/src/config/environment.ts b/typescript/infra/src/config/environment.ts index ecbf1030ab..90761e1adc 100644 --- a/typescript/infra/src/config/environment.ts +++ b/typescript/infra/src/config/environment.ts @@ -109,6 +109,8 @@ export function getOwnerConfigForAddress(owner: string): OwnableConfig { return { owner, // To ensure that any other overrides aren't applied - ownerOverrides: {}, + ownerOverrides: { + proxyAdmin: owner, + }, }; }