Skip to content

Commit

Permalink
fix: allow SuperNova compressed proof serialization and size computat…
Browse files Browse the repository at this point in the history
…ion (#1016)

- Added serialization for the compressed proof using bincode in `sha256_nivc.rs`
- Implemented computation and display of serialized compressed proof size
- Introduced `serde` bound attribute to the `Proof` enum in `supernova.rs`

Fixes #1006
  • Loading branch information
huitseeker authored Jan 3, 2024
1 parent 3f7f653 commit 71db5fb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/sha256_ivc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ fn main() {

println!("Compression took {:?}", compress_end);

let buf = bincode::serialize(&compressed_proof).unwrap();
println!("proof size : {:}B", buf.len());

let compressed_verify_start = Instant::now();
let res = compressed_proof.verify(&pp, &z0, &zi).unwrap();
let compressed_verify_end = compressed_verify_start.elapsed();
Expand Down
3 changes: 3 additions & 0 deletions examples/sha256_nivc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ fn main() {

println!("Compression took {:?}", compress_end);

let buf = bincode::serialize(&compressed_proof).unwrap();
println!("proof size : {:}B", buf.len());

let compressed_verify_start = Instant::now();
let res = compressed_proof.verify(&pp, &z0, &zi).unwrap();
let compressed_verify_end = compressed_verify_start.elapsed();
Expand Down
1 change: 1 addition & 0 deletions src/proof/supernova.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ where

/// An enum representing the two types of proofs that can be generated and verified.
#[derive(Serialize, Deserialize)]
#[serde(bound = "")]
pub enum Proof<
'a,
F: CurveCycleEquipped,
Expand Down

1 comment on commit 71db5fb

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmarks

Table of Contents

Overview

This benchmark report shows the Fibonacci GPU benchmark.
NVIDIA L4
Intel(R) Xeon(R) CPU @ 2.20GHz
125.78 GB RAM
Workflow run: https://github.com/lurk-lab/lurk-rs/actions/runs/7402375825

Benchmark Results

LEM Fibonacci Prove - rc = 100

fib-ref=3f7f653e6c1313de7495e3aee224ec856a85e765 fib-ref=71db5fbb3fcadaffd1bacb0ea16e9c4a12a2fc0e
num-100 2.37 s (✅ 1.00x) 2.37 s (✅ 1.00x slower)
num-200 4.64 s (✅ 1.00x) 4.64 s (✅ 1.00x faster)

LEM Fibonacci Prove - rc = 600

fib-ref=3f7f653e6c1313de7495e3aee224ec856a85e765 fib-ref=71db5fbb3fcadaffd1bacb0ea16e9c4a12a2fc0e
num-100 1.98 s (✅ 1.00x) 1.99 s (✅ 1.00x slower)
num-200 4.49 s (✅ 1.00x) 4.50 s (✅ 1.00x slower)

Made with criterion-table

Please sign in to comment.