Skip to content

Commit

Permalink
feat: Sync from aztec-packages (#5401)
Browse files Browse the repository at this point in the history
Automated pull of Noir development from
[aztec-packages](https://github.com/AztecProtocol/aztec-packages).
BEGIN_COMMIT_OVERRIDE
feat: Sync from noir
(AztecProtocol/aztec-packages#7308)
feat: Sync from noir
(AztecProtocol/aztec-packages#7288)
refactor: nuking "new" from names
(AztecProtocol/aztec-packages#7273)
END_COMMIT_OVERRIDE

Co-authored-by: TomAFrench <tom@tomfren.ch>
  • Loading branch information
AztecBot and TomAFrench authored Jul 3, 2024
1 parent 370f141 commit 322f863
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
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

0 comments on commit 322f863

Please sign in to comment.