diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ec05635..846ce95 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 @@ -28,8 +48,6 @@ jobs: - name: Run Noir tests run: nargo test - env: - RAYON_NUM_THREADS: 1 format: runs-on: ubuntu-latest @@ -40,7 +58,7 @@ jobs: - name: Install Nargo uses: noir-lang/noirup@v0.1.3 with: - toolchain: 0.37.0 + toolchain: ${{ env.MINIMUM_NOIR_VERSION }} - name: Run formatter run: nargo fmt --check diff --git a/README.md b/README.md index 1c28766..1fb003c 100644 --- a/README.md +++ b/README.md @@ -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. + +## Usage See `bigcurve_test.nr` for some ways in which the library can be used. @@ -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 @@ -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)