Skip to main content

Replica

Struct Replica 

Source
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

Source

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.

Source

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.

Source

pub fn recover<J: Journal, A: Authentication>( context: Context, validator: &str, limits: Limits, journal: &J, auth: &A, ) -> Result<Self>

Source

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.

Source

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.

Source

pub fn seal_evidence( &self, manifest: &VersionManifest, ) -> Result<Vec<RelayItem>>

Old holds/credits and their transitive ancestry are also required at seal.

Source

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.

Source

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.

Source

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.

Source

pub fn context(&self) -> &Context

Source

pub fn validator(&self) -> &str

Source

pub fn operation_act(&self, id: &str) -> Option<&Act>

Fetch retained evidence for relay. These getters never synthesize proofs.

Source

pub fn certificate(&self, kind: VoteKind, id: &str) -> Option<&Certificate>

Source

pub fn journal_sequence(&self) -> u64

Source

pub fn owned_root(&self, account: &str) -> Option<&str>

Certificate-derived mode; an untrusted manifest cannot activate ownership.

Source

pub fn version(&self, id: &str) -> Option<&DagVersion>

Validated metadata for relay; no synthetic certificates or winner selection.

Source

pub fn version_snapshot(&self, account: &str) -> Result<VersionSnapshot>

Complete immutable local history, including released and zero-cost IDs.

Source

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.

Source

pub fn receive_version<J: Journal, A: Authentication>( &mut self, version: DagVersion, journal: &mut J, auth: &A, ) -> Result<()>

Source

pub fn adopt_version<J: Journal, A: Authentication>( &mut self, id: &str, journal: &mut J, auth: &A, ) -> Result<()>

Source

pub fn record_owned_proposal<J: Journal, A: Authentication>( &mut self, request: OwnedSealRequest, journal: &mut J, auth: &A, ) -> Result<()>

Source

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.

Source

pub fn register<J: Journal, A: Authentication>( &mut self, act: Act, j: &mut J, a: &A, ) -> Result<()>

Source

pub fn receive<J: Journal, A: Authentication>( &mut self, c: Certificate, j: &mut J, a: &A, ) -> Result<()>

Source

pub fn prepare_operation<J: Journal, A: Authentication>( &mut self, id: &str, j: &mut J, a: &A, ) -> Result<SigningRequest>

Source

pub fn prepare_effects<J: Journal, A: Authentication>( &mut self, id: &str, j: &mut J, a: &A, ) -> Result<SigningRequest>

Source

pub fn prepare_cancel<J: Journal, A: Authentication>( &mut self, request: Vote, j: &mut J, a: &A, ) -> Result<SigningRequest>

Source

pub fn release<J: Journal, A: Authentication>( &mut self, id: &str, j: &mut J, a: &A, ) -> Result<()>

Source

pub fn active_epoch(&self, account: &str) -> Result<&str>

Source

pub fn finalized_view(&self) -> Result<FinalizedView>

Source

