Skip to main content

ProofReplayStore

Trait ProofReplayStore 

Source
pub trait ProofReplayStore: Send + Sync {
    // Required methods
    fn domain_guarantee(&self) -> ReplayDomainGuarantee;
    fn check_and_insert(
        &self,
        partition: ProofDisposition,
        key: &ProofReplayKey,
        expires_at: u64,
    ) -> ProofAdmissionResult;

    // Provided methods
    fn owns_namespace(&self, signer_thumbprint: &[u8; 32]) -> bool { ... }
    fn check_and_insert_mediated(
        &self,
        _key: &MediatedQueryReplayKey,
        _expires_at: u64,
    ) -> ProofAdmissionResult { ... }
    fn check_and_insert_credential(
        &self,
        _key: &CredentialReplayKey,
        _expires_at: u64,
    ) -> ProofAdmissionResult { ... }
}
Expand description

Proof replay admission store.

Implementations are the substrate (in-process for a single verifier, or a shared linearizable backend); this trait is the only admission surface.

Required Methods§

Source

fn domain_guarantee(&self) -> ReplayDomainGuarantee

Which domain-wide guarantee this deployment provides. Dispatch refuses to admit under a guarantee the store cannot honour for the key at hand.

Source

fn check_and_insert( &self, partition: ProofDisposition, key: &ProofReplayKey, expires_at: u64, ) -> ProofAdmissionResult

Atomically admit a fresh key or reject a replay, within the partition for partition. Capacity pressure MUST NOT evict an unexpired accepted record: the partition fails closed instead.

Provided Methods§

Source

fn owns_namespace(&self, signer_thumbprint: &[u8; 32]) -> bool

Whether this node owns the replay namespace for signer_thumbprint.

Only consulted under ReplayDomainGuarantee::NamespaceAffineRouting, where a node that does not own the namespace holds none of its history and MUST deny rather than admit. The other guarantees own every namespace by construction.

Source

fn check_and_insert_mediated( &self, _key: &MediatedQueryReplayKey, _expires_at: u64, ) -> ProofAdmissionResult

Dedicated mediated-query domain. Backends that do not implement this atomic admission deny; they must never silently reuse dispatch keys.

Source

fn check_and_insert_credential( &self, _key: &CredentialReplayKey, _expires_at: u64, ) -> ProofAdmissionResult

Atomically consume one verified source credential through its expiry. Backends that do not provide a separate shared credential partition deny rather than alias it into proof-request replay state.

Implementors§