@@ -25,15 +25,19 @@ use tokio::sync::{mpsc, watch::Receiver};
25
25
use super :: {
26
26
sender_account:: { RavInformation , ReceiptFees , SenderAccountConfig , SenderAccountMessage } ,
27
27
sender_accounts_manager:: AllocationId ,
28
- sender_allocation_task:: SenderAllocationTask ,
29
28
unaggregated_receipts:: UnaggregatedReceipts ,
30
29
} ;
31
30
use crate :: {
32
31
actor_migrate:: { LifecycleManager , RestartPolicy , TaskHandle , TaskRegistry } ,
33
- tap:: context:: { Horizon , Legacy } ,
34
32
tracker:: { SenderFeeTracker , SimpleFeeTracker } ,
35
33
} ;
36
34
35
+ #[ cfg( any( test, feature = "test" ) ) ]
36
+ use super :: sender_allocation_task:: SenderAllocationTask ;
37
+
38
+ #[ cfg( any( test, feature = "test" ) ) ]
39
+ use crate :: tap:: context:: { Horizon , Legacy } ;
40
+
37
41
type Balance = U256 ;
38
42
type RavMap = HashMap < Address , u128 > ;
39
43
@@ -58,8 +62,10 @@ struct TaskState {
58
62
/// Current sender balance
59
63
sender_balance : U256 ,
60
64
/// Registry for managing child tasks
65
+ #[ allow( dead_code) ]
61
66
child_registry : TaskRegistry ,
62
67
/// Lifecycle manager for child tasks
68
+ #[ allow( dead_code) ]
63
69
lifecycle : Arc < LifecycleManager > ,
64
70
/// Configuration
65
71
#[ allow( dead_code) ]
@@ -339,10 +345,22 @@ impl SenderAccountTask {
339
345
340
346
#[ cfg( not( any( test, feature = "test" ) ) ) ]
341
347
{
342
- // In production, we'd need a proper way to create a self-reference
343
- // For now, just log that this isn't implemented yet
348
+ // TODO: Implement production child task spawning
349
+ // This requires proper integration with the actual SenderAllocationTask spawn method
350
+ // that includes TAP manager, aggregator client, etc.
351
+ //
352
+ // For now, we'll skip this to maintain build compatibility
353
+ // The proper implementation would look like:
354
+ //
355
+ // 1. Create aggregator client for this sender
356
+ // 2. Set up TAP manager with proper configuration
357
+ // 3. Spawn SenderAllocationTask with full parameters
358
+ // 4. Set up proper parent-child communication channel
359
+
344
360
tracing:: warn!(
345
- "Production sender allocation spawning not fully implemented yet - child task communication needs work"
361
+ sender = %state. sender,
362
+ allocation_id = ?allocation_id,
363
+ "Production sender allocation spawning not yet implemented - requires TAP manager integration"
346
364
) ;
347
365
}
348
366
@@ -412,11 +430,28 @@ impl SenderAccountTask {
412
430
413
431
/// Handle invalid receipt fee updates
414
432
async fn handle_update_invalid_receipt_fees (
415
- _state : & mut TaskState ,
416
- _allocation_id : AllocationId ,
417
- _unaggregated_fees : UnaggregatedReceipts ,
433
+ state : & mut TaskState ,
434
+ allocation_id : AllocationId ,
435
+ unaggregated_fees : UnaggregatedReceipts ,
418
436
) -> Result < ( ) > {
419
- // Simplified implementation
437
+ let addr = match allocation_id {
438
+ AllocationId :: Legacy ( id) => id. into_inner ( ) ,
439
+ AllocationId :: Horizon ( id) => thegraph_core:: AllocationId :: from ( id) . into_inner ( ) ,
440
+ } ;
441
+
442
+ // Track invalid receipt fees in the tracker
443
+ state
444
+ . invalid_receipts_tracker
445
+ . update ( addr, unaggregated_fees. value ) ;
446
+
447
+ tracing:: debug!(
448
+ sender = %state. sender,
449
+ allocation_id = ?allocation_id,
450
+ invalid_value = unaggregated_fees. value,
451
+ invalid_count = unaggregated_fees. counter,
452
+ "Updated invalid receipt fees for allocation"
453
+ ) ;
454
+
420
455
Ok ( ( ) )
421
456
}
422
457
0 commit comments