diff --git a/docs/docs/developers/contracts/references/storage/private_state.md b/docs/docs/developers/contracts/references/storage/private_state.md index 402e891ffa8..3e181bba649 100644 --- a/docs/docs/developers/contracts/references/storage/private_state.md +++ b/docs/docs/developers/contracts/references/storage/private_state.md @@ -226,7 +226,7 @@ An example of how to use this operation is visible in the `easy_private_state`: This function returns the notes the account has access to. -The kernel circuits are constrained to a maximum number of notes this function can return at a time. Check [here](https://github.com/AztecProtocol/aztec-packages/blob/#include_aztec_version/noir-projects/noir-protocol-circuits/crates/types/src/constants.nr) and look for `MAX_READ_REQUESTS_PER_CALL` for the up-to-date number. +The kernel circuits are constrained to a maximum number of notes this function can return at a time. Check [here](https://github.com/AztecProtocol/aztec-packages/blob/#include_aztec_version/noir-projects/noir-protocol-circuits/crates/types/src/constants.nr) and look for `MAX_NOTE_HASH_READ_REQUESTS_PER_CALL` for the up-to-date number. Because of this limit, we should always consider using the second argument `NoteGetterOptions` to limit the number of notes we need to read and constrain in our programs. This is quite important as every extra call increases the time used to prove the program and we don't want to spend more time than necessary. @@ -268,7 +268,7 @@ When the `limit` is set to a non-zero value, the data oracle will return a maxim This setting enables us to skip the first `offset` notes. It's particularly useful for pagination. -### `filter: fn ([Option; MAX_READ_REQUESTS_PER_CALL], FILTER_ARGS) -> [Option; MAX_READ_REQUESTS_PER_CALL]` +### `filter: fn ([Option; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL], FILTER_ARGS) -> [Option; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL]` Developers have the option to provide a custom filter. This allows specific logic to be applied to notes that meet the criteria outlined above. The filter takes the notes returned from the oracle and `filter_args` as its parameters. @@ -292,7 +292,7 @@ This function initializes a `NoteGetterOptions` that simply returns the maximum ### `fn with_filter(filter, filter_args) -> NoteGetterOptions` -This function initializes a `NoteGetterOptions` with a [`filter`](#filter-fn-optionnote-max_read_requests_per_call-filter_args---optionnote-max_read_requests_per_call) and [`filter_args`](#filter_args-filter_args). +This function initializes a `NoteGetterOptions` with a [`filter`](#filter-fn-optionnote-max_note_hash_read_requests_per_call-filter_args---optionnote-max_note_hash_read_requests_per_call) and [`filter_args`](#filter_args-filter_args). ### `.select` @@ -346,7 +346,7 @@ We can use it as a filter to further reduce the number of the final notes: One thing to remember is, `filter` will be applied on the notes after they are picked from the database, so it is more efficient to use select with comparators where possible. Another side effect of this is that it's possible that the actual notes we end up getting are fewer than the limit. -The limit is `MAX_READ_REQUESTS_PER_CALL` by default. But we can set it to any value **smaller** than that: +The limit is `MAX_NOTE_HASH_READ_REQUESTS_PER_CALL` by default. But we can set it to any value **smaller** than that: #include_code state_vars-NoteGetterOptionsPickOne /noir-projects/noir-contracts/contracts/docs_example_contract/src/options.nr rust diff --git a/l1-contracts/src/core/libraries/ConstantsGen.sol b/l1-contracts/src/core/libraries/ConstantsGen.sol index d0b7484d108..622bace99a5 100644 --- a/l1-contracts/src/core/libraries/ConstantsGen.sol +++ b/l1-contracts/src/core/libraries/ConstantsGen.sol @@ -23,7 +23,7 @@ library Constants { uint256 internal constant MAX_NEW_L2_TO_L1_MSGS_PER_CALL = 2; 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_READ_REQUESTS_PER_CALL = 32; + 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_KEY_VALIDATION_REQUESTS_PER_CALL = 1; uint256 internal constant MAX_NEW_NOTE_HASHES_PER_TX = 64; @@ -44,7 +44,7 @@ library Constants { uint256 internal constant MAX_REVERTIBLE_PUBLIC_DATA_READS_PER_TX = 16; uint256 internal constant MAX_NEW_L2_TO_L1_MSGS_PER_TX = 2; uint256 internal constant MAX_NEW_CONTRACTS_PER_TX = 1; - uint256 internal constant MAX_READ_REQUESTS_PER_TX = 128; + 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_KEY_VALIDATION_REQUESTS_PER_TX = 4; uint256 internal constant NUM_ENCRYPTED_LOGS_HASHES_PER_TX = 1; diff --git a/noir-projects/aztec-nr/aztec/src/context/private_context.nr b/noir-projects/aztec-nr/aztec/src/context/private_context.nr index 4e9642a63fa..7f6757f7455 100644 --- a/noir-projects/aztec-nr/aztec/src/context/private_context.nr +++ b/noir-projects/aztec-nr/aztec/src/context/private_context.nr @@ -1,7 +1,6 @@ use crate::{ context::{inputs::PrivateContextInputs, interface::ContextInterface}, - key::nullifier_key::validate_nullifier_key_against_address, - messaging::process_l1_to_l2_message, + key::nullifier_key::validate_nullifier_key_against_address, messaging::process_l1_to_l2_message, oracle::{ arguments, call_private_function::call_private_function_internal, enqueue_public_function_call::enqueue_public_function_call_internal, context::get_portal_address, @@ -11,21 +10,20 @@ use crate::{ }; use dep::protocol_types::{ abis::{ - call_context::CallContext, function_data::FunctionData, function_selector::FunctionSelector, - nullifier_key_validation_request::NullifierKeyValidationRequest, - private_call_stack_item::PrivateCallStackItem, - private_circuit_public_inputs::PrivateCircuitPublicInputs, - public_call_stack_item::PublicCallStackItem, - public_circuit_public_inputs::PublicCircuitPublicInputs, - read_request::ReadRequest, - side_effect::{SideEffect, SideEffectLinkedToNoteHash} - }, + call_context::CallContext, function_data::FunctionData, function_selector::FunctionSelector, + nullifier_key_validation_request::NullifierKeyValidationRequest, + private_call_stack_item::PrivateCallStackItem, + private_circuit_public_inputs::PrivateCircuitPublicInputs, + public_call_stack_item::PublicCallStackItem, + public_circuit_public_inputs::PublicCircuitPublicInputs, read_request::ReadRequest, + side_effect::{SideEffect, SideEffectLinkedToNoteHash} +}, address::{AztecAddress, EthAddress}, constants::{ MAX_NEW_NOTE_HASHES_PER_CALL, MAX_NEW_L2_TO_L1_MSGS_PER_CALL, MAX_NEW_NULLIFIERS_PER_CALL, MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL, MAX_PUBLIC_DATA_READS_PER_CALL, MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL, - MAX_READ_REQUESTS_PER_CALL, MAX_NULLIFIER_READ_REQUESTS_PER_CALL, + MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, MAX_NULLIFIER_READ_REQUESTS_PER_CALL, MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_CALL, NUM_FIELDS_PER_SHA256, RETURN_VALUES_LENGTH }, contrakt::{storage_read::StorageRead, storage_update_request::StorageUpdateRequest}, @@ -48,7 +46,7 @@ struct PrivateContext { args_hash : Field, return_values : BoundedVec, - read_requests: BoundedVec, + note_hash_read_requests: BoundedVec, nullifier_read_requests: BoundedVec, nullifier_key_validation_requests: BoundedVec, @@ -121,7 +119,7 @@ impl PrivateContext { min_revertible_side_effect_counter, args_hash, return_values: BoundedVec::new(), - read_requests: BoundedVec::new(), + note_hash_read_requests: BoundedVec::new(), nullifier_read_requests: BoundedVec::new(), nullifier_key_validation_requests: BoundedVec::new(), new_note_hashes: BoundedVec::new(), @@ -171,7 +169,7 @@ impl PrivateContext { // I've had to initialize the counter here so that it would work for contract deployments // the above checks should be doable after we figure out fee payments for contract deployments min_revertible_side_effect_counter: self.min_revertible_side_effect_counter, - read_requests: self.read_requests.storage, + note_hash_read_requests: self.note_hash_read_requests.storage, nullifier_read_requests: self.nullifier_read_requests.storage, nullifier_key_validation_requests: self.nullifier_key_validation_requests.storage, new_note_hashes: self.new_note_hashes.storage, @@ -196,9 +194,9 @@ impl PrivateContext { self.min_revertible_side_effect_counter = self.side_effect_counter; } - pub fn push_read_request(&mut self, read_request: Field) { - let side_effect = SideEffect { value: read_request, counter: self.side_effect_counter }; - self.read_requests.push(side_effect); + pub fn push_note_hash_read_request(&mut self, note_hash: Field) { + let side_effect = SideEffect { value: note_hash, counter: self.side_effect_counter }; + self.note_hash_read_requests.push(side_effect); self.side_effect_counter = self.side_effect_counter + 1; } diff --git a/noir-projects/aztec-nr/aztec/src/context/public_context.nr b/noir-projects/aztec-nr/aztec/src/context/public_context.nr index 9593c3e5919..810934586f9 100644 --- a/noir-projects/aztec-nr/aztec/src/context/public_context.nr +++ b/noir-projects/aztec-nr/aztec/src/context/public_context.nr @@ -1,7 +1,6 @@ use crate::{ - context::{inputs::PublicContextInputs, interface::ContextInterface}, - messaging::process_l1_to_l2_message, - oracle::{arguments, public_call::call_public_function_internal} + context::{inputs::PublicContextInputs, interface::ContextInterface}, + messaging::process_l1_to_l2_message, oracle::{arguments, public_call::call_public_function_internal} }; use dep::protocol_types::{ abis::{ @@ -15,8 +14,8 @@ use dep::protocol_types::{ constants::{ MAX_NEW_NOTE_HASHES_PER_CALL, MAX_NEW_L2_TO_L1_MSGS_PER_CALL, MAX_NEW_NULLIFIERS_PER_CALL, MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL, MAX_PUBLIC_DATA_READS_PER_CALL, - MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL, MAX_READ_REQUESTS_PER_CALL, NUM_FIELDS_PER_SHA256, - RETURN_VALUES_LENGTH + MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, + NUM_FIELDS_PER_SHA256, RETURN_VALUES_LENGTH }, contrakt::{storage_read::StorageRead, storage_update_request::StorageUpdateRequest}, hash::hash_args, header::Header, messaging::l2_to_l1_message::L2ToL1Message, utils::reader::Reader diff --git a/noir-projects/aztec-nr/aztec/src/note/note_getter.nr b/noir-projects/aztec-nr/aztec/src/note/note_getter.nr index 23237bb805f..a42e9f89318 100644 --- a/noir-projects/aztec-nr/aztec/src/note/note_getter.nr +++ b/noir-projects/aztec-nr/aztec/src/note/note_getter.nr @@ -1,7 +1,7 @@ use dep::std::option::Option; use dep::protocol_types::{ constants::{ - MAX_READ_REQUESTS_PER_CALL, GET_NOTE_ORACLE_RETURN_LENGTH, GET_NOTES_ORACLE_RETURN_LENGTH, + MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, GET_NOTE_ORACLE_RETURN_LENGTH, GET_NOTES_ORACLE_RETURN_LENGTH, MAX_NOTES_PER_PAGE, VIEW_NOTE_ORACLE_RETURN_LENGTH } }; @@ -75,7 +75,7 @@ pub fn get_note( let note_hash_for_read_request = compute_note_hash_for_consumption(note); - context.push_read_request(note_hash_for_read_request); + context.push_note_hash_read_request(note_hash_for_read_request); note } @@ -83,7 +83,7 @@ pub fn get_notes( context: &mut PrivateContext, storage_slot: Field, options: NoteGetterOptions -) -> [Option; MAX_READ_REQUESTS_PER_CALL] where Note: NoteInterface { +) -> [Option; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL] where Note: NoteInterface { let opt_notes = get_notes_internal(storage_slot, options); let mut num_notes = 0; let mut prev_fields = [0; N]; @@ -102,7 +102,7 @@ pub fn get_notes( let note_hash_for_read_request = compute_note_hash_for_consumption(note); // TODO(https://github.com/AztecProtocol/aztec-packages/issues/1410): test to ensure // failure if malicious oracle injects 0 nonce here for a "pre-existing" note. - context.push_read_request(note_hash_for_read_request); + context.push_note_hash_read_request(note_hash_for_read_request); num_notes += 1; }; @@ -137,9 +137,9 @@ unconstrained fn get_note_internal(storage_slot: Field) -> Note where N unconstrained fn get_notes_internal( storage_slot: Field, options: NoteGetterOptions -) -> [Option; MAX_READ_REQUESTS_PER_CALL] where Note: NoteInterface { +) -> [Option; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL] where Note: NoteInterface { let (num_selects, select_by, select_values, select_comparators, sort_by, sort_order) = flatten_options(options.selects, options.sorts); - let placeholder_opt_notes = [Option::none(); MAX_READ_REQUESTS_PER_CALL]; + let placeholder_opt_notes = [Option::none(); MAX_NOTE_HASH_READ_REQUESTS_PER_CALL]; let placeholder_fields = [0; GET_NOTES_ORACLE_RETURN_LENGTH]; let placeholder_note_length = [0; N]; let opt_notes = oracle::notes::get_notes( diff --git a/noir-projects/aztec-nr/aztec/src/note/note_getter_options.nr b/noir-projects/aztec-nr/aztec/src/note/note_getter_options.nr index 85b0f0d37ed..24c9a223ab4 100644 --- a/noir-projects/aztec-nr/aztec/src/note/note_getter_options.nr +++ b/noir-projects/aztec-nr/aztec/src/note/note_getter_options.nr @@ -1,5 +1,5 @@ use dep::std::option::Option; -use dep::protocol_types::{constants::MAX_READ_REQUESTS_PER_CALL}; +use dep::protocol_types::{constants::MAX_NOTE_HASH_READ_REQUESTS_PER_CALL}; use crate::note::note_interface::NoteInterface; struct ComparatorEnum { @@ -65,9 +65,9 @@ global NoteStatus = NoteStatusEnum { }; fn return_all_notes( - notes: [Option; MAX_READ_REQUESTS_PER_CALL], + notes: [Option; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL], _p: Field -) -> [Option; MAX_READ_REQUESTS_PER_CALL] { +) -> [Option; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL] { notes } @@ -77,7 +77,7 @@ struct NoteGetterOptions { sorts: BoundedVec, N>, limit: u32, offset: u32, - filter: fn ([Option; MAX_READ_REQUESTS_PER_CALL], FILTER_ARGS) -> [Option; MAX_READ_REQUESTS_PER_CALL], + filter: fn ([Option; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL], FILTER_ARGS) -> [Option; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL], filter_args: FILTER_ARGS, status: u8, } @@ -93,7 +93,7 @@ impl NoteGetterOptions { NoteGetterOptions { selects: BoundedVec::new(), sorts: BoundedVec::new(), - limit: MAX_READ_REQUESTS_PER_CALL as u32, + limit: MAX_NOTE_HASH_READ_REQUESTS_PER_CALL as u32, offset: 0, filter: return_all_notes, filter_args: 0, @@ -104,13 +104,13 @@ impl NoteGetterOptions { // This function initializes a NoteGetterOptions with a filter, which takes the notes returned from the database and filter_args as its parameters. // `filter_args` allows you to provide additional data or context to the custom filter. pub fn with_filter( - filter: fn([Option; MAX_READ_REQUESTS_PER_CALL], FILTER_ARGS) -> [Option; MAX_READ_REQUESTS_PER_CALL], + filter: fn([Option; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL], FILTER_ARGS) -> [Option; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL], filter_args: FILTER_ARGS ) -> Self where Note: NoteInterface { NoteGetterOptions { selects: BoundedVec::new(), sorts: BoundedVec::new(), - limit: MAX_READ_REQUESTS_PER_CALL as u32, + limit: MAX_NOTE_HASH_READ_REQUESTS_PER_CALL as u32, offset: 0, filter, filter_args, @@ -136,7 +136,7 @@ impl NoteGetterOptions { // This method lets you set a limit for the maximum number of notes to be retrieved in a single query result. pub fn set_limit(&mut self, limit: u32) -> Self { - assert(limit <= MAX_READ_REQUESTS_PER_CALL as u32); + assert(limit <= MAX_NOTE_HASH_READ_REQUESTS_PER_CALL as u32); self.limit = limit; *self } diff --git a/noir-projects/aztec-nr/aztec/src/state_vars/private_set.nr b/noir-projects/aztec-nr/aztec/src/state_vars/private_set.nr index 03d676f291f..ec0b254bb4b 100644 --- a/noir-projects/aztec-nr/aztec/src/state_vars/private_set.nr +++ b/noir-projects/aztec-nr/aztec/src/state_vars/private_set.nr @@ -1,6 +1,6 @@ use dep::std::option::Option; use dep::protocol_types::{ - constants::{MAX_NOTES_PER_PAGE, MAX_READ_REQUESTS_PER_CALL}, + constants::{MAX_NOTES_PER_PAGE, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL}, abis::side_effect::{SideEffect, SideEffectLinkedToNoteHash} }; use crate::context::{PrivateContext, PublicContext, Context}; @@ -63,7 +63,7 @@ impl PrivateSet { pub fn remove(self, note: Note) where Note: NoteInterface { let context = self.context.private.unwrap(); let note_hash = compute_note_hash_for_consumption(note); - let has_been_read = context.read_requests.any(|r: SideEffect| r.value == note_hash); + let has_been_read = context.note_hash_read_requests.any(|r: SideEffect| r.value == note_hash); assert(has_been_read, "Can only remove a note that has been read from the set."); destroy_note(context, note); @@ -74,7 +74,7 @@ impl PrivateSet { pub fn get_notes( self, options: NoteGetterOptions - ) -> [Option; MAX_READ_REQUESTS_PER_CALL] where Note: NoteInterface { + ) -> [Option; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL] where Note: NoteInterface { let storage_slot = self.storage_slot; let opt_notes = get_notes(self.context.private.unwrap(), storage_slot, options); opt_notes diff --git a/noir-projects/aztec-nr/value-note/src/filter.nr b/noir-projects/aztec-nr/value-note/src/filter.nr index 9d8a51a33bf..2621ffb49f9 100644 --- a/noir-projects/aztec-nr/value-note/src/filter.nr +++ b/noir-projects/aztec-nr/value-note/src/filter.nr @@ -1,12 +1,12 @@ use dep::std::option::Option; -use dep::aztec::protocol_types::constants::MAX_READ_REQUESTS_PER_CALL; +use dep::aztec::protocol_types::constants::MAX_NOTE_HASH_READ_REQUESTS_PER_CALL; use crate::value_note::ValueNote; pub fn filter_notes_min_sum( - notes: [Option; MAX_READ_REQUESTS_PER_CALL], + notes: [Option; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL], min_sum: Field -) -> [Option; MAX_READ_REQUESTS_PER_CALL] { - let mut selected = [Option::none(); MAX_READ_REQUESTS_PER_CALL]; +) -> [Option; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL] { + let mut selected = [Option::none(); MAX_NOTE_HASH_READ_REQUESTS_PER_CALL]; let mut sum = U128::from_integer(0); for i in 0..notes.len() { if notes[i].is_some() & (sum < U128::from_integer(min_sum)) { diff --git a/noir-projects/noir-contracts/contracts/card_game_contract/src/cards.nr b/noir-projects/noir-contracts/contracts/card_game_contract/src/cards.nr index cc41a36f6c8..59208aa986e 100644 --- a/noir-projects/noir-contracts/contracts/card_game_contract/src/cards.nr +++ b/noir-projects/noir-contracts/contracts/card_game_contract/src/cards.nr @@ -1,5 +1,5 @@ use dep::aztec::{ - protocol_types::{address::AztecAddress, constants::{MAX_NOTES_PER_PAGE, MAX_READ_REQUESTS_PER_CALL}}, + protocol_types::{address::AztecAddress, constants::{MAX_NOTES_PER_PAGE, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL}}, context::{PrivateContext, PublicContext, Context}, note::{ note_getter_options::NoteGetterOptions, note_viewer_options::NoteViewerOptions, @@ -66,10 +66,10 @@ struct Deck { } pub fn filter_cards( - notes: [Option; MAX_READ_REQUESTS_PER_CALL], + notes: [Option; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL], desired_cards: [Card; N] -) -> [Option; MAX_READ_REQUESTS_PER_CALL] { - let mut selected = [Option::none(); MAX_READ_REQUESTS_PER_CALL]; +) -> [Option; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL] { + let mut selected = [Option::none(); MAX_NOTE_HASH_READ_REQUESTS_PER_CALL]; let mut found = [false; N]; diff --git a/noir-projects/noir-contracts/contracts/docs_example_contract/src/options.nr b/noir-projects/noir-contracts/contracts/docs_example_contract/src/options.nr index d2f56953138..362828f7ce7 100644 --- a/noir-projects/noir-contracts/contracts/docs_example_contract/src/options.nr +++ b/noir-projects/noir-contracts/contracts/docs_example_contract/src/options.nr @@ -1,5 +1,5 @@ use crate::types::card_note::{CardNote, CARD_NOTE_LEN}; -use dep::aztec::protocol_types::{address::AztecAddress, constants::MAX_READ_REQUESTS_PER_CALL}; +use dep::aztec::protocol_types::{address::AztecAddress, constants::MAX_NOTE_HASH_READ_REQUESTS_PER_CALL}; use dep::aztec::note::note_getter_options::{NoteGetterOptions, Sort, SortOrder}; use dep::std::option::Option; @@ -26,10 +26,10 @@ pub fn create_exact_card_getter_options( // docs:start:state_vars-OptionFilter pub fn filter_min_points( - cards: [Option; MAX_READ_REQUESTS_PER_CALL], + cards: [Option; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL], min_points: u8 -) -> [Option; MAX_READ_REQUESTS_PER_CALL] { - let mut selected_cards = [Option::none(); MAX_READ_REQUESTS_PER_CALL]; +) -> [Option; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL] { + let mut selected_cards = [Option::none(); MAX_NOTE_HASH_READ_REQUESTS_PER_CALL]; let mut num_selected = 0; for i in 0..cards.len() { if cards[i].is_some() & cards[i].unwrap_unchecked().points >= min_points { diff --git a/noir-projects/noir-contracts/contracts/test_contract/src/main.nr b/noir-projects/noir-contracts/contracts/test_contract/src/main.nr index e0386b0445a..1436bc95a6e 100644 --- a/noir-projects/noir-contracts/contracts/test_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/test_contract/src/main.nr @@ -4,7 +4,7 @@ contract Test { use dep::aztec::protocol_types::{ abis::private_circuit_public_inputs::PrivateCircuitPublicInputs, address::{AztecAddress, EthAddress}, - constants::{MAX_READ_REQUESTS_PER_CALL, MAX_NOTES_PER_PAGE}, hash::hash_args + constants::{MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, MAX_NOTES_PER_PAGE}, hash::hash_args }; // docs:start:unencrypted_import use dep::aztec::log::emit_unencrypted_log; @@ -14,10 +14,10 @@ contract Test { context::{Context, inputs::private_context_inputs::PrivateContextInputs}, hash::pedersen_hash, context::PrivateContext, note::{ - note_header::NoteHeader, utils as note_utils, lifecycle::{create_note, destroy_note}, - note_getter::{get_notes, view_notes}, note_getter_options::{NoteGetterOptions, NoteStatus}, - note_viewer_options::NoteViewerOptions - }, + note_header::NoteHeader, utils as note_utils, lifecycle::{create_note, destroy_note}, + note_getter::{get_notes, view_notes}, note_getter_options::{NoteGetterOptions, NoteStatus}, + note_viewer_options::NoteViewerOptions + }, deploy::{deploy_contract as aztec_deploy_contract}, oracle::{get_public_key::get_public_key as get_public_key_oracle, context::get_portal_address, rand::rand}, state_vars::PrivateImmutable, log::emit_unencrypted_log_from_private @@ -86,7 +86,7 @@ contract Test { options = options.set_status(NoteStatus.ACTIVE_OR_NULLIFIED); } - let opt_notes: [Option; MAX_READ_REQUESTS_PER_CALL] = get_notes(&mut context, storage_slot, options); + let opt_notes: [Option; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL] = get_notes(&mut context, storage_slot, options); // We can't get the return value of a private function from the outside world in an end to end test, so we // expose it via an unecrypted log instead. @@ -105,7 +105,7 @@ contract Test { options = options.set_status(NoteStatus.ACTIVE_OR_NULLIFIED); } - let opt_notes: [Option; MAX_READ_REQUESTS_PER_CALL] = get_notes(&mut context, storage_slot, options); + let opt_notes: [Option; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL] = get_notes(&mut context, storage_slot, options); // We can't get the return value of a private function from the outside world in an end to end test, so we // expose it via an unecrypted log instead. @@ -153,7 +153,7 @@ contract Test { ); let options = NoteGetterOptions::new(); - let opt_notes: [Option; MAX_READ_REQUESTS_PER_CALL] = get_notes(&mut context, storage_slot, options); + let opt_notes: [Option; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL] = get_notes(&mut context, storage_slot, options); let note = opt_notes[0].unwrap(); diff --git a/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/types/balances_map.nr b/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/types/balances_map.nr index c979e0f2769..95653508f0d 100644 --- a/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/types/balances_map.nr +++ b/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/types/balances_map.nr @@ -1,6 +1,7 @@ use dep::std::option::Option; use dep::aztec::{ - context::Context, protocol_types::{address::AztecAddress, constants::MAX_READ_REQUESTS_PER_CALL}, + context::Context, + protocol_types::{address::AztecAddress, constants::MAX_NOTE_HASH_READ_REQUESTS_PER_CALL}, state_vars::{PrivateSet, Map}, note::{ note_getter::view_notes, note_getter_options::{NoteGetterOptions, SortOrder}, @@ -101,10 +102,10 @@ impl BalancesMap { } pub fn filter_notes_min_sum( - notes: [Option; MAX_READ_REQUESTS_PER_CALL], + notes: [Option; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL], min_sum: U128 -) -> [Option; MAX_READ_REQUESTS_PER_CALL] where T: NoteInterface + OwnedNote { - let mut selected = [Option::none(); MAX_READ_REQUESTS_PER_CALL]; +) -> [Option; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL] where T: NoteInterface + OwnedNote { + let mut selected = [Option::none(); MAX_NOTE_HASH_READ_REQUESTS_PER_CALL]; let mut sum = U128::from_integer(0); for i in 0..notes.len() { if notes[i].is_some() & sum < min_sum { diff --git a/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/types/token_note.nr b/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/types/token_note.nr index 2b03bb3c7fd..c9233038f30 100644 --- a/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/types/token_note.nr +++ b/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/types/token_note.nr @@ -1,5 +1,5 @@ use dep::aztec::{ - protocol_types::{address::AztecAddress, constants::MAX_READ_REQUESTS_PER_CALL}, + protocol_types::address::AztecAddress, note::{note_header::NoteHeader, note_interface::NoteInterface, utils::compute_note_hash_for_consumption}, context::PrivateContext, log::emit_encrypted_log, hash::pedersen_hash }; diff --git a/noir-projects/noir-contracts/contracts/token_contract/src/types/balances_map.nr b/noir-projects/noir-contracts/contracts/token_contract/src/types/balances_map.nr index 8e84d308df1..740d328413f 100644 --- a/noir-projects/noir-contracts/contracts/token_contract/src/types/balances_map.nr +++ b/noir-projects/noir-contracts/contracts/token_contract/src/types/balances_map.nr @@ -1,7 +1,7 @@ use dep::std::option::Option; use dep::aztec::{ context::{PrivateContext, PublicContext, Context}, hash::pedersen_hash, - protocol_types::{address::AztecAddress, constants::MAX_READ_REQUESTS_PER_CALL}, + protocol_types::{address::AztecAddress, constants::MAX_NOTE_HASH_READ_REQUESTS_PER_CALL}, state_vars::{PrivateSet, Map}, note::{ note_getter::view_notes, note_getter_options::{NoteGetterOptions, SortOrder}, @@ -102,10 +102,10 @@ impl BalancesMap { } pub fn filter_notes_min_sum( - notes: [Option; MAX_READ_REQUESTS_PER_CALL], + notes: [Option; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL], min_sum: U128 -) -> [Option; MAX_READ_REQUESTS_PER_CALL] where T: NoteInterface + OwnedNote { - let mut selected = [Option::none(); MAX_READ_REQUESTS_PER_CALL]; +) -> [Option; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL] where T: NoteInterface + OwnedNote { + let mut selected = [Option::none(); MAX_NOTE_HASH_READ_REQUESTS_PER_CALL]; let mut sum = U128::from_integer(0); for i in 0..notes.len() { if notes[i].is_some() & sum < min_sum { diff --git a/noir-projects/noir-contracts/contracts/token_contract/src/types/token_note.nr b/noir-projects/noir-contracts/contracts/token_contract/src/types/token_note.nr index 2b03bb3c7fd..c9233038f30 100644 --- a/noir-projects/noir-contracts/contracts/token_contract/src/types/token_note.nr +++ b/noir-projects/noir-contracts/contracts/token_contract/src/types/token_note.nr @@ -1,5 +1,5 @@ use dep::aztec::{ - protocol_types::{address::AztecAddress, constants::MAX_READ_REQUESTS_PER_CALL}, + protocol_types::address::AztecAddress, note::{note_header::NoteHeader, note_interface::NoteInterface, utils::compute_note_hash_for_consumption}, context::PrivateContext, log::emit_encrypted_log, hash::pedersen_hash }; diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/common.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/common.nr index 3bba005f1c3..49076a1a403 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/common.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/common.nr @@ -3,7 +3,7 @@ use dep::types::{ abis::{ call_request::CallRequest, accumulated_data::CombinedAccumulatedData, function_data::FunctionData, kernel_circuit_public_inputs::PrivateKernelCircuitPublicInputsBuilder, - membership_witness::ReadRequestMembershipWitness, new_contract_data::NewContractData, + membership_witness::NoteHashReadRequestMembershipWitness, new_contract_data::NewContractData, private_circuit_public_inputs::PrivateCircuitPublicInputs, private_kernel::private_call_data::PrivateCallData, kernel_data::{PrivateKernelInnerData, PrivateKernelTailData}, @@ -13,7 +13,7 @@ use dep::types::{ contract_class_id::ContractClassId, contrakt::contract_deployment_data::ContractDeploymentData, constants::{ MAX_NEW_NULLIFIERS_PER_CALL, MAX_NEW_L2_TO_L1_MSGS_PER_CALL, MAX_NEW_NOTE_HASHES_PER_CALL, - MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, MAX_READ_REQUESTS_PER_CALL, + MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, MAX_NULLIFIER_READ_REQUESTS_PER_CALL, MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_CALL }, grumpkin_private_key::GrumpkinPrivateKey, @@ -34,7 +34,7 @@ pub fn validate_arrays(app_public_inputs: PrivateCircuitPublicInputs) { // to extend_from_array_to_array() routines which rely on the passed arrays to be well-formed. validate_array(app_public_inputs.return_values); - validate_array(app_public_inputs.read_requests); + validate_array(app_public_inputs.note_hash_read_requests); validate_array(app_public_inputs.nullifier_read_requests); validate_array(app_public_inputs.nullifier_key_validation_requests); validate_array(app_public_inputs.new_note_hashes); @@ -52,14 +52,14 @@ pub fn validate_arrays(app_public_inputs: PrivateCircuitPublicInputs) { // More info here: // - https://discourse.aztec.network/t/to-read-or-not-to-read/178 // - https://discourse.aztec.network/t/spending-notes-which-havent-yet-been-inserted/180 -pub fn validate_read_requests( +pub fn validate_note_hash_read_requests( historical_note_hash_tree_root: Field, - read_requests: [SideEffect; MAX_READ_REQUESTS_PER_CALL], - read_request_membership_witnesses: [ReadRequestMembershipWitness; MAX_READ_REQUESTS_PER_CALL] + read_requests: [SideEffect; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL], + read_request_membership_witnesses: [NoteHashReadRequestMembershipWitness; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL] ) { // membership witnesses must resolve to the same note hash tree root // for every request in all kernel iterations - for rr_idx in 0..MAX_READ_REQUESTS_PER_CALL { + for rr_idx in 0..MAX_NOTE_HASH_READ_REQUESTS_PER_CALL { let read_request = read_requests[rr_idx].value; let witness = read_request_membership_witnesses[rr_idx]; @@ -92,7 +92,7 @@ pub fn initialize_end_values( // functions within this circuit: let start = previous_kernel.public_inputs.end; - public_inputs.end.read_requests = array_to_bounded_vec(start.read_requests); + public_inputs.end.note_hash_read_requests = array_to_bounded_vec(start.note_hash_read_requests); public_inputs.end.nullifier_read_requests = array_to_bounded_vec(start.nullifier_read_requests); public_inputs.end.nullifier_key_validation_requests = array_to_bounded_vec(start.nullifier_key_validation_requests); @@ -180,10 +180,10 @@ pub fn update_end_values( // Transient read requests and witnesses are accumulated in public_inputs.end // We silo the read requests (domain separation per contract address) - let read_requests = private_call_public_inputs.read_requests; - let read_request_membership_witnesses = private_call.read_request_membership_witnesses; - let mut siloed_read_requests: BoundedVec = BoundedVec::new(); - for i in 0..MAX_READ_REQUESTS_PER_CALL { + let read_requests = private_call_public_inputs.note_hash_read_requests; + let read_request_membership_witnesses = private_call.note_hash_read_request_membership_witnesses; + let mut siloed_read_requests: BoundedVec = BoundedVec::new(); + for i in 0..MAX_NOTE_HASH_READ_REQUESTS_PER_CALL { let read_request = read_requests[i].value; let witness = read_request_membership_witnesses[i]; if witness.is_transient & (read_request != 0) { // only forward transient to public inputs @@ -192,7 +192,7 @@ pub fn update_end_values( ) } } - public_inputs.end.read_requests.extend_from_bounded_vec(siloed_read_requests); + public_inputs.end.note_hash_read_requests.extend_from_bounded_vec(siloed_read_requests); // Nullifier read request. let nullifier_read_requests = private_call_public_inputs.nullifier_read_requests; diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_init.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_init.nr index ad1d13c6153..6da43c3f9ba 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_init.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_init.nr @@ -90,10 +90,10 @@ impl PrivateKernelInitCircuitPrivateInputs { self.validate_this_private_call_against_tx_request(); // TODO: Do this in a reset circuit. - common::validate_read_requests( + common::validate_note_hash_read_requests( public_inputs.constants.historical_header.state.partial.note_hash_tree.root, - self.private_call.call_stack_item.public_inputs.read_requests, - self.private_call.read_request_membership_witnesses + self.private_call.call_stack_item.public_inputs.note_hash_read_requests, + self.private_call.note_hash_read_request_membership_witnesses ); // TODO(dbanks12): feels like update_end_values should happen after contract logic @@ -127,7 +127,7 @@ mod tests { side_effect::{SideEffect, SideEffectLinkedToNoteHash} }, address::{AztecAddress, EthAddress, compute_initialization_hash}, - constants::MAX_READ_REQUESTS_PER_CALL, grumpkin_point::GrumpkinPoint, + constants::MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, grumpkin_point::GrumpkinPoint, grumpkin_private_key::GrumpkinPrivateKey, hash::{compute_constructor_hash, compute_logs_hash, stdlib_recursion_verification_key_compress_native_vk}, messaging::l2_to_l1_message::L2ToL1Message, @@ -254,10 +254,10 @@ mod tests { } #[test(should_fail_with = "invalid array")] - fn input_validation_malformed_arrays_read_requests() { + fn input_validation_malformed_arrays_note_hash_read_requests() { let mut builder = PrivateKernelInitInputsBuilder::new_constructor(); - builder.private_call.public_inputs.read_requests.extend_from_array( + builder.private_call.public_inputs.note_hash_read_requests.extend_from_array( [ SideEffect { value: 0, counter: 0 }, SideEffect { value: 9123, counter: 1 } @@ -462,48 +462,48 @@ mod tests { } #[test(should_fail_with="note hash tree root mismatch")] - fn native_read_request_bad_request() { + fn native_note_hash_read_request_bad_request() { let mut builder = PrivateKernelInitInputsBuilder::new(); - builder.private_call.append_read_requests(2); + builder.private_call.append_note_hash_read_requests(2); // tweak read_request so it gives wrong root when paired with its sibling path - let read_request = builder.private_call.public_inputs.read_requests.pop(); - builder.private_call.public_inputs.read_requests.push(SideEffect { value: read_request.value + 1, counter: read_request.counter }); + let read_request = builder.private_call.public_inputs.note_hash_read_requests.pop(); + builder.private_call.public_inputs.note_hash_read_requests.push(SideEffect { value: read_request.value + 1, counter: read_request.counter }); builder.failed(); } #[test(should_fail_with="note hash tree root mismatch")] - fn native_read_request_bad_leaf_index() { + fn native_note_hash_read_request_bad_leaf_index() { let mut builder = PrivateKernelInitInputsBuilder::new(); - builder.private_call.append_read_requests(2); + builder.private_call.append_note_hash_read_requests(2); // tweak leaf index so it gives wrong root when paired with its request and sibling path - let mut read_request_membership_witness = builder.private_call.read_request_membership_witnesses.pop(); + let mut read_request_membership_witness = builder.private_call.note_hash_read_request_membership_witnesses.pop(); read_request_membership_witness.leaf_index += 1; - builder.private_call.read_request_membership_witnesses.push(read_request_membership_witness); + builder.private_call.note_hash_read_request_membership_witnesses.push(read_request_membership_witness); builder.failed(); } #[test(should_fail_with="note hash tree root mismatch")] - fn native_read_request_bad_sibling_path() { + fn native_note_hash_read_request_bad_sibling_path() { let mut builder = PrivateKernelInitInputsBuilder::new(); - builder.private_call.append_read_requests(2); + builder.private_call.append_note_hash_read_requests(2); // tweak sibling path so it gives wrong root when paired with its request - let mut read_request_membership_witness = builder.private_call.read_request_membership_witnesses.pop(); + let mut read_request_membership_witness = builder.private_call.note_hash_read_request_membership_witnesses.pop(); read_request_membership_witness.sibling_path[1] += 1; - builder.private_call.read_request_membership_witnesses.push(read_request_membership_witness); + builder.private_call.note_hash_read_request_membership_witnesses.push(read_request_membership_witness); builder.failed(); } #[test] - fn native_no_read_requests_works() { + fn native_no_note_hash_read_requests_works() { let mut builder = PrivateKernelInitInputsBuilder::new(); let public_inputs = builder.execute(); @@ -513,14 +513,14 @@ mod tests { assert_eq(public_inputs.end.new_nullifiers[0].value, builder.tx_request.hash()); // non-transient read requests are NOT forwarded - assert_eq(array_length(public_inputs.end.read_requests), 0); + assert_eq(array_length(public_inputs.end.note_hash_read_requests), 0); } #[test] - fn native_one_read_requests_works() { + fn native_one_note_hash_read_requests_works() { let mut builder = PrivateKernelInitInputsBuilder::new(); - builder.private_call.append_read_requests(1); + builder.private_call.append_note_hash_read_requests(1); let public_inputs = builder.execute(); @@ -529,14 +529,14 @@ mod tests { assert_eq(public_inputs.end.new_nullifiers[0].value, builder.tx_request.hash()); // non-transient read requests are NOT forwarded - assert_eq(array_length(public_inputs.end.read_requests), 0); + assert_eq(array_length(public_inputs.end.note_hash_read_requests), 0); } #[test] - fn native_two_read_requests_works() { + fn native_two_note_hash_read_requests_works() { let mut builder = PrivateKernelInitInputsBuilder::new(); - builder.private_call.append_read_requests(2); + builder.private_call.append_note_hash_read_requests(2); let public_inputs = builder.execute(); @@ -545,14 +545,14 @@ mod tests { assert_eq(public_inputs.end.new_nullifiers[0].value, builder.tx_request.hash()); // non-transient read requests are NOT forwarded - assert_eq(array_length(public_inputs.end.read_requests), 0); + assert_eq(array_length(public_inputs.end.note_hash_read_requests), 0); } #[test] - fn native_max_read_requests_works() { + fn native_max_note_hash_read_requests_works() { let mut builder = PrivateKernelInitInputsBuilder::new(); - builder.private_call.append_read_requests(MAX_READ_REQUESTS_PER_CALL); + builder.private_call.append_note_hash_read_requests(MAX_NOTE_HASH_READ_REQUESTS_PER_CALL); let public_inputs = builder.execute(); @@ -561,14 +561,14 @@ mod tests { assert_eq(public_inputs.end.new_nullifiers[0].value, builder.tx_request.hash()); // non-transient read requests are NOT forwarded - assert_eq(array_length(public_inputs.end.read_requests), 0); + assert_eq(array_length(public_inputs.end.note_hash_read_requests), 0); } #[test] - fn native_one_transient_read_requests_works() { + fn native_one_transient_note_hash_read_requests_works() { let mut builder = PrivateKernelInitInputsBuilder::new(); - builder.private_call.append_transient_read_requests(1); + builder.private_call.append_transient_note_hash_read_requests(1); let public_inputs = builder.execute(); @@ -577,15 +577,15 @@ mod tests { assert_eq(public_inputs.end.new_nullifiers[0].value, builder.tx_request.hash()); // non-transient read requests are NOT forwarded - assert_eq(array_length(public_inputs.end.read_requests), 1); + assert_eq(array_length(public_inputs.end.note_hash_read_requests), 1); } #[test] - fn native_max_read_requests_one_transient_works() { + fn native_max_note_hash_read_requests_one_transient_works() { let mut builder = PrivateKernelInitInputsBuilder::new(); - builder.private_call.append_transient_read_requests(1); - builder.private_call.append_read_requests(MAX_READ_REQUESTS_PER_CALL - 1); + builder.private_call.append_transient_note_hash_read_requests(1); + builder.private_call.append_note_hash_read_requests(MAX_NOTE_HASH_READ_REQUESTS_PER_CALL - 1); let public_inputs = builder.execute(); @@ -594,14 +594,14 @@ mod tests { assert_eq(public_inputs.end.new_nullifiers[0].value, builder.tx_request.hash()); // non-transient read requests are NOT forwarded - assert_eq(array_length(public_inputs.end.read_requests), 1); + assert_eq(array_length(public_inputs.end.note_hash_read_requests), 1); } #[test] - fn native_max_read_requests_all_transient_works() { + fn native_max_note_hash_read_requests_all_transient_works() { let mut builder = PrivateKernelInitInputsBuilder::new(); - builder.private_call.append_transient_read_requests(MAX_READ_REQUESTS_PER_CALL); + builder.private_call.append_transient_note_hash_read_requests(MAX_NOTE_HASH_READ_REQUESTS_PER_CALL); let public_inputs = builder.execute(); @@ -610,7 +610,9 @@ mod tests { assert_eq(public_inputs.end.new_nullifiers[0].value, builder.tx_request.hash()); // non-transient read requests are NOT forwarded - assert_eq(array_length(public_inputs.end.read_requests), MAX_READ_REQUESTS_PER_CALL); + assert_eq( + array_length(public_inputs.end.note_hash_read_requests), MAX_NOTE_HASH_READ_REQUESTS_PER_CALL + ); } #[test] diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_inner.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_inner.nr index e0c0659512d..4b2fd76d3b1 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_inner.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_inner.nr @@ -54,10 +54,10 @@ impl PrivateKernelInnerCircuitPrivateInputs { self.pop_and_validate_this_private_call_hash(&mut public_inputs); // TODO: Do this in a reset circuit. - common::validate_read_requests( + common::validate_note_hash_read_requests( public_inputs.constants.historical_header.state.partial.note_hash_tree.root, - self.private_call.call_stack_item.public_inputs.read_requests, // read requests from private call - self.private_call.read_request_membership_witnesses + self.private_call.call_stack_item.public_inputs.note_hash_read_requests, // read requests from private call + self.private_call.note_hash_read_request_membership_witnesses ); //TODO(David): feels like update_end_values should happen later @@ -86,7 +86,7 @@ impl PrivateKernelInnerCircuitPrivateInputs { mod tests { use crate::private_kernel_inner::PrivateKernelInnerCircuitPrivateInputs; - use dep::types::constants::{MAX_READ_REQUESTS_PER_CALL, MAX_NEW_NOTE_HASHES_PER_TX}; + use dep::types::constants::{MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, MAX_NEW_NOTE_HASHES_PER_TX}; use dep::types::{ abis::{ kernel_circuit_public_inputs::PrivateKernelInnerCircuitPublicInputs, @@ -442,7 +442,7 @@ mod tests { fn input_validation_malformed_arrays_read_requests() { let mut builder = PrivateKernelInnerInputsBuilder::new(); - builder.private_call.public_inputs.read_requests.extend_from_array( + builder.private_call.public_inputs.note_hash_read_requests.extend_from_array( [ SideEffect { value: 0, counter: 0 }, SideEffect { value: 9123, counter: 1 } @@ -551,51 +551,51 @@ mod tests { } #[test(should_fail_with="note hash tree root mismatch")] - fn native_read_request_bad_request() { + fn native_note_hash_read_request_bad_request() { let mut builder = PrivateKernelInnerInputsBuilder::new(); - builder.private_call.append_read_requests(2); + builder.private_call.append_note_hash_read_requests(2); // tweak read_request so it gives wrong root when paired with its sibling path - let read_request = builder.private_call.public_inputs.read_requests.pop(); - builder.private_call.public_inputs.read_requests.push(SideEffect { value: read_request.value + 1, counter: read_request.counter }); + let read_request = builder.private_call.public_inputs.note_hash_read_requests.pop(); + builder.private_call.public_inputs.note_hash_read_requests.push(SideEffect { value: read_request.value + 1, counter: read_request.counter }); builder.failed(); } #[test(should_fail_with="note hash tree root mismatch")] - fn native_read_request_bad_leaf_index() { + fn native_note_hash_read_request_bad_leaf_index() { let mut builder = PrivateKernelInnerInputsBuilder::new(); - builder.private_call.append_read_requests(2); + builder.private_call.append_note_hash_read_requests(2); // Tweak leaf index so it gives wrong root when paired with its request and sibling path. - let mut read_request_membership_witness = builder.private_call.read_request_membership_witnesses.pop(); + let mut read_request_membership_witness = builder.private_call.note_hash_read_request_membership_witnesses.pop(); read_request_membership_witness.leaf_index += 1; - builder.private_call.read_request_membership_witnesses.push(read_request_membership_witness); + builder.private_call.note_hash_read_request_membership_witnesses.push(read_request_membership_witness); builder.failed(); } #[test(should_fail_with="note hash tree root mismatch")] - fn native_read_request_bad_sibling_path() { + fn native_note_hash_read_request_bad_sibling_path() { let mut builder = PrivateKernelInnerInputsBuilder::new(); - builder.private_call.append_read_requests(2); + builder.private_call.append_note_hash_read_requests(2); // Tweak the sibling path of the second read so it gives wrong root when paired with its request. - let mut read_request_membership_witness = builder.private_call.read_request_membership_witnesses.pop(); + let mut read_request_membership_witness = builder.private_call.note_hash_read_request_membership_witnesses.pop(); read_request_membership_witness.sibling_path[1] += 1; - builder.private_call.read_request_membership_witnesses.push(read_request_membership_witness); + builder.private_call.note_hash_read_request_membership_witnesses.push(read_request_membership_witness); builder.failed(); } #[test(should_fail_with="note hash tree root mismatch")] - fn native_read_request_root_mismatch() { + fn native_note_hash_read_request_root_mismatch() { let mut builder = PrivateKernelInnerInputsBuilder::new(); - builder.private_call.append_read_requests(1); + builder.private_call.append_note_hash_read_requests(1); // Set the root to be a different root so the above read request is not under this root. let old_root = builder.previous_kernel.historical_header.state.partial.note_hash_tree.root; @@ -605,89 +605,91 @@ mod tests { } #[test] - fn native_no_read_requests_works() { + fn native_no_note_hash_read_requests_works() { let mut builder = PrivateKernelInnerInputsBuilder::new(); - assert_eq(builder.private_call.public_inputs.read_requests.len(), 0); + assert_eq(builder.private_call.public_inputs.note_hash_read_requests.len(), 0); let public_inputs = builder.execute(); // non-transient read requests are NOT forwarded - assert_eq(array_length(public_inputs.end.read_requests), 0); + assert_eq(array_length(public_inputs.end.note_hash_read_requests), 0); } #[test] - fn native_one_read_requests_works() { + fn native_one_note_hash_read_requests_works() { let mut builder = PrivateKernelInnerInputsBuilder::new(); - builder.private_call.append_read_requests(1); + builder.private_call.append_note_hash_read_requests(1); let public_inputs = builder.execute(); // non-transient read requests are NOT forwarded - assert_eq(array_length(public_inputs.end.read_requests), 0); + assert_eq(array_length(public_inputs.end.note_hash_read_requests), 0); } #[test] - fn native_two_read_requests_works() { + fn native_two_note_hash_read_requests_works() { let mut builder = PrivateKernelInnerInputsBuilder::new(); - builder.private_call.append_read_requests(2); + builder.private_call.append_note_hash_read_requests(2); let public_inputs = builder.execute(); // non-transient read requests are NOT forwarded - assert_eq(array_length(public_inputs.end.read_requests), 0); + assert_eq(array_length(public_inputs.end.note_hash_read_requests), 0); } #[test] - fn native_max_read_requests_works() { + fn native_max_note_hash_read_requests_works() { let mut builder = PrivateKernelInnerInputsBuilder::new(); - builder.private_call.append_read_requests(MAX_READ_REQUESTS_PER_CALL); + builder.private_call.append_note_hash_read_requests(MAX_NOTE_HASH_READ_REQUESTS_PER_CALL); let public_inputs = builder.execute(); // non-transient read requests are NOT forwarded - assert_eq(array_length(public_inputs.end.read_requests), 0); + assert_eq(array_length(public_inputs.end.note_hash_read_requests), 0); } #[test] - fn native_one_transient_read_requests_works() { + fn native_one_transient_note_hash_read_requests_works() { let mut builder = PrivateKernelInnerInputsBuilder::new(); - builder.private_call.append_transient_read_requests(1); + builder.private_call.append_transient_note_hash_read_requests(1); let public_inputs = builder.execute(); // non-transient read requests are NOT forwarded - assert_eq(array_length(public_inputs.end.read_requests), 1); + assert_eq(array_length(public_inputs.end.note_hash_read_requests), 1); } #[test] - fn native_max_read_requests_one_transient_works() { + fn native_max_note_hash_read_requests_one_transient_works() { let mut builder = PrivateKernelInnerInputsBuilder::new(); - builder.private_call.append_read_requests(1); - builder.private_call.append_transient_read_requests(1); - builder.private_call.append_read_requests(MAX_READ_REQUESTS_PER_CALL - 2); + builder.private_call.append_note_hash_read_requests(1); + builder.private_call.append_transient_note_hash_read_requests(1); + builder.private_call.append_note_hash_read_requests(MAX_NOTE_HASH_READ_REQUESTS_PER_CALL - 2); let public_inputs = builder.execute(); // non-transient read requests are NOT forwarded - assert_eq(array_length(public_inputs.end.read_requests), 1); + assert_eq(array_length(public_inputs.end.note_hash_read_requests), 1); } #[test] - fn native_max_read_requests_all_transient_works() { + fn native_max_note_hash_read_requests_all_transient_works() { let mut builder = PrivateKernelInnerInputsBuilder::new(); - builder.private_call.append_transient_read_requests(MAX_READ_REQUESTS_PER_CALL); + builder.private_call.append_transient_note_hash_read_requests(MAX_NOTE_HASH_READ_REQUESTS_PER_CALL); let public_inputs = builder.execute(); // non-transient read requests are NOT forwarded - assert_eq(array_length(public_inputs.end.read_requests), MAX_READ_REQUESTS_PER_CALL); + assert_eq( + array_length(public_inputs.end.note_hash_read_requests), MAX_NOTE_HASH_READ_REQUESTS_PER_CALL + ); } #[test] diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_tail.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_tail.nr index ffe0a1d5c0e..1787a725bc3 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_tail.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_tail.nr @@ -12,7 +12,7 @@ use dep::types::{ side_effect::{SideEffect, SideEffectLinkedToNoteHash, Ordered} }, constants::{ - MAX_NEW_NOTE_HASHES_PER_TX, MAX_NEW_NULLIFIERS_PER_TX, MAX_READ_REQUESTS_PER_TX, + MAX_NEW_NOTE_HASHES_PER_TX, MAX_NEW_NULLIFIERS_PER_TX, MAX_NOTE_HASH_READ_REQUESTS_PER_TX, MAX_NULLIFIER_READ_REQUESTS_PER_TX, MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_TX, MAX_PUBLIC_CALL_STACK_LENGTH_PER_TX, MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX }, @@ -25,7 +25,7 @@ struct PrivateKernelTailCircuitPrivateInputs { previous_kernel: PrivateKernelInnerData, sorted_new_note_hashes: [SideEffect; MAX_NEW_NOTE_HASHES_PER_TX], sorted_new_note_hashes_indexes: [u64; MAX_NEW_NOTE_HASHES_PER_TX], - read_commitment_hints: [u64; MAX_READ_REQUESTS_PER_TX], + read_commitment_hints: [u64; MAX_NOTE_HASH_READ_REQUESTS_PER_TX], sorted_new_nullifiers: [SideEffectLinkedToNoteHash; MAX_NEW_NULLIFIERS_PER_TX], sorted_new_nullifiers_indexes: [u64; MAX_NEW_NULLIFIERS_PER_TX], nullifier_read_request_reset_hints: NullifierReadRequestResetHints, @@ -89,10 +89,10 @@ impl PrivateKernelTailCircuitPrivateInputs { fn match_reads_to_commitments(self, public_inputs: &mut PrivateKernelCircuitPublicInputsBuilder) { let new_note_hashes = public_inputs.end.new_note_hashes; - let read_requests = public_inputs.end.read_requests; + let read_requests = public_inputs.end.note_hash_read_requests; // match reads to commitments from the previous call(s) - for rr_idx in 0..MAX_READ_REQUESTS_PER_TX { + for rr_idx in 0..MAX_NOTE_HASH_READ_REQUESTS_PER_TX { let read_request = read_requests.get_unchecked(rr_idx); let read_commitment_hint = self.read_commitment_hints[rr_idx] as u64; @@ -106,7 +106,7 @@ impl PrivateKernelTailCircuitPrivateInputs { } // Empty out read requests after matching them to commitments - public_inputs.end.read_requests = BoundedVec::new(); + public_inputs.end.note_hash_read_requests = BoundedVec::new(); } fn assert_sorted_counters( @@ -266,7 +266,7 @@ mod tests { read_request_reset::{PendingReadHint, ReadRequestState, ReadRequestStatus} }; use dep::types::constants::{ - MAX_READ_REQUESTS_PER_TX, MAX_NEW_NOTE_HASHES_PER_TX, MAX_NEW_NULLIFIERS_PER_TX, + MAX_NOTE_HASH_READ_REQUESTS_PER_TX, MAX_NEW_NOTE_HASHES_PER_TX, MAX_NEW_NULLIFIERS_PER_TX, MAX_NULLIFIER_READ_REQUESTS_PER_TX, MAX_NON_REVERTIBLE_NOTE_HASHES_PER_TX, MAX_REVERTIBLE_NOTE_HASHES_PER_TX }; @@ -281,7 +281,7 @@ mod tests { struct PrivateKernelTailInputsBuilder { previous_kernel: PreviousKernelDataBuilder, - read_commitment_hints: [u64; MAX_READ_REQUESTS_PER_TX], + read_commitment_hints: [u64; MAX_NOTE_HASH_READ_REQUESTS_PER_TX], nullifier_commitment_hints: [u64; MAX_NEW_NULLIFIERS_PER_TX], nullifier_read_request_reset_hints_builder: NullifierReadRequestResetHintsBuilder, } @@ -290,7 +290,7 @@ mod tests { pub fn new() -> Self { PrivateKernelTailInputsBuilder { previous_kernel: PreviousKernelDataBuilder::new(false), - read_commitment_hints: [0; MAX_READ_REQUESTS_PER_TX], + read_commitment_hints: [0; MAX_NOTE_HASH_READ_REQUESTS_PER_TX], nullifier_commitment_hints: [0; MAX_NEW_NULLIFIERS_PER_TX], nullifier_read_request_reset_hints_builder: NullifierReadRequestResetHintsBuilder::new(MAX_NULLIFIER_READ_REQUESTS_PER_TX) } @@ -372,7 +372,7 @@ mod tests { pub fn execute(&mut self) -> PrivateKernelTailCircuitPublicInputs { let (sorted_new_note_hashes, sorted_new_note_hashes_indexes) = PrivateKernelTailInputsBuilder::sort_sideffects(self.get_new_note_hashes()); - let mut sorted_read_commitment_hints = [0; MAX_READ_REQUESTS_PER_TX]; + let mut sorted_read_commitment_hints = [0; MAX_NOTE_HASH_READ_REQUESTS_PER_TX]; for i in 0..sorted_read_commitment_hints.len() { sorted_read_commitment_hints[i] = sorted_new_note_hashes_indexes[self.read_commitment_hints[i]]; } @@ -454,8 +454,8 @@ mod tests { builder.append_transient_commitments(1); builder.add_transient_read(0); // Tweak the read request so that it does not match the hash at index 0; - let read_request = builder.previous_kernel.end.read_requests.pop(); - builder.previous_kernel.end.read_requests.push(SideEffect { value: read_request.value + 1, counter: 0 }); + let read_request = builder.previous_kernel.end.note_hash_read_requests.pop(); + builder.previous_kernel.end.note_hash_read_requests.push(SideEffect { value: read_request.value + 1, counter: 0 }); builder.failed(); } diff --git a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/public_kernel_app_logic.nr b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/public_kernel_app_logic.nr index 8fb3ddf3c57..7337baaa409 100644 --- a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/public_kernel_app_logic.nr +++ b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/public_kernel_app_logic.nr @@ -213,7 +213,7 @@ mod tests { builder.previous_kernel.append_public_data_read_requests(2); let previous = builder.previous_kernel.end.public_data_reads.storage; // Setup 2 data reads on the current public inputs. - builder.public_call.append_read_requests(2); + builder.public_call.append_public_data_read_requests(2); let current = builder.get_current_public_data_reads(); let public_data_read_requests = [previous[0], previous[1], current[0], current[1]]; let public_inputs = builder.execute(); @@ -400,7 +400,7 @@ mod tests { let storage = builder.get_current_public_data_update_requests(); let update_requests = [storage[0], storage[1]]; - builder.public_call.append_read_requests(3); + builder.public_call.append_public_data_read_requests(3); let storage = builder.get_current_public_data_reads(); let read_requests = [storage[0], storage[1], storage[2]]; diff --git a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/public_kernel_setup.nr b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/public_kernel_setup.nr index d169e044db8..7e0df945db1 100644 --- a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/public_kernel_setup.nr +++ b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/public_kernel_setup.nr @@ -171,9 +171,9 @@ mod tests { #[test] fn only_valid_public_data_reads_should_be_propagated() { let mut builder = PublicKernelSetupCircuitPrivateInputsBuilder::new(); - builder.public_call.append_read_requests(1); - builder.public_call.append_empty_read_requests(1); - builder.public_call.append_read_requests(1); + builder.public_call.append_public_data_read_requests(1); + builder.public_call.append_empty_public_data_read_requests(1); + builder.public_call.append_public_data_read_requests(1); let _ = builder.get_current_public_data_reads(); let _ = builder.execute(); @@ -414,7 +414,7 @@ mod tests { let storage = builder.get_current_public_data_update_requests(); let update_requests = [storage[0], storage[1]]; - builder.public_call.append_read_requests(3); + builder.public_call.append_public_data_read_requests(3); let storage = builder.get_current_public_data_reads(); let read_requests = [storage[0], storage[1], storage[2]]; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/accumulated_revertible_data_builder.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/accumulated_revertible_data_builder.nr index 7bb03a0ffaa..5ecd302a8a8 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/accumulated_revertible_data_builder.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/accumulated_revertible_data_builder.nr @@ -11,7 +11,7 @@ use crate::{ } }; use crate::constants::{ - MAX_READ_REQUESTS_PER_TX, MAX_NULLIFIER_READ_REQUESTS_PER_TX, + MAX_NOTE_HASH_READ_REQUESTS_PER_TX, MAX_NULLIFIER_READ_REQUESTS_PER_TX, MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_TX, MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX, MAX_NEW_L2_TO_L1_MSGS_PER_TX, MAX_NEW_CONTRACTS_PER_TX, NUM_FIELDS_PER_SHA256, MAX_REVERTIBLE_NOTE_HASHES_PER_TX, MAX_REVERTIBLE_NULLIFIERS_PER_TX, @@ -20,7 +20,7 @@ use crate::constants::{ }; struct AccumulatedRevertibleDataBuilder { - read_requests: BoundedVec, + note_hash_read_requests: BoundedVec, nullifier_read_requests: BoundedVec, nullifier_key_validation_requests: BoundedVec, @@ -63,7 +63,7 @@ impl AccumulatedRevertibleDataBuilder { pub fn to_public(self) -> PublicAccumulatedRevertibleData { PublicAccumulatedRevertibleData { - read_requests: self.read_requests.storage, + note_hash_read_requests: self.note_hash_read_requests.storage, nullifier_read_requests: self.nullifier_read_requests.storage, new_note_hashes: self.new_note_hashes.storage, nullifier_key_validation_requests: self.nullifier_key_validation_requests.storage, diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/combined_accumulated_data.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/combined_accumulated_data.nr index 7e4c3553ced..7ce04e9e935 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/combined_accumulated_data.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/combined_accumulated_data.nr @@ -11,7 +11,7 @@ use crate::{ } }; use crate::constants::{ - MAX_READ_REQUESTS_PER_TX, MAX_NULLIFIER_READ_REQUESTS_PER_TX, + MAX_NOTE_HASH_READ_REQUESTS_PER_TX, MAX_NULLIFIER_READ_REQUESTS_PER_TX, MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_TX, MAX_NEW_NOTE_HASHES_PER_TX, MAX_NEW_NULLIFIERS_PER_TX, MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX, MAX_PUBLIC_CALL_STACK_LENGTH_PER_TX, MAX_NEW_L2_TO_L1_MSGS_PER_TX, MAX_NEW_CONTRACTS_PER_TX, MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, @@ -29,7 +29,7 @@ use crate::traits::is_empty; use crate::utils::arrays::{array_cp, array_concat, array_to_bounded_vec}; struct CombinedAccumulatedData { - read_requests: [SideEffect; MAX_READ_REQUESTS_PER_TX], + note_hash_read_requests: [SideEffect; MAX_NOTE_HASH_READ_REQUESTS_PER_TX], nullifier_read_requests: [ReadRequestContext; MAX_NULLIFIER_READ_REQUESTS_PER_TX], nullifier_key_validation_requests: [NullifierKeyValidationRequestContext; MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_TX], @@ -66,7 +66,7 @@ impl CombinedAccumulatedData { revertible: PublicAccumulatedRevertibleData ) -> CombinedAccumulatedData { CombinedAccumulatedData { - read_requests: revertible.read_requests, + note_hash_read_requests: revertible.note_hash_read_requests, nullifier_read_requests: revertible.nullifier_read_requests, nullifier_key_validation_requests: revertible.nullifier_key_validation_requests, new_note_hashes: array_concat(non_revertible.new_note_hashes, revertible.new_note_hashes), diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/combined_accumulated_data_builder.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/combined_accumulated_data_builder.nr index e1c257d5f86..d949da09d6a 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/combined_accumulated_data_builder.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/combined_accumulated_data_builder.nr @@ -16,7 +16,7 @@ use crate::{ } }; use crate::constants::{ - MAX_READ_REQUESTS_PER_TX, MAX_NULLIFIER_READ_REQUESTS_PER_TX, + MAX_NOTE_HASH_READ_REQUESTS_PER_TX, MAX_NULLIFIER_READ_REQUESTS_PER_TX, MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_TX, MAX_NEW_NOTE_HASHES_PER_TX, MAX_NEW_NULLIFIERS_PER_TX, MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX, MAX_PUBLIC_CALL_STACK_LENGTH_PER_TX, MAX_NEW_L2_TO_L1_MSGS_PER_TX, MAX_NEW_CONTRACTS_PER_TX, MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, @@ -34,7 +34,7 @@ use crate::traits::is_empty; use crate::utils::arrays::{array_cp, array_concat, array_to_bounded_vec}; struct CombinedAccumulatedDataBuilder { - read_requests: BoundedVec, + note_hash_read_requests: BoundedVec, nullifier_read_requests: BoundedVec, nullifier_key_validation_requests: BoundedVec, @@ -66,7 +66,7 @@ impl CombinedAccumulatedDataBuilder { revertible: PublicAccumulatedRevertibleData ) -> CombinedAccumulatedDataBuilder { CombinedAccumulatedDataBuilder { - read_requests: array_to_bounded_vec(revertible.read_requests), + note_hash_read_requests: array_to_bounded_vec(revertible.note_hash_read_requests), nullifier_read_requests: array_to_bounded_vec(revertible.nullifier_read_requests), nullifier_key_validation_requests: array_to_bounded_vec(revertible.nullifier_key_validation_requests), new_note_hashes: array_to_bounded_vec(array_concat(non_revertible.new_note_hashes, revertible.new_note_hashes)), @@ -101,7 +101,7 @@ impl CombinedAccumulatedDataBuilder { pub fn finish(self) -> CombinedAccumulatedData { CombinedAccumulatedData { - read_requests: self.read_requests.storage, + note_hash_read_requests: self.note_hash_read_requests.storage, nullifier_read_requests: self.nullifier_read_requests.storage, nullifier_key_validation_requests: self.nullifier_key_validation_requests.storage, new_note_hashes: self.new_note_hashes.storage, @@ -136,7 +136,7 @@ impl CombinedAccumulatedDataBuilder { pub fn to_public_accumulated_revertible_data(self) -> PublicAccumulatedRevertibleData { PublicAccumulatedRevertibleData { - read_requests: self.read_requests.storage, + note_hash_read_requests: self.note_hash_read_requests.storage, nullifier_read_requests: self.nullifier_read_requests.storage, nullifier_key_validation_requests: self.nullifier_key_validation_requests.storage, new_note_hashes: array_cp(self.new_note_hashes.storage), diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/public_accumulated_revertible_data.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/public_accumulated_revertible_data.nr index 5cdf2ac95e8..1f64f37bb3f 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/public_accumulated_revertible_data.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/public_accumulated_revertible_data.nr @@ -7,7 +7,7 @@ use crate::{ } }; use crate::constants::{ - MAX_READ_REQUESTS_PER_TX, MAX_NULLIFIER_READ_REQUESTS_PER_TX, + MAX_NOTE_HASH_READ_REQUESTS_PER_TX, MAX_NULLIFIER_READ_REQUESTS_PER_TX, MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_TX, MAX_REVERTIBLE_NOTE_HASHES_PER_TX, MAX_REVERTIBLE_NULLIFIERS_PER_TX, MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX, MAX_REVERTIBLE_PUBLIC_CALL_STACK_LENGTH_PER_TX, MAX_NEW_L2_TO_L1_MSGS_PER_TX, NUM_FIELDS_PER_SHA256, @@ -16,7 +16,7 @@ use crate::constants::{ }; struct PublicAccumulatedRevertibleData { - read_requests: [SideEffect; MAX_READ_REQUESTS_PER_TX], + note_hash_read_requests: [SideEffect; MAX_NOTE_HASH_READ_REQUESTS_PER_TX], nullifier_read_requests: [ReadRequestContext; MAX_NULLIFIER_READ_REQUESTS_PER_TX], nullifier_key_validation_requests: [NullifierKeyValidationRequestContext; MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_TX], diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/membership_witness.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/membership_witness.nr index 68781ba8e8e..443efeaf108 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/membership_witness.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/membership_witness.nr @@ -42,7 +42,7 @@ struct ArchiveRootMembershipWitness{ sibling_path: [Field; ARCHIVE_HEIGHT] } -struct ReadRequestMembershipWitness { +struct NoteHashReadRequestMembershipWitness { leaf_index: Field, sibling_path: [Field; NOTE_HASH_TREE_HEIGHT], // whether or not the read request corresponds to a pending note hash diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_circuit_public_inputs.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_circuit_public_inputs.nr index 3f2a4243501..a36c0e4d4bd 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_circuit_public_inputs.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_circuit_public_inputs.nr @@ -4,7 +4,7 @@ use crate::{ read_request::ReadRequest, side_effect::{SideEffect, SideEffectLinkedToNoteHash} }, constants::{ - MAX_READ_REQUESTS_PER_CALL, MAX_NULLIFIER_READ_REQUESTS_PER_CALL, + MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, MAX_NULLIFIER_READ_REQUESTS_PER_CALL, MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_CALL, MAX_NEW_NOTE_HASHES_PER_CALL, MAX_NEW_NULLIFIERS_PER_CALL, MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL, MAX_NEW_L2_TO_L1_MSGS_PER_CALL, NUM_FIELDS_PER_SHA256, @@ -24,7 +24,7 @@ struct PrivateCircuitPublicInputs { min_revertible_side_effect_counter: u32, - read_requests: [SideEffect; MAX_READ_REQUESTS_PER_CALL], + note_hash_read_requests: [SideEffect; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL], nullifier_read_requests: [ReadRequest; MAX_NULLIFIER_READ_REQUESTS_PER_CALL], nullifier_key_validation_requests: [NullifierKeyValidationRequest; MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_CALL], @@ -60,7 +60,7 @@ impl Eq for PrivateCircuitPublicInputs { self.call_context.eq(other.call_context) & self.args_hash.eq(other.args_hash) & (self.return_values == other.return_values) & - (self.read_requests == other.read_requests) & + (self.note_hash_read_requests == other.note_hash_read_requests) & (self.nullifier_read_requests == other.nullifier_read_requests) & (self.nullifier_key_validation_requests == other.nullifier_key_validation_requests) & (self.new_note_hashes == other.new_note_hashes) & @@ -89,8 +89,8 @@ impl Serialize for PrivateCircuitPublicInp fields.push(self.min_revertible_side_effect_counter as Field); - for i in 0..MAX_READ_REQUESTS_PER_CALL{ - fields.extend_from_array(self.read_requests[i].serialize()); + for i in 0..MAX_NOTE_HASH_READ_REQUESTS_PER_CALL{ + fields.extend_from_array(self.note_hash_read_requests[i].serialize()); } for i in 0..MAX_NULLIFIER_READ_REQUESTS_PER_CALL{ fields.extend_from_array(self.nullifier_read_requests[i].serialize()); @@ -134,7 +134,7 @@ impl Deserialize for PrivateCircuitPublicI args_hash: reader.read(), return_values: reader.read_array([0; RETURN_VALUES_LENGTH]), min_revertible_side_effect_counter: reader.read() as u32, - read_requests: reader.read_struct_array(SideEffect::deserialize, [SideEffect::empty(); MAX_READ_REQUESTS_PER_CALL]), + note_hash_read_requests: reader.read_struct_array(SideEffect::deserialize, [SideEffect::empty(); MAX_NOTE_HASH_READ_REQUESTS_PER_CALL]), nullifier_read_requests: reader.read_struct_array(ReadRequest::deserialize, [ReadRequest::empty(); MAX_NULLIFIER_READ_REQUESTS_PER_CALL]), nullifier_key_validation_requests: reader.read_struct_array(NullifierKeyValidationRequest::deserialize, [NullifierKeyValidationRequest::empty(); MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_CALL]), new_note_hashes: reader.read_struct_array(SideEffect::deserialize, [SideEffect::empty(); MAX_NEW_NOTE_HASHES_PER_CALL]), diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_kernel/private_call_data.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_kernel/private_call_data.nr index e2bf6343ba8..4d8c8aeef2d 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_kernel/private_call_data.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_kernel/private_call_data.nr @@ -1,13 +1,13 @@ use crate::abis::{ call_request::CallRequest, private_call_stack_item::PrivateCallStackItem, - membership_witness::{ContractLeafMembershipWitness, FunctionLeafMembershipWitness, ReadRequestMembershipWitness} + membership_witness::{ContractLeafMembershipWitness, FunctionLeafMembershipWitness, NoteHashReadRequestMembershipWitness} }; use crate::address::{SaltedInitializationHash, PublicKeysHash, EthAddress}; use crate::contract_class_id::ContractClassId; use crate::mocked::{Proof, VerificationKey}; use crate::constants::{ MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL, - MAX_READ_REQUESTS_PER_CALL + MAX_NOTE_HASH_READ_REQUESTS_PER_CALL }; struct PrivateCallData { @@ -25,7 +25,7 @@ struct PrivateCallData { contract_class_public_bytecode_commitment: Field, function_leaf_membership_witness: FunctionLeafMembershipWitness, - read_request_membership_witnesses: [ReadRequestMembershipWitness; MAX_READ_REQUESTS_PER_CALL], + note_hash_read_request_membership_witnesses: [NoteHashReadRequestMembershipWitness; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL], portal_contract_address: EthAddress, acir_hash: Field, diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/constants.nr b/noir-projects/noir-protocol-circuits/crates/types/src/constants.nr index 5a9201dbb71..85f4433e2e3 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/constants.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/constants.nr @@ -30,7 +30,7 @@ global MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL: u64 = 4; 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_READ_REQUESTS_PER_CALL: u64 = 32; +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_KEY_VALIDATION_REQUESTS_PER_CALL: u64 = 1; @@ -59,7 +59,7 @@ global MAX_REVERTIBLE_PUBLIC_DATA_READS_PER_TX: u64 = 16; global MAX_NEW_L2_TO_L1_MSGS_PER_TX: u64 = 2; global MAX_NEW_CONTRACTS_PER_TX: u64 = 1; -global MAX_READ_REQUESTS_PER_TX: u64 = 128; +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_KEY_VALIDATION_REQUESTS_PER_TX: u64 = 4; global NUM_ENCRYPTED_LOGS_HASHES_PER_TX: u64 = 1; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/tests/fixtures.nr b/noir-projects/noir-protocol-circuits/crates/types/src/tests/fixtures.nr index 5613ef4134f..1a39d338404 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/tests/fixtures.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/tests/fixtures.nr @@ -2,7 +2,7 @@ mod contract_functions; mod contract_tree; mod contracts; mod note_hash_tree; -mod read_requests; +mod note_hash_read_requests; use crate::{ abis::{append_only_tree_snapshot::AppendOnlyTreeSnapshot, global_variables::GlobalVariables}, diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/tests/fixtures/note_hash_read_requests.nr b/noir-projects/noir-protocol-circuits/crates/types/src/tests/fixtures/note_hash_read_requests.nr new file mode 100644 index 00000000000..0123c28e38a --- /dev/null +++ b/noir-projects/noir-protocol-circuits/crates/types/src/tests/fixtures/note_hash_read_requests.nr @@ -0,0 +1,33 @@ +use crate::abis::{membership_witness::NoteHashReadRequestMembershipWitness, side_effect::SideEffect}; +use crate::tests::fixtures; +use crate::constants::{MAX_NOTE_HASH_READ_REQUESTS_PER_CALL}; + +pub fn generate_note_hash_read_requests(how_many: u64) -> (BoundedVec, BoundedVec) { + generate_note_hash_read_requests_with_config(how_many, false, [0; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL]) +} + +pub fn generate_transient_note_hash_read_requests(how_many: u64) -> (BoundedVec, BoundedVec) { + generate_note_hash_read_requests_with_config(how_many, true, [0; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL]) +} + +fn generate_note_hash_read_requests_with_config( + how_many: u64, + is_transient: bool, + hints_to_commitment: [Field; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL] +) -> (BoundedVec, BoundedVec) { + let mut read_requests = BoundedVec::new(); + let mut read_request_membership_witnesses = BoundedVec::new(); + + for i in 0..how_many { + read_requests.push(SideEffect { value: (i as Field) + 1, counter: 0 }); + let witness = NoteHashReadRequestMembershipWitness { + leaf_index: i as Field, + sibling_path: fixtures::note_hash_tree::SIBLING_PATHS[i], + is_transient, + hint_to_note_hash: hints_to_commitment[i] + }; + read_request_membership_witnesses.push(witness); + } + + (read_requests, read_request_membership_witnesses) +} diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/tests/fixtures/read_requests.nr b/noir-projects/noir-protocol-circuits/crates/types/src/tests/fixtures/read_requests.nr deleted file mode 100644 index f23ef8080ef..00000000000 --- a/noir-projects/noir-protocol-circuits/crates/types/src/tests/fixtures/read_requests.nr +++ /dev/null @@ -1,33 +0,0 @@ -use crate::abis::{membership_witness::ReadRequestMembershipWitness, side_effect::SideEffect}; -use crate::tests::fixtures; -use crate::constants::{MAX_READ_REQUESTS_PER_CALL}; - -pub fn generate_read_requests(how_many: u64) -> (BoundedVec, BoundedVec) { - generate_read_requests_with_config(how_many, false, [0; MAX_READ_REQUESTS_PER_CALL]) -} - -pub fn generate_transient_read_requests(how_many: u64) -> (BoundedVec, BoundedVec) { - generate_read_requests_with_config(how_many, true, [0; MAX_READ_REQUESTS_PER_CALL]) -} - -pub fn generate_read_requests_with_config( - how_many: u64, - is_transient: bool, - hints_to_commitment: [Field; MAX_READ_REQUESTS_PER_CALL] -) -> (BoundedVec, BoundedVec) { - let mut read_requests = BoundedVec::new(); - let mut read_request_membership_witnesses = BoundedVec::new(); - - for i in 0..how_many { - read_requests.push(SideEffect { value: (i as Field) + 1, counter: 0 }); - let witness = ReadRequestMembershipWitness { - leaf_index: i as Field, - sibling_path: fixtures::note_hash_tree::SIBLING_PATHS[i], - is_transient, - hint_to_note_hash: hints_to_commitment[i] - }; - read_request_membership_witnesses.push(witness); - } - - (read_requests, read_request_membership_witnesses) -} diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/tests/kernel_data_builder.nr b/noir-projects/noir-protocol-circuits/crates/types/src/tests/kernel_data_builder.nr index 5f370ce3b57..a4126dff9b7 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/tests/kernel_data_builder.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/tests/kernel_data_builder.nr @@ -115,10 +115,10 @@ impl PreviousKernelDataBuilder { } pub fn add_read_request_for_transient_commitment(&mut self, commitment_index: u64) -> u64 { - let new_read_request_index = self.end.read_requests.len(); + let new_read_request_index = self.end.note_hash_read_requests.len(); let commitment = self.end.new_note_hashes.get(commitment_index); let read_request = SideEffect { value: commitment.value, counter: self.next_sideffect_counter() }; - self.end.read_requests.push(read_request); + self.end.note_hash_read_requests.push(read_request); new_read_request_index } diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/tests/private_call_data_builder.nr b/noir-projects/noir-protocol-circuits/crates/types/src/tests/private_call_data_builder.nr index 85c4f08c7be..f86b5767eeb 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/tests/private_call_data_builder.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/tests/private_call_data_builder.nr @@ -2,7 +2,7 @@ use crate::{ abis::{ call_request::{CallerContext, CallRequest}, private_call_stack_item::PrivateCallStackItem, function_data::FunctionData, - membership_witness::{ContractLeafMembershipWitness, FunctionLeafMembershipWitness, ReadRequestMembershipWitness}, + membership_witness::{ContractLeafMembershipWitness, FunctionLeafMembershipWitness, NoteHashReadRequestMembershipWitness}, private_circuit_public_inputs::{PrivateCircuitPublicInputs}, private_kernel::private_call_data::PrivateCallData }, @@ -16,7 +16,7 @@ use crate::{ }; use crate::constants::{ MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL, - MAX_READ_REQUESTS_PER_CALL, NUM_FIELDS_PER_SHA256 + MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, NUM_FIELDS_PER_SHA256 }; struct PrivateCallDataBuilder { @@ -35,7 +35,7 @@ struct PrivateCallDataBuilder { contract_class_artifact_hash: Field, contract_class_public_bytecode_commitment: Field, function_leaf_membership_witness: FunctionLeafMembershipWitness, - read_request_membership_witnesses: BoundedVec, + note_hash_read_request_membership_witnesses: BoundedVec, portal_contract_address: EthAddress, acir_hash: Field, } @@ -66,7 +66,7 @@ impl PrivateCallDataBuilder { public_keys_hash: contract_data.public_keys_hash, contract_class_artifact_hash: contract_data.artifact_hash, contract_class_public_bytecode_commitment: contract_data.public_bytecode_commitment, - read_request_membership_witnesses: dep::std::unsafe::zeroed(), + note_hash_read_request_membership_witnesses: dep::std::unsafe::zeroed(), portal_contract_address: public_inputs.call_context.portal_contract_address, acir_hash: contract_function.acir_hash } @@ -156,16 +156,16 @@ impl PrivateCallDataBuilder { (hashes, call_requests) } - pub fn append_read_requests(&mut self, num_read_requests: u64) { - let (read_requests, read_request_membership_witnesses) = fixtures::read_requests::generate_read_requests(num_read_requests); - self.public_inputs.read_requests.extend_from_bounded_vec(read_requests); - self.read_request_membership_witnesses.extend_from_bounded_vec(read_request_membership_witnesses); + pub fn append_note_hash_read_requests(&mut self, num_read_requests: u64) { + let (read_requests, read_request_membership_witnesses) = fixtures::note_hash_read_requests::generate_note_hash_read_requests(num_read_requests); + self.public_inputs.note_hash_read_requests.extend_from_bounded_vec(read_requests); + self.note_hash_read_request_membership_witnesses.extend_from_bounded_vec(read_request_membership_witnesses); } - pub fn append_transient_read_requests(&mut self, num_read_requests: u64) { - let (read_requests, read_request_membership_witnesses) = fixtures::read_requests::generate_transient_read_requests(num_read_requests); - self.public_inputs.read_requests.extend_from_bounded_vec(read_requests); - self.read_request_membership_witnesses.extend_from_bounded_vec(read_request_membership_witnesses); + pub fn append_transient_note_hash_read_requests(&mut self, num_read_requests: u64) { + let (read_requests, read_request_membership_witnesses) = fixtures::note_hash_read_requests::generate_transient_note_hash_read_requests(num_read_requests); + self.public_inputs.note_hash_read_requests.extend_from_bounded_vec(read_requests); + self.note_hash_read_request_membership_witnesses.extend_from_bounded_vec(read_request_membership_witnesses); } pub fn set_encrypted_logs(&mut self, hash: [Field; NUM_FIELDS_PER_SHA256], preimages_length: Field) { @@ -205,7 +205,7 @@ impl PrivateCallDataBuilder { public_keys_hash: self.public_keys_hash, contract_class_artifact_hash: self.contract_class_artifact_hash, contract_class_public_bytecode_commitment: self.contract_class_public_bytecode_commitment, - read_request_membership_witnesses: self.read_request_membership_witnesses.storage, + note_hash_read_request_membership_witnesses: self.note_hash_read_request_membership_witnesses.storage, portal_contract_address: self.portal_contract_address, acir_hash: self.acir_hash } diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/tests/private_circuit_public_inputs_builder.nr b/noir-projects/noir-protocol-circuits/crates/types/src/tests/private_circuit_public_inputs_builder.nr index 5d4432732cc..2f23306a1c0 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/tests/private_circuit_public_inputs_builder.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/tests/private_circuit_public_inputs_builder.nr @@ -11,8 +11,9 @@ use crate::{ tests::{fixtures, testing_harness::build_contract_deployment_data} }; use crate::constants::{ - MAX_READ_REQUESTS_PER_CALL, MAX_NULLIFIER_READ_REQUESTS_PER_CALL, MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_CALL, - MAX_NEW_NOTE_HASHES_PER_CALL, MAX_NEW_NULLIFIERS_PER_CALL, MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, + MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, MAX_NULLIFIER_READ_REQUESTS_PER_CALL, + MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_CALL, MAX_NEW_NOTE_HASHES_PER_CALL, + MAX_NEW_NULLIFIERS_PER_CALL, MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL, MAX_NEW_L2_TO_L1_MSGS_PER_CALL, NUM_FIELDS_PER_SHA256, RETURN_VALUES_LENGTH }; @@ -25,7 +26,7 @@ struct PrivateCircuitPublicInputsBuilder { min_revertible_side_effect_counter: u32, - read_requests: BoundedVec, + note_hash_read_requests: BoundedVec, nullifier_read_requests: BoundedVec, nullifier_key_validation_requests: BoundedVec, @@ -108,7 +109,7 @@ impl PrivateCircuitPublicInputsBuilder { args_hash: self.args_hash, return_values: self.return_values.storage, min_revertible_side_effect_counter: self.min_revertible_side_effect_counter, - read_requests: self.read_requests.storage, + note_hash_read_requests: self.note_hash_read_requests.storage, nullifier_read_requests: self.nullifier_read_requests.storage, nullifier_key_validation_requests: self.nullifier_key_validation_requests.storage, new_note_hashes: self.new_note_hashes.storage, diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/tests/public_call_data_builder.nr b/noir-projects/noir-protocol-circuits/crates/types/src/tests/public_call_data_builder.nr index 7ac3af533b5..d12da8ff1b6 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/tests/public_call_data_builder.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/tests/public_call_data_builder.nr @@ -111,7 +111,7 @@ impl PublicCallDataBuilder { } } - pub fn append_read_requests(&mut self, num_reads: Field) { + pub fn append_public_data_read_requests(&mut self, num_reads: Field) { let value_offset = self.public_inputs.contract_storage_reads.len(); for i in 0..MAX_PUBLIC_DATA_READS_PER_CALL { if i as u64 < num_reads as u64 { @@ -126,7 +126,7 @@ impl PublicCallDataBuilder { } } - pub fn append_empty_read_requests(&mut self, num_reads: Field) { + pub fn append_empty_public_data_read_requests(&mut self, num_reads: Field) { for i in 0..MAX_PUBLIC_DATA_READS_PER_CALL { if i as u64 < num_reads as u64 { self.public_inputs.contract_storage_reads.push(StorageRead::empty()); diff --git a/yarn-project/circuits.js/fixtures/Benchmarking.test.json b/yarn-project/circuits.js/fixtures/Benchmarking.test.json index 4682f2b2111..5927c4d1224 100644 --- a/yarn-project/circuits.js/fixtures/Benchmarking.test.json +++ b/yarn-project/circuits.js/fixtures/Benchmarking.test.json @@ -3388,7 +3388,7 @@ "path": "/home/santiago/Projects/aztec3-packages/noir-contracts/contracts/benchmarking_contract/src/main.nr" }, "40": { - "source": "use crate::{\n abi::{\n PrivateContextInputs,\n PublicContextInputs,\n },\n key::nullifier_key::validate_nullifier_key_against_address,\n messaging::process_l1_to_l2_message,\n oracle::{\n arguments,\n call_private_function::call_private_function_internal,\n public_call::call_public_function_internal,\n enqueue_public_function_call::enqueue_public_function_call_internal,\n context::get_portal_address,\n get_block_header::get_block_header,\n nullifier_key::get_nullifier_key_pair,\n },\n types::vec::BoundedVec,\n utils::Reader,\n};\nuse dep::protocol_types::{\n abis::{\n block_header::BlockHeader,\n call_context::CallContext,\n function_data::FunctionData,\n function_selector::FunctionSelector,\n private_circuit_public_inputs::PrivateCircuitPublicInputs,\n public_circuit_public_inputs::PublicCircuitPublicInputs,\n call_stack_item::PrivateCallStackItem,\n call_stack_item::PublicCallStackItem,\n side_effect::{SideEffect, SideEffectLinkedToNoteHash},\n },\n address::{\n AztecAddress,\n EthAddress,\n },\n constants::{\n MAX_NEW_NOTE_HASHES_PER_CALL,\n MAX_NEW_L2_TO_L1_MSGS_PER_CALL,\n MAX_NEW_NULLIFIERS_PER_CALL,\n MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL,\n MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL,\n MAX_PUBLIC_DATA_READS_PER_CALL,\n MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL,\n MAX_READ_REQUESTS_PER_CALL,\n NUM_FIELDS_PER_SHA256,\n RETURN_VALUES_LENGTH,\n },\n contrakt::{\n deployment_data::ContractDeploymentData,\n storage_read::StorageRead,\n storage_update_request::StorageUpdateRequest,\n },\n hash::hash_args,\n grumpkin_point::GrumpkinPoint,\n};\nuse dep::std::{\n grumpkin_scalar::GrumpkinScalar,\n option::Option,\n};\n\n// TODO(https://github.com/AztecProtocol/aztec-packages/issues/1165)\n// use dep::std::collections::vec::Vec;\n\n// When finished, one can call .finish() to convert back to the abi\nstruct PrivateContext {\n // docs:start:private-context\n inputs: PrivateContextInputs,\n side_effect_counter: u32,\n\n args_hash : Field,\n return_values : BoundedVec,\n\n read_requests: BoundedVec,\n\n new_note_hashes: BoundedVec,\n new_nullifiers: BoundedVec,\n\n private_call_stack_hashes : BoundedVec,\n public_call_stack_hashes : BoundedVec,\n new_l2_to_l1_msgs : BoundedVec,\n // docs:end:private-context\n\n block_header: BlockHeader,\n\n // TODO(https://github.com/AztecProtocol/aztec-packages/issues/1165)\n // encrypted_logs_preimages: Vec,\n // unencrypted_logs_preimages: Vec,\n}\n\nimpl PrivateContext {\n pub fn new(inputs: PrivateContextInputs, args_hash: Field) -> PrivateContext {\n PrivateContext {\n inputs: inputs,\n side_effect_counter: inputs.call_context.start_side_effect_counter,\n\n args_hash: args_hash,\n return_values: BoundedVec::new();\n call_public_function_internal(\n contract_address, \n function_selector, \n args_hash,\n )\n }\n\n pub fn call_public_function_no_args(\n _self: Self,\n contract_address: AztecAddress, \n function_selector: FunctionSelector,\n ) -> [Field; RETURN_VALUES_LENGTH] {\n call_public_function_internal(\n contract_address, \n function_selector, \n 0,\n )\n }\n\n}\n\nstruct Context {\n private: Option<&mut PrivateContext>,\n public: Option<&mut PublicContext>,\n}\n\nimpl Context {\n pub fn private(context: &mut PrivateContext) -> Context {\n Context {\n private: Option::some(context),\n public: Option::none()\n }\n }\n\n pub fn public(context: &mut PublicContext) -> Context {\n Context {\n public: Option::some(context),\n private: Option::none()\n }\n }\n\n pub fn none() -> Context {\n Context {\n public: Option::none(),\n private: Option::none()\n }\n }\n}\n", + "source": "use crate::{\n abi::{\n PrivateContextInputs,\n PublicContextInputs,\n },\n key::nullifier_key::validate_nullifier_key_against_address,\n messaging::process_l1_to_l2_message,\n oracle::{\n arguments,\n call_private_function::call_private_function_internal,\n public_call::call_public_function_internal,\n enqueue_public_function_call::enqueue_public_function_call_internal,\n context::get_portal_address,\n get_block_header::get_block_header,\n nullifier_key::get_nullifier_key_pair,\n },\n types::vec::BoundedVec,\n utils::Reader,\n};\nuse dep::protocol_types::{\n abis::{\n block_header::BlockHeader,\n call_context::CallContext,\n function_data::FunctionData,\n function_selector::FunctionSelector,\n private_circuit_public_inputs::PrivateCircuitPublicInputs,\n public_circuit_public_inputs::PublicCircuitPublicInputs,\n call_stack_item::PrivateCallStackItem,\n call_stack_item::PublicCallStackItem,\n side_effect::{SideEffect, SideEffectLinkedToNoteHash},\n },\n address::{\n AztecAddress,\n EthAddress,\n },\n constants::{\n MAX_NEW_NOTE_HASHES_PER_CALL,\n MAX_NEW_L2_TO_L1_MSGS_PER_CALL,\n MAX_NEW_NULLIFIERS_PER_CALL,\n MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL,\n MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL,\n MAX_PUBLIC_DATA_READS_PER_CALL,\n MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL,\n MAX_NOTE_HASH_READ_REQUESTS_PER_CALL,\n NUM_FIELDS_PER_SHA256,\n RETURN_VALUES_LENGTH,\n },\n contrakt::{\n deployment_data::ContractDeploymentData,\n storage_read::StorageRead,\n storage_update_request::StorageUpdateRequest,\n },\n hash::hash_args,\n grumpkin_point::GrumpkinPoint,\n};\nuse dep::std::{\n grumpkin_scalar::GrumpkinScalar,\n option::Option,\n};\n\n// TODO(https://github.com/AztecProtocol/aztec-packages/issues/1165)\n// use dep::std::collections::vec::Vec;\n\n// When finished, one can call .finish() to convert back to the abi\nstruct PrivateContext {\n // docs:start:private-context\n inputs: PrivateContextInputs,\n side_effect_counter: u32,\n\n args_hash : Field,\n return_values : BoundedVec,\n\n read_requests: BoundedVec,\n\n new_note_hashes: BoundedVec,\n new_nullifiers: BoundedVec,\n\n private_call_stack_hashes : BoundedVec,\n public_call_stack_hashes : BoundedVec,\n new_l2_to_l1_msgs : BoundedVec,\n // docs:end:private-context\n\n block_header: BlockHeader,\n\n // TODO(https://github.com/AztecProtocol/aztec-packages/issues/1165)\n // encrypted_logs_preimages: Vec,\n // unencrypted_logs_preimages: Vec,\n}\n\nimpl PrivateContext {\n pub fn new(inputs: PrivateContextInputs, args_hash: Field) -> PrivateContext {\n PrivateContext {\n inputs: inputs,\n side_effect_counter: inputs.call_context.start_side_effect_counter,\n\n args_hash: args_hash,\n return_values: BoundedVec::new();\n call_public_function_internal(\n contract_address, \n function_selector, \n args_hash,\n )\n }\n\n pub fn call_public_function_no_args(\n _self: Self,\n contract_address: AztecAddress, \n function_selector: FunctionSelector,\n ) -> [Field; RETURN_VALUES_LENGTH] {\n call_public_function_internal(\n contract_address, \n function_selector, \n 0,\n )\n }\n\n}\n\nstruct Context {\n private: Option<&mut PrivateContext>,\n public: Option<&mut PublicContext>,\n}\n\nimpl Context {\n pub fn private(context: &mut PrivateContext) -> Context {\n Context {\n private: Option::some(context),\n public: Option::none()\n }\n }\n\n pub fn public(context: &mut PublicContext) -> Context {\n Context {\n public: Option::some(context),\n private: Option::none()\n }\n }\n\n pub fn none() -> Context {\n Context {\n public: Option::none(),\n private: Option::none()\n }\n }\n}\n", "path": "/home/santiago/Projects/aztec3-packages/aztec-nr/aztec/src/context.nr" }, "43": { @@ -3396,7 +3396,7 @@ "path": "/home/santiago/Projects/aztec3-packages/aztec-nr/aztec/src/abi.nr" }, "47": { - "source": "use dep::std::option::Option;\nuse crate::abi::PublicContextInputs;\nuse dep::protocol_types::{\n constants::{MAX_NOTES_PER_PAGE, MAX_READ_REQUESTS_PER_CALL},\n abis::side_effect::{SideEffect, SideEffectLinkedToNoteHash},\n};\nuse crate::context::{PrivateContext, PublicContext, Context};\nuse crate::note::{\n lifecycle::{create_note, create_note_hash_from_public, destroy_note},\n note_getter::{get_notes, view_notes},\n note_getter_options::NoteGetterOptions,\n note_header::NoteHeader,\n note_interface::NoteInterface,\n note_viewer_options::NoteViewerOptions,\n utils::compute_note_hash_for_read_or_nullify,\n};\n\n// docs:start:struct\nstruct Set {\n context: Context,\n storage_slot: Field,\n note_interface: NoteInterface,\n}\n// docs:end:struct\n\nimpl Set {\n // docs:start:new\n pub fn new(\n context: Context,\n storage_slot: Field,\n note_interface: NoteInterface,\n ) -> Self {\n assert(storage_slot != 0, \"Storage slot 0 not allowed. Storage slots must start from 1.\");\n Set {\n context,\n storage_slot,\n note_interface,\n }\n }\n // docs:end:new\n\n // docs:start:insert\n pub fn insert(self,\n note: &mut Note,\n broadcast: bool,\n ) {\n create_note(\n self.context.private.unwrap(),\n self.storage_slot,\n note,\n self.note_interface,\n broadcast,\n );\n }\n // docs:end:insert\n\n // docs:start:insert_from_public\n pub fn insert_from_public(self, note: &mut Note) {\n create_note_hash_from_public(\n self.context.public.unwrap(),\n self.storage_slot,\n note,\n self.note_interface,\n );\n }\n // docs:end:insert_from_public\n \n // DEPRECATED\n fn assert_contains_and_remove(_self: Self, _note: &mut Note, _nonce: Field) {\n assert(false, \"`assert_contains_and_remove` has been deprecated. Please call PXE.addNote() to add a note to the database. Then use Set.get_notes() and Set.remove() in your contract to verify and remove a note.\");\n }\n\n // DEPRECATED\n fn assert_contains_and_remove_publicly_created(_self: Self, _note: &mut Note) {\n assert(false, \"`assert_contains_and_remove_publicly_created` has been deprecated. Please call PXE.addNote() to add a note to the database. Then use Set.get_notes() and Set.remove() in your contract to verify and remove a note.\");\n }\n\n // docs:start:remove\n pub fn remove(self, note: Note) {\n let context = self.context.private.unwrap();\n let note_hash = compute_note_hash_for_read_or_nullify(self.note_interface, note);\n let has_been_read = context.read_requests.any(|r: SideEffect| r.value == note_hash);\n assert(has_been_read, \"Can only remove a note that has been read from the set.\");\n\n destroy_note(\n context,\n note,\n self.note_interface,\n );\n }\n // docs:end:remove\n\n // docs:start:get_notes\n pub fn get_notes(\n self,\n options: NoteGetterOptions,\n ) -> [Option; MAX_READ_REQUESTS_PER_CALL] {\n let storage_slot = self.storage_slot;\n let opt_notes = get_notes(\n self.context.private.unwrap(),\n storage_slot,\n self.note_interface,\n options,\n );\n opt_notes\n }\n // docs:end:get_notes\n\n // docs:start:view_notes\n unconstrained pub fn view_notes(\n self,\n options: NoteViewerOptions,\n ) -> [Option; MAX_NOTES_PER_PAGE] {\n view_notes(self.storage_slot, self.note_interface, options)\n }\n // docs:end:view_notes\n}\n", + "source": "use dep::std::option::Option;\nuse crate::abi::PublicContextInputs;\nuse dep::protocol_types::{\n constants::{MAX_NOTES_PER_PAGE, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL},\n abis::side_effect::{SideEffect, SideEffectLinkedToNoteHash},\n};\nuse crate::context::{PrivateContext, PublicContext, Context};\nuse crate::note::{\n lifecycle::{create_note, create_note_hash_from_public, destroy_note},\n note_getter::{get_notes, view_notes},\n note_getter_options::NoteGetterOptions,\n note_header::NoteHeader,\n note_interface::NoteInterface,\n note_viewer_options::NoteViewerOptions,\n utils::compute_note_hash_for_read_or_nullify,\n};\n\n// docs:start:struct\nstruct Set {\n context: Context,\n storage_slot: Field,\n note_interface: NoteInterface,\n}\n// docs:end:struct\n\nimpl Set {\n // docs:start:new\n pub fn new(\n context: Context,\n storage_slot: Field,\n note_interface: NoteInterface,\n ) -> Self {\n assert(storage_slot != 0, \"Storage slot 0 not allowed. Storage slots must start from 1.\");\n Set {\n context,\n storage_slot,\n note_interface,\n }\n }\n // docs:end:new\n\n // docs:start:insert\n pub fn insert(self,\n note: &mut Note,\n broadcast: bool,\n ) {\n create_note(\n self.context.private.unwrap(),\n self.storage_slot,\n note,\n self.note_interface,\n broadcast,\n );\n }\n // docs:end:insert\n\n // docs:start:insert_from_public\n pub fn insert_from_public(self, note: &mut Note) {\n create_note_hash_from_public(\n self.context.public.unwrap(),\n self.storage_slot,\n note,\n self.note_interface,\n );\n }\n // docs:end:insert_from_public\n \n // DEPRECATED\n fn assert_contains_and_remove(_self: Self, _note: &mut Note, _nonce: Field) {\n assert(false, \"`assert_contains_and_remove` has been deprecated. Please call PXE.addNote() to add a note to the database. Then use Set.get_notes() and Set.remove() in your contract to verify and remove a note.\");\n }\n\n // DEPRECATED\n fn assert_contains_and_remove_publicly_created(_self: Self, _note: &mut Note) {\n assert(false, \"`assert_contains_and_remove_publicly_created` has been deprecated. Please call PXE.addNote() to add a note to the database. Then use Set.get_notes() and Set.remove() in your contract to verify and remove a note.\");\n }\n\n // docs:start:remove\n pub fn remove(self, note: Note) {\n let context = self.context.private.unwrap();\n let note_hash = compute_note_hash_for_read_or_nullify(self.note_interface, note);\n let has_been_read = context.read_requests.any(|r: SideEffect| r.value == note_hash);\n assert(has_been_read, \"Can only remove a note that has been read from the set.\");\n\n destroy_note(\n context,\n note,\n self.note_interface,\n );\n }\n // docs:end:remove\n\n // docs:start:get_notes\n pub fn get_notes(\n self,\n options: NoteGetterOptions,\n ) -> [Option; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL] {\n let storage_slot = self.storage_slot;\n let opt_notes = get_notes(\n self.context.private.unwrap(),\n storage_slot,\n self.note_interface,\n options,\n );\n opt_notes\n }\n // docs:end:get_notes\n\n // docs:start:view_notes\n unconstrained pub fn view_notes(\n self,\n options: NoteViewerOptions,\n ) -> [Option; MAX_NOTES_PER_PAGE] {\n view_notes(self.storage_slot, self.note_interface, options)\n }\n // docs:end:view_notes\n}\n", "path": "/home/santiago/Projects/aztec3-packages/aztec-nr/aztec/src/state_vars/set.nr" }, "49": { @@ -3452,7 +3452,7 @@ "path": "/home/santiago/Projects/aztec3-packages/aztec-nr/aztec/src/key/nullifier_key.nr" }, "87": { - "source": "use dep::std::option::Option;\nuse dep::protocol_types::constants::{\n MAX_READ_REQUESTS_PER_CALL,\n GET_NOTE_ORACLE_RETURN_LENGTH,\n GET_NOTES_ORACLE_RETURN_LENGTH,\n MAX_NOTES_PER_PAGE,\n VIEW_NOTE_ORACLE_RETURN_LENGTH,\n};\nuse crate::context::PrivateContext;\nuse crate::note::{\n note_getter_options::{NoteGetterOptions, Select, Sort, SortOrder},\n note_interface::NoteInterface,\n note_viewer_options::NoteViewerOptions,\n utils::compute_note_hash_for_read_or_nullify,\n};\nuse crate::oracle;\nuse crate::types::vec::BoundedVec;\n\nfn check_note_header(\n context: PrivateContext,\n storage_slot: Field,\n note_interface: NoteInterface,\n note: Note\n) {\n let get_header = note_interface.get_header;\n let header = get_header(note);\n let contract_address = context.this_address();\n assert(header.contract_address.eq(contract_address));\n assert(header.storage_slot == storage_slot);\n}\n\nfn check_note_fields(fields: [Field; N], selects: BoundedVec, N>) {\n for i in 0..selects.len {\n let select = selects.get_unchecked(i).unwrap_unchecked();\n assert(fields[select.field_index] == select.value, \"Mismatch return note field.\");\n }\n}\n\nfn check_notes_order(\n fields_0: [Field; N],\n fields_1: [Field; N],\n sorts: BoundedVec, N>\n) {\n for i in 0..sorts.len {\n let sort = sorts.get_unchecked(i).unwrap_unchecked();\n let eq = fields_0[sort.field_index] == fields_1[sort.field_index];\n let lt = fields_0[sort.field_index] as u120 < fields_1[sort.field_index] as u120;\n if sort.order == SortOrder.ASC {\n assert(eq | lt, \"Return notes not sorted in ascending order.\");\n } else if !eq {\n assert(!lt, \"Return notes not sorted in descending order.\");\n }\n }\n}\n\npub fn get_note(\n context: &mut PrivateContext,\n storage_slot: Field,\n note_interface: NoteInterface\n) -> Note {\n let note = get_note_internal(storage_slot, note_interface);\n\n check_note_header(*context, storage_slot, note_interface, note);\n\n let note_hash_for_read_request = compute_note_hash_for_read_or_nullify(note_interface, note);\n\n context.push_read_request(note_hash_for_read_request);\n note\n}\n\npub fn get_notes(\n context: &mut PrivateContext,\n storage_slot: Field,\n note_interface: NoteInterface,\n options: NoteGetterOptions\n) -> [Option; MAX_READ_REQUESTS_PER_CALL] {\n let opt_notes = get_notes_internal(storage_slot, note_interface, options);\n let mut num_notes = 0;\n let mut prev_fields = [0; N];\n for i in 0..opt_notes.len() {\n let opt_note = opt_notes[i];\n if opt_note.is_some() {\n let note = opt_note.unwrap_unchecked();\n let serialize = note_interface.serialize;\n let fields = serialize(note);\n check_note_header(*context, storage_slot, note_interface, note);\n check_note_fields(fields, options.selects);\n if i != 0 {\n check_notes_order(prev_fields, fields, options.sorts);\n }\n prev_fields = fields;\n\n let note_hash_for_read_request = compute_note_hash_for_read_or_nullify(note_interface, note);\n // TODO(https://github.com/AztecProtocol/aztec-packages/issues/1410): test to ensure\n // failure if malicious oracle injects 0 nonce here for a \"pre-existing\" note.\n context.push_read_request(note_hash_for_read_request);\n\n num_notes += 1;\n };\n }\n if options.limit != 0 {\n assert(num_notes <= options.limit, \"Invalid number of return notes.\");\n }\n opt_notes\n}\n\nunconstrained fn get_note_internal(storage_slot: Field, note_interface: NoteInterface) -> Note {\n let placeholder_note = [Option::none()];\n let placeholder_fields = [0; GET_NOTE_ORACLE_RETURN_LENGTH];\n oracle::notes::get_notes(\n storage_slot,\n note_interface,\n 0,\n [],\n [],\n [],\n [],\n 1, // limit\n 0, // offset\n placeholder_note,\n placeholder_fields\n )[0].unwrap() // Notice: we don't allow dummies to be returned from get_note (singular).\n}\n\nunconstrained fn get_notes_internal(\n storage_slot: Field,\n note_interface: NoteInterface,\n options: NoteGetterOptions\n) -> [Option; MAX_READ_REQUESTS_PER_CALL] {\n let (num_selects, select_by, select_values, sort_by, sort_order) = flatten_options(options.selects, options.sorts);\n let placeholder_opt_notes = [Option::none(); MAX_READ_REQUESTS_PER_CALL];\n let placeholder_fields = [0; GET_NOTES_ORACLE_RETURN_LENGTH];\n let opt_notes = oracle::notes::get_notes(\n storage_slot,\n note_interface,\n num_selects,\n select_by,\n select_values,\n sort_by,\n sort_order,\n options.limit,\n options.offset,\n placeholder_opt_notes,\n placeholder_fields\n );\n\n let filter = options.filter;\n let filter_args = options.filter_args;\n filter(opt_notes, filter_args)\n}\n\nunconstrained pub fn view_notes(\n storage_slot: Field,\n note_interface: NoteInterface,\n options: NoteViewerOptions\n) -> [Option; MAX_NOTES_PER_PAGE] {\n let (num_selects, select_by, select_values, sort_by, sort_order) = flatten_options(options.selects, options.sorts);\n let placeholder_opt_notes = [Option::none(); MAX_NOTES_PER_PAGE];\n let placeholder_fields = [0; VIEW_NOTE_ORACLE_RETURN_LENGTH];\n oracle::notes::get_notes(\n storage_slot,\n note_interface,\n num_selects,\n select_by,\n select_values,\n sort_by,\n sort_order,\n options.limit,\n options.offset,\n placeholder_opt_notes,\n placeholder_fields\n )\n}\n\nunconstrained fn flatten_options(\n selects: BoundedVec, N>,\n sorts: BoundedVec, N>\n) -> (u8, [u8; N], [Field; N], [u8; N], [u2; N]) {\n let mut num_selects = 0;\n let mut select_by = [0; N];\n let mut select_values = [0; N];\n for i in 0..selects.len {\n let select = selects.get(i);\n if select.is_some() {\n select_by[num_selects] = select.unwrap_unchecked().field_index;\n select_values[num_selects] = select.unwrap_unchecked().value;\n num_selects += 1;\n };\n }\n\n let mut sort_by = [0; N];\n let mut sort_order = [0; N];\n for i in 0..sorts.len {\n let sort = sorts.get(i);\n if sort.is_some() {\n sort_by[i] = sort.unwrap_unchecked().field_index;\n sort_order[i] = sort.unwrap_unchecked().order;\n };\n }\n\n (num_selects, select_by, select_values, sort_by, sort_order)\n}\n", + "source": "use dep::std::option::Option;\nuse dep::protocol_types::constants::{\n MAX_NOTE_HASH_READ_REQUESTS_PER_CALL,\n GET_NOTE_ORACLE_RETURN_LENGTH,\n GET_NOTES_ORACLE_RETURN_LENGTH,\n MAX_NOTES_PER_PAGE,\n VIEW_NOTE_ORACLE_RETURN_LENGTH,\n};\nuse crate::context::PrivateContext;\nuse crate::note::{\n note_getter_options::{NoteGetterOptions, Select, Sort, SortOrder},\n note_interface::NoteInterface,\n note_viewer_options::NoteViewerOptions,\n utils::compute_note_hash_for_read_or_nullify,\n};\nuse crate::oracle;\nuse crate::types::vec::BoundedVec;\n\nfn check_note_header(\n context: PrivateContext,\n storage_slot: Field,\n note_interface: NoteInterface,\n note: Note\n) {\n let get_header = note_interface.get_header;\n let header = get_header(note);\n let contract_address = context.this_address();\n assert(header.contract_address.eq(contract_address));\n assert(header.storage_slot == storage_slot);\n}\n\nfn check_note_fields(fields: [Field; N], selects: BoundedVec, N>) {\n for i in 0..selects.len {\n let select = selects.get_unchecked(i).unwrap_unchecked();\n assert(fields[select.field_index] == select.value, \"Mismatch return note field.\");\n }\n}\n\nfn check_notes_order(\n fields_0: [Field; N],\n fields_1: [Field; N],\n sorts: BoundedVec, N>\n) {\n for i in 0..sorts.len {\n let sort = sorts.get_unchecked(i).unwrap_unchecked();\n let eq = fields_0[sort.field_index] == fields_1[sort.field_index];\n let lt = fields_0[sort.field_index] as u120 < fields_1[sort.field_index] as u120;\n if sort.order == SortOrder.ASC {\n assert(eq | lt, \"Return notes not sorted in ascending order.\");\n } else if !eq {\n assert(!lt, \"Return notes not sorted in descending order.\");\n }\n }\n}\n\npub fn get_note(\n context: &mut PrivateContext,\n storage_slot: Field,\n note_interface: NoteInterface\n) -> Note {\n let note = get_note_internal(storage_slot, note_interface);\n\n check_note_header(*context, storage_slot, note_interface, note);\n\n let note_hash_for_read_request = compute_note_hash_for_read_or_nullify(note_interface, note);\n\n context.push_read_request(note_hash_for_read_request);\n note\n}\n\npub fn get_notes(\n context: &mut PrivateContext,\n storage_slot: Field,\n note_interface: NoteInterface,\n options: NoteGetterOptions\n) -> [Option; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL] {\n let opt_notes = get_notes_internal(storage_slot, note_interface, options);\n let mut num_notes = 0;\n let mut prev_fields = [0; N];\n for i in 0..opt_notes.len() {\n let opt_note = opt_notes[i];\n if opt_note.is_some() {\n let note = opt_note.unwrap_unchecked();\n let serialize = note_interface.serialize;\n let fields = serialize(note);\n check_note_header(*context, storage_slot, note_interface, note);\n check_note_fields(fields, options.selects);\n if i != 0 {\n check_notes_order(prev_fields, fields, options.sorts);\n }\n prev_fields = fields;\n\n let note_hash_for_read_request = compute_note_hash_for_read_or_nullify(note_interface, note);\n // TODO(https://github.com/AztecProtocol/aztec-packages/issues/1410): test to ensure\n // failure if malicious oracle injects 0 nonce here for a \"pre-existing\" note.\n context.push_read_request(note_hash_for_read_request);\n\n num_notes += 1;\n };\n }\n if options.limit != 0 {\n assert(num_notes <= options.limit, \"Invalid number of return notes.\");\n }\n opt_notes\n}\n\nunconstrained fn get_note_internal(storage_slot: Field, note_interface: NoteInterface) -> Note {\n let placeholder_note = [Option::none()];\n let placeholder_fields = [0; GET_NOTE_ORACLE_RETURN_LENGTH];\n oracle::notes::get_notes(\n storage_slot,\n note_interface,\n 0,\n [],\n [],\n [],\n [],\n 1, // limit\n 0, // offset\n placeholder_note,\n placeholder_fields\n )[0].unwrap() // Notice: we don't allow dummies to be returned from get_note (singular).\n}\n\nunconstrained fn get_notes_internal(\n storage_slot: Field,\n note_interface: NoteInterface,\n options: NoteGetterOptions\n) -> [Option; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL] {\n let (num_selects, select_by, select_values, sort_by, sort_order) = flatten_options(options.selects, options.sorts);\n let placeholder_opt_notes = [Option::none(); MAX_NOTE_HASH_READ_REQUESTS_PER_CALL];\n let placeholder_fields = [0; GET_NOTES_ORACLE_RETURN_LENGTH];\n let opt_notes = oracle::notes::get_notes(\n storage_slot,\n note_interface,\n num_selects,\n select_by,\n select_values,\n sort_by,\n sort_order,\n options.limit,\n options.offset,\n placeholder_opt_notes,\n placeholder_fields\n );\n\n let filter = options.filter;\n let filter_args = options.filter_args;\n filter(opt_notes, filter_args)\n}\n\nunconstrained pub fn view_notes(\n storage_slot: Field,\n note_interface: NoteInterface,\n options: NoteViewerOptions\n) -> [Option; MAX_NOTES_PER_PAGE] {\n let (num_selects, select_by, select_values, sort_by, sort_order) = flatten_options(options.selects, options.sorts);\n let placeholder_opt_notes = [Option::none(); MAX_NOTES_PER_PAGE];\n let placeholder_fields = [0; VIEW_NOTE_ORACLE_RETURN_LENGTH];\n oracle::notes::get_notes(\n storage_slot,\n note_interface,\n num_selects,\n select_by,\n select_values,\n sort_by,\n sort_order,\n options.limit,\n options.offset,\n placeholder_opt_notes,\n placeholder_fields\n )\n}\n\nunconstrained fn flatten_options(\n selects: BoundedVec, N>,\n sorts: BoundedVec, N>\n) -> (u8, [u8; N], [Field; N], [u8; N], [u2; N]) {\n let mut num_selects = 0;\n let mut select_by = [0; N];\n let mut select_values = [0; N];\n for i in 0..selects.len {\n let select = selects.get(i);\n if select.is_some() {\n select_by[num_selects] = select.unwrap_unchecked().field_index;\n select_values[num_selects] = select.unwrap_unchecked().value;\n num_selects += 1;\n };\n }\n\n let mut sort_by = [0; N];\n let mut sort_order = [0; N];\n for i in 0..sorts.len {\n let sort = sorts.get(i);\n if sort.is_some() {\n sort_by[i] = sort.unwrap_unchecked().field_index;\n sort_order[i] = sort.unwrap_unchecked().order;\n };\n }\n\n (num_selects, select_by, select_values, sort_by, sort_order)\n}\n", "path": "/home/santiago/Projects/aztec3-packages/aztec-nr/aztec/src/note/note_getter.nr" }, "88": { @@ -3476,7 +3476,7 @@ "path": "/home/santiago/Projects/aztec3-packages/aztec-nr/aztec/src/types/type_serialization/field_serialization.nr" }, "105": { - "source": "global ARGS_LENGTH: Field = 16;\nglobal RETURN_VALUES_LENGTH: Field = 4;\n\n/**\n * Convention for constant array lengths are mainly divided in 2 classes:\n * - FUNCTION CALL\n * - TRANSACTION\n *\n * Agreed convention is to use MAX_XXX_PER_CALL resp. MAX_XXX_PER_TX, where XXX denotes a type of element such as\n * commitment, or nullifier, e.g.,:\n * - MAX_NEW_NULLIFIERS_PER_CALL\n * - MAX_NEW_NOTE_HASHES_PER_TX\n *\n * In the kernel circuits, we accumulate elements such as commitments and the nullifiers from all functions calls in a\n * transaction. Therefore, we always must have:\n * MAX_XXX_PER_TX ≥ MAX_XXX_PER_CALL\n *\n * For instance:\n * MAX_NEW_NOTE_HASHES_PER_TX ≥ MAX_NEW_NOTE_HASHES_PER_CALL\n * MAX_NEW_NULLIFIERS_PER_TX ≥ MAX_NEW_NULLIFIERS_PER_CALL\n *\n */\n\n// docs:start:constants\n// \"PER CALL\" CONSTANTS\nglobal MAX_NEW_NOTE_HASHES_PER_CALL: Field = 16;\nglobal MAX_NEW_NULLIFIERS_PER_CALL: Field = 16;\nglobal MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL: Field = 4;\nglobal MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL: Field = 4;\nglobal MAX_NEW_L2_TO_L1_MSGS_PER_CALL: Field = 2;\nglobal MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL: Field = 16;\nglobal MAX_PUBLIC_DATA_READS_PER_CALL: Field = 16;\nglobal MAX_READ_REQUESTS_PER_CALL: Field = 32;\n\n// \"PER TRANSACTION\" CONSTANTS\nglobal MAX_NEW_NOTE_HASHES_PER_TX: Field = 64;\nglobal MAX_NEW_NULLIFIERS_PER_TX: Field = 64;\nglobal MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX: Field = 8;\nglobal MAX_PUBLIC_CALL_STACK_LENGTH_PER_TX: Field = 8;\nglobal MAX_NEW_L2_TO_L1_MSGS_PER_TX: Field = 2;\nglobal MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX: Field = 16;\nglobal MAX_PUBLIC_DATA_READS_PER_TX: Field = 16;\nglobal MAX_NEW_CONTRACTS_PER_TX: Field = 1;\nglobal MAX_OPTIONALLY_REVEALED_DATA_LENGTH_PER_TX: Field = 4;\nglobal MAX_READ_REQUESTS_PER_TX: Field = 128;\nglobal NUM_ENCRYPTED_LOGS_HASHES_PER_TX: Field = 1;\nglobal NUM_UNENCRYPTED_LOGS_HASHES_PER_TX: Field = 1;\n// docs:end:constants\n\n// ROLLUP CONTRACT CONSTANTS - constants used only in l1-contracts\nglobal NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP: Field = 16;\n\n// TREES RELATED CONSTANTS\nglobal VK_TREE_HEIGHT: Field = 3;\nglobal FUNCTION_TREE_HEIGHT: Field = 5;\nglobal CONTRACT_TREE_HEIGHT: Field = 16;\nglobal NOTE_HASH_TREE_HEIGHT: Field = 32;\nglobal PUBLIC_DATA_TREE_HEIGHT: Field = 40;\nglobal NULLIFIER_TREE_HEIGHT: Field = 20;\nglobal L1_TO_L2_MSG_TREE_HEIGHT: Field = 16;\nglobal ROLLUP_VK_TREE_HEIGHT: Field = 8;\n\n// SUB-TREES RELATED CONSTANTS\nglobal CONTRACT_SUBTREE_HEIGHT: Field = 0;\nglobal CONTRACT_SUBTREE_SIBLING_PATH_LENGTH: Field = 16;\nglobal NOTE_HASH_SUBTREE_HEIGHT: Field = 6;\nglobal NOTE_HASH_SUBTREE_SIBLING_PATH_LENGTH: Field = 26;\nglobal NULLIFIER_SUBTREE_HEIGHT: Field = 6;\nglobal PUBLIC_DATA_SUBTREE_HEIGHT: Field = 4;\nglobal ARCHIVE_HEIGHT: Field = 16;\nglobal NULLIFIER_SUBTREE_SIBLING_PATH_LENGTH: Field = 14;\nglobal PUBLIC_DATA_SUBTREE_SIBLING_PATH_LENGTH: Field = 36;\nglobal L1_TO_L2_MSG_SUBTREE_HEIGHT: Field = 4;\nglobal L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH: Field = 12;\n\n// MISC CONSTANTS\nglobal FUNCTION_SELECTOR_NUM_BYTES: Field = 4;\nglobal MAPPING_SLOT_PEDERSEN_SEPARATOR: Field = 4;\n// sha256 hash is stored in two fields to accommodate all 256-bits of the hash\nglobal NUM_FIELDS_PER_SHA256: Field = 2;\nglobal ARGS_HASH_CHUNK_LENGTH: u32 = 32;\nglobal ARGS_HASH_CHUNK_COUNT: u32 = 16;\n\n// NOIR CONSTANTS - constants used only in yarn-packages/noir-contracts\n// Some are defined here because Noir doesn't yet support globals referencing other globals yet.\n// Move these constants to a noir file once the issue bellow is resolved:\n// https://github.com/noir-lang/noir/issues/1734\nglobal L1_TO_L2_MESSAGE_LENGTH: Field = 8;\nglobal L1_TO_L2_MESSAGE_ORACLE_CALL_LENGTH: Field = 25;\nglobal MAX_NOTE_FIELDS_LENGTH: Field = 20;\n// GET_NOTE_ORACLE_RETURN_LENGT = MAX_NOTE_FIELDS_LENGTH + 1 + 2\n// The plus 1 is 1 extra field for nonce.\n// + 2 for EXTRA_DATA: [number_of_return_notes, contract_address]\nglobal GET_NOTE_ORACLE_RETURN_LENGTH: Field = 23;\nglobal MAX_NOTES_PER_PAGE: Field = 10;\n// VIEW_NOTE_ORACLE_RETURN_LENGTH = MAX_NOTES_PER_PAGE * (MAX_NOTE_FIELDS_LENGTH + 1) + 2;\nglobal VIEW_NOTE_ORACLE_RETURN_LENGTH: Field = 212;\nglobal CALL_CONTEXT_LENGTH: Field = 8;\nglobal BLOCK_HEADER_LENGTH: Field = 7;\nglobal FUNCTION_DATA_LENGTH: Field = 4;\nglobal CONTRACT_DEPLOYMENT_DATA_LENGTH: Field = 6;\n// Change this ONLY if you have changed the PrivateCircuitPublicInputs structure.\n// In other words, if the structure/size of the public inputs of a function call changes then we\n// should change this constant as well as the offsets in private_call_stack_item.nr\nglobal PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH: Field = 189;\nglobal CONTRACT_STORAGE_UPDATE_REQUEST_LENGTH: Field = 3;\nglobal CONTRACT_STORAGE_READ_LENGTH: Field = 2;\n// Change this ONLY if you have changed the PublicCircuitPublicInputs structure.\nglobal PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH: Field = 190;\nglobal GET_NOTES_ORACLE_RETURN_LENGTH: Field = 674;\nglobal CALL_PRIVATE_FUNCTION_RETURN_SIZE: Field = 195;\nglobal PUBLIC_CIRCUIT_PUBLIC_INPUTS_HASH_INPUT_LENGTH: Field = 87;\nglobal PRIVATE_CIRCUIT_PUBLIC_INPUTS_HASH_INPUT_LENGTH: Field = 177;\nglobal NOTE_HASHES_NUM_BYTES_PER_BASE_ROLLUP: Field = 2048;\nglobal NULLIFIERS_NUM_BYTES_PER_BASE_ROLLUP: Field = 2048;\nglobal PUBLIC_DATA_WRITES_NUM_BYTES_PER_BASE_ROLLUP: Field = 1024;\nglobal CONTRACTS_NUM_BYTES_PER_BASE_ROLLUP: Field = 32;\nglobal CONTRACT_DATA_NUM_BYTES_PER_BASE_ROLLUP: Field = 64;\nglobal CONTRACT_DATA_NUM_BYTES_PER_BASE_ROLLUP_UNPADDED: Field = 52;\nglobal L2_TO_L1_MSGS_NUM_BYTES_PER_BASE_ROLLUP: Field = 64;\nglobal LOGS_HASHES_NUM_BYTES_PER_BASE_ROLLUP: Field = 64;\n\n/**\n * Enumerate the hash_indices which are used for pedersen hashing.\n * We start from 1 to avoid the default generators. The generator indices are listed\n * based on the number of elements each index hashes. The following conditions must be met:\n *\n * +-----------+-------------------------------+----------------------+\n * | Hash size | Number of elements hashed (n) | Condition to use |\n * |-----------+-------------------------------+----------------------|\n * | LOW | n ≤ 8 | 0 < hash_index ≤ 32 |\n * | MID | 8 < n ≤ 16 | 32 < hash_index ≤ 40 |\n * | HIGH | 16 < n ≤ 48 | 40 < hash_index ≤ 48 |\n * +-----------+-------------------------------+----------------------+\n *\n * Note: When modifying, modify `GeneratorIndexPacker` in packer.hpp accordingly.\n */\n// Indices with size ≤ 8\nglobal GENERATOR_INDEX__COMMITMENT = 1;\nglobal GENERATOR_INDEX__NOTE_HASH_NONCE = 2;\nglobal GENERATOR_INDEX__UNIQUE_NOTE_HASH = 3;\nglobal GENERATOR_INDEX__SILOED_NOTE_HASH = 4;\nglobal GENERATOR_INDEX__NULLIFIER = 5;\nglobal GENERATOR_INDEX__INITIALIZATION_NULLIFIER = 6;\nglobal GENERATOR_INDEX__OUTER_NULLIFIER = 7;\nglobal GENERATOR_INDEX__PUBLIC_DATA_READ = 8;\nglobal GENERATOR_INDEX__PUBLIC_DATA_UPDATE_REQUEST = 9;\nglobal GENERATOR_INDEX__FUNCTION_DATA = 10;\nglobal GENERATOR_INDEX__FUNCTION_LEAF = 11;\nglobal GENERATOR_INDEX__CONTRACT_DEPLOYMENT_DATA = 12;\nglobal GENERATOR_INDEX__CONSTRUCTOR = 13;\nglobal GENERATOR_INDEX__CONSTRUCTOR_ARGS = 14;\nglobal GENERATOR_INDEX__CONTRACT_ADDRESS = 15;\nglobal GENERATOR_INDEX__CONTRACT_LEAF = 16;\nglobal GENERATOR_INDEX__CALL_CONTEXT = 17;\nglobal GENERATOR_INDEX__CALL_STACK_ITEM = 18;\nglobal GENERATOR_INDEX__CALL_STACK_ITEM_2 = 19;\nglobal GENERATOR_INDEX__L1_TO_L2_MESSAGE_SECRET = 20;\nglobal GENERATOR_INDEX__L2_TO_L1_MSG = 21;\nglobal GENERATOR_INDEX__TX_CONTEXT = 22;\nglobal GENERATOR_INDEX__PUBLIC_LEAF_INDEX = 23;\nglobal GENERATOR_INDEX__PUBLIC_DATA_LEAF = 24;\nglobal GENERATOR_INDEX__SIGNED_TX_REQUEST = 25;\nglobal GENERATOR_INDEX__GLOBAL_VARIABLES = 26;\nglobal GENERATOR_INDEX__PARTIAL_ADDRESS = 27;\nglobal GENERATOR_INDEX__BLOCK_HASH = 28;\nglobal GENERATOR_INDEX__SIDE_EFFECT = 29;\n// Indices with size ≤ 16\nglobal GENERATOR_INDEX__TX_REQUEST = 33;\nglobal GENERATOR_INDEX__SIGNATURE_PAYLOAD = 34;\n// Indices with size ≤ 44\nglobal GENERATOR_INDEX__VK = 41;\nglobal GENERATOR_INDEX__PRIVATE_CIRCUIT_PUBLIC_INPUTS = 42;\nglobal GENERATOR_INDEX__PUBLIC_CIRCUIT_PUBLIC_INPUTS = 43;\nglobal GENERATOR_INDEX__FUNCTION_ARGS = 44;\n", + "source": "global ARGS_LENGTH: Field = 16;\nglobal RETURN_VALUES_LENGTH: Field = 4;\n\n/**\n * Convention for constant array lengths are mainly divided in 2 classes:\n * - FUNCTION CALL\n * - TRANSACTION\n *\n * Agreed convention is to use MAX_XXX_PER_CALL resp. MAX_XXX_PER_TX, where XXX denotes a type of element such as\n * commitment, or nullifier, e.g.,:\n * - MAX_NEW_NULLIFIERS_PER_CALL\n * - MAX_NEW_NOTE_HASHES_PER_TX\n *\n * In the kernel circuits, we accumulate elements such as commitments and the nullifiers from all functions calls in a\n * transaction. Therefore, we always must have:\n * MAX_XXX_PER_TX ≥ MAX_XXX_PER_CALL\n *\n * For instance:\n * MAX_NEW_NOTE_HASHES_PER_TX ≥ MAX_NEW_NOTE_HASHES_PER_CALL\n * MAX_NEW_NULLIFIERS_PER_TX ≥ MAX_NEW_NULLIFIERS_PER_CALL\n *\n */\n\n// docs:start:constants\n// \"PER CALL\" CONSTANTS\nglobal MAX_NEW_NOTE_HASHES_PER_CALL: Field = 16;\nglobal MAX_NEW_NULLIFIERS_PER_CALL: Field = 16;\nglobal MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL: Field = 4;\nglobal MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL: Field = 4;\nglobal MAX_NEW_L2_TO_L1_MSGS_PER_CALL: Field = 2;\nglobal MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL: Field = 16;\nglobal MAX_PUBLIC_DATA_READS_PER_CALL: Field = 16;\nglobal MAX_NOTE_HASH_READ_REQUESTS_PER_CALL: Field = 32;\n\n// \"PER TRANSACTION\" CONSTANTS\nglobal MAX_NEW_NOTE_HASHES_PER_TX: Field = 64;\nglobal MAX_NEW_NULLIFIERS_PER_TX: Field = 64;\nglobal MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX: Field = 8;\nglobal MAX_PUBLIC_CALL_STACK_LENGTH_PER_TX: Field = 8;\nglobal MAX_NEW_L2_TO_L1_MSGS_PER_TX: Field = 2;\nglobal MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX: Field = 16;\nglobal MAX_PUBLIC_DATA_READS_PER_TX: Field = 16;\nglobal MAX_NEW_CONTRACTS_PER_TX: Field = 1;\nglobal MAX_OPTIONALLY_REVEALED_DATA_LENGTH_PER_TX: Field = 4;\nglobal MAX_NOTE_HASH_READ_REQUESTS_PER_TX: Field = 128;\nglobal NUM_ENCRYPTED_LOGS_HASHES_PER_TX: Field = 1;\nglobal NUM_UNENCRYPTED_LOGS_HASHES_PER_TX: Field = 1;\n// docs:end:constants\n\n// ROLLUP CONTRACT CONSTANTS - constants used only in l1-contracts\nglobal NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP: Field = 16;\n\n// TREES RELATED CONSTANTS\nglobal VK_TREE_HEIGHT: Field = 3;\nglobal FUNCTION_TREE_HEIGHT: Field = 5;\nglobal CONTRACT_TREE_HEIGHT: Field = 16;\nglobal NOTE_HASH_TREE_HEIGHT: Field = 32;\nglobal PUBLIC_DATA_TREE_HEIGHT: Field = 40;\nglobal NULLIFIER_TREE_HEIGHT: Field = 20;\nglobal L1_TO_L2_MSG_TREE_HEIGHT: Field = 16;\nglobal ROLLUP_VK_TREE_HEIGHT: Field = 8;\n\n// SUB-TREES RELATED CONSTANTS\nglobal CONTRACT_SUBTREE_HEIGHT: Field = 0;\nglobal CONTRACT_SUBTREE_SIBLING_PATH_LENGTH: Field = 16;\nglobal NOTE_HASH_SUBTREE_HEIGHT: Field = 6;\nglobal NOTE_HASH_SUBTREE_SIBLING_PATH_LENGTH: Field = 26;\nglobal NULLIFIER_SUBTREE_HEIGHT: Field = 6;\nglobal PUBLIC_DATA_SUBTREE_HEIGHT: Field = 4;\nglobal ARCHIVE_HEIGHT: Field = 16;\nglobal NULLIFIER_SUBTREE_SIBLING_PATH_LENGTH: Field = 14;\nglobal PUBLIC_DATA_SUBTREE_SIBLING_PATH_LENGTH: Field = 36;\nglobal L1_TO_L2_MSG_SUBTREE_HEIGHT: Field = 4;\nglobal L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH: Field = 12;\n\n// MISC CONSTANTS\nglobal FUNCTION_SELECTOR_NUM_BYTES: Field = 4;\nglobal MAPPING_SLOT_PEDERSEN_SEPARATOR: Field = 4;\n// sha256 hash is stored in two fields to accommodate all 256-bits of the hash\nglobal NUM_FIELDS_PER_SHA256: Field = 2;\nglobal ARGS_HASH_CHUNK_LENGTH: u32 = 32;\nglobal ARGS_HASH_CHUNK_COUNT: u32 = 16;\n\n// NOIR CONSTANTS - constants used only in yarn-packages/noir-contracts\n// Some are defined here because Noir doesn't yet support globals referencing other globals yet.\n// Move these constants to a noir file once the issue bellow is resolved:\n// https://github.com/noir-lang/noir/issues/1734\nglobal L1_TO_L2_MESSAGE_LENGTH: Field = 8;\nglobal L1_TO_L2_MESSAGE_ORACLE_CALL_LENGTH: Field = 25;\nglobal MAX_NOTE_FIELDS_LENGTH: Field = 20;\n// GET_NOTE_ORACLE_RETURN_LENGT = MAX_NOTE_FIELDS_LENGTH + 1 + 2\n// The plus 1 is 1 extra field for nonce.\n// + 2 for EXTRA_DATA: [number_of_return_notes, contract_address]\nglobal GET_NOTE_ORACLE_RETURN_LENGTH: Field = 23;\nglobal MAX_NOTES_PER_PAGE: Field = 10;\n// VIEW_NOTE_ORACLE_RETURN_LENGTH = MAX_NOTES_PER_PAGE * (MAX_NOTE_FIELDS_LENGTH + 1) + 2;\nglobal VIEW_NOTE_ORACLE_RETURN_LENGTH: Field = 212;\nglobal CALL_CONTEXT_LENGTH: Field = 8;\nglobal BLOCK_HEADER_LENGTH: Field = 7;\nglobal FUNCTION_DATA_LENGTH: Field = 4;\nglobal CONTRACT_DEPLOYMENT_DATA_LENGTH: Field = 6;\n// Change this ONLY if you have changed the PrivateCircuitPublicInputs structure.\n// In other words, if the structure/size of the public inputs of a function call changes then we\n// should change this constant as well as the offsets in private_call_stack_item.nr\nglobal PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH: Field = 189;\nglobal CONTRACT_STORAGE_UPDATE_REQUEST_LENGTH: Field = 3;\nglobal CONTRACT_STORAGE_READ_LENGTH: Field = 2;\n// Change this ONLY if you have changed the PublicCircuitPublicInputs structure.\nglobal PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH: Field = 190;\nglobal GET_NOTES_ORACLE_RETURN_LENGTH: Field = 674;\nglobal CALL_PRIVATE_FUNCTION_RETURN_SIZE: Field = 195;\nglobal PUBLIC_CIRCUIT_PUBLIC_INPUTS_HASH_INPUT_LENGTH: Field = 87;\nglobal PRIVATE_CIRCUIT_PUBLIC_INPUTS_HASH_INPUT_LENGTH: Field = 177;\nglobal NOTE_HASHES_NUM_BYTES_PER_BASE_ROLLUP: Field = 2048;\nglobal NULLIFIERS_NUM_BYTES_PER_BASE_ROLLUP: Field = 2048;\nglobal PUBLIC_DATA_WRITES_NUM_BYTES_PER_BASE_ROLLUP: Field = 1024;\nglobal CONTRACTS_NUM_BYTES_PER_BASE_ROLLUP: Field = 32;\nglobal CONTRACT_DATA_NUM_BYTES_PER_BASE_ROLLUP: Field = 64;\nglobal CONTRACT_DATA_NUM_BYTES_PER_BASE_ROLLUP_UNPADDED: Field = 52;\nglobal L2_TO_L1_MSGS_NUM_BYTES_PER_BASE_ROLLUP: Field = 64;\nglobal LOGS_HASHES_NUM_BYTES_PER_BASE_ROLLUP: Field = 64;\n\n/**\n * Enumerate the hash_indices which are used for pedersen hashing.\n * We start from 1 to avoid the default generators. The generator indices are listed\n * based on the number of elements each index hashes. The following conditions must be met:\n *\n * +-----------+-------------------------------+----------------------+\n * | Hash size | Number of elements hashed (n) | Condition to use |\n * |-----------+-------------------------------+----------------------|\n * | LOW | n ≤ 8 | 0 < hash_index ≤ 32 |\n * | MID | 8 < n ≤ 16 | 32 < hash_index ≤ 40 |\n * | HIGH | 16 < n ≤ 48 | 40 < hash_index ≤ 48 |\n * +-----------+-------------------------------+----------------------+\n *\n * Note: When modifying, modify `GeneratorIndexPacker` in packer.hpp accordingly.\n */\n// Indices with size ≤ 8\nglobal GENERATOR_INDEX__COMMITMENT = 1;\nglobal GENERATOR_INDEX__NOTE_HASH_NONCE = 2;\nglobal GENERATOR_INDEX__UNIQUE_NOTE_HASH = 3;\nglobal GENERATOR_INDEX__SILOED_NOTE_HASH = 4;\nglobal GENERATOR_INDEX__NULLIFIER = 5;\nglobal GENERATOR_INDEX__INITIALIZATION_NULLIFIER = 6;\nglobal GENERATOR_INDEX__OUTER_NULLIFIER = 7;\nglobal GENERATOR_INDEX__PUBLIC_DATA_READ = 8;\nglobal GENERATOR_INDEX__PUBLIC_DATA_UPDATE_REQUEST = 9;\nglobal GENERATOR_INDEX__FUNCTION_DATA = 10;\nglobal GENERATOR_INDEX__FUNCTION_LEAF = 11;\nglobal GENERATOR_INDEX__CONTRACT_DEPLOYMENT_DATA = 12;\nglobal GENERATOR_INDEX__CONSTRUCTOR = 13;\nglobal GENERATOR_INDEX__CONSTRUCTOR_ARGS = 14;\nglobal GENERATOR_INDEX__CONTRACT_ADDRESS = 15;\nglobal GENERATOR_INDEX__CONTRACT_LEAF = 16;\nglobal GENERATOR_INDEX__CALL_CONTEXT = 17;\nglobal GENERATOR_INDEX__CALL_STACK_ITEM = 18;\nglobal GENERATOR_INDEX__CALL_STACK_ITEM_2 = 19;\nglobal GENERATOR_INDEX__L1_TO_L2_MESSAGE_SECRET = 20;\nglobal GENERATOR_INDEX__L2_TO_L1_MSG = 21;\nglobal GENERATOR_INDEX__TX_CONTEXT = 22;\nglobal GENERATOR_INDEX__PUBLIC_LEAF_INDEX = 23;\nglobal GENERATOR_INDEX__PUBLIC_DATA_LEAF = 24;\nglobal GENERATOR_INDEX__SIGNED_TX_REQUEST = 25;\nglobal GENERATOR_INDEX__GLOBAL_VARIABLES = 26;\nglobal GENERATOR_INDEX__PARTIAL_ADDRESS = 27;\nglobal GENERATOR_INDEX__BLOCK_HASH = 28;\nglobal GENERATOR_INDEX__SIDE_EFFECT = 29;\n// Indices with size ≤ 16\nglobal GENERATOR_INDEX__TX_REQUEST = 33;\nglobal GENERATOR_INDEX__SIGNATURE_PAYLOAD = 34;\n// Indices with size ≤ 44\nglobal GENERATOR_INDEX__VK = 41;\nglobal GENERATOR_INDEX__PRIVATE_CIRCUIT_PUBLIC_INPUTS = 42;\nglobal GENERATOR_INDEX__PUBLIC_CIRCUIT_PUBLIC_INPUTS = 43;\nglobal GENERATOR_INDEX__FUNCTION_ARGS = 44;\n", "path": "/home/santiago/Projects/aztec3-packages/noir-protocol-circuits/crates/types/src/constants.nr" }, "111": { diff --git a/yarn-project/circuits.js/src/constants.gen.ts b/yarn-project/circuits.js/src/constants.gen.ts index 2e9b51a892b..a53f6979ca6 100644 --- a/yarn-project/circuits.js/src/constants.gen.ts +++ b/yarn-project/circuits.js/src/constants.gen.ts @@ -9,7 +9,7 @@ export const MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL = 4; 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_READ_REQUESTS_PER_CALL = 32; +export const MAX_NOTE_HASH_READ_REQUESTS_PER_CALL = 32; export const MAX_NULLIFIER_READ_REQUESTS_PER_CALL = 2; export const MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_CALL = 1; export const MAX_NEW_NOTE_HASHES_PER_TX = 64; @@ -30,7 +30,7 @@ export const MAX_NON_REVERTIBLE_PUBLIC_DATA_READS_PER_TX = 16; export const MAX_REVERTIBLE_PUBLIC_DATA_READS_PER_TX = 16; export const MAX_NEW_L2_TO_L1_MSGS_PER_TX = 2; export const MAX_NEW_CONTRACTS_PER_TX = 1; -export const MAX_READ_REQUESTS_PER_TX = 128; +export const MAX_NOTE_HASH_READ_REQUESTS_PER_TX = 128; export const MAX_NULLIFIER_READ_REQUESTS_PER_TX = 8; export const MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_TX = 4; export const NUM_ENCRYPTED_LOGS_HASHES_PER_TX = 1; diff --git a/yarn-project/circuits.js/src/structs/index.ts b/yarn-project/circuits.js/src/structs/index.ts index eec426b81a2..106a1e558a0 100644 --- a/yarn-project/circuits.js/src/structs/index.ts +++ b/yarn-project/circuits.js/src/structs/index.ts @@ -39,7 +39,7 @@ export * from './public_call_request.js'; export * from './public_call_stack_item.js'; export * from './public_circuit_public_inputs.js'; export * from './read_request.js'; -export * from './read_request_membership_witness.js'; +export * from './note_hash_read_request_membership_witness.js'; export * from './read_request_reset_hints.js'; export * from './rollup/append_only_tree_snapshot.js'; export * from './rollup/base_or_merge_rollup_public_inputs.js'; diff --git a/yarn-project/circuits.js/src/structs/kernel/combined_accumulated_data.ts b/yarn-project/circuits.js/src/structs/kernel/combined_accumulated_data.ts index f15f9c5afff..246f48b8983 100644 --- a/yarn-project/circuits.js/src/structs/kernel/combined_accumulated_data.ts +++ b/yarn-project/circuits.js/src/structs/kernel/combined_accumulated_data.ts @@ -14,13 +14,13 @@ import { MAX_NON_REVERTIBLE_PUBLIC_CALL_STACK_LENGTH_PER_TX, MAX_NON_REVERTIBLE_PUBLIC_DATA_READS_PER_TX, MAX_NON_REVERTIBLE_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, + MAX_NOTE_HASH_READ_REQUESTS_PER_TX, MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_TX, MAX_NULLIFIER_READ_REQUESTS_PER_TX, MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX, MAX_PUBLIC_CALL_STACK_LENGTH_PER_TX, MAX_PUBLIC_DATA_READS_PER_TX, MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, - MAX_READ_REQUESTS_PER_TX, MAX_REVERTIBLE_NOTE_HASHES_PER_TX, MAX_REVERTIBLE_NULLIFIERS_PER_TX, MAX_REVERTIBLE_PUBLIC_CALL_STACK_LENGTH_PER_TX, @@ -162,7 +162,7 @@ export class CombinedAccumulatedData { /** * All the read requests made in this transaction. */ - public readRequests: Tuple, + public noteHashReadRequests: Tuple, /** * All the nullifier read requests made in this transaction. */ @@ -228,7 +228,7 @@ export class CombinedAccumulatedData { toBuffer() { return serializeToBuffer( - this.readRequests, + this.noteHashReadRequests, this.nullifierReadRequests, this.nullifierKeyValidationRequests, this.newNoteHashes, @@ -258,7 +258,7 @@ export class CombinedAccumulatedData { static fromBuffer(buffer: Buffer | BufferReader): CombinedAccumulatedData { const reader = BufferReader.asReader(buffer); return new CombinedAccumulatedData( - reader.readArray(MAX_READ_REQUESTS_PER_TX, SideEffect), + reader.readArray(MAX_NOTE_HASH_READ_REQUESTS_PER_TX, SideEffect), reader.readArray(MAX_NULLIFIER_READ_REQUESTS_PER_TX, ReadRequestContext), reader.readArray(MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_TX, NullifierKeyValidationRequestContext), reader.readArray(MAX_NEW_NOTE_HASHES_PER_TX, SideEffect), @@ -287,7 +287,7 @@ export class CombinedAccumulatedData { static empty() { return new CombinedAccumulatedData( - makeTuple(MAX_READ_REQUESTS_PER_TX, SideEffect.empty), + makeTuple(MAX_NOTE_HASH_READ_REQUESTS_PER_TX, SideEffect.empty), makeTuple(MAX_NULLIFIER_READ_REQUESTS_PER_TX, ReadRequestContext.empty), makeTuple(MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_TX, NullifierKeyValidationRequestContext.empty), makeTuple(MAX_NEW_NOTE_HASHES_PER_TX, SideEffect.empty), @@ -360,7 +360,7 @@ export class CombinedAccumulatedData { ); return new CombinedAccumulatedData( - revertible.readRequests, + revertible.noteHashReadRequests, revertible.nullifierReadRequests, revertible.nullifierKeyValidationRequests, newNoteHashes, @@ -384,7 +384,7 @@ export class PublicAccumulatedRevertibleData { /** * All the read requests made in this transaction. */ - public readRequests: Tuple, + public noteHashReadRequests: Tuple, /** * All the read requests for nullifiers made in this transaction. */ @@ -453,7 +453,7 @@ export class PublicAccumulatedRevertibleData { toBuffer() { return serializeToBuffer( - this.readRequests, + this.noteHashReadRequests, this.nullifierKeyValidationRequests, this.newNoteHashes, this.newNullifiers, @@ -482,7 +482,7 @@ export class PublicAccumulatedRevertibleData { static fromBuffer(buffer: Buffer | BufferReader) { const reader = BufferReader.asReader(buffer); return new this( - reader.readArray(MAX_READ_REQUESTS_PER_TX, SideEffect), + reader.readArray(MAX_NOTE_HASH_READ_REQUESTS_PER_TX, SideEffect), reader.readArray(MAX_NULLIFIER_READ_REQUESTS_PER_TX, ReadRequestContext), reader.readArray(MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_TX, NullifierKeyValidationRequestContext), reader.readArray(MAX_REVERTIBLE_NOTE_HASHES_PER_TX, SideEffect), @@ -502,7 +502,7 @@ export class PublicAccumulatedRevertibleData { static fromPrivateAccumulatedRevertibleData(finalData: PrivateAccumulatedRevertibleData) { return new this( - makeTuple(MAX_READ_REQUESTS_PER_TX, SideEffect.empty), + makeTuple(MAX_NOTE_HASH_READ_REQUESTS_PER_TX, SideEffect.empty), makeTuple(MAX_NULLIFIER_READ_REQUESTS_PER_TX, ReadRequestContext.empty), makeTuple(MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_TX, NullifierKeyValidationRequestContext.empty), padArrayEnd(finalData.newNoteHashes, SideEffect.empty(), MAX_REVERTIBLE_NOTE_HASHES_PER_TX), @@ -531,7 +531,7 @@ export class PublicAccumulatedRevertibleData { static empty() { return new this( - makeTuple(MAX_READ_REQUESTS_PER_TX, SideEffect.empty), + makeTuple(MAX_NOTE_HASH_READ_REQUESTS_PER_TX, SideEffect.empty), makeTuple(MAX_NULLIFIER_READ_REQUESTS_PER_TX, ReadRequestContext.empty), makeTuple(MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_TX, NullifierKeyValidationRequestContext.empty), makeTuple(MAX_REVERTIBLE_NOTE_HASHES_PER_TX, SideEffect.empty), diff --git a/yarn-project/circuits.js/src/structs/kernel/private_call_data.ts b/yarn-project/circuits.js/src/structs/kernel/private_call_data.ts index 81a27ee231b..eba16946eea 100644 --- a/yarn-project/circuits.js/src/structs/kernel/private_call_data.ts +++ b/yarn-project/circuits.js/src/structs/kernel/private_call_data.ts @@ -4,15 +4,15 @@ import { FieldsOf } from '@aztec/foundation/types'; import { FUNCTION_TREE_HEIGHT, + MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL, - MAX_READ_REQUESTS_PER_CALL, } from '../../constants.gen.js'; import { CallRequest } from '../call_request.js'; import { MembershipWitness } from '../membership_witness.js'; +import { NoteHashReadRequestMembershipWitness } from '../note_hash_read_request_membership_witness.js'; import { PrivateCallStackItem } from '../private_call_stack_item.js'; import { Proof } from '../proof.js'; -import { ReadRequestMembershipWitness } from '../read_request_membership_witness.js'; import { VerificationKey } from '../verification_key.js'; /** @@ -63,7 +63,10 @@ export class PrivateCallData { /** * The membership witnesses for read requests created by the function being invoked. */ - public readRequestMembershipWitnesses: Tuple, + public noteHashReadRequestMembershipWitnesses: Tuple< + NoteHashReadRequestMembershipWitness, + typeof MAX_NOTE_HASH_READ_REQUESTS_PER_CALL + >, /** * The address of the portal contract corresponding to the contract on which the function is being invoked. */ @@ -91,7 +94,7 @@ export class PrivateCallData { fields.publicKeysHash, fields.saltedInitializationHash, fields.functionLeafMembershipWitness, - fields.readRequestMembershipWitnesses, + fields.noteHashReadRequestMembershipWitnesses, fields.portalContractAddress, fields.acirHash, ] as const; @@ -127,7 +130,7 @@ export class PrivateCallData { reader.readObject(Fr), reader.readObject(Fr), reader.readObject(MembershipWitness.deserializer(FUNCTION_TREE_HEIGHT)), - reader.readArray(MAX_READ_REQUESTS_PER_CALL, ReadRequestMembershipWitness), + reader.readArray(MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, NoteHashReadRequestMembershipWitness), reader.readObject(Fr), reader.readObject(Fr), ); diff --git a/yarn-project/circuits.js/src/structs/kernel/private_kernel_tail_circuit_private_inputs.ts b/yarn-project/circuits.js/src/structs/kernel/private_kernel_tail_circuit_private_inputs.ts index e0d9f200947..da7f5cd14e1 100644 --- a/yarn-project/circuits.js/src/structs/kernel/private_kernel_tail_circuit_private_inputs.ts +++ b/yarn-project/circuits.js/src/structs/kernel/private_kernel_tail_circuit_private_inputs.ts @@ -3,8 +3,8 @@ import { BufferReader, Tuple, serializeToBuffer } from '@aztec/foundation/serial import { MAX_NEW_NOTE_HASHES_PER_TX, MAX_NEW_NULLIFIERS_PER_TX, + MAX_NOTE_HASH_READ_REQUESTS_PER_TX, MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_TX, - MAX_READ_REQUESTS_PER_TX, } from '../../constants.gen.js'; import { GrumpkinPrivateKey } from '../../index.js'; import { Fr, GrumpkinScalar } from '../index.js'; @@ -35,7 +35,7 @@ export class PrivateKernelTailCircuitPrivateInputs { /** * Contains hints for the transient read requests to localize corresponding commitments. */ - public readCommitmentHints: Tuple, + public readCommitmentHints: Tuple, /** * The sorted new nullifiers. Maps original to sorted. */ @@ -87,7 +87,7 @@ export class PrivateKernelTailCircuitPrivateInputs { reader.readObject(PrivateKernelInnerData), reader.readArray(MAX_NEW_NOTE_HASHES_PER_TX, SideEffect), reader.readNumbers(MAX_NEW_NOTE_HASHES_PER_TX), - reader.readArray(MAX_READ_REQUESTS_PER_TX, Fr), + reader.readArray(MAX_NOTE_HASH_READ_REQUESTS_PER_TX, Fr), reader.readArray(MAX_NEW_NULLIFIERS_PER_TX, SideEffectLinkedToNoteHash), reader.readNumbers(MAX_NEW_NULLIFIERS_PER_TX), reader.readObject({ fromBuffer: nullifierReadRequestResetHintsFromBuffer }), diff --git a/yarn-project/circuits.js/src/structs/note_hash_read_request_membership_witness.test.ts b/yarn-project/circuits.js/src/structs/note_hash_read_request_membership_witness.test.ts new file mode 100644 index 00000000000..64ef843ea2e --- /dev/null +++ b/yarn-project/circuits.js/src/structs/note_hash_read_request_membership_witness.test.ts @@ -0,0 +1,11 @@ +import { makeNoteHashReadRequestMembershipWitness } from '../tests/factories.js'; +import { NoteHashReadRequestMembershipWitness } from './note_hash_read_request_membership_witness.js'; + +describe('NoteHashReadRequestMembershipWitness', () => { + it('Data after serialization and deserialization is equal to the original', () => { + const original = makeNoteHashReadRequestMembershipWitness(0); + const buf = original.toBuffer(); + const afterSerialization = NoteHashReadRequestMembershipWitness.fromBuffer(buf); + expect(original).toEqual(afterSerialization); + }); +}); diff --git a/yarn-project/circuits.js/src/structs/read_request_membership_witness.ts b/yarn-project/circuits.js/src/structs/note_hash_read_request_membership_witness.ts similarity index 81% rename from yarn-project/circuits.js/src/structs/read_request_membership_witness.ts rename to yarn-project/circuits.js/src/structs/note_hash_read_request_membership_witness.ts index e77b32692ab..d9bb37c0c09 100644 --- a/yarn-project/circuits.js/src/structs/read_request_membership_witness.ts +++ b/yarn-project/circuits.js/src/structs/note_hash_read_request_membership_witness.ts @@ -11,7 +11,7 @@ import { MembershipWitness } from './membership_witness.js'; * some additional fields used to direct the kernel regarding whether a read is transient * and if so which commitment it corresponds to. */ -export class ReadRequestMembershipWitness { +export class NoteHashReadRequestMembershipWitness { constructor( /** * Index of a leaf in the Merkle tree. @@ -49,7 +49,7 @@ export class ReadRequestMembershipWitness { } static mock(size: number, start: number) { - return new ReadRequestMembershipWitness( + return new NoteHashReadRequestMembershipWitness( new Fr(start), range(size, start).map(x => new Fr(BigInt(x))) as Tuple, false, @@ -62,7 +62,7 @@ export class ReadRequestMembershipWitness { * @returns Random membership witness. */ public static random() { - return new ReadRequestMembershipWitness( + return new NoteHashReadRequestMembershipWitness( new Fr(0n), makeTuple(NOTE_HASH_TREE_HEIGHT, () => Fr.random()), false, @@ -75,18 +75,18 @@ export class ReadRequestMembershipWitness { * @param leafIndex - Index of the leaf in the Merkle tree. * @returns Membership witness with zero sibling path. */ - public static empty(leafIndex: bigint): ReadRequestMembershipWitness { + public static empty(leafIndex: bigint): NoteHashReadRequestMembershipWitness { const arr = makeTuple(NOTE_HASH_TREE_HEIGHT, () => Fr.ZERO); - return new ReadRequestMembershipWitness(new Fr(leafIndex), arr, false, new Fr(0)); + return new NoteHashReadRequestMembershipWitness(new Fr(leafIndex), arr, false, new Fr(0)); } /** * Creates a transient read request membership witness. * @returns an empty transient read request membership witness. */ - public static emptyTransient(): ReadRequestMembershipWitness { + public static emptyTransient(): NoteHashReadRequestMembershipWitness { const arr = makeTuple(NOTE_HASH_TREE_HEIGHT, () => Fr.ZERO); - return new ReadRequestMembershipWitness(new Fr(0), arr, true, new Fr(0)); + return new NoteHashReadRequestMembershipWitness(new Fr(0), arr, true, new Fr(0)); } static fromBufferArray( @@ -94,8 +94,8 @@ export class ReadRequestMembershipWitness { siblingPath: Tuple, isTransient: boolean, hintToNoteHash: Fr, - ): ReadRequestMembershipWitness { - return new ReadRequestMembershipWitness( + ): NoteHashReadRequestMembershipWitness { + return new NoteHashReadRequestMembershipWitness( leafIndex, siblingPath.map(x => Fr.fromBuffer(x)) as Tuple, isTransient, @@ -107,8 +107,8 @@ export class ReadRequestMembershipWitness { membershipWitness: MembershipWitness, isTransient: boolean, hintToNoteHash: Fr, - ): ReadRequestMembershipWitness { - return new ReadRequestMembershipWitness( + ): NoteHashReadRequestMembershipWitness { + return new NoteHashReadRequestMembershipWitness( new Fr(membershipWitness.leafIndex), membershipWitness.siblingPath as Tuple, isTransient, @@ -121,12 +121,12 @@ export class ReadRequestMembershipWitness { * @param buffer - Buffer or reader to read from. * @returns The deserialized `ReadRequestMembershipWitness`. */ - static fromBuffer(buffer: Buffer | BufferReader): ReadRequestMembershipWitness { + static fromBuffer(buffer: Buffer | BufferReader): NoteHashReadRequestMembershipWitness { const reader = BufferReader.asReader(buffer); const leafIndex = Fr.fromBuffer(reader); const siblingPath = reader.readArray(NOTE_HASH_TREE_HEIGHT, Fr); const isTransient = reader.readBoolean(); const hintToNoteHash = Fr.fromBuffer(reader); - return new ReadRequestMembershipWitness(leafIndex, siblingPath, isTransient, hintToNoteHash); + return new NoteHashReadRequestMembershipWitness(leafIndex, siblingPath, isTransient, hintToNoteHash); } } diff --git a/yarn-project/circuits.js/src/structs/private_circuit_public_inputs.ts b/yarn-project/circuits.js/src/structs/private_circuit_public_inputs.ts index c334ab1f393..af8fd80dac8 100644 --- a/yarn-project/circuits.js/src/structs/private_circuit_public_inputs.ts +++ b/yarn-project/circuits.js/src/structs/private_circuit_public_inputs.ts @@ -10,11 +10,11 @@ import { MAX_NEW_L2_TO_L1_MSGS_PER_CALL, MAX_NEW_NOTE_HASHES_PER_CALL, MAX_NEW_NULLIFIERS_PER_CALL, + MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_CALL, MAX_NULLIFIER_READ_REQUESTS_PER_CALL, MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL, - MAX_READ_REQUESTS_PER_CALL, NUM_FIELDS_PER_SHA256, PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH, RETURN_VALUES_LENGTH, @@ -52,7 +52,7 @@ export class PrivateCircuitPublicInputs { /** * Read requests created by the corresponding function call. */ - public readRequests: Tuple, + public noteHashReadRequests: Tuple, /** * Nullifier read requests created by the corresponding function call. */ @@ -151,7 +151,7 @@ export class PrivateCircuitPublicInputs { reader.readObject(Fr), reader.readArray(RETURN_VALUES_LENGTH, Fr), reader.readObject(Fr), - reader.readArray(MAX_READ_REQUESTS_PER_CALL, SideEffect), + reader.readArray(MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, SideEffect), reader.readArray(MAX_NULLIFIER_READ_REQUESTS_PER_CALL, ReadRequest), reader.readArray(MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_CALL, NullifierKeyValidationRequest), reader.readArray(MAX_NEW_NOTE_HASHES_PER_CALL, SideEffect), @@ -178,7 +178,7 @@ export class PrivateCircuitPublicInputs { reader.readField(), reader.readFieldArray(RETURN_VALUES_LENGTH), reader.readField(), - reader.readArray(MAX_READ_REQUESTS_PER_CALL, SideEffect), + reader.readArray(MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, SideEffect), reader.readArray(MAX_NULLIFIER_READ_REQUESTS_PER_CALL, ReadRequest), reader.readArray(MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_CALL, NullifierKeyValidationRequest), reader.readArray(MAX_NEW_NOTE_HASHES_PER_CALL, SideEffect), @@ -208,7 +208,7 @@ export class PrivateCircuitPublicInputs { Fr.ZERO, makeTuple(RETURN_VALUES_LENGTH, Fr.zero), Fr.ZERO, - makeTuple(MAX_READ_REQUESTS_PER_CALL, SideEffect.empty), + makeTuple(MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, SideEffect.empty), makeTuple(MAX_NULLIFIER_READ_REQUESTS_PER_CALL, ReadRequest.empty), makeTuple(MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_CALL, NullifierKeyValidationRequest.empty), makeTuple(MAX_NEW_NOTE_HASHES_PER_CALL, SideEffect.empty), @@ -238,7 +238,7 @@ export class PrivateCircuitPublicInputs { this.argsHash.isZero() && isZeroArray(this.returnValues) && this.minRevertibleSideEffectCounter.isZero() && - isEmptyArray(this.readRequests) && + isEmptyArray(this.noteHashReadRequests) && isEmptyArray(this.nullifierReadRequests) && isEmptyArray(this.nullifierKeyValidationRequests) && isEmptyArray(this.newNoteHashes) && @@ -268,7 +268,7 @@ export class PrivateCircuitPublicInputs { fields.argsHash, fields.returnValues, fields.minRevertibleSideEffectCounter, - fields.readRequests, + fields.noteHashReadRequests, fields.nullifierReadRequests, fields.nullifierKeyValidationRequests, fields.newNoteHashes, diff --git a/yarn-project/circuits.js/src/structs/read_request_membership_witness.test.ts b/yarn-project/circuits.js/src/structs/read_request_membership_witness.test.ts deleted file mode 100644 index ebda8f78924..00000000000 --- a/yarn-project/circuits.js/src/structs/read_request_membership_witness.test.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { makeReadRequestMembershipWitness } from '../tests/factories.js'; -import { ReadRequestMembershipWitness } from './read_request_membership_witness.js'; - -describe('ReadRequestMembershipWitness', () => { - it('Data after serialization and deserialization is equal to the original', () => { - const original = makeReadRequestMembershipWitness(0); - const buf = original.toBuffer(); - const afterSerialization = ReadRequestMembershipWitness.fromBuffer(buf); - expect(original).toEqual(afterSerialization); - }); -}); diff --git a/yarn-project/circuits.js/src/tests/factories.ts b/yarn-project/circuits.js/src/tests/factories.ts index b29457e88ce..f3d0b779a87 100644 --- a/yarn-project/circuits.js/src/tests/factories.ts +++ b/yarn-project/circuits.js/src/tests/factories.ts @@ -46,6 +46,8 @@ import { MAX_NON_REVERTIBLE_PUBLIC_CALL_STACK_LENGTH_PER_TX, MAX_NON_REVERTIBLE_PUBLIC_DATA_READS_PER_TX, MAX_NON_REVERTIBLE_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, + MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, + MAX_NOTE_HASH_READ_REQUESTS_PER_TX, MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_CALL, MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_TX, MAX_NULLIFIER_READ_REQUESTS_PER_CALL, @@ -58,8 +60,6 @@ import { MAX_PUBLIC_DATA_READS_PER_TX, MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL, MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, - MAX_READ_REQUESTS_PER_CALL, - MAX_READ_REQUESTS_PER_TX, MAX_REVERTIBLE_NOTE_HASHES_PER_TX, MAX_REVERTIBLE_NULLIFIERS_PER_TX, MAX_REVERTIBLE_PUBLIC_CALL_STACK_LENGTH_PER_TX, @@ -74,6 +74,7 @@ import { NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP, NUM_FIELDS_PER_SHA256, NewContractData, + NoteHashReadRequestMembershipWitness, NullifierKeyValidationRequest, NullifierKeyValidationRequestContext, NullifierLeafPreimage, @@ -108,7 +109,6 @@ import { ROLLUP_VK_TREE_HEIGHT, ReadRequest, ReadRequestContext, - ReadRequestMembershipWitness, RollupTypes, RootRollupInputs, RootRollupPublicInputs, @@ -262,7 +262,7 @@ export function makeCombinedAccumulatedData(seed = 1, full = false): CombinedAcc const tupleGenerator = full ? makeTuple : makeHalfFullTuple; return new CombinedAccumulatedData( - tupleGenerator(MAX_READ_REQUESTS_PER_TX, sideEffectFromNumber, seed + 0x80), + tupleGenerator(MAX_NOTE_HASH_READ_REQUESTS_PER_TX, sideEffectFromNumber, seed + 0x80), tupleGenerator(MAX_NULLIFIER_READ_REQUESTS_PER_TX, readRequestContextFromNumber, seed + 0x90), tupleGenerator( MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_TX, @@ -293,7 +293,7 @@ export function makeCombinedAccumulatedRevertibleData(seed = 1, full = false): P const tupleGenerator = full ? makeTuple : makeHalfFullTuple; return new PublicAccumulatedRevertibleData( - tupleGenerator(MAX_READ_REQUESTS_PER_TX, sideEffectFromNumber, seed + 0x80), + tupleGenerator(MAX_NOTE_HASH_READ_REQUESTS_PER_TX, sideEffectFromNumber, seed + 0x80), tupleGenerator(MAX_NULLIFIER_READ_REQUESTS_PER_TX, readRequestContextFromNumber, seed + 0x90), tupleGenerator( MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_TX, @@ -557,8 +557,8 @@ export function makeMembershipWitness(size: N, start: number): * @param start - The start of the membership witness. * @returns A non-transient read request membership witness. */ -export function makeReadRequestMembershipWitness(start: number): ReadRequestMembershipWitness { - return new ReadRequestMembershipWitness( +export function makeNoteHashReadRequestMembershipWitness(start: number): NoteHashReadRequestMembershipWitness { + return new NoteHashReadRequestMembershipWitness( new Fr(start), makeTuple(NOTE_HASH_TREE_HEIGHT, fr, start + 1), false, @@ -571,8 +571,13 @@ export function makeReadRequestMembershipWitness(start: number): ReadRequestMemb * @param start - The start of the membership witness. * @returns Non-transient empty read request membership witness. */ -export function makeEmptyReadRequestMembershipWitness(): ReadRequestMembershipWitness { - return new ReadRequestMembershipWitness(new Fr(0), makeTuple(NOTE_HASH_TREE_HEIGHT, Fr.zero), false, new Fr(0)); +export function makeEmptyNoteHashReadRequestMembershipWitness(): NoteHashReadRequestMembershipWitness { + return new NoteHashReadRequestMembershipWitness( + new Fr(0), + makeTuple(NOTE_HASH_TREE_HEIGHT, Fr.zero), + false, + new Fr(0), + ); } /** @@ -812,9 +817,9 @@ export function makePrivateCallData(seed = 1): PrivateCallData { publicKeysHash: fr(seed + 0x72), saltedInitializationHash: fr(seed + 0x73), functionLeafMembershipWitness: makeMembershipWitness(FUNCTION_TREE_HEIGHT, seed + 0x30), - readRequestMembershipWitnesses: makeTuple( - MAX_READ_REQUESTS_PER_CALL, - makeReadRequestMembershipWitness, + noteHashReadRequestMembershipWitnesses: makeTuple( + MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, + makeNoteHashReadRequestMembershipWitness, seed + 0x70, ), portalContractAddress: makeEthAddress(seed + 0x40).toField(), @@ -855,7 +860,7 @@ export function makePrivateCircuitPublicInputs(seed = 0): PrivateCircuitPublicIn argsHash: fr(seed + 0x100), returnValues: makeTuple(RETURN_VALUES_LENGTH, fr, seed + 0x200), minRevertibleSideEffectCounter: fr(0), - readRequests: makeTuple(MAX_READ_REQUESTS_PER_CALL, sideEffectFromNumber, seed + 0x300), + noteHashReadRequests: makeTuple(MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, sideEffectFromNumber, seed + 0x300), nullifierReadRequests: makeTuple(MAX_NULLIFIER_READ_REQUESTS_PER_CALL, readRequestFromNumber, seed + 0x310), nullifierKeyValidationRequests: makeTuple( MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_CALL, diff --git a/yarn-project/noir-protocol-circuits-types/src/__snapshots__/index.test.ts.snap b/yarn-project/noir-protocol-circuits-types/src/__snapshots__/index.test.ts.snap index 5c6f599a291..08fea4b3629 100644 --- a/yarn-project/noir-protocol-circuits-types/src/__snapshots__/index.test.ts.snap +++ b/yarn-project/noir-protocol-circuits-types/src/__snapshots__/index.test.ts.snap @@ -14308,9 +14308,9 @@ PrivateKernelInnerCircuitPublicInputs { }, }, ], - "nullifierKeyValidationRequests": [ - NullifierKeyValidationRequestContext { - "contractAddress": AztecAddress { + "noteHashReadRequests": [ + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -14350,90 +14350,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "publicKey": Point { - "kind": "point", - "x": Fr { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", - }, - }, - "y": Fr { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", - }, - }, - }, - "secretKey": Fq { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -14474,8 +14391,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - NullifierKeyValidationRequestContext { - "contractAddress": AztecAddress { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -14515,90 +14432,49 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "publicKey": Point { - "kind": "point", - "x": Fr { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", - }, - }, - "y": Fr { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", - }, + "value": Fr { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", }, }, - "secretKey": Fq { + }, + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -14638,9 +14514,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - }, - NullifierKeyValidationRequestContext { - "contractAddress": AztecAddress { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -14680,90 +14554,49 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "publicKey": Point { - "kind": "point", - "x": Fr { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", - }, - }, - "y": Fr { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", - }, + }, + SideEffect { + "counter": Fr { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", }, }, - "secretKey": Fq { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -14804,8 +14637,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - NullifierKeyValidationRequestContext { - "contractAddress": AztecAddress { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -14845,90 +14678,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "publicKey": Point { - "kind": "point", - "x": Fr { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", - }, - }, - "y": Fr { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", - }, - }, - }, - "secretKey": Fq { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -14969,10 +14719,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - ], - "nullifierReadRequests": [ - ReadRequestContext { - "contractAddress": AztecAddress { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -15012,7 +14760,6 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "counter": 0, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -15054,8 +14801,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - ReadRequestContext { - "contractAddress": AztecAddress { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -15095,7 +14842,6 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "counter": 0, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -15137,8 +14883,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - ReadRequestContext { - "contractAddress": AztecAddress { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -15178,7 +14924,6 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "counter": 0, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -15220,8 +14965,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - ReadRequestContext { - "contractAddress": AztecAddress { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -15261,7 +15006,6 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "counter": 0, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -15303,8 +15047,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - ReadRequestContext { - "contractAddress": AztecAddress { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -15344,7 +15088,6 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "counter": 0, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -15386,8 +15129,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - ReadRequestContext { - "contractAddress": AztecAddress { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -15427,7 +15170,6 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "counter": 0, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -15469,8 +15211,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - ReadRequestContext { - "contractAddress": AztecAddress { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -15510,7 +15252,6 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "counter": 0, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -15552,8 +15293,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - ReadRequestContext { - "contractAddress": AztecAddress { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -15593,7 +15334,6 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "counter": 0, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -15635,92 +15375,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - ], - "privateCallStack": [ - CallRequest { - "callerContext": CallerContext { - "msgSender": AztecAddress { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", - }, - }, - "storageContractAddress": AztecAddress { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", - }, - }, - }, - "callerContractAddress": AztecAddress { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -15760,7 +15416,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "endSideEffectCounter": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -15800,7 +15456,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "hash": Fr { + }, + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -15840,7 +15498,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "startSideEffectCounter": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -15881,90 +15539,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - CallRequest { - "callerContext": CallerContext { - "msgSender": AztecAddress { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", - }, - }, - "storageContractAddress": AztecAddress { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", - }, - }, - }, - "callerContractAddress": AztecAddress { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -16004,7 +15580,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "endSideEffectCounter": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -16044,7 +15620,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "hash": Fr { + }, + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -16084,7 +15662,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "startSideEffectCounter": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -16125,90 +15703,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - CallRequest { - "callerContext": CallerContext { - "msgSender": AztecAddress { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", - }, - }, - "storageContractAddress": AztecAddress { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", - }, - }, - }, - "callerContractAddress": AztecAddress { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -16248,7 +15744,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "endSideEffectCounter": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -16288,7 +15784,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "hash": Fr { + }, + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -16328,7 +15826,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "startSideEffectCounter": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -16369,90 +15867,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - CallRequest { - "callerContext": CallerContext { - "msgSender": AztecAddress { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", - }, - }, - "storageContractAddress": AztecAddress { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", - }, - }, - }, - "callerContractAddress": AztecAddress { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -16492,7 +15908,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "endSideEffectCounter": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -16532,7 +15948,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "hash": Fr { + }, + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -16572,7 +15990,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "startSideEffectCounter": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -16613,90 +16031,90 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - CallRequest { - "callerContext": CallerContext { - "msgSender": AztecAddress { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", - }, + SideEffect { + "counter": Fr { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", }, - "storageContractAddress": AztecAddress { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", - }, + }, + "value": Fr { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", }, }, - "callerContractAddress": AztecAddress { + }, + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -16736,7 +16154,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "endSideEffectCounter": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -16776,7 +16194,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "hash": Fr { + }, + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -16816,7 +16236,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "startSideEffectCounter": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -16857,90 +16277,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - CallRequest { - "callerContext": CallerContext { - "msgSender": AztecAddress { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", - }, - }, - "storageContractAddress": AztecAddress { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", - }, - }, - }, - "callerContractAddress": AztecAddress { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -16980,7 +16318,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "endSideEffectCounter": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -17020,7 +16358,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "hash": Fr { + }, + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -17060,7 +16400,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "startSideEffectCounter": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -17101,90 +16441,48 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - CallRequest { - "callerContext": CallerContext { - "msgSender": AztecAddress { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", - }, - }, - "storageContractAddress": AztecAddress { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", - }, + SideEffect { + "counter": Fr { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", }, }, - "callerContractAddress": AztecAddress { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -17224,7 +16522,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "endSideEffectCounter": Fr { + }, + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -17264,7 +16564,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "hash": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -17304,7 +16604,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "startSideEffectCounter": Fr { + }, + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -17344,91 +16646,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - }, - CallRequest { - "callerContext": CallerContext { - "msgSender": AztecAddress { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", - }, - }, - "storageContractAddress": AztecAddress { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", - }, - }, - }, - "callerContractAddress": AztecAddress { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -17468,7 +16686,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "endSideEffectCounter": Fr { + }, + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -17508,7 +16728,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "hash": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -17548,7 +16768,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "startSideEffectCounter": Fr { + }, + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -17588,93 +16810,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - }, - ], - "publicCallStack": [ - CallRequest { - "callerContext": CallerContext { - "msgSender": AztecAddress { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", - }, - }, - "storageContractAddress": AztecAddress { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", - }, - }, - }, - "callerContractAddress": AztecAddress { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -17714,7 +16850,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "endSideEffectCounter": Fr { + }, + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -17754,7 +16892,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "hash": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -17794,7 +16932,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "startSideEffectCounter": Fr { + }, + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -17834,91 +16974,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - }, - CallRequest { - "callerContext": CallerContext { - "msgSender": AztecAddress { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", - }, - }, - "storageContractAddress": AztecAddress { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", - }, - }, - }, - "callerContractAddress": AztecAddress { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -17958,7 +17014,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "endSideEffectCounter": Fr { + }, + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -17998,7 +17056,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "hash": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -18038,7 +17096,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "startSideEffectCounter": Fr { + }, + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -18078,91 +17138,49 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - }, - CallRequest { - "callerContext": CallerContext { - "msgSender": AztecAddress { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", - }, - }, - "storageContractAddress": AztecAddress { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", - }, + "value": Fr { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", }, }, - "callerContractAddress": AztecAddress { + }, + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -18202,7 +17220,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "endSideEffectCounter": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -18242,7 +17260,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "hash": Fr { + }, + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -18282,7 +17302,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "startSideEffectCounter": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -18323,90 +17343,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - CallRequest { - "callerContext": CallerContext { - "msgSender": AztecAddress { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", - }, - }, - "storageContractAddress": AztecAddress { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", - }, - }, - }, - "callerContractAddress": AztecAddress { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -18446,7 +17384,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "endSideEffectCounter": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -18486,7 +17424,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "hash": Fr { + }, + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -18526,7 +17466,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "startSideEffectCounter": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -18567,90 +17507,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - CallRequest { - "callerContext": CallerContext { - "msgSender": AztecAddress { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", - }, - }, - "storageContractAddress": AztecAddress { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", - }, - }, - }, - "callerContractAddress": AztecAddress { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -18690,7 +17548,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "endSideEffectCounter": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -18730,7 +17588,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "hash": Fr { + }, + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -18770,7 +17630,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "startSideEffectCounter": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -18811,90 +17671,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - CallRequest { - "callerContext": CallerContext { - "msgSender": AztecAddress { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", - }, - }, - "storageContractAddress": AztecAddress { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", - }, - }, - }, - "callerContractAddress": AztecAddress { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -18934,7 +17712,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "endSideEffectCounter": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -18974,7 +17752,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "hash": Fr { + }, + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -19014,7 +17794,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "startSideEffectCounter": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -19055,90 +17835,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - CallRequest { - "callerContext": CallerContext { - "msgSender": AztecAddress { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", - }, - }, - "storageContractAddress": AztecAddress { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", - }, - }, - }, - "callerContractAddress": AztecAddress { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -19178,7 +17876,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "endSideEffectCounter": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -19218,7 +17916,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "hash": Fr { + }, + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -19258,7 +17958,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "startSideEffectCounter": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -19299,90 +17999,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - CallRequest { - "callerContext": CallerContext { - "msgSender": AztecAddress { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", - }, - }, - "storageContractAddress": AztecAddress { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", - }, - }, - }, - "callerContractAddress": AztecAddress { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -19422,7 +18040,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "endSideEffectCounter": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -19462,7 +18080,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "hash": Fr { + }, + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -19502,7 +18122,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "startSideEffectCounter": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -19543,10 +18163,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - ], - "publicDataReads": [ - PublicDataRead { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -19586,7 +18204,6 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -19628,8 +18245,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - PublicDataRead { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -19669,7 +18286,6 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -19711,8 +18327,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - PublicDataRead { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -19752,7 +18368,6 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -19794,8 +18409,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - PublicDataRead { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -19835,7 +18450,6 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -19877,8 +18491,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - PublicDataRead { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -19918,7 +18532,6 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -19960,8 +18573,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - PublicDataRead { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -20001,7 +18614,6 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -20043,8 +18655,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - PublicDataRead { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -20084,7 +18696,6 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -20126,8 +18737,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - PublicDataRead { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -20167,7 +18778,6 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -20209,8 +18819,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - PublicDataRead { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -20250,7 +18860,6 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -20292,8 +18901,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - PublicDataRead { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -20333,7 +18942,6 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -20375,8 +18983,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - PublicDataRead { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -20416,7 +19024,6 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -20458,8 +19065,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - PublicDataRead { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -20499,7 +19106,6 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -20541,8 +19147,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - PublicDataRead { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -20582,7 +19188,6 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -20624,8 +19229,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - PublicDataRead { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -20665,7 +19270,6 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -20707,8 +19311,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - PublicDataRead { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -20748,7 +19352,6 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -20790,8 +19393,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - PublicDataRead { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -20831,7 +19434,6 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -20873,8 +19475,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - PublicDataRead { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -20914,7 +19516,6 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -20956,8 +19557,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - PublicDataRead { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -20997,7 +19598,6 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -21039,8 +19639,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - PublicDataRead { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -21080,7 +19680,6 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -21122,8 +19721,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - PublicDataRead { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -21163,7 +19762,6 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -21205,8 +19803,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - PublicDataRead { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -21246,7 +19844,6 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -21288,8 +19885,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - PublicDataRead { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -21329,7 +19926,6 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -21371,8 +19967,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - PublicDataRead { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -21412,7 +20008,6 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -21454,8 +20049,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - PublicDataRead { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -21495,7 +20090,6 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -21537,8 +20131,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - PublicDataRead { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -21578,7 +20172,6 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -21620,8 +20213,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - PublicDataRead { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -21661,7 +20254,6 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -21703,8 +20295,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - PublicDataRead { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -21744,7 +20336,6 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -21786,8 +20377,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - PublicDataRead { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -21827,7 +20418,6 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -21869,8 +20459,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - PublicDataRead { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -21910,7 +20500,6 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -21952,8 +20541,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - PublicDataRead { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -21993,7 +20582,6 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -22035,8 +20623,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - PublicDataRead { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -22076,7 +20664,6 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -22118,8 +20705,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - PublicDataRead { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -22159,7 +20746,6 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -22201,10 +20787,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - ], - "publicDataUpdateRequests": [ - PublicDataUpdateRequest { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -22244,7 +20828,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "newValue": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -22284,10 +20868,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, }, - PublicDataUpdateRequest { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -22327,7 +20910,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "newValue": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -22367,10 +20950,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, }, - PublicDataUpdateRequest { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -22410,7 +20992,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "newValue": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -22450,10 +21032,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, }, - PublicDataUpdateRequest { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -22493,7 +21074,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "newValue": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -22533,10 +21114,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, }, - PublicDataUpdateRequest { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -22576,7 +21156,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "newValue": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -22616,10 +21196,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, }, - PublicDataUpdateRequest { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -22659,7 +21238,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "newValue": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -22699,10 +21278,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, }, - PublicDataUpdateRequest { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -22742,7 +21320,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "newValue": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -22782,10 +21360,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, }, - PublicDataUpdateRequest { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -22825,7 +21402,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "newValue": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -22865,10 +21442,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, }, - PublicDataUpdateRequest { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -22908,7 +21484,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "newValue": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -22948,10 +21524,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, }, - PublicDataUpdateRequest { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -22991,7 +21566,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "newValue": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -23031,10 +21606,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, }, - PublicDataUpdateRequest { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -23074,7 +21648,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "newValue": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -23114,10 +21688,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, }, - PublicDataUpdateRequest { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -23157,7 +21730,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "newValue": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -23197,10 +21770,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, }, - PublicDataUpdateRequest { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -23240,7 +21812,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "newValue": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -23280,10 +21852,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, }, - PublicDataUpdateRequest { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -23323,7 +21894,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "newValue": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -23363,10 +21934,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, }, - PublicDataUpdateRequest { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -23406,7 +21976,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "newValue": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -23446,10 +22016,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, }, - PublicDataUpdateRequest { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -23489,7 +22058,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "newValue": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -23529,10 +22098,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, }, - PublicDataUpdateRequest { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -23572,7 +22140,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "newValue": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -23612,10 +22180,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, }, - PublicDataUpdateRequest { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -23655,7 +22222,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "newValue": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -23695,10 +22262,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, }, - PublicDataUpdateRequest { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -23738,7 +22304,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "newValue": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -23778,10 +22344,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, }, - PublicDataUpdateRequest { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -23821,7 +22386,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "newValue": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -23861,10 +22426,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, }, - PublicDataUpdateRequest { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -23904,7 +22468,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "newValue": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -23944,10 +22508,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, }, - PublicDataUpdateRequest { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -23987,7 +22550,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "newValue": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -24027,10 +22590,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, }, - PublicDataUpdateRequest { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -24070,7 +22632,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "newValue": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -24110,10 +22672,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, }, - PublicDataUpdateRequest { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -24153,7 +22714,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "newValue": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -24193,10 +22754,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, }, - PublicDataUpdateRequest { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -24236,7 +22796,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "newValue": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -24276,10 +22836,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, }, - PublicDataUpdateRequest { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -24319,7 +22878,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "newValue": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -24359,10 +22918,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, }, - PublicDataUpdateRequest { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -24402,7 +22960,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "newValue": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -24442,10 +23000,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, }, - PublicDataUpdateRequest { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -24485,7 +23042,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "newValue": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -24525,10 +23082,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, }, - PublicDataUpdateRequest { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -24568,7 +23124,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "newValue": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -24608,10 +23164,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, }, - PublicDataUpdateRequest { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -24651,7 +23206,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "newValue": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -24691,10 +23246,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, }, - PublicDataUpdateRequest { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -24734,7 +23288,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "newValue": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -24774,10 +23328,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, }, - PublicDataUpdateRequest { - "leafSlot": Fr { + SideEffect { + "counter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -24817,7 +23370,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "newValue": Fr { + "value": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -24857,10 +23410,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "sideEffectCounter": undefined, }, - ], - "readRequests": [ SideEffect { "counter": Fr { "asBigInt": 0n, @@ -26255,8 +24805,10 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + ], + "nullifierKeyValidationRequests": [ + NullifierKeyValidationRequestContext { + "contractAddress": AztecAddress { "asBigInt": 0n, "asBuffer": { "data": [ @@ -26296,30 +24848,113 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, + "publicKey": Point { + "kind": "point", + "x": Fr { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", + }, + }, + "y": Fr { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", + }, + }, + }, + "secretKey": Fq { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, 0, 0, 0, @@ -26337,8 +24972,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + NullifierKeyValidationRequestContext { + "contractAddress": AztecAddress { "asBigInt": 0n, "asBuffer": { "data": [ @@ -26378,7 +25013,132 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "publicKey": Point { + "kind": "point", + "x": Fr { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", + }, + }, + "y": Fr { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", + }, + }, + }, + "secretKey": Fq { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", + }, + }, + }, + NullifierKeyValidationRequestContext { + "contractAddress": AztecAddress { "asBigInt": 0n, "asBuffer": { "data": [ @@ -26418,9 +25178,90 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - }, - SideEffect { - "counter": Fr { + "publicKey": Point { + "kind": "point", + "x": Fr { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", + }, + }, + "y": Fr { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", + }, + }, + }, + "secretKey": Fq { "asBigInt": 0n, "asBuffer": { "data": [ @@ -26460,7 +25301,9 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + }, + NullifierKeyValidationRequestContext { + "contractAddress": AztecAddress { "asBigInt": 0n, "asBuffer": { "data": [ @@ -26500,49 +25343,90 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - }, - SideEffect { - "counter": Fr { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", + "publicKey": Point { + "kind": "point", + "x": Fr { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", + }, + }, + "y": Fr { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", + }, }, }, - "value": Fr { + "secretKey": Fq { "asBigInt": 0n, "asBuffer": { "data": [ @@ -26583,8 +25467,10 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + ], + "nullifierReadRequests": [ + ReadRequestContext { + "contractAddress": AztecAddress { "asBigInt": 0n, "asBuffer": { "data": [ @@ -26624,6 +25510,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "counter": 0, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -26665,8 +25552,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + ReadRequestContext { + "contractAddress": AztecAddress { "asBigInt": 0n, "asBuffer": { "data": [ @@ -26706,6 +25593,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "counter": 0, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -26747,8 +25635,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + ReadRequestContext { + "contractAddress": AztecAddress { "asBigInt": 0n, "asBuffer": { "data": [ @@ -26788,6 +25676,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "counter": 0, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -26829,8 +25718,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + ReadRequestContext { + "contractAddress": AztecAddress { "asBigInt": 0n, "asBuffer": { "data": [ @@ -26870,6 +25759,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "counter": 0, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -26911,8 +25801,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + ReadRequestContext { + "contractAddress": AztecAddress { "asBigInt": 0n, "asBuffer": { "data": [ @@ -26952,6 +25842,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "counter": 0, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -26993,8 +25884,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + ReadRequestContext { + "contractAddress": AztecAddress { "asBigInt": 0n, "asBuffer": { "data": [ @@ -27034,6 +25925,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "counter": 0, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -27075,8 +25967,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + ReadRequestContext { + "contractAddress": AztecAddress { "asBigInt": 0n, "asBuffer": { "data": [ @@ -27116,6 +26008,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "counter": 0, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -27157,8 +26050,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + ReadRequestContext { + "contractAddress": AztecAddress { "asBigInt": 0n, "asBuffer": { "data": [ @@ -27198,6 +26091,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "counter": 0, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -27238,9 +26132,93 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - }, - SideEffect { - "counter": Fr { + }, + ], + "privateCallStack": [ + CallRequest { + "callerContext": CallerContext { + "msgSender": AztecAddress { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", + }, + }, + "storageContractAddress": AztecAddress { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", + }, + }, + }, + "callerContractAddress": AztecAddress { "asBigInt": 0n, "asBuffer": { "data": [ @@ -27280,7 +26258,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "endSideEffectCounter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -27320,9 +26298,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - }, - SideEffect { - "counter": Fr { + "hash": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -27362,7 +26338,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "startSideEffectCounter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -27403,8 +26379,90 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + CallRequest { + "callerContext": CallerContext { + "msgSender": AztecAddress { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", + }, + }, + "storageContractAddress": AztecAddress { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", + }, + }, + }, + "callerContractAddress": AztecAddress { "asBigInt": 0n, "asBuffer": { "data": [ @@ -27444,7 +26502,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "endSideEffectCounter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -27484,9 +26542,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - }, - SideEffect { - "counter": Fr { + "hash": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -27526,7 +26582,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "startSideEffectCounter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -27567,8 +26623,90 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + CallRequest { + "callerContext": CallerContext { + "msgSender": AztecAddress { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", + }, + }, + "storageContractAddress": AztecAddress { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", + }, + }, + }, + "callerContractAddress": AztecAddress { "asBigInt": 0n, "asBuffer": { "data": [ @@ -27608,7 +26746,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "endSideEffectCounter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -27648,9 +26786,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - }, - SideEffect { - "counter": Fr { + "hash": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -27690,7 +26826,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "startSideEffectCounter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -27730,9 +26866,91 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - }, - SideEffect { - "counter": Fr { + }, + CallRequest { + "callerContext": CallerContext { + "msgSender": AztecAddress { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", + }, + }, + "storageContractAddress": AztecAddress { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", + }, + }, + }, + "callerContractAddress": AztecAddress { "asBigInt": 0n, "asBuffer": { "data": [ @@ -27772,7 +26990,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "endSideEffectCounter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -27812,9 +27030,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - }, - SideEffect { - "counter": Fr { + "hash": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -27854,7 +27070,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "startSideEffectCounter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -27895,8 +27111,90 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + CallRequest { + "callerContext": CallerContext { + "msgSender": AztecAddress { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", + }, + }, + "storageContractAddress": AztecAddress { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", + }, + }, + }, + "callerContractAddress": AztecAddress { "asBigInt": 0n, "asBuffer": { "data": [ @@ -27936,7 +27234,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "endSideEffectCounter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -27976,9 +27274,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - }, - SideEffect { - "counter": Fr { + "hash": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -28018,7 +27314,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "startSideEffectCounter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -28059,48 +27355,90 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", + CallRequest { + "callerContext": CallerContext { + "msgSender": AztecAddress { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", + }, + }, + "storageContractAddress": AztecAddress { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", + }, }, }, - "value": Fr { + "callerContractAddress": AztecAddress { "asBigInt": 0n, "asBuffer": { "data": [ @@ -28140,9 +27478,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - }, - SideEffect { - "counter": Fr { + "endSideEffectCounter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -28182,7 +27518,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "hash": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -28222,9 +27558,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - }, - SideEffect { - "counter": Fr { + "startSideEffectCounter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -28264,49 +27598,91 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", + }, + CallRequest { + "callerContext": CallerContext { + "msgSender": AztecAddress { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", + }, + }, + "storageContractAddress": AztecAddress { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", + }, }, }, - }, - SideEffect { - "counter": Fr { + "callerContractAddress": AztecAddress { "asBigInt": 0n, "asBuffer": { "data": [ @@ -28346,7 +27722,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "endSideEffectCounter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -28386,9 +27762,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - }, - SideEffect { - "counter": Fr { + "hash": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -28428,7 +27802,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "startSideEffectCounter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -28469,48 +27843,90 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", + CallRequest { + "callerContext": CallerContext { + "msgSender": AztecAddress { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", + }, + }, + "storageContractAddress": AztecAddress { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", + }, }, }, - "value": Fr { + "callerContractAddress": AztecAddress { "asBigInt": 0n, "asBuffer": { "data": [ @@ -28550,9 +27966,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - }, - SideEffect { - "counter": Fr { + "endSideEffectCounter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -28592,7 +28006,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "hash": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -28632,9 +28046,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - }, - SideEffect { - "counter": Fr { + "startSideEffectCounter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -28674,49 +28086,93 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", + }, + ], + "publicCallStack": [ + CallRequest { + "callerContext": CallerContext { + "msgSender": AztecAddress { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", + }, + }, + "storageContractAddress": AztecAddress { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", + }, }, }, - }, - SideEffect { - "counter": Fr { + "callerContractAddress": AztecAddress { "asBigInt": 0n, "asBuffer": { "data": [ @@ -28756,7 +28212,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "endSideEffectCounter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -28796,9 +28252,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - }, - SideEffect { - "counter": Fr { + "hash": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -28838,7 +28292,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "startSideEffectCounter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -28879,48 +28333,90 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", + CallRequest { + "callerContext": CallerContext { + "msgSender": AztecAddress { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", + }, + }, + "storageContractAddress": AztecAddress { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", + }, }, }, - "value": Fr { + "callerContractAddress": AztecAddress { "asBigInt": 0n, "asBuffer": { "data": [ @@ -28960,9 +28456,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - }, - SideEffect { - "counter": Fr { + "endSideEffectCounter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -29002,7 +28496,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "hash": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -29042,9 +28536,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - }, - SideEffect { - "counter": Fr { + "startSideEffectCounter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -29084,49 +28576,91 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { - "asBigInt": 0n, - "asBuffer": { - "data": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - ], - "type": "Buffer", + }, + CallRequest { + "callerContext": CallerContext { + "msgSender": AztecAddress { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", + }, + }, + "storageContractAddress": AztecAddress { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", + }, }, }, - }, - SideEffect { - "counter": Fr { + "callerContractAddress": AztecAddress { "asBigInt": 0n, "asBuffer": { "data": [ @@ -29166,7 +28700,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "endSideEffectCounter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -29206,9 +28740,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - }, - SideEffect { - "counter": Fr { + "hash": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -29248,7 +28780,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "startSideEffectCounter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -29289,8 +28821,90 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + CallRequest { + "callerContext": CallerContext { + "msgSender": AztecAddress { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", + }, + }, + "storageContractAddress": AztecAddress { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", + }, + }, + }, + "callerContractAddress": AztecAddress { "asBigInt": 0n, "asBuffer": { "data": [ @@ -29330,7 +28944,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "endSideEffectCounter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -29370,9 +28984,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - }, - SideEffect { - "counter": Fr { + "hash": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -29412,7 +29024,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "startSideEffectCounter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -29453,8 +29065,90 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + CallRequest { + "callerContext": CallerContext { + "msgSender": AztecAddress { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", + }, + }, + "storageContractAddress": AztecAddress { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", + }, + }, + }, + "callerContractAddress": AztecAddress { "asBigInt": 0n, "asBuffer": { "data": [ @@ -29494,7 +29188,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "endSideEffectCounter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -29534,9 +29228,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - }, - SideEffect { - "counter": Fr { + "hash": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -29576,7 +29268,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "startSideEffectCounter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -29617,8 +29309,90 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + CallRequest { + "callerContext": CallerContext { + "msgSender": AztecAddress { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", + }, + }, + "storageContractAddress": AztecAddress { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", + }, + }, + }, + "callerContractAddress": AztecAddress { "asBigInt": 0n, "asBuffer": { "data": [ @@ -29658,7 +29432,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "endSideEffectCounter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -29698,9 +29472,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - }, - SideEffect { - "counter": Fr { + "hash": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -29740,7 +29512,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "startSideEffectCounter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -29780,9 +29552,91 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - }, - SideEffect { - "counter": Fr { + }, + CallRequest { + "callerContext": CallerContext { + "msgSender": AztecAddress { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", + }, + }, + "storageContractAddress": AztecAddress { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", + }, + }, + }, + "callerContractAddress": AztecAddress { "asBigInt": 0n, "asBuffer": { "data": [ @@ -29822,7 +29676,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "endSideEffectCounter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -29862,9 +29716,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - }, - SideEffect { - "counter": Fr { + "hash": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -29904,7 +29756,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "startSideEffectCounter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -29945,8 +29797,90 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + CallRequest { + "callerContext": CallerContext { + "msgSender": AztecAddress { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", + }, + }, + "storageContractAddress": AztecAddress { + "asBigInt": 0n, + "asBuffer": { + "data": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "type": "Buffer", + }, + }, + }, + "callerContractAddress": AztecAddress { "asBigInt": 0n, "asBuffer": { "data": [ @@ -29986,7 +29920,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "endSideEffectCounter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -30026,9 +29960,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - }, - SideEffect { - "counter": Fr { + "hash": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -30068,7 +30000,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "startSideEffectCounter": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -30109,8 +30041,10 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + ], + "publicDataReads": [ + PublicDataRead { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -30150,6 +30084,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -30191,8 +30126,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + PublicDataRead { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -30232,6 +30167,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -30273,8 +30209,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + PublicDataRead { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -30314,6 +30250,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -30355,8 +30292,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + PublicDataRead { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -30396,6 +30333,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -30437,8 +30375,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + PublicDataRead { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -30478,6 +30416,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -30519,8 +30458,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + PublicDataRead { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -30560,6 +30499,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -30601,8 +30541,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + PublicDataRead { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -30642,6 +30582,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -30683,8 +30624,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + PublicDataRead { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -30724,6 +30665,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -30765,8 +30707,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + PublicDataRead { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -30806,6 +30748,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -30847,8 +30790,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + PublicDataRead { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -30888,6 +30831,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -30929,8 +30873,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + PublicDataRead { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -30970,6 +30914,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -31011,8 +30956,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + PublicDataRead { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -31052,6 +30997,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -31093,8 +31039,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + PublicDataRead { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -31134,6 +31080,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -31175,8 +31122,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + PublicDataRead { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -31216,6 +31163,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -31257,8 +31205,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + PublicDataRead { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -31298,6 +31246,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -31339,8 +31288,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + PublicDataRead { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -31380,6 +31329,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -31421,8 +31371,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + PublicDataRead { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -31462,6 +31412,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -31503,8 +31454,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + PublicDataRead { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -31544,6 +31495,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -31585,8 +31537,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + PublicDataRead { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -31626,6 +31578,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -31667,8 +31620,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + PublicDataRead { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -31708,6 +31661,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -31749,8 +31703,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + PublicDataRead { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -31790,6 +31744,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -31831,8 +31786,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + PublicDataRead { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -31872,6 +31827,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -31913,8 +31869,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + PublicDataRead { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -31954,6 +31910,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -31995,8 +31952,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + PublicDataRead { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -32036,6 +31993,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -32077,8 +32035,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + PublicDataRead { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -32118,6 +32076,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -32159,8 +32118,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + PublicDataRead { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -32200,6 +32159,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -32241,8 +32201,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + PublicDataRead { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -32282,6 +32242,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -32323,8 +32284,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + PublicDataRead { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -32364,6 +32325,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -32405,8 +32367,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + PublicDataRead { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -32446,6 +32408,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -32487,8 +32450,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + PublicDataRead { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -32528,6 +32491,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -32569,8 +32533,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + PublicDataRead { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -32610,6 +32574,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -32651,8 +32616,8 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + PublicDataRead { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -32692,6 +32657,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, "value": Fr { "asBigInt": 0n, "asBuffer": { @@ -32733,8 +32699,10 @@ PrivateKernelInnerCircuitPublicInputs { }, }, }, - SideEffect { - "counter": Fr { + ], + "publicDataUpdateRequests": [ + PublicDataUpdateRequest { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -32774,7 +32742,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "newValue": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -32814,9 +32782,10 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, }, - SideEffect { - "counter": Fr { + PublicDataUpdateRequest { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -32856,7 +32825,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "newValue": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -32896,9 +32865,10 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, }, - SideEffect { - "counter": Fr { + PublicDataUpdateRequest { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -32938,7 +32908,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "newValue": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -32978,9 +32948,10 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, }, - SideEffect { - "counter": Fr { + PublicDataUpdateRequest { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -33020,7 +32991,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "newValue": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -33060,9 +33031,10 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, }, - SideEffect { - "counter": Fr { + PublicDataUpdateRequest { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -33102,7 +33074,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "newValue": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -33142,9 +33114,10 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, }, - SideEffect { - "counter": Fr { + PublicDataUpdateRequest { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -33184,7 +33157,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "newValue": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -33224,9 +33197,10 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, }, - SideEffect { - "counter": Fr { + PublicDataUpdateRequest { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -33266,7 +33240,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "newValue": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -33306,9 +33280,10 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, }, - SideEffect { - "counter": Fr { + PublicDataUpdateRequest { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -33348,7 +33323,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "newValue": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -33388,9 +33363,10 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, }, - SideEffect { - "counter": Fr { + PublicDataUpdateRequest { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -33430,7 +33406,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "newValue": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -33470,9 +33446,10 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, }, - SideEffect { - "counter": Fr { + PublicDataUpdateRequest { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -33512,7 +33489,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "newValue": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -33552,9 +33529,10 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, }, - SideEffect { - "counter": Fr { + PublicDataUpdateRequest { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -33594,7 +33572,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "newValue": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -33634,9 +33612,10 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, }, - SideEffect { - "counter": Fr { + PublicDataUpdateRequest { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -33676,7 +33655,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "newValue": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -33716,9 +33695,10 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, }, - SideEffect { - "counter": Fr { + PublicDataUpdateRequest { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -33758,7 +33738,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "newValue": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -33798,9 +33778,10 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, }, - SideEffect { - "counter": Fr { + PublicDataUpdateRequest { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -33840,7 +33821,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "newValue": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -33880,9 +33861,10 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, }, - SideEffect { - "counter": Fr { + PublicDataUpdateRequest { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -33922,7 +33904,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "newValue": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -33962,9 +33944,10 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, }, - SideEffect { - "counter": Fr { + PublicDataUpdateRequest { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -34004,7 +33987,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "newValue": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -34044,9 +34027,10 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, }, - SideEffect { - "counter": Fr { + PublicDataUpdateRequest { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -34086,7 +34070,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "newValue": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -34126,9 +34110,10 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, }, - SideEffect { - "counter": Fr { + PublicDataUpdateRequest { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -34168,7 +34153,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "newValue": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -34208,9 +34193,10 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, }, - SideEffect { - "counter": Fr { + PublicDataUpdateRequest { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -34250,7 +34236,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "newValue": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -34290,9 +34276,10 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, }, - SideEffect { - "counter": Fr { + PublicDataUpdateRequest { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -34332,7 +34319,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "newValue": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -34372,9 +34359,10 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, }, - SideEffect { - "counter": Fr { + PublicDataUpdateRequest { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -34414,7 +34402,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "newValue": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -34454,9 +34442,10 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, }, - SideEffect { - "counter": Fr { + PublicDataUpdateRequest { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -34496,7 +34485,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "newValue": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -34536,9 +34525,10 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, }, - SideEffect { - "counter": Fr { + PublicDataUpdateRequest { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -34578,7 +34568,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "newValue": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -34618,9 +34608,10 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, }, - SideEffect { - "counter": Fr { + PublicDataUpdateRequest { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -34660,7 +34651,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "newValue": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -34700,9 +34691,10 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, }, - SideEffect { - "counter": Fr { + PublicDataUpdateRequest { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -34742,7 +34734,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "newValue": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -34782,9 +34774,10 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, }, - SideEffect { - "counter": Fr { + PublicDataUpdateRequest { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -34824,7 +34817,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "newValue": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -34864,9 +34857,10 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, }, - SideEffect { - "counter": Fr { + PublicDataUpdateRequest { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -34906,7 +34900,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "newValue": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -34946,9 +34940,10 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, }, - SideEffect { - "counter": Fr { + PublicDataUpdateRequest { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -34988,7 +34983,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "newValue": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -35028,9 +35023,10 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, }, - SideEffect { - "counter": Fr { + PublicDataUpdateRequest { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -35070,7 +35066,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "newValue": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -35110,9 +35106,10 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, }, - SideEffect { - "counter": Fr { + PublicDataUpdateRequest { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -35152,7 +35149,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "newValue": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -35192,9 +35189,10 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, }, - SideEffect { - "counter": Fr { + PublicDataUpdateRequest { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -35234,7 +35232,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "newValue": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -35274,9 +35272,10 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, }, - SideEffect { - "counter": Fr { + PublicDataUpdateRequest { + "leafSlot": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -35316,7 +35315,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, - "value": Fr { + "newValue": Fr { "asBigInt": 0n, "asBuffer": { "data": [ @@ -35356,6 +35355,7 @@ PrivateKernelInnerCircuitPublicInputs { "type": "Buffer", }, }, + "sideEffectCounter": undefined, }, ], "unencryptedLogPreimagesLength": Fr { diff --git a/yarn-project/noir-protocol-circuits-types/src/type_conversion.ts b/yarn-project/noir-protocol-circuits-types/src/type_conversion.ts index ff701339680..0142e245046 100644 --- a/yarn-project/noir-protocol-circuits-types/src/type_conversion.ts +++ b/yarn-project/noir-protocol-circuits-types/src/type_conversion.ts @@ -34,13 +34,13 @@ import { MAX_NON_REVERTIBLE_PUBLIC_CALL_STACK_LENGTH_PER_TX, MAX_NON_REVERTIBLE_PUBLIC_DATA_READS_PER_TX, MAX_NON_REVERTIBLE_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, + MAX_NOTE_HASH_READ_REQUESTS_PER_TX, MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_TX, MAX_NULLIFIER_READ_REQUESTS_PER_TX, MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX, MAX_PUBLIC_CALL_STACK_LENGTH_PER_TX, MAX_PUBLIC_DATA_READS_PER_TX, MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, - MAX_READ_REQUESTS_PER_TX, MAX_REVERTIBLE_NOTE_HASHES_PER_TX, MAX_REVERTIBLE_NULLIFIERS_PER_TX, MAX_REVERTIBLE_PUBLIC_CALL_STACK_LENGTH_PER_TX, @@ -51,6 +51,7 @@ import { NULLIFIER_TREE_HEIGHT, NUM_FIELDS_PER_SHA256, NewContractData, + NoteHashReadRequestMembershipWitness, NullifierKeyValidationRequest, NullifierKeyValidationRequestContext, NullifierLeafPreimage, @@ -85,7 +86,6 @@ import { PublicKernelData, ReadRequest, ReadRequestContext, - ReadRequestMembershipWitness, ReadRequestStatus, RollupKernelCircuitPublicInputs, RollupKernelData, @@ -119,6 +119,7 @@ import { EthAddress as NoirEthAddress, Field as NoirField, GrumpkinPoint as NoirPoint, + NoteHashReadRequestMembershipWitness as NoteHashReadRequestMembershipWitnessNoir, NullifierKeyValidationRequestContext as NullifierKeyValidationRequestContextNoir, NullifierKeyValidationRequest as NullifierKeyValidationRequestNoir, PrivateCallData as PrivateCallDataNoir, @@ -128,7 +129,6 @@ import { PublicDataRead as PublicDataReadNoir, PublicDataUpdateRequest as PublicDataUpdateRequestNoir, ReadRequestContext as ReadRequestContextNoir, - ReadRequestMembershipWitness as ReadRequestMembershipWitnessNoir, ReadRequest as ReadRequestNoir, SideEffectLinkedToNoteHash as SideEffectLinkedToNoteHashNoir, SideEffect as SideEffectNoir, @@ -722,7 +722,7 @@ export function mapPrivateCircuitPublicInputsToNoir( call_context: mapCallContextToNoir(privateCircuitPublicInputs.callContext), args_hash: mapFieldToNoir(privateCircuitPublicInputs.argsHash), return_values: mapTuple(privateCircuitPublicInputs.returnValues, mapFieldToNoir), - read_requests: mapTuple(privateCircuitPublicInputs.readRequests, mapSideEffectToNoir), + note_hash_read_requests: mapTuple(privateCircuitPublicInputs.noteHashReadRequests, mapSideEffectToNoir), nullifier_read_requests: mapTuple(privateCircuitPublicInputs.nullifierReadRequests, mapSideEffectToNoir), nullifier_key_validation_requests: mapTuple( privateCircuitPublicInputs.nullifierKeyValidationRequests, @@ -775,17 +775,17 @@ function mapFunctionLeafMembershipWitnessToNoir( /** * Maps a read request membership witness to a noir read request membership witness. - * @param readRequestMembershipWitness - The read request membership witness. + * @param noteHashReadRequestMembershipWitness - The read request membership witness. * @returns The noir read request membership witness. */ -export function mapReadRequestMembershipWitnessToNoir( - readRequestMembershipWitness: ReadRequestMembershipWitness, -): ReadRequestMembershipWitnessNoir { +export function mapNoteHashReadRequestMembershipWitnessToNoir( + noteHashReadRequestMembershipWitness: NoteHashReadRequestMembershipWitness, +): NoteHashReadRequestMembershipWitnessNoir { return { - leaf_index: mapFieldToNoir(readRequestMembershipWitness.leafIndex), - sibling_path: mapTuple(readRequestMembershipWitness.siblingPath, mapFieldToNoir), - is_transient: readRequestMembershipWitness.isTransient, - hint_to_note_hash: mapFieldToNoir(readRequestMembershipWitness.hintToNoteHash), + leaf_index: mapFieldToNoir(noteHashReadRequestMembershipWitness.leafIndex), + sibling_path: mapTuple(noteHashReadRequestMembershipWitness.siblingPath, mapFieldToNoir), + is_transient: noteHashReadRequestMembershipWitness.isTransient, + hint_to_note_hash: mapFieldToNoir(noteHashReadRequestMembershipWitness.hintToNoteHash), }; } @@ -804,9 +804,9 @@ export function mapPrivateCallDataToNoir(privateCallData: PrivateCallData): Priv function_leaf_membership_witness: mapFunctionLeafMembershipWitnessToNoir( privateCallData.functionLeafMembershipWitness, ), - read_request_membership_witnesses: mapTuple( - privateCallData.readRequestMembershipWitnesses, - mapReadRequestMembershipWitnessToNoir, + note_hash_read_request_membership_witnesses: mapTuple( + privateCallData.noteHashReadRequestMembershipWitnesses, + mapNoteHashReadRequestMembershipWitnessToNoir, ), contract_class_artifact_hash: mapFieldToNoir(privateCallData.contractClassArtifactHash), contract_class_public_bytecode_commitment: mapFieldToNoir(privateCallData.contractClassPublicBytecodeCommitment), @@ -972,7 +972,11 @@ export function mapCombinedAccumulatedDataFromNoir( combinedAccumulatedData: CombinedAccumulatedDataNoir, ): CombinedAccumulatedData { return new CombinedAccumulatedData( - mapTupleFromNoir(combinedAccumulatedData.read_requests, MAX_READ_REQUESTS_PER_TX, mapSideEffectFromNoir), + mapTupleFromNoir( + combinedAccumulatedData.note_hash_read_requests, + MAX_NOTE_HASH_READ_REQUESTS_PER_TX, + mapSideEffectFromNoir, + ), mapTupleFromNoir( combinedAccumulatedData.nullifier_read_requests, MAX_NULLIFIER_READ_REQUESTS_PER_TX, @@ -1112,7 +1116,7 @@ export function mapCombinedAccumulatedDataToNoir( combinedAccumulatedData: CombinedAccumulatedData, ): CombinedAccumulatedDataNoir { return { - read_requests: mapTuple(combinedAccumulatedData.readRequests, mapSideEffectToNoir), + note_hash_read_requests: mapTuple(combinedAccumulatedData.noteHashReadRequests, mapSideEffectToNoir), nullifier_read_requests: mapTuple(combinedAccumulatedData.nullifierReadRequests, mapReadRequestContextToNoir), nullifier_key_validation_requests: mapTuple( combinedAccumulatedData.nullifierKeyValidationRequests, @@ -1202,7 +1206,7 @@ export function mapPublicAccumulatedRevertibleDataToNoir( data: PublicAccumulatedRevertibleData, ): PublicAccumulatedRevertibleDataNoir { return { - read_requests: mapTuple(data.readRequests, mapSideEffectToNoir), + note_hash_read_requests: mapTuple(data.noteHashReadRequests, mapSideEffectToNoir), nullifier_read_requests: mapTuple(data.nullifierReadRequests, mapReadRequestContextToNoir), nullifier_key_validation_requests: mapTuple( data.nullifierKeyValidationRequests, @@ -1433,7 +1437,7 @@ export function mapPublicAccumulatedRevertibleDataFromNoir( data: PublicAccumulatedRevertibleDataNoir, ): PublicAccumulatedRevertibleData { return new PublicAccumulatedRevertibleData( - mapTupleFromNoir(data.read_requests, MAX_READ_REQUESTS_PER_TX, mapSideEffectFromNoir), + mapTupleFromNoir(data.note_hash_read_requests, MAX_NOTE_HASH_READ_REQUESTS_PER_TX, mapSideEffectFromNoir), mapTupleFromNoir(data.nullifier_read_requests, MAX_NULLIFIER_READ_REQUESTS_PER_TX, mapReadRequestContextFromNoir), mapTupleFromNoir( data.nullifier_key_validation_requests, diff --git a/yarn-project/pxe/src/kernel_prover/hints_builder.ts b/yarn-project/pxe/src/kernel_prover/hints_builder.ts index c8c6815648c..5ebd2abe738 100644 --- a/yarn-project/pxe/src/kernel_prover/hints_builder.ts +++ b/yarn-project/pxe/src/kernel_prover/hints_builder.ts @@ -3,9 +3,9 @@ import { GrumpkinScalar, MAX_NEW_NOTE_HASHES_PER_TX, MAX_NEW_NULLIFIERS_PER_TX, + MAX_NOTE_HASH_READ_REQUESTS_PER_TX, MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_TX, MAX_NULLIFIER_READ_REQUESTS_PER_TX, - MAX_READ_REQUESTS_PER_TX, MembershipWitness, NULLIFIER_TREE_HEIGHT, NullifierKeyValidationRequestContext, @@ -51,22 +51,22 @@ export class HintsBuilder { * note hash. Several read requests might be pointing to the same note hash. It is therefore valid * to return more than one hint with the same index (contrary to getNullifierHints). * - * @param readRequests - The array of read requests. + * @param noteHashReadRequests - The array of read requests. * @param noteHashes - The array of note hashes. * @returns An array of hints where each element is the index of the note hash in note hashes array * corresponding to the read request. In other words we have readRequests[i] == noteHashes[hints[i]]. */ - getReadRequestHints( - readRequests: Tuple, + getNoteHashReadRequestHints( + noteHashReadRequests: Tuple, noteHashes: Tuple, - ): Tuple { - const hints = makeTuple(MAX_READ_REQUESTS_PER_TX, Fr.zero); - for (let i = 0; i < MAX_READ_REQUESTS_PER_TX && !readRequests[i].isEmpty(); i++) { - const equalToRR = (cmt: SideEffect) => cmt.value.equals(readRequests[i].value); + ): Tuple { + const hints = makeTuple(MAX_NOTE_HASH_READ_REQUESTS_PER_TX, Fr.zero); + for (let i = 0; i < MAX_NOTE_HASH_READ_REQUESTS_PER_TX && !noteHashReadRequests[i].isEmpty(); i++) { + const equalToRR = (cmt: SideEffect) => cmt.value.equals(noteHashReadRequests[i].value); const result = noteHashes.findIndex(equalToRR); if (result == -1) { throw new Error( - `The read request at index ${i} ${readRequests[i].toString()} does not match to any note hash.`, + `The read request at index ${i} ${noteHashReadRequests[i].toString()} does not match to any note hash.`, ); } else { hints[i] = new Fr(result); @@ -76,8 +76,8 @@ export class HintsBuilder { } async getNullifierReadRequestResetHints( - nullifiers: Tuple, nullifierReadRequests: Tuple, + nullifiers: Tuple, ) { // TODO - Should be comparing un-siloed values and contract addresses. const builder = new NullifierReadRequestResetHintsBuilder(); diff --git a/yarn-project/pxe/src/kernel_prover/kernel_prover.test.ts b/yarn-project/pxe/src/kernel_prover/kernel_prover.test.ts index 6ae5a8561ba..5a8f599c0bf 100644 --- a/yarn-project/pxe/src/kernel_prover/kernel_prover.test.ts +++ b/yarn-project/pxe/src/kernel_prover/kernel_prover.test.ts @@ -4,14 +4,14 @@ import { FunctionSelector, MAX_NEW_NOTE_HASHES_PER_CALL, MAX_NEW_NOTE_HASHES_PER_TX, - MAX_READ_REQUESTS_PER_CALL, + MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, MAX_REVERTIBLE_NOTE_HASHES_PER_TX, MembershipWitness, + NoteHashReadRequestMembershipWitness, PrivateCallStackItem, PrivateCircuitPublicInputs, PrivateKernelInnerCircuitPublicInputs, PrivateKernelTailCircuitPublicInputs, - ReadRequestMembershipWitness, SideEffect, TxRequest, VK_TREE_HEIGHT, @@ -69,8 +69,8 @@ describe('Kernel Prover', () => { newNotes: newNoteIndices.map(idx => notesAndSlots[idx]), // TODO(dbanks12): should test kernel prover with non-transient reads. // This will be necessary once kernel actually checks (attempts to match) transient reads. - readRequestPartialWitnesses: Array.from({ length: MAX_READ_REQUESTS_PER_CALL }, () => - ReadRequestMembershipWitness.emptyTransient(), + noteHashReadRequestPartialWitnesses: Array.from({ length: MAX_NOTE_HASH_READ_REQUESTS_PER_CALL }, () => + NoteHashReadRequestMembershipWitness.emptyTransient(), ), returnValues: [], acir: Buffer.alloc(0), diff --git a/yarn-project/pxe/src/kernel_prover/kernel_prover.ts b/yarn-project/pxe/src/kernel_prover/kernel_prover.ts index 541b3120c26..5ecb98cfba7 100644 --- a/yarn-project/pxe/src/kernel_prover/kernel_prover.ts +++ b/yarn-project/pxe/src/kernel_prover/kernel_prover.ts @@ -4,16 +4,16 @@ import { Fr, MAX_NEW_NOTE_HASHES_PER_TX, MAX_NEW_NULLIFIERS_PER_TX, + MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL, - MAX_READ_REQUESTS_PER_CALL, + NoteHashReadRequestMembershipWitness, PrivateCallData, PrivateKernelInitCircuitPrivateInputs, PrivateKernelInnerCircuitPrivateInputs, PrivateKernelInnerCircuitPublicInputs, PrivateKernelInnerData, PrivateKernelTailCircuitPrivateInputs, - ReadRequestMembershipWitness, SideEffect, SideEffectLinkedToNoteHash, TxRequest, @@ -109,8 +109,8 @@ export class KernelProver { // Start with the partially filled in read request witnesses from the simulator // and fill the non-transient ones in with sibling paths via oracle. - const readRequestMembershipWitnesses = currentExecution.readRequestPartialWitnesses; - for (let rr = 0; rr < readRequestMembershipWitnesses.length; rr++) { + const noteHashReadRequestMembershipWitnesses = currentExecution.noteHashReadRequestPartialWitnesses; + for (let rr = 0; rr < noteHashReadRequestMembershipWitnesses.length; rr++) { // Pretty sure this check was forever broken. I made some changes to Fr and this started triggering. // The conditional makes no sense to me anyway. // if (currentExecution.callStackItem.publicInputs.readRequests[rr] == Fr.ZERO) { @@ -118,7 +118,7 @@ export class KernelProver { // 'Number of read requests output from Noir circuit does not match number of read request commitment indices output from simulator.', // ); // } - const rrWitness = readRequestMembershipWitnesses[rr]; + const rrWitness = noteHashReadRequestMembershipWitnesses[rr]; if (!rrWitness.isTransient) { // Non-transient reads must contain full membership witness with sibling path from commitment to root. // Get regular membership witness to fill in sibling path in the read request witness. @@ -128,17 +128,17 @@ export class KernelProver { } // fill in witnesses for remaining/empty read requests - readRequestMembershipWitnesses.push( - ...Array(MAX_READ_REQUESTS_PER_CALL - readRequestMembershipWitnesses.length) + noteHashReadRequestMembershipWitnesses.push( + ...Array(MAX_NOTE_HASH_READ_REQUESTS_PER_CALL - noteHashReadRequestMembershipWitnesses.length) .fill(0) - .map(() => ReadRequestMembershipWitness.empty(BigInt(0))), + .map(() => NoteHashReadRequestMembershipWitness.empty(BigInt(0))), ); const privateCallData = await this.createPrivateCallData( currentExecution, privateCallRequests, publicCallRequests, - readRequestMembershipWitnesses, + noteHashReadRequestMembershipWitnesses, ); if (firstIteration) { @@ -184,14 +184,14 @@ export class KernelProver { typeof MAX_NEW_NULLIFIERS_PER_TX >(output.publicInputs.end.newNullifiers); - const readNoteHashHints = this.hintsBuilder.getReadRequestHints( - output.publicInputs.end.readRequests, + const readNoteHashHints = this.hintsBuilder.getNoteHashReadRequestHints( + output.publicInputs.end.noteHashReadRequests, sortedNoteHashes, ); const nullifierReadRequestResetHints = await this.hintsBuilder.getNullifierReadRequestResetHints( - output.publicInputs.end.newNullifiers, output.publicInputs.end.nullifierReadRequests, + output.publicInputs.end.newNullifiers, ); const nullifierNoteHashHints = this.hintsBuilder.getNullifierHints( @@ -232,7 +232,7 @@ export class KernelProver { { callStackItem, vk }: ExecutionResult, privateCallRequests: CallRequest[], publicCallRequests: CallRequest[], - readRequestMembershipWitnesses: ReadRequestMembershipWitness[], + noteHashReadRequestMembershipWitnesses: NoteHashReadRequestMembershipWitness[], ) { const { contractAddress, functionData, publicInputs } = callStackItem; const { portalContractAddress } = publicInputs.callContext; @@ -273,7 +273,11 @@ export class KernelProver { contractClassPublicBytecodeCommitment, saltedInitializationHash, functionLeafMembershipWitness, - readRequestMembershipWitnesses: makeTuple(MAX_READ_REQUESTS_PER_CALL, i => readRequestMembershipWitnesses[i], 0), + noteHashReadRequestMembershipWitnesses: makeTuple( + MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, + i => noteHashReadRequestMembershipWitnesses[i], + 0, + ), portalContractAddress: portalContractAddress.toField(), acirHash, }); diff --git a/yarn-project/simulator/src/client/client_execution_context.ts b/yarn-project/simulator/src/client/client_execution_context.ts index 83997e5f936..ebeb17c3936 100644 --- a/yarn-project/simulator/src/client/client_execution_context.ts +++ b/yarn-project/simulator/src/client/client_execution_context.ts @@ -14,8 +14,8 @@ import { FunctionData, FunctionSelector, Header, + NoteHashReadRequestMembershipWitness, PublicCallRequest, - ReadRequestMembershipWitness, SideEffect, TxContext, } from '@aztec/circuits.js'; @@ -119,17 +119,17 @@ export class ClientExecutionContext extends ViewDataOracle { * or to flag non-transient reads with their leafIndex. * The KernelProver will use this to fully populate witnesses and provide hints to * the kernel regarding which commitments each transient read request corresponds to. - * @param readRequests - SideEffect containing Note hashed of the notes being read and counter. + * @param noteHashReadRequests - SideEffect containing Note hashed of the notes being read and counter. * @returns An array of partially filled in read request membership witnesses. */ - public getReadRequestPartialWitnesses(readRequests: SideEffect[]) { - return readRequests + public getNoteHashReadRequestPartialWitnesses(noteHashReadRequests: SideEffect[]) { + return noteHashReadRequests .filter(r => !r.isEmpty()) .map(r => { const index = this.gotNotes.get(r.value.toBigInt()); return index !== undefined - ? ReadRequestMembershipWitness.empty(index) - : ReadRequestMembershipWitness.emptyTransient(); + ? NoteHashReadRequestMembershipWitness.empty(index) + : NoteHashReadRequestMembershipWitness.emptyTransient(); }); } diff --git a/yarn-project/simulator/src/client/execution_result.test.ts b/yarn-project/simulator/src/client/execution_result.test.ts index 181807c00f5..b2e626ab382 100644 --- a/yarn-project/simulator/src/client/execution_result.test.ts +++ b/yarn-project/simulator/src/client/execution_result.test.ts @@ -9,7 +9,7 @@ function emptyExecutionResult(): ExecutionResult { vk: Buffer.from(''), partialWitness: new Map(), callStackItem: PrivateCallStackItem.empty(), - readRequestPartialWitnesses: [], + noteHashReadRequestPartialWitnesses: [], newNotes: [], returnValues: [], nestedExecutions: [], diff --git a/yarn-project/simulator/src/client/execution_result.ts b/yarn-project/simulator/src/client/execution_result.ts index 1a822e3eb51..6b2fd1052e1 100644 --- a/yarn-project/simulator/src/client/execution_result.ts +++ b/yarn-project/simulator/src/client/execution_result.ts @@ -1,5 +1,5 @@ import { FunctionL2Logs, Note } from '@aztec/circuit-types'; -import { PrivateCallStackItem, PublicCallRequest, ReadRequestMembershipWitness } from '@aztec/circuits.js'; +import { NoteHashReadRequestMembershipWitness, PrivateCallStackItem, PublicCallRequest } from '@aztec/circuits.js'; import { DecodedReturn } from '@aztec/foundation/abi'; import { Fr } from '@aztec/foundation/fields'; @@ -32,7 +32,7 @@ export interface ExecutionResult { /** The call stack item. */ callStackItem: PrivateCallStackItem; /** The partially filled-in read request membership witnesses for commitments being read. */ - readRequestPartialWitnesses: ReadRequestMembershipWitness[]; + noteHashReadRequestPartialWitnesses: NoteHashReadRequestMembershipWitness[]; // Needed when we enable chained txs. The new notes can be cached and used in a later transaction. /** The notes created in the executed function. */ newNotes: NoteAndSlot[]; diff --git a/yarn-project/simulator/src/client/private_execution.test.ts b/yarn-project/simulator/src/client/private_execution.test.ts index 7fc20389560..c97d08acb7c 100644 --- a/yarn-project/simulator/src/client/private_execution.test.ts +++ b/yarn-project/simulator/src/client/private_execution.test.ts @@ -411,7 +411,7 @@ describe('Private Execution test suite', () => { expect(changeNote.note.items[0]).toEqual(new Fr(40n)); const readRequests = sideEffectArrayToValueArray( - nonEmptySideEffects(result.callStackItem.publicInputs.readRequests), + nonEmptySideEffects(result.callStackItem.publicInputs.noteHashReadRequests), ); expect(readRequests).toHaveLength(consumedNotes.length); @@ -799,7 +799,7 @@ describe('Private Execution test suite', () => { // Check the commitment read request was created successfully. const readRequests = sideEffectArrayToValueArray( - nonEmptySideEffects(result.callStackItem.publicInputs.readRequests), + nonEmptySideEffects(result.callStackItem.publicInputs.noteHashReadRequests), ); expect(readRequests).toHaveLength(1); @@ -926,7 +926,7 @@ describe('Private Execution test suite', () => { expect(noteHash).toEqual(innerNoteHash); // read request should match innerNoteHash for pending notes (there is no nonce, so can't compute "unique" hash) - const readRequest = sideEffectArrayToValueArray(result.callStackItem.publicInputs.readRequests)[0]; + const readRequest = sideEffectArrayToValueArray(result.callStackItem.publicInputs.noteHashReadRequests)[0]; expect(readRequest).toEqual(innerNoteHash); const gotNoteValue = result.callStackItem.publicInputs.returnValues[0].value; @@ -1015,7 +1015,7 @@ describe('Private Execution test suite', () => { expect(noteHash).toEqual(innerNoteHash); // read request should match innerNoteHash for pending notes (there is no nonce, so can't compute "unique" hash) - const readRequest = execGetThenNullify.callStackItem.publicInputs.readRequests[0]; + const readRequest = execGetThenNullify.callStackItem.publicInputs.noteHashReadRequests[0]; expect(readRequest.value).toEqual(innerNoteHash); const gotNoteValue = execGetThenNullify.callStackItem.publicInputs.returnValues[0].value; @@ -1080,7 +1080,7 @@ describe('Private Execution test suite', () => { ); // read requests should be empty - const readRequest = result.callStackItem.publicInputs.readRequests[0].value; + const readRequest = result.callStackItem.publicInputs.noteHashReadRequests[0].value; expect(readRequest).toEqual(Fr.ZERO); // should get note value 0 because it actually gets a fake note since the real one hasn't been inserted yet! diff --git a/yarn-project/simulator/src/client/private_execution.ts b/yarn-project/simulator/src/client/private_execution.ts index bb6198e3ad1..df3fb12a848 100644 --- a/yarn-project/simulator/src/client/private_execution.ts +++ b/yarn-project/simulator/src/client/private_execution.ts @@ -54,7 +54,9 @@ export async function executePrivateFunction( const callStackItem = new PrivateCallStackItem(contractAddress, functionData, publicInputs); const returnValues = decodeReturnValues(artifact, publicInputs.returnValues); - const readRequestPartialWitnesses = context.getReadRequestPartialWitnesses(publicInputs.readRequests); + const noteHashReadRequestPartialWitnesses = context.getNoteHashReadRequestPartialWitnesses( + publicInputs.noteHashReadRequests, + ); const newNotes = context.getNewNotes(); const nestedExecutions = context.getNestedExecutions(); const enqueuedPublicFunctionCalls = context.getEnqueuedPublicFunctionCalls(); @@ -66,7 +68,7 @@ export async function executePrivateFunction( partialWitness, callStackItem, returnValues, - readRequestPartialWitnesses, + noteHashReadRequestPartialWitnesses, newNotes, vk: Buffer.from(artifact.verificationKey!, 'hex'), nestedExecutions,