Skip to content

Commit

Permalink
chore: remove stubbed docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Maddiaa0 committed Jan 29, 2024
1 parent 02de79f commit 31d47b2
Show file tree
Hide file tree
Showing 757 changed files with 22,844 additions and 9,941 deletions.
33 changes: 23 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ jobs:
name: Test
command: cond_spot_run_container yarn-project 64 test | add_timestamps

aztec-sandbox:
aztec-package:
machine:
image: ubuntu-2204:2023.07.2
resource_class: large
Expand All @@ -420,7 +420,7 @@ jobs:
- *setup_env
- run:
name: "Build and test"
command: build aztec-sandbox
command: build aztec

cli:
machine:
Expand Down Expand Up @@ -521,6 +521,17 @@ jobs:
name: "Test"
command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=e2e_2_pxes.test.ts

e2e-note-getter:
docker:
- image: aztecprotocol/alpine-build-image
resource_class: small
steps:
- *checkout
- *setup_env
- run:
name: "Test"
command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=e2e_note_getter.test.ts

e2e-multiple-accounts-1-enc-key:
docker:
- image: aztecprotocol/alpine-build-image
Expand Down Expand Up @@ -982,7 +993,7 @@ jobs:
command: |
should_release || exit 0
deploy_dockerhub noir
deploy_dockerhub aztec-sandbox
deploy_dockerhub aztec
deploy_dockerhub cli
deploy_dockerhub aztec-faucet
deploy_dockerhub mainnet-fork
Expand Down Expand Up @@ -1034,7 +1045,7 @@ jobs:
# Export variables for Terraform.
export TF_VAR_BOOTNODE_1_PRIVATE_KEY=$BOOTNODE_1_PRIVATE_KEY
export TF_VAR_BOOTNODE_2_PRIVATE_KEY=$BOOTNODE_2_PRIVATE_KEY
deploy_terraform_services yarn-project/p2p-bootstrap aztec-sandbox
deploy_terraform_services yarn-project/p2p-bootstrap aztec
- run:
name: "Deploy Aztec Nodes to AWS"
command: |
Expand All @@ -1048,16 +1059,16 @@ jobs:
# Check if l1-contracts have changed
if [ "$CONTRACTS_DEPLOYED" -eq 1 ]; then
echo "Contracts have changed, taint nodes to force redeploy.."
deploy_terraform_services yarn-project/aztec-node aztec-sandbox aztec-node "aws_ecs_task_definition.aztec-node[0],aws_ecs_task_definition.aztec-node[1]"
deploy_terraform_services yarn-project/aztec-node aztec aztec-node "aws_ecs_task_definition.aztec-node[0],aws_ecs_task_definition.aztec-node[1]"
else
deploy_terraform_services yarn-project/aztec-node aztec-sandbox
deploy_terraform_services yarn-project/aztec-node aztec
fi
- run:
name: "Deploy Aztec Faucet to AWS"
command: |
should_deploy 0 || exit 0
export TF_VAR_FAUCET_PRIVATE_KEY=$FAUCET_PRIVATE_KEY
deploy_terraform_services yarn-project/aztec-faucet aztec-sandbox
deploy_terraform_services yarn-project/aztec-faucet aztec
# Repeatable config for defining the workflow below.
defaults: &defaults
Expand Down Expand Up @@ -1191,14 +1202,14 @@ workflows:
- build-docs: *defaults_yarn_project

# Artifacts
- aztec-sandbox: *defaults_yarn_project_prod
- aztec-package: *defaults_yarn_project_prod
- cli: *defaults_yarn_project_prod
- aztec-faucet: *defaults_yarn_project_prod

