Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

chore: Bring acvm_js package into the workspace #459

Merged
merged 102 commits into from
Aug 8, 2023
Merged
Show file tree
Hide file tree
Changes from 92 commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
9959fcb
Initial commit
TomAFrench May 8, 2023
8bdbcb6
feat: add mvp abi encode/decode
TomAFrench May 11, 2023
7a66e88
feat: add circuit execution
TomAFrench May 12, 2023
0d3b0ac
chore: add comment on removal of vendored code
TomAFrench May 12, 2023
73801a9
feat: replace opaque witness maps with js Maps
TomAFrench May 15, 2023
1c6bb83
chore: move js-witness conversion code into module
TomAFrench May 15, 2023
f238d9b
feat: add support for oracle opcodes
TomAFrench May 15, 2023
30103fb
chore: set up eslint
TomAFrench May 15, 2023
5058791
chore: apply eslint fixes
TomAFrench May 15, 2023
f6c47e7
chore: clippy fixes
TomAFrench May 15, 2023
1c7c5a7
chore: clippy fix
TomAFrench May 15, 2023
51b511f
chore: remove debugging code
TomAFrench May 15, 2023
cd7b8bf
feat: return errors rather than panicking
TomAFrench May 15, 2023
6fcdbee
fix(ci): update working directory for wasm build step
TomAFrench May 15, 2023
248022a
feat: update to ACVM 0.11.0
TomAFrench May 16, 2023
811cdd3
Merge pull request https://github.com/noir-lang/acvm-simulator/pull/2…
TomAFrench May 17, 2023
b6b98ee
chore(ci): Add initial testing for running simulator in the browser (…
TomAFrench May 19, 2023
e97dd98
chore: remove unnecessary peer dependency
TomAFrench May 19, 2023
2571edb
feat: use JS naming convention for generated functions (https://githu…
TomAFrench May 22, 2023
3a4d7f7
chore: add type aliases for tests (https://github.com/noir-lang/acvm-…
TomAFrench May 22, 2023
99131ac
feat: Enforce `WitnessMap` type in TS (https://github.com/noir-lang/a…
TomAFrench May 22, 2023
fe4809e
chore(ci): add eslint to CI (https://github.com/noir-lang/acvm-simula…
TomAFrench May 22, 2023
c97bd45
chore: add smoketest for build-info (https://github.com/noir-lang/acv…
TomAFrench May 22, 2023
b478a72
chore: add release-please action (https://github.com/noir-lang/acvm-s…
TomAFrench May 22, 2023
ab9f74b
chore: add jsdoc for `execute_circuit` (https://github.com/noir-lang/…
TomAFrench May 22, 2023
a03f76a
chore: enforce type on oracle callback function (https://github.com/n…
TomAFrench May 22, 2023
cf18ba4
chore: update release secret name
TomAFrench May 22, 2023
0f5d939
feat: update to ACVM 0.12.0 (https://github.com/noir-lang/acvm-simula…
TomAFrench May 26, 2023
ce91d73
chore(github): Remove Repo-tied Issue & PR Templates (https://github.…
Savio-Sou Jun 6, 2023
8910ce1
chore: fix missing output in release-please CI (https://github.com/no…
TomAFrench Jun 6, 2023
51428e1
chore: replace puppeteer with playwright for browser test (https://gi…
TomAFrench Jun 7, 2023
3dd154b
chore: merge CI workflows for tests (https://github.com/noir-lang/acv…
TomAFrench Jun 7, 2023
536e37d
chore: trim down cspell dictionary (https://github.com/noir-lang/acvm…
TomAFrench Jun 7, 2023
b14137d
chore: Add nix flake (https://github.com/noir-lang/acvm-simulator/pul…
TomAFrench Jun 7, 2023
eefc8ff
chore: Add description of repository purpose to README (https://githu…
Savio-Sou Jun 7, 2023
9180d62
chore: add build.sh (https://github.com/noir-lang/acvm-simulator/pull…
TomAFrench Jun 7, 2023
b775d70
feat: added public_witness wasm utils (https://github.com/noir-lang/a…
sirasistant Jun 7, 2023
2022c48
chore: migrate to acvm 0.13.0 (https://github.com/noir-lang/acvm-simu…
TomAFrench Jun 7, 2023
d473fdd
feat: Add support for remaining black box opcodes using `barretenberg…
kobyhallx Jun 8, 2023
9300265
feat: Add functions to convert between compressed witnesses and `JSWi…
TomAFrench Jun 12, 2023
b05da06
chore: refactor foreign call logic into separate module (https://gith…
TomAFrench Jun 12, 2023
57589fd
chore: update to ACVM 0.14.4 (https://github.com/noir-lang/acvm-simul…
TomAFrench Jun 15, 2023
f1acde8
feat: update to target ACVM 0.15.0 (https://github.com/noir-lang/acvm…
TomAFrench Jun 19, 2023
d50a6fc
chore: add automatic symlinks for build artifacts (https://github.com…
TomAFrench Jun 19, 2023
a6b8048
chore: remove support for oracle opcodes (https://github.com/noir-lan…
TomAFrench Jun 19, 2023
5dfaa4e
chore: add `beforeEach` for browser tests (https://github.com/noir-la…
TomAFrench Jun 19, 2023
f72c4f9
chore: run browser tests on both Chromium and Webkit (https://github.…
TomAFrench Jun 19, 2023
1aac2a2
chore: remove double printing of install location (https://github.com…
TomAFrench Jun 20, 2023
b22a29c
feat: allow calling pedersen opcode with non-zero domain separator (h…
TomAFrench Jun 20, 2023
6a50a31
chore: enforce type checks on logging and build info (https://github.…
TomAFrench Jun 20, 2023
ab10ef7
chore: cspell
TomAFrench Jun 20, 2023
a3ebdc2
chore: document remaining functions (https://github.com/noir-lang/acv…
TomAFrench Jun 20, 2023
dc0723a
chore: update build scripts (https://github.com/noir-lang/acvm-simula…
TomAFrench Jun 26, 2023
89efc13
chore: rename `acvm-simulator` to `acvm_js` (https://github.com/noir-…
TomAFrench Jun 26, 2023
3a7b193
chore!: remove abi encoding functionality (https://github.com/noir-la…
TomAFrench Jun 26, 2023
851a5ad
chore: release 0.1.0
kevaundray Jun 30, 2023
550fca1
feat: Update to ACVM 0.16.0 (https://github.com/noir-lang/acvm-simula…
TomAFrench Jul 6, 2023
aa6a4ea
chore: remove patch on ACVM (https://github.com/noir-lang/acvm-simula…
TomAFrench Jul 6, 2023
ca3c28c
feat: Add support for resolving `Brillig` foreign calls (https://gith…
TomAFrench Jul 10, 2023
b5f8443
fix: fix running rust based tests (https://github.com/noir-lang/acvm-…
TomAFrench Jul 11, 2023
f8b3bcd
chore: fix mac CI (https://github.com/noir-lang/acvm-simulator/pull/67)
TomAFrench Jul 11, 2023
d1ad518
chore: bump to ACVM 0.17.0 (https://github.com/noir-lang/acvm-simulat…
TomAFrench Jul 11, 2023
a4d85ed
chore!: update to ACVM 0.19.0 (https://github.com/noir-lang/acvm-simu…
TomAFrench Jul 18, 2023
59eecb9
chore!: Bump ACVM to 0.20.0 (https://github.com/noir-lang/acvm-simula…
Maddiaa0 Jul 25, 2023
eee073d
chore: acvm_js in the acvm monorepo
kobyhallx Jul 26, 2023
f9cfca4
fix: file locations, nix building
kobyhallx Jul 26, 2023
7bc2759
chore: remove acvm_js from workspace
TomAFrench Jul 27, 2023
ea79f1e
feat: migrate to ACVM 0.21.0
TomAFrench Jul 27, 2023
9458dba
chore: improve file paths
TomAFrench Jul 27, 2023
872670f
chore: fix CI
TomAFrench Jul 27, 2023
72872ac
chore: linter
TomAFrench Jul 27, 2023
f51567d
chore: fix ci path
TomAFrench Jul 27, 2023
a6bf39d
chore: move acvm_js into the workspace
TomAFrench Jul 27, 2023
ebddb32
chore: clean up unwanted files
TomAFrench Jul 27, 2023
d6d2721
chore: update acvm_js package.json
TomAFrench Jul 27, 2023
4132c0d
chore: update lockfile
TomAFrench Jul 27, 2023
6b55b8e
chore: add .direnv to gitignore
TomAFrench Jul 27, 2023
c503235
chore: remove SUPPORT.md
TomAFrench Jul 27, 2023
4316616
chore: rename `equality_check` to `addition`
TomAFrench Jul 27, 2023
48a6de5
chore: add serialisation integration test for `schnorr_verify` circuit
TomAFrench Jul 27, 2023
954bb0e
chore: remove commented circuit definitions and refer to integration …
TomAFrench Jul 27, 2023
daf3480
chore: add note to `test_program_serialization.rs` on purpose
TomAFrench Jul 27, 2023
ecfba86
chore: linter
TomAFrench Jul 27, 2023
d576736
chore: fix build of acvm_js
TomAFrench Jul 27, 2023
4eea91d
chore: fixes to flake
kobyhallx Jul 27, 2023
3e12a36
chore: build acvm_js part of workspace
kobyhallx Jul 31, 2023
244fd68
chore: disable acvm_js for clippy pass
kobyhallx Jul 31, 2023
973c6bb
chore: enable build script to find bb in file system
kobyhallx Aug 1, 2023
ccb5da0
fix: acvm_js check'n'test
kobyhallx Aug 1, 2023
1d226b2
fix: clippy and fmt complaints
kobyhallx Aug 1, 2023
0645ba7
fix: utilize nix for clippy/test/fmt
kobyhallx Aug 2, 2023
bcea77b
chore: cleanup workflows
kobyhallx Aug 2, 2023
ef864e6
chore: removes 10s test timeout for 40s global
kobyhallx Aug 2, 2023
b905f67
Merge branch 'master' into combined_history-acvm_js
kobyhallx Aug 2, 2023
127657d
chore: drops update-lockfile from release
kobyhallx Aug 2, 2023
9f76891
Merge branch 'master' into combined_history-acvm_js
TomAFrench Aug 3, 2023
ad5e449
chore: remove `#[cfg(target_arch = "wasm32")]` spam in acvm_js
TomAFrench Aug 3, 2023
66bf801
chore: remove comment
TomAFrench Aug 3, 2023
40d8945
chore: allow running tests on CLI as well as CI
TomAFrench Aug 3, 2023
424780c
chore: bump for acvm_js Cargo.toml
kobyhallx Aug 3, 2023
02cb5b0
fix: universal build script
kobyhallx Aug 3, 2023
1fdd7eb
chore: remove unwanted file
TomAFrench Aug 4, 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
20 changes: 20 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Based on https://github.com/direnv/direnv-vscode/blob/158e8302c2594cc0eaa5f8b4f0cafedd4e1c0315/.envrc

# You can define your system-specific logic (like Git settings or GH tokens) in .envrc.local
# If that logic is usable by other people and might improve development environment, consider
# contributing it to this file!

source_env_if_exists .envrc.local

if [[ -z "${SKIP_NIX:-}" ]] && has nix; then

if nix flake metadata &>/dev/null && has use_flake; then
# use flakes if possible
use flake

else
# Otherwise fall back to pure nix
use nix
fi

fi
22 changes: 22 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Yarn Cache and Install
description: Installs dependencies and caches them

inputs:
working-directory:
default: ./
required: false

runs:
using: composite
steps:
- name: Cache
uses: actions/cache@v3
id: cache
with:
path: "**/node_modules"
key: yarn-v1-${{ hashFiles('**/yarn.lock') }}
- name: Install
working-directory: ${{ inputs.working-directory }}
run: yarn --immutable
shell: bash
if: steps.cache.outputs.cache-hit != 'true'
45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,48 @@ jobs:
workflow: publish.yml
ref: master
inputs: '{ "acvm-ref": "${{ needs.release-please.outputs.tag-name }}" }'

update-lockfile:
name: Update lockfile
needs: [release-please]
if: ${{ needs.release-please.outputs.release-pr }}
runs-on: ubuntu-latest
steps:
- name: Checkout release branch
uses: actions/checkout@v3
with:
ref: ${{ fromJSON(needs.release-please.outputs.release-pr).headBranchName }}
token: ${{ secrets.ACVM_JS_RELEASES_TOKEN }}

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

- name: Update lockfile
run: |
cargo update --workspace

- name: Configure git
run: |
git config user.name tomafrench
git config user.email tomfrench@aztecprotocol.com

- name: Commit updates
run: |
git add Cargo.lock
git commit -m 'chore: Update lockfile'
git push

dispatch-acvm-js-wasm:
name: Dispatch to acvm-js-wasm
needs: [release-please]
if: ${{ needs.release-please.outputs.tag-name }}
runs-on: ubuntu-latest
steps:
- name: Dispatch to acvm-js-wasm
uses: benc-uk/workflow-dispatch@v1
with:
workflow: update.yml
repo: noir-lang/acvm-js-wasm
kobyhallx marked this conversation as resolved.
Show resolved Hide resolved
token: ${{ secrets.ACVM_JS_RELEASES_TOKEN }}
inputs: '{ "acvm-js-ref": "${{ needs.release-please.outputs.tag-name }}" }'

58 changes: 49 additions & 9 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,54 @@ name: Rust
on: [push, pull_request]

jobs:
check_n_test:
name: cargo check & test
uses: noir-lang/.github/.github/workflows/rust-test.yml@main
clippy-n-test:
name: Test on ${{ matrix.os }}
runs-on: ${{ matrix.runner }}
timeout-minutes: 30

clippy:
name: cargo clippy
uses: noir-lang/.github/.github/workflows/rust-clippy.yml@main
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu
runner: ubuntu-latest
target: x86_64-linux

format:
name: cargo fmt
uses: noir-lang/.github/.github/workflows/rust-format.yml@main
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
id: nix-store-cache
uses: actions/cache@v3
with:
path: /tmp/nix-cache
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.nix-store-cache.outputs.cache-hit == 'true'
# We don't check the signature because we're the one that created the cache
run: |
for narinfo in /tmp/nix-cache/*.narinfo; do
path=$(head -n 1 "$narinfo" | awk '{print $2}')
nix copy --no-check-sigs --from "file:///tmp/nix-cache" "$path"
done

- name: Run `nix flake check`
run: |
nix flake check -L

- name: Export cache from nix store
if: steps.nix-store-cache.outputs.cache-hit != 'true'
run: |
nix copy --to "file:///tmp/nix-cache?compression=zstd&parallel-compression=true" .#cargo-artifacts
93 changes: 93 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Test acvm_js

on: [push, pull_request]

# This will cancel previous runs when a branch or PR is updated
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref || github.run_id }}
cancel-in-progress: true

jobs:
build-acvm-js-package:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3

- 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 }}"

- name: Build acvm-js
run: |
nix build .#

- name: Dereference symlink
run: echo "UPLOAD_PATH=$(readlink -f result)" >> $GITHUB_ENV

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: acvm-js
path: ${{ env.UPLOAD_PATH }}
retention-days: 3

test-acvm_js-node:
needs: [build-acvm-js-package]
name: Node.js Tests
runs-on: ubuntu-latest

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

- name: Download artifact
uses: actions/download-artifact@v3
with:
name: acvm-js
path: ./acvm_js/result

- name: Set up test environment
uses: ./.github/actions/setup
with:
working-directory: ./acvm_js

- name: Run node tests
working-directory: ./acvm_js
run: yarn test

test-acvm_js-browser:
needs: [build-acvm-js-package]
name: Browser Tests
runs-on: ubuntu-latest

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

- name: Download artifact
uses: actions/download-artifact@v3
with:
name: acvm-js
path: ./acvm_js/result

- name: Set up test environment
uses: ./.github/actions/setup
with:
working-directory: ./acvm_js

- name: Install playwright deps
working-directory: ./acvm_js
run: |
npx playwright install
npx playwright install-deps

- name: Run browser tests
working-directory: ./acvm_js
run: yarn test:browser
26 changes: 26 additions & 0 deletions .github/workflows/typescript.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Typescript

on: [push, pull_request]

# This will cancel previous runs when a branch or PR is updated
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref || github.run_id }}
cancel-in-progress: true

jobs:
eslint:
name: Eslint
runs-on: ubuntu-latest

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

- name: Install dependencies
uses: ./.github/actions/setup
with:
working-directory: ./acvm_js

- name: Run eslint
working-directory: ./acvm_js
run: yarn lint
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/target
.DS_Store
.vscode
Cargo.lock
# Cargo.lock
result
outputs/
.direnv
Loading
Loading