From 443b70433a8653a84fcd8bd76cddfbd5413a5b79 Mon Sep 17 00:00:00 2001 From: Srinath Setty Date: Mon, 6 Jan 2025 11:51:20 -0800 Subject: [PATCH 1/7] fix typos with typos tool --- src/gadgets/ecc.rs | 14 +++++++------- src/provider/poseidon/poseidon_inner.rs | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/gadgets/ecc.rs b/src/gadgets/ecc.rs index ef204dab..edccb588 100644 --- a/src/gadgets/ecc.rs +++ b/src/gadgets/ecc.rs @@ -912,7 +912,7 @@ mod tests { } /// Make the point io - pub fn inputize_allocted_point>( + pub fn inputize_allocated_point>( p: &AllocatedPoint, mut cs: CS, ) { @@ -994,7 +994,7 @@ mod tests { CS: ConstraintSystem, { let a = alloc_random_point(cs.namespace(|| "a")).unwrap(); - inputize_allocted_point(&a, cs.namespace(|| "inputize a")); + inputize_allocated_point(&a, cs.namespace(|| "inputize a")); let s = E::Scalar::random(&mut OsRng); // Allocate bits for s @@ -1006,7 +1006,7 @@ mod tests { .collect::, SynthesisError>>() .unwrap(); let e = a.scalar_mul(cs.namespace(|| "Scalar Mul"), &bits).unwrap(); - inputize_allocted_point(&e, cs.namespace(|| "inputize e")); + inputize_allocated_point(&e, cs.namespace(|| "inputize e")); (a, e, s) } @@ -1060,9 +1060,9 @@ mod tests { CS: ConstraintSystem, { let a = alloc_random_point(cs.namespace(|| "a")).unwrap(); - inputize_allocted_point(&a, cs.namespace(|| "inputize a")); + inputize_allocated_point(&a, cs.namespace(|| "inputize a")); let e = a.add(cs.namespace(|| "add a to a"), &a).unwrap(); - inputize_allocted_point(&e, cs.namespace(|| "inputize e")); + inputize_allocated_point(&e, cs.namespace(|| "inputize e")); (a, e) } @@ -1115,13 +1115,13 @@ mod tests { CS: ConstraintSystem, { let a = alloc_random_point(cs.namespace(|| "a")).unwrap(); - inputize_allocted_point(&a, cs.namespace(|| "inputize a")); + inputize_allocated_point(&a, cs.namespace(|| "inputize a")); let b = &mut a.clone(); b.y = AllocatedNum::alloc(cs.namespace(|| "allocate negation of a"), || { Ok(E::Base::ZERO) }) .unwrap(); - inputize_allocted_point(b, cs.namespace(|| "inputize b")); + inputize_allocated_point(b, cs.namespace(|| "inputize b")); let e = a.add(cs.namespace(|| "add a to b"), b).unwrap(); e } diff --git a/src/provider/poseidon/poseidon_inner.rs b/src/provider/poseidon/poseidon_inner.rs index ab98efe4..97316bf3 100644 --- a/src/provider/poseidon/poseidon_inner.rs +++ b/src/provider/poseidon/poseidon_inner.rs @@ -128,13 +128,13 @@ where /// Generates new instance of [`PoseidonConstants`] suitable for both optimized / non-optimized hashing /// with following default parameters: /// - 128 bit of security; - /// - Merkle Tree (where all leafs are presented) domain separation ([`HashType`]). + /// - Merkle Tree (where all leaves are presented) domain separation ([`HashType`]). pub fn new() -> Self { Self::new_with_strength(DEFAULT_STRENGTH) } /// Generates new instance of [`PoseidonConstants`] suitable for both optimized / non-optimized hashing - /// with Merkle Tree (where all leafs are presented) domain separation ([`HashType`]) custom security level ([`Strength`]). + /// with Merkle Tree (where all leaves are presented) domain separation ([`HashType`]) custom security level ([`Strength`]). pub fn new_with_strength(strength: Strength) -> Self { Self::new_with_strength_and_type(strength, HashType::MerkleTree) } From d462e742ac2f7a34c26102026cf3dc80ab825240 Mon Sep 17 00:00:00 2001 From: Srinath Setty Date: Mon, 6 Jan 2025 11:53:07 -0800 Subject: [PATCH 2/7] add to CI --- .github/workflows/rust.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 0cea2dce..9f358c45 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -74,3 +74,11 @@ jobs: with: command: clippy args: --all-targets -- -D warnings + + spelling: + runs-on: ubuntu-latest + steps: + - name: Checkout Actions Repository + uses: actions/checkout@v4 + - name: Spell Check Repo + uses: crate-ci/typos@v1.29.4 From 86a822c228e184182da08980e779d716beb3d727 Mon Sep 17 00:00:00 2001 From: Srinath Setty Date: Mon, 6 Jan 2025 11:55:59 -0800 Subject: [PATCH 3/7] fix typos --- src/gadgets/nonnative/bignat.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gadgets/nonnative/bignat.rs b/src/gadgets/nonnative/bignat.rs index eab03447..98052b50 100644 --- a/src/gadgets/nonnative/bignat.rs +++ b/src/gadgets/nonnative/bignat.rs @@ -493,7 +493,7 @@ impl BigNat { }) } - /// Compute a `BigNat` contrained to be equal to `self * other % modulus`. + /// Compute a `BigNat` constrained to be equal to `self * other % modulus`. pub fn mult_mod>( &self, mut cs: CS, @@ -564,7 +564,7 @@ impl BigNat { Ok((quotient, remainder)) } - /// Compute a `BigNat` contrained to be equal to `self * other % modulus`. + /// Compute a `BigNat` constrained to be equal to `self * other % modulus`. pub fn red_mod>( &self, mut cs: CS, From 482abe2bdffcdfade7b424583ee00eb78a69ea94 Mon Sep 17 00:00:00 2001 From: Srinath Setty Date: Mon, 6 Jan 2025 11:58:34 -0800 Subject: [PATCH 4/7] add permissions --- .github/workflows/rust.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 9f358c45..89d6f04d 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -1,5 +1,9 @@ name: Build and Test Nova +permissions: + contents: read + pull-requests: write + on: push: branches: [ main ] From 6baa68d81415ecf5887f292b599951f0707e301e Mon Sep 17 00:00:00 2001 From: Srinath Setty Date: Mon, 6 Jan 2025 12:51:19 -0800 Subject: [PATCH 5/7] use commit hash --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 89d6f04d..f61bdb48 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -85,4 +85,4 @@ jobs: - name: Checkout Actions Repository uses: actions/checkout@v4 - name: Spell Check Repo - uses: crate-ci/typos@v1.29.4 + uses: crate-ci/typos@685eb3d From 77550a38e981961ae8a95634a5a7f0ef94ba55da Mon Sep 17 00:00:00 2001 From: Srinath Setty Date: Mon, 6 Jan 2025 12:52:11 -0800 Subject: [PATCH 6/7] use commit hash --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index f61bdb48..62ec800f 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -85,4 +85,4 @@ jobs: - name: Checkout Actions Repository uses: actions/checkout@v4 - name: Spell Check Repo - uses: crate-ci/typos@685eb3d + uses: crate-ci/typos@685eb3d55be2f85191e8c84acb9f44d7756f84ab From 7a82f31bda5196aa19a8ff4b2e6d0ccb61a75a93 Mon Sep 17 00:00:00 2001 From: Srinath Setty Date: Mon, 6 Jan 2025 13:01:46 -0800 Subject: [PATCH 7/7] Update .github/workflows/rust.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 62ec800f..b2b4cfe5 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -83,6 +83,6 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Actions Repository - uses: actions/checkout@v4 + uses: actions/checkout@v3 - name: Spell Check Repo uses: crate-ci/typos@685eb3d55be2f85191e8c84acb9f44d7756f84ab