pub fn intend( &self, inst: &Instance<'_>, owner: &AgentKey, verb: &str, fields: BTreeMap<String, SExpr>, nonce: &str, ) -> Result<Message, Reject>

Source

pub fn fold_instance(&self, inst: &Instance<'_>) -> Result<Vec<(String, Value)>>

Auto Trait Implementations§

§

impl Forget for Replica

§

impl Freeze for Replica

§

impl Move for Replica

§

impl RefUnwindSafe for Replica

§

impl Send for Replica
where RawVecInner: Send, NodeRef<Owned, String, SExpr, LeafOrInternal>: Send, BoxRaw<(String, SExpr)>: Send, NodeRef<Owned, String, SetValZST, LeafOrInternal>: Send, BoxRaw<(String, SetValZST)>: Send, NodeRef<Owned, String, StepDecl, LeafOrInternal>: Send, BoxRaw<(String, StepDecl)>: Send, Arc<Node>: Send, NodeRef<Owned, String, BTreeSet<String>, LeafOrInternal>: Send, BoxRaw<(String, BTreeSet<String>)>: Send, BoxRaw<Definition>: Send, BoxRaw<Lift>: Send, BoxRaw<CounterRule>: Send, BoxRaw<Value>: Send, BoxRaw<Message>: Send, NodeRef<Owned, String, Resources, LeafOrInternal>: Send, BoxRaw<(String, Resources)>: Send, NodeRef<Owned, String, String, LeafOrInternal>: Send, BoxRaw<(String, String)>: Send, NodeRef<Owned, String, VersionManifest, LeafOrInternal>: Send, BoxRaw<(String, VersionManifest)>: Send, NodeRef<Owned, String, Operation, LeafOrInternal>: Send, BoxRaw<(String, Operation)>: Send, NodeRef<Owned, String, OwnedSealRequest, LeafOrInternal>: Send, BoxRaw<(String, OwnedSealRequest)>: Send, NodeRef<Owned, (VoteKind, String), Certificate, LeafOrInternal>: Send, BoxRaw<((VoteKind, String), Certificate)>: Send, NodeRef<Owned, String, DagVersion, LeafOrInternal>: Send, BoxRaw<(String, DagVersion)>: Send,

§

impl Sync for Replica
where RawVecInner: Sync, NodeRef<Owned, String, SExpr, LeafOrInternal>: Sync, BoxRaw<(String, SExpr)>: Sync, NodeRef<Owned, String, SetValZST, LeafOrInternal>: Sync, BoxRaw<(String, SetValZST)>: Sync, NodeRef<Owned, String, StepDecl, LeafOrInternal>: Sync, BoxRaw<(String, StepDecl)>: Sync, Arc<Node>: Sync, NodeRef<Owned, String, BTreeSet<String>, LeafOrInternal>: Sync, BoxRaw<(String, BTreeSet<String>)>: Sync, BoxRaw<Definition>: Sync, BoxRaw<Lift>: Sync, BoxRaw<CounterRule>: Sync, BoxRaw<Value>: Sync, BoxRaw<Message>: Sync, NodeRef<Owned, String, Resources, LeafOrInternal>: Sync, BoxRaw<(String, Resources)>: Sync, NodeRef<Owned, String, String, LeafOrInternal>: Sync, BoxRaw<(String, String)>: Sync, NodeRef<Owned, String, VersionManifest, LeafOrInternal>: Sync, BoxRaw<(String, VersionManifest)>: Sync, NodeRef<Owned, String, Operation, LeafOrInternal>: Sync, BoxRaw<(String, Operation)>: Sync, NodeRef<Owned, String, OwnedSealRequest, LeafOrInternal>: Sync, BoxRaw<(String, OwnedSealRequest)>: Sync, NodeRef<Owned, (VoteKind, String), Certificate, LeafOrInternal>: Sync, BoxRaw<((VoteKind, String), Certificate)>: Sync, NodeRef<Owned, String, DagVersion, LeafOrInternal>: Sync, BoxRaw<(String, DagVersion)>: Sync,

§

impl Unpin for Replica
where *const u8 is !null: Unpin, *const LeafNode<String, SExpr> is !null: Unpin, Box<(String, SExpr)>: Unpin, *const LeafNode<String, SetValZST> is !null: Unpin, Box<(String, SetValZST)>: Unpin, *const LeafNode<String, StepDecl> is !null: Unpin, Box<(String, StepDecl)>: Unpin, Arc<Node>: Unpin, *const LeafNode<String, BTreeSet<String>> is !null: Unpin, Box<(String, BTreeSet<String>)>: Unpin, Box<Definition>: Unpin, Box<Lift>: Unpin, Box<CounterRule>: Unpin, Box<Value>: Unpin, Box<Message>: Unpin, *const LeafNode<String, Resources> is !null: Unpin, Box<(String, Resources)>: Unpin, *const LeafNode<String, String> is !null: Unpin, Box<(String, String)>: Unpin, *const LeafNode<String, VersionManifest> is !null: Unpin, Box<(String, VersionManifest)>: Unpin, *const LeafNode<String, Operation> is !null: Unpin, Box<(String, Operation)>: Unpin, *const LeafNode<String, OwnedSealRequest> is !null: Unpin, Box<(String, OwnedSealRequest)>: Unpin, *const LeafNode<(VoteKind, String), Certificate> is !null: Unpin, Box<((VoteKind, String), Certificate)>: Unpin, *const LeafNode<String, DagVersion> is !null: Unpin, Box<(String, DagVersion)>: Unpin,

§

impl UnsafeUnpin for Replica
where *const u8 is !null: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin, *const LeafNode<String, SExpr> is !null: UnsafeUnpin, PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin, PhantomData<Box<(String, SExpr)>>: UnsafeUnpin, PhantomData<String>: UnsafeUnpin, PhantomData<PerformativeDef>: UnsafeUnpin, PhantomData<SExpr>: UnsafeUnpin, *const LeafNode<String, StepDecl> is !null: UnsafeUnpin, PhantomData<Box<(String, StepDecl)>>: UnsafeUnpin, PhantomData<ShapeConstraint>: UnsafeUnpin, PhantomData<RoleDecl>: UnsafeUnpin, *const LeafNode<String, BTreeSet<String>> is !null: UnsafeUnpin, PhantomData<Box<(String, BTreeSet<String>)>>: UnsafeUnpin, PhantomData<Entry>: UnsafeUnpin, PhantomData<Act>: UnsafeUnpin, *const LeafNode<String, Resources> is !null: UnsafeUnpin, PhantomData<Box<(String, Resources)>>: UnsafeUnpin, *const LeafNode<String, String> is !null: UnsafeUnpin, PhantomData<Box<(String, String)>>: UnsafeUnpin, *const LeafNode<String, VersionManifest> is !null: UnsafeUnpin, PhantomData<Box<(String, VersionManifest)>>: UnsafeUnpin, *const LeafNode<String, SetValZST> is !null: UnsafeUnpin, PhantomData<Box<(String, SetValZST)>>: UnsafeUnpin, *const LeafNode<String, Operation> is !null: UnsafeUnpin, PhantomData<Box<(String, Operation)>>: UnsafeUnpin, *const LeafNode<String, OwnedSealRequest> is !null: UnsafeUnpin, PhantomData<Box<(String, OwnedSealRequest)>>: UnsafeUnpin, *const LeafNode<(VoteKind, String), Certificate> is !null: UnsafeUnpin, PhantomData<Box<((VoteKind, String), Certificate)>>: UnsafeUnpin, *const LeafNode<String, DagVersion> is !null: UnsafeUnpin, PhantomData<Box<(String, DagVersion)>>: UnsafeUnpin,

§

impl UnwindSafe for Replica

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<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> 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.