Skip to content

Commit

Permalink
Merge branch 'master' into lde/stdlib_transcript
Browse files Browse the repository at this point in the history
  • Loading branch information
ludamad authored Jul 27, 2023
2 parents 55b3ae8 + c577436 commit 66776da
Show file tree
Hide file tree
Showing 183 changed files with 3,763 additions and 1,171 deletions.
68 changes: 42 additions & 26 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -236,16 +236,16 @@ jobs:
command: cond_spot_run_tests barretenberg-x86_64-linux-clang-assert 3 join_split_example_proofs_join_split_tests --gtest_filter=-*full_proof*
- *save_logs

bb-bin-tests:
docker:
- image: aztecprotocol/alpine-build-image
resource_class: small
steps:
- *checkout
- *setup_env
- run:
name: "Test"
command: cond_spot_run_test_script ./scripts/bin-test.sh barretenberg-x86_64-linux-clang-assert
# bb-bin-tests:
# docker:
# - image: aztecprotocol/alpine-build-image
# resource_class: small
# steps:
# - *checkout
# - *setup_env
# - run:
# name: "Test"
# command: cond_spot_run_test_script ./scripts/bin-test.sh barretenberg-x86_64-linux-clang-assert

barretenberg-benchmark-aggregator:
docker:
Expand Down Expand Up @@ -316,16 +316,17 @@ jobs:
name: "Build"
command: cond_spot_run_build circuits-wasm-linux-clang-assert 64

circuits-x86_64-linux-clang-tidy:
docker:
- image: aztecprotocol/alpine-build-image
resource_class: small
steps:
- *checkout
- *setup_env
- run:
name: "Build"
command: cond_spot_run_build circuits-x86_64-linux-clang-tidy 64
# TODO Disabling until this is 3-10x faster see #1152
# circuits-x86_64-linux-clang-tidy:
# docker:
# - image: aztecprotocol/alpine-build-image
# resource_class: small
# steps:
# - *checkout
# - *setup_env
# - run:
# name: "Build"
# command: cond_spot_run_build circuits-x86_64-linux-clang-tidy 64

circuits-x86_64-linux-clang:
docker:
Expand Down Expand Up @@ -685,6 +686,18 @@ jobs:
name: "Test"
command: cond_spot_run_tests end-to-end e2e_deploy_contract.test.ts

e2e-lending-contract:
docker:
- image: aztecprotocol/alpine-build-image
resource_class: small
steps:
- *checkout
- *setup_env
- run:
name: "Test"
command: cond_spot_run_tests end-to-end e2e_lending_contract.test.ts


e2e-zk-token-contract:
docker:
- image: aztecprotocol/alpine-build-image
Expand Down Expand Up @@ -762,7 +775,7 @@ jobs:
name: "Test"
command: cond_spot_run_tests end-to-end e2e_public_to_private_messaging.test.ts

e2e-account-contract:
e2e-account-contracts:
docker:
- image: aztecprotocol/alpine-build-image
resource_class: small
Expand Down Expand Up @@ -1008,7 +1021,8 @@ workflows:
- barretenberg-stdlib-recursion-turbo-tests: *bb_test
- barretenberg-stdlib-recursion-ultra-tests: *bb_test
- barretenberg-join-split-tests: *bb_test
- bb-bin-tests: *bb_test
# TODO(#1236): Reinstate this test once Noir support recursion again.
# - bb-bin-tests: *bb_test
- barretenberg-benchmark-aggregator:
requires:
- barretenberg-tests
Expand Down Expand Up @@ -1037,7 +1051,7 @@ workflows:
<<: *defaults
- circuits-wasm-linux-clang: *defaults
- circuits-wasm-linux-clang-assert: *defaults
- circuits-x86_64-linux-clang-tidy: *defaults
# - circuits-x86_64-linux-clang-tidy: *defaults # TODO #1152
- circuits-x86_64-linux-clang: *defaults
- circuits-x86_64-linux-clang-assert: *defaults
- circuits-wasm-tests:
Expand All @@ -1049,7 +1063,7 @@ workflows:
requires:
- circuits-wasm-linux-clang
- circuits-wasm-linux-clang-assert
- circuits-x86_64-linux-clang-tidy
# - circuits-x86_64-linux-clang-tidy # TODO #1152
- circuits-x86_64-linux-clang
- circuits-x86_64-linux-clang-assert
- circuits-wasm-tests
Expand Down Expand Up @@ -1115,6 +1129,7 @@ workflows:

- e2e-2-rpc-servers: *e2e_test
- e2e-deploy-contract: *e2e_test
- e2e-lending-contract: *e2e_test
- e2e-zk-token-contract: *e2e_test
- e2e-block-building: *e2e_test
- e2e-nested-contract: *e2e_test
Expand All @@ -1124,7 +1139,7 @@ workflows:
- e2e-cross-chain-messaging: *e2e_test
- e2e-public-cross-chain-messaging: *e2e_test
- e2e-public-to-private-messaging: *e2e_test
- e2e-account-contract: *e2e_test
- e2e-account-contracts: *e2e_test
- e2e-pending-commitments-contract: *e2e_test
- uniswap-trade-on-l1-from-l2: *e2e_test
- integration-l1-publisher: *e2e_test
Expand All @@ -1136,6 +1151,7 @@ workflows:
requires:
- e2e-2-rpc-servers
- e2e-deploy-contract
- e2e-lending-contract
- e2e-zk-token-contract
- e2e-block-building
- e2e-nested-contract
Expand All @@ -1145,7 +1161,7 @@ workflows:
- e2e-cross-chain-messaging
- e2e-public-cross-chain-messaging
- e2e-public-to-private-messaging
- e2e-account-contract
- e2e-account-contracts
- e2e-pending-commitments-contract
- uniswap-trade-on-l1-from-l2
- integration-l1-publisher
Expand Down
22 changes: 11 additions & 11 deletions circuits/cpp/barretenberg/.circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -266,16 +266,16 @@ jobs:
command: cond_spot_run_tests barretenberg-x86_64-linux-clang-assert 3 join_split_example_proofs_join_split_tests --gtest_filter=-*full_proof*
- *save_logs

