Tracks last cleaned slot in accounts background service#6396
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6396 +/- ##
========================================
Coverage 82.8% 82.8%
========================================
Files 848 848
Lines 379048 379050 +2
========================================
+ Hits 313859 314021 +162
+ Misses 65189 65029 -160 🚀 New features to boost your workflow:
|
4089f49 to
7ec06e9
Compare
|
Force-pushed to resolve merge conflicts. No code was changed. |
|
i'm not sure about skipped slots. we'll clean more often when we skip slots. Today we aren't skipping many slots on mnb. Just thinking about attacks, changes in behavior, etc. |
Yep! This means we'll strictly clean more than before. Since mnb's skip rate is 0.2%, we'll only be changing the duration between calls to clean by like 1 slot. Note there's already a random amount applied to when we call 'clean' too. And really, when snapshots are enabled, we're cleaning each snapshot request, which have different (longer) runtimes than the no-snapshot-request paths. Specifically, when snapshots are enabled (assuming the default 100 slot incremental snapshot interval), we never go through this else-if block, which is really the only thing that changed. } else if bank.slot() - last_cleaned_slot
> (CLEAN_INTERVAL_SLOTS + thread_rng().gen_range(0..10)) |
Problem
The main problem is #6295. As a means to that end, we need to ensure we don't clean past any enqueued snapshot request's slot. Currently, accounts background service tracks the last cleaned block height, which doesn't easily map to slot (when calling
AccountsDb::clean_accounts(), which takesmax_clean_root_inclusive, which is aSlot).Summary of Changes
Track the last cleaned slot, instead of block height.