Skip to content

Commit

Permalink
Merge branch 'master' into sync-noir
Browse files Browse the repository at this point in the history
* master: (66 commits)
  feat: Get logs by tags (#9353)
  feat: bytes to fields and back (#8590)
  feat: eccvm translator zk sumcheck (#9199)
  chore: bump node types (#9397)
  refactor: quick account manager refactor (#9357)
  chore: quick keystore refactor (#9355)
  chore: implement Fq add (#9354)
  chore: fix and re-enable prover coordination e2e test (#9344)
  feat: introduce default public keys and replace empty public keys (#9277)
  chore: remove unnecessary `is_integral_bit_size` function (#9352)
  feat(nr): serde for signed ints (#9211)
  feat(docs): nits (#8948)
  chore: unstake the bond when the proof lands (#9363)
  chore: print out gas at start and end of each enqueued call (#9377)
  fix: broken constants gen (#9387)
  chore: redo typo PR by pucedoteth (#9385)
  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
  ...
  • Loading branch information
TomAFrench committed Oct 24, 2024
2 parents 2725921 + 719c33e commit 3ef26d3
Show file tree
Hide file tree
Showing 927 changed files with 22,900 additions and 15,296 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 README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Aztec Monorepo

All the packages that make up [Aztec](https://docs.aztec.network).
All the packages that make up [Aztec](https://docs.aztec.network).

- [**`l1-contracts`**](/l1-contracts): Solidity code for the Ethereum contracts that process rollups
- [**`yarn-project`**](/yarn-project): Typescript code for client and backend
Expand All @@ -17,7 +17,7 @@ All the packages that make up [Aztec](https://docs.aztec.network).

## Issues Board

All issues being worked on are tracked on the [Aztec Github Project](https://github.com/orgs/AztecProtocol/projects/22). For a higher-level roadmap, check the [milestones overview](https://docs.aztec.network/aztec/roadmap) section of our docs.
All issues being worked on are tracked on the [Aztec Github Project](https://github.com/orgs/AztecProtocol/projects/22). For a higher-level roadmap, check the [milestones overview](https://aztec.network/roadmap) section of our website.

## Development Setup

Expand Down
10 changes: 1 addition & 9 deletions avm-transpiler/src/opcodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,17 @@ pub enum AvmOpcode {
// External calls
CALL,
STATICCALL,
DELEGATECALL,
RETURN,
REVERT_8,
REVERT_16,
// Misc
DEBUGLOG,
// Gadgets
KECCAK,
POSEIDON2,
SHA256COMPRESSION,
KECCAKF1600,
PEDERSEN, // temp - may be removed, but alot of contracts rely on it
ECADD,
MSM,
PEDERSENCOMMITMENT, // temp
// Conversions
TORADIXLE,
}
Expand Down Expand Up @@ -161,7 +157,6 @@ impl AvmOpcode {
// Control Flow - Contract Calls
AvmOpcode::CALL => "CALL",
AvmOpcode::STATICCALL => "STATICCALL",
AvmOpcode::DELEGATECALL => "DELEGATECALL",
AvmOpcode::RETURN => "RETURN",
AvmOpcode::REVERT_8 => "REVERT_8",
AvmOpcode::REVERT_16 => "REVERT_16",
Expand All @@ -170,14 +165,11 @@ impl AvmOpcode {
AvmOpcode::DEBUGLOG => "DEBUGLOG",

// Gadgets
AvmOpcode::KECCAK => "KECCAK",
AvmOpcode::KECCAKF1600 => "KECCAKF1600",
AvmOpcode::POSEIDON2 => "POSEIDON2",
AvmOpcode::SHA256COMPRESSION => "SHA256COMPRESSION",
AvmOpcode::PEDERSEN => "PEDERSEN",
AvmOpcode::KECCAKF1600 => "KECCAKF1600",
AvmOpcode::ECADD => "ECADD",
AvmOpcode::MSM => "MSM",
AvmOpcode::PEDERSENCOMMITMENT => "PEDERSENCOMMITMENT",
// Conversions
AvmOpcode::TORADIXLE => "TORADIXLE",
}
Expand Down
42 changes: 8 additions & 34 deletions avm-transpiler/src/transpile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,7 @@ pub fn brillig_to_avm(
],
});
}
BrilligOpcode::BinaryIntOp { destination, op, bit_size, lhs, rhs } => {
assert!(
is_integral_bit_size(*bit_size),
"BinaryIntOp bit size should be integral: {:?}",
brillig_instr
);
BrilligOpcode::BinaryIntOp { destination, op, lhs, rhs, .. } => {
let bits_needed =
[*lhs, *rhs, *destination].iter().map(bits_needed_for).max().unwrap();
assert!(
Expand Down Expand Up @@ -189,12 +184,7 @@ pub fn brillig_to_avm(
],
});
}
BrilligOpcode::Not { destination, source, bit_size } => {
assert!(
is_integral_bit_size(*bit_size),
"Not bit size should be integral: {:?}",
brillig_instr
);
BrilligOpcode::Not { destination, source, .. } => {
let bits_needed =
[*source, *destination].iter().map(bits_needed_for).max().unwrap();
assert!(
Expand Down Expand Up @@ -800,7 +790,6 @@ fn handle_getter_instruction(
) {
enum EnvironmentVariable {
ADDRESS,
STORAGEADDRESS,
SENDER,
FUNCTIONSELECTOR,
TRANSACTIONFEE,
Expand All @@ -827,7 +816,6 @@ fn handle_getter_instruction(

let var_idx = match function {
"avmOpcodeAddress" => EnvironmentVariable::ADDRESS,
"avmOpcodeStorageAddress" => EnvironmentVariable::STORAGEADDRESS,
"avmOpcodeSender" => EnvironmentVariable::SENDER,
"avmOpcodeFeePerL2Gas" => EnvironmentVariable::FEEPERL2GAS,
"avmOpcodeFeePerDaGas" => EnvironmentVariable::FEEPERDAGAS,
Expand Down Expand Up @@ -963,7 +951,7 @@ fn generate_mov_instruction(
}
}

/// Black box functions, for the meantime only covers pedersen operations as the blackbox function api suits our current needs.
/// Black box functions
/// (array goes in -> field element comes out)
fn handle_black_box_function(avm_instrs: &mut Vec<AvmInstruction>, operation: &BlackBoxOp) {
match operation {
Expand Down Expand Up @@ -1014,9 +1002,9 @@ fn handle_black_box_function(avm_instrs: &mut Vec<AvmInstruction>, operation: &B
..Default::default()
});
}
BlackBoxOp::Keccakf1600 { message, output } => {
let message_offset = message.pointer.to_usize();
let message_size_offset = message.size.to_usize();
BlackBoxOp::Keccakf1600 { input, output } => {
let input_offset = input.pointer.to_usize();
assert_eq!(input.size, 25, "Keccakf1600 input size must be 25!");
let dest_offset = output.pointer.to_usize();
assert_eq!(output.size, 25, "Keccakf1600 output size must be 25!");

Expand All @@ -1025,14 +1013,12 @@ fn handle_black_box_function(avm_instrs: &mut Vec<AvmInstruction>, operation: &B
indirect: Some(
AddressingModeBuilder::default()
.indirect_operand(&output.pointer)
.indirect_operand(&message.pointer)
.direct_operand(&message.size)
.indirect_operand(&input.pointer)
.build(),
),
operands: vec![
AvmOperand::U16 { value: dest_offset as u16 },
AvmOperand::U16 { value: message_offset as u16 },
AvmOperand::U16 { value: message_size_offset as u16 },
AvmOperand::U16 { value: input_offset as u16 },
],
..Default::default()
});
Expand Down Expand Up @@ -1425,18 +1411,6 @@ pub fn map_brillig_pcs_to_avm_pcs(brillig_bytecode: &[BrilligOpcode<FieldElement
pc_map
}

fn is_integral_bit_size(bit_size: IntegerBitSize) -> bool {
matches!(
bit_size,
IntegerBitSize::U1
| IntegerBitSize::U8
| IntegerBitSize::U16
| IntegerBitSize::U32
| IntegerBitSize::U64
| IntegerBitSize::U128
)
}

fn tag_from_bit_size(bit_size: BitSize) -> AvmTypeTag {
match bit_size {
BitSize::Integer(IntegerBitSize::U1) => AvmTypeTag::UINT1,
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 = 54bcb59eeabbbaaa0e2ddc2b6c7c40502e1145a1
parent = cb58490eed9cc46a7b2039d93645a9456ee9c834
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
14 changes: 5 additions & 9 deletions barretenberg/acir_tests/browser-test-app/src/index.ts

Large diffs are not rendered by default.

33 changes: 10 additions & 23 deletions barretenberg/acir_tests/headless-test/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { chromium, firefox, webkit } from "playwright";
import fs from "fs";
import { Command } from "commander";
import { gunzipSync } from "zlib";
import chalk from "chalk";
import os from "os";

Expand Down Expand Up @@ -37,25 +36,14 @@ function formatAndPrintLog(message: string): void {
console.log(formattedMessage);
}

const readBytecodeFile = (path: string): Uint8Array => {
const extension = path.substring(path.lastIndexOf(".") + 1);

if (extension == "json") {
const encodedCircuit = JSON.parse(fs.readFileSync(path, "utf8"));
const decompressed = gunzipSync(
Uint8Array.from(atob(encodedCircuit.bytecode), (c) => c.charCodeAt(0))
);
return decompressed;
}

const encodedCircuit = fs.readFileSync(path);
const decompressed = gunzipSync(encodedCircuit);
return decompressed;
const readBytecodeFile = (path: string): string => {
const encodedCircuit = JSON.parse(fs.readFileSync(path, "utf8"));
return encodedCircuit.bytecode;
};

const readWitnessFile = (path: string): Uint8Array => {
const buffer = fs.readFileSync(path);
return gunzipSync(buffer);
return buffer;
};

// Set up the command-line interface
Expand All @@ -70,8 +58,8 @@ program
)
.option(
"-b, --bytecode-path <path>",
"Specify the path to the gzip encoded ACIR bytecode",
"./target/acir.gz"
"Specify the path to the ACIR artifact json file",
"./target/acir.json"
)
.option(
"-w, --witness-path <path>",
Expand Down Expand Up @@ -102,19 +90,18 @@ program
await page.goto("http://localhost:8080");

const result: boolean = await page.evaluate(
([acirData, witnessData, threads]) => {
([acir, witnessData, threads]: [string, number[], number]) => {
// Convert the input data to Uint8Arrays within the browser context
const acirUint8Array = new Uint8Array(acirData as number[]);
const witnessUint8Array = new Uint8Array(witnessData as number[]);
const witnessUint8Array = new Uint8Array(witnessData);

// Call the desired function and return the result
return (window as any).runTest(
acirUint8Array,
acir,
witnessUint8Array,
threads
);
},
[Array.from(acir), Array.from(witness), threads]
[acir, Array.from(witness), threads]
);

await browser.close();
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/
1 change: 0 additions & 1 deletion barretenberg/cpp/pil/avm/constants_gen.pil
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ namespace constants(256);
pol MEM_TAG_U128 = 6;
pol SENDER_KERNEL_INPUTS_COL_OFFSET = 0;
pol ADDRESS_KERNEL_INPUTS_COL_OFFSET = 1;
pol STORAGE_ADDRESS_KERNEL_INPUTS_COL_OFFSET = 1;
pol FUNCTION_SELECTOR_KERNEL_INPUTS_COL_OFFSET = 2;
pol IS_STATIC_CALL_KERNEL_INPUTS_COL_OFFSET = 3;
pol CHAIN_ID_KERNEL_INPUTS_COL_OFFSET = 4;
Expand Down
Loading

0 comments on commit 3ef26d3

Please sign in to comment.