Skip to content

Commit

Permalink
Merge branch 'main' into dan/cosmos-ism-dryrun
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-savu authored Dec 20, 2023
2 parents b98ee6e + f73ee0b commit 395ac44
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 75 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ jobs:
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Check
run: cargo check --all-features --all-targets
run: cargo check --release --all-features --all-targets
- name: Rustfmt
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy -- -D warnings
- name: Setup WASM
run: rustup target add wasm32-unknown-unknown
- name: Check WASM
run: cargo check -p hyperlane-core --features=strum,test-utils --target wasm32-unknown-unknown
run: cargo check --release -p hyperlane-core --features=strum,test-utils --target wasm32-unknown-unknown
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ jobs:
working-directory: ./rust

- name: agent tests with CosmWasm
run: RUST_BACKTRACE=1 cargo test --package run-locally --bin run-locally --features cosmos -- cosmos::test --nocapture
run: RUST_BACKTRACE=1 cargo test --release --package run-locally --bin run-locally --features cosmos -- cosmos::test --nocapture
working-directory: ./rust

- name: agent tests excluding CosmWasm
Expand Down
7 changes: 3 additions & 4 deletions rust/agents/relayer/src/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use derive_new::new;
use eyre::Result;
use hyperlane_core::HyperlaneDomain;
use tokio::task::JoinHandle;
use tracing::{info_span, instrument, instrument::Instrumented, Instrument};
use tracing::instrument;

