Skip to main content

AirProver

Trait AirProver 

Source
pub trait AirProver<GC: IopCtx, SC: ShardContext<GC>>:
    'static
    + Send
    + Sync
    + Sized {
    type PreprocessedData: 'static + Send + Sync;

    // Required methods
    fn machine(&self) -> &Machine<GC::F, SC::Air>;
    fn setup_from_vk(
        &self,
        program: Arc<Program<GC, SC>>,
        vk: Option<MachineVerifyingKey<GC>>,
        prover_permits: ProverSemaphore,
    ) -> impl Future<Output = (PreprocessedData<ProvingKey<GC, SC, Self>>, MachineVerifyingKey<GC>)> + Send;
    fn setup_and_prove_shard(
        &self,
        program: Arc<Program<GC, SC>>,
        record: Record<GC, SC>,
        vk: Option<MachineVerifyingKey<GC>>,
        prover_permits: ProverSemaphore,
    ) -> impl Future<Output = (MachineVerifyingKey<GC>, ShardProof<GC, PcsProof<GC, SC>>, ProverPermit)> + Send;
    fn prove_shard_with_pk(
        &self,
        pk: Arc<ProvingKey<GC, SC, Self>>,
        record: Record<GC, SC>,
        prover_permits: ProverSemaphore,
    ) -> impl Future<Output = (ShardProof<GC, PcsProof<GC, SC>>, ProverPermit)> + Send;
    fn preprocessed_table_heights(
        pk: Arc<ProvingKey<GC, SC, Self>>,
    ) -> impl Future<Output = BTreeMap<String, usize>> + Send;

    // Provided methods
    fn all_chips(&self) -> &[Chip<GC::F, SC::Air>] { ... }
    fn setup(
        &self,
        program: Arc<Program<GC, SC>>,
        setup_permits: ProverSemaphore,
    ) -> impl Future<Output = (PreprocessedData<ProvingKey<GC, SC, Self>>, MachineVerifyingKey<GC>)> + Send { ... }
}
Expand description

A prover for an AIR.

Required Associated Types§

Source

type PreprocessedData: 'static + Send + Sync

The proving key type.

Required Methods§

Source

fn machine(&self) -> &Machine<GC::F, SC::Air>

Get the machine.

Source

fn setup_from_vk( &self, program: Arc<Program<GC, SC>>, vk: Option<MachineVerifyingKey<GC>>, prover_permits: ProverSemaphore, ) -> impl Future<Output = (PreprocessedData<ProvingKey<GC, SC, Self>>, MachineVerifyingKey<GC>)> + Send

Setup from a verifying key.

Source

fn setup_and_prove_shard( &self, program: Arc<Program<GC, SC>>, record: Record<GC, SC>, vk: Option<MachineVerifyingKey<GC>>, prover_permits: ProverSemaphore, ) -> impl Future<Output = (MachineVerifyingKey<GC>, ShardProof<GC, PcsProof<GC, SC>>, ProverPermit)> + Send

Setup and prove a shard.

Source

fn prove_shard_with_pk( &self, pk: Arc<ProvingKey<GC, SC, Self>>, record: Record<GC, SC>, prover_permits: ProverSemaphore, ) -> impl Future<Output = (ShardProof<GC, PcsProof<GC, SC>>, ProverPermit)> + Send

Prove a shard with a given proving key.

Source

fn preprocessed_table_heights( pk: Arc<ProvingKey<GC, SC, Self>>, ) -> impl Future<Output = BTreeMap<String, usize>> + Send

A function which deduces preprocessed table heights from the proving key.

Provided Methods§

Source

fn all_chips(&self) -> &[Chip<GC::F, SC::Air>]

Get all the chips in the machine.

Source

fn setup( &self, program: Arc<Program<GC, SC>>, setup_permits: ProverSemaphore, ) -> impl Future<Output = (PreprocessedData<ProvingKey<GC, SC, Self>>, MachineVerifyingKey<GC>)> + Send

Setup from a program.

The setup phase produces a pair ‘(pk, vk)’ of proving and verifying keys. The proving key consists of information used by the prover that only depends on the program itself and not a specific execution.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<GC: IopCtx, SC: ShardContext<GC>, C: DefaultJaggedProver<GC, SC::Config>> AirProver<GC, SC> for ShardProver<GC, SC, C>