* purge_old_snapshot_archives is changed to take an extra argument 'maximum_snapshots_to_retain' to control the max number of latest snapshot archives to retain. Note the oldest snapshot is always retained as before and is not subjected to this new options.
* The validator and ledger-tool executables are modified with a CLI argument --maximum-snapshots-to-retain. And the options are propagated down the call chains. Their corresponding shell scripts were changed accordingly.
* SnapshotConfig is modified to have an extra field for the maximum_snapshots_to_retain
* Unit tests are developed to cover purge_old_snapshot_archives
* AccountSecondaryIndexes.include/exclude
* use normal scan if key is not indexed
* add a test to ask for a scan for an excluded secondary index
* fix up cli args
* insert accounts in parallel when building initial index
* rename nits from pr review
* rename nits from pr review
* rename nits from pr review
* rename nits from pr review
* distribute_rent_to_validators checked_add_lamports unwrap
* make rent disappear on add failure
* add pubkey to message
* update message text
* don't store account that we failed to transfer to
* format
In a scenario where a bank is unrooted and dropped, any keys that exist
_only_ in that bank are now cleaned up.
This work was originally based on PR #15106.
* stretchy roots tracker
* rename hash to hash_set in tests
* update comment
* try 2 widths in test
* bool iter
* add assert
* helper function for bitfield insert/remove
* introduce RollingBitFieldTester
* another bool iter replacement
* map cleanup
* map to cloned
While working on another issue (#16580), the list of uncleaned pubkeys
returned from `remove_uncleaned_slots_and_collect_pubkeys_up_to_slot()`
did not include unrooted slots. This meant that during cleaning,
unrooted slots would not have their pubkeys cleaned up properly.
Now, return all uncleaned pubkeys, regardless if the slot is rooted or
not. Additionally, update the tests to have unrooted slots to ensure
this behavior.
This is part two of PR #16879, and originally based on PR #15106.
* Refactor `collect_uncleaned_pubkeys_to_slot()`
While working on another issue (#16580), I came across
`collect_unclean_pubkeys_to_slot()` and had difficulty understanding it.
Since the function does a few logically separate things, I split the
function up. I also added documentation, removed an unused return value,
and renamed the functions to be more specific.
This commit is to split up an existing PR (#16786), where I had both this
aesthetic change _and_ a behavioral change.