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!: generalize ProverEvaluate::result_evaluate and final_round_evaluate to multiple tables #272

Closed
wants to merge 1 commit into from

Conversation

iajoiner
Copy link
Contributor

@iajoiner iajoiner commented Oct 15, 2024

Please be sure to look over the pull request guidelines here: https://github.com/spaceandtimelabs/sxt-proof-of-sql/blob/main/CONTRIBUTING.md#submit-pr.

Please go through the following checklist

Rationale for this change

In order to complete #121 and #122 we need to allow ProofPlan composition and multiple table support. In particular we have to allow ProofExpr::prover_evaluate to accept table_lengths that are not identical to proof_builder.table_length due to ProofPlan composition. This is the latest PR for this.

What changes are included in this PR?

  • add table_length to ProofExpr::prover_evaluate.
  • generalize ProverEvaluate::result_evaluate.
  • generalize ProverEvaluate::final_round_evaluate.

Are these changes tested?

Existing tests should pass.

alloc: &'a Bump,
_accessor: &'a dyn DataAccessor<C::Scalar>,
) -> Column<'a, C::Scalar> {
let table_length = builder.table_length();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we remove FinalRoundBuilder::table_length since it no longer should be used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. That's overdue. In fact we really need to have one FinalRoundBuilder per ProofPlan.

builder: &mut FinalRoundBuilder<'a, C::Scalar>,
_alloc: &'a Bump,
accessor: &'a dyn DataAccessor<C::Scalar>,
) -> Column<'a, C::Scalar> {
let column = accessor.get_column(self.column_ref);
assert!(column.len() == table_length);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What guarantees this always occurs? Please add a comment explaining why this is safe.

NIT:

Suggested change
assert!(column.len() == table_length);
assert_eq!(column.len(), table_length);

@@ -57,11 +57,11 @@ impl<C: Commitment> ProofExpr<C> for LiteralExpr<C::Scalar> {
#[tracing::instrument(name = "LiteralExpr::prover_evaluate", level = "debug", skip_all)]
fn prover_evaluate<'a>(
&self,
builder: &mut FinalRoundBuilder<'a, C::Scalar>,
table_length: usize,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

builder.mle_evaluations.input_one_evaluation in verifier_evaluate also depends on table length, so we should handle that with this change as well.

…und_evaluate` to multiple tables

- add `table_length` to `ProofExpr::prover_evaluate`
- generalize `ProverEvaluate::result_evaluate`
- generalize `ProverEvaluate::final_round_evaluate`
@iajoiner
Copy link
Contributor Author

iajoiner commented Nov 5, 2024

Closed in favor of #334

@iajoiner iajoiner closed this Nov 5, 2024
@iajoiner iajoiner deleted the refactor/prover branch November 5, 2024 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants