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§

source

fn new(machine: StarkMachine<SC, A>) -> Self

Create a new prover from a given machine.

source

fn machine(&self) -> &StarkMachine<SC, A>

A reference to the machine that this prover is using.

source

fn commit_main(&self, shard: &A::Record) -> Self::MainData

Commit to the main execution trace.

source

fn commit_shards( &self, shards: &[A::Record], opts: SP1CoreOpts, ) -> (Vec<Com<SC>>, Vec<Self::ShardCommitData>)

source

fn prove_shard( &self, pk: &StarkProvingKey<SC>, shard_data: Self::MainData, challenger: &mut SC::Challenger, ) -> Result<ShardProof<SC>, Self::Error>

source

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§

source

fn generate_dependencies( &self, records: &mut [A::Record], opts: &<A::Record as MachineRecord>::Config, )

source

fn setup( &self, program: &A::Program, ) -> (StarkProvingKey<SC>, StarkVerifyingKey<SC>)

source

fn config(&self) -> &SC

The stark config for the machine.

source

fn num_pv_elts(&self) -> usize

source

fn shard_chips<'a, 'b>( &'a self, shard: &'b A::Record, ) -> impl Iterator<Item = &'b MachineChip<SC, A>>
where SC: 'b, 'a: 'b,

source

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>>,

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.

source

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>>,

Object Safety§

This trait is not object safe.

Implementors§