Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
sai-deng committed Nov 9, 2024
1 parent b9c3365 commit 1eb7053
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
2 changes: 1 addition & 1 deletion plonky2/src/fri/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ fn fri_committed_trees<F: RichField + Extendable<D>, C: GenericConfig<D, F = F>,
}

if let Some(step_count) = query_round_step_count {
let cap_len = 1 << fri_params.config.cap_height * NUM_HASH_OUT_ELTS;
let cap_len = (1 << fri_params.config.cap_height) * NUM_HASH_OUT_ELTS;
let zero_cap = vec![F::ZERO; cap_len];
for _ in step_count..fri_params.reduction_arity_bits.len() {
challenger.observe_elements(&zero_cap);
Expand Down
27 changes: 21 additions & 6 deletions plonky2/src/fri/witness_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,27 @@ where
witness.set_extension_target(fri_proof_target.final_poly.0[i], F::Extension::ZERO)?;
}

for (t, x) in fri_proof_target
.commit_phase_merkle_caps
.iter()
.zip_eq(&fri_proof.commit_phase_merkle_caps)
{
witness.set_cap_target(t, x)?;
let target_caps = &fri_proof_target.commit_phase_merkle_caps;
let proof_caps = &fri_proof.commit_phase_merkle_caps;

if target_caps.len() < proof_caps.len() {
return Err(anyhow!(
"fri_proof->commit_phase_merkle_caps's target length is less than the proof length"
));
}

// Set matching elements in both proof and target caps
for (target_cap, proof_cap) in target_caps.iter().zip(proof_caps) {
witness.set_cap_target(target_cap, proof_cap)?;
}

// Set remaining elements in target caps to ZERO if target is longer
for target_cap in target_caps.iter().skip(proof_caps.len()) {
for cap_element in target_cap.0.iter() {
for element in cap_element.elements.iter() {
witness.set_target(*element, F::ZERO)?;
}
}
}

for (qt, q) in fri_proof_target
Expand Down
2 changes: 1 addition & 1 deletion starky/src/fibonacci_stark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ mod tests {
stark_config.fri_config.num_query_rounds = 1;

let min_degree_bits_to_support = 7;
let verifier_degree_bits = 10; // 14;
let verifier_degree_bits = 14;
let degree_bits = min_degree_bits_to_support..=verifier_degree_bits;
let fri_params = stark_config.fri_params(verifier_degree_bits);

Expand Down

0 comments on commit 1eb7053

Please sign in to comment.