-
Notifications
You must be signed in to change notification settings - Fork 225
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into constant-brillig-execution
* master: feat: Optimize equality checks between a boolean and constant (#2201) feat: Issue warning for signed integers (#2185) chore: Add `noir_wasm` testing workflow (#1921)
- Loading branch information
Showing
37 changed files
with
4,046 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,8 +9,90 @@ concurrency: | |
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
name: Build Wasm | ||
# 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 | ||
|
||
steps: | ||
- name: Checkout Noir repo | ||
uses: actions/checkout@v3 | ||
|
||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
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/[email protected] | ||
|
||
- 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 | ||
- name: Package artifacts | ||
run: | | ||
mkdir dist | ||
cp ./target/release/nargo ./dist/nargo | ||
7z a -ttar -so -an ./dist/* | 7z a -si ./nargo-x86_64-unknown-linux-gnu.tar.gz | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: nargo | ||
path: ./dist/* | ||
retention-days: 3 | ||
|
||
build-wasm: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
|
@@ -25,3 +107,54 @@ jobs: | |
- name: Build wasm package | ||
run: | | ||
nix build -L .#wasm | ||
- name: Dereference symlink | ||
run: echo "UPLOAD_PATH=$(readlink -f result)" >> $GITHUB_ENV | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: noir_wasm | ||
path: ${{ env.UPLOAD_PATH }} | ||
retention-days: 3 | ||
|
||
test: | ||
needs: [build-wasm, build-nargo] | ||
name: Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout noir-lang/noir | ||
uses: actions/checkout@v3 | ||
|
||
- name: Download wasm package artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: noir_wasm | ||
path: ./crates/wasm/dist | ||
|
||
- name: Download nargo binary | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: nargo | ||
path: ./nargo | ||
|
||
- name: Compile test program with Nargo CLI | ||
working-directory: ./crates/wasm/noir-script | ||
run: | | ||
nargo_binary=${{ github.workspace }}/nargo/nargo | ||
chmod +x $nargo_binary | ||
$nargo_binary compile | ||
- name: Install dependencies | ||
working-directory: ./crates/wasm | ||
run: yarn install | ||
|
||
- name: Install playwright deps | ||
working-directory: ./crates/wasm | ||
run: | | ||
npx playwright install | ||
npx playwright install-deps | ||
- name: Run tests | ||
working-directory: ./crates/wasm | ||
run: yarn test:browser |
2 changes: 1 addition & 1 deletion
2
crates/nargo_cli/tests/execution_success/9_conditional/target/9_conditional.json
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file modified
BIN
-15 Bytes
(100%)
crates/nargo_cli/tests/execution_success/9_conditional/target/witness.tr
Binary file not shown.
2 changes: 1 addition & 1 deletion
2
crates/nargo_cli/tests/execution_success/bool_not/target/bool_not.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"backend":"acvm-backend-barretenberg","abi":{"parameters":[{"name":"x","type":{"kind":"integer","sign":"unsigned","width":1},"visibility":"private"}],"param_witnesses":{"x":[1]},"return_type":null,"return_witnesses":[]},"bytecode":"H4sIAAAAAAAA/81SWwoDIQyMj+5nz5L4WONfr1Kpe/8jtLB+pLJ/jdABiUSYzGS8AcAGJ8zn2FENfMOO+hg14p5SL6FTpCeG2jhjym1nYsqcX4Fj7Jy41FYLVkqx05FrPPCEUeSyggt/A7kL7yB6WnMUNaPU68TdT9nJ922BJ5jmzHu8X/RUh68IyS3g9aD3+Vf59voZoaD8652aSaPEG568Nu0xBQAA","proving_key":null,"verification_key":null} | ||
{"backend":"acvm-backend-barretenberg","abi":{"parameters":[{"name":"x","type":{"kind":"integer","sign":"unsigned","width":1},"visibility":"private"}],"param_witnesses":{"x":[1]},"return_type":null,"return_witnesses":[]},"bytecode":"H4sIAAAAAAAA/6WOwQ3AMAgDQyaCAAn8ukqjkv1H6KNUivrtSZbtj+VaSqnlATJDauftRzr+g2DbYuwiMVoQ04nNpymKzm5kpKZXM+YwseHTBzoJBy11XjkGn487N8yEX77gAAAA","proving_key":null,"verification_key":null} |
Binary file modified
BIN
-11 Bytes
(80%)
crates/nargo_cli/tests/execution_success/bool_not/target/witness.tr
Binary file not shown.
2 changes: 1 addition & 1 deletion
2
crates/nargo_cli/tests/execution_success/bool_or/target/bool_or.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"backend":"acvm-backend-barretenberg","abi":{"parameters":[{"name":"x","type":{"kind":"integer","sign":"unsigned","width":1},"visibility":"private"},{"name":"y","type":{"kind":"integer","sign":"unsigned","width":1},"visibility":"private"}],"param_witnesses":{"x":[1],"y":[2]},"return_type":null,"return_witnesses":[]},"bytecode":"H4sIAAAAAAAA/+1W2wqDMAyN98nE/UprW23f9iuT6f9/wja0kIkvw9OhYEBS83CSnJOW1ER0o8mi9xfPPmL/PkbM32evRKv10DWDVPIhGtdbI7TpWyutNNY8G6vUYLXtXO864aRWgxyNU6OYzOdIFrhim8kIiBUD+03AWF4PbhGYywSHJXi96co5ZjE/E3mAnmiRZ8ljvRKDJg8hUhoANyPcwIbqO8NrJBjk4Tg9H+Xf+s3Bc3MQPZq96nE9gB55ANyKwrxfCbjOAjg3QK1lBezxX8sVkMuv5erCzudytRGzmAlF45a07+Xq03eJ1yjocoXkNGY18svj7QUuV6DaPg8AAA==","proving_key":null,"verification_key":null} | ||
{"backend":"acvm-backend-barretenberg","abi":{"parameters":[{"name":"x","type":{"kind":"integer","sign":"unsigned","width":1},"visibility":"private"},{"name":"y","type":{"kind":"integer","sign":"unsigned","width":1},"visibility":"private"}],"param_witnesses":{"x":[1],"y":[2]},"return_type":null,"return_witnesses":[]},"bytecode":"H4sIAAAAAAAA/+WU0QrDIAxFY6X9nsQkNXnbr0xm//8TNmgFGXurg5UdkIs+XGOuZAGABXbCa02Hhm7fzqDT26GMq0jNqRLTHZMXUxQtq5GRmj6SMVcTy148o5NwpU2dN9zp7+h98RwUBnpNA9/7zR7GP+lhHFfXlfJIv5rHfIE84gdfPAfNA2ts86/9nXeejHS7tqgFAAA=","proving_key":null,"verification_key":null} |
Binary file modified
BIN
-65 Bytes
(47%)
crates/nargo_cli/tests/execution_success/bool_or/target/witness.tr
Binary file not shown.
2 changes: 1 addition & 1 deletion
2
...n_success/brillig_integer_binary_operations/target/brillig_integer_binary_operations.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"backend":"acvm-backend-barretenberg","abi":{"parameters":[],"param_witnesses":{},"return_type":null,"return_witnesses":[]},"bytecode":"H4sIAAAAAAAA/+2Uy27CMBBFB5JCobwKhUKh9BecFzi7/kpRw/9/QmXVixHF3cy1ZEvOJiMWlzN3ovNBRCX9fXr2/WnflTrVdXcuu6IqvlTZXnSj6uZy0oUuGt18l7qqOl3rc3tpz6ot6qorrk1bXdXv02NZSvhkjO8/ZiV7CiQz5+2zOb/zW2bfAw870c3/3PY4u/Mb9M99HKnvITcj3Mfva+8MfyPFIoPv1MUpzc4pPlkhmTnvA5uTrISZuS0UnTugsGWV2w8EfCOvskJ36uKUZg8pPlkhmTnvI5uTrISZQ1soOndEYcvK7D3C38irrNCdujil2WOKT1ZIZs77xOYkK2Hm2BaKzp1Q2LIye0/wN/IqK3SnLk5p9pTikxWSmfPO2JxkJcyc3kCjcucUtqzM3nP8jbzKCt2pi1OavaD4ZIVk5rzPbE6yEmYubKHo3CWFLSuz9xJ/I6+yQnfq4pRmryg+WSGZOe8Lm5OshJkrWyg6d01hy8rsvcbfyKus0J26OKXZG4pPVkhmzvvK5iQrYebGForO3VLYsjJ7b/E38iordKcuTmn2juKTFZKZ876xOclKmLmzhaJz9xS2rMzee/yNvMoK3amLU5p9oPhkhWTmvO9sTrISZh5soejcI4UtK7P3EX8jr7JCd3rv+QEAi3N45i4AAA==","proving_key":null,"verification_key":null} | ||
{"backend":"acvm-backend-barretenberg","abi":{"parameters":[],"param_witnesses":{},"return_type":null,"return_witnesses":[]},"bytecode":"H4sIAAAAAAAA/+2Uy27CMBBFB5JCobwKhdI/6NLOgzi7/kqjhv//hCqqF6M0ZjPXki3Zm1hZ3Jy5E50PIvqk/2dmn1/2WapbVfVN0etSf6ui7Uytqrq7GW10beqfwpRlbyrTtF3bqFZXZa/vdVve1d+ZsSwlPBnje8SsZEcjmTnvnN3ziXeZfS48zESj74x73E28g37cx5LmHnIzwv38vubO8DtSLDL4Tl2c0uyc4pMVkpnzPrF7kpUwM7eFonMXFLascvuDgHfkVVboTl2c0uwlxScrJDPnfWb3JCth5tIWis5dUdiyGuZe4XfkVVboTl2c0uw1xScrJDPnfWH3JCth5toWis7dUNiyGube4HfkVVboTl2c0uwtxScrJDPn3bF7kpUwczuCRuXuKWxZDXPv8TvyKit0py5OafaB4pMVkpnzvrJ7kpUw82ALReceKWxZDXMf8TvyKit0py5OafaJ4pMVkpnzvrF7kpUw82QLReeeKWxZDXOf8TvyKit0py5OafaF4pMVkpnzvrN7kpUw82ILRedeKWxZDXNf8TvyKit0p1PnF6lyuYaMJQAA","proving_key":null,"verification_key":null} |
Binary file modified
BIN
-17 Bytes
(87%)
crates/nargo_cli/tests/execution_success/brillig_integer_binary_operations/target/witness.tr
Binary file not shown.
2 changes: 1 addition & 1 deletion
2
crates/nargo_cli/tests/execution_success/brillig_not/target/brillig_not.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"backend":"acvm-backend-barretenberg","abi":{"parameters":[{"name":"x","type":{"kind":"field"},"visibility":"private"},{"name":"y","type":{"kind":"field"},"visibility":"private"}],"param_witnesses":{"x":[1],"y":[2]},"return_type":null,"return_witnesses":[]},"bytecode":"H4sIAAAAAAAA/+1XWW6DMBAdzBaW0p8exMYQzF+vUlS4/wWqVjRjdaBupYgxChIjIVsOeX6ezbxnAHiBm4X4rC3A8RVHuc1UwIclHXS5sGuP2EoQTOvziKxlOAp8ZktIPOh/PuF3rAIyF/hO+M87wR84mYNnRbgAn09kAuy5JiuCyU34O5EFOuYDNxIYlPWmoYe9LZaW16YZu3pUWr3Juh9MK5t2uBplVGva99poPZrGdP3Qd7JXjR7V1PZ6nG4WMmBNSCziO6MMXcHjTxLFyZnyjcm8wDGDn4K2dpRiiglX2hjseWxjiJjjQxuebVrRau+MrIUOX9vfUvDYEMDhFIu9tbBiRqwEjleknJwp35TM10k1m00mDwW1yBeXH73eXr6ClHrAvQBf8vs694U/RovP20f26V7SQYAf3zLHbTfpYG/h3LF2Sodttot0mJ1EpUMO/qUDLaKt0iEDviaSw/G+Sjg5U76FY35Kh7vtlA6zFYxYJeOZ9ypSRs6LIn0i81M6bMQs0aHcuBU8tnQoMVjMMfIqHTh9KgjH9e022xc2nM0FohgAAA==","proving_key":null,"verification_key":null} | ||
{"backend":"acvm-backend-barretenberg","abi":{"parameters":[{"name":"x","type":{"kind":"field"},"visibility":"private"},{"name":"y","type":{"kind":"field"},"visibility":"private"}],"param_witnesses":{"x":[1],"y":[2]},"return_type":null,"return_witnesses":[]},"bytecode":"H4sIAAAAAAAA/+1VW27EIAx0II9FrfYsEGADf71Ko5L7X6Bqla5RLUr70TgrZbUjRSCSDIONPQoAnuEKiU+JBscXHPU2mIaPS1fkcnGPO3IbQThzzFuypnAU+KzoST7oPx/wM1cNmQv8Rv7xTfMLj6roPBMtwBcT3QP7XdNnwskt+OsiCwzMO24kMCnlpnKHvTOX1Rfn0jQmY82rHuMcvHZ+vgQTjA/+bQzWpuDCFOc46WicTWbx0ablCsnAtaCwlu+MWtaSx39JDKdmqrcj8yccFXwXdMZRiqkjWmljyOfJjaFlzg9teLlptcXeiqzJSqzzuwF2bAiUswz+1sLqgLewbuH0glFzRe7hnD4Xz0DWHk7Pw3kTp1+FU6evdRNup6dFtNXpe+BrSAMcz+k5NVO9JzJ/OP2/cR9Or7fBnICvSAXRWF7GFZ+KOUARABAAAA==","proving_key":null,"verification_key":null} |
Binary file modified
BIN
-16 Bytes
(81%)
crates/nargo_cli/tests/execution_success/brillig_not/target/witness.tr
Binary file not shown.
2 changes: 1 addition & 1 deletion
2
crates/nargo_cli/tests/execution_success/modulus/target/modulus.json
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file modified
BIN
-4.05 KB
(26%)
crates/nargo_cli/tests/execution_success/modulus/target/witness.tr
Binary file not shown.
2 changes: 1 addition & 1 deletion
2
crates/nargo_cli/tests/execution_success/pred_eq/target/pred_eq.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"backend":"acvm-backend-barretenberg","abi":{"parameters":[{"name":"x","type":{"kind":"field"},"visibility":"private"},{"name":"y","type":{"kind":"field"},"visibility":"private"}],"param_witnesses":{"x":[1],"y":[2]},"return_type":null,"return_witnesses":[]},"bytecode":"H4sIAAAAAAAA/+1USxLCIAxNf9huPAvhU8LOq8hI738ERwcdrOwaHBZmkwyLl7yX8BYAWOA7hpQvKctjgV2GpeVqTHQqosarVD6QlcaGlZDQkr0p0jqSIeeDd9Kj0RE36/WWwHpGrIGP4xOrK2jZMWvJOXM+71io+8JNiAqcYNdnr+O58MbavMaSxgq4E/Adfy3eE/+OZAb5PsoWNRXAa06/MBQBdQzllNV/QzmIKZKg3LgztG0oD94z/44+DKVlTftsxvzzvOIOhKdrBcIJAAA=","proving_key":null,"verification_key":null} | ||
{"backend":"acvm-backend-barretenberg","abi":{"parameters":[{"name":"x","type":{"kind":"field"},"visibility":"private"},{"name":"y","type":{"kind":"field"},"visibility":"private"}],"param_witnesses":{"x":[1],"y":[2]},"return_type":null,"return_witnesses":[]},"bytecode":"H4sIAAAAAAAA/81TMQ7DIAw0JGTsW2wMwWz9SlHJ/59QqaISStlipNxixHC+O9sbADj4x9Lqs1W8BjIdF+MeQk2+EtMLfS4SMcSyCwlFiW8vzFWCpFxywkyBKx0x89HIrCLXoufxy2UGWRrlLDU193rXwdsOdmKb4AlOfc45PgZ/qs1nDGmdwOtAb/ln+Xb6M8KO8taZ2k5jfzw/fADLYG+4cQUAAA==","proving_key":null,"verification_key":null} |
Binary file modified
BIN
-9 Bytes
(87%)
crates/nargo_cli/tests/execution_success/pred_eq/target/witness.tr
Binary file not shown.
Oops, something went wrong.