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!: Update to acvm-backend-barretenberg v0.12.0 #2377

Merged
merged 30 commits into from
Aug 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
1f9d08c
chore: remove keys from preprocessed artifacts
TomAFrench Aug 11, 2023
e024c69
chore: remove unused dependency
TomAFrench Aug 11, 2023
40ed808
chore: rebuild artifacts
TomAFrench Aug 11, 2023
d9236f4
Merge branch 'master' into remove-keys-from-artifact
TomAFrench Aug 15, 2023
69b0058
Merge branch 'master' into remove-keys-from-artifact
TomAFrench Aug 22, 2023
18d6edc
prove_cmd and verify_cmd no longer take in the proving and verificati…
kevaundray Aug 20, 2023
3218e83
prove and verify now just use a dummy pk and vk
kevaundray Aug 20, 2023
8e2361a
use acvm branch
kevaundray Aug 20, 2023
cfd66ca
chore: bump acvm-backend-barretenberg
TomAFrench Aug 22, 2023
09c7bcb
chore: bump acvm-backend-barretenberg
TomAFrench Aug 22, 2023
410281d
chore: update `acvm-backend-barretenberg` commit
TomAFrench Aug 24, 2023
2c6c66b
chore: flake fixes
TomAFrench Aug 24, 2023
96819b1
chore: bump acvm-backend-barretenberg
TomAFrench Aug 24, 2023
47f2ab6
Merge branch 'master' into kw/bb-binaries
TomAFrench Aug 30, 2023
b04ed6b
Merge branch 'master' into remove-keys-from-artifact
TomAFrench Aug 30, 2023
8df17bf
Merge branch 'remove-keys-from-artifact' into kw/bb-binaries
TomAFrench Aug 30, 2023
ca1e3e3
chore: run CI without nix
TomAFrench Aug 30, 2023
cd8be44
chore: fix ci
TomAFrench Aug 30, 2023
d8fe242
chore: use proper linux target
TomAFrench Aug 30, 2023
d35a81d
chore: CI updates
TomAFrench Aug 30, 2023
49f356c
chore: fix leftover references to wasm in flake
TomAFrench Aug 30, 2023
96bca20
chore: drop unsupported platforms
TomAFrench Aug 30, 2023
e2740c5
chore: add barretenberg archive environment variable to nix
TomAFrench Aug 30, 2023
7d07fe4
chore: freeze lockfile in CI tests
TomAFrench Aug 30, 2023
e9dc5b8
chore: run tests in release mode
TomAFrench Aug 30, 2023
bd6bd29
chore: lock rather than freeze the lockfile
TomAFrench Aug 30, 2023
4d322f7
Merge branch 'master' into kw/bb-binaries
TomAFrench Aug 30, 2023
80df70f
chore: fix bad merge
TomAFrench Aug 30, 2023
4a1608e
chore: ditto
TomAFrench Aug 30, 2023
613e098
chore: fix build
TomAFrench Aug 30, 2023
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
143 changes: 2 additions & 141 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,43 +25,7 @@ permissions:
contents: write

jobs:
build-barretenberg:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ inputs.tag || env.GITHUB_REF }}

- name: Collect locked barretenberg rev
run: |
echo "BB_REV=$(jq -r .nodes.barretenberg.locked.rev ./flake.lock)" >> $GITHUB_ENV

- uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixos-22.11
github_access_token: ${{ secrets.GITHUB_TOKEN }}

- uses: cachix/cachix-action@v12
with:
name: barretenberg

# Upload does not work with symlinks, using this workaround:
# https://github.com/actions/upload-artifact/issues/92#issuecomment-1080347032
- name: Build barretenberg as libbarretenberg-wasm32
run: |
nix build "github:AztecProtocol/barretenberg/${{ env.BB_REV }}#wasm32"
echo "ARTIFACT_UPLOAD_PATH=$(readlink -f result)" >> $GITHUB_ENV

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: libbarretenberg-wasm32
path: ${{ env.ARTIFACT_UPLOAD_PATH }}
retention-days: 3

