Skip to content

Commit

Permalink
remove now redundant env set vars
Browse files Browse the repository at this point in the history
  • Loading branch information
nulltea committed Mar 11, 2024
1 parent 91245f3 commit 1148504
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 20 deletions.
16 changes: 4 additions & 12 deletions lightclient-circuits/src/aggregation_circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use snark_verifier_sdk::{
halo2::aggregation::{AggregationCircuit, AggregationConfigParams},
Snark, SHPLONK,
};
use std::{env::set_var, fs::File, path::Path};
use std::{fs::File, path::Path};

/// Configuration for the aggregation circuit.
#[derive(Clone, Debug, Default, Serialize, Deserialize)]
Expand Down Expand Up @@ -104,17 +104,9 @@ impl AppCircuit for AggregationCircuit {
// We assume that `AggregationCircuit` will only be used for a single aggregation/compression layer.
circuit.expose_previous_instances(false);

match stage {
CircuitBuilderStage::Prover => {
circuit.set_params(circuit_params);
circuit.set_break_points(pinning.map_or(vec![], |p| p.break_points));
}
_ => {
set_var(
"AGG_CONFIG_PARAMS",
serde_json::to_string(&circuit.calculate_params(Some(10))).unwrap(),
);
}
if matches!(stage, CircuitBuilderStage::Prover) {
circuit.set_params(circuit_params);
circuit.set_break_points(pinning.map_or(vec![], |p| p.break_points));
};

Ok(circuit)
Expand Down
9 changes: 1 addition & 8 deletions lightclient-circuits/src/gadget/crypto/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// Code: https://github.com/ChainSafe/Spectre
// SPDX-License-Identifier: LGPL-3.0-only

use std::env::set_var;

use crate::util::{CommonGateManager, Eth2ConfigPinning, GateBuilderConfig, Halo2ConfigPinning, PinnableCircuit};
use eth_types::Field;
use getset::Getters;
Expand Down Expand Up @@ -168,12 +166,7 @@ impl<F: Field, GateManager: CommonGateManager<F>> ShaCircuitBuilder<F, GateManag
}

pub fn calculate_params(&mut self, minimum_rows: Option<usize>) -> BaseCircuitParams {
let params = self.base.calculate_params(minimum_rows);
set_var(
"GATE_CONFIG_PARAMS",
serde_json::to_string(&params).unwrap(),
);
params
self.base.calculate_params(minimum_rows)
}

pub fn sha_contexts_pair(&mut self) -> (&mut Context<F>, GateManager::CustomContext<'_>) {
Expand Down

0 comments on commit 1148504

Please sign in to comment.