#[async_trait]
pub trait ProcessorExt: Send + Debug {
Expand All @@ -23,9 +23,8 @@ pub struct Processor {
}

impl Processor {
pub fn spawn(self) -> Instrumented<JoinHandle<Result<()>>> {
let span = info_span!("MessageProcessor");
tokio::spawn(async move { self.main_loop().await }).instrument(span)
pub fn spawn(self) -> JoinHandle<Result<()>> {
tokio::spawn(async move { self.main_loop().await })
}

#[instrument(ret, err, skip(self), level = "info", fields(domain=%self.ticker.domain()))]
Expand Down
92 changes: 47 additions & 45 deletions rust/config/test_sealevel_config.json
Original file line number Diff line number Diff line change
@@ -1,48 +1,50 @@
{
"chains": {
"sealeveltest1": {
"name": "sealeveltest1",
"chainId": 13375,
"domainId": 13375,
"mailbox": "692KZJaoe2KRcD6uhCQDLLXnLNA5ZLnfvdqjE4aX9iu1",
"interchainGasPaymaster": "DrFtxirPPsfdY4HQiNZj2A9o4Ux7JaL3gELANgAoihhp",
"validatorAnnounce": "DH43ae1LwemXAboWwSh8zc9pG8j72gKUEXNi57w8fEnn",
"protocol": "sealevel",
"blocks": {
"reorgPeriod": 0,
"confirmations": 0
},
"rpcUrls": [
{
"http": "http://localhost:8899"
}
],
"index": {
"from": 1,
"mode": "sequence"
}
},
"sealeveltest2": {
"name": "sealeveltest2",
"chainId": 13376,
"domainId": 13376,
"mailbox": "9tCUWNjpqcf3NUSrtp7vquYVCwbEByvLjZUrhG5dgvhj",
"interchainGasPaymaster": "G5rGigZBL8NmxCaukK2CAKr9Jq4SUfAhsjzeri7GUraK",
"validatorAnnounce": "3Uo5j2Bti9aZtrDqJmAyuwiFaJFPFoNL5yxTpVCNcUhb",
"protocol": "sealevel",
"blocks": {
"reorgPeriod": 0,
"confirmations": 0
},
"rpcUrls": [
{
"http": "http://localhost:8899"
}
],
"index": {
"from": 1,
"mode": "sequence"
}
"chains": {
"sealeveltest1": {
"name": "sealeveltest1",
"chainId": 13375,
"domainId": 13375,
"mailbox": "692KZJaoe2KRcD6uhCQDLLXnLNA5ZLnfvdqjE4aX9iu1",
"merkleTreeHook": "692KZJaoe2KRcD6uhCQDLLXnLNA5ZLnfvdqjE4aX9iu1",
"interchainGasPaymaster": "DrFtxirPPsfdY4HQiNZj2A9o4Ux7JaL3gELANgAoihhp",
"validatorAnnounce": "DH43ae1LwemXAboWwSh8zc9pG8j72gKUEXNi57w8fEnn",
"protocol": "sealevel",
"blocks": {
"reorgPeriod": 0,
"confirmations": 0
},
"rpcUrls": [
{
"http": "http://localhost:8899"
}
],
"index": {
"from": 1,
"mode": "sequence"
}
},
"sealeveltest2": {
"name": "sealeveltest2",
"chainId": 13376,
"domainId": 13376,
"mailbox": "9tCUWNjpqcf3NUSrtp7vquYVCwbEByvLjZUrhG5dgvhj",
"merkleTreeHook": "9tCUWNjpqcf3NUSrtp7vquYVCwbEByvLjZUrhG5dgvhj",
"interchainGasPaymaster": "G5rGigZBL8NmxCaukK2CAKr9Jq4SUfAhsjzeri7GUraK",
"validatorAnnounce": "3Uo5j2Bti9aZtrDqJmAyuwiFaJFPFoNL5yxTpVCNcUhb",
"protocol": "sealevel",
"blocks": {
"reorgPeriod": 0,
"confirmations": 0
},
"rpcUrls": [
{
"http": "http://localhost:8899"
}
],
"index": {
"from": 1,
"mode": "sequence"
}
}
}
}
}
28 changes: 8 additions & 20 deletions rust/hyperlane-base/src/settings/chains.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ pub struct CoreContractAddresses {
/// Address of the ValidatorAnnounce contract
pub validator_announce: H256,
/// Address of the MerkleTreeHook contract
pub merkle_tree_hook: Option<H256>,
pub merkle_tree_hook: H256,
}

/// Indexing settings
Expand Down Expand Up @@ -173,13 +173,7 @@ impl ChainConf {
metrics: &CoreMetrics,
) -> Result<Box<dyn MerkleTreeHook>> {
let ctx = "Building merkle tree hook";
// TODO: if the merkle tree hook is set for sealevel, it's still a mailbox program
// that the connection is made to using the pda seeds, which will not be usable.
let address = self
.addresses
.merkle_tree_hook
.unwrap_or(self.addresses.mailbox);
let locator = self.locator(address);
let locator = self.locator(self.addresses.merkle_tree_hook);

match &self.connection {
ChainConnectionConf::Ethereum(conf) => {
Expand Down Expand Up @@ -368,11 +362,7 @@ impl ChainConf {
metrics: &CoreMetrics,
) -> Result<Box<dyn SequenceIndexer<MerkleTreeInsertion>>> {
let ctx = "Building merkle tree hook indexer";
let address = self
.addresses
.merkle_tree_hook
.unwrap_or(self.addresses.mailbox);
let locator = self.locator(address);
let locator = self.locator(self.addresses.merkle_tree_hook);

match &self.connection {
ChainConnectionConf::Ethereum(conf) => {
Expand Down Expand Up @@ -704,13 +694,11 @@ impl ChainConf {
self.addresses.interchain_gas_paymaster,
EthereumInterchainGasPaymasterAbi::fn_map_owned(),
);
if let Some(address) = self.addresses.merkle_tree_hook {
register_contract(
"merkle_tree_hook",
address,
EthereumInterchainGasPaymasterAbi::fn_map_owned(),
);
}
register_contract(
"merkle_tree_hook",
self.addresses.merkle_tree_hook,
EthereumInterchainGasPaymasterAbi::fn_map_owned(),
);

cfg
}
Expand Down
4 changes: 2 additions & 2 deletions rust/hyperlane-base/src/settings/parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ fn parse_chain(
.end();
let merkle_tree_hook = chain
.chain(&mut err)
.get_opt_key("merkleTreeHook")
.get_key("merkleTreeHook")
.parse_address_hash()
.end();

Expand All @@ -234,7 +234,7 @@ fn parse_chain(
default_rpc_consensus_type,
);

cfg_unwrap_all!(&chain.cwp, err: [connection, mailbox, interchain_gas_paymaster, validator_announce]);
cfg_unwrap_all!(&chain.cwp, err: [connection, mailbox, interchain_gas_paymaster, validator_announce, merkle_tree_hook]);
err.into_result(ChainConf {
domain,
signer,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,3 @@ Regardless, workload identities are a more attractive long-term option, and movi
The [documentation](https://external-secrets.io/v0.4.4/) is the best source. In short, it allows Kuberenetes Secrets to get their secrets from an external secret provided (like GCP's Secret Manager), all without a developer/deployer needing to touch the secrets themselves.

The general idea is there are `SecretStore`s (or `ClusterSecretStore`s, which are the cluster-wide version), that specify how the cluster can authenticate with the external secret provider. `ExternalSecret`s can then be specified in "application" infrastructure, which allow developers to specify a template for a Secret that will be created using the secret values from the external provider (& using the credentials from the SecretStore).

0 comments on commit 395ac44

Please sign in to comment.