pub struct GrindingBudget { /* private fields */ }Expand description
The difficulty the security model credits at every site of one parameter set.
A FRI-backed protocol splits its grinding across two carriers, and this joins them.
the STARK's own sites -> out-of-domain, batch-combination, lookup-challenge
the FRI regime -> ldt-commit-phase, ldt-query-phaseThe composite boosts the first three.
The low-degree test folds the last two into its own terms.
Implementations§
Source§impl GrindingBudget
impl GrindingBudget
Sourcepub const fn from_sites(sites: &GrindingSites) -> Self
pub const fn from_sites(sites: &GrindingSites) -> Self
The three sites a STARK declares, with the low-degree test’s own two at zero.
Fill those two in afterwards from the low-degree test’s regime.
Sourcepub const fn with_fri(self, ldt: &FriRegime) -> Self
pub const fn with_fri(self, ldt: &FriRegime) -> Self
Fill in the two sites a FRI low-degree test owns.
The commit-phase grind repeats once per folding round, at one difficulty.
The commit-phase error term credits that difficulty once, which is the conservative reading.
Sourcepub const fn bits(&self, site: GrindingSite) -> usize
pub const fn bits(&self, site: GrindingSite) -> usize
Bits credited at one site.
Sourcepub fn check(
&self,
protocols: &[&str],
recorded: &[RecordedGrind],
) -> Result<(), GrindingMismatch>
pub fn check( &self, protocols: &[&str], recorded: &[RecordedGrind], ) -> Result<(), GrindingMismatch>
Check the difficulties a transcript records against the ones this budget credits.
protocols names the transcripts recorded was read from.
Without it, a step the model credits and no transcript describes would be indistinguishable from a protocol that is simply not in the stack.
A grind repeated once per round appears once per round in recorded.
Every occurrence has to carry the credited difficulty.
§Errors
Returns the first disagreement found, naming the site and both numbers.
Trait Implementations§
Source§impl Clone for GrindingBudget
impl Clone for GrindingBudget
impl Copy for GrindingBudget
Source§impl Debug for GrindingBudget
impl Debug for GrindingBudget
impl Eq for GrindingBudget
Source§impl PartialEq for GrindingBudget
impl PartialEq for GrindingBudget
impl StructuralPartialEq for GrindingBudget
Auto Trait Implementations§
impl Freeze for GrindingBudget
impl RefUnwindSafe for GrindingBudget
impl Send for GrindingBudget
impl Sync for GrindingBudget
impl Unpin for GrindingBudget
impl UnsafeUnpin for GrindingBudget
impl UnwindSafe for GrindingBudget
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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