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

refactor!: remove accessor from ProofPlan::count #347

Merged
merged 1 commit into from
Nov 8, 2024
Merged
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
6 changes: 1 addition & 5 deletions crates/proof-of-sql/src/sql/proof/proof_plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ use core::fmt::Debug;
#[enum_dispatch::enum_dispatch(DynProofPlan)]
pub trait ProofPlan: Debug + Send + Sync + ProverEvaluate {
/// Count terms used within the Query's proof
fn count(
&self,
builder: &mut CountBuilder,
accessor: &dyn MetadataAccessor,
) -> Result<(), ProofError>;
fn count(&self, builder: &mut CountBuilder) -> Result<(), ProofError>;

/// The length of the input table
fn get_length(&self, accessor: &dyn MetadataAccessor) -> usize;
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 @@ -168,7 +168,7 @@ impl<CP: CommitmentEvaluationProof> QueryProof<CP> {
// count terms
let counts = {
let mut builder = CountBuilder::new(&self.bit_distributions);
expr.count(&mut builder, accessor)?;
expr.count(&mut builder)?;
builder.counts()
}?;

Expand Down
24 changes: 4 additions & 20 deletions crates/proof-of-sql/src/sql/proof/query_proof_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,7 @@ impl ProverEvaluate for TrivialTestProofPlan {
}
}
impl ProofPlan for TrivialTestProofPlan {
fn count(
&self,
builder: &mut CountBuilder,
_accessor: &dyn MetadataAccessor,
) -> Result<(), ProofError> {
fn count(&self, builder: &mut CountBuilder) -> Result<(), ProofError> {
builder.count_degree(2);
builder.count_intermediate_mles(1);
builder.count_subpolynomials(1);
Expand Down Expand Up @@ -238,11 +234,7 @@ impl ProverEvaluate for SquareTestProofPlan {
}
}
impl ProofPlan for SquareTestProofPlan {
fn count(
&self,
builder: &mut CountBuilder,
_accessor: &dyn MetadataAccessor,
) -> Result<(), ProofError> {
fn count(&self, builder: &mut CountBuilder) -> Result<(), ProofError> {
builder.count_degree(3);
builder.count_intermediate_mles(1);
builder.count_subpolynomials(1);
Expand Down Expand Up @@ -436,11 +428,7 @@ impl ProverEvaluate for DoubleSquareTestProofPlan {
}
}
impl ProofPlan for DoubleSquareTestProofPlan {
fn count(
&self,
builder: &mut CountBuilder,
_accessor: &dyn MetadataAccessor,
) -> Result<(), ProofError> {
fn count(&self, builder: &mut CountBuilder) -> Result<(), ProofError> {
builder.count_degree(3);
builder.count_intermediate_mles(2);
builder.count_subpolynomials(2);
Expand Down Expand Up @@ -641,11 +629,7 @@ impl ProverEvaluate for ChallengeTestProofPlan {
}
}
impl ProofPlan for ChallengeTestProofPlan {
fn count(
&self,
builder: &mut CountBuilder,
_accessor: &dyn MetadataAccessor,
) -> Result<(), ProofError> {
fn count(&self, builder: &mut CountBuilder) -> Result<(), ProofError> {
builder.count_degree(3);
builder.count_intermediate_mles(1);
builder.count_subpolynomials(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,7 @@ impl ProverEvaluate for EmptyTestQueryExpr {
}
}
impl ProofPlan for EmptyTestQueryExpr {
fn count(
&self,
builder: &mut CountBuilder,
_accessor: &dyn MetadataAccessor,
) -> Result<(), ProofError> {
fn count(&self, builder: &mut CountBuilder) -> Result<(), ProofError> {
builder.count_intermediate_mles(self.columns);
Ok(())
}
Expand Down
6 changes: 1 addition & 5 deletions crates/proof-of-sql/src/sql/proof_plans/empty_exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,7 @@ impl EmptyExec {
}

impl ProofPlan for EmptyExec {
fn count(
&self,
_builder: &mut CountBuilder,
_accessor: &dyn MetadataAccessor,
) -> Result<(), ProofError> {
fn count(&self, _builder: &mut CountBuilder) -> Result<(), ProofError> {
Ok(())
}

Expand Down
6 changes: 1 addition & 5 deletions crates/proof-of-sql/src/sql/proof_plans/filter_exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,7 @@ impl<H: ProverHonestyMarker> ProofPlan for OstensibleFilterExec<H>
where
OstensibleFilterExec<H>: ProverEvaluate,
{
fn count(
&self,
builder: &mut CountBuilder,
_accessor: &dyn MetadataAccessor,
) -> Result<(), ProofError> {
fn count(&self, builder: &mut CountBuilder) -> Result<(), ProofError> {
self.where_clause.count(builder)?;
for aliased_expr in &self.aliased_results {
aliased_expr.expr.count(builder)?;
Expand Down
6 changes: 1 addition & 5 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 @@ -69,11 +69,7 @@ impl GroupByExec {
}

impl ProofPlan for GroupByExec {
fn count(
&self,
builder: &mut CountBuilder,
_accessor: &dyn MetadataAccessor,
) -> Result<(), ProofError> {
fn count(&self, builder: &mut CountBuilder) -> Result<(), ProofError> {
self.where_clause.count(builder)?;
for expr in &self.group_by_exprs {
expr.count(builder)?;
Expand Down
6 changes: 1 addition & 5 deletions crates/proof-of-sql/src/sql/proof_plans/projection_exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,7 @@ impl ProjectionExec {
}

impl ProofPlan for ProjectionExec {
fn count(
&self,
builder: &mut CountBuilder,
_accessor: &dyn MetadataAccessor,
) -> Result<(), ProofError> {
fn count(&self, builder: &mut CountBuilder) -> Result<(), ProofError> {
for aliased_expr in &self.aliased_results {
aliased_expr.expr.count(builder)?;
builder.count_intermediate_mles(1);
Expand Down
Loading