Skip to content

Commit

Permalink
Merge branch 'master' into lde/standard_end_of_life_ceremony
Browse files Browse the repository at this point in the history
  • Loading branch information
ledwards2225 authored Sep 22, 2023
2 parents f1db4b8 + 2fe8f5e commit a6c6006
Show file tree
Hide file tree
Showing 242 changed files with 3,070 additions and 3,673 deletions.
18 changes: 2 additions & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -671,17 +671,6 @@ jobs:
name: "Build"
command: build ethereum

rollup-provider:
machine:
image: ubuntu-2004:202010-01
resource_class: large
steps:
- *checkout
- *setup_env
- run:
name: "Build"
command: build rollup-provider

e2e-2-rpc-servers:
machine:
image: ubuntu-2004:202010-01
Expand Down Expand Up @@ -1315,8 +1304,6 @@ workflows:
when:
equal: [system, << pipeline.parameters.workflow >>]
jobs:
- build-docs: *defaults

# Barretenberg
- barretenberg-x86_64-linux-gcc: *defaults
- barretenberg-x86_64-linux-clang: *defaults
Expand Down Expand Up @@ -1409,7 +1396,8 @@ workflows:
- l1-contracts
- noir-contracts-build
<<: *defaults


- build-docs: *yarn_project
- aztec-js: *yarn_project
- end-to-end: *yarn_project
- ethereum: *yarn_project
Expand All @@ -1430,7 +1418,6 @@ workflows:
- sequencer-client: *yarn_project
- types: *yarn_project
- circuits-js: *yarn_project
- rollup-provider: *yarn_project
- aztec-sandbox-base: *yarn_project
- canary: *yarn_project

Expand Down Expand Up @@ -1471,7 +1458,6 @@ workflows:
- sequencer-client
- types
- circuits-js
- rollup-provider
- aztec-sandbox-ecr-manifest
- canary
<<: *defaults
Expand Down
11 changes: 8 additions & 3 deletions barretenberg/cpp/src/barretenberg/bb/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,14 @@ int main(int argc, char* argv[])
std::string vk_path = getOption(args, "-k", "./target/vk");
CRS_PATH = getOption(args, "-c", "./crs");
bool recursive = flagPresent(args, "-r") || flagPresent(args, "--recursive");

// Skip CRS initialization for any command which doesn't require the CRS.
if (command == "info") {
std::string output_path = getOption(args, "-o", "info.json");
acvmInfo(output_path);
return 0;
}

init();

if (command == "prove_and_verify") {
Expand All @@ -355,9 +363,6 @@ int main(int argc, char* argv[])
} else if (command == "vk_as_fields") {
std::string output_path = getOption(args, "-o", vk_path + "_fields.json");
vkAsFields(vk_path, output_path);
} else if (command == "info") {
std::string output_path = getOption(args, "-o", "info.json");
acvmInfo(output_path);
} else {
std::cerr << "Unknown command: " << command << "\n";
return 1;
Expand Down
6 changes: 1 addition & 5 deletions build_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,6 @@
"buildDir": "yarn-project",
"projectDir": "yarn-project/prover-client"
},
"rollup-provider": {
"buildDir": "yarn-project",
"projectDir": "yarn-project/rollup-provider"
},
"aztec-node": {
"buildDir": "yarn-project",
"projectDir": "yarn-project/aztec-node"
Expand All @@ -240,4 +236,4 @@
"buildDir": "yarn-project",
"projectDir": "yarn-project/world-state"
}
}
}
8 changes: 4 additions & 4 deletions circuits/cpp/src/aztec3/circuits/apps/.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ TEST_F(state_var_tests, circuit_utxo_of_default_private_note_fr)
.creator_address = msg_sender,
.memo = 1234 });

exec_ctx.finalise();
exec_ctx.finalize();

// Here, we test that the shared_ptr of a note, stored within the exec_ctx, works. TODO: put this in its own little
// test, instead of this ever-growing beast test.
Expand Down Expand Up @@ -270,7 +270,7 @@ TEST_F(state_var_tests, circuit_utxo_set_of_default_private_notes_fr)
.memo = 1234,
});

exec_ctx.finalise();
exec_ctx.finalize();

// Here, we test that the shared_ptr of a note, stored within the exec_ctx, works. TODO: put this in its own little
// test, instead of this ever-growing beast test.
Expand Down Expand Up @@ -318,7 +318,7 @@ TEST_F(state_var_tests, circuit_initialise_utxo_of_default_singleton_private_not

my_utxo.initialise({ .value = 100, .owner = owner_of_initialised_note });

exec_ctx.finalise();
exec_ctx.finalize();

// Here, we test that the shared_ptr of a note, stored within the exec_ctx, works. TODO: put this in its own little
// test, instead of this ever-growing beast test.
Expand Down Expand Up @@ -367,7 +367,7 @@ TEST_F(state_var_tests, circuit_modify_utxo_of_default_singleton_private_note_fr
.owner = msg_sender,
});