build-apple-darwin:
needs: [build-barretenberg]
runs-on: macos-latest
env:
CROSS_CONFIG: ${{ github.workspace }}/.github/Cross.toml
Expand Down Expand Up @@ -94,22 +58,14 @@ jobs:
path: ${{ env.CACHED_PATHS }}
key: ${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Download artifact
uses: actions/download-artifact@v3
with:
name: libbarretenberg-wasm32
path: ${{ github.workspace }}/libbarretenberg-wasm32

- name: Setup toolchain
uses: dtolnay/rust-toolchain@1.66.0
with:
targets: ${{ matrix.target }}

- name: Build environment and Compile
env:
BARRETENBERG_BIN_DIR: ${{ github.workspace }}/libbarretenberg-wasm32/bin
run: |
cargo build --package nargo_cli --release --target ${{ matrix.target }} --no-default-features --features "plonk_bn254_wasm ${{ inputs.features }}"
cargo build --package nargo_cli --release --target ${{ matrix.target }} --no-default-features --features "${{ inputs.features }}"

- uses: actions/cache/save@v3
# Don't create cache entries for the merge queue.
Expand Down Expand Up @@ -152,7 +108,6 @@ jobs:
tag: ${{ inputs.tag || 'nightly' }} # This will fail if `inputs.tag` is not a tag (e.g. testing a branch)

build-linux:
needs: [build-barretenberg]
runs-on: ubuntu-22.04
env:
CROSS_CONFIG: ${{ github.workspace }}/.github/Cross.toml
Expand All @@ -169,8 +124,6 @@ jobs:
[
x86_64-unknown-linux-gnu,
x86_64-unknown-linux-musl,
aarch64-unknown-linux-gnu,
aarch64-unknown-linux-musl,
]

steps:
Expand All @@ -185,23 +138,15 @@ jobs:
path: ${{ env.CACHED_PATHS }}
key: ${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Download artifact
uses: actions/download-artifact@v3
with:
name: libbarretenberg-wasm32
path: ${{ github.workspace }}/libbarretenberg-wasm32

- name: Setup toolchain
uses: dtolnay/rust-toolchain@1.66.0
with:
targets: ${{ matrix.target }}

- name: Build Nargo
env:
BARRETENBERG_BIN_DIR: ${{ github.workspace }}/libbarretenberg-wasm32/bin
run: |
cargo install cross --version 0.2.5 --force
cross build --package nargo_cli --release --target=${{ matrix.target }} --no-default-features --features "plonk_bn254_wasm ${{ inputs.features }}"
cross build --package nargo_cli --release --target=${{ matrix.target }} --no-default-features --features "${{ inputs.features }}"

- uses: actions/cache/save@v3
# Don't create cache entries for the merge queue.
Expand Down Expand Up @@ -242,87 +187,3 @@ jobs:
asset_name: nargo-${{ matrix.target }}.tar.gz
overwrite: true
tag: ${{ inputs.tag || 'nightly' }} # This will fail if `inputs.tag` is not a tag (e.g. testing a branch)

build-windows:
needs: [build-barretenberg]
runs-on: windows-2022
env:
CROSS_CONFIG: ${{ github.workspace }}/.github/Cross.toml
CACHED_PATHS: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
strategy:
matrix:
target: [x86_64-pc-windows-msvc]

steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ inputs.tag || env.GITHUB_REF }}

