44use std:: {
55 collections:: { HashMap , HashSet } ,
66 str:: FromStr ,
7- sync:: Arc ,
87 time:: Duration ,
98} ;
109
1110use anyhow:: Context ;
1211use bigdecimal:: { num_bigint:: ToBigInt , ToPrimitive } ;
1312use futures:: { stream, StreamExt } ;
14- use indexer_dips:: {
15- collect_indexing_agreements, database:: PsqlAgreementStore ,
16- proto:: gateway:: graphprotocol:: gateway:: dips:: dipper_service_client:: DipperServiceClient ,
17- store:: AgreementStore , DipsError ,
18- } ;
1913use indexer_monitor:: { EscrowAccounts , SubgraphClient } ;
2014use indexer_query:: {
2115 closed_allocations:: { self , ClosedAllocations } ,
@@ -53,6 +47,7 @@ use crate::{
5347 tap:: context:: { Horizon , Legacy } ,
5448 tracker:: { SenderFeeTracker , SimpleFeeTracker } ,
5549} ;
50+
5651lazy_static ! {
5752 static ref SENDER_DENIED : IntGaugeVec =
5853 register_int_gauge_vec!( "tap_sender_denied" , "Sender is denied" , & [ "sender" ] ) . unwrap( ) ;
@@ -324,10 +319,6 @@ pub struct State {
324319
325320 // Config forwarded to [SenderAllocation]
326321 config : & ' static SenderAccountConfig ,
327- /// Indexing agreement store
328- agreement_store : Arc < dyn AgreementStore > ,
329- /// Client for the dipper grpc server
330- dipper_client : Option < DipperServiceClient < Channel > > ,
331322}
332323
333324/// Configuration derived from config.toml
@@ -352,8 +343,6 @@ pub struct SenderAccountConfig {
352343 ///
353344 /// This is reached if the database is too slow
354345 pub tap_sender_timeout : Duration ,
355- /// URL of the dipper grpc server
356- pub dipper_grpc_url : Option < String > ,
357346}
358347
359348impl SenderAccountConfig {
@@ -368,10 +357,6 @@ impl SenderAccountConfig {
368357 trigger_value : config. tap . get_trigger_value ( ) ,
369358 rav_request_timeout : config. tap . rav_request . request_timeout_secs ,
370359 tap_sender_timeout : config. tap . sender_timeout_secs ,
371- dipper_grpc_url : config
372- . dips
373- . as_ref ( )
374- . map ( |dips_config| dips_config. dipper_grpc_url . clone ( ) ) ,
375360 }
376361 }
377362}
@@ -836,19 +821,6 @@ impl Actor for SenderAccount {
836821 // wiremock_grpc used for tests doesn't support Zstd compression
837822 #[ cfg( not( test) ) ]
838823 let aggregator_v2 = aggregator_v2. send_compressed ( tonic:: codec:: CompressionEncoding :: Zstd ) ;
839-
840- let agreement_store = Arc :: new ( PsqlAgreementStore {
841- pool : pgpool. clone ( ) ,
842- } ) ;
843-
844- let dipper_client = if let Some ( ref url) = config. dipper_grpc_url {
845- let endpoint = tonic:: transport:: Endpoint :: from_str ( url)
846- . map_err ( DipsError :: ConnectionError ) ?
847- . connect_lazy ( ) ;
848- Some ( DipperServiceClient :: new ( endpoint) )
849- } else {
850- None
851- } ;
852824 let state = State {
853825 prefix,
854826 sender_fee_tracker : SenderFeeTracker :: new ( config. rav_request_buffer ) ,
@@ -870,8 +842,6 @@ impl Actor for SenderAccount {
870842 aggregator_v2,
871843 backoff_info : BackoffInfo :: default ( ) ,
872844 config,
873- agreement_store,
874- dipper_client,
875845 } ;
876846
877847 stream:: iter ( allocation_ids)
@@ -1083,24 +1053,6 @@ impl Actor for SenderAccount {
10831053 if let Some ( sender_handle) = ActorRef :: < SenderAllocationMessage > :: where_is (
10841054 state. format_sender_allocation ( & allocation_id. address ( ) ) ,
10851055 ) {
1086- if let Some ( ref dipper_client) = state. dipper_client {
1087- tracing:: trace!( %allocation_id, "SenderAccount checking for indexing agreements to collect" ) ;
1088- match collect_indexing_agreements (
1089- state. agreement_store . clone ( ) ,
1090- allocation_id. address ( ) ,
1091- dipper_client,
1092- )
1093- . await
1094- {
1095- Ok ( _) => {
1096- tracing:: info!( %allocation_id, "Indexing agreements collected" )
1097- }
1098- Err ( e) => {
1099- tracing:: warn!( %allocation_id, error = %e, "Error collecting indexing agreements" )
1100- }
1101- }
1102- }
1103-
11041056 tracing:: trace!( %allocation_id, "SenderAccount shutting down SenderAllocation" ) ;
11051057 // we can not send a rav request to this allocation
11061058 // because it's gonna trigger the last rav
0 commit comments