pub struct PotVerifier { /* private fields */ }
Expand description
Verifier data structure that verifies and caches results of PoT verification
Implementations§
source§impl PotVerifier
impl PotVerifier
pub fn new(genesis_seed: PotSeed, cache_size: u32) -> Self
sourcepub fn inject_verified_checkpoints(
&self,
seed: PotSeed,
slot_iterations: NonZeroU32,
checkpoints: PotCheckpoints,
)
pub fn inject_verified_checkpoints( &self, seed: PotSeed, slot_iterations: NonZeroU32, checkpoints: PotCheckpoints, )
Inject known good checkpoints into verifier
sourcepub fn genesis_seed(&self) -> PotSeed
pub fn genesis_seed(&self) -> PotSeed
Get genesis seed
sourcepub fn get_checkpoints(
&self,
slot_iterations: NonZeroU32,
seed: PotSeed,
) -> Option<PotCheckpoints>
pub fn get_checkpoints( &self, slot_iterations: NonZeroU32, seed: PotSeed, ) -> Option<PotCheckpoints>
Try to get checkpoints for provided seed and slot iterations, returns None
if proving
fails internally.
sourcepub fn try_get_checkpoints(
&self,
slot_iterations: NonZeroU32,
seed: PotSeed,
) -> Option<PotCheckpoints>
pub fn try_get_checkpoints( &self, slot_iterations: NonZeroU32, seed: PotSeed, ) -> Option<PotCheckpoints>
Try to get checkpoints quickly without waiting for potentially locked mutex or proving
sourcepub fn is_output_valid(
&self,
input: PotNextSlotInput,
slots: Slot,
output: PotOutput,
maybe_parameters_change: Option<PotParametersChange>,
) -> bool
pub fn is_output_valid( &self, input: PotNextSlotInput, slots: Slot, output: PotOutput, maybe_parameters_change: Option<PotParametersChange>, ) -> bool
Verify sequence of proofs of time that covers slots
slots starting at slot
with provided
initial seed
.
In case maybe_parameters_change
is present, it will not affect provided seed
and
slot_iterations
, meaning if parameters change occurred at slot
, provided seed
and
slot_iterations
must already account for that.
NOTE: Potentially much slower than checkpoints, prefer Self::verify_checkpoints()
whenever possible.
sourcepub fn try_is_output_valid(
&self,
input: PotNextSlotInput,
slots: Slot,
output: PotOutput,
maybe_parameters_change: Option<PotParametersChange>,
) -> bool
pub fn try_is_output_valid( &self, input: PotNextSlotInput, slots: Slot, output: PotOutput, maybe_parameters_change: Option<PotParametersChange>, ) -> bool
Does the same verification as Self::is_output_valid()
except it relies on proofs being
pre-validated before and will return false
in case proving is necessary, this is meant to
be a quick and cheap version of the function.
sourcepub fn verify_checkpoints(
&self,
seed: PotSeed,
slot_iterations: NonZeroU32,
checkpoints: &PotCheckpoints,
) -> bool
pub fn verify_checkpoints( &self, seed: PotSeed, slot_iterations: NonZeroU32, checkpoints: &PotCheckpoints, ) -> bool
Verify proof of time checkpoints
Trait Implementations§
source§impl Clone for PotVerifier
impl Clone for PotVerifier
source§fn clone(&self) -> PotVerifier
fn clone(&self) -> PotVerifier
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for PotVerifier
impl !RefUnwindSafe for PotVerifier
impl Send for PotVerifier
impl Sync for PotVerifier
impl Unpin for PotVerifier
impl !UnwindSafe for PotVerifier
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
§fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
§fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
T
. Read more§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from
.§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T
.