Skip to content

Commit

Permalink
Merge branch 'master' into alexg/fix/bad-contracts-deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
alexghr authored Oct 17, 2023
2 parents b886a9d + 06bc4f9 commit 6f12e74
Show file tree
Hide file tree
Showing 25 changed files with 313 additions and 68 deletions.
2 changes: 1 addition & 1 deletion barretenberg/.gitrepo
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
remote = https://github.com/AztecProtocol/barretenberg
branch = master
commit = 9d92a4b81285f38b4195b05cafdd6bc887be23d5
parent = bc4e1fccfbcc9df40168cb6cb8e395bc9a9093de
parent = cd253a8f0742348141e7102d247d786ca1d48d6d
method = merge
cmdver = 0.4.6
4 changes: 2 additions & 2 deletions build-system/.gitrepo
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[subrepo]
remote = https://github.com/AztecProtocol/build-system
branch = master
commit = 9591cdeab903d13430e91dfd0c069c8722ec1b20
parent = 3e5c4b195fa61a72e1eb6dce068120c98b17fb62
commit = 9654fc770fc04d3b9b2500af9320a64bcd06b8a2
parent = cb18f455d02b00b30da20c6afbeb806921b3a1cf
method = merge
cmdver = 0.4.6
2 changes: 1 addition & 1 deletion circuits/cpp/src/aztec3/circuits/kernel/private/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ void common_contract_logic(DummyBuilder& builder,

// compute contract address nullifier
auto const blake_input = new_contract_address.to_field().to_buffer();
auto const new_contract_address_nullifier = NT::fr::serialize_from_buffer(NT::blake3s(blake_input).data());
auto const new_contract_address_nullifier = NT::fr::serialize_from_buffer(NT::blake2s(blake_input).data());

// push the contract address nullifier to nullifier vector
array_push(builder,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ void update_end_values(PrivateKernelInputsInner<CT> const& private_inputs, Kerne

// compute contract address nullifier
auto blake_input = CT::byte_array(contract_address.to_field());
auto contract_address_nullifier = CT::fr(CT::blake3s(blake_input));
auto contract_address_nullifier = CT::fr(CT::blake2s(blake_input));

// push the contract address nullifier to nullifier vector
CT::fr const conditional_contract_address_nullifier =
Expand Down
2 changes: 0 additions & 2 deletions circuits/cpp/src/aztec3/utils/types/circuit_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ template <typename Builder> struct CircuitTypes {
};

static byte_array blake2s(const byte_array& input) { return plonk::stdlib::blake2s(input); }

static byte_array blake3s(const byte_array& input) { return plonk::stdlib::blake3s(input); }
};

} // namespace aztec3::utils::types
2 changes: 0 additions & 2 deletions circuits/cpp/src/aztec3/utils/types/native_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,6 @@ struct NativeTypes {
auto res = blake2::blake2s(input);
return byte_array(res.begin(), res.end());
}

static byte_array blake3s(const byte_array& input) { return blake3::blake3s(input); }
};

} // namespace aztec3::utils::types
3 changes: 2 additions & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -173,5 +173,6 @@
"git-subrepo/",
"*.snap",
"package.json"
]
],
"flagWords": ["anonymous"]
}
4 changes: 2 additions & 2 deletions docs/.gitrepo
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[subrepo]
remote = https://github.com/AztecProtocol/docs
branch = main
commit = 4a7532550e5976b2fb092d1f91cf9b4ec2763ae9
parent = 3e5c4b195fa61a72e1eb6dce068120c98b17fb62
commit = 1a5ee6c4bf28f14a603c3141535549233a7d4b1a
parent = cb18f455d02b00b30da20c6afbeb806921b3a1cf
method = merge
cmdver = 0.4.6
16 changes: 14 additions & 2 deletions yarn-project/aztec-node/src/aztec-node/db.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { LevelDown, default as leveldown } from 'leveldown';
import { LevelUp, default as levelup } from 'levelup';
import { MemDown, default as memdown } from 'memdown';
import { mkdir } from 'node:fs/promises';
import { join } from 'node:path';

import { AztecNodeConfig } from './config.js';
Expand All @@ -22,16 +23,27 @@ type NodeMetadata = {
};

