Skip to content

feat: optionally reclaim expired account rent from operator #172

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

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

gzalz
Copy link
Contributor

@gzalz gzalz commented Jul 23, 2025

Problem
Our rent reclamation is currently an ad-hoc script. The tip router operator should handle operations like these without a need for manual action.

Solution

  • Add tx_utils for common utils for sending bulk transactions
  • Add reclaim mod with the expired claim status account related functions
  • Add expired distribution account related functions
  • Use num_monitored_epochs as bounds for epochs to check for expired accounts
  • Call reclaim expired accounts from main.rs Run
  • Emit metrics related to expired transactions
Screenshot 2025-07-23 at 1 53 03 PM Screenshot 2025-07-24 at 12 05 02 PM

@gzalz gzalz marked this pull request as ready for review July 23, 2025 21:18
Ok((tda_accounts, pfda_accounts))
}

async fn fetch_expired_claim_statuses(
Copy link
Contributor Author

@gzalz gzalz Jul 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has an average of 30-60 seconds latency vs 700s+ for the existing approach for fetching claims by epoch (within the claims process) using get batched accounts, not counting sourcing the pubkeys from the very large merkle tree collection.

#[allow(clippy::integer_division)]
#[allow(clippy::arithmetic_side_effects)]
#[allow(clippy::manual_div_ceil)]
pub fn pack_transactions(
Copy link
Contributor Author

@gzalz gzalz Jul 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This helps us achieve 200+ closed accounts per second on a single instance. We should re-use this where applicable. The claims process would be a great candidate.

@gzalz gzalz changed the title feat: optionally reclaim claim status accounts from operator feat: optionally reclaim expired account rent from operator Jul 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant