Skip to content

Commit

Permalink
refactor!: rename ProverEvaluate::prover_evaluate to `final_round_e…
Browse files Browse the repository at this point in the history
…valuate`
  • Loading branch information
iajoiner authored and JayWhite2357 committed Oct 11, 2024
1 parent 8e69f9d commit 42f3069
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 20 deletions.
2 changes: 1 addition & 1 deletion crates/proof-of-sql/src/sql/proof/proof_plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ pub trait ProverEvaluate<S: Scalar> {
/// Intermediate values that are needed to form the proof are allocated into the arena
/// allocator alloc. These intermediate values will persist through proof creation and
/// will be bulk deallocated once the proof is formed.
fn prover_evaluate<'a>(
fn final_round_evaluate<'a>(
&self,
builder: &mut FinalRoundBuilder<'a, S>,
alloc: &'a Bump,
Expand Down
2 changes: 1 addition & 1 deletion crates/proof-of-sql/src/sql/proof/query_proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ impl<CP: CommitmentEvaluationProof> QueryProof<CP> {

let mut builder =
FinalRoundBuilder::new(table_length, num_sumcheck_variables, post_result_challenges);
expr.prover_evaluate(&mut builder, &alloc, accessor);
expr.final_round_evaluate(&mut builder, &alloc, accessor);

let num_sumcheck_variables = builder.num_sumcheck_variables();
let table_length = builder.table_length();
Expand Down
8 changes: 4 additions & 4 deletions crates/proof-of-sql/src/sql/proof/query_proof_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl<S: Scalar> ProverEvaluate<S> for TrivialTestProofPlan {

fn first_round_evaluate(&self, _builder: &mut FirstRoundBuilder) {}

fn prover_evaluate<'a>(
fn final_round_evaluate<'a>(
&self,
builder: &mut FinalRoundBuilder<'a, S>,
alloc: &'a Bump,
Expand Down Expand Up @@ -210,7 +210,7 @@ impl<S: Scalar> ProverEvaluate<S> for SquareTestProofPlan {

fn first_round_evaluate(&self, _builder: &mut FirstRoundBuilder) {}

fn prover_evaluate<'a>(
fn final_round_evaluate<'a>(
&self,
builder: &mut FinalRoundBuilder<'a, S>,
alloc: &'a Bump,
Expand Down Expand Up @@ -392,7 +392,7 @@ impl<S: Scalar> ProverEvaluate<S> for DoubleSquareTestProofPlan {

fn first_round_evaluate(&self, _builder: &mut FirstRoundBuilder) {}

fn prover_evaluate<'a>(
fn final_round_evaluate<'a>(
&self,
builder: &mut FinalRoundBuilder<'a, S>,
alloc: &'a Bump,
Expand Down Expand Up @@ -605,7 +605,7 @@ impl<S: Scalar> ProverEvaluate<S> for ChallengeTestProofPlan {
builder.request_post_result_challenges(2);
}

fn prover_evaluate<'a>(
fn final_round_evaluate<'a>(
&self,
builder: &mut FinalRoundBuilder<'a, S>,
alloc: &'a Bump,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impl<S: Scalar> ProverEvaluate<S> for EmptyTestQueryExpr {
vec![Column::BigInt(res); self.columns]
}
fn first_round_evaluate(&self, _builder: &mut FirstRoundBuilder) {}
fn prover_evaluate<'a>(
fn final_round_evaluate<'a>(
&self,
builder: &mut FinalRoundBuilder<'a, S>,
alloc: &'a Bump,
Expand Down
10 changes: 5 additions & 5 deletions crates/proof-of-sql/src/sql/proof_plans/dyn_proof_plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,17 +114,17 @@ impl<C: Commitment> ProverEvaluate<C::Scalar> for DynProofPlan<C> {
}
}

#[tracing::instrument(name = "DynProofPlan::prover_evaluate", level = "debug", skip_all)]
fn prover_evaluate<'a>(
#[tracing::instrument(name = "DynProofPlan::final_round_evaluate", level = "debug", skip_all)]
fn final_round_evaluate<'a>(
&self,
builder: &mut crate::sql::proof::FinalRoundBuilder<'a, C::Scalar>,
alloc: &'a bumpalo::Bump,
accessor: &'a dyn crate::base::database::DataAccessor<C::Scalar>,
) -> Vec<Column<'a, C::Scalar>> {
match self {
DynProofPlan::Projection(expr) => expr.prover_evaluate(builder, alloc, accessor),
DynProofPlan::GroupBy(expr) => expr.prover_evaluate(builder, alloc, accessor),
DynProofPlan::Filter(expr) => expr.prover_evaluate(builder, alloc, accessor),
DynProofPlan::Projection(expr) => expr.final_round_evaluate(builder, alloc, accessor),
DynProofPlan::GroupBy(expr) => expr.final_round_evaluate(builder, alloc, accessor),
DynProofPlan::Filter(expr) => expr.final_round_evaluate(builder, alloc, accessor),
}
}
}
4 changes: 2 additions & 2 deletions crates/proof-of-sql/src/sql/proof_plans/filter_exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ impl<C: Commitment> ProverEvaluate<C::Scalar> for FilterExec<C> {
builder.request_post_result_challenges(2);
}

