Skip to content

Commit

Permalink
Infra for neutron & neutrontestnet (#2869)
Browse files Browse the repository at this point in the history
### Description

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

### Drive-by changes

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

### Related issues

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

### Backward compatibility

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

Yes/No
-->

### Testing

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

None/Manual/Unit Tests
-->

---------

Co-authored-by: Trevor Porter <trkporter@ucdavis.edu>
  • Loading branch information
nambrot and tkporter authored Nov 28, 2023
1 parent df34198 commit 68d4f2f
Show file tree
Hide file tree
Showing 36 changed files with 622 additions and 147 deletions.
12 changes: 10 additions & 2 deletions rust/helm/hyperlane-agent/templates/external-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,23 @@ 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 }}
{{- 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
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 }}
Expand Down
3 changes: 2 additions & 1 deletion rust/helm/hyperlane-agent/templates/validator-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
1 change: 1 addition & 0 deletions typescript/infra/config/contexts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
export enum Contexts {
Hyperlane = 'hyperlane',
ReleaseCandidate = 'rc',
Neutron = 'neutron',
}
52 changes: 52 additions & 0 deletions typescript/infra/config/environments/mainnet3/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
GasPaymentEnforcementPolicyType,
RpcConsensusType,
chainMetadata,
getDomainId,
} from '@hyperlane-xyz/sdk';

import { RootAgentConfig, allAgentChainNames } from '../../../src/config';
Expand Down Expand Up @@ -51,6 +52,14 @@ const hyperlane: RootAgentConfig = {
repo,
tag: '1bee32a-20231121-121303',
},
chainDockerOverrides: {
[chainMetadata.neutron.name]: {
tag: '5070398-20231108-172634',
},
[chainMetadata.mantapacific.name]: {
tag: '5070398-20231108-172634',
},
},
rpcConsensusType: RpcConsensusType.Quorum,
chains: validatorChainConfig(Contexts.Hyperlane),
},
Expand Down Expand Up @@ -90,7 +99,50 @@ const releaseCandidate: RootAgentConfig = {
},
};

const neutron: RootAgentConfig = {
...contextBase,
contextChainNames: {
validator: [],
relayer: [
chainMetadata.neutron.name,
chainMetadata.mantapacific.name,
chainMetadata.arbitrum.name,
],
scraper: [],
},
context: Contexts.Neutron,
rolesWithKeys: [Role.Relayer],
relayer: {
rpcConsensusType: RpcConsensusType.Fallback,
docker: {
repo,
tag: '68bad33-20231109-024958',
},
gasPaymentEnforcement: [
{
type: GasPaymentEnforcementPolicyType.None,
matchingList: [
{
originDomain: getDomainId(chainMetadata.neutron),
destinationDomain: getDomainId(chainMetadata.mantapacific),
senderAddress: '*',
recipientAddress: '*',
},
{
originDomain: getDomainId(chainMetadata.neutron),
destinationDomain: getDomainId(chainMetadata.arbitrum),
senderAddress: '*',
recipientAddress: '*',
},
],
},
...gasPaymentEnforcement,
],
},
};

export const agents = {
[Contexts.Hyperlane]: hyperlane,
[Contexts.ReleaseCandidate]: releaseCandidate,
[Contexts.Neutron]: neutron,
};
25 changes: 11 additions & 14 deletions typescript/infra/config/environments/mainnet3/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,18 @@ export const ethereumMainnetConfigs: ChainMap<ChainMetadata> = {
},
moonbeam: chainMetadata.moonbeam,
gnosis: chainMetadata.gnosis,
mantapacific: chainMetadata.mantapacific,
};

// Blessed non-Ethereum chains.
// export const nonEthereumMainnetConfigs: ChainMap<ChainMetadata> = {
// solana: chainMetadata.solana,
// };
export const nonEthereumMainnetConfigs: ChainMap<ChainMetadata> = {
// solana: chainMetadata.solana,
neutron: chainMetadata.neutron,
};

export const mainnetConfigs: ChainMap<ChainMetadata> = {
...ethereumMainnetConfigs,
// ...nonEthereumMainnetConfigs,
...nonEthereumMainnetConfigs,
};

export type MainnetChains = keyof typeof mainnetConfigs;
Expand All @@ -63,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,
};
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
]
}
9 changes: 9 additions & 0 deletions typescript/infra/config/environments/mainnet3/gas-oracle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ const gasPrices: ChainMap<BigNumber> = {
base: ethers.utils.parseUnits('1', 'gwei'),
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.
Expand Down Expand Up @@ -83,6 +85,13 @@ const tokenUsdPrices: ChainMap<BigNumber> = {
'1619.00',
TOKEN_EXCHANGE_RATE_DECIMALS,
),
// 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const infrastructure: InfrastructureConfig = {
'mainnet2-',
'hyperlane-mainnet3-',
'rc-mainnet3-',
'neutron-mainnet3-',
'mainnet3-',
],
},
Expand Down
1 change: 1 addition & 0 deletions typescript/infra/config/environments/mainnet3/owners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const safes: ChainMap<Address> = {
base: '',
scroll: '',
polygonzkevm: '',
mantapacific: '',
};

// export const owners = safes;
Expand Down
Loading

0 comments on commit 68d4f2f

Please sign in to comment.