Skip to content

Commit 55816c3

Browse files
authored
fix: bump blitzar version to 3.0.2 (#27)
# Rationale for this change We need to check and make sure that [this fix](spaceandtimelabs/blitzar#144) is properly used. <!-- Why are you proposing this change? If this is already explained clearly in the linked Jira ticket then this section is not needed. Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes. --> # What changes are included in this PR? - bump blitzar version to 3.0.2 - add tests to ensure that commitments work on integer extrema - fix existing tests that once require workarounds <!-- There is no need to duplicate the description in the ticket here but it is sometimes worth providing a summary of the individual changes in this PR. --> # Are these changes tested? Yes <!-- We typically require tests for all PRs in order to: 1. Prevent the code from being accidentally broken by subsequent changes 2. Serve as another way to document the expected behavior of the code If tests are not included in your PR, please explain why (for example, are they covered by existing tests)? -->
1 parent 650ac2a commit 55816c3

File tree

3 files changed

+81
-5
lines changed

3 files changed

+81
-5
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ arrow-csv = { version = "45.0" }
2323
bit-iter = { version = "1.1.1" }
2424
bigdecimal = { version = "0.4.5", features = ["serde"] }
2525
blake3 = { version = "1.3.3" }
26-
blitzar = { version = "3.0.1" }
26+
blitzar = { version = "3.0.2" }
2727
bumpalo = { version = "3.11.0" }
2828
bytemuck = {version = "1.14.2" }
2929
byte-slice-cast = { version = "1.2.1" }

crates/proof-of-sql/src/sql/ast/add_subtract_expr_test.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,7 @@ fn overflow_in_nonselected_rows_doesnt_error_out() {
167167
// select a, b from sxt.t where a + b >= 0
168168
#[test]
169169
fn overflow_in_where_clause_doesnt_error_out() {
170-
let data = owned_table([
171-
bigint("a", [i64::MAX, i64::MIN + 1]),
172-
smallint("b", [1_i16, 0]),
173-
]);
170+
let data = owned_table([bigint("a", [i64::MAX, i64::MIN]), smallint("b", [1_i16, 0])]);
174171
let t = "sxt.t".parse().unwrap();
175172
let accessor = OwnedTableTestAccessor::<InnerProductProof>::new_from_table(t, data, 0, ());
176173
let ast: ProofPlan<RistrettoPoint> = dense_filter(

crates/proof-of-sql/tests/integration_tests.rs

+79
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,85 @@ fn we_can_prove_a_basic_inequality_query_with_curve25519() {
160160
assert_eq!(owned_table_result, expected_result);
161161
}
162162

163+
#[test]
164+
#[cfg(feature = "blitzar")]
165+
fn we_can_prove_a_basic_query_containing_extrema_with_curve25519() {
166+
let mut accessor = OwnedTableTestAccessor::<InnerProductProof>::new_empty_with_setup(());
167+
accessor.add_table(
168+
"sxt.table".parse().unwrap(),
169+
owned_table([
170+
smallint("smallint", [i16::MIN, 0, i16::MAX]),
171+
int("int", [i32::MIN, 0, i32::MAX]),
172+
bigint("bigint", [i64::MIN, 0, i64::MAX]),
173+
int128("int128", [i128::MIN, 0, i128::MAX]),
174+
]),
175+
0,
176+
);
177+
let query = QueryExpr::try_new(
178+
"SELECT * FROM table".parse().unwrap(),
179+
"sxt".parse().unwrap(),
180+
&accessor,
181+
)
182+
.unwrap();
183+
let (proof, serialized_result) =
184+
QueryProof::<InnerProductProof>::new(query.proof_expr(), &accessor, &());
185+
let owned_table_result = proof
186+
.verify(query.proof_expr(), &accessor, &serialized_result, &())
187+
.unwrap()
188+
.table;
189+
let expected_result = owned_table([
190+
smallint("smallint", [i16::MIN, 0, i16::MAX]),
191+
int("int", [i32::MIN, 0, i32::MAX]),
192+
bigint("bigint", [i64::MIN, 0, i64::MAX]),
193+
int128("int128", [i128::MIN, 0, i128::MAX]),
194+
]);
195+
assert_eq!(owned_table_result, expected_result);
196+
}
197+
198+
#[test]
199+
#[cfg(feature = "blitzar")]
200+
fn we_can_prove_a_basic_query_containing_extrema_with_dory() {
201+
let dory_prover_setup = DoryProverPublicSetup::rand(4, 3, &mut test_rng());
202+
let dory_verifier_setup = (&dory_prover_setup).into();
203+
let mut accessor = OwnedTableTestAccessor::<DoryEvaluationProof>::new_empty_with_setup(
204+
dory_prover_setup.clone(),
205+
);
206+
accessor.add_table(
207+
"sxt.table".parse().unwrap(),
208+
owned_table([
209+
smallint("smallint", [i16::MIN, 0, i16::MAX]),
210+
int("int", [i32::MIN, 0, i32::MAX]),
211+
bigint("bigint", [i64::MIN, 0, i64::MAX]),
212+
int128("int128", [i128::MIN, 0, i128::MAX]),
213+
]),
214+
0,
215+
);
216+
let query = QueryExpr::try_new(
217+
"SELECT * FROM table".parse().unwrap(),
218+
"sxt".parse().unwrap(),
219+
&accessor,
220+
)
221+
.unwrap();
222+
let (proof, serialized_result) =
223+
QueryProof::<DoryEvaluationProof>::new(query.proof_expr(), &accessor, &dory_prover_setup);
224+
let owned_table_result = proof
225+
.verify(
226+
query.proof_expr(),
227+
&accessor,
228+
&serialized_result,
229+
&dory_verifier_setup,
230+
)
231+
.unwrap()
232+
.table;
233+
let expected_result = owned_table([
234+
smallint("smallint", [i16::MIN, 0, i16::MAX]),
235+
int("int", [i32::MIN, 0, i32::MAX]),
236+
bigint("bigint", [i64::MIN, 0, i64::MAX]),
237+
int128("int128", [i128::MIN, 0, i128::MAX]),
238+
]);
239+
assert_eq!(owned_table_result, expected_result);
240+
}
241+
163242
#[test]
164243
#[cfg(feature = "blitzar")]
165244
fn we_can_prove_a_query_with_arithmetic_in_where_clause_with_curve25519() {

0 commit comments

Comments
 (0)