Skip to content

Commit

Permalink
implement some client and connection queries
Browse files Browse the repository at this point in the history
  • Loading branch information
avahowell committed Jan 31, 2024
1 parent 303c21b commit ff9e6d3
Show file tree
Hide file tree
Showing 3 changed files with 169 additions and 32 deletions.
2 changes: 1 addition & 1 deletion crates/relayer/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pub mod cosmos;
pub mod counterparty;
pub mod endpoint;
pub mod handle;
pub mod penumbra;
pub mod requests;
pub mod runtime;
pub mod tracking;
pub mod penumbra;
198 changes: 168 additions & 30 deletions crates/relayer/src/chain/penumbra/chain.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
use http::Uri;
use std::str::FromStr;
use std::sync::Arc;
use std::thread;

use crate::chain::requests::{IncludeProof, Qualified, QueryConnectionsRequest, QueryHeight};

Check warning on line 6 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / ics-double-sign (interchain-security, cosmos)

unused imports: `IncludeProof`, `Qualified`, `QueryHeight`

Check warning on line 6 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (gaia13, gaiad, cosmos, stake, forward-packet,clean-workers)

unused imports: `IncludeProof`, `Qualified`, `QueryHeight`

Check warning on line 6 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / ics-light-client-attack (interchain-security, cosmos)

unused imports: `IncludeProof`, `Qualified`, `QueryHeight`

Check warning on line 6 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (gaia14, gaiad, cosmos, stake, forward-packet,clean-workers)

unused imports: `IncludeProof`, `Qualified`, `QueryHeight`

Check warning on line 6 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / ics-light-client-attack-freeze (interchain-security, cosmos)

unused imports: `IncludeProof`, `Qualified`, `QueryHeight`

Check warning on line 6 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / test-stable

unused imports: `IncludeProof`, `Qualified`, `QueryHeight`

Check warning on line 6 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

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

unused imports: `IncludeProof`, `Qualified`, `QueryHeight`

Check warning on line 6 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / light-client-attack (gaia14, gaiad, cosmos)

unused imports: `IncludeProof`, `Qualified`, `QueryHeight`

Check warning on line 6 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

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

unused imports: `IncludeProof`, `Qualified`, `QueryHeight`

