Skip to content

Commit

Permalink
feat: efficient range check (#421)
Browse files Browse the repository at this point in the history
# Rationale for this change

Currently, ranges on scalar values are verified in a bitwise
decomposition for each bit. This requires a proportionally large amount
of work to verify, since each bit must be checked. A more efficient
range check can leverage a lookup table and protocol with a verifying
party to efficiently argue range and uniqueness against columns of
scalar values.

# What changes are included in this PR?

Adds an efficient, byte-oriented range check protocol via lookup table
with logarithmic derivative arguments

# Are these changes tested?
- [x] Thorough unit tests for individual range check components
- [x] A demo RangeCheckExpr based off of a ProofPlan trait
implementation so that the prover and verifier builder structs can be
accessed

# Split

- Introduce threading to heavy matrix operations
- Configurable, generic word sizes
- Configurable range
- Dynamic column sizes
- Convert from ProofPlan to ProofExpr, need ProofExpr to be able to
provide verifier challenge
  • Loading branch information
Dustin-Ray authored Dec 12, 2024
2 parents 674cf4c + e9d4c6c commit f15a9fa
Show file tree
Hide file tree
Showing 5 changed files with 859 additions and 317 deletions.
3 changes: 0 additions & 3 deletions crates/proof-of-sql/src/sql/proof_exprs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,3 @@ mod column_expr;
pub(crate) use column_expr::ColumnExpr;
#[cfg(all(test, feature = "blitzar"))]
mod column_expr_test;

#[allow(dead_code, unused_variables)]
mod range_check;
314 changes: 0 additions & 314 deletions crates/proof-of-sql/src/sql/proof_exprs/range_check.rs

This file was deleted.

4 changes: 4 additions & 0 deletions crates/proof-of-sql/src/sql/proof_plans/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,7 @@ pub use dyn_proof_plan::DynProofPlan;

#[cfg(test)]
mod demo_mock_plan;

pub mod range_check;
#[cfg(all(test, feature = "blitzar"))]
pub mod range_check_test_plan;
Loading

0 comments on commit f15a9fa

Please sign in to comment.