File tree Expand file tree Collapse file tree 5 files changed +18
-4
lines changed Expand file tree Collapse file tree 5 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -19,9 +19,11 @@ max_receipt_value_grt = "0.001" # We use strings to prevent rounding errors
1919
2020[tap ]
2121max_amount_willing_to_lose_grt = 20
22+ sender_timeout_secs = 30
2223
2324[tap .rav_request ]
2425trigger_value_divisor = 10
2526timestamp_buffer_secs = 60
2627request_timeout_secs = 5
2728max_receipts_per_request = 10000
29+
Original file line number Diff line number Diff line change @@ -124,6 +124,9 @@ max_receipt_value_grt = "0.001" # 0.001 GRT. We use strings to prevent rounding
124124# max_amount_willing_to_lose_grt = "0.1"
125125max_amount_willing_to_lose_grt = 20
126126
127+ # Receipts query timeout
128+ sender_timeout_secs = 30
129+
127130[tap .rav_request ]
128131# Trigger value is the amount used to trigger a rav request
129132# The dividor is used to define the trigger value of a RAV request using
@@ -148,3 +151,4 @@ max_receipts_per_request = 10000
148151
149152[dips ]
150153allowed_payers = [" 0x3333333333333333333333333333333333333333" ]
154+
Original file line number Diff line number Diff line change @@ -373,13 +373,17 @@ pub struct ServiceTapConfig {
373373 pub max_receipt_value_grt : NonZeroGRT ,
374374}
375375
376+ #[ serde_as]
376377#[ derive( Debug , Deserialize ) ]
377378#[ cfg_attr( test, derive( PartialEq ) ) ]
378379pub struct TapConfig {
379380 /// what is the maximum amount the indexer is willing to lose in grt
380381 pub max_amount_willing_to_lose_grt : NonZeroGRT ,
381382 pub rav_request : RavRequestConfig ,
382383
384+ #[ serde_as( as = "DurationSecondsWithFrac<f64>" ) ]
385+ pub sender_timeout_secs : Duration ,
386+
383387 pub sender_aggregator_endpoints : HashMap < Address , Url > ,
384388}
385389
@@ -578,7 +582,7 @@ mod tests {
578582 key1 = "${TEST_VAR1}"
579583 key2 = "${TEST_VAR-default}"
580584 key3 = "{{TEST_VAR3}}"
581-
585+
582586 [section2]
583587 key4 = "prefix_${TEST_VAR1}_${TEST_VAR-default}_suffix"
584588 key5 = "a_key_without_substitution"
@@ -590,7 +594,7 @@ mod tests {
590594 key1 = "changed_value_1"
591595 key2 = "${TEST_VAR-default}"
592596 key3 = "{{TEST_VAR3}}"
593-
597+
594598 [section2]
595599 key4 = "prefix_changed_value_1_${TEST_VAR-default}_suffix"
596600 key5 = "a_key_without_substitution"
Original file line number Diff line number Diff line change @@ -190,6 +190,7 @@ pub struct SenderAccountConfig {
190190 pub rav_request_receipt_limit : u64 ,
191191 pub indexer_address : Address ,
192192 pub escrow_polling_interval : Duration ,
193+ pub tap_sender_timeout : Duration ,
193194}
194195
195196impl SenderAccountConfig {
@@ -202,6 +203,7 @@ impl SenderAccountConfig {
202203 max_amount_willing_to_lose_grt : config. tap . max_amount_willing_to_lose_grt . get_value ( ) ,
203204 trigger_value : config. tap . get_trigger_value ( ) ,
204205 rav_request_timeout : config. tap . rav_request . request_timeout_secs ,
206+ tap_sender_timeout : config. tap . sender_timeout_secs ,
205207 }
206208 }
207209}
@@ -1147,6 +1149,7 @@ pub mod tests {
11471149 rav_request_receipt_limit,
11481150 indexer_address : INDEXER . 1 ,
11491151 escrow_polling_interval : Duration :: default ( ) ,
1152+ tap_sender_timeout : Duration :: from_secs ( 30 ) ,
11501153 } ) ) ;
11511154
11521155 let network_subgraph = Box :: leak ( Box :: new (
Original file line number Diff line number Diff line change @@ -142,7 +142,7 @@ impl Actor for SenderAccountsManager {
142142 } ;
143143 let sender_allocation = select ! {
144144 sender_allocation = state. get_pending_sender_allocation_id( ) => sender_allocation,
145- _ = tokio:: time:: sleep( std :: time :: Duration :: from_secs ( 30 ) ) => {
145+ _ = tokio:: time:: sleep( state . config . tap_sender_timeout ) => {
146146 panic!( "Timeout while getting pending sender allocation ids" ) ;
147147 }
148148 } ;
@@ -252,7 +252,7 @@ impl Actor for SenderAccountsManager {
252252
253253 let mut sender_allocation = select ! {
254254 sender_allocation = state. get_pending_sender_allocation_id( ) => sender_allocation,
255- _ = tokio:: time:: sleep( std :: time :: Duration :: from_secs ( 30 ) ) => {
255+ _ = tokio:: time:: sleep( state . config . tap_sender_timeout ) => {
256256 tracing:: error!( "Timeout while getting pending sender allocation ids" ) ;
257257 return Ok ( ( ) ) ;
258258 }
@@ -643,6 +643,7 @@ mod tests {
643643 rav_request_receipt_limit : 1000 ,
644644 indexer_address : INDEXER . 1 ,
645645 escrow_polling_interval : Duration :: default ( ) ,
646+ tap_sender_timeout : Duration :: from_secs ( 30 ) ,
646647 } ) )
647648 }
648649
You can’t perform that action at this time.
0 commit comments