diff --git a/rust/chains/hyperlane-cosmos/src/interchain_gas.rs b/rust/chains/hyperlane-cosmos/src/interchain_gas.rs index c6087bb0bd..60e0e1bb1f 100644 --- a/rust/chains/hyperlane-cosmos/src/interchain_gas.rs +++ b/rust/chains/hyperlane-cosmos/src/interchain_gas.rs @@ -212,7 +212,11 @@ impl Indexer for CosmosInterchainGasPaymasterIndexer { tokio::spawn(async move { let logs = self_clone .indexer - .get_logs_in_block(block_number, Self::interchain_gas_payment_parser) + .get_logs_in_block( + block_number, + Self::interchain_gas_payment_parser, + "InterchainGasPaymentCursor", + ) .await; (logs, block_number) }) diff --git a/rust/chains/hyperlane-cosmos/src/mailbox.rs b/rust/chains/hyperlane-cosmos/src/mailbox.rs index 6476da13e8..fcda4e78af 100644 --- a/rust/chains/hyperlane-cosmos/src/mailbox.rs +++ b/rust/chains/hyperlane-cosmos/src/mailbox.rs @@ -361,7 +361,11 @@ impl Indexer for CosmosMailboxIndexer { tokio::spawn(async move { let logs = self_clone .indexer - .get_logs_in_block(block_number, Self::hyperlane_message_parser) + .get_logs_in_block( + block_number, + Self::hyperlane_message_parser, + "HyperlaneMessageCursor", + ) .await; (logs, block_number) }) diff --git a/rust/chains/hyperlane-cosmos/src/merkle_tree_hook.rs b/rust/chains/hyperlane-cosmos/src/merkle_tree_hook.rs index d55ed45d79..9cab0e9f90 100644 --- a/rust/chains/hyperlane-cosmos/src/merkle_tree_hook.rs +++ b/rust/chains/hyperlane-cosmos/src/merkle_tree_hook.rs @@ -293,7 +293,11 @@ impl Indexer for CosmosMerkleTreeHookIndexer { tokio::spawn(async move { let logs = self_clone .indexer - .get_logs_in_block(block_number, Self::merkle_tree_insertion_parser) + .get_logs_in_block( + block_number, + Self::merkle_tree_insertion_parser, + "MerkleTreeInsertionCursor", + ) .await; (logs, block_number) }) diff --git a/rust/chains/hyperlane-cosmos/src/providers/rpc.rs b/rust/chains/hyperlane-cosmos/src/providers/rpc.rs index 9a1efd385c..2a64c257c3 100644 --- a/rust/chains/hyperlane-cosmos/src/providers/rpc.rs +++ b/rust/chains/hyperlane-cosmos/src/providers/rpc.rs @@ -3,6 +3,7 @@ use cosmrs::rpc::client::Client; use hyperlane_core::rpc_clients::call_with_retry; use hyperlane_core::{ChainCommunicationError, ChainResult, ContractLocator, LogMeta, H256, U256}; use sha256::digest; +use std::fmt::Debug; use tendermint::abci::{Event, EventAttribute}; use tendermint::hash::Algorithm; use tendermint::Hash; @@ -25,9 +26,10 @@ pub trait WasmIndexer: Send + Sync { &self, block_number: u32, parser: for<'a> fn(&'a Vec) -> ChainResult>, + cursor_label: &'static str, ) -> ChainResult> where - T: Send + Sync + PartialEq + 'static; + T: Send + Sync + PartialEq + Debug + 'static; } #[derive(Debug, Eq, PartialEq)] @@ -122,9 +124,10 @@ impl CosmosWasmIndexer { block: BlockResponse, block_results: BlockResultsResponse, parser: for<'a> fn(&'a Vec) -> ChainResult>, + cursor_label: &'static str, ) -> Vec<(T, LogMeta)> where - T: PartialEq + 'static, + T: PartialEq + Debug + 'static, { let Some(tx_results) = block_results.txs_results else { return vec![]; @@ -231,17 +234,19 @@ impl WasmIndexer for CosmosWasmIndexer { &self, block_number: u32, parser: for<'a> fn(&'a Vec) -> ChainResult>, + cursor_label: &'static str, ) -> ChainResult> where - T: Send + Sync + PartialEq + 'static, + T: Send + Sync + PartialEq + Debug + 'static, { let client = self.provider.rpc().clone(); + debug!(?block_number, ?cursor_label, "Getting logs in block"); let (block, block_results) = tokio::join!( call_with_retry(|| { Box::pin(Self::get_block(client.clone(), block_number)) }), call_with_retry(|| { Box::pin(Self::get_block_results(client.clone(), block_number)) }), ); - Ok(self.handle_txs(block?, block_results?, parser)) + Ok(self.handle_txs(block?, block_results?, parser, cursor_label)) } } diff --git a/rust/config/mainnet3_config.json b/rust/config/mainnet3_config.json index dc078a1ff8..f7683cd30c 100644 --- a/rust/config/mainnet3_config.json +++ b/rust/config/mainnet3_config.json @@ -494,7 +494,7 @@ "contractAddressBytes": 32, "index": { "from": 4000000, - "chunk": 1 + "chunk": 50 }, "blocks": { "reorgPeriod": 1 @@ -533,7 +533,7 @@ "contractAddressBytes": 20, "index": { "from": 58419500, - "chunk": 1 + "chunk": 50 }, "blocks": { "reorgPeriod": 10