#### Problem
In TieredStorage, we want to make AccountOffset and IndexOffset u32 instead
of usize just like OwnerOffset. However, we need to first change what we persist
in the storage. Currently, IndexBlock persists offsets as u64 instead of u32.
#### Summary of Changes
This PR makes IndexBlock persist u32 offsets.
#### Test Plan
Existing test cases.
#### Problem
TieredAccountMeta currently uses `u32` for owner_offset, while
we already have a dedicate type for that --- OwnerOffset.
#### Summary of Changes
This PR makes TieredAccountMeta use OwnerOffset for its
owner_offset field.
#### Test Plan
Existing unit-tests.
The function matches the access type and calls a different RocksDB
function depending on whether we have primary or secondary access. But,
lots of the code is the same for these two paths so de-duplicate the
repeated sections.
* Moves modification of feature accounts from Bank::compute_active_feature_set() into Bank::apply_feature_activations().
* Renames allow_new_activations and newly_activated to include_pending and pending.
* Fix test_compute_active_feature_set.
#### Problem
The current OwnerOffset is defined as usize, which actual size could be u32 or u64.
On the other hand, the OwnerOffset is used to access the ith owner in one
TieredStorageFile. As a result, u32 is more than enough to represent the number of
owners inside one TieredStorageFile while u16 might not be always enough.
#### Summary of Changes
This PR defines OwnerOffset as u32.
#### Test Plan
Existing test cases.
* Add push and get methods for RestartLastVotedForkSlots
* Improve expression format.
* Remove fill() from RestartLastVotedForkSlots and move into constructor.
* Update ABI signature.
* Use flate2 compress directly instead of relying on CompressedSlots.
* Make constructor of RestartLastVotedForkSlots return error if necessary.
* Use minmax and remove unnecessary code.
* Replace flate2 with run-length encoding in RestartLastVotedForkSlots.
* Remove accidentally added file.
* The passed in last_voted_fork don't need to be mutable any more.
* Switch to different type of run-length encoding.
* Fix typo.
* Move constant into RestartLastVotedForkSlots.
* Use BitVec in RawOffsets.
* Remove the unnecessary clone.
* Use iter functions for RLE.
* Use take_while instead of loop.
* Change Run length encoding to iterator implementation.
* Allow one slot in RestartLastVotedForkSlots.
* Various simplifications.
* Fix various errors and use customized error type.
* Various simplifications.
* Return error from push_get_restart_last_voted_fork_slots and
remove unnecessary constraints in to_slots.
* Allow 81k slots on RestartLastVotedForkSlots.
* Limit MAX_SLOTS to 65535 so we can go back to u16.
* Use u16::MAX instead of 65535.
* add a feature to disable rent collection
* fix a test
* fix a test
* rekey
* should collect rent
* Update runtime/src/bank/fee_distribution.rs
Co-authored-by: Brooks <brooks@prumo.org>
* expand tests to cover both rent collection disabled and enabled
* feedbacks
* reviews - move should collect rent check out of rent collector into bank
* enforce rent_epoch to u64:max when rent collection is disabled
* review feedbacks and fix a test
When rent fee collection is disabled, we won't collect rent for any account. If there are any rent paying accounts, their `rent_epoch` won't change too.
* revise comments
* update rent_epoch for rent exempted account
* rebase
* set rent_epoch in rent collection for rent exempted account
* revert test change
* don't assert
---------
Co-authored-by: HaoranYi <haoran.yi@solana.com>
Co-authored-by: Brooks <brooks@prumo.org>
* Create runtime-transaction crate to host transaction type for runtime that comes with metadata
* create separate structs for runtime in different state, add corresponding traits for transaction_meta
* share simple-vote checking code
* not to expose private fields to outside of sdk
---------
Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com>
#### Problem
The HotStorageReader does not have an API to obtain owners_address.
#### Summary of Changes
This PR adds HotStorageReader::get_owner_address().
#### Test Plan
A new unit-test is added to this PR.