You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR introduces a quick fix to existing cloning pipeline, to remove
undelegated account from validator (both from database and from
websocket monitoring) once certain preconfigured threshold is reached.
The eviction of those accounts happen using LRU strategy. Every
transaction affects this cache by touching the account and renewing its
"stay", thus only stale/unused accounts are removed. Delegated accounts
are not affected by this change.
<!-- greptile_comment -->
## Greptile Summary
Implemented account monitoring limits using an LRU cache to prevent
unbounded memory growth in the validator.
- Added `monitored_accounts` LRU cache in `RemoteAccountClonerWorker`
with configurable capacity (default 2048)
- Implemented account eviction logic in `track_undelegated_account` that
removes accounts from AccountsDB and websocket subscriptions
- Added metrics tracking for monitored accounts count, subscriptions per
shard, and evicted accounts
- Modified account update system to support unsubscribing from account
monitoring when accounts are evicted
- Added `remove_account` capability to AccountsDB and providers to
properly cleanup evicted accounts
<!-- /greptile_comment -->
---------
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: Gabriele Picco <piccogabriele@gmail.com>
0 commit comments