Skip to content

Commit

Permalink
Merge branch 'master' into mm/pg-refactor-new
Browse files Browse the repository at this point in the history
  • Loading branch information
maramihali committed Feb 26, 2024
2 parents b80d8f6 + 18c18fe commit 30d92bc
Show file tree
Hide file tree
Showing 159 changed files with 105,718 additions and 1,471 deletions.
129 changes: 118 additions & 11 deletions .circleci/config.yml

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions avm-transpiler/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:bookworm
FROM rust:bullseye

WORKDIR /usr/src
COPY ./avm-transpiler ./avm-transpiler
Expand All @@ -8,6 +8,6 @@ WORKDIR /usr/src/avm-transpiler
RUN apt-get update && apt-get install -y git
RUN ./scripts/bootstrap_native.sh

FROM ubuntu:lunar
FROM ubuntu:focal
COPY --from=0 /usr/src/avm-transpiler/target/release/avm-transpiler /usr/src/avm-transpiler/target/release/avm-transpiler
ENTRYPOINT ["sh", "-c"]
ENTRYPOINT ["sh", "-c"]
3 changes: 3 additions & 0 deletions avm-transpiler/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@ if [ -n "$CMD" ]; then
fi
fi

# Attempt to just pull artefacts from CI and exit on success.
./bootstrap_cache.sh && exit

./scripts/bootstrap_native.sh
4 changes: 4 additions & 0 deletions avm-transpiler/bootstrap_cache.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
#!/usr/bin/env bash
set -eu

[ -z "${NO_CACHE:-}" ] && type docker &> /dev/null && [ -f ~/.aws/credentials ] || exit 1

cd "$(dirname "$0")"
source ../build-system/scripts/setup_env '' '' mainframe_$USER > /dev/null

echo -e "\033[1mRetrieving avm-transpiler from remote cache...\033[0m"
extract_repo avm-transpiler \
/usr/src/avm-transpiler/target/release/avm-transpiler ./target/release/

remove_old_images avm-transpiler
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 = 3eac14010f3f355109e8c85d7dbffdf1bc7a1eca
parent = a2c0caed4c48ce2d37d2370040ea059d80d93bfe
commit = e68cec277e733e01f19b3fa61a307b4b8c49f6fa
parent = 842ba7a720d075632ad2c4b948f874a12cfa3ecd
method = merge
cmdver = 0.4.6
13 changes: 0 additions & 13 deletions barretenberg/bootstrap_cache.sh

This file was deleted.

3 changes: 3 additions & 0 deletions barretenberg/cpp/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ fi
# Download ignition transcripts.
(cd ./srs_db && ./download_ignition.sh 0)

# Attempt to just pull artefacts from CI and exit on success.
./bootstrap_cache.sh && exit

# Pick native toolchain file.
ARCH=$(uname -m)
if [ "$OS" == "macos" ]; then
Expand Down
14 changes: 14 additions & 0 deletions barretenberg/cpp/bootstrap_cache.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash
set -eu

[ -z "${NO_CACHE:-}" ] && type docker &> /dev/null && [ -f ~/.aws/credentials ] || exit 1

cd "$(dirname "$0")"
source ../../build-system/scripts/setup_env '' '' mainframe_$USER > /dev/null

echo -e "\033[1mRetrieving bb.wasm from remote cache...\033[0m"
extract_repo barretenberg-wasm-linux-clang \
/usr/src/barretenberg/cpp/build-wasm/bin ./cpp/build-wasm \
/usr/src/barretenberg/cpp/build-wasm-threads/bin ./cpp/build-wasm-threads

