Skip to content

Commit

Permalink
Merge branch 'master' into sync-noir
Browse files Browse the repository at this point in the history
* master: (26 commits)
  chore: silence cache-download.sh (#9317)
  feat: apella (#9084)
  feat: gerousia (#8942)
  fix: use github.actor on publish workflow dispatch (#9324)
  chore: Copying world state binary to yarn project is on generate (#9194)
  feat: modify private calldata to use public keys (#9276)
  chore: test 4epochs in native-network (#9309)
  git subrepo push --branch=master noir-projects/aztec-nr
  git_subrepo.sh: Fix parent in .gitrepo file. [skip ci]
  chore: replace relative paths to noir-protocol-circuits
  git subrepo push --branch=master barretenberg
  fix: ci github clone edge case (#9320)
  feat: Handle reorgs on sequencer (#9201)
  chore(avm): some cleaning in avm prover (#9311)
  fix: barretenberg readme scare warning (#9313)
  feat: Constrain protocol VK hashing (#9304)
  chore(master): Release 0.59.0 (#9281)
  fix: publish readme on bb.js NPM package (#9303)
  chore: re-enable test fixed by Native World State (#9289)
  fix(docs): Dapp tutorial edits (#8695)
  ...
  • Loading branch information
TomAFrench committed Oct 22, 2024
2 parents 05e1310 + 314d9d2 commit 2e1ca53
Show file tree
Hide file tree
Showing 180 changed files with 6,076 additions and 852 deletions.
21 changes: 12 additions & 9 deletions .github/ensure-builder/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,24 @@ runs:
# Set up a context for this run
- name: Copy Repo to Builder
shell: bash
env:
UNPACK: |
[ -d ~/run-$RUN_ID ] || (
mkdir -p ~/run-$RUN_ID-git &&
cd ~/run-$RUN_ID-git && tar xzf - &&
git config --global advice.detachedHead false &&
git clone ~/run-$RUN_ID-git/.git ~/run-$RUN_ID &&
echo ${{ env.BUILD_INSTANCE_SSH_KEY }} | base64 --decode > ~/.ssh/build_instance_key &&
chmod 600 ~/.ssh/build_instance_key
)
run: |
sudo shutdown -P ${{ steps.select_instance.outputs.ttl }}
set -x
# detect run folder
if ! scripts/run_on_builder "[ -d ~/run-$RUN_ID ]" ; then
echo "Copying local repo to spot"
tar czf - .git | scripts/run_on_builder \
"mkdir -p ~/run-$RUN_ID-git && cd ~/run-$RUN_ID-git && tar xzf -" || true
scripts/run_on_builder "
echo "Unpacking repo"
git config --global advice.detachedHead false
git clone ~/run-$RUN_ID-git/.git ~/run-$RUN_ID
echo ${{ env.BUILD_INSTANCE_SSH_KEY }} | base64 --decode > ~/.ssh/build_instance_key
chmod 600 ~/.ssh/build_instance_key
" || true
(tar czf - .git || true) | scripts/run_on_builder \
"flock ~/git.lock bash -c '$UNPACK'"
fi
- name: Attach EBS Cache Disk
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/publish-aztec-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ jobs:
BRANCH: "${{ github.ref_name }}"
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
echo "username=${{ github.event.pull_request.user.login }}"
echo "username=${{ github.event.pull_request.user.login }}" >> $GITHUB_OUTPUT
echo "username=${{ github.actor }}"
echo "username=${{ github.actor }}" >> $GITHUB_OUTPUT
else
GIT_HASH="${{ github.sha }}"
GIT_HASH_LAST8=${GIT_HASH: -8}
Expand All @@ -71,6 +71,7 @@ jobs:
else
echo "Invalid tag format. Expected aztec-packages-v*"
exit 1
fi
setup-x86:
needs: [configure]
Expand Down
8 changes: 4 additions & 4 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
".": "0.58.0",
".": "0.59.0",
"yarn-project/cli": "0.35.1",
"yarn-project/aztec": "0.58.0",
"barretenberg": "0.58.0",
"barretenberg/ts": "0.58.0"
"yarn-project/aztec": "0.59.0",
"barretenberg": "0.59.0",
"barretenberg/ts": "0.59.0"
}
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Changelog

## [0.59.0](https://github.com/AztecProtocol/aztec-packages/compare/aztec-packages-v0.58.0...aztec-packages-v0.59.0) (2024-10-21)


### ⚠ BREAKING CHANGES

* **seq:** disable sequencer and disable validator as one env var, update p2p listen port names ([#9266](https://github.com/AztecProtocol/aztec-packages/issues/9266))

### Bug Fixes

* **docs:** Dapp tutorial edits ([#8695](https://github.com/AztecProtocol/aztec-packages/issues/8695)) ([f95bcff](https://github.com/AztecProtocol/aztec-packages/commit/f95bcff9902b7e28bffcf96fbd7159b2da88e89c))
* **docs:** Update debugging docs ([#9200](https://github.com/AztecProtocol/aztec-packages/issues/9200)) ([2a4188c](https://github.com/AztecProtocol/aztec-packages/commit/2a4188ca91a1341a3dca1d052a842b730b50fd91))
* Publish readme on bb.js NPM package ([#9303](https://github.com/AztecProtocol/aztec-packages/issues/9303)) ([1d860a8](https://github.com/AztecProtocol/aztec-packages/commit/1d860a82c290d820b0fcc55b61ef68f5501f7c1b))


### Miscellaneous

* Re-enable test fixed by Native World State ([#9289](https://github.com/AztecProtocol/aztec-packages/issues/9289)) ([3fd1802](https://github.com/AztecProtocol/aztec-packages/commit/3fd18028a84f1eae6e7e9d2858d5875a6e47595f)), closes [#8306](https://github.com/AztecProtocol/aztec-packages/issues/8306)
* Replace relative paths to noir-protocol-circuits ([ceeab4e](https://github.com/AztecProtocol/aztec-packages/commit/ceeab4e08240884e84f08e94b32f5350c3def606))
* **seq:** Disable sequencer and disable validator as one env var, update p2p listen port names ([#9266](https://github.com/AztecProtocol/aztec-packages/issues/9266)) ([367c38c](https://github.com/AztecProtocol/aztec-packages/commit/367c38c02b6cda494e9d3c64ea27a1cf3465f082))

## [0.58.0](https://github.com/AztecProtocol/aztec-packages/compare/aztec-packages-v0.57.0...aztec-packages-v0.58.0) (2024-10-18)


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 = b64d075cb709b963b9facc9878de98fd8aefe202
parent = 17c612740dc3563321bf69c1760de1ef88b22124
commit = 1a158d808447c38573acc6a92cd0d9f2b9851a10
parent = 15abe6fe2f12450b7f40d859a394dec966132b0b
method = merge
cmdver = 0.4.6
7 changes: 7 additions & 0 deletions barretenberg/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [0.59.0](https://github.com/AztecProtocol/aztec-packages/compare/barretenberg-v0.58.0...barretenberg-v0.59.0) (2024-10-21)


### Miscellaneous

* **barretenberg:** Synchronize aztec-packages versions

## [0.58.0](https://github.com/AztecProtocol/aztec-packages/compare/barretenberg-v0.57.0...barretenberg-v0.58.0) (2024-10-18)


Expand Down
12 changes: 6 additions & 6 deletions barretenberg/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
> [!WARNING]
> :warning: This is not an actively developed repository, it is a mirror. See <https://github.com/AztecProtocol/aztec-packages> :warning:
> [!WARNING]
> :warning: **<https://github.com/AztecProtocol/barretenberg> is a mirror-only repository, please only use <https://github.com/AztecProtocol/aztec-packages>. Do not use this for any purpose other than reference.** :warning:
![banner](../.github/img/bb_banner.png)

# Barretenberg
Expand Down Expand Up @@ -32,12 +38,6 @@ Barretenberg (or `bb` for short) is an optimized elliptic curve library for the
- [Improving LLDB Debugging](#improving-lldb-debugging)
- [Using Tracy to Profile Memory/CPU](#using-tracy-to-profile-memorycpu)

> [!WARNING]
> :warning: This is not an actively developed repository, it is a mirror. See <https://github.com/AztecProtocol/aztec-packages> :warning:
> [!WARNING]
> :warning: **<https://github.com/AztecProtocol/barretenberg> is a mirror-only repository, please only use <https://github.com/AztecProtocol/aztec-packages>. Do not use this for any purpose other than reference.** :warning:
> [!CAUTION]
> **This code is highly experimental, use at your own risk!**
Expand Down
2 changes: 1 addition & 1 deletion barretenberg/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cmake_minimum_required(VERSION 3.24 FATAL_ERROR)
project(
Barretenberg
DESCRIPTION "BN254 elliptic curve library, and PLONK SNARK prover"
VERSION 0.58.0 # x-release-please-version
VERSION 0.59.0 # x-release-please-version
LANGUAGES CXX C
)
# Insert version into `bb` config file
Expand Down
3 changes: 0 additions & 3 deletions barretenberg/cpp/bootstrap_cache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,3 @@ cp -r $TMP/barretenberg-preset-wasm-threads/build build-wasm-threads/
mkdir -p build
cp -r $TMP/barretenberg-preset-release/build/* build/
cp -r $TMP/barretenberg-preset-release-world-state/build/* build/

mkdir -p ../../yarn-project/world-state/build/
cp $TMP/barretenberg-preset-release-world-state/build/bin/world_state_napi.node ../../yarn-project/world-state/build/
19 changes: 4 additions & 15 deletions barretenberg/cpp/src/barretenberg/vm/avm/generated/prover.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,9 @@ using FF = Flavor::FF;
*/
AvmProver::AvmProver(std::shared_ptr<Flavor::ProvingKey> input_key, std::shared_ptr<PCSCommitmentKey> commitment_key)
: key(std::move(input_key))
, prover_polynomials(*key)
, commitment_key(std::move(commitment_key))
{
for (auto [prover_poly, key_poly] : zip_view(prover_polynomials.get_unshifted(), key->get_all())) {
ASSERT(bb::flavor_get_label(prover_polynomials, prover_poly) == bb::flavor_get_label(*key, key_poly));
prover_poly = key_poly.share();
}
for (auto [prover_poly, key_poly] : zip_view(prover_polynomials.get_shifted(), key->get_to_be_shifted())) {
ASSERT(bb::flavor_get_label(prover_polynomials, prover_poly) ==
bb::flavor_get_label(*key, key_poly) + "_shift");
prover_poly = key_poly.shifted();
}
}
{}

/**
* @brief Add circuit size, public input size, and public inputs to transcript
Expand Down Expand Up @@ -69,11 +60,9 @@ void AvmProver::execute_wire_commitments_round()

void AvmProver::execute_log_derivative_inverse_round()
{
auto [beta, gamm] = transcript->template get_challenges<FF>("beta", "gamma");
auto [beta, gamma] = transcript->template get_challenges<FF>("beta", "gamma");
relation_parameters.beta = beta;
relation_parameters.gamma = gamm;

auto prover_polynomials = ProverPolynomials(*key);
relation_parameters.gamma = gamma;
std::vector<std::function<void()>> tasks;

bb::constexpr_for<0, std::tuple_size_v<Flavor::LookupRelations>, 1>([&]<size_t relation_idx>() {
Expand Down
7 changes: 7 additions & 0 deletions barretenberg/ts/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [0.59.0](https://github.com/AztecProtocol/aztec-packages/compare/barretenberg.js-v0.58.0...barretenberg.js-v0.59.0) (2024-10-21)


### Bug Fixes

* Publish readme on bb.js NPM package ([#9303](https://github.com/AztecProtocol/aztec-packages/issues/9303)) ([1d860a8](https://github.com/AztecProtocol/aztec-packages/commit/1d860a82c290d820b0fcc55b61ef68f5501f7c1b))

## [0.58.0](https://github.com/AztecProtocol/aztec-packages/compare/barretenberg.js-v0.57.0...barretenberg.js-v0.58.0) (2024-10-18)


Expand Down
2 changes: 1 addition & 1 deletion barretenberg/ts/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ deps:
RUN yarn --immutable

# other source files
COPY --dir src *.json *.js *.cjs .
COPY --dir src *.json *.js *.cjs *.md .

# copy over wasm builds from cpp folder
COPY ../cpp/+preset-wasm-threads/bin/barretenberg.wasm src/barretenberg_wasm/barretenberg-threads.wasm
Expand Down
2 changes: 1 addition & 1 deletion barretenberg/ts/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@aztec/bb.js",
"packageManager": "[email protected]",
"version": "0.58.0",
"version": "0.59.0",
"homepage": "https://github.com/AztecProtocol/aztec-packages/tree/master/barretenberg/ts",
"license": "MIT",
"type": "module",
Expand Down
20 changes: 4 additions & 16 deletions bb-pilcom/bb-pil-backend/templates/prover.cpp.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,9 @@ using FF = Flavor::FF;
{{name}}Prover::{{name}}Prover(std::shared_ptr<Flavor::ProvingKey> input_key,
std::shared_ptr<PCSCommitmentKey> commitment_key)
: key(std::move(input_key))
, prover_polynomials(*key)
, commitment_key(std::move(commitment_key))
{
for (auto [prover_poly, key_poly] : zip_view(prover_polynomials.get_unshifted(), key->get_all())) {
ASSERT(bb::flavor_get_label(prover_polynomials, prover_poly) ==
bb::flavor_get_label(*key, key_poly));
prover_poly = key_poly.share();
}
for (auto [prover_poly, key_poly] : zip_view(prover_polynomials.get_shifted(), key->get_to_be_shifted())) {
ASSERT(bb::flavor_get_label(prover_polynomials, prover_poly) ==
bb::flavor_get_label(*key, key_poly) + "_shift");
prover_poly = key_poly.shifted();
}
}
{}

/**
* @brief Add circuit size, public input size, and public inputs to transcript
Expand Down Expand Up @@ -70,11 +60,9 @@ void {{name}}Prover::execute_wire_commitments_round()

void {{name}}Prover::execute_log_derivative_inverse_round()
{
auto [beta, gamm] = transcript->template get_challenges<FF>("beta", "gamma");
auto [beta, gamma] = transcript->template get_challenges<FF>("beta", "gamma");
relation_parameters.beta = beta;
relation_parameters.gamma = gamm;

auto prover_polynomials = ProverPolynomials(*key);
relation_parameters.gamma = gamma;
std::vector<std::function<void()>> tasks;

bb::constexpr_for<0, std::tuple_size_v<Flavor::LookupRelations>, 1>([&]<size_t relation_idx>() {
Expand Down
2 changes: 1 addition & 1 deletion build-system/s3-cache-scripts/cache-download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function on_exit() {
trap on_exit EXIT

# Attempt to download the cache file
aws ${S3_BUILD_CACHE_AWS_PARAMS:-} s3 cp "s3://aztec-ci-artifacts/build-cache/$TAR_FILE" "$TAR_FILE" --quiet --no-progress || (echo "Cache download of $TAR_FILE failed." && exit 1)
aws ${S3_BUILD_CACHE_AWS_PARAMS:-} s3 cp "s3://aztec-ci-artifacts/build-cache/$TAR_FILE" "$TAR_FILE" --quiet &>/dev/null || (echo "Cache download of $TAR_FILE failed." && exit 1)

# Extract the cache file
mkdir -p "$OUT_DIR"
Expand Down
27 changes: 16 additions & 11 deletions docs/docs/reference/developer_references/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ You can log statements from Aztec.nr contracts that will show ups in the Sandbox

### Import `debug_log`

Import the [`debug_log` (GitHub link)](https://github.com/AztecProtocol/aztec-packages/blob/master/noir-projects/aztec-nr/aztec/src/oracle/debug_log.nr) dependency from Aztec oracles:
Import the `debug_log` dependency from Aztec oracles:

```rust
use dep::aztec::oracle::debug_log::{ debug_log };
Expand Down Expand Up @@ -47,16 +47,21 @@ debug_log_array(my_array);

### Start Sandbox in debug mode

Prepend the command to start the sandbox with `DEBUG=aztec:*` to log everything or `DEBUG=aztec:simulator:oracle` to only log your `debug_log()` statements.

```bash
# Using the docker-compose.yml setup
cd ~/.aztec && DEBUG=aztec:* docker-compose up
```

Alternatively you can update the `DEBUG` environment variable in docker-compose.yml and start the sandbox normally.
Update the `DEBUG` environment variable in docker-compose.sandbox.yml to the following:

```yml
environment:
DEBUG: aztec:*
# ~/.aztec/docker-compose.sandbox.yml

# ...

aztec:
image: "aztecprotocol/aztec"
ports:
- "${PXE_PORT:-8080}:${PXE_PORT:-8080}"
environment:
DEBUG: aztec:simulator:client_execution_context, aztec:sandbox, aztec:avm_simulator:debug_log
LOG_LEVEL: verbose # optionally add this for more logs
# ...
```

and start the sandbox normally.
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ For a quick start, follow the [guide](../../../guides/developer_guides/getting_s

There are various environment variables you can use when running the whole sandbox or when running on of the available modes.

To change them, you can open `~/.aztec/docker-compose.yml` and edit them directly.
To change them, you can open `~/.aztec/docker-compose.sandbox.yml` and edit them directly.

**Sandbox**

```sh
DEBUG=aztec:* # The level of debugging logs to be displayed. using "aztec:*" will log everything.
HOST_WORKDIR='${PWD}' # The location to store log outpus. Will use ~/.aztec where the docker-compose.yml file is stored by default.
LOG_LEVEL=debug # Setting to 'debug' will print the debug logs
HOST_WORKDIR='${PWD}' # The location to store log outputs. Will use ~/.aztec where the docker-compose.yml file is stored by default.
ETHEREUM_HOST=http://ethereum:8545 # The Ethereum JSON RPC URL. We use an anvil instance that runs in parallel to the sandbox on docker by default.
L1_CHAIN_ID=31337 # The Chain ID that the Ethereum host is using.
TEST_ACCOUNTS='true' # Option to deploy 3 test account when sandbox starts. (default: true)
Expand Down Expand Up @@ -78,7 +79,7 @@ SEQ_MAX_SECONDS_BETWEEN_BLOCKS=0 # Sequencer will produce a block with less than
SEQ_MIN_SECONDS_BETWEEN_BLOCKS=0 # Minimum seconds to wait between consecutive blocks. (default: 0)

## Validator variables ##
VALIDATOR_PRIVATE_KEY=0x01234567890abcde01234567890abcde # Private key of the ethereum account that will be used to perform validator duties
VALIDATOR_PRIVATE_KEY=0x01234567890abcde01234567890abcde # Private key of the ethereum account that will be used to perform validator duties
```

**PXE**
Expand Down Expand Up @@ -158,14 +159,14 @@ UniswapContractArtifact

> <sup><sub><a href="https://github.com/AztecProtocol/aztec-packages/blob/master//yarn-project/end-to-end/src/composed/cli_docs_sandbox.test.ts#L95-L118" target="_blank" rel="noopener noreferrer">Source code: /yarn-project/end-to-end/src/composed/cli_docs_sandbox.test.ts#L95-L118</a></sub></sup>

You can see all of our example contracts in the monorepo [here (GitHub link)](https://github.com/AztecProtocol/aztec-packages/tree/master/noir-projects/noir-contracts/contracts).
You can see all of our example contracts in the monorepo [here (GitHub link)](https://github.com/AztecProtocol/aztec-packages/tree/master/noir-projects/noir-contracts/contracts).

## Running Aztec PXE / Node / P2P-Bootstrap node individually

If you wish to run components of the Aztec network stack separately, you can use the `aztec start` command with various options for enabling components.

```bash
aztec start --node [nodeOptions] --pxe [pxeOptions] --archiver [archiverOptions] --sequencer [sequencerOptions] --prover [proverOptions] ----p2p-bootstrap [p2pOptions]
aztec start --node [nodeOptions] --pxe [pxeOptions] --archiver [archiverOptions] --sequencer [sequencerOptions] --prover [proverOptions] --p2p-bootstrap [p2pOptions]
```

Starting the aztec node alongside a PXE, sequencer or archiver, will attach the components to the node. Eg if you want to run a PXE separately to a node, you can [read this guide](../../../guides/developer_guides/local_env/run_more_than_one_pxe_sandbox.md).
Expand All @@ -176,4 +177,4 @@ To update the sandbox, run:

```bash
aztec-up
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ easy_private_state = { git="https://github.com/AztecProtocol/aztec-packages/", t
Go to `main.nr` and start with this contract initialization:

```rust
contract Counter {
#include_code setup /noir-projects/noir-contracts/contracts/counter_contract/src/main.nr raw
}
```

Expand Down Expand Up @@ -159,4 +159,4 @@ Follow the private voting contract tutorial on the [next page](./private_voting_

### Optional: Learn more about concepts mentioned here

- [Functions and annotations like `#[aztec(private)]`](../../../aztec/smart_contracts/functions/inner_workings.md)
- [Functions and annotations like `#[aztec(private)]`](../../../aztec/smart_contracts/functions/inner_workings.md)
8 changes: 2 additions & 6 deletions docs/docs/tutorials/codealong/simple_dapp/0_project_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,8 @@ cd sample-dapp
yarn init -yp
```

3. Add the `aztec.js` and `accounts` libraries as a dependency:
3. Add the `aztec.js` and `accounts` libraries as dependencies. Also add `noir-contracts.js` for quick use of example contracts:

```sh
yarn add @aztec/aztec.js @aztec/accounts
yarn add @aztec/aztec.js @aztec/accounts @aztec/noir-contracts.js
```

## Next steps

With your project already set up, let's [connect to the Private eXecution Environment (PXE) running inside Sandbox and grab an account to interact with it](./1_pxe_service.md).
Loading

0 comments on commit 2e1ca53

Please sign in to comment.