#[tracing::instrument(name = "FilterExec::prover_evaluate", level = "debug", skip_all)]
#[tracing::instrument(name = "FilterExec::final_round_evaluate", level = "debug", skip_all)]
#[allow(unused_variables)]
fn prover_evaluate<'a>(
fn final_round_evaluate<'a>(
&self,
builder: &mut FinalRoundBuilder<'a, C::Scalar>,
alloc: &'a Bump,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ impl ProverEvaluate<Curve25519Scalar> for DishonestFilterExec<RistrettoPoint> {
}

#[tracing::instrument(
name = "DishonestFilterExec::prover_evaluate",
name = "DishonestFilterExec::final_round_evaluate",
level = "debug",
skip_all
)]
#[allow(unused_variables)]
fn prover_evaluate<'a>(
fn final_round_evaluate<'a>(
&self,
builder: &mut FinalRoundBuilder<'a, Curve25519Scalar>,
alloc: &'a Bump,
Expand Down
4 changes: 2 additions & 2 deletions crates/proof-of-sql/src/sql/proof_plans/group_by_exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,9 @@ impl<C: Commitment> ProverEvaluate<C::Scalar> for GroupByExec<C> {
builder.request_post_result_challenges(2);
}

#[tracing::instrument(name = "GroupByExec::prover_evaluate", level = "debug", skip_all)]
#[tracing::instrument(name = "GroupByExec::final_round_evaluate", level = "debug", skip_all)]
#[allow(unused_variables)]
fn prover_evaluate<'a>(
fn final_round_evaluate<'a>(
&self,
builder: &mut FinalRoundBuilder<'a, C::Scalar>,
alloc: &'a Bump,
Expand Down
8 changes: 6 additions & 2 deletions crates/proof-of-sql/src/sql/proof_plans/projection_exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,13 @@ impl<C: Commitment> ProverEvaluate<C::Scalar> for ProjectionExec<C> {

fn first_round_evaluate(&self, _builder: &mut FirstRoundBuilder) {}

#[tracing::instrument(name = "ProjectionExec::prover_evaluate", level = "debug", skip_all)]
#[tracing::instrument(
name = "ProjectionExec::final_round_evaluate",
level = "debug",
skip_all
)]
#[allow(unused_variables)]
fn prover_evaluate<'a>(
fn final_round_evaluate<'a>(
&self,
builder: &mut FinalRoundBuilder<'a, C::Scalar>,
alloc: &'a Bump,
Expand Down

0 comments on commit 42f3069

Please sign in to comment.