Check warning on line 6 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / interchain-security-no-ica (.#gaia13 .#neutron, gaiad,neutrond, cosmos,neutron)

unused imports: `IncludeProof`, `Qualified`, `QueryHeight`

Check warning on line 6 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / ordered-channel-test

unused imports: `IncludeProof`, `Qualified`, `QueryHeight`

Check warning on line 6 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (ibc-go-v8-simapp, simd, cosmos, stake, ica,ics29-fee)

unused imports: `IncludeProof`, `Qualified`, `QueryHeight`

Check warning on line 6 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / interchain-security-no-ica (.#gaia14 .#neutron, gaiad,neutrond, cosmos,neutron)

unused imports: `IncludeProof`, `Qualified`, `QueryHeight`

Check warning on line 6 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

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

unused imports: `IncludeProof`, `Qualified`, `QueryHeight`

Check warning on line 6 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (osmosis, osmosisd, osmo, stake, dynamic-gas-fee)

unused imports: `IncludeProof`, `Qualified`, `QueryHeight`

Check warning on line 6 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (juno, junod, juno, stake, juno,forward-packet)

unused imports: `IncludeProof`, `Qualified`, `QueryHeight`

Check warning on line 6 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (provenance, provenanced, pb, nhash, fee-grant,async-icq)

unused imports: `IncludeProof`, `Qualified`, `QueryHeight`

Check warning on line 6 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (migaloo, migalood, migaloo, stake)

unused imports: `IncludeProof`, `Qualified`, `QueryHeight`

Check warning on line 6 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / celestia-to-gaia (.#celestia .#gaia13, celestia-appd,gaiad, celestia,cosmos, utia,stake)

unused imports: `IncludeProof`, `Qualified`, `QueryHeight`

Check warning on line 6 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / interchain-security-ica (.#gaia13 .#stride-consumer, gaiad,strided, cosmos,stride)

unused imports: `IncludeProof`, `Qualified`, `QueryHeight`

Check warning on line 6 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / interchain-security-icq (.#gaia13 .#stride-consumer-no-admin, gaiad,strided, cosmos,stride)

unused imports: `IncludeProof`, `Qualified`, `QueryHeight`

Check warning on line 6 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / celestia-to-gaia (.#celestia .#gaia14, celestia-appd,gaiad, celestia,cosmos, utia,stake)

unused imports: `IncludeProof`, `Qualified`, `QueryHeight`

Check warning on line 6 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / interchain-security-ica (.#gaia14 .#stride-consumer, gaiad,strided, cosmos,stride)

unused imports: `IncludeProof`, `Qualified`, `QueryHeight`

Check warning on line 6 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / interchain-security-icq (.#gaia14 .#stride-consumer-no-admin, gaiad,strided, cosmos,stride)

unused imports: `IncludeProof`, `Qualified`, `QueryHeight`

Check warning on line 6 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / model-based-test (gaia6)

unused imports: `IncludeProof`, `Qualified`, `QueryHeight`

Check failure on line 6 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / clippy-no-default-features

unused imports: `IncludeProof`, `Qualified`, `QueryHeight`

error: unused imports: `IncludeProof`, `Qualified`, `QueryHeight` --> crates/relayer/src/chain/penumbra/chain.rs:6:30 | 6 | use crate::chain::requests::{IncludeProof, Qualified, QueryConnectionsRequest, QueryHeight}; | ^^^^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^^^ | = note: `-D unused-imports` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(unused_imports)]`

Check failure on line 6 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / clippy-no-default-features

unused imports: `IncludeProof`, `Qualified`, `QueryHeight`

error: unused imports: `IncludeProof`, `Qualified`, `QueryHeight` --> crates/relayer/src/chain/penumbra/chain.rs:6:30 | 6 | use crate::chain::requests::{IncludeProof, Qualified, QueryConnectionsRequest, QueryHeight}; | ^^^^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^^^ | = note: `-D unused-imports` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(unused_imports)]`

Check failure on line 6 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / clippy-all-features

unused imports: `IncludeProof`, `Qualified`, `QueryHeight`

error: unused imports: `IncludeProof`, `Qualified`, `QueryHeight` --> crates/relayer/src/chain/penumbra/chain.rs:6:30 | 6 | use crate::chain::requests::{IncludeProof, Qualified, QueryConnectionsRequest, QueryHeight}; | ^^^^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^^^ | = note: `-D unused-imports` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(unused_imports)]`

Check failure on line 6 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / clippy-all-features

unused imports: `IncludeProof`, `Qualified`, `QueryHeight`

error: unused imports: `IncludeProof`, `Qualified`, `QueryHeight` --> crates/relayer/src/chain/penumbra/chain.rs:6:30 | 6 | use crate::chain::requests::{IncludeProof, Qualified, QueryConnectionsRequest, QueryHeight}; | ^^^^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^^^ | = note: `-D unused-imports` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(unused_imports)]`
use crate::client_state::{AnyClientState, IdentifiedAnyClientState};

Check warning on line 7 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / ics-double-sign (interchain-security, cosmos)

unused import: `AnyClientState`

Check warning on line 7 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (gaia13, gaiad, cosmos, stake, forward-packet,clean-workers)

unused import: `AnyClientState`

Check warning on line 7 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / ics-light-client-attack (interchain-security, cosmos)

unused import: `AnyClientState`

Check warning on line 7 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (gaia14, gaiad, cosmos, stake, forward-packet,clean-workers)

unused import: `AnyClientState`

Check warning on line 7 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / ics-light-client-attack-freeze (interchain-security, cosmos)

unused import: `AnyClientState`

Check warning on line 7 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / test-stable

unused import: `AnyClientState`

Check warning on line 7 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

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

unused import: `AnyClientState`

Check warning on line 7 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / light-client-attack (gaia14, gaiad, cosmos)

unused import: `AnyClientState`

Check warning on line 7 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

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

unused import: `AnyClientState`

Check warning on line 7 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / interchain-security-no-ica (.#gaia13 .#neutron, gaiad,neutrond, cosmos,neutron)

unused import: `AnyClientState`

Check warning on line 7 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / ordered-channel-test

unused import: `AnyClientState`

Check warning on line 7 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (ibc-go-v8-simapp, simd, cosmos, stake, ica,ics29-fee)

unused import: `AnyClientState`

Check warning on line 7 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / interchain-security-no-ica (.#gaia14 .#neutron, gaiad,neutrond, cosmos,neutron)

unused import: `AnyClientState`

Check warning on line 7 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

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

unused import: `AnyClientState`

Check warning on line 7 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (osmosis, osmosisd, osmo, stake, dynamic-gas-fee)

unused import: `AnyClientState`

Check warning on line 7 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (juno, junod, juno, stake, juno,forward-packet)

unused import: `AnyClientState`

Check warning on line 7 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (provenance, provenanced, pb, nhash, fee-grant,async-icq)

unused import: `AnyClientState`

Check warning on line 7 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (migaloo, migalood, migaloo, stake)

unused import: `AnyClientState`

Check warning on line 7 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / celestia-to-gaia (.#celestia .#gaia13, celestia-appd,gaiad, celestia,cosmos, utia,stake)

unused import: `AnyClientState`

Check warning on line 7 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / interchain-security-ica (.#gaia13 .#stride-consumer, gaiad,strided, cosmos,stride)

unused import: `AnyClientState`

Check warning on line 7 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / interchain-security-icq (.#gaia13 .#stride-consumer-no-admin, gaiad,strided, cosmos,stride)

unused import: `AnyClientState`

Check warning on line 7 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / celestia-to-gaia (.#celestia .#gaia14, celestia-appd,gaiad, celestia,cosmos, utia,stake)

unused import: `AnyClientState`

Check warning on line 7 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / interchain-security-ica (.#gaia14 .#stride-consumer, gaiad,strided, cosmos,stride)

unused import: `AnyClientState`

Check warning on line 7 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / interchain-security-icq (.#gaia14 .#stride-consumer-no-admin, gaiad,strided, cosmos,stride)

unused import: `AnyClientState`

Check warning on line 7 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / model-based-test (gaia6)

unused import: `AnyClientState`

Check failure on line 7 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / clippy-no-default-features

unused import: `AnyClientState`

error: unused import: `AnyClientState` --> crates/relayer/src/chain/penumbra/chain.rs:7:27 | 7 | use crate::client_state::{AnyClientState, IdentifiedAnyClientState}; | ^^^^^^^^^^^^^^

Check failure on line 7 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / clippy-no-default-features

unused import: `AnyClientState`

error: unused import: `AnyClientState` --> crates/relayer/src/chain/penumbra/chain.rs:7:27 | 7 | use crate::client_state::{AnyClientState, IdentifiedAnyClientState}; | ^^^^^^^^^^^^^^

Check failure on line 7 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / clippy-all-features

unused import: `AnyClientState`

error: unused import: `AnyClientState` --> crates/relayer/src/chain/penumbra/chain.rs:7:27 | 7 | use crate::client_state::{AnyClientState, IdentifiedAnyClientState}; | ^^^^^^^^^^^^^^

Check failure on line 7 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / clippy-all-features

unused import: `AnyClientState`

error: unused import: `AnyClientState` --> crates/relayer/src/chain/penumbra/chain.rs:7:27 | 7 | use crate::client_state::{AnyClientState, IdentifiedAnyClientState}; | ^^^^^^^^^^^^^^
use crate::event::source::{EventSource, TxEventSourceCmd};
use crate::light_client::tendermint::LightClient as TmLightClient;

Check warning on line 9 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / ics-double-sign (interchain-security, cosmos)

unused import: `crate::light_client::tendermint::LightClient as TmLightClient`

Check warning on line 9 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (gaia13, gaiad, cosmos, stake, forward-packet,clean-workers)

unused import: `crate::light_client::tendermint::LightClient as TmLightClient`

Check warning on line 9 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / ics-light-client-attack (interchain-security, cosmos)

unused import: `crate::light_client::tendermint::LightClient as TmLightClient`

Check warning on line 9 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (gaia14, gaiad, cosmos, stake, forward-packet,clean-workers)

unused import: `crate::light_client::tendermint::LightClient as TmLightClient`

Check warning on line 9 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / ics-light-client-attack-freeze (interchain-security, cosmos)

unused import: `crate::light_client::tendermint::LightClient as TmLightClient`

Check warning on line 9 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / test-stable

unused import: `crate::light_client::tendermint::LightClient as TmLightClient`

Check warning on line 9 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

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

unused import: `crate::light_client::tendermint::LightClient as TmLightClient`

Check warning on line 9 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / light-client-attack (gaia14, gaiad, cosmos)

unused import: `crate::light_client::tendermint::LightClient as TmLightClient`

Check warning on line 9 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

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

unused import: `crate::light_client::tendermint::LightClient as TmLightClient`

Check warning on line 9 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / interchain-security-no-ica (.#gaia13 .#neutron, gaiad,neutrond, cosmos,neutron)

unused import: `crate::light_client::tendermint::LightClient as TmLightClient`

Check warning on line 9 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / ordered-channel-test

unused import: `crate::light_client::tendermint::LightClient as TmLightClient`

Check warning on line 9 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (ibc-go-v8-simapp, simd, cosmos, stake, ica,ics29-fee)

unused import: `crate::light_client::tendermint::LightClient as TmLightClient`

Check warning on line 9 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / interchain-security-no-ica (.#gaia14 .#neutron, gaiad,neutrond, cosmos,neutron)

unused import: `crate::light_client::tendermint::LightClient as TmLightClient`

Check warning on line 9 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

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

unused import: `crate::light_client::tendermint::LightClient as TmLightClient`

Check warning on line 9 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (osmosis, osmosisd, osmo, stake, dynamic-gas-fee)

unused import: `crate::light_client::tendermint::LightClient as TmLightClient`

Check warning on line 9 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (juno, junod, juno, stake, juno,forward-packet)

unused import: `crate::light_client::tendermint::LightClient as TmLightClient`

Check warning on line 9 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (provenance, provenanced, pb, nhash, fee-grant,async-icq)

unused import: `crate::light_client::tendermint::LightClient as TmLightClient`

Check warning on line 9 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (migaloo, migalood, migaloo, stake)

unused import: `crate::light_client::tendermint::LightClient as TmLightClient`

Check warning on line 9 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / celestia-to-gaia (.#celestia .#gaia13, celestia-appd,gaiad, celestia,cosmos, utia,stake)

unused import: `crate::light_client::tendermint::LightClient as TmLightClient`

Check warning on line 9 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / interchain-security-ica (.#gaia13 .#stride-consumer, gaiad,strided, cosmos,stride)

unused import: `crate::light_client::tendermint::LightClient as TmLightClient`

Check warning on line 9 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / interchain-security-icq (.#gaia13 .#stride-consumer-no-admin, gaiad,strided, cosmos,stride)

unused import: `crate::light_client::tendermint::LightClient as TmLightClient`

Check warning on line 9 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / celestia-to-gaia (.#celestia .#gaia14, celestia-appd,gaiad, celestia,cosmos, utia,stake)

unused import: `crate::light_client::tendermint::LightClient as TmLightClient`

Check warning on line 9 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / interchain-security-ica (.#gaia14 .#stride-consumer, gaiad,strided, cosmos,stride)

unused import: `crate::light_client::tendermint::LightClient as TmLightClient`

Check warning on line 9 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / interchain-security-icq (.#gaia14 .#stride-consumer-no-admin, gaiad,strided, cosmos,stride)

unused import: `crate::light_client::tendermint::LightClient as TmLightClient`

Check warning on line 9 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / model-based-test (gaia6)

unused import: `crate::light_client::tendermint::LightClient as TmLightClient`

Check failure on line 9 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / clippy-no-default-features

unused import: `crate::light_client::tendermint::LightClient as TmLightClient`

error: unused import: `crate::light_client::tendermint::LightClient as TmLightClient` --> crates/relayer/src/chain/penumbra/chain.rs:9:5 | 9 | use crate::light_client::tendermint::LightClient as TmLightClient; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Check failure on line 9 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / clippy-no-default-features

unused import: `crate::light_client::tendermint::LightClient as TmLightClient`

error: unused import: `crate::light_client::tendermint::LightClient as TmLightClient` --> crates/relayer/src/chain/penumbra/chain.rs:9:5 | 9 | use crate::light_client::tendermint::LightClient as TmLightClient; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Check failure on line 9 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / clippy-all-features

unused import: `crate::light_client::tendermint::LightClient as TmLightClient`

error: unused import: `crate::light_client::tendermint::LightClient as TmLightClient` --> crates/relayer/src/chain/penumbra/chain.rs:9:5 | 9 | use crate::light_client::tendermint::LightClient as TmLightClient; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Check failure on line 9 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / clippy-all-features

unused import: `crate::light_client::tendermint::LightClient as TmLightClient`

error: unused import: `crate::light_client::tendermint::LightClient as TmLightClient` --> crates/relayer/src/chain/penumbra/chain.rs:9:5 | 9 | use crate::light_client::tendermint::LightClient as TmLightClient; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
use crate::util::pretty::{
PrettyIdentifiedChannel, PrettyIdentifiedClientState, PrettyIdentifiedConnection,

Check warning on line 11 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / ics-double-sign (interchain-security, cosmos)

unused import: `PrettyIdentifiedChannel`

Check warning on line 11 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (gaia13, gaiad, cosmos, stake, forward-packet,clean-workers)

unused import: `PrettyIdentifiedChannel`

Check warning on line 11 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / ics-light-client-attack (interchain-security, cosmos)

unused import: `PrettyIdentifiedChannel`

Check warning on line 11 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (gaia14, gaiad, cosmos, stake, forward-packet,clean-workers)

unused import: `PrettyIdentifiedChannel`

Check warning on line 11 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / ics-light-client-attack-freeze (interchain-security, cosmos)

unused import: `PrettyIdentifiedChannel`

Check warning on line 11 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / test-stable

unused import: `PrettyIdentifiedChannel`

Check warning on line 11 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

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

unused import: `PrettyIdentifiedChannel`

Check warning on line 11 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / light-client-attack (gaia14, gaiad, cosmos)

unused import: `PrettyIdentifiedChannel`

Check warning on line 11 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

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

unused import: `PrettyIdentifiedChannel`

Check warning on line 11 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / interchain-security-no-ica (.#gaia13 .#neutron, gaiad,neutrond, cosmos,neutron)

unused import: `PrettyIdentifiedChannel`

Check warning on line 11 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / ordered-channel-test

unused import: `PrettyIdentifiedChannel`

Check warning on line 11 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (ibc-go-v8-simapp, simd, cosmos, stake, ica,ics29-fee)

unused import: `PrettyIdentifiedChannel`

Check warning on line 11 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / interchain-security-no-ica (.#gaia14 .#neutron, gaiad,neutrond, cosmos,neutron)

unused import: `PrettyIdentifiedChannel`

Check warning on line 11 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

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

unused import: `PrettyIdentifiedChannel`

Check warning on line 11 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (osmosis, osmosisd, osmo, stake, dynamic-gas-fee)

unused import: `PrettyIdentifiedChannel`

Check warning on line 11 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (juno, junod, juno, stake, juno,forward-packet)

unused import: `PrettyIdentifiedChannel`

Check warning on line 11 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (provenance, provenanced, pb, nhash, fee-grant,async-icq)

unused import: `PrettyIdentifiedChannel`

Check warning on line 11 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (migaloo, migalood, migaloo, stake)

unused import: `PrettyIdentifiedChannel`

Check warning on line 11 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / celestia-to-gaia (.#celestia .#gaia13, celestia-appd,gaiad, celestia,cosmos, utia,stake)

unused import: `PrettyIdentifiedChannel`

Check warning on line 11 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / interchain-security-ica (.#gaia13 .#stride-consumer, gaiad,strided, cosmos,stride)

unused import: `PrettyIdentifiedChannel`

Check warning on line 11 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / interchain-security-icq (.#gaia13 .#stride-consumer-no-admin, gaiad,strided, cosmos,stride)

unused import: `PrettyIdentifiedChannel`

Check warning on line 11 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / celestia-to-gaia (.#celestia .#gaia14, celestia-appd,gaiad, celestia,cosmos, utia,stake)

unused import: `PrettyIdentifiedChannel`

Check warning on line 11 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / interchain-security-ica (.#gaia14 .#stride-consumer, gaiad,strided, cosmos,stride)

unused import: `PrettyIdentifiedChannel`

Check warning on line 11 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / interchain-security-icq (.#gaia14 .#stride-consumer-no-admin, gaiad,strided, cosmos,stride)

unused import: `PrettyIdentifiedChannel`

Check warning on line 11 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / model-based-test (gaia6)

unused import: `PrettyIdentifiedChannel`

Check failure on line 11 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / clippy-no-default-features

unused import: `PrettyIdentifiedChannel`

error: unused import: `PrettyIdentifiedChannel` --> crates/relayer/src/chain/penumbra/chain.rs:11:5 | 11 | PrettyIdentifiedChannel, PrettyIdentifiedClientState, PrettyIdentifiedConnection, | ^^^^^^^^^^^^^^^^^^^^^^^

Check failure on line 11 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / clippy-no-default-features

unused import: `PrettyIdentifiedChannel`

error: unused import: `PrettyIdentifiedChannel` --> crates/relayer/src/chain/penumbra/chain.rs:11:5 | 11 | PrettyIdentifiedChannel, PrettyIdentifiedClientState, PrettyIdentifiedConnection, | ^^^^^^^^^^^^^^^^^^^^^^^

Check failure on line 11 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / clippy-all-features

unused import: `PrettyIdentifiedChannel`

error: unused import: `PrettyIdentifiedChannel` --> crates/relayer/src/chain/penumbra/chain.rs:11:5 | 11 | PrettyIdentifiedChannel, PrettyIdentifiedClientState, PrettyIdentifiedConnection, | ^^^^^^^^^^^^^^^^^^^^^^^

Check failure on line 11 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / clippy-all-features

unused import: `PrettyIdentifiedChannel`

error: unused import: `PrettyIdentifiedChannel` --> crates/relayer/src/chain/penumbra/chain.rs:11:5 | 11 | PrettyIdentifiedChannel, PrettyIdentifiedClientState, PrettyIdentifiedConnection, | ^^^^^^^^^^^^^^^^^^^^^^^
};
use futures::StreamExt;
use ibc_relayer_types::clients::ics07_tendermint::client_state::ClientState as TmClientState;
use ibc_relayer_types::clients::ics07_tendermint::consensus_state::ConsensusState as TmConsensusState;
use ibc_relayer_types::clients::ics07_tendermint::header::Header as TmHeader;
use futures::StreamExt;
use ibc_relayer_types::core::ics03_connection::connection::{
ConnectionEnd, IdentifiedConnectionEnd,

Check warning on line 18 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / ics-double-sign (interchain-security, cosmos)

unused import: `ConnectionEnd`

Check warning on line 18 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (gaia13, gaiad, cosmos, stake, forward-packet,clean-workers)

unused import: `ConnectionEnd`

Check warning on line 18 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / ics-light-client-attack (interchain-security, cosmos)

unused import: `ConnectionEnd`

Check warning on line 18 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (gaia14, gaiad, cosmos, stake, forward-packet,clean-workers)

unused import: `ConnectionEnd`

Check warning on line 18 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / ics-light-client-attack-freeze (interchain-security, cosmos)

unused import: `ConnectionEnd`

Check warning on line 18 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / test-stable

unused import: `ConnectionEnd`

Check warning on line 18 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

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

unused import: `ConnectionEnd`

Check warning on line 18 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / light-client-attack (gaia14, gaiad, cosmos)

unused import: `ConnectionEnd`

Check warning on line 18 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

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

unused import: `ConnectionEnd`

Check warning on line 18 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / interchain-security-no-ica (.#gaia13 .#neutron, gaiad,neutrond, cosmos,neutron)

unused import: `ConnectionEnd`

Check warning on line 18 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / ordered-channel-test

unused import: `ConnectionEnd`

Check warning on line 18 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (ibc-go-v8-simapp, simd, cosmos, stake, ica,ics29-fee)

unused import: `ConnectionEnd`

Check warning on line 18 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / interchain-security-no-ica (.#gaia14 .#neutron, gaiad,neutrond, cosmos,neutron)

unused import: `ConnectionEnd`

Check warning on line 18 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

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

unused import: `ConnectionEnd`

Check warning on line 18 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (osmosis, osmosisd, osmo, stake, dynamic-gas-fee)

unused import: `ConnectionEnd`

Check warning on line 18 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (juno, junod, juno, stake, juno,forward-packet)

unused import: `ConnectionEnd`

Check warning on line 18 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (provenance, provenanced, pb, nhash, fee-grant,async-icq)

unused import: `ConnectionEnd`

Check warning on line 18 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (migaloo, migalood, migaloo, stake)

unused import: `ConnectionEnd`

Check warning on line 18 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / celestia-to-gaia (.#celestia .#gaia13, celestia-appd,gaiad, celestia,cosmos, utia,stake)

unused import: `ConnectionEnd`

Check warning on line 18 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / interchain-security-ica (.#gaia13 .#stride-consumer, gaiad,strided, cosmos,stride)

unused import: `ConnectionEnd`

Check warning on line 18 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / interchain-security-icq (.#gaia13 .#stride-consumer-no-admin, gaiad,strided, cosmos,stride)

unused import: `ConnectionEnd`

Check warning on line 18 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / celestia-to-gaia (.#celestia .#gaia14, celestia-appd,gaiad, celestia,cosmos, utia,stake)

unused import: `ConnectionEnd`

Check warning on line 18 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / interchain-security-ica (.#gaia14 .#stride-consumer, gaiad,strided, cosmos,stride)

unused import: `ConnectionEnd`

Check warning on line 18 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / interchain-security-icq (.#gaia14 .#stride-consumer-no-admin, gaiad,strided, cosmos,stride)

unused import: `ConnectionEnd`

Check warning on line 18 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / model-based-test (gaia6)

unused import: `ConnectionEnd`

Check failure on line 18 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / clippy-no-default-features

unused import: `ConnectionEnd`

error: unused import: `ConnectionEnd` --> crates/relayer/src/chain/penumbra/chain.rs:18:5 | 18 | ConnectionEnd, IdentifiedConnectionEnd, | ^^^^^^^^^^^^^

Check failure on line 18 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / clippy-no-default-features

unused import: `ConnectionEnd`

error: unused import: `ConnectionEnd` --> crates/relayer/src/chain/penumbra/chain.rs:18:5 | 18 | ConnectionEnd, IdentifiedConnectionEnd, | ^^^^^^^^^^^^^

Check failure on line 18 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / clippy-all-features

unused import: `ConnectionEnd`

error: unused import: `ConnectionEnd` --> crates/relayer/src/chain/penumbra/chain.rs:18:5 | 18 | ConnectionEnd, IdentifiedConnectionEnd, | ^^^^^^^^^^^^^

Check failure on line 18 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / clippy-all-features

unused import: `ConnectionEnd`

error: unused import: `ConnectionEnd` --> crates/relayer/src/chain/penumbra/chain.rs:18:5 | 18 | ConnectionEnd, IdentifiedConnectionEnd, | ^^^^^^^^^^^^^
};
use penumbra_proto::box_grpc_svc::{self, BoxGrpcService};
use penumbra_proto::{
custody::v1alpha1::{
Expand All @@ -16,8 +28,7 @@ use penumbra_proto::{
view_protocol_service_server::ViewProtocolServiceServer,
},
};
use crate::event::source::{EventSource, TxEventSourceCmd};
use penumbra_view::{ViewService, ViewClient};
use penumbra_view::{ViewClient, ViewService};
use tendermint::time::Time as TmTime;
use tendermint_light_client::verifier::types::LightBlock as TmLightBlock;
use tendermint_rpc::HttpClient;
Expand All @@ -41,7 +52,9 @@ pub struct PenumbraChain {

view_client: ViewProtocolServiceClient<BoxGrpcService>,
custody_client: CustodyProtocolServiceClient<BoxGrpcService>,

tendermint_rpc_client: HttpClient,
grpc_addr: Uri,

tx_monitor_cmd: Option<TxEventSourceCmd>,
}
Expand Down Expand Up @@ -96,9 +109,11 @@ impl ChainEndpoint for PenumbraChain {
return Err(Error::config(ConfigError::wrong_type()));
};

let rpc_client = HttpClient::new(config.rpc_addr.clone())
let rpc_client = HttpClient::new(config.rpc_addr.clone())
.map_err(|e| Error::rpc(config.rpc_addr.clone(), e))?;

let grpc_addr = Uri::from_str(&config.grpc_addr.to_string())
.map_err(|e| Error::invalid_uri(config.grpc_addr.to_string(), e))?;

let fvk = config.kms_config.spend_key.full_viewing_key();

Expand All @@ -120,16 +135,16 @@ impl ChainEndpoint for PenumbraChain {

tracing::info!("starting view service sync");

let sync_height = rt.block_on(async {
let mut stream = ViewClient::status_stream(&mut view_client).await?;
let mut sync_height = 0u64;
while let Some(status) = stream.next().await.transpose()? {
sync_height = status.full_sync_height;
}
Ok(sync_height)
})
.map_err(|e: anyhow::Error| Error::temp_penumbra_error(e.to_string()))?;

let sync_height = rt
.block_on(async {
let mut stream = ViewClient::status_stream(&mut view_client).await?;
let mut sync_height = 0u64;
while let Some(status) = stream.next().await.transpose()? {
sync_height = status.full_sync_height;
}
Ok(sync_height)
})
.map_err(|e: anyhow::Error| Error::temp_penumbra_error(e.to_string()))?;

tracing::info!(?sync_height, "view service sync complete");

Expand All @@ -140,6 +155,7 @@ impl ChainEndpoint for PenumbraChain {
custody_client,
tendermint_rpc_client: rpc_client,
tx_monitor_cmd: None,
grpc_addr,
})
}

Expand All @@ -148,14 +164,20 @@ impl ChainEndpoint for PenumbraChain {
}

fn health_check(&mut self) -> Result<HealthCheck, Error> {
let catching_up = self.rt.block_on(async {
let status = ViewClient::status(&mut self.view_client).await?;
Ok(status.catching_up)
})
.map_err(|e: anyhow::Error| Error::temp_penumbra_error(e.to_string()))?;
let catching_up = self
.rt
.block_on(async {
let status = ViewClient::status(&mut self.view_client).await?;
Ok(status.catching_up)
})
.map_err(|e: anyhow::Error| Error::temp_penumbra_error(e.to_string()))?;

if catching_up {
Ok(HealthCheck::Unhealthy(Box::new(Error::temp_penumbra_error(anyhow::anyhow!("view service is not synced").to_string()))))
Ok(HealthCheck::Unhealthy(Box::new(
Error::temp_penumbra_error(
anyhow::anyhow!("view service is not synced").to_string(),
),
)))
} else {
Ok(HealthCheck::Healthy)
}
Expand Down Expand Up @@ -249,7 +271,8 @@ impl ChainEndpoint for PenumbraChain {
&self,
) -> Result<ibc_relayer_types::core::ics23_commitment::commitment::CommitmentPrefix, Error>
{
todo!()
// This is hardcoded for now.
Ok(b"ibc-data".to_vec().try_into().unwrap())
}

fn query_application_status(&self) -> Result<crate::chain::endpoint::ChainStatus, Error> {
Expand All @@ -259,8 +282,52 @@ impl ChainEndpoint for PenumbraChain {
fn query_clients(
&self,
request: crate::chain::requests::QueryClientStatesRequest,
) -> Result<Vec<crate::client_state::IdentifiedAnyClientState>, Error> {
todo!()
) -> Result<Vec<IdentifiedAnyClientState>, Error> {
crate::time!(
"query_clients",
{
"src_chain": self.config().id().to_string(),
}
);
crate::telemetry!(query, self.id(), "query_clients");

let mut client = self
.rt
.block_on(
ibc_proto::ibc::core::client::v1::query_client::QueryClient::connect(
self.grpc_addr.clone(),
),
)
.map_err(Error::grpc_transport)?;

let request = tonic::Request::new(request.into());
let response = self
.rt
.block_on(client.client_states(request))
.map_err(|e| Error::grpc_status(e, "query_clients".to_owned()))?
.into_inner();

// Deserialize into domain type
let mut clients: Vec<IdentifiedAnyClientState> = response
.client_states
.into_iter()
.filter_map(|cs| {
IdentifiedAnyClientState::try_from(cs.clone())
.map_err(|e| {
tracing::warn!(
"failed to parse client state {}. Error: {}",
PrettyIdentifiedClientState(&cs),
e
)
})
.ok()
})
.collect();

// Sort by client identifier counter
clients.sort_by_cached_key(|c| client_id_suffix(&c.client_id).unwrap_or(0));

Ok(clients)
}

fn query_client_state(
Expand Down Expand Up @@ -326,19 +393,79 @@ impl ChainEndpoint for PenumbraChain {

fn query_connections(
&self,
request: crate::chain::requests::QueryConnectionsRequest,
) -> Result<
Vec<ibc_relayer_types::core::ics03_connection::connection::IdentifiedConnectionEnd>,
Error,
> {
todo!()
request: QueryConnectionsRequest,
) -> Result<Vec<IdentifiedConnectionEnd>, Error> {
crate::time!(
"query_connections",
{
"src_chain": self.config().id().to_string(),
}
);
crate::telemetry!(query, self.id(), "query_connections");

let mut client = self
.rt
.block_on(
ibc_proto::ibc::core::connection::v1::query_client::QueryClient::connect(
self.grpc_addr.clone(),
),
)
.map_err(Error::grpc_transport)?;

let request = tonic::Request::new(request.into());

let response = self
.rt
.block_on(client.connections(request))
.map_err(|e| Error::grpc_status(e, "query_connections".to_owned()))?
.into_inner();

let connections = response
.connections
.into_iter()
.filter_map(|co| {
IdentifiedConnectionEnd::try_from(co.clone())
.map_err(|e| {
tracing::warn!(
"connection with ID {} failed parsing. Error: {}",
PrettyIdentifiedConnection(&co),
e
)
})
.ok()
})
.collect();

Ok(connections)
}

fn query_client_connections(
&self,
request: crate::chain::requests::QueryClientConnectionsRequest,
) -> Result<Vec<ibc_relayer_types::core::ics24_host::identifier::ConnectionId>, Error> {
todo!()
crate::time!(
"query_client_connections",
{
"src_chain": self.config().id.to_string(),

Check failure on line 449 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / clippy-no-default-features

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

error[E0615]: attempted to take value of method `id` on type `config::ChainConfig` --> crates/relayer/src/chain/penumbra/chain.rs:449:44 | 449 | "src_chain": self.config().id.to_string(), | ^^ method, not a field | help: use parentheses to call the method | 449 | "src_chain": self.config().id().to_string(), | ++

Check failure on line 449 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / clippy-no-default-features

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

error[E0615]: attempted to take value of method `id` on type `config::ChainConfig` --> crates/relayer/src/chain/penumbra/chain.rs:449:44 | 449 | "src_chain": self.config().id.to_string(), | ^^ method, not a field | help: use parentheses to call the method | 449 | "src_chain": self.config().id().to_string(), | ++

Check failure on line 449 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / clippy-all-features

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

error[E0615]: attempted to take value of method `id` on type `config::ChainConfig` --> crates/relayer/src/chain/penumbra/chain.rs:449:44 | 449 | "src_chain": self.config().id.to_string(), | ^^ method, not a field | help: use parentheses to call the method | 449 | "src_chain": self.config().id().to_string(), | ++

Check failure on line 449 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / clippy-all-features

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

error[E0615]: attempted to take value of method `id` on type `config::ChainConfig` --> crates/relayer/src/chain/penumbra/chain.rs:449:44 | 449 | "src_chain": self.config().id.to_string(), | ^^ method, not a field | help: use parentheses to call the method | 449 | "src_chain": self.config().id().to_string(), | ++
}
);
crate::telemetry!(query, self.id(), "query_client_connections");

let connections = self.query_connections(QueryConnectionsRequest {
pagination: Default::default(),
})?;

let mut client_conns = vec![];
for connection in connections {
if connection
.connection_end
.client_id_matches(&request.client_id)
{
client_conns.push(connection.connection_id);
}
}

Ok(client_conns)
}

fn query_connection(
Expand Down Expand Up @@ -571,3 +698,14 @@ impl ChainEndpoint for PenumbraChain {
todo!()
}
}

/// Returns the suffix counter for a CosmosSDK client id.
/// Returns `None` if the client identifier is malformed
/// and the suffix could not be parsed.
fn client_id_suffix(client_id: &ClientId) -> Option<u64> {

Check failure on line 705 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / ics-double-sign (interchain-security, cosmos)

cannot find type `ClientId` in this scope

Check failure on line 705 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (gaia13, gaiad, cosmos, stake, forward-packet,clean-workers)

cannot find type `ClientId` in this scope

Check failure on line 705 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / ics-light-client-attack (interchain-security, cosmos)

cannot find type `ClientId` in this scope

Check failure on line 705 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (gaia14, gaiad, cosmos, stake, forward-packet,clean-workers)

cannot find type `ClientId` in this scope

Check failure on line 705 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / ics-light-client-attack-freeze (interchain-security, cosmos)

cannot find type `ClientId` in this scope

Check failure on line 705 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / test-stable

cannot find type `ClientId` in this scope

Check failure on line 705 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

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

cannot find type `ClientId` in this scope

Check failure on line 705 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / light-client-attack (gaia14, gaiad, cosmos)

cannot find type `ClientId` in this scope

Check failure on line 705 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

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

cannot find type `ClientId` in this scope

Check failure on line 705 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / interchain-security-no-ica (.#gaia13 .#neutron, gaiad,neutrond, cosmos,neutron)

cannot find type `ClientId` in this scope

Check failure on line 705 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / ordered-channel-test

cannot find type `ClientId` in this scope

Check failure on line 705 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (ibc-go-v8-simapp, simd, cosmos, stake, ica,ics29-fee)

cannot find type `ClientId` in this scope

Check failure on line 705 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / interchain-security-no-ica (.#gaia14 .#neutron, gaiad,neutrond, cosmos,neutron)

cannot find type `ClientId` in this scope

Check failure on line 705 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

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

cannot find type `ClientId` in this scope

Check failure on line 705 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (osmosis, osmosisd, osmo, stake, dynamic-gas-fee)

cannot find type `ClientId` in this scope

Check failure on line 705 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (juno, junod, juno, stake, juno,forward-packet)

cannot find type `ClientId` in this scope

Check failure on line 705 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (provenance, provenanced, pb, nhash, fee-grant,async-icq)

cannot find type `ClientId` in this scope

Check failure on line 705 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (migaloo, migalood, migaloo, stake)

cannot find type `ClientId` in this scope

Check failure on line 705 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / celestia-to-gaia (.#celestia .#gaia13, celestia-appd,gaiad, celestia,cosmos, utia,stake)

cannot find type `ClientId` in this scope

Check failure on line 705 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / interchain-security-ica (.#gaia13 .#stride-consumer, gaiad,strided, cosmos,stride)

cannot find type `ClientId` in this scope

Check failure on line 705 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / interchain-security-icq (.#gaia13 .#stride-consumer-no-admin, gaiad,strided, cosmos,stride)

cannot find type `ClientId` in this scope

Check failure on line 705 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / celestia-to-gaia (.#celestia .#gaia14, celestia-appd,gaiad, celestia,cosmos, utia,stake)

cannot find type `ClientId` in this scope

Check failure on line 705 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / interchain-security-ica (.#gaia14 .#stride-consumer, gaiad,strided, cosmos,stride)

cannot find type `ClientId` in this scope

Check failure on line 705 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / interchain-security-icq (.#gaia14 .#stride-consumer-no-admin, gaiad,strided, cosmos,stride)

cannot find type `ClientId` in this scope

Check failure on line 705 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / model-based-test (gaia6)

cannot find type `ClientId` in this scope

Check failure on line 705 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / clippy-no-default-features

cannot find type `ClientId` in this scope

error[E0412]: cannot find type `ClientId` in this scope --> crates/relayer/src/chain/penumbra/chain.rs:705:33 | 705 | fn client_id_suffix(client_id: &ClientId) -> Option<u64> { | ^^^^^^^^ not found in this scope | help: consider importing this struct | 1 + use ibc_relayer_types::core::ics24_host::identifier::ClientId; |

Check failure on line 705 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / clippy-no-default-features

cannot find type `ClientId` in this scope

error[E0412]: cannot find type `ClientId` in this scope --> crates/relayer/src/chain/penumbra/chain.rs:705:33 | 705 | fn client_id_suffix(client_id: &ClientId) -> Option<u64> { | ^^^^^^^^ not found in this scope | help: consider importing this struct | 1 + use ibc_relayer_types::core::ics24_host::identifier::ClientId; |

Check failure on line 705 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / clippy-all-features

cannot find type `ClientId` in this scope

error[E0412]: cannot find type `ClientId` in this scope --> crates/relayer/src/chain/penumbra/chain.rs:705:33 | 705 | fn client_id_suffix(client_id: &ClientId) -> Option<u64> { | ^^^^^^^^ not found in this scope | help: consider importing this struct | 1 + use ibc_relayer_types::core::ics24_host::identifier::ClientId; |

Check failure on line 705 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / clippy-all-features

cannot find type `ClientId` in this scope

error[E0412]: cannot find type `ClientId` in this scope --> crates/relayer/src/chain/penumbra/chain.rs:705:33 | 705 | fn client_id_suffix(client_id: &ClientId) -> Option<u64> { | ^^^^^^^^ not found in this scope | help: consider importing this struct | 1 + use ibc_relayer_types::core::ics24_host::identifier::ClientId; |
client_id
.as_str()
.split('-')
.last()
.and_then(|e| e.parse::<u64>().ok())
}
1 change: 0 additions & 1 deletion crates/relayer/src/chain/penumbra/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ pub struct PenumbraConfig {
pub client_refresh_rate: RefreshRate,

// These last few need to be last otherwise we run into `ValueAfterTable` error when serializing to TOML

/// Key configuration
///
/// This is used instead of the Hermes keyring, which doesn't yet handle
Expand Down

0 comments on commit ff9e6d3

Please sign in to comment.