Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change config format to scope configs by type #3644

Merged
merged 34 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
92ea480
wip: make config an endpoint-specific enum
hdevalence Oct 1, 2023
f315763
propagate changes into relayer-cli and add questions
hdevalence Oct 3, 2023
362f4a7
relayer-cli: propagate enum chain config changes
erwanor Oct 11, 2023
9b25ce6
relayer: add `ChainConfig::set_key_name`
erwanor Oct 11, 2023
4b6f769
test-framework: begin propagating config changes
erwanor Oct 11, 2023
71cf297
relayer-cli: momentarily allow irrefutable patterns
erwanor Oct 11, 2023
baad978
relayer: run cargo fmt
erwanor Oct 11, 2023
6b5f8fb
integration-tests: propagate config enum api changes
erwanor Oct 11, 2023
4457c2b
Merge remote-tracking branch 'upstream/master' into config-enum
erwanor Oct 12, 2023
02f9a87
integration-tests: fix errors with `ica` feature
erwanor Oct 12, 2023
c259910
integration-tests: fix errors with `ics29` feature
erwanor Oct 12, 2023
0a6baeb
integration-tests: fix errors with `fee-grant` feature
erwanor Oct 12, 2023
ed1ff5f
integration-tests: fix errors with `mbt` feature
erwanor Oct 13, 2023
25c7cf8
integration-tests: fix errors with `ordered` feature
erwanor Oct 13, 2023
a6eadc0
Merge remote-tracking branch 'upstream/master' into config-enum
erwanor Oct 13, 2023
e891697
relayer-cli: fix conflict introduced by merge
erwanor Oct 13, 2023
29b1bde
integration-test: fix simulation:
erwanor Oct 13, 2023
12c02de
hermes: various linting fixes
erwanor Oct 13, 2023
f28601b
hermes: include chain type in default config file
erwanor Oct 13, 2023
64083a3
hermes: add chain type to all config examples
erwanor Oct 13, 2023
8f02d10
ci: update misbehavior config
erwanor Oct 13, 2023
44032e5
relayer-rest(tests): add chain type to mock config
erwanor Oct 13, 2023
0a09a0c
ci(misbehavior): edit config of forked chain
erwanor Oct 13, 2023
b1a39d7
relayer(config): remove dead code
erwanor Oct 14, 2023
c158cba
relayer: lift keys to `ChainConfig::list_keys`
erwanor Oct 14, 2023
e7028fc
relayer: move config validation to `ibc_relayer::config`
erwanor Oct 14, 2023
3cb9db3
relayer: move cosmos config to `chain::cosmos::config`
erwanor Oct 17, 2023
33e2cf5
relayer: add `chain::cosmos::config` module
erwanor Oct 17, 2023
cddce8d
relayer-cli(chain-registry): update path to `CosmosSdkConfig`
erwanor Oct 17, 2023
4e7b5ee
Merge remote-tracking branch 'upstream/master' into config-enum
erwanor Oct 23, 2023
c42de92
ci(misbehavior-ics): add chain type to config file
erwanor Oct 23, 2023
e588311
relayer(evidence): exit early if chain type is not cosmos sdk
erwanor Oct 23, 2023
979cef4
relayer(cosmos): refactor cosmos-specific config validation
erwanor Oct 23, 2023
d7f8674
Add changelog entries
romac Oct 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions crates/relayer-cli/src/chain_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ use ibc_chain_registry::querier::*;
use ibc_relayer::config::filter::{FilterPattern, PacketFilter};
use ibc_relayer::config::gas_multiplier::GasMultiplier;
use ibc_relayer::config::types::{MaxMsgNum, MaxTxSize, Memo};
use ibc_relayer::config::{default, AddressType, ChainConfig, EventSourceMode, GasPrice};
use ibc_relayer::config::{
default, AddressType, ChainConfig, CosmosSdkConfig, EventSourceMode, GasPrice,
};
use ibc_relayer::keyring::Store;

use tendermint_light_client_verifier::types::TrustThreshold;
Expand Down Expand Up @@ -120,9 +122,8 @@ where
0.1
};

Ok(ChainConfig {
Ok(ChainConfig::CosmosSdk(CosmosSdkConfig {
id: chain_data.chain_id,
r#type: default::chain_type(),
rpc_addr: rpc_data.rpc_address,
grpc_addr: grpc_address,
event_source: EventSourceMode::Push {
Expand Down Expand Up @@ -160,7 +161,7 @@ where
address_type: AddressType::default(),
sequential_batch_tx: false,
extension_options: Vec::new(),
})
}))
}

