global: adding support for safe lengths

This commit is contained in:
nym21
2026-05-06 15:33:07 +02:00
parent da7671744f
commit 086bfd9938
177 changed files with 2445 additions and 2049 deletions
@@ -1,25 +1,20 @@
use brk_error::Result;
use brk_indexer::Indexer;
use brk_types::{Indexes, StoredU32};
use brk_types::StoredU32;
use vecdb::Exit;
use super::Vecs;
impl Vecs {
pub(crate) fn compute(
&mut self,
indexer: &Indexer,
starting_indexes: &Indexes,
exit: &Exit,
) -> Result<()> {
// Block count raw + cumulative
pub(crate) fn compute(&mut self, indexer: &Indexer, exit: &Exit) -> Result<()> {
let starting_height = indexer.safe_lengths().height;
self.total.block.compute_range(
starting_indexes.height,
starting_height,
&indexer.vecs.blocks.weight,
|h| (h, StoredU32::from(1_u32)),
exit,
)?;
self.total.compute_rest(starting_indexes.height, exit)?;
self.total.compute_rest(starting_height, exit)?;
Ok(())
}