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
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,
§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<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
fn into_tuple(self) -> Dest
§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.