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.
#### Problem
#34032 mentioned nice-to-have a formatting improvement that
can improve the readability.
#### Summary of Changes
Improve the code formatting in test_hot_storage_get_account_offset_and_address().
reserve(additional) reserves additional bytes on top of the current _length_
not capacity. Before this fix we could potentially reserve less capacity than
required.
#### Problem
A TieredStorage file has three types of block: accounts block, index block,
and owner block, but implementation of the TieredStorage OwnersBlock
is missing in the current master.
#### Summary of Changes
This PR implements OwnersBlock which stores a set of owners' addresses
in a compact but efficient way.
#### Test Plan
A new unit-test is included in this PR.