@@ -78,18 +78,7 @@ pub async fn run() -> anyhow::Result<()> {
7878    ) 
7979    . await ; 
8080
81-     let  escrow_subgraph_v2 = if  let  Some ( ref  escrow_v2_config)  = config. subgraphs . escrow_v2  { 
82-         Some ( 
83-             create_subgraph_client ( 
84-                 http_client. clone ( ) , 
85-                 & config. graph_node , 
86-                 & escrow_v2_config. config , 
87-             ) 
88-             . await , 
89-         ) 
90-     }  else  { 
91-         None 
92-     } ; 
81+     // V2 escrow accounts are in the network subgraph, not a separate escrow_v2 subgraph 
9382
9483    // Establish Database connection necessary for serving indexer management 
9584    // requests with defined schema 
@@ -113,11 +102,8 @@ pub async fn run() -> anyhow::Result<()> {
113102
114103    // Capture individual fields needed for DIPS before they get moved 
115104    let  escrow_v1_query_url_for_dips = config. subgraphs . escrow . config . query_url . clone ( ) ; 
116-     let  escrow_v2_query_url_for_dips = config
117-         . subgraphs 
118-         . escrow_v2 
119-         . as_ref ( ) 
120-         . map ( |c| c. config . query_url . clone ( ) ) ; 
105+     // V2 escrow accounts are in the network subgraph 
106+     let  escrow_v2_query_url_for_dips = Some ( config. subgraphs . network . config . query_url . clone ( ) ) ; 
121107
122108    // Configure router with escrow watchers based on Horizon mode 
123109    use  indexer_config:: HorizonMode ; 
@@ -157,7 +143,7 @@ pub async fn run() -> anyhow::Result<()> {
157143        } 
158144        HorizonMode :: Transition  => { 
159145            tracing:: info!( "Horizon mode: Transition - using both escrow accounts v1 and v2" ) ; 
160-             // Create both watchers for transition mode using separate subgraph clients  
146+             // Create both watchers for transition mode 
161147            let  escrow_subgraph_v1 = create_subgraph_client ( 
162148                http_client. clone ( ) , 
163149                & config. graph_node , 
@@ -174,78 +160,38 @@ pub async fn run() -> anyhow::Result<()> {
174160            . await 
175161            . expect ( "Error creating escrow_accounts_v1 channel" ) ; 
176162
177-             if  let  Some ( escrow_v2_subgraph)  = escrow_subgraph_v2 { 
178-                 let  v2_watcher = indexer_monitor:: escrow_accounts_v2 ( 
179-                     escrow_v2_subgraph, 
180-                     indexer_address, 
181-                     config
182-                         . subgraphs 
183-                         . escrow_v2 
184-                         . as_ref ( ) 
185-                         . unwrap ( ) 
186-                         . config 
187-                         . syncing_interval_secs , 
188-                     true ,  // Reject thawing signers eagerly 
189-                 ) 
190-                 . await 
191-                 . expect ( "Error creating escrow_accounts_v2 channel" ) ; 
192- 
193-                 ServiceRouter :: builder ( ) 
194-                     . database ( database. clone ( ) ) 
195-                     . domain_separator ( domain_separator. clone ( ) ) 
196-                     . graph_node ( config. graph_node ) 
197-                     . http_client ( http_client) 
198-                     . release ( release) 
199-                     . indexer ( config. indexer ) 
200-                     . service ( config. service ) 
201-                     . blockchain ( config. blockchain ) 
202-                     . timestamp_buffer_secs ( config. tap . rav_request . timestamp_buffer_secs ) 
203-                     . network_subgraph ( network_subgraph,  config. subgraphs . network ) 
204-                     . escrow_accounts_v1 ( v1_watcher) 
205-                     . escrow_accounts_v2 ( v2_watcher) 
206-                     . build ( ) 
207-             }  else  { 
208-                 tracing:: warn!( "Horizon mode is Transition but no escrow_v2 configuration provided, falling back to v1 only" ) ; 
209-                 ServiceRouter :: builder ( ) 
210-                     . database ( database. clone ( ) ) 
211-                     . domain_separator ( domain_separator. clone ( ) ) 
212-                     . graph_node ( config. graph_node ) 
213-                     . http_client ( http_client) 
214-                     . release ( release) 
215-                     . indexer ( config. indexer ) 
216-                     . service ( config. service ) 
217-                     . blockchain ( config. blockchain ) 
218-                     . timestamp_buffer_secs ( config. tap . rav_request . timestamp_buffer_secs ) 
219-                     . network_subgraph ( network_subgraph,  config. subgraphs . network ) 
220-                     . escrow_accounts_v1 ( v1_watcher) 
221-                     . build ( ) 
222-             } 
163+             // V2 escrow accounts are in the network subgraph 
164+             let  v2_watcher = indexer_monitor:: escrow_accounts_v2 ( 
165+                 network_subgraph, 
166+                 indexer_address, 
167+                 config. subgraphs . network . config . syncing_interval_secs , 
168+                 true ,  // Reject thawing signers eagerly 
169+             ) 
170+             . await 
171+             . expect ( "Error creating escrow_accounts_v2 channel" ) ; 
172+ 
173+             ServiceRouter :: builder ( ) 
174+                 . database ( database. clone ( ) ) 
175+                 . domain_separator ( domain_separator. clone ( ) ) 
176+                 . graph_node ( config. graph_node ) 
177+                 . http_client ( http_client) 
178+                 . release ( release) 
179+                 . indexer ( config. indexer ) 
180+                 . service ( config. service ) 
181+                 . blockchain ( config. blockchain ) 
182+                 . timestamp_buffer_secs ( config. tap . rav_request . timestamp_buffer_secs ) 
183+                 . network_subgraph ( network_subgraph,  config. subgraphs . network ) 
184+                 . escrow_accounts_v1 ( v1_watcher) 
185+                 . escrow_accounts_v2 ( v2_watcher) 
186+                 . build ( ) 
223187        } 
224188        HorizonMode :: Full  => { 
225189            tracing:: info!( "Horizon mode: Full - using escrow accounts v2 only" ) ; 
226-             // Only create v2 watcher for full Horizon mode 
227-             let  v2_subgraph = if  let  Some ( escrow_v2_subgraph)  = escrow_subgraph_v2 { 
228-                 escrow_v2_subgraph
229-             }  else  { 
230-                 tracing:: warn!( "Horizon mode is Full but no escrow_v2 configuration provided, falling back to escrow v1 endpoint for v2 queries" ) ; 
231-                 create_subgraph_client ( 
232-                     http_client. clone ( ) , 
233-                     & config. graph_node , 
234-                     & config. subgraphs . escrow . config , 
235-                 ) 
236-                 . await 
237-             } ; 
238-             let  v2_config = config
239-                 . subgraphs 
240-                 . escrow_v2 
241-                 . as_ref ( ) 
242-                 . map ( |c| & c. config ) 
243-                 . unwrap_or ( & config. subgraphs . escrow . config ) ; 
244- 
190+             // V2 escrow accounts are in the network subgraph 
245191            let  v2_watcher = indexer_monitor:: escrow_accounts_v2 ( 
246-                 v2_subgraph , 
192+                 network_subgraph , 
247193                indexer_address, 
248-                 v2_config . syncing_interval_secs , 
194+                 config . subgraphs . network . config . syncing_interval_secs , 
249195                true ,  // Reject thawing signers eagerly 
250196            ) 
251197            . await 
0 commit comments