Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add sumcheck range length field #443

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions crates/proof-of-sql/src/sql/proof/first_round_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ pub struct FirstRoundBuilder {
num_post_result_challenges: usize,
/// The extra one evaluation lengths used in the proof.
one_evaluation_lengths: Vec<usize>,
/// The extra sumcheck range lengths used in the proof.
sumcheck_range_lengths: Vec<usize>,
}

impl Default for FirstRoundBuilder {
Expand All @@ -21,14 +23,21 @@ impl FirstRoundBuilder {
Self {
num_post_result_challenges: 0,
one_evaluation_lengths: Vec::new(),
sumcheck_range_lengths: Vec::new(),
}
}

/// Get the one evaluation lengths used in the proof.
#[allow(dead_code)]
pub(crate) fn one_evaluation_lengths(&self) -> &[usize] {
&self.one_evaluation_lengths
}

/// Get the sumcheck range lengths used in the proof.
pub(crate) fn sumcheck_range_lengths(&self) -> &[usize] {
&self.sumcheck_range_lengths
}

/// Append the length to the list of one evaluation lengths.
pub(crate) fn produce_one_evaluation_length(&mut self, length: usize) {
self.one_evaluation_lengths.push(length);
Expand Down
4 changes: 3 additions & 1 deletion crates/proof-of-sql/src/sql/proof/query_proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,11 @@ impl<CP: CommitmentEvaluationProof> QueryProof<CP> {
let query_result = expr.first_round_evaluate(&mut first_round_builder, &alloc, &table_map);
let owned_table_result = OwnedTable::from(&query_result);
let provable_result = query_result.into();

let one_evaluation_lengths = first_round_builder.one_evaluation_lengths();
let range_evaluation_lengths = first_round_builder.sumcheck_range_lengths();
Dustin-Ray marked this conversation as resolved.
Show resolved Hide resolved

let range_length = one_evaluation_lengths
let range_length = range_evaluation_lengths
.iter()
.copied()
.chain(core::iter::once(initial_range_length))
Expand Down
Loading