Skip to content

Commit

Permalink
Merge branch 'main' into update-examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Abiji-2020 authored Oct 11, 2024
2 parents 77f87e9 + 25db238 commit 800d0cd
Show file tree
Hide file tree
Showing 39 changed files with 315 additions and 749 deletions.
8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,11 @@ cast_lossless = "deny"
redundant_closure_for_method_calls = "deny"
inconsistent_struct_constructor = "deny"
default_trait_access = "deny"
module_name_repetitions = "deny"
wildcard_imports = "deny"
unused_self = "deny"
manual_let_else = "deny"
struct_field_names = "deny"
unicode_not_nfc = "deny"
manual_string_new = "deny"
large_types_passed_by_value = "deny"
9 changes: 7 additions & 2 deletions crates/proof-of-sql-parser/src/intermediate_ast_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ use crate::{
utility::*,
SelectStatement,
};
use alloc::{borrow::ToOwned, string::ToString, vec};
use alloc::{
borrow::ToOwned,
string::{String, ToString},
vec,
};

// Sting parser tests
#[test]
Expand All @@ -26,7 +30,7 @@ fn we_can_correctly_escape_the_single_quote_character() {

#[test]
fn we_can_parse_empty_strings() {
assert_eq!(StringLiteralParser::new().parse("''"), Ok("".to_string()));
assert_eq!(StringLiteralParser::new().parse("''"), Ok(String::new()));
}

#[test]
Expand Down Expand Up @@ -108,6 +112,7 @@ fn we_can_parse_strings_having_control_characters() {
);
}

#[allow(clippy::unicode_not_nfc)]
#[test]
fn unnormalized_strings_should_differ() {
let lhs = StringLiteralParser::new().parse("'á'").unwrap();
Expand Down
2 changes: 1 addition & 1 deletion crates/proof-of-sql/benches/scaffold/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ pub fn jaeger_scaffold<CP: CommitmentEvaluationProof>(
.unwrap();
}

#[allow(dead_code)]
#[allow(dead_code, clippy::module_name_repetitions)]
pub fn criterion_scaffold<CP: CommitmentEvaluationProof>(
c: &mut Criterion,
title: &str,
Expand Down
6 changes: 5 additions & 1 deletion crates/proof-of-sql/examples/hello_world/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
use ark_std::test_rng;
use blitzar::compute::init_backend;
use proof_of_sql::{
base::database::{owned_table_utility::*, OwnedTableTestAccessor, TestAccessor},
proof_primitive::dory::{
DynamicDoryEvaluationProof, ProverSetup, PublicParameters, VerifierSetup,
},

base::database::{
owned_table_utility::{bigint, owned_table, varchar},
OwnedTableTestAccessor, TestAccessor,
},
sql::{parse::QueryExpr, proof::QueryProof},
};
Expand Down
14 changes: 13 additions & 1 deletion crates/proof-of-sql/src/base/database/owned_column_operation.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
use super::{ColumnOperationError, ColumnOperationResult};
use crate::base::{
database::{column_operation::*, OwnedColumn},
database::{
column_operation::{
eq_decimal_columns, ge_decimal_columns, le_decimal_columns, slice_and, slice_eq,
slice_eq_with_casting, slice_ge, slice_ge_with_casting, slice_le,
slice_le_with_casting, slice_not, slice_or, try_add_decimal_columns, try_add_slices,
try_add_slices_with_casting, try_divide_decimal_columns, try_divide_slices,
try_divide_slices_left_upcast, try_divide_slices_right_upcast,
try_multiply_decimal_columns, try_multiply_slices, try_multiply_slices_with_casting,
try_subtract_decimal_columns, try_subtract_slices, try_subtract_slices_left_upcast,
try_subtract_slices_right_upcast,
},
OwnedColumn,
},
scalar::Scalar,
};
use core::ops::{Add, Div, Mul, Sub};
Expand Down
5 changes: 5 additions & 0 deletions crates/proof-of-sql/src/proof_primitive/dory/dory_messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use ark_ff::Field;
use ark_serialize::{CanonicalDeserialize, CanonicalSerialize};
use num_traits::Zero;

#[allow(clippy::struct_field_names)]
#[derive(Default, Clone, CanonicalSerialize, CanonicalDeserialize, PartialEq, Eq, Debug)]
/// The messages sent from the prover to the verifier in the interactive protocol.
/// This is, in essence, the proof.
Expand Down Expand Up @@ -51,6 +52,8 @@ impl DoryMessages {
transcript.extend_canonical_serialize_as_le(&message);
self.G2_messages.insert(0, message);
}

#[allow(clippy::large_types_passed_by_value)]
/// Pushes a GT element from the prover onto the queue, and appends it to the transcript.
pub(super) fn prover_send_GT_message(&mut self, transcript: &mut impl Transcript, message: GT) {
transcript.extend_canonical_serialize_as_le(&message);
Expand Down Expand Up @@ -102,6 +105,8 @@ impl DoryMessages {
transcript.extend_canonical_serialize_as_le(&message);
message
}

#[allow(clippy::unused_self)]
/// This is the F message that the verifier sends to the prover.
/// This message is produces as a challenge from the transcript.
///
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
use super::{
dory_reduce_helper::*,
extended_dory_reduce_helper::*,
dory_reduce_helper::{
dory_reduce_prove_compute_Cs, dory_reduce_prove_compute_Ds, dory_reduce_prove_fold_v_vecs,
dory_reduce_prove_mutate_v_vecs, dory_reduce_verify_update_C, dory_reduce_verify_update_Ds,
},
extended_dory_reduce_helper::{
extended_dory_reduce_prove_compute_E_betas, extended_dory_reduce_prove_compute_signed_Es,
extended_dory_reduce_prove_fold_s_vecs, extended_dory_reduce_verify_update_Es,
},
extended_state::{ExtendedProverState, ExtendedVerifierState},
DoryMessages, ProverSetup, VerifierSetup,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ impl DynProofExprBuilder<'_> {
)))
}

#[allow(clippy::unused_self)]
fn visit_literal<C: Commitment>(
&self,
lit: &Literal,
Expand Down
1 change: 1 addition & 0 deletions crates/proof-of-sql/src/sql/parse/query_context_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ impl<'a> QueryContextBuilder<'a> {
}
}

#[allow(clippy::unused_self)]
fn visit_literal(&self, literal: &Literal) -> Result<ColumnType, ConversionError> {
match literal {
Literal::Boolean(_) => Ok(ColumnType::Boolean),
Expand Down
111 changes: 0 additions & 111 deletions crates/proof-of-sql/src/sql/proof/indexes.rs

This file was deleted.

Loading

0 comments on commit 800d0cd

Please sign in to comment.