Skip to content

Commit

Permalink
Prevent clone
Browse files Browse the repository at this point in the history
  • Loading branch information
georgwiese committed Jun 28, 2024
1 parent e52e6fe commit b502273
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions backend/src/estark/starky_wrapper.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::io;
use std::path::PathBuf;
use std::sync::Arc;
use std::time::Instant;
use std::{borrow::Cow, io};

use crate::{Backend, BackendFactory, BackendOptions, Error};
use powdr_ast::analyzed::Analyzed;
Expand Down Expand Up @@ -47,15 +47,13 @@ impl<F: FieldElement> BackendFactory<F> for Factory {
return Err(Error::NoAggregationAvailable);
}

let fixed = (*fixed).clone();

let proof_type: ProofType = ProofType::from(options);

let params = create_stark_struct(pil.degree(), proof_type.hash_type());

let (pil_json, patched_fixed) = first_step_fixup(&pil, &fixed);

let fixed = patched_fixed.map_or_else(|| Cow::Borrowed(&fixed), Cow::Owned);
let fixed = patched_fixed.map_or_else(|| fixed.clone(), Arc::new);

let const_pols = to_starky_pols_array(&fixed, &pil_json, PolKind::Constant);

Expand All @@ -66,7 +64,7 @@ impl<F: FieldElement> BackendFactory<F> for Factory {
};

Ok(Box::new(EStark {
fixed: fixed.to_vec(),
fixed,
pil_json,
params,
setup,
Expand All @@ -90,7 +88,7 @@ fn create_stark_setup(
}

pub struct EStark<F: FieldElement> {
fixed: Vec<(String, Vec<F>)>,
fixed: Arc<Vec<(String, Vec<F>)>>,
pil_json: PIL,
params: StarkStruct,
// eSTARK calls it setup, but it works similarly to a verification key and depends only on the
Expand Down

0 comments on commit b502273

Please sign in to comment.