From ff26f5449d2471655c9eaec37db65abea7b8be72 Mon Sep 17 00:00:00 2001 From: josh crites Date: Wed, 18 Dec 2024 10:17:20 -0500 Subject: [PATCH 1/4] add aztec-wallet --- .../local_env/sandbox_proving.md | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/docs/docs/guides/developer_guides/local_env/sandbox_proving.md b/docs/docs/guides/developer_guides/local_env/sandbox_proving.md index 1dc5149c42d..ce281d7921f 100644 --- a/docs/docs/guides/developer_guides/local_env/sandbox_proving.md +++ b/docs/docs/guides/developer_guides/local_env/sandbox_proving.md @@ -20,7 +20,7 @@ To enable client-side proving, update the docker compose file found at `~/.aztec ```yml BB_BINARY_PATH: /usr/src/barretenberg/cpp/build/bin/bb PXE_PROVER_ENABLED: 1 -BB_WORKING_DIRECTORY: ~/bb-temp #any temp directory for writing circuit artifacts +BB_WORKING_DIRECTORY: ~/bb-temp #any temp directory for writing circuit artifacts ``` ## Usage @@ -36,3 +36,28 @@ The sandbox will take much longer to start. The first time it starts, it will ne The sandbox will also deploy 3 Schnorr account contracts on startup. The sandbox will need to generate transaction proofs for deployment, which will take additional time. Once everything has been set up, you will see that the PXE is listening on `localhost:8080` as you would see with the sandbox running in the default mode. At this point you can use the sandbox as you would without client-side proving enabled. + +## Proving with `aztec-wallet` + +Alternatively, you can enable proving for transactions using `aztec-wallet` and not all transactions going to the sandbox. + +Open `~/.aztec/bin/aztec-wallet` and update the `ENV_VARS_TO_INJECT` variable to: + +```bash +# ~/.aztec/bin/aztec-wallet +export ENV_VARS_TO_INJECT="WALLET_DATA_DIRECTORY SSH_AUTH_SOCK BB_BINARY_PATH PXE_PROVER_ENABLED BB_WORKING_DIRECTORY" +``` + +Export the following envnironment variables in the terminal where you will run `aztec-wallet` commands: + +```bash +export BB_BINARY_PATH=/usr/src/barretenberg/cpp/build/bin/bb +export PXE_PROVER_ENABLED=1 +export BB_WORKING_DIRECTORY=~/bb-temp +``` + +Now send transactions from `aztec-wallet`, and proving will be enabled. + +Note that you do not need to restart the sandbox in order to start sending proven transactions. You can optionally set this for 1 off transactions. + +If this is the first time you are sending transactions with proving enabled, you will have to download the CRS (which is several GBs). From 18401cd1163af2abbc5fac2977a6cb3e14d7082a Mon Sep 17 00:00:00 2001 From: josh crites Date: Thu, 19 Dec 2024 09:21:57 -0500 Subject: [PATCH 2/4] Update docs/docs/guides/developer_guides/local_env/sandbox_proving.md Co-authored-by: Rahul Kothari --- docs/docs/guides/developer_guides/local_env/sandbox_proving.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/guides/developer_guides/local_env/sandbox_proving.md b/docs/docs/guides/developer_guides/local_env/sandbox_proving.md index ce281d7921f..b705c465646 100644 --- a/docs/docs/guides/developer_guides/local_env/sandbox_proving.md +++ b/docs/docs/guides/developer_guides/local_env/sandbox_proving.md @@ -39,7 +39,7 @@ Once everything has been set up, you will see that the PXE is listening on `loca ## Proving with `aztec-wallet` -Alternatively, you can enable proving for transactions using `aztec-wallet` and not all transactions going to the sandbox. +Alternatively, you can enable proving on a per-transaction basis using the `aztec-wallet` CLI Open `~/.aztec/bin/aztec-wallet` and update the `ENV_VARS_TO_INJECT` variable to: From 9739a916718ab41f7886697bd7f3e8998985a00c Mon Sep 17 00:00:00 2001 From: josh crites Date: Thu, 19 Dec 2024 09:26:20 -0500 Subject: [PATCH 3/4] quickstart link --- docs/docs/guides/developer_guides/local_env/sandbox_proving.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/guides/developer_guides/local_env/sandbox_proving.md b/docs/docs/guides/developer_guides/local_env/sandbox_proving.md index ce281d7921f..a5904b0ecac 100644 --- a/docs/docs/guides/developer_guides/local_env/sandbox_proving.md +++ b/docs/docs/guides/developer_guides/local_env/sandbox_proving.md @@ -56,7 +56,7 @@ export PXE_PROVER_ENABLED=1 export BB_WORKING_DIRECTORY=~/bb-temp ``` -Now send transactions from `aztec-wallet`, and proving will be enabled. +Now send transactions from `aztec-wallet`, and proving will be enabled. Check the [Quickstart](../../getting_started.md) for a refresher on how to send transactions using `aztec-wallet`. Note that you do not need to restart the sandbox in order to start sending proven transactions. You can optionally set this for 1 off transactions. From 871e2aebe35efbab0956004cdfa7c30b50621d60 Mon Sep 17 00:00:00 2001 From: Rahul Kothari Date: Mon, 23 Dec 2024 10:14:54 +0000 Subject: [PATCH 4/4] make it easier to read, add data to wallet reference too --- .../local_env/sandbox_proving.md | 27 ++++++++++++------- .../cli_wallet_reference.md | 4 +++ 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/docs/docs/guides/developer_guides/local_env/sandbox_proving.md b/docs/docs/guides/developer_guides/local_env/sandbox_proving.md index 483d978904c..528d94561d8 100644 --- a/docs/docs/guides/developer_guides/local_env/sandbox_proving.md +++ b/docs/docs/guides/developer_guides/local_env/sandbox_proving.md @@ -5,15 +5,18 @@ tags: [sandbox, PXE] The Sandbox does not have client-side proving in the PXE enabled by default. This reduces testing times and increases development speed by allowing for rapid iteration. -You may want to enable client-side proving in the Sandbox to better understand how long it takes to execute Aztec transactions. +You may want to enable client-side proving in the Sandbox to better understand how long it takes to execute Aztec transactions. There are 2 ways of doing this: +1. Run the sandbox in proving mode (every transaction wil be proved) or +2. Use `aztec-wallet` cli to prove a one-off transaction :::note - -Running the sandbox with client-side proving is much slower and should only be used sparingly to analyze real proving times of executing private functions of a contract. - +Proving is much slower and should only be used sparingly to analyze real proving times of executing private functions of a contract. ::: -## Config +## Sandbox in Proving Mode +Here every transaction, contract deployment will be proved. If you want to just prove a single transaction, follow [proving with aztec-wallet cli](#proving-with-aztec-wallet). + +### Config To enable client-side proving, update the docker compose file found at `~/.aztec/docker-compose.sandbox.yml` and add the following configuration settings under the `aztec:environment` scope. @@ -23,8 +26,7 @@ PXE_PROVER_ENABLED: 1 BB_WORKING_DIRECTORY: ~/bb-temp #any temp directory for writing circuit artifacts ``` -## Usage - +### Usage Once the `docker-compose.sandbox.yml` has been updated, restart the sandbox with: ```bash @@ -38,9 +40,9 @@ The sandbox will also deploy 3 Schnorr account contracts on startup. The sandbox Once everything has been set up, you will see that the PXE is listening on `localhost:8080` as you would see with the sandbox running in the default mode. At this point you can use the sandbox as you would without client-side proving enabled. ## Proving with `aztec-wallet` +You can enable proving on a per-transaction basis using the `aztec-wallet` CLI. -Alternatively, you can enable proving on a per-transaction basis using the `aztec-wallet` CLI - +### Config Open `~/.aztec/bin/aztec-wallet` and update the `ENV_VARS_TO_INJECT` variable to: ```bash @@ -56,8 +58,13 @@ export PXE_PROVER_ENABLED=1 export BB_WORKING_DIRECTORY=~/bb-temp ``` -Now send transactions from `aztec-wallet`, and proving will be enabled. Check the [Quickstart](../../getting_started.md) for a refresher on how to send transactions using `aztec-wallet`. +### Usage +Now send transactions from `aztec-wallet`, and proving will be enabled. Check the [Quickstart](../../getting_started.md) for a refresher on how to send transactions using `aztec-wallet` or check the [reference here](../../../reference/developer_references/cli_wallet_reference.md) Note that you do not need to restart the sandbox in order to start sending proven transactions. You can optionally set this for 1 off transactions. If this is the first time you are sending transactions with proving enabled, you will have to download the CRS (which is several GBs). + +::: note +You can also profile your transactions to get gate count, if you don't want to prove your transactions but check how many constraints it is. Follow [reference here](../../../reference/developer_references/cli_wallet_reference.md#profile) +::: diff --git a/docs/docs/reference/developer_references/cli_wallet_reference.md b/docs/docs/reference/developer_references/cli_wallet_reference.md index 22c1e67e892..f19293d8648 100644 --- a/docs/docs/reference/developer_references/cli_wallet_reference.md +++ b/docs/docs/reference/developer_references/cli_wallet_reference.md @@ -13,6 +13,7 @@ For development, it may be useful to deploy, transact, or create notes in a non- - Pushing arbitrary [notes](../../guides/developer_guides/smart_contracts/writing_contracts/notes/index.md) to your PXE - Creating [authwits](../../guides/developer_guides/smart_contracts/writing_contracts/authwit.md) - Aliasing info and secrets for further usage +- Proving your transactions and profile gate counts :::info @@ -164,3 +165,6 @@ It expects `name` and `storageFieldName`. For example, if the `#[storage]` struc ```bash aztec-wallet add-note JediMember available_members -a master_yoda -ca jedi_order -h 0x00000 ``` + +## Proving +You can prove a transaction using the aztec-wallet with a running sandbox. Follow the guide [here](../../guides/developer_guides/local_env/sandbox_proving.md#proving-with-aztec-wallet)