1
1
// Copyright 2023-, Edge & Node, GraphOps, and Semiotic Labs.
2
2
// SPDX-License-Identifier: Apache-2.0
3
3
4
+ #[ allow( unused_imports) ] // str::FromStr used in production code paths
4
5
use std:: {
5
6
collections:: { HashMap , HashSet } ,
6
7
str:: FromStr ,
7
8
sync:: LazyLock ,
8
9
time:: Duration ,
9
10
} ;
10
11
12
+ #[ allow( unused_imports) ] // Used in different conditional compilation modes
11
13
use anyhow:: Context ;
14
+ #[ allow( unused_imports) ] // Used in different conditional compilation modes
12
15
use 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
14
21
use indexer_monitor:: { EscrowAccounts , SubgraphClient } ;
22
+ #[ allow( unused_imports) ] // Used in different conditional compilation modes
15
23
use indexer_query:: {
16
24
closed_allocations:: { self , ClosedAllocations } ,
17
- unfinalized_transactions, UnfinalizedTransactions ,
25
+ unfinalized_transactions:: { self } ,
26
+ UnfinalizedTransactions ,
18
27
} ;
28
+ #[ allow( unused_imports) ] // Used in different conditional compilation modes
19
29
use indexer_watcher:: watch_pipe;
20
30
use prometheus:: { register_gauge_vec, register_int_gauge_vec, GaugeVec , IntGaugeVec } ;
21
31
#[ cfg( any( test, feature = "test" ) ) ]
22
32
use ractor:: { Actor , ActorProcessingErr , ActorRef , MessagingErr , SupervisionEvent } ;
33
+ #[ allow( unused_imports) ] // Used in production config structs
23
34
use reqwest:: Url ;
35
+ #[ allow( unused_imports) ] // Used in production config structs
24
36
use sqlx:: PgPool ;
37
+ #[ allow( unused_imports) ] // Used in different conditional compilation modes
25
38
use tap_aggregator:: grpc:: {
26
39
v1:: tap_aggregator_client:: TapAggregatorClient as AggregatorV1 ,
27
40
v2:: tap_aggregator_client:: TapAggregatorClient as AggregatorV2 ,
28
41
} ;
42
+ #[ allow( unused_imports) ] // hex::ToHexExt and sol_types::Eip712Domain used in production
29
43
use thegraph_core:: {
30
44
alloy:: {
31
45
hex:: ToHexExt ,
@@ -34,17 +48,21 @@ use thegraph_core::{
34
48
} ,
35
49
AllocationId as AllocationIdCore , CollectionId ,
36
50
} ;
51
+ #[ allow( unused_imports) ] // Used in production config structs
37
52
use tokio:: { sync:: watch:: Receiver , task:: JoinHandle } ;
53
+ #[ allow( unused_imports) ] // Used in different conditional compilation modes
38
54
use tonic:: transport:: { Channel , Endpoint } ;
55
+ #[ allow( unused_imports) ] // Used in different conditional compilation modes
39
56
use tracing:: Level ;
40
57
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 } ;
45
60
46
61
#[ 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
48
66
use crate :: {
49
67
adaptative_concurrency:: AdaptiveLimiter ,
50
68
agent:: unaggregated_receipts:: UnaggregatedReceipts ,
@@ -53,9 +71,11 @@ use crate::{
53
71
tracker:: { SenderFeeTracker , SimpleFeeTracker } ,
54
72
} ;
55
73
74
+ #[ allow( dead_code) ] // Prometheus metrics used in production, not in test builds
56
75
static SENDER_DENIED : LazyLock < IntGaugeVec > = LazyLock :: new ( || {
57
76
register_int_gauge_vec ! ( "tap_sender_denied" , "Sender is denied" , & [ "sender" ] ) . unwrap ( )
58
77
} ) ;
78
+ #[ allow( dead_code) ] // Used in production code
59
79
static ESCROW_BALANCE : LazyLock < GaugeVec > = LazyLock :: new ( || {
60
80
register_gauge_vec ! (
61
81
"tap_sender_escrow_balance_grt_total" ,
@@ -64,6 +84,7 @@ static ESCROW_BALANCE: LazyLock<GaugeVec> = LazyLock::new(|| {
64
84
)
65
85
. unwrap ( )
66
86
} ) ;
87
+ #[ allow( dead_code) ] // Used in production code
67
88
static UNAGGREGATED_FEES : LazyLock < GaugeVec > = LazyLock :: new ( || {
68
89
register_gauge_vec ! (
69
90
"tap_unaggregated_fees_grt_total" ,
@@ -72,6 +93,7 @@ static UNAGGREGATED_FEES: LazyLock<GaugeVec> = LazyLock::new(|| {
72
93
)
73
94
. unwrap ( )
74
95
} ) ;
96
+ #[ allow( dead_code) ] // Used in production code
75
97
static SENDER_FEE_TRACKER : LazyLock < GaugeVec > = LazyLock :: new ( || {
76
98
register_gauge_vec ! (
77
99
"tap_sender_fee_tracker_grt_total" ,
@@ -80,6 +102,7 @@ static SENDER_FEE_TRACKER: LazyLock<GaugeVec> = LazyLock::new(|| {
80
102
)
81
103
. unwrap ( )
82
104
} ) ;
105
+ #[ allow( dead_code) ] // Used in production code
83
106
static INVALID_RECEIPT_FEES : LazyLock < GaugeVec > = LazyLock :: new ( || {
84
107
register_gauge_vec ! (
85
108
"tap_invalid_receipt_fees_grt_total" ,
@@ -88,6 +111,7 @@ static INVALID_RECEIPT_FEES: LazyLock<GaugeVec> = LazyLock::new(|| {
88
111
)
89
112
. unwrap ( )
90
113
} ) ;
114
+ #[ allow( dead_code) ] // Used in production code
91
115
static PENDING_RAV : LazyLock < GaugeVec > = LazyLock :: new ( || {
92
116
register_gauge_vec ! (
93
117
"tap_pending_rav_grt_total" ,
@@ -96,6 +120,7 @@ static PENDING_RAV: LazyLock<GaugeVec> = LazyLock::new(|| {
96
120
)
97
121
. unwrap ( )
98
122
} ) ;
123
+ #[ allow( dead_code) ] // Used in production code
99
124
static MAX_FEE_PER_SENDER : LazyLock < GaugeVec > = LazyLock :: new ( || {
100
125
register_gauge_vec ! (
101
126
"tap_max_fee_per_sender_grt_total" ,
@@ -104,6 +129,7 @@ static MAX_FEE_PER_SENDER: LazyLock<GaugeVec> = LazyLock::new(|| {
104
129
)
105
130
. unwrap ( )
106
131
} ) ;
132
+ #[ allow( dead_code) ] // Used in production code
107
133
static RAV_REQUEST_TRIGGER_VALUE : LazyLock < GaugeVec > = LazyLock :: new ( || {
108
134
register_gauge_vec ! (
109
135
"tap_rav_request_trigger_value" ,
@@ -113,6 +139,7 @@ static RAV_REQUEST_TRIGGER_VALUE: LazyLock<GaugeVec> = LazyLock::new(|| {
113
139
. unwrap ( )
114
140
} ) ;
115
141
142
+ #[ allow( dead_code) ] // Used by AdaptiveLimiter in production code paths
116
143
const INITIAL_RAV_REQUEST_CONCURRENT : usize = 1 ;
117
144
118
145
type RavMap = HashMap < Address , u128 > ;
0 commit comments