diff --git a/crates/tap-agent/src/agent/sender_account.rs b/crates/tap-agent/src/agent/sender_account.rs index 33436b37..903179f3 100644 --- a/crates/tap-agent/src/agent/sender_account.rs +++ b/crates/tap-agent/src/agent/sender_account.rs @@ -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, diff --git a/crates/tap-agent/src/tracker/generic_tracker.rs b/crates/tap-agent/src/tracker/generic_tracker.rs index d81a392b..2ec4c6d6 100644 --- a/crates/tap-agent/src/tracker/generic_tracker.rs +++ b/crates/tap-agent/src/tracker/generic_tracker.rs @@ -8,6 +8,7 @@ use std::{ }; use thegraph_core::alloy::primitives::Address; +use tracing::warn; use super::{ global_tracker::GlobalTracker, AllocationStats, DefaultFromExtra, DurationInfo, SenderFeeStats, @@ -214,6 +215,16 @@ where }); } + pub fn is_allocation_id_blocked(&self, address: &Address) -> bool { + match self.id_to_fee.get(address).map(|v| v.blocked) { + Some(val) => val, + None => { + warn!("Allocation ID {} not found in the tracker", address); + false + } + } + } + pub fn can_trigger_rav(&self, allocation_id: Address) -> bool { self.id_to_fee .get(&allocation_id)