@@ -6,6 +6,7 @@ use std::{
66 time:: Duration ,
77} ;
88
9+ use alloy:: dyn_abi:: Eip712Domain ;
910use alloy:: sol_types:: eip712_domain;
1011use anyhow;
1112use autometrics:: prometheus_exporter;
@@ -33,11 +34,11 @@ use tower_governor::{governor::GovernorConfigBuilder, GovernorLayer};
3334use tower_http:: { cors, cors:: CorsLayer , normalize_path:: NormalizePath , trace:: TraceLayer } ;
3435use tracing:: { info, info_span} ;
3536
37+ use crate :: escrow_accounts:: EscrowAccounts ;
38+ use crate :: escrow_accounts:: EscrowAccountsError ;
3639use crate :: {
3740 address:: public_key,
38- indexer_service:: http:: {
39- metrics:: IndexerServiceMetrics , static_subgraph:: static_subgraph_request_handler,
40- } ,
41+ indexer_service:: http:: static_subgraph:: static_subgraph_request_handler,
4142 prelude:: {
4243 attestation_signers, dispute_manager, escrow_accounts, indexer_allocations,
4344 AttestationSigner , DeploymentDetails , SubgraphClient ,
9899 FailedToSignAttestation ,
99100 #[ error( "Failed to query subgraph: {0}" ) ]
100101 FailedToQueryStaticSubgraph ( anyhow:: Error ) ,
102+
103+ #[ error( "Could not decode signer: {0}" ) ]
104+ CouldNotDecodeSigner ( tap_core:: Error ) ,
105+
106+ #[ error( "There was an error while accessing escrow account: {0}" ) ]
107+ EscrowAccount ( EscrowAccountsError ) ,
101108}
102109
103110impl < E > IntoResponse for IndexerServiceError < E >
@@ -122,6 +129,8 @@ where
122129 ReceiptError ( _)
123130 | InvalidRequest ( _)
124131 | InvalidFreeQueryAuthToken
132+ | CouldNotDecodeSigner ( _)
133+ | EscrowAccount ( _)
125134 | ProcessingError ( _) => StatusCode :: BAD_REQUEST ,
126135
127136 FailedToQueryStaticSubgraph ( _) => StatusCode :: INTERNAL_SERVER_ERROR ,
@@ -166,7 +175,6 @@ where
166175 pub config : IndexerServiceConfig ,
167176 pub release : IndexerServiceRelease ,
168177 pub url_namespace : & ' static str ,
169- pub metrics_prefix : & ' static str ,
170178 pub extra_routes : Router < Arc < IndexerServiceState < I > > > ,
171179}
172180
@@ -178,7 +186,10 @@ where
178186 pub attestation_signers : Eventual < HashMap < Address , AttestationSigner > > ,
179187 pub tap_manager : Manager < IndexerTapContext > ,
180188 pub service_impl : Arc < I > ,
181- pub metrics : IndexerServiceMetrics ,
189+
190+ // tap
191+ pub escrow_accounts : Eventual < EscrowAccounts > ,
192+ pub domain_separator : Eip712Domain ,
182193}
183194
184195pub struct IndexerService { }
@@ -188,8 +199,6 @@ impl IndexerService {
188199 where
189200 I : IndexerServiceImpl + Sync + Send + ' static ,
190201 {
191- let metrics = IndexerServiceMetrics :: new ( options. metrics_prefix ) ;
192-
193202 let http_client = reqwest:: Client :: builder ( )
194203 . tcp_nodelay ( true )
195204 . timeout ( Duration :: from_secs ( 30 ) )
@@ -299,21 +308,26 @@ impl IndexerService {
299308 let checks = IndexerTapContext :: get_checks (
300309 database,
301310 allocations,
302- escrow_accounts,
311+ escrow_accounts. clone ( ) ,
303312 domain_separator. clone ( ) ,
304313 timestamp_error_tolerance,
305314 receipt_max_value,
306315 )
307316 . await ;
308317
309- let tap_manager = Manager :: new ( domain_separator, indexer_context, CheckList :: new ( checks) ) ;
318+ let tap_manager = Manager :: new (
319+ domain_separator. clone ( ) ,
320+ indexer_context,
321+ CheckList :: new ( checks) ,
322+ ) ;
310323
311324 let state = Arc :: new ( IndexerServiceState {
312325 config : options. config . clone ( ) ,
313326 attestation_signers,
314327 tap_manager,
315328 service_impl : Arc :: new ( options. service_impl ) ,
316- metrics,
329+ escrow_accounts,
330+ domain_separator,
317331 } ) ;
318332
319333 // Rate limits by allowing bursts of 10 requests and requiring 100ms of
0 commit comments