# Boxes.
- boxes:
requires:
- aztec-sandbox
- aztec-package
<<: *defaults
- boxes-blank:
requires:
Expand All @@ -1217,10 +1228,11 @@ workflows:
- e2e-join:
requires:
- end-to-end
- aztec-sandbox
- aztec-package
- cli
<<: *defaults
- e2e-2-pxes: *e2e_test
- e2e-note-getter: *e2e_test
- e2e-deploy-contract: *e2e_test
- e2e-lending-contract: *e2e_test
- e2e-token-contract: *e2e_test
Expand Down Expand Up @@ -1260,6 +1272,7 @@ workflows:
requires:
- mainnet-fork
- e2e-2-pxes
- e2e-note-getter
- e2e-deploy-contract
- e2e-lending-contract
- e2e-token-contract
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ All the packages that make up [Aztec](https://docs.aztec.network).
## Popular packages

- [Aztec.nr](./yarn-project/aztec-nr/): A [Noir](https://noir-lang.org) framework for smart contracts on Aztec.
- [Aztec Sandbox](./yarn-project/aztec-sandbox/): A package for setting up a local dev net, including a local Ethereum network, deployed rollup contracts and Aztec execution environment.
- [Aztec](./yarn-project/aztec/): A package for starting up local dev net modules, including a local 'sandbox' devnet, an Ethereum network, deployed rollup contracts and Aztec execution environment.
- [Aztec.js](./yarn-project/aztec.js/): A tool for interacting with the Aztec network. It communicates via the [Private Execution Environment (PXE)](./yarn-project/pxe/).
- [Example contracts](./yarn-project/noir-contracts/): Example contracts for the Aztec network, written in Noir.
- [End to end tests](./yarn-project/end-to-end/): Integration tests written in Typescript--a good reference for how to use the packages for specific tasks.
Expand Down
19 changes: 18 additions & 1 deletion aztec-up/bin/aztec
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
#!/usr/bin/env bash
set -euo pipefail

$(dirname $0)/.aztec-run aztecprotocol/aztec-sandbox $@
# Call cli image if used with `aztec cli ...args`
if [ -n "${1-}" ] && [ "$1" != "--help" ]; then
if [ "$1" == "cli" ]; then
shift
$(dirname $0)/.aztec-run aztecprotocol/cli "$@"
elif [ "$1" == "sandbox" ]; then
$(dirname $0)/aztec-sandbox
else
$(dirname $0)/.aztec-run aztecprotocol/aztec "$@"
fi
else
# TODO - display help message
echo
echo "Using 'aztec' CLI:"
echo " aztec start <args> - Start aztec infrastructure components. See 'aztec start --help' for detailed command info."
echo " aztec sandbox - Run a local sandbox network (same as aztec-sandbox)."
echo " aztec cli <args> - Run the aztec client CLI. See 'aztec cli --help' for detailed command info."
fi
3 changes: 2 additions & 1 deletion aztec-up/bin/aztec-cli
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ set -euo pipefail

export ENV_VARS_TO_INJECT="PXE_URL PRIVATE_KEY DEBUG"
export PXE_URL=${PXE_URL:-"http://host.docker.internal:8080"}
export ETHEREUM_HOST=${ETHEREUM_HOST:-"http://host.docker.internal:8545"}

$(dirname $0)/.aztec-run aztecprotocol/cli $@
$(dirname $0)/.aztec-run aztecprotocol/cli $@
6 changes: 3 additions & 3 deletions aztec-up/bin/aztec-install
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function title() {
echo -e "${r}"
fi
echo -e "This will install the following scripts and update your PATH if necessary:"
echo -e " ${bold}${g}aztec${r} - launches various infrastructure subsystems (sequencer, prover, pxe, etc)."
echo -e " ${bold}${g}aztec${r} - launches various infrastructure subsystems (node, sequencer, prover, pxe, etc)."
echo -e " ${bold}${g}aztec-cli${r} - a command line tool for interfacing and experimenting with infrastructure."
echo -e " ${bold}${g}aztec-nargo${r} - aztec's build of nargo, the noir compiler toolchain."
echo -e " ${bold}${g}aztec-sandbox${r} - a wrapper around docker-compose that launches services needed for sandbox testing."
Expand Down Expand Up @@ -106,12 +106,12 @@ export DOCKER_CLI_HINTS=false

if [ -z "${SKIP_PULL:-}" ]; then
info "Pulling aztec version $VERSION..."
pull_container aztec-sandbox
pull_container aztec
pull_container cli
pull_container noir
fi

# Download the Docker Compose file. Used by aztec-sandbox.
# Download the Docker Compose file. Used by aztec.
curl -fsSL http://$INSTALL_HOST/docker-compose.yml -o $AZTEC_PATH/docker-compose.yml

function install_bin {
Expand Down
6 changes: 2 additions & 4 deletions aztec-up/bin/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ services:
ANVIL_PORT: ${ANVIL_PORT:-8545}

aztec:
image: "aztecprotocol/aztec-sandbox"
image: "aztecprotocol/aztec"
ports:
- "${AZTEC_NODE_PORT:-8079}:${AZTEC_NODE_PORT:-8079}"
- "${PXE_PORT:-8080}:${PXE_PORT:-8080}"
environment:
DEBUG: # Loaded from the user shell if explicitly set
Expand All @@ -32,7 +31,6 @@ services:
WS_BLOCK_CHECK_INTERVAL_MS: 50
PXE_BLOCK_POLLING_INTERVAL_MS: 50
ARCHIVER_VIEM_POLLING_INTERVAL_MS: 500
AZTEC_NODE_PORT: ${AZTEC_NODE_PORT:-8079}
PXE_PORT: ${PXE_PORT:-8080}
volumes:
- ./log:/usr/src/yarn-project/aztec-sandbox/log:rw
- ./log:/usr/src/yarn-project/aztec/log:rw
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 = 9e88d98006deb4981c980bbbf9f0ddb568e476ed
parent = a56e418b0fe90b77b7a9fd6bcb0e40cd15260fd6
commit = 74d4bbd1c283af2f2c3b034c002fea3740c32705
parent = 9e6250aacbe2d47aa71dee9fa5e43c66eec73e75
method = merge
cmdver = 0.4.6
2 changes: 2 additions & 0 deletions barretenberg/cpp/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ CMakeUserPresets.json
acir_tests
# we may download go in scripts/collect_heap_information.sh
go*.tar.gz
barretenberg_modules.dot
barretenberg_modules.png
24 changes: 24 additions & 0 deletions barretenberg/cpp/scripts/barretenberg_module_digraph.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash
set -eu

TMP=tmp.dot
RESULT_DOT=barretenberg_modules.dot
RESULT_PNG=barretenberg_modules.png

# initialize a directed graph for graphviz
echo digraph BarretenbergModules { > $TMP
# populate the directed graph
for file in $(find ./src/barretenberg/ -iname CMakeLists.txt); do
opening_chars=$(head -c 19 "$file")
if [ "$opening_chars" == barretenberg_module ]; then
awk -f ./scripts/barretenberg_module_digraph_edges.awk $file >> $TMP
fi
done
echo } >> $TMP

# apply transitive reduction to remove dependcies that are implied by other dependencies
cat $TMP | tred > $RESULT_DOT
rm $TMP

# produce a PNG of the graph
dot -Tpng $RESULT_DOT -o $RESULT_PNG
35 changes: 35 additions & 0 deletions barretenberg/cpp/scripts/barretenberg_module_digraph_edges.awk
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Function to extract words between parentheses
function extract_edges(line) {
match(line, /\(.*\)/); # Find the portion within parentheses
line = substr(line, RSTART + 1, RLENGTH - 2); # Extract the words
gsub(/^[ ]+/, "", line); # Remove leading spaces and tabs
gsub(/[ ]+$/, "", line); # Remove trailing spaces and tabs
gsub(/[ ]+/, " ", line); # Sub multiple spaces for a single space
split(line, modules, " "); # Split into an array of words

# If node has no dependencies, just add the node
if (length(modules)==1) {
print modules[1];
}
else { # add edges
for (i = 2; i <= length(modules); i++) {
print modules[1]" -> "modules[i];
}
}
}

# Main AWK script
{
# Concatenate lines if the opening parenthesis is not closed
while (!/\)/) {
current_line = $0;
getline;
$0 = current_line $0;
}

# Check if the line begins with "barretenberg_module". If so, extact the digraph edges
function_name = "barretenberg_module";
if ($0 ~ "^" function_name "\\(") {
extract_edges($0);
}
}
17 changes: 17 additions & 0 deletions barretenberg/cpp/src/barretenberg/common/utils.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include "./utils.hpp"

namespace bb::utils {

std::vector<uint8_t> hex_to_bytes(const std::string& hex)
{
std::vector<uint8_t> bytes;

for (unsigned int i = 0; i < hex.length(); i += 2) {
std::string byteString = hex.substr(i, 2);
bytes.push_back(static_cast<uint8_t>(strtol(byteString.c_str(), nullptr, 16)));
}

return bytes;
}

} // namespace bb::utils
17 changes: 17 additions & 0 deletions barretenberg/cpp/src/barretenberg/common/utils.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#pragma once

#include <cstdint>
#include <string>
#include <vector>

namespace bb::utils {

/**
* @brief Routine to transform hexstring to vector of bytes.
*
* @param Hexadecimal string representation.
* @return Vector of uint8_t values.
*/
std::vector<uint8_t> hex_to_bytes(const std::string& hex);

} // namespace bb::utils
24 changes: 6 additions & 18 deletions barretenberg/cpp/src/barretenberg/crypto/ecdsa/ecdsa.test.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "ecdsa.hpp"
#include "barretenberg/common/serialize.hpp"
#include "barretenberg/common/utils.hpp"
#include "barretenberg/ecc/curves/grumpkin/grumpkin.hpp"
#include "barretenberg/ecc/curves/secp256r1/secp256r1.hpp"
#include "barretenberg/serialize/test_helper.hpp"
Expand Down Expand Up @@ -89,23 +90,10 @@ TEST(ecdsa, recover_public_key_secp256r1_sha256)
EXPECT_EQ(recovered_public_key, account.public_key);
}

std::vector<uint8_t> HexToBytes(const std::string& hex)
{
std::vector<uint8_t> bytes;

for (unsigned int i = 0; i < hex.length(); i += 2) {
std::string byteString = hex.substr(i, 2);
uint8_t byte = (uint8_t)strtol(byteString.c_str(), NULL, 16);
bytes.push_back(byte);
}

return bytes;
}

TEST(ecdsa, check_overflowing_r_and_s_are_rejected)
{

std::vector<uint8_t> message_vec = HexToBytes("41414141");
std::vector<uint8_t> message_vec = utils::hex_to_bytes("41414141");

std::string message(message_vec.begin(), message_vec.end());
crypto::ecdsa_signature signature;
Expand Down Expand Up @@ -181,10 +169,10 @@ TEST(ecdsa, verify_signature_secp256r1_sha256_NIST_1)
};

crypto::ecdsa_signature sig{ r, s, 27 };
std::vector<uint8_t> message_vec =
HexToBytes("5905238877c77421f73e43ee3da6f2d9e2ccad5fc942dcec0cbd25482935faaf416983fe165b1a045ee2bcd2e6dca3bdf46"
"c4310a7461f9a37960ca672d3feb5473e253605fb1ddfd28065b53cb5858a8ad28175bf9bd386a5e471ea7a65c17cc934a9"
"d791e91491eb3754d03799790fe2d308d16146d5c9b0d0debd97d79ce8");
std::vector<uint8_t> message_vec = utils::hex_to_bytes(
"5905238877c77421f73e43ee3da6f2d9e2ccad5fc942dcec0cbd25482935faaf416983fe165b1a045ee2bcd2e6dca3bdf46"
"c4310a7461f9a37960ca672d3feb5473e253605fb1ddfd28065b53cb5858a8ad28175bf9bd386a5e471ea7a65c17cc934a9"
"d791e91491eb3754d03799790fe2d308d16146d5c9b0d0debd97d79ce8");
std::string message(message_vec.begin(), message_vec.end());

bool result = crypto::ecdsa_verify_signature<Sha256Hasher, secp256r1::fq, secp256r1::fr, secp256r1::g1>(
Expand Down
Loading

0 comments on commit 31d47b2

Please sign in to comment.