- uses: actions/cache/restore@v3
id: cache
with:
path: ${{ env.CACHED_PATHS }}
key: ${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Download artifact
uses: actions/download-artifact@v3
with:
name: libbarretenberg-wasm32
path: ${{ github.workspace }}/libbarretenberg-wasm32

- name: Setup toolchain
uses: dtolnay/rust-toolchain@1.66.0
with:
targets: ${{ matrix.target }}

- name: Build environment and Compile
env:
BARRETENBERG_BIN_DIR: ${{ github.workspace }}/libbarretenberg-wasm32/bin
run: |
cargo build --package nargo_cli --release --target ${{ matrix.target }} --no-default-features --features "plonk_bn254_wasm ${{ inputs.features }}"

- uses: actions/cache/save@v3
# Don't create cache entries for the merge queue.
if: ${{ steps.cache.outputs.cache-hit != 'true' && github.event_name != 'merge_group' }}
with:
path: ${{ env.CACHED_PATHS }}
key: ${{ steps.cache.outputs.cache-primary-key }}

- name: Package artifacts
run: |
mkdir dist
cp ./target/${{ matrix.target }}/release/nargo.exe ./dist/nargo.exe
7z a -tzip nargo-${{ matrix.target }}.zip ./dist/*

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: nargo-${{ matrix.target }}
path: ./dist/*
retention-days: 3

- name: Test built artifact
shell: powershell
run: |
cp ./target/${{ matrix.target }}/release/nargo.exe ~/.cargo/bin/

cd release-tests
yarn install
yarn test

- name: Upload binaries to release tag
uses: svenstaro/upload-release-action@v2
if: ${{ inputs.publish || github.event_name == 'schedule' }}
with:
repo_name: noir-lang/noir
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./nargo-${{ matrix.target }}.zip
asset_name: nargo-${{ matrix.target }}.zip
overwrite: true
tag: ${{ inputs.tag || 'nightly' }} # This will fail if `inputs.tag` is not a tag (e.g. testing a branch)
45 changes: 15 additions & 30 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,58 +15,43 @@ jobs:
runs-on: ${{ matrix.runner }}
timeout-minutes: 30
env:
CACHED_PATH: /tmp/nix-cache
CACHED_PATHS: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/

strategy:
fail-fast: false
matrix:
include:
- os: ubuntu
runner: ubuntu-latest
target: x86_64-linux
target: x86_64-unknown-linux-gnu

steps:
- name: Checkout
uses: actions/checkout@v3

- uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-22.11
github_access_token: ${{ secrets.GITHUB_TOKEN }}

- uses: cachix/cachix-action@v12
with:
name: barretenberg

- name: Restore nix store cache
uses: actions/cache/restore@v3
id: cache
with:
path: ${{ env.CACHED_PATH }}
path: ${{ env.CACHED_PATHS }}
key: ${{ runner.os }}-flake-${{ hashFiles('*.lock') }}

# Based on https://github.com/marigold-dev/deku/blob/b5016f0cf4bf6ac48db9111b70dd7fb49b969dfd/.github/workflows/build.yml#L26
- name: Copy cache into nix store
if: steps.cache.outputs.cache-hit == 'true'
# We don't check the signature because we're the one that created the cache
run: |
for narinfo in ${{ env.CACHED_PATH }}/*.narinfo; do
path=$(head -n 1 "$narinfo" | awk '{print $2}')
nix copy --no-check-sigs --from "file://${{ env.CACHED_PATH }}" "$path"
done

- name: Run `nix flake check`
run: |
nix flake check -L
- name: Setup toolchain
uses: dtolnay/rust-toolchain@1.66.0
with:
targets: ${{ matrix.target }}

- name: Export cache from nix store
if: ${{ always() && steps.cache.outputs.cache-hit != 'true' && github.event_name != 'merge_group' }}
run: |
nix copy --to "file://${{ env.CACHED_PATH }}?compression=zstd&parallel-compression=true" .#native-cargo-artifacts
- name: Run tests
run: cargo test --workspace --locked --release

- uses: actions/cache/save@v3
# Write a cache entry even if the tests fail but don't create any for the merge queue.
if: ${{ always() && steps.cache.outputs.cache-hit != 'true' && github.event_name != 'merge_group' }}
with:
path: ${{ env.CACHED_PATH }}
path: ${{ env.CACHED_PATHS }}
key: ${{ steps.cache.outputs.cache-primary-key }}
49 changes: 1 addition & 48 deletions .github/workflows/wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,45 +9,7 @@ concurrency:
cancel-in-progress: true

jobs:
# TODO: Replace this step with downloading a wasm binary from a set release of Barretenberg
build-barretenberg:
runs-on: ubuntu-latest
steps:
- name: Checkout Noir repo
uses: actions/checkout@v3

- name: Collect locked barretenberg rev
run: |
echo "BB_REV=$(jq -r .nodes.barretenberg.locked.rev ./flake.lock)" >> $GITHUB_ENV
echo "BB_REV is ${{ env.BB_REV }}"

- uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixos-22.11
github_access_token: ${{ secrets.GITHUB_TOKEN }}

- uses: cachix/cachix-action@v12
with:
name: barretenberg
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"

# Upload does not work with symlinks, using this workaround:
# https://github.com/actions/upload-artifact/issues/92#issuecomment-1080347032
- name: Build barretenberg as libbarretenberg-wasm32
run: |
echo "BB_REV is ${{ env.BB_REV }}"
nix build "github:AztecProtocol/barretenberg/${{ env.BB_REV }}#wasm32"
echo "ARTIFACT_UPLOAD_PATH=$(readlink -f result)" >> $GITHUB_ENV

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: libbarretenberg-wasm32
path: ${{ env.ARTIFACT_UPLOAD_PATH }}
retention-days: 3

build-nargo:
needs: [build-barretenberg]
runs-on: ubuntu-22.04
env:
CACHED_PATHS: |
Expand All @@ -67,20 +29,11 @@ jobs:
path: ${{ env.CACHED_PATHS }}
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Download artifact
uses: actions/download-artifact@v3
with:
name: libbarretenberg-wasm32
path: ${{ github.workspace }}/libbarretenberg-wasm32

- name: Setup toolchain
uses: dtolnay/rust-toolchain@1.66.0

- name: Build Nargo
env:
BARRETENBERG_BIN_DIR: ${{ github.workspace }}/libbarretenberg-wasm32/bin
run: |
cargo build --package nargo_cli --release --no-default-features --features plonk_bn254_wasm
run: cargo build --package nargo_cli --release

- uses: actions/cache/save@v3
# Don't create cache entries for the merge queue.
Expand Down
Loading