Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "feat: add option to avoid denying senders" #618

Merged
merged 2 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions crates/config/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,9 +382,6 @@ pub struct TapConfig {
pub sender_timeout_secs: Duration,

pub sender_aggregator_endpoints: HashMap<Address, Url>,
/// Set of sender addresses that will not be added to the denylist
#[serde(default)]
pub trusted_senders: Vec<Address>,
}

#[derive(Debug, Deserialize)]
Expand Down
14 changes: 0 additions & 14 deletions crates/tap-agent/src/agent/sender_account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,6 @@ pub struct SenderAccountConfig {
pub max_amount_willing_to_lose_grt: u128,
/// What value triggers a new Rav request
pub trigger_value: u128,
/// Set of sender addresses that will not be added to the denylist
pub trusted_senders: HashSet<Address>,

// allocation config
/// Timeout config for rav requests
Expand All @@ -357,7 +355,6 @@ impl SenderAccountConfig {
escrow_polling_interval: config.subgraphs.escrow.config.syncing_interval_secs,
max_amount_willing_to_lose_grt: config.tap.max_amount_willing_to_lose_grt.get_value(),
trigger_value: config.tap.get_trigger_value(),
trusted_senders: config.tap.trusted_senders.iter().copied().collect(),
rav_request_timeout: config.tap.rav_request.request_timeout_secs,
tap_sender_timeout: config.tap.sender_timeout_secs,
}
Expand Down Expand Up @@ -552,17 +549,6 @@ impl State {

/// Will update [`State::denied`], as well as the denylist table in the database.
async fn add_to_denylist(&mut self) {
if self.config.trusted_senders.contains(&self.sender) {
tracing::warn!(
fee_tracker = self.sender_fee_tracker.get_total_fee(),
rav_tracker = self.rav_tracker.get_total_fee(),
max_amount_willing_to_lose = self.config.max_amount_willing_to_lose_grt,
sender_balance = self.sender_balance.to_u128(),
"Trusted sender would be denied."
);
return;
}

tracing::warn!(
fee_tracker = self.sender_fee_tracker.get_total_fee(),
rav_tracker = self.rav_tracker.get_total_fee(),
Expand Down
2 changes: 0 additions & 2 deletions crates/tap-agent/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ pub fn get_sender_account_config() -> &'static SenderAccountConfig {
rav_request_buffer: RAV_REQUEST_BUFFER,
max_amount_willing_to_lose_grt: TRIGGER_VALUE + 100,
trigger_value: TRIGGER_VALUE,
trusted_senders: Default::default(),
rav_request_timeout: Duration::from_secs(30),
rav_request_receipt_limit: 1000,
indexer_address: INDEXER.1,
Expand Down Expand Up @@ -118,7 +117,6 @@ pub async fn create_sender_account(
rav_request_buffer: BUFFER_DURATION,
max_amount_willing_to_lose_grt,
trigger_value: rav_request_trigger_value,
trusted_senders: Default::default(),
rav_request_timeout: RAV_REQUEST_TIMEOUT,
rav_request_receipt_limit,
indexer_address: INDEXER.1,
Expand Down
1 change: 0 additions & 1 deletion crates/tap-agent/tests/tap_agent_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ pub async fn start_agent(
rav_request_buffer: Duration::from_millis(500),
max_amount_willing_to_lose_grt: 50,
trigger_value: 150,
trusted_senders: Default::default(),
rav_request_timeout: Duration::from_secs(60),
rav_request_receipt_limit: 10,
indexer_address: INDEXER_ADDRESS,
Expand Down
Loading