@@ -30,6 +30,7 @@ use super::sender_allocation::{SenderAllocation, SenderAllocationArgs};
3030use crate :: adaptative_concurrency:: AdaptiveLimiter ;
3131use crate :: agent:: sender_allocation:: SenderAllocationMessage ;
3232use crate :: agent:: unaggregated_receipts:: UnaggregatedReceipts ;
33+ use crate :: backoff:: BackoffInfo ;
3334use crate :: tracker:: { SenderFeeTracker , SimpleFeeTracker } ;
3435use crate :: {
3536 config:: { self } ,
@@ -161,6 +162,9 @@ pub struct State {
161162 config : & ' static config:: Config ,
162163 pgpool : PgPool ,
163164 sender_aggregator : jsonrpsee:: http_client:: HttpClient ,
165+
166+ // Backoff info
167+ backoff_info : BackoffInfo ,
164168}
165169
166170impl State {
@@ -546,6 +550,7 @@ impl Actor for SenderAccount {
546550 retry_interval,
547551 scheduled_rav_request : None ,
548552 adaptive_limiter : AdaptiveLimiter :: new ( INITIAL_RAV_REQUEST_CONCURRENT , 1 ..50 ) ,
553+ backoff_info : BackoffInfo :: default ( ) ,
549554 } ;
550555
551556 for allocation_id in & allocation_ids {
@@ -664,17 +669,16 @@ impl Actor for SenderAccount {
664669 counter_greater_receipt_limit,
665670 total_fee_greater_trigger_value,
666671 ) {
667- ( true , _) => {
672+ ( true , _) if !state . backoff_info . in_backoff ( ) => {
668673 tracing:: debug!(
669674 total_counter_for_allocation,
670675 rav_request_receipt_limit = state. config. tap. rav_request_receipt_limit,
671676 %allocation_id,
672677 "Total counter greater than the receipt limit per rav. Triggering RAV request"
673678 ) ;
674-
675679 state. rav_request_for_allocation ( allocation_id) . await
676680 }
677- ( _, true ) => {
681+ ( _, true ) if !state . backoff_info . in_backoff ( ) => {
678682 tracing:: debug!(
679683 total_fee_outside_buffer,
680684 trigger_value = state. config. tap. rav_request_trigger_value,
0 commit comments