Trait sp1_core::stark::MachineProver
source · pub trait MachineProver<SC: StarkGenericConfig, A: MachineAir<SC::Val>>: 'static + Send + Sync {
type Error: Error + Send + Sync;
// Required methods
fn new(machine: StarkMachine<SC, A>) -> Self;
fn machine(&self) -> &StarkMachine<SC, A>;
fn commit(&self, record: &A::Record) -> Com<SC>;
fn commit_and_open(
&self,
pk: &StarkProvingKey<SC>,
record: A::Record,
challenger: &mut SC::Challenger,
) -> Result<ShardProof<SC>, Self::Error>;
fn prove(
&self,
pk: &StarkProvingKey<SC>,
records: Vec<A::Record>,
challenger: &mut SC::Challenger,
opts: <A::Record as MachineRecord>::Config,
) -> Result<MachineProof<SC>, Self::Error>
where A: for<'a> Air<DebugConstraintBuilder<'a, Val<SC>, SC::Challenge>>;
// Provided methods
fn config(&self) -> &SC { ... }
fn num_pv_elts(&self) -> usize { ... }
fn shard_chips<'a, 'b>(
&'a self,
shard: &'b A::Record,
) -> impl Iterator<Item = &'b MachineChip<SC, A>>
where SC: 'b,
'a: 'b { ... }
fn setup(
&self,
program: &A::Program,
) -> (StarkProvingKey<SC>, StarkVerifyingKey<SC>) { ... }
fn update(
&self,
challenger: &mut SC::Challenger,
commitment: Com<SC>,
public_values: &[SC::Val],
) { ... }
fn debug_constraints(
&self,
pk: &StarkProvingKey<SC>,
records: Vec<A::Record>,
challenger: &mut SC::Challenger,
)
where SC::Val: PrimeField32,
A: for<'a> Air<DebugConstraintBuilder<'a, Val<SC>, SC::Challenge>> { ... }
}Required Associated Types§
Required Methods§
sourcefn new(machine: StarkMachine<SC, A>) -> Self
fn new(machine: StarkMachine<SC, A>) -> Self
Create a new prover from a given machine.
sourcefn machine(&self) -> &StarkMachine<SC, A>
fn machine(&self) -> &StarkMachine<SC, A>
A reference to the machine that this prover is using.
sourcefn commit(&self, record: &A::Record) -> Com<SC>
fn commit(&self, record: &A::Record) -> Com<SC>
Calculate the main commitment for a given record.
sourcefn commit_and_open(
&self,
pk: &StarkProvingKey<SC>,
record: A::Record,
challenger: &mut SC::Challenger,
) -> Result<ShardProof<SC>, Self::Error>
fn commit_and_open( &self, pk: &StarkProvingKey<SC>, record: A::Record, challenger: &mut SC::Challenger, ) -> Result<ShardProof<SC>, Self::Error>
Commit and generate a proof for a given record, using the given challenger.
sourcefn prove(
&self,
pk: &StarkProvingKey<SC>,
records: Vec<A::Record>,
challenger: &mut SC::Challenger,
opts: <A::Record as MachineRecord>::Config,
) -> Result<MachineProof<SC>, Self::Error>
fn prove( &self, pk: &StarkProvingKey<SC>, records: Vec<A::Record>, challenger: &mut SC::Challenger, opts: <A::Record as MachineRecord>::Config, ) -> Result<MachineProof<SC>, Self::Error>
Generate a proof for the given records.
Provided Methods§
fn num_pv_elts(&self) -> usize
fn shard_chips<'a, 'b>(
&'a self,
shard: &'b A::Record,
) -> impl Iterator<Item = &'b MachineChip<SC, A>>where
SC: 'b,
'a: 'b,
fn setup( &self, program: &A::Program, ) -> (StarkProvingKey<SC>, StarkVerifyingKey<SC>)
sourcefn update(
&self,
challenger: &mut SC::Challenger,
commitment: Com<SC>,
public_values: &[SC::Val],
)
fn update( &self, challenger: &mut SC::Challenger, commitment: Com<SC>, public_values: &[SC::Val], )
Update the challenger with the given shard data
fn debug_constraints( &self, pk: &StarkProvingKey<SC>, records: Vec<A::Record>, challenger: &mut SC::Challenger, )
Object Safety§
This trait is not object safe.