exec_ctx.finalise();
exec_ctx.finalize();

// Here, we test that the shared_ptr of a note, stored within the exec_ctx, works. TODO: put this in its own little
// test, instead of this ever-growing beast test.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ template <typename Builder> class FunctionExecutionContext {

PrivateCircuitPublicInputs<NT> final_private_circuit_public_inputs{};

bool is_finalised = false;
bool is_finalized = false;

public:
FunctionExecutionContext(Builder& builder, OracleWrapperInterface<Builder>& oracle)
Expand Down Expand Up @@ -101,8 +101,8 @@ template <typename Builder> class FunctionExecutionContext {
PrivateCircuitPublicInputs<NT> get_final_private_circuit_public_inputs()
{
// For safety, only return this if the circuit is complete.
if (!is_finalised) {
throw_or_abort("You need to call exec_ctx.finalise() in your circuit first.");
if (!is_finalized) {
throw_or_abort("You need to call exec_ctx.finalize() in your circuit first.");
}
return final_private_circuit_public_inputs;
}
Expand Down Expand Up @@ -287,7 +287,7 @@ template <typename Builder> class FunctionExecutionContext {
* TODO: Might need some refactoring. Roles between: Opcodes modifying exec_ctx members; and the exec_ctx directly
* modifying its members, are somewhat blurred at the moment.
*/
void finalise_utxos()
void finalize_utxos()
{
// Copy some vectors, as we can't control whether they'll be pushed-to further, when we call Note methods.
auto new_nullifiers_copy = new_nullifiers;
Expand Down Expand Up @@ -319,16 +319,16 @@ template <typename Builder> class FunctionExecutionContext {
std::copy(new_nonces.begin(), new_nonces.end(), std::back_inserter(new_nullifiers));
}

void finalise()
void finalize()
{
finalise_utxos();
finalize_utxos();
private_circuit_public_inputs.set_commitments(new_commitments);
private_circuit_public_inputs.set_nullifiers(new_nullifiers);
private_circuit_public_inputs.set_nullified_commitments(nullified_commitments);
private_circuit_public_inputs.set_public(builder);
final_private_circuit_public_inputs =
private_circuit_public_inputs.remove_optionality().template to_native_type<Builder>();
is_finalised = true;
is_finalized = true;
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ OptionalPrivateCircuitPublicInputs<NT> constructor(FunctionExecutionContext& exe
auto& public_inputs = exec_ctx.private_circuit_public_inputs;
public_inputs.args_hash = compute_var_args_hash<CT>({ arg0, arg1, arg2 });

exec_ctx.finalise();
exec_ctx.finalize();

// info("public inputs: ", public_inputs);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ OptionalPrivateCircuitPublicInputs<NT> deposit(FunctionExecutionContext& exec_ct
auto& public_inputs = exec_ctx.private_circuit_public_inputs;
public_inputs.args_hash = compute_var_args_hash<CT>({ amount, asset_id, memo });

exec_ctx.finalise();
exec_ctx.finalize();

// info("public inputs: ", public_inputs);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ OptionalPrivateCircuitPublicInputs<NT> transfer(FunctionExecutionContext& exec_c
/// TODO: merkle membership check
// public_inputs.historic_private_data_tree_root

exec_ctx.finalise();
exec_ctx.finalize();

// info("public inputs: ", public_inputs);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ OptionalPrivateCircuitPublicInputs<NT> withdraw(FunctionExecutionContext& exec_c
auto& public_inputs = exec_ctx.private_circuit_public_inputs;
public_inputs.args_hash = compute_var_args_hash<CT>({ amount, asset_id, memo, l1_withdrawal_address, fee });

exec_ctx.finalise();
exec_ctx.finalize();

/// TODO: merkle membership check
// public_inputs.historic_private_data_tree_root
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void function_1_1(FunctionExecutionContext& exec_ctx, std::vector<NT::fr> const&
auto& public_inputs = exec_ctx.private_circuit_public_inputs;
public_inputs.args_hash = compute_var_args_hash<CT>({ a, b, c });

exec_ctx.finalise();
exec_ctx.finalize();
};

} // namespace aztec3::circuits::apps::test_apps::private_to_private_function_call
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void function_2_1(FunctionExecutionContext& exec_ctx, std::vector<NT::fr> const&

public_inputs.return_values[0] = product;

exec_ctx.finalise();
exec_ctx.finalize();

// info("public inputs: ", public_inputs);

Expand Down
10 changes: 7 additions & 3 deletions docs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
FROM node:18-alpine
RUN apk update
FROM 278380418400.dkr.ecr.eu-west-2.amazonaws.com/yarn-project-base AS builder

WORKDIR /usr/src

COPY . .

WORKDIR /usr/src/yarn-project

RUN yarn build

WORKDIR /usr/src/docs

RUN yarn && yarn build
RUN yarn && yarn build

29 changes: 25 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,12 @@ Most changes are reflected live without having to restart the server.
$ yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.
This command generates static content into the `build` directory and can be served using any static contents hosting service. When run on Netlify, it will also build the typescript projects needed for extracting type information via typedoc.


## #include_code macro
## Macros

### `#include_code`

You can embed code snippets into a `.md`/`.mdx` file from code which lives elsewhere in the repo.
- In your markdown file:
Expand Down Expand Up @@ -119,7 +121,26 @@ You can embed code snippets into a `.md`/`.mdx` file from code which lives elsew
- `#include_code hello path/from/repo/root/to/file.ts typescript noTitle,noLineNumbers,noSourceLink`
- Ironically, we can't show you a rendering of these examples, because this README.md file doesn't support the `#include_code` macro!

> See [here](./src/components/GithubCode/index.js) for another way to include code, although this approach is flakier, so the above `#include_code` macro is preferred.

### `#include_aztec_version`

This macros will be replaced inline with the current aztec packages tag, which is `aztec-packages-v0.7.10` at the time of these writing. This value is sourced from `.release-please-manifest.json` on the project root.

### Another way to include code.
Alternatively, you can also use the `AztecPackagesVersion()` js function, which you need to import explicitly:

```
import { AztecPackagesVersion } from "@site/src/components/Version";
<>{AztecPackagesVersion()}</>
```
See [here](./src/components/GithubCode/index.js), although this approach is flakier, so the above `#include_code` macro is preferred.
### `#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()}</>
```
1 change: 1 addition & 0 deletions docs/docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/apis
2 changes: 1 addition & 1 deletion docs/docs/about_aztec/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Contributors to Aztec uphold many of the values of the Ethereum community -- bui

Noir is a domain specific programming language for writing zero knowledge circuits. On Aztec a smart contract is a collection of circuits that developers write using Noir.

You can find more information and resources for learning about Noir smart contracts on [this page](../dev_docs/getting_started/noir_contracts.md).
You can find more information and resources for learning about Noir smart contracts on [this page](../dev_docs/contracts/main.md).

## Cryptography

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/concepts/advanced/contract_creation.md
Original file line number Diff line number Diff line change
Expand Up @@ -327,4 +327,4 @@ Adds initial public state variables to the public data tree.

## Further reading

To see how to deploy a contract in practice, check out the [dapp development tutorial](../../dev_docs/dapps/tutorials/main.md).
To see how to deploy a contract in practice, check out the [dapp development tutorial](../../dev_docs/tutorials/writing_dapp/main.md).
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ import Disclaimer from "../../../misc/common/\_disclaimer.mdx";

## Indexed Merkle Trees

This article will introduce the concept of an indexed merkle tree, and how it can be used to improve the performance of nullifier trees in circuits. The content was also covered in a presentation for the [Privacy + Scaling Explorations team at the Ethereum Foundation](https://pse.dev/).

<iframe width="100%" height="720" src="https://www.youtube-nocookie.com/embed/x_0ZhUKtWSs?si=TmguEhgz4Gu07Dac" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>

#### Primer on Nullifier Trees

Currently the only feasible way to get privacy in public blockchains is via a UTXO model. In this model, state is stored in encrypted UTXO's in merkle trees. However, to maintain privacy, state can not be updated. The very act of performing an update leaks information. In order to simulate "updating" the state, we "destroy" old UTXO's and create new ones for each state update. Resulting in a merkle tree that is append-only.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ The L2 -> L1 pending messages set only exist logically, as it is practically unn

### Rollup Contract

The rollup contract has a few very important responsibilities. The contract must keep track of the _L2 rollup state root_, perform _state transitions_ and ensure that the data is available for anyone else to synchronise to the current state.
The rollup contract has a few very important responsibilities. The contract must keep track of the _L2 rollup state root_, perform _state transitions_ and ensure that the data is available for anyone else to synchronize to the current state.

To ensure that _state transitions_ are performed correctly, the contract will derive public inputs for the **rollup circuit** based on the input data, and then use a _verifier_ contract to validate that inputs correctly transition the current state to the next. All data needed for the public inputs to the circuit must be from the rollup block, ensuring that the block is available. For a valid proof, the _rollup state root_ is updated and it will emit an _event_ to make it easy for anyone to find the data by event spotting.

Expand Down
Loading

0 comments on commit a6c6006

Please sign in to comment.