#### Summary of Changes
This PR implements AccountIndexFormat::AddressAndOffset, the index format
that will be used by the hot account storage.
#### Test Plan
Unit tests are included in this PR.
Tested via the prototype implementation of tiered-storage.
#### Problem
`TieredAccountMeta` has default impls on many of its methods. But I don't think it should, because these defaults are not actually useful defaults (i.e. they are `unimplemented!()`).
We're only going to have a small number of structs that'll implement this trait, and each struct should be responsible for picking the correct impl for each method.
Currently, `HotAccountMeta` is the only one, and it implements every method.
#### Summary of Changes
Remove default impls on TieredAccountMeta
* update max reward block factor
* review comments
* more tests
* reduce the number of stakes per block to speed up tests
---------
Co-authored-by: HaoranYi <haoran.yi@solana.com>
#### Problem
While TieredReadableAccount implements ReadableAccount that
already includes `fn data(&self) -> &'a [u8]`, a `data()` function that
directly under TieredReadableAccount is still needed in order to
correctly link the lifetime of the returned value and its member
account_block. Otherwise, cargo will complain lifetime may not
live long enough.
#### Summary of Changes
This PR adds TieredReadableAccount::data() that directly links the lifetime
of its account_block to the returned value.
* Test rewards compuation and partitioned rewards distribution at the epoch boundary
* reviews
* match to if
* clippy
* peeling of bank1 from the loop
* collapse if_same
---------
Co-authored-by: HaoranYi <haoran.yi@solana.com>
* Move CostModel and CostTracker to its own crate
* compile new crate and update imports
* update sbf Cargo.lock
* fix AbiExample
* fix cargo sort
* Fix AbiExample
#### Problem
Both AppendVec::cloned_account() and ReadableAccount::to_account_shard_data()
returns an AccountSharedData instance by cloning itself as pointed out under
a comment in PR #32380.
#### Summary of Changes
This PR removes AccountsFile::cloned_account() and replaces its call-sites by
ReadableAccount::to_account_shared_data().
#### Summary of Changes
This PR introduces TieredReadableAccount, a struct that takes a generic
TieredAccountMeta that implements ReadableAccount and support
StoredAccountMeta.
#### Test Plan
More tests will be added once more reader and writer functions for hot
accounts have been added.
#### Problem
In TieredAccountMeta, it uses `data` and `account_data` to refer to
the data associated with the account, and this could be confusing.
#### Summary of Changes
This PR makes TieredAccountMeta only use `account_data` to refer
to the data associated with the account.