Skip to content

Commit

Permalink
Merge commit 'cd2f67f' into ad/refactor/bb/non_stdlib_namespace_short…
Browse files Browse the repository at this point in the history
…ening
  • Loading branch information
ludamad0 committed Jan 19, 2024
2 parents 9d292f1 + cd2f67f commit 802e90a
Show file tree
Hide file tree
Showing 207 changed files with 4,090 additions and 2,574 deletions.
5 changes: 5 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -996,6 +996,11 @@ jobs:
command: |
should_release || exit 0
yarn-project/deploy_npm.sh canary
- run:
name: "Release latest to NPM: bb.js"
command: |
should_release || exit 0
deploy_npm bb.js latest
- run:
name: "Release latest to NPM: yarn-project"
command: |
Expand Down
30 changes: 15 additions & 15 deletions .github/workflows/publish-bb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
sudo cp -r clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/lib/* /usr/local/lib/
sudo cp -r clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/share/* /usr/local/share/
- name: Install yarn
- name: Install yarn # Needed to call 'yarn build' on barretenberg/ts
run: |
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
Expand All @@ -104,7 +104,7 @@ jobs:
./scripts/install-wasi-sdk.sh
- name: Compile Typescript
- name: Compile Typescript # Compiles bb.js and wasms
run: |
cd barretenberg/ts
yarn install && yarn && yarn build
Expand All @@ -117,19 +117,19 @@ jobs:
working-directory: barretenberg/cpp/build-wasm/bin
run: tar -cvzf acvm_backend.wasm.tar.gz acvm_backend.wasm

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: "18"
registry-url: "https://registry.npmjs.org"

- name: Deploy Typescript to NPM
if: github.event.inputs.tag != 'nightly' && github.event.inputs.tag != '' # Do not deploy to npm if it is a nightly build
run: |
cd barretenberg/ts
yarn deploy
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
# - name: Setup Node.js
# uses: actions/setup-node@v2
# with:
# node-version: "18"
# registry-url: "https://registry.npmjs.org"

# - name: Deploy Typescript to NPM
# if: github.event.inputs.tag != 'nightly' && github.event.inputs.tag != '' # Do not deploy to npm if it is a nightly build
# run: |
# cd barretenberg/ts
# yarn deploy
# env:
# NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

- name: Upload artifacts
uses: actions/upload-artifact@v2
Expand Down
4 changes: 2 additions & 2 deletions barretenberg/.gitrepo
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[subrepo]
remote = https://github.com/AztecProtocol/barretenberg
branch = master
commit = 4f7bac9189d6b75b9591ecad688f964646783e2b
parent = 50b4a728b4c20503f6ab56c07feaa29d767cec10
commit = f01329ccb7a07c8828a06a19d0a4d77d3f89087a
parent = b77afb14c609cfc04663a318eecaa8cbd3b2fa85
method = merge
cmdver = 0.4.6
3 changes: 2 additions & 1 deletion barretenberg/cpp/scripts/ci/upload_benchmarks_to_s3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ elif [ -n "${PULL_REQUEST:-}" ]; then
TARGET_FOLDER="barretenberg-bench-v1/pulls/${PULL_REQUEST##*/}"
else
echo Skipping upload since no target folder was defined
exit
fi
echo "Uploading to s3://$BUCKET_NAME/$TARGET_FOLDER"
aws s3 cp extracted-repo/src/barretenberg/cpp/build/ultra_honk_rounds_bench.json "s3://$BUCKET_NAME/$TARGET_FOLDER/ultra_honk_rounds_bench.json"
aws s3 cp extracted-repo/src/barretenberg/cpp/build/ultra_honk_rounds_bench.json "s3://$BUCKET_NAME/$TARGET_FOLDER/ultra_honk_rounds_bench.json"
1 change: 0 additions & 1 deletion build_manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ docs:
- ^.*.hpp$
- ^.*.ts$
- ^.release-please-manifest.json$
- ^.*/noir-version.json$
- ^.*.nr$
dependencies:
- yarn-project
Expand Down
11 changes: 0 additions & 11 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,3 @@ Alternatively, you can also use the `AztecPackagesVersion()` js function, which
import { AztecPackagesVersion } from "@site/src/components/Version";
<>{AztecPackagesVersion()}</>
```
### `#include_noir_version`
This macros will be replaced inline with the required nargo version, which is `0.11.1-aztec.0` at the time of these writing. This value is sourced from `yarn-project/noir-compiler/src/noir-version.json`.
Alternatively, you can also use the `NoirVersion()` js function, which you need to import explicitly:
```
import { NoirVersion } from "@site/src/components/Version";
<>{NoirVersion()}</>
```
22 changes: 0 additions & 22 deletions docs/docs/dev_docs/cli/cli-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,6 @@ Here you will find a reference to the commands available in the Aztec CLI.

