Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into lw/storage
Browse files Browse the repository at this point in the history
  • Loading branch information
LeilaWang committed Sep 6, 2023
2 parents bb12467 + 28a877b commit 9ab16a1
Show file tree
Hide file tree
Showing 40 changed files with 928 additions and 247 deletions.
13 changes: 13 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -970,6 +970,17 @@ jobs:
command: ./scripts/cond_run_script end-to-end $JOB_NAME ./scripts/run_tests_local guides/writing_an_account_contract.test.ts
working_directory: yarn-project/end-to-end

guides-dapp-testing:
docker:
- image: aztecprotocol/alpine-build-image
resource_class: small
steps:
- *checkout
- *setup_env
- run:
name: "Test"
command: cond_spot_run_tests end-to-end guides/dapp_testing.test.ts docker-compose-e2e-sandbox.yml

e2e-canary-test:
docker:
- image: aztecprotocol/alpine-build-image
Expand Down Expand Up @@ -1407,6 +1418,7 @@ workflows:
- e2e-browser-sandbox: *e2e_test
- aztec-rpc-sandbox: *e2e_test
- guides-writing-an-account-contract: *e2e_test
- guides-dapp-testing: *e2e_test

- e2e-end:
requires:
Expand Down Expand Up @@ -1437,6 +1449,7 @@ workflows:
- e2e-canary-test
- aztec-rpc-sandbox
- guides-writing-an-account-contract
- guides-dapp-testing
<<: *defaults

- deploy-dockerhub:
Expand Down
47 changes: 47 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,52 @@
# Changelog

## [0.1.0-alpha62](https://github.com/AztecProtocol/aztec-packages/compare/v0.1.0-alpha61...v0.1.0-alpha62) (2023-09-06)


### Features

