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§

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(&self, record: &A::Record) -> Com<SC>

Calculate the main commitment for a given record.

source

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.

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

Generate a proof for the given records.

Provided Methods§

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 setup( &self, program: &A::Program, ) -> (StarkProvingKey<SC>, StarkVerifyingKey<SC>)

source

fn update( &self, challenger: &mut SC::Challenger, commitment: Com<SC>, public_values: &[SC::Val], )

Update the challenger with the given shard data

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§