Skip to content

Commit

Permalink
too many unknowns fix attemp
Browse files Browse the repository at this point in the history
  • Loading branch information
benesjan committed Jun 2, 2023
1 parent 1b9c9fb commit c29f9e7
Show file tree
Hide file tree
Showing 23 changed files with 183 additions and 176 deletions.
46 changes: 24 additions & 22 deletions circuits/cpp/src/aztec3/circuits/abis/combined_accumulated_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ template <typename NCT> struct CombinedAccumulatedData {

// sha256 hash of the log preimages (in two fields to accommodate all 256-bits of the hash)
std::array<fr, 2> encrypted_logs_hash = zero_array<fr, 2>();
std::array<fr, 2> unencrypted_logs_hash = zero_array<fr, 2>();
// std::array<fr, 2> unencrypted_logs_hash = zero_array<fr, 2>();

// Here so that the gas cost of this request can be measured by circuits, without actually needing to feed in the
// variable-length data.
// TODO: Mike has this as uint32 but I have issue compiling it like that. Should it be used or is fr ok?
fr encrypted_log_preimages_length = 0;
fr unencrypted_log_preimages_length = 0;
// fr unencrypted_log_preimages_length = 0;

std::array<NewContractData<NCT>, KERNEL_NEW_CONTRACTS_LENGTH> new_contracts{};

Expand All @@ -62,9 +62,9 @@ template <typename NCT> struct CombinedAccumulatedData {
public_call_stack,
new_l2_to_l1_msgs,
encrypted_logs_hash,
unencrypted_logs_hash,
// unencrypted_logs_hash,
encrypted_log_preimages_length,
unencrypted_log_preimages_length,
// unencrypted_log_preimages_length,
new_contracts,
optionally_revealed_data,
public_data_update_requests,
Expand All @@ -75,9 +75,9 @@ template <typename NCT> struct CombinedAccumulatedData {
new_nullifiers == other.new_nullifiers && private_call_stack == other.private_call_stack &&
public_call_stack == other.public_call_stack && new_l2_to_l1_msgs == other.new_l2_to_l1_msgs &&
encrypted_logs_hash == other.encrypted_logs_hash &&
unencrypted_logs_hash == other.unencrypted_logs_hash &&
// unencrypted_logs_hash == other.unencrypted_logs_hash &&
encrypted_log_preimages_length == other.encrypted_log_preimages_length &&
unencrypted_log_preimages_length == other.unencrypted_log_preimages_length &&
// unencrypted_log_preimages_length == other.unencrypted_log_preimages_length &&
new_contracts == other.new_contracts && optionally_revealed_data == other.optionally_revealed_data &&
public_data_update_requests == other.public_data_update_requests &&
public_data_reads == other.public_data_reads;
Expand Down Expand Up @@ -110,10 +110,10 @@ template <typename NCT> struct CombinedAccumulatedData {
to_ct(new_l2_to_l1_msgs),

to_ct(encrypted_logs_hash),
to_ct(unencrypted_logs_hash),
// to_ct(unencrypted_logs_hash),

to_ct(encrypted_log_preimages_length),
to_ct(unencrypted_log_preimages_length),
// to_ct(unencrypted_log_preimages_length),

map(new_contracts, to_circuit_type),
map(optionally_revealed_data, to_circuit_type),
Expand Down Expand Up @@ -147,10 +147,10 @@ template <typename NCT> struct CombinedAccumulatedData {
to_nt(new_l2_to_l1_msgs),

to_nt(encrypted_logs_hash),
to_nt(unencrypted_logs_hash),
// to_nt(unencrypted_logs_hash),

to_nt(encrypted_log_preimages_length),
to_nt(unencrypted_log_preimages_length),
// to_nt(unencrypted_log_preimages_length),

map(new_contracts, to_native_type),
map(optionally_revealed_data, to_native_type),
Expand All @@ -174,7 +174,7 @@ template <typename NCT> struct CombinedAccumulatedData {
set_array_public(new_l2_to_l1_msgs);

set_array_public(encrypted_logs_hash);
set_array_public(unencrypted_logs_hash);
// set_array_public(unencrypted_logs_hash);

set_array_public(new_contracts);
set_array_public(optionally_revealed_data);
Expand Down Expand Up @@ -234,9 +234,9 @@ template <typename NCT> void read(uint8_t const*& it, CombinedAccumulatedData<NC
read(it, accum_data.public_call_stack);
read(it, accum_data.new_l2_to_l1_msgs);
read(it, accum_data.encrypted_logs_hash);
read(it, accum_data.unencrypted_logs_hash);
// read(it, accum_data.unencrypted_logs_hash);
read(it, accum_data.encrypted_log_preimages_length);
read(it, accum_data.unencrypted_log_preimages_length);
// read(it, accum_data.unencrypted_log_preimages_length);
read(it, accum_data.new_contracts);
read(it, accum_data.optionally_revealed_data);
read(it, accum_data.public_data_update_requests);
Expand All @@ -254,9 +254,9 @@ template <typename NCT> void write(std::vector<uint8_t>& buf, CombinedAccumulate
write(buf, accum_data.public_call_stack);
write(buf, accum_data.new_l2_to_l1_msgs);
write(buf, accum_data.encrypted_logs_hash);
write(buf, accum_data.unencrypted_logs_hash);
// write(buf, accum_data.unencrypted_logs_hash);
write(buf, accum_data.encrypted_log_preimages_length);
write(buf, accum_data.unencrypted_log_preimages_length);
// write(buf, accum_data.unencrypted_log_preimages_length);
write(buf, accum_data.new_contracts);
write(buf, accum_data.optionally_revealed_data);
write(buf, accum_data.public_data_update_requests);
Expand All @@ -278,15 +278,17 @@ template <typename NCT> std::ostream& operator<<(std::ostream& os, CombinedAccum
<< "new_l2_to_l1_msgs:\n"
<< accum_data.new_l2_to_l1_msgs << "\n"
<< "encrypted_logs_hash:\n"
<< accum_data.encrypted_logs_hash << "\n"
<< "unencrypted_logs_hash:\n"
<< accum_data.unencrypted_logs_hash << "\n"
<< accum_data.encrypted_logs_hash
<< "\n"
// << "unencrypted_logs_hash:\n"
// << accum_data.unencrypted_logs_hash << "\n"
<< "encrypted_log_preimages_length:\n"
<< accum_data.encrypted_log_preimages_length << "\n"
<< "unencrypted_log_preimages_length:\n"
<< accum_data.new_contracts << "\n"
<< accum_data.encrypted_log_preimages_length
<< "\n"
// << "unencrypted_log_preimages_length:\n"
// << accum_data.unencrypted_log_preimages_length << "\n"
<< "new_contracts:\n"
<< accum_data.unencrypted_log_preimages_length << "\n"
<< accum_data.new_contracts << "\n"
<< "optionally_revealed_data:\n"
<< accum_data.optionally_revealed_data << "\n"
<< "public_data_update_requests:\n"
Expand Down
Loading

0 comments on commit c29f9e7

Please sign in to comment.