Trait sp1_core::stark::MachineProver
source · pub trait MachineProver<SC: StarkGenericConfig, A: MachineAir<SC::Val>> {
type MainData;
type ShardCommitData;
type Error: Error;
Show 13 methods
// Required methods
fn new(machine: StarkMachine<SC, A>) -> Self;
fn machine(&self) -> &StarkMachine<SC, A>;
fn commit_main(&self, shard: &A::Record) -> Self::MainData;
fn commit_shards(
&self,
shards: &[A::Record],
opts: SP1CoreOpts,
) -> (Vec<Com<SC>>, Vec<Self::ShardCommitData>);
fn prove_shard(
&self,
pk: &StarkProvingKey<SC>,
shard_data: Self::MainData,
challenger: &mut SC::Challenger,
) -> Result<ShardProof<SC>, Self::Error>;
fn prove_shards(
&self,
pk: &StarkProvingKey<SC>,
shards: Vec<A::Record>,
challenger: &mut SC::Challenger,
opts: <A::Record as MachineRecord>::Config,
) -> Result<MachineProof<SC>, Self::Error>;
// Provided methods
fn generate_dependencies(
&self,
records: &mut [A::Record],
opts: &<A::Record as MachineRecord>::Config,
) { ... }
fn setup(
&self,
program: &A::Program,
) -> (StarkProvingKey<SC>, StarkVerifyingKey<SC>) { ... }
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 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>> { ... }
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_main(&self, shard: &A::Record) -> Self::MainData
fn commit_main(&self, shard: &A::Record) -> Self::MainData
Commit to the main execution trace.
fn commit_shards( &self, shards: &[A::Record], opts: SP1CoreOpts, ) -> (Vec<Com<SC>>, Vec<Self::ShardCommitData>)
fn prove_shard( &self, pk: &StarkProvingKey<SC>, shard_data: Self::MainData, challenger: &mut SC::Challenger, ) -> Result<ShardProof<SC>, Self::Error>
fn prove_shards( &self, pk: &StarkProvingKey<SC>, shards: Vec<A::Record>, challenger: &mut SC::Challenger, opts: <A::Record as MachineRecord>::Config, ) -> Result<MachineProof<SC>, Self::Error>
Provided Methods§
fn generate_dependencies( &self, records: &mut [A::Record], opts: &<A::Record as MachineRecord>::Config, )
fn setup( &self, program: &A::Program, ) -> (StarkProvingKey<SC>, StarkVerifyingKey<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,
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>
Prove the execution record is valid.
Given a proving key pk and a matching execution record record, this function generates
a STARK proof that the execution record is valid.
fn debug_constraints( &self, pk: &StarkProvingKey<SC>, records: Vec<A::Record>, challenger: &mut SC::Challenger, )
Object Safety§
This trait is not object safe.