|
1 | 1 | #[cfg(not(feature = "std"))] |
2 | 2 | use alloc::{vec, vec::Vec}; |
3 | 3 |
|
| 4 | +use anyhow::anyhow; |
4 | 5 | use hashbrown::HashSet; |
5 | 6 |
|
6 | 7 | use super::circuit_builder::NUM_COINS_LOOKUP; |
@@ -187,7 +188,7 @@ impl<F: RichField + Extendable<D>, C: GenericConfig<D, F = F>, const D: usize> |
187 | 188 | &self, |
188 | 189 | challenges: &ProofChallenges<F, D>, |
189 | 190 | common_data: &CommonCircuitData<F, D>, |
190 | | - ) -> FriInferredElements<F, D> { |
| 191 | + ) -> anyhow::Result<FriInferredElements<F, D>> { |
191 | 192 | let ProofChallenges { |
192 | 193 | plonk_zeta, |
193 | 194 | fri_challenges: |
@@ -215,11 +216,12 @@ impl<F: RichField + Extendable<D>, C: GenericConfig<D, F = F>, const D: usize> |
215 | 216 | * F::primitive_root_of_unity(log_n).exp_u64(reverse_bits(x_index, log_n) as u64); |
216 | 217 | let mut old_eval = fri_combine_initial::<F, C, D>( |
217 | 218 | &common_data.get_fri_instance(*plonk_zeta), |
218 | | - &self |
219 | | - .proof |
| 219 | + self.proof |
220 | 220 | .opening_proof |
221 | 221 | .query_round_proofs |
222 | | - .initial_trees_proofs[&x_index], |
| 222 | + .initial_trees_proofs |
| 223 | + .get(&x_index) |
| 224 | + .ok_or_else(|| anyhow!("fri_query_index missing from initial_trees_proofs"))?, |
223 | 225 | *fri_alpha, |
224 | 226 | subgroup_x, |
225 | 227 | &precomputed_reduced_evals, |
@@ -254,7 +256,7 @@ impl<F: RichField + Extendable<D>, C: GenericConfig<D, F = F>, const D: usize> |
254 | 256 | x_index = coset_index; |
255 | 257 | } |
256 | 258 | } |
257 | | - FriInferredElements(fri_inferred_elements) |
| 259 | + Ok(FriInferredElements(fri_inferred_elements)) |
258 | 260 | } |
259 | 261 | } |
260 | 262 |
|
|
0 commit comments