bb-bin-tests:
docker:
- image: aztecprotocol/alpine-build-image
resource_class: small
steps:
- *checkout
- *setup_env
- run:
name: "Test"
command: cond_spot_run_test_script ./scripts/bin-test.sh barretenberg-x86_64-linux-clang-assert
# bb-bin-tests:
# docker:
# - image: aztecprotocol/alpine-build-image
# resource_class: small
# steps:
# - *checkout
# - *setup_env
# - run:
# name: "Test"
# command: cond_spot_run_test_script ./scripts/bin-test.sh barretenberg-x86_64-linux-clang-assert

benchmark-aggregator:
docker:
Expand Down Expand Up @@ -439,7 +439,7 @@ workflows:
- stdlib-recursion-turbo-tests: *bb_test
- stdlib-recursion-ultra-tests: *bb_test
- join-split-tests: *bb_test
- bb-bin-tests: *bb_test
# - bb-bin-tests: *bb_test
- benchmark-aggregator:
requires:
- barretenberg-tests
Expand Down
4 changes: 2 additions & 2 deletions circuits/cpp/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 = d6271b95bc9b0b3ba55ae5c783c48f7903086506
parent = 5ded7a37b833372982dd888781a708a807100e19
commit = 970bb073763cc59552cd05dccf7f8fc63f58cef9
parent = 6743ec1700ea13977ddfdf4817d1a4e2cb8464a8
method = merge
cmdver = 0.4.6
1 change: 0 additions & 1 deletion circuits/cpp/barretenberg/cpp/bin-test/target/main.json

This file was deleted.

Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -209,31 +209,6 @@ void handle_blackbox_func_call(Circuit::Opcode::BlackBoxFuncCall const& arg, aci
arg.value.value);
}

void handle_memory(Circuit::MemoryBlock const& mem_block, bool is_ram, acir_format& af)
{
std::vector<poly_triple> init;
std::vector<MemOp> trace;
auto len = mem_block.len;
for (size_t i = 0; i < len; ++i) {
init.push_back(serialize_arithmetic_gate(mem_block.trace[i].value));
}
for (size_t i = len; i < mem_block.trace.size(); ++i) {
auto index = serialize_arithmetic_gate(mem_block.trace[i].index);
auto value = serialize_arithmetic_gate(mem_block.trace[i].value);
auto op = mem_block.trace[i].operation;
if (!(op.mul_terms.empty() && op.linear_combinations.empty())) {
throw_or_abort("Expected constant.");
}
bool access_type(uint256_t(op.q_c));
trace.push_back(MemOp{
.access_type = static_cast<uint8_t>(access_type),
.index = index,
.value = value,
});
}
af.block_constraints.push_back(BlockConstraint{ .init = init, .trace = trace, .type = (BlockType)is_ram });
}

BlockConstraint handle_memory_init(Circuit::Opcode::MemoryInit const& mem_init)
{
BlockConstraint block{ .init = {}, .trace = {}, .type = BlockType::ROM };
Expand All @@ -256,10 +231,16 @@ BlockConstraint handle_memory_init(Circuit::Opcode::MemoryInit const& mem_init)
return block;
}

bool is_rom(Circuit::MemOp const& mem_op)
{
return mem_op.operation.mul_terms.size() == 0 && mem_op.operation.linear_combinations.size() == 0 &&
uint256_t(mem_op.operation.q_c) == 0;
}

void handle_memory_op(Circuit::Opcode::MemoryOp const& mem_op, BlockConstraint& block)
{
uint8_t access_type = 1;
if (mem_op.op.is_rom()) {
if (is_rom(mem_op.op)) {
access_type = 0;
}
if (block.type == BlockType::ROM && access_type == 1) {
Expand Down Expand Up @@ -289,10 +270,6 @@ acir_format circuit_buf_to_acir_format(std::vector<uint8_t> const& buf)
handle_arithmetic(arg, af);
} else if constexpr (std::is_same_v<T, Circuit::Opcode::BlackBoxFuncCall>) {
handle_blackbox_func_call(arg, af);
} else if constexpr (std::is_same_v<T, Circuit::Opcode::RAM>) {
handle_memory(arg.value, true, af);
} else if constexpr (std::is_same_v<T, Circuit::Opcode::ROM>) {
handle_memory(arg.value, false, af);
} else if constexpr (std::is_same_v<T, Circuit::Opcode::MemoryInit>) {
auto block = handle_memory_init(arg);
uint32_t block_id = arg.block_id.value;
Expand Down
Loading

0 comments on commit 66776da

Please sign in to comment.