diff --git a/crates/relayer/src/chain/cosmos.rs b/crates/relayer/src/chain/cosmos.rs index 570c053213..81ffa8a375 100644 --- a/crates/relayer/src/chain/cosmos.rs +++ b/crates/relayer/src/chain/cosmos.rs @@ -577,11 +577,6 @@ impl CosmosSdkChain { height_query: QueryHeight, prove: bool, ) -> Result { - crate::time!("query", - { - "src_chain": self.config().id.to_string(), - }); - let data = data.into(); if !data.is_provable() & prove { return Err(Error::private_store()); @@ -1197,6 +1192,12 @@ impl ChainEndpoint for CosmosSdkChain { } fn query_balance(&self, key_name: Option<&str>, denom: Option<&str>) -> Result { + crate::time!( + "query_balance", + { + "src_chain": self.config().id.to_string(), + } + ); // If a key_name is given, extract the account hash. // Else retrieve the account from the configuration file. let key = match key_name { @@ -1212,6 +1213,12 @@ impl ChainEndpoint for CosmosSdkChain { } fn query_all_balances(&self, key_name: Option<&str>) -> Result, Error> { + crate::time!( + "query_all_balances", + { + "src_chain": self.config().id.to_string(), + } + ); // If a key_name is given, extract the account hash. // Else retrieve the account from the configuration file. let key = match key_name { @@ -1893,6 +1900,12 @@ impl ChainEndpoint for CosmosSdkChain { request: QueryPacketCommitmentRequest, include_proof: IncludeProof, ) -> Result<(Vec, Option), Error> { + crate::time!( + "query_packet_commitment", + { + "src_chain": self.config().id.to_string(), + } + ); let res = self.query( CommitmentsPath { port_id: request.port_id, @@ -2050,6 +2063,12 @@ impl ChainEndpoint for CosmosSdkChain { request: QueryPacketReceiptRequest, include_proof: IncludeProof, ) -> Result<(Vec, Option), Error> { + crate::time!( + "query_packet_receipt", + { + "src_chain": self.config().id.to_string(), + } + ); let res = self.query( ReceiptsPath { port_id: request.port_id, @@ -2115,6 +2134,12 @@ impl ChainEndpoint for CosmosSdkChain { request: QueryPacketAcknowledgementRequest, include_proof: IncludeProof, ) -> Result<(Vec, Option), Error> { + crate::time!( + "query_packet_acknowledgement", + { + "src_chain": self.config().id.to_string(), + } + ); let res = self.query( AcksPath { port_id: request.port_id, @@ -2347,10 +2372,6 @@ impl ChainEndpoint for CosmosSdkChain { /// 1. Client Update request - returns a vector with at most one update client event /// 2. Transaction event request - returns all IBC events resulted from a Tx execution fn query_txs(&self, request: QueryTxRequest) -> Result, Error> { - crate::time!("query_txs", - { - "src_chain": self.config().id.to_string(), - }); crate::telemetry!(query, self.id(), "query_txs"); self.block_on(query_txs( @@ -2446,6 +2467,12 @@ impl ChainEndpoint for CosmosSdkChain { &self, request: QueryHostConsensusStateRequest, ) -> Result { + crate::time!( + "query_host_consensus_state", + { + "src_chain": self.config().id.to_string(), + } + ); let height = match request.height { QueryHeight::Latest => TmHeight::from(0u32), QueryHeight::Specific(ibc_height) => TmHeight::from(ibc_height), @@ -2476,6 +2503,12 @@ impl ChainEndpoint for CosmosSdkChain { height: ICSHeight, settings: ClientSettings, ) -> Result { + crate::time!( + "build_client_state", + { + "src_chain": self.config().id.to_string(), + } + ); let ClientSettings::Tendermint(settings) = settings; let unbonding_period = self.unbonding_period()?; let trusting_period = settings diff --git a/crates/relayer/src/chain/cosmos/query/tx.rs b/crates/relayer/src/chain/cosmos/query/tx.rs index e6897c02a4..317ea9e6d0 100644 --- a/crates/relayer/src/chain/cosmos/query/tx.rs +++ b/crates/relayer/src/chain/cosmos/query/tx.rs @@ -75,6 +75,12 @@ pub async fn query_txs( } QueryTxRequest::Transaction(tx) => { + crate::time!( + "query_txs: transaction hash", + { + "src_chain": chain_id, + } + ); let mut response = rpc_client .tx_search( tx_hash_query(&tx), diff --git a/crates/relayer/src/foreign_client.rs b/crates/relayer/src/foreign_client.rs index 8fded33524..c05a5739f4 100644 --- a/crates/relayer/src/foreign_client.rs +++ b/crates/relayer/src/foreign_client.rs @@ -1213,6 +1213,13 @@ impl ForeignClient, ) -> Result, ForeignClientError> { + crate::time!( + "build_update_client_with_trusted", + { + "src_chain": self.src_chain().id(), + "dst_chain": self.dst_chain().id(), + } + ); // Get the latest client state on destination. let (client_state, _) = self.validated_client_state()?; diff --git a/crates/relayer/src/light_client/tendermint.rs b/crates/relayer/src/light_client/tendermint.rs index 32d31dfcdb..808c616235 100644 --- a/crates/relayer/src/light_client/tendermint.rs +++ b/crates/relayer/src/light_client/tendermint.rs @@ -55,6 +55,12 @@ impl super::LightClient for LightClient { client_state: &AnyClientState, now: Time, ) -> Result, Error> { + crate::time!( + "light_client.tendermint.header_and_minimal_set", + { + "src_chain": self.chain_id.to_string(), + } + ); let Verified { target, supporting } = self.verify(trusted_height, target_height, client_state, now)?; @@ -81,6 +87,12 @@ impl super::LightClient for LightClient { client_state: &AnyClientState, now: Time, ) -> Result, Error> { + crate::time!( + "light_client.tendermint.verify", + { + "src_chain": self.chain_id.to_string(), + } + ); trace!(%trusted_height, %target_height, "light client verification"); if !self.enable_verification {