Skip to main content

PoolMigrationAuditStore

Struct PoolMigrationAuditStore 

Source
pub struct PoolMigrationAuditStore { /* private fields */ }
Expand description

Durable, provenance-separated source reconciliation and target body proofs.

A source entry means root independently observed the exact source key and a terminal Stored target catalog location whose catalog supplied the size. It is not a source-body or target-body proof. A target entry means the target body was independently hash-verified. The root controller owns the writable instance. Workers open it read-only.

Implementations§

Source§

impl PoolMigrationAuditStore

Source

pub fn open(path: &Path, binding: Hash) -> Result<Self, StoreError>

Source

pub fn open_read_only(path: &Path, binding: Hash) -> Result<Self, StoreError>

Source

pub fn path(&self) -> &Path

Source

pub fn binding(&self) -> Hash

Source

pub fn contains_source_reconciled_exact_sorted( &self, candidates: &[(Hash, u64)], ) -> Result<Vec<bool>, StoreError>

Return whether each sorted source candidate already has an exact durable hash/size reconciliation. A conflicting size is corruption, never a cache miss.

Source

pub fn contains_target_exact_sorted( &self, candidates: &[(Hash, u64)], ) -> Result<Vec<bool>, StoreError>

Source

pub fn record_reconciled_source( &self, entries: &[(Hash, u64)], ) -> Result<(), StoreError>

Root-commit exact source-to-target catalog reconciliations.

These entries deliberately do not enter target_verified: the exhaustive target audit must still read and hash every target body.

Source

pub fn begin_target_fenced_epoch( &self, fence_binding: Hash, ) -> Result<(), StoreError>

Start or resume the target-fenced certification epoch. Existing hash/size body proofs remain valid under Pool’s content-addressed, non-replacing write contract. The raw catalog cursor is reset on the first transition so every final catalog row is revisited under the exact held fence.

Source

pub fn target_fence_binding(&self) -> Result<Option<Hash>, StoreError>

Source

pub fn record_verified_target_page( &self, entries: &[(Hash, u64)], cursor: Hash, ) -> Result<(), StoreError>

Commit exact target content proofs and their raw catalog cursor in one force-synced transaction. The cursor can therefore never become durable ahead of the proofs that allowed it to advance.

Source

pub fn prepare_target_import(&self, authority: Hash) -> Result<bool, StoreError>

Prepare a quarantined import bound to the complete certification and evidence authority. Returns true when the caller must rebuild the staging database, or false when an authenticated promotion can be resumed (or has already completed).

Unauthenticated staging rows are never consulted by target queries or exports. A changed authority fails closed for the lifetime of this rollout-bound audit store.

Source

pub fn stage_target_import_entries( &self, authority: Hash, entries: &[(Hash, u64)], ) -> Result<(), StoreError>

Append exact hash/size rows to the untrusted quarantine. This never changes the target proof set visible to migration workers.

Source

pub fn authenticate_target_import( &self, authority: Hash, ) -> Result<(), StoreError>

Make a completely validated staging database eligible for promotion. The caller may invoke this only after authenticated EOF and exact receipt-summary validation. The marker and all prior staging batches are ordered by force-synced LMDB commits.

Source

pub fn promote_authenticated_target_import_batch( &self, authority: Hash, batch_size: usize, ) -> Result<bool, StoreError>

Promote at most one authenticated staging batch into the visible proof set. Returns true once promotion and quarantine cleanup are durable.

A crash can expose only a prefix whose complete source manifest was already authenticated. The promotion cursor and target writes share one LMDB transaction. Each promoted staging row is deleted in that same transaction, so promotion never needs a second full-size copy of the imported proof set. The authenticated marker makes destructive draining safe, while the cursor makes retries exact and idempotent.

Source

pub fn promoted_target_import_authority( &self, ) -> Result<Option<Hash>, StoreError>

Source

pub fn target_cursor(&self) -> Result<Option<Hash>, StoreError>

Source

pub fn reset_target_cursor(&self) -> Result<(), StoreError>

Source

pub fn for_each_source_reconciled_batch( &self, batch_size: usize, visit: impl FnMut(&[(Hash, u64)]) -> Result<(), StoreError>, ) -> Result<PoolMigrationAuditSummary, StoreError>

Stream every reconciled source hash/size record in canonical order.

Source

pub fn for_each_target_verified_batch( &self, batch_size: usize, visit: impl FnMut(&[(Hash, u64)]) -> Result<(), StoreError>, ) -> Result<PoolMigrationAuditSummary, StoreError>

Source

pub fn first_unreconciled_source_key( &self, source: &LmdbBlobReader, page_size: usize, ) -> Result<Option<Hash>, StoreError>

Find the first source key not covered by this durable set.

This scans only the authoritative raw blob keys. It never reads source values, metadata sizes, external file lengths, or payload bodies.

Source

pub fn first_unreconciled_source_key_parallel( &self, source: &LmdbBlobReader, page_size: usize, concurrency: usize, ) -> Result<Option<Hash>, StoreError>

Find the first source key not covered by this durable set using an ordered, coherent-snapshot parallel raw-key scan.

Only source keys are prefetched. LMDB values, metadata sizes, external file lengths, and payload bodies are never requested.

Source

pub fn validate_binding(&self) -> Result<(), StoreError>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V