Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Noir Version Testing Update #20

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 24 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,41 @@ name: Noir tests

on:
push:
branches:
- main
branches:
- main
pull_request:

env:
CARGO_TERM_COLOR: always
MINIMUM_NOIR_VERSION: v0.37.0

jobs:
noir-version-list:
name: Query supported Noir versions
runs-on: ubuntu-latest
outputs:
noir_versions: ${{ steps.get_versions.outputs.versions }}
steps:
- name: Checkout sources
id: get_versions
run: |
# gh returns the Noir releases in reverse chronological order so we keep all releases published after the minimum supported version.
VERSIONS=$(gh release list -R noir-lang/noir --exclude-pre-releases --json tagName -q 'map(.tagName) | index(env.MINIMUM_NOIR_VERSION) as $index | if $index then .[0:$index+1] else [env.MINIMUM_NOIR_VERSION] end')
echo "versions=$VERSIONS"
echo "versions=$VERSIONS" >> $GITHUB_OUTPUT
env:
GH_TOKEN: ${{ github.token }}

test:
needs: [noir-version-list]
name: Test on Nargo ${{matrix.toolchain}}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
toolchain: [nightly, 0.37.0]
toolchain: ${{ fromJson( needs.noir-version-list.outputs.noir_versions )}}
include:
- toolchains: nightly
steps:
- name: Checkout sources
uses: actions/checkout@v4
Expand All @@ -28,8 +48,6 @@ jobs:

- name: Run Noir tests
run: nargo test
env:
RAYON_NUM_THREADS: 1

format:
runs-on: ubuntu-latest
Expand All @@ -40,7 +58,7 @@ jobs:
- name: Install Nargo
uses: noir-lang/[email protected]
with:
toolchain: 0.37.0
toolchain: ${{ env.MINIMUM_NOIR_VERSION }}

- name: Run formatter
run: nargo fmt --check
Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ noir_bigcurve uses the [noir-bignum](https://github.com/zac-williamson/noir-bign

This library is a work in progress and likely full of bugs!

# Overview
## Overview

`noir_bigcurve` make use of `noir-bignum` to optimally evaluate group operations using a minimal number of modular reductions. Runtime lookup tables are also used to reduce the number of group operations required when evaluating scalar multiplications

# Usage
## Noir Version Compatibility

This library is tested with all stable releases since 0.36.0 as well as nightly.
Copy link

@Savio-Sou Savio-Sou Dec 19, 2024

Choose a reason for hiding this comment

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

Suggested change
This library is tested with all stable releases since 0.36.0 as well as nightly.
This library is tested with all Noir stable releases from v0.37.0.


## Usage

See `bigcurve_test.nr` for some ways in which the library can be used.

Expand All @@ -20,7 +24,7 @@ Complete elliptic curve operations can be evalauted using `BigCurve::add`, `BigC

The most efficient method to evaluate curve operations is `BigCurve::evaluate_linear_expression` (TODO: Brillig bug means this method does not currently work!)

# Future work
## Future work

- When performing MSMs, utilize the Montgomery Ladder to minimize the number of field operations (see `batch_mul` in `barretenberg/src/stdlib/biggroup` for example implementation)
- `ScalarField` is not properly constrained when constructed from a `BigNum` object
Expand All @@ -32,7 +36,7 @@ The most efficient method to evaluate curve operations is `BigCurve::evaluate_li
- Create benchmarks
- Add support for curve endomorphisms where applicable (if base field and scalar field both contain cube roots of unity, we can reduce the number of point doublings required for an MSM in half)

# FAQ
## FAQ

Q: What's up with the Jacobian points and the transcript objects?
A: To minimize witness generation time (currently the bottleneck due to Brillig VM) we evaluate ECC operations over Jacobian coordinates in an unconstrained function, in order to efficiently batch-compute the modular inverses required to constrain ECC operations over Affine coordinates (which is more constraint-efficient)
Loading