Skip to content

Commit

Permalink
chore: bump maximum nullifier read requests (necessary for e2e tests …
Browse files Browse the repository at this point in the history
…in AVM)
  • Loading branch information
dbanks12 committed May 17, 2024
1 parent 1fa5963 commit a4f83d6
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ const size_t MAX_NEW_L2_TO_L1_MSGS_PER_CALL = 2;
const size_t MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL = 16;
const size_t MAX_PUBLIC_DATA_READS_PER_CALL = 16;
const size_t MAX_NOTE_HASH_READ_REQUESTS_PER_CALL = 32;
const size_t MAX_NULLIFIER_READ_REQUESTS_PER_CALL = 2;
const size_t MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_CALL = 2;
const size_t MAX_NULLIFIER_READ_REQUESTS_PER_CALL = 32;
const size_t MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_CALL = 32;
const size_t MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_CALL = 16;
const size_t MAX_NOTE_ENCRYPTED_LOGS_PER_CALL = 16;
const size_t MAX_ENCRYPTED_LOGS_PER_CALL = 4;
Expand All @@ -25,8 +25,8 @@ const size_t MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX = 32;
const size_t MAX_PUBLIC_DATA_READS_PER_TX = 32;
const size_t MAX_NEW_L2_TO_L1_MSGS_PER_TX = 2;
const size_t MAX_NOTE_HASH_READ_REQUESTS_PER_TX = 128;
const size_t MAX_NULLIFIER_READ_REQUESTS_PER_TX = 8;
const size_t MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_TX = 8;
const size_t MAX_NULLIFIER_READ_REQUESTS_PER_TX = 128;
const size_t MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_TX = 128;
const size_t MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_TX = 64;
const size_t MAX_NOTE_ENCRYPTED_LOGS_PER_TX = 64;
const size_t MAX_ENCRYPTED_LOGS_PER_TX = 8;
Expand Down
8 changes: 4 additions & 4 deletions l1-contracts/src/core/libraries/ConstantsGen.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ library Constants {
uint256 internal constant MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL = 16;
uint256 internal constant MAX_PUBLIC_DATA_READS_PER_CALL = 16;
uint256 internal constant MAX_NOTE_HASH_READ_REQUESTS_PER_CALL = 32;
uint256 internal constant MAX_NULLIFIER_READ_REQUESTS_PER_CALL = 2;
uint256 internal constant MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_CALL = 2;
uint256 internal constant MAX_NULLIFIER_READ_REQUESTS_PER_CALL = 32;
uint256 internal constant MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_CALL = 32;
uint256 internal constant MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_CALL = 16;
uint256 internal constant MAX_NOTE_ENCRYPTED_LOGS_PER_CALL = 16;
uint256 internal constant MAX_ENCRYPTED_LOGS_PER_CALL = 4;
Expand All @@ -37,8 +37,8 @@ library Constants {
uint256 internal constant MAX_PUBLIC_DATA_READS_PER_TX = 32;
uint256 internal constant MAX_NEW_L2_TO_L1_MSGS_PER_TX = 2;
uint256 internal constant MAX_NOTE_HASH_READ_REQUESTS_PER_TX = 128;
uint256 internal constant MAX_NULLIFIER_READ_REQUESTS_PER_TX = 8;
uint256 internal constant MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_TX = 8;
uint256 internal constant MAX_NULLIFIER_READ_REQUESTS_PER_TX = 128;
uint256 internal constant MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_TX = 128;
uint256 internal constant MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_TX = 64;
uint256 internal constant MAX_NOTE_ENCRYPTED_LOGS_PER_TX = 64;
uint256 internal constant MAX_ENCRYPTED_LOGS_PER_TX = 8;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,6 @@ fn empty_hash() {
let hash = item.hash();

// Value from private_call_stack_item.test.ts "computes empty item hash" test
let test_data_empty_hash = 0x23e9b31fb9659181d8e6d941e95cc88a6d4d43c6b6ee316351528db772f419c0;
let test_data_empty_hash = 0x11e550264f1840bab424389aa41ed8a5735c0aa8f94e41bd259caab964ff93dc;
assert_eq(hash, test_data_empty_hash);
}
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,6 @@ fn empty_hash() {
let inputs = PrivateCircuitPublicInputs::empty();
let hash = inputs.hash();
// Value from private_circuit_public_inputs.test.ts "computes empty item hash" test
let test_data_empty_hash = 0x04f513d6a85e9d0c994d3c3764732e4486264190b3bf285257f41180f09a0b58;
let test_data_empty_hash = 0x067b9bd773ae49145e07b395da4f156fb35972e77bd4c40ed980ea8c9b90dd64;
assert_eq(hash, test_data_empty_hash);
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ mod tests {
let call_stack_item = PublicCallStackItem { contract_address, public_inputs, is_execution_request: true, function_data };

// Value from public_call_stack_item.test.ts "Computes a callstack item request hash" test
let test_data_call_stack_item_request_hash = 0x23066ad690c088120f8397cfeb2ef5608d4517342c7ff9fcb713009933ef1c61;
let test_data_call_stack_item_request_hash = 0x11998b1d33b8ba1c8fa7a6c2f5bc76b31bbaa80400554465c335ba31559ac1f9;
assert_eq(call_stack_item.hash(), test_data_call_stack_item_request_hash);
}

Expand All @@ -87,7 +87,7 @@ mod tests {
let call_stack_item = PublicCallStackItem { contract_address, public_inputs, is_execution_request: false, function_data };

// Value from public_call_stack_item.test.ts "Computes a callstack item hash" test
let test_data_call_stack_item_hash = 0x1236612a9ec71bcc83af597d523f1d05df071565067bc23276a4e64b72882c22;
let test_data_call_stack_item_hash = 0x2b7f8b68d96d0011ecc576459899e9451fbd880568ccc7a071d9cf04e59abb65;
assert_eq(call_stack_item.hash(), test_data_call_stack_item_hash);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,6 @@ fn empty_hash() {
let hash = inputs.hash();

// Value from public_circuit_public_inputs.test.ts "computes empty item hash" test
let test_data_empty_hash = 0x048912d56248af479f8d7ecedbba7092d27741b10075a989e040f8e3242a7a3f;
let test_data_empty_hash = 0x1e4351db0c9aa20836e7009bc3e6a4555c92622c5e9cb3b49e2ec0fbbf59d0bd;
assert_eq(hash, test_data_empty_hash);
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ global MAX_NEW_L2_TO_L1_MSGS_PER_CALL: u64 = 2;
global MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL: u64 = 16;
global MAX_PUBLIC_DATA_READS_PER_CALL: u64 = 16;
global MAX_NOTE_HASH_READ_REQUESTS_PER_CALL: u64 = 32;
global MAX_NULLIFIER_READ_REQUESTS_PER_CALL: u64 = 2; // Change it to a larger value when there's a seperate reset circuit.
global MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_CALL: u64 = 2;
global MAX_NULLIFIER_READ_REQUESTS_PER_CALL: u64 = 32;
global MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_CALL: u64 = 32;
global MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_CALL: u64 = 16;
global MAX_NOTE_ENCRYPTED_LOGS_PER_CALL: u64 = 16;
global MAX_ENCRYPTED_LOGS_PER_CALL: u64 = 4; // If modifying, update DEPLOYER_CONTRACT_ADDRESS.
Expand All @@ -46,8 +46,8 @@ global MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX: u64 = 32;
global MAX_PUBLIC_DATA_READS_PER_TX: u64 = 32;
global MAX_NEW_L2_TO_L1_MSGS_PER_TX: u64 = 2;
global MAX_NOTE_HASH_READ_REQUESTS_PER_TX: u64 = 128;
global MAX_NULLIFIER_READ_REQUESTS_PER_TX: u64 = 8; // Change it to a larger value when there's a seperate reset circuit.
global MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_TX: u64 = 8;
global MAX_NULLIFIER_READ_REQUESTS_PER_TX: u64 = 128;
global MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_TX: u64 = 128;
global MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_TX: u64 = 64;
global MAX_NOTE_ENCRYPTED_LOGS_PER_TX: u64 = 64;
global MAX_ENCRYPTED_LOGS_PER_TX: u64 = 8;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use super::{
};
use acvm::{acir::brillig::MemoryAddress, FieldElement};

pub(crate) const MAX_STACK_SIZE: usize = 1024;
pub(crate) const MAX_STACK_SIZE: usize = 2048;

impl BrilligContext {
/// Creates an entry point artifact that will jump to the function label provided.
Expand Down
8 changes: 4 additions & 4 deletions yarn-project/circuits.js/src/constants.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ export const MAX_NEW_L2_TO_L1_MSGS_PER_CALL = 2;
export const MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL = 16;
export const MAX_PUBLIC_DATA_READS_PER_CALL = 16;
export const MAX_NOTE_HASH_READ_REQUESTS_PER_CALL = 32;
export const MAX_NULLIFIER_READ_REQUESTS_PER_CALL = 2;
export const MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_CALL = 2;
export const MAX_NULLIFIER_READ_REQUESTS_PER_CALL = 32;
export const MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_CALL = 32;
export const MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_CALL = 16;
export const MAX_NOTE_ENCRYPTED_LOGS_PER_CALL = 16;
export const MAX_ENCRYPTED_LOGS_PER_CALL = 4;
Expand All @@ -23,8 +23,8 @@ export const MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX = 32;
export const MAX_PUBLIC_DATA_READS_PER_TX = 32;
export const MAX_NEW_L2_TO_L1_MSGS_PER_TX = 2;
export const MAX_NOTE_HASH_READ_REQUESTS_PER_TX = 128;
export const MAX_NULLIFIER_READ_REQUESTS_PER_TX = 8;
export const MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_TX = 8;
export const MAX_NULLIFIER_READ_REQUESTS_PER_TX = 128;
export const MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_TX = 128;
export const MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_TX = 64;
export const MAX_NOTE_ENCRYPTED_LOGS_PER_TX = 64;
export const MAX_ENCRYPTED_LOGS_PER_TX = 8;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`PrivateCallStackItem computes empty item hash 1`] = `Fr<0x23e9b31fb9659181d8e6d941e95cc88a6d4d43c6b6ee316351528db772f419c0>`;
exports[`PrivateCallStackItem computes empty item hash 1`] = `Fr<0x11e550264f1840bab424389aa41ed8a5735c0aa8f94e41bd259caab964ff93dc>`;

exports[`PrivateCallStackItem computes hash 1`] = `Fr<0x03716c2dd42af2c14e1a871ef725775bd2ee0e7a606bb7882f15dc8cc49c2ad5>`;
exports[`PrivateCallStackItem computes hash 1`] = `Fr<0x17b804ce2f015fe4761c3f524103213bdc3033a2b226f5bf33637b0e7650b8ff>`;
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`PrivateCircuitPublicInputs computes empty inputs hash 1`] = `Fr<0x04f513d6a85e9d0c994d3c3764732e4486264190b3bf285257f41180f09a0b58>`;
exports[`PrivateCircuitPublicInputs computes empty inputs hash 1`] = `Fr<0x067b9bd773ae49145e07b395da4f156fb35972e77bd4c40ed980ea8c9b90dd64>`;

exports[`PrivateCircuitPublicInputs hash matches snapshot 1`] = `Fr<0x0e2af4cfdb7eb8df296c5ca7c88141f821ef45800bd240026f151f7fa7bebba6>`;
exports[`PrivateCircuitPublicInputs hash matches snapshot 1`] = `Fr<0x024619cfa41bf4ca35cec15ee5c7b90183f44711737bea9aef56c40602765dbb>`;
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`PublicCallStackItem Computes a callstack item hash 1`] = `"0x1236612a9ec71bcc83af597d523f1d05df071565067bc23276a4e64b72882c22"`;
exports[`PublicCallStackItem Computes a callstack item hash 1`] = `"0x2b7f8b68d96d0011ecc576459899e9451fbd880568ccc7a071d9cf04e59abb65"`;

exports[`PublicCallStackItem Computes a callstack item request hash 1`] = `"0x23066ad690c088120f8397cfeb2ef5608d4517342c7ff9fcb713009933ef1c61"`;
exports[`PublicCallStackItem Computes a callstack item request hash 1`] = `"0x11998b1d33b8ba1c8fa7a6c2f5bc76b31bbaa80400554465c335ba31559ac1f9"`;

exports[`PublicCallStackItem computes empty item hash 1`] = `Fr<0x0eef6f20d1f73de870f781dad46a843966eb560e2b684752c82cd2bd45f97a34>`;
exports[`PublicCallStackItem computes empty item hash 1`] = `Fr<0x2e7cef26b4ef88a036f6f2bc5bd5d7457b7c2851c7357f1e6f79be9fdde4cf77>`;

exports[`PublicCallStackItem computes hash 1`] = `Fr<0x14dc282fc24629bcc16eab0264ce0bfffc01e433f307e3578c89d95337bc42b3>`;
exports[`PublicCallStackItem computes hash 1`] = `Fr<0x025cc2b4f4105c6f39113d8544224901fbc23fde4d4c958d6c41907078b678bb>`;
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`PublicCircuitPublicInputs computes empty inputs hash 1`] = `Fr<0x048912d56248af479f8d7ecedbba7092d27741b10075a989e040f8e3242a7a3f>`;
exports[`PublicCircuitPublicInputs computes empty inputs hash 1`] = `Fr<0x1e4351db0c9aa20836e7009bc3e6a4555c92622c5e9cb3b49e2ec0fbbf59d0bd>`;

exports[`PublicCircuitPublicInputs hash matches snapshot 1`] = `Fr<0x28a405c25dfa4ae5823506f7ad48e804d81b9f0fa57dc8fc43fbc0f804ee4514>`;
exports[`PublicCircuitPublicInputs hash matches snapshot 1`] = `Fr<0x07eb8710b05470576d027ed77139ac6755324fb1a67da6c7669e837c4eab7dc2>`;

0 comments on commit a4f83d6

Please sign in to comment.