Skip to content

Commit

Permalink
fix: check allocation id blocked before sending rav req
Browse files Browse the repository at this point in the history
  • Loading branch information
shiyasmohd committed Feb 1, 2025
1 parent 1e4ea11 commit d101e29
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crates/tap-agent/src/agent/sender_account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,11 @@ impl Actor for SenderAccount {
"Total fee greater than the trigger value. Triggering RAV request"
);
state.rav_request_for_heaviest_allocation().await
} else if counter_greater_receipt_limit {
} else if counter_greater_receipt_limit
&& !state
.sender_fee_tracker
.is_allocation_id_blocked(&allocation_id)
{
tracing::debug!(
total_counter_for_allocation,
rav_request_receipt_limit = state.config.rav_request_receipt_limit,
Expand Down
7 changes: 7 additions & 0 deletions crates/tap-agent/src/tracker/generic_tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,13 @@ where
});
}

pub fn is_allocation_id_blocked(&self, address: &Address) -> bool {
self.id_to_fee
.get(address)
.map(|v| v.blocked)
.expect("Allocation ID not found")
}

pub fn can_trigger_rav(&self, allocation_id: Address) -> bool {
self.id_to_fee
.get(&allocation_id)
Expand Down

0 comments on commit d101e29

Please sign in to comment.