mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-23 06:44:35 +00:00
New state pruning algorithm
This commit is contained in:
@@ -75,6 +75,15 @@ pub trait KeyValueStore<E: EthSpec>: Sync + Send + Sized + 'static {
|
||||
|
||||
/// Compact the database, freeing space used by deleted items.
|
||||
fn compact(&self) -> Result<(), Error>;
|
||||
|
||||
/// Iterate through all values in a particular column.
|
||||
fn iter_column<'a>(
|
||||
&'a self,
|
||||
_column: DBColumn,
|
||||
) -> Box<dyn Iterator<Item = Result<(Hash256, Vec<u8>), Error>> + 'a> {
|
||||
// Default impl for non LevelDB databases
|
||||
Box::new(std::iter::empty())
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_key_for_col(column: &str, key: &[u8]) -> Vec<u8> {
|
||||
@@ -144,6 +153,7 @@ pub enum StoreOp<'a, E: EthSpec> {
|
||||
DeleteStateTemporaryFlag(Hash256),
|
||||
DeleteBlock(Hash256),
|
||||
DeleteState(Hash256, Option<Slot>),
|
||||
KeyValueOp(KeyValueStoreOp),
|
||||
}
|
||||
|
||||
/// A unique column identifier.
|
||||
|
||||
Reference in New Issue
Block a user