The CLI will be installed automatically via Docker by running the command to install and start the sandbox, [instructions here](./sandbox-reference.md#with-docker).

:::info

The `@aztec/aztec-sandbox` and `@aztec/cli` packages published to npm **should not be used**, in favor of Docker. If you've installed the sandbox or the CLI via NPM, **uninstall** them and remove them from your project dependencies and [install via Docker](./sandbox-reference.md#with-docker).

<Tabs>
<TabItem value="yarn" label="yarn" default>

<code>
yarn global remove @aztec/aztec-sandbox @aztec/cli
</code>

</TabItem>
<TabItem value="npm" label="npm">

<code>
npm -g uninstall @aztec/aztec-sandbox @aztec/cli
</code>

</TabItem>
</Tabs>
:::

## Update

The CLI comes with an update command.
Expand Down
14 changes: 9 additions & 5 deletions docs/docs/dev_docs/contracts/main.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,23 @@ An **Aztec smart contract** is a smart contract with **private** state variables

## Install aztec-nargo

To write an Aztec.nr contract, you need to write Noir, `aztec-nargo` comes with a built-in compiler for Aztec contracts written in Noir. See install instructions [here](../cli/sandbox-reference.md).
To write an Aztec.nr contract, you need to the compiler, `aztec-nargo` which is installed when you install the sandbox. See install instructions [here](../cli/sandbox-reference.md).

:::info
For those coming from vanilla Noir, the version used for aztec.nr is tracked separately to nargo for vanilla Noir. Be sure to use `aztec-nargo` to compile your contracts.
:::

## Install `nargo` (recommended)
## Install Noir LSP (recommended)

`aztec-nargo` comes with the Noir compiler, so installing `nargo` is not required, however it is recommended as it provides a better developer experience for writing contracts. You will need nargo installed to take advantage of the [Noir Language Server](https://noir-lang.org/docs/getting_started/tooling/language_server), which provides syntax highlighting and formatting for your Aztec contracts.
Install the [Noir Language Support extension](https://marketplace.visualstudio.com/items?itemName=noir-lang.vscode-noir) to get syntax highlighting, syntax error detection and go-to definitions for your Aztec contracts.

You can install `nargo` with the following commands:
Once the extension is installed, go to your VSCode settings, search for "noir" and update the `Noir: Nargo Path` field to point to your `aztec-nargo` executable.

<InstallNargoInstructions />
You can print the path of your `aztec-nargo` executable by running:

```bash
which aztec-nargo
```

## Install Noir tooling

Expand Down
5 changes: 0 additions & 5 deletions docs/docs/dev_docs/getting_started/aztecjs-getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ A successful run should show something like this:
```
token Aztec Sandbox Info {
token sandboxVersion: '#include_aztec_short_version',
token compatibleNargoVersion: '#include_noir_version',
token chainId: 31337,
token protocolVersion: 1,
token l1ContractAddresses: {
Expand Down Expand Up @@ -168,7 +167,6 @@ Now that we have our accounts loaded, let's move on to deploy our pre-compiled t
```
token Aztec Sandbox Info {
token sandboxVersion: '#include_aztec_short_version',
token compatibleNargoVersion: '#include_noir_version',
token chainId: 31337,
token protocolVersion: 1,
token l1ContractAddresses: {
Expand Down Expand Up @@ -220,7 +218,6 @@ Running now should yield output:
```
token Aztec Sandbox Info {
token sandboxVersion: '#include_aztec_short_version',
token compatibleNargoVersion: '#include_noir_version',
token chainId: 31337,
token protocolVersion: 1,
token l1ContractAddresses: {
Expand Down Expand Up @@ -282,7 +279,6 @@ Our output should now look like this:
```
token Aztec Sandbox Info {
token sandboxVersion: '#include_aztec_short_version',
token compatibleNargoVersion: '#include_noir_version',
token chainId: 31337,
token protocolVersion: 1,
token l1ContractAddresses: {
Expand Down Expand Up @@ -339,7 +335,6 @@ Our complete output should now be something like:
```
token Aztec Sandbox Info {
token sandboxVersion: '#include_aztec_short_version',
token compatibleNargoVersion: '#include_noir_version',
token chainId: 31337,
token protocolVersion: 1,
token l1ContractAddresses: {
Expand Down
12 changes: 7 additions & 5 deletions docs/docs/dev_docs/getting_started/aztecnr-getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,15 +205,17 @@ You can also test the functions by applying what you learned in the [quickstart]

Congratulations, you have now written, compiled, and deployed your first Aztec.nr smart contract!

## Install `nargo` (recommended)
## Install Noir LSP (recommended)

The CLI comes with the Noir compiler, so installing `nargo` is not required, however it is recommended as it provides a better developer experience for writing contracts. You will need nargo installed to take advantage of the [Noir Language Server](https://noir-lang.org/docs/getting_started/tooling/language_server), which provides syntax highlighting and formatting for your Aztec contracts.
Install the [Noir Language Support extension](https://marketplace.visualstudio.com/items?itemName=noir-lang.vscode-noir) to get syntax highlighting, syntax error detection and go-to definitions for your Aztec contracts.

You will also need `nargo` if you want to run unit tests in Noir.
Once the extension is installed, go to your VSCode settings, search for "noir" and update the `Noir: Nargo Path` field to point to your `aztec-nargo` executable.

You can install `nargo` with the following commands:
You can print the path of your `aztec-nargo` executable by running:

<InstallNargoInstructions />
```bash
which aztec-nargo
```

## What's next?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
To add contracts to your application, we'll start by creating a new `aztec-nargo` project. We'll then compile the contracts, and write a simple script to deploy them to our Sandbox.

:::info
Follow the instructions [here](../../contracts/setup.md) to install `nargo` if you haven't done so already.
Follow the instructions [here](../../cli/sandbox-reference.md) to install `aztec-nargo` if you haven't done so already.
:::

## Initialize Aztec project
Expand Down
34 changes: 7 additions & 27 deletions docs/docs/dev_docs/updating.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,12 @@
title: Updating
---

:::info
The `@aztec/aztec-sandbox` and `@aztec/cli` packages published to npm **should not be used**, in favor of Docker. If you've installed the sandbox or the CLI via NPM, **uninstall** them and remove them from your project dependencies and [install via Docker](./cli/sandbox-reference.md#with-docker).

<Tabs>
<TabItem value="yarn" label="yarn" default>

<code>
yarn global remove @aztec/aztec-sandbox @aztec/cli
</code>

</TabItem>
<TabItem value="npm" label="npm">

<code>
npm -g uninstall @aztec/aztec-sandbox @aztec/cli
</code>

</TabItem>
</Tabs>

:::

## TL;DR

1. Updating the sandbox and CLI:

```shell
aztec-up latest
aztec-up
```

2. Updating aztec-nr and individual @aztec dependencies:
Expand All @@ -47,13 +25,15 @@ The sandbox must be running for the update command to work. Make sure it is [ins

---

There are three components whose versions need to be kept compatible:
There are four components whose versions need to be kept compatible:

1. Aztec Sandbox
2. Aztec CLI
3. `Aztec.nr`, the Noir framework for writing Aztec contracts
3. aztec-nargo
4. `Aztec.nr`, the Noir framework for writing Aztec contracts

All three are using the same versioning scheme and their versions must match. Docker ensures that the sandbox and CLI are always compatible, but you need to update Aztec.nr manually or using `aztec-cli update`.
First three are packaged together in docker and are kept compatible by running `aztec-up`.
But you need to update your Aztec.nr version manually or using `aztec-cli update`.

## Updating Aztec.nr packages

Expand Down Expand Up @@ -91,5 +71,5 @@ If the dependencies fail to resolve ensure that the tag matches a tag in the [az
`aztec-nargo` is updated by running:

```bash
aztec-up latest
aztec-up
```
10 changes: 1 addition & 9 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,6 @@ const config = {
name: "load-versions",
async loadContent() {
try {
const noirVersionPath = path.resolve(
__dirname,
"../yarn-project/noir-compiler/src/noir-version.json"
);
const noirVersion = JSON.parse(
fs.readFileSync(noirVersionPath).toString()
).tag;
const aztecVersionPath = path.resolve(
__dirname,
"../.release-please-manifest.json"
Expand All @@ -97,12 +90,11 @@ const config = {
fs.readFileSync(aztecVersionPath).toString()
)["."];
return {
noir: noirVersion,
"aztec-packages": `aztec-packages-v${aztecVersion}`,
};
} catch (err) {
throw new Error(
`Error loading Noir version from noir-compiler in docusaurus build. Check load-versions in docusaurus.config.js.\n${err}`
`Error loading versions in docusaurus build. Check load-versions in docusaurus.config.js.\n${err}`
);
}
},
Expand Down
12 changes: 0 additions & 12 deletions docs/src/components/InstallNargoInstructions/index.js

This file was deleted.

1 change: 0 additions & 1 deletion docs/src/components/Version/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ export default function Version({ what }) {
return Versions()[what];
}

export const NoirVersion = () => Versions()["noir"];
export const AztecPackagesVersion = () => Versions()["aztec-packages"];
8 changes: 0 additions & 8 deletions docs/src/preprocess/include_version.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@ let versions;
async function getVersions() {
if (!versions) {
try {
const noirVersionPath = path.resolve(
__dirname,
"../../../yarn-project/noir-compiler/src/noir-version.json"
);
const noirVersion = JSON.parse(
fs.readFileSync(noirVersionPath).toString()
).tag;
const aztecVersionPath = path.resolve(
__dirname,
"../../../.release-please-manifest.json"
Expand All @@ -22,7 +15,6 @@ async function getVersions() {
fs.readFileSync(aztecVersionPath).toString()
)["."];
versions = {
noir: noirVersion,
aztec: `aztec-packages-v${aztecVersion}`,
aztec_short: aztecVersion,
};
Expand Down
8 changes: 1 addition & 7 deletions docs/src/theme/MDXComponents.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
import React from "react";
import MDXComponents from "@theme-original/MDXComponents";
import Version, {
NoirVersion,
AztecPackagesVersion,
} from "@site/src/components/Version";
import InstallNargoInstructions from "@site/src/components/InstallNargoInstructions";
import Version, { AztecPackagesVersion } from "@site/src/components/Version";
import CodeBlock from "@theme/CodeBlock";

// https://docusaurus.io/docs/markdown-features/react#mdx-component-scope
export default {
...MDXComponents,
Version,
NoirVersion,
AztecPackagesVersion,
InstallNargoInstructions,
CodeBlock,
};
Loading

0 comments on commit 802e90a

Please sign in to comment.