v1.1: Eager rent collection (#10028)
* Introduce eager rent collection (#9527)
* Switch AccountsIndex.account_maps from HashMap to BTreeMap
* Introduce eager rent collection
* Start to add tests
* Avoid too short eager rent collection cycles
* Add more tests
* Add more tests...
* Refacotr!!!!!!
* Refactoring follow up
* More tiny cleanups
* Don't rewrite 0-lamport accounts to be deterministic
* Refactor a bit
* Do hard fork, restore tests, and perf. mitigation
* Fix build...
* Refactor and add switch over for testnet (TdS)
* Use to_be_bytes
* cleanup
* More tiny cleanup
* Rebase cleanup
* Set Bank::genesis_hash when resuming from snapshot
* Reorder fns and clean ups
* Better naming and commenting
* Yet more naming clarifications
* Make prefix width strictly uniform for 2-base partition_count
* Fix typo...
* Revert cluster-dependent gate
* kick ci?
* kick ci?
* kick ci?
(cherry picked from commit 1eb40c3fe0
)
# Conflicts:
# core/tests/bank_forks.rs
# ledger/src/bank_forks_utils.rs
# ledger/src/snapshot_utils.rs
# runtime/src/bank.rs
* Fix merge conflicts
* Add gating
* Add Danger comment...
* Delay activation epoch
* Add gating for stable as well
* fmt...
* fmt!!!!
This commit is contained in:
@@ -85,6 +85,12 @@ pub type Segment = u64;
|
||||
/// some number of Slots.
|
||||
pub type Epoch = u64;
|
||||
|
||||
/// SlotIndex is an index to the slots of a epoch
|
||||
pub type SlotIndex = u64;
|
||||
|
||||
/// SlotCount is the number of slots in a epoch
|
||||
pub type SlotCount = u64;
|
||||
|
||||
/// UnixTimestamp is an approximate measure of real-world time,
|
||||
/// expressed as Unix time (ie. seconds since the Unix epoch)
|
||||
pub type UnixTimestamp = i64;
|
||||
|
@@ -78,6 +78,14 @@ impl Hash {
|
||||
pub fn new(hash_slice: &[u8]) -> Self {
|
||||
Hash(<[u8; HASH_BYTES]>::try_from(hash_slice).unwrap())
|
||||
}
|
||||
|
||||
pub const fn new_from_array(hash_array: [u8; HASH_BYTES]) -> Self {
|
||||
Self(hash_array)
|
||||
}
|
||||
|
||||
pub fn to_bytes(self) -> [u8; HASH_BYTES] {
|
||||
self.0
|
||||
}
|
||||
}
|
||||
|
||||
/// Return a Sha256 hash for the given data.
|
||||
|
Reference in New Issue
Block a user