From 9041183e5f26960b0d76597589052eb7a666552d Mon Sep 17 00:00:00 2001 From: Trevor Porter Date: Wed, 25 Oct 2023 17:05:45 +0100 Subject: [PATCH 01/38] Add neutron testnet --- .../config/environments/testnet4/chains.ts | 15 +++---- .../environments/testnet4/gas-oracle.ts | 2 + .../environments/testnet4/validators.ts | 15 +++++++ typescript/infra/package.json | 1 + typescript/infra/src/agents/gcp.ts | 16 ++++++++ typescript/infra/src/agents/key-utils.ts | 41 +++++++++++++++---- typescript/sdk/src/consts/chainMetadata.ts | 22 ++++++++++ typescript/sdk/src/consts/chains.ts | 1 + typescript/sdk/src/consts/multisigIsm.ts | 8 ++++ yarn.lock | 1 + 10 files changed, 106 insertions(+), 16 deletions(-) diff --git a/typescript/infra/config/environments/testnet4/chains.ts b/typescript/infra/config/environments/testnet4/chains.ts index 64ad786e04..0589b068b3 100644 --- a/typescript/infra/config/environments/testnet4/chains.ts +++ b/typescript/infra/config/environments/testnet4/chains.ts @@ -25,13 +25,14 @@ export const ethereumTestnetConfigs: ChainMap = { }; // Blessed non-Ethereum chains. -// export const nonEthereumTestnetConfigs: ChainMap = { -// solanadevnet: chainMetadata.solanadevnet, -// }; +export const nonEthereumTestnetConfigs: ChainMap = { + // solanadevnet: chainMetadata.solanadevnet, + neutrontestnet: chainMetadata.neutrontestnet, +}; export const testnetConfigs: ChainMap = { ...ethereumTestnetConfigs, - // ...nonEthereumTestnetConfigs, + ...nonEthereumTestnetConfigs, }; export type TestnetChains = keyof typeof testnetConfigs; @@ -43,11 +44,7 @@ export const environment = 'testnet4'; export const ethereumChainNames = Object.keys( ethereumTestnetConfigs, ) as TestnetChains[]; -const validatorChainNames = [ - ...supportedChainNames, - // chainMetadata.solanadevnet.name, - // chainMetadata.proteustestnet.name, -]; +const validatorChainNames = supportedChainNames; const relayerChainNames = validatorChainNames; export const agentChainNames: AgentChainNames = { diff --git a/typescript/infra/config/environments/testnet4/gas-oracle.ts b/typescript/infra/config/environments/testnet4/gas-oracle.ts index b173f4d3a5..7fda9ad6b1 100644 --- a/typescript/infra/config/environments/testnet4/gas-oracle.ts +++ b/typescript/infra/config/environments/testnet4/gas-oracle.ts @@ -30,6 +30,7 @@ const gasPrices: ChainMap = { polygonzkevmtestnet: ethers.utils.parseUnits('1', 'gwei'), chiado: ethers.utils.parseUnits('2', 'gwei'), // solanadevnet: ethers.BigNumber.from('28'), + neutrontestnet: ethers.utils.parseUnits('0.1', 'gwei'), }; // Used to categorize rarity of testnet tokens & approximate exchange rates. @@ -64,6 +65,7 @@ const chainTokenRarity: ChainMap = { polygonzkevmtestnet: Rarity.Common, chiado: Rarity.Common, // solanadevnet: Rarity.Common, + neutrontestnet: Rarity.Common, }; // Gets the "value" of a testnet chain diff --git a/typescript/infra/config/environments/testnet4/validators.ts b/typescript/infra/config/environments/testnet4/validators.ts index 89271fbb54..52349da98d 100644 --- a/typescript/infra/config/environments/testnet4/validators.ts +++ b/typescript/infra/config/environments/testnet4/validators.ts @@ -311,5 +311,20 @@ export const validatorChainConfig = ( // 'solanadevnet', // ), // }, + neutrontestnet: { + interval: 5, + reorgPeriod: chainMetadata.neutrontestnet.blocks!.reorgPeriod!, + validators: validatorsConfig( + { + [Contexts.Hyperlane]: [ + '0x5d2a99d67cd294a821de4fb25da6901ea8f89814', + '0xb57486243ce3bb3c38c50a582b8bbd20cb393589', + '0x661faee997654d14ead4ae48035883f05c3150cf', + ], + [Contexts.ReleaseCandidate]: [], + }, + 'neutrontestnet', + ), + }, }; }; diff --git a/typescript/infra/package.json b/typescript/infra/package.json index 1cdba73ed7..4cd023485c 100644 --- a/typescript/infra/package.json +++ b/typescript/infra/package.json @@ -7,6 +7,7 @@ "@aws-sdk/client-iam": "^3.74.0", "@aws-sdk/client-kms": "3.48.0", "@aws-sdk/client-s3": "^3.74.0", + "@cosmjs/amino": "^0.31.3", "@eth-optimism/sdk": "^1.7.0", "@ethersproject/experimental": "^5.7.0", "@ethersproject/hardware-wallets": "^5.7.0", diff --git a/typescript/infra/src/agents/gcp.ts b/typescript/infra/src/agents/gcp.ts index a2f6748880..f483bdd1be 100644 --- a/typescript/infra/src/agents/gcp.ts +++ b/typescript/infra/src/agents/gcp.ts @@ -1,3 +1,8 @@ +import { + encodeSecp256k1Pubkey, + pubkeyToAddress, + rawSecp256k1PubkeyToRawAddress, +} from '@cosmjs/amino'; import { Keypair } from '@solana/web3.js'; import { Wallet, ethers } from 'ethers'; @@ -101,6 +106,17 @@ export class AgentGCPKey extends CloudAgentKey { return Keypair.fromSeed( Buffer.from(strip0x(this.privateKey), 'hex'), ).publicKey.toBase58(); + case ProtocolType.CosmWasm: + const compressedPubkey = ethers.utils.computePublicKey( + this.privateKey, + true, + ); + const encodedPubkey = encodeSecp256k1Pubkey( + new Uint8Array(Buffer.from(strip0x(compressedPubkey), 'hex')), + ); + // TODO support other prefixes? + // https://cosmosdrops.io/en/tools/bech32-converter is useful for converting to other prefixes. + return pubkeyToAddress(encodedPubkey, 'dual'); default: return undefined; } diff --git a/typescript/infra/src/agents/key-utils.ts b/typescript/infra/src/agents/key-utils.ts index afe3288e44..ba6efe4a25 100644 --- a/typescript/infra/src/agents/key-utils.ts +++ b/typescript/infra/src/agents/key-utils.ts @@ -96,25 +96,52 @@ export function getValidatorCloudAgentKeys( ): Array { // For each chainName, create validatorCount keys if (!agentConfig.validators) return []; + const validators = agentConfig.validators; return agentConfig.contextChainNames[Role.Validator] .filter((chainName) => !!validators.chains[chainName]) .flatMap((chainName) => - validators.chains[chainName].validators.map((_, index) => - getCloudAgentKey(agentConfig, Role.Validator, chainName, index), - ), - ); + validators.chains[chainName].validators.map((_, index) => { + const validatorKeys = []; + + // If AWS is enabled, we want to use AWS keys for the validator signing key + // that actually signs checkpoints. + if (agentConfig.aws) { + validatorKeys.push( + new AgentAwsKey(agentConfig, Role.Validator, chainName, index), + ); + } + + // If the chain is not an EVM chain, we also want to use GCP keys for + // self-announcing. This key won't actually sign checkpoints, just the self-announcement tx. + // We also want to use a GCP key if AWS is not enabled. + if (isNotEthereumProtocolChain(chainName) || !agentConfig.aws) { + validatorKeys.push( + new AgentGCPKey( + agentConfig.runEnv, + agentConfig.context, + Role.Validator, + chainName, + index, + ), + ); + } + + return validatorKeys; + }), + ) + .flat(); } export function getAllCloudAgentKeys( agentConfig: RootAgentConfig, ): Array { const keys = []; - if ((agentConfig.rolesWithKeys ?? []).includes(Role.Relayer)) + if (agentConfig.rolesWithKeys.includes(Role.Relayer)) keys.push(...getRelayerCloudAgentKeys(agentConfig)); - if ((agentConfig.rolesWithKeys ?? []).includes(Role.Validator)) + if (agentConfig.rolesWithKeys.includes(Role.Validator)) keys.push(...getValidatorCloudAgentKeys(agentConfig)); - if ((agentConfig.rolesWithKeys ?? []).includes(Role.Kathy)) + if (agentConfig.rolesWithKeys.includes(Role.Kathy)) keys.push(...getKathyCloudAgentKeys(agentConfig)); for (const role of agentConfig.rolesWithKeys) { diff --git a/typescript/sdk/src/consts/chainMetadata.ts b/typescript/sdk/src/consts/chainMetadata.ts index 1b7d753852..1cb22cf1d1 100644 --- a/typescript/sdk/src/consts/chainMetadata.ts +++ b/typescript/sdk/src/consts/chainMetadata.ts @@ -1005,6 +1005,27 @@ export const polygonzkevm: ChainMetadata = { }, }; +export const neutrontestnet: ChainMetadata = { + protocol: ProtocolType.Cosmos, + domainId: 33333, + chainId: 33333, + name: Chains.neutrontestnet, + displayName: 'Neutron Testnet', + displayNameShort: 'Neutron Testnet', + nativeToken: { + name: 'Neutron', + symbol: 'NTRN', + decimals: 6, + }, + blocks: { + confirmations: 1, + reorgPeriod: 0, + estimateBlockTime: 3, + }, + rpcUrls: [{ http: 'http://54.149.31.83:26657' }], + isTestnet: true, +}; + /** * Collection maps * @@ -1048,6 +1069,7 @@ export const chainMetadata: ChainMap = { solanatestnet, solanadevnet, nautilus, + neutrontestnet, }; export const chainIdToMetadata = Object.values(chainMetadata).reduce< diff --git a/typescript/sdk/src/consts/chains.ts b/typescript/sdk/src/consts/chains.ts index b73faf0a0c..65bd49820e 100644 --- a/typescript/sdk/src/consts/chains.ts +++ b/typescript/sdk/src/consts/chains.ts @@ -35,6 +35,7 @@ export enum Chains { proteustestnet = 'proteustestnet', solana = 'solana', solanadevnet = 'solanadevnet', + neutrontestnet = 'neutrontestnet', test1 = 'test1', test2 = 'test2', test3 = 'test3', diff --git a/typescript/sdk/src/consts/multisigIsm.ts b/typescript/sdk/src/consts/multisigIsm.ts index e6c9608e24..fadd9ba920 100644 --- a/typescript/sdk/src/consts/multisigIsm.ts +++ b/typescript/sdk/src/consts/multisigIsm.ts @@ -226,4 +226,12 @@ export const defaultMultisigIsmConfigs: ChainMap = { '0x967c5ecdf2625ae86580bd203b630abaaf85cd62', ], }, + neutrontestnet: { + threshold: 2, + validators: [ + '0x5d2a99d67cd294a821de4fb25da6901ea8f89814', + '0xb57486243ce3bb3c38c50a582b8bbd20cb393589', + '0x661faee997654d14ead4ae48035883f05c3150cf', + ], + }, }; diff --git a/yarn.lock b/yarn.lock index b2444c031c..dbcd6244a8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4166,6 +4166,7 @@ __metadata: "@aws-sdk/client-iam": ^3.74.0 "@aws-sdk/client-kms": 3.48.0 "@aws-sdk/client-s3": ^3.74.0 + "@cosmjs/amino": ^0.31.3 "@eth-optimism/sdk": ^1.7.0 "@ethersproject/experimental": ^5.7.0 "@ethersproject/hardware-wallets": ^5.7.0 From 4d0bc144b892a4f1365abedfcfc38218fb5eb4b4 Mon Sep 17 00:00:00 2001 From: Trevor Porter Date: Thu, 26 Oct 2023 09:55:21 +0100 Subject: [PATCH 02/38] Remove unnecessary reorgPeriod setting from infra for the Validator, the chain one is used now --- typescript/infra/scripts/agents/utils.ts | 11 +++++---- typescript/infra/src/agents/index.ts | 24 ++++++++++--------- typescript/infra/src/config/agent/relayer.ts | 8 +++---- .../infra/src/config/agent/validator.ts | 5 ++-- 4 files changed, 25 insertions(+), 23 deletions(-) diff --git a/typescript/infra/scripts/agents/utils.ts b/typescript/infra/scripts/agents/utils.ts index 607569a660..7196a086dc 100644 --- a/typescript/infra/scripts/agents/utils.ts +++ b/typescript/infra/scripts/agents/utils.ts @@ -7,6 +7,7 @@ import { import { EnvironmentConfig, RootAgentConfig } from '../../src/config'; import { Role } from '../../src/roles'; import { HelmCommand } from '../../src/utils/helm'; +import { sleep } from '../../src/utils/utils'; import { assertCorrectKubeContext, getArgs, @@ -33,6 +34,7 @@ export class AgentCli { switch (role) { case Role.Validator: for (const chain of this.agentConfig.contextChainNames[role]) { + if (chain !== 'neutrontestnet') continue; const key = `${role}-${chain}`; managers[key] = new ValidatorHelmManager(this.agentConfig, chain); } @@ -49,11 +51,10 @@ export class AgentCli { } if (this.dryRun) { - for (const m of Object.values(managers)) { - void m.helmValues().then((v) => { - console.log(JSON.stringify(v, null, 2)); - }); - } + const values = await Promise.all( + Object.values(managers).map(async (m) => m.helmValues()), + ); + console.log('Dry run values:\n', JSON.stringify(values, null, 2)); } for (const m of Object.values(managers)) { diff --git a/typescript/infra/src/agents/index.ts b/typescript/infra/src/agents/index.ts index 1d306963cc..23cb44091d 100644 --- a/typescript/infra/src/agents/index.ts +++ b/typescript/infra/src/agents/index.ts @@ -113,17 +113,24 @@ export abstract class AgentHelmManager { runEnv: this.environment, context: this.context, aws: !!this.config.aws, - chains: this.config.environmentChainNames.map((name) => ({ - name, - disabled: !this.config.contextChainNames[this.role].includes(name), - rpcConsensusType: this.rpcConsensusType(name), - })), + chains: this.config.environmentChainNames.map((chain) => { + const reorgPeriod = chainMetadata[chain].blocks?.reorgPeriod; + if (reorgPeriod === undefined) { + throw new Error(`No reorg period found for chain ${chain}`); + } + return { + name: chain, + disabled: !this.config.contextChainNames[this.role].includes(chain), + rpcConsensusType: this.rpcConsensusType(chain), + blocks: { reorgPeriod }, + }; + }), }, }; } rpcConsensusType(chain: ChainName): RpcConsensusType { - if (chainMetadata[chain].protocol == ProtocolType.Sealevel) { + if (chainMetadata[chain].protocol !== ProtocolType.Ethereum) { return RpcConsensusType.Single; } @@ -250,11 +257,6 @@ export class ValidatorHelmManager extends MultichainAgentHelmManager { const helmValues = await super.helmValues(); const cfg = await this.config.buildConfig(); - helmValues.hyperlane.chains.push({ - name: cfg.originChainName, - blocks: { reorgPeriod: cfg.reorgPeriod }, - }); - helmValues.hyperlane.validator = { enabled: true, configs: cfg.validators.map((c) => ({ diff --git a/typescript/infra/src/config/agent/relayer.ts b/typescript/infra/src/config/agent/relayer.ts index a4e4f2a1ee..813d5d03ea 100644 --- a/typescript/infra/src/config/agent/relayer.ts +++ b/typescript/infra/src/config/agent/relayer.ts @@ -96,11 +96,11 @@ export class RelayerConfigHelper extends AgentConfigHelper { return Object.fromEntries( this.contextChainNames[Role.Relayer].map((name) => { const chain = chainMetadata[name]; - // Sealevel chains always use hex keys - if (chain?.protocol == ProtocolType.Sealevel) { - return [name, { type: AgentSignerKeyType.Hex }]; - } else { + if (chain?.protocol === ProtocolType.Ethereum) { return [name, awsKey]; + } else { + // Non-ethereum chains always use hex keys + return [name, { type: AgentSignerKeyType.Hex }]; } }), ); diff --git a/typescript/infra/src/config/agent/validator.ts b/typescript/infra/src/config/agent/validator.ts index 380ebef111..4731f88000 100644 --- a/typescript/infra/src/config/agent/validator.ts +++ b/typescript/infra/src/config/agent/validator.ts @@ -33,7 +33,6 @@ export interface ValidatorBaseConfig { export interface ValidatorConfig { interval: number; - reorgPeriod: number; originChainName: ChainName; validators: Array<{ checkpointSyncer: CheckpointSyncerConfig; @@ -88,7 +87,6 @@ export class ValidatorConfigHelper extends AgentConfigHelper { async buildConfig(): Promise { return { interval: this.#chainConfig.interval, - reorgPeriod: this.#chainConfig.reorgPeriod, originChainName: this.chainName!, validators: await Promise.all( this.#chainConfig.validators.map((val, i) => @@ -123,8 +121,9 @@ export class ValidatorConfigHelper extends AgentConfigHelper { await awsUser.createIfNotExists(); await awsUser.createBucketIfNotExists(); - if (this.aws) + if (this.aws) { validator = (await awsUser.createKeyIfNotExists(this)).keyConfig; + } } else { console.warn( `Validator ${cfg.address}'s checkpoint syncer is not S3-based. Be sure this is a non-k8s-based environment!`, From 9c8382d23dd0d28bb0774cce8b5b1e6fe3289bba Mon Sep 17 00:00:00 2001 From: Trevor Porter Date: Thu, 26 Oct 2023 12:28:10 +0100 Subject: [PATCH 03/38] It aint pretty but it probably works --- .../templates/external-secret.yaml | 12 +++++-- .../templates/relayer-external-secret.yaml | 8 +++-- .../templates/validator-configmap.yaml | 3 +- .../templates/validator-external-secret.yaml | 7 ++-- typescript/infra/src/agents/index.ts | 4 ++- typescript/infra/src/config/agent/agent.ts | 6 +++- .../infra/src/config/agent/validator.ts | 35 ++++++++++++++++++- typescript/sdk/src/consts/chainMetadata.ts | 1 + typescript/sdk/src/metadata/agentConfig.ts | 10 ++++++ .../sdk/src/metadata/chainMetadataTypes.ts | 5 +++ 10 files changed, 80 insertions(+), 11 deletions(-) diff --git a/rust/helm/hyperlane-agent/templates/external-secret.yaml b/rust/helm/hyperlane-agent/templates/external-secret.yaml index 98a4bc3b29..5d0eae5ced 100644 --- a/rust/helm/hyperlane-agent/templates/external-secret.yaml +++ b/rust/helm/hyperlane-agent/templates/external-secret.yaml @@ -28,17 +28,25 @@ spec: {{- range .Values.hyperlane.chains }} {{- if not .disabled }} HYP_CHAINS_{{ .name | upper }}_CUSTOMRPCURLS: {{ printf "'{{ .%s_rpcs | mustFromJson | join \",\" }}'" .name }} + {{- if eq .protocol "cosmos" }} + HYP_CHAINS_{{ .name | upper }}_GRPCURL: {{ printf "'{{ .%s_grpc }}'" .name }} + {{- end }} {{- end }} {{- end }} data: {{- /* - * For each network, load the secret in GCP secret manager with the form: environment-rpc-endpoint-network, - * and associate it with the secret key networkname_rpc. + * For each network, load the secret in GCP secret manager with the form: environment-rpc-endpoints-network, + * and associate it with the secret key networkname_rpcs. */}} {{- range .Values.hyperlane.chains }} {{- if not .disabled }} - secretKey: {{ printf "%s_rpcs" .name }} remoteRef: key: {{ printf "%s-rpc-endpoints-%s" $.Values.hyperlane.runEnv .name }} + {{- if eq .protocol "cosmos" }} + - secretKey: {{ printf "%s_grpc" .name }} + remoteRef: + key: {{ printf "%s-grpc-endpoint-%s" $.Values.hyperlane.runEnv .name }} + {{- end }} {{- end }} {{- end }} diff --git a/rust/helm/hyperlane-agent/templates/relayer-external-secret.yaml b/rust/helm/hyperlane-agent/templates/relayer-external-secret.yaml index 35ac56b548..3bcd4f5a95 100644 --- a/rust/helm/hyperlane-agent/templates/relayer-external-secret.yaml +++ b/rust/helm/hyperlane-agent/templates/relayer-external-secret.yaml @@ -22,20 +22,22 @@ spec: {{- include "agent-common.labels" . | nindent 10 }} data: {{- range .Values.hyperlane.relayerChains }} - {{- if eq .signer.type "hexKey" }} + {{- if or (eq .signer.type "hexKey") (eq .signer.type "cosmosKey") }} HYP_CHAINS_{{ .name | upper }}_SIGNER_KEY: {{ printf "'{{ .%s_signer_key | toString }}'" .name }} {{- end }} {{- if and (eq .signer.type "aws") $.Values.hyperlane.relayer.aws }} HYP_CHAINS_{{ .name | upper }}_SIGNER_TYPE: aws HYP_CHAINS_{{ .name | upper }}_SIGNER_ID: {{ .signer.id }} HYP_CHAINS_{{ .name | upper }}_SIGNER_REGION: {{ .signer.region}} + {{- end }} + {{- end }} + {{- if .Values.hyperlane.relayer.aws }} AWS_ACCESS_KEY_ID: {{ print "'{{ .aws_access_key_id | toString }}'" }} AWS_SECRET_ACCESS_KEY: {{ print "'{{ .aws_secret_access_key | toString }}'" }} {{- end }} - {{- end }} data: {{- range .Values.hyperlane.relayerChains }} - {{- if eq .signer.type "hexKey" }} + {{- if or (eq .signer.type "hexKey") (eq .signer.type "cosmosKey") }} - secretKey: {{ printf "%s_signer_key" .name }} remoteRef: {{- if $.Values.hyperlane.relayer.usingDefaultSignerKey }} diff --git a/rust/helm/hyperlane-agent/templates/validator-configmap.yaml b/rust/helm/hyperlane-agent/templates/validator-configmap.yaml index cabed1644a..8594b96e21 100644 --- a/rust/helm/hyperlane-agent/templates/validator-configmap.yaml +++ b/rust/helm/hyperlane-agent/templates/validator-configmap.yaml @@ -8,6 +8,7 @@ metadata: data: {{- range $index, $config := .Values.hyperlane.validator.configs }} validator-{{ $index }}.env: | - {{- include "agent-common.config-env-vars" (dict "config" $config "format" "dot_env") | nindent 4 }} + {{- include "agent-common.config-env-vars" (dict "config" (get $config "chainSigner") "format" "dot_env" "key_name_prefix" (printf "CHAINS_%s_SIGNER_" ($config.originChainName | upper))) | nindent 4 }} + {{- include "agent-common.config-env-vars" (dict "config" (omit $config "chainSigner") "format" "dot_env") | nindent 4 }} {{- end }} {{- end }} diff --git a/rust/helm/hyperlane-agent/templates/validator-external-secret.yaml b/rust/helm/hyperlane-agent/templates/validator-external-secret.yaml index c15081f119..61f115584d 100644 --- a/rust/helm/hyperlane-agent/templates/validator-external-secret.yaml +++ b/rust/helm/hyperlane-agent/templates/validator-external-secret.yaml @@ -26,18 +26,21 @@ spec: validator-{{ $index }}.env: | {{- if eq .validator.type "hexKey" }} HYP_VALIDATOR_KEY={{ printf "'{{ .signer_key_%d | toString }}'" $index }} - HYP_CHAINS_{{ .originChainName | upper }}_SIGNER_KEY={{ printf "'{{ .signer_key_%d | toString }}'" $index }} {{- end }} {{- if or (eq .checkpointSyncer.type "s3") $.Values.hyperlane.aws }} AWS_ACCESS_KEY_ID={{ printf "'{{ .aws_access_key_id_%d | toString }}'" $index }} AWS_SECRET_ACCESS_KEY={{ printf "'{{ .aws_secret_access_key_%d | toString }}'" $index }} {{- end }} + + {{- if or (eq .chainSigner.type "hexKey") (eq .chainSigner.type "cosmosKey") }} + HYP_CHAINS_{{ .originChainName | upper }}_SIGNER_KEY={{ printf "'{{ .signer_key_%d | toString }}'" $index }} + {{- end }} {{ $index = add1 $index }} {{- end }} data: {{ $index = 0 }} {{- range .Values.hyperlane.validator.configs }} -{{- if eq .validator.type "hexKey" }} +{{- if or (eq .validator.type "hexKey") (eq .chainSigner.type "hexKey") (eq .chainSigner.type "cosmosKey") }} - secretKey: signer_key_{{ $index }} remoteRef: key: {{ printf "%s-%s-key-%s-validator-%d" $.Values.hyperlane.context $.Values.hyperlane.runEnv .originChainName $index }} diff --git a/typescript/infra/src/agents/index.ts b/typescript/infra/src/agents/index.ts index 23cb44091d..8607e021dc 100644 --- a/typescript/infra/src/agents/index.ts +++ b/typescript/infra/src/agents/index.ts @@ -114,7 +114,8 @@ export abstract class AgentHelmManager { context: this.context, aws: !!this.config.aws, chains: this.config.environmentChainNames.map((chain) => { - const reorgPeriod = chainMetadata[chain].blocks?.reorgPeriod; + const metadata = chainMetadata[chain]; + const reorgPeriod = metadata.blocks?.reorgPeriod; if (reorgPeriod === undefined) { throw new Error(`No reorg period found for chain ${chain}`); } @@ -122,6 +123,7 @@ export abstract class AgentHelmManager { name: chain, disabled: !this.config.contextChainNames[this.role].includes(chain), rpcConsensusType: this.rpcConsensusType(chain), + protocol: metadata.protocol, blocks: { reorgPeriod }, }; }), diff --git a/typescript/infra/src/config/agent/agent.ts b/typescript/infra/src/config/agent/agent.ts index af11ea850c..630e3fb4c9 100644 --- a/typescript/infra/src/config/agent/agent.ts +++ b/typescript/infra/src/config/agent/agent.ts @@ -94,7 +94,11 @@ interface AgentRoleConfig { export type AwsKeyConfig = Required; // only require specifying that it's the "hex" type for helm since the hex key will be pulled from secrets. export type HexKeyConfig = { type: AgentSignerKeyType.Hex }; -export type KeyConfig = AwsKeyConfig | HexKeyConfig; +export type CosmosKeyConfig = { + type: AgentSignerKeyType.Cosmos; + prefix: string; +}; +export type KeyConfig = AwsKeyConfig | HexKeyConfig | CosmosKeyConfig; interface IndexingConfig { from: number; diff --git a/typescript/infra/src/config/agent/validator.ts b/typescript/infra/src/config/agent/validator.ts index 4731f88000..288a0d0ca4 100644 --- a/typescript/infra/src/config/agent/validator.ts +++ b/typescript/infra/src/config/agent/validator.ts @@ -4,9 +4,11 @@ import { ValidatorConfig as AgentValidatorConfig, ChainMap, ChainName, + chainMetadata, } from '@hyperlane-xyz/sdk'; +import { ProtocolType } from '@hyperlane-xyz/utils'; -import { ValidatorAgentAwsUser } from '../../agents/aws'; +import { AgentAwsUser, ValidatorAgentAwsUser } from '../../agents/aws'; import { Role } from '../../roles'; import { HelmStatefulSetValues } from '../infrastructure'; @@ -36,7 +38,10 @@ export interface ValidatorConfig { originChainName: ChainName; validators: Array<{ checkpointSyncer: CheckpointSyncerConfig; + // The key that signs checkpoints validator: KeyConfig; + // The key that signs txs (e.g. self-announcements) + chainSigner: KeyConfig | undefined; }>; } @@ -108,7 +113,12 @@ export class ValidatorConfigHelper extends AgentConfigHelper { cfg: ValidatorBaseConfig, idx: number, ): Promise { + const metadata = chainMetadata[this.chainName]; + const protocol = metadata.protocol; + let validator: KeyConfig = { type: AgentSignerKeyType.Hex }; + let chainSigner: KeyConfig | undefined = undefined; + if (cfg.checkpointSyncer.type == CheckpointSyncerType.S3) { const awsUser = new ValidatorAgentAwsUser( this.runEnv, @@ -123,6 +133,28 @@ export class ValidatorConfigHelper extends AgentConfigHelper { if (this.aws) { validator = (await awsUser.createKeyIfNotExists(this)).keyConfig; + + switch (protocol) { + case ProtocolType.Ethereum: + chainSigner = validator; + break; + case ProtocolType.CosmWasm: + if (metadata.prefix === undefined) { + throw new Error( + `Prefix for cosmos chain ${this.chainName} is undefined`, + ); + } + chainSigner = { + type: AgentSignerKeyType.Cosmos, + prefix: metadata.prefix, + }; + break; + // No self-announcement on Sealevel + case ProtocolType.Sealevel: + default: + chainSigner = undefined; + break; + } } } else { console.warn( @@ -133,6 +165,7 @@ export class ValidatorConfigHelper extends AgentConfigHelper { return { checkpointSyncer: cfg.checkpointSyncer, validator, + chainSigner, }; } diff --git a/typescript/sdk/src/consts/chainMetadata.ts b/typescript/sdk/src/consts/chainMetadata.ts index 1cb22cf1d1..23fcdf1996 100644 --- a/typescript/sdk/src/consts/chainMetadata.ts +++ b/typescript/sdk/src/consts/chainMetadata.ts @@ -1024,6 +1024,7 @@ export const neutrontestnet: ChainMetadata = { }, rpcUrls: [{ http: 'http://54.149.31.83:26657' }], isTestnet: true, + prefix: 'dual', }; /** diff --git a/typescript/sdk/src/metadata/agentConfig.ts b/typescript/sdk/src/metadata/agentConfig.ts index 8431ea7385..2b10080946 100644 --- a/typescript/sdk/src/metadata/agentConfig.ts +++ b/typescript/sdk/src/metadata/agentConfig.ts @@ -46,6 +46,7 @@ export enum AgentSignerKeyType { Aws = 'aws', Hex = 'hexKey', Node = 'node', + Cosmos = 'cosmosKey', } const AgentSignerHexKeySchema = z @@ -63,6 +64,13 @@ const AgentSignerAwsKeySchema = z .describe( 'An AWS signer. Note that AWS credentials must be inserted into the env separately.', ); +const AgentSignerCosmosKeySchema = z + .object({ + type: z.literal(AgentSignerKeyType.Cosmos), + prefix: z.string().describe('The prefix for the cosmos address'), + key: ZHash, + }) + .describe('Cosmos key'); const AgentSignerNodeSchema = z .object({ type: z.literal(AgentSignerKeyType.Node), @@ -72,11 +80,13 @@ const AgentSignerNodeSchema = z const AgentSignerSchema = z.union([ AgentSignerHexKeySchema, AgentSignerAwsKeySchema, + AgentSignerCosmosKeySchema, AgentSignerNodeSchema, ]); export type AgentSignerHexKey = z.infer; export type AgentSignerAwsKey = z.infer; +export type AgentSignerCosmosKey = z.infer; export type AgentSignerNode = z.infer; export type AgentSigner = z.infer; diff --git a/typescript/sdk/src/metadata/chainMetadataTypes.ts b/typescript/sdk/src/metadata/chainMetadataTypes.ts index 7e185878ee..ba73a40394 100644 --- a/typescript/sdk/src/metadata/chainMetadataTypes.ts +++ b/typescript/sdk/src/metadata/chainMetadataTypes.ts @@ -170,6 +170,11 @@ export const ChainMetadataSchemaObject = z.object({ .boolean() .optional() .describe('Whether the chain is considered a testnet or a mainnet.'), + // TODO we should have a better policy for protocol-specific configurations + prefix: z + .string() + .optional() + .describe('The prefix for a Cosmos address, e.g. osmo'), }); // Add refinements to the object schema to conditionally validate certain fields From 9962e05ac8a65cfb01e1c1a2dafe9fee5ce198d8 Mon Sep 17 00:00:00 2001 From: Trevor Porter Date: Fri, 27 Oct 2023 12:29:02 +0100 Subject: [PATCH 04/38] Add new neutron context --- typescript/infra/config/contexts.ts | 1 + .../config/environments/testnet4/agent.ts | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/typescript/infra/config/contexts.ts b/typescript/infra/config/contexts.ts index a8df3d4d65..6c9e551700 100644 --- a/typescript/infra/config/contexts.ts +++ b/typescript/infra/config/contexts.ts @@ -2,4 +2,5 @@ export enum Contexts { Hyperlane = 'hyperlane', ReleaseCandidate = 'rc', + Neutron = 'neutron', } diff --git a/typescript/infra/config/environments/testnet4/agent.ts b/typescript/infra/config/environments/testnet4/agent.ts index f3406d1421..1c9e29392c 100644 --- a/typescript/infra/config/environments/testnet4/agent.ts +++ b/typescript/infra/config/environments/testnet4/agent.ts @@ -106,6 +106,26 @@ const releaseCandidate: RootAgentConfig = { }, }; +const neutron: RootAgentConfig = { + ...contextBase, + context: Contexts.Neutron, + rolesWithKeys: [Role.Relayer], + contextChainNames: { + relayer: [chainMetadata.neutron.name, chainMetadata.goerli.name], + validator: [], + scraper: [], + }, + relayer: { + rpcConsensusType: RpcConsensusType.Fallback, + docker: { + repo, + tag: 'fd890d2-20231024-132022', + }, + gasPaymentEnforcement, + transactionGasLimit: 750000, + }, +}; + export const agents = { [Contexts.Hyperlane]: hyperlane, [Contexts.ReleaseCandidate]: releaseCandidate, From 34c00df9d99e2fb193c3fbf4e693f69438bda485 Mon Sep 17 00:00:00 2001 From: Trevor Porter Date: Fri, 27 Oct 2023 12:45:19 +0100 Subject: [PATCH 05/38] Add neutron context --- .../environments/mainnet2/validators.ts | 177 ++++++++++++++++++ .../config/environments/testnet4/agent.ts | 11 +- .../environments/testnet4/validators.ts | 13 ++ typescript/infra/src/agents/index.ts | 10 +- typescript/infra/src/config/agent/relayer.ts | 6 +- 5 files changed, 208 insertions(+), 9 deletions(-) create mode 100644 typescript/infra/config/environments/mainnet2/validators.ts diff --git a/typescript/infra/config/environments/mainnet2/validators.ts b/typescript/infra/config/environments/mainnet2/validators.ts new file mode 100644 index 0000000000..945b71ed75 --- /dev/null +++ b/typescript/infra/config/environments/mainnet2/validators.ts @@ -0,0 +1,177 @@ +import { chainMetadata } from '@hyperlane-xyz/sdk'; + +import { ValidatorBaseChainConfigMap } from '../../../src/config/agent'; +import { Contexts } from '../../contexts'; +import { validatorBaseConfigsFn } from '../utils'; + +import { environment } from './chains'; + +export const validatorChainConfig = ( + context: Contexts, +): ValidatorBaseChainConfigMap => { + const validatorsConfig = validatorBaseConfigsFn(environment, context); + return { + celo: { + interval: 5, + reorgPeriod: 0, + validators: validatorsConfig( + { + [Contexts.Hyperlane]: ['0x1f20274b1210046769d48174c2f0e7c25ca7d5c5'], + [Contexts.ReleaseCandidate]: [ + '0xe7a82e210f512f8e9900d6bc2acbf7981c63e66e', + ], + [Contexts.Neutron]: [], + }, + 'celo', + ), + }, + ethereum: { + interval: 5, + reorgPeriod: 20, + validators: validatorsConfig( + { + [Contexts.Hyperlane]: ['0x4c327ccb881a7542be77500b2833dc84c839e7b7'], + [Contexts.ReleaseCandidate]: [ + '0xaea1adb1c687b061e5b60b9da84cb69e7b5fab44', + ], + [Contexts.Neutron]: [], + }, + 'ethereum', + ), + }, + avalanche: { + interval: 5, + reorgPeriod: 3, + validators: validatorsConfig( + { + [Contexts.Hyperlane]: ['0xa7aa52623fe3d78c343008c95894be669e218b8d'], + [Contexts.ReleaseCandidate]: [ + '0x706976391e23dea28152e0207936bd942aba01ce', + ], + [Contexts.Neutron]: [], + }, + 'avalanche', + ), + }, + polygon: { + interval: 5, + reorgPeriod: 256, + validators: validatorsConfig( + { + [Contexts.Hyperlane]: ['0x59a001c3451e7f9f3b4759ea215382c1e9aa5fc1'], + [Contexts.ReleaseCandidate]: [ + '0xef372f6ff7775989b3ac884506ee31c79638c989', + ], + [Contexts.Neutron]: [], + }, + 'polygon', + ), + }, + bsc: { + interval: 5, + reorgPeriod: 15, + validators: validatorsConfig( + { + [Contexts.Hyperlane]: ['0xcc84b1eb711e5076b2755cf4ad1d2b42c458a45e'], + [Contexts.ReleaseCandidate]: [ + '0x0823081031a4a6f97c6083775c191d17ca96d0ab', + ], + [Contexts.Neutron]: [], + }, + 'bsc', + ), + }, + arbitrum: { + interval: 5, + reorgPeriod: 0, + validators: validatorsConfig( + { + [Contexts.Hyperlane]: ['0xbcb815f38d481a5eba4d7ac4c9e74d9d0fc2a7e7'], + [Contexts.ReleaseCandidate]: [ + '0x1a95b35fb809d57faf1117c1cc29a6c5df289df1', + ], + [Contexts.Neutron]: [], + }, + 'arbitrum', + ), + }, + optimism: { + interval: 5, + reorgPeriod: 0, + validators: validatorsConfig( + { + [Contexts.Hyperlane]: ['0x9f2296d5cfc6b5176adc7716c7596898ded13d35'], + [Contexts.ReleaseCandidate]: [ + '0x60e938bf280bbc21bacfd8bf435459d9003a8f98', + ], + [Contexts.Neutron]: [], + }, + 'optimism', + ), + }, + moonbeam: { + interval: 5, + reorgPeriod: 2, + validators: validatorsConfig( + { + [Contexts.Hyperlane]: ['0x237243d32d10e3bdbbf8dbcccc98ad44c1c172ea'], + [Contexts.ReleaseCandidate]: [ + '0x0df7140811e309dc69638352545151ebb9d5e0fd', + ], + [Contexts.Neutron]: [], + }, + 'moonbeam', + ), + }, + gnosis: { + interval: 5, + reorgPeriod: 14, + validators: validatorsConfig( + { + [Contexts.Hyperlane]: ['0xd0529ec8df08d0d63c0f023786bfa81e4bb51fd6'], + [Contexts.ReleaseCandidate]: [ + '0x15f48e78092a4f79febface509cfd76467c6cdbb', + ], + [Contexts.Neutron]: [], + }, + 'gnosis', + ), + }, + solana: { + interval: 5, + reorgPeriod: chainMetadata.solana.blocks!.reorgPeriod!, + validators: validatorsConfig( + { + [Contexts.Hyperlane]: [ + '0x3cd1a081f38874bbb075bf10b62adcb858db864c', + '0x28aa072634dd41d19471640237852e807bd9901f', + '0x8a93ba04f4e30064660670cb581d9aa10df78929', + ], + [Contexts.ReleaseCandidate]: [ + '0x8cc7dbfb5de339e4133f3af059c927ec383ace38', + ], + [Contexts.Neutron]: [], + }, + 'solana', + ), + }, + nautilus: { + interval: 5, + reorgPeriod: chainMetadata.nautilus.blocks!.reorgPeriod!, + validators: validatorsConfig( + { + [Contexts.Hyperlane]: [ + '0x9c920af9467595a23cb3433adefc3854d498a437', + '0x12b583ce1623b7de3fc727ccccda24dcab1fe022', + '0xc8b996a421ff1e203070c709c1af93944c049cc0', + ], + [Contexts.ReleaseCandidate]: [ + '0xdaf2e5ddaf2532753dc78bb6fbb0a10204c888c1', + ], + [Contexts.Neutron]: [], + }, + 'nautilus', + ), + }, + }; +}; diff --git a/typescript/infra/config/environments/testnet4/agent.ts b/typescript/infra/config/environments/testnet4/agent.ts index 1c9e29392c..2130eafa79 100644 --- a/typescript/infra/config/environments/testnet4/agent.ts +++ b/typescript/infra/config/environments/testnet4/agent.ts @@ -1,4 +1,5 @@ import { + Chains, GasPaymentEnforcementPolicyType, RpcConsensusType, chainMetadata, @@ -68,6 +69,11 @@ const hyperlane: RootAgentConfig = { repo, tag: 'fd890d2-20231024-132022', }, + chainDockerOverrides: { + neutrontestnet: { + tag: 'd860160-20231026-161305', + }, + }, chains: validatorChainConfig(Contexts.Hyperlane), }, scraper: { @@ -111,7 +117,7 @@ const neutron: RootAgentConfig = { context: Contexts.Neutron, rolesWithKeys: [Role.Relayer], contextChainNames: { - relayer: [chainMetadata.neutron.name, chainMetadata.goerli.name], + relayer: [Chains.neutrontestnet, Chains.goerli], validator: [], scraper: [], }, @@ -119,7 +125,7 @@ const neutron: RootAgentConfig = { rpcConsensusType: RpcConsensusType.Fallback, docker: { repo, - tag: 'fd890d2-20231024-132022', + tag: 'd860160-20231026-161305', }, gasPaymentEnforcement, transactionGasLimit: 750000, @@ -129,4 +135,5 @@ const neutron: RootAgentConfig = { export const agents = { [Contexts.Hyperlane]: hyperlane, [Contexts.ReleaseCandidate]: releaseCandidate, + [Contexts.Neutron]: neutron, }; diff --git a/typescript/infra/config/environments/testnet4/validators.ts b/typescript/infra/config/environments/testnet4/validators.ts index 52349da98d..da7ca5a070 100644 --- a/typescript/infra/config/environments/testnet4/validators.ts +++ b/typescript/infra/config/environments/testnet4/validators.ts @@ -26,6 +26,7 @@ export const validatorChainConfig = ( '0x6c8bfdfb8c40aba10cc9fb2cf0e3e856e0e5dbb3', '0x54c65eb7677e6086cdde3d5ccef89feb2103a11d', ], + [Contexts.Neutron]: [], }, 'alfajores', ), @@ -45,6 +46,7 @@ export const validatorChainConfig = ( '0x36de434527b8f83851d83f1b1d72ec11a5903533', '0x4b65f7527c267e420bf62a0c5a139cb8c3906277', ], + [Contexts.Neutron]: [], }, 'basegoerli', ), @@ -64,6 +66,7 @@ export const validatorChainConfig = ( '0x0a636e76df4124b092cabb4321d6aaef9defb514', '0xbf86037899efe97bca4cea865607e10b849b5878', ], + [Contexts.Neutron]: [], }, 'fuji', ), @@ -121,6 +124,7 @@ export const validatorChainConfig = ( '0x954168cf13faeaa248d412e145a17dc697556636', '0x98a9f2610e44246ac0c749c20a07a6eb192ce9eb', ], + [Contexts.Neutron]: [], }, 'mumbai', ), @@ -140,6 +144,7 @@ export const validatorChainConfig = ( '0xcb5be62b19c52b78cd3993c71c3fa74d821475ae', '0xc50ddb8f03133611853b7f03ffe0a8098e08ae15', ], + [Contexts.Neutron]: [], }, 'bsctestnet', ), @@ -159,6 +164,7 @@ export const validatorChainConfig = ( '0x4711d476a5929840196def397a156c5253b44b96', '0xb0add42f2a4b824ba5fab2628f930dc1dcfc40f8', ], + [Contexts.Neutron]: [], }, 'goerli', ), @@ -178,6 +184,7 @@ export const validatorChainConfig = ( '0x10fa7a657a06a47bcca1bacc436d61619e5d104c', '0xa0f1cf3b23bd0f8a5e2ad438657097b8287816b4', ], + [Contexts.Neutron]: [], }, 'scrollsepolia', ), @@ -197,6 +204,7 @@ export const validatorChainConfig = ( '0x13b51805e9af68e154778d973165f32e10b7446b', '0x7f699c3fc3de4928f1c0abfba1eac3fbb5a00d1b', ], + [Contexts.Neutron]: [], }, 'sepolia', ), @@ -216,6 +224,7 @@ export const validatorChainConfig = ( '0x776623e8be8d7218940b7c77d02162af4ff97985', '0xb4c81facd992a6c7c4a187bcce35a6fc968399a0', ], + [Contexts.Neutron]: [], }, 'moonbasealpha', ), @@ -235,6 +244,7 @@ export const validatorChainConfig = ( '0xec6b5ddfd20ee64ff0dcbc7472ad757dce151685', '0x4acd2983a51f1c33c2ab41669184c7679e0316f1', ], + [Contexts.Neutron]: [], }, 'optimismgoerli', ), @@ -254,6 +264,7 @@ export const validatorChainConfig = ( '0x9be82c7a063b47b2d04c890daabcb666b670a9a4', '0x92c62f4b9cd60a7fe4216d1f12134d34cf827c41', ], + [Contexts.Neutron]: [], }, 'arbitrumgoerli', ), @@ -273,6 +284,7 @@ export const validatorChainConfig = ( '0x989bbbfa753431169556f69be1b0a496b252e8a6', '0x292d5788587bb5efd5c2c911115527e57f50cd05', ], + [Contexts.Neutron]: [], }, 'polygonzkevmtestnet', ), @@ -322,6 +334,7 @@ export const validatorChainConfig = ( '0x661faee997654d14ead4ae48035883f05c3150cf', ], [Contexts.ReleaseCandidate]: [], + [Contexts.Neutron]: [], }, 'neutrontestnet', ), diff --git a/typescript/infra/src/agents/index.ts b/typescript/infra/src/agents/index.ts index 8607e021dc..77cd8d0c30 100644 --- a/typescript/infra/src/agents/index.ts +++ b/typescript/infra/src/agents/index.ts @@ -204,12 +204,10 @@ export class RelayerHelmManager extends OmniscientAgentHelmManager { }; const signers = await this.config.signers(); - values.hyperlane.relayerChains = this.config.environmentChainNames.map( - (name) => ({ - name, - signer: signers[name], - }), - ); + values.hyperlane.relayerChains = this.config.relayChains.map((name) => ({ + name, + signer: signers[name], + })); return values; } diff --git a/typescript/infra/src/config/agent/relayer.ts b/typescript/infra/src/config/agent/relayer.ts index 813d5d03ea..667066bff1 100644 --- a/typescript/infra/src/config/agent/relayer.ts +++ b/typescript/infra/src/config/agent/relayer.ts @@ -60,7 +60,7 @@ export class RelayerConfigHelper extends AgentConfigHelper { const baseConfig = this.#relayerConfig!; const relayerConfig: RelayerConfig = { - relayChains: this.contextChainNames[Role.Relayer].join(','), + relayChains: this.relayChains.join(','), gasPaymentEnforcement: JSON.stringify(baseConfig.gasPaymentEnforcement), }; @@ -130,6 +130,10 @@ export class RelayerConfigHelper extends AgentConfigHelper { get role(): Role { return Role.Relayer; } + + get relayChains(): Array { + return this.contextChainNames[Role.Relayer]; + } } // Create a matching list for the given router addresses From d1666395941c4a03d5b2f670a924ec86b838159c Mon Sep 17 00:00:00 2001 From: Trevor Porter Date: Fri, 27 Oct 2023 14:19:57 +0100 Subject: [PATCH 06/38] Update external secrets prefixes --- typescript/infra/config/environments/testnet4/infrastructure.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/typescript/infra/config/environments/testnet4/infrastructure.ts b/typescript/infra/config/environments/testnet4/infrastructure.ts index 9429f4782d..c3367436cb 100644 --- a/typescript/infra/config/environments/testnet4/infrastructure.ts +++ b/typescript/infra/config/environments/testnet4/infrastructure.ts @@ -40,6 +40,7 @@ export const infrastructure: InfrastructureConfig = { 'testnet3-', 'hyperlane-testnet4-', 'rc-testnet4-', + 'neutron-testnet4-', 'testnet4-', ], }, From 7032820d0262a68919879dcb0ab9d1e8e490d30a Mon Sep 17 00:00:00 2001 From: Trevor Porter Date: Fri, 27 Oct 2023 14:26:42 +0100 Subject: [PATCH 07/38] new image --- typescript/infra/config/environments/testnet4/agent.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/typescript/infra/config/environments/testnet4/agent.ts b/typescript/infra/config/environments/testnet4/agent.ts index 2130eafa79..49eb4c8065 100644 --- a/typescript/infra/config/environments/testnet4/agent.ts +++ b/typescript/infra/config/environments/testnet4/agent.ts @@ -71,7 +71,7 @@ const hyperlane: RootAgentConfig = { }, chainDockerOverrides: { neutrontestnet: { - tag: 'd860160-20231026-161305', + tag: 'eea130c-20231027-115055', }, }, chains: validatorChainConfig(Contexts.Hyperlane), @@ -125,7 +125,7 @@ const neutron: RootAgentConfig = { rpcConsensusType: RpcConsensusType.Fallback, docker: { repo, - tag: 'd860160-20231026-161305', + tag: 'eea130c-20231027-115055', }, gasPaymentEnforcement, transactionGasLimit: 750000, From ab2fbf18532e4e1eb9088249ebb374c92137ea2b Mon Sep 17 00:00:00 2001 From: Trevor Porter Date: Sat, 28 Oct 2023 21:15:35 +0100 Subject: [PATCH 08/38] Add neutron and manta --- .../config/environments/mainnet3/chains.ts | 9 +++---- .../environments/mainnet3/gas-oracle.ts | 3 +++ .../environments/mainnet3/validators.ts | 24 +++++++++++++++++++ typescript/infra/src/agents/gcp.ts | 2 +- typescript/sdk/src/consts/chains.ts | 2 ++ typescript/sdk/src/consts/multisigIsm.ts | 8 +++++++ 6 files changed, 43 insertions(+), 5 deletions(-) diff --git a/typescript/infra/config/environments/mainnet3/chains.ts b/typescript/infra/config/environments/mainnet3/chains.ts index 14465a19ce..e3d9fc0772 100644 --- a/typescript/infra/config/environments/mainnet3/chains.ts +++ b/typescript/infra/config/environments/mainnet3/chains.ts @@ -44,13 +44,14 @@ export const ethereumMainnetConfigs: ChainMap = { }; // Blessed non-Ethereum chains. -// export const nonEthereumMainnetConfigs: ChainMap = { -// solana: chainMetadata.solana, -// }; +export const nonEthereumMainnetConfigs: ChainMap = { + // solana: chainMetadata.solana, + neutron: chainMetadata.neutron, +}; export const mainnetConfigs: ChainMap = { ...ethereumMainnetConfigs, - // ...nonEthereumMainnetConfigs, + ...nonEthereumMainnetConfigs, }; export type MainnetChains = keyof typeof mainnetConfigs; diff --git a/typescript/infra/config/environments/mainnet3/gas-oracle.ts b/typescript/infra/config/environments/mainnet3/gas-oracle.ts index c3dc53ec6d..d5031cb16d 100644 --- a/typescript/infra/config/environments/mainnet3/gas-oracle.ts +++ b/typescript/infra/config/environments/mainnet3/gas-oracle.ts @@ -48,6 +48,7 @@ const gasPrices: ChainMap = { base: ethers.utils.parseUnits('1', 'gwei'), scroll: ethers.utils.parseUnits('1', 'gwei'), polygonzkevm: ethers.utils.parseUnits('2', 'gwei'), + neutron: ethers.utils.parseUnits('1', 'gwei'), }; // Accurate from coingecko as of Mar 9, 2023. @@ -83,6 +84,8 @@ const tokenUsdPrices: ChainMap = { '1619.00', TOKEN_EXCHANGE_RATE_DECIMALS, ), + // https://www.coingecko.com/en/coins/neutron + neutron: ethers.utils.parseUnits('0.304396', TOKEN_EXCHANGE_RATE_DECIMALS), }; // Gets the exchange rate of the remote quoted in local tokens diff --git a/typescript/infra/config/environments/mainnet3/validators.ts b/typescript/infra/config/environments/mainnet3/validators.ts index 28d5e54fd6..fe9aae1f56 100644 --- a/typescript/infra/config/environments/mainnet3/validators.ts +++ b/typescript/infra/config/environments/mainnet3/validators.ts @@ -195,5 +195,29 @@ export const validatorChainConfig = ( 'polygonzkevm', ), }, + neutron: { + interval: 5, + reorgPeriod: 0, + validators: validatorsConfig( + { + [Contexts.Hyperlane]: ['', '', ''], + [Contexts.ReleaseCandidate]: [], + [Contexts.Neutron]: [], + }, + 'neutron', + ), + }, + mantapacific: { + interval: 5, + reorgPeriod: 0, + validators: validatorsConfig( + { + [Contexts.Hyperlane]: ['', '', ''], + [Contexts.ReleaseCandidate]: [], + [Contexts.Neutron]: [], + }, + 'mantapacific', + ), + }, }; }; diff --git a/typescript/infra/src/agents/gcp.ts b/typescript/infra/src/agents/gcp.ts index f483bdd1be..f36f1d8fef 100644 --- a/typescript/infra/src/agents/gcp.ts +++ b/typescript/infra/src/agents/gcp.ts @@ -116,7 +116,7 @@ export class AgentGCPKey extends CloudAgentKey { ); // TODO support other prefixes? // https://cosmosdrops.io/en/tools/bech32-converter is useful for converting to other prefixes. - return pubkeyToAddress(encodedPubkey, 'dual'); + return pubkeyToAddress(encodedPubkey, 'neutron'); default: return undefined; } diff --git a/typescript/sdk/src/consts/chains.ts b/typescript/sdk/src/consts/chains.ts index 65bd49820e..04e0242e54 100644 --- a/typescript/sdk/src/consts/chains.ts +++ b/typescript/sdk/src/consts/chains.ts @@ -35,7 +35,9 @@ export enum Chains { proteustestnet = 'proteustestnet', solana = 'solana', solanadevnet = 'solanadevnet', + neutron = 'neutron', neutrontestnet = 'neutrontestnet', + mantapacific = 'mantapacific', test1 = 'test1', test2 = 'test2', test3 = 'test3', diff --git a/typescript/sdk/src/consts/multisigIsm.ts b/typescript/sdk/src/consts/multisigIsm.ts index fadd9ba920..b76a6a26ce 100644 --- a/typescript/sdk/src/consts/multisigIsm.ts +++ b/typescript/sdk/src/consts/multisigIsm.ts @@ -234,4 +234,12 @@ export const defaultMultisigIsmConfigs: ChainMap = { '0x661faee997654d14ead4ae48035883f05c3150cf', ], }, + neutron: { + threshold: 2, + validators: ['', '', ''], + }, + mantapacific: { + threshold: 2, + validators: ['', '', ''], + }, }; From 8b27f688ab639e944a7f7125b235b221752221da Mon Sep 17 00:00:00 2001 From: Trevor Porter Date: Sat, 28 Oct 2023 23:05:30 +0100 Subject: [PATCH 09/38] wip --- typescript/infra/config/environments/mainnet3/agent.ts | 5 +++++ typescript/infra/scripts/agents/utils.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/typescript/infra/config/environments/mainnet3/agent.ts b/typescript/infra/config/environments/mainnet3/agent.ts index d2922ebc96..375988d197 100644 --- a/typescript/infra/config/environments/mainnet3/agent.ts +++ b/typescript/infra/config/environments/mainnet3/agent.ts @@ -51,6 +51,11 @@ const hyperlane: RootAgentConfig = { repo, tag: '2e1db12-20231025-013013', }, + chainDockerOverrides: { + [chainMetadata.neutron.name]: { + tag: 'b02f4b7-20231028-205229', + }, + }, rpcConsensusType: RpcConsensusType.Quorum, chains: validatorChainConfig(Contexts.Hyperlane), }, diff --git a/typescript/infra/scripts/agents/utils.ts b/typescript/infra/scripts/agents/utils.ts index 7196a086dc..c3949bef83 100644 --- a/typescript/infra/scripts/agents/utils.ts +++ b/typescript/infra/scripts/agents/utils.ts @@ -34,7 +34,7 @@ export class AgentCli { switch (role) { case Role.Validator: for (const chain of this.agentConfig.contextChainNames[role]) { - if (chain !== 'neutrontestnet') continue; + if (chain !== 'neutrontestnet' && chain !== 'neutron') continue; const key = `${role}-${chain}`; managers[key] = new ValidatorHelmManager(this.agentConfig, chain); } From 7071213838a1d17bec1416532a0becd83b429239 Mon Sep 17 00:00:00 2001 From: Nam Chu Hoai Date: Sun, 29 Oct 2023 11:48:22 -0400 Subject: [PATCH 10/38] Update neutron validators --- typescript/infra/config/environments/mainnet3/agent.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typescript/infra/config/environments/mainnet3/agent.ts b/typescript/infra/config/environments/mainnet3/agent.ts index 375988d197..2d8b84c670 100644 --- a/typescript/infra/config/environments/mainnet3/agent.ts +++ b/typescript/infra/config/environments/mainnet3/agent.ts @@ -53,7 +53,7 @@ const hyperlane: RootAgentConfig = { }, chainDockerOverrides: { [chainMetadata.neutron.name]: { - tag: 'b02f4b7-20231028-205229', + tag: '7816e05-20231028-225509', }, }, rpcConsensusType: RpcConsensusType.Quorum, From 794c7d46d1b381e19438b90d67cb9978a8c8fbb8 Mon Sep 17 00:00:00 2001 From: Nam Chu Hoai Date: Sun, 29 Oct 2023 12:50:45 -0400 Subject: [PATCH 11/38] Deploy to mantapacific --- rust/config/mainnet3_config.json | 103 +++++++++++++++++- .../config/environments/mainnet3/chains.ts | 4 +- .../mainnet3/core/verification.json | 80 ++++++++++++++ .../environments/mainnet3/gas-oracle.ts | 6 + .../config/environments/mainnet3/owners.ts | 1 + typescript/infra/config/routingIsm.ts | 2 +- .../sdk/src/consts/environments/mainnet.json | 76 +++++++++++++ 7 files changed, 269 insertions(+), 3 deletions(-) diff --git a/rust/config/mainnet3_config.json b/rust/config/mainnet3_config.json index fc06c4c8d5..e7275785a5 100644 --- a/rust/config/mainnet3_config.json +++ b/rust/config/mainnet3_config.json @@ -370,7 +370,108 @@ "protocolFee": "0x9c2214467Daf9e2e1F45b36d08ce0b9C65BFeA88", "validatorAnnounce": "0x87ED6926abc9E38b9C7C19f835B41943b622663c", "index": { - "from": 30715963 + "from": 30696004 + } + }, + "mantapacific": { + "protocol": "ethereum", + "domainId": 169, + "chainId": 169, + "name": "mantapacific", + "displayName": "Manta Pacific", + "displayNameShort": "Manta", + "nativeToken": { + "name": "Ether", + "symbol": "ETH", + "decimals": 18 + }, + "blocks": { + "confirmations": 1, + "reorgPeriod": 0, + "estimateBlockTime": 3 + }, + "rpcUrls": [ + { + "http": "https://pacific-rpc.manta.network/http" + } + ], + "isTestnet": false, + "merkleRootMultisigIsmFactory": "0x8F7454AC98228f3504Bb91eA3D8Adafe6406110A", + "messageIdMultisigIsmFactory": "0xEb9FcFDC9EfDC17c1EC5E1dc085B98485da213D6", + "aggregationIsmFactory": "0x1052eF3419f26Bec74Ed7CEf4a4FA6812Bc09908", + "aggregationHookFactory": "0x0761b0827849abbf7b0cC09CE14e1C93D87f5004", + "routingIsmFactory": "0x4Ed7d626f1E96cD1C0401607Bf70D95243E3dEd1", + "proxyAdmin": "0x2f2aFaE1139Ce54feFC03593FeE8AB2aDF4a85A7", + "mailbox": "0x3a464f746D23Ab22155710f44dB16dcA53e0775E", + "bsc": { + "merkleRootMultisigIsm": "0xeb4351CD48188F2BF3B2adB973ac1591C99Ea1Eb", + "messageIdMultisigIsm": "0x7fe658ef7970612241dA3E0C72baB85f483B7E05", + "staticAggregationIsm": "0x440f0539CF460215ef86354B9DaF2AE517aec083" + }, + "avalanche": { + "merkleRootMultisigIsm": "0x55a189Cf54F3A19Ec0e470D300B9E7154ce6b2BC", + "messageIdMultisigIsm": "0x8f818036434828EAbF24Ea5964C2C196B51F69E8", + "staticAggregationIsm": "0x85f6fee10DED6b15b4e36dC38786D1647d56abC6" + }, + "base": { + "merkleRootMultisigIsm": "0x6c2D1620fFa3eD98901fd83c271a13e8372a833d", + "messageIdMultisigIsm": "0x0b9eEb221AE7066a46eEcc00c0e4bf7166e78491", + "staticAggregationIsm": "0x2e51Cdb525b5037b8521BDaD9A3D53DD55c2e32a" + }, + "polygon": { + "merkleRootMultisigIsm": "0xcD73EEca505BA901D653b0a57d9dBE0E374a39C4", + "messageIdMultisigIsm": "0x5538dBd17Fc554800f8b2728666D4E07022d989a", + "staticAggregationIsm": "0x4648d8054b537EE7B5691a488bE507f7Bc8A7a56" + }, + "polygonzkevm": { + "merkleRootMultisigIsm": "0xb703caB3afD73582F7ea6F80CE88D3b2E3fF5AAD", + "messageIdMultisigIsm": "0x865269ae050F6dD1C6eF23CDcf0080456cC5Bd44", + "staticAggregationIsm": "0xe7f028152eD20602DABc23d02dfa1605d696816D" + }, + "scroll": { + "merkleRootMultisigIsm": "0xFFE674a8f561E13F784C58b6f93bEcEc418A9146", + "messageIdMultisigIsm": "0xE67D5867B520Dbe839659Ea90eDa0a52ccE36358", + "staticAggregationIsm": "0x3b67302cbEa46b80c3bD0fEFBeE854EA51BED13c" + }, + "celo": { + "merkleRootMultisigIsm": "0x424b047b25622b250351252Ee70897485c603582", + "messageIdMultisigIsm": "0x7a562ec8a36f124a3752673486feA0FAA3A0496b", + "staticAggregationIsm": "0xaEe6d2D15E6C9c273D62Ff03e04Efe68aE8A355C" + }, + "arbitrum": { + "merkleRootMultisigIsm": "0x08C0859B4DE164b942080dF136250F5e4e7b19cF", + "messageIdMultisigIsm": "0x28517474A13c327d2A9F837093a7D65338C2F0a5", + "staticAggregationIsm": "0x2727515b66AEA3f468948c0942DA469da2a7DC75" + }, + "optimism": { + "merkleRootMultisigIsm": "0x3848879abD1e07e1916fec8a3E9cE6075FC48d5e", + "messageIdMultisigIsm": "0x91e0d11Dd34DaFbEb716784D7127d799ec47964A", + "staticAggregationIsm": "0x7fb1c0288F8D9FFD16AB6161866C4de5ccb94C19" + }, + "ethereum": { + "merkleRootMultisigIsm": "0xe69de3fcAa6De26D3A3860E5E21aAaabFE70E9D1", + "messageIdMultisigIsm": "0x555b99a31935E985354332ea02014555520e0FbF", + "staticAggregationIsm": "0x4fde34B9F164cF1E945459b98e6085Fb4031535C" + }, + "moonbeam": { + "merkleRootMultisigIsm": "0xbeecDA79C392862003C9618dB6E37b4ee8C2e091", + "messageIdMultisigIsm": "0x44de3f39EB40f1a72F8A72cDF407e86274D9818d", + "staticAggregationIsm": "0x34e2233224eb4Bb938f24Cdb72D7a182B3074310" + }, + "gnosis": { + "merkleRootMultisigIsm": "0x1526dAFeDBfD375EEb69fAD0fD0DF94841A9B70B", + "messageIdMultisigIsm": "0x95d4d919d650F5f72A82fa4DEdf176616ec035CA", + "staticAggregationIsm": "0x5c3e9E58C852aF94dc9dF49c368619513f8E8D01" + }, + "domainRoutingIsm": "0xDEed16fe4b1c9b2a93483EDFf34C77A9b57D31Ff", + "storageGasOracle": "0x19dc38aeae620380430C200a6E990D5Af5480117", + "interchainGasPaymaster": "0x0D63128D887159d63De29497dfa45AFc7C699AE4", + "merkleTreeHook": "0x149db7afD694722747035d5AEC7007ccb6F8f112", + "aggregationHook": "0x8464aF853363B8d6844070F68b0AB34Cb6523d0F", + "protocolFee": "0xd83A4F747fE80Ed98839e05079B1B7Fe037b1638", + "validatorAnnounce": "0x2fa5F5C96419C222cDbCeC797D696e6cE428A7A9", + "index": { + "from": 437384 } }, "moonbeam": { diff --git a/typescript/infra/config/environments/mainnet3/chains.ts b/typescript/infra/config/environments/mainnet3/chains.ts index e3d9fc0772..4388137b23 100644 --- a/typescript/infra/config/environments/mainnet3/chains.ts +++ b/typescript/infra/config/environments/mainnet3/chains.ts @@ -41,6 +41,8 @@ export const ethereumMainnetConfigs: ChainMap = { }, moonbeam: chainMetadata.moonbeam, gnosis: chainMetadata.gnosis, + + mantapacific: chainMetadata.mantapacific, }; // Blessed non-Ethereum chains. @@ -51,7 +53,7 @@ export const nonEthereumMainnetConfigs: ChainMap = { export const mainnetConfigs: ChainMap = { ...ethereumMainnetConfigs, - ...nonEthereumMainnetConfigs, + // ...nonEthereumMainnetConfigs, }; export type MainnetChains = keyof typeof mainnetConfigs; diff --git a/typescript/infra/config/environments/mainnet3/core/verification.json b/typescript/infra/config/environments/mainnet3/core/verification.json index 1f81718f07..bee9dfbdf0 100644 --- a/typescript/infra/config/environments/mainnet3/core/verification.json +++ b/typescript/infra/config/environments/mainnet3/core/verification.json @@ -1288,5 +1288,85 @@ "constructorArguments": "0000000000000000000000005d934f4e2f797775e53561bb72aca21ba36b96bb", "isProxy": false } + ], + "mantapacific": [ + { + "name": "ProxyAdmin", + "address": "0x2f2aFaE1139Ce54feFC03593FeE8AB2aDF4a85A7", + "constructorArguments": "", + "isProxy": false + }, + { + "name": "Mailbox", + "address": "0xeA87ae93Fa0019a82A727bfd3eBd1cFCa8f64f1D", + "constructorArguments": "00000000000000000000000000000000000000000000000000000000000000a9", + "isProxy": false + }, + { + "name": "TransparentUpgradeableProxy", + "address": "0x3a464f746D23Ab22155710f44dB16dcA53e0775E", + "constructorArguments": "000000000000000000000000ea87ae93fa0019a82a727bfd3ebd1cfca8f64f1d0000000000000000000000002f2afae1139ce54fefc03593fee8ab2adf4a85a700000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000", + "isProxy": true + }, + { + "name": "MerkleTreeHook", + "address": "0x149db7afD694722747035d5AEC7007ccb6F8f112", + "constructorArguments": "0000000000000000000000003a464f746d23ab22155710f44db16dca53e0775e", + "isProxy": false + }, + { + "name": "StorageGasOracle", + "address": "0x19dc38aeae620380430C200a6E990D5Af5480117", + "constructorArguments": "", + "isProxy": false + }, + { + "name": "InterchainGasPaymaster", + "address": "0xBF12ef4B9f307463D3FB59c3604F294dDCe287E2", + "constructorArguments": "", + "isProxy": false + }, + { + "name": "TransparentUpgradeableProxy", + "address": "0x0D63128D887159d63De29497dfa45AFc7C699AE4", + "constructorArguments": "000000000000000000000000bf12ef4b9f307463d3fb59c3604f294ddce287e20000000000000000000000002f2afae1139ce54fefc03593fee8ab2adf4a85a700000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044485cc955000000000000000000000000a7eccdb9be08178f896c26b7bbd8c3d4e844d9ba000000000000000000000000a7eccdb9be08178f896c26b7bbd8c3d4e844d9ba00000000000000000000000000000000000000000000000000000000", + "isProxy": true + }, + { + "name": "MerkleTreeHook", + "address": "0x149db7afD694722747035d5AEC7007ccb6F8f112", + "constructorArguments": "0000000000000000000000003a464f746d23ab22155710f44db16dca53e0775e", + "isProxy": false + }, + { + "name": "StorageGasOracle", + "address": "0x19dc38aeae620380430C200a6E990D5Af5480117", + "constructorArguments": "", + "isProxy": false + }, + { + "name": "InterchainGasPaymaster", + "address": "0xBF12ef4B9f307463D3FB59c3604F294dDCe287E2", + "constructorArguments": "", + "isProxy": false + }, + { + "name": "TransparentUpgradeableProxy", + "address": "0x0D63128D887159d63De29497dfa45AFc7C699AE4", + "constructorArguments": "000000000000000000000000bf12ef4b9f307463d3fb59c3604f294ddce287e20000000000000000000000002f2afae1139ce54fefc03593fee8ab2adf4a85a700000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044485cc955000000000000000000000000a7eccdb9be08178f896c26b7bbd8c3d4e844d9ba000000000000000000000000a7eccdb9be08178f896c26b7bbd8c3d4e844d9ba00000000000000000000000000000000000000000000000000000000", + "isProxy": true + }, + { + "name": "ProtocolFee", + "address": "0xd83A4F747fE80Ed98839e05079B1B7Fe037b1638", + "constructorArguments": "000000000000000000000000000000000000000000000000000000003b9aca000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a7eccdb9be08178f896c26b7bbd8c3d4e844d9ba000000000000000000000000a7eccdb9be08178f896c26b7bbd8c3d4e844d9ba", + "isProxy": false + }, + { + "name": "ValidatorAnnounce", + "address": "0x2fa5F5C96419C222cDbCeC797D696e6cE428A7A9", + "constructorArguments": "0000000000000000000000003a464f746d23ab22155710f44db16dca53e0775e", + "isProxy": false + } ] } diff --git a/typescript/infra/config/environments/mainnet3/gas-oracle.ts b/typescript/infra/config/environments/mainnet3/gas-oracle.ts index d5031cb16d..e58dcaffd0 100644 --- a/typescript/infra/config/environments/mainnet3/gas-oracle.ts +++ b/typescript/infra/config/environments/mainnet3/gas-oracle.ts @@ -49,6 +49,7 @@ const gasPrices: ChainMap = { scroll: ethers.utils.parseUnits('1', 'gwei'), polygonzkevm: ethers.utils.parseUnits('2', 'gwei'), neutron: ethers.utils.parseUnits('1', 'gwei'), + mantapacific: ethers.utils.parseUnits('1', 'gwei'), }; // Accurate from coingecko as of Mar 9, 2023. @@ -86,6 +87,11 @@ const tokenUsdPrices: ChainMap = { ), // https://www.coingecko.com/en/coins/neutron neutron: ethers.utils.parseUnits('0.304396', TOKEN_EXCHANGE_RATE_DECIMALS), + // https://www.coingecko.com/en/coins/ethereum + mantapacific: ethers.utils.parseUnits( + '1619.00', + TOKEN_EXCHANGE_RATE_DECIMALS, + ), }; // Gets the exchange rate of the remote quoted in local tokens diff --git a/typescript/infra/config/environments/mainnet3/owners.ts b/typescript/infra/config/environments/mainnet3/owners.ts index 32dae82723..1b4b2a1a0e 100644 --- a/typescript/infra/config/environments/mainnet3/owners.ts +++ b/typescript/infra/config/environments/mainnet3/owners.ts @@ -16,6 +16,7 @@ export const safes: ChainMap
= { base: '', scroll: '', polygonzkevm: '', + mantapacific: '', }; // export const owners = safes; diff --git a/typescript/infra/config/routingIsm.ts b/typescript/infra/config/routingIsm.ts index e822ea7197..5c1e68e77f 100644 --- a/typescript/infra/config/routingIsm.ts +++ b/typescript/infra/config/routingIsm.ts @@ -42,7 +42,7 @@ export const routingIsm = ( context: Contexts, ): RoutingIsmConfig | string => { const aggregationIsms: ChainMap = chains[environment] - .filter((_) => _ !== local) + .filter((chain) => chain !== local) .reduce( (acc, chain) => ({ ...acc, diff --git a/typescript/sdk/src/consts/environments/mainnet.json b/typescript/sdk/src/consts/environments/mainnet.json index f9dea3adb4..653469c5ed 100644 --- a/typescript/sdk/src/consts/environments/mainnet.json +++ b/typescript/sdk/src/consts/environments/mainnet.json @@ -178,5 +178,81 @@ "protocolFee": "0xEc4AdA26E51f2685279F37C8aE62BeAd8212D597", "mailbox": "0xFf06aFcaABaDDd1fb08371f9ccA15D73D51FeBD6", "validatorAnnounce": "0x9Cad0eC82328CEE2386Ec14a12E81d070a27712f" + }, + "mantapacific": { + "merkleRootMultisigIsmFactory": "0x8F7454AC98228f3504Bb91eA3D8Adafe6406110A", + "messageIdMultisigIsmFactory": "0xEb9FcFDC9EfDC17c1EC5E1dc085B98485da213D6", + "aggregationIsmFactory": "0x1052eF3419f26Bec74Ed7CEf4a4FA6812Bc09908", + "aggregationHookFactory": "0x0761b0827849abbf7b0cC09CE14e1C93D87f5004", + "routingIsmFactory": "0x4Ed7d626f1E96cD1C0401607Bf70D95243E3dEd1", + "proxyAdmin": "0x2f2aFaE1139Ce54feFC03593FeE8AB2aDF4a85A7", + "mailbox": "0x3a464f746D23Ab22155710f44dB16dcA53e0775E", + "bsc": { + "merkleRootMultisigIsm": "0xeb4351CD48188F2BF3B2adB973ac1591C99Ea1Eb", + "messageIdMultisigIsm": "0x7fe658ef7970612241dA3E0C72baB85f483B7E05", + "staticAggregationIsm": "0x440f0539CF460215ef86354B9DaF2AE517aec083" + }, + "avalanche": { + "merkleRootMultisigIsm": "0x55a189Cf54F3A19Ec0e470D300B9E7154ce6b2BC", + "messageIdMultisigIsm": "0x8f818036434828EAbF24Ea5964C2C196B51F69E8", + "staticAggregationIsm": "0x85f6fee10DED6b15b4e36dC38786D1647d56abC6" + }, + "base": { + "merkleRootMultisigIsm": "0x6c2D1620fFa3eD98901fd83c271a13e8372a833d", + "messageIdMultisigIsm": "0x0b9eEb221AE7066a46eEcc00c0e4bf7166e78491", + "staticAggregationIsm": "0x2e51Cdb525b5037b8521BDaD9A3D53DD55c2e32a" + }, + "polygon": { + "merkleRootMultisigIsm": "0xcD73EEca505BA901D653b0a57d9dBE0E374a39C4", + "messageIdMultisigIsm": "0x5538dBd17Fc554800f8b2728666D4E07022d989a", + "staticAggregationIsm": "0x4648d8054b537EE7B5691a488bE507f7Bc8A7a56" + }, + "polygonzkevm": { + "merkleRootMultisigIsm": "0xb703caB3afD73582F7ea6F80CE88D3b2E3fF5AAD", + "messageIdMultisigIsm": "0x865269ae050F6dD1C6eF23CDcf0080456cC5Bd44", + "staticAggregationIsm": "0xe7f028152eD20602DABc23d02dfa1605d696816D" + }, + "scroll": { + "merkleRootMultisigIsm": "0xFFE674a8f561E13F784C58b6f93bEcEc418A9146", + "messageIdMultisigIsm": "0xE67D5867B520Dbe839659Ea90eDa0a52ccE36358", + "staticAggregationIsm": "0x3b67302cbEa46b80c3bD0fEFBeE854EA51BED13c" + }, + "celo": { + "merkleRootMultisigIsm": "0x424b047b25622b250351252Ee70897485c603582", + "messageIdMultisigIsm": "0x7a562ec8a36f124a3752673486feA0FAA3A0496b", + "staticAggregationIsm": "0xaEe6d2D15E6C9c273D62Ff03e04Efe68aE8A355C" + }, + "arbitrum": { + "merkleRootMultisigIsm": "0x08C0859B4DE164b942080dF136250F5e4e7b19cF", + "messageIdMultisigIsm": "0x28517474A13c327d2A9F837093a7D65338C2F0a5", + "staticAggregationIsm": "0x2727515b66AEA3f468948c0942DA469da2a7DC75" + }, + "optimism": { + "merkleRootMultisigIsm": "0x3848879abD1e07e1916fec8a3E9cE6075FC48d5e", + "messageIdMultisigIsm": "0x91e0d11Dd34DaFbEb716784D7127d799ec47964A", + "staticAggregationIsm": "0x7fb1c0288F8D9FFD16AB6161866C4de5ccb94C19" + }, + "ethereum": { + "merkleRootMultisigIsm": "0xe69de3fcAa6De26D3A3860E5E21aAaabFE70E9D1", + "messageIdMultisigIsm": "0x555b99a31935E985354332ea02014555520e0FbF", + "staticAggregationIsm": "0x4fde34B9F164cF1E945459b98e6085Fb4031535C" + }, + "moonbeam": { + "merkleRootMultisigIsm": "0xbeecDA79C392862003C9618dB6E37b4ee8C2e091", + "messageIdMultisigIsm": "0x44de3f39EB40f1a72F8A72cDF407e86274D9818d", + "staticAggregationIsm": "0x34e2233224eb4Bb938f24Cdb72D7a182B3074310" + }, + "gnosis": { + "merkleRootMultisigIsm": "0x1526dAFeDBfD375EEb69fAD0fD0DF94841A9B70B", + "messageIdMultisigIsm": "0x95d4d919d650F5f72A82fa4DEdf176616ec035CA", + "staticAggregationIsm": "0x5c3e9E58C852aF94dc9dF49c368619513f8E8D01" + }, + "domainRoutingIsm": "0xDEed16fe4b1c9b2a93483EDFf34C77A9b57D31Ff", + "storageGasOracle": "0x19dc38aeae620380430C200a6E990D5Af5480117", + "interchainGasPaymaster": "0x0D63128D887159d63De29497dfa45AFc7C699AE4", + "merkleTreeHook": "0x149db7afD694722747035d5AEC7007ccb6F8f112", + "aggregationHook": "0x8464aF853363B8d6844070F68b0AB34Cb6523d0F", + "protocolFee": "0xd83A4F747fE80Ed98839e05079B1B7Fe037b1638", + "validatorAnnounce": "0x2fa5F5C96419C222cDbCeC797D696e6cE428A7A9" } } From 921fa32309267ea9c6fb828f5c8807ce6393ddbc Mon Sep 17 00:00:00 2001 From: Nam Chu Hoai Date: Sun, 29 Oct 2023 15:53:01 -0400 Subject: [PATCH 12/38] Add Neutron config --- rust/config/mainnet3_config.json | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/rust/config/mainnet3_config.json b/rust/config/mainnet3_config.json index e7275785a5..3353e674a8 100644 --- a/rust/config/mainnet3_config.json +++ b/rust/config/mainnet3_config.json @@ -474,6 +474,29 @@ "from": 437384 } }, + "neutron": { + "name": "neutron", + "domainId": "1853125230", + "chainId": "neutron-1", + "mailbox": "0x848426d50eb2104d5c6381ec63757930b1c14659c40db8b8081e516e7c5238fc", + "interchainGasPaymaster": "0x504ee9ac43ec5814e00c7d21869a90ec52becb489636bdf893b7df9d606b5d67", + "validatorAnnounce": "0xf3aa0d652226e21ae35cd9035c492ae41725edc9036edf0d6a48701b153b90a0", + "merkleTreeHook": "0xcd30a0001cc1f436c41ef764a712ebabc5a144140e3fd03eafe64a9a24e4e27c", + "protocol": "cosmos", + "finalityBlocks": 1, + "rpcUrls": [ + { + "http": "https://rpc-kralum.neutron-1.neutron.org" + } + ], + "grpcUrl": "https://grpc-kralum.neutron-1.neutron.org:80", + "canonicalAsset": "untrn", + "prefix": "neutron", + "index": { + "from": 4000000, + "chunk": 100000 + } + }, "moonbeam": { "chainId": 1284, "domainId": 1284, From d754236e695dd6f49ec2fe21bcd06b179e36ba33 Mon Sep 17 00:00:00 2001 From: Trevor Porter Date: Sun, 29 Oct 2023 20:23:43 +0000 Subject: [PATCH 13/38] PR comments --- typescript/infra/src/agents/gcp.ts | 2 +- typescript/infra/src/config/agent/validator.ts | 2 +- typescript/sdk/src/consts/chainMetadata.ts | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/typescript/infra/src/agents/gcp.ts b/typescript/infra/src/agents/gcp.ts index f36f1d8fef..4ba314256e 100644 --- a/typescript/infra/src/agents/gcp.ts +++ b/typescript/infra/src/agents/gcp.ts @@ -106,7 +106,7 @@ export class AgentGCPKey extends CloudAgentKey { return Keypair.fromSeed( Buffer.from(strip0x(this.privateKey), 'hex'), ).publicKey.toBase58(); - case ProtocolType.CosmWasm: + case ProtocolType.Cosmos: const compressedPubkey = ethers.utils.computePublicKey( this.privateKey, true, diff --git a/typescript/infra/src/config/agent/validator.ts b/typescript/infra/src/config/agent/validator.ts index 288a0d0ca4..8d27d63bff 100644 --- a/typescript/infra/src/config/agent/validator.ts +++ b/typescript/infra/src/config/agent/validator.ts @@ -138,7 +138,7 @@ export class ValidatorConfigHelper extends AgentConfigHelper { case ProtocolType.Ethereum: chainSigner = validator; break; - case ProtocolType.CosmWasm: + case ProtocolType.Cosmos: if (metadata.prefix === undefined) { throw new Error( `Prefix for cosmos chain ${this.chainName} is undefined`, diff --git a/typescript/sdk/src/consts/chainMetadata.ts b/typescript/sdk/src/consts/chainMetadata.ts index 23fcdf1996..6dde01c2b0 100644 --- a/typescript/sdk/src/consts/chainMetadata.ts +++ b/typescript/sdk/src/consts/chainMetadata.ts @@ -1011,7 +1011,6 @@ export const neutrontestnet: ChainMetadata = { chainId: 33333, name: Chains.neutrontestnet, displayName: 'Neutron Testnet', - displayNameShort: 'Neutron Testnet', nativeToken: { name: 'Neutron', symbol: 'NTRN', From 6fec2b04e3aab7f60969ff34ab7afe5c0698fa5e Mon Sep 17 00:00:00 2001 From: Trevor Porter Date: Sun, 29 Oct 2023 21:14:27 +0000 Subject: [PATCH 14/38] Try deploy --- typescript/infra/config/environments/mainnet3/agent.ts | 5 ++++- typescript/infra/config/environments/mainnet3/chains.ts | 2 +- typescript/infra/scripts/agents/utils.ts | 7 ++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/typescript/infra/config/environments/mainnet3/agent.ts b/typescript/infra/config/environments/mainnet3/agent.ts index 2d8b84c670..9e33527f28 100644 --- a/typescript/infra/config/environments/mainnet3/agent.ts +++ b/typescript/infra/config/environments/mainnet3/agent.ts @@ -53,7 +53,10 @@ const hyperlane: RootAgentConfig = { }, chainDockerOverrides: { [chainMetadata.neutron.name]: { - tag: '7816e05-20231028-225509', + tag: 'e300482-20231029-202732', + }, + [chainMetadata.mantapacific.name]: { + tag: 'e300482-20231029-202732', }, }, rpcConsensusType: RpcConsensusType.Quorum, diff --git a/typescript/infra/config/environments/mainnet3/chains.ts b/typescript/infra/config/environments/mainnet3/chains.ts index 4388137b23..37e16cafdd 100644 --- a/typescript/infra/config/environments/mainnet3/chains.ts +++ b/typescript/infra/config/environments/mainnet3/chains.ts @@ -53,7 +53,7 @@ export const nonEthereumMainnetConfigs: ChainMap = { export const mainnetConfigs: ChainMap = { ...ethereumMainnetConfigs, - // ...nonEthereumMainnetConfigs, + ...nonEthereumMainnetConfigs, }; export type MainnetChains = keyof typeof mainnetConfigs; diff --git a/typescript/infra/scripts/agents/utils.ts b/typescript/infra/scripts/agents/utils.ts index c3949bef83..efb30c3798 100644 --- a/typescript/infra/scripts/agents/utils.ts +++ b/typescript/infra/scripts/agents/utils.ts @@ -34,7 +34,12 @@ export class AgentCli { switch (role) { case Role.Validator: for (const chain of this.agentConfig.contextChainNames[role]) { - if (chain !== 'neutrontestnet' && chain !== 'neutron') continue; + if ( + chain !== 'neutrontestnet' && + chain !== 'neutron' && + chain !== 'mantapacific' + ) + continue; const key = `${role}-${chain}`; managers[key] = new ValidatorHelmManager(this.agentConfig, chain); } From 8c8a802d2a54feb180d214e6a798d2234a037b8e Mon Sep 17 00:00:00 2001 From: Trevor Porter Date: Sun, 29 Oct 2023 21:40:43 +0000 Subject: [PATCH 15/38] Deploy --- .../config/environments/mainnet3/agent.ts | 20 +++++++++++++++++++ .../environments/mainnet3/infrastructure.ts | 1 + .../environments/mainnet3/validators.ts | 12 +++++++++-- typescript/sdk/src/consts/multisigIsm.ts | 12 +++++++++-- 4 files changed, 41 insertions(+), 4 deletions(-) diff --git a/typescript/infra/config/environments/mainnet3/agent.ts b/typescript/infra/config/environments/mainnet3/agent.ts index 9e33527f28..11516362d4 100644 --- a/typescript/infra/config/environments/mainnet3/agent.ts +++ b/typescript/infra/config/environments/mainnet3/agent.ts @@ -98,7 +98,27 @@ const releaseCandidate: RootAgentConfig = { }, }; +const neutron: RootAgentConfig = { + ...contextBase, + contextChainNames: { + validator: [], + relayer: [chainMetadata.neutron.name, chainMetadata.mantapacific.name], + scraper: [], + }, + context: Contexts.Neutron, + rolesWithKeys: [Role.Relayer], + relayer: { + rpcConsensusType: RpcConsensusType.Fallback, + docker: { + repo, + tag: 'e300482-20231029-202732', + }, + gasPaymentEnforcement, + }, +}; + export const agents = { [Contexts.Hyperlane]: hyperlane, [Contexts.ReleaseCandidate]: releaseCandidate, + [Contexts.Neutron]: neutron, }; diff --git a/typescript/infra/config/environments/mainnet3/infrastructure.ts b/typescript/infra/config/environments/mainnet3/infrastructure.ts index c0d562f91b..f123829482 100644 --- a/typescript/infra/config/environments/mainnet3/infrastructure.ts +++ b/typescript/infra/config/environments/mainnet3/infrastructure.ts @@ -40,6 +40,7 @@ export const infrastructure: InfrastructureConfig = { 'mainnet2-', 'hyperlane-mainnet3-', 'rc-mainnet3-', + 'neutron-mainnet3-', 'mainnet3-', ], }, diff --git a/typescript/infra/config/environments/mainnet3/validators.ts b/typescript/infra/config/environments/mainnet3/validators.ts index fe9aae1f56..fbbc255f64 100644 --- a/typescript/infra/config/environments/mainnet3/validators.ts +++ b/typescript/infra/config/environments/mainnet3/validators.ts @@ -200,7 +200,11 @@ export const validatorChainConfig = ( reorgPeriod: 0, validators: validatorsConfig( { - [Contexts.Hyperlane]: ['', '', ''], + [Contexts.Hyperlane]: [ + '0xa9b8c1f4998f781f958c63cfcd1708d02f004ff0', + '0x60e890b34cb44ce3fa52f38684f613f31b47a1a6', + '0x7885fae56dbcf5176657f54adbbd881dc6714132', + ], [Contexts.ReleaseCandidate]: [], [Contexts.Neutron]: [], }, @@ -212,7 +216,11 @@ export const validatorChainConfig = ( reorgPeriod: 0, validators: validatorsConfig( { - [Contexts.Hyperlane]: ['', '', ''], + [Contexts.Hyperlane]: [ + '0x8e668c97ad76d0e28375275c41ece4972ab8a5bc', + '0x80afdde2a81f3fb056fd088a97f0af3722dbc4f3', + '0x5dda0c4cf18de3b3ab637f8df82b24921082b54c', + ], [Contexts.ReleaseCandidate]: [], [Contexts.Neutron]: [], }, diff --git a/typescript/sdk/src/consts/multisigIsm.ts b/typescript/sdk/src/consts/multisigIsm.ts index b76a6a26ce..5fca3087ee 100644 --- a/typescript/sdk/src/consts/multisigIsm.ts +++ b/typescript/sdk/src/consts/multisigIsm.ts @@ -236,10 +236,18 @@ export const defaultMultisigIsmConfigs: ChainMap = { }, neutron: { threshold: 2, - validators: ['', '', ''], + validators: [ + '0xa9b8c1f4998f781f958c63cfcd1708d02f004ff0', + '0x60e890b34cb44ce3fa52f38684f613f31b47a1a6', + '0x7885fae56dbcf5176657f54adbbd881dc6714132', + ], }, mantapacific: { threshold: 2, - validators: ['', '', ''], + validators: [ + '0x8e668c97ad76d0e28375275c41ece4972ab8a5bc', + '0x80afdde2a81f3fb056fd088a97f0af3722dbc4f3', + '0x5dda0c4cf18de3b3ab637f8df82b24921082b54c', + ], }, }; From 5f85a754e8d99d4cb069b9fec26ed02696b9bd98 Mon Sep 17 00:00:00 2001 From: Trevor Porter Date: Mon, 30 Oct 2023 09:43:44 +0000 Subject: [PATCH 16/38] More PR comments --- typescript/infra/src/config/agent/validator.ts | 6 +++--- typescript/sdk/src/consts/chainMetadata.ts | 8 ++++++-- typescript/sdk/src/metadata/chainMetadataTypes.ts | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/typescript/infra/src/config/agent/validator.ts b/typescript/infra/src/config/agent/validator.ts index 8d27d63bff..5e3d2a15b5 100644 --- a/typescript/infra/src/config/agent/validator.ts +++ b/typescript/infra/src/config/agent/validator.ts @@ -139,14 +139,14 @@ export class ValidatorConfigHelper extends AgentConfigHelper { chainSigner = validator; break; case ProtocolType.Cosmos: - if (metadata.prefix === undefined) { + if (metadata.bech32Prefix === undefined) { throw new Error( - `Prefix for cosmos chain ${this.chainName} is undefined`, + `Bech32 prefix for cosmos chain ${this.chainName} is undefined`, ); } chainSigner = { type: AgentSignerKeyType.Cosmos, - prefix: metadata.prefix, + prefix: metadata.bech32Prefix, }; break; // No self-announcement on Sealevel diff --git a/typescript/sdk/src/consts/chainMetadata.ts b/typescript/sdk/src/consts/chainMetadata.ts index 6dde01c2b0..cce1c8a8eb 100644 --- a/typescript/sdk/src/consts/chainMetadata.ts +++ b/typescript/sdk/src/consts/chainMetadata.ts @@ -1021,9 +1021,13 @@ export const neutrontestnet: ChainMetadata = { reorgPeriod: 0, estimateBlockTime: 3, }, - rpcUrls: [{ http: 'http://54.149.31.83:26657' }], + // First URL RPC, second REST + rpcUrls: [ + { http: 'http://54.149.31.83:26657' }, + { http: 'http://54.149.31.83:1317' }, + ], + bech32Prefix: 'dual', isTestnet: true, - prefix: 'dual', }; /** diff --git a/typescript/sdk/src/metadata/chainMetadataTypes.ts b/typescript/sdk/src/metadata/chainMetadataTypes.ts index ba73a40394..a6e814d462 100644 --- a/typescript/sdk/src/metadata/chainMetadataTypes.ts +++ b/typescript/sdk/src/metadata/chainMetadataTypes.ts @@ -171,7 +171,7 @@ export const ChainMetadataSchemaObject = z.object({ .optional() .describe('Whether the chain is considered a testnet or a mainnet.'), // TODO we should have a better policy for protocol-specific configurations - prefix: z + bech32Prefix: z .string() .optional() .describe('The prefix for a Cosmos address, e.g. osmo'), From 8056b46e74ad04647a6abebfbbbcf3ae65bad529 Mon Sep 17 00:00:00 2001 From: Trevor Porter Date: Mon, 30 Oct 2023 09:56:34 +0000 Subject: [PATCH 17/38] Fix gnosis from block --- rust/config/mainnet3_config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/config/mainnet3_config.json b/rust/config/mainnet3_config.json index 3353e674a8..97a8a81849 100644 --- a/rust/config/mainnet3_config.json +++ b/rust/config/mainnet3_config.json @@ -370,7 +370,7 @@ "protocolFee": "0x9c2214467Daf9e2e1F45b36d08ce0b9C65BFeA88", "validatorAnnounce": "0x87ED6926abc9E38b9C7C19f835B41943b622663c", "index": { - "from": 30696004 + "from": 30623434 } }, "mantapacific": { From 844aaa9602f2160d3b5d21fab98a5dc83fc372c8 Mon Sep 17 00:00:00 2001 From: Trevor Porter Date: Mon, 30 Oct 2023 10:11:13 +0000 Subject: [PATCH 18/38] Update new images --- .../hyperlane-agent/templates/relayer-external-secret.yaml | 1 + typescript/infra/config/environments/mainnet3/agent.ts | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/rust/helm/hyperlane-agent/templates/relayer-external-secret.yaml b/rust/helm/hyperlane-agent/templates/relayer-external-secret.yaml index 3bcd4f5a95..2dc33fe34c 100644 --- a/rust/helm/hyperlane-agent/templates/relayer-external-secret.yaml +++ b/rust/helm/hyperlane-agent/templates/relayer-external-secret.yaml @@ -24,6 +24,7 @@ spec: {{- range .Values.hyperlane.relayerChains }} {{- if or (eq .signer.type "hexKey") (eq .signer.type "cosmosKey") }} HYP_CHAINS_{{ .name | upper }}_SIGNER_KEY: {{ printf "'{{ .%s_signer_key | toString }}'" .name }} + {{- include "agent-common.config-env-vars" (dict "config" . "format" "config_map" "key_name_prefix" (printf "CHAINS_%s_SIGNER_" (.name | upper))) | nindent 8 }} {{- end }} {{- if and (eq .signer.type "aws") $.Values.hyperlane.relayer.aws }} HYP_CHAINS_{{ .name | upper }}_SIGNER_TYPE: aws diff --git a/typescript/infra/config/environments/mainnet3/agent.ts b/typescript/infra/config/environments/mainnet3/agent.ts index 11516362d4..a972fb5496 100644 --- a/typescript/infra/config/environments/mainnet3/agent.ts +++ b/typescript/infra/config/environments/mainnet3/agent.ts @@ -53,10 +53,10 @@ const hyperlane: RootAgentConfig = { }, chainDockerOverrides: { [chainMetadata.neutron.name]: { - tag: 'e300482-20231029-202732', + tag: '31822d0-20231030-003417', }, [chainMetadata.mantapacific.name]: { - tag: 'e300482-20231029-202732', + tag: '31822d0-20231030-003417', }, }, rpcConsensusType: RpcConsensusType.Quorum, @@ -111,7 +111,7 @@ const neutron: RootAgentConfig = { rpcConsensusType: RpcConsensusType.Fallback, docker: { repo, - tag: 'e300482-20231029-202732', + tag: '31822d0-20231030-003417', }, gasPaymentEnforcement, }, From 20598bbd7b7e5d7d2a2a4121fb2adde1db03cf8d Mon Sep 17 00:00:00 2001 From: Trevor Porter Date: Mon, 30 Oct 2023 11:21:02 +0000 Subject: [PATCH 19/38] Touchups --- .../templates/relayer-external-secret.yaml | 2 +- .../config/environments/mainnet3/chains.ts | 16 +++---- .../config/environments/testnet4/agent.ts | 4 +- .../config/environments/testnet4/chains.ts | 9 ++-- typescript/infra/scripts/agents/utils.ts | 24 +++++----- typescript/infra/src/config/agent/agent.ts | 21 +++++++++ typescript/infra/src/config/agent/relayer.ts | 44 +++++++++++-------- .../infra/src/config/agent/validator.ts | 14 +++++- 8 files changed, 82 insertions(+), 52 deletions(-) diff --git a/rust/helm/hyperlane-agent/templates/relayer-external-secret.yaml b/rust/helm/hyperlane-agent/templates/relayer-external-secret.yaml index 2dc33fe34c..c9bcd9a27d 100644 --- a/rust/helm/hyperlane-agent/templates/relayer-external-secret.yaml +++ b/rust/helm/hyperlane-agent/templates/relayer-external-secret.yaml @@ -24,7 +24,7 @@ spec: {{- range .Values.hyperlane.relayerChains }} {{- if or (eq .signer.type "hexKey") (eq .signer.type "cosmosKey") }} HYP_CHAINS_{{ .name | upper }}_SIGNER_KEY: {{ printf "'{{ .%s_signer_key | toString }}'" .name }} - {{- include "agent-common.config-env-vars" (dict "config" . "format" "config_map" "key_name_prefix" (printf "CHAINS_%s_SIGNER_" (.name | upper))) | nindent 8 }} + {{- include "agent-common.config-env-vars" (dict "config" .signer "format" "config_map" "key_name_prefix" (printf "CHAINS_%s_SIGNER_" (.name | upper))) | nindent 8 }} {{- end }} {{- if and (eq .signer.type "aws") $.Values.hyperlane.relayer.aws }} HYP_CHAINS_{{ .name | upper }}_SIGNER_TYPE: aws diff --git a/typescript/infra/config/environments/mainnet3/chains.ts b/typescript/infra/config/environments/mainnet3/chains.ts index 37e16cafdd..a6b3584355 100644 --- a/typescript/infra/config/environments/mainnet3/chains.ts +++ b/typescript/infra/config/environments/mainnet3/chains.ts @@ -41,7 +41,6 @@ export const ethereumMainnetConfigs: ChainMap = { }, moonbeam: chainMetadata.moonbeam, gnosis: chainMetadata.gnosis, - mantapacific: chainMetadata.mantapacific, }; @@ -66,16 +65,11 @@ export const ethereumChainNames = Object.keys( ethereumMainnetConfigs, ) as MainnetChains[]; -const validatorChainNames = [ - ...supportedChainNames, - // chainMetadata.solana.name, - // chainMetadata.nautilus.name, -]; - -const relayerChainNames = validatorChainNames; - +// Hyperlane & RC context agent chain names. export const agentChainNames: AgentChainNames = { - [Role.Validator]: validatorChainNames, - [Role.Relayer]: relayerChainNames, + // Run validators for all chains. + [Role.Validator]: supportedChainNames, + // Only run relayers for Ethereum chains at the moment. + [Role.Relayer]: ethereumChainNames, [Role.Scraper]: ethereumChainNames, }; diff --git a/typescript/infra/config/environments/testnet4/agent.ts b/typescript/infra/config/environments/testnet4/agent.ts index 49eb4c8065..f44b5c6b37 100644 --- a/typescript/infra/config/environments/testnet4/agent.ts +++ b/typescript/infra/config/environments/testnet4/agent.ts @@ -71,7 +71,7 @@ const hyperlane: RootAgentConfig = { }, chainDockerOverrides: { neutrontestnet: { - tag: 'eea130c-20231027-115055', + tag: '31822d0-20231030-003417', }, }, chains: validatorChainConfig(Contexts.Hyperlane), @@ -125,7 +125,7 @@ const neutron: RootAgentConfig = { rpcConsensusType: RpcConsensusType.Fallback, docker: { repo, - tag: 'eea130c-20231027-115055', + tag: '31822d0-20231030-003417', }, gasPaymentEnforcement, transactionGasLimit: 750000, diff --git a/typescript/infra/config/environments/testnet4/chains.ts b/typescript/infra/config/environments/testnet4/chains.ts index 0589b068b3..dd9e827ea8 100644 --- a/typescript/infra/config/environments/testnet4/chains.ts +++ b/typescript/infra/config/environments/testnet4/chains.ts @@ -44,11 +44,12 @@ export const environment = 'testnet4'; export const ethereumChainNames = Object.keys( ethereumTestnetConfigs, ) as TestnetChains[]; -const validatorChainNames = supportedChainNames; -const relayerChainNames = validatorChainNames; +// Hyperlane & RC context agent chain names. export const agentChainNames: AgentChainNames = { - [Role.Validator]: validatorChainNames, - [Role.Relayer]: relayerChainNames, + // Run validators for all chains. + [Role.Validator]: supportedChainNames, + // Only run relayers for Ethereum chains at the moment. + [Role.Relayer]: ethereumChainNames, [Role.Scraper]: ethereumChainNames, }; diff --git a/typescript/infra/scripts/agents/utils.ts b/typescript/infra/scripts/agents/utils.ts index efb30c3798..1fc1bcb356 100644 --- a/typescript/infra/scripts/agents/utils.ts +++ b/typescript/infra/scripts/agents/utils.ts @@ -24,6 +24,8 @@ export class AgentCli { agentConfig!: RootAgentConfig; initialized = false; dryRun = false; + // Whether to run deployments in parallel + parallel = false; public async runHelmCommand(command: HelmCommand) { await this.init(); @@ -34,12 +36,6 @@ export class AgentCli { switch (role) { case Role.Validator: for (const chain of this.agentConfig.contextChainNames[role]) { - if ( - chain !== 'neutrontestnet' && - chain !== 'neutron' && - chain !== 'mantapacific' - ) - continue; const key = `${role}-${chain}`; managers[key] = new ValidatorHelmManager(this.agentConfig, chain); } @@ -67,21 +63,21 @@ export class AgentCli { } } - protected async init( - argv?: GetConfigsArgv & { role: Role[]; 'dry-run'?: boolean }, - ) { + protected async init() { if (this.initialized) return; - if (!argv) - argv = await withAgentRole(withContext(getArgs())) - .describe('dry-run', 'Run through the steps without making any changes') - .boolean('dry-run').argv; + const argv = await withAgentRole(withContext(getArgs())) + .describe('dry-run', 'Run through the steps without making any changes') + .boolean('dry-run') + .describe('parallel', 'Whether to run deployments in parallel') + .boolean('parallel').argv; const { envConfig, agentConfig } = await getConfigsBasedOnArgs(argv); await assertCorrectKubeContext(envConfig); this.roles = argv.role; this.envConfig = envConfig; this.agentConfig = agentConfig; - this.dryRun = argv['dry-run'] || false; + this.dryRun = argv.dryRun || false; + this.parallel = argv.parallel || false; this.initialized = true; } } diff --git a/typescript/infra/src/config/agent/agent.ts b/typescript/infra/src/config/agent/agent.ts index 630e3fb4c9..d53e68e056 100644 --- a/typescript/infra/src/config/agent/agent.ts +++ b/typescript/infra/src/config/agent/agent.ts @@ -4,7 +4,9 @@ import { AgentSignerKeyType, ChainName, RpcConsensusType, + chainMetadata, } from '@hyperlane-xyz/sdk'; +import { ProtocolType } from '@hyperlane-xyz/utils'; import { Contexts } from '../../../config/contexts'; import { AgentChainNames, Role } from '../../roles'; @@ -186,3 +188,22 @@ export abstract class AgentConfigHelper export const allAgentChainNames = (agentChainNames: AgentChainNames) => [ ...new Set(Object.values(agentChainNames).reduce((a, b) => a.concat(b), [])), ]; + +// Returns the default KeyConfig for the `chainName`'s chain signer. +// For Ethereum or Sealevel, this is a hexKey, for Cosmos, this is a cosmosKey. +export function defaultChainSignerKeyConfig(chainName: ChainName): KeyConfig { + const metadata = chainMetadata[chainName]; + + switch (metadata?.protocol) { + case ProtocolType.Cosmos: + if (metadata.bech32Prefix === undefined) { + throw new Error(`Bech32 prefix for cosmos chain ${name} is undefined`); + } + return { type: AgentSignerKeyType.Cosmos, prefix: metadata.bech32Prefix }; + // For Ethereum and Sealevel, use a hex key + case ProtocolType.Ethereum: + case ProtocolType.Sealevel: + default: + return { type: AgentSignerKeyType.Hex }; + } +} diff --git a/typescript/infra/src/config/agent/relayer.ts b/typescript/infra/src/config/agent/relayer.ts index 667066bff1..b7821c47c7 100644 --- a/typescript/infra/src/config/agent/relayer.ts +++ b/typescript/infra/src/config/agent/relayer.ts @@ -16,7 +16,12 @@ import { AgentAwsUser } from '../../agents/aws'; import { Role } from '../../roles'; import { HelmStatefulSetValues } from '../infrastructure'; -import { AgentConfigHelper, KeyConfig, RootAgentConfig } from './agent'; +import { + AgentConfigHelper, + KeyConfig, + RootAgentConfig, + defaultChainSignerKeyConfig, +} from './agent'; export { GasPaymentEnforcement as GasPaymentEnforcementConfig } from '@hyperlane-xyz/sdk'; @@ -84,6 +89,8 @@ export class RelayerConfigHelper extends AgentConfigHelper { // Get the signer configuration for each chain by the chain name. async signers(): Promise> { + let chainSigners: ChainMap = {}; + if (this.aws) { const awsUser = new AgentAwsUser( this.runEnv, @@ -93,25 +100,24 @@ export class RelayerConfigHelper extends AgentConfigHelper { ); await awsUser.createIfNotExists(); const awsKey = (await awsUser.createKeyIfNotExists(this)).keyConfig; - return Object.fromEntries( - this.contextChainNames[Role.Relayer].map((name) => { - const chain = chainMetadata[name]; - if (chain?.protocol === ProtocolType.Ethereum) { - return [name, awsKey]; - } else { - // Non-ethereum chains always use hex keys - return [name, { type: AgentSignerKeyType.Hex }]; - } - }), - ); - } else { - return Object.fromEntries( - this.contextChainNames[Role.Relayer].map((name) => [ - name, - { type: AgentSignerKeyType.Hex }, - ]), - ); + + // AWS keys only work for Ethereum chains + for (const chainName of this.relayChains) { + if (chainMetadata[chainName].protocol === ProtocolType.Ethereum) { + chainSigners[chainName] = awsKey; + } + } } + + // For any chains that were not configured with AWS keys, fill in the defaults + for (const chainName of this.relayChains) { + if (chainSigners[chainName] !== undefined) { + continue; + } + chainSigners[chainName] = defaultChainSignerKeyConfig(chainName); + } + + return chainSigners; } // Returns whether the relayer requires AWS credentials diff --git a/typescript/infra/src/config/agent/validator.ts b/typescript/infra/src/config/agent/validator.ts index 5e3d2a15b5..6a671fb223 100644 --- a/typescript/infra/src/config/agent/validator.ts +++ b/typescript/infra/src/config/agent/validator.ts @@ -12,7 +12,12 @@ import { AgentAwsUser, ValidatorAgentAwsUser } from '../../agents/aws'; import { Role } from '../../roles'; import { HelmStatefulSetValues } from '../infrastructure'; -import { AgentConfigHelper, KeyConfig, RootAgentConfig } from './agent'; +import { + AgentConfigHelper, + KeyConfig, + RootAgentConfig, + defaultChainSignerKeyConfig, +} from './agent'; // Validator agents for each chain. export type ValidatorBaseChainConfigMap = ChainMap; @@ -162,6 +167,13 @@ export class ValidatorConfigHelper extends AgentConfigHelper { ); } + // If the chainSigner isn't set to the AWS-based key above, then set the default. + // There is no self-announcement on Sealevel, so in that case we just skip the + // chain signer altogether + if (chainSigner === undefined && protocol !== ProtocolType.Sealevel) { + chainSigner = defaultChainSignerKeyConfig(this.chainName); + } + return { checkpointSyncer: cfg.checkpointSyncer, validator, From 451d874badc37fcedf92dfbd5b88f6b1a206868f Mon Sep 17 00:00:00 2001 From: Trevor Porter Date: Mon, 30 Oct 2023 11:31:30 +0000 Subject: [PATCH 20/38] Cleanup --- typescript/infra/src/agents/index.ts | 5 +++-- typescript/infra/src/agents/key-utils.ts | 7 +------ typescript/infra/src/utils/utils.ts | 7 ++++++- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/typescript/infra/src/agents/index.ts b/typescript/infra/src/agents/index.ts index 77cd8d0c30..8c3d5927a8 100644 --- a/typescript/infra/src/agents/index.ts +++ b/typescript/infra/src/agents/index.ts @@ -22,7 +22,7 @@ import { buildHelmChartDependencies, helmifyValues, } from '../utils/helm'; -import { execCmd } from '../utils/utils'; +import { execCmd, isNotEthereumProtocolChain } from '../utils/utils'; import { AgentGCPKey } from './gcp'; @@ -132,7 +132,8 @@ export abstract class AgentHelmManager { } rpcConsensusType(chain: ChainName): RpcConsensusType { - if (chainMetadata[chain].protocol !== ProtocolType.Ethereum) { + // Non-Ethereum chains only support Single + if (isNotEthereumProtocolChain(chain)) { return RpcConsensusType.Single; } diff --git a/typescript/infra/src/agents/key-utils.ts b/typescript/infra/src/agents/key-utils.ts index ba6efe4a25..70705ff711 100644 --- a/typescript/infra/src/agents/key-utils.ts +++ b/typescript/infra/src/agents/key-utils.ts @@ -9,7 +9,7 @@ import { } from '../config'; import { Role } from '../roles'; import { fetchGCPSecret, setGCPSecret } from '../utils/gcloud'; -import { execCmd } from '../utils/utils'; +import { execCmd, isNotEthereumProtocolChain } from '../utils/utils'; import { AgentAwsKey } from './aws/key'; import { AgentGCPKey } from './gcp'; @@ -260,8 +260,3 @@ function addressesIdentifier( ) { return `${context}-${environment}-key-addresses`; } - -function isNotEthereumProtocolChain(chainName: ChainName) { - if (!chainMetadata[chainName]) throw new Error(`Unknown chain ${chainName}`); - return chainMetadata[chainName].protocol !== ProtocolType.Ethereum; -} diff --git a/typescript/infra/src/utils/utils.ts b/typescript/infra/src/utils/utils.ts index 1a8a79f8e5..92db7a7f56 100644 --- a/typescript/infra/src/utils/utils.ts +++ b/typescript/infra/src/utils/utils.ts @@ -11,7 +11,7 @@ import { CoreChainName, chainMetadata, } from '@hyperlane-xyz/sdk'; -import { objMerge } from '@hyperlane-xyz/utils'; +import { ProtocolType, objMerge } from '@hyperlane-xyz/utils'; import { Contexts } from '../../config/contexts'; import { Role } from '../roles'; @@ -273,3 +273,8 @@ export function mustGetChainNativeTokenDecimals(chain: ChainName): number { } return metadata.nativeToken.decimals; } + +export function isNotEthereumProtocolChain(chainName: ChainName) { + if (!chainMetadata[chainName]) throw new Error(`Unknown chain ${chainName}`); + return chainMetadata[chainName].protocol !== ProtocolType.Ethereum; +} From 711cb8da9e6119562c122664ca3c02db32accab5 Mon Sep 17 00:00:00 2001 From: Trevor Porter Date: Mon, 30 Oct 2023 11:35:03 +0000 Subject: [PATCH 21/38] Cleanin --- .../infra/src/config/agent/validator.ts | 27 +++---------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/typescript/infra/src/config/agent/validator.ts b/typescript/infra/src/config/agent/validator.ts index 6a671fb223..cfc8a57d20 100644 --- a/typescript/infra/src/config/agent/validator.ts +++ b/typescript/infra/src/config/agent/validator.ts @@ -139,26 +139,9 @@ export class ValidatorConfigHelper extends AgentConfigHelper { if (this.aws) { validator = (await awsUser.createKeyIfNotExists(this)).keyConfig; - switch (protocol) { - case ProtocolType.Ethereum: - chainSigner = validator; - break; - case ProtocolType.Cosmos: - if (metadata.bech32Prefix === undefined) { - throw new Error( - `Bech32 prefix for cosmos chain ${this.chainName} is undefined`, - ); - } - chainSigner = { - type: AgentSignerKeyType.Cosmos, - prefix: metadata.bech32Prefix, - }; - break; - // No self-announcement on Sealevel - case ProtocolType.Sealevel: - default: - chainSigner = undefined; - break; + // AWS-based chain signer keys are only used for Ethereum + if (protocol === ProtocolType.Ethereum) { + chainSigner = validator; } } } else { @@ -168,9 +151,7 @@ export class ValidatorConfigHelper extends AgentConfigHelper { } // If the chainSigner isn't set to the AWS-based key above, then set the default. - // There is no self-announcement on Sealevel, so in that case we just skip the - // chain signer altogether - if (chainSigner === undefined && protocol !== ProtocolType.Sealevel) { + if (chainSigner === undefined) { chainSigner = defaultChainSignerKeyConfig(this.chainName); } From e2e6e5d62c656938af7b93db044cd927aa88a2dc Mon Sep 17 00:00:00 2001 From: Trevor Porter Date: Mon, 30 Oct 2023 15:49:49 +0000 Subject: [PATCH 22/38] new images --- typescript/infra/config/environments/mainnet3/agent.ts | 6 +++--- typescript/infra/config/environments/testnet4/agent.ts | 4 ++-- typescript/infra/scripts/agents/utils.ts | 7 +------ 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/typescript/infra/config/environments/mainnet3/agent.ts b/typescript/infra/config/environments/mainnet3/agent.ts index a972fb5496..4281a8c80e 100644 --- a/typescript/infra/config/environments/mainnet3/agent.ts +++ b/typescript/infra/config/environments/mainnet3/agent.ts @@ -53,10 +53,10 @@ const hyperlane: RootAgentConfig = { }, chainDockerOverrides: { [chainMetadata.neutron.name]: { - tag: '31822d0-20231030-003417', + tag: 'dd370cb-20231030-120127', }, [chainMetadata.mantapacific.name]: { - tag: '31822d0-20231030-003417', + tag: 'dd370cb-20231030-120127', }, }, rpcConsensusType: RpcConsensusType.Quorum, @@ -111,7 +111,7 @@ const neutron: RootAgentConfig = { rpcConsensusType: RpcConsensusType.Fallback, docker: { repo, - tag: '31822d0-20231030-003417', + tag: 'dd370cb-20231030-120127', }, gasPaymentEnforcement, }, diff --git a/typescript/infra/config/environments/testnet4/agent.ts b/typescript/infra/config/environments/testnet4/agent.ts index f44b5c6b37..d0aebb57c2 100644 --- a/typescript/infra/config/environments/testnet4/agent.ts +++ b/typescript/infra/config/environments/testnet4/agent.ts @@ -71,7 +71,7 @@ const hyperlane: RootAgentConfig = { }, chainDockerOverrides: { neutrontestnet: { - tag: '31822d0-20231030-003417', + tag: 'dd370cb-20231030-120127', }, }, chains: validatorChainConfig(Contexts.Hyperlane), @@ -125,7 +125,7 @@ const neutron: RootAgentConfig = { rpcConsensusType: RpcConsensusType.Fallback, docker: { repo, - tag: '31822d0-20231030-003417', + tag: 'dd370cb-20231030-120127', }, gasPaymentEnforcement, transactionGasLimit: 750000, diff --git a/typescript/infra/scripts/agents/utils.ts b/typescript/infra/scripts/agents/utils.ts index 1fc1bcb356..2bd9a3ad7c 100644 --- a/typescript/infra/scripts/agents/utils.ts +++ b/typescript/infra/scripts/agents/utils.ts @@ -24,8 +24,6 @@ export class AgentCli { agentConfig!: RootAgentConfig; initialized = false; dryRun = false; - // Whether to run deployments in parallel - parallel = false; public async runHelmCommand(command: HelmCommand) { await this.init(); @@ -67,9 +65,7 @@ export class AgentCli { if (this.initialized) return; const argv = await withAgentRole(withContext(getArgs())) .describe('dry-run', 'Run through the steps without making any changes') - .boolean('dry-run') - .describe('parallel', 'Whether to run deployments in parallel') - .boolean('parallel').argv; + .boolean('dry-run').argv; const { envConfig, agentConfig } = await getConfigsBasedOnArgs(argv); await assertCorrectKubeContext(envConfig); @@ -77,7 +73,6 @@ export class AgentCli { this.envConfig = envConfig; this.agentConfig = agentConfig; this.dryRun = argv.dryRun || false; - this.parallel = argv.parallel || false; this.initialized = true; } } From 29e503522e3b5d9f341ea23dc63e96a27ac5b769 Mon Sep 17 00:00:00 2001 From: Trevor Porter Date: Tue, 31 Oct 2023 14:35:23 +0000 Subject: [PATCH 23/38] Update image --- typescript/infra/config/environments/mainnet3/agent.ts | 6 +++--- typescript/infra/config/environments/testnet4/agent.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/typescript/infra/config/environments/mainnet3/agent.ts b/typescript/infra/config/environments/mainnet3/agent.ts index 4281a8c80e..78698d0906 100644 --- a/typescript/infra/config/environments/mainnet3/agent.ts +++ b/typescript/infra/config/environments/mainnet3/agent.ts @@ -53,10 +53,10 @@ const hyperlane: RootAgentConfig = { }, chainDockerOverrides: { [chainMetadata.neutron.name]: { - tag: 'dd370cb-20231030-120127', + tag: 'f47d6ab-20231031-124004', }, [chainMetadata.mantapacific.name]: { - tag: 'dd370cb-20231030-120127', + tag: 'f47d6ab-20231031-124004', }, }, rpcConsensusType: RpcConsensusType.Quorum, @@ -111,7 +111,7 @@ const neutron: RootAgentConfig = { rpcConsensusType: RpcConsensusType.Fallback, docker: { repo, - tag: 'dd370cb-20231030-120127', + tag: 'f47d6ab-20231031-124004', }, gasPaymentEnforcement, }, diff --git a/typescript/infra/config/environments/testnet4/agent.ts b/typescript/infra/config/environments/testnet4/agent.ts index d0aebb57c2..065239e1bb 100644 --- a/typescript/infra/config/environments/testnet4/agent.ts +++ b/typescript/infra/config/environments/testnet4/agent.ts @@ -71,7 +71,7 @@ const hyperlane: RootAgentConfig = { }, chainDockerOverrides: { neutrontestnet: { - tag: 'dd370cb-20231030-120127', + tag: 'f47d6ab-20231031-124004', }, }, chains: validatorChainConfig(Contexts.Hyperlane), @@ -125,7 +125,7 @@ const neutron: RootAgentConfig = { rpcConsensusType: RpcConsensusType.Fallback, docker: { repo, - tag: 'dd370cb-20231030-120127', + tag: 'f47d6ab-20231031-124004', }, gasPaymentEnforcement, transactionGasLimit: 750000, From 4aff474792b2d640164a68b8ac70031e32b55483 Mon Sep 17 00:00:00 2001 From: Trevor Porter Date: Tue, 31 Oct 2023 19:22:04 +0000 Subject: [PATCH 24/38] Don't charge neutron -> mantapacific --- .../config/environments/mainnet3/agent.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/typescript/infra/config/environments/mainnet3/agent.ts b/typescript/infra/config/environments/mainnet3/agent.ts index 78698d0906..60216773f0 100644 --- a/typescript/infra/config/environments/mainnet3/agent.ts +++ b/typescript/infra/config/environments/mainnet3/agent.ts @@ -2,6 +2,7 @@ import { GasPaymentEnforcementPolicyType, RpcConsensusType, chainMetadata, + getDomainId, } from '@hyperlane-xyz/sdk'; import { RootAgentConfig, allAgentChainNames } from '../../../src/config'; @@ -111,9 +112,22 @@ const neutron: RootAgentConfig = { rpcConsensusType: RpcConsensusType.Fallback, docker: { repo, - tag: 'f47d6ab-20231031-124004', + tag: 'ff69559-20231031-172516', }, - gasPaymentEnforcement, + gasPaymentEnforcement: [ + { + type: GasPaymentEnforcementPolicyType.None, + matchingList: [ + { + originDomain: getDomainId(chainMetadata.neutron), + destinationDomain: getDomainId(chainMetadata.mantapacific), + senderAddress: '*', + recipientAddress: '*', + }, + ], + }, + ...gasPaymentEnforcement, + ], }, }; From b38abd46dcd9b52feda8013410654d14a8b59824 Mon Sep 17 00:00:00 2001 From: Trevor Porter Date: Wed, 1 Nov 2023 11:19:21 +0000 Subject: [PATCH 25/38] new image --- typescript/infra/config/environments/mainnet3/agent.ts | 6 +++--- typescript/infra/config/environments/testnet4/agent.ts | 4 ++-- typescript/infra/scripts/agents/utils.ts | 4 ++++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/typescript/infra/config/environments/mainnet3/agent.ts b/typescript/infra/config/environments/mainnet3/agent.ts index 60216773f0..2b93999aa2 100644 --- a/typescript/infra/config/environments/mainnet3/agent.ts +++ b/typescript/infra/config/environments/mainnet3/agent.ts @@ -54,10 +54,10 @@ const hyperlane: RootAgentConfig = { }, chainDockerOverrides: { [chainMetadata.neutron.name]: { - tag: 'f47d6ab-20231031-124004', + tag: '2ba12dc-20231101-103934', }, [chainMetadata.mantapacific.name]: { - tag: 'f47d6ab-20231031-124004', + tag: '2ba12dc-20231101-103934', }, }, rpcConsensusType: RpcConsensusType.Quorum, @@ -112,7 +112,7 @@ const neutron: RootAgentConfig = { rpcConsensusType: RpcConsensusType.Fallback, docker: { repo, - tag: 'ff69559-20231031-172516', + tag: '2ba12dc-20231101-103934', }, gasPaymentEnforcement: [ { diff --git a/typescript/infra/config/environments/testnet4/agent.ts b/typescript/infra/config/environments/testnet4/agent.ts index 065239e1bb..4ab24a7476 100644 --- a/typescript/infra/config/environments/testnet4/agent.ts +++ b/typescript/infra/config/environments/testnet4/agent.ts @@ -71,7 +71,7 @@ const hyperlane: RootAgentConfig = { }, chainDockerOverrides: { neutrontestnet: { - tag: 'f47d6ab-20231031-124004', + tag: '2ba12dc-20231101-103934', }, }, chains: validatorChainConfig(Contexts.Hyperlane), @@ -125,7 +125,7 @@ const neutron: RootAgentConfig = { rpcConsensusType: RpcConsensusType.Fallback, docker: { repo, - tag: 'f47d6ab-20231031-124004', + tag: '2ba12dc-20231101-103934', }, gasPaymentEnforcement, transactionGasLimit: 750000, diff --git a/typescript/infra/scripts/agents/utils.ts b/typescript/infra/scripts/agents/utils.ts index 2bd9a3ad7c..42e031978e 100644 --- a/typescript/infra/scripts/agents/utils.ts +++ b/typescript/infra/scripts/agents/utils.ts @@ -34,6 +34,10 @@ export class AgentCli { switch (role) { case Role.Validator: for (const chain of this.agentConfig.contextChainNames[role]) { + const matches = ['neutron', 'neutrontestnet', 'mantapacific']; + if (!matches.includes(chain)) { + continue; + } const key = `${role}-${chain}`; managers[key] = new ValidatorHelmManager(this.agentConfig, chain); } From 8c427150c301909fae9535dd3e7ea3054dfe28ef Mon Sep 17 00:00:00 2001 From: Trevor Porter Date: Thu, 2 Nov 2023 14:30:30 +0000 Subject: [PATCH 26/38] Roll out reorg period change --- typescript/infra/config/environments/mainnet3/agent.ts | 6 +++--- typescript/infra/config/environments/testnet4/agent.ts | 4 ++-- typescript/sdk/src/consts/chainMetadata.ts | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/typescript/infra/config/environments/mainnet3/agent.ts b/typescript/infra/config/environments/mainnet3/agent.ts index 2b93999aa2..1c1161e98c 100644 --- a/typescript/infra/config/environments/mainnet3/agent.ts +++ b/typescript/infra/config/environments/mainnet3/agent.ts @@ -54,10 +54,10 @@ const hyperlane: RootAgentConfig = { }, chainDockerOverrides: { [chainMetadata.neutron.name]: { - tag: '2ba12dc-20231101-103934', + tag: 'a4f484f-20231102-132429', }, [chainMetadata.mantapacific.name]: { - tag: '2ba12dc-20231101-103934', + tag: 'a4f484f-20231102-132429', }, }, rpcConsensusType: RpcConsensusType.Quorum, @@ -112,7 +112,7 @@ const neutron: RootAgentConfig = { rpcConsensusType: RpcConsensusType.Fallback, docker: { repo, - tag: '2ba12dc-20231101-103934', + tag: 'a4f484f-20231102-132429', }, gasPaymentEnforcement: [ { diff --git a/typescript/infra/config/environments/testnet4/agent.ts b/typescript/infra/config/environments/testnet4/agent.ts index 4ab24a7476..b7875ee2be 100644 --- a/typescript/infra/config/environments/testnet4/agent.ts +++ b/typescript/infra/config/environments/testnet4/agent.ts @@ -71,7 +71,7 @@ const hyperlane: RootAgentConfig = { }, chainDockerOverrides: { neutrontestnet: { - tag: '2ba12dc-20231101-103934', + tag: 'a4f484f-20231102-132429', }, }, chains: validatorChainConfig(Contexts.Hyperlane), @@ -125,7 +125,7 @@ const neutron: RootAgentConfig = { rpcConsensusType: RpcConsensusType.Fallback, docker: { repo, - tag: '2ba12dc-20231101-103934', + tag: 'a4f484f-20231102-132429', }, gasPaymentEnforcement, transactionGasLimit: 750000, diff --git a/typescript/sdk/src/consts/chainMetadata.ts b/typescript/sdk/src/consts/chainMetadata.ts index cce1c8a8eb..71413357cf 100644 --- a/typescript/sdk/src/consts/chainMetadata.ts +++ b/typescript/sdk/src/consts/chainMetadata.ts @@ -807,7 +807,7 @@ export const neutron: ChainMetadata = { ], blocks: { confirmations: 1, - reorgPeriod: 0, + reorgPeriod: 1, estimateBlockTime: 3, }, blockExplorers: [ @@ -1018,7 +1018,7 @@ export const neutrontestnet: ChainMetadata = { }, blocks: { confirmations: 1, - reorgPeriod: 0, + reorgPeriod: 1, estimateBlockTime: 3, }, // First URL RPC, second REST From 2a3c1815b3557a971b3f09e6736d76b015b2fb1d Mon Sep 17 00:00:00 2001 From: Trevor Porter Date: Fri, 3 Nov 2023 10:12:49 +0000 Subject: [PATCH 27/38] Deploy sequenced merkle tree indexing --- typescript/infra/config/environments/mainnet3/agent.ts | 6 +++--- typescript/infra/config/environments/testnet4/agent.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/typescript/infra/config/environments/mainnet3/agent.ts b/typescript/infra/config/environments/mainnet3/agent.ts index 1c1161e98c..e042bedb53 100644 --- a/typescript/infra/config/environments/mainnet3/agent.ts +++ b/typescript/infra/config/environments/mainnet3/agent.ts @@ -54,10 +54,10 @@ const hyperlane: RootAgentConfig = { }, chainDockerOverrides: { [chainMetadata.neutron.name]: { - tag: 'a4f484f-20231102-132429', + tag: '44bc6c2-20231102-175116', }, [chainMetadata.mantapacific.name]: { - tag: 'a4f484f-20231102-132429', + tag: '44bc6c2-20231102-175116', }, }, rpcConsensusType: RpcConsensusType.Quorum, @@ -112,7 +112,7 @@ const neutron: RootAgentConfig = { rpcConsensusType: RpcConsensusType.Fallback, docker: { repo, - tag: 'a4f484f-20231102-132429', + tag: '44bc6c2-20231102-175116', }, gasPaymentEnforcement: [ { diff --git a/typescript/infra/config/environments/testnet4/agent.ts b/typescript/infra/config/environments/testnet4/agent.ts index b7875ee2be..ea4e115be4 100644 --- a/typescript/infra/config/environments/testnet4/agent.ts +++ b/typescript/infra/config/environments/testnet4/agent.ts @@ -71,7 +71,7 @@ const hyperlane: RootAgentConfig = { }, chainDockerOverrides: { neutrontestnet: { - tag: 'a4f484f-20231102-132429', + tag: '44bc6c2-20231102-175116', }, }, chains: validatorChainConfig(Contexts.Hyperlane), @@ -125,7 +125,7 @@ const neutron: RootAgentConfig = { rpcConsensusType: RpcConsensusType.Fallback, docker: { repo, - tag: 'a4f484f-20231102-132429', + tag: '44bc6c2-20231102-175116', }, gasPaymentEnforcement, transactionGasLimit: 750000, From c2915df9ad978f175c9293238ca760de29b7acb0 Mon Sep 17 00:00:00 2001 From: Nam Chu Hoai Date: Fri, 3 Nov 2023 15:22:34 -0400 Subject: [PATCH 28/38] Relayer arbitrum --- .../infra/config/environments/mainnet3/agent.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/typescript/infra/config/environments/mainnet3/agent.ts b/typescript/infra/config/environments/mainnet3/agent.ts index e042bedb53..2d8a82a773 100644 --- a/typescript/infra/config/environments/mainnet3/agent.ts +++ b/typescript/infra/config/environments/mainnet3/agent.ts @@ -103,7 +103,11 @@ const neutron: RootAgentConfig = { ...contextBase, contextChainNames: { validator: [], - relayer: [chainMetadata.neutron.name, chainMetadata.mantapacific.name], + relayer: [ + chainMetadata.neutron.name, + chainMetadata.mantapacific.name, + chainMetadata.arbitrum.name, + ], scraper: [], }, context: Contexts.Neutron, @@ -124,6 +128,12 @@ const neutron: RootAgentConfig = { senderAddress: '*', recipientAddress: '*', }, + { + originDomain: getDomainId(chainMetadata.neutron), + destinationDomain: getDomainId(chainMetadata.arbitrum), + senderAddress: '*', + recipientAddress: '*', + }, ], }, ...gasPaymentEnforcement, From 419d038f17f178f7e86e578f2de3ee061fa2a868 Mon Sep 17 00:00:00 2001 From: Trevor Porter Date: Wed, 8 Nov 2023 17:57:49 +0000 Subject: [PATCH 29/38] New image with null deser fix --- typescript/infra/config/environments/mainnet3/agent.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/typescript/infra/config/environments/mainnet3/agent.ts b/typescript/infra/config/environments/mainnet3/agent.ts index 2d8a82a773..12063880a1 100644 --- a/typescript/infra/config/environments/mainnet3/agent.ts +++ b/typescript/infra/config/environments/mainnet3/agent.ts @@ -54,10 +54,10 @@ const hyperlane: RootAgentConfig = { }, chainDockerOverrides: { [chainMetadata.neutron.name]: { - tag: '44bc6c2-20231102-175116', + tag: '5070398-20231108-172634', }, [chainMetadata.mantapacific.name]: { - tag: '44bc6c2-20231102-175116', + tag: '5070398-20231108-172634', }, }, rpcConsensusType: RpcConsensusType.Quorum, @@ -116,7 +116,7 @@ const neutron: RootAgentConfig = { rpcConsensusType: RpcConsensusType.Fallback, docker: { repo, - tag: '44bc6c2-20231102-175116', + tag: '5070398-20231108-172634', }, gasPaymentEnforcement: [ { From 8c0b059272cba2777b86f5f3b763ca7ab457e741 Mon Sep 17 00:00:00 2001 From: Trevor Porter Date: Wed, 8 Nov 2023 18:30:52 +0000 Subject: [PATCH 30/38] testnet too --- typescript/infra/config/environments/testnet4/agent.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/typescript/infra/config/environments/testnet4/agent.ts b/typescript/infra/config/environments/testnet4/agent.ts index ea4e115be4..3002e356b2 100644 --- a/typescript/infra/config/environments/testnet4/agent.ts +++ b/typescript/infra/config/environments/testnet4/agent.ts @@ -71,7 +71,7 @@ const hyperlane: RootAgentConfig = { }, chainDockerOverrides: { neutrontestnet: { - tag: '44bc6c2-20231102-175116', + tag: '5070398-20231108-172634', }, }, chains: validatorChainConfig(Contexts.Hyperlane), @@ -125,7 +125,7 @@ const neutron: RootAgentConfig = { rpcConsensusType: RpcConsensusType.Fallback, docker: { repo, - tag: '44bc6c2-20231102-175116', + tag: '5070398-20231108-172634', }, gasPaymentEnforcement, transactionGasLimit: 750000, From 51a172283d6becab5e8c293655bb75b8864d9d66 Mon Sep 17 00:00:00 2001 From: Trevor Porter Date: Thu, 9 Nov 2023 11:04:34 +0000 Subject: [PATCH 31/38] Kunal's lower gas fix --- typescript/infra/config/environments/mainnet3/agent.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typescript/infra/config/environments/mainnet3/agent.ts b/typescript/infra/config/environments/mainnet3/agent.ts index 12063880a1..6da9510b14 100644 --- a/typescript/infra/config/environments/mainnet3/agent.ts +++ b/typescript/infra/config/environments/mainnet3/agent.ts @@ -116,7 +116,7 @@ const neutron: RootAgentConfig = { rpcConsensusType: RpcConsensusType.Fallback, docker: { repo, - tag: '5070398-20231108-172634', + tag: '68bad33-20231109-024958', }, gasPaymentEnforcement: [ { From 1b1b9a026636cbf0ea6744b99ae5115ccf79b305 Mon Sep 17 00:00:00 2001 From: Trevor Porter Date: Thu, 9 Nov 2023 17:08:16 +0000 Subject: [PATCH 32/38] Typescript compiles --- typescript/sdk/src/consts/chains.ts | 2 - .../sdk/src/consts/environments/mainnet.json | 60 ------------------- .../sdk/src/metadata/chainMetadataTypes.ts | 5 -- 3 files changed, 67 deletions(-) diff --git a/typescript/sdk/src/consts/chains.ts b/typescript/sdk/src/consts/chains.ts index 04e0242e54..65bd49820e 100644 --- a/typescript/sdk/src/consts/chains.ts +++ b/typescript/sdk/src/consts/chains.ts @@ -35,9 +35,7 @@ export enum Chains { proteustestnet = 'proteustestnet', solana = 'solana', solanadevnet = 'solanadevnet', - neutron = 'neutron', neutrontestnet = 'neutrontestnet', - mantapacific = 'mantapacific', test1 = 'test1', test2 = 'test2', test3 = 'test3', diff --git a/typescript/sdk/src/consts/environments/mainnet.json b/typescript/sdk/src/consts/environments/mainnet.json index 653469c5ed..b1f9a4678e 100644 --- a/typescript/sdk/src/consts/environments/mainnet.json +++ b/typescript/sdk/src/consts/environments/mainnet.json @@ -187,66 +187,6 @@ "routingIsmFactory": "0x4Ed7d626f1E96cD1C0401607Bf70D95243E3dEd1", "proxyAdmin": "0x2f2aFaE1139Ce54feFC03593FeE8AB2aDF4a85A7", "mailbox": "0x3a464f746D23Ab22155710f44dB16dcA53e0775E", - "bsc": { - "merkleRootMultisigIsm": "0xeb4351CD48188F2BF3B2adB973ac1591C99Ea1Eb", - "messageIdMultisigIsm": "0x7fe658ef7970612241dA3E0C72baB85f483B7E05", - "staticAggregationIsm": "0x440f0539CF460215ef86354B9DaF2AE517aec083" - }, - "avalanche": { - "merkleRootMultisigIsm": "0x55a189Cf54F3A19Ec0e470D300B9E7154ce6b2BC", - "messageIdMultisigIsm": "0x8f818036434828EAbF24Ea5964C2C196B51F69E8", - "staticAggregationIsm": "0x85f6fee10DED6b15b4e36dC38786D1647d56abC6" - }, - "base": { - "merkleRootMultisigIsm": "0x6c2D1620fFa3eD98901fd83c271a13e8372a833d", - "messageIdMultisigIsm": "0x0b9eEb221AE7066a46eEcc00c0e4bf7166e78491", - "staticAggregationIsm": "0x2e51Cdb525b5037b8521BDaD9A3D53DD55c2e32a" - }, - "polygon": { - "merkleRootMultisigIsm": "0xcD73EEca505BA901D653b0a57d9dBE0E374a39C4", - "messageIdMultisigIsm": "0x5538dBd17Fc554800f8b2728666D4E07022d989a", - "staticAggregationIsm": "0x4648d8054b537EE7B5691a488bE507f7Bc8A7a56" - }, - "polygonzkevm": { - "merkleRootMultisigIsm": "0xb703caB3afD73582F7ea6F80CE88D3b2E3fF5AAD", - "messageIdMultisigIsm": "0x865269ae050F6dD1C6eF23CDcf0080456cC5Bd44", - "staticAggregationIsm": "0xe7f028152eD20602DABc23d02dfa1605d696816D" - }, - "scroll": { - "merkleRootMultisigIsm": "0xFFE674a8f561E13F784C58b6f93bEcEc418A9146", - "messageIdMultisigIsm": "0xE67D5867B520Dbe839659Ea90eDa0a52ccE36358", - "staticAggregationIsm": "0x3b67302cbEa46b80c3bD0fEFBeE854EA51BED13c" - }, - "celo": { - "merkleRootMultisigIsm": "0x424b047b25622b250351252Ee70897485c603582", - "messageIdMultisigIsm": "0x7a562ec8a36f124a3752673486feA0FAA3A0496b", - "staticAggregationIsm": "0xaEe6d2D15E6C9c273D62Ff03e04Efe68aE8A355C" - }, - "arbitrum": { - "merkleRootMultisigIsm": "0x08C0859B4DE164b942080dF136250F5e4e7b19cF", - "messageIdMultisigIsm": "0x28517474A13c327d2A9F837093a7D65338C2F0a5", - "staticAggregationIsm": "0x2727515b66AEA3f468948c0942DA469da2a7DC75" - }, - "optimism": { - "merkleRootMultisigIsm": "0x3848879abD1e07e1916fec8a3E9cE6075FC48d5e", - "messageIdMultisigIsm": "0x91e0d11Dd34DaFbEb716784D7127d799ec47964A", - "staticAggregationIsm": "0x7fb1c0288F8D9FFD16AB6161866C4de5ccb94C19" - }, - "ethereum": { - "merkleRootMultisigIsm": "0xe69de3fcAa6De26D3A3860E5E21aAaabFE70E9D1", - "messageIdMultisigIsm": "0x555b99a31935E985354332ea02014555520e0FbF", - "staticAggregationIsm": "0x4fde34B9F164cF1E945459b98e6085Fb4031535C" - }, - "moonbeam": { - "merkleRootMultisigIsm": "0xbeecDA79C392862003C9618dB6E37b4ee8C2e091", - "messageIdMultisigIsm": "0x44de3f39EB40f1a72F8A72cDF407e86274D9818d", - "staticAggregationIsm": "0x34e2233224eb4Bb938f24Cdb72D7a182B3074310" - }, - "gnosis": { - "merkleRootMultisigIsm": "0x1526dAFeDBfD375EEb69fAD0fD0DF94841A9B70B", - "messageIdMultisigIsm": "0x95d4d919d650F5f72A82fa4DEdf176616ec035CA", - "staticAggregationIsm": "0x5c3e9E58C852aF94dc9dF49c368619513f8E8D01" - }, "domainRoutingIsm": "0xDEed16fe4b1c9b2a93483EDFf34C77A9b57D31Ff", "storageGasOracle": "0x19dc38aeae620380430C200a6E990D5Af5480117", "interchainGasPaymaster": "0x0D63128D887159d63De29497dfa45AFc7C699AE4", diff --git a/typescript/sdk/src/metadata/chainMetadataTypes.ts b/typescript/sdk/src/metadata/chainMetadataTypes.ts index a6e814d462..7e185878ee 100644 --- a/typescript/sdk/src/metadata/chainMetadataTypes.ts +++ b/typescript/sdk/src/metadata/chainMetadataTypes.ts @@ -170,11 +170,6 @@ export const ChainMetadataSchemaObject = z.object({ .boolean() .optional() .describe('Whether the chain is considered a testnet or a mainnet.'), - // TODO we should have a better policy for protocol-specific configurations - bech32Prefix: z - .string() - .optional() - .describe('The prefix for a Cosmos address, e.g. osmo'), }); // Add refinements to the object schema to conditionally validate certain fields From 6d9c31228ab96ffcbbcc9423ef538ba4ce7f8fea Mon Sep 17 00:00:00 2001 From: Trevor Porter Date: Thu, 9 Nov 2023 17:11:06 +0000 Subject: [PATCH 33/38] I lied, now typescript builds --- .../environments/mainnet2/validators.ts | 177 ------------------ .../environments/mainnet3/validators.ts | 12 ++ 2 files changed, 12 insertions(+), 177 deletions(-) delete mode 100644 typescript/infra/config/environments/mainnet2/validators.ts diff --git a/typescript/infra/config/environments/mainnet2/validators.ts b/typescript/infra/config/environments/mainnet2/validators.ts deleted file mode 100644 index 945b71ed75..0000000000 --- a/typescript/infra/config/environments/mainnet2/validators.ts +++ /dev/null @@ -1,177 +0,0 @@ -import { chainMetadata } from '@hyperlane-xyz/sdk'; - -import { ValidatorBaseChainConfigMap } from '../../../src/config/agent'; -import { Contexts } from '../../contexts'; -import { validatorBaseConfigsFn } from '../utils'; - -import { environment } from './chains'; - -export const validatorChainConfig = ( - context: Contexts, -): ValidatorBaseChainConfigMap => { - const validatorsConfig = validatorBaseConfigsFn(environment, context); - return { - celo: { - interval: 5, - reorgPeriod: 0, - validators: validatorsConfig( - { - [Contexts.Hyperlane]: ['0x1f20274b1210046769d48174c2f0e7c25ca7d5c5'], - [Contexts.ReleaseCandidate]: [ - '0xe7a82e210f512f8e9900d6bc2acbf7981c63e66e', - ], - [Contexts.Neutron]: [], - }, - 'celo', - ), - }, - ethereum: { - interval: 5, - reorgPeriod: 20, - validators: validatorsConfig( - { - [Contexts.Hyperlane]: ['0x4c327ccb881a7542be77500b2833dc84c839e7b7'], - [Contexts.ReleaseCandidate]: [ - '0xaea1adb1c687b061e5b60b9da84cb69e7b5fab44', - ], - [Contexts.Neutron]: [], - }, - 'ethereum', - ), - }, - avalanche: { - interval: 5, - reorgPeriod: 3, - validators: validatorsConfig( - { - [Contexts.Hyperlane]: ['0xa7aa52623fe3d78c343008c95894be669e218b8d'], - [Contexts.ReleaseCandidate]: [ - '0x706976391e23dea28152e0207936bd942aba01ce', - ], - [Contexts.Neutron]: [], - }, - 'avalanche', - ), - }, - polygon: { - interval: 5, - reorgPeriod: 256, - validators: validatorsConfig( - { - [Contexts.Hyperlane]: ['0x59a001c3451e7f9f3b4759ea215382c1e9aa5fc1'], - [Contexts.ReleaseCandidate]: [ - '0xef372f6ff7775989b3ac884506ee31c79638c989', - ], - [Contexts.Neutron]: [], - }, - 'polygon', - ), - }, - bsc: { - interval: 5, - reorgPeriod: 15, - validators: validatorsConfig( - { - [Contexts.Hyperlane]: ['0xcc84b1eb711e5076b2755cf4ad1d2b42c458a45e'], - [Contexts.ReleaseCandidate]: [ - '0x0823081031a4a6f97c6083775c191d17ca96d0ab', - ], - [Contexts.Neutron]: [], - }, - 'bsc', - ), - }, - arbitrum: { - interval: 5, - reorgPeriod: 0, - validators: validatorsConfig( - { - [Contexts.Hyperlane]: ['0xbcb815f38d481a5eba4d7ac4c9e74d9d0fc2a7e7'], - [Contexts.ReleaseCandidate]: [ - '0x1a95b35fb809d57faf1117c1cc29a6c5df289df1', - ], - [Contexts.Neutron]: [], - }, - 'arbitrum', - ), - }, - optimism: { - interval: 5, - reorgPeriod: 0, - validators: validatorsConfig( - { - [Contexts.Hyperlane]: ['0x9f2296d5cfc6b5176adc7716c7596898ded13d35'], - [Contexts.ReleaseCandidate]: [ - '0x60e938bf280bbc21bacfd8bf435459d9003a8f98', - ], - [Contexts.Neutron]: [], - }, - 'optimism', - ), - }, - moonbeam: { - interval: 5, - reorgPeriod: 2, - validators: validatorsConfig( - { - [Contexts.Hyperlane]: ['0x237243d32d10e3bdbbf8dbcccc98ad44c1c172ea'], - [Contexts.ReleaseCandidate]: [ - '0x0df7140811e309dc69638352545151ebb9d5e0fd', - ], - [Contexts.Neutron]: [], - }, - 'moonbeam', - ), - }, - gnosis: { - interval: 5, - reorgPeriod: 14, - validators: validatorsConfig( - { - [Contexts.Hyperlane]: ['0xd0529ec8df08d0d63c0f023786bfa81e4bb51fd6'], - [Contexts.ReleaseCandidate]: [ - '0x15f48e78092a4f79febface509cfd76467c6cdbb', - ], - [Contexts.Neutron]: [], - }, - 'gnosis', - ), - }, - solana: { - interval: 5, - reorgPeriod: chainMetadata.solana.blocks!.reorgPeriod!, - validators: validatorsConfig( - { - [Contexts.Hyperlane]: [ - '0x3cd1a081f38874bbb075bf10b62adcb858db864c', - '0x28aa072634dd41d19471640237852e807bd9901f', - '0x8a93ba04f4e30064660670cb581d9aa10df78929', - ], - [Contexts.ReleaseCandidate]: [ - '0x8cc7dbfb5de339e4133f3af059c927ec383ace38', - ], - [Contexts.Neutron]: [], - }, - 'solana', - ), - }, - nautilus: { - interval: 5, - reorgPeriod: chainMetadata.nautilus.blocks!.reorgPeriod!, - validators: validatorsConfig( - { - [Contexts.Hyperlane]: [ - '0x9c920af9467595a23cb3433adefc3854d498a437', - '0x12b583ce1623b7de3fc727ccccda24dcab1fe022', - '0xc8b996a421ff1e203070c709c1af93944c049cc0', - ], - [Contexts.ReleaseCandidate]: [ - '0xdaf2e5ddaf2532753dc78bb6fbb0a10204c888c1', - ], - [Contexts.Neutron]: [], - }, - 'nautilus', - ), - }, - }; -}; diff --git a/typescript/infra/config/environments/mainnet3/validators.ts b/typescript/infra/config/environments/mainnet3/validators.ts index fbbc255f64..61cf6f3f1b 100644 --- a/typescript/infra/config/environments/mainnet3/validators.ts +++ b/typescript/infra/config/environments/mainnet3/validators.ts @@ -22,6 +22,7 @@ export const validatorChainConfig = ( '0x7bf30afcb6a7d92146d5a910ea4c154fba38d25e', ], [Contexts.ReleaseCandidate]: [], + [Contexts.Neutron]: [], }, 'celo', ), @@ -37,6 +38,7 @@ export const validatorChainConfig = ( '0x749d6e7ad949e522c92181dc77f7bbc1c5d71506', ], [Contexts.ReleaseCandidate]: [], + [Contexts.Neutron]: [], }, 'ethereum', ), @@ -54,6 +56,7 @@ export const validatorChainConfig = ( [Contexts.ReleaseCandidate]: [ '0x706976391e23dea28152e0207936bd942aba01ce', ], + [Contexts.Neutron]: [], }, 'avalanche', ), @@ -69,6 +72,7 @@ export const validatorChainConfig = ( '0xdbf3666de031bea43ec35822e8c33b9a9c610322', ], [Contexts.ReleaseCandidate]: [], + [Contexts.Neutron]: [], }, 'polygon', ), @@ -84,6 +88,7 @@ export const validatorChainConfig = ( '0x03047213365800f065356b4a2fe97c3c3a52296a', ], [Contexts.ReleaseCandidate]: [], + [Contexts.Neutron]: [], }, 'bsc', ), @@ -99,6 +104,7 @@ export const validatorChainConfig = ( '0x3369e12edd52570806f126eb50be269ba5e65843', ], [Contexts.ReleaseCandidate]: [], + [Contexts.Neutron]: [], }, 'arbitrum', ), @@ -116,6 +122,7 @@ export const validatorChainConfig = ( [Contexts.ReleaseCandidate]: [ '0x60e938bf280bbc21bacfd8bf435459d9003a8f98', ], + [Contexts.Neutron]: [], }, 'optimism', ), @@ -131,6 +138,7 @@ export const validatorChainConfig = ( '0xcc4a78aa162482bea43313cd836ba7b560b44fc4', ], [Contexts.ReleaseCandidate]: [], + [Contexts.Neutron]: [], }, 'moonbeam', ), @@ -146,6 +154,7 @@ export const validatorChainConfig = ( '0xb93a72cee19402553c9dd7fed2461aebd04e2454', ], [Contexts.ReleaseCandidate]: [], + [Contexts.Neutron]: [], }, 'gnosis', ), @@ -161,6 +170,7 @@ export const validatorChainConfig = ( '0xb144bb2f599a5af095bc30367856f27ea8a8adc7', ], [Contexts.ReleaseCandidate]: [], + [Contexts.Neutron]: [], }, 'base', ), @@ -176,6 +186,7 @@ export const validatorChainConfig = ( '0x7210fa0a6be39a75cb14d682ebfb37e2b53ecbe5', ], [Contexts.ReleaseCandidate]: [], + [Contexts.Neutron]: [], }, 'scroll', ), @@ -191,6 +202,7 @@ export const validatorChainConfig = ( '0x6a1da2e0b7ae26aaece1377c0a4dbe25b85fa3ca', ], [Contexts.ReleaseCandidate]: [], + [Contexts.Neutron]: [], }, 'polygonzkevm', ), From 7ca99aa9839947f05a9356190b715ce35e208607 Mon Sep 17 00:00:00 2001 From: Trevor Porter Date: Thu, 9 Nov 2023 17:20:23 +0000 Subject: [PATCH 34/38] nits --- rust/config/mainnet3_config.json | 60 ---------------------- typescript/sdk/src/metadata/agentConfig.ts | 2 +- 2 files changed, 1 insertion(+), 61 deletions(-) diff --git a/rust/config/mainnet3_config.json b/rust/config/mainnet3_config.json index 97a8a81849..1f5142e505 100644 --- a/rust/config/mainnet3_config.json +++ b/rust/config/mainnet3_config.json @@ -403,66 +403,6 @@ "routingIsmFactory": "0x4Ed7d626f1E96cD1C0401607Bf70D95243E3dEd1", "proxyAdmin": "0x2f2aFaE1139Ce54feFC03593FeE8AB2aDF4a85A7", "mailbox": "0x3a464f746D23Ab22155710f44dB16dcA53e0775E", - "bsc": { - "merkleRootMultisigIsm": "0xeb4351CD48188F2BF3B2adB973ac1591C99Ea1Eb", - "messageIdMultisigIsm": "0x7fe658ef7970612241dA3E0C72baB85f483B7E05", - "staticAggregationIsm": "0x440f0539CF460215ef86354B9DaF2AE517aec083" - }, - "avalanche": { - "merkleRootMultisigIsm": "0x55a189Cf54F3A19Ec0e470D300B9E7154ce6b2BC", - "messageIdMultisigIsm": "0x8f818036434828EAbF24Ea5964C2C196B51F69E8", - "staticAggregationIsm": "0x85f6fee10DED6b15b4e36dC38786D1647d56abC6" - }, - "base": { - "merkleRootMultisigIsm": "0x6c2D1620fFa3eD98901fd83c271a13e8372a833d", - "messageIdMultisigIsm": "0x0b9eEb221AE7066a46eEcc00c0e4bf7166e78491", - "staticAggregationIsm": "0x2e51Cdb525b5037b8521BDaD9A3D53DD55c2e32a" - }, - "polygon": { - "merkleRootMultisigIsm": "0xcD73EEca505BA901D653b0a57d9dBE0E374a39C4", - "messageIdMultisigIsm": "0x5538dBd17Fc554800f8b2728666D4E07022d989a", - "staticAggregationIsm": "0x4648d8054b537EE7B5691a488bE507f7Bc8A7a56" - }, - "polygonzkevm": { - "merkleRootMultisigIsm": "0xb703caB3afD73582F7ea6F80CE88D3b2E3fF5AAD", - "messageIdMultisigIsm": "0x865269ae050F6dD1C6eF23CDcf0080456cC5Bd44", - "staticAggregationIsm": "0xe7f028152eD20602DABc23d02dfa1605d696816D" - }, - "scroll": { - "merkleRootMultisigIsm": "0xFFE674a8f561E13F784C58b6f93bEcEc418A9146", - "messageIdMultisigIsm": "0xE67D5867B520Dbe839659Ea90eDa0a52ccE36358", - "staticAggregationIsm": "0x3b67302cbEa46b80c3bD0fEFBeE854EA51BED13c" - }, - "celo": { - "merkleRootMultisigIsm": "0x424b047b25622b250351252Ee70897485c603582", - "messageIdMultisigIsm": "0x7a562ec8a36f124a3752673486feA0FAA3A0496b", - "staticAggregationIsm": "0xaEe6d2D15E6C9c273D62Ff03e04Efe68aE8A355C" - }, - "arbitrum": { - "merkleRootMultisigIsm": "0x08C0859B4DE164b942080dF136250F5e4e7b19cF", - "messageIdMultisigIsm": "0x28517474A13c327d2A9F837093a7D65338C2F0a5", - "staticAggregationIsm": "0x2727515b66AEA3f468948c0942DA469da2a7DC75" - }, - "optimism": { - "merkleRootMultisigIsm": "0x3848879abD1e07e1916fec8a3E9cE6075FC48d5e", - "messageIdMultisigIsm": "0x91e0d11Dd34DaFbEb716784D7127d799ec47964A", - "staticAggregationIsm": "0x7fb1c0288F8D9FFD16AB6161866C4de5ccb94C19" - }, - "ethereum": { - "merkleRootMultisigIsm": "0xe69de3fcAa6De26D3A3860E5E21aAaabFE70E9D1", - "messageIdMultisigIsm": "0x555b99a31935E985354332ea02014555520e0FbF", - "staticAggregationIsm": "0x4fde34B9F164cF1E945459b98e6085Fb4031535C" - }, - "moonbeam": { - "merkleRootMultisigIsm": "0xbeecDA79C392862003C9618dB6E37b4ee8C2e091", - "messageIdMultisigIsm": "0x44de3f39EB40f1a72F8A72cDF407e86274D9818d", - "staticAggregationIsm": "0x34e2233224eb4Bb938f24Cdb72D7a182B3074310" - }, - "gnosis": { - "merkleRootMultisigIsm": "0x1526dAFeDBfD375EEb69fAD0fD0DF94841A9B70B", - "messageIdMultisigIsm": "0x95d4d919d650F5f72A82fa4DEdf176616ec035CA", - "staticAggregationIsm": "0x5c3e9E58C852aF94dc9dF49c368619513f8E8D01" - }, "domainRoutingIsm": "0xDEed16fe4b1c9b2a93483EDFf34C77A9b57D31Ff", "storageGasOracle": "0x19dc38aeae620380430C200a6E990D5Af5480117", "interchainGasPaymaster": "0x0D63128D887159d63De29497dfa45AFc7C699AE4", diff --git a/typescript/sdk/src/metadata/agentConfig.ts b/typescript/sdk/src/metadata/agentConfig.ts index 2b10080946..bcc9795146 100644 --- a/typescript/sdk/src/metadata/agentConfig.ts +++ b/typescript/sdk/src/metadata/agentConfig.ts @@ -67,7 +67,7 @@ const AgentSignerAwsKeySchema = z const AgentSignerCosmosKeySchema = z .object({ type: z.literal(AgentSignerKeyType.Cosmos), - prefix: z.string().describe('The prefix for the cosmos address'), + prefix: z.string().describe('The bech32 prefix for the cosmos address'), key: ZHash, }) .describe('Cosmos key'); From 66233f7e704c369e06f622daf93865226821563c Mon Sep 17 00:00:00 2001 From: Trevor Porter Date: Fri, 10 Nov 2023 13:04:46 +0000 Subject: [PATCH 35/38] Rm skipping certain validator deploys --- typescript/infra/scripts/agents/utils.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/typescript/infra/scripts/agents/utils.ts b/typescript/infra/scripts/agents/utils.ts index 42e031978e..2bd9a3ad7c 100644 --- a/typescript/infra/scripts/agents/utils.ts +++ b/typescript/infra/scripts/agents/utils.ts @@ -34,10 +34,6 @@ export class AgentCli { switch (role) { case Role.Validator: for (const chain of this.agentConfig.contextChainNames[role]) { - const matches = ['neutron', 'neutrontestnet', 'mantapacific']; - if (!matches.includes(chain)) { - continue; - } const key = `${role}-${chain}`; managers[key] = new ValidatorHelmManager(this.agentConfig, chain); } From 8b190cfe2d0d0315e10a90cead5f7784914c21ae Mon Sep 17 00:00:00 2001 From: Nam Chu Hoai Date: Tue, 14 Nov 2023 16:56:33 +0300 Subject: [PATCH 36/38] Add Manta validators to check with verify-validators (#2917) ### Description ### Drive-by changes ### Related issues ### Backward compatibility ### Testing --- typescript/infra/src/agents/aws/s3.ts | 9 ++++++--- typescript/infra/src/agents/aws/validator.ts | 8 +++++--- typescript/sdk/src/consts/multisigIsm.ts | 20 ++++++++++++-------- 3 files changed, 23 insertions(+), 14 deletions(-) diff --git a/typescript/infra/src/agents/aws/s3.ts b/typescript/infra/src/agents/aws/s3.ts index 233b4c24de..2c12cd00c3 100644 --- a/typescript/infra/src/agents/aws/s3.ts +++ b/typescript/infra/src/agents/aws/s3.ts @@ -15,23 +15,26 @@ export class S3Wrapper { private readonly client: S3Client; readonly bucket: string; readonly region: string; + readonly folder: string | undefined; static fromBucketUrl(bucketUrl: string): S3Wrapper { const match = bucketUrl.match(S3_BUCKET_REGEX); if (!match) throw new Error('Could not parse bucket url'); - return new S3Wrapper(match[1], match[2]); + return new S3Wrapper(match[1], match[2], undefined); } - constructor(bucket: string, region: string) { + constructor(bucket: string, region: string, folder: string | undefined) { this.bucket = bucket; this.region = region; + this.folder = folder; this.client = new S3Client({ region }); } async getS3Obj(key: string): Promise | undefined> { + const Key = this.folder ? `${this.folder}/${key}` : key; const command = new GetObjectCommand({ Bucket: this.bucket, - Key: key, + Key, }); try { const response = await this.client.send(command); diff --git a/typescript/infra/src/agents/aws/validator.ts b/typescript/infra/src/agents/aws/validator.ts index fd8ffa4b6f..2cea6b6a8d 100644 --- a/typescript/infra/src/agents/aws/validator.ts +++ b/typescript/infra/src/agents/aws/validator.ts @@ -50,9 +50,10 @@ export class S3Validator extends BaseValidator { mailbox: string, s3Bucket: string, s3Region: string, + s3Folder: string | undefined, ) { super(address, localDomain, mailbox); - this.s3Bucket = new S3Wrapper(s3Bucket, s3Region); + this.s3Bucket = new S3Wrapper(s3Bucket, s3Region, s3Folder); } static async fromStorageLocation( @@ -61,8 +62,8 @@ export class S3Validator extends BaseValidator { if (storageLocation.startsWith(LOCATION_PREFIX)) { const suffix = storageLocation.slice(LOCATION_PREFIX.length); const pieces = suffix.split('/'); - if (pieces.length == 2) { - const s3Bucket = new S3Wrapper(pieces[0], pieces[1]); + if (pieces.length >= 2) { + const s3Bucket = new S3Wrapper(pieces[0], pieces[1], pieces[2]); const announcement = await s3Bucket.getS3Obj(ANNOUNCEMENT_KEY); const address = announcement?.data.value.validator; const mailbox = announcement?.data.value.mailbox_address; @@ -74,6 +75,7 @@ export class S3Validator extends BaseValidator { mailbox, pieces[0], pieces[1], + pieces[2], ); } } diff --git a/typescript/sdk/src/consts/multisigIsm.ts b/typescript/sdk/src/consts/multisigIsm.ts index 92eaba68b8..a246053204 100644 --- a/typescript/sdk/src/consts/multisigIsm.ts +++ b/typescript/sdk/src/consts/multisigIsm.ts @@ -106,6 +106,18 @@ export const defaultMultisigIsmConfigs: ChainMap = { '0x57231619fea13d85270ca6943298046c75a6dd01', // everstake ], }, + mantapacific: { + threshold: 5, + validators: [ + '0x8e668c97ad76d0e28375275c41ece4972ab8a5bc', //abacusworks + '0x521a3e6bf8d24809fde1c1fd3494a859a16f132c', //cosmostation + '0x14025fe092f5f8a401dd9819704d9072196d2125', //p2p + '0x25b9a0961c51e74fd83295293bc029131bf1e05a', //neutron + '0xa0eE95e280D46C14921e524B075d0C341e7ad1C8', //cosmos spaces + '0xcc9a0b6de7fe314bd99223687d784730a75bb957', //dsrv + '0x42b6de2edbaa62c2ea2309ad85d20b3e37d38acf', //sg-1 + ], + }, // ----------------- Testnets ----------------- alfajores: { threshold: 2, @@ -244,12 +256,4 @@ export const defaultMultisigIsmConfigs: ChainMap = { '0x7885fae56dbcf5176657f54adbbd881dc6714132', ], }, - mantapacific: { - threshold: 2, - validators: [ - '0x8e668c97ad76d0e28375275c41ece4972ab8a5bc', - '0x80afdde2a81f3fb056fd088a97f0af3722dbc4f3', - '0x5dda0c4cf18de3b3ab637f8df82b24921082b54c', - ], - }, }; From e61ee639e9006e92221725216dbf1da31726b822 Mon Sep 17 00:00:00 2001 From: Trevor Porter Date: Tue, 28 Nov 2023 17:01:58 +0000 Subject: [PATCH 37/38] refine signer type --- typescript/sdk/src/metadata/agentConfig.ts | 93 +++++++++++++++------- 1 file changed, 64 insertions(+), 29 deletions(-) diff --git a/typescript/sdk/src/metadata/agentConfig.ts b/typescript/sdk/src/metadata/agentConfig.ts index bcc9795146..ea4f8270cc 100644 --- a/typescript/sdk/src/metadata/agentConfig.ts +++ b/typescript/sdk/src/metadata/agentConfig.ts @@ -4,6 +4,8 @@ */ import { z } from 'zod'; +import { ProtocolType } from '@hyperlane-xyz/utils'; + import { MultiProvider } from '../providers/MultiProvider'; import { ChainMap, ChainName } from '../types'; @@ -92,37 +94,70 @@ export type AgentSigner = z.infer; export const AgentChainMetadataSchema = ChainMetadataSchemaObject.merge( HyperlaneDeploymentArtifactsSchema, -).extend({ - customRpcUrls: z - .string() - .optional() - .describe( - 'Specify a comma seperated list of custom RPC URLs to use for this chain. If not specified, the default RPC urls will be used.', - ), - rpcConsensusType: z - .nativeEnum(RpcConsensusType) - .describe('The consensus type to use when multiple RPCs are configured.') - .optional(), - signer: AgentSignerSchema.optional().describe( - 'The signer to use for this chain', - ), - index: z - .object({ - from: ZUint.optional().describe( - 'The starting block from which to index events.', - ), - chunk: ZNzUint.optional().describe( - 'The number of blocks to index at a time.', +) + .extend({ + customRpcUrls: z + .string() + .optional() + .describe( + 'Specify a comma seperated list of custom RPC URLs to use for this chain. If not specified, the default RPC urls will be used.', ), - mode: z - .nativeEnum(AgentIndexMode) - .optional() - .describe( - 'The indexing method to use for this chain; will attempt to choose a suitable default if not specified.', + rpcConsensusType: z + .nativeEnum(RpcConsensusType) + .describe('The consensus type to use when multiple RPCs are configured.') + .optional(), + signer: AgentSignerSchema.optional().describe( + 'The signer to use for this chain', + ), + index: z + .object({ + from: ZUint.optional().describe( + 'The starting block from which to index events.', ), - }) - .optional(), -}); + chunk: ZNzUint.optional().describe( + 'The number of blocks to index at a time.', + ), + mode: z + .nativeEnum(AgentIndexMode) + .optional() + .describe( + 'The indexing method to use for this chain; will attempt to choose a suitable default if not specified.', + ), + }) + .optional(), + }) + .refine((metadata) => { + // Make sure that the signer is valid for the protocol + + const signerType = metadata.signer?.type; + + // If no signer is specified, no validation is needed + if (signerType === undefined) { + return true; + } + + switch (metadata.protocol) { + case ProtocolType.Ethereum: + return [ + AgentSignerKeyType.Hex, + signerType === AgentSignerKeyType.Aws, + signerType === AgentSignerKeyType.Node, + ].includes(signerType); + + case ProtocolType.Cosmos: + return [AgentSignerKeyType.Cosmos].includes(signerType); + + case ProtocolType.Sealevel: + return [AgentSignerKeyType.Hex].includes(signerType); + + case ProtocolType.Fuel: + return [AgentSignerKeyType.Hex].includes(signerType); + + default: + // Just default to true if we don't know the protocol + return true; + } + }); export type AgentChainMetadata = z.infer; From f155e53b07fc7ccc8980f09175bbd23818587b83 Mon Sep 17 00:00:00 2001 From: Trevor Porter Date: Tue, 28 Nov 2023 17:11:40 +0000 Subject: [PATCH 38/38] add test --- typescript/sdk/src/consts/chainMetadata.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typescript/sdk/src/consts/chainMetadata.ts b/typescript/sdk/src/consts/chainMetadata.ts index e63feff697..4285126c00 100644 --- a/typescript/sdk/src/consts/chainMetadata.ts +++ b/typescript/sdk/src/consts/chainMetadata.ts @@ -1011,7 +1011,7 @@ export const polygonzkevm: ChainMetadata = { export const neutrontestnet: ChainMetadata = { protocol: ProtocolType.Cosmos, domainId: 33333, - chainId: 33333, + chainId: 'duality-devnet', name: Chains.neutrontestnet, displayName: 'Neutron Testnet', nativeToken: {