11// Copyright 2023-, Edge & Node, GraphOps, and Semiotic Labs.
22// SPDX-License-Identifier: Apache-2.0
33
4+ #[ allow( unused_imports) ] // str::FromStr used in production code paths
45use std:: {
56 collections:: { HashMap , HashSet } ,
67 str:: FromStr ,
78 sync:: LazyLock ,
89 time:: Duration ,
910} ;
1011
12+ #[ allow( unused_imports) ] // Used in different conditional compilation modes
1113use anyhow:: Context ;
14+ #[ allow( unused_imports) ] // Used in different conditional compilation modes
1215use bigdecimal:: { num_bigint:: ToBigInt , ToPrimitive } ;
13- use futures:: { stream, StreamExt } ;
16+ #[ allow( unused_imports) ] // Used in different conditional compilation modes
17+ use futures:: stream;
18+ #[ allow( unused_imports) ] // Used for stream operations
19+ use futures:: StreamExt ;
20+ #[ allow( unused_imports) ] // Used in production config structs
1421use indexer_monitor:: { EscrowAccounts , SubgraphClient } ;
22+ #[ allow( unused_imports) ] // Used in different conditional compilation modes
1523use indexer_query:: {
1624 closed_allocations:: { self , ClosedAllocations } ,
17- unfinalized_transactions, UnfinalizedTransactions ,
25+ unfinalized_transactions:: { self } ,
26+ UnfinalizedTransactions ,
1827} ;
28+ #[ allow( unused_imports) ] // Used in different conditional compilation modes
1929use indexer_watcher:: watch_pipe;
2030use prometheus:: { register_gauge_vec, register_int_gauge_vec, GaugeVec , IntGaugeVec } ;
2131#[ cfg( any( test, feature = "test" ) ) ]
2232use ractor:: { Actor , ActorProcessingErr , ActorRef , MessagingErr , SupervisionEvent } ;
33+ #[ allow( unused_imports) ] // Used in production config structs
2334use reqwest:: Url ;
35+ #[ allow( unused_imports) ] // Used in production config structs
2436use sqlx:: PgPool ;
37+ #[ allow( unused_imports) ] // Used in different conditional compilation modes
2538use tap_aggregator:: grpc:: {
2639 v1:: tap_aggregator_client:: TapAggregatorClient as AggregatorV1 ,
2740 v2:: tap_aggregator_client:: TapAggregatorClient as AggregatorV2 ,
2841} ;
42+ #[ allow( unused_imports) ] // hex::ToHexExt and sol_types::Eip712Domain used in production
2943use thegraph_core:: {
3044 alloy:: {
3145 hex:: ToHexExt ,
@@ -34,17 +48,21 @@ use thegraph_core::{
3448 } ,
3549 AllocationId as AllocationIdCore , CollectionId ,
3650} ;
51+ #[ allow( unused_imports) ] // Used in production config structs
3752use tokio:: { sync:: watch:: Receiver , task:: JoinHandle } ;
53+ #[ allow( unused_imports) ] // Used in different conditional compilation modes
3854use tonic:: transport:: { Channel , Endpoint } ;
55+ #[ allow( unused_imports) ] // Used in different conditional compilation modes
3956use tracing:: Level ;
4057
41- use super :: {
42- sender_accounts_manager:: { AllocationId , SenderType } ,
43- sender_allocation:: { AllocationConfig , SenderAllocationMessage } ,
44- } ;
58+ #[ allow( unused_imports) ] // SenderType used for Legacy/Horizon differentiation in production
59+ use super :: sender_accounts_manager:: { AllocationId , SenderType } ;
4560
4661#[ cfg( any( test, feature = "test" ) ) ]
47- use super :: sender_allocation:: { SenderAllocation , SenderAllocationArgs } ;
62+ use super :: sender_allocation:: {
63+ AllocationConfig , SenderAllocation , SenderAllocationArgs , SenderAllocationMessage ,
64+ } ;
65+ #[ allow( unused_imports) ] // Production-only imports for rate limiting, backoff, network types, tracking
4866use crate :: {
4967 adaptative_concurrency:: AdaptiveLimiter ,
5068 agent:: unaggregated_receipts:: UnaggregatedReceipts ,
@@ -53,9 +71,11 @@ use crate::{
5371 tracker:: { SenderFeeTracker , SimpleFeeTracker } ,
5472} ;
5573
74+ #[ allow( dead_code) ] // Prometheus metrics used in production, not in test builds
5675static SENDER_DENIED : LazyLock < IntGaugeVec > = LazyLock :: new ( || {
5776 register_int_gauge_vec ! ( "tap_sender_denied" , "Sender is denied" , & [ "sender" ] ) . unwrap ( )
5877} ) ;
78+ #[ allow( dead_code) ] // Used in production code
5979static ESCROW_BALANCE : LazyLock < GaugeVec > = LazyLock :: new ( || {
6080 register_gauge_vec ! (
6181 "tap_sender_escrow_balance_grt_total" ,
@@ -64,6 +84,7 @@ static ESCROW_BALANCE: LazyLock<GaugeVec> = LazyLock::new(|| {
6484 )
6585 . unwrap ( )
6686} ) ;
87+ #[ allow( dead_code) ] // Used in production code
6788static UNAGGREGATED_FEES : LazyLock < GaugeVec > = LazyLock :: new ( || {
6889 register_gauge_vec ! (
6990 "tap_unaggregated_fees_grt_total" ,
@@ -72,6 +93,7 @@ static UNAGGREGATED_FEES: LazyLock<GaugeVec> = LazyLock::new(|| {
7293 )
7394 . unwrap ( )
7495} ) ;
96+ #[ allow( dead_code) ] // Used in production code
7597static SENDER_FEE_TRACKER : LazyLock < GaugeVec > = LazyLock :: new ( || {
7698 register_gauge_vec ! (
7799 "tap_sender_fee_tracker_grt_total" ,
@@ -80,6 +102,7 @@ static SENDER_FEE_TRACKER: LazyLock<GaugeVec> = LazyLock::new(|| {
80102 )
81103 . unwrap ( )
82104} ) ;
105+ #[ allow( dead_code) ] // Used in production code
83106static INVALID_RECEIPT_FEES : LazyLock < GaugeVec > = LazyLock :: new ( || {
84107 register_gauge_vec ! (
85108 "tap_invalid_receipt_fees_grt_total" ,
@@ -88,6 +111,7 @@ static INVALID_RECEIPT_FEES: LazyLock<GaugeVec> = LazyLock::new(|| {
88111 )
89112 . unwrap ( )
90113} ) ;
114+ #[ allow( dead_code) ] // Used in production code
91115static PENDING_RAV : LazyLock < GaugeVec > = LazyLock :: new ( || {
92116 register_gauge_vec ! (
93117 "tap_pending_rav_grt_total" ,
@@ -96,6 +120,7 @@ static PENDING_RAV: LazyLock<GaugeVec> = LazyLock::new(|| {
96120 )
97121 . unwrap ( )
98122} ) ;
123+ #[ allow( dead_code) ] // Used in production code
99124static MAX_FEE_PER_SENDER : LazyLock < GaugeVec > = LazyLock :: new ( || {
100125 register_gauge_vec ! (
101126 "tap_max_fee_per_sender_grt_total" ,
@@ -104,6 +129,7 @@ static MAX_FEE_PER_SENDER: LazyLock<GaugeVec> = LazyLock::new(|| {
104129 )
105130 . unwrap ( )
106131} ) ;
132+ #[ allow( dead_code) ] // Used in production code
107133static RAV_REQUEST_TRIGGER_VALUE : LazyLock < GaugeVec > = LazyLock :: new ( || {
108134 register_gauge_vec ! (
109135 "tap_rav_request_trigger_value" ,
@@ -113,6 +139,7 @@ static RAV_REQUEST_TRIGGER_VALUE: LazyLock<GaugeVec> = LazyLock::new(|| {
113139 . unwrap ( )
114140} ) ;
115141
142+ #[ allow( dead_code) ] // Used by AdaptiveLimiter in production code paths
116143const INITIAL_RAV_REQUEST_CONCURRENT : usize = 1 ;
117144
118145type RavMap = HashMap < Address , u128 > ;
0 commit comments