Skip to content

Commit

Permalink
refactor: Update AllocatedPoint type specifications in circuits and g…
Browse files Browse the repository at this point in the history
…adgets (#299)

- Change the parameter of `AllocatedPoint` from an `Engine` to the more minimal setup of a `Group`
- Ensure no changes are made to the operating logic of the code, only type specification has been updated.

Downstream changes:
- Modify data type of `W` and `E` fields in structures `AllocatedR1CSInstance` and `AllocatedRelaxedR1CSInstance` to `AllocatedPoint<E::GE>` along with the type of `T` parameter in `fold_with_r1cs`.
- Update `conditionally_select_point` function in `gadgets/r1cs.rs` to use a generic parameter `G` that inherits from `Group` instead of `E` from `Engine`.
- Update method signatures in `NovaAugmentedCircuit` and `SuperNovaAugmentedCircuit` to accommodate changes in the underlying type of `AllocatedPoint` from `E` to `E::GE`.
  • Loading branch information
huitseeker committed Feb 7, 2024
1 parent 788e878 commit 7a5d7bf
Show file tree
Hide file tree
Showing 4 changed files with 140 additions and 145 deletions.
4 changes: 2 additions & 2 deletions src/circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ impl<'a, E: Engine, SC: StepCircuit<E::Base>> NovaAugmentedCircuit<'a, E, SC> {
Vec<AllocatedNum<E::Base>>,
AllocatedRelaxedR1CSInstance<E>,
AllocatedR1CSInstance<E>,
AllocatedPoint<E>,
AllocatedPoint<E::GE>,
),
SynthesisError,
> {
Expand Down Expand Up @@ -214,7 +214,7 @@ impl<'a, E: Engine, SC: StepCircuit<E::Base>> NovaAugmentedCircuit<'a, E, SC> {
z_i: &[AllocatedNum<E::Base>],
U: &AllocatedRelaxedR1CSInstance<E>,
u: &AllocatedR1CSInstance<E>,
T: &AllocatedPoint<E>,
T: &AllocatedPoint<E::GE>,
arity: usize,
) -> Result<(AllocatedRelaxedR1CSInstance<E>, AllocatedBit), SynthesisError> {
// Check that u.x[0] = Hash(params, U, i, z0, zi)
Expand Down

1 comment on commit 7a5d7bf

@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 Arecibo GPU benchmarks.
NVIDIA L4
Intel(R) Xeon(R) CPU @ 2.20GHz
32 vCPUs
125 GB RAM
Workflow run: https://github.com/lurk-lab/arecibo/actions/runs/7814543364

Benchmark Results

RecursiveSNARK-NIVC-2

ref=788e878 ref=7a5d7bf
Prove-NumCons-6540 53.04 ms (✅ 1.00x) 53.11 ms (✅ 1.00x slower)
Verify-NumCons-6540 32.96 ms (✅ 1.00x) 33.39 ms (✅ 1.01x slower)
Prove-NumCons-1028888 342.19 ms (✅ 1.00x) 362.84 ms (✅ 1.06x slower)
Verify-NumCons-1028888 256.69 ms (✅ 1.00x) 274.99 ms (✅ 1.07x slower)

CompressedSNARK-NIVC-Commitments-2

ref=788e878 ref=7a5d7bf
Prove-NumCons-6540 14.09 s (✅ 1.00x) 14.17 s (✅ 1.01x slower)
Verify-NumCons-6540 78.44 ms (✅ 1.00x) 78.87 ms (✅ 1.01x slower)
Prove-NumCons-1028888 111.58 s (✅ 1.00x) 110.80 s (✅ 1.01x faster)
Verify-NumCons-1028888 773.29 ms (✅ 1.00x) 772.81 ms (✅ 1.00x faster)

Made with criterion-table

Please sign in to comment.