From a32364a35075030896d6804f1e17b766aeb6b12c Mon Sep 17 00:00:00 2001 From: Mehul Mathur Date: Tue, 8 Oct 2024 01:04:54 +0530 Subject: [PATCH] chore: resolve `clippy::inconsistent_struct_constructor` and `clippy::default_trait_access` lints in `proof-of-sql` (#224) # Rationale for this change We have cargo clippy running in our CI in order to enforce code quality. In order to increase our standards, we should enable the clippy::pedantic lint group. # What changes are included in this PR? This PR fixes `clippy::inconsistent_struct_constructor` and `clippy::default_trait_access` for proof-of-sql lib. # Are these changes tested? Yes. --- Cargo.toml | 2 ++ .../examples/posql_db/commit_accessor.rs | 3 ++- .../proof-of-sql/examples/posql_db/csv_accessor.rs | 2 +- .../src/base/commitment/column_commitments.rs | 4 ++-- .../base/commitment/commitment_evaluation_proof.rs | 6 +++--- crates/proof-of-sql/src/base/commitment/mod.rs | 5 ++++- crates/proof-of-sql/src/base/database/column.rs | 2 +- .../src/base/database/owned_table_test_accessor.rs | 4 ++-- .../proof-of-sql/src/base/database/test_accessor.rs | 2 +- crates/proof-of-sql/src/base/scalar/mont_scalar.rs | 2 +- .../src/proof_primitive/dory/build_vmv_state.rs | 4 ++-- .../dory/dory_commitment_evaluation_proof.rs | 6 +++--- .../src/proof_primitive/dory/dory_vmv_helper.rs | 7 ++++--- .../dynamic_dory_commitment_evaluation_proof.rs | 6 +++--- .../src/proof_primitive/dory/dynamic_dory_helper.rs | 2 +- .../src/proof_primitive/dory/extended_state.rs | 13 +++++++------ .../src/proof_primitive/dory/extended_state_test.rs | 5 +++-- .../src/proof_primitive/dory/public_parameters.rs | 2 +- .../src/proof_primitive/dory/vmv_state.rs | 9 +++++---- .../src/proof_primitive/sumcheck/proof_test.rs | 4 ++-- crates/proof-of-sql/src/sql/proof/count_builder.rs | 2 +- crates/proof-of-sql/src/sql/proof/indexes.rs | 2 +- crates/proof-of-sql/src/sql/proof/indexes_test.rs | 7 +++++-- .../src/sql/proof/verifiable_query_result_test.rs | 4 ++-- .../src/sql/proof_exprs/sign_expr_test.rs | 6 +++--- .../src/sql/proof_plans/group_by_exec.rs | 2 +- 26 files changed, 63 insertions(+), 50 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index fa3578ca2..744758955 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -80,3 +80,5 @@ range_plus_one = "deny" cloned_instead_of_copied = "deny" from_iter_instead_of_collect = "deny" cast_lossless = "deny" +inconsistent_struct_constructor = "deny" +default_trait_access = "deny" diff --git a/crates/proof-of-sql/examples/posql_db/commit_accessor.rs b/crates/proof-of-sql/examples/posql_db/commit_accessor.rs index cd3fa5d95..b05e96050 100644 --- a/crates/proof-of-sql/examples/posql_db/commit_accessor.rs +++ b/crates/proof-of-sql/examples/posql_db/commit_accessor.rs @@ -1,4 +1,5 @@ use core::error::Error; +use indexmap::IndexMap; use proof_of_sql::base::{ commitment::{Commitment, QueryCommitments, TableCommitment}, database::{CommitmentAccessor, MetadataAccessor, SchemaAccessor, TableRef}, @@ -13,7 +14,7 @@ impl Deserialize<'a>> CommitAccessor { pub fn new(base_path: PathBuf) -> Self { Self { base_path, - inner: Default::default(), + inner: IndexMap::default(), } } pub fn write_commit( diff --git a/crates/proof-of-sql/examples/posql_db/csv_accessor.rs b/crates/proof-of-sql/examples/posql_db/csv_accessor.rs index 2dbbfb64b..f513db428 100644 --- a/crates/proof-of-sql/examples/posql_db/csv_accessor.rs +++ b/crates/proof-of-sql/examples/posql_db/csv_accessor.rs @@ -44,7 +44,7 @@ impl CsvDataAccessor { pub fn new(base_path: PathBuf) -> Self { Self { base_path, - inner: Default::default(), + inner: RecordBatchAccessor::default(), } } pub fn load_table( diff --git a/crates/proof-of-sql/src/base/commitment/column_commitments.rs b/crates/proof-of-sql/src/base/commitment/column_commitments.rs index c84779051..908d3589e 100644 --- a/crates/proof-of-sql/src/base/commitment/column_commitments.rs +++ b/crates/proof-of-sql/src/base/commitment/column_commitments.rs @@ -272,8 +272,8 @@ impl ColumnCommitments { .expect("we've already checked that self and other have equal column counts"); Ok(ColumnCommitments { - column_metadata, commitments, + column_metadata, }) } @@ -293,8 +293,8 @@ impl ColumnCommitments { .expect("we've already checked that self and other have equal column counts"); Ok(ColumnCommitments { - column_metadata, commitments, + column_metadata, }) } } diff --git a/crates/proof-of-sql/src/base/commitment/commitment_evaluation_proof.rs b/crates/proof-of-sql/src/base/commitment/commitment_evaluation_proof.rs index 81313a03e..17258823a 100644 --- a/crates/proof-of-sql/src/base/commitment/commitment_evaluation_proof.rs +++ b/crates/proof-of-sql/src/base/commitment/commitment_evaluation_proof.rs @@ -93,7 +93,7 @@ impl CommitmentEvaluationProof for InnerProductProof { _setup: &Self::ProverPublicSetup<'_>, ) -> Self { assert!(!a.is_empty()); - let b = &mut vec![Default::default(); a.len()]; + let b = &mut vec![MontScalar::default(); a.len()]; if b_point.is_empty() { assert_eq!(b.len(), 1); b[0] = Self::Scalar::ONE; @@ -124,7 +124,7 @@ impl CommitmentEvaluationProof for InnerProductProof { _setup: &Self::VerifierPublicSetup<'_>, ) -> Result<(), Self::Error> { assert!(table_length > 0); - let b = &mut vec![Default::default(); table_length]; + let b = &mut vec![MontScalar::default(); table_length]; if b_point.is_empty() { assert_eq!(b.len(), 1); b[0] = Self::Scalar::ONE; @@ -140,7 +140,7 @@ impl CommitmentEvaluationProof for InnerProductProof { .iter() .zip(batching_factors.iter()) .map(|(c, m)| *m * c) - .fold(Default::default(), |mut a, c| { + .fold(RistrettoPoint::default(), |mut a, c| { a += c; a }), diff --git a/crates/proof-of-sql/src/base/commitment/mod.rs b/crates/proof-of-sql/src/base/commitment/mod.rs index 1168e7bc9..48502fbe8 100644 --- a/crates/proof-of-sql/src/base/commitment/mod.rs +++ b/crates/proof-of-sql/src/base/commitment/mod.rs @@ -100,8 +100,11 @@ impl Commitment for RistrettoPoint { offset: usize, _setup: &Self::PublicSetup<'_>, ) -> Vec { + use curve25519_dalek::ristretto::CompressedRistretto; + let sequences: Vec<_> = committable_columns.iter().map(Into::into).collect(); - let mut compressed_commitments = vec![Default::default(); committable_columns.len()]; + let mut compressed_commitments = + vec![CompressedRistretto::default(); committable_columns.len()]; blitzar::compute::compute_curve25519_commitments( &mut compressed_commitments, &sequences, diff --git a/crates/proof-of-sql/src/base/database/column.rs b/crates/proof-of-sql/src/base/database/column.rs index 78833c37c..bbf9ac07a 100644 --- a/crates/proof-of-sql/src/base/database/column.rs +++ b/crates/proof-of-sql/src/base/database/column.rs @@ -515,8 +515,8 @@ impl ColumnRef { pub fn new(table_ref: TableRef, column_id: Identifier, column_type: ColumnType) -> Self { Self { column_id, - column_type, table_ref, + column_type, } } diff --git a/crates/proof-of-sql/src/base/database/owned_table_test_accessor.rs b/crates/proof-of-sql/src/base/database/owned_table_test_accessor.rs index 05b3cea6f..cbcb26de8 100644 --- a/crates/proof-of-sql/src/base/database/owned_table_test_accessor.rs +++ b/crates/proof-of-sql/src/base/database/owned_table_test_accessor.rs @@ -20,7 +20,7 @@ pub struct OwnedTableTestAccessor<'a, CP: CommitmentEvaluationProof> { impl Default for OwnedTableTestAccessor<'_, CP> { fn default() -> Self { Self { - tables: Default::default(), + tables: IndexMap::default(), alloc: Bump::new(), setup: None, } @@ -43,7 +43,7 @@ impl TestAccessor type Table = OwnedTable; fn new_empty() -> Self { - Default::default() + OwnedTableTestAccessor::default() } fn add_table(&mut self, table_ref: TableRef, data: Self::Table, table_offset: usize) { diff --git a/crates/proof-of-sql/src/base/database/test_accessor.rs b/crates/proof-of-sql/src/base/database/test_accessor.rs index f76dd8989..cd9da1d65 100644 --- a/crates/proof-of-sql/src/base/database/test_accessor.rs +++ b/crates/proof-of-sql/src/base/database/test_accessor.rs @@ -38,7 +38,7 @@ impl TestAccessor for UnimplementedTestAccessor { type Table = (); fn new_empty() -> Self { - Default::default() + UnimplementedTestAccessor } fn add_table(&mut self, _table_ref: TableRef, _data: (), _table_offset: usize) { diff --git a/crates/proof-of-sql/src/base/scalar/mont_scalar.rs b/crates/proof-of-sql/src/base/scalar/mont_scalar.rs index 056817a9a..4705b3607 100644 --- a/crates/proof-of-sql/src/base/scalar/mont_scalar.rs +++ b/crates/proof-of-sql/src/base/scalar/mont_scalar.rs @@ -94,7 +94,7 @@ impl> PartialEq for MontScalar { } impl> Default for MontScalar { fn default() -> Self { - Self(Default::default()) + Self(Fp::default()) } } impl> Debug for MontScalar { diff --git a/crates/proof-of-sql/src/proof_primitive/dory/build_vmv_state.rs b/crates/proof-of-sql/src/proof_primitive/dory/build_vmv_state.rs index 0acf2ce90..2cce36810 100644 --- a/crates/proof-of-sql/src/proof_primitive/dory/build_vmv_state.rs +++ b/crates/proof-of-sql/src/proof_primitive/dory/build_vmv_state.rs @@ -19,12 +19,12 @@ pub(super) fn build_vmv_prover_state( VMVProverState { v_vec, T_vec_prime, - L_vec, - R_vec, #[cfg(test)] l_tensor, #[cfg(test)] r_tensor, + L_vec, + R_vec, nu, } } diff --git a/crates/proof-of-sql/src/proof_primitive/dory/dory_commitment_evaluation_proof.rs b/crates/proof-of-sql/src/proof_primitive/dory/dory_commitment_evaluation_proof.rs index 2452e3bd1..3ca7c263f 100644 --- a/crates/proof-of-sql/src/proof_primitive/dory/dory_commitment_evaluation_proof.rs +++ b/crates/proof-of-sql/src/proof_primitive/dory/dory_commitment_evaluation_proof.rs @@ -44,19 +44,19 @@ impl CommitmentEvaluationProof for DoryEvaluationProof { if generators_offset != 0 { // TODO: support offsets other than 0. // Note: this will always result in a verification error. - return Default::default(); + return DoryMessages::default(); } let a: &[F] = bytemuck::TransparentWrapper::peel_slice(a); let b_point: &[F] = bytemuck::TransparentWrapper::peel_slice(b_point); let prover_setup = setup.prover_setup(); let nu = compute_nu(b_point.len(), setup.sigma()); if nu > prover_setup.max_nu { - return Default::default(); // Note: this will always result in a verification error. + return DoryMessages::default(); // Note: this will always result in a verification error. } let T_vec_prime = compute_T_vec_prime(a, setup.sigma(), nu, prover_setup); let state = build_vmv_prover_state(a, b_point, T_vec_prime, setup.sigma(), nu); - let mut messages = Default::default(); + let mut messages = DoryMessages::default(); let extended_state = eval_vmv_re_prove(&mut messages, transcript, state, prover_setup); extended_dory_inner_product_prove(&mut messages, transcript, extended_state, prover_setup); messages diff --git a/crates/proof-of-sql/src/proof_primitive/dory/dory_vmv_helper.rs b/crates/proof-of-sql/src/proof_primitive/dory/dory_vmv_helper.rs index 830ae0eb5..a1534f913 100644 --- a/crates/proof-of-sql/src/proof_primitive/dory/dory_vmv_helper.rs +++ b/crates/proof-of-sql/src/proof_primitive/dory/dory_vmv_helper.rs @@ -145,6 +145,7 @@ pub(super) fn compute_l_r_tensors(b_point: &[F], sigma: usize, nu: usize) -> (Ve #[cfg(test)] mod tests { use super::*; + use ark_ff::Fp; use ark_std::UniformRand; use core::iter::repeat_with; @@ -163,7 +164,7 @@ mod tests { } /// This is the naive inner product. It is used to check the correctness of the `compute_LMR` method. fn compute_ab_inner_product(a: &[F], b_point: &[F]) -> F { - let mut b = vec![Default::default(); a.len()]; + let mut b = vec![Fp::default(); a.len()]; compute_evaluation_vector(&mut b, b_point); a.iter().zip(b.iter()).map(|(a, b)| a * b).sum() } @@ -177,8 +178,8 @@ mod tests { assert_eq!(LMR, ab); } fn check_L_R_vecs_with_l_r_tensors(L: &[F], R: &[F], l: &[F], r: &[F]) { - let mut l_vec = vec![Default::default(); 1 << l.len()]; - let mut r_vec = vec![Default::default(); 1 << r.len()]; + let mut l_vec = vec![Fp::default(); 1 << l.len()]; + let mut r_vec = vec![Fp::default(); 1 << r.len()]; compute_evaluation_vector(&mut l_vec, l); compute_evaluation_vector(&mut r_vec, r); assert_eq!(l_vec, L); diff --git a/crates/proof-of-sql/src/proof_primitive/dory/dynamic_dory_commitment_evaluation_proof.rs b/crates/proof-of-sql/src/proof_primitive/dory/dynamic_dory_commitment_evaluation_proof.rs index 653340440..52c92cc85 100644 --- a/crates/proof-of-sql/src/proof_primitive/dory/dynamic_dory_commitment_evaluation_proof.rs +++ b/crates/proof-of-sql/src/proof_primitive/dory/dynamic_dory_commitment_evaluation_proof.rs @@ -46,18 +46,18 @@ impl CommitmentEvaluationProof for DynamicDoryEvaluationProof { if generators_offset != 0 { // TODO: support offsets other than 0. // Note: this will always result in a verification error. - return Default::default(); + return DynamicDoryEvaluationProof::default(); } let a: &[F] = bytemuck::TransparentWrapper::peel_slice(a); let b_point: &[F] = bytemuck::TransparentWrapper::peel_slice(b_point); let nu = compute_dynamic_nu(b_point.len()); if nu > setup.max_nu { - return Default::default(); // Note: this will always result in a verification error. + return DynamicDoryEvaluationProof::default(); // Note: this will always result in a verification error. } let T_vec_prime = compute_dynamic_T_vec_prime(a, nu, setup); let state = build_dynamic_vmv_prover_state(a, b_point, T_vec_prime, nu); - let mut messages = Default::default(); + let mut messages = DoryMessages::default(); let extended_state = eval_vmv_re_prove(&mut messages, transcript, state, setup); extended_dory_inner_product_prove(&mut messages, transcript, extended_state, setup); Self(messages) diff --git a/crates/proof-of-sql/src/proof_primitive/dory/dynamic_dory_helper.rs b/crates/proof-of-sql/src/proof_primitive/dory/dynamic_dory_helper.rs index aab56bd7c..32fc0b5a0 100644 --- a/crates/proof-of-sql/src/proof_primitive/dory/dynamic_dory_helper.rs +++ b/crates/proof-of-sql/src/proof_primitive/dory/dynamic_dory_helper.rs @@ -222,7 +222,7 @@ mod tests { D_2: DeferredMSM::new([], []), nu, }, - s2_tensor: Default::default(), + s2_tensor: Vec::default(), }; let (lo_fold, hi_fold) = fold_dynamic_tensors(&state); diff --git a/crates/proof-of-sql/src/proof_primitive/dory/extended_state.rs b/crates/proof-of-sql/src/proof_primitive/dory/extended_state.rs index 60389029b..d2764b336 100644 --- a/crates/proof-of-sql/src/proof_primitive/dory/extended_state.rs +++ b/crates/proof-of-sql/src/proof_primitive/dory/extended_state.rs @@ -6,6 +6,7 @@ use super::{G1Affine, G1Projective, G2Projective, ProverSetup}; use alloc::{vec, vec::Vec}; #[cfg(test)] use ark_ec::VariableBaseMSM; +use ark_ff::Fp; /// The state of the prover during the Dory proof generation with the extended algorithm. /// `base_state` is the state of the prover during the Dory proof generation with the original algorithm. @@ -53,8 +54,8 @@ impl ExtendedProverState { use crate::base::polynomial::compute_evaluation_vector; assert_eq!(s1_tensor.len(), nu); assert_eq!(s2_tensor.len(), nu); - let mut s1 = vec![Default::default(); 1 << nu]; - let mut s2 = vec![Default::default(); 1 << nu]; + let mut s1 = vec![Fp::default(); 1 << nu]; + let mut s2 = vec![Fp::default(); 1 << nu]; compute_evaluation_vector(&mut s1, &s1_tensor); compute_evaluation_vector(&mut s2, &s2_tensor); ExtendedProverState { @@ -80,8 +81,8 @@ impl ExtendedProverState { E_2: E_2.into(), s1_tensor: self.s1_tensor.clone(), s2_tensor: self.s2_tensor.clone(), - alphas: vec![Default::default(); self.base_state.nu], - alpha_invs: vec![Default::default(); self.base_state.nu], + alphas: vec![Fp::default(); self.base_state.nu], + alpha_invs: vec![Fp::default(); self.base_state.nu], } } } @@ -127,8 +128,8 @@ impl ExtendedVerifierState { E_2, s1_tensor, s2_tensor, - alphas: vec![Default::default(); nu], - alpha_invs: vec![Default::default(); nu], + alphas: vec![Fp::default(); nu], + alpha_invs: vec![Fp::default(); nu], } } } diff --git a/crates/proof-of-sql/src/proof_primitive/dory/extended_state_test.rs b/crates/proof-of-sql/src/proof_primitive/dory/extended_state_test.rs index 8cd62547e..d958156c6 100644 --- a/crates/proof-of-sql/src/proof_primitive/dory/extended_state_test.rs +++ b/crates/proof-of-sql/src/proof_primitive/dory/extended_state_test.rs @@ -4,6 +4,7 @@ use super::{ }; use crate::base::polynomial::compute_evaluation_vector; use ark_ec::{pairing::Pairing, VariableBaseMSM}; +use ark_ff::Fp; #[test] pub fn we_can_create_an_extended_verifier_state_from_an_extended_prover_state() { @@ -14,8 +15,8 @@ pub fn we_can_create_an_extended_verifier_state_from_an_extended_prover_state() for nu in 0..max_nu { let (v1, v2) = rand_G_vecs(nu, &mut rng); let (s1_tensor, s2_tensor) = rand_F_tensors(nu, &mut rng); - let mut s1 = vec![Default::default(); 1 << nu]; - let mut s2 = vec![Default::default(); 1 << nu]; + let mut s1 = vec![Fp::default(); 1 << nu]; + let mut s2 = vec![Fp::default(); 1 << nu]; compute_evaluation_vector(&mut s1, &s1_tensor); compute_evaluation_vector(&mut s2, &s2_tensor); let extended_prover_state = ExtendedProverState::new_from_tensors( diff --git a/crates/proof-of-sql/src/proof_primitive/dory/public_parameters.rs b/crates/proof-of-sql/src/proof_primitive/dory/public_parameters.rs index b1f8925c4..c2d1b98a1 100644 --- a/crates/proof-of-sql/src/proof_primitive/dory/public_parameters.rs +++ b/crates/proof-of-sql/src/proof_primitive/dory/public_parameters.rs @@ -44,10 +44,10 @@ impl PublicParameters { Self { Gamma_1, Gamma_2, - max_nu, H_1, H_2, Gamma_2_fin, + max_nu, } } } diff --git a/crates/proof-of-sql/src/proof_primitive/dory/vmv_state.rs b/crates/proof-of-sql/src/proof_primitive/dory/vmv_state.rs index 9d8de717f..0824cedd0 100644 --- a/crates/proof-of-sql/src/proof_primitive/dory/vmv_state.rs +++ b/crates/proof-of-sql/src/proof_primitive/dory/vmv_state.rs @@ -92,17 +92,18 @@ impl VMV { nu: usize, ) -> Self { use crate::base::polynomial::compute_evaluation_vector; + use ark_ff::Fp; - let mut L = vec![Default::default(); 1 << l_tensor.len()]; - let mut R = vec![Default::default(); 1 << r_tensor.len()]; + let mut L = vec![Fp::default(); 1 << l_tensor.len()]; + let mut R = vec![Fp::default(); 1 << r_tensor.len()]; compute_evaluation_vector(&mut L, &l_tensor); compute_evaluation_vector(&mut R, &r_tensor); Self { M, - L, - R, l_tensor, r_tensor, + L, + R, nu, } } diff --git a/crates/proof-of-sql/src/proof_primitive/sumcheck/proof_test.rs b/crates/proof-of-sql/src/proof_primitive/sumcheck/proof_test.rs index 8f1977d98..97f9ea5ab 100644 --- a/crates/proof-of-sql/src/proof_primitive/sumcheck/proof_test.rs +++ b/crates/proof-of-sql/src/proof_primitive/sumcheck/proof_test.rs @@ -2,7 +2,7 @@ use super::test_cases::sumcheck_test_cases; use crate::base::{ polynomial::{CompositePolynomial, CompositePolynomialInfo}, proof::Transcript as _, - scalar::{test_scalar::TestScalar, Curve25519Scalar, Scalar}, + scalar::{test_scalar::TestScalar, Curve25519Scalar, MontScalar, Scalar}, }; /* * Adopted from arkworks @@ -168,7 +168,7 @@ fn we_can_verify_many_random_test_cases() { for test_case in sumcheck_test_cases::(&mut rng) { let mut transcript = Transcript::new(b"sumchecktest"); - let mut evaluation_point = vec![Default::default(); test_case.num_vars]; + let mut evaluation_point = vec![MontScalar::default(); test_case.num_vars]; let proof = SumcheckProof::create( &mut transcript, &mut evaluation_point, diff --git a/crates/proof-of-sql/src/sql/proof/count_builder.rs b/crates/proof-of-sql/src/sql/proof/count_builder.rs index e3fe6122a..3229b9edc 100644 --- a/crates/proof-of-sql/src/sql/proof/count_builder.rs +++ b/crates/proof-of-sql/src/sql/proof/count_builder.rs @@ -14,7 +14,7 @@ impl<'a> CountBuilder<'a> { pub fn new(bit_distributions: &'a [BitDistribution]) -> Self { Self { bit_distributions, - counts: Default::default(), + counts: ProofCounts::default(), } } diff --git a/crates/proof-of-sql/src/sql/proof/indexes.rs b/crates/proof-of-sql/src/sql/proof/indexes.rs index 561a6d542..4dc97470c 100644 --- a/crates/proof-of-sql/src/sql/proof/indexes.rs +++ b/crates/proof-of-sql/src/sql/proof/indexes.rs @@ -15,7 +15,7 @@ pub enum Indexes { impl Default for Indexes { fn default() -> Self { - Self::Sparse(Default::default()) + Self::Sparse(Vec::default()) } } diff --git a/crates/proof-of-sql/src/sql/proof/indexes_test.rs b/crates/proof-of-sql/src/sql/proof/indexes_test.rs index 48b05c5c9..b6a717f8d 100644 --- a/crates/proof-of-sql/src/sql/proof/indexes_test.rs +++ b/crates/proof-of-sql/src/sql/proof/indexes_test.rs @@ -1,5 +1,8 @@ use super::Indexes; -use crate::base::{polynomial::compute_evaluation_vector, scalar::Curve25519Scalar}; +use crate::base::{ + polynomial::compute_evaluation_vector, + scalar::{Curve25519Scalar, MontScalar}, +}; use num_traits::Zero; #[test] @@ -169,7 +172,7 @@ fn we_can_evaluate_indexes_at_an_evaluation_point() { Curve25519Scalar::from(5u64), Curve25519Scalar::from(7u64), ]; - let mut evaluation_vector = vec![Default::default(); 8]; + let mut evaluation_vector = vec![MontScalar::default(); 8]; compute_evaluation_vector(&mut evaluation_vector, &evaluation_point); let ix = Indexes::Sparse(vec![0, 1, 1]); diff --git a/crates/proof-of-sql/src/sql/proof/verifiable_query_result_test.rs b/crates/proof-of-sql/src/sql/proof/verifiable_query_result_test.rs index 871103c28..02efaf453 100644 --- a/crates/proof-of-sql/src/sql/proof/verifiable_query_result_test.rs +++ b/crates/proof-of-sql/src/sql/proof/verifiable_query_result_test.rs @@ -14,7 +14,7 @@ use crate::{ proof::ProofError, scalar::Scalar, }, - sql::proof::{QueryData, ResultBuilder}, + sql::proof::{ProvableQueryResult, QueryData, ResultBuilder}, }; use bumpalo::Bump; use serde::Serialize; @@ -113,7 +113,7 @@ fn empty_verification_fails_if_the_result_contains_non_null_members() { }; let accessor = UnimplementedTestAccessor::new_empty(); let res = VerifiableQueryResult:: { - provable_result: Some(Default::default()), + provable_result: Some(ProvableQueryResult::default()), proof: None, }; assert!(res.verify(&expr, &accessor, &()).is_err()); diff --git a/crates/proof-of-sql/src/sql/proof_exprs/sign_expr_test.rs b/crates/proof-of-sql/src/sql/proof_exprs/sign_expr_test.rs index ca6a89cfd..f8177d551 100644 --- a/crates/proof-of-sql/src/sql/proof_exprs/sign_expr_test.rs +++ b/crates/proof-of-sql/src/sql/proof_exprs/sign_expr_test.rs @@ -2,7 +2,7 @@ use super::{count_sign, prover_evaluate_sign, result_evaluate_sign, verifier_eva use crate::{ base::{bit::BitDistribution, polynomial::MultilinearExtension, scalar::Curve25519Scalar}, sql::proof::{ - CountBuilder, ProofBuilder, SumcheckMleEvaluations, SumcheckRandomScalars, + CountBuilder, Indexes, ProofBuilder, SumcheckMleEvaluations, SumcheckRandomScalars, VerificationBuilder, }, }; @@ -62,7 +62,7 @@ fn we_can_verify_a_constant_decomposition() { &evaluation_point, &sumcheck_random_scalars, &[], - &Default::default(), + &Indexes::default(), ); let one_eval = sumcheck_evaluations.one_evaluation; @@ -86,7 +86,7 @@ fn verification_of_constant_data_fails_if_the_commitment_doesnt_match_the_bit_di &evaluation_point, &sumcheck_random_scalars, &[], - &Default::default(), + &Indexes::default(), ); let one_eval = sumcheck_evaluations.one_evaluation; diff --git a/crates/proof-of-sql/src/sql/proof_plans/group_by_exec.rs b/crates/proof-of-sql/src/sql/proof_plans/group_by_exec.rs index 4bc1e5515..05587d860 100644 --- a/crates/proof-of-sql/src/sql/proof_plans/group_by_exec.rs +++ b/crates/proof-of-sql/src/sql/proof_plans/group_by_exec.rs @@ -61,8 +61,8 @@ impl GroupByExec { Self { group_by_exprs, sum_expr, - table, count_alias, + table, where_clause, } }