MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / load_frozen_envelopes

Function load_frozen_envelopes

libatomic/src/daemon/provenance_core.rs:287–318  ·  view source on GitHub ↗

Load the whole frozen journal by paging through it with strict continuity validation. This is the in-process counterpart of the wire sink's paged loop (the daemon's journal sink reuses it directly).

(
    store: &RedbChangeStore,
    id: ProvenanceId,
    attempt_generation: u64,
    frozen_event_count: u64,
)

Source from the content-addressed store, hash-verified

285/// continuity validation. This is the in-process counterpart of the wire
286/// sink's paged loop (the daemon's journal sink reuses it directly).
287pub fn load_frozen_envelopes(
288 store: &RedbChangeStore,
289 id: ProvenanceId,
290 attempt_generation: u64,
291 frozen_event_count: u64,
292) -> Result<Vec<Vec<u8>>, JournalError> {
293 let mut cursor = FrozenProvenanceCursor::default();
294 let mut envelopes = Vec::new();
295 let mut partial = Vec::new();
296 while cursor.seq < frozen_event_count {
297 let page = load_frozen_page(
298 store,
299 id,
300 attempt_generation,
301 frozen_event_count,
302 cursor,
303 None,
304 )?;
305 append_frozen_page(
306 &mut envelopes,
307 &mut partial,
308 &mut cursor,
309 frozen_event_count,
310 page,
311 )
312 .map_err(|message| JournalError {
313 code: ErrorCode::ProvenanceCheckpoint,
314 message,
315 })?;
316 }
317 Ok(envelopes)
318}
319
320/// Bind the prepared graph hash and exact immutable session turn once.
321pub fn bind_checkpoint_hash(

Callers

nothing calls this directly

Calls 2

load_frozen_pageFunction · 0.85
append_frozen_pageFunction · 0.70

Tested by

no test coverage detected