remove_old_images barretenberg-wasm-linux-clang
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,6 @@ BENCHMARK_DEFINE_F(IvcBench, Accumulate)(benchmark::State& state)
BENCHMARK_DEFINE_F(IvcBench, Decide)(benchmark::State& state)
{
ClientIVC ivc;
<<<<<<< HEAD
<<<<<<< HEAD
=======

>>>>>>> master
=======
>>>>>>> 26118e61dc6183b907f5718a24d3dcfb1e036361
// Perform a specified number of iterations of function/kernel accumulation
perform_ivc_accumulation_rounds(state, ivc);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,24 @@ TEST_F(GoblinTranslatorComposerTests, Basic)
using Fr = fr;
using Fq = fq;

// Add an element and scalar the accumulation of which leaves no Point-at-Infinity commitments
const auto x = uint256_t(0xd3c208c16d87cfd3, 0xd97816a916871ca8, 0x9b85045b68181585, 0x30644e72e131a02);
const auto y = uint256_t(0x3ce1cc9c7e645a83, 0x2edac647851e3ac5, 0xd0cbe61fced2bc53, 0x1a76dae6d3272396);
auto padding_element = G1(x, y);
auto padding_scalar = -Fr::one();

auto P1 = G1::random_element();
auto P2 = G1::random_element();
auto z = Fr::random_element();

// Add the same operations to the ECC op queue; the native computation is performed under the hood.
auto op_queue = std::make_shared<bb::ECCOpQueue>();

// Accumulate padding so that we don't produce Point-at-Infinity commitments. Currently our transcript can't handle
// them
op_queue->mul_accumulate(padding_element, padding_scalar);

// Push everything else
for (size_t i = 0; i < 500; i++) {
op_queue->add_accumulate(P1);
op_queue->mul_accumulate(P2, z);
Expand Down
5 changes: 4 additions & 1 deletion barretenberg/ts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@ if [ -n "$CMD" ]; then
fi
fi

# Attempt to just pull artefacts from CI and exit on success.
./bootstrap_cache.sh && exit

yarn install --immutable
echo "Building with command 'yarn $BUILD_CMD'..."
yarn $BUILD_CMD

# Make bin globally available.
npm link
echo "Barretenberg ts build successful"
echo "Barretenberg ts build successful"
14 changes: 14 additions & 0 deletions barretenberg/ts/bootstrap_cache.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash
set -eu

[ -z "${NO_CACHE:-}" ] && type docker &> /dev/null && [ -f ~/.aws/credentials ] || exit 1

cd "$(dirname "$0")"
source ../../build-system/scripts/setup_env '' '' mainframe_$USER > /dev/null

echo -e "\033[1mRetrieving bb.js from remote cache...\033[0m"
extract_repo bb.js /usr/src/barretenberg/ts/dest .
# Annoyingly we still need to install modules, so they can be found as part of module resolution when portalled.
yarn install

remove_old_images bb.js
20 changes: 7 additions & 13 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ if [ -n "$CMD" ]; then
git clean -ffdx

exit 0
elif [ "$CMD" = "full" ]; then
export NO_CACHE=1
else
echo "Unknown command: $CMD"
exit 1
Expand Down Expand Up @@ -61,19 +63,11 @@ PROJECTS=(

# Build projects locally
for P in "${PROJECTS[@]}"; do
if [ -n "${BOOTSTRAP_USE_REMOTE_CACHE:-}" ] && [ -f "$P/bootstrap_cache.sh" ]; then
echo "**************************************"
echo -e "\033[1mBootstrapping $P from remote cache...\033[0m"
echo "**************************************"
echo
$P/bootstrap_cache.sh
else
echo "**************************************"
echo -e "\033[1mBootstrapping $P...\033[0m"
echo "**************************************"
echo
$P/bootstrap.sh
fi
echo "**************************************"
echo -e "\033[1mBootstrapping $P...\033[0m"
echo "**************************************"
echo
(cd $P && ./bootstrap.sh)
echo
echo
done
31 changes: 27 additions & 4 deletions boxes/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# Aztec Starter Kits
# Aztec Boxes

A collection of projects that act as starter kits for Aztec.
These depend on accounts, aztec.js and aztec.nr, and point to the monorepos local development versions.
These projects depend on the sandbox. They're built and tested after the sandbox by docker compose files.
Aztec Boxes are the one-stop-shop for developing on Aztec. They often include a combination of:

- Fully tested contracts
- Frontend boilerplates
- General tests

Boxes include the sandbox installation script and its start command. By choosing the appropriate box, you can get started working on Aztec in a minimal amount of time.

## Getting started

If you have [node](https://nodejs.org/en/download) installed, you can open a terminal in any folder and run:

`npx create-aztec-app`

The script will install the sandbox, run it, and clone the boilerplate you chose. If at any time you encounter problems, refer to the guides at [docs.aztec.network](https://docs.aztec.network) for more information.

## Templates

Currently there are two boxes:

- React - A React boilerplate with a minimal UI.
- Vanilla JS and HTML - Some say if you get something working in vanilla JS and HTML, you can make it work on any framework. If you can't find the box you need, this could be a good starting point.

## Support

Need any support? Reach out on [discord](https://discord.gg/DgWG2DBMyB), [discourse](https://discourse.aztec.network/) or [twitter](https://twitter.com/aztecnetwork).
31 changes: 0 additions & 31 deletions boxes/blank-react/README.md

This file was deleted.

41 changes: 0 additions & 41 deletions boxes/blank-react/src/config.ts

This file was deleted.

67 changes: 0 additions & 67 deletions boxes/blank/README.md

This file was deleted.

1 change: 0 additions & 1 deletion boxes/blank/src/contracts/target/blank-Blank.json

This file was deleted.

2 changes: 1 addition & 1 deletion boxes/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ services:
ETHEREUM_HOST: http://ethereum:8545
CHAIN_ID: 31337
PXE_URL: http://aztec:8080
BOX: ${BOX:-box-blank}
BOX: ${BOX:-box-vanilla}
Loading

0 comments on commit 30d92bc

Please sign in to comment.