Skip to main content

CheckpointRunner

Struct CheckpointRunner 

Source
pub struct CheckpointRunner<B: ?Sized, S> { /* private fields */ }
Expand description

Advances durable CLL state when its host runs it (Go checkpoint.Runner).

B is the store, shared in an Arc so a DeliveryRunner can use the same one; S signs the checkpoints, and its key_id must be the hex raw Ed25519 public key, which becomes each statement’s kid. Passes are serialized: one runner never runs two at once.

Implementations§

Source§

impl<B, S> CheckpointRunner<B, S>

Source

pub fn new(config: RunnerConfig, store: Arc<B>, signer: S) -> Result<Self>

Validates config without starting background work: an invalid log or witness identifier, scan limit, cadence or poll interval, more than MAX_WITNESSES witnesses or a repeated one is invalid.

Source

pub fn config(&self) -> &RunnerConfig

The configuration.

Source

pub fn notify(&self)

Wakes a running run loop without blocking the caller.

Source

pub fn run(&self, stop: &AtomicBool) -> Result<()>

Catches up until stop is set, then waits for notify or the poll interval. Contention is retried on the next wakeup; any other error ends the loop. To stop promptly, set stop and then call notify.

Source

pub fn run_once(&self, now: Timestamp) -> Result<bool>

Advances durable state by at most one entry scan batch at now. Returns true when it commits nodes, a checkpoint, or both. A stored state whose MMR, indexed sequence or checkpoint is inconsistent, or whose checkpoint does not verify under this log and key, is corrupt; a lost compare-and-set is contention.

Source

pub fn catch_up(&self, now: Timestamp) -> Result<()>

Runs passes until one commits nothing, all at the one time now, so every checkpoint it signs shares one evaluation time. Contention reloads the state once; contention again right after the reload is returned.

Auto Trait Implementations§

§

impl<B, S> !Freeze for CheckpointRunner<B, S>

§

impl<B, S> Forget for CheckpointRunner<B, S>
where B: ?Sized,

§

impl<B, S> Move for CheckpointRunner<B, S>
where B: ?Sized,

§

impl<B, S> RefUnwindSafe for CheckpointRunner<B, S>
where Arc<B>: RefUnwindSafe, S: RefUnwindSafe, B: ?Sized,

§

impl<B, S> Send for CheckpointRunner<B, S>
where Arc<B>: Send, S: Send, B: ?Sized,

§

impl<B, S> Sync for CheckpointRunner<B, S>
where Arc<B>: Sync, S: Sync, B: ?Sized,

§

impl<B, S> Unpin for CheckpointRunner<B, S>
where Arc<B>: Unpin, S: Unpin, B: ?Sized,

§

impl<B, S> UnsafeUnpin for CheckpointRunner<B, S>
where Arc<B>: UnsafeUnpin, S: UnsafeUnpin, B: ?Sized,

§

impl<B, S> UnwindSafe for CheckpointRunner<B, S>
where Arc<B>: UnwindSafe, S: UnwindSafe, B: ?Sized,

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.