Skip to content

Commit

Permalink
Merge branch 'main' into test/dynamic-dory-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtrombetta authored Oct 9, 2024
2 parents ad05f68 + cc8e2f0 commit 9e46296
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 5 deletions.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: JayWhite2357

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Please provide a minimal example of what causes the bug. This allows us to identify the root cause and fix it more quickly.

**Expected behavior**
A clear and concise description of what you expected to happen.

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context about the feature request here.
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/generic-issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
name: Generic Issue
about: This is a template for a generic issue.
title: ''
labels: ''
assignees: ''

---

# Background and Motivation
# Changes Required
Original file line number Diff line number Diff line change
Expand Up @@ -322,11 +322,11 @@ fn we_can_compute_an_empty_dory_commitment() {
let public_parameters = PublicParameters::test_rand(5, &mut test_rng());
let prover_setup = ProverSetup::from(&public_parameters);
let setup = DoryProverPublicSetup::new(&prover_setup, 2);
let res = compute_dory_commitments(&[CommittableColumn::BigInt(&[0, 0])], 0, &setup);
let res = compute_dory_commitments(&[CommittableColumn::BigInt(&[0; 0])], 0, &setup);
assert_eq!(res[0].0, GT::zero());
let res = compute_dory_commitments(&[CommittableColumn::BigInt(&[0, 0])], 5, &setup);
let res = compute_dory_commitments(&[CommittableColumn::BigInt(&[0; 0])], 5, &setup);
assert_eq!(res[0].0, GT::zero());
let res = compute_dory_commitments(&[CommittableColumn::BigInt(&[0, 0])], 20, &setup);
let res = compute_dory_commitments(&[CommittableColumn::BigInt(&[0; 0])], 20, &setup);
assert_eq!(res[0].0, GT::zero());
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
use super::{
dynamic_dory_structure::row_and_column_from_index, pairings, DoryScalar, DynamicDoryCommitment,
G1Affine, G1Projective, ProverSetup,
G1Affine, G1Projective, ProverSetup, GT,
};
use crate::base::commitment::CommittableColumn;
use alloc::{vec, vec::Vec};
use num_traits::Zero;

#[tracing::instrument(name = "compute_dory_commitment_impl (cpu)", level = "debug", skip_all)]
/// # Panics
Expand Down Expand Up @@ -71,6 +72,11 @@ pub(super) fn compute_dynamic_dory_commitments(
) -> Vec<DynamicDoryCommitment> {
committable_columns
.iter()
.map(|column| compute_dory_commitment(column, offset, setup))
.map(|column| {
column
.is_empty()
.then(|| DynamicDoryCommitment(GT::zero()))
.unwrap_or_else(|| compute_dory_commitment(column, offset, setup))
})
.collect()
}

0 comments on commit 9e46296

Please sign in to comment.