/// Concurrent `query_healthy` might fail, this is a helper function which will retry a failed query a fixed
Expand Down Expand Up @@ -341,7 +342,10 @@ mod tests {
for config in configs {
match config {
Ok(config) => {
assert_eq!(config.packet_filter.channel_policy, ChannelPolicy::AllowAll);
assert_eq!(
config.packet_filter().channel_policy,
ChannelPolicy::AllowAll
);
}
Err(e) => panic!(
"Encountered an unexpected error in chain registry test: {}",
Expand All @@ -367,9 +371,9 @@ mod tests {

for config in configs {
match config {
Ok(config) => match config.packet_filter.channel_policy {
Ok(config) => match config.packet_filter().channel_policy {
ChannelPolicy::Allow(channel_filter) => {
if config.id.as_str().contains("cosmoshub") {
if config.id().as_str().contains("cosmoshub") {
assert!(channel_filter.is_exact());

let cosmoshub_juno = (
Expand All @@ -385,7 +389,7 @@ mod tests {
assert!(channel_filter.matches(cosmoshub_juno));
assert!(channel_filter.matches(cosmoshub_osmosis));
assert!(channel_filter.len() == 2);
} else if config.id.as_str().contains("juno") {
} else if config.id().as_str().contains("juno") {
assert!(channel_filter.is_exact());

let juno_cosmoshub = (
Expand All @@ -407,7 +411,7 @@ mod tests {
assert!(channel_filter.matches(juno_osmosis_1));
assert!(channel_filter.matches(juno_osmosis_2));
assert!(channel_filter.len() == 3);
} else if config.id.as_str().contains("osmosis") {
} else if config.id().as_str().contains("osmosis") {
assert!(channel_filter.is_exact());

let osmosis_cosmoshub = (
Expand Down
10 changes: 7 additions & 3 deletions crates/relayer-cli/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use abscissa_core::{config::Override, Command, Configurable, FrameworkError, Run
use tracing::{error, info};

use crate::DEFAULT_CONFIG_PATH;
use ibc_relayer::config::Config;
use ibc_relayer::config::{ChainConfig, Config};

/// Default configuration file path
pub fn default_config_file() -> Option<PathBuf> {
Expand Down Expand Up @@ -145,14 +145,18 @@ impl Configurable<Config> for CliCmd {
let web = "https://hermes.informal.systems";
let suffix = format!("{} {} ({})", CliCmd::name(), clap::crate_version!(), web);
for ccfg in config.chains.iter_mut() {
ccfg.memo_prefix.apply_suffix(&suffix);
if let ChainConfig::CosmosSdk(ref mut cosmos_ccfg) = ccfg {
cosmos_ccfg.memo_prefix.apply_suffix(&suffix);
}
}

// For all commands except for `start` Hermes retries
// for a prolonged period of time.
if !matches!(self, CliCmd::Start(_)) {
for c in config.chains.iter_mut() {
c.rpc_timeout = Duration::from_secs(120);
if let ChainConfig::CosmosSdk(ref mut cosmos_ccfg) = c {
cosmos_ccfg.rpc_timeout = Duration::from_secs(120);
}
}
}

Expand Down
5 changes: 5 additions & 0 deletions crates/relayer-cli/src/commands/clear.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,12 @@
})?;

if let Some(ref key_name) = self.key_name {
// Q: should the key name be required across chain types, meaning that
// key management is common to all chain types, or should key management
// be the responsibility of the backend? If key management is common
// across backends, how should it be agnostic to the key type? Can it
// just be an opaque byte string handled by the backend?
Comment on lines +78 to +82
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ties in to #3641

Perhaps the key manager should only support opaque byte strings, and let the rest be handled by the backend?

chain_config.key_name = key_name.to_string();

Check failure on line 83 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / ics29-fee-test (ibc-go-v5-simapp, simd, cosmos)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 83 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / ica-filter-test (ibc-go-v6-simapp, simd, cosmos)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 83 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / ica-filter-test (ibc-go-v7-simapp, simd, cosmos)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 83 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / ics29-fee-test (ibc-go-v7-simapp, simd, cosmos)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 83 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / ics29-fee-test (ibc-go-v6-simapp, simd, cosmos)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 83 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / clean-workers (gaia11, gaiad, cosmos)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 83 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / ics31 (.#gaia11 .#stride-no-admin, gaiad,strided, cosmos,stride)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 83 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / model-based-test (gaia6)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 83 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / misbehaviour (gaia11, gaiad, cosmos)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 83 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / forward-packet (juno, junod, juno)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 83 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / fee-grant (stride, strided, stride)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 83 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / ordered-channel-test

no field `key_name` on type `&mut ChainConfig`

Check failure on line 83 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / ics29-fee-test (migaloo, migalood, migaloo)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 83 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / integration-test (ibc-go-v4-simapp, simd, cosmos)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 83 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / integration-test (gaia11, gaiad, cosmos)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 83 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / integration-test (juno, junod, juno)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 83 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / test-stable

no field `key_name` on type `&mut ChainConfig`

Check failure on line 83 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / integration-test (osmosis, osmosisd, osmo)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 83 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / integration-test (stride, strided, stride)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 83 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / integration-test (ibc-go-v7-simapp, simd, cosmos)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 83 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / fee-grant (evmos, evmosd, evmos)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 83 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / integration-test (evmos, evmosd, evmos)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 83 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / integration-test (ibc-go-v5-simapp, simd, cosmos)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 83 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / integration-test (ibc-go-v6-simapp, simd, cosmos)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 83 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / integration-test (wasmd, wasmd, wasm)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 83 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / forward-packet (gaia11, gaiad, cosmos)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 83 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / interchain-security-ica (stride-consumer, strided, stride)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 83 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / cargo-doc

no field `key_name` on type `&mut ChainConfig`

Check failure on line 83 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / interchain-security-no-ica (neutron, neutrond, neutron)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 83 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / interchain-security-icq (stride-consumer-no-admin, strided, stride)

no field `key_name` on type `&mut ChainConfig`
}

Ok(config)
Expand All @@ -101,7 +106,7 @@
if let Some(ref counterparty_key_name) = self.counterparty_key_name {
match chains.dst.config() {
Ok(mut dst_chain_cfg) => {
dst_chain_cfg.key_name = counterparty_key_name.to_string();

Check failure on line 109 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / ics29-fee-test (ibc-go-v5-simapp, simd, cosmos)

no field `key_name` on type `ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / ica-filter-test (ibc-go-v6-simapp, simd, cosmos)

no field `key_name` on type `ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / ica-filter-test (ibc-go-v7-simapp, simd, cosmos)

no field `key_name` on type `ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / ics29-fee-test (ibc-go-v7-simapp, simd, cosmos)

no field `key_name` on type `ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / ics29-fee-test (ibc-go-v6-simapp, simd, cosmos)

no field `key_name` on type `ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / clean-workers (gaia11, gaiad, cosmos)

no field `key_name` on type `ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / ics31 (.#gaia11 .#stride-no-admin, gaiad,strided, cosmos,stride)

no field `key_name` on type `ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / model-based-test (gaia6)

no field `key_name` on type `ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / misbehaviour (gaia11, gaiad, cosmos)

no field `key_name` on type `ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / forward-packet (juno, junod, juno)

no field `key_name` on type `ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / fee-grant (stride, strided, stride)

no field `key_name` on type `ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / ordered-channel-test

no field `key_name` on type `ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / ics29-fee-test (migaloo, migalood, migaloo)

no field `key_name` on type `ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / integration-test (ibc-go-v4-simapp, simd, cosmos)

no field `key_name` on type `ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / integration-test (gaia11, gaiad, cosmos)

no field `key_name` on type `ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / integration-test (juno, junod, juno)

no field `key_name` on type `ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / test-stable

no field `key_name` on type `ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / integration-test (osmosis, osmosisd, osmo)

no field `key_name` on type `ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / integration-test (stride, strided, stride)

no field `key_name` on type `ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / integration-test (ibc-go-v7-simapp, simd, cosmos)

no field `key_name` on type `ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / fee-grant (evmos, evmosd, evmos)

no field `key_name` on type `ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / integration-test (evmos, evmosd, evmos)

no field `key_name` on type `ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / integration-test (ibc-go-v5-simapp, simd, cosmos)

no field `key_name` on type `ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / integration-test (ibc-go-v6-simapp, simd, cosmos)

no field `key_name` on type `ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / integration-test (wasmd, wasmd, wasm)

no field `key_name` on type `ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / forward-packet (gaia11, gaiad, cosmos)

no field `key_name` on type `ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / interchain-security-ica (stride-consumer, strided, stride)

no field `key_name` on type `ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / cargo-doc

no field `key_name` on type `ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / interchain-security-no-ica (neutron, neutrond, neutron)

no field `key_name` on type `ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/clear.rs

View workflow job for this annotation

GitHub Actions / interchain-security-icq (stride-consumer-no-admin, strided, stride)

no field `key_name` on type `ChainConfig`
}
Err(e) => Output::error(e).exit(),
}
Expand Down
4 changes: 2 additions & 2 deletions crates/relayer-cli/src/commands/config/auto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
.collect();

// Determine which chains were not fetched
let fetched_chains_set = HashSet::from_iter(chain_configs.iter().map(|c| c.id.name()));

Check failure on line 120 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / ics29-fee-test (ibc-go-v5-simapp, simd, cosmos)

attempted to take value of method `id` on type `&ChainConfig`

Check failure on line 120 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / ica-filter-test (ibc-go-v6-simapp, simd, cosmos)

attempted to take value of method `id` on type `&ChainConfig`

Check failure on line 120 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / ica-filter-test (ibc-go-v7-simapp, simd, cosmos)

attempted to take value of method `id` on type `&ChainConfig`

Check failure on line 120 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / ics29-fee-test (ibc-go-v7-simapp, simd, cosmos)

attempted to take value of method `id` on type `&ChainConfig`

Check failure on line 120 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / ics29-fee-test (ibc-go-v6-simapp, simd, cosmos)

attempted to take value of method `id` on type `&ChainConfig`

Check failure on line 120 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / clean-workers (gaia11, gaiad, cosmos)

attempted to take value of method `id` on type `&ChainConfig`

Check failure on line 120 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / ics31 (.#gaia11 .#stride-no-admin, gaiad,strided, cosmos,stride)

attempted to take value of method `id` on type `&ChainConfig`

Check failure on line 120 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / model-based-test (gaia6)

attempted to take value of method `id` on type `&ChainConfig`

Check failure on line 120 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / misbehaviour (gaia11, gaiad, cosmos)

attempted to take value of method `id` on type `&ChainConfig`

Check failure on line 120 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / forward-packet (juno, junod, juno)

attempted to take value of method `id` on type `&ChainConfig`

Check failure on line 120 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / fee-grant (stride, strided, stride)

attempted to take value of method `id` on type `&ChainConfig`

Check failure on line 120 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / ordered-channel-test

attempted to take value of method `id` on type `&ChainConfig`

Check failure on line 120 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / ics29-fee-test (migaloo, migalood, migaloo)

attempted to take value of method `id` on type `&ChainConfig`

Check failure on line 120 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / integration-test (ibc-go-v4-simapp, simd, cosmos)

attempted to take value of method `id` on type `&ChainConfig`

Check failure on line 120 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / integration-test (gaia11, gaiad, cosmos)

attempted to take value of method `id` on type `&ChainConfig`

Check failure on line 120 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / integration-test (juno, junod, juno)

attempted to take value of method `id` on type `&ChainConfig`

Check failure on line 120 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / test-stable

attempted to take value of method `id` on type `&ChainConfig`

Check failure on line 120 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / integration-test (osmosis, osmosisd, osmo)

attempted to take value of method `id` on type `&ChainConfig`

Check failure on line 120 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / integration-test (stride, strided, stride)

attempted to take value of method `id` on type `&ChainConfig`

Check failure on line 120 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / integration-test (ibc-go-v7-simapp, simd, cosmos)

attempted to take value of method `id` on type `&ChainConfig`

Check failure on line 120 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / fee-grant (evmos, evmosd, evmos)

attempted to take value of method `id` on type `&ChainConfig`

Check failure on line 120 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / integration-test (evmos, evmosd, evmos)

attempted to take value of method `id` on type `&ChainConfig`

Check failure on line 120 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / integration-test (ibc-go-v5-simapp, simd, cosmos)

attempted to take value of method `id` on type `&ChainConfig`

Check failure on line 120 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / integration-test (ibc-go-v6-simapp, simd, cosmos)

attempted to take value of method `id` on type `&ChainConfig`

Check failure on line 120 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / integration-test (wasmd, wasmd, wasm)

attempted to take value of method `id` on type `&ChainConfig`

Check failure on line 120 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / forward-packet (gaia11, gaiad, cosmos)

attempted to take value of method `id` on type `&ChainConfig`

Check failure on line 120 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / interchain-security-ica (stride-consumer, strided, stride)

attempted to take value of method `id` on type `&ChainConfig`

Check failure on line 120 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / cargo-doc

attempted to take value of method `id` on type `&ChainConfig`

Check failure on line 120 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / interchain-security-no-ica (neutron, neutrond, neutron)

attempted to take value of method `id` on type `&ChainConfig`

Check failure on line 120 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / interchain-security-icq (stride-consumer-no-admin, strided, stride)

attempted to take value of method `id` on type `&ChainConfig`
let missing_chains_set: HashSet<_> =
sorted_names_set.difference(&fetched_chains_set).collect();

Expand All @@ -128,15 +128,15 @@
for (chain_config, key_option) in configs_and_keys {
// If a key is provided, use it
if let Some(key_name) = key_option {
info!("{}: uses key \"{}\"", &chain_config.id, &key_name);
info!("{}: uses key \"{}\"", &chain_config.id(), &key_name);
chain_config.key_name = key_name;

Check failure on line 132 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / ics29-fee-test (ibc-go-v5-simapp, simd, cosmos)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 132 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / ica-filter-test (ibc-go-v6-simapp, simd, cosmos)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 132 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / ica-filter-test (ibc-go-v7-simapp, simd, cosmos)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 132 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / ics29-fee-test (ibc-go-v7-simapp, simd, cosmos)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 132 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / ics29-fee-test (ibc-go-v6-simapp, simd, cosmos)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 132 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / clean-workers (gaia11, gaiad, cosmos)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 132 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / ics31 (.#gaia11 .#stride-no-admin, gaiad,strided, cosmos,stride)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 132 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / model-based-test (gaia6)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 132 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / misbehaviour (gaia11, gaiad, cosmos)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 132 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / forward-packet (juno, junod, juno)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 132 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / fee-grant (stride, strided, stride)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 132 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / ordered-channel-test

no field `key_name` on type `&mut ChainConfig`

Check failure on line 132 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / ics29-fee-test (migaloo, migalood, migaloo)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 132 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / integration-test (ibc-go-v4-simapp, simd, cosmos)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 132 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / integration-test (gaia11, gaiad, cosmos)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 132 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / integration-test (juno, junod, juno)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 132 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / test-stable

no field `key_name` on type `&mut ChainConfig`

Check failure on line 132 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / integration-test (osmosis, osmosisd, osmo)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 132 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / integration-test (stride, strided, stride)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 132 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / integration-test (ibc-go-v7-simapp, simd, cosmos)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 132 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / fee-grant (evmos, evmosd, evmos)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 132 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / integration-test (evmos, evmosd, evmos)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 132 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / integration-test (ibc-go-v5-simapp, simd, cosmos)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 132 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / integration-test (ibc-go-v6-simapp, simd, cosmos)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 132 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / integration-test (wasmd, wasmd, wasm)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 132 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / forward-packet (gaia11, gaiad, cosmos)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 132 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / interchain-security-ica (stride-consumer, strided, stride)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 132 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / cargo-doc

no field `key_name` on type `&mut ChainConfig`

Check failure on line 132 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / interchain-security-no-ica (neutron, neutrond, neutron)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 132 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / interchain-security-icq (stride-consumer-no-admin, strided, stride)

no field `key_name` on type `&mut ChainConfig`
} else {
// Otherwise, find the key in the keystore
let chain_id = &chain_config.id;
let chain_id = &chain_config.id();
let key = find_key(chain_config);
if let Some(key) = key {
info!("{}: uses key '{}'", &chain_id, &key);
chain_config.key_name = key;

Check failure on line 139 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / ics29-fee-test (ibc-go-v5-simapp, simd, cosmos)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 139 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / ica-filter-test (ibc-go-v6-simapp, simd, cosmos)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 139 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / ica-filter-test (ibc-go-v7-simapp, simd, cosmos)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 139 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / ics29-fee-test (ibc-go-v7-simapp, simd, cosmos)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 139 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / ics29-fee-test (ibc-go-v6-simapp, simd, cosmos)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 139 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / clean-workers (gaia11, gaiad, cosmos)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 139 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / ics31 (.#gaia11 .#stride-no-admin, gaiad,strided, cosmos,stride)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 139 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / model-based-test (gaia6)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 139 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / misbehaviour (gaia11, gaiad, cosmos)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 139 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / forward-packet (juno, junod, juno)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 139 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / fee-grant (stride, strided, stride)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 139 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / ordered-channel-test

no field `key_name` on type `&mut ChainConfig`

Check failure on line 139 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / ics29-fee-test (migaloo, migalood, migaloo)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 139 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / integration-test (ibc-go-v4-simapp, simd, cosmos)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 139 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / integration-test (gaia11, gaiad, cosmos)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 139 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / integration-test (juno, junod, juno)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 139 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / test-stable

no field `key_name` on type `&mut ChainConfig`

Check failure on line 139 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / integration-test (osmosis, osmosisd, osmo)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 139 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / integration-test (stride, strided, stride)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 139 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / integration-test (ibc-go-v7-simapp, simd, cosmos)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 139 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / fee-grant (evmos, evmosd, evmos)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 139 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / integration-test (evmos, evmosd, evmos)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 139 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / integration-test (ibc-go-v5-simapp, simd, cosmos)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 139 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / integration-test (ibc-go-v6-simapp, simd, cosmos)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 139 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / integration-test (wasmd, wasmd, wasm)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 139 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / forward-packet (gaia11, gaiad, cosmos)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 139 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / interchain-security-ica (stride-consumer, strided, stride)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 139 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / cargo-doc

no field `key_name` on type `&mut ChainConfig`

Check failure on line 139 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / interchain-security-no-ica (neutron, neutrond, neutron)

no field `key_name` on type `&mut ChainConfig`

Check failure on line 139 in crates/relayer-cli/src/commands/config/auto.rs

View workflow job for this annotation

GitHub Actions / interchain-security-icq (stride-consumer-no-admin, strided, stride)

no field `key_name` on type `&mut ChainConfig`
} else {
// If no key is found, warn the user and continue
warn!("No key found for chain: {}", chain_id);
Expand Down
6 changes: 3 additions & 3 deletions crates/relayer-cli/src/commands/health.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ impl Runnable for HealthCheckCmd {
let config = app_config();

for ch in &config.chains {
let _span = tracing::error_span!("health_check", chain = %ch.id).entered();
let _span = tracing::error_span!("health_check", chain = %ch.id()).entered();

info!("performing health check...");

let chain =
spawn_chain_runtime(&config, &ch.id).unwrap_or_else(exit_with_unrecoverable_error);
let chain = spawn_chain_runtime(&config, &ch.id())
.unwrap_or_else(exit_with_unrecoverable_error);

match chain.health_check() {
Ok(Healthy) => info!("chain is healthy"),
Expand Down
13 changes: 6 additions & 7 deletions crates/relayer-cli/src/commands/keys/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
use eyre::eyre;
use hdpath::StandardHDPath;
use ibc_relayer::{
chain::ChainType,
config::{ChainConfig, Config},
keyring::{
AnySigningKeyPair, KeyRing, Secp256k1KeyPair, SigningKeyPair, SigningKeyPairSized, Store,
Expand Down Expand Up @@ -107,7 +106,7 @@
let hd_path = StandardHDPath::from_str(&self.hd_path)
.map_err(|_| eyre!("invalid derivation path: {}", self.hd_path))?;

Ok(KeysAddOptions {

Check failure on line 109 in crates/relayer-cli/src/commands/keys/add.rs

View workflow job for this annotation

GitHub Actions / ics29-fee-test (ibc-go-v5-simapp, simd, cosmos)

no field `key_name` on type `&ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/keys/add.rs

View workflow job for this annotation

GitHub Actions / ica-filter-test (ibc-go-v6-simapp, simd, cosmos)

no field `key_name` on type `&ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/keys/add.rs

View workflow job for this annotation

GitHub Actions / ica-filter-test (ibc-go-v7-simapp, simd, cosmos)

no field `key_name` on type `&ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/keys/add.rs

View workflow job for this annotation

GitHub Actions / ics29-fee-test (ibc-go-v7-simapp, simd, cosmos)

no field `key_name` on type `&ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/keys/add.rs

View workflow job for this annotation

GitHub Actions / ics29-fee-test (ibc-go-v6-simapp, simd, cosmos)

no field `key_name` on type `&ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/keys/add.rs

View workflow job for this annotation

GitHub Actions / clean-workers (gaia11, gaiad, cosmos)

no field `key_name` on type `&ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/keys/add.rs

View workflow job for this annotation

GitHub Actions / ics31 (.#gaia11 .#stride-no-admin, gaiad,strided, cosmos,stride)

no field `key_name` on type `&ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/keys/add.rs

View workflow job for this annotation

GitHub Actions / model-based-test (gaia6)

no field `key_name` on type `&ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/keys/add.rs

View workflow job for this annotation

GitHub Actions / misbehaviour (gaia11, gaiad, cosmos)

no field `key_name` on type `&ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/keys/add.rs

View workflow job for this annotation

GitHub Actions / forward-packet (juno, junod, juno)

no field `key_name` on type `&ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/keys/add.rs

View workflow job for this annotation

GitHub Actions / fee-grant (stride, strided, stride)

no field `key_name` on type `&ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/keys/add.rs

View workflow job for this annotation

GitHub Actions / ordered-channel-test

no field `key_name` on type `&ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/keys/add.rs

View workflow job for this annotation

GitHub Actions / ics29-fee-test (migaloo, migalood, migaloo)

no field `key_name` on type `&ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/keys/add.rs

View workflow job for this annotation

GitHub Actions / integration-test (ibc-go-v4-simapp, simd, cosmos)

no field `key_name` on type `&ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/keys/add.rs

View workflow job for this annotation

GitHub Actions / integration-test (gaia11, gaiad, cosmos)

no field `key_name` on type `&ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/keys/add.rs

View workflow job for this annotation

GitHub Actions / integration-test (juno, junod, juno)

no field `key_name` on type `&ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/keys/add.rs

View workflow job for this annotation

GitHub Actions / test-stable

no field `key_name` on type `&ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/keys/add.rs

View workflow job for this annotation

GitHub Actions / integration-test (osmosis, osmosisd, osmo)

no field `key_name` on type `&ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/keys/add.rs

View workflow job for this annotation

GitHub Actions / integration-test (stride, strided, stride)

no field `key_name` on type `&ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/keys/add.rs

View workflow job for this annotation

GitHub Actions / integration-test (ibc-go-v7-simapp, simd, cosmos)

no field `key_name` on type `&ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/keys/add.rs

View workflow job for this annotation

GitHub Actions / fee-grant (evmos, evmosd, evmos)

no field `key_name` on type `&ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/keys/add.rs

View workflow job for this annotation

GitHub Actions / integration-test (evmos, evmosd, evmos)

no field `key_name` on type `&ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/keys/add.rs

View workflow job for this annotation

GitHub Actions / integration-test (ibc-go-v5-simapp, simd, cosmos)

no field `key_name` on type `&ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/keys/add.rs

View workflow job for this annotation

GitHub Actions / integration-test (ibc-go-v6-simapp, simd, cosmos)

no field `key_name` on type `&ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/keys/add.rs

View workflow job for this annotation

GitHub Actions / integration-test (wasmd, wasmd, wasm)

no field `key_name` on type `&ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/keys/add.rs

View workflow job for this annotation

GitHub Actions / forward-packet (gaia11, gaiad, cosmos)

no field `key_name` on type `&ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/keys/add.rs

View workflow job for this annotation

GitHub Actions / interchain-security-ica (stride-consumer, strided, stride)

no field `key_name` on type `&ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/keys/add.rs

View workflow job for this annotation

GitHub Actions / cargo-doc

no field `key_name` on type `&ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/keys/add.rs

View workflow job for this annotation

GitHub Actions / interchain-security-no-ica (neutron, neutrond, neutron)

no field `key_name` on type `&ChainConfig`

Check failure on line 109 in crates/relayer-cli/src/commands/keys/add.rs

View workflow job for this annotation

GitHub Actions / interchain-security-icq (stride-consumer-no-admin, strided, stride)

no field `key_name` on type `&ChainConfig`
config: chain_config.clone(),
name,
hd_path,
Expand Down Expand Up @@ -146,7 +145,7 @@
"Added key '{}' ({}) on chain {}",
opts.name,
key.account(),
opts.config.id
opts.config.id(),
))
.exit(),
Err(e) => Output::error(format!(
Expand All @@ -170,7 +169,7 @@
"Restored key '{}' ({}) on chain {}",
opts.name,
key.account(),
opts.config.id
opts.config.id()
))
.exit(),
Err(e) => Output::error(format!(
Expand Down Expand Up @@ -198,8 +197,8 @@
hd_path: &StandardHDPath,
overwrite: bool,
) -> eyre::Result<AnySigningKeyPair> {
let key_pair = match config.r#type {
ChainType::CosmosSdk => {
let key_pair = match config {
ChainConfig::CosmosSdk(config) => {
let mut keyring = KeyRing::new_secp256k1(
Store::Test,
&config.account_prefix,
Expand Down Expand Up @@ -231,8 +230,8 @@
let mnemonic_content =
fs::read_to_string(mnemonic).map_err(|_| eyre!("error reading the mnemonic file"))?;

let key_pair = match config.r#type {
ChainType::CosmosSdk => {
let key_pair = match config {
ChainConfig::CosmosSdk(config) => {
let mut keyring = KeyRing::new_secp256k1(
Store::Test,
&config.account_prefix,
Expand Down
12 changes: 6 additions & 6 deletions crates/relayer-cli/src/commands/keys/delete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

use eyre::eyre;
use ibc_relayer::{
chain::ChainType,
config::{ChainConfig, Config},
keyring::{KeyRing, Store},
};
Expand Down Expand Up @@ -95,7 +94,7 @@
match opts.id {
KeysDeleteId::All => match delete_all_keys(&opts.config) {
Ok(_) => {
Output::success_msg(format!("Removed all keys on chain {}", opts.config.id))

Check failure on line 97 in crates/relayer-cli/src/commands/keys/delete.rs

View workflow job for this annotation

GitHub Actions / ics29-fee-test (ibc-go-v5-simapp, simd, cosmos)

attempted to take value of method `id` on type `ChainConfig`

Check failure on line 97 in crates/relayer-cli/src/commands/keys/delete.rs

View workflow job for this annotation

GitHub Actions / ica-filter-test (ibc-go-v6-simapp, simd, cosmos)

attempted to take value of method `id` on type `ChainConfig`

Check failure on line 97 in crates/relayer-cli/src/commands/keys/delete.rs

View workflow job for this annotation

GitHub Actions / ica-filter-test (ibc-go-v7-simapp, simd, cosmos)

attempted to take value of method `id` on type `ChainConfig`

Check failure on line 97 in crates/relayer-cli/src/commands/keys/delete.rs

View workflow job for this annotation

GitHub Actions / ics29-fee-test (ibc-go-v7-simapp, simd, cosmos)

attempted to take value of method `id` on type `ChainConfig`

Check failure on line 97 in crates/relayer-cli/src/commands/keys/delete.rs

View workflow job for this annotation

GitHub Actions / ics29-fee-test (ibc-go-v6-simapp, simd, cosmos)

attempted to take value of method `id` on type `ChainConfig`

Check failure on line 97 in crates/relayer-cli/src/commands/keys/delete.rs

View workflow job for this annotation

GitHub Actions / clean-workers (gaia11, gaiad, cosmos)

attempted to take value of method `id` on type `ChainConfig`

Check failure on line 97 in crates/relayer-cli/src/commands/keys/delete.rs

View workflow job for this annotation

GitHub Actions / ics31 (.#gaia11 .#stride-no-admin, gaiad,strided, cosmos,stride)

attempted to take value of method `id` on type `ChainConfig`

Check failure on line 97 in crates/relayer-cli/src/commands/keys/delete.rs

View workflow job for this annotation

GitHub Actions / model-based-test (gaia6)

attempted to take value of method `id` on type `ChainConfig`

Check failure on line 97 in crates/relayer-cli/src/commands/keys/delete.rs

View workflow job for this annotation

GitHub Actions / misbehaviour (gaia11, gaiad, cosmos)

attempted to take value of method `id` on type `ChainConfig`

Check failure on line 97 in crates/relayer-cli/src/commands/keys/delete.rs

View workflow job for this annotation

GitHub Actions / forward-packet (juno, junod, juno)

attempted to take value of method `id` on type `ChainConfig`

Check failure on line 97 in crates/relayer-cli/src/commands/keys/delete.rs

View workflow job for this annotation

GitHub Actions / fee-grant (stride, strided, stride)

attempted to take value of method `id` on type `ChainConfig`

Check failure on line 97 in crates/relayer-cli/src/commands/keys/delete.rs

View workflow job for this annotation

GitHub Actions / ordered-channel-test

attempted to take value of method `id` on type `ChainConfig`

Check failure on line 97 in crates/relayer-cli/src/commands/keys/delete.rs

View workflow job for this annotation

GitHub Actions / ics29-fee-test (migaloo, migalood, migaloo)

attempted to take value of method `id` on type `ChainConfig`

Check failure on line 97 in crates/relayer-cli/src/commands/keys/delete.rs

View workflow job for this annotation

GitHub Actions / integration-test (ibc-go-v4-simapp, simd, cosmos)

attempted to take value of method `id` on type `ChainConfig`

Check failure on line 97 in crates/relayer-cli/src/commands/keys/delete.rs

View workflow job for this annotation

GitHub Actions / integration-test (gaia11, gaiad, cosmos)

attempted to take value of method `id` on type `ChainConfig`

Check failure on line 97 in crates/relayer-cli/src/commands/keys/delete.rs

View workflow job for this annotation

GitHub Actions / integration-test (juno, junod, juno)

attempted to take value of method `id` on type `ChainConfig`

Check failure on line 97 in crates/relayer-cli/src/commands/keys/delete.rs

View workflow job for this annotation

GitHub Actions / test-stable

attempted to take value of method `id` on type `ChainConfig`

Check failure on line 97 in crates/relayer-cli/src/commands/keys/delete.rs

View workflow job for this annotation

GitHub Actions / integration-test (osmosis, osmosisd, osmo)

attempted to take value of method `id` on type `ChainConfig`

Check failure on line 97 in crates/relayer-cli/src/commands/keys/delete.rs

View workflow job for this annotation

GitHub Actions / integration-test (stride, strided, stride)

attempted to take value of method `id` on type `ChainConfig`

Check failure on line 97 in crates/relayer-cli/src/commands/keys/delete.rs

View workflow job for this annotation

GitHub Actions / integration-test (ibc-go-v7-simapp, simd, cosmos)

attempted to take value of method `id` on type `ChainConfig`

Check failure on line 97 in crates/relayer-cli/src/commands/keys/delete.rs

View workflow job for this annotation

GitHub Actions / fee-grant (evmos, evmosd, evmos)

attempted to take value of method `id` on type `ChainConfig`

Check failure on line 97 in crates/relayer-cli/src/commands/keys/delete.rs

View workflow job for this annotation

GitHub Actions / integration-test (evmos, evmosd, evmos)

attempted to take value of method `id` on type `ChainConfig`

Check failure on line 97 in crates/relayer-cli/src/commands/keys/delete.rs

View workflow job for this annotation

GitHub Actions / integration-test (ibc-go-v5-simapp, simd, cosmos)

attempted to take value of method `id` on type `ChainConfig`

Check failure on line 97 in crates/relayer-cli/src/commands/keys/delete.rs

View workflow job for this annotation

GitHub Actions / integration-test (ibc-go-v6-simapp, simd, cosmos)

attempted to take value of method `id` on type `ChainConfig`

Check failure on line 97 in crates/relayer-cli/src/commands/keys/delete.rs

View workflow job for this annotation

GitHub Actions / integration-test (wasmd, wasmd, wasm)

attempted to take value of method `id` on type `ChainConfig`

Check failure on line 97 in crates/relayer-cli/src/commands/keys/delete.rs

View workflow job for this annotation

GitHub Actions / forward-packet (gaia11, gaiad, cosmos)

attempted to take value of method `id` on type `ChainConfig`

Check failure on line 97 in crates/relayer-cli/src/commands/keys/delete.rs

View workflow job for this annotation

GitHub Actions / interchain-security-ica (stride-consumer, strided, stride)

attempted to take value of method `id` on type `ChainConfig`

Check failure on line 97 in crates/relayer-cli/src/commands/keys/delete.rs

View workflow job for this annotation

GitHub Actions / cargo-doc

attempted to take value of method `id` on type `ChainConfig`

Check failure on line 97 in crates/relayer-cli/src/commands/keys/delete.rs

View workflow job for this annotation

GitHub Actions / interchain-security-no-ica (neutron, neutrond, neutron)

attempted to take value of method `id` on type `ChainConfig`

Check failure on line 97 in crates/relayer-cli/src/commands/keys/delete.rs

View workflow job for this annotation

GitHub Actions / interchain-security-icq (stride-consumer-no-admin, strided, stride)

attempted to take value of method `id` on type `ChainConfig`
.exit()
}
Err(e) => Output::error(e).exit(),
Expand All @@ -103,7 +102,8 @@
KeysDeleteId::Named(key_name) => match delete_key(&opts.config, key_name) {
Ok(_) => Output::success_msg(format!(
"Removed key ({}) on chain {}",
key_name, opts.config.id
key_name,
opts.config.id(),
))
.exit(),
Err(e) => Output::error(e).exit(),
Expand All @@ -113,8 +113,8 @@
}

pub fn delete_key(config: &ChainConfig, key_name: &str) -> eyre::Result<()> {
match config.r#type {
ChainType::CosmosSdk => {
match config {
ChainConfig::CosmosSdk(config) => {
let mut keyring = KeyRing::new_secp256k1(
Store::Test,
&config.account_prefix,
Expand All @@ -128,8 +128,8 @@
}

pub fn delete_all_keys(config: &ChainConfig) -> eyre::Result<()> {
match config.r#type {
ChainType::CosmosSdk => {
match config {
ChainConfig::CosmosSdk(config) => {
let mut keyring = KeyRing::new_secp256k1(
Store::Test,
&config.account_prefix,
Expand Down
5 changes: 4 additions & 1 deletion crates/relayer-cli/src/commands/listen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ impl Runnable for ListenCmd {
}

/// Listen to events
#[instrument(skip_all, level = "error", fields(chain = %config.id))]
#[instrument(skip_all, level = "error", fields(chain = %config.id()))]
pub fn listen(config: &ChainConfig, filters: &[EventFilter]) -> eyre::Result<()> {
let rt = Arc::new(TokioRuntime::new()?);
let compat_mode = detect_compatibility_mode(config, rt.clone())?;
Expand Down Expand Up @@ -144,6 +144,8 @@ fn subscribe(
compat_mode: CompatMode,
rt: Arc<TokioRuntime>,
) -> eyre::Result<Subscription> {
// Q: Should this be restricted only to backends that support it,
// or are all backends expected to support subscriptions?
let (event_source, monitor_tx) = match &chain_config.event_source {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that should be restricted only to backends to support subscriptions, but right now Hermes requires all backends to do so. Definitely more work needed there to remove this assumption.

EventSourceMode::Push { url, batch_delay } => EventSource::websocket(
chain_config.id.clone(),
Expand All @@ -166,6 +168,7 @@ fn subscribe(
Ok(subscription)
}

// Q: why isn't this part of the CosmosSDK chain endpoint impl?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, we have similar code in the CosmosSdkChain::boostrap which ought to be refactored to use this function after we move it under the cosmos module.

fn detect_compatibility_mode(
config: &ChainConfig,
rt: Arc<TokioRuntime>,
Expand Down
8 changes: 5 additions & 3 deletions crates/relayer-cli/src/commands/tx/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ impl Runnable for TxUpdateClientCmd {

if let Some(restart_params) = self.genesis_restart_params() {
if let Some(c) = config.find_chain_mut(&reference_chain_id) {
// Q: How should this be handled? Should the cli command only
// work on supported chain types?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we probably want such commands to restrict which types of chains they work against, either by explicitly checking that and throwing an error, or by moving them under a new sub-command per chain type, eg. this would become tx cosmos update client. Not sure which way to go yet.

c.genesis_restart = Some(restart_params);
}
}
Expand Down Expand Up @@ -435,14 +437,14 @@ impl Runnable for TxUpgradeClientsCmd {
.chains
.iter()
.filter_map(|chain| {
(self.reference_chain_id != chain.id
(self.reference_chain_id != *chain.id()
&& (self.host_chain_id.is_none()
|| self.host_chain_id == Some(chain.id.clone())))
|| self.host_chain_id == Some(chain.id().clone())))
.then(|| {
self.upgrade_clients_for_chain(
&config,
reference_chain.clone(),
&chain.id,
&chain.id(),
reference_upgrade_height,
)
})
Expand Down
19 changes: 11 additions & 8 deletions crates/relayer-cli/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use alloc::collections::BTreeSet;
use std::path::PathBuf;

use flex_error::{define_error, TraceError};
use ibc_relayer::config::{ChainConfig, Config, ModeConfig};
use ibc_relayer::config::{ChainConfig, Config, CosmosSdkConfig, ModeConfig};
use ibc_relayer_types::core::ics24_host::identifier::ChainId;
use tendermint_light_client_verifier::types::TrustThreshold;
use tracing_subscriber::filter::ParseError;
Expand Down Expand Up @@ -87,15 +87,18 @@ pub fn validate_config(config: &Config) -> Result<(), Diagnostic<Error>> {
// Check for duplicate chain configuration and invalid trust thresholds
let mut unique_chain_ids = BTreeSet::new();
for c in config.chains.iter() {
let already_present = !unique_chain_ids.insert(c.id.clone());
let already_present = !unique_chain_ids.insert(c.id().clone());
if already_present {
return Err(Diagnostic::Error(Error::duplicate_chains(c.id.clone())));
return Err(Diagnostic::Error(Error::duplicate_chains(c.id().clone())));
}

validate_trust_threshold(&c.id, c.trust_threshold)?;

// Validate gas-related settings
validate_gas_settings(&c.id, c)?;
// TODO: why are these not methods on the config object?
// why are they defined only in the relayer-cli crate?
if let ChainConfig::CosmosSdk(cosmos_c) = c {
validate_trust_threshold(&cosmos_c.id, cosmos_c.trust_threshold)?;
// Validate gas-related settings
validate_gas_settings(&cosmos_c.id, cosmos_c)?;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't config validation code be attached to the configs in the core crate, rather than being in the cli? Happy to move it if that sounds good.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, let's move that function into the core crate. No good reason to have it here.

}

// Check for invalid mode config
Expand Down Expand Up @@ -156,7 +159,7 @@ fn validate_trust_threshold(
Ok(())
}

fn validate_gas_settings(id: &ChainId, config: &ChainConfig) -> Result<(), Diagnostic<Error>> {
fn validate_gas_settings(id: &ChainId, config: &CosmosSdkConfig) -> Result<(), Diagnostic<Error>> {
// Check that the gas_adjustment option is not set
if let Some(gas_adjustment) = config.gas_adjustment {
let gas_multiplier = gas_adjustment + 1.0;
Expand Down
57 changes: 0 additions & 57 deletions crates/relayer/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,60 +6,3 @@ pub mod handle;
pub mod requests;
pub mod runtime;
pub mod tracking;

use serde::{de::Error, Deserialize, Serialize};

// NOTE(new): When adding a variant to `ChainType`, make sure to update
// the `Deserialize` implementation below and the tests.
// See the NOTE(new) comments below.

#[derive(Copy, Clone, Debug, PartialEq, Eq, Serialize)]
/// Types of chains the relayer can relay to and from
pub enum ChainType {
/// Chains based on the Cosmos SDK
CosmosSdk,
}
Comment on lines -16 to -21
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is gone entirely. Rather than having the config store an enum of chain types, the config is an enum, so that it can have different subtypes for different configs.


impl<'de> Deserialize<'de> for ChainType {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let original = String::deserialize(deserializer)?;
let s = original.to_ascii_lowercase().replace('-', "");

match s.as_str() {
"cosmossdk" => Ok(Self::CosmosSdk),

// NOTE(new): Add a case here
_ => Err(D::Error::unknown_variant(&original, &["cosmos-sdk"])), // NOTE(new): mention the new variant here
}
}
}

#[cfg(test)]
mod tests {
use super::*;

#[derive(Copy, Clone, Debug, Serialize, Deserialize)]
pub struct Config {
tpe: ChainType,
}

fn parse(variant: &str) -> Result<ChainType, toml::de::Error> {
toml::from_str::<Config>(&format!("tpe = '{variant}'")).map(|e| e.tpe)
}

#[test]
fn deserialize() {
use ChainType::*;

assert!(matches!(parse("CosmosSdk"), Ok(CosmosSdk)));
assert!(matches!(parse("cosmossdk"), Ok(CosmosSdk)));
assert!(matches!(parse("cosmos-sdk"), Ok(CosmosSdk)));

// NOTE(new): Add tests here

assert!(parse("hello-world").is_err());
}
}
Loading
Loading