mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-17 12:58:31 +00:00
Improve freezer DB efficiency with periodic restore points (#649)
* Draft of checkpoint freezer DB * Fix bugs * Adjust root iterators for checkpoint database * Fix freezer state lookups with no slot hint * Fix split comment * Use "restore point" to refer to frozen states * Resolve some FIXMEs * Configurable slots per restore point * Document new freezer DB functions * Fix up StoreConfig * Fix new test for merge * Document SPRP default CLI flag, clarify tests
This commit is contained in:
committed by
Paul Hauner
parent
5a765396b7
commit
d0319320ce
@@ -576,6 +576,14 @@ impl<T: EthSpec> BeaconState<T> {
|
||||
Ok(&self.state_roots[i])
|
||||
}
|
||||
|
||||
/// Gets the oldest (earliest slot) block root.
|
||||
///
|
||||
/// Spec v0.9.1
|
||||
pub fn get_oldest_block_root(&self) -> Result<&Hash256, Error> {
|
||||
let i = self.get_latest_block_roots_index(self.slot - self.block_roots.len() as u64)?;
|
||||
Ok(&self.block_roots[i])
|
||||
}
|
||||
|
||||
/// Sets the latest state root for slot.
|
||||
///
|
||||
/// Spec v0.9.1
|
||||
|
||||
Reference in New Issue
Block a user