Skip to content

Commit

Permalink
refactor: modified the CI to run the examples with the blitzer feat…
Browse files Browse the repository at this point in the history
…ure disabled and updated the `ReadMe.md` (#259)

# Rationale
Our example code leverages the `InnerProductProof` commitment scheme. While this is still valid, it is more difficult as an entry point to the code because it requires Linux (and GPU by default).

# What changes are included in this PR?

Updated the documents and disabled the `blitzer` feature in the CI

# Are these changes tested?

yes

---------

Signed-off-by: Abinand P <[email protected]>
  • Loading branch information
Abiji-2020 authored Oct 11, 2024
1 parent d79cbbf commit cbf5078
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 10 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,16 @@ jobs:
run: cargo test -p proof-of-sql --no-run --no-default-features --features="std"
- name: Run cargo test (proof primitives - Dory) (std feature only - i.e. not using blitzar)
run: cargo test proof_primitive::dory::dory_compute_commitments_test --no-default-features --features="std"
- name: Run hello_world example
run: cargo run --example hello_world --features="blitzar test"
- name: Run posql_db example
- name: Run hello_world example (With Blitzar)
run: cargo run --example hello_world --features="test"
- name: Run hello_world example (Without Blitzar and With Rayon)
run: cargo run --example hello_world --no-default-features --features="rayon test"
- name: Run hello_world example (Without Blitzar and Without Rayon)
run: cargo run --example hello_world --no-default-features --features="test"
- name: Run posql_db example (With Blitzar)
run: bash crates/proof-of-sql/examples/posql_db/run_example.sh
- name: Run posql_db example (Without Blitzar)
run: bash crates/proof-of-sql/examples/posql_db/run_example.sh --no-default-features --features="rayon"

clippy:
name: Clippy
Expand Down
7 changes: 6 additions & 1 deletion crates/proof-of-sql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,13 @@ The "Hello World" example demonstrates generating and verifying a proof of the q
#### Run

```bash
cargo run --example hello_world
cargo run --example hello_world
```
> [!NOTE]
> To run this example without the `blitzar` (i.e CPU only) feature:
> ```bash
> cargo run --example hello_world --no-default-features --features="rayon test"
> ```

#### Output

Expand Down
10 changes: 8 additions & 2 deletions crates/proof-of-sql/examples/hello_world/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,15 @@ This example demonstrates generating and verifying a proof of the query `SELECT
#### Run

```bash
cargo run --example hello_world
cargo run --example hello_world
```

> [!NOTE]
> To run this example without the `blitzar` (i.e CPU only) feature:
> ```bash
> cargo run --example hello_world --no-default-features --features="test rayon"
> ```
#### Output
```
Expand All @@ -25,4 +31,4 @@ Generating Proof... 467.45371ms
Verifying Proof... 7.106864ms
Valid proof!
Query result: OwnedTable { table: {Identifier { name: "b" }: VarChar(["hello", "world"])} }
```
```
6 changes: 6 additions & 0 deletions crates/proof-of-sql/examples/posql_db/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ Example demonstrating an implementation of a simple csv-backed database with Pro
## Install
Run `cargo install --example posql_db --path crates/proof-of-sql` to install the example.

> [!NOTE]
> To run this example without the `blitzar` (i.e CPU only )feature
> ```bash
> cargo install --example posql_db --path crates/proof-of-sql --no-default-features --features="rayon"
> ```
## Quick Start Exmaple
Run the following
```bash
Expand Down
8 changes: 4 additions & 4 deletions crates/proof-of-sql/examples/posql_db/run_example.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cd crates/proof-of-sql/examples/posql_db
cargo run --features="arrow " --example posql_db create -t sxt.table -c a,b -d BIGINT,VARCHAR
cargo run --features="arrow " --example posql_db append -t sxt.table -f hello_world.csv
cargo run --features="arrow " --example posql_db prove -q "SELECT b FROM sxt.table WHERE a = 2" -f hello.proof
cargo run --features="arrow " --example posql_db verify -q "SELECT b FROM sxt.table WHERE a = 2" -f hello.proof
cargo run --features="arrow" "$@" --example posql_db create -t sxt.table -c a,b -d BIGINT,VARCHAR
cargo run --features="arrow" "$@" --example posql_db append -t sxt.table -f hello_world.csv
cargo run --features="arrow" "$@" --example posql_db prove -q "SELECT b FROM sxt.table WHERE a = 2" -f hello.proof
cargo run --features="arrow" "$@" --example posql_db verify -q "SELECT b FROM sxt.table WHERE a = 2" -f hello.proof

0 comments on commit cbf5078

Please sign in to comment.