chore(infra): Remove RpcConsensusType usage in infra now that SmartProvider is used instead (#3882)

### Description

Removed references to RpcConsensusType where TS-based providers are used
in infra

<!--
What's included in this PR?
-->

### Drive-by changes

<!--
Are there any minor or drive-by changes also included?
-->

### Related issues

<!--
- Fixes #[issue number here]
-->

### Backward compatibility

<!--
Are these changes backward compatible? Are there any infrastructure
implications, e.g. changes that would prohibit deploying older commits
using this infra tooling?

Yes/No
-->

### Testing

<!--
What kind of testing have these changes undergone?

None/Manual/Unit Tests
-->
pull/3900/head
Mohammed Hussan 5 months ago committed by GitHub
parent 554f875ebf
commit efa9025f5e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 3
      typescript/infra/config/environments/mainnet3/funding.ts
  2. 4
      typescript/infra/config/environments/mainnet3/helloworld.ts
  3. 2
      typescript/infra/config/environments/mainnet3/index.ts
  4. 2
      typescript/infra/config/environments/mainnet3/liquidityLayer.ts
  5. 3
      typescript/infra/config/environments/testnet4/funding.ts
  6. 4
      typescript/infra/config/environments/testnet4/helloworld.ts
  7. 2
      typescript/infra/config/environments/testnet4/index.ts
  8. 3
      typescript/infra/config/environments/testnet4/middleware.ts
  9. 4
      typescript/infra/helm/helloworld-kathy/templates/_helpers.tpl
  10. 4
      typescript/infra/helm/key-funder/templates/cron-job.yaml
  11. 4
      typescript/infra/helm/liquidity-layer-relayers/templates/circle-relayer-deployment.yaml
  12. 4
      typescript/infra/helm/liquidity-layer-relayers/templates/portal-relayer-deployment.yaml
  13. 1
      typescript/infra/scripts/agent-utils.ts
  14. 1
      typescript/infra/scripts/agents/update-agent-config.ts
  15. 7
      typescript/infra/scripts/funding/fund-keys-from-deployer.ts
  16. 13
      typescript/infra/scripts/helloworld/kathy.ts
  17. 5
      typescript/infra/scripts/helloworld/utils.ts
  18. 25
      typescript/infra/src/config/chain.ts
  19. 2
      typescript/infra/src/config/environment.ts
  20. 3
      typescript/infra/src/config/funding.ts
  21. 3
      typescript/infra/src/config/helloworld/types.ts
  22. 3
      typescript/infra/src/config/middleware.ts
  23. 1
      typescript/infra/src/funding/key-funder.ts
  24. 1
      typescript/infra/src/helloworld/kathy.ts
  25. 1
      typescript/infra/src/middleware/liquidity-layer-relayer.ts

@ -1,5 +1,3 @@
import { RpcConsensusType } from '@hyperlane-xyz/sdk';
import { KeyFunderConfig } from '../../../src/config/funding.js';
import { Role } from '../../../src/roles.js';
import { Contexts } from '../../contexts.js';
@ -23,7 +21,6 @@ export const keyFunderConfig: KeyFunderConfig = {
[Contexts.Hyperlane]: [Role.Relayer, Role.Kathy],
[Contexts.ReleaseCandidate]: [Role.Relayer, Role.Kathy],
},
connectionType: RpcConsensusType.Fallback,
// desired balance config
desiredBalancePerChain: {
arbitrum: '0.5',

@ -1,5 +1,3 @@
import { RpcConsensusType } from '@hyperlane-xyz/sdk';
import {
HelloWorldConfig,
HelloWorldKathyRunMode,
@ -26,7 +24,6 @@ export const hyperlane: HelloWorldConfig = {
},
messageSendTimeout: 1000 * 60 * 8, // 8 min
messageReceiptTimeout: 1000 * 60 * 20, // 20 min
connectionType: RpcConsensusType.Fallback,
cyclesBetweenEthereumMessages: 1, // Skip 1 cycle of Ethereum, i.e. send/receive Ethereum messages every 5 days (not great since we still send like 12 in that cycle)
},
};
@ -46,7 +43,6 @@ export const releaseCandidate: HelloWorldConfig = {
},
messageSendTimeout: 1000 * 60 * 8, // 8 min
messageReceiptTimeout: 1000 * 60 * 20, // 20 min
connectionType: RpcConsensusType.Fallback,
},
};

