diff --git a/backend/src/estark/starky_wrapper.rs b/backend/src/estark/starky_wrapper.rs index 6ba9d715e..c94c9908c 100644 --- a/backend/src/estark/starky_wrapper.rs +++ b/backend/src/estark/starky_wrapper.rs @@ -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; @@ -47,15 +47,13 @@ impl BackendFactory 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); @@ -66,7 +64,7 @@ impl BackendFactory for Factory { }; Ok(Box::new(EStark { - fixed: fixed.to_vec(), + fixed, pil_json, params, setup, @@ -90,7 +88,7 @@ fn create_stark_setup( } pub struct EStark { - fixed: Vec<(String, Vec)>, + fixed: Arc)>>, pil_json: PIL, params: StarkStruct, // eSTARK calls it setup, but it works similarly to a verification key and depends only on the