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

fix: circuits issues when building with gcc #2107

Merged
merged 3 commits into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,9 @@ template <typename NCT> class OptionalPrivateCircuitPublicInputs {
chain_id,
version);

OptionalPrivateCircuitPublicInputs<NCT>() = default;
OptionalPrivateCircuitPublicInputs() = default;

OptionalPrivateCircuitPublicInputs<NCT>(
OptionalPrivateCircuitPublicInputs(
std::optional<CallContext<NCT>> const& call_context,

opt_fr const& args_hash,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ template <typename NCT> struct PublicCircuitPublicInputs {

HistoricBlockData<NCT> historic_block_data{};

address prover_address;
address prover_address{};

// for serialization, update with new fields
MSGPACK_FIELDS(call_context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,39 +18,39 @@ template <typename NCT> struct RootRollupPublicInputs {
using AggregationObject = typename NCT::AggregationObject;

// All below are shared between the base and merge rollups
AggregationObject end_aggregation_object;
AggregationObject end_aggregation_object{};

GlobalVariables<NCT> global_variables;
GlobalVariables<NCT> global_variables{};

AppendOnlyTreeSnapshot<NCT> start_private_data_tree_snapshot;
AppendOnlyTreeSnapshot<NCT> end_private_data_tree_snapshot;
AppendOnlyTreeSnapshot<NCT> start_private_data_tree_snapshot{};
AppendOnlyTreeSnapshot<NCT> end_private_data_tree_snapshot{};

AppendOnlyTreeSnapshot<NCT> start_nullifier_tree_snapshot;
AppendOnlyTreeSnapshot<NCT> end_nullifier_tree_snapshot;
AppendOnlyTreeSnapshot<NCT> start_nullifier_tree_snapshot{};
AppendOnlyTreeSnapshot<NCT> end_nullifier_tree_snapshot{};

AppendOnlyTreeSnapshot<NCT> start_contract_tree_snapshot;
AppendOnlyTreeSnapshot<NCT> end_contract_tree_snapshot;
AppendOnlyTreeSnapshot<NCT> start_contract_tree_snapshot{};
AppendOnlyTreeSnapshot<NCT> end_contract_tree_snapshot{};

fr start_public_data_tree_root;
fr end_public_data_tree_root;
fr start_public_data_tree_root{};
fr end_public_data_tree_root{};

AppendOnlyTreeSnapshot<NCT> start_tree_of_historic_private_data_tree_roots_snapshot;
AppendOnlyTreeSnapshot<NCT> end_tree_of_historic_private_data_tree_roots_snapshot;
AppendOnlyTreeSnapshot<NCT> start_tree_of_historic_private_data_tree_roots_snapshot{};
AppendOnlyTreeSnapshot<NCT> end_tree_of_historic_private_data_tree_roots_snapshot{};

AppendOnlyTreeSnapshot<NCT> start_tree_of_historic_contract_tree_roots_snapshot;
AppendOnlyTreeSnapshot<NCT> end_tree_of_historic_contract_tree_roots_snapshot;
AppendOnlyTreeSnapshot<NCT> start_tree_of_historic_contract_tree_roots_snapshot{};
AppendOnlyTreeSnapshot<NCT> end_tree_of_historic_contract_tree_roots_snapshot{};

AppendOnlyTreeSnapshot<NCT> start_l1_to_l2_messages_tree_snapshot;
AppendOnlyTreeSnapshot<NCT> end_l1_to_l2_messages_tree_snapshot;
AppendOnlyTreeSnapshot<NCT> start_l1_to_l2_messages_tree_snapshot{};
AppendOnlyTreeSnapshot<NCT> end_l1_to_l2_messages_tree_snapshot{};

AppendOnlyTreeSnapshot<NCT> start_tree_of_historic_l1_to_l2_messages_tree_roots_snapshot;
AppendOnlyTreeSnapshot<NCT> end_tree_of_historic_l1_to_l2_messages_tree_roots_snapshot;
AppendOnlyTreeSnapshot<NCT> start_tree_of_historic_l1_to_l2_messages_tree_roots_snapshot{};
AppendOnlyTreeSnapshot<NCT> end_tree_of_historic_l1_to_l2_messages_tree_roots_snapshot{};

AppendOnlyTreeSnapshot<NCT> start_historic_blocks_tree_snapshot;
AppendOnlyTreeSnapshot<NCT> end_historic_blocks_tree_snapshot;
AppendOnlyTreeSnapshot<NCT> start_historic_blocks_tree_snapshot{};
AppendOnlyTreeSnapshot<NCT> end_historic_blocks_tree_snapshot{};

std::array<fr, NUM_FIELDS_PER_SHA256> calldata_hash;
std::array<fr, NUM_FIELDS_PER_SHA256> l1_to_l2_messages_hash;
std::array<fr, NUM_FIELDS_PER_SHA256> calldata_hash{};
std::array<fr, NUM_FIELDS_PER_SHA256> l1_to_l2_messages_hash{};

// For serialization, update with new fields
MSGPACK_FIELDS(end_aggregation_object,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ template <typename Builder> class FunctionExecutionContext {
bool is_finalised = false;

public:
FunctionExecutionContext<Builder>(Builder& builder, OracleWrapperInterface<Builder>& oracle)
FunctionExecutionContext(Builder& builder, OracleWrapperInterface<Builder>& oracle)
: builder(builder)
, oracle(oracle)
, private_circuit_public_inputs(OptionalPrivateCircuitPublicInputs<CT>::create())
Expand Down Expand Up @@ -332,4 +332,4 @@ template <typename Builder> class FunctionExecutionContext {
}
};

} // namespace aztec3::circuits::apps
} // namespace aztec3::circuits::apps
4 changes: 2 additions & 2 deletions circuits/cpp/src/aztec3/circuits/hash.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -442,9 +442,9 @@ template <typename NCT> std::array<typename NCT::fr, NUM_FIELDS_PER_SHA256> accu
// Generate a 512 bit input from right and left 256 bit hashes
constexpr auto num_bytes = 2 * 32;
std::array<uint8_t, num_bytes> hash_input_bytes;
for (uint8_t i = 0; i < 4; i++) {
for (size_t i = 0; i < 4; i++) {
auto half = hashes[i].to_buffer();
for (uint8_t j = 0; j < 16; j++) {
for (size_t j = 0; j < 16; j++) {
hash_input_bytes[i * 16 + j] = half[16 + j];
}
}
Expand Down