* **circuits:** hints nullifier transient commitments ([#2056](https://github.com/AztecProtocol/aztec-packages/issues/2056)) ([725b550](https://github.com/AztecProtocol/aztec-packages/commit/725b550a368494abd15a38e95b15b1379bc926bc))
* **docs:** Testing guide and getPrivateStorage method ([#1992](https://github.com/AztecProtocol/aztec-packages/issues/1992)) ([5a8c571](https://github.com/AztecProtocol/aztec-packages/commit/5a8c5719753549f71ceeec9114d69b8d1d640376))


### Bug Fixes

* **build:** Use semver version in docker version tag ([#2065](https://github.com/AztecProtocol/aztec-packages/issues/2065)) ([b3db0d0](https://github.com/AztecProtocol/aztec-packages/commit/b3db0d0ae6d6b7d8a6d7338a556e2b9507e2631a))


### Documentation

* Link to local ethereum nodes in testing guide ([#2061](https://github.com/AztecProtocol/aztec-packages/issues/2061)) ([e29148b](https://github.com/AztecProtocol/aztec-packages/commit/e29148b379a435a9fefd846cc5fe78af6be7021d))

## [0.1.0-alpha61](https://github.com/AztecProtocol/aztec-packages/compare/v0.1.0-alpha60...v0.1.0-alpha61) (2023-09-06)


### Bug Fixes

* **sandbox:** build script for tagged commits ([#2057](https://github.com/AztecProtocol/aztec-packages/issues/2057)) ([c9d9722](https://github.com/AztecProtocol/aztec-packages/commit/c9d9722151de1e6f9a49a4cc6310e5646593ec01))

## [0.1.0-alpha60](https://github.com/AztecProtocol/aztec-packages/compare/v0.1.0-alpha59...v0.1.0-alpha60) (2023-09-06)


### Features

* Goblin recursive verifier ([#1822](https://github.com/AztecProtocol/aztec-packages/issues/1822)) ([f962cb6](https://github.com/AztecProtocol/aztec-packages/commit/f962cb68f46d25047bf67a1ad2e7407a176ffc53))
* initial `is_valid` eip1271 style wallet + minimal test changes ([#1935](https://github.com/AztecProtocol/aztec-packages/issues/1935)) ([f264c54](https://github.com/AztecProtocol/aztec-packages/commit/f264c5421424bf58d983fe104aaf7c7126259e01))


### Bug Fixes

* benchmark git repo ([#2041](https://github.com/AztecProtocol/aztec-packages/issues/2041)) ([3c696bb](https://github.com/AztecProtocol/aztec-packages/commit/3c696bba1ca4bd69c8e3f5bc004d1a07adb23cf1))
* cli canary & deployment ([#2053](https://github.com/AztecProtocol/aztec-packages/issues/2053)) ([1ddd24a](https://github.com/AztecProtocol/aztec-packages/commit/1ddd24ad2f8702fd3d3c48ed015a652b3326bfd9))
* **rpc:** Fixes getNodeInfo serialisation ([#1991](https://github.com/AztecProtocol/aztec-packages/issues/1991)) ([0a29fa8](https://github.com/AztecProtocol/aztec-packages/commit/0a29fa8dd95b37e490c18df2db90a7324ebe762c))


### Miscellaneous

* **circuits:** - use msgpack for cbind routines of native private kernel circuits ([#1938](https://github.com/AztecProtocol/aztec-packages/issues/1938)) ([3dc5c07](https://github.com/AztecProtocol/aztec-packages/commit/3dc5c07358d99786df8809f46638fdb04b33a6c2))
* **docs:** API docs stucture ([#2014](https://github.com/AztecProtocol/aztec-packages/issues/2014)) ([9aab9dd](https://github.com/AztecProtocol/aztec-packages/commit/9aab9ddefac63d35ebc356afed573af268896b35))
* Update function selector computation ([#2001](https://github.com/AztecProtocol/aztec-packages/issues/2001)) ([e07ea1a](https://github.com/AztecProtocol/aztec-packages/commit/e07ea1a887484f3a1a2ba8b5328af5abf6ccc6a2))

## [0.1.0-alpha59](https://github.com/AztecProtocol/aztec-packages/compare/v0.1.0-alpha58...v0.1.0-alpha59) (2023-09-05)


Expand Down
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 = f469760d03323731c3d2bc3b0cce71aa48fba939
parent = 3c696bba1ca4bd69c8e3f5bc004d1a07adb23cf1
commit = ae59957de8ba622d2d5327dba89607a2d16a4f87
parent = b3db0d0ae6d6b7d8a6d7338a556e2b9507e2631a
method = merge
cmdver = 0.4.6
77 changes: 39 additions & 38 deletions build-system/scripts/build
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,39 @@ for PARENT in $PARENTS; do
docker tag $PARENT_IMAGE_URI $ECR_DEPLOY_URL/$PARENT
done


# Extract version from commit tag
# Check if there is a commit tag
if [[ -n "$COMMIT_TAG" ]]; then

# Check if it's a repo-specific tag
if [[ "$COMMIT_TAG" == *"/"* ]]; then
REPO_NAME="${COMMIT_TAG%%/*}"
COMMIT_TAG_VERSION="${COMMIT_TAG#*/}"
echo "Tag was made for: $REPO_NAME"
echo "Version: $COMMIT_TAG_VERSION"

# Check if REPO_NAME is equal to REPOSITORY
if [ "$REPO_NAME" != "$REPOSITORY" ]; then
echo "REPO_NAME ($REPO_NAME) does not match REPOSITORY ($REPOSITORY). Ignoring..."
COMMIT_TAG_VERSION=""
fi
else
COMMIT_TAG_VERSION=$COMMIT_TAG
fi

# We are building a tagged commit. Check it's a valid semver.
VERSION=$(npx semver $COMMIT_TAG_VERSION)
if [ -z "$VERSION" ]; then
COMMIT_TAG_VERSION=""
else
COMMIT_TAG_VERSION=$VERSION
fi
else
COMMIT_TAG_VERSION=""
fi


# Pull, build and push each named stage to cache.
STAGE_CACHE_FROM=""
CACHE_FROM=""
Expand All @@ -115,48 +148,16 @@ for STAGE in $STAGES; do
STAGE_CACHE_FROM="--cache-from $STAGE_IMAGE_LAST_URI"
fi
fi

echo "Building stage: $STAGE"
STAGE_IMAGE_COMMIT_URI=$ECR_URL/$REPOSITORY:cache-$CONTENT_HASH-$STAGE
# Build our dockerfile, add timing information

# Check if there is a commit tag
if [[ -n "${COMMIT_TAG:-}" ]]; then

# Check if it's a repo-specific tag
if [[ "$COMMIT_TAG" == *"/"* ]]; then
REPO_NAME="${COMMIT_TAG%%/*}"
COMMIT_TAG_VERSION="${COMMIT_TAG#*/}"
echo "Tag was made for: $REPO_NAME"
echo "Version: $COMMIT_TAG_VERSION"

# Check if REPO_NAME is equal to REPOSITORY
if [ "$REPO_NAME" != "$REPOSITORY" ]; then
echo "REPO_NAME ($REPO_NAME) does not match REPOSITORY ($REPOSITORY). Ignoring..."
COMMIT_TAG_VERSION=""
fi
else
COMMIT_TAG_VERSION=$COMMIT_TAG
fi

# We are building a tagged commit. Check it's a valid semver.
VERSION=$(npx semver $COMMIT_TAG_VERSION)
if [ -z "$VERSION" ]; then
COMMIT_TAG_VERSION=""
fi

# Pass commit tag as build argument if it exists
docker build --target $STAGE $STAGE_CACHE_FROM -t $STAGE_IMAGE_COMMIT_URI -f $DOCKERFILE --build-arg ARG_CONTENT_HASH=$CONTENT_HASH --build-arg DOCKER_TAG=${COMMIT_TAG_VERSION#v} . \
| while read line ; do echo "$(date "+%H:%M:%S")| $line"; done
else
docker build --target $STAGE $STAGE_CACHE_FROM -t $STAGE_IMAGE_COMMIT_URI -f $DOCKERFILE --build-arg ARG_CONTENT_HASH=$CONTENT_HASH . \
| while read line ; do echo "$(date "+%H:%M:%S")| $line"; done

fi

docker build --target $STAGE $STAGE_CACHE_FROM -t $STAGE_IMAGE_COMMIT_URI -f $DOCKERFILE --build-arg COMMIT_TAG=$COMMIT_TAG_VERSION --build-arg ARG_CONTENT_HASH=$CONTENT_HASH . \
| while read line ; do echo "$(date "+%H:%M:%S")| $line"; done

# We don't want to have redo this stages work when building the final image. Use it as a layer cache.
CACHE_FROM="--cache-from $STAGE_IMAGE_COMMIT_URI $CACHE_FROM"

echo "Pushing stage: $STAGE"
docker push $STAGE_IMAGE_COMMIT_URI > /dev/null 2>&1
echo
Expand All @@ -175,7 +176,7 @@ fi
IMAGE_COMMIT_URI=$ECR_URL/$REPOSITORY:cache-$CONTENT_HASH
echo "Building image: $IMAGE_COMMIT_URI"
# Build our dockerfile, add timing information
docker build -t $IMAGE_COMMIT_URI -f $DOCKERFILE $CACHE_FROM --build-arg COMMIT_TAG=$COMMIT_TAG --build-arg ARG_CONTENT_HASH=$CONTENT_HASH . \
docker build -t $IMAGE_COMMIT_URI -f $DOCKERFILE $CACHE_FROM --build-arg COMMIT_TAG=$COMMIT_TAG_VERSION --build-arg ARG_CONTENT_HASH=$CONTENT_HASH . \
| while read line ; do echo "$(date "+%H:%M:%S")| $line"; done
echo "Pushing image: $IMAGE_COMMIT_URI"
docker push $IMAGE_COMMIT_URI > /dev/null 2>&1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -874,8 +874,8 @@ template <typename FF> class UltraCircuitBuilder_ : public CircuitBuilderBase<ar

size_t total = count + romcount + ramcount + rangecount + num_ecc_op_gates;
std::cout << "gates = " << total << " (arith " << count << ", rom " << romcount << ", ram " << ramcount
<< ", range " << rangecount << ", non native field gates " << nnfcount << ", goblin ecc op gates " << num_ecc_op_gates
<< "), pubinp = " << this->public_inputs.size() << std::endl;
<< ", range " << rangecount << ", non native field gates " << nnfcount << ", goblin ecc op gates "
<< num_ecc_op_gates << "), pubinp = " << this->public_inputs.size() << std::endl;
}
// /**
// * @brief Get the final number of gates in a circuit, which consists of the sum of:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ template <typename Curve> class stdlib_biggroup_goblin : public testing::Test {
/**
* @brief Test goblin-style batch mul
* @details Check that 1) Goblin-style batch mul returns correct value, and 2) resulting circuit is correct
*
*
*/
static void test_goblin_style_batch_mul()
{
const bool goblin_flag = true; // used to indicate goblin-style in batch_mul
const size_t num_points = 5;
Builder builder;

std::vector<affine_element> points;
std::vector<fr> scalars;
for (size_t i = 0; i < num_points; ++i) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,11 @@ std::array<typename Flavor::GroupElement, 2> UltraRecursiveVerifier_<Flavor, gob

std::optional sumcheck_output = sumcheck.verify(relation_parameters, transcript);

info("Sumcheck: num gates = ", builder->get_num_gates() - prev_num_gates, ", (total = ", builder->get_num_gates(), ")");
info("Sumcheck: num gates = ",
builder->get_num_gates() - prev_num_gates,
", (total = ",
builder->get_num_gates(),
")");
prev_num_gates = builder->get_num_gates();

// If Sumcheck does not return an output, sumcheck verification has failed
Expand All @@ -124,7 +128,11 @@ std::array<typename Flavor::GroupElement, 2> UltraRecursiveVerifier_<Flavor, gob
++evaluation_idx;
}

info("Batched eval: num gates = ", builder->get_num_gates() - prev_num_gates, ", (total = ", builder->get_num_gates(), ")");
info("Batched eval: num gates = ",
builder->get_num_gates() - prev_num_gates,
", (total = ",
builder->get_num_gates(),
")");
prev_num_gates = builder->get_num_gates();

// Compute batched commitments needed for input to Gemini.
Expand All @@ -150,13 +158,21 @@ std::array<typename Flavor::GroupElement, 2> UltraRecursiveVerifier_<Flavor, gob
auto batched_commitment_unshifted =
GroupElement::template batch_mul<goblin_flag>(commitments.get_unshifted(), scalars_unshifted);

info("Batch mul (unshifted): num gates = ", builder->get_num_gates() - prev_num_gates, ", (total = ", builder->get_num_gates(), ")");
info("Batch mul (unshifted): num gates = ",
builder->get_num_gates() - prev_num_gates,
", (total = ",
builder->get_num_gates(),
")");
prev_num_gates = builder->get_num_gates();

auto batched_commitment_to_be_shifted =
GroupElement::template batch_mul<goblin_flag>(commitments.get_to_be_shifted(), scalars_to_be_shifted);

info("Batch mul (to-be-shited): num gates = ", builder->get_num_gates() - prev_num_gates, ", (total = ", builder->get_num_gates(), ")");
info("Batch mul (to-be-shited): num gates = ",
builder->get_num_gates() - prev_num_gates,
", (total = ",
builder->get_num_gates(),
")");
prev_num_gates = builder->get_num_gates();

// Produce a Gemini claim consisting of:
Expand All @@ -168,13 +184,21 @@ std::array<typename Flavor::GroupElement, 2> UltraRecursiveVerifier_<Flavor, gob
batched_commitment_to_be_shifted,
transcript);

info("Gemini: num gates = ", builder->get_num_gates() - prev_num_gates, ", (total = ", builder->get_num_gates(), ")");
info("Gemini: num gates = ",
builder->get_num_gates() - prev_num_gates,
", (total = ",
builder->get_num_gates(),
")");
prev_num_gates = builder->get_num_gates();

// Produce a Shplonk claim: commitment [Q] - [Q_z], evaluation zero (at random challenge z)
auto shplonk_claim = Shplonk::reduce_verification(pcs_verification_key, gemini_claim, transcript);

info("Shplonk: num gates = ", builder->get_num_gates() - prev_num_gates, ", (total = ", builder->get_num_gates(), ")");
info("Shplonk: num gates = ",
builder->get_num_gates() - prev_num_gates,
", (total = ",
builder->get_num_gates(),
")");
prev_num_gates = builder->get_num_gates();

// Constuct the inputs to the final KZG pairing check
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "private_call_data.hpp"
#include "../previous_kernel_data.hpp"

#include "aztec3/constants.hpp"
#include "aztec3/utils/types/circuit_types.hpp"
#include "aztec3/utils/types/native_types.hpp"

Expand All @@ -20,10 +21,11 @@ template <typename NCT> struct PrivateKernelInputsOrdering {

PreviousKernelData<NCT> previous_kernel{};

std::array<fr, MAX_READ_REQUESTS_PER_TX> hint_to_commitments{};
std::array<fr, MAX_READ_REQUESTS_PER_TX> read_commitment_hints{};
std::array<fr, MAX_NEW_NULLIFIERS_PER_TX> nullifier_commitment_hints{};

// For serialization, update with new fields
MSGPACK_FIELDS(previous_kernel, hint_to_commitments);
MSGPACK_FIELDS(previous_kernel, read_commitment_hints, nullifier_commitment_hints);
boolean operator==(PrivateKernelInputsOrdering<NCT> const& other) const
{
return msgpack_derived_equals<boolean>(*this, other);
Expand All @@ -36,7 +38,8 @@ template <typename NCT> struct PrivateKernelInputsOrdering {

PrivateKernelInputsOrdering<CircuitTypes<Builder>> private_inputs = {
previous_kernel.to_circuit_type(builder),
hint_to_commitments.to_circuit_type(builder),
read_commitment_hints.to_circuit_type(builder),
nullifier_commitment_hints.to_circuit_type(builder),
};

return private_inputs;
Expand Down
Loading

0 comments on commit 9ab16a1

Please sign in to comment.