@@ -18,7 +18,7 @@ use itertools::Itertools;
1818use jsonrpsee:: types:: { error:: INTERNAL_ERROR_CODE , ErrorObject } ;
1919use time:: OffsetDateTime ;
2020use tokio:: task:: JoinSet ;
21- use tracing:: { debug, info, info_span, trace, Instrument } ;
21+ use tracing:: { debug, info, info_span, trace, warn , Instrument } ;
2222
2323use crate :: {
2424 indexer:: {
@@ -41,6 +41,7 @@ pub struct TmFetcherClient {
4141 pub chain_id : ChainId ,
4242 pub provider : Provider ,
4343 pub tx_search_max_page_size : u8 ,
44+ pub testnet : bool ,
4445}
4546
4647impl Display for TmFetcherClient {
@@ -179,13 +180,25 @@ impl TmFetcherClient {
179180
180181 match txs_event_count == block_tx_event_count {
181182 true => Ok ( ( ) ) ,
182- false => Err ( IndexerError :: ProviderError ( eyre ! ( "provider: {:?} at height {} block_results tx events: {} <> transactions events: {}" ,
183+ false => match self . testnet {
184+ true => {
185+ // testnet rpcs often have inconsistencies. accept them
186+ warn ! (
187+ "provider: {:?} at height {} block_results tx events: {} <> transactions events: {}" ,
188+ provider_id,
189+ block_results. height,
190+ block_tx_event_count,
191+ txs_event_count
192+ ) ;
193+ Ok ( ( ) )
194+ } ,
195+ false => Err ( IndexerError :: ProviderError ( eyre ! ( "provider: {:?} at height {} block_results tx events: {} <> transactions events: {}" ,
183196 provider_id,
184197 block_results. height,
185198 block_tx_event_count,
186199 txs_event_count
187200 )
188- ) ) ,
201+ ) ) } ,
189202 }
190203 }
191204
@@ -553,6 +566,7 @@ impl FetcherClient for TmFetcherClient {
553566 chain_id,
554567 provider,
555568 tx_search_max_page_size : context. tx_search_max_page_size ,
569+ testnet : context. testnet ,
556570 } )
557571 }
558572 . instrument ( indexing_span)
0 commit comments