pub struct GateThreadBuilder<F: ScalarField> {
    pub threads: [Vec<Context<F>>; 3],
    pub witness_gen_only: bool,
    /* private fields */
}
Expand description

Builds the process for gate threading

Fields

threads: [Vec<Context<F>>; 3]

Threads for each challenge phase

witness_gen_only: bool

Flag for witness generation. If true, the gate thread builder is used for witness generation only.

Implementations

Creates a new GateThreadBuilder and spawns a main thread in phase 0.

  • witness_gen_only: If true, the GateThreadBuilder is used for witness generation only.
    • If true, the gate thread builder only does witness asignments and does not store constraint information – this should only be used for the real prover.
    • If false, the gate thread builder is used for keygen and mock prover (it can also be used for real prover) and the builder stores circuit information (e.g. copy constraints, fixed columns, enabled selectors).
      • These values are fixed for the circuit at key generation time, and they do not need to be re-computed by the prover in the actual proving phase.

Creates a new GateThreadBuilder with witness_gen_only set to false.

Performs the witness assignment computations and then checks using normal programming logic whether the gate constraints are all satisfied.

Creates a new GateThreadBuilder with witness_gen_only set to false.

Performs the witness assignment computations and generates prover and verifier keys.

Creates a new GateThreadBuilder with witness_gen_only set to true.

Performs the witness assignment computations and then runs the proving system.

Creates a new GateThreadBuilder with use_unknown flag set.

  • use_unknown: If true, during key generation witness [Value]s are replaced with Value::unknown() for safety.

Returns a mutable reference to the Context of a gate thread. Spawns a new thread for the given phase, if none exists.

  • phase: The challenge phase (as an index) of the gate thread.

Returns the witness_gen_only flag.

Returns the use_unknown flag.

Returns the current number of threads in the GateThreadBuilder.

Creates a new thread id by incrementing the thread count

Spawns a new thread for a new given phase. Returns a mutable reference to the Context of the new thread.

  • phase: The phase (index) of the gate thread.

Auto-calculates configuration parameters for the circuit

  • k: The number of in the circuit (i.e. numeber of rows = 2k)
  • minimum_rows: The minimum number of rows in the circuit that cannot be used for witness assignments and contain random blinding factors to ensure zk property, defaults to 0.

Assigns all advice and fixed cells, turns on selectors, and imposes equality constraints.

Returns the assigned advices, and constants in the form of KeygenAssignments.

Assumes selector and advice columns are already allocated and of the same length.

Note: assign_all() should be called during keygen or if using mock prover. It also works for the real prover, but there it is more optimal to use assign_threads_in instead.

  • config: The FlexGateConfig of the circuit.
  • lookup_advice: The lookup advice columns.
  • q_lookup: The lookup advice selectors.
  • region: The [Region] of the circuit.
  • assigned_advices: The assigned advice cells.
  • assigned_constants: The assigned fixed cells.
  • break_points: The break points of the circuit.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Converts self into T using Into<T>. Read more
Causes self to use its Binary implementation when Debug-formatted.
Causes self to use its Display implementation when Debug-formatted. Read more
Causes self to use its LowerExp implementation when Debug-formatted. Read more
Causes self to use its LowerHex implementation when Debug-formatted. Read more
Causes self to use its Octal implementation when Debug-formatted.
Causes self to use its Pointer implementation when Debug-formatted. Read more
Causes self to use its UpperExp implementation when Debug-formatted. Read more
Causes self to use its UpperHex implementation when Debug-formatted. Read more
Formats each item in a sequence. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Pipes by value. This is generally the method you want to use. Read more
Borrows self and passes that borrow into the pipe function. Read more
Mutably borrows self and passes that borrow into the pipe function. Read more
Borrows self, then passes self.borrow() into the pipe function. Read more
Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Borrows self, then passes self.as_ref() into the pipe function.
Mutably borrows self, then passes self.as_mut() into the pipe function. Read more
Borrows self, then passes self.deref() into the pipe function.
Mutably borrows self, then passes self.deref_mut() into the pipe function. Read more
The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
Immutable access to a value. Read more
Mutable access to a value. Read more
Immutable access to the Borrow<B> of a value. Read more
Mutable access to the BorrowMut<B> of a value. Read more
Immutable access to the AsRef<R> view of a value. Read more
Mutable access to the AsMut<R> view of a value. Read more
Immutable access to the Deref::Target of a value. Read more
Mutable access to the Deref::Target of a value. Read more
Calls .tap() only in debug builds, and is erased in release builds.
Calls .tap_mut() only in debug builds, and is erased in release builds. Read more
Calls .tap_borrow() only in debug builds, and is erased in release builds. Read more
Calls .tap_borrow_mut() only in debug builds, and is erased in release builds. Read more
Calls .tap_ref() only in debug builds, and is erased in release builds. Read more
Calls .tap_ref_mut() only in debug builds, and is erased in release builds. Read more
Calls .tap_deref() only in debug builds, and is erased in release builds. Read more
Calls .tap_deref_mut() only in debug builds, and is erased in release builds. Read more
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Attempts to convert self into T using TryInto<T>. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more