diff --git a/rust/agents/relayer/src/settings/matching_list.rs b/rust/agents/relayer/src/settings/matching_list.rs index b153a1325..3aded7faf 100644 --- a/rust/agents/relayer/src/settings/matching_list.rs +++ b/rust/agents/relayer/src/settings/matching_list.rs @@ -1,5 +1,5 @@ use std::fmt; -use std::fmt::{Display, Formatter}; +use std::fmt::{Debug, Display, Formatter}; use std::marker::PhantomData; use std::num::ParseIntError; @@ -41,15 +41,15 @@ impl Filter { } } -impl Display for Filter { +impl Display for Filter { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { match self { Self::Wildcard => write!(f, "*"), - Self::Enumerated(l) if l.len() == 1 => write!(f, "{}", l[0]), + Self::Enumerated(l) if l.len() == 1 => write!(f, "{:?}", l[0]), Self::Enumerated(l) => { write!(f, "[")?; for i in l { - write!(f, "{i},")?; + write!(f, "{i:?},")?; } write!(f, "]") } @@ -276,9 +276,10 @@ fn parse_addr(addr_str: &str) -> Result { #[cfg(test)] mod test { - use crate::settings::matching_list::MatchInfo; use hyperlane_core::{H160, H256}; + use crate::settings::matching_list::MatchInfo; + use super::{Filter::*, MatchingList}; #[test] diff --git a/rust/hyperlane-base/src/settings/loader.rs b/rust/hyperlane-base/src/settings/loader.rs index c25155468..c29754a66 100644 --- a/rust/hyperlane-base/src/settings/loader.rs +++ b/rust/hyperlane-base/src/settings/loader.rs @@ -73,12 +73,12 @@ pub(crate) fn load_settings_object<'de, T: Deserialize<'de>, S: AsRef>( .source(Some(filtered_env)), ) .build()?; - let formatted_config = format!("{:#?}", config_deserializer); + let formatted_config = format!("{:#?}", config_deserializer).replace('\n', "\\n"); match serde_path_to_error::deserialize(config_deserializer) { Ok(cfg) => Ok(cfg), Err(err) => { println!( - "Error during deseriaization, showing the config for debugging:\n {}", + "Error during deserialization, showing the config for debugging: {}", formatted_config ); let ctx = format!("Invalid config at `{}` {:?}", err.path(), err); diff --git a/typescript/infra/config/environments/mainnet2/agent.ts b/typescript/infra/config/environments/mainnet2/agent.ts index 3776dbce0..ec4e617de 100644 --- a/typescript/infra/config/environments/mainnet2/agent.ts +++ b/typescript/infra/config/environments/mainnet2/agent.ts @@ -1,15 +1,21 @@ -import { ALL_KEY_ROLES } from '../../../src/agents/roles'; +import { ALL_KEY_ROLES, KEY_ROLE_ENUM } from '../../../src/agents/roles'; import { AgentConfig } from '../../../src/config'; import { ConnectionType, GasPaymentEnforcementPolicyType, } from '../../../src/config/agent'; import { Contexts } from '../../contexts'; +import { helloworldMatchingList } from '../../utils'; import { MainnetChains, chainNames, environment } from './chains'; -// import { helloWorld } from './helloworld'; +import { helloWorld } from './helloworld'; import { validators } from './validators'; +const releaseCandidateHelloworldMatchingList = helloworldMatchingList( + helloWorld, + Contexts.ReleaseCandidate, +); + export const hyperlane: AgentConfig = { environment, namespace: environment, @@ -67,6 +73,7 @@ export const hyperlane: AgentConfig = { relayer: { default: { blacklist: [ + ...releaseCandidateHelloworldMatchingList, { originDomain: '137', recipientAddress: '0xBC3cFeca7Df5A45d61BC60E7898E63670e1654aE', @@ -80,6 +87,37 @@ export const hyperlane: AgentConfig = { rolesWithKeys: ALL_KEY_ROLES, }; +export const releaseCandidate: AgentConfig = { + environment, + namespace: environment, + runEnv: environment, + context: Contexts.ReleaseCandidate, + docker: { + repo: 'gcr.io/abacus-labs-dev/hyperlane-agent', + tag: 'sha-0477ee1', + }, + aws: { + region: 'us-east-1', + }, + environmentChainNames: chainNames, + contextChainNames: chainNames, + validatorSets: validators, + gelato: { + enabledChains: [], + }, + connectionType: ConnectionType.HttpQuorum, + relayer: { + default: { + whitelist: releaseCandidateHelloworldMatchingList, + gasPaymentEnforcementPolicy: { + type: GasPaymentEnforcementPolicyType.None, + }, + }, + }, + rolesWithKeys: [KEY_ROLE_ENUM.Relayer, KEY_ROLE_ENUM.Kathy], +}; + export const agents = { [Contexts.Hyperlane]: hyperlane, + [Contexts.ReleaseCandidate]: releaseCandidate, }; diff --git a/typescript/infra/config/environments/mainnet2/funding.ts b/typescript/infra/config/environments/mainnet2/funding.ts index cdd5c76d6..72c417fa1 100644 --- a/typescript/infra/config/environments/mainnet2/funding.ts +++ b/typescript/infra/config/environments/mainnet2/funding.ts @@ -21,6 +21,7 @@ export const keyFunderConfig: KeyFunderConfig = { contextFundingFrom: Contexts.Hyperlane, contextsAndRolesToFund: { [Contexts.Hyperlane]: [KEY_ROLE_ENUM.Relayer, KEY_ROLE_ENUM.Kathy], + [Contexts.ReleaseCandidate]: [KEY_ROLE_ENUM.Relayer, KEY_ROLE_ENUM.Kathy], }, connectionType: ConnectionType.Http, }; diff --git a/typescript/infra/config/environments/mainnet2/helloworld.ts b/typescript/infra/config/environments/mainnet2/helloworld.ts index e110a19df..b452f0699 100644 --- a/typescript/infra/config/environments/mainnet2/helloworld.ts +++ b/typescript/infra/config/environments/mainnet2/helloworld.ts @@ -5,6 +5,7 @@ import { Contexts } from '../../contexts'; import { MainnetChains, environment } from './chains'; import hyperlaneAddresses from './helloworld/hyperlane/addresses.json'; +import rcAddresses from './helloworld/rc/addresses.json'; export const hyperlane: HelloWorldConfig = { addresses: hyperlaneAddresses, @@ -28,8 +29,28 @@ export const hyperlane: HelloWorldConfig = { }, }; +export const releaseCandidate: HelloWorldConfig = { + addresses: rcAddresses, + kathy: { + docker: { + repo: 'gcr.io/abacus-labs-dev/hyperlane-monorepo', + tag: 'sha-0477ee1', + }, + chainsToSkip: [], + runEnv: environment, + namespace: environment, + runConfig: { + mode: HelloWorldKathyRunMode.CycleOnce, + }, + messageSendTimeout: 1000 * 60 * 8, // 8 min + messageReceiptTimeout: 1000 * 60 * 20, // 20 min + connectionType: ConnectionType.Http, + }, +}; + export const helloWorld: Partial< Record> > = { [Contexts.Hyperlane]: hyperlane, + [Contexts.ReleaseCandidate]: releaseCandidate, }; diff --git a/typescript/infra/config/environments/mainnet2/helloworld/rc/addresses.json b/typescript/infra/config/environments/mainnet2/helloworld/rc/addresses.json new file mode 100644 index 000000000..d7e6de8d9 --- /dev/null +++ b/typescript/infra/config/environments/mainnet2/helloworld/rc/addresses.json @@ -0,0 +1,29 @@ +{ + "bsc": { + "router": "0x3f4663873A9aC7Ec683a5Bddc0acbC00091c10D0" + }, + "avalanche": { + "router": "0xaC5a4925d8aab7B9fb33F0a1722e3b94b6f87dB4" + }, + "polygon": { + "router": "0x3Ee06Da5110117c5B9AD41e2F827B774cBb15CC3" + }, + "celo": { + "router": "0x8E10405F4D23060b1a75005EFB99d99D537e0A7f" + }, + "arbitrum": { + "router": "0xb44a2B834FFdf762051Ee26Eb41531a4A02fA8d0" + }, + "optimism": { + "router": "0xe5F7E241F9bb6A644e88f2ca38fC373196b5392b" + }, + "ethereum": { + "router": "0x43ae568363c4FA6897EE9dF0c9ca445d3872c906" + }, + "moonbeam": { + "router": "0x1Efd1EdC42ef6cf2612F75e6C599C081d650c513" + }, + "gnosis": { + "router": "0x14aBb1f28B06272c57c37723D0e671d1c3326679" + } +} diff --git a/typescript/infra/config/environments/mainnet2/helloworld/rc/verification.json b/typescript/infra/config/environments/mainnet2/helloworld/rc/verification.json new file mode 100644 index 000000000..343c3762b --- /dev/null +++ b/typescript/infra/config/environments/mainnet2/helloworld/rc/verification.json @@ -0,0 +1,74 @@ +{ + "bsc": [ + { + "name": "router", + "address": "0x3f4663873A9aC7Ec683a5Bddc0acbC00091c10D0", + "constructorArguments": "00000000000000000000000035231d4c2d8b8adcb5617a638a0c4548684c7c7000000000000000000000000056f52c0a1ddcd557285f7cbc782d3d83096ce1cc", + "isProxy": false + } + ], + "avalanche": [ + { + "name": "router", + "address": "0xaC5a4925d8aab7B9fb33F0a1722e3b94b6f87dB4", + "constructorArguments": "00000000000000000000000035231d4c2d8b8adcb5617a638a0c4548684c7c7000000000000000000000000056f52c0a1ddcd557285f7cbc782d3d83096ce1cc", + "isProxy": false + } + ], + "polygon": [ + { + "name": "router", + "address": "0x3Ee06Da5110117c5B9AD41e2F827B774cBb15CC3", + "constructorArguments": "00000000000000000000000035231d4c2d8b8adcb5617a638a0c4548684c7c7000000000000000000000000056f52c0a1ddcd557285f7cbc782d3d83096ce1cc", + "isProxy": false + } + ], + "celo": [ + { + "name": "router", + "address": "0x8E10405F4D23060b1a75005EFB99d99D537e0A7f", + "constructorArguments": "00000000000000000000000035231d4c2d8b8adcb5617a638a0c4548684c7c7000000000000000000000000056f52c0a1ddcd557285f7cbc782d3d83096ce1cc", + "isProxy": false + } + ], + "arbitrum": [ + { + "name": "router", + "address": "0xb44a2B834FFdf762051Ee26Eb41531a4A02fA8d0", + "constructorArguments": "00000000000000000000000035231d4c2d8b8adcb5617a638a0c4548684c7c7000000000000000000000000056f52c0a1ddcd557285f7cbc782d3d83096ce1cc", + "isProxy": false + } + ], + "optimism": [ + { + "name": "router", + "address": "0xe5F7E241F9bb6A644e88f2ca38fC373196b5392b", + "constructorArguments": "00000000000000000000000035231d4c2d8b8adcb5617a638a0c4548684c7c7000000000000000000000000056f52c0a1ddcd557285f7cbc782d3d83096ce1cc", + "isProxy": false + } + ], + "ethereum": [ + { + "name": "router", + "address": "0x43ae568363c4FA6897EE9dF0c9ca445d3872c906", + "constructorArguments": "00000000000000000000000035231d4c2d8b8adcb5617a638a0c4548684c7c7000000000000000000000000056f52c0a1ddcd557285f7cbc782d3d83096ce1cc", + "isProxy": false + } + ], + "moonbeam": [ + { + "name": "router", + "address": "0x1Efd1EdC42ef6cf2612F75e6C599C081d650c513", + "constructorArguments": "00000000000000000000000035231d4c2d8b8adcb5617a638a0c4548684c7c7000000000000000000000000056f52c0a1ddcd557285f7cbc782d3d83096ce1cc", + "isProxy": false + } + ], + "gnosis": [ + { + "name": "router", + "address": "0x14aBb1f28B06272c57c37723D0e671d1c3326679", + "constructorArguments": "00000000000000000000000035231d4c2d8b8adcb5617a638a0c4548684c7c7000000000000000000000000056f52c0a1ddcd557285f7cbc782d3d83096ce1cc", + "isProxy": false + } + ] +} diff --git a/typescript/infra/config/environments/testnet3/agent.ts b/typescript/infra/config/environments/testnet3/agent.ts index 0b09704e9..e161eaf9b 100644 --- a/typescript/infra/config/environments/testnet3/agent.ts +++ b/typescript/infra/config/environments/testnet3/agent.ts @@ -1,23 +1,22 @@ import { chainMetadata } from '@hyperlane-xyz/sdk'; -import { ALL_KEY_ROLES } from '../../../src/agents/roles'; +import { ALL_KEY_ROLES, KEY_ROLE_ENUM } from '../../../src/agents/roles'; import { AgentConfig } from '../../../src/config'; import { ConnectionType, GasPaymentEnforcementPolicyType, } from '../../../src/config/agent'; import { Contexts } from '../../contexts'; +import { helloworldMatchingList } from '../../utils'; import { TestnetChains, chainNames, environment } from './chains'; -// import { helloWorld } from './helloworld'; +import { helloWorld } from './helloworld'; import { validators } from './validators'; -/* const releaseCandidateHelloworldMatchingList = helloworldMatchingList( helloWorld, Contexts.ReleaseCandidate, ); -*/ export const hyperlane: AgentConfig = { environment, @@ -26,7 +25,7 @@ export const hyperlane: AgentConfig = { context: Contexts.Hyperlane, docker: { repo: 'gcr.io/abacus-labs-dev/hyperlane-agent', - tag: 'sha-c163fce', + tag: 'sha-0477ee1', }, aws: { region: 'us-east-1', @@ -67,6 +66,7 @@ export const hyperlane: AgentConfig = { relayer: { default: { blacklist: [ + ...releaseCandidateHelloworldMatchingList, { recipientAddress: '0xBC3cFeca7Df5A45d61BC60E7898E63670e1654aE' }, ], gasPaymentEnforcementPolicy: { @@ -77,6 +77,37 @@ export const hyperlane: AgentConfig = { rolesWithKeys: ALL_KEY_ROLES, }; +export const releaseCandidate: AgentConfig = { + environment, + namespace: environment, + runEnv: environment, + context: Contexts.ReleaseCandidate, + docker: { + repo: 'gcr.io/abacus-labs-dev/hyperlane-agent', + tag: 'sha-0477ee1', + }, + aws: { + region: 'us-east-1', + }, + environmentChainNames: chainNames, + contextChainNames: chainNames, + validatorSets: validators, + gelato: { + enabledChains: [], + }, + connectionType: ConnectionType.HttpQuorum, + relayer: { + default: { + whitelist: releaseCandidateHelloworldMatchingList, + gasPaymentEnforcementPolicy: { + type: GasPaymentEnforcementPolicyType.None, + }, + }, + }, + rolesWithKeys: [KEY_ROLE_ENUM.Relayer, KEY_ROLE_ENUM.Kathy], +}; + export const agents = { [Contexts.Hyperlane]: hyperlane, + [Contexts.ReleaseCandidate]: releaseCandidate, }; diff --git a/typescript/infra/config/environments/testnet3/funding.ts b/typescript/infra/config/environments/testnet3/funding.ts index 18c82a297..979d28857 100644 --- a/typescript/infra/config/environments/testnet3/funding.ts +++ b/typescript/infra/config/environments/testnet3/funding.ts @@ -20,6 +20,7 @@ export const keyFunderConfig: KeyFunderConfig = { contextFundingFrom: Contexts.Hyperlane, contextsAndRolesToFund: { [Contexts.Hyperlane]: [KEY_ROLE_ENUM.Relayer, KEY_ROLE_ENUM.Kathy], + [Contexts.ReleaseCandidate]: [KEY_ROLE_ENUM.Relayer, KEY_ROLE_ENUM.Kathy], }, connectionType: ConnectionType.Http, }; diff --git a/typescript/infra/config/environments/testnet3/helloworld.ts b/typescript/infra/config/environments/testnet3/helloworld.ts index 4dd88a589..b059672a6 100644 --- a/typescript/infra/config/environments/testnet3/helloworld.ts +++ b/typescript/infra/config/environments/testnet3/helloworld.ts @@ -5,6 +5,7 @@ import { Contexts } from '../../contexts'; import { TestnetChains, environment } from './chains'; import hyperlaneAddresses from './helloworld/hyperlane/addresses.json'; +import rcAddresses from './helloworld/rc/addresses.json'; export const hyperlane: HelloWorldConfig = { addresses: hyperlaneAddresses, @@ -26,8 +27,28 @@ export const hyperlane: HelloWorldConfig = { }, }; +export const releaseCandidate: HelloWorldConfig = { + addresses: rcAddresses, + kathy: { + docker: { + repo: 'gcr.io/abacus-labs-dev/hyperlane-monorepo', + tag: 'sha-0477ee1', + }, + chainsToSkip: [], + runEnv: environment, + namespace: environment, + runConfig: { + mode: HelloWorldKathyRunMode.CycleOnce, + }, + messageSendTimeout: 1000 * 60 * 8, // 8 min + messageReceiptTimeout: 1000 * 60 * 20, // 20 min + connectionType: ConnectionType.Http, + }, +}; + export const helloWorld: Partial< Record> > = { [Contexts.Hyperlane]: hyperlane, + [Contexts.ReleaseCandidate]: releaseCandidate, }; diff --git a/typescript/infra/config/environments/testnet3/helloworld/rc/addresses.json b/typescript/infra/config/environments/testnet3/helloworld/rc/addresses.json new file mode 100644 index 000000000..edd14046b --- /dev/null +++ b/typescript/infra/config/environments/testnet3/helloworld/rc/addresses.json @@ -0,0 +1,26 @@ +{ + "alfajores": { + "router": "0x908200F276B36dAa2FAfe0757bB7188F36E85d3E" + }, + "fuji": { + "router": "0xc91Fcf115926705737394c4560E8b974f28eaad6" + }, + "mumbai": { + "router": "0x5B30cF4a552B32FBF9c15b98f91e863D822f355C" + }, + "bsctestnet": { + "router": "0x07453BE646Aab789a4AcE31DB68688263fB48D53" + }, + "goerli": { + "router": "0x04E9e0B2EC0bB80F9A914d82435DeE7f10ce7D29" + }, + "moonbasealpha": { + "router": "0xa5075B2AcA697944273d67B57a3340a0730632A3" + }, + "optimismgoerli": { + "router": "0x793A8E343eBc1498afd644A05507fc2b6B97AfB4" + }, + "arbitrumgoerli": { + "router": "0xa1E338311C26a00Eb586133728c3C9B97c67fAe0" + } +} diff --git a/typescript/infra/config/environments/testnet3/helloworld/rc/verification.json b/typescript/infra/config/environments/testnet3/helloworld/rc/verification.json new file mode 100644 index 000000000..85e7dd895 --- /dev/null +++ b/typescript/infra/config/environments/testnet3/helloworld/rc/verification.json @@ -0,0 +1,66 @@ +{ + "alfajores": [ + { + "name": "router", + "address": "0x908200F276B36dAa2FAfe0757bB7188F36E85d3E", + "constructorArguments": "000000000000000000000000cc737a94fecaec165abcf12ded095bb13f037685000000000000000000000000f90cb82a76492614d07b82a7658917f3ac811ac1", + "isProxy": false + } + ], + "fuji": [ + { + "name": "router", + "address": "0xc91Fcf115926705737394c4560E8b974f28eaad6", + "constructorArguments": "000000000000000000000000cc737a94fecaec165abcf12ded095bb13f037685000000000000000000000000f90cb82a76492614d07b82a7658917f3ac811ac1", + "isProxy": false + } + ], + "mumbai": [ + { + "name": "router", + "address": "0x5B30cF4a552B32FBF9c15b98f91e863D822f355C", + "constructorArguments": "000000000000000000000000cc737a94fecaec165abcf12ded095bb13f037685000000000000000000000000f90cb82a76492614d07b82a7658917f3ac811ac1", + "isProxy": false + } + ], + "bsctestnet": [ + { + "name": "router", + "address": "0x07453BE646Aab789a4AcE31DB68688263fB48D53", + "constructorArguments": "000000000000000000000000cc737a94fecaec165abcf12ded095bb13f037685000000000000000000000000f90cb82a76492614d07b82a7658917f3ac811ac1", + "isProxy": false + } + ], + "goerli": [ + { + "name": "router", + "address": "0x04E9e0B2EC0bB80F9A914d82435DeE7f10ce7D29", + "constructorArguments": "000000000000000000000000cc737a94fecaec165abcf12ded095bb13f037685000000000000000000000000f90cb82a76492614d07b82a7658917f3ac811ac1", + "isProxy": false + } + ], + "moonbasealpha": [ + { + "name": "router", + "address": "0xa5075B2AcA697944273d67B57a3340a0730632A3", + "constructorArguments": "000000000000000000000000cc737a94fecaec165abcf12ded095bb13f037685000000000000000000000000f90cb82a76492614d07b82a7658917f3ac811ac1", + "isProxy": false + } + ], + "optimismgoerli": [ + { + "name": "router", + "address": "0x793A8E343eBc1498afd644A05507fc2b6B97AfB4", + "constructorArguments": "000000000000000000000000cc737a94fecaec165abcf12ded095bb13f037685000000000000000000000000f90cb82a76492614d07b82a7658917f3ac811ac1", + "isProxy": false + } + ], + "arbitrumgoerli": [ + { + "name": "router", + "address": "0xa1E338311C26a00Eb586133728c3C9B97c67fAe0", + "constructorArguments": "000000000000000000000000cc737a94fecaec165abcf12ded095bb13f037685000000000000000000000000f90cb82a76492614d07b82a7658917f3ac811ac1", + "isProxy": false + } + ] +}