/**
* Opens the database for the aztec node.
* Opens the database for the aztec node. If a data directory is specified, then this attempts to create it.
* @param config - The configuration to be used by the aztec node.
* @throws If `config.dataDirectory` is set and the directory cannot be created.
* @returns The database for the aztec node.
*/
export async function openDb(config: AztecNodeConfig): Promise<LevelUp> {
const nodeMetadata: NodeMetadata = {
rollupContractAddress: config.l1Contracts.rollupAddress.toString(),
};

const db = levelup(config.dataDirectory ? createLevelDown(join(config.dataDirectory, DB_SUBDIR)) : createMemDown());
let db: LevelUp;

if (config.dataDirectory) {
const dbDir = join(config.dataDirectory, DB_SUBDIR);
// this throws if we don't have permissions to create the directory
await mkdir(dbDir, { recursive: true });
db = levelup(createLevelDown(dbDir));
} else {
db = levelup(createMemDown());
}

const prevNodeMetadata = await getNodeMetadata(db);

// if the rollup addresses are different, wipe the local database and start over
Expand Down
4 changes: 2 additions & 2 deletions yarn-project/aztec-nr/.gitrepo
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[subrepo]
remote = https://github.com/AztecProtocol/aztec-nr
branch = master
commit = 749abe8672d0fec28d597e086d5bae3c81464ecd
commit = 2918e68f8aeffe43cf3f286a233d4394cba72d8b
method = merge
cmdver = 0.4.6
parent = 3e5c4b195fa61a72e1eb6dce068120c98b17fb62
parent = cb18f455d02b00b30da20c6afbeb806921b3a1cf
16 changes: 7 additions & 9 deletions yarn-project/aztec-sandbox/src/sandbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,13 @@ async function deployContractsToL1(aztecNodeConfig: AztecNodeConfig, hdAccount:
},
};

const l1Contracts = await waitThenDeploy(aztecNodeConfig, () =>
deployL1Contracts(aztecNodeConfig.rpcUrl, hdAccount, localAnvil, logger, l1Artifacts),
);
aztecNodeConfig.l1Contracts.rollupAddress = l1Contracts.l1ContractAddresses.rollupAddress;
aztecNodeConfig.l1Contracts.contractDeploymentEmitterAddress =
l1Contracts.l1ContractAddresses.contractDeploymentEmitterAddress;
aztecNodeConfig.l1Contracts.inboxAddress = l1Contracts.l1ContractAddresses.inboxAddress;
aztecNodeConfig.l1Contracts.registryAddress = l1Contracts.l1ContractAddresses.registryAddress;
return l1Contracts;
aztecNodeConfig.l1Contracts = (
await waitThenDeploy(aztecNodeConfig, () =>
deployL1Contracts(aztecNodeConfig.rpcUrl, hdAccount, localAnvil, logger, l1Artifacts),
)
).l1ContractAddresses;

return aztecNodeConfig.l1Contracts;
}

/** Sandbox settings. */
Expand Down
47 changes: 47 additions & 0 deletions yellow-paper/docs-tutorial-reference/intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
sidebar_position: 1
---

# Tutorial Intro

Let's discover **Docusaurus in less than 5 minutes**.

## Getting Started

Get started by **creating a new site**.

Or **try Docusaurus immediately** with **[docusaurus.new](https://docusaurus.new)**.

### What you'll need

- [Node.js](https://nodejs.org/en/download/) version 16.14 or above:
- When installing Node.js, you are recommended to check all checkboxes related to dependencies.

## Generate a new site

Generate a new Docusaurus site using the **classic template**.

The classic template will automatically be added to your project after you run the command:

```bash
npm init docusaurus@latest my-website classic
```

You can type this command into Command Prompt, Powershell, Terminal, or any other integrated terminal of your code editor.

The command also installs all necessary dependencies you need to run Docusaurus.

## Start your site

Run the development server:

```bash
cd my-website
npm run start
```

The `cd` command changes the directory you're working with. In order to work with your newly created Docusaurus site, you'll need to navigate the terminal there.

The `npm run start` command builds your website locally and serves it through a development server, ready for you to view at http://localhost:3000/.

Open `docs/intro.md` (this page) and edit some lines: the site **reloads automatically** and displays your changes.
Loading

0 comments on commit 6f12e74

Please sign in to comment.