Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(barretenberg): use a single bberg header & cleanup includes #720

Merged
merged 12 commits into from
Jun 1, 2023
3 changes: 1 addition & 2 deletions circuits/cpp/src/aztec3/circuits/abis/.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@

#include "aztec3/circuits/abis/combined_accumulated_data.hpp"

#include <barretenberg/common/serialize.hpp>
#include <barretenberg/serialize/cbind.hpp>
#include <barretenberg/barretenberg.hpp>

#include <gtest/gtest.h>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
#pragma once

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

#include <barretenberg/serialize/msgpack.hpp>
#include <barretenberg/barretenberg.hpp>

namespace aztec3::circuits::abis {

using aztec3::utils::types::CircuitTypes;
using aztec3::utils::types::NativeTypes;
using std::is_same;

template <typename NCT> struct AppendOnlyTreeSnapshot {
using fr = typename NCT::fr;
using uint32 = typename NCT::uint32;
Expand Down
16 changes: 5 additions & 11 deletions circuits/cpp/src/aztec3/circuits/abis/c_bind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,11 @@
#include "aztec3/circuits/abis/private_kernel/private_kernel_inputs_init.hpp"
#include "aztec3/circuits/abis/signed_tx_request.hpp"
#include "aztec3/circuits/abis/types.hpp"
#include <aztec3/circuits/hash.hpp>
#include <aztec3/constants.hpp>
#include <aztec3/utils/array.hpp>
#include <aztec3/utils/types/native_types.hpp>

#include "barretenberg/crypto/ecdsa/ecdsa.hpp"
#include "barretenberg/srs/reference_string/mem_reference_string.hpp"
#include "barretenberg/stdlib/commitment/pedersen/pedersen_plookup.hpp"
#include <barretenberg/crypto/keccak/keccak.hpp>
#include <barretenberg/serialize/cbind.hpp>
#include <barretenberg/stdlib/merkle_tree/membership.hpp>
#include "aztec3/circuits/hash.hpp"
#include "aztec3/constants.hpp"
#include "aztec3/utils/types/native_types.hpp"

#include <barretenberg/barretenberg.hpp>

namespace {

Expand Down
3 changes: 1 addition & 2 deletions circuits/cpp/src/aztec3/circuits/abis/c_bind.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <barretenberg/serialize/cbind_fwd.hpp>
#include <barretenberg/barretenberg.hpp>

#include <algorithm>
#include <cstddef>
Expand Down Expand Up @@ -27,4 +27,3 @@ WASM_EXPORT void abis__compute_message_secret_hash(uint8_t const* secret, uint8_
WASM_EXPORT void abis__compute_contract_leaf(uint8_t const* contract_leaf_preimage_buf, uint8_t* output);
WASM_EXPORT void abis__compute_transaction_hash(uint8_t const* signed_tx_request_buf, uint8_t* output);
WASM_EXPORT void abis__compute_call_stack_item_hash(uint8_t const* call_stack_item_buf, uint8_t* output);

5 changes: 1 addition & 4 deletions circuits/cpp/src/aztec3/circuits/abis/c_bind.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
#include "aztec3/circuits/abis/signed_tx_request.hpp"
#include "aztec3/circuits/hash.hpp"

#include <barretenberg/common/serialize.hpp>
#include <barretenberg/numeric/random/engine.hpp>
#include <barretenberg/serialize/test_helper.hpp>
#include <barretenberg/stdlib/merkle_tree/membership.hpp>
#include <barretenberg/barretenberg.hpp>

#include <gtest/gtest.h>

Expand Down
19 changes: 8 additions & 11 deletions circuits/cpp/src/aztec3/circuits/abis/call_context.hpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
#pragma once

#include <aztec3/constants.hpp>
#include <aztec3/utils/msgpack_derived_equals.hpp>
#include <aztec3/utils/msgpack_derived_output.hpp>
#include <aztec3/utils/types/circuit_types.hpp>
#include <aztec3/utils/types/convert.hpp>
#include <aztec3/utils/types/native_types.hpp>

#include <barretenberg/crypto/generators/generator_data.hpp>
#include <barretenberg/serialize/msgpack.hpp>
#include <barretenberg/stdlib/hash/pedersen/pedersen.hpp>
#include <barretenberg/stdlib/primitives/witness/witness.hpp>
#include "aztec3/constants.hpp"
#include "aztec3/utils/msgpack_derived_equals.hpp"
#include "aztec3/utils/msgpack_derived_output.hpp"
#include "aztec3/utils/types/circuit_types.hpp"
#include "aztec3/utils/types/convert.hpp"
#include "aztec3/utils/types/native_types.hpp"

#include <barretenberg/barretenberg.hpp>

namespace aztec3::circuits::abis {

Expand Down
10 changes: 4 additions & 6 deletions circuits/cpp/src/aztec3/circuits/abis/call_stack_item.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,16 @@
#include "public_circuit_public_inputs.hpp"

#include "aztec3/circuits/abis/types.hpp"
#include <aztec3/utils/types/circuit_types.hpp>
#include <aztec3/utils/types/convert.hpp>
#include <aztec3/utils/types/native_types.hpp>
#include "aztec3/utils/types/circuit_types.hpp"
#include "aztec3/utils/types/convert.hpp"
#include "aztec3/utils/types/native_types.hpp"

#include <barretenberg/serialize/msgpack.hpp>
#include <barretenberg/stdlib/primitives/witness/witness.hpp>
#include <barretenberg/barretenberg.hpp>

namespace aztec3::circuits::abis {

using aztec3::utils::types::CircuitTypes;
using aztec3::utils::types::NativeTypes;
using std::conditional;
using std::is_same;

template <typename NCT, template <class> typename PrivatePublic> struct CallStackItem {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
#include "public_data_update_request.hpp"

#include "aztec3/constants.hpp"
#include <aztec3/utils/array.hpp>
#include <aztec3/utils/types/circuit_types.hpp>
#include <aztec3/utils/types/convert.hpp>
#include <aztec3/utils/types/native_types.hpp>
#include "aztec3/utils/array.hpp"
#include "aztec3/utils/types/circuit_types.hpp"
#include "aztec3/utils/types/convert.hpp"
#include "aztec3/utils/types/native_types.hpp"

#include <barretenberg/common/map.hpp>
#include <barretenberg/stdlib/primitives/witness/witness.hpp>
#include <barretenberg/barretenberg.hpp>

namespace aztec3::circuits::abis {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@
#include "tx_context.hpp"

#include "aztec3/circuits/abis/combined_historic_tree_roots.hpp"
#include <aztec3/utils/types/circuit_types.hpp>
#include <aztec3/utils/types/convert.hpp>
#include <aztec3/utils/types/native_types.hpp>
#include "aztec3/utils/types/circuit_types.hpp"
#include "aztec3/utils/types/convert.hpp"
#include "aztec3/utils/types/native_types.hpp"

#include <barretenberg/stdlib/primitives/witness/witness.hpp>
#include <barretenberg/barretenberg.hpp>

namespace aztec3::circuits::abis {

using aztec3::circuits::abis::CombinedHistoricTreeRoots;
using aztec3::utils::types::CircuitTypes;
using aztec3::utils::types::NativeTypes;
using plonk::stdlib::witness_t;
using std::is_same;

template <typename NCT> struct CombinedConstantData {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
#pragma once
#include "private_historic_tree_roots.hpp"

#include <aztec3/utils/types/circuit_types.hpp>
#include <aztec3/utils/types/convert.hpp>
#include <aztec3/utils/types/native_types.hpp>
#include "aztec3/utils/types/circuit_types.hpp"
#include "aztec3/utils/types/convert.hpp"
#include "aztec3/utils/types/native_types.hpp"

#include <barretenberg/stdlib/primitives/witness/witness.hpp>
#include <barretenberg/barretenberg.hpp>

namespace aztec3::circuits::abis {

using aztec3::circuits::abis::PrivateHistoricTreeRoots;
using aztec3::utils::types::CircuitTypes;
using aztec3::utils::types::NativeTypes;
using plonk::stdlib::witness_t;
using std::is_same;

template <typename NCT> struct CombinedHistoricTreeRoots {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
#pragma once
#include <aztec3/constants.hpp>
#include <aztec3/utils/types/circuit_types.hpp>
#include <aztec3/utils/types/convert.hpp>
#include <aztec3/utils/types/native_types.hpp>
#include "aztec3/constants.hpp"
#include "aztec3/utils/types/circuit_types.hpp"
#include "aztec3/utils/types/convert.hpp"
#include "aztec3/utils/types/native_types.hpp"

#include <barretenberg/crypto/generators/generator_data.hpp>
#include <barretenberg/stdlib/hash/pedersen/pedersen.hpp>
#include <barretenberg/stdlib/primitives/witness/witness.hpp>
#include <barretenberg/barretenberg.hpp>

namespace aztec3::circuits::abis {

using aztec3::utils::types::CircuitTypes;
using aztec3::utils::types::NativeTypes;
using plonk::stdlib::witness_t;
using std::is_same;

template <typename NCT> struct ContractDeploymentData {
Expand Down
11 changes: 5 additions & 6 deletions circuits/cpp/src/aztec3/circuits/abis/contract_storage_read.hpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
#pragma once
#include <aztec3/utils/msgpack_derived_output.hpp>
#include <aztec3/utils/types/circuit_types.hpp>
#include <aztec3/utils/types/convert.hpp>
#include <aztec3/utils/types/native_types.hpp>
#include "aztec3/utils/msgpack_derived_output.hpp"
#include "aztec3/utils/types/circuit_types.hpp"
#include "aztec3/utils/types/convert.hpp"
#include "aztec3/utils/types/native_types.hpp"

#include <barretenberg/serialize/msgpack.hpp>
#include <barretenberg/stdlib/primitives/witness/witness.hpp>
#include <barretenberg/barretenberg.hpp>

namespace aztec3::circuits::abis {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
#pragma once
#include <aztec3/utils/msgpack_derived_output.hpp>
#include <aztec3/utils/types/circuit_types.hpp>
#include <aztec3/utils/types/convert.hpp>
#include <aztec3/utils/types/native_types.hpp>
#include "aztec3/utils/msgpack_derived_output.hpp"
#include "aztec3/utils/types/circuit_types.hpp"
#include "aztec3/utils/types/convert.hpp"
#include "aztec3/utils/types/native_types.hpp"

#include <barretenberg/serialize/msgpack.hpp>
#include <barretenberg/stdlib/primitives/witness/witness.hpp>
#include <barretenberg/barretenberg.hpp>

namespace aztec3::circuits::abis {

Expand Down
9 changes: 5 additions & 4 deletions circuits/cpp/src/aztec3/circuits/abis/function_data.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#pragma once
#include <aztec3/constants.hpp>
#include <aztec3/utils/types/circuit_types.hpp>
#include <aztec3/utils/types/convert.hpp>
#include <aztec3/utils/types/native_types.hpp>

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

namespace aztec3::circuits::abis {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#pragma once
#include <aztec3/constants.hpp>
#include <aztec3/utils/types/circuit_types.hpp>
#include <aztec3/utils/types/convert.hpp>
#include <aztec3/utils/types/native_types.hpp>

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

namespace aztec3::circuits::abis {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,16 @@
#include "combined_accumulated_data.hpp"
#include "combined_constant_data.hpp"

#include <aztec3/utils/types/circuit_types.hpp>
#include <aztec3/utils/types/convert.hpp>
#include <aztec3/utils/types/native_types.hpp>
#include "aztec3/utils/types/circuit_types.hpp"
#include "aztec3/utils/types/convert.hpp"
#include "aztec3/utils/types/native_types.hpp"

#include <barretenberg/stdlib/primitives/witness/witness.hpp>
#include <barretenberg/barretenberg.hpp>

namespace aztec3::circuits::abis {

using aztec3::utils::types::CircuitTypes;
using aztec3::utils::types::NativeTypes;
using plonk::stdlib::witness_t;
using std::conditional;
using std::is_same;

template <typename NCT> struct KernelCircuitPublicInputs {
Expand Down
3 changes: 2 additions & 1 deletion circuits/cpp/src/aztec3/circuits/abis/membership_witness.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#pragma once

#include "aztec3/utils/array.hpp"
#include "aztec3/utils/types/circuit_types.hpp"
#include "aztec3/utils/types/convert.hpp"
#include <aztec3/utils/array.hpp>

namespace aztec3::circuits::abis {

using aztec3::utils::zero_array;
Expand Down
5 changes: 2 additions & 3 deletions circuits/cpp/src/aztec3/circuits/abis/new_contract_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
#include "aztec3/utils/types/circuit_types.hpp"
#include "aztec3/utils/types/convert.hpp"

#include "barretenberg/serialize/msgpack.hpp"
#include "barretenberg/stdlib/primitives/witness/witness.hpp"
#include <barretenberg/barretenberg.hpp>

namespace aztec3::circuits::abis {

using aztec3::utils::types::CircuitTypes;
using aztec3::utils::types::NativeTypes;
using plonk::stdlib::witness_t;
using std::is_same;

template <typename NCT> struct NewContractData {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#pragma once
#include "function_data.hpp"

#include <aztec3/utils/array.hpp>
#include <aztec3/utils/types/circuit_types.hpp>
#include <aztec3/utils/types/convert.hpp>
#include <aztec3/utils/types/native_types.hpp>
#include "aztec3/utils/array.hpp"
#include "aztec3/utils/types/circuit_types.hpp"
#include "aztec3/utils/types/convert.hpp"
#include "aztec3/utils/types/native_types.hpp"

#include <barretenberg/barretenberg.hpp>

#include <barretenberg/stdlib/primitives/witness/witness.hpp>
namespace aztec3::circuits::abis {

using aztec3::utils::zero_array;
Expand Down
10 changes: 4 additions & 6 deletions circuits/cpp/src/aztec3/circuits/abis/previous_kernel_data.hpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
#pragma once
#include "aztec3/circuits/abis/kernel_circuit_public_inputs.hpp"
#include <aztec3/utils/types/circuit_types.hpp>
#include <aztec3/utils/types/convert.hpp>
#include <aztec3/utils/types/native_types.hpp>
#include "aztec3/utils/types/circuit_types.hpp"
#include "aztec3/utils/types/convert.hpp"
#include "aztec3/utils/types/native_types.hpp"

#include <barretenberg/plonk/proof_system/types/proof.hpp>
#include <barretenberg/srs/reference_string/env_reference_string.hpp>
#include <barretenberg/stdlib/primitives/witness/witness.hpp>
#include <barretenberg/barretenberg.hpp>

namespace aztec3::circuits::abis {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,20 @@
#include "call_context.hpp"
#include "contract_deployment_data.hpp"

#include <aztec3/constants.hpp>
#include <aztec3/utils/array.hpp>
#include <aztec3/utils/types/circuit_types.hpp>
#include <aztec3/utils/types/convert.hpp>
#include <aztec3/utils/types/native_types.hpp>
#include "aztec3/constants.hpp"
#include "aztec3/utils/array.hpp"
#include "aztec3/utils/types/circuit_types.hpp"
#include "aztec3/utils/types/convert.hpp"
#include "aztec3/utils/types/native_types.hpp"

#include <barretenberg/common/map.hpp>
#include <barretenberg/crypto/generators/generator_data.hpp>
#include <barretenberg/stdlib/hash/pedersen/pedersen.hpp>
#include <barretenberg/stdlib/primitives/witness/witness.hpp>
#include <barretenberg/barretenberg.hpp>

namespace aztec3::circuits::abis {

using aztec3::utils::zero_array;
using aztec3::utils::types::CircuitTypes;
using aztec3::utils::types::NativeTypes;
using plonk::stdlib::witness_t;

template <typename NCT> class PrivateCircuitPublicInputs {
using fr = typename NCT::fr;
Expand Down
Loading