global: snapshot

This commit is contained in:
nym21
2025-08-03 23:38:58 +02:00
parent f7aa9424db
commit a2f5704581
50 changed files with 818 additions and 704 deletions

View File

@@ -221,7 +221,7 @@ where
I: StoredRaw + StoredIndex + From<usize>,
T: StoredRaw,
{
let h = Height::from(u64::from(height_to_index.stamp()));
let h = Height::from(height_to_index.stamp());
if h.is_zero() {
None
} else if h + 1_u32 == starting_height {

View File

@@ -800,6 +800,10 @@ impl Indexer {
Ok(starting_indexes)
}
pub fn static_clone(&self) -> &'static Self {
Box::leak(Box::new(self.clone()))
}
}
#[derive(Debug)]

View File

@@ -443,7 +443,7 @@ impl Vecs {
pub fn flush(&mut self, height: Height) -> Result<()> {
self.mut_vecs()
.into_par_iter()
.try_for_each(|vec| vec.stamped_flush(Stamp::from(u64::from(height))))?;
.try_for_each(|vec| vec.stamped_flush(Stamp::from(height)))?;
Ok(())
}
@@ -451,7 +451,7 @@ impl Vecs {
self.mut_vecs()
.into_iter()
.map(|vec| {
let h = Height::from(u64::from(vec.stamp()));
let h = Height::from(vec.stamp());
if h > Height::ZERO { h.incremented() } else { h }
})
.min()