@ -1,5 +1,4 @@
import { IRegistry } from '@hyperlane-xyz/registry';
import { RpcConsensusType } from '@hyperlane-xyz/sdk';
import {
getKeysForRole,
@ -42,7 +41,6 @@ export const environment: EnvironmentConfig = {
getMultiProvider: async (
context: Contexts = Contexts.Hyperlane,
role: Role = Role.Deployer,
_connectionType?: RpcConsensusType,
useSecrets?: boolean,
) =>
getMultiProviderForRole(

@ -2,7 +2,6 @@ import {
BridgeAdapterConfig,
BridgeAdapterType,
ChainMap,
RpcConsensusType,
} from '@hyperlane-xyz/sdk';
import { LiquidityLayerRelayerConfig } from '../../../src/config/middleware.js';
@ -50,5 +49,4 @@ export const relayerConfig: LiquidityLayerRelayerConfig = {
namespace: environment,
prometheusPushGateway:
'http://prometheus-prometheus-pushgateway.monitoring.svc.cluster.local:9091',
connectionType: RpcConsensusType.Single,
};

@ -1,5 +1,3 @@
import { RpcConsensusType } from '@hyperlane-xyz/sdk';
import { KeyFunderConfig } from '../../../src/config/funding.js';
import { Role } from '../../../src/roles.js';
import { Contexts } from '../../contexts.js';
@ -23,7 +21,6 @@ export const keyFunderConfig: KeyFunderConfig = {
[Contexts.Hyperlane]: [Role.Relayer, Role.Kathy],
[Contexts.ReleaseCandidate]: [Role.Relayer, Role.Kathy],
},
connectionType: RpcConsensusType.Fallback,
// desired balance config
desiredBalancePerChain: {
alfajores: '5',

@ -1,5 +1,3 @@
import { RpcConsensusType } from '@hyperlane-xyz/sdk';
import {
HelloWorldConfig,
HelloWorldKathyRunMode,
@ -26,7 +24,6 @@ export const hyperlaneHelloworld: HelloWorldConfig = {
},
messageSendTimeout: 1000 * 60 * 10, // 10 min
messageReceiptTimeout: 1000 * 60 * 20, // 20 min
connectionType: RpcConsensusType.Fallback,
},
};
@ -45,7 +42,6 @@ export const releaseCandidateHelloworld: HelloWorldConfig = {
},
messageSendTimeout: 1000 * 60 * 8, // 8 min
messageReceiptTimeout: 1000 * 60 * 20, // 20 min
connectionType: RpcConsensusType.Fallback,
},
};

@ -1,5 +1,4 @@
import { IRegistry } from '@hyperlane-xyz/registry';
import { RpcConsensusType } from '@hyperlane-xyz/sdk';
import { objMerge } from '@hyperlane-xyz/utils';
import {
@ -44,7 +43,6 @@ export const environment: EnvironmentConfig = {
getMultiProvider: async (
context: Contexts = Contexts.Hyperlane,
role: Role = Role.Deployer,
_connectionType?: RpcConsensusType,
useSecrets?: boolean,
) =>
getMultiProviderForRole(

@ -1,5 +1,3 @@
import { RpcConsensusType } from '@hyperlane-xyz/sdk';
import { LiquidityLayerRelayerConfig } from '../../../src/config/middleware.js';
import { environment } from './chains.js';
@ -12,5 +10,4 @@ export const liquidityLayerRelayerConfig: LiquidityLayerRelayerConfig = {
namespace: environment,
prometheusPushGateway:
'http://prometheus-prometheus-pushgateway.monitoring.svc.cluster.local:9091',
connectionType: RpcConsensusType.Single,
};

@ -91,10 +91,6 @@ The helloworld-kathy container
{{- if .Values.hyperlane.cycleOnce }}
- --cycle-once
{{- end }}
{{- if .Values.hyperlane.connectionType }}
- --connection-type
- {{ .Values.hyperlane.connectionType }}
{{- end }}
{{- if .Values.hyperlane.cyclesBetweenEthereumMessages }}
- --cycles-between-ethereum-messages
- "{{ .Values.hyperlane.cyclesBetweenEthereumMessages }}"

@ -29,10 +29,6 @@ spec:
- --contexts-and-roles
- {{ $context }}={{ join "," $roles }}
{{- end }}
{{- if .Values.hyperlane.connectionType }}
- --connection-type
- {{ .Values.hyperlane.connectionType }}
{{- end }}
{{- range $chain, $balance := .Values.hyperlane.desiredBalancePerChain }}
- --desired-balance-per-chain
- {{ $chain }}={{ $balance }}

@ -21,10 +21,6 @@ spec:
- ./typescript/infra/scripts/middleware/circle-relayer.ts
- -e
- {{ .Values.hyperlane.runEnv }}
{{- if .Values.hyperlane.connectionType }}
- --connection-type
- {{ .Values.hyperlane.connectionType }}
{{- end }}
envFrom:
- secretRef:
name: liquidity-layer-env-var-secret

@ -21,10 +21,6 @@ spec:
- ./typescript/infra/scripts/middleware/portal-relayer.ts
- -e
- {{ .Values.hyperlane.runEnv }}
{{- if .Values.hyperlane.connectionType }}
- --connection-type
- {{ .Values.hyperlane.connectionType }}
{{- end }}
envFrom:
- secretRef:
name: liquidity-layer-env-var-secret

@ -9,7 +9,6 @@ import {
CoreConfig,
MultiProtocolProvider,
MultiProvider,
RpcConsensusType,
collectValidators,
} from '@hyperlane-xyz/sdk';
import {

@ -7,7 +7,6 @@ async function main() {
const envConfig = getEnvironmentConfig(environment);
let multiProvider = await envConfig.getMultiProvider(
undefined,
undefined,
undefined,
// Don't use secrets

@ -9,7 +9,6 @@ import {
ChainName,
HyperlaneIgp,
MultiProvider,
RpcConsensusType,
} from '@hyperlane-xyz/sdk';
import { Address, objFilter, objMap, rootLogger } from '@hyperlane-xyz/utils';
@ -177,11 +176,6 @@ async function main() {
)
.coerce('desired-kathy-balance-per-chain', parseBalancePerChain)
.string('connection-type')
.describe('connection-type', 'The provider connection type to use for RPCs')
.default('connection-type', RpcConsensusType.Single)
.demandOption('connection-type')
.boolean('skip-igp-claim')
.describe('skip-igp-claim', 'If true, never claims funds from the IGP')
.default('skip-igp-claim', false).argv;
@ -191,7 +185,6 @@ async function main() {
const multiProvider = await config.getMultiProvider(
Contexts.Hyperlane, // Always fund from the hyperlane context
Role.Deployer, // Always fund from the deployer
argv.connectionType,
);
let contextFunders: ContextFunder[];

@ -11,7 +11,6 @@ import {
MultiProtocolCore,
MultiProvider,
ProviderType,
RpcConsensusType,
TypedTransactionReceipt,
resolveOrDeployAccountOwner,
} from '@hyperlane-xyz/sdk';
@ -128,16 +127,6 @@ function getKathyArgs() {
chainStrs.map((chainStr: string) => assertChain(chainStr)),
)
.string('connection-type')
.describe('connection-type', 'The provider connection type to use for RPCs')
.default('connection-type', RpcConsensusType.Single)
.choices('connection-type', [
RpcConsensusType.Single,
RpcConsensusType.Quorum,
RpcConsensusType.Fallback,
])
.demandOption('connection-type')
.number('cycles-between-ethereum-messages')
.describe(
'cycles-between-ethereum-messages',
@ -156,7 +145,6 @@ async function main(): Promise<boolean> {
fullCycleTime,
messageSendTimeout,
messageReceiptTimeout,
connectionType,
cyclesBetweenEthereumMessages,
} = await getKathyArgs();
@ -173,7 +161,6 @@ async function main(): Promise<boolean> {
context,
Role.Kathy,
undefined,
connectionType,
);
const appChains = app.chains();

@ -8,7 +8,6 @@ import {
MultiProtocolCore,
MultiProtocolProvider,
MultiProvider,
RpcConsensusType,
attachContractsMap,
attachContractsMapAndGetForeignDeployments,
filterChainMapToProtocol,
@ -28,12 +27,10 @@ export async function getHelloWorldApp(
context: Contexts,
keyRole: Role,
keyContext: Contexts = context,
connectionType: RpcConsensusType = RpcConsensusType.Single,
) {
const multiProvider: MultiProvider = await coreConfig.getMultiProvider(
keyContext,
keyRole,
connectionType,
);
const helloworldConfig = getHelloWorldConfig(coreConfig, context);
@ -61,12 +58,10 @@ export async function getHelloWorldMultiProtocolApp(
context: Contexts,
keyRole: Role,
keyContext: Contexts = context,
connectionType: RpcConsensusType = RpcConsensusType.Single,
) {
const multiProvider: MultiProvider = await coreConfig.getMultiProvider(
keyContext,
keyRole,
connectionType,
);
const envAddresses = getEnvAddresses(coreConfig.environment);

@ -8,8 +8,6 @@ import {
ChainName,
HyperlaneSmartProvider,
ProviderRetryOptions,
RpcConsensusType,
RpcUrl,
} from '@hyperlane-xyz/sdk';
import { ProtocolType, objFilter, objMerge } from '@hyperlane-xyz/utils';
@ -26,7 +24,6 @@ export const defaultRetry: ProviderRetryOptions = {
export async function fetchProvider(
chainName: ChainName,
connectionType: RpcConsensusType = RpcConsensusType.Single,
): Promise<providers.Provider> {
const chainMetadata = getChain(chainName);
if (!chainMetadata) {
@ -38,22 +35,12 @@ export async function fetchProvider(
throw Error(`No RPC URLs found for chain: ${chainName}`);
}
if (connectionType === RpcConsensusType.Single) {
return HyperlaneSmartProvider.fromRpcUrl(chainId, rpcData[0], defaultRetry);
} else if (
connectionType === RpcConsensusType.Quorum ||
connectionType === RpcConsensusType.Fallback
) {
return new HyperlaneSmartProvider(
chainId,
rpcData.map((url) => ({ http: url })),
undefined,
// disable retry for quorum
connectionType === RpcConsensusType.Fallback ? defaultRetry : undefined,
);
} else {
throw Error(`Unsupported connectionType: ${connectionType}`);
}
return new HyperlaneSmartProvider(
chainId,
rpcData.map((url) => ({ http: url })),
undefined,
defaultRetry,
);
}
export function getChainMetadatas(chains: Array<ChainName>) {

@ -9,7 +9,6 @@ import {
MultiProtocolProvider,
MultiProvider,
OwnableConfig,
RpcConsensusType,
} from '@hyperlane-xyz/sdk';
import { objKeys } from '@hyperlane-xyz/utils';
@ -54,7 +53,6 @@ export type EnvironmentConfig = {
getMultiProvider: (
context?: Contexts,
role?: Role,
connectionType?: RpcConsensusType,
useSecrets?: boolean,
) => Promise<MultiProvider>;
getKeys: (

@ -1,4 +1,4 @@
import { ChainMap, RpcConsensusType } from '@hyperlane-xyz/sdk';
import { ChainMap } from '@hyperlane-xyz/sdk';
import { Contexts } from '../../config/contexts.js';
import { FundableRole, Role } from '../roles.js';
@ -20,7 +20,6 @@ export interface KeyFunderConfig {
contextsAndRolesToFund: ContextAndRolesMap;
cyclesBetweenEthereumMessages?: number;
prometheusPushGateway: string;
connectionType: RpcConsensusType;
desiredBalancePerChain: ChainMap<string>;
desiredKathyBalancePerChain: ChainMap<string>;
}

@ -1,4 +1,4 @@
import { ChainMap, ChainName, RpcConsensusType } from '@hyperlane-xyz/sdk';
import { ChainMap, ChainName } from '@hyperlane-xyz/sdk';
import { DockerConfig } from '../agent/agent.js';
@ -29,7 +29,6 @@ export interface HelloWorldKathyConfig {
messageReceiptTimeout: number;
// Which type of provider to use
connectionType: RpcConsensusType;
// How many cycles to skip between a cycles that send messages to/from Ethereum. Defaults to 0.
cyclesBetweenEthereumMessages?: number;
}

@ -1,10 +1,7 @@
import { RpcConsensusType } from '@hyperlane-xyz/sdk';
import { DockerConfig } from './agent/agent.js';
export interface LiquidityLayerRelayerConfig {
docker: DockerConfig;
namespace: string;
connectionType: RpcConsensusType.Single | RpcConsensusType.Quorum;
prometheusPushGateway: string;
}

@ -48,7 +48,6 @@ function getKeyFunderHelmValues(
chains: agentConfig.environmentChainNames,
contextFundingFrom: keyFunderConfig.contextFundingFrom,
contextsAndRolesToFund: keyFunderConfig.contextsAndRolesToFund,
connectionType: keyFunderConfig.connectionType,
desiredBalancePerChain: keyFunderConfig.desiredBalancePerChain,
desiredKathyBalancePerChain: keyFunderConfig.desiredKathyBalancePerChain,
},

@ -85,7 +85,6 @@ function getHelloworldKathyHelmValues(
messageReceiptTimeout: kathyConfig.messageReceiptTimeout,
cycleOnce,
fullCycleTime,
connectionType: kathyConfig.connectionType,
cyclesBetweenEthereumMessages: kathyConfig.cyclesBetweenEthereumMessages,
},
image: {

@ -44,7 +44,6 @@ function getLiquidityLayerRelayerHelmValues(
runEnv: agentConfig.runEnv,
// Only used for fetching RPC urls as env vars
chains: agentConfig.contextChainNames,
connectionType: relayerConfig.connectionType,
},
image: {
repository: relayerConfig.docker.repo,

Loading…
Cancel
Save