Skip to content

Commit

Permalink
chore: add back RangeCircuitBuilder::config (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanpwang authored Aug 17, 2023
1 parent a62ae5d commit 7100c23
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions halo2-base/src/gates/builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,13 @@ impl<F: ScalarField> RangeCircuitBuilder<F> {
) -> Self {
Self(GateCircuitBuilder::prover(builder, config_params, break_points))
}

/// Auto-configures the circuit configuration parameters. Mutates the configuration parameters of the circuit
/// and also returns a copy of the new configuration.
pub fn config(&mut self, minimum_rows: Option<usize>) -> BaseConfigParams {
self.0.config_params = self.0.builder.borrow().config(self.0.config_params.k, minimum_rows);
self.0.config_params.clone()
}
}

impl<F: ScalarField> Circuit<F> for RangeCircuitBuilder<F> {
Expand Down Expand Up @@ -754,6 +761,12 @@ impl<F: ScalarField> RangeWithInstanceCircuitBuilder<F> {
pub fn instance(&self) -> Vec<F> {
self.assigned_instances.iter().map(|v| *v.value()).collect()
}

/// Auto-configures the circuit configuration parameters. Mutates the configuration parameters of the circuit
/// and also returns a copy of the new configuration.
pub fn config(&mut self, minimum_rows: Option<usize>) -> BaseConfigParams {
self.circuit.config(minimum_rows)
}
}

impl<F: ScalarField> Circuit<F> for RangeWithInstanceCircuitBuilder<F> {
Expand Down

0 comments on commit 7100c23

Please sign in to comment.