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

feat: Sync from aztec-packages #5401

Merged
merged 2 commits into from
Jul 3, 2024
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
2 changes: 1 addition & 1 deletion .aztec-sync-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
df3b27b8c603845598bf966100be3a21e8e442db
2ae17f2177380244f695575c169cc591496cf3ad
28 changes: 14 additions & 14 deletions test_programs/execution_success/brillig_cow_regression/src/main.nr
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Tests a performance regression found in aztec-packages with brillig cow optimization

global MAX_NEW_NOTE_HASHES_PER_TX: u64 = 64;
global MAX_NEW_NULLIFIERS_PER_TX: u64 = 64;
global MAX_NEW_L2_TO_L1_MSGS_PER_TX: u64 = 2;
global MAX_NOTE_HASHES_PER_TX: u64 = 64;
global MAX_NULLIFIERS_PER_TX: u64 = 64;
global MAX_L2_TO_L1_MSGS_PER_TX: u64 = 2;
global MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX: u64 = 16;
global MAX_NEW_CONTRACTS_PER_TX: u64 = 1;
global NUM_ENCRYPTED_LOGS_HASHES_PER_TX: u64 = 1;
Expand Down Expand Up @@ -30,10 +30,10 @@ impl NewContractData {
}

struct DataToHash {
new_note_hashes: [Field; MAX_NEW_NOTE_HASHES_PER_TX],
new_nullifiers: [Field; MAX_NEW_NULLIFIERS_PER_TX],
new_note_hashes: [Field; MAX_NOTE_HASHES_PER_TX],
new_nullifiers: [Field; MAX_NULLIFIERS_PER_TX],
public_data_update_requests: [PublicDataUpdateRequest; MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX],
new_l2_to_l1_msgs: [Field; MAX_NEW_L2_TO_L1_MSGS_PER_TX],
new_l2_to_l1_msgs: [Field; MAX_L2_TO_L1_MSGS_PER_TX],
encrypted_logs_hash: [Field; NUM_FIELDS_PER_SHA256],
unencrypted_logs_hash: [Field; NUM_FIELDS_PER_SHA256],
new_contracts: [NewContractData; MAX_NEW_CONTRACTS_PER_TX],
Expand Down Expand Up @@ -104,21 +104,21 @@ unconstrained fn main(kernel_data: DataToHash) -> pub [Field; NUM_FIELDS_PER_SHA
let new_note_hashes = kernel_data.new_note_hashes;
let new_nullifiers = kernel_data.new_nullifiers;
let public_data_update_requests = kernel_data.public_data_update_requests;
let newL2ToL1msgs = kernel_data.new_l2_to_l1_msgs;
let l2ToL1Msgs = kernel_data.new_l2_to_l1_msgs;
let encryptedLogsHash = kernel_data.encrypted_logs_hash;
let unencryptedLogsHash = kernel_data.unencrypted_logs_hash;

let mut offset = 0;

for j in 0..MAX_NEW_NOTE_HASHES_PER_TX {
for j in 0..MAX_NOTE_HASHES_PER_TX {
tx_effects_hash_inputs[offset + j] = new_note_hashes[j];
}
offset += MAX_NEW_NOTE_HASHES_PER_TX ;
offset += MAX_NOTE_HASHES_PER_TX ;

for j in 0..MAX_NEW_NULLIFIERS_PER_TX {
for j in 0..MAX_NULLIFIERS_PER_TX {
tx_effects_hash_inputs[offset + j] = new_nullifiers[j];
}
offset += MAX_NEW_NULLIFIERS_PER_TX ;
offset += MAX_NULLIFIERS_PER_TX ;

for j in 0..MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX {
tx_effects_hash_inputs[offset + j * 2] =
Expand All @@ -128,10 +128,10 @@ unconstrained fn main(kernel_data: DataToHash) -> pub [Field; NUM_FIELDS_PER_SHA
}
offset += MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX * 2;

for j in 0..MAX_NEW_L2_TO_L1_MSGS_PER_TX {
tx_effects_hash_inputs[offset + j] = newL2ToL1msgs[j];
for j in 0..MAX_L2_TO_L1_MSGS_PER_TX {
tx_effects_hash_inputs[offset + j] = l2ToL1Msgs[j];
}
offset += MAX_NEW_L2_TO_L1_MSGS_PER_TX;
offset += MAX_L2_TO_L1_MSGS_PER_TX;

let contract_leaf = kernel_data.new_contracts[0];
tx_effects_hash_inputs[offset] = contract_leaf.hash();
Expand Down
Loading