pub struct Replica { /* private fields */ }Expand description
One validator’s independent state machine. Each mutation is journaled before exposing a decision to the signer. There is no shared reservation authority.
Implementations§
Source§impl Replica
impl Replica
Sourcepub fn commit_group<J: BatchJournal, A: Authentication>(
&mut self,
events: &[Event],
journal: &mut J,
auth: &A,
) -> Result<Vec<Option<SigningRequest>>>
pub fn commit_group<J: BatchJournal, A: Authentication>( &mut self, events: &[Event], journal: &mut J, auth: &A, ) -> Result<Vec<Option<SigningRequest>>>
Validate a bounded group using the ordinary guards, then persist it with one durability barrier. No signing request escapes before that barrier. On validation/CAS failure state is unchanged. Retries emit no log event. Only candidate/certificate/sign/effect transitions are supported; DAG adoption, cancellation fencing and release retain their serial API.
Sourcepub fn initialize<J: Journal>(
context: Context,
validator: &str,
limits: Limits,
journal: &mut J,
) -> Result<Self>
pub fn initialize<J: Journal>( context: Context, validator: &str, limits: Limits, journal: &mut J, ) -> Result<Self>
Creates a log exactly once. An existing identity must use recover.
pub fn recover<J: Journal, A: Authentication>( context: Context, validator: &str, limits: Limits, journal: &J, auth: &A, ) -> Result<Self>
Sourcepub fn catch_up_owned<J: Journal, A: Authentication>(
&mut self,
target: &str,
journal: &mut J,
auth: &A,
) -> Result<()>
pub fn catch_up_owned<J: Journal, A: Authentication>( &mut self, target: &str, journal: &mut J, auth: &A, ) -> Result<()>
Apply ordinary adoption events, retaining durable prefix progress on IO failure. This is a retryable multi-event service, not an atomic transaction.
Sourcepub fn publication(&self, act: &Act) -> Result<Publication>
pub fn publication(&self, act: &Act) -> Result<Publication>
Export the transitive verified dependency closure, deduplicated by identity. Host transport must attach each Act’s actual authentication envelope.
Sourcepub fn seal_evidence(
&self,
manifest: &VersionManifest,
) -> Result<Vec<RelayItem>>
pub fn seal_evidence( &self, manifest: &VersionManifest, ) -> Result<Vec<RelayItem>>
Old holds/credits and their transitive ancestry are also required at seal.
Sourcepub fn prepare_seal_publication<J: Journal, A: Authentication>(
&mut self,
publication: &SealPublication,
journal: &mut J,
auth: &A,
) -> Result<PublicationResult>
pub fn prepare_seal_publication<J: Journal, A: Authentication>( &mut self, publication: &SealPublication, journal: &mut J, auth: &A, ) -> Result<PublicationResult>
Seal preparation uses the same retry closure; a lagging honest validator must not need a Byzantine sender to supply the old effects certificates.
Sourcepub fn receive_evidence<J: Journal, A: Authentication>(
&mut self,
items: &[RelayItem],
journal: &mut J,
auth: &A,
) -> Result<RelayReport>
pub fn receive_evidence<J: Journal, A: Authentication>( &mut self, items: &[RelayItem], journal: &mut J, auth: &A, ) -> Result<RelayReport>
Import peer-retained proofs without making any local voting decision. This is also the owner-side path for feedback certificates. Individual accepted journal events remain durable if a later append fails.
Sourcepub fn prepare_publication<J: Journal, A: Authentication>(
&mut self,
publication: &Publication,
journal: &mut J,
auth: &A,
) -> Result<PublicationResult>
pub fn prepare_publication<J: Journal, A: Authentication>( &mut self, publication: &Publication, journal: &mut J, auth: &A, ) -> Result<PublicationResult>
Retry public evidence to a finite fixed point, using ordinary guards and individually atomic journal events. Accepted prefix progress survives errors. No signing request escapes a failed journal append. Pending is not success.
pub fn context(&self) -> &Context
pub fn validator(&self) -> &str
Sourcepub fn operation_act(&self, id: &str) -> Option<&Act>
pub fn operation_act(&self, id: &str) -> Option<&Act>
Fetch retained evidence for relay. These getters never synthesize proofs.
pub fn certificate(&self, kind: VoteKind, id: &str) -> Option<&Certificate>
pub fn journal_sequence(&self) -> u64
Sourcepub fn owned_root(&self, account: &str) -> Option<&str>
pub fn owned_root(&self, account: &str) -> Option<&str>
Certificate-derived mode; an untrusted manifest cannot activate ownership.
Sourcepub fn version(&self, id: &str) -> Option<&DagVersion>
pub fn version(&self, id: &str) -> Option<&DagVersion>
Validated metadata for relay; no synthetic certificates or winner selection.
Sourcepub fn version_snapshot(&self, account: &str) -> Result<VersionSnapshot>
pub fn version_snapshot(&self, account: &str) -> Result<VersionSnapshot>
Complete immutable local history, including released and zero-cost IDs.
Sourcepub fn draft_version(
&self,
parents: &BTreeSet<String>,
held: &BTreeSet<String>,
refunds: &BTreeSet<String>,
credits: &BTreeSet<String>,
) -> Result<VersionManifest>
pub fn draft_version( &self, parents: &BTreeSet<String>, held: &BTreeSet<String>, refunds: &BTreeSet<String>, credits: &BTreeSet<String>, ) -> Result<VersionManifest>
Compute unique cumulative books. The caller externally authorizes the result; receipt verifies all prerequisites independently.
pub fn receive_version<J: Journal, A: Authentication>( &mut self, version: DagVersion, journal: &mut J, auth: &A, ) -> Result<()>
pub fn adopt_version<J: Journal, A: Authentication>( &mut self, id: &str, journal: &mut J, auth: &A, ) -> Result<()>
pub fn record_owned_proposal<J: Journal, A: Authentication>( &mut self, request: OwnedSealRequest, journal: &mut J, auth: &A, ) -> Result<()>
Sourcepub fn prepare_owned_seal<J: Journal, A: Authentication>(
&mut self,
request: OwnedSealRequest,
journal: &mut J,
auth: &A,
) -> Result<SigningRequest>
pub fn prepare_owned_seal<J: Journal, A: Authentication>( &mut self, request: OwnedSealRequest, journal: &mut J, auth: &A, ) -> Result<SigningRequest>
Journal the unique permanent seal before exposing a validator vote.