@aztec/accounts 0.0.1-commit.b8a057fa → 0.0.1-commit.be03c316

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/artifacts/EcdsaKAccount.json +939 -812
  2. package/artifacts/EcdsaRAccount.json +939 -812
  3. package/artifacts/SchnorrAccount.json +935 -808
  4. package/artifacts/SchnorrInitializerlessAccount.json +419 -353
  5. package/artifacts/SimulatedEcdsaAccount.json +907 -541
  6. package/artifacts/SimulatedSchnorrAccount.json +1056 -690
  7. package/dest/schnorr/initializerless/index.d.ts +4 -4
  8. package/dest/schnorr/initializerless/index.d.ts.map +1 -1
  9. package/dest/schnorr/initializerless/index.js +7 -7
  10. package/dest/schnorr/initializerless/lazy.d.ts +4 -4
  11. package/dest/schnorr/initializerless/lazy.d.ts.map +1 -1
  12. package/dest/schnorr/initializerless/lazy.js +7 -7
  13. package/dest/schnorr/private_immutable/index.d.ts +4 -4
  14. package/dest/schnorr/private_immutable/index.d.ts.map +1 -1
  15. package/dest/schnorr/private_immutable/index.js +7 -7
  16. package/dest/schnorr/private_immutable/lazy.d.ts +4 -4
  17. package/dest/schnorr/private_immutable/lazy.d.ts.map +1 -1
  18. package/dest/schnorr/private_immutable/lazy.js +7 -7
  19. package/dest/testing/configuration.d.ts +1 -1
  20. package/dest/testing/configuration.d.ts.map +1 -1
  21. package/dest/testing/configuration.js +6 -2
  22. package/dest/testing/index.d.ts +1 -1
  23. package/dest/testing/index.d.ts.map +1 -1
  24. package/dest/testing/index.js +13 -11
  25. package/dest/testing/lazy.d.ts +1 -1
  26. package/dest/testing/lazy.d.ts.map +1 -1
  27. package/dest/testing/lazy.js +13 -11
  28. package/dest/utils/index.d.ts +2 -1
  29. package/dest/utils/index.d.ts.map +1 -1
  30. package/dest/utils/index.js +1 -0
  31. package/dest/utils/key_derivation.d.ts +9 -0
  32. package/dest/utils/key_derivation.d.ts.map +1 -0
  33. package/dest/utils/key_derivation.js +16 -0
  34. package/package.json +6 -6
  35. package/src/schnorr/initializerless/index.ts +8 -8
  36. package/src/schnorr/initializerless/lazy.ts +8 -8
  37. package/src/schnorr/private_immutable/index.ts +8 -8
  38. package/src/schnorr/private_immutable/lazy.ts +8 -8
  39. package/src/testing/configuration.ts +6 -2
  40. package/src/testing/index.ts +13 -13
  41. package/src/testing/lazy.ts +13 -13
  42. package/src/utils/index.ts +1 -0
  43. package/src/utils/key_derivation.ts +15 -0
@@ -18,7 +18,7 @@
18
18
  "path": "std/aes128.nr",
19
19
  "source": "// docs:start:aes128\n/// Given a plaintext as an array of bytes, returns the corresponding aes128 ciphertext (CBC mode). Input padding is performed using PKCS#7, so that the output length is `input.len() + (16 - input.len() % 16)`.\npub fn aes128_encrypt<let N: u32>(\n input: [u8; N],\n iv: [u8; 16],\n key: [u8; 16],\n) -> [u8; N + 16 - N % 16] {\n let padding_length = (16 - N % 16) as u8;\n let mut padded_input: [u8; N + 16 - N % 16] = [0; N + 16 - N % 16];\n for i in 0..N {\n padded_input[i] = input[i];\n }\n for i in N..N + 16 - N % 16 {\n padded_input[i] = padding_length;\n }\n let output = aes128_encrypt_padded_input(padded_input, iv, key);\n output\n}\n\n#[foreign(aes128_encrypt)]\nfn aes128_encrypt_padded_input<let N: u32>(input: [u8; N], iv: [u8; 16], key: [u8; 16]) -> [u8; N] {}\n\n// docs:end:aes128\n\nmod tests {\n use super::aes128_encrypt;\n\n #[test]\n fn encrypt() {\n let input = \"kevlovesrust\".as_bytes();\n let iv = \"0000000000000000\".as_bytes();\n let key = \"0000000000000000\".as_bytes();\n let output = [244, 14, 126, 172, 171, 40, 208, 186, 173, 184, 226, 105, 238, 122, 205, 191];\n assert_eq(aes128_encrypt(input, iv, key), output);\n }\n}\n"
20
20
  },
21
- "100": {
21
+ "101": {
22
22
  "function_locations": [
23
23
  {
24
24
  "name": "log_prefix",
@@ -88,7 +88,7 @@
88
88
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/logging.nr",
89
89
  "source": "// Not all log levels are currently used, but we provide the full set so that new call sites can use any level. Because\n// of that we tag all with `#[allow(dead_code)]` to prevent warnings.\n//\n// All wrappers resolve function paths at comptime via `resolve_fn` so that the emitted `Quoted` code works both inside\n// aztec-nr (where `crate::` = aztec) and inside macro-generated contract code (where `crate::` = the contract).\n\nuse std::meta::ctstring::AsCtString;\n\ncomptime fn log_prefix<let N: u32>(msg: str<N>) -> CtString {\n \"[aztec-nr] \".as_ctstring().append_str(msg)\n}\n\n// --- No-args variants (direct call) ---\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_fatal_log<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::fatal_log });\n quote { $f($msg) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_error_log<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::error_log });\n quote { $f($msg) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_warn_log<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::warn_log });\n quote { $f($msg) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_info_log<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::info_log });\n quote { $f($msg) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_verbose_log<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::verbose_log });\n quote { $f($msg) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_debug_log<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::debug_log });\n quote { $f($msg) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_trace_log<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::trace_log });\n quote { $f($msg) }\n}\n\n// --- Format variants (return lambda for runtime args) ---\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_fatal_log_format<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::fatal_log_format });\n quote { (|args| $f($msg, args)) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_error_log_format<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::error_log_format });\n quote { (|args| $f($msg, args)) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_warn_log_format<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::warn_log_format });\n quote { (|args| $f($msg, args)) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_info_log_format<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::info_log_format });\n quote { (|args| $f($msg, args)) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_verbose_log_format<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::verbose_log_format });\n quote { (|args| $f($msg, args)) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_debug_log_format<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::debug_log_format });\n quote { (|args| $f($msg, args)) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_trace_log_format<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::trace_log_format });\n quote { (|args| $f($msg, args)) }\n}\n\n// See module-level comment for why this is needed.\ncomptime fn resolve_fn(path: Quoted) -> TypedExpr {\n path.as_expr().unwrap().resolve(Option::none())\n}\n"
90
90
  },
91
- "103": {
91
+ "104": {
92
92
  "function_locations": [
93
93
  {
94
94
  "name": "AztecConfig::new",
@@ -126,7 +126,7 @@
126
126
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/macros/aztec.nr",
127
127
  "source": "mod compute_note_hash_and_nullifier;\n\nuse crate::{\n macros::{\n calls_generation::{\n external_functions::{generate_external_function_calls, generate_external_function_self_calls_structs},\n internal_functions::generate_call_internal_struct,\n },\n dispatch::generate_public_dispatch,\n emit_public_init_nullifier::generate_emit_public_init_nullifier,\n internals_functions_generation::{create_fn_abi_exports, process_functions},\n offchain_receive::{\n OFFCHAIN_RECEIVE_FN_NAME, OFFCHAIN_RECEIVE_PARAM_NAME, offchain_receive_param_type,\n OFFCHAIN_RECEIVE_RETURN_TYPE,\n },\n storage::STORAGE_LAYOUT_NAME,\n utils::{is_fn_contract_library_method, is_fn_external, is_fn_internal, is_fn_test, module_has_storage},\n },\n messages::discovery::{CustomMessageHandler, CustomSyncHandler},\n};\n\nuse compute_note_hash_and_nullifier::generate_contract_library_methods_compute_note_hash_and_nullifier;\n\n/// Configuration for the [`aztec`] macro.\n///\n/// This type lets users override different parts of the default aztec-nr contract behavior, such\n/// as message handling and state synchronization. These are advanced features that require careful\n/// understanding of the behavior of these systems.\n///\n/// ## Examples\n///\n/// ```noir\n/// #[aztec(aztec::macros::AztecConfig::new().custom_message_handler(my_handler))]\n/// contract MyContract { ... }\n/// ```\npub struct AztecConfig {\n custom_message_handler: Option<CustomMessageHandler>,\n custom_sync_state: Option<CustomSyncHandler>,\n}\n\nimpl AztecConfig {\n /// Creates a new `AztecConfig` with default values.\n ///\n /// Calling `new` is equivalent to invoking the [`aztec`] macro with no parameters. The different methods\n /// (e.g. [`AztecConfig::custom_message_handler`]) can then be used to change the default behavior.\n pub comptime fn new() -> Self {\n Self { custom_message_handler: Option::none(), custom_sync_state: Option::none() }\n }\n\n /// Sets a handler for custom messages.\n ///\n /// This enables contracts to process non-standard messages (i.e. any with a message type that is not in\n /// [`crate::messages::msg_type`]).\n ///\n /// `handler` must be a function that conforms to the\n /// [`crate::messages::discovery::CustomMessageHandler`] type signature.\n pub comptime fn custom_message_handler(&mut self, handler: CustomMessageHandler) -> Self {\n self.custom_message_handler = Option::some(handler);\n *self\n }\n\n /// Overrides the default state synchronization logic.\n ///\n /// The generated `sync_state` function will call `handler` instead of\n /// [`crate::messages::discovery::do_sync_state`]. The handler receives all of the same parameters, so it can\n /// run custom logic (e.g. fetching and decrypting custom logs) before, after, or instead of calling\n /// `do_sync_state`.\n ///\n /// `handler` must be a function that conforms to the\n /// [`crate::messages::discovery::CustomSyncHandler`] type signature.\n pub comptime fn custom_sync_state(&mut self, handler: CustomSyncHandler) -> Self {\n self.custom_sync_state = Option::some(handler);\n *self\n }\n}\n\n/// Enables aztec-nr features on a `contract`.\n///\n/// All aztec-nr contracts should have this macro invoked on them, as it is the one that processes all contract\n/// functions, notes, storage, generates interfaces for external calls, and creates the message processing\n/// boilerplate.\n///\n/// ## Examples\n///\n/// Most contracts can simply invoke the macro with no parameters, resulting in default aztec-nr behavior:\n/// ```noir\n/// #[aztec]\n/// contract MyContract { ... }\n/// ```\n///\n/// Advanced contracts can use [`AztecConfig`] to customize parts of its behavior, such as message\n/// processing.\n/// ```noir\n/// #[aztec(aztec::macros::AztecConfig::new().custom_message_handler(my_handler))]\n/// contract MyAdvancedContract { ... }\n/// ```\n#[varargs]\npub comptime fn aztec(m: Module, args: [AztecConfig]) -> Quoted {\n let num_args = args.len();\n let config = if num_args == 0 {\n AztecConfig::new()\n } else if num_args == 1 {\n args[0]\n } else {\n panic(f\"#[aztec] expects 0 or 1 arguments, got {num_args}\")\n };\n\n // Functions that don't have #[external(...)], #[contract_library_method], or #[test] are not allowed in contracts.\n check_each_fn_macroified(m);\n\n // We generate new functions prefixed with `__aztec_nr_internals__` and we replace the original functions' bodies\n // with `static_assert(false, ...)` to prevent them from being called directly from within the contract.\n let functions = process_functions(m);\n\n // We generate structs and their implementations necessary for convenient functions calls.\n let interface = generate_contract_interface(m);\n let self_call_structs = generate_external_function_self_calls_structs(m);\n let call_internal_struct = generate_call_internal_struct(m);\n\n // We generate ABI exports for all the external functions in the contract.\n let fn_abi_exports = create_fn_abi_exports(m);\n\n // We generate `_compute_note_hash`, `_compute_note_nullifier` (and the deprecated\n // `_compute_note_hash_and_nullifier` wrapper) only if they are not already implemented.\n // If they are implemented we just insert empty quotes.\n let contract_library_method_compute_note_hash_and_nullifier = if !m.functions().any(|f| {\n // Note that we don't test for `_compute_note_hash` or `_compute_note_nullifier` in order to make this simpler\n // - users must either implement all three or none.\n // Down the line we'll remove this check and use `AztecConfig`.\n f.name() == quote { _compute_note_hash_and_nullifier }\n }) {\n generate_contract_library_methods_compute_note_hash_and_nullifier()\n } else {\n quote {}\n };\n let process_custom_message_option = if config.custom_message_handler.is_some() {\n let handler = config.custom_message_handler.unwrap();\n quote { Option::some($handler) }\n } else {\n quote { Option::<aztec::messages::discovery::CustomMessageHandler>::none() }\n };\n\n let offchain_inbox_sync_option = quote {\n Option::some(aztec::messages::processing::offchain::sync_inbox)\n };\n\n if m.functions().any(|f| f.name() == quote { sync_state }) {\n panic(\n \"User-defined 'sync_state' is not allowed. Use AztecConfig::custom_sync_state() to customize sync behavior.\",\n );\n }\n\n let custom_sync_handler = if config.custom_sync_state.is_some() {\n let handler = config.custom_sync_state.unwrap();\n Option::some(quote { $handler })\n } else {\n Option::none()\n };\n\n let sync_state_fn_and_abi_export = generate_sync_state(\n process_custom_message_option,\n offchain_inbox_sync_option,\n custom_sync_handler,\n );\n\n if m.functions().any(|f| f.name() == quote { offchain_receive }) {\n panic(\n \"User-defined 'offchain_receive' is not allowed. The function is auto-injected by the #[aztec] macro. See https://docs.aztec.network/errors/7\",\n );\n }\n let offchain_receive_fn_and_abi_export = generate_offchain_receive();\n\n let (has_public_init_nullifier_fn, emit_public_init_nullifier_fn_body) = generate_emit_public_init_nullifier(m);\n let public_dispatch = generate_public_dispatch(m, has_public_init_nullifier_fn);\n\n quote {\n $interface\n $self_call_structs\n $call_internal_struct\n $functions\n $fn_abi_exports\n $contract_library_method_compute_note_hash_and_nullifier\n $public_dispatch\n $sync_state_fn_and_abi_export\n $emit_public_init_nullifier_fn_body\n $offchain_receive_fn_and_abi_export\n }\n}\n\ncomptime fn generate_contract_interface(m: Module) -> Quoted {\n let calls = generate_external_function_calls(m);\n\n let module_name = m.name();\n\n let has_storage_layout = module_has_storage(m) & STORAGE_LAYOUT_NAME.get(m).is_some();\n let storage_layout_getter = if has_storage_layout {\n let storage_layout_name = STORAGE_LAYOUT_NAME.get(m).unwrap();\n quote {\n pub fn storage_layout() -> StorageLayoutFields {\n $storage_layout_name.fields\n }\n }\n } else {\n quote {}\n };\n\n let library_storage_layout_getter = if has_storage_layout {\n quote {\n #[contract_library_method]\n $storage_layout_getter\n }\n } else {\n quote {}\n };\n\n quote {\n pub struct $module_name {\n pub target_contract: aztec::protocol::address::AztecAddress\n }\n\n impl $module_name {\n $calls\n\n pub fn at(\n addr: aztec::protocol::address::AztecAddress\n ) -> Self {\n Self { target_contract: addr }\n }\n\n pub fn interface() -> Self {\n Self { target_contract: aztec::protocol::address::AztecAddress::zero() }\n }\n\n $storage_layout_getter\n }\n\n #[contract_library_method]\n pub fn at(\n addr: aztec::protocol::address::AztecAddress\n ) -> $module_name {\n $module_name { target_contract: addr }\n }\n\n #[contract_library_method]\n pub fn interface() -> $module_name {\n $module_name { target_contract: aztec::protocol::address::AztecAddress::zero() }\n }\n\n $library_storage_layout_getter\n\n }\n}\n\n/// Generates the `sync_state` utility function that performs message discovery.\ncomptime fn generate_sync_state(\n process_custom_message_option: Quoted,\n offchain_inbox_sync_option: Quoted,\n custom_sync_handler: Option<Quoted>,\n) -> Quoted {\n let body = if custom_sync_handler.is_some() {\n let handler = custom_sync_handler.unwrap();\n quote {\n $handler(\n address,\n _compute_note_hash,\n _compute_note_nullifier,\n $process_custom_message_option,\n $offchain_inbox_sync_option,\n scope,\n );\n }\n } else {\n quote {\n aztec::messages::discovery::do_sync_state(\n address,\n _compute_note_hash,\n _compute_note_nullifier,\n $process_custom_message_option,\n $offchain_inbox_sync_option,\n scope,\n );\n }\n };\n\n quote {\n pub struct sync_state_parameters {\n pub scope: aztec::protocol::address::AztecAddress,\n }\n\n #[abi(functions)]\n pub struct sync_state_abi {\n parameters: sync_state_parameters,\n }\n\n #[aztec::macros::internals_functions_generation::abi_attributes::abi_utility]\n unconstrained fn sync_state(scope: aztec::protocol::address::AztecAddress) {\n let address = aztec::context::UtilityContext::new().this_address();\n $body\n }\n }\n}\n\n/// Generates an `offchain_receive` utility function that lets callers add messages to the offchain message inbox.\n///\n/// For more details, see `aztec::messages::processing::offchain::receive`.\ncomptime fn generate_offchain_receive() -> Quoted {\n let param_type = offchain_receive_param_type(quote { aztec });\n let parameters_struct_name = f\"{OFFCHAIN_RECEIVE_FN_NAME}_parameters\".quoted_contents();\n let abi_struct_name = f\"{OFFCHAIN_RECEIVE_FN_NAME}_abi\".quoted_contents();\n\n quote {\n pub struct $parameters_struct_name {\n pub $OFFCHAIN_RECEIVE_PARAM_NAME: $param_type,\n }\n\n #[abi(functions)]\n pub struct $abi_struct_name {\n parameters: $parameters_struct_name,\n }\n\n /// Receives offchain messages into this contract's offchain inbox for subsequent processing.\n ///\n /// Each message is routed to the inbox scoped to its `recipient` field.\n ///\n /// For more details, see `aztec::messages::processing::offchain::receive`.\n ///\n /// This function is automatically injected by the `#[aztec]` macro.\n #[aztec::macros::internals_functions_generation::abi_attributes::abi_utility]\n unconstrained fn $OFFCHAIN_RECEIVE_FN_NAME($OFFCHAIN_RECEIVE_PARAM_NAME: $param_type) -> $OFFCHAIN_RECEIVE_RETURN_TYPE {\n let address = aztec::context::UtilityContext::new().this_address();\n aztec::messages::processing::offchain::receive(address, $OFFCHAIN_RECEIVE_PARAM_NAME);\n }\n }\n}\n\n/// Checks that all functions in the module have a context macro applied.\n///\n/// Non-macroified functions are not allowed in contracts. They must all be one of\n/// [`crate::macros::functions::external`], [`crate::macros::functions::internal`] or `test`.\ncomptime fn check_each_fn_macroified(m: Module) {\n for f in m.functions() {\n let name = f.name();\n if !is_fn_external(f) & !is_fn_contract_library_method(f) & !is_fn_internal(f) & !is_fn_test(f) {\n // We don't suggest that #[contract_library_method] is allowed because we don't want to introduce another\n // concept\n panic(\n f\"Function {name} must be marked as either #[external(...)], #[internal(...)], or #[test]\",\n );\n }\n }\n}\n"
128
128
  },
129
- "118": {
129
+ "119": {
130
130
  "function_locations": [
131
131
  {
132
132
  "name": "generate_private_external",
@@ -136,7 +136,7 @@
136
136
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/macros/internals_functions_generation/external/private.nr",
137
137
  "source": "use crate::macros::{\n functions::initialization_utils::has_public_init_checked_functions,\n internals_functions_generation::external::helpers::{create_authorize_once_check, get_abi_relevant_attributes},\n utils::{\n fn_has_allow_phase_change, fn_has_authorize_once, fn_has_noinitcheck, is_fn_initializer, is_fn_only_self,\n is_fn_view, module_has_initializer, module_has_storage,\n },\n};\nuse crate::protocol::meta::utils::derive_serialization_quotes;\nuse std::meta::type_of;\n\npub(crate) comptime fn generate_private_external(f: FunctionDefinition) -> Quoted {\n let module_has_initializer = module_has_initializer(f.module());\n let module_has_storage = module_has_storage(f.module());\n\n // Private functions undergo a lot of transformations from their Aztec.nr form into a circuit that can be fed to\n // the Private Kernel Circuit. First we change the function signature so that it also receives\n // `PrivateContextInputs`, which contain information about the execution context (e.g. the caller).\n let original_params = f.parameters();\n\n let original_params_quotes =\n original_params.map(|(param_name, param_type)| quote { $param_name: $param_type }).join(quote {, });\n\n let params = quote { inputs: aztec::context::inputs::PrivateContextInputs, $original_params_quotes };\n\n let mut body = f.body().as_block().unwrap();\n\n // The original params are hashed and passed to the `context` object, so that the kernel can verify we've received\n // the correct values.\n let (args_serialization, _, serialized_args_name) = derive_serialization_quotes(original_params, false);\n\n let storage_init = if module_has_storage {\n // Contract has Storage defined so we initialize it.\n quote {\n let storage = Storage::init(&mut context);\n }\n } else {\n // Contract does not have Storage defined, so we set storage to the unit type `()`. ContractSelfPrivate\n // requires a storage struct in its constructor. Using an Option type would lead to worse developer experience\n // and higher constraint counts so we use the unit type `()` instead.\n quote {\n let storage = ();\n }\n };\n\n let contract_self_creation = quote {\n #[allow(unused_variables)]\n let mut self = {\n $args_serialization\n let args_hash = aztec::hash::hash_args($serialized_args_name);\n let mut context = aztec::context::PrivateContext::new(inputs, args_hash);\n $storage_init\n let self_address = context.this_address();\n let call_self: CallSelf<&mut aztec::context::PrivateContext> = CallSelf { address: self_address, context: &mut context };\n let enqueue_self: EnqueueSelf<&mut aztec::context::PrivateContext> = EnqueueSelf { address: self_address, context: &mut context };\n let call_self_static: CallSelfStatic<&mut aztec::context::PrivateContext> = CallSelfStatic { address: self_address, context: &mut context };\n let enqueue_self_static: EnqueueSelfStatic<&mut aztec::context::PrivateContext> = EnqueueSelfStatic { address: self_address, context: &mut context };\n let internal: CallInternal<&mut aztec::context::PrivateContext> = CallInternal { context: &mut context };\n let call_self_utility = CallSelfUtility { address: self_address };\n let utility: aztec::contract_self::PrivateUtilityCalls<CallSelfUtility> = aztec::contract_self::PrivateUtilityCalls { call_self: call_self_utility };\n aztec::contract_self::ContractSelfPrivate::new(&mut context, storage, call_self, enqueue_self, call_self_static, enqueue_self_static, internal, utility)\n };\n };\n\n let original_function_name = f.name();\n\n // Modifications introduced by the different marker attributes.\n let internal_check = if is_fn_only_self(f) {\n let assertion_message = f\"Function {original_function_name} can only be called by the same contract\";\n quote { assert(self.msg_sender() == self.address, $assertion_message); }\n } else {\n quote {}\n };\n\n let view_check = if is_fn_view(f) {\n let assertion_message = f\"Function {original_function_name} can only be called statically\".as_quoted_str();\n quote { assert(self.context.is_static_call(), $assertion_message); }\n } else {\n quote {}\n };\n\n let (assert_initializer, mark_as_initialized) = if is_fn_initializer(f) {\n let has_public_fns_with_init_check = has_public_init_checked_functions(f.module());\n (\n quote {\n aztec::macros::functions::initialization_utils::assert_initialization_matches_address_preimage_private(*self.context);\n },\n quote { aztec::macros::functions::initialization_utils::mark_as_initialized_from_private_initializer(self.context, $has_public_fns_with_init_check); },\n )\n } else {\n (quote {}, quote {})\n };\n\n // Initialization checks are not included in contracts that don't have initializers.\n let init_check = if module_has_initializer & !is_fn_initializer(f) & !fn_has_noinitcheck(f) {\n quote { aztec::macros::functions::initialization_utils::assert_is_initialized_private(self.context); }\n } else {\n quote {}\n };\n\n // Phase checks are skipped in functions that request to manually handle phases\n let initial_phase_store = if fn_has_allow_phase_change(f) {\n quote {}\n } else {\n quote { let within_revertible_phase: bool = self.context.in_revertible_phase(); }\n };\n\n let no_phase_change_check = if fn_has_allow_phase_change(f) {\n quote {}\n } else {\n quote {\n assert_eq(\n within_revertible_phase,\n self.context.in_revertible_phase(),\n f\"Phase change detected on function with phase check. If this is expected, use #[allow_phase_change]\",\n );\n }\n };\n\n // Inject the authwit check if the function is marked with #[authorize_once].\n let authorize_once_check = if fn_has_authorize_once(f) {\n create_authorize_once_check(f, true)\n } else {\n quote {}\n };\n\n // Finally, we need to change the return type to be `PrivateCircuitPublicInputs`, which is what the Private Kernel\n // circuit expects.\n let return_value_var_name = quote { macro__returned__values };\n\n let return_value_type = f.return_type();\n let return_value = if body.len() == 0 {\n quote {}\n } else if return_value_type != type_of(()) {\n // The original return value is serialized and hashed before being passed to the context.\n let (body_without_return, last_body_expr) = body.pop_back();\n let return_value = last_body_expr.quoted();\n let return_value_assignment = quote { let $return_value_var_name: $return_value_type = $return_value; };\n\n let (return_serialization, _, serialized_return_name) =\n derive_serialization_quotes([(return_value_var_name, return_value_type)], false);\n\n body = body_without_return;\n\n quote {\n $return_value_assignment\n $return_serialization\n self.context.set_return_hash($serialized_return_name);\n }\n } else {\n let (body_without_return, last_body_expr) = body.pop_back();\n if !last_body_expr.has_semicolon()\n & last_body_expr.as_for().is_none()\n & last_body_expr.as_assert().is_none()\n & last_body_expr.as_for_range().is_none()\n & last_body_expr.as_assert_eq().is_none()\n & last_body_expr.as_let().is_none() {\n let unused_return_value_name = f\"_{return_value_var_name}\".quoted_contents();\n body = body_without_return.push_back(quote { let $unused_return_value_name = $last_body_expr; }\n .as_expr()\n .unwrap());\n }\n quote {}\n };\n\n let context_finish = quote { self.context.finish() };\n\n // Preserve all attributes that are relevant to the function's ABI.\n let abi_relevant_attributes = get_abi_relevant_attributes(f);\n\n let fn_name = f\"__aztec_nr_internals__{original_function_name}\".quoted_contents();\n\n let to_prepend = quote {\n aztec::oracle::version::assert_compatible_oracle_version();\n $contract_self_creation\n $initial_phase_store\n $assert_initializer\n $init_check\n $internal_check\n $view_check\n $authorize_once_check\n };\n\n let body_quote = body.map(|expr| expr.quoted()).join(quote { });\n\n // `mark_as_initialized` is placed after the user's function body. If it ran at the beginning, the contract\n // would appear initialized while the initializer is still running, allowing contracts called by the initializer\n // to re-enter into a half-initialized contract.\n let to_append = quote {\n $return_value\n $mark_as_initialized\n $no_phase_change_check\n $context_finish\n };\n\n quote {\n #[aztec::macros::internals_functions_generation::abi_attributes::abi_private]\n $abi_relevant_attributes\n fn $fn_name($params) -> return_data aztec::protocol::abis::private_circuit_public_inputs::PrivateCircuitPublicInputs {\n $to_prepend\n $body_quote\n $to_append\n }\n }\n}\n"
138
138
  },
139
- "120": {
139
+ "121": {
140
140
  "function_locations": [
141
141
  {
142
142
  "name": "generate_utility_self_creator",
@@ -636,229 +636,249 @@
636
636
  "name": "tests::non_zero_field_to_be_bytes_zero_limbs",
637
637
  "start": 19469
638
638
  },
639
+ {
640
+ "name": "tests::zero_field_to_bytes_zero_limbs_unconstrained",
641
+ "start": 19600
642
+ },
643
+ {
644
+ "name": "tests::zero_field_to_bytes_zero_limbs_constrained",
645
+ "start": 19915
646
+ },
647
+ {
648
+ "name": "tests::zero_field_to_bytes_zero_limbs_comptime",
649
+ "start": 20227
650
+ },
639
651
  {
640
652
  "name": "tests::test_field_less_than",
641
- "start": 19576
653
+ "start": 20558
642
654
  },
643
655
  {
644
656
  "name": "tests::test_large_field_values_unconstrained",
645
- "start": 19831
657
+ "start": 20813
646
658
  },
647
659
  {
648
660
  "name": "tests::test_large_field_values",
649
- "start": 20284
661
+ "start": 21266
650
662
  },
651
663
  {
652
664
  "name": "tests::test_decomposition_edge_cases",
653
- "start": 20731
665
+ "start": 21713
654
666
  },
655
667
  {
656
668
  "name": "tests::test_pow_32",
657
- "start": 21321
669
+ "start": 22303
658
670
  },
659
671
  {
660
672
  "name": "tests::test_sgn0",
661
- "start": 21650
673
+ "start": 22632
662
674
  },
663
675
  {
664
676
  "name": "tests::test_bit_decomposition_overflow",
665
- "start": 22072
677
+ "start": 23054
666
678
  },
667
679
  {
668
680
  "name": "tests::test_byte_decomposition_overflow",
669
- "start": 22354
681
+ "start": 23336
670
682
  },
671
683
  {
672
684
  "name": "tests::test_to_from_be_bytes_bn254_edge_cases",
673
- "start": 22571
685
+ "start": 23553
674
686
  },
675
687
  {
676
688
  "name": "tests::test_to_from_le_bytes_bn254_edge_cases",
677
- "start": 24522
689
+ "start": 25504
678
690
  },
679
691
  {
680
692
  "name": "tests::test_from_le_bytes_checked_accepts_modulus_minus_one",
681
- "start": 26457
693
+ "start": 27439
682
694
  },
683
695
  {
684
696
  "name": "tests::test_from_le_bytes_checked_rejects_modulus",
685
- "start": 26936
697
+ "start": 27918
686
698
  },
687
699
  {
688
700
  "name": "tests::test_from_le_bytes_checked_rejects_modulus_plus_one",
689
- "start": 27321
701
+ "start": 28303
690
702
  },
691
703
  {
692
704
  "name": "tests::test_from_be_bytes_checked_accepts_modulus_minus_one",
693
- "start": 27776
705
+ "start": 28758
694
706
  },
695
707
  {
696
708
  "name": "tests::test_from_be_bytes_checked_rejects_modulus",
697
- "start": 28265
709
+ "start": 29247
698
710
  },
699
711
  {
700
712
  "name": "tests::test_from_be_bytes_checked_rejects_modulus_plus_one",
701
- "start": 28650
713
+ "start": 29632
702
714
  },
703
715
  {
704
716
  "name": "tests::test_from_bytes_checked_small_n",
705
- "start": 29094
717
+ "start": 30076
706
718
  },
707
719
  {
708
720
  "name": "tests::from_le_bits",
709
- "start": 29739
721
+ "start": 30721
710
722
  },
711
723
  {
712
724
  "name": "tests::from_be_bits",
713
- "start": 30286
725
+ "start": 31268
714
726
  },
715
727
  {
716
728
  "name": "tests::test_to_from_be_bits_bn254_edge_cases",
717
- "start": 30532
729
+ "start": 31514
718
730
  },
719
731
  {
720
732
  "name": "tests::test_to_from_le_bits_bn254_edge_cases",
721
- "start": 32465
733
+ "start": 33447
722
734
  },
723
735
  {
724
736
  "name": "tests::max_bit_size_too_large",
725
- "start": 34397
737
+ "start": 35379
726
738
  }
727
739
  ],
728
740
  "path": "std/field/mod.nr",
729
- "source": "pub mod bn254;\nuse crate::{runtime::is_unconstrained, static_assert};\nuse bn254::lt as bn254_lt;\n\nimpl Field {\n /// Asserts that `self` can be represented in `bit_size` bits.\n ///\n /// # Failures\n /// Causes a constraint failure for `Field` values exceeding `2^{bit_size}`.\n // docs:start:assert_max_bit_size\n pub fn assert_max_bit_size<let BIT_SIZE: u32>(self) {\n // docs:end:assert_max_bit_size\n static_assert(\n BIT_SIZE < modulus_num_bits() as u32,\n \"BIT_SIZE must be less than modulus_num_bits\",\n );\n __assert_max_bit_size(self, BIT_SIZE);\n }\n\n /// Decomposes `self` into its little endian bit decomposition as a `[bool; N]` array.\n /// This array will be zero padded should not all bits be necessary to represent `self`.\n ///\n /// # Failures\n /// Causes a constraint failure for `Field` values exceeding `2^N` as the resulting array will not\n /// be able to represent the original `Field`.\n ///\n /// # Safety\n /// The bit decomposition returned is canonical and is guaranteed to not overflow the modulus.\n // docs:start:to_le_bits\n pub fn to_le_bits<let N: u32>(self: Self) -> [bool; N] {\n // docs:end:to_le_bits\n let bits = __to_le_bits(self);\n\n if !is_unconstrained() {\n // Ensure that the byte decomposition does not overflow the modulus\n let p = modulus_le_bits();\n assert(bits.len() <= p.len());\n let mut ok = bits.len() != p.len();\n for i in 0..N {\n if !ok {\n if (bits[N - 1 - i] != p[N - 1 - i]) {\n assert(p[N - 1 - i]);\n ok = true;\n }\n }\n }\n assert(ok);\n }\n bits\n }\n\n /// Decomposes `self` into its big endian bit decomposition as a `[bool; N]` array.\n /// This array will be zero padded should not all bits be necessary to represent `self`.\n ///\n /// # Failures\n /// Causes a constraint failure for `Field` values exceeding `2^N` as the resulting array will not\n /// be able to represent the original `Field`.\n ///\n /// # Safety\n /// The bit decomposition returned is canonical and is guaranteed to not overflow the modulus.\n // docs:start:to_be_bits\n pub fn to_be_bits<let N: u32>(self: Self) -> [bool; N] {\n // docs:end:to_be_bits\n let bits = __to_be_bits(self);\n\n if !is_unconstrained() {\n // Ensure that the decomposition does not overflow the modulus\n let p = modulus_be_bits();\n assert(bits.len() <= p.len());\n let mut ok = bits.len() != p.len();\n for i in 0..N {\n if !ok {\n if (bits[i] != p[i]) {\n assert(p[i]);\n ok = true;\n }\n }\n }\n assert(ok);\n }\n bits\n }\n\n /// Decomposes `self` into its little endian byte decomposition as a `[u8;N]` array\n /// This array will be zero padded should not all bytes be necessary to represent `self`.\n ///\n /// # Failures\n /// The length N of the array must be big enough to contain all the bytes of the 'self',\n /// and no more than the number of bytes required to represent the field modulus\n ///\n /// # Safety\n /// The result is ensured to be the canonical decomposition of the field element\n // docs:start:to_le_bytes\n pub fn to_le_bytes<let N: u32>(self: Self) -> [u8; N] {\n // docs:end:to_le_bytes\n static_assert(\n N <= modulus_le_bytes().len(),\n \"N must be less than or equal to modulus_le_bytes().len()\",\n );\n // Compute the byte decomposition\n let bytes = self.to_le_radix(256);\n\n if !is_unconstrained() {\n // Ensure that the byte decomposition does not overflow the modulus\n let p = modulus_le_bytes();\n assert(bytes.len() <= p.len());\n let mut ok = bytes.len() != p.len();\n for i in 0..N {\n if !ok {\n if (bytes[N - 1 - i] != p[N - 1 - i]) {\n assert(bytes[N - 1 - i] < p[N - 1 - i]);\n ok = true;\n }\n }\n }\n assert(ok);\n }\n bytes\n }\n\n /// Decomposes `self` into its big endian byte decomposition as a `[u8;N]` array of length required to represent the field modulus\n /// This array will be zero padded should not all bytes be necessary to represent `self`.\n ///\n /// # Failures\n /// The length N of the array must be big enough to contain all the bytes of the 'self',\n /// and no more than the number of bytes required to represent the field modulus\n ///\n /// # Safety\n /// The result is ensured to be the canonical decomposition of the field element\n // docs:start:to_be_bytes\n pub fn to_be_bytes<let N: u32>(self: Self) -> [u8; N] {\n // docs:end:to_be_bytes\n static_assert(\n N <= modulus_le_bytes().len(),\n \"N must be less than or equal to modulus_le_bytes().len()\",\n );\n // Compute the byte decomposition\n let bytes = self.to_be_radix(256);\n\n if !is_unconstrained() {\n // Ensure that the byte decomposition does not overflow the modulus\n let p = modulus_be_bytes();\n assert(bytes.len() <= p.len());\n let mut ok = bytes.len() != p.len();\n for i in 0..N {\n if !ok {\n if (bytes[i] != p[i]) {\n assert(bytes[i] < p[i]);\n ok = true;\n }\n }\n }\n assert(ok);\n }\n bytes\n }\n\n fn to_le_radix<let N: u32>(self: Self, radix: u32) -> [u8; N] {\n // Brillig does not need an immediate radix\n if !crate::runtime::is_unconstrained() {\n static_assert(1 < radix, \"radix must be greater than 1\");\n static_assert(radix <= 256, \"radix must be less than or equal to 256\");\n static_assert(radix & (radix - 1) == 0, \"radix must be a power of 2\");\n }\n __to_le_radix(self, radix)\n }\n\n fn to_be_radix<let N: u32>(self: Self, radix: u32) -> [u8; N] {\n // Brillig does not need an immediate radix\n if !crate::runtime::is_unconstrained() {\n static_assert(1 < radix, \"radix must be greater than 1\");\n static_assert(radix <= 256, \"radix must be less than or equal to 256\");\n static_assert(radix & (radix - 1) == 0, \"radix must be a power of 2\");\n }\n __to_be_radix(self, radix)\n }\n\n // Returns self to the power of the given exponent value.\n // Caution: we assume the exponent fits into 32 bits\n // using a bigger bit size impacts negatively the performance and should be done only if the exponent does not fit in 32 bits\n pub fn pow_32(self, exponent: Field) -> Field {\n let mut r: Field = 1;\n let b: [bool; 32] = exponent.to_le_bits();\n\n for i in 1..33 {\n r *= r;\n r = (b[32 - i] as Field) * (r * self) + (1 - b[32 - i] as Field) * r;\n }\n r\n }\n\n // Parity of (prime) Field element, i.e. sgn0(x mod p) = false if x `elem` {0, ..., p-1} is even, otherwise sgn0(x mod p) = true.\n pub fn sgn0(self) -> bool {\n (self as u8) % 2 == 1\n }\n\n pub fn lt(self, another: Field) -> bool {\n if crate::compat::is_bn254() {\n bn254_lt(self, another)\n } else {\n lt_fallback(self, another)\n }\n }\n\n /// Convert a little endian byte array to a field element.\n /// If the provided byte array overflows the field modulus then the Field will silently wrap around.\n ///\n /// # Failures\n /// `N` must be no greater than the number of bytes required to represent the field modulus\n // docs:start:from_le_bytes\n pub fn from_le_bytes<let N: u32>(bytes: [u8; N]) -> Field {\n // docs:end:from_le_bytes\n static_assert(\n N <= modulus_le_bytes().len(),\n \"N must be less than or equal to modulus_le_bytes().len()\",\n );\n let mut v = 1;\n let mut result = 0;\n\n for i in 0..N {\n result += (bytes[i] as Field) * v;\n v = v * 256;\n }\n result\n }\n\n /// Convert a big endian byte array to a field element.\n /// If the provided byte array overflows the field modulus then the Field will silently wrap around.\n ///\n /// # Failures\n /// `N` must be no greater than the number of bytes required to represent the field modulus\n // docs:start:from_be_bytes\n pub fn from_be_bytes<let N: u32>(bytes: [u8; N]) -> Field {\n // docs:end:from_be_bytes\n static_assert(\n N <= modulus_be_bytes().len(),\n \"N must be less than or equal to modulus_be_bytes().len()\",\n );\n let mut v = 1;\n let mut result = 0;\n\n for i in 0..N {\n result += (bytes[N - 1 - i] as Field) * v;\n v = v * 256;\n }\n result\n }\n\n /// Convert a little endian byte array to a field element, asserting that the input is a\n /// canonical representation (strictly less than the field modulus).\n ///\n /// # Failures\n /// Causes a constraint failure if `bytes` encodes a value greater than or equal to the\n /// field modulus.\n // docs:start:from_le_bytes_checked\n pub fn from_le_bytes_checked<let N: u32>(bytes: [u8; N]) -> Field {\n // docs:end:from_le_bytes_checked\n let p = modulus_le_bytes();\n let mut ok = N != p.len();\n for i in 0..N {\n if !ok {\n if bytes[N - 1 - i] != p[N - 1 - i] {\n assert(\n bytes[N - 1 - i] < p[N - 1 - i],\n \"input bytes are not a canonical field representation\",\n );\n ok = true;\n }\n }\n }\n assert(ok, \"input bytes are not a canonical field representation\");\n Field::from_le_bytes(bytes)\n }\n\n /// Convert a big endian byte array to a field element, asserting that the input is a\n /// canonical representation (strictly less than the field modulus).\n ///\n /// # Failures\n /// Causes a constraint failure if `bytes` encodes a value greater than or equal to the\n /// field modulus.\n // docs:start:from_be_bytes_checked\n pub fn from_be_bytes_checked<let N: u32>(bytes: [u8; N]) -> Field {\n // docs:end:from_be_bytes_checked\n let p = modulus_be_bytes();\n let mut ok = N != p.len();\n for i in 0..N {\n if !ok {\n if bytes[i] != p[i] {\n assert(bytes[i] < p[i], \"input bytes are not a canonical field representation\");\n ok = true;\n }\n }\n }\n assert(ok, \"input bytes are not a canonical field representation\");\n Field::from_be_bytes(bytes)\n }\n}\n\n#[builtin(apply_range_constraint)]\nfn __assert_max_bit_size(value: Field, bit_size: u32) {}\n\n// `_radix` must be less than 256\n#[builtin(to_le_radix)]\nfn __to_le_radix<let N: u32>(value: Field, radix: u32) -> [u8; N] {}\n\n// `_radix` must be less than 256\n#[builtin(to_be_radix)]\nfn __to_be_radix<let N: u32>(value: Field, radix: u32) -> [u8; N] {}\n\n/// Decomposes `self` into its little endian bit decomposition as a `[bool; N]` array.\n/// This array will be zero padded should not all bits be necessary to represent `self`.\n///\n/// # Failures\n/// Causes a constraint failure for `Field` values exceeding `2^N` as the resulting array will not\n/// be able to represent the original `Field`.\n///\n/// # Safety\n/// Values of `N` equal to or greater than the number of bits necessary to represent the `Field` modulus\n/// (e.g. 254 for the BN254 field) allow for multiple bit decompositions. This is due to how the `Field` will\n/// wrap around due to overflow when verifying the decomposition.\n#[builtin(to_le_bits)]\nfn __to_le_bits<let N: u32>(value: Field) -> [bool; N] {}\n\n/// Decomposes `self` into its big endian bit decomposition as a `[bool; N]` array.\n/// This array will be zero padded should not all bits be necessary to represent `self`.\n///\n/// # Failures\n/// Causes a constraint failure for `Field` values exceeding `2^N` as the resulting array will not\n/// be able to represent the original `Field`.\n///\n/// # Safety\n/// Values of `N` equal to or greater than the number of bits necessary to represent the `Field` modulus\n/// (e.g. 254 for the BN254 field) allow for multiple bit decompositions. This is due to how the `Field` will\n/// wrap around due to overflow when verifying the decomposition.\n#[builtin(to_be_bits)]\nfn __to_be_bits<let N: u32>(value: Field) -> [bool; N] {}\n\n#[builtin(modulus_num_bits)]\npub comptime fn modulus_num_bits() -> u64 {}\n\n#[builtin(modulus_be_bits)]\npub comptime fn modulus_be_bits() -> [bool] {}\n\n#[builtin(modulus_le_bits)]\npub comptime fn modulus_le_bits() -> [bool] {}\n\n#[builtin(modulus_be_bytes)]\npub comptime fn modulus_be_bytes() -> [u8] {}\n\n#[builtin(modulus_le_bytes)]\npub comptime fn modulus_le_bytes() -> [u8] {}\n\n/// An unconstrained only built in to efficiently compare fields.\n#[builtin(field_less_than)]\nunconstrained fn __field_less_than(x: Field, y: Field) -> bool {}\n\npub(crate) unconstrained fn field_less_than(x: Field, y: Field) -> bool {\n __field_less_than(x, y)\n}\n\nfn lt_fallback(x: Field, y: Field) -> bool {\n if is_unconstrained() {\n // Safety: unconstrained context\n unsafe {\n field_less_than(x, y)\n }\n } else {\n let x_bytes: [u8; 32] = x.to_le_bytes();\n let y_bytes: [u8; 32] = y.to_le_bytes();\n let mut x_is_lt = false;\n let mut done = false;\n for i in 0..32 {\n if (!done) {\n let x_byte = x_bytes[32 - 1 - i] as u8;\n let y_byte = y_bytes[32 - 1 - i] as u8;\n let bytes_match = x_byte == y_byte;\n if !bytes_match {\n x_is_lt = x_byte < y_byte;\n done = true;\n }\n }\n }\n x_is_lt\n }\n}\n\nmod tests {\n use crate::{panic::panic, runtime, static_assert};\n use super::{\n field_less_than, modulus_be_bits, modulus_be_bytes, modulus_le_bits, modulus_le_bytes,\n };\n\n #[test]\n // docs:start:to_be_bits_example\n fn test_to_be_bits() {\n let field = 2;\n let bits: [bool; 8] = field.to_be_bits();\n assert_eq(bits, [false, false, false, false, false, false, true, false]);\n }\n // docs:end:to_be_bits_example\n\n #[test]\n // docs:start:to_le_bits_example\n fn test_to_le_bits() {\n let field = 2;\n let bits: [bool; 8] = field.to_le_bits();\n assert_eq(bits, [false, true, false, false, false, false, false, false]);\n }\n // docs:end:to_le_bits_example\n\n #[test]\n // docs:start:to_be_bytes_example\n fn test_to_be_bytes() {\n let field = 2;\n let bytes: [u8; 8] = field.to_be_bytes();\n assert_eq(bytes, [0, 0, 0, 0, 0, 0, 0, 2]);\n assert_eq(Field::from_be_bytes::<8>(bytes), field);\n }\n // docs:end:to_be_bytes_example\n\n #[test]\n // docs:start:to_le_bytes_example\n fn test_to_le_bytes() {\n let field = 2;\n let bytes: [u8; 8] = field.to_le_bytes();\n assert_eq(bytes, [2, 0, 0, 0, 0, 0, 0, 0]);\n assert_eq(Field::from_le_bytes::<8>(bytes), field);\n }\n // docs:end:to_le_bytes_example\n\n #[test]\n // docs:start:to_be_radix_example\n fn test_to_be_radix() {\n // 259, in base 256, big endian, is [1, 3].\n // i.e. 3 * 256^0 + 1 * 256^1\n let field = 259;\n\n // The radix (in this example, 256) must be a power of 2.\n // The length of the returned byte array can be specified to be\n // >= the amount of space needed.\n let bytes: [u8; 8] = field.to_be_radix(256);\n assert_eq(bytes, [0, 0, 0, 0, 0, 0, 1, 3]);\n assert_eq(Field::from_be_bytes::<8>(bytes), field);\n }\n // docs:end:to_be_radix_example\n\n #[test]\n // docs:start:to_le_radix_example\n fn test_to_le_radix() {\n // 259, in base 256, little endian, is [3, 1].\n // i.e. 3 * 256^0 + 1 * 256^1\n let field = 259;\n\n // The radix (in this example, 256) must be a power of 2.\n // The length of the returned byte array can be specified to be\n // >= the amount of space needed.\n let bytes: [u8; 8] = field.to_le_radix(256);\n assert_eq(bytes, [3, 1, 0, 0, 0, 0, 0, 0]);\n assert_eq(Field::from_le_bytes::<8>(bytes), field);\n }\n // docs:end:to_le_radix_example\n\n #[test(should_fail_with = \"radix must be greater than 1\")]\n fn test_to_le_radix_1() {\n // this test should only fail in constrained mode\n if !runtime::is_unconstrained() {\n let field = 2;\n let _: [u8; 8] = field.to_le_radix(1);\n } else {\n panic(\"radix must be greater than 1\");\n }\n }\n\n // Updated test to account for Brillig restriction that radix must be greater than 2\n #[test(should_fail_with = \"radix must be greater than 1\")]\n fn test_to_le_radix_brillig_1() {\n // this test should only fail in constrained mode\n if !runtime::is_unconstrained() {\n let field = 1;\n let _: [u8; 8] = field.to_le_radix(1);\n } else {\n panic(\"radix must be greater than 1\");\n }\n }\n\n #[test(should_fail_with = \"radix must be a power of 2\")]\n fn test_to_le_radix_3() {\n // this test should only fail in constrained mode\n if !runtime::is_unconstrained() {\n let field = 2;\n let _: [u8; 8] = field.to_le_radix(3);\n } else {\n panic(\"radix must be a power of 2\");\n }\n }\n\n #[test]\n fn test_to_le_radix_brillig_3() {\n // this test should only fail in constrained mode\n if runtime::is_unconstrained() {\n let field = 1;\n let out: [u8; 8] = field.to_le_radix(3);\n let mut expected = [0; 8];\n expected[0] = 1;\n assert(out == expected, \"unexpected result\");\n }\n }\n\n #[test(should_fail_with = \"radix must be less than or equal to 256\")]\n fn test_to_le_radix_512() {\n // this test should only fail in constrained mode\n if !runtime::is_unconstrained() {\n let field = 2;\n let _: [u8; 8] = field.to_le_radix(512);\n } else {\n panic(\"radix must be less than or equal to 256\")\n }\n }\n\n #[test(should_fail_with = \"Field failed to decompose into specified 16 limbs\")]\n unconstrained fn not_enough_limbs_brillig() {\n let _: [u8; 16] = 0x100000000000000000000000000000000.to_le_bytes();\n }\n\n #[test(should_fail_with = \"Field failed to decompose into specified 16 limbs\")]\n fn not_enough_limbs() {\n let _: [u8; 16] = 0x100000000000000000000000000000000.to_le_bytes();\n }\n\n #[test(should_fail_with = \"Field failed to decompose into specified 0 limbs\")]\n unconstrained fn non_zero_field_to_le_bytes_zero_limbs() {\n let _: [u8; 0] = 5.to_le_bytes();\n }\n\n #[test(should_fail_with = \"Field failed to decompose into specified 0 limbs\")]\n unconstrained fn non_zero_field_to_be_bytes_zero_limbs() {\n let _: [u8; 0] = 5.to_be_bytes();\n }\n\n #[test]\n unconstrained fn test_field_less_than() {\n assert(field_less_than(0, 1));\n assert(field_less_than(0, 0x100));\n assert(field_less_than(0x100, 0 - 1));\n assert(!field_less_than(0 - 1, 0));\n }\n\n #[test]\n unconstrained fn test_large_field_values_unconstrained() {\n let large_field = 0xffffffffffffffff;\n\n let bits: [bool; 64] = large_field.to_le_bits();\n assert_eq(bits[0], true);\n\n let bytes: [u8; 8] = large_field.to_le_bytes();\n assert_eq(Field::from_le_bytes::<8>(bytes), large_field);\n\n let radix_bytes: [u8; 8] = large_field.to_le_radix(256);\n assert_eq(Field::from_le_bytes::<8>(radix_bytes), large_field);\n }\n\n #[test]\n fn test_large_field_values() {\n let large_val = 0xffffffffffffffff;\n\n let bits: [bool; 64] = large_val.to_le_bits();\n assert_eq(bits[0], true);\n\n let bytes: [u8; 8] = large_val.to_le_bytes();\n assert_eq(Field::from_le_bytes::<8>(bytes), large_val);\n\n let radix_bytes: [u8; 8] = large_val.to_le_radix(256);\n assert_eq(Field::from_le_bytes::<8>(radix_bytes), large_val);\n }\n\n #[test]\n fn test_decomposition_edge_cases() {\n let zero_bits: [bool; 8] = 0.to_le_bits();\n assert_eq(zero_bits, [false; 8]);\n\n let zero_bytes: [u8; 8] = 0.to_le_bytes();\n assert_eq(zero_bytes, [0; 8]);\n\n let one_bits: [bool; 8] = 1.to_le_bits();\n let expected: [bool; 8] = [true, false, false, false, false, false, false, false];\n assert_eq(one_bits, expected);\n\n let pow2_bits: [bool; 8] = 4.to_le_bits();\n let expected: [bool; 8] = [false, false, true, false, false, false, false, false];\n assert_eq(pow2_bits, expected);\n }\n\n #[test]\n fn test_pow_32() {\n assert_eq(2.pow_32(3), 8);\n assert_eq(3.pow_32(2), 9);\n assert_eq(5.pow_32(0), 1);\n assert_eq(7.pow_32(1), 7);\n\n assert_eq(2.pow_32(10), 1024);\n\n assert_eq(0.pow_32(5), 0);\n assert_eq(0.pow_32(0), 1);\n\n assert_eq(1.pow_32(100), 1);\n }\n\n #[test]\n fn test_sgn0() {\n assert_eq(0.sgn0(), false);\n assert_eq(2.sgn0(), false);\n assert_eq(4.sgn0(), false);\n assert_eq(100.sgn0(), false);\n\n assert_eq(1.sgn0(), true);\n assert_eq(3.sgn0(), true);\n assert_eq(5.sgn0(), true);\n assert_eq(101.sgn0(), true);\n }\n\n #[test(should_fail_with = \"Field failed to decompose into specified 8 limbs\")]\n fn test_bit_decomposition_overflow() {\n // 8 bits can't represent large field values\n let large_val = 0x1000000000000000;\n let _: [bool; 8] = large_val.to_le_bits();\n }\n\n #[test(should_fail_with = \"Field failed to decompose into specified 4 limbs\")]\n fn test_byte_decomposition_overflow() {\n // 4 bytes can't represent large field values\n let large_val = 0x1000000000000000;\n let _: [u8; 4] = large_val.to_le_bytes();\n }\n\n #[test]\n fn test_to_from_be_bytes_bn254_edge_cases() {\n if crate::compat::is_bn254() {\n // checking that decrementing this byte produces the expected 32 BE bytes for (modulus - 1)\n let mut p_minus_1_bytes: [u8; 32] = modulus_be_bytes().as_array();\n assert(p_minus_1_bytes[32 - 1] > 0);\n p_minus_1_bytes[32 - 1] -= 1;\n\n let p_minus_1 = Field::from_be_bytes::<32>(p_minus_1_bytes);\n assert_eq(p_minus_1 + 1, 0);\n\n // checking that converting (modulus - 1) from and then to 32 BE bytes produces the same bytes\n let p_minus_1_converted_bytes: [u8; 32] = p_minus_1.to_be_bytes();\n assert_eq(p_minus_1_converted_bytes, p_minus_1_bytes);\n\n // checking that incrementing this byte produces 32 BE bytes for (modulus + 1)\n let mut p_plus_1_bytes: [u8; 32] = modulus_be_bytes().as_array();\n assert(p_plus_1_bytes[32 - 1] < 255);\n p_plus_1_bytes[32 - 1] += 1;\n\n let p_plus_1 = Field::from_be_bytes::<32>(p_plus_1_bytes);\n assert_eq(p_plus_1, 1);\n\n // checking that converting p_plus_1 to 32 BE bytes produces the same\n // byte set to 1 as p_plus_1_bytes and otherwise zeroes\n let mut p_plus_1_converted_bytes: [u8; 32] = p_plus_1.to_be_bytes();\n assert_eq(p_plus_1_converted_bytes[32 - 1], 1);\n p_plus_1_converted_bytes[32 - 1] = 0;\n assert_eq(p_plus_1_converted_bytes, [0; 32]);\n\n // checking that Field::from_be_bytes::<32> on the Field modulus produces 0\n assert_eq(modulus_be_bytes().len(), 32);\n let p = Field::from_be_bytes::<32>(modulus_be_bytes().as_array());\n assert_eq(p, 0);\n\n // checking that converting 0 to 32 BE bytes produces 32 zeroes\n let p_bytes: [u8; 32] = 0.to_be_bytes();\n assert_eq(p_bytes, [0; 32]);\n }\n }\n\n #[test]\n fn test_to_from_le_bytes_bn254_edge_cases() {\n if crate::compat::is_bn254() {\n // checking that decrementing this byte produces the expected 32 LE bytes for (modulus - 1)\n let mut p_minus_1_bytes: [u8; 32] = modulus_le_bytes().as_array();\n assert(p_minus_1_bytes[0] > 0);\n p_minus_1_bytes[0] -= 1;\n\n let p_minus_1 = Field::from_le_bytes::<32>(p_minus_1_bytes);\n assert_eq(p_minus_1 + 1, 0);\n\n // checking that converting (modulus - 1) from and then to 32 BE bytes produces the same bytes\n let p_minus_1_converted_bytes: [u8; 32] = p_minus_1.to_le_bytes();\n assert_eq(p_minus_1_converted_bytes, p_minus_1_bytes);\n\n // checking that incrementing this byte produces 32 LE bytes for (modulus + 1)\n let mut p_plus_1_bytes: [u8; 32] = modulus_le_bytes().as_array();\n assert(p_plus_1_bytes[0] < 255);\n p_plus_1_bytes[0] += 1;\n\n let p_plus_1 = Field::from_le_bytes::<32>(p_plus_1_bytes);\n assert_eq(p_plus_1, 1);\n\n // checking that converting p_plus_1 to 32 LE bytes produces the same\n // byte set to 1 as p_plus_1_bytes and otherwise zeroes\n let mut p_plus_1_converted_bytes: [u8; 32] = p_plus_1.to_le_bytes();\n assert_eq(p_plus_1_converted_bytes[0], 1);\n p_plus_1_converted_bytes[0] = 0;\n assert_eq(p_plus_1_converted_bytes, [0; 32]);\n\n // checking that Field::from_le_bytes::<32> on the Field modulus produces 0\n assert_eq(modulus_le_bytes().len(), 32);\n let p = Field::from_le_bytes::<32>(modulus_le_bytes().as_array());\n assert_eq(p, 0);\n\n // checking that converting 0 to 32 LE bytes produces 32 zeroes\n let p_bytes: [u8; 32] = 0.to_le_bytes();\n assert_eq(p_bytes, [0; 32]);\n }\n }\n\n #[test]\n fn test_from_le_bytes_checked_accepts_modulus_minus_one() {\n if crate::compat::is_bn254() {\n let mut p_minus_1_bytes: [u8; 32] = modulus_le_bytes().as_array();\n assert(p_minus_1_bytes[0] > 0);\n p_minus_1_bytes[0] -= 1;\n let p_minus_1 = Field::from_le_bytes_checked::<32>(p_minus_1_bytes);\n assert_eq(p_minus_1 + 1, 0);\n }\n }\n\n #[test(should_fail_with = \"input bytes are not a canonical field representation\")]\n fn test_from_le_bytes_checked_rejects_modulus() {\n if crate::compat::is_bn254() {\n let _ = Field::from_le_bytes_checked::<32>(modulus_le_bytes().as_array());\n } else {\n panic(\"input bytes are not a canonical field representation\");\n }\n }\n\n #[test(should_fail_with = \"input bytes are not a canonical field representation\")]\n fn test_from_le_bytes_checked_rejects_modulus_plus_one() {\n if crate::compat::is_bn254() {\n let mut p_plus_1_bytes: [u8; 32] = modulus_le_bytes().as_array();\n assert(p_plus_1_bytes[0] < 255);\n p_plus_1_bytes[0] += 1;\n let _ = Field::from_le_bytes_checked::<32>(p_plus_1_bytes);\n } else {\n panic(\"input bytes are not a canonical field representation\");\n }\n }\n\n #[test]\n fn test_from_be_bytes_checked_accepts_modulus_minus_one() {\n if crate::compat::is_bn254() {\n let mut p_minus_1_bytes: [u8; 32] = modulus_be_bytes().as_array();\n assert(p_minus_1_bytes[32 - 1] > 0);\n p_minus_1_bytes[32 - 1] -= 1;\n let p_minus_1 = Field::from_be_bytes_checked::<32>(p_minus_1_bytes);\n assert_eq(p_minus_1 + 1, 0);\n }\n }\n\n #[test(should_fail_with = \"input bytes are not a canonical field representation\")]\n fn test_from_be_bytes_checked_rejects_modulus() {\n if crate::compat::is_bn254() {\n let _ = Field::from_be_bytes_checked::<32>(modulus_be_bytes().as_array());\n } else {\n panic(\"input bytes are not a canonical field representation\");\n }\n }\n\n #[test(should_fail_with = \"input bytes are not a canonical field representation\")]\n fn test_from_be_bytes_checked_rejects_modulus_plus_one() {\n if crate::compat::is_bn254() {\n let mut p_plus_1_bytes: [u8; 32] = modulus_be_bytes().as_array();\n assert(p_plus_1_bytes[32 - 1] < 255);\n p_plus_1_bytes[32 - 1] += 1;\n let _ = Field::from_be_bytes_checked::<32>(p_plus_1_bytes);\n } else {\n panic(\"input bytes are not a canonical field representation\");\n }\n }\n\n #[test]\n fn test_from_bytes_checked_small_n() {\n // For N < modulus_bytes().len(), the input cannot overflow the modulus, so the checked\n // variants behave identically to the unchecked ones.\n let le_bytes: [u8; 8] = [3, 1, 0, 0, 0, 0, 0, 0];\n assert_eq(Field::from_le_bytes_checked::<8>(le_bytes), 259);\n let be_bytes: [u8; 8] = [0, 0, 0, 0, 0, 0, 1, 3];\n assert_eq(Field::from_be_bytes_checked::<8>(be_bytes), 259);\n }\n\n /// Convert a little endian bit array to a field element.\n /// If the provided bit array overflows the field modulus then the Field will silently wrap around.\n fn from_le_bits<let N: u32>(bits: [bool; N]) -> Field {\n static_assert(\n N <= modulus_le_bits().len(),\n \"N must be less than or equal to modulus_le_bits().len()\",\n );\n let mut v = 1;\n let mut result = 0;\n\n for i in 0..N {\n result += (bits[i] as Field) * v;\n v = v * 2;\n }\n result\n }\n\n /// Convert a big endian bit array to a field element.\n /// If the provided bit array overflows the field modulus then the Field will silently wrap around.\n fn from_be_bits<let N: u32>(bits: [bool; N]) -> Field {\n let mut v = 1;\n let mut result = 0;\n\n for i in 0..N {\n result += (bits[N - 1 - i] as Field) * v;\n v = v * 2;\n }\n result\n }\n\n #[test]\n fn test_to_from_be_bits_bn254_edge_cases() {\n if crate::compat::is_bn254() {\n // checking that decrementing this bit produces the expected 254 BE bits for (modulus - 1)\n let mut p_minus_1_bits: [bool; 254] = modulus_be_bits().as_array();\n assert(p_minus_1_bits[254 - 1]);\n p_minus_1_bits[254 - 1] = false;\n\n let p_minus_1 = from_be_bits::<254>(p_minus_1_bits);\n assert_eq(p_minus_1 + 1, 0);\n\n // checking that converting (modulus - 1) from and then to 254 BE bits produces the same bits\n let p_minus_1_converted_bits: [bool; 254] = p_minus_1.to_be_bits();\n assert_eq(p_minus_1_converted_bits, p_minus_1_bits);\n\n // checking that incrementing this bit produces 254 BE bits for (modulus + 4)\n let mut p_plus_4_bits: [bool; 254] = modulus_be_bits().as_array();\n assert(!p_plus_4_bits[254 - 3]);\n p_plus_4_bits[254 - 3] = true;\n\n let p_plus_4 = from_be_bits::<254>(p_plus_4_bits);\n assert_eq(p_plus_4, 4);\n\n // checking that converting p_plus_4 to 254 BE bits produces the same\n // bit set to 1 as p_plus_4_bits and otherwise zeroes\n let mut p_plus_4_converted_bits: [bool; 254] = p_plus_4.to_be_bits();\n assert(p_plus_4_converted_bits[254 - 3]);\n p_plus_4_converted_bits[254 - 3] = false;\n assert_eq(p_plus_4_converted_bits, [false; 254]);\n\n // checking that Field::from_be_bits::<254> on the Field modulus produces 0\n assert_eq(modulus_be_bits().len(), 254);\n let p = from_be_bits::<254>(modulus_be_bits().as_array());\n assert_eq(p, 0);\n\n // checking that converting 0 to 254 BE bits produces 254 false values\n let p_bits: [bool; 254] = 0.to_be_bits();\n assert_eq(p_bits, [false; 254]);\n }\n }\n\n #[test]\n fn test_to_from_le_bits_bn254_edge_cases() {\n if crate::compat::is_bn254() {\n // checking that decrementing this bit produces the expected 254 LE bits for (modulus - 1)\n let mut p_minus_1_bits: [bool; 254] = modulus_le_bits().as_array();\n assert(p_minus_1_bits[0]);\n p_minus_1_bits[0] = false;\n\n let p_minus_1 = from_le_bits::<254>(p_minus_1_bits);\n assert_eq(p_minus_1 + 1, 0);\n\n // checking that converting (modulus - 1) from and then to 254 BE bits produces the same bits\n let p_minus_1_converted_bits: [bool; 254] = p_minus_1.to_le_bits();\n assert_eq(p_minus_1_converted_bits, p_minus_1_bits);\n\n // checking that incrementing this bit produces 254 LE bits for (modulus + 4)\n let mut p_plus_4_bits: [bool; 254] = modulus_le_bits().as_array();\n assert(!p_plus_4_bits[2]);\n p_plus_4_bits[2] = true;\n\n let p_plus_4 = from_le_bits::<254>(p_plus_4_bits);\n assert_eq(p_plus_4, 4);\n\n // checking that converting p_plus_4 to 254 LE bits produces the same\n // bit set to 1 as p_plus_4_bits and otherwise zeroes\n let mut p_plus_4_converted_bits: [bool; 254] = p_plus_4.to_le_bits();\n assert(p_plus_4_converted_bits[2]);\n p_plus_4_converted_bits[2] = false;\n assert_eq(p_plus_4_converted_bits, [false; 254]);\n\n // checking that Field::from_le_bits::<254> on the Field modulus produces 0\n assert_eq(modulus_le_bits().len(), 254);\n let p = from_le_bits::<254>(modulus_le_bits().as_array());\n assert_eq(p, 0);\n\n // checking that converting 0 to 254 LE bits produces 254 false values\n let p_bits: [bool; 254] = 0.to_le_bits();\n assert_eq(p_bits, [false; 254]);\n }\n }\n\n #[test(should_fail_with = \"call to assert_max_bit_size\")]\n fn max_bit_size_too_large() {\n let x: Field = 0x010000;\n x.assert_max_bit_size::<16>();\n }\n\n}\n"
741
+ "source": "pub mod bn254;\nuse crate::{runtime::is_unconstrained, static_assert};\nuse bn254::lt as bn254_lt;\n\nimpl Field {\n /// Asserts that `self` can be represented in `bit_size` bits.\n ///\n /// # Failures\n /// Causes a constraint failure for `Field` values exceeding `2^{bit_size}`.\n // docs:start:assert_max_bit_size\n pub fn assert_max_bit_size<let BIT_SIZE: u32>(self) {\n // docs:end:assert_max_bit_size\n static_assert(\n BIT_SIZE < modulus_num_bits() as u32,\n \"BIT_SIZE must be less than modulus_num_bits\",\n );\n __assert_max_bit_size(self, BIT_SIZE);\n }\n\n /// Decomposes `self` into its little endian bit decomposition as a `[bool; N]` array.\n /// This array will be zero padded should not all bits be necessary to represent `self`.\n ///\n /// # Failures\n /// Causes a constraint failure for `Field` values exceeding `2^N` as the resulting array will not\n /// be able to represent the original `Field`.\n ///\n /// # Safety\n /// The bit decomposition returned is canonical and is guaranteed to not overflow the modulus.\n // docs:start:to_le_bits\n pub fn to_le_bits<let N: u32>(self: Self) -> [bool; N] {\n // docs:end:to_le_bits\n let bits = __to_le_bits(self);\n\n if !is_unconstrained() {\n // Ensure that the byte decomposition does not overflow the modulus\n let p = modulus_le_bits();\n assert(bits.len() <= p.len());\n let mut ok = bits.len() != p.len();\n for i in 0..N {\n if !ok {\n if (bits[N - 1 - i] != p[N - 1 - i]) {\n assert(p[N - 1 - i]);\n ok = true;\n }\n }\n }\n assert(ok);\n }\n bits\n }\n\n /// Decomposes `self` into its big endian bit decomposition as a `[bool; N]` array.\n /// This array will be zero padded should not all bits be necessary to represent `self`.\n ///\n /// # Failures\n /// Causes a constraint failure for `Field` values exceeding `2^N` as the resulting array will not\n /// be able to represent the original `Field`.\n ///\n /// # Safety\n /// The bit decomposition returned is canonical and is guaranteed to not overflow the modulus.\n // docs:start:to_be_bits\n pub fn to_be_bits<let N: u32>(self: Self) -> [bool; N] {\n // docs:end:to_be_bits\n let bits = __to_be_bits(self);\n\n if !is_unconstrained() {\n // Ensure that the decomposition does not overflow the modulus\n let p = modulus_be_bits();\n assert(bits.len() <= p.len());\n let mut ok = bits.len() != p.len();\n for i in 0..N {\n if !ok {\n if (bits[i] != p[i]) {\n assert(p[i]);\n ok = true;\n }\n }\n }\n assert(ok);\n }\n bits\n }\n\n /// Decomposes `self` into its little endian byte decomposition as a `[u8;N]` array\n /// This array will be zero padded should not all bytes be necessary to represent `self`.\n ///\n /// # Failures\n /// The length N of the array must be big enough to contain all the bytes of the 'self',\n /// and no more than the number of bytes required to represent the field modulus\n ///\n /// # Safety\n /// The result is ensured to be the canonical decomposition of the field element\n // docs:start:to_le_bytes\n pub fn to_le_bytes<let N: u32>(self: Self) -> [u8; N] {\n // docs:end:to_le_bytes\n static_assert(\n N <= modulus_le_bytes().len(),\n \"N must be less than or equal to modulus_le_bytes().len()\",\n );\n // Compute the byte decomposition\n let bytes = self.to_le_radix(256);\n\n if !is_unconstrained() {\n // Ensure that the byte decomposition does not overflow the modulus\n let p = modulus_le_bytes();\n assert(bytes.len() <= p.len());\n let mut ok = bytes.len() != p.len();\n for i in 0..N {\n if !ok {\n if (bytes[N - 1 - i] != p[N - 1 - i]) {\n assert(bytes[N - 1 - i] < p[N - 1 - i]);\n ok = true;\n }\n }\n }\n assert(ok);\n }\n bytes\n }\n\n /// Decomposes `self` into its big endian byte decomposition as a `[u8;N]` array of length required to represent the field modulus\n /// This array will be zero padded should not all bytes be necessary to represent `self`.\n ///\n /// # Failures\n /// The length N of the array must be big enough to contain all the bytes of the 'self',\n /// and no more than the number of bytes required to represent the field modulus\n ///\n /// # Safety\n /// The result is ensured to be the canonical decomposition of the field element\n // docs:start:to_be_bytes\n pub fn to_be_bytes<let N: u32>(self: Self) -> [u8; N] {\n // docs:end:to_be_bytes\n static_assert(\n N <= modulus_le_bytes().len(),\n \"N must be less than or equal to modulus_le_bytes().len()\",\n );\n // Compute the byte decomposition\n let bytes = self.to_be_radix(256);\n\n if !is_unconstrained() {\n // Ensure that the byte decomposition does not overflow the modulus\n let p = modulus_be_bytes();\n assert(bytes.len() <= p.len());\n let mut ok = bytes.len() != p.len();\n for i in 0..N {\n if !ok {\n if (bytes[i] != p[i]) {\n assert(bytes[i] < p[i]);\n ok = true;\n }\n }\n }\n assert(ok);\n }\n bytes\n }\n\n fn to_le_radix<let N: u32>(self: Self, radix: u32) -> [u8; N] {\n // Brillig does not need an immediate radix\n if !crate::runtime::is_unconstrained() {\n static_assert(1 < radix, \"radix must be greater than 1\");\n static_assert(radix <= 256, \"radix must be less than or equal to 256\");\n static_assert(radix & (radix - 1) == 0, \"radix must be a power of 2\");\n }\n __to_le_radix(self, radix)\n }\n\n fn to_be_radix<let N: u32>(self: Self, radix: u32) -> [u8; N] {\n // Brillig does not need an immediate radix\n if !crate::runtime::is_unconstrained() {\n static_assert(1 < radix, \"radix must be greater than 1\");\n static_assert(radix <= 256, \"radix must be less than or equal to 256\");\n static_assert(radix & (radix - 1) == 0, \"radix must be a power of 2\");\n }\n __to_be_radix(self, radix)\n }\n\n // Returns self to the power of the given exponent value.\n // Caution: we assume the exponent fits into 32 bits\n // using a bigger bit size impacts negatively the performance and should be done only if the exponent does not fit in 32 bits\n pub fn pow_32(self, exponent: Field) -> Field {\n let mut r: Field = 1;\n let b: [bool; 32] = exponent.to_le_bits();\n\n for i in 1..33 {\n r *= r;\n r = (b[32 - i] as Field) * (r * self) + (1 - b[32 - i] as Field) * r;\n }\n r\n }\n\n // Parity of (prime) Field element, i.e. sgn0(x mod p) = false if x `elem` {0, ..., p-1} is even, otherwise sgn0(x mod p) = true.\n pub fn sgn0(self) -> bool {\n (self as u8) % 2 == 1\n }\n\n pub fn lt(self, another: Field) -> bool {\n if crate::compat::is_bn254() {\n bn254_lt(self, another)\n } else {\n lt_fallback(self, another)\n }\n }\n\n /// Convert a little endian byte array to a field element.\n /// If the provided byte array overflows the field modulus then the Field will silently wrap around.\n ///\n /// # Failures\n /// `N` must be no greater than the number of bytes required to represent the field modulus\n // docs:start:from_le_bytes\n pub fn from_le_bytes<let N: u32>(bytes: [u8; N]) -> Field {\n // docs:end:from_le_bytes\n static_assert(\n N <= modulus_le_bytes().len(),\n \"N must be less than or equal to modulus_le_bytes().len()\",\n );\n let mut v = 1;\n let mut result = 0;\n\n for i in 0..N {\n result += (bytes[i] as Field) * v;\n v = v * 256;\n }\n result\n }\n\n /// Convert a big endian byte array to a field element.\n /// If the provided byte array overflows the field modulus then the Field will silently wrap around.\n ///\n /// # Failures\n /// `N` must be no greater than the number of bytes required to represent the field modulus\n // docs:start:from_be_bytes\n pub fn from_be_bytes<let N: u32>(bytes: [u8; N]) -> Field {\n // docs:end:from_be_bytes\n static_assert(\n N <= modulus_be_bytes().len(),\n \"N must be less than or equal to modulus_be_bytes().len()\",\n );\n let mut v = 1;\n let mut result = 0;\n\n for i in 0..N {\n result += (bytes[N - 1 - i] as Field) * v;\n v = v * 256;\n }\n result\n }\n\n /// Convert a little endian byte array to a field element, asserting that the input is a\n /// canonical representation (strictly less than the field modulus).\n ///\n /// # Failures\n /// Causes a constraint failure if `bytes` encodes a value greater than or equal to the\n /// field modulus.\n // docs:start:from_le_bytes_checked\n pub fn from_le_bytes_checked<let N: u32>(bytes: [u8; N]) -> Field {\n // docs:end:from_le_bytes_checked\n let p = modulus_le_bytes();\n let mut ok = N != p.len();\n for i in 0..N {\n if !ok {\n if bytes[N - 1 - i] != p[N - 1 - i] {\n assert(\n bytes[N - 1 - i] < p[N - 1 - i],\n \"input bytes are not a canonical field representation\",\n );\n ok = true;\n }\n }\n }\n assert(ok, \"input bytes are not a canonical field representation\");\n Field::from_le_bytes(bytes)\n }\n\n /// Convert a big endian byte array to a field element, asserting that the input is a\n /// canonical representation (strictly less than the field modulus).\n ///\n /// # Failures\n /// Causes a constraint failure if `bytes` encodes a value greater than or equal to the\n /// field modulus.\n // docs:start:from_be_bytes_checked\n pub fn from_be_bytes_checked<let N: u32>(bytes: [u8; N]) -> Field {\n // docs:end:from_be_bytes_checked\n let p = modulus_be_bytes();\n let mut ok = N != p.len();\n for i in 0..N {\n if !ok {\n if bytes[i] != p[i] {\n assert(bytes[i] < p[i], \"input bytes are not a canonical field representation\");\n ok = true;\n }\n }\n }\n assert(ok, \"input bytes are not a canonical field representation\");\n Field::from_be_bytes(bytes)\n }\n}\n\n#[builtin(apply_range_constraint)]\nfn __assert_max_bit_size(value: Field, bit_size: u32) {}\n\n// `_radix` must be less than 256\n#[builtin(to_le_radix)]\nfn __to_le_radix<let N: u32>(value: Field, radix: u32) -> [u8; N] {}\n\n// `_radix` must be less than 256\n#[builtin(to_be_radix)]\nfn __to_be_radix<let N: u32>(value: Field, radix: u32) -> [u8; N] {}\n\n/// Decomposes `self` into its little endian bit decomposition as a `[bool; N]` array.\n/// This array will be zero padded should not all bits be necessary to represent `self`.\n///\n/// # Failures\n/// Causes a constraint failure for `Field` values exceeding `2^N` as the resulting array will not\n/// be able to represent the original `Field`.\n///\n/// # Safety\n/// Values of `N` equal to or greater than the number of bits necessary to represent the `Field` modulus\n/// (e.g. 254 for the BN254 field) allow for multiple bit decompositions. This is due to how the `Field` will\n/// wrap around due to overflow when verifying the decomposition.\n#[builtin(to_le_bits)]\nfn __to_le_bits<let N: u32>(value: Field) -> [bool; N] {}\n\n/// Decomposes `self` into its big endian bit decomposition as a `[bool; N]` array.\n/// This array will be zero padded should not all bits be necessary to represent `self`.\n///\n/// # Failures\n/// Causes a constraint failure for `Field` values exceeding `2^N` as the resulting array will not\n/// be able to represent the original `Field`.\n///\n/// # Safety\n/// Values of `N` equal to or greater than the number of bits necessary to represent the `Field` modulus\n/// (e.g. 254 for the BN254 field) allow for multiple bit decompositions. This is due to how the `Field` will\n/// wrap around due to overflow when verifying the decomposition.\n#[builtin(to_be_bits)]\nfn __to_be_bits<let N: u32>(value: Field) -> [bool; N] {}\n\n#[builtin(modulus_num_bits)]\npub comptime fn modulus_num_bits() -> u64 {}\n\n#[builtin(modulus_be_bits)]\npub comptime fn modulus_be_bits() -> [bool] {}\n\n#[builtin(modulus_le_bits)]\npub comptime fn modulus_le_bits() -> [bool] {}\n\n#[builtin(modulus_be_bytes)]\npub comptime fn modulus_be_bytes() -> [u8] {}\n\n#[builtin(modulus_le_bytes)]\npub comptime fn modulus_le_bytes() -> [u8] {}\n\n/// An unconstrained only built in to efficiently compare fields.\n#[builtin(field_less_than)]\nunconstrained fn __field_less_than(x: Field, y: Field) -> bool {}\n\npub(crate) unconstrained fn field_less_than(x: Field, y: Field) -> bool {\n __field_less_than(x, y)\n}\n\nfn lt_fallback(x: Field, y: Field) -> bool {\n if is_unconstrained() {\n // Safety: unconstrained context\n unsafe {\n field_less_than(x, y)\n }\n } else {\n let x_bytes: [u8; 32] = x.to_le_bytes();\n let y_bytes: [u8; 32] = y.to_le_bytes();\n let mut x_is_lt = false;\n let mut done = false;\n for i in 0..32 {\n if (!done) {\n let x_byte = x_bytes[32 - 1 - i] as u8;\n let y_byte = y_bytes[32 - 1 - i] as u8;\n let bytes_match = x_byte == y_byte;\n if !bytes_match {\n x_is_lt = x_byte < y_byte;\n done = true;\n }\n }\n }\n x_is_lt\n }\n}\n\nmod tests {\n use crate::{panic::panic, runtime, static_assert};\n use super::{\n field_less_than, modulus_be_bits, modulus_be_bytes, modulus_le_bits, modulus_le_bytes,\n };\n\n #[test]\n // docs:start:to_be_bits_example\n fn test_to_be_bits() {\n let field = 2;\n let bits: [bool; 8] = field.to_be_bits();\n assert_eq(bits, [false, false, false, false, false, false, true, false]);\n }\n // docs:end:to_be_bits_example\n\n #[test]\n // docs:start:to_le_bits_example\n fn test_to_le_bits() {\n let field = 2;\n let bits: [bool; 8] = field.to_le_bits();\n assert_eq(bits, [false, true, false, false, false, false, false, false]);\n }\n // docs:end:to_le_bits_example\n\n #[test]\n // docs:start:to_be_bytes_example\n fn test_to_be_bytes() {\n let field = 2;\n let bytes: [u8; 8] = field.to_be_bytes();\n assert_eq(bytes, [0, 0, 0, 0, 0, 0, 0, 2]);\n assert_eq(Field::from_be_bytes::<8>(bytes), field);\n }\n // docs:end:to_be_bytes_example\n\n #[test]\n // docs:start:to_le_bytes_example\n fn test_to_le_bytes() {\n let field = 2;\n let bytes: [u8; 8] = field.to_le_bytes();\n assert_eq(bytes, [2, 0, 0, 0, 0, 0, 0, 0]);\n assert_eq(Field::from_le_bytes::<8>(bytes), field);\n }\n // docs:end:to_le_bytes_example\n\n #[test]\n // docs:start:to_be_radix_example\n fn test_to_be_radix() {\n // 259, in base 256, big endian, is [1, 3].\n // i.e. 3 * 256^0 + 1 * 256^1\n let field = 259;\n\n // The radix (in this example, 256) must be a power of 2.\n // The length of the returned byte array can be specified to be\n // >= the amount of space needed.\n let bytes: [u8; 8] = field.to_be_radix(256);\n assert_eq(bytes, [0, 0, 0, 0, 0, 0, 1, 3]);\n assert_eq(Field::from_be_bytes::<8>(bytes), field);\n }\n // docs:end:to_be_radix_example\n\n #[test]\n // docs:start:to_le_radix_example\n fn test_to_le_radix() {\n // 259, in base 256, little endian, is [3, 1].\n // i.e. 3 * 256^0 + 1 * 256^1\n let field = 259;\n\n // The radix (in this example, 256) must be a power of 2.\n // The length of the returned byte array can be specified to be\n // >= the amount of space needed.\n let bytes: [u8; 8] = field.to_le_radix(256);\n assert_eq(bytes, [3, 1, 0, 0, 0, 0, 0, 0]);\n assert_eq(Field::from_le_bytes::<8>(bytes), field);\n }\n // docs:end:to_le_radix_example\n\n #[test(should_fail_with = \"radix must be greater than 1\")]\n fn test_to_le_radix_1() {\n // this test should only fail in constrained mode\n if !runtime::is_unconstrained() {\n let field = 2;\n let _: [u8; 8] = field.to_le_radix(1);\n } else {\n panic(\"radix must be greater than 1\");\n }\n }\n\n // Updated test to account for Brillig restriction that radix must be greater than 2\n #[test(should_fail_with = \"radix must be greater than 1\")]\n fn test_to_le_radix_brillig_1() {\n // this test should only fail in constrained mode\n if !runtime::is_unconstrained() {\n let field = 1;\n let _: [u8; 8] = field.to_le_radix(1);\n } else {\n panic(\"radix must be greater than 1\");\n }\n }\n\n #[test(should_fail_with = \"radix must be a power of 2\")]\n fn test_to_le_radix_3() {\n // this test should only fail in constrained mode\n if !runtime::is_unconstrained() {\n let field = 2;\n let _: [u8; 8] = field.to_le_radix(3);\n } else {\n panic(\"radix must be a power of 2\");\n }\n }\n\n #[test]\n fn test_to_le_radix_brillig_3() {\n // this test should only fail in constrained mode\n if runtime::is_unconstrained() {\n let field = 1;\n let out: [u8; 8] = field.to_le_radix(3);\n let mut expected = [0; 8];\n expected[0] = 1;\n assert(out == expected, \"unexpected result\");\n }\n }\n\n #[test(should_fail_with = \"radix must be less than or equal to 256\")]\n fn test_to_le_radix_512() {\n // this test should only fail in constrained mode\n if !runtime::is_unconstrained() {\n let field = 2;\n let _: [u8; 8] = field.to_le_radix(512);\n } else {\n panic(\"radix must be less than or equal to 256\")\n }\n }\n\n #[test(should_fail_with = \"Field failed to decompose into specified 16 limbs\")]\n unconstrained fn not_enough_limbs_brillig() {\n let _: [u8; 16] = 0x100000000000000000000000000000000.to_le_bytes();\n }\n\n #[test(should_fail_with = \"Field failed to decompose into specified 16 limbs\")]\n fn not_enough_limbs() {\n let _: [u8; 16] = 0x100000000000000000000000000000000.to_le_bytes();\n }\n\n #[test(should_fail_with = \"Field failed to decompose into specified 0 limbs\")]\n unconstrained fn non_zero_field_to_le_bytes_zero_limbs() {\n let _: [u8; 0] = 5.to_le_bytes();\n }\n\n #[test(should_fail_with = \"Field failed to decompose into specified 0 limbs\")]\n unconstrained fn non_zero_field_to_be_bytes_zero_limbs() {\n let _: [u8; 0] = 5.to_be_bytes();\n }\n\n #[test]\n unconstrained fn zero_field_to_bytes_zero_limbs_unconstrained() {\n assert_eq((0 as Field).to_le_bytes::<0>().len(), 0);\n assert_eq((0 as Field).to_be_bytes::<0>().len(), 0);\n assert_eq((0 as Field).to_le_bits::<0>().len(), 0);\n assert_eq((0 as Field).to_be_bits::<0>().len(), 0);\n }\n\n #[test]\n fn zero_field_to_bytes_zero_limbs_constrained() {\n assert_eq((0 as Field).to_le_bytes::<0>().len(), 0);\n assert_eq((0 as Field).to_be_bytes::<0>().len(), 0);\n assert_eq((0 as Field).to_le_bits::<0>().len(), 0);\n assert_eq((0 as Field).to_be_bits::<0>().len(), 0);\n }\n\n #[test]\n fn zero_field_to_bytes_zero_limbs_comptime() {\n let _: [u8; 0] = comptime { (0 as Field).to_le_bytes() };\n let _: [u8; 0] = comptime { (0 as Field).to_be_bytes() };\n let _: [bool; 0] = comptime { (0 as Field).to_le_bits() };\n let _: [bool; 0] = comptime { (0 as Field).to_be_bits() };\n }\n\n #[test]\n unconstrained fn test_field_less_than() {\n assert(field_less_than(0, 1));\n assert(field_less_than(0, 0x100));\n assert(field_less_than(0x100, 0 - 1));\n assert(!field_less_than(0 - 1, 0));\n }\n\n #[test]\n unconstrained fn test_large_field_values_unconstrained() {\n let large_field = 0xffffffffffffffff;\n\n let bits: [bool; 64] = large_field.to_le_bits();\n assert_eq(bits[0], true);\n\n let bytes: [u8; 8] = large_field.to_le_bytes();\n assert_eq(Field::from_le_bytes::<8>(bytes), large_field);\n\n let radix_bytes: [u8; 8] = large_field.to_le_radix(256);\n assert_eq(Field::from_le_bytes::<8>(radix_bytes), large_field);\n }\n\n #[test]\n fn test_large_field_values() {\n let large_val = 0xffffffffffffffff;\n\n let bits: [bool; 64] = large_val.to_le_bits();\n assert_eq(bits[0], true);\n\n let bytes: [u8; 8] = large_val.to_le_bytes();\n assert_eq(Field::from_le_bytes::<8>(bytes), large_val);\n\n let radix_bytes: [u8; 8] = large_val.to_le_radix(256);\n assert_eq(Field::from_le_bytes::<8>(radix_bytes), large_val);\n }\n\n #[test]\n fn test_decomposition_edge_cases() {\n let zero_bits: [bool; 8] = 0.to_le_bits();\n assert_eq(zero_bits, [false; 8]);\n\n let zero_bytes: [u8; 8] = 0.to_le_bytes();\n assert_eq(zero_bytes, [0; 8]);\n\n let one_bits: [bool; 8] = 1.to_le_bits();\n let expected: [bool; 8] = [true, false, false, false, false, false, false, false];\n assert_eq(one_bits, expected);\n\n let pow2_bits: [bool; 8] = 4.to_le_bits();\n let expected: [bool; 8] = [false, false, true, false, false, false, false, false];\n assert_eq(pow2_bits, expected);\n }\n\n #[test]\n fn test_pow_32() {\n assert_eq(2.pow_32(3), 8);\n assert_eq(3.pow_32(2), 9);\n assert_eq(5.pow_32(0), 1);\n assert_eq(7.pow_32(1), 7);\n\n assert_eq(2.pow_32(10), 1024);\n\n assert_eq(0.pow_32(5), 0);\n assert_eq(0.pow_32(0), 1);\n\n assert_eq(1.pow_32(100), 1);\n }\n\n #[test]\n fn test_sgn0() {\n assert_eq(0.sgn0(), false);\n assert_eq(2.sgn0(), false);\n assert_eq(4.sgn0(), false);\n assert_eq(100.sgn0(), false);\n\n assert_eq(1.sgn0(), true);\n assert_eq(3.sgn0(), true);\n assert_eq(5.sgn0(), true);\n assert_eq(101.sgn0(), true);\n }\n\n #[test(should_fail_with = \"Field failed to decompose into specified 8 limbs\")]\n fn test_bit_decomposition_overflow() {\n // 8 bits can't represent large field values\n let large_val = 0x1000000000000000;\n let _: [bool; 8] = large_val.to_le_bits();\n }\n\n #[test(should_fail_with = \"Field failed to decompose into specified 4 limbs\")]\n fn test_byte_decomposition_overflow() {\n // 4 bytes can't represent large field values\n let large_val = 0x1000000000000000;\n let _: [u8; 4] = large_val.to_le_bytes();\n }\n\n #[test]\n fn test_to_from_be_bytes_bn254_edge_cases() {\n if crate::compat::is_bn254() {\n // checking that decrementing this byte produces the expected 32 BE bytes for (modulus - 1)\n let mut p_minus_1_bytes: [u8; 32] = modulus_be_bytes().as_array();\n assert(p_minus_1_bytes[32 - 1] > 0);\n p_minus_1_bytes[32 - 1] -= 1;\n\n let p_minus_1 = Field::from_be_bytes::<32>(p_minus_1_bytes);\n assert_eq(p_minus_1 + 1, 0);\n\n // checking that converting (modulus - 1) from and then to 32 BE bytes produces the same bytes\n let p_minus_1_converted_bytes: [u8; 32] = p_minus_1.to_be_bytes();\n assert_eq(p_minus_1_converted_bytes, p_minus_1_bytes);\n\n // checking that incrementing this byte produces 32 BE bytes for (modulus + 1)\n let mut p_plus_1_bytes: [u8; 32] = modulus_be_bytes().as_array();\n assert(p_plus_1_bytes[32 - 1] < 255);\n p_plus_1_bytes[32 - 1] += 1;\n\n let p_plus_1 = Field::from_be_bytes::<32>(p_plus_1_bytes);\n assert_eq(p_plus_1, 1);\n\n // checking that converting p_plus_1 to 32 BE bytes produces the same\n // byte set to 1 as p_plus_1_bytes and otherwise zeroes\n let mut p_plus_1_converted_bytes: [u8; 32] = p_plus_1.to_be_bytes();\n assert_eq(p_plus_1_converted_bytes[32 - 1], 1);\n p_plus_1_converted_bytes[32 - 1] = 0;\n assert_eq(p_plus_1_converted_bytes, [0; 32]);\n\n // checking that Field::from_be_bytes::<32> on the Field modulus produces 0\n assert_eq(modulus_be_bytes().len(), 32);\n let p = Field::from_be_bytes::<32>(modulus_be_bytes().as_array());\n assert_eq(p, 0);\n\n // checking that converting 0 to 32 BE bytes produces 32 zeroes\n let p_bytes: [u8; 32] = 0.to_be_bytes();\n assert_eq(p_bytes, [0; 32]);\n }\n }\n\n #[test]\n fn test_to_from_le_bytes_bn254_edge_cases() {\n if crate::compat::is_bn254() {\n // checking that decrementing this byte produces the expected 32 LE bytes for (modulus - 1)\n let mut p_minus_1_bytes: [u8; 32] = modulus_le_bytes().as_array();\n assert(p_minus_1_bytes[0] > 0);\n p_minus_1_bytes[0] -= 1;\n\n let p_minus_1 = Field::from_le_bytes::<32>(p_minus_1_bytes);\n assert_eq(p_minus_1 + 1, 0);\n\n // checking that converting (modulus - 1) from and then to 32 BE bytes produces the same bytes\n let p_minus_1_converted_bytes: [u8; 32] = p_minus_1.to_le_bytes();\n assert_eq(p_minus_1_converted_bytes, p_minus_1_bytes);\n\n // checking that incrementing this byte produces 32 LE bytes for (modulus + 1)\n let mut p_plus_1_bytes: [u8; 32] = modulus_le_bytes().as_array();\n assert(p_plus_1_bytes[0] < 255);\n p_plus_1_bytes[0] += 1;\n\n let p_plus_1 = Field::from_le_bytes::<32>(p_plus_1_bytes);\n assert_eq(p_plus_1, 1);\n\n // checking that converting p_plus_1 to 32 LE bytes produces the same\n // byte set to 1 as p_plus_1_bytes and otherwise zeroes\n let mut p_plus_1_converted_bytes: [u8; 32] = p_plus_1.to_le_bytes();\n assert_eq(p_plus_1_converted_bytes[0], 1);\n p_plus_1_converted_bytes[0] = 0;\n assert_eq(p_plus_1_converted_bytes, [0; 32]);\n\n // checking that Field::from_le_bytes::<32> on the Field modulus produces 0\n assert_eq(modulus_le_bytes().len(), 32);\n let p = Field::from_le_bytes::<32>(modulus_le_bytes().as_array());\n assert_eq(p, 0);\n\n // checking that converting 0 to 32 LE bytes produces 32 zeroes\n let p_bytes: [u8; 32] = 0.to_le_bytes();\n assert_eq(p_bytes, [0; 32]);\n }\n }\n\n #[test]\n fn test_from_le_bytes_checked_accepts_modulus_minus_one() {\n if crate::compat::is_bn254() {\n let mut p_minus_1_bytes: [u8; 32] = modulus_le_bytes().as_array();\n assert(p_minus_1_bytes[0] > 0);\n p_minus_1_bytes[0] -= 1;\n let p_minus_1 = Field::from_le_bytes_checked::<32>(p_minus_1_bytes);\n assert_eq(p_minus_1 + 1, 0);\n }\n }\n\n #[test(should_fail_with = \"input bytes are not a canonical field representation\")]\n fn test_from_le_bytes_checked_rejects_modulus() {\n if crate::compat::is_bn254() {\n let _ = Field::from_le_bytes_checked::<32>(modulus_le_bytes().as_array());\n } else {\n panic(\"input bytes are not a canonical field representation\");\n }\n }\n\n #[test(should_fail_with = \"input bytes are not a canonical field representation\")]\n fn test_from_le_bytes_checked_rejects_modulus_plus_one() {\n if crate::compat::is_bn254() {\n let mut p_plus_1_bytes: [u8; 32] = modulus_le_bytes().as_array();\n assert(p_plus_1_bytes[0] < 255);\n p_plus_1_bytes[0] += 1;\n let _ = Field::from_le_bytes_checked::<32>(p_plus_1_bytes);\n } else {\n panic(\"input bytes are not a canonical field representation\");\n }\n }\n\n #[test]\n fn test_from_be_bytes_checked_accepts_modulus_minus_one() {\n if crate::compat::is_bn254() {\n let mut p_minus_1_bytes: [u8; 32] = modulus_be_bytes().as_array();\n assert(p_minus_1_bytes[32 - 1] > 0);\n p_minus_1_bytes[32 - 1] -= 1;\n let p_minus_1 = Field::from_be_bytes_checked::<32>(p_minus_1_bytes);\n assert_eq(p_minus_1 + 1, 0);\n }\n }\n\n #[test(should_fail_with = \"input bytes are not a canonical field representation\")]\n fn test_from_be_bytes_checked_rejects_modulus() {\n if crate::compat::is_bn254() {\n let _ = Field::from_be_bytes_checked::<32>(modulus_be_bytes().as_array());\n } else {\n panic(\"input bytes are not a canonical field representation\");\n }\n }\n\n #[test(should_fail_with = \"input bytes are not a canonical field representation\")]\n fn test_from_be_bytes_checked_rejects_modulus_plus_one() {\n if crate::compat::is_bn254() {\n let mut p_plus_1_bytes: [u8; 32] = modulus_be_bytes().as_array();\n assert(p_plus_1_bytes[32 - 1] < 255);\n p_plus_1_bytes[32 - 1] += 1;\n let _ = Field::from_be_bytes_checked::<32>(p_plus_1_bytes);\n } else {\n panic(\"input bytes are not a canonical field representation\");\n }\n }\n\n #[test]\n fn test_from_bytes_checked_small_n() {\n // For N < modulus_bytes().len(), the input cannot overflow the modulus, so the checked\n // variants behave identically to the unchecked ones.\n let le_bytes: [u8; 8] = [3, 1, 0, 0, 0, 0, 0, 0];\n assert_eq(Field::from_le_bytes_checked::<8>(le_bytes), 259);\n let be_bytes: [u8; 8] = [0, 0, 0, 0, 0, 0, 1, 3];\n assert_eq(Field::from_be_bytes_checked::<8>(be_bytes), 259);\n }\n\n /// Convert a little endian bit array to a field element.\n /// If the provided bit array overflows the field modulus then the Field will silently wrap around.\n fn from_le_bits<let N: u32>(bits: [bool; N]) -> Field {\n static_assert(\n N <= modulus_le_bits().len(),\n \"N must be less than or equal to modulus_le_bits().len()\",\n );\n let mut v = 1;\n let mut result = 0;\n\n for i in 0..N {\n result += (bits[i] as Field) * v;\n v = v * 2;\n }\n result\n }\n\n /// Convert a big endian bit array to a field element.\n /// If the provided bit array overflows the field modulus then the Field will silently wrap around.\n fn from_be_bits<let N: u32>(bits: [bool; N]) -> Field {\n let mut v = 1;\n let mut result = 0;\n\n for i in 0..N {\n result += (bits[N - 1 - i] as Field) * v;\n v = v * 2;\n }\n result\n }\n\n #[test]\n fn test_to_from_be_bits_bn254_edge_cases() {\n if crate::compat::is_bn254() {\n // checking that decrementing this bit produces the expected 254 BE bits for (modulus - 1)\n let mut p_minus_1_bits: [bool; 254] = modulus_be_bits().as_array();\n assert(p_minus_1_bits[254 - 1]);\n p_minus_1_bits[254 - 1] = false;\n\n let p_minus_1 = from_be_bits::<254>(p_minus_1_bits);\n assert_eq(p_minus_1 + 1, 0);\n\n // checking that converting (modulus - 1) from and then to 254 BE bits produces the same bits\n let p_minus_1_converted_bits: [bool; 254] = p_minus_1.to_be_bits();\n assert_eq(p_minus_1_converted_bits, p_minus_1_bits);\n\n // checking that incrementing this bit produces 254 BE bits for (modulus + 4)\n let mut p_plus_4_bits: [bool; 254] = modulus_be_bits().as_array();\n assert(!p_plus_4_bits[254 - 3]);\n p_plus_4_bits[254 - 3] = true;\n\n let p_plus_4 = from_be_bits::<254>(p_plus_4_bits);\n assert_eq(p_plus_4, 4);\n\n // checking that converting p_plus_4 to 254 BE bits produces the same\n // bit set to 1 as p_plus_4_bits and otherwise zeroes\n let mut p_plus_4_converted_bits: [bool; 254] = p_plus_4.to_be_bits();\n assert(p_plus_4_converted_bits[254 - 3]);\n p_plus_4_converted_bits[254 - 3] = false;\n assert_eq(p_plus_4_converted_bits, [false; 254]);\n\n // checking that Field::from_be_bits::<254> on the Field modulus produces 0\n assert_eq(modulus_be_bits().len(), 254);\n let p = from_be_bits::<254>(modulus_be_bits().as_array());\n assert_eq(p, 0);\n\n // checking that converting 0 to 254 BE bits produces 254 false values\n let p_bits: [bool; 254] = 0.to_be_bits();\n assert_eq(p_bits, [false; 254]);\n }\n }\n\n #[test]\n fn test_to_from_le_bits_bn254_edge_cases() {\n if crate::compat::is_bn254() {\n // checking that decrementing this bit produces the expected 254 LE bits for (modulus - 1)\n let mut p_minus_1_bits: [bool; 254] = modulus_le_bits().as_array();\n assert(p_minus_1_bits[0]);\n p_minus_1_bits[0] = false;\n\n let p_minus_1 = from_le_bits::<254>(p_minus_1_bits);\n assert_eq(p_minus_1 + 1, 0);\n\n // checking that converting (modulus - 1) from and then to 254 BE bits produces the same bits\n let p_minus_1_converted_bits: [bool; 254] = p_minus_1.to_le_bits();\n assert_eq(p_minus_1_converted_bits, p_minus_1_bits);\n\n // checking that incrementing this bit produces 254 LE bits for (modulus + 4)\n let mut p_plus_4_bits: [bool; 254] = modulus_le_bits().as_array();\n assert(!p_plus_4_bits[2]);\n p_plus_4_bits[2] = true;\n\n let p_plus_4 = from_le_bits::<254>(p_plus_4_bits);\n assert_eq(p_plus_4, 4);\n\n // checking that converting p_plus_4 to 254 LE bits produces the same\n // bit set to 1 as p_plus_4_bits and otherwise zeroes\n let mut p_plus_4_converted_bits: [bool; 254] = p_plus_4.to_le_bits();\n assert(p_plus_4_converted_bits[2]);\n p_plus_4_converted_bits[2] = false;\n assert_eq(p_plus_4_converted_bits, [false; 254]);\n\n // checking that Field::from_le_bits::<254> on the Field modulus produces 0\n assert_eq(modulus_le_bits().len(), 254);\n let p = from_le_bits::<254>(modulus_le_bits().as_array());\n assert_eq(p, 0);\n\n // checking that converting 0 to 254 LE bits produces 254 false values\n let p_bits: [bool; 254] = 0.to_le_bits();\n assert_eq(p_bits, [false; 254]);\n }\n }\n\n #[test(should_fail_with = \"call to assert_max_bit_size\")]\n fn max_bit_size_too_large() {\n let x: Field = 0x010000;\n x.assert_max_bit_size::<16>();\n }\n\n}\n"
730
742
  },
731
- "163": {
743
+ "164": {
732
744
  "function_locations": [
733
745
  {
734
746
  "name": "receive",
735
- "start": 2673
747
+ "start": 2699
736
748
  },
737
749
  {
738
750
  "name": "sync_inbox",
739
- "start": 3451
751
+ "start": 4202
740
752
  },
741
753
  {
742
754
  "name": "test::setup",
743
- "start": 5230
755
+ "start": 6051
744
756
  },
745
757
  {
746
758
  "name": "test::make_msg",
747
- "start": 5560
759
+ "start": 6381
748
760
  },
749
761
  {
750
762
  "name": "test::advance_by",
751
- "start": 5843
763
+ "start": 6664
752
764
  },
753
765
  {
754
766
  "name": "test::empty_inbox_returns_empty_result",
755
- "start": 6034
767
+ "start": 6855
756
768
  },
757
769
  {
758
770
  "name": "test::multiple_messages_mixed_expiration",
759
- "start": 6422
771
+ "start": 7243
772
+ },
773
+ {
774
+ "name": "test::accepts_messages_within_the_tolerated_future_skew",
775
+ "start": 9172
776
+ },
777
+ {
778
+ "name": "test::rejects_batch_with_implausible_future_anchor",
779
+ "start": 10197
760
780
  },
761
781
  {
762
782
  "name": "test::redelivery_is_idempotent",
763
- "start": 8404
783
+ "start": 10895
764
784
  },
765
785
  {
766
786
  "name": "test::redelivery_after_processing_keeps_processed_guard",
767
- "start": 9269
787
+ "start": 11760
768
788
  }
769
789
  ],
770
790
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/messages/processing/offchain/mod.nr",
771
- "source": "use crate::{\n context::UtilityContext,\n ephemeral::EphemeralArray,\n messages::{encoding::MESSAGE_CIPHERTEXT_LEN, processing::OffchainMessageWithTx},\n oracle::{contract_sync::set_contract_sync_cache_invalid, tx_resolution::get_resolved_txs},\n protocol::{address::AztecAddress, traits::{Deserialize, Serialize}},\n};\n\nmod reception;\nuse reception::OffchainReception;\n\n/// Maximum number of offchain messages accepted by `offchain_receive` in a single call.\npub global MAX_OFFCHAIN_MESSAGES_PER_RECEIVE_CALL: u32 = 16;\n\n/// A function that manages offchain-delivered messages for processing during sync.\n///\n/// Offchain messages are messages that are not broadcasted via onchain logs. They are instead delivered to the\n/// recipient by calling the `offchain_receive` utility function (injected by the `#[aztec]` macro). Message transport\n/// is the app's responsibility. Typical examples of transport methods are: messaging apps, email, QR codes, etc.\n///\n/// Once offchain messages are delivered to the recipient's private environment via `offchain_receive`, messages are\n/// locally stored in a persistent inbox.\n///\n/// This function determines when each message in said inbox is ready for processing, when it can be safely disposed\n/// of, etc.\n///\n/// The only current implementation of an [`OffchainInboxSync`] is [`sync_inbox`], which manages an inbox with\n/// expiration and finality-based eviction and automatic transaction context resolution.\npub type OffchainInboxSync = unconstrained fn(\n/* contract_address */AztecAddress, /* scope */ AztecAddress) -> EphemeralArray<OffchainMessageWithTx>;\n\n/// Delivers offchain messages to the given contract's offchain inbox for subsequent processing.\n///\n/// Offchain messages are transaction effects that are not broadcasted via onchain logs. Instead, the sender shares the\n/// message to the recipient through an external channel (e.g. a URL accessible by the recipient). The recipient then\n/// calls this function to hand the messages to the contract so they can be processed through the same mechanisms as\n/// onchain messages.\n///\n/// Messages are processed when their originating transaction is found onchain (providing the context needed to\n/// validate resulting notes and events).\n///\n/// Messages are eventually removed from the inbox: an unprocessed message once its TTL (`anchor_block_timestamp +\n/// MAX_MSG_TTL`) elapses, and a processed message once the block its transaction was found in finalizes.\n///\n/// Processing order is not guaranteed.\npub unconstrained fn receive(\n contract_address: AztecAddress,\n messages: BoundedVec<OffchainMessage, MAX_OFFCHAIN_MESSAGES_PER_RECEIVE_CALL>,\n) {\n // Offchain reception facts are scoped to the recipient. Note that because offchain messages have no integrity or\n // authenticity checks it is not possible to verify that this is indeed the intended recipient. In this case we're\n // assuming a cooperative environment, which is on par with other offchain delivery expectations.\n messages.for_each(|msg| OffchainReception::init(contract_address, msg));\n\n // Clear cache for message recipients so the next sync runs.\n set_contract_sync_cache_invalid(contract_address, messages.map(|msg| msg.recipient));\n}\n\n/// Returns offchain-delivered messages to process during sync.\npub unconstrained fn sync_inbox(\n contract_address: AztecAddress,\n scope: AztecAddress,\n) -> EphemeralArray<OffchainMessageWithTx> {\n let active_receptions = OffchainReception::load_all(contract_address, scope);\n\n // Ask PXE to resolve each message's originating tx. We pass the tx hashes in reception order, so the resolved txs\n // come back aligned with the reception indices and can be matched back positionally.\n let resolved_txs = get_resolved_txs(active_receptions.map(|reception: OffchainReception| {\n reception.read_message().tx_hash.unwrap_or(0)\n }));\n\n let processable_messages: EphemeralArray<OffchainMessageWithTx> = EphemeralArray::empty();\n let now = UtilityContext::new().timestamp();\n\n active_receptions.for_each(|i, reception| {\n let maybe_message = reception.step(resolved_txs.get(i), now);\n if maybe_message.is_some() {\n processable_messages.push(maybe_message.unwrap());\n }\n });\n\n processable_messages\n}\n\n/// A message delivered via the `offchain_receive` utility function.\n#[derive(Serialize, Deserialize)]\npub struct OffchainMessage {\n /// The encrypted message payload.\n pub ciphertext: BoundedVec<Field, MESSAGE_CIPHERTEXT_LEN>,\n /// The intended recipient of the message.\n pub recipient: AztecAddress,\n /// The hash of the transaction that produced this message. `Option::none` indicates a tx-less message.\n pub tx_hash: Option<Field>,\n /// Anchor block timestamp at message emission.\n pub anchor_block_timestamp: u64,\n}\n\nmod test {\n use crate::{\n oracle::random::random, protocol::address::AztecAddress, test::helpers::test_environment::TestEnvironment,\n };\n use super::{MAX_OFFCHAIN_MESSAGES_PER_RECEIVE_CALL, OffchainMessage, receive, sync_inbox};\n use super::reception::{MAX_MSG_TTL, OffchainReception};\n\n unconstrained fn setup() -> (TestEnvironment, AztecAddress) {\n let mut env = TestEnvironment::new();\n let scope = env.create_light_account();\n (env, scope)\n }\n\n /// Creates an `OffchainMessage` with dummy ciphertext and the given scope as recipient.\n fn make_msg(recipient: AztecAddress, tx_hash: Option<Field>, anchor_block_timestamp: u64) -> OffchainMessage {\n OffchainMessage { ciphertext: BoundedVec::new(), recipient, tx_hash, anchor_block_timestamp }\n }\n\n /// Advances the TXE block timestamp by `offset` seconds and returns the resulting timestamp.\n unconstrained fn advance_by(env: TestEnvironment, offset: u64) -> u64 {\n env.advance_next_block_timestamp_by(offset);\n env.mine_block();\n env.last_block_timestamp()\n }\n\n #[test]\n unconstrained fn empty_inbox_returns_empty_result() {\n let (env, scope) = setup();\n env.utility_context(|context| {\n let address = context.this_address();\n let result = sync_inbox(address, scope);\n\n assert_eq(result.len(), 0);\n assert_eq(OffchainReception::load_all(address, scope).len(), 0);\n });\n }\n\n #[test]\n unconstrained fn multiple_messages_mixed_expiration() {\n let (env, scope) = setup();\n let anchor_ts = advance_by(env, 10);\n\n let expired_a_tx_hash = random();\n let survivor_tx_hash = random();\n\n let expired_a = make_msg(scope, Option::some(expired_a_tx_hash), 0);\n let survivor = make_msg(scope, Option::some(survivor_tx_hash), anchor_ts);\n let expired_b = make_msg(scope, Option::none(), 0);\n\n env.utility_context(|context| {\n let address = context.this_address();\n let mut msgs: BoundedVec<OffchainMessage, MAX_OFFCHAIN_MESSAGES_PER_RECEIVE_CALL> = BoundedVec::new();\n // Message 0: tx-bound, anchor=0 so it expires quickly.\n msgs.push(expired_a);\n // Message 1: tx-bound, anchor_ts is recent so it survives.\n msgs.push(survivor);\n // Message 2: tx-less, anchor=0 so it also expires.\n msgs.push(expired_b);\n receive(address, msgs);\n });\n\n // Advance past MAX_MSG_TTL for anchor=0, but not for anchor_ts.\n let _now = advance_by(env, MAX_MSG_TTL);\n\n env.utility_context(|context| {\n let address = context.this_address();\n let result = sync_inbox(address, scope);\n\n assert_eq(result.len(), 0); // all contexts are None\n assert(\n !OffchainReception::is_active(address, scope, expired_a),\n \"expired tx-bound reception should be terminated\",\n );\n assert(\n !OffchainReception::is_active(address, scope, expired_b),\n \"expired tx-less reception should be terminated\",\n );\n assert(OffchainReception::is_active(address, scope, survivor), \"survivor reception should stay active\");\n assert_eq(OffchainReception::load_all(address, scope).len(), 1);\n });\n }\n\n // -- Idempotent re-delivery (first-write-wins fact recording) ---------\n\n #[test]\n unconstrained fn redelivery_is_idempotent() {\n let (env, scope) = setup();\n let anchor_ts = advance_by(env, 10);\n let msg = make_msg(scope, Option::some(random()), anchor_ts);\n\n // First delivery, committed as its own job.\n env.utility_context(|context| { receive(context.this_address(), BoundedVec::from_array([msg])); });\n\n // Re-delivering the same content-addressed message must not panic and must not create a second reception.\n env.utility_context(|context| {\n let address = context.this_address();\n receive(address, BoundedVec::from_array([msg]));\n\n assert(OffchainReception::is_active(address, scope, msg), \"reception should be active\");\n assert_eq(OffchainReception::load_all(address, scope).len(), 1);\n });\n }\n\n #[test]\n unconstrained fn redelivery_after_processing_keeps_processed_guard() {\n let (env, scope) = setup();\n let known_tx_hash: Field = 1;\n let anchor_ts = advance_by(env, 10);\n let msg = make_msg(scope, Option::some(known_tx_hash), anchor_ts);\n\n env.utility_context(|context| { receive(context.this_address(), BoundedVec::from_array([msg])); });\n\n let _now = advance_by(env, 100);\n\n // First sync resolves the message and marks it as processed.\n env.utility_context(|context| {\n let address = context.this_address();\n assert_eq(sync_inbox(address, scope).len(), 1);\n assert(OffchainReception::is_processed(address, scope, msg), \"should be processed\");\n });\n\n // Re-deliver the same message. The next sync recognizes it as already processed and does not re-push it.\n env.utility_context(|context| {\n let address = context.this_address();\n receive(address, BoundedVec::from_array([msg]));\n\n assert(\n OffchainReception::is_processed(address, scope, msg),\n \"re-delivery must preserve the processed guard\",\n );\n assert_eq(sync_inbox(address, scope).len(), 0);\n });\n }\n}\n"
791
+ "source": "use crate::{\n context::UtilityContext,\n ephemeral::EphemeralArray,\n messages::{encoding::MESSAGE_CIPHERTEXT_LEN, processing::OffchainMessageWithTx},\n oracle::{contract_sync::set_contract_sync_cache_invalid, tx_resolution::get_resolved_txs},\n protocol::{address::AztecAddress, traits::{Deserialize, Serialize}},\n};\n\nmod reception;\nuse reception::{MAX_ANCHOR_FUTURE_SKEW, OffchainReception};\n\n/// Maximum number of offchain messages accepted by `offchain_receive` in a single call.\npub global MAX_OFFCHAIN_MESSAGES_PER_RECEIVE_CALL: u32 = 16;\n\n/// A function that manages offchain-delivered messages for processing during sync.\n///\n/// Offchain messages are messages that are not broadcasted via onchain logs. They are instead delivered to the\n/// recipient by calling the `offchain_receive` utility function (injected by the `#[aztec]` macro). Message transport\n/// is the app's responsibility. Typical examples of transport methods are: messaging apps, email, QR codes, etc.\n///\n/// Once offchain messages are delivered to the recipient's private environment via `offchain_receive`, messages are\n/// locally stored in a persistent inbox.\n///\n/// This function determines when each message in said inbox is ready for processing, when it can be safely disposed\n/// of, etc.\n///\n/// The only current implementation of an [`OffchainInboxSync`] is [`sync_inbox`], which manages an inbox with\n/// expiration and finality-based eviction and automatic transaction context resolution.\npub type OffchainInboxSync = unconstrained fn(\n/* contract_address */AztecAddress, /* scope */ AztecAddress) -> EphemeralArray<OffchainMessageWithTx>;\n\n/// Delivers offchain messages to the given contract's offchain inbox for subsequent processing.\n///\n/// Offchain messages are transaction effects that are not broadcasted via onchain logs. Instead, the sender shares the\n/// message to the recipient through an external channel (e.g. a URL accessible by the recipient). The recipient then\n/// calls this function to hand the messages to the contract so they can be processed through the same mechanisms as\n/// onchain messages.\n///\n/// Messages are processed when their originating transaction is found onchain (providing the context needed to\n/// validate resulting notes and events).\n///\n/// Messages are eventually removed from the inbox: an unprocessed message once its TTL (`anchor_block_timestamp +\n/// MAX_MSG_TTL`) elapses, and a processed message once the block its transaction was found in finalizes.\n///\n/// Processing order is not guaranteed.\npub unconstrained fn receive(\n contract_address: AztecAddress,\n messages: BoundedVec<OffchainMessage, MAX_OFFCHAIN_MESSAGES_PER_RECEIVE_CALL>,\n) {\n // Offchain reception facts are scoped to the recipient. Note that because offchain messages have no integrity or\n // authenticity checks it is not possible to verify that this is indeed the intended recipient. In this case we're\n // assuming a cooperative environment, which is on par with other offchain delivery expectations.\n //\n // The sender-supplied anchor timestamp is the one field we bound: a message claiming to originate implausibly far\n // in our future (see MAX_ANCHOR_FUTURE_SKEW) cannot be genuine, and accepting it would let a malicious anchor evade\n // the TTL-based inbox eviction. We reject such a batch by panicking instead of silently dropping the message, so\n // the calling wallet can react to it (e.g. surface the error or distrust the sender).\n let now = UtilityContext::new().timestamp();\n messages.for_each(|msg| {\n assert(\n msg.anchor_block_timestamp <= now + MAX_ANCHOR_FUTURE_SKEW,\n \"offchain message anchor timestamp is implausibly far in the future\",\n );\n });\n\n messages.for_each(|msg| OffchainReception::init(contract_address, msg));\n\n // Clear cache for message recipients so the next sync runs.\n set_contract_sync_cache_invalid(contract_address, messages.map(|msg| msg.recipient));\n}\n\n/// Returns offchain-delivered messages to process during sync.\npub unconstrained fn sync_inbox(\n contract_address: AztecAddress,\n scope: AztecAddress,\n) -> EphemeralArray<OffchainMessageWithTx> {\n let active_receptions = OffchainReception::load_all(contract_address, scope);\n\n // Ask PXE to resolve each message's originating tx. We pass the tx hashes in reception order, so the resolved txs\n // come back aligned with the reception indices and can be matched back positionally.\n let resolved_txs = get_resolved_txs(active_receptions.map(|reception: OffchainReception| {\n reception.read_message().tx_hash.unwrap_or(0)\n }));\n\n let processable_messages: EphemeralArray<OffchainMessageWithTx> = EphemeralArray::empty();\n let now = UtilityContext::new().timestamp();\n\n active_receptions.for_each(|i, reception| {\n let maybe_message = reception.step(resolved_txs.get(i), now);\n if maybe_message.is_some() {\n processable_messages.push(maybe_message.unwrap());\n }\n });\n\n processable_messages\n}\n\n/// A message delivered via the `offchain_receive` utility function.\n#[derive(Serialize, Deserialize)]\npub struct OffchainMessage {\n /// The encrypted message payload.\n pub ciphertext: BoundedVec<Field, MESSAGE_CIPHERTEXT_LEN>,\n /// The intended recipient of the message.\n pub recipient: AztecAddress,\n /// The hash of the transaction that produced this message. `Option::none` indicates a tx-less message.\n pub tx_hash: Option<Field>,\n /// Anchor block timestamp at message emission.\n pub anchor_block_timestamp: u64,\n}\n\nmod test {\n use crate::{\n oracle::random::random,\n protocol::{address::AztecAddress, constants::MAX_TX_LIFETIME},\n test::helpers::test_environment::TestEnvironment,\n };\n use super::{MAX_OFFCHAIN_MESSAGES_PER_RECEIVE_CALL, OffchainMessage, receive, sync_inbox};\n use super::reception::{MAX_ANCHOR_FUTURE_SKEW, MAX_MSG_TTL, OffchainReception};\n\n unconstrained fn setup() -> (TestEnvironment, AztecAddress) {\n let mut env = TestEnvironment::new();\n let scope = env.create_light_account();\n (env, scope)\n }\n\n /// Creates an `OffchainMessage` with dummy ciphertext and the given scope as recipient.\n fn make_msg(recipient: AztecAddress, tx_hash: Option<Field>, anchor_block_timestamp: u64) -> OffchainMessage {\n OffchainMessage { ciphertext: BoundedVec::new(), recipient, tx_hash, anchor_block_timestamp }\n }\n\n /// Advances the TXE block timestamp by `offset` seconds and returns the resulting timestamp.\n unconstrained fn advance_by(env: TestEnvironment, offset: u64) -> u64 {\n env.advance_next_block_timestamp_by(offset);\n env.mine_block();\n env.last_block_timestamp()\n }\n\n #[test]\n unconstrained fn empty_inbox_returns_empty_result() {\n let (env, scope) = setup();\n env.utility_context(|context| {\n let address = context.this_address();\n let result = sync_inbox(address, scope);\n\n assert_eq(result.len(), 0);\n assert_eq(OffchainReception::load_all(address, scope).len(), 0);\n });\n }\n\n #[test]\n unconstrained fn multiple_messages_mixed_expiration() {\n let (env, scope) = setup();\n let anchor_ts = advance_by(env, 10);\n\n let expired_a_tx_hash = random();\n let survivor_tx_hash = random();\n\n let expired_a = make_msg(scope, Option::some(expired_a_tx_hash), 0);\n let survivor = make_msg(scope, Option::some(survivor_tx_hash), anchor_ts);\n let expired_b = make_msg(scope, Option::none(), 0);\n\n env.utility_context(|context| {\n let address = context.this_address();\n let mut msgs: BoundedVec<OffchainMessage, MAX_OFFCHAIN_MESSAGES_PER_RECEIVE_CALL> = BoundedVec::new();\n // Message 0: tx-bound, anchor=0 so it expires quickly.\n msgs.push(expired_a);\n // Message 1: tx-bound, anchor_ts is recent so it survives.\n msgs.push(survivor);\n // Message 2: tx-less, anchor=0 so it also expires.\n msgs.push(expired_b);\n receive(address, msgs);\n });\n\n // Advance past MAX_MSG_TTL for anchor=0, but not for anchor_ts.\n let _now = advance_by(env, MAX_MSG_TTL);\n\n env.utility_context(|context| {\n let address = context.this_address();\n let result = sync_inbox(address, scope);\n\n assert_eq(result.len(), 0); // all contexts are None\n assert(\n !OffchainReception::is_active(address, scope, expired_a),\n \"expired tx-bound reception should be terminated\",\n );\n assert(\n !OffchainReception::is_active(address, scope, expired_b),\n \"expired tx-less reception should be terminated\",\n );\n assert(OffchainReception::is_active(address, scope, survivor), \"survivor reception should stay active\");\n assert_eq(OffchainReception::load_all(address, scope).len(), 1);\n });\n }\n\n #[test]\n unconstrained fn accepts_messages_within_the_tolerated_future_skew() {\n let (env, scope) = setup();\n let now = advance_by(env, 10);\n\n // A present-dated anchor and a 24h-future one both fall within the tolerated skew. The latter models a genuine\n // message whose sender anchored ahead of our lagging PXE, and must still be accepted.\n let present = make_msg(scope, Option::some(random()), now);\n let lagged = make_msg(scope, Option::some(random()), now + MAX_TX_LIFETIME);\n\n env.utility_context(|context| {\n let address = context.this_address();\n receive(address, BoundedVec::from_array([present, lagged]));\n\n assert(OffchainReception::is_active(address, scope, present));\n assert(OffchainReception::is_active(address, scope, lagged));\n assert_eq(OffchainReception::load_all(address, scope).len(), 2);\n });\n }\n\n #[test(should_fail_with = \"offchain message anchor timestamp is implausibly far in the future\")]\n unconstrained fn rejects_batch_with_implausible_future_anchor() {\n let (env, scope) = setup();\n let now = advance_by(env, 10);\n\n // Beyond `now + MAX_ANCHOR_FUTURE_SKEW`: our view would trail the tip by more than a tx lifetime, so this\n // cannot be genuine. Reception panics so the wallet can react rather than accept it.\n let too_future = make_msg(\n scope,\n Option::some(random()),\n now + MAX_ANCHOR_FUTURE_SKEW + 7200,\n );\n\n env.utility_context(|context| { receive(context.this_address(), BoundedVec::from_array([too_future])); });\n }\n\n // -- Idempotent re-delivery (first-write-wins fact recording) ---------\n\n #[test]\n unconstrained fn redelivery_is_idempotent() {\n let (env, scope) = setup();\n let anchor_ts = advance_by(env, 10);\n let msg = make_msg(scope, Option::some(random()), anchor_ts);\n\n // First delivery, committed as its own job.\n env.utility_context(|context| { receive(context.this_address(), BoundedVec::from_array([msg])); });\n\n // Re-delivering the same content-addressed message must not panic and must not create a second reception.\n env.utility_context(|context| {\n let address = context.this_address();\n receive(address, BoundedVec::from_array([msg]));\n\n assert(OffchainReception::is_active(address, scope, msg), \"reception should be active\");\n assert_eq(OffchainReception::load_all(address, scope).len(), 1);\n });\n }\n\n #[test]\n unconstrained fn redelivery_after_processing_keeps_processed_guard() {\n let (env, scope) = setup();\n let known_tx_hash: Field = 1;\n let anchor_ts = advance_by(env, 10);\n let msg = make_msg(scope, Option::some(known_tx_hash), anchor_ts);\n\n env.utility_context(|context| { receive(context.this_address(), BoundedVec::from_array([msg])); });\n\n let _now = advance_by(env, 100);\n\n // First sync resolves the message and marks it as processed.\n env.utility_context(|context| {\n let address = context.this_address();\n assert_eq(sync_inbox(address, scope).len(), 1);\n assert(OffchainReception::is_processed(address, scope, msg), \"should be processed\");\n });\n\n // Re-deliver the same message. The next sync recognizes it as already processed and does not re-push it.\n env.utility_context(|context| {\n let address = context.this_address();\n receive(address, BoundedVec::from_array([msg]));\n\n assert(\n OffchainReception::is_processed(address, scope, msg),\n \"re-delivery must preserve the processed guard\",\n );\n assert_eq(sync_inbox(address, scope).len(), 0);\n });\n }\n}\n"
772
792
  },
773
- "164": {
793
+ "165": {
774
794
  "function_locations": [
775
795
  {
776
796
  "name": "OffchainReception::init",
777
- "start": 8657
797
+ "start": 9679
778
798
  },
779
799
  {
780
800
  "name": "OffchainReception::load_all",
781
- "start": 9175
801
+ "start": 10197
782
802
  },
783
803
  {
784
804
  "name": "OffchainReception::read_message",
785
- "start": 9524
805
+ "start": 10546
786
806
  },
787
807
  {
788
808
  "name": "OffchainReception::id_for",
789
- "start": 10225
809
+ "start": 11247
790
810
  },
791
811
  {
792
812
  "name": "OffchainReception::is_active",
793
- "start": 10544
813
+ "start": 11566
794
814
  },
795
815
  {
796
816
  "name": "OffchainReception::step",
797
- "start": 11199
817
+ "start": 12221
798
818
  },
799
819
  {
800
820
  "name": "OffchainReception::is_processed",
801
- "start": 12804
821
+ "start": 13826
802
822
  },
803
823
  {
804
824
  "name": "OffchainReception::mark_processed",
805
- "start": 13372
825
+ "start": 14394
806
826
  },
807
827
  {
808
828
  "name": "OffchainReception::terminate",
809
- "start": 13940
829
+ "start": 14962
810
830
  },
811
831
  {
812
832
  "name": "to_payload",
813
- "start": 14314
833
+ "start": 15336
814
834
  },
815
835
  {
816
836
  "name": "test::setup",
817
- "start": 14871
837
+ "start": 15893
818
838
  },
819
839
  {
820
840
  "name": "test::make_msg",
821
- "start": 15201
841
+ "start": 16223
822
842
  },
823
843
  {
824
844
  "name": "test::resolved_tx_at_block",
825
- "start": 15485
845
+ "start": 16507
826
846
  },
827
847
  {
828
848
  "name": "test::resolved_tx",
829
- "start": 15876
849
+ "start": 16898
830
850
  },
831
851
  {
832
852
  "name": "test::expired_reception_is_terminated",
833
- "start": 15993
853
+ "start": 17015
834
854
  },
835
855
  {
836
856
  "name": "test::unresolved_reception_stays_active",
837
- "start": 16675
857
+ "start": 17697
838
858
  },
839
859
  {
840
860
  "name": "test::resolved_reception_is_ready_to_process",
841
- "start": 17470
861
+ "start": 18492
842
862
  },
843
863
  {
844
864
  "name": "test::already_processed_reception_is_not_re_pushed",
845
- "start": 18516
865
+ "start": 19538
846
866
  },
847
867
  {
848
868
  "name": "test::processed_reception_terminates_once_its_origin_block_finalizes",
849
- "start": 19890
869
+ "start": 20912
850
870
  },
851
871
  {
852
872
  "name": "test::unfinalized_processed_reception_survives_past_the_ttl",
853
- "start": 21115
873
+ "start": 22137
854
874
  },
855
875
  {
856
876
  "name": "test::expired_reception_is_still_processed_when_its_tx_resolves",
857
- "start": 22505
877
+ "start": 23527
858
878
  }
859
879
  ],
860
880
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/messages/processing/offchain/reception.nr",
861
- "source": "//! The state machine of a single offchain message reception process.\n//!\n//! Offchain processing needs to handle some complexity, including the possibility of reorgs reverting message effects,\n//! and the need to reprocess messages in that case. The state chart below summarizes the current behavior.\n//!\n//! ```text\n//! offchain_receive() (process starts)\n//! |\n//! v\n//! +-----------+ tx found onchain +-----------+\n//! ---- | | --------------------------> | |\n//! tx not found | | | | | discover notes,\n//! |--> | RECEIVED | | PROCESSED | ~~> events, etc\n//! | | <-------------------------- | |\n//! | | tx block re-orged | |\n//! +-----------+ +-----------+\n//! | |\n//! | TTL expired | tx block finalized\n//! v v\n//! +---------------------------------------------------------+\n//! | TERMINATED (process ends) |\n//! +---------------------------------------------------------+\n//! ```\n//!\n//! ## States\n//!\n//! - **Received**: the message is stored but its originating transaction has not been found onchain yet (or the\n//! message is tx-less; see below). While the reception process is in this state, it keeps looking for the\n// transaction onchain.\n//! - **Processed**: the message has been handed off for processing. If there weren't reorgs, reaching this state would\n//! be equivalent to terminating the reception process. Since reorgs are a possibility, this state is not terminal\n//! until the block the originating transaction was found in finalizes.\n//! - **Terminated**: nothing else can be done with the message, either because its originating transaction never\n//! appeared within the TTL, or because the block it was processed in has finalized. This is the terminal state of\n//! this process.\n//!\n//! ## Transitions (each evaluated by [`OffchainReception::step`])\n//!\n//! - **Received -> Processed**: the originating transaction is found onchain. The message (packaged with its\n//! transaction context) is queued to have its actual contents processed (which can lead for example to the discovery\n//! of notes and events).\n//! - **Processed -> Received**: the block where the message transaction was originally found is re-orged out.\n//! - **Received -> Terminated**: the message TTL has elapsed (see below), so the originating transaction can no longer\n//! appear and the message is no longer processable.\n//! - **Processed -> Terminated**: the block the originating transaction was found in has finalized, so the effects of\n//! its processing are permanent and reorg-proof.\n//!\n//! # Message reception lifecycle and the TTL\n//!\n//! A reception expires once `now > anchor_block_timestamp + MAX_MSG_TTL`, where `MAX_MSG_TTL = MAX_TX_LIFETIME + 2h`.\n//! A transaction anchored at a given block can only be mined within\n//! [`MAX_TX_LIFETIME`](crate::protocol::constants::MAX_TX_LIFETIME) of that block, so once that\n//! window (plus a safety margin of 2 hours) has elapsed the originating transaction can no longer appear, and it is\n//! safe to stop looking for it.\n//!\n//! The TTL only matters for unprocessed messages. Already-processed message receptions complete when the block that\n//! included the originating transaction finalizes, which is exactly when the processing becomes reorg-proof.\n//!\n//! # Current limitations, future plans\n//!\n//! - Tx-less messages never reach `Processed` and are only ever removed by expiry. This will be supported in the\n//! future.\n//!\n//! # Implementation\n//!\n//! [`OffchainReception::init`] creates a [fact collection](crate::facts::FactCollection) of type\n//! `OFFCHAIN_RECEPTION_TYPE_ID`. The fact collection is identified by a hash of the `OffchainMessage` it tracks, which\n//! makes duplicate calls to `init` idempotent.\n//!\n//! Upon reception, an `OFFCHAIN_MESSAGE_RECEIVED` [non-retractable fact](crate::facts::record_non_retractable_fact) is\n//! recorded. The fact's payload is the `OffchainMessage` itself, which persists it to be subsequently processed.\n//! A fact collection with just an `OFFCHAIN_MESSAGE_RECEIVED` fact represents an active reception process in the\n//! RECEIVED state from our state chart above.\n//!\n//! The message reception state machine is driven externally, advancing one step at a time each time\n//! [`OffchainReception::step`] is invoked. [`OffchainReception::step`] implements the rest of the reception state\n//! machine described above.\n//!\n//! When stepping, if the transaction to the message is found onchain, an `OFFCHAIN_MESSAGE_PROCESSED`\n//! [retractable fact](crate::facts::record_retractable_fact) associated to the block where the transaction was found is\n//! recorded.\n//! Note that since this fact is retractable, a reorg dropping said block would result in the fact being automatically\n//! removed by PXE, effectively pushing the reception process back to `RECEIVED` state.\n//!\n//! To determine in which state of the reception process we are we just analyze the recorded facts:\n//!\n//! - If there is an `OFFCHAIN_MESSAGE_PROCESSED` fact we are in PROCESSED state. Once that fact's origin block has\n//! finalized the processing is reorg-proof, so the [fact collection](crate::facts::FactCollection) can (and should)\n//! be deleted; until then there is nothing to do.\n//! - If there is only an `OFFCHAIN_MESSAGE_RECEIVED` fact we are in RECEIVED state, so we check if the message\n//! transaction is now available onchain, and if so, exercise the RECEIVED->PROCESSED transition. Otherwise, once the\n//! TTL has elapsed the originating transaction can no longer appear and the collection can (and should) be deleted.\n//!\n//! The PROCESSED->RECEIVED transition is transparently handled by PXE: if a re-org caused the message transaction to\n//! fall off the chain, the `OFFCHAIN_MESSAGE_PROCESSED` fact disappears, taking us back to the RECEIVED state.\n\nuse crate::{\n ephemeral::EphemeralArray,\n facts::{\n delete_fact_collection, Fact, FactCollection, get_fact_collection, get_fact_collections_by_type, OriginBlock,\n record_non_retractable_fact, record_retractable_fact,\n },\n messages::processing::OffchainMessageWithTx,\n oracle::tx_resolution::ResolvedTx,\n protocol::{\n address::AztecAddress,\n constants::MAX_TX_LIFETIME,\n hash::{poseidon2_hash, sha256_to_field},\n traits::{Deserialize, Serialize},\n },\n};\nuse super::OffchainMessage;\n\n/// Maximum time-to-live for a tx-bound offchain message.\n///\n/// After `anchor_block_timestamp + MAX_MSG_TTL`, the message is evicted from the inbox.\n/// (7200 == 2 hours)\npub(crate) global MAX_MSG_TTL: u64 = MAX_TX_LIFETIME + 7200;\n\n/// Fact type id of the fact that stores the offchain message body inside a reception collection.\nglobal OFFCHAIN_MESSAGE_RECEIVED: Field = sha256_to_field(\"AZTEC_NR::OFFCHAIN_MESSAGE_RECEIVED\".as_bytes());\n\n/// Fact type id to mark an offchain message as processed.\n///\n/// A reception is in \"processed state\" exactly when its collection carries a fact of this type.\npub(crate) global OFFCHAIN_MESSAGE_PROCESSED: Field =\n sha256_to_field(\"AZTEC_NR::OFFCHAIN_MESSAGE_PROCESSED\".as_bytes());\n\n/// Fact-collection type id shared by every offchain message reception in the [fact store](crate::facts).\npub(crate) global OFFCHAIN_RECEPTION_TYPE_ID: Field =\n sha256_to_field(\"AZTEC_NR::OFFCHAIN_RECEPTION_TYPE_ID\".as_bytes());\n\n/// A single offchain message reception machine, backed by a [`FactCollection`](crate::facts::FactCollection).\n///\n/// Wraps the fact collection that tracks one message's progress through the reception state machine (see the\n/// [module documentation](super)); the [`OffchainMessage`] it carries is decoded on demand.\n#[derive(Deserialize, Serialize)]\npub(crate) struct OffchainReception {\n collection: FactCollection,\n}\n\nimpl OffchainReception {\n /// Initializes a new reception for a freshly received message, in the `Received` state.\n ///\n /// Re-initializing the same message is a no-op, which makes redelivery idempotent.\n pub(crate) unconstrained fn init(contract_address: AztecAddress, message: OffchainMessage) {\n record_non_retractable_fact(\n contract_address,\n message.recipient,\n OFFCHAIN_RECEPTION_TYPE_ID,\n Self::id_for(message),\n OFFCHAIN_MESSAGE_RECEIVED,\n to_payload(message),\n );\n }\n\n /// Loads every active reception for the given contract and scope, decoding each message body.\n pub(crate) unconstrained fn load_all(\n contract_address: AztecAddress,\n scope: AztecAddress,\n ) -> EphemeralArray<OffchainReception> {\n get_fact_collections_by_type(contract_address, scope, OFFCHAIN_RECEPTION_TYPE_ID)\n .map(|collection: FactCollection| OffchainReception { collection })\n }\n\n /// Reads and returns the message this reception carries, decoding it from its fact collection.\n pub(crate) unconstrained fn read_message(self) -> OffchainMessage {\n let message_fact = self.collection.facts.find(|f: Fact| f.fact_type_id == OFFCHAIN_MESSAGE_RECEIVED).unwrap();\n let n = <OffchainMessage as Deserialize>::N;\n let mut fields = [0; <OffchainMessage as Deserialize>::N];\n for i in 0..n {\n fields[i] = message_fact.payload.get(i);\n }\n Deserialize::deserialize(fields)\n }\n\n /// Computes the fact-collection id that identifies a message's reception machine in the [fact store](crate::facts).\n ///\n /// The id is a hash of the message, which makes duplicate receptions of the same message collapse onto a single\n /// reception.\n pub(crate) fn id_for(message: OffchainMessage) -> Field {\n poseidon2_hash(message.serialize())\n }\n\n /// Returns `true` if a reception for `message` is currently active for the given contract and scope.\n pub(crate) unconstrained fn is_active(\n contract_address: AztecAddress,\n scope: AztecAddress,\n message: OffchainMessage,\n ) -> bool {\n get_fact_collection(\n contract_address,\n scope,\n OFFCHAIN_RECEPTION_TYPE_ID,\n Self::id_for(message),\n )\n .is_some()\n }\n\n /// Advances this reception by one step of its state machine. See the [module documentation](super) for the\n /// states, transitions, and expiry rules.\n ///\n /// Returns `Some` with the message and its resolved context when this step determines the message is ready to be\n /// processed.\n pub(crate) unconstrained fn step(\n self,\n maybe_resolved_tx: Option<ResolvedTx>,\n now: u64,\n ) -> Option<OffchainMessageWithTx> {\n let message = self.read_message();\n let processed_fact = self.collection.facts.find(|f: Fact| f.fact_type_id == OFFCHAIN_MESSAGE_PROCESSED);\n\n if processed_fact.is_none() & maybe_resolved_tx.is_some() {\n // Received -> Processed: the originating tx is onchain.\n let resolved = maybe_resolved_tx.unwrap();\n self.mark_processed(resolved.block_number, resolved.block_hash);\n Option::some(\n OffchainMessageWithTx { message_ciphertext: message.ciphertext, resolved_tx: resolved },\n )\n } else if processed_fact.is_some() {\n if processed_fact.unwrap().origin_block.unwrap().block_state.is_finalized() {\n // Processed -> Terminated: once the marker's origin block finalizes, the processing is reorg-proof and\n // the reception is complete. Until then we wait: a reorg dropping that block removes the retractable\n // marker and PXE pushes us back to Received.\n self.terminate();\n }\n Option::none()\n } else {\n // Received -> Terminated: the TTL caps how long we keep looking for the originating tx.\n if now > message.anchor_block_timestamp + MAX_MSG_TTL {\n self.terminate();\n }\n Option::none()\n }\n }\n\n /// Returns `true` if the reception for `message` has been marked processed.\n pub(crate) unconstrained fn is_processed(\n contract_address: AztecAddress,\n scope: AztecAddress,\n message: OffchainMessage,\n ) -> bool {\n let maybe_collection = get_fact_collection(\n contract_address,\n scope,\n OFFCHAIN_RECEPTION_TYPE_ID,\n Self::id_for(message),\n );\n if maybe_collection.is_some() {\n maybe_collection.unwrap().facts.any(|f: Fact| f.fact_type_id == OFFCHAIN_MESSAGE_PROCESSED)\n } else {\n false\n }\n }\n\n /// Records the retractable processed marker for this reception, originated at the resolved block.\n unconstrained fn mark_processed(self, block_number: u32, block_hash: Field) {\n let empty_payload: EphemeralArray<Field> = EphemeralArray::empty();\n record_retractable_fact(\n self.collection.contract_address,\n self.collection.scope,\n self.collection.fact_collection_type_id,\n self.collection.fact_collection_id,\n OFFCHAIN_MESSAGE_PROCESSED,\n empty_payload,\n OriginBlock { block_number, block_hash },\n );\n }\n\n /// Terminates this reception by deleting its [fact collection](crate::facts::FactCollection).\n unconstrained fn terminate(self) {\n delete_fact_collection(\n self.collection.contract_address,\n self.collection.scope,\n self.collection.fact_collection_type_id,\n self.collection.fact_collection_id,\n );\n }\n}\n\n/// Serializes an [`OffchainMessage`] into a fact payload.\nunconstrained fn to_payload(message: OffchainMessage) -> EphemeralArray<Field> {\n let fields = message.serialize();\n let payload: EphemeralArray<Field> = EphemeralArray::empty();\n for i in 0..fields.len() {\n payload.push(fields[i]);\n }\n payload\n}\n\nmod test {\n use crate::{\n messages::processing::offchain::OffchainMessage,\n oracle::{random::random, tx_resolution::ResolvedTx},\n protocol::address::AztecAddress,\n test::helpers::test_environment::TestEnvironment,\n };\n use super::{MAX_MSG_TTL, OffchainReception};\n\n unconstrained fn setup() -> (TestEnvironment, AztecAddress) {\n let mut env = TestEnvironment::new();\n let scope = env.create_light_account();\n (env, scope)\n }\n\n /// Creates an `OffchainMessage` with dummy ciphertext and the given scope as recipient.\n fn make_msg(recipient: AztecAddress, tx_hash: Option<Field>, anchor_block_timestamp: u64) -> OffchainMessage {\n OffchainMessage { ciphertext: BoundedVec::new(), recipient, tx_hash, anchor_block_timestamp }\n }\n\n /// Builds the resolved-tx context PXE would return for `tx_hash`, found in `block_number`.\n fn resolved_tx_at_block(tx_hash: Field, block_number: u32) -> ResolvedTx {\n ResolvedTx {\n tx_hash,\n unique_note_hashes_in_tx: BoundedVec::new(),\n first_nullifier_in_tx: 0,\n block_number,\n block_hash: 0,\n }\n }\n\n /// Builds a resolved-tx context found in a low block, which TXE (proven == finalized == latest) reports as\n /// `Finalized`.\n fn resolved_tx(tx_hash: Field) -> ResolvedTx {\n resolved_tx_at_block(tx_hash, 1)\n }\n\n #[test]\n unconstrained fn expired_reception_is_terminated() {\n let (env, scope) = setup();\n let msg = make_msg(scope, Option::some(random()), 0);\n\n env.utility_context(|context| {\n let address = context.this_address();\n OffchainReception::init(address, msg);\n let reception = OffchainReception::load_all(address, scope).get(0);\n\n // Past the TTL with no resolved tx: the reception is terminated.\n assert(reception.step(Option::none(), MAX_MSG_TTL + 1).is_none());\n assert(!OffchainReception::is_active(address, scope, msg), \"expired reception should be terminated\");\n });\n }\n\n #[test]\n unconstrained fn unresolved_reception_stays_active() {\n let (env, scope) = setup();\n let msg = make_msg(scope, Option::some(random()), 0);\n\n env.utility_context(|context| {\n let address = context.this_address();\n OffchainReception::init(address, msg);\n let reception = OffchainReception::load_all(address, scope).get(0);\n\n // Within the TTL with no resolved tx: nothing to process, the reception stays.\n assert(reception.step(Option::none(), 100).is_none());\n assert(OffchainReception::is_active(address, scope, msg), \"unresolved reception should stay active\");\n assert(!OffchainReception::is_processed(address, scope, msg), \"should still be unprocessed\");\n });\n }\n\n #[test]\n unconstrained fn resolved_reception_is_ready_to_process() {\n let (env, scope) = setup();\n let tx_hash = random();\n let msg = make_msg(scope, Option::some(tx_hash), 0);\n\n env.utility_context(|context| {\n let address = context.this_address();\n OffchainReception::init(address, msg);\n let reception = OffchainReception::load_all(address, scope).get(0);\n\n // A resolved tx within the TTL: the message is handed off with its tx context attached.\n let processable = reception.step(Option::some(resolved_tx(tx_hash)), 100);\n assert(processable.is_some());\n assert_eq(processable.unwrap().resolved_tx.tx_hash, tx_hash);\n\n // It stays active for reorg safety and is now marked processed.\n assert(OffchainReception::is_active(address, scope, msg), \"processed reception should stay active\");\n assert(OffchainReception::is_processed(address, scope, msg), \"should be processed\");\n });\n }\n\n #[test]\n unconstrained fn already_processed_reception_is_not_re_pushed() {\n let (env, scope) = setup();\n let tx_hash = random();\n let msg = make_msg(scope, Option::some(tx_hash), 0);\n // A future origin block stays unfinalized, so the reception lingers in Processed across steps.\n let future_block = env.last_block_number() + 100;\n\n env.utility_context(|context| {\n let address = context.this_address();\n OffchainReception::init(address, msg);\n\n // First step processes the message.\n let reception = OffchainReception::load_all(address, scope).get(0);\n assert(reception.step(Option::some(resolved_tx_at_block(tx_hash, future_block)), 100).is_some());\n assert(OffchainReception::is_processed(address, scope, msg), \"should be processed\");\n\n // Second step (still resolved, not finalized) recognizes it as processed and does not re-push it.\n let reloaded = OffchainReception::load_all(address, scope).get(0);\n assert(\n reloaded.step(Option::some(resolved_tx_at_block(tx_hash, future_block)), 100).is_none(),\n \"already processed\",\n );\n assert(OffchainReception::is_active(address, scope, msg), \"processed reception should still be active\");\n });\n }\n\n #[test]\n unconstrained fn processed_reception_terminates_once_its_origin_block_finalizes() {\n let (env, scope) = setup();\n let tx_hash = random();\n let msg = make_msg(scope, Option::some(tx_hash), 0);\n\n env.utility_context(|context| {\n let address = context.this_address();\n OffchainReception::init(address, msg);\n\n // Process the message against a finalized block.\n let reception = OffchainReception::load_all(address, scope).get(0);\n assert(reception.step(Option::some(resolved_tx(tx_hash)), 100).is_some());\n assert(OffchainReception::is_processed(address, scope, msg), \"should be processed\");\n\n // Next step, still well within the TTL: a finalized origin block makes the processing reorg-proof, so the\n // reception terminates regardless of the TTL.\n let reloaded = OffchainReception::load_all(address, scope).get(0);\n assert(reloaded.step(Option::some(resolved_tx(tx_hash)), 100).is_none());\n assert(\n !OffchainReception::is_active(address, scope, msg),\n \"finalized processed reception should be terminated\",\n );\n });\n }\n\n #[test]\n unconstrained fn unfinalized_processed_reception_survives_past_the_ttl() {\n let (env, scope) = setup();\n let tx_hash = random();\n let msg = make_msg(scope, Option::some(tx_hash), 0);\n // A future origin block never finalizes here, so the reception must not be terminated by the TTL.\n let future_block = env.last_block_number() + 100;\n\n env.utility_context(|context| {\n let address = context.this_address();\n OffchainReception::init(address, msg);\n\n let reception = OffchainReception::load_all(address, scope).get(0);\n assert(reception.step(Option::some(resolved_tx_at_block(tx_hash, future_block)), 100).is_some());\n assert(OffchainReception::is_processed(address, scope, msg), \"should be processed\");\n\n // Past the TTL, but the origin block has not finalized: the reception stays active. The TTL no longer\n // governs an already-processed reception.\n let reloaded = OffchainReception::load_all(address, scope).get(0);\n assert(reloaded.step(Option::some(resolved_tx_at_block(tx_hash, future_block)), MAX_MSG_TTL + 1).is_none());\n assert(\n OffchainReception::is_active(address, scope, msg),\n \"unfinalized processed reception should survive past the TTL\",\n );\n });\n }\n\n #[test]\n unconstrained fn expired_reception_is_still_processed_when_its_tx_resolves() {\n let (env, scope) = setup();\n let tx_hash = random();\n let msg = make_msg(scope, Option::some(tx_hash), 0);\n\n env.utility_context(|context| {\n let address = context.this_address();\n OffchainReception::init(address, msg);\n\n // Even past the TTL, a freshly resolved tx is still handed off: expiry only caps the search for the\n // originating tx, it does not pre-empt processing once that tx is found.\n let reception = OffchainReception::load_all(address, scope).get(0);\n assert(reception.step(Option::some(resolved_tx(tx_hash)), MAX_MSG_TTL + 1).is_some());\n assert(OffchainReception::is_processed(address, scope, msg), \"should be processed\");\n assert(OffchainReception::is_active(address, scope, msg), \"just-processed reception should stay active\");\n });\n }\n}\n"
881
+ "source": "//! The state machine of a single offchain message reception process.\n//!\n//! Offchain processing needs to handle some complexity, including the possibility of reorgs reverting message effects,\n//! and the need to reprocess messages in that case. The state chart below summarizes the current behavior.\n//!\n//! ```text\n//! offchain_receive() (process starts)\n//! |\n//! v\n//! +-----------+ tx found onchain +-----------+\n//! ---- | | --------------------------> | |\n//! tx not found | | | | | discover notes,\n//! |--> | RECEIVED | | PROCESSED | ~~> events, etc\n//! | | <-------------------------- | |\n//! | | tx block re-orged | |\n//! +-----------+ +-----------+\n//! | |\n//! | TTL expired | tx block finalized\n//! v v\n//! +---------------------------------------------------------+\n//! | TERMINATED (process ends) |\n//! +---------------------------------------------------------+\n//! ```\n//!\n//! ## States\n//!\n//! - **Received**: the message is stored but its originating transaction has not been found onchain yet (or the\n//! message is tx-less; see below). While the reception process is in this state, it keeps looking for the\n// transaction onchain.\n//! - **Processed**: the message has been handed off for processing. If there weren't reorgs, reaching this state would\n//! be equivalent to terminating the reception process. Since reorgs are a possibility, this state is not terminal\n//! until the block the originating transaction was found in finalizes.\n//! - **Terminated**: nothing else can be done with the message, either because its originating transaction never\n//! appeared within the TTL, or because the block it was processed in has finalized. This is the terminal state of\n//! this process.\n//!\n//! ## Transitions (each evaluated by [`OffchainReception::step`])\n//!\n//! - **Received -> Processed**: the originating transaction is found onchain. The message (packaged with its\n//! transaction context) is queued to have its actual contents processed (which can lead for example to the discovery\n//! of notes and events).\n//! - **Processed -> Received**: the block where the message transaction was originally found is re-orged out.\n//! - **Received -> Terminated**: the message TTL has elapsed (see below), so the originating transaction can no longer\n//! appear and the message is no longer processable.\n//! - **Processed -> Terminated**: the block the originating transaction was found in has finalized, so the effects of\n//! its processing are permanent and reorg-proof.\n//!\n//! # Message reception lifecycle and the TTL\n//!\n//! A reception expires once `now > anchor_block_timestamp + MAX_MSG_TTL`, where `MAX_MSG_TTL = MAX_TX_LIFETIME + 2h`.\n//! A transaction anchored at a given block can only be mined within\n//! [`MAX_TX_LIFETIME`](crate::protocol::constants::MAX_TX_LIFETIME) of that block, so once that\n//! window (plus a safety margin of 2 hours) has elapsed the originating transaction can no longer appear, and it is\n//! safe to stop looking for it.\n//!\n//! The TTL only matters for unprocessed messages. Already-processed message receptions complete when the block that\n//! included the originating transaction finalizes, which is exactly when the processing becomes reorg-proof.\n//!\n//! # Current limitations, future plans\n//!\n//! - Tx-less messages never reach `Processed` and are only ever removed by expiry. This will be supported in the\n//! future.\n//!\n//! # Implementation\n//!\n//! [`OffchainReception::init`] creates a [fact collection](crate::facts::FactCollection) of type\n//! `OFFCHAIN_RECEPTION_TYPE_ID`. The fact collection is identified by a hash of the `OffchainMessage` it tracks, which\n//! makes duplicate calls to `init` idempotent.\n//!\n//! Upon reception, an `OFFCHAIN_MESSAGE_RECEIVED` [non-retractable fact](crate::facts::record_non_retractable_fact) is\n//! recorded. The fact's payload is the `OffchainMessage` itself, which persists it to be subsequently processed.\n//! A fact collection with just an `OFFCHAIN_MESSAGE_RECEIVED` fact represents an active reception process in the\n//! RECEIVED state from our state chart above.\n//!\n//! The message reception state machine is driven externally, advancing one step at a time each time\n//! [`OffchainReception::step`] is invoked. [`OffchainReception::step`] implements the rest of the reception state\n//! machine described above.\n//!\n//! When stepping, if the transaction to the message is found onchain, an `OFFCHAIN_MESSAGE_PROCESSED`\n//! [retractable fact](crate::facts::record_retractable_fact) associated to the block where the transaction was found is\n//! recorded.\n//! Note that since this fact is retractable, a reorg dropping said block would result in the fact being automatically\n//! removed by PXE, effectively pushing the reception process back to `RECEIVED` state.\n//!\n//! To determine in which state of the reception process we are we just analyze the recorded facts:\n//!\n//! - If there is an `OFFCHAIN_MESSAGE_PROCESSED` fact we are in PROCESSED state. Once that fact's origin block has\n//! finalized the processing is reorg-proof, so the [fact collection](crate::facts::FactCollection) can (and should)\n//! be deleted; until then there is nothing to do.\n//! - If there is only an `OFFCHAIN_MESSAGE_RECEIVED` fact we are in RECEIVED state, so we check if the message\n//! transaction is now available onchain, and if so, exercise the RECEIVED->PROCESSED transition. Otherwise, once the\n//! TTL has elapsed the originating transaction can no longer appear and the collection can (and should) be deleted.\n//!\n//! The PROCESSED->RECEIVED transition is transparently handled by PXE: if a re-org caused the message transaction to\n//! fall off the chain, the `OFFCHAIN_MESSAGE_PROCESSED` fact disappears, taking us back to the RECEIVED state.\n\nuse crate::{\n ephemeral::EphemeralArray,\n facts::{\n delete_fact_collection, Fact, FactCollection, get_fact_collection, get_fact_collections_by_type, OriginBlock,\n record_non_retractable_fact, record_retractable_fact,\n },\n messages::processing::OffchainMessageWithTx,\n oracle::tx_resolution::ResolvedTx,\n protocol::{\n address::AztecAddress,\n constants::MAX_TX_LIFETIME,\n hash::{poseidon2_hash, sha256_to_field},\n traits::{Deserialize, Serialize},\n },\n};\nuse super::OffchainMessage;\n\n/// Maximum time-to-live for a tx-bound offchain message.\n///\n/// After `anchor_block_timestamp + MAX_MSG_TTL`, the message is evicted from the inbox.\n/// (7200 == 2 hours)\npub(crate) global MAX_MSG_TTL: u64 = MAX_TX_LIFETIME + 7200;\n\n/// Maximum amount by which a received message's `anchor_block_timestamp` may exceed our current timestamp.\n///\n/// A message's anchor is the timestamp of the block the sender anchored its originating tx to, so for a genuine\n/// message it is at or before our own anchor timestamp. Our PXE may lag the chain tip though, which can make a\n/// legitimate anchor appear to be in our future, so we tolerate a forward skew of `MAX_TX_LIFETIME` (the longest a tx\n/// can wait to be mined after its anchor) plus a 2h margin. A larger skew would mean our view trails the tip by more\n/// than a tx lifetime -- so far behind that we could not even build a tx that wouldn't be immediately expired -- so\n/// such a message cannot be genuine and is rejected on reception. Bounding the anchor this way also keeps accepted\n/// values near the present, which prevents the `anchor_block_timestamp + MAX_MSG_TTL` eviction check from overflowing.\n/// (7200 == 2 hours)\npub(crate) global MAX_ANCHOR_FUTURE_SKEW: u64 = MAX_TX_LIFETIME + 7200;\n\n/// Fact type id of the fact that stores the offchain message body inside a reception collection.\nglobal OFFCHAIN_MESSAGE_RECEIVED: Field = sha256_to_field(\"AZTEC_NR::OFFCHAIN_MESSAGE_RECEIVED\".as_bytes());\n\n/// Fact type id to mark an offchain message as processed.\n///\n/// A reception is in \"processed state\" exactly when its collection carries a fact of this type.\npub(crate) global OFFCHAIN_MESSAGE_PROCESSED: Field =\n sha256_to_field(\"AZTEC_NR::OFFCHAIN_MESSAGE_PROCESSED\".as_bytes());\n\n/// Fact-collection type id shared by every offchain message reception in the [fact store](crate::facts).\npub(crate) global OFFCHAIN_RECEPTION_TYPE_ID: Field =\n sha256_to_field(\"AZTEC_NR::OFFCHAIN_RECEPTION_TYPE_ID\".as_bytes());\n\n/// A single offchain message reception machine, backed by a [`FactCollection`](crate::facts::FactCollection).\n///\n/// Wraps the fact collection that tracks one message's progress through the reception state machine (see the\n/// [module documentation](super)); the [`OffchainMessage`] it carries is decoded on demand.\n#[derive(Deserialize, Serialize)]\npub(crate) struct OffchainReception {\n collection: FactCollection,\n}\n\nimpl OffchainReception {\n /// Initializes a new reception for a freshly received message, in the `Received` state.\n ///\n /// Re-initializing the same message is a no-op, which makes redelivery idempotent.\n pub(crate) unconstrained fn init(contract_address: AztecAddress, message: OffchainMessage) {\n record_non_retractable_fact(\n contract_address,\n message.recipient,\n OFFCHAIN_RECEPTION_TYPE_ID,\n Self::id_for(message),\n OFFCHAIN_MESSAGE_RECEIVED,\n to_payload(message),\n );\n }\n\n /// Loads every active reception for the given contract and scope, decoding each message body.\n pub(crate) unconstrained fn load_all(\n contract_address: AztecAddress,\n scope: AztecAddress,\n ) -> EphemeralArray<OffchainReception> {\n get_fact_collections_by_type(contract_address, scope, OFFCHAIN_RECEPTION_TYPE_ID)\n .map(|collection: FactCollection| OffchainReception { collection })\n }\n\n /// Reads and returns the message this reception carries, decoding it from its fact collection.\n pub(crate) unconstrained fn read_message(self) -> OffchainMessage {\n let message_fact = self.collection.facts.find(|f: Fact| f.fact_type_id == OFFCHAIN_MESSAGE_RECEIVED).unwrap();\n let n = <OffchainMessage as Deserialize>::N;\n let mut fields = [0; <OffchainMessage as Deserialize>::N];\n for i in 0..n {\n fields[i] = message_fact.payload.get(i);\n }\n Deserialize::deserialize(fields)\n }\n\n /// Computes the fact-collection id that identifies a message's reception machine in the [fact store](crate::facts).\n ///\n /// The id is a hash of the message, which makes duplicate receptions of the same message collapse onto a single\n /// reception.\n pub(crate) fn id_for(message: OffchainMessage) -> Field {\n poseidon2_hash(message.serialize())\n }\n\n /// Returns `true` if a reception for `message` is currently active for the given contract and scope.\n pub(crate) unconstrained fn is_active(\n contract_address: AztecAddress,\n scope: AztecAddress,\n message: OffchainMessage,\n ) -> bool {\n get_fact_collection(\n contract_address,\n scope,\n OFFCHAIN_RECEPTION_TYPE_ID,\n Self::id_for(message),\n )\n .is_some()\n }\n\n /// Advances this reception by one step of its state machine. See the [module documentation](super) for the\n /// states, transitions, and expiry rules.\n ///\n /// Returns `Some` with the message and its resolved context when this step determines the message is ready to be\n /// processed.\n pub(crate) unconstrained fn step(\n self,\n maybe_resolved_tx: Option<ResolvedTx>,\n now: u64,\n ) -> Option<OffchainMessageWithTx> {\n let message = self.read_message();\n let processed_fact = self.collection.facts.find(|f: Fact| f.fact_type_id == OFFCHAIN_MESSAGE_PROCESSED);\n\n if processed_fact.is_none() & maybe_resolved_tx.is_some() {\n // Received -> Processed: the originating tx is onchain.\n let resolved = maybe_resolved_tx.unwrap();\n self.mark_processed(resolved.block_number, resolved.block_hash);\n Option::some(\n OffchainMessageWithTx { message_ciphertext: message.ciphertext, resolved_tx: resolved },\n )\n } else if processed_fact.is_some() {\n if processed_fact.unwrap().origin_block.unwrap().block_state.is_finalized() {\n // Processed -> Terminated: once the marker's origin block finalizes, the processing is reorg-proof and\n // the reception is complete. Until then we wait: a reorg dropping that block removes the retractable\n // marker and PXE pushes us back to Received.\n self.terminate();\n }\n Option::none()\n } else {\n // Received -> Terminated: the TTL caps how long we keep looking for the originating tx.\n if now > message.anchor_block_timestamp + MAX_MSG_TTL {\n self.terminate();\n }\n Option::none()\n }\n }\n\n /// Returns `true` if the reception for `message` has been marked processed.\n pub(crate) unconstrained fn is_processed(\n contract_address: AztecAddress,\n scope: AztecAddress,\n message: OffchainMessage,\n ) -> bool {\n let maybe_collection = get_fact_collection(\n contract_address,\n scope,\n OFFCHAIN_RECEPTION_TYPE_ID,\n Self::id_for(message),\n );\n if maybe_collection.is_some() {\n maybe_collection.unwrap().facts.any(|f: Fact| f.fact_type_id == OFFCHAIN_MESSAGE_PROCESSED)\n } else {\n false\n }\n }\n\n /// Records the retractable processed marker for this reception, originated at the resolved block.\n unconstrained fn mark_processed(self, block_number: u32, block_hash: Field) {\n let empty_payload: EphemeralArray<Field> = EphemeralArray::empty();\n record_retractable_fact(\n self.collection.contract_address,\n self.collection.scope,\n self.collection.fact_collection_type_id,\n self.collection.fact_collection_id,\n OFFCHAIN_MESSAGE_PROCESSED,\n empty_payload,\n OriginBlock { block_number, block_hash },\n );\n }\n\n /// Terminates this reception by deleting its [fact collection](crate::facts::FactCollection).\n unconstrained fn terminate(self) {\n delete_fact_collection(\n self.collection.contract_address,\n self.collection.scope,\n self.collection.fact_collection_type_id,\n self.collection.fact_collection_id,\n );\n }\n}\n\n/// Serializes an [`OffchainMessage`] into a fact payload.\nunconstrained fn to_payload(message: OffchainMessage) -> EphemeralArray<Field> {\n let fields = message.serialize();\n let payload: EphemeralArray<Field> = EphemeralArray::empty();\n for i in 0..fields.len() {\n payload.push(fields[i]);\n }\n payload\n}\n\nmod test {\n use crate::{\n messages::processing::offchain::OffchainMessage,\n oracle::{random::random, tx_resolution::ResolvedTx},\n protocol::address::AztecAddress,\n test::helpers::test_environment::TestEnvironment,\n };\n use super::{MAX_MSG_TTL, OffchainReception};\n\n unconstrained fn setup() -> (TestEnvironment, AztecAddress) {\n let mut env = TestEnvironment::new();\n let scope = env.create_light_account();\n (env, scope)\n }\n\n /// Creates an `OffchainMessage` with dummy ciphertext and the given scope as recipient.\n fn make_msg(recipient: AztecAddress, tx_hash: Option<Field>, anchor_block_timestamp: u64) -> OffchainMessage {\n OffchainMessage { ciphertext: BoundedVec::new(), recipient, tx_hash, anchor_block_timestamp }\n }\n\n /// Builds the resolved-tx context PXE would return for `tx_hash`, found in `block_number`.\n fn resolved_tx_at_block(tx_hash: Field, block_number: u32) -> ResolvedTx {\n ResolvedTx {\n tx_hash,\n unique_note_hashes_in_tx: BoundedVec::new(),\n first_nullifier_in_tx: 0,\n block_number,\n block_hash: 0,\n }\n }\n\n /// Builds a resolved-tx context found in a low block, which TXE (proven == finalized == latest) reports as\n /// `Finalized`.\n fn resolved_tx(tx_hash: Field) -> ResolvedTx {\n resolved_tx_at_block(tx_hash, 1)\n }\n\n #[test]\n unconstrained fn expired_reception_is_terminated() {\n let (env, scope) = setup();\n let msg = make_msg(scope, Option::some(random()), 0);\n\n env.utility_context(|context| {\n let address = context.this_address();\n OffchainReception::init(address, msg);\n let reception = OffchainReception::load_all(address, scope).get(0);\n\n // Past the TTL with no resolved tx: the reception is terminated.\n assert(reception.step(Option::none(), MAX_MSG_TTL + 1).is_none());\n assert(!OffchainReception::is_active(address, scope, msg), \"expired reception should be terminated\");\n });\n }\n\n #[test]\n unconstrained fn unresolved_reception_stays_active() {\n let (env, scope) = setup();\n let msg = make_msg(scope, Option::some(random()), 0);\n\n env.utility_context(|context| {\n let address = context.this_address();\n OffchainReception::init(address, msg);\n let reception = OffchainReception::load_all(address, scope).get(0);\n\n // Within the TTL with no resolved tx: nothing to process, the reception stays.\n assert(reception.step(Option::none(), 100).is_none());\n assert(OffchainReception::is_active(address, scope, msg), \"unresolved reception should stay active\");\n assert(!OffchainReception::is_processed(address, scope, msg), \"should still be unprocessed\");\n });\n }\n\n #[test]\n unconstrained fn resolved_reception_is_ready_to_process() {\n let (env, scope) = setup();\n let tx_hash = random();\n let msg = make_msg(scope, Option::some(tx_hash), 0);\n\n env.utility_context(|context| {\n let address = context.this_address();\n OffchainReception::init(address, msg);\n let reception = OffchainReception::load_all(address, scope).get(0);\n\n // A resolved tx within the TTL: the message is handed off with its tx context attached.\n let processable = reception.step(Option::some(resolved_tx(tx_hash)), 100);\n assert(processable.is_some());\n assert_eq(processable.unwrap().resolved_tx.tx_hash, tx_hash);\n\n // It stays active for reorg safety and is now marked processed.\n assert(OffchainReception::is_active(address, scope, msg), \"processed reception should stay active\");\n assert(OffchainReception::is_processed(address, scope, msg), \"should be processed\");\n });\n }\n\n #[test]\n unconstrained fn already_processed_reception_is_not_re_pushed() {\n let (env, scope) = setup();\n let tx_hash = random();\n let msg = make_msg(scope, Option::some(tx_hash), 0);\n // A future origin block stays unfinalized, so the reception lingers in Processed across steps.\n let future_block = env.last_block_number() + 100;\n\n env.utility_context(|context| {\n let address = context.this_address();\n OffchainReception::init(address, msg);\n\n // First step processes the message.\n let reception = OffchainReception::load_all(address, scope).get(0);\n assert(reception.step(Option::some(resolved_tx_at_block(tx_hash, future_block)), 100).is_some());\n assert(OffchainReception::is_processed(address, scope, msg), \"should be processed\");\n\n // Second step (still resolved, not finalized) recognizes it as processed and does not re-push it.\n let reloaded = OffchainReception::load_all(address, scope).get(0);\n assert(\n reloaded.step(Option::some(resolved_tx_at_block(tx_hash, future_block)), 100).is_none(),\n \"already processed\",\n );\n assert(OffchainReception::is_active(address, scope, msg), \"processed reception should still be active\");\n });\n }\n\n #[test]\n unconstrained fn processed_reception_terminates_once_its_origin_block_finalizes() {\n let (env, scope) = setup();\n let tx_hash = random();\n let msg = make_msg(scope, Option::some(tx_hash), 0);\n\n env.utility_context(|context| {\n let address = context.this_address();\n OffchainReception::init(address, msg);\n\n // Process the message against a finalized block.\n let reception = OffchainReception::load_all(address, scope).get(0);\n assert(reception.step(Option::some(resolved_tx(tx_hash)), 100).is_some());\n assert(OffchainReception::is_processed(address, scope, msg), \"should be processed\");\n\n // Next step, still well within the TTL: a finalized origin block makes the processing reorg-proof, so the\n // reception terminates regardless of the TTL.\n let reloaded = OffchainReception::load_all(address, scope).get(0);\n assert(reloaded.step(Option::some(resolved_tx(tx_hash)), 100).is_none());\n assert(\n !OffchainReception::is_active(address, scope, msg),\n \"finalized processed reception should be terminated\",\n );\n });\n }\n\n #[test]\n unconstrained fn unfinalized_processed_reception_survives_past_the_ttl() {\n let (env, scope) = setup();\n let tx_hash = random();\n let msg = make_msg(scope, Option::some(tx_hash), 0);\n // A future origin block never finalizes here, so the reception must not be terminated by the TTL.\n let future_block = env.last_block_number() + 100;\n\n env.utility_context(|context| {\n let address = context.this_address();\n OffchainReception::init(address, msg);\n\n let reception = OffchainReception::load_all(address, scope).get(0);\n assert(reception.step(Option::some(resolved_tx_at_block(tx_hash, future_block)), 100).is_some());\n assert(OffchainReception::is_processed(address, scope, msg), \"should be processed\");\n\n // Past the TTL, but the origin block has not finalized: the reception stays active. The TTL no longer\n // governs an already-processed reception.\n let reloaded = OffchainReception::load_all(address, scope).get(0);\n assert(reloaded.step(Option::some(resolved_tx_at_block(tx_hash, future_block)), MAX_MSG_TTL + 1).is_none());\n assert(\n OffchainReception::is_active(address, scope, msg),\n \"unfinalized processed reception should survive past the TTL\",\n );\n });\n }\n\n #[test]\n unconstrained fn expired_reception_is_still_processed_when_its_tx_resolves() {\n let (env, scope) = setup();\n let tx_hash = random();\n let msg = make_msg(scope, Option::some(tx_hash), 0);\n\n env.utility_context(|context| {\n let address = context.this_address();\n OffchainReception::init(address, msg);\n\n // Even past the TTL, a freshly resolved tx is still handed off: expiry only caps the search for the\n // originating tx, it does not pre-empt processing once that tx is found.\n let reception = OffchainReception::load_all(address, scope).get(0);\n assert(reception.step(Option::some(resolved_tx(tx_hash)), MAX_MSG_TTL + 1).is_some());\n assert(OffchainReception::is_processed(address, scope, msg), \"should be processed\");\n assert(OffchainReception::is_active(address, scope, msg), \"just-processed reception should stay active\");\n });\n }\n}\n"
862
882
  },
863
883
  "17": {
864
884
  "function_locations": [
@@ -870,183 +890,183 @@
870
890
  "name": "keccakf1600",
871
891
  "start": 707
872
892
  },
873
- {
874
- "name": "keccak::keccakf1600",
875
- "start": 882
876
- },
877
893
  {
878
894
  "name": "blake2s",
879
- "start": 1044
895
+ "start": 852
880
896
  },
881
897
  {
882
898
  "name": "blake3",
883
- "start": 1142
899
+ "start": 950
884
900
  },
885
901
  {
886
902
  "name": "__blake3",
887
- "start": 1629
903
+ "start": 1437
888
904
  },
889
905
  {
890
906
  "name": "pedersen_commitment",
891
- "start": 1747
907
+ "start": 1555
892
908
  },
893
909
  {
894
910
  "name": "pedersen_commitment_with_separator",
895
- "start": 1976
911
+ "start": 1784
896
912
  },
897
913
  {
898
914
  "name": "pedersen_hash",
899
- "start": 2380
915
+ "start": 2188
900
916
  },
901
917
  {
902
918
  "name": "pedersen_hash_with_separator",
903
- "start": 2537
919
+ "start": 2345
904
920
  },
905
921
  {
906
922
  "name": "derive_generators",
907
- "start": 3531
923
+ "start": 3339
908
924
  },
909
925
  {
910
926
  "name": "__derive_generators",
911
- "start": 3890
927
+ "start": 3698
912
928
  },
913
929
  {
914
930
  "name": "poseidon2_permutation",
915
- "start": 3968
931
+ "start": 3776
916
932
  },
917
933
  {
918
934
  "name": "poseidon2_permutation_internal",
919
- "start": 4324
935
+ "start": 4132
920
936
  },
921
937
  {
922
938
  "name": "poseidon2_config_state_size",
923
- "start": 4417
939
+ "start": 4225
924
940
  },
925
941
  {
926
942
  "name": "derive_hash",
927
- "start": 4728
943
+ "start": 4536
944
+ },
945
+ {
946
+ "name": "Hasher::finish_ref",
947
+ "start": 5327
928
948
  },
929
949
  {
930
950
  "name": "<impl BuildHasher for BuildHasherDefault<H>>::build_hasher",
931
- "start": 5953
951
+ "start": 5761
932
952
  },
933
953
  {
934
954
  "name": "<impl Default for BuildHasherDefault<H>>::default",
935
- "start": 6085
955
+ "start": 5893
936
956
  },
937
957
  {
938
958
  "name": "<impl Hash for Field>::hash",
939
- "start": 6217
959
+ "start": 6025
940
960
  },
941
961
  {
942
962
  "name": "<impl Hash for u8>::hash",
943
- "start": 6347
963
+ "start": 6155
944
964
  },
945
965
  {
946
966
  "name": "<impl Hash for u16>::hash",
947
- "start": 6487
967
+ "start": 6295
948
968
  },
949
969
  {
950
970
  "name": "<impl Hash for u32>::hash",
951
- "start": 6627
971
+ "start": 6435
952
972
  },
953
973
  {
954
974
  "name": "<impl Hash for u64>::hash",
955
- "start": 6767
975
+ "start": 6575
956
976
  },
957
977
  {
958
978
  "name": "<impl Hash for u128>::hash",
959
- "start": 6908
979
+ "start": 6716
960
980
  },
961
981
  {
962
982
  "name": "<impl Hash for i8>::hash",
963
- "start": 7047
983
+ "start": 6855
964
984
  },
965
985
  {
966
986
  "name": "<impl Hash for i16>::hash",
967
- "start": 7193
987
+ "start": 7001
968
988
  },
969
989
  {
970
990
  "name": "<impl Hash for i32>::hash",
971
- "start": 7340
991
+ "start": 7148
972
992
  },
973
993
  {
974
994
  "name": "<impl Hash for i64>::hash",
975
- "start": 7487
995
+ "start": 7295
976
996
  },
977
997
  {
978
998
  "name": "<impl Hash for bool>::hash",
979
- "start": 7635
999
+ "start": 7443
980
1000
  },
981
1001
  {
982
1002
  "name": "<impl Hash for ()>::hash",
983
- "start": 7782
1003
+ "start": 7590
984
1004
  },
985
1005
  {
986
1006
  "name": "<impl Hash for [T; N]>::hash",
987
- "start": 7914
1007
+ "start": 7722
988
1008
  },
989
1009
  {
990
1010
  "name": "<impl Hash for [T]>::hash",
991
- "start": 8103
1011
+ "start": 7911
992
1012
  },
993
1013
  {
994
1014
  "name": "<impl Hash for (A,)>::hash",
995
- "start": 8325
1015
+ "start": 8133
996
1016
  },
997
1017
  {
998
1018
  "name": "<impl Hash for (A, B)>::hash",
999
- "start": 8494
1019
+ "start": 8302
1000
1020
  },
1001
1021
  {
1002
1022
  "name": "<impl Hash for (A, B, C)>::hash",
1003
- "start": 8710
1023
+ "start": 8518
1004
1024
  },
1005
1025
  {
1006
1026
  "name": "<impl Hash for (A, B, C, D)>::hash",
1007
- "start": 8973
1027
+ "start": 8781
1008
1028
  },
1009
1029
  {
1010
1030
  "name": "<impl Hash for (A, B, C, D, E)>::hash",
1011
- "start": 9283
1031
+ "start": 9091
1012
1032
  },
1013
1033
  {
1014
1034
  "name": "<impl Hash for (A, B, C, D, E, F)>::hash",
1015
- "start": 9640
1035
+ "start": 9448
1016
1036
  },
1017
1037
  {
1018
1038
  "name": "<impl Hash for (A, B, C, D, E, F, G)>::hash",
1019
- "start": 10044
1039
+ "start": 9852
1020
1040
  },
1021
1041
  {
1022
1042
  "name": "<impl Hash for (A, B, C, D, E, F, G, H_)>::hash",
1023
- "start": 10498
1043
+ "start": 10306
1024
1044
  },
1025
1045
  {
1026
1046
  "name": "<impl Hash for (A, B, C, D, E, F, G, H_, I)>::hash",
1027
- "start": 10999
1047
+ "start": 10807
1028
1048
  },
1029
1049
  {
1030
1050
  "name": "<impl Hash for (A, B, C, D, E, F, G, H_, I, J)>::hash",
1031
- "start": 11547
1051
+ "start": 11355
1032
1052
  },
1033
1053
  {
1034
1054
  "name": "<impl Hash for (A, B, C, D, E, F, G, H_, I, J, K)>::hash",
1035
- "start": 12142
1055
+ "start": 11950
1036
1056
  },
1037
1057
  {
1038
1058
  "name": "<impl Hash for (A, B, C, D, E, F, G, H_, I, J, K, L)>::hash",
1039
- "start": 12785
1059
+ "start": 12593
1040
1060
  },
1041
1061
  {
1042
1062
  "name": "assert_pedersen",
1043
- "start": 13379
1063
+ "start": 13187
1044
1064
  }
1045
1065
  ],
1046
1066
  "path": "std/hash/mod.nr",
1047
- "source": "// Exposed only for usage in `std::meta`\npub(crate) mod poseidon2;\n\nuse crate::default::Default;\nuse crate::embedded_curve_ops::{\n EmbeddedCurvePoint, EmbeddedCurveScalar, multi_scalar_mul, multi_scalar_mul_array_return,\n};\nuse crate::meta::derive_via;\nuse crate::static_assert;\n\n/// The size of the state accepted by the backend in `poseidon2_permutation`.\nglobal POSEIDON2_CONFIG_STATE_SIZE: u32 = poseidon2_config_state_size();\n\n#[foreign(sha256_compression)]\n// docs:start:sha256_compression\npub fn sha256_compression(input: [u32; 16], state: [u32; 8]) -> [u32; 8] {}\n// docs:end:sha256_compression\n\n#[foreign(keccakf1600)]\n// docs:start:keccakf1600\npub fn keccakf1600(input: [u64; 25]) -> [u64; 25] {}\n// docs:end:keccakf1600\n\npub mod keccak {\n #[deprecated(\"This function has been moved to std::hash::keccakf1600\")]\n pub fn keccakf1600(input: [u64; 25]) -> [u64; 25] {\n super::keccakf1600(input)\n }\n}\n\n#[foreign(blake2s)]\n// docs:start:blake2s\npub fn blake2s<let N: u32>(input: [u8; N]) -> [u8; 32]\n// docs:end:blake2s\n{}\n\n// docs:start:blake3\npub fn blake3<let N: u32>(input: [u8; N]) -> [u8; 32]\n// docs:end:blake3\n{\n if crate::runtime::is_unconstrained() {\n // Temporary measure while Barretenberg is main proving system.\n // Please open an issue if you're working on another proving system and running into problems due to this.\n crate::static_assert(\n N <= 1024,\n \"Barretenberg cannot prove blake3 hashes with inputs larger than 1024 bytes\",\n );\n }\n __blake3(input)\n}\n\n#[foreign(blake3)]\nfn __blake3<let N: u32>(input: [u8; N]) -> [u8; 32] {}\n\n// docs:start:pedersen_commitment\npub fn pedersen_commitment<let N: u32>(input: [Field; N]) -> EmbeddedCurvePoint {\n // docs:end:pedersen_commitment\n pedersen_commitment_with_separator(input, 0)\n}\n\n#[inline_always]\npub fn pedersen_commitment_with_separator<let N: u32>(\n input: [Field; N],\n separator: u32,\n) -> EmbeddedCurvePoint {\n let mut points = [EmbeddedCurveScalar { lo: 0, hi: 0 }; N];\n for i in 0..N {\n points[i] = EmbeddedCurveScalar::from_field(input[i]);\n }\n let generators = derive_generators(\"DEFAULT_DOMAIN_SEPARATOR\".as_bytes(), separator);\n multi_scalar_mul(generators, points)\n}\n\n// docs:start:pedersen_hash\npub fn pedersen_hash<let N: u32>(input: [Field; N]) -> Field\n// docs:end:pedersen_hash\n{\n pedersen_hash_with_separator(input, 0)\n}\n\n#[no_predicates]\npub fn pedersen_hash_with_separator<let N: u32>(input: [Field; N], separator: u32) -> Field {\n let mut scalars: [EmbeddedCurveScalar; N + 1] = [EmbeddedCurveScalar { lo: 0, hi: 0 }; N + 1];\n let mut generators: [EmbeddedCurvePoint; N + 1] =\n [EmbeddedCurvePoint::point_at_infinity(); N + 1];\n crate::assert_constant(separator);\n let domain_generators: [EmbeddedCurvePoint; N] =\n derive_generators(\"DEFAULT_DOMAIN_SEPARATOR\".as_bytes(), separator);\n\n for i in 0..N {\n scalars[i] = EmbeddedCurveScalar::from_field(input[i]);\n generators[i] = domain_generators[i];\n }\n scalars[N] = EmbeddedCurveScalar { lo: N as Field, hi: 0 as Field };\n\n let length_generator: [EmbeddedCurvePoint; 1] =\n derive_generators(\"pedersen_hash_length\".as_bytes(), 0);\n generators[N] = length_generator[0];\n multi_scalar_mul_array_return(generators, scalars, true)[0].x\n}\n\n#[field(bn254)]\n#[inline_always]\npub fn derive_generators<let N: u32, let M: u32>(\n domain_separator_bytes: [u8; M],\n starting_index: u32,\n) -> [EmbeddedCurvePoint; N] {\n crate::assert_constant(domain_separator_bytes);\n crate::assert_constant(starting_index);\n __derive_generators(domain_separator_bytes, starting_index)\n}\n\n#[builtin(derive_pedersen_generators)]\n#[field(bn254)]\nfn __derive_generators<let N: u32, let M: u32>(\n domain_separator_bytes: [u8; M],\n starting_index: u32,\n) -> [EmbeddedCurvePoint; N] {}\n\npub fn poseidon2_permutation<let N: u32>(input: [Field; N]) -> [Field; N] {\n static_assert(\n N == POSEIDON2_CONFIG_STATE_SIZE,\n f\"the input length must equal the state size in the Poseidon2 config; expected {POSEIDON2_CONFIG_STATE_SIZE}, got {N}\",\n );\n poseidon2_permutation_internal(input)\n}\n\n#[foreign(poseidon2_permutation)]\nfn poseidon2_permutation_internal<let N: u32>(input: [Field; N]) -> [Field; N] {}\n\n#[foreign(poseidon2_config_state_size)]\ncomptime fn poseidon2_config_state_size() -> u32 {}\n\n// Generic hashing support.\n// Partially ported and impacted by rust.\n\n// Hash trait shall be implemented per type.\n#[derive_via(derive_hash)]\npub trait Hash {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher;\n}\n\n// docs:start:derive_hash\ncomptime fn derive_hash(s: TypeDefinition) -> Quoted {\n let name = quote { $crate::hash::Hash };\n let signature = quote { fn hash<H>(_self: Self, _state: &mut H) where H: $crate::hash::Hasher };\n let for_each_field = |name| quote { _self.$name.hash(_state); };\n crate::meta::make_trait_impl(\n s,\n name,\n signature,\n for_each_field,\n quote {},\n |fields| fields,\n )\n}\n// docs:end:derive_hash\n\n// Hasher trait shall be implemented by algorithms to provide hash-agnostic means.\n// TODO: consider making the types generic here ([u8], [Field], etc.)\npub trait Hasher {\n fn finish(self) -> Field;\n\n /// Returns the hash value without consuming the hasher.\n /// Override this for more efficient implementations that avoid copying.\n /// TODO: deprecate finish() and replace it\n fn finish_ref(&self) -> Field {\n (*self).finish()\n }\n\n fn write(&mut self, input: Field);\n}\n\n// BuildHasher is a factory trait, responsible for production of specific Hasher.\npub trait BuildHasher {\n type H: Hasher;\n\n fn build_hasher(self) -> H;\n}\n\npub struct BuildHasherDefault<H>;\n\nimpl<H> BuildHasher for BuildHasherDefault<H>\nwhere\n H: Hasher + Default,\n{\n type H = H;\n\n fn build_hasher(_self: Self) -> H {\n H::default()\n }\n}\n\nimpl<H> Default for BuildHasherDefault<H>\nwhere\n H: Hasher + Default,\n{\n fn default() -> Self {\n BuildHasherDefault {}\n }\n}\n\nimpl Hash for Field {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self);\n }\n}\n\nimpl Hash for u8 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as Field);\n }\n}\n\nimpl Hash for u16 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as Field);\n }\n}\n\nimpl Hash for u32 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as Field);\n }\n}\n\nimpl Hash for u64 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as Field);\n }\n}\n\nimpl Hash for u128 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as Field);\n }\n}\n\nimpl Hash for i8 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as u8 as Field);\n }\n}\n\nimpl Hash for i16 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as u16 as Field);\n }\n}\n\nimpl Hash for i32 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as u32 as Field);\n }\n}\n\nimpl Hash for i64 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as u64 as Field);\n }\n}\n\nimpl Hash for bool {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as Field);\n }\n}\n\nimpl Hash for () {\n fn hash<H>(_self: Self, _state: &mut H)\n where\n H: Hasher,\n {}\n}\n\nimpl<T, let N: u32> Hash for [T; N]\nwhere\n T: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n for elem in self {\n elem.hash(state);\n }\n }\n}\n\nimpl<T> Hash for [T]\nwhere\n T: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.len().hash(state);\n for elem in self {\n elem.hash(state);\n }\n }\n}\n\nimpl<A> Hash for (A,)\nwhere\n A: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n }\n}\n\nimpl<A, B> Hash for (A, B)\nwhere\n A: Hash,\n B: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n self.1.hash(state);\n }\n}\n\nimpl<A, B, C> Hash for (A, B, C)\nwhere\n A: Hash,\n B: Hash,\n C: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n self.1.hash(state);\n self.2.hash(state);\n }\n}\n\nimpl<A, B, C, D> Hash for (A, B, C, D)\nwhere\n A: Hash,\n B: Hash,\n C: Hash,\n D: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n self.1.hash(state);\n self.2.hash(state);\n self.3.hash(state);\n }\n}\n\nimpl<A, B, C, D, E> Hash for (A, B, C, D, E)\nwhere\n A: Hash,\n B: Hash,\n C: Hash,\n D: Hash,\n E: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n self.1.hash(state);\n self.2.hash(state);\n self.3.hash(state);\n self.4.hash(state);\n }\n}\n\nimpl<A, B, C, D, E, F> Hash for (A, B, C, D, E, F)\nwhere\n A: Hash,\n B: Hash,\n C: Hash,\n D: Hash,\n E: Hash,\n F: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n self.1.hash(state);\n self.2.hash(state);\n self.3.hash(state);\n self.4.hash(state);\n self.5.hash(state);\n }\n}\n\nimpl<A, B, C, D, E, F, G> Hash for (A, B, C, D, E, F, G)\nwhere\n A: Hash,\n B: Hash,\n C: Hash,\n D: Hash,\n E: Hash,\n F: Hash,\n G: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n self.1.hash(state);\n self.2.hash(state);\n self.3.hash(state);\n self.4.hash(state);\n self.5.hash(state);\n self.6.hash(state);\n }\n}\n\nimpl<A, B, C, D, E, F, G, H_> Hash for (A, B, C, D, E, F, G, H_)\nwhere\n A: Hash,\n B: Hash,\n C: Hash,\n D: Hash,\n E: Hash,\n F: Hash,\n G: Hash,\n H_: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n self.1.hash(state);\n self.2.hash(state);\n self.3.hash(state);\n self.4.hash(state);\n self.5.hash(state);\n self.6.hash(state);\n self.7.hash(state);\n }\n}\n\nimpl<A, B, C, D, E, F, G, H_, I> Hash for (A, B, C, D, E, F, G, H_, I)\nwhere\n A: Hash,\n B: Hash,\n C: Hash,\n D: Hash,\n E: Hash,\n F: Hash,\n G: Hash,\n H_: Hash,\n I: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n self.1.hash(state);\n self.2.hash(state);\n self.3.hash(state);\n self.4.hash(state);\n self.5.hash(state);\n self.6.hash(state);\n self.7.hash(state);\n self.8.hash(state);\n }\n}\n\nimpl<A, B, C, D, E, F, G, H_, I, J> Hash for (A, B, C, D, E, F, G, H_, I, J)\nwhere\n A: Hash,\n B: Hash,\n C: Hash,\n D: Hash,\n E: Hash,\n F: Hash,\n G: Hash,\n H_: Hash,\n I: Hash,\n J: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n self.1.hash(state);\n self.2.hash(state);\n self.3.hash(state);\n self.4.hash(state);\n self.5.hash(state);\n self.6.hash(state);\n self.7.hash(state);\n self.8.hash(state);\n self.9.hash(state);\n }\n}\n\nimpl<A, B, C, D, E, F, G, H_, I, J, K> Hash for (A, B, C, D, E, F, G, H_, I, J, K)\nwhere\n A: Hash,\n B: Hash,\n C: Hash,\n D: Hash,\n E: Hash,\n F: Hash,\n G: Hash,\n H_: Hash,\n I: Hash,\n J: Hash,\n K: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n self.1.hash(state);\n self.2.hash(state);\n self.3.hash(state);\n self.4.hash(state);\n self.5.hash(state);\n self.6.hash(state);\n self.7.hash(state);\n self.8.hash(state);\n self.9.hash(state);\n self.10.hash(state);\n }\n}\n\nimpl<A, B, C, D, E, F, G, H_, I, J, K, L> Hash for (A, B, C, D, E, F, G, H_, I, J, K, L)\nwhere\n A: Hash,\n B: Hash,\n C: Hash,\n D: Hash,\n E: Hash,\n F: Hash,\n G: Hash,\n H_: Hash,\n I: Hash,\n J: Hash,\n K: Hash,\n L: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n self.1.hash(state);\n self.2.hash(state);\n self.3.hash(state);\n self.4.hash(state);\n self.5.hash(state);\n self.6.hash(state);\n self.7.hash(state);\n self.8.hash(state);\n self.9.hash(state);\n self.10.hash(state);\n self.11.hash(state);\n }\n}\n\n// Some test vectors for Pedersen hash and Pedersen Commitment.\n// They have been generated using the same functions so the tests are for now useless\n// but they will be useful when we switch to Noir implementation.\n#[test]\nfn assert_pedersen() {\n assert_eq(\n pedersen_hash_with_separator([1], 1),\n 0x1b3f4b1a83092a13d8d1a59f7acb62aba15e7002f4440f2275edb99ebbc2305f,\n );\n assert_eq(\n pedersen_commitment_with_separator([1], 1),\n EmbeddedCurvePoint {\n x: 0x054aa86a73cb8a34525e5bbed6e43ba1198e860f5f3950268f71df4591bde402,\n y: 0x209dcfbf2cfb57f9f6046f44d71ac6faf87254afc7407c04eb621a6287cac126,\n },\n );\n\n assert_eq(\n pedersen_hash_with_separator([1, 2], 2),\n 0x26691c129448e9ace0c66d11f0a16d9014a9e8498ee78f4d69f0083168188255,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2], 2),\n EmbeddedCurvePoint {\n x: 0x2e2b3b191e49541fe468ec6877721d445dcaffe41728df0a0eafeb15e87b0753,\n y: 0x2ff4482400ad3a6228be17a2af33e2bcdf41be04795f9782bd96efe7e24f8778,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3], 3),\n 0x0bc694b7a1f8d10d2d8987d07433f26bd616a2d351bc79a3c540d85b6206dbe4,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3], 3),\n EmbeddedCurvePoint {\n x: 0x1fee4e8cf8d2f527caa2684236b07c4b1bad7342c01b0f75e9a877a71827dc85,\n y: 0x2f9fedb9a090697ab69bf04c8bc15f7385b3e4b68c849c1536e5ae15ff138fd1,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3, 4], 4),\n 0xdae10fb32a8408521803905981a2b300d6a35e40e798743e9322b223a5eddc,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3, 4], 4),\n EmbeddedCurvePoint {\n x: 0x07ae3e202811e1fca39c2d81eabe6f79183978e6f12be0d3b8eda095b79bdbc9,\n y: 0x0afc6f892593db6fbba60f2da558517e279e0ae04f95758587760ba193145014,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3, 4, 5], 5),\n 0xfc375b062c4f4f0150f7100dfb8d9b72a6d28582dd9512390b0497cdad9c22,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3, 4, 5], 5),\n EmbeddedCurvePoint {\n x: 0x1754b12bd475a6984a1094b5109eeca9838f4f81ac89c5f0a41dbce53189bb29,\n y: 0x2da030e3cfcdc7ddad80eaf2599df6692cae0717d4e9f7bfbee8d073d5d278f7,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3, 4, 5, 6], 6),\n 0x1696ed13dc2730062a98ac9d8f9de0661bb98829c7582f699d0273b18c86a572,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3, 4, 5, 6], 6),\n EmbeddedCurvePoint {\n x: 0x190f6c0e97ad83e1e28da22a98aae156da083c5a4100e929b77e750d3106a697,\n y: 0x1f4b60f34ef91221a0b49756fa0705da93311a61af73d37a0c458877706616fb,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3, 4, 5, 6, 7], 7),\n 0x128c0ff144fc66b6cb60eeac8a38e23da52992fc427b92397a7dffd71c45ede3,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3, 4, 5, 6, 7], 7),\n EmbeddedCurvePoint {\n x: 0x015441e9d29491b06563fac16fc76abf7a9534c715421d0de85d20dbe2965939,\n y: 0x1d2575b0276f4e9087e6e07c2cb75aa1baafad127af4be5918ef8a2ef2fea8fc,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3, 4, 5, 6, 7, 8], 8),\n 0x2f960e117482044dfc99d12fece2ef6862fba9242be4846c7c9a3e854325a55c,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3, 4, 5, 6, 7, 8], 8),\n EmbeddedCurvePoint {\n x: 0x1657737676968887fceb6dd516382ea13b3a2c557f509811cd86d5d1199bc443,\n y: 0x1f39f0cb569040105fa1e2f156521e8b8e08261e635a2b210bdc94e8d6d65f77,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3, 4, 5, 6, 7, 8, 9], 9),\n 0x0c96db0790602dcb166cc4699e2d306c479a76926b81c2cb2aaa92d249ec7be7,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3, 4, 5, 6, 7, 8, 9], 9),\n EmbeddedCurvePoint {\n x: 0x0a3ceae42d14914a432aa60ec7fded4af7dad7dd4acdbf2908452675ec67e06d,\n y: 0xfc19761eaaf621ad4aec9a8b2e84a4eceffdba78f60f8b9391b0bd9345a2f2,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 10),\n 0x2cd37505871bc460a62ea1e63c7fe51149df5d0801302cf1cbc48beb8dff7e94,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 10),\n EmbeddedCurvePoint {\n x: 0x2fb3f8b3d41ddde007c8c3c62550f9a9380ee546fcc639ffbb3fd30c8d8de30c,\n y: 0x300783be23c446b11a4c0fabf6c91af148937cea15fcf5fb054abf7f752ee245,\n },\n );\n}\n"
1067
+ "source": "// Exposed only for usage in `std::meta`\npub(crate) mod poseidon2;\n\nuse crate::default::Default;\nuse crate::embedded_curve_ops::{\n EmbeddedCurvePoint, EmbeddedCurveScalar, multi_scalar_mul, multi_scalar_mul_array_return,\n};\nuse crate::meta::derive_via;\nuse crate::static_assert;\n\n/// The size of the state accepted by the backend in `poseidon2_permutation`.\nglobal POSEIDON2_CONFIG_STATE_SIZE: u32 = poseidon2_config_state_size();\n\n#[foreign(sha256_compression)]\n// docs:start:sha256_compression\npub fn sha256_compression(input: [u32; 16], state: [u32; 8]) -> [u32; 8] {}\n// docs:end:sha256_compression\n\n#[foreign(keccakf1600)]\n// docs:start:keccakf1600\npub fn keccakf1600(input: [u64; 25]) -> [u64; 25] {}\n// docs:end:keccakf1600\n\n#[foreign(blake2s)]\n// docs:start:blake2s\npub fn blake2s<let N: u32>(input: [u8; N]) -> [u8; 32]\n// docs:end:blake2s\n{}\n\n// docs:start:blake3\npub fn blake3<let N: u32>(input: [u8; N]) -> [u8; 32]\n// docs:end:blake3\n{\n if crate::runtime::is_unconstrained() {\n // Temporary measure while Barretenberg is main proving system.\n // Please open an issue if you're working on another proving system and running into problems due to this.\n crate::static_assert(\n N <= 1024,\n \"Barretenberg cannot prove blake3 hashes with inputs larger than 1024 bytes\",\n );\n }\n __blake3(input)\n}\n\n#[foreign(blake3)]\nfn __blake3<let N: u32>(input: [u8; N]) -> [u8; 32] {}\n\n// docs:start:pedersen_commitment\npub fn pedersen_commitment<let N: u32>(input: [Field; N]) -> EmbeddedCurvePoint {\n // docs:end:pedersen_commitment\n pedersen_commitment_with_separator(input, 0)\n}\n\n#[inline_always]\npub fn pedersen_commitment_with_separator<let N: u32>(\n input: [Field; N],\n separator: u32,\n) -> EmbeddedCurvePoint {\n let mut points = [EmbeddedCurveScalar { lo: 0, hi: 0 }; N];\n for i in 0..N {\n points[i] = EmbeddedCurveScalar::from_field(input[i]);\n }\n let generators = derive_generators(\"DEFAULT_DOMAIN_SEPARATOR\".as_bytes(), separator);\n multi_scalar_mul(generators, points)\n}\n\n// docs:start:pedersen_hash\npub fn pedersen_hash<let N: u32>(input: [Field; N]) -> Field\n// docs:end:pedersen_hash\n{\n pedersen_hash_with_separator(input, 0)\n}\n\n#[no_predicates]\npub fn pedersen_hash_with_separator<let N: u32>(input: [Field; N], separator: u32) -> Field {\n let mut scalars: [EmbeddedCurveScalar; N + 1] = [EmbeddedCurveScalar { lo: 0, hi: 0 }; N + 1];\n let mut generators: [EmbeddedCurvePoint; N + 1] =\n [EmbeddedCurvePoint::point_at_infinity(); N + 1];\n crate::assert_constant(separator);\n let domain_generators: [EmbeddedCurvePoint; N] =\n derive_generators(\"DEFAULT_DOMAIN_SEPARATOR\".as_bytes(), separator);\n\n for i in 0..N {\n scalars[i] = EmbeddedCurveScalar::from_field(input[i]);\n generators[i] = domain_generators[i];\n }\n scalars[N] = EmbeddedCurveScalar { lo: N as Field, hi: 0 as Field };\n\n let length_generator: [EmbeddedCurvePoint; 1] =\n derive_generators(\"pedersen_hash_length\".as_bytes(), 0);\n generators[N] = length_generator[0];\n multi_scalar_mul_array_return(generators, scalars, true)[0].x\n}\n\n#[field(bn254)]\n#[inline_always]\npub fn derive_generators<let N: u32, let M: u32>(\n domain_separator_bytes: [u8; M],\n starting_index: u32,\n) -> [EmbeddedCurvePoint; N] {\n crate::assert_constant(domain_separator_bytes);\n crate::assert_constant(starting_index);\n __derive_generators(domain_separator_bytes, starting_index)\n}\n\n#[builtin(derive_pedersen_generators)]\n#[field(bn254)]\nfn __derive_generators<let N: u32, let M: u32>(\n domain_separator_bytes: [u8; M],\n starting_index: u32,\n) -> [EmbeddedCurvePoint; N] {}\n\npub fn poseidon2_permutation<let N: u32>(input: [Field; N]) -> [Field; N] {\n static_assert(\n N == POSEIDON2_CONFIG_STATE_SIZE,\n f\"the input length must equal the state size in the Poseidon2 config; expected {POSEIDON2_CONFIG_STATE_SIZE}, got {N}\",\n );\n poseidon2_permutation_internal(input)\n}\n\n#[foreign(poseidon2_permutation)]\nfn poseidon2_permutation_internal<let N: u32>(input: [Field; N]) -> [Field; N] {}\n\n#[foreign(poseidon2_config_state_size)]\ncomptime fn poseidon2_config_state_size() -> u32 {}\n\n// Generic hashing support.\n// Partially ported and impacted by rust.\n\n// Hash trait shall be implemented per type.\n#[derive_via(derive_hash)]\npub trait Hash {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher;\n}\n\n// docs:start:derive_hash\ncomptime fn derive_hash(s: TypeDefinition) -> Quoted {\n let name = quote { $crate::hash::Hash };\n let signature = quote { fn hash<H>(_self: Self, _state: &mut H) where H: $crate::hash::Hasher };\n let for_each_field = |name| quote { _self.$name.hash(_state); };\n crate::meta::make_trait_impl(\n s,\n name,\n signature,\n for_each_field,\n quote {},\n |fields| fields,\n )\n}\n// docs:end:derive_hash\n\n// Hasher trait shall be implemented by algorithms to provide hash-agnostic means.\n// TODO: consider making the types generic here ([u8], [Field], etc.)\npub trait Hasher {\n fn finish(self) -> Field;\n\n /// Returns the hash value without consuming the hasher.\n /// Override this for more efficient implementations that avoid copying.\n /// TODO: deprecate finish() and replace it\n fn finish_ref(&self) -> Field {\n (*self).finish()\n }\n\n fn write(&mut self, input: Field);\n}\n\n// BuildHasher is a factory trait, responsible for production of specific Hasher.\npub trait BuildHasher {\n type H: Hasher;\n\n fn build_hasher(self) -> H;\n}\n\npub struct BuildHasherDefault<H>;\n\nimpl<H> BuildHasher for BuildHasherDefault<H>\nwhere\n H: Hasher + Default,\n{\n type H = H;\n\n fn build_hasher(_self: Self) -> H {\n H::default()\n }\n}\n\nimpl<H> Default for BuildHasherDefault<H>\nwhere\n H: Hasher + Default,\n{\n fn default() -> Self {\n BuildHasherDefault {}\n }\n}\n\nimpl Hash for Field {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self);\n }\n}\n\nimpl Hash for u8 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as Field);\n }\n}\n\nimpl Hash for u16 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as Field);\n }\n}\n\nimpl Hash for u32 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as Field);\n }\n}\n\nimpl Hash for u64 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as Field);\n }\n}\n\nimpl Hash for u128 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as Field);\n }\n}\n\nimpl Hash for i8 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as u8 as Field);\n }\n}\n\nimpl Hash for i16 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as u16 as Field);\n }\n}\n\nimpl Hash for i32 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as u32 as Field);\n }\n}\n\nimpl Hash for i64 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as u64 as Field);\n }\n}\n\nimpl Hash for bool {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as Field);\n }\n}\n\nimpl Hash for () {\n fn hash<H>(_self: Self, _state: &mut H)\n where\n H: Hasher,\n {}\n}\n\nimpl<T, let N: u32> Hash for [T; N]\nwhere\n T: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n for elem in self {\n elem.hash(state);\n }\n }\n}\n\nimpl<T> Hash for [T]\nwhere\n T: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.len().hash(state);\n for elem in self {\n elem.hash(state);\n }\n }\n}\n\nimpl<A> Hash for (A,)\nwhere\n A: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n }\n}\n\nimpl<A, B> Hash for (A, B)\nwhere\n A: Hash,\n B: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n self.1.hash(state);\n }\n}\n\nimpl<A, B, C> Hash for (A, B, C)\nwhere\n A: Hash,\n B: Hash,\n C: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n self.1.hash(state);\n self.2.hash(state);\n }\n}\n\nimpl<A, B, C, D> Hash for (A, B, C, D)\nwhere\n A: Hash,\n B: Hash,\n C: Hash,\n D: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n self.1.hash(state);\n self.2.hash(state);\n self.3.hash(state);\n }\n}\n\nimpl<A, B, C, D, E> Hash for (A, B, C, D, E)\nwhere\n A: Hash,\n B: Hash,\n C: Hash,\n D: Hash,\n E: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n self.1.hash(state);\n self.2.hash(state);\n self.3.hash(state);\n self.4.hash(state);\n }\n}\n\nimpl<A, B, C, D, E, F> Hash for (A, B, C, D, E, F)\nwhere\n A: Hash,\n B: Hash,\n C: Hash,\n D: Hash,\n E: Hash,\n F: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n self.1.hash(state);\n self.2.hash(state);\n self.3.hash(state);\n self.4.hash(state);\n self.5.hash(state);\n }\n}\n\nimpl<A, B, C, D, E, F, G> Hash for (A, B, C, D, E, F, G)\nwhere\n A: Hash,\n B: Hash,\n C: Hash,\n D: Hash,\n E: Hash,\n F: Hash,\n G: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n self.1.hash(state);\n self.2.hash(state);\n self.3.hash(state);\n self.4.hash(state);\n self.5.hash(state);\n self.6.hash(state);\n }\n}\n\nimpl<A, B, C, D, E, F, G, H_> Hash for (A, B, C, D, E, F, G, H_)\nwhere\n A: Hash,\n B: Hash,\n C: Hash,\n D: Hash,\n E: Hash,\n F: Hash,\n G: Hash,\n H_: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n self.1.hash(state);\n self.2.hash(state);\n self.3.hash(state);\n self.4.hash(state);\n self.5.hash(state);\n self.6.hash(state);\n self.7.hash(state);\n }\n}\n\nimpl<A, B, C, D, E, F, G, H_, I> Hash for (A, B, C, D, E, F, G, H_, I)\nwhere\n A: Hash,\n B: Hash,\n C: Hash,\n D: Hash,\n E: Hash,\n F: Hash,\n G: Hash,\n H_: Hash,\n I: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n self.1.hash(state);\n self.2.hash(state);\n self.3.hash(state);\n self.4.hash(state);\n self.5.hash(state);\n self.6.hash(state);\n self.7.hash(state);\n self.8.hash(state);\n }\n}\n\nimpl<A, B, C, D, E, F, G, H_, I, J> Hash for (A, B, C, D, E, F, G, H_, I, J)\nwhere\n A: Hash,\n B: Hash,\n C: Hash,\n D: Hash,\n E: Hash,\n F: Hash,\n G: Hash,\n H_: Hash,\n I: Hash,\n J: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n self.1.hash(state);\n self.2.hash(state);\n self.3.hash(state);\n self.4.hash(state);\n self.5.hash(state);\n self.6.hash(state);\n self.7.hash(state);\n self.8.hash(state);\n self.9.hash(state);\n }\n}\n\nimpl<A, B, C, D, E, F, G, H_, I, J, K> Hash for (A, B, C, D, E, F, G, H_, I, J, K)\nwhere\n A: Hash,\n B: Hash,\n C: Hash,\n D: Hash,\n E: Hash,\n F: Hash,\n G: Hash,\n H_: Hash,\n I: Hash,\n J: Hash,\n K: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n self.1.hash(state);\n self.2.hash(state);\n self.3.hash(state);\n self.4.hash(state);\n self.5.hash(state);\n self.6.hash(state);\n self.7.hash(state);\n self.8.hash(state);\n self.9.hash(state);\n self.10.hash(state);\n }\n}\n\nimpl<A, B, C, D, E, F, G, H_, I, J, K, L> Hash for (A, B, C, D, E, F, G, H_, I, J, K, L)\nwhere\n A: Hash,\n B: Hash,\n C: Hash,\n D: Hash,\n E: Hash,\n F: Hash,\n G: Hash,\n H_: Hash,\n I: Hash,\n J: Hash,\n K: Hash,\n L: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n self.1.hash(state);\n self.2.hash(state);\n self.3.hash(state);\n self.4.hash(state);\n self.5.hash(state);\n self.6.hash(state);\n self.7.hash(state);\n self.8.hash(state);\n self.9.hash(state);\n self.10.hash(state);\n self.11.hash(state);\n }\n}\n\n// Some test vectors for Pedersen hash and Pedersen Commitment.\n// They have been generated using the same functions so the tests are for now useless\n// but they will be useful when we switch to Noir implementation.\n#[test]\nfn assert_pedersen() {\n assert_eq(\n pedersen_hash_with_separator([1], 1),\n 0x1b3f4b1a83092a13d8d1a59f7acb62aba15e7002f4440f2275edb99ebbc2305f,\n );\n assert_eq(\n pedersen_commitment_with_separator([1], 1),\n EmbeddedCurvePoint {\n x: 0x054aa86a73cb8a34525e5bbed6e43ba1198e860f5f3950268f71df4591bde402,\n y: 0x209dcfbf2cfb57f9f6046f44d71ac6faf87254afc7407c04eb621a6287cac126,\n },\n );\n\n assert_eq(\n pedersen_hash_with_separator([1, 2], 2),\n 0x26691c129448e9ace0c66d11f0a16d9014a9e8498ee78f4d69f0083168188255,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2], 2),\n EmbeddedCurvePoint {\n x: 0x2e2b3b191e49541fe468ec6877721d445dcaffe41728df0a0eafeb15e87b0753,\n y: 0x2ff4482400ad3a6228be17a2af33e2bcdf41be04795f9782bd96efe7e24f8778,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3], 3),\n 0x0bc694b7a1f8d10d2d8987d07433f26bd616a2d351bc79a3c540d85b6206dbe4,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3], 3),\n EmbeddedCurvePoint {\n x: 0x1fee4e8cf8d2f527caa2684236b07c4b1bad7342c01b0f75e9a877a71827dc85,\n y: 0x2f9fedb9a090697ab69bf04c8bc15f7385b3e4b68c849c1536e5ae15ff138fd1,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3, 4], 4),\n 0xdae10fb32a8408521803905981a2b300d6a35e40e798743e9322b223a5eddc,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3, 4], 4),\n EmbeddedCurvePoint {\n x: 0x07ae3e202811e1fca39c2d81eabe6f79183978e6f12be0d3b8eda095b79bdbc9,\n y: 0x0afc6f892593db6fbba60f2da558517e279e0ae04f95758587760ba193145014,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3, 4, 5], 5),\n 0xfc375b062c4f4f0150f7100dfb8d9b72a6d28582dd9512390b0497cdad9c22,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3, 4, 5], 5),\n EmbeddedCurvePoint {\n x: 0x1754b12bd475a6984a1094b5109eeca9838f4f81ac89c5f0a41dbce53189bb29,\n y: 0x2da030e3cfcdc7ddad80eaf2599df6692cae0717d4e9f7bfbee8d073d5d278f7,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3, 4, 5, 6], 6),\n 0x1696ed13dc2730062a98ac9d8f9de0661bb98829c7582f699d0273b18c86a572,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3, 4, 5, 6], 6),\n EmbeddedCurvePoint {\n x: 0x190f6c0e97ad83e1e28da22a98aae156da083c5a4100e929b77e750d3106a697,\n y: 0x1f4b60f34ef91221a0b49756fa0705da93311a61af73d37a0c458877706616fb,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3, 4, 5, 6, 7], 7),\n 0x128c0ff144fc66b6cb60eeac8a38e23da52992fc427b92397a7dffd71c45ede3,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3, 4, 5, 6, 7], 7),\n EmbeddedCurvePoint {\n x: 0x015441e9d29491b06563fac16fc76abf7a9534c715421d0de85d20dbe2965939,\n y: 0x1d2575b0276f4e9087e6e07c2cb75aa1baafad127af4be5918ef8a2ef2fea8fc,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3, 4, 5, 6, 7, 8], 8),\n 0x2f960e117482044dfc99d12fece2ef6862fba9242be4846c7c9a3e854325a55c,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3, 4, 5, 6, 7, 8], 8),\n EmbeddedCurvePoint {\n x: 0x1657737676968887fceb6dd516382ea13b3a2c557f509811cd86d5d1199bc443,\n y: 0x1f39f0cb569040105fa1e2f156521e8b8e08261e635a2b210bdc94e8d6d65f77,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3, 4, 5, 6, 7, 8, 9], 9),\n 0x0c96db0790602dcb166cc4699e2d306c479a76926b81c2cb2aaa92d249ec7be7,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3, 4, 5, 6, 7, 8, 9], 9),\n EmbeddedCurvePoint {\n x: 0x0a3ceae42d14914a432aa60ec7fded4af7dad7dd4acdbf2908452675ec67e06d,\n y: 0xfc19761eaaf621ad4aec9a8b2e84a4eceffdba78f60f8b9391b0bd9345a2f2,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 10),\n 0x2cd37505871bc460a62ea1e63c7fe51149df5d0801302cf1cbc48beb8dff7e94,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 10),\n EmbeddedCurvePoint {\n x: 0x2fb3f8b3d41ddde007c8c3c62550f9a9380ee546fcc639ffbb3fd30c8d8de30c,\n y: 0x300783be23c446b11a4c0fabf6c91af148937cea15fcf5fb054abf7f752ee245,\n },\n );\n}\n"
1048
1068
  },
1049
- "184": {
1069
+ "185": {
1050
1070
  "function_locations": [
1051
1071
  {
1052
1072
  "name": "get_auth_witness_oracle",
@@ -1072,7 +1092,7 @@
1072
1092
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/auth_witness.nr",
1073
1093
  "source": "#[oracle(aztec_utl_getAuthWitness)]\nunconstrained fn get_auth_witness_oracle<let N: u32>(_message_hash: Field) -> [Field; N] {}\n\n/// Oracle wrapper to fetch an `auth_witness` for a given `message_hash` from the PXE.\npub unconstrained fn get_auth_witness<let N: u32>(message_hash: Field) -> [Field; N] {\n get_auth_witness_oracle(message_hash)\n}\n\n/// Fetches an auth witness and casts each field to a byte.\n///\n/// Each field is range-checked to `[0, 256)` before casting to prevent silent truncation (e.g. a field value of\n/// `b + 256` would truncate to the same byte as `b`).\npub unconstrained fn get_auth_witness_as_bytes<let N: u32>(message_hash: Field) -> [u8; N] {\n let witness = get_auth_witness::<N>(message_hash);\n let mut result: [u8; N] = [0; N];\n for i in 0..N {\n assert(witness[i].lt(256), \"auth witness field is not a single byte\");\n result[i] = witness[i] as u8;\n }\n result\n}\n\nmod test {\n use super::get_auth_witness_as_bytes;\n use std::test::OracleMock;\n\n #[test]\n unconstrained fn get_auth_witness_as_bytes_casts_valid_witness() {\n let witness: [Field; 3] = [0, 127, 255];\n let _ = OracleMock::mock(\"aztec_utl_getAuthWitness\").returns(witness);\n let bytes: [u8; 3] = get_auth_witness_as_bytes(0);\n assert_eq(bytes, [0, 127, 255]);\n }\n\n #[test(should_fail_with = \"auth witness field is not a single byte\")]\n unconstrained fn get_auth_witness_as_bytes_rejects_field_above_byte_range() {\n let witness: [Field; 1] = [256];\n let _ = OracleMock::mock(\"aztec_utl_getAuthWitness\").returns(witness);\n let _: [u8; 1] = get_auth_witness_as_bytes(0);\n }\n}\n"
1074
1094
  },
1075
- "187": {
1095
+ "188": {
1076
1096
  "function_locations": [
1077
1097
  {
1078
1098
  "name": "call_private_function_oracle",
@@ -1086,7 +1106,7 @@
1086
1106
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/call_private_function.nr",
1087
1107
  "source": "use crate::protocol::{abis::function_selector::FunctionSelector, address::AztecAddress};\n\n#[oracle(aztec_prv_callPrivateFunction)]\nunconstrained fn call_private_function_oracle(\n _contract_address: AztecAddress,\n _function_selector: FunctionSelector,\n _args_hash: Field,\n _start_side_effect_counter: u32,\n _is_static_call: bool,\n) -> (u32, Field) {}\n\npub unconstrained fn call_private_function_internal(\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args_hash: Field,\n start_side_effect_counter: u32,\n is_static_call: bool,\n) -> (u32, Field) {\n call_private_function_oracle(\n contract_address,\n function_selector,\n args_hash,\n start_side_effect_counter,\n is_static_call,\n )\n}\n"
1088
1108
  },
1089
- "189": {
1109
+ "190": {
1090
1110
  "function_locations": [
1091
1111
  {
1092
1112
  "name": "store",
@@ -1180,7 +1200,7 @@
1180
1200
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/capsules.nr",
1181
1201
  "source": "use crate::protocol::{address::AztecAddress, traits::{Deserialize, Serialize}};\n\n/// Stores arbitrary information in a per-contract non-volatile database, which can later be retrieved with `load`. If\n/// data was already stored at this slot, it is overwritten.\n// TODO(F-498): review naming consistency\npub unconstrained fn store<T>(contract_address: AztecAddress, slot: Field, value: T, scope: AztecAddress)\nwhere\n T: Serialize,\n{\n let serialized = value.serialize();\n set_capsule_oracle(contract_address, slot, serialized, scope);\n}\n\n/// Returns data previously stored via `storeCapsule` in the per-contract non-volatile database. Returns\n/// Option::none() if nothing was stored at the given slot.\n// TODO(F-498): review naming consistency\npub unconstrained fn load<T>(contract_address: AztecAddress, slot: Field, scope: AztecAddress) -> Option<T>\nwhere\n T: Deserialize,\n{\n let serialized_option = get_capsule_oracle(contract_address, slot, <T as Deserialize>::N, scope);\n serialized_option.map(|arr| Deserialize::deserialize(arr))\n}\n\n/// Deletes data in the per-contract non-volatile database. Does nothing if no data was present.\npub unconstrained fn delete(contract_address: AztecAddress, slot: Field, scope: AztecAddress) {\n delete_oracle(contract_address, slot, scope);\n}\n\n/// Copies a number of contiguous entries in the per-contract non-volatile database. This allows for efficient data\n/// structures by avoiding repeated calls to `loadCapsule` and `storeCapsule`. Supports overlapping source and\n/// destination regions (which will result in the overlapped source values being overwritten). All copied slots must\n/// exist in the database (i.e. have been stored and not deleted)\npub unconstrained fn copy(\n contract_address: AztecAddress,\n src_slot: Field,\n dst_slot: Field,\n num_entries: u32,\n scope: AztecAddress,\n) {\n copy_oracle(contract_address, src_slot, dst_slot, num_entries, scope);\n}\n\n#[oracle(aztec_utl_setCapsule)]\nunconstrained fn set_capsule_oracle<let N: u32>(\n contract_address: AztecAddress,\n slot: Field,\n values: [Field; N],\n scope: AztecAddress,\n) {}\n\n/// We need to pass in `array_len` (the value of N) as a parameter to tell the oracle how many fields the response must\n/// have.\n///\n/// Note that the oracle returns an Option<[Field; N]> because we cannot return an Option<T> directly. That would\n/// require for the oracle resolver to know the shape of T (e.g. if T were a struct of 3 u32 values then the expected\n/// response shape would be 3 single items, whereas it were a struct containing `u32, [Field;10], u32` then the\n/// expected shape would be single, array, single.). Instead, we return the serialization and deserialize in Noir.\n#[oracle(aztec_utl_getCapsule)]\nunconstrained fn get_capsule_oracle<let N: u32>(\n contract_address: AztecAddress,\n slot: Field,\n array_len: u32,\n scope: AztecAddress,\n) -> Option<[Field; N]> {}\n\n#[oracle(aztec_utl_deleteCapsule)]\nunconstrained fn delete_oracle(contract_address: AztecAddress, slot: Field, scope: AztecAddress) {}\n\n#[oracle(aztec_utl_copyCapsule)]\nunconstrained fn copy_oracle(\n contract_address: AztecAddress,\n src_slot: Field,\n dst_slot: Field,\n num_entries: u32,\n scope: AztecAddress,\n) {}\n\nmod test {\n // These tests are sort of redundant since we already test the oracle implementation directly in TypeScript, but\n // they are cheap regardless and help ensure both that the TXE implementation works accordingly and that the Noir\n // oracles are hooked up correctly.\n\n use crate::{\n oracle::capsules::{copy, delete, load, store},\n test::{helpers::test_environment::TestEnvironment, mocks::MockStruct},\n };\n use crate::protocol::{address::AztecAddress, traits::{FromField, ToField}};\n\n global SLOT: Field = 1;\n\n unconstrained fn setup() -> (TestEnvironment, AztecAddress) {\n let mut env = TestEnvironment::new();\n let scope = env.create_light_account();\n (env, scope)\n }\n\n #[test]\n unconstrained fn stores_and_loads() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n let value = MockStruct::new(5, 6);\n store(contract_address, SLOT, value, scope);\n\n assert_eq(load(contract_address, SLOT, scope).unwrap(), value);\n });\n }\n\n #[test]\n unconstrained fn store_overwrites() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n let value = MockStruct::new(5, 6);\n store(contract_address, SLOT, value, scope);\n\n let new_value = MockStruct::new(7, 8);\n store(contract_address, SLOT, new_value, scope);\n\n assert_eq(load(contract_address, SLOT, scope).unwrap(), new_value);\n });\n }\n\n #[test]\n unconstrained fn loads_empty_slot() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n let loaded_value: Option<MockStruct> = load(contract_address, SLOT, scope);\n assert_eq(loaded_value, Option::none());\n });\n }\n\n #[test]\n unconstrained fn deletes_stored_value() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n let value = MockStruct::new(5, 6);\n store(contract_address, SLOT, value, scope);\n delete(contract_address, SLOT, scope);\n\n let loaded_value: Option<MockStruct> = load(contract_address, SLOT, scope);\n assert_eq(loaded_value, Option::none());\n });\n }\n\n #[test]\n unconstrained fn deletes_empty_slot() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n delete(contract_address, SLOT, scope);\n let loaded_value: Option<MockStruct> = load(contract_address, SLOT, scope);\n assert_eq(loaded_value, Option::none());\n });\n }\n\n #[test]\n unconstrained fn copies_non_overlapping_values() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n let src = 5;\n\n let values = [MockStruct::new(5, 6), MockStruct::new(7, 8), MockStruct::new(9, 10)];\n store(contract_address, src, values[0], scope);\n store(contract_address, src + 1, values[1], scope);\n store(contract_address, src + 2, values[2], scope);\n\n let dst = 10;\n copy(contract_address, src, dst, 3, scope);\n\n assert_eq(load(contract_address, dst, scope).unwrap(), values[0]);\n assert_eq(load(contract_address, dst + 1, scope).unwrap(), values[1]);\n assert_eq(load(contract_address, dst + 2, scope).unwrap(), values[2]);\n });\n }\n\n #[test]\n unconstrained fn copies_overlapping_values_with_src_ahead() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n let src = 1;\n\n let values = [MockStruct::new(5, 6), MockStruct::new(7, 8), MockStruct::new(9, 10)];\n store(contract_address, src, values[0], scope);\n store(contract_address, src + 1, values[1], scope);\n store(contract_address, src + 2, values[2], scope);\n\n let dst = 2;\n copy(contract_address, src, dst, 3, scope);\n\n assert_eq(load(contract_address, dst, scope).unwrap(), values[0]);\n assert_eq(load(contract_address, dst + 1, scope).unwrap(), values[1]);\n assert_eq(load(contract_address, dst + 2, scope).unwrap(), values[2]);\n\n // src[1] and src[2] should have been overwritten since they are also dst[0] and dst[1]\n assert_eq(load(contract_address, src, scope).unwrap(), values[0]); // src[0] (unchanged)\n assert_eq(load(contract_address, src + 1, scope).unwrap(), values[0]); // dst[0]\n assert_eq(load(contract_address, src + 2, scope).unwrap(), values[1]); // dst[1]\n });\n }\n\n #[test]\n unconstrained fn copies_overlapping_values_with_dst_ahead() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n let src = 2;\n\n let values = [MockStruct::new(5, 6), MockStruct::new(7, 8), MockStruct::new(9, 10)];\n store(contract_address, src, values[0], scope);\n store(contract_address, src + 1, values[1], scope);\n store(contract_address, src + 2, values[2], scope);\n\n let dst = 1;\n copy(contract_address, src, dst, 3, scope);\n\n assert_eq(load(contract_address, dst, scope).unwrap(), values[0]);\n assert_eq(load(contract_address, dst + 1, scope).unwrap(), values[1]);\n assert_eq(load(contract_address, dst + 2, scope).unwrap(), values[2]);\n\n // src[0] and src[1] should have been overwritten since they are also dst[1] and dst[2]\n assert_eq(load(contract_address, src, scope).unwrap(), values[1]); // dst[1]\n assert_eq(load(contract_address, src + 1, scope).unwrap(), values[2]); // dst[2]\n assert_eq(load(contract_address, src + 2, scope).unwrap(), values[2]); // src[2] (unchanged)\n });\n }\n\n #[test(should_fail_with = \"copy empty slot\")]\n unconstrained fn cannot_copy_empty_values() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n copy(contract_address, SLOT, SLOT, 1, scope);\n });\n }\n\n #[test(should_fail_with = \"not allowed to access\")]\n unconstrained fn cannot_store_other_contract() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\n let other_contract_address = AztecAddress::from_field(contract_address.to_field() + 1);\n\n let value = MockStruct::new(5, 6);\n store(other_contract_address, SLOT, value, scope);\n });\n }\n\n #[test(should_fail_with = \"not allowed to access\")]\n unconstrained fn cannot_load_other_contract() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\n let other_contract_address = AztecAddress::from_field(contract_address.to_field() + 1);\n\n let _: Option<MockStruct> = load(other_contract_address, SLOT, scope);\n });\n }\n\n #[test(should_fail_with = \"not allowed to access\")]\n unconstrained fn cannot_delete_other_contract() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\n let other_contract_address = AztecAddress::from_field(contract_address.to_field() + 1);\n\n delete(other_contract_address, SLOT, scope);\n });\n }\n\n #[test(should_fail_with = \"not allowed to access\")]\n unconstrained fn cannot_copy_other_contract() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\n let other_contract_address = AztecAddress::from_field(contract_address.to_field() + 1);\n\n copy(other_contract_address, SLOT, SLOT, 0, scope);\n });\n }\n}\n"
1182
1202
  },
1183
- "190": {
1203
+ "191": {
1184
1204
  "function_locations": [
1185
1205
  {
1186
1206
  "name": "set_contract_sync_cache_invalid_oracle",
@@ -1194,7 +1214,7 @@
1194
1214
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/contract_sync.nr",
1195
1215
  "source": "use crate::protocol::address::AztecAddress;\n\n#[oracle(aztec_utl_setContractSyncCacheInvalid)]\nunconstrained fn set_contract_sync_cache_invalid_oracle<let N: u32>(\n contract_address: AztecAddress,\n scopes: BoundedVec<AztecAddress, N>,\n) {}\n\n/// Forces the PXE to re-sync the given contract for a set of scopes on the next query.\n///\n/// Call this after writing data (e.g. offchain messages) that the contract's `sync_state` function needs to discover.\n/// Without invalidation, the sync cache would skip re-running `sync_state` until the next block.\npub unconstrained fn set_contract_sync_cache_invalid<let N: u32>(\n contract_address: AztecAddress,\n scopes: BoundedVec<AztecAddress, N>,\n) {\n set_contract_sync_cache_invalid_oracle(contract_address, scopes);\n}\n"
1196
1216
  },
1197
- "192": {
1217
+ "193": {
1198
1218
  "function_locations": [
1199
1219
  {
1200
1220
  "name": "get_utility_context_oracle",
@@ -1208,7 +1228,7 @@
1208
1228
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/execution.nr",
1209
1229
  "source": "use crate::context::UtilityContext;\nuse crate::protocol::{abis::block_header::BlockHeader, address::AztecAddress};\n\n/// Wire shape of [`get_utility_context_oracle`]'s response. [`UtilityContext`] is built from it rather than returned\n/// directly so its fields stay private to its module.\n#[derive(Eq)]\npub(crate) struct UtilityContextData {\n pub(crate) block_header: BlockHeader,\n pub(crate) contract_address: AztecAddress,\n pub(crate) msg_sender: AztecAddress,\n}\n\n#[oracle(aztec_utl_getUtilityContext)]\nunconstrained fn get_utility_context_oracle() -> UtilityContextData {}\n\n/// Returns a utility context built from the global variables of anchor block and the contract address of the function\n/// being executed.\npub unconstrained fn get_utility_context() -> UtilityContext {\n UtilityContext::from(get_utility_context_oracle())\n}\n"
1210
1230
  },
1211
- "193": {
1231
+ "194": {
1212
1232
  "function_locations": [
1213
1233
  {
1214
1234
  "name": "store",
@@ -1234,7 +1254,7 @@
1234
1254
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/execution_cache.nr",
1235
1255
  "source": "/// Stores values represented as slice in execution cache to be later obtained by its hash.\n// TODO(F-498): review naming consistency\npub fn store<let N: u32>(values: [Field; N], hash: Field) {\n // Safety: This oracle call returns nothing: we only call it for its side effects. It is therefore always safe to\n // call. When loading the values, however, the caller must check that the values are indeed the preimage.\n unsafe { set_hash_preimage_oracle_wrapper(values, hash) };\n}\n\nunconstrained fn set_hash_preimage_oracle_wrapper<let N: u32>(values: [Field; N], hash: Field) {\n set_hash_preimage_oracle(values, hash);\n}\n\n// TODO(F-498): review naming consistency\npub unconstrained fn load<let N: u32>(hash: Field) -> [Field; N] {\n get_hash_preimage_oracle(hash)\n}\n\n#[oracle(aztec_prv_setHashPreimage)]\nunconstrained fn set_hash_preimage_oracle<let N: u32>(_values: [Field; N], _hash: Field) {}\n\n#[oracle(aztec_prv_getHashPreimage)]\nunconstrained fn get_hash_preimage_oracle<let N: u32>(_hash: Field) -> [Field; N] {}\n"
1236
1256
  },
1237
- "195": {
1257
+ "196": {
1238
1258
  "function_locations": [
1239
1259
  {
1240
1260
  "name": "get_contract_instance_oracle",
@@ -1300,7 +1320,7 @@
1300
1320
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/get_contract_instance.nr",
1301
1321
  "source": "use crate::protocol::{\n address::AztecAddress, contract_class_id::ContractClassId, contract_instance::ContractInstance, traits::FromField,\n};\n\n// NOTE: this is for use in private only\n#[oracle(aztec_utl_getContractInstance)]\nunconstrained fn get_contract_instance_oracle(_address: AztecAddress) -> ContractInstance {}\n\n// NOTE: this is for use in private only\nunconstrained fn get_contract_instance_internal(address: AztecAddress) -> ContractInstance {\n get_contract_instance_oracle(address)\n}\n\n/// Returns `address`'s [`ContractInstance`].\npub fn get_contract_instance(address: AztecAddress) -> ContractInstance {\n // Safety: The to_address function combines all values in the instance object to produce an address, so by checking\n // that we get the expected address we validate the entire struct.\n let instance = unsafe { get_contract_instance_internal(address) };\n assert_eq(instance.to_address(), address);\n\n instance\n}\n\n#[derive(Eq)]\npub(crate) struct GetContractInstanceResult {\n pub(crate) exists: bool,\n pub(crate) member: Field,\n}\n\n// These oracles each return a ContractInstance member plus a boolean indicating whether the instance was found.\n#[oracle(aztec_avm_getContractInstanceDeployer)]\nunconstrained fn get_contract_instance_deployer_oracle_avm(_address: AztecAddress) -> [GetContractInstanceResult; 1] {}\n#[oracle(aztec_avm_getContractInstanceClassId)]\nunconstrained fn get_contract_instance_current_class_id_oracle_avm(\n _address: AztecAddress,\n) -> [GetContractInstanceResult; 1] {}\n#[oracle(aztec_avm_getContractInstanceInitializationHash)]\nunconstrained fn get_contract_instance_initialization_hash_oracle_avm(\n _address: AztecAddress,\n) -> [GetContractInstanceResult; 1] {}\n#[oracle(aztec_avm_getContractInstanceImmutablesHash)]\nunconstrained fn get_contract_instance_immutables_hash_oracle_avm(\n _address: AztecAddress,\n) -> [GetContractInstanceResult; 1] {}\n\nunconstrained fn get_contract_instance_deployer_internal_avm(address: AztecAddress) -> [GetContractInstanceResult; 1] {\n get_contract_instance_deployer_oracle_avm(address)\n}\nunconstrained fn get_contract_instance_current_class_id_internal_avm(\n address: AztecAddress,\n) -> [GetContractInstanceResult; 1] {\n get_contract_instance_current_class_id_oracle_avm(address)\n}\nunconstrained fn get_contract_instance_initialization_hash_internal_avm(\n address: AztecAddress,\n) -> [GetContractInstanceResult; 1] {\n get_contract_instance_initialization_hash_oracle_avm(address)\n}\nunconstrained fn get_contract_instance_immutables_hash_internal_avm(\n address: AztecAddress,\n) -> [GetContractInstanceResult; 1] {\n get_contract_instance_immutables_hash_oracle_avm(address)\n}\n\npub fn get_contract_instance_deployer_avm(address: AztecAddress) -> Option<AztecAddress> {\n // Safety: AVM opcodes are constrained by the AVM itself\n let GetContractInstanceResult { exists, member } =\n unsafe { get_contract_instance_deployer_internal_avm(address)[0] };\n if exists {\n Option::some(AztecAddress::from_field(member))\n } else {\n Option::none()\n }\n}\n/// Returns `address` current contract class, or `Option::none` if unpublished.\n///\n/// The current contract class is the one that would be used to determine the code of the contract's functions if it\n/// were to be executed in this transaction. This is not necessarily the contract's original class if it has been\n/// upgraded via the `ContractInstanceRegistry`, and it could similarly change in the future.\npub fn get_contract_instance_current_class_id_avm(address: AztecAddress) -> Option<ContractClassId> {\n // Safety: AVM opcodes are constrained by the AVM itself\n let GetContractInstanceResult { exists, member } =\n unsafe { get_contract_instance_current_class_id_internal_avm(address)[0] };\n if exists {\n Option::some(ContractClassId::from_field(member))\n } else {\n Option::none()\n }\n}\npub fn get_contract_instance_initialization_hash_avm(address: AztecAddress) -> Option<Field> {\n // Safety: AVM opcodes are constrained by the AVM itself\n let GetContractInstanceResult { exists, member } =\n unsafe { get_contract_instance_initialization_hash_internal_avm(address)[0] };\n if exists {\n Option::some(member)\n } else {\n Option::none()\n }\n}\npub fn get_contract_instance_immutables_hash_avm(address: AztecAddress) -> Option<Field> {\n // Safety: AVM opcodes are constrained by the AVM itself\n let GetContractInstanceResult { exists, member } =\n unsafe { get_contract_instance_immutables_hash_internal_avm(address)[0] };\n if exists {\n Option::some(member)\n } else {\n Option::none()\n }\n}\n"
1302
1322
  },
1303
- "198": {
1323
+ "199": {
1304
1324
  "function_locations": [
1305
1325
  {
1306
1326
  "name": "get_low_nullifier_membership_witness_oracle",
@@ -1322,7 +1342,7 @@
1322
1342
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/get_nullifier_membership_witness.nr",
1323
1343
  "source": "use crate::protocol::{\n abis::{block_header::BlockHeader, nullifier_leaf_preimage::NullifierLeafPreimage},\n constants::NULLIFIER_TREE_HEIGHT,\n merkle_tree::MembershipWitness,\n traits::Hash,\n};\n\n#[oracle(aztec_utl_getLowNullifierMembershipWitness)]\nunconstrained fn get_low_nullifier_membership_witness_oracle(\n _block_hash: Field,\n _nullifier: Field,\n) -> (NullifierLeafPreimage, MembershipWitness<NULLIFIER_TREE_HEIGHT>) {}\n\n/// Returns a leaf preimage and membership witness for the low nullifier of `nullifier` in the nullifier tree whose\n/// root is defined in `block_header`.\n///\n/// The low nullifier is the leaf with the largest value that is still smaller than `nullifier`. This is used to prove\n/// non-inclusion: if the low nullifier's `next_value` is greater than `nullifier`, then `nullifier` is not in the\n/// tree.\npub unconstrained fn get_low_nullifier_membership_witness(\n block_header: BlockHeader,\n nullifier: Field,\n) -> (NullifierLeafPreimage, MembershipWitness<NULLIFIER_TREE_HEIGHT>) {\n let block_hash = block_header.hash();\n get_low_nullifier_membership_witness_oracle(block_hash, nullifier)\n}\n\n#[oracle(aztec_utl_getNullifierMembershipWitness)]\nunconstrained fn get_nullifier_membership_witness_oracle(\n _block_hash: Field,\n _nullifier: Field,\n) -> (NullifierLeafPreimage, MembershipWitness<NULLIFIER_TREE_HEIGHT>) {}\n\n/// Returns a leaf preimage and membership witness for `nullifier` in the nullifier tree whose root is defined in\n/// `block_header`.\n///\n/// This is used to prove that a nullifier exists in the tree (inclusion proof).\npub unconstrained fn get_nullifier_membership_witness(\n block_header: BlockHeader,\n nullifier: Field,\n) -> (NullifierLeafPreimage, MembershipWitness<NULLIFIER_TREE_HEIGHT>) {\n let block_hash = block_header.hash();\n get_nullifier_membership_witness_oracle(block_hash, nullifier)\n}\n"
1324
1344
  },
1325
- "206": {
1345
+ "207": {
1326
1346
  "function_locations": [
1327
1347
  {
1328
1348
  "name": "notify_created_nullifier",
@@ -1352,7 +1372,7 @@
1352
1372
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/nullifiers.nr",
1353
1373
  "source": "//! Nullifier creation, existence checks, etc.\n\nuse crate::protocol::address::aztec_address::AztecAddress;\n\n/// Notifies the simulator that a nullifier has been created, so that its correct status (pending or settled) can be\n/// determined when reading nullifiers in subsequent private function calls. The first non-revertible nullifier emitted\n/// is also used to compute note nonces.\npub fn notify_created_nullifier(inner_nullifier: Field) {\n // Safety: This oracle call returns nothing: we only call it for its side effects. It is therefore always safe to\n // call.\n unsafe { notify_created_nullifier_oracle(inner_nullifier) };\n}\n\n#[oracle(aztec_prv_notifyCreatedNullifier)]\nunconstrained fn notify_created_nullifier_oracle(_inner_nullifier: Field) {}\n\n/// Returns `true` if the nullifier has been emitted in the same transaction, i.e. if [`notify_created_nullifier`] has\n/// been\n/// called for this inner nullifier from the contract with the specified address.\n///\n/// Note that despite sharing pending transaction information with the app, this is not a privacy leak: anyone in the\n/// network can always determine in which transaction a inner nullifier was emitted by a given contract by simply\n/// inspecting transaction effects. What _would_ constitute a leak would be to share the list of inner pending\n/// nullifiers, as that would reveal their preimages.\npub unconstrained fn is_nullifier_pending(inner_nullifier: Field, contract_address: AztecAddress) -> bool {\n is_nullifier_pending_oracle(inner_nullifier, contract_address)\n}\n\n#[oracle(aztec_prv_isNullifierPending)]\nunconstrained fn is_nullifier_pending_oracle(_inner_nullifier: Field, _contract_address: AztecAddress) -> bool {}\n\n/// Returns `true` if the nullifier exists. Note that a `true` value can be constrained by proving existence of the\n/// nullifier, but a `false` value should not be relied upon since other transactions may emit this nullifier before\n/// the current transaction is included in a block. While this might seem of little use at first, certain design\n/// patterns benefit from this abstraction (see e.g. `PrivateMutable`).\n// TODO(F-498): review naming consistency\npub unconstrained fn check_nullifier_exists(inner_nullifier: Field) -> bool {\n does_nullifier_exist_oracle(inner_nullifier)\n}\n\n#[oracle(aztec_utl_doesNullifierExist)]\nunconstrained fn does_nullifier_exist_oracle(_inner_nullifier: Field) -> bool {}\n"
1354
1374
  },
1355
- "208": {
1375
+ "209": {
1356
1376
  "function_locations": [
1357
1377
  {
1358
1378
  "name": "assert_valid_public_call_data",
@@ -1370,7 +1390,7 @@
1370
1390
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/public_call.nr",
1371
1391
  "source": "/// Validates public calldata by checking that the preimage exists and the cumulative size is within limits.\n///\n/// The check is unconstrained and the only purpose of it is to fail early in case of calldata overflow or a bug in\n/// calldata hashing.\npub(crate) fn assert_valid_public_call_data(calldata_hash: Field) {\n // Safety: This oracle call returns nothing: we only call it for its side effects (validating the calldata).\n // It is therefore always safe to call.\n unsafe {\n assert_valid_public_call_data_oracle_wrapper(calldata_hash)\n }\n}\n\nunconstrained fn assert_valid_public_call_data_oracle_wrapper(calldata_hash: Field) {\n assert_valid_public_call_data_oracle(calldata_hash)\n}\n\n#[oracle(aztec_prv_assertValidPublicCalldata)]\nunconstrained fn assert_valid_public_call_data_oracle(_calldata_hash: Field) {}\n"
1372
1392
  },
1373
- "209": {
1393
+ "210": {
1374
1394
  "function_locations": [
1375
1395
  {
1376
1396
  "name": "random",
@@ -1384,7 +1404,7 @@
1384
1404
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/random.nr",
1385
1405
  "source": "/// Returns an unconstrained random value. Note that it is not possible to constrain this value to prove that it is\n/// truly random: we assume that the oracle is cooperating and returning random values. In some applications this\n/// behavior might not be acceptable and other techniques might be more suitable, such as producing pseudo-random\n/// values by hashing values outside of user control (like block hashes) or secrets.\npub unconstrained fn random() -> Field {\n rand_oracle()\n}\n\n#[oracle(aztec_misc_getRandomField)]\nunconstrained fn rand_oracle() -> Field {}\n"
1386
1406
  },
1387
- "215": {
1407
+ "216": {
1388
1408
  "function_locations": [
1389
1409
  {
1390
1410
  "name": "notify_revertible_phase_start",
@@ -1410,7 +1430,7 @@
1410
1430
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/tx_phase.nr",
1411
1431
  "source": "/// Notifies PXE of the side effect counter at which the revertible phase begins.\n///\n/// PXE uses it to classify notes and nullifiers as revertible or non-revertible in its note cache. This information is\n/// then fed to kernels as hints.\npub(crate) fn notify_revertible_phase_start(counter: u32) {\n // Safety: This oracle call returns nothing: we only call it for its side effects. It is therefore always safe to\n // call.\n unsafe { notify_revertible_phase_start_oracle_wrapper(counter) };\n}\n\n/// Returns whether a side effect counter falls in the revertible phase of the transaction.\npub(crate) unconstrained fn is_execution_in_revertible_phase(current_counter: u32) -> bool {\n is_execution_in_revertible_phase_oracle(current_counter)\n}\n\nunconstrained fn notify_revertible_phase_start_oracle_wrapper(counter: u32) {\n notify_revertible_phase_start_oracle(counter);\n}\n\n#[oracle(aztec_prv_notifyRevertiblePhaseStart)]\nunconstrained fn notify_revertible_phase_start_oracle(_counter: u32) {}\n\n#[oracle(aztec_prv_isExecutionInRevertiblePhase)]\nunconstrained fn is_execution_in_revertible_phase_oracle(current_counter: u32) -> bool {}\n"
1412
1432
  },
1413
- "217": {
1433
+ "218": {
1414
1434
  "function_locations": [
1415
1435
  {
1416
1436
  "name": "assert_compatible_oracle_version",
@@ -1434,9 +1454,9 @@
1434
1454
  }
1435
1455
  ],
1436
1456
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/version.nr",
1437
- "source": "/// The oracle version constants are used to check that the oracle interface is in sync between PXE and Aztec.nr.\n/// We version the oracle interface as `major.minor` where:\n/// - `major` = backward-breaking changes (must match exactly between PXE and Aztec.nr)\n/// - `minor` = oracle additions (non-breaking; PXE minor >= contract minor)\n///\n/// The TypeScript counterparts are in `oracle_version.ts`.\n///\n/// @dev Whenever a contract function or Noir test is run, the `aztec_misc_assertCompatibleOracleVersion` oracle is\n/// called. If the major version is incompatible, an error is thrown immediately. The minor version is recorded by\n/// the PXE and used to provide helpful error messages if a contract calls an oracle that doesn't exist. We don't throw\n/// immediately if AZTEC_NR_MINOR > PXE_MINOR because if a contract is updated to use a newer Aztec.nr dependency\n/// without actually using any of the new oracles then there is no reason to throw.\npub global ORACLE_VERSION_MAJOR: Field = 30;\npub global ORACLE_VERSION_MINOR: Field = 5;\n\n/// Asserts that the version of the oracle is compatible with the version expected by the contract.\npub fn assert_compatible_oracle_version() {\n // Safety: This oracle call returns nothing: we only call it to check Aztec.nr and Oracle interface versions are\n // compatible. It is therefore always safe to call.\n unsafe {\n assert_compatible_oracle_version_wrapper();\n }\n}\n\nunconstrained fn assert_compatible_oracle_version_wrapper() {\n assert_compatible_oracle_version_oracle(ORACLE_VERSION_MAJOR, ORACLE_VERSION_MINOR);\n}\n\n#[oracle(aztec_misc_assertCompatibleOracleVersion)]\nunconstrained fn assert_compatible_oracle_version_oracle(major: Field, minor: Field) {}\n\nmod test {\n use super::{assert_compatible_oracle_version_oracle, ORACLE_VERSION_MAJOR, ORACLE_VERSION_MINOR};\n\n #[test]\n unconstrained fn compatible_oracle_version() {\n assert_compatible_oracle_version_oracle(ORACLE_VERSION_MAJOR, ORACLE_VERSION_MINOR);\n }\n\n #[test(should_fail_with = \"Incompatible aztec cli version:\")]\n unconstrained fn incompatible_oracle_version_major() {\n let arbitrary_incorrect_major = 318183437;\n assert_compatible_oracle_version_oracle(arbitrary_incorrect_major, ORACLE_VERSION_MINOR);\n }\n}\n"
1457
+ "source": "/// The oracle version constants are used to check that the oracle interface is in sync between PXE and Aztec.nr.\n/// We version the oracle interface as `major.minor` where:\n/// - `major` = backward-breaking changes (must match exactly between PXE and Aztec.nr)\n/// - `minor` = oracle additions (non-breaking; PXE minor >= contract minor)\n///\n/// The TypeScript counterparts are in `oracle_version.ts`.\n///\n/// @dev Whenever a contract function or Noir test is run, the `aztec_misc_assertCompatibleOracleVersion` oracle is\n/// called. If the major version is incompatible, an error is thrown immediately. The minor version is recorded by\n/// the PXE and used to provide helpful error messages if a contract calls an oracle that doesn't exist. We don't throw\n/// immediately if AZTEC_NR_MINOR > PXE_MINOR because if a contract is updated to use a newer Aztec.nr dependency\n/// without actually using any of the new oracles then there is no reason to throw.\npub global ORACLE_VERSION_MAJOR: Field = 30;\npub global ORACLE_VERSION_MINOR: Field = 8;\n\n/// Asserts that the version of the oracle is compatible with the version expected by the contract.\npub fn assert_compatible_oracle_version() {\n // Safety: This oracle call returns nothing: we only call it to check Aztec.nr and Oracle interface versions are\n // compatible. It is therefore always safe to call.\n unsafe {\n assert_compatible_oracle_version_wrapper();\n }\n}\n\nunconstrained fn assert_compatible_oracle_version_wrapper() {\n assert_compatible_oracle_version_oracle(ORACLE_VERSION_MAJOR, ORACLE_VERSION_MINOR);\n}\n\n#[oracle(aztec_misc_assertCompatibleOracleVersion)]\nunconstrained fn assert_compatible_oracle_version_oracle(major: Field, minor: Field) {}\n\nmod test {\n use super::{assert_compatible_oracle_version_oracle, ORACLE_VERSION_MAJOR, ORACLE_VERSION_MINOR};\n\n #[test]\n unconstrained fn compatible_oracle_version() {\n assert_compatible_oracle_version_oracle(ORACLE_VERSION_MAJOR, ORACLE_VERSION_MINOR);\n }\n\n #[test(should_fail_with = \"Incompatible aztec cli version:\")]\n unconstrained fn incompatible_oracle_version_major() {\n let arbitrary_incorrect_major = 318183437;\n assert_compatible_oracle_version_oracle(arbitrary_incorrect_major, ORACLE_VERSION_MINOR);\n }\n}\n"
1438
1458
  },
1439
- "272": {
1459
+ "273": {
1440
1460
  "function_locations": [
1441
1461
  {
1442
1462
  "name": "UnconstrainedArray<T, Oracle>::at",
@@ -1506,7 +1526,7 @@
1506
1526
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/unconstrained_array/mod.nr",
1507
1527
  "source": "pub(crate) mod test_helpers;\npub(crate) mod test_suite;\n\nuse crate::oracle::random::random;\nuse crate::protocol::traits::{Deserialize, Serialize};\n\n/// Oracle backend for an [`UnconstrainedArray`]: the set of PXE-side operations that implement its storage.\n///\n/// Each implementor routes these operations to a distinct family of oracles, and the oracle family determines the\n/// array's lifetime and visibility (e.g. [`EphemeralArray`](crate::ephemeral::EphemeralArray) arrays live for one\n/// contract call frame, while [`TransientArray`](crate::transient::TransientArray) arrays are shared across all frames\n/// of the same contract within one top-level PXE call).\npub(crate) trait ArrayOracles {\n /// Returns the number of elements in the array at `slot`.\n unconstrained fn len_oracle(slot: Field) -> u32;\n\n /// Appends a serialized element to the array at `slot` and returns the new length.\n unconstrained fn push_oracle<let N: u32>(slot: Field, values: [Field; N]) -> u32;\n\n /// Removes and returns the last serialized element of the array at `slot`. Implementors must panic if the\n /// array is empty.\n unconstrained fn pop_oracle<let N: u32>(slot: Field) -> [Field; N];\n\n /// Returns the serialized element at the given index of the array at `slot`. Implementors must panic if `index`\n /// is out of bounds.\n unconstrained fn get_oracle<let N: u32>(slot: Field, index: u32) -> [Field; N];\n\n /// Overwrites the serialized element at the given index of the array at `slot`. Implementors must panic if\n /// `index` is out of bounds.\n unconstrained fn set_oracle<let N: u32>(slot: Field, index: u32, values: [Field; N]);\n\n /// Removes the element at the given index of the array at `slot`, shifting subsequent elements backward.\n /// Implementors must panic if `index` is out of bounds.\n unconstrained fn remove_oracle(slot: Field, index: u32);\n\n /// Removes all elements from the array at `slot`.\n unconstrained fn clear_oracle(slot: Field);\n}\n\n/// A dynamically sized array backed by PXE-side in-memory storage via an [`ArrayOracles`] backend.\n///\n/// Arrays are identified by a slot, and each logical operation (push, pop, get, etc.) is a single oracle call. The\n/// `Oracle` backend determines the array's lifetime and visibility; contracts should not use this type directly but\n/// rather one of its aliases: [`EphemeralArray`](crate::ephemeral::EphemeralArray) (scoped to a single contract call\n/// frame) or [`TransientArray`](crate::transient::TransientArray) (shared across all frames of the same contract\n/// within one top-level PXE call).\npub struct UnconstrainedArray<T, Oracle> {\n pub(crate) slot: Field,\n}\n\nimpl<T, Oracle> UnconstrainedArray<T, Oracle>\nwhere\n Oracle: ArrayOracles,\n{\n /// Returns a handle to the array at the given slot, which may already contain data (e.g. populated by an oracle\n /// or by an earlier frame, depending on the backend's visibility).\n pub unconstrained fn at(slot: Field) -> Self {\n Self { slot }\n }\n\n /// Returns an empty array at the given slot, clearing any pre-existing data.\n ///\n /// For backends whose arrays are visible beyond a single call frame (e.g. transient arrays), this wipes data\n /// other frames of the same contract may have written at the slot.\n pub unconstrained fn empty_at(slot: Field) -> Self {\n Self::at(slot).clear()\n }\n\n /// Returns an empty array at a fresh, randomly allocated slot.\n ///\n /// Use this when the caller does not need a specific slot: the random slot is isolated from every other array of\n /// the same backend with overwhelming probability. Prefer [`UnconstrainedArray::empty_at`] when the slot must be a\n /// known value (e.g. one shared with an oracle or another call frame).\n pub unconstrained fn empty() -> Self {\n Self::at(random())\n }\n\n /// Returns the number of elements stored in the array.\n pub unconstrained fn len(self) -> u32 {\n Oracle::len_oracle(self.slot)\n }\n\n /// Stores a value at the end of the array.\n pub unconstrained fn push(self, value: T)\n where\n T: Serialize,\n {\n let serialized = value.serialize();\n let _ = Oracle::push_oracle(self.slot, serialized);\n }\n\n /// Removes and returns the last element. Implementors are required to panic if the array is empty.\n pub unconstrained fn pop(self) -> T\n where\n T: Deserialize,\n {\n let serialized = Oracle::pop_oracle(self.slot);\n Deserialize::deserialize(serialized)\n }\n\n /// Retrieves the value stored at `index`. Implementors are required to panic if the index is out of bounds.\n pub unconstrained fn get(self, index: u32) -> T\n where\n T: Deserialize,\n {\n let serialized = Oracle::get_oracle(self.slot, index);\n Deserialize::deserialize(serialized)\n }\n\n /// Overwrites the value stored at `index`. Implementors are required to panic if the index is out of bounds.\n pub unconstrained fn set(self, index: u32, value: T)\n where\n T: Serialize,\n {\n let serialized = value.serialize();\n Oracle::set_oracle(self.slot, index, serialized);\n }\n\n /// Removes the element at `index`, shifting subsequent elements backward. Implementors are required to panic if\n /// the index is out of bounds.\n pub unconstrained fn remove(self, index: u32) {\n Oracle::remove_oracle(self.slot, index);\n }\n\n /// Removes all elements from the array and returns self for chaining.\n pub unconstrained fn clear(self) -> Self {\n Oracle::clear_oracle(self.slot);\n self\n }\n\n /// Calls a function on each element of the array.\n ///\n /// The function `f` is called once with each array value and its corresponding index, in order (from the first\n /// element to the last).\n ///\n /// Structurally mutating the array from inside the callback (e.g. via `push`, `pop`, `remove` or `clear`) is\n /// **not** supported: it can cause elements to be skipped, visited more than once, or read out of bounds.\n pub unconstrained fn for_each<Env>(self, f: unconstrained fn[Env](u32, T) -> ())\n where\n T: Deserialize,\n {\n let n = self.len();\n for i in 0..n {\n f(i, self.get(i));\n }\n }\n\n /// Applies `f` to every element and collects the results into a fresh array.\n pub unconstrained fn map<U, Env>(self, f: unconstrained fn[Env](T) -> U) -> UnconstrainedArray<U, Oracle>\n where\n T: Deserialize,\n U: Serialize,\n {\n let dest: UnconstrainedArray<U, Oracle> = UnconstrainedArray::empty();\n let n = self.len();\n for i in 0..n {\n dest.push(f(self.get(i)));\n }\n dest\n }\n\n /// Collects every element satisfying the predicate `f` into a fresh array.\n pub unconstrained fn filter<Env>(self, f: unconstrained fn[Env](T) -> bool) -> Self\n where\n T: Serialize + Deserialize,\n {\n let dest: Self = UnconstrainedArray::empty();\n let n = self.len();\n for i in 0..n {\n let value = self.get(i);\n if f(value) {\n dest.push(value);\n }\n }\n dest\n }\n\n /// Returns `true` if at least one element satisfies the predicate `f`.\n pub unconstrained fn any<Env>(self, f: unconstrained fn[Env](T) -> bool) -> bool\n where\n T: Serialize + Deserialize,\n {\n self.filter(f).len() != 0\n }\n\n /// Returns `true` if every element satisfies the predicate `f` (vacuously `true` for an empty array).\n pub unconstrained fn all<Env>(self, f: unconstrained fn[Env](T) -> bool) -> bool\n where\n T: Serialize + Deserialize,\n {\n self.filter(f).len() == self.len()\n }\n\n /// Returns the first element satisfying the predicate `f`, or `Option::none` if none do.\n pub unconstrained fn find<Env>(self, f: unconstrained fn[Env](T) -> bool) -> Option<T>\n where\n T: Deserialize,\n {\n let n = self.len();\n let mut result: Option<T> = Option::none();\n let mut i = 0;\n while (i < n) & result.is_none() {\n let value = self.get(i);\n if f(value) {\n result = Option::some(value);\n }\n i += 1;\n }\n result\n }\n}\n"
1508
1528
  },
1509
- "296": {
1529
+ "297": {
1510
1530
  "function_locations": [
1511
1531
  {
1512
1532
  "name": "Poseidon2::hash",
@@ -1558,175 +1578,171 @@
1558
1578
  "name": "[T; N]::as_vector",
1559
1579
  "start": 735
1560
1580
  },
1561
- {
1562
- "name": "[T; N]::as_slice",
1563
- "start": 1112
1564
- },
1565
1581
  {
1566
1582
  "name": "[T; N]::map",
1567
- "start": 1443
1583
+ "start": 1066
1568
1584
  },
1569
1585
  {
1570
1586
  "name": "[T; N]::mapi",
1571
- "start": 2004
1587
+ "start": 1627
1572
1588
  },
1573
1589
  {
1574
1590
  "name": "[T; N]::for_each",
1575
- "start": 2552
1591
+ "start": 2175
1576
1592
  },
1577
1593
  {
1578
1594
  "name": "[T; N]::for_eachi",
1579
- "start": 2970
1595
+ "start": 2593
1580
1596
  },
1581
1597
  {
1582
1598
  "name": "[T; N]::fold",
1583
- "start": 3837
1599
+ "start": 3460
1584
1600
  },
1585
1601
  {
1586
1602
  "name": "[T; N]::reduce",
1587
- "start": 4355
1603
+ "start": 3978
1588
1604
  },
1589
1605
  {
1590
1606
  "name": "[T; N]::all",
1591
- "start": 4865
1607
+ "start": 4488
1592
1608
  },
1593
1609
  {
1594
1610
  "name": "[T; N]::any",
1595
- "start": 5338
1611
+ "start": 4961
1596
1612
  },
1597
1613
  {
1598
1614
  "name": "[T; N]::concat",
1599
- "start": 5881
1615
+ "start": 5504
1600
1616
  },
1601
1617
  {
1602
1618
  "name": "[T; N]::sort",
1603
- "start": 6778
1619
+ "start": 6401
1604
1620
  },
1605
1621
  {
1606
1622
  "name": "[T; N]::sort_via",
1607
- "start": 7794
1623
+ "start": 7417
1608
1624
  },
1609
1625
  {
1610
1626
  "name": "[u8; N]::as_str_unchecked",
1611
- "start": 8944
1627
+ "start": 8567
1612
1628
  },
1613
1629
  {
1614
1630
  "name": "<impl From<str<N>> for [u8; N]>::from",
1615
- "start": 9071
1631
+ "start": 8694
1616
1632
  },
1617
1633
  {
1618
1634
  "name": "test::map_empty",
1619
- "start": 9145
1635
+ "start": 8768
1620
1636
  },
1621
1637
  {
1622
1638
  "name": "test::sort_u32",
1623
- "start": 10255
1639
+ "start": 9878
1624
1640
  },
1625
1641
  {
1626
1642
  "name": "test::test_sort",
1627
- "start": 10310
1643
+ "start": 9933
1628
1644
  },
1629
1645
  {
1630
1646
  "name": "test::test_sort_empty",
1631
- "start": 10536
1647
+ "start": 10159
1632
1648
  },
1633
1649
  {
1634
1650
  "name": "test::test_sort_via_empty",
1635
- "start": 10682
1651
+ "start": 10305
1636
1652
  },
1637
1653
  {
1638
1654
  "name": "test::test_sort_100_values",
1639
- "start": 10841
1655
+ "start": 10464
1640
1656
  },
1641
1657
  {
1642
1658
  "name": "test::test_sort_100_values_comptime",
1643
- "start": 12009
1659
+ "start": 11632
1644
1660
  },
1645
1661
  {
1646
1662
  "name": "test::test_sort_via",
1647
- "start": 12154
1663
+ "start": 11777
1648
1664
  },
1649
1665
  {
1650
1666
  "name": "test::test_sort_via_100_values",
1651
- "start": 12401
1667
+ "start": 12024
1652
1668
  },
1653
1669
  {
1654
1670
  "name": "test::mapi_empty",
1655
- "start": 13562
1671
+ "start": 13185
1656
1672
  },
1657
1673
  {
1658
1674
  "name": "test::for_each_empty",
1659
- "start": 13657
1675
+ "start": 13280
1660
1676
  },
1661
1677
  {
1662
1678
  "name": "test::for_eachi_empty",
1663
- "start": 13795
1679
+ "start": 13418
1664
1680
  },
1665
1681
  {
1666
1682
  "name": "test::map_example",
1667
- "start": 13934
1683
+ "start": 13557
1668
1684
  },
1669
1685
  {
1670
1686
  "name": "test::mapi_example",
1671
- "start": 14071
1687
+ "start": 13694
1672
1688
  },
1673
1689
  {
1674
1690
  "name": "test::for_each_example",
1675
- "start": 14220
1691
+ "start": 13843
1676
1692
  },
1677
1693
  {
1678
1694
  "name": "test::for_eachi_example",
1679
- "start": 14560
1695
+ "start": 14183
1680
1696
  },
1681
1697
  {
1682
1698
  "name": "test::concat",
1683
- "start": 14771
1699
+ "start": 14394
1684
1700
  },
1685
1701
  {
1686
1702
  "name": "test::concat_zero_length_with_something",
1687
- "start": 15030
1703
+ "start": 14653
1688
1704
  },
1689
1705
  {
1690
1706
  "name": "test::concat_something_with_zero_length",
1691
- "start": 15233
1707
+ "start": 14856
1692
1708
  },
1693
1709
  {
1694
1710
  "name": "test::concat_zero_lengths",
1695
- "start": 15422
1711
+ "start": 15045
1696
1712
  },
1697
1713
  {
1698
1714
  "name": "test::test_fold",
1699
- "start": 15623
1715
+ "start": 15246
1700
1716
  },
1701
1717
  {
1702
1718
  "name": "test::test_reduce",
1703
- "start": 15788
1719
+ "start": 15411
1704
1720
  },
1705
1721
  {
1706
1722
  "name": "test::test_reduce_failure_on_empty_array",
1707
- "start": 15999
1723
+ "start": 15622
1708
1724
  },
1709
1725
  {
1710
1726
  "name": "test::test_all",
1711
- "start": 16147
1727
+ "start": 15770
1712
1728
  },
1713
1729
  {
1714
1730
  "name": "test::test_any",
1715
- "start": 16296
1731
+ "start": 15919
1716
1732
  },
1717
1733
  {
1718
1734
  "name": "test::test_to_string",
1719
- "start": 16451
1735
+ "start": 16074
1720
1736
  },
1721
1737
  {
1722
1738
  "name": "test::test_bytes_from_string",
1723
- "start": 16597
1739
+ "start": 16220
1724
1740
  }
1725
1741
  ],
1726
1742
  "path": "std/array/mod.nr",
1727
- "source": "use crate::cmp::{Eq, Ord};\nuse crate::convert::From;\nuse crate::runtime::is_unconstrained;\n\nmod check_shuffle;\nmod quicksort;\n\nimpl<T, let N: u32> [T; N] {\n /// Returns the length of this array.\n ///\n /// ```noir\n /// fn len(self) -> Field\n /// ```\n ///\n /// example\n ///\n /// ```noir\n /// fn main() {\n /// let array = [42, 42];\n /// assert(array.len() == 2);\n /// }\n /// ```\n #[builtin(array_len)]\n pub fn len(self) -> u32 {}\n\n /// Returns this array as a vector.\n ///\n /// ```noir\n /// let array = [1, 2];\n /// let vector = array.as_vector();\n /// assert_eq(vector, [1, 2].as_vector());\n /// ```\n #[builtin(as_vector)]\n pub fn as_vector(self) -> [T] {}\n\n /// Returns this array as a vector.\n /// This method is deprecated in favor of `as_vector`.\n ///\n /// ```noir\n /// let array = [1, 2];\n /// let vector = array.as_slice();\n /// assert_eq(vector, [1, 2].as_vector());\n /// ```\n #[builtin(as_vector)]\n #[deprecated(\"This method has been renamed to `as_vector`\")]\n pub fn as_slice(self) -> [T] {}\n\n /// Applies a function to each element of this array, returning a new array containing the mapped elements.\n ///\n /// Example:\n ///\n /// ```rust\n /// let a = [1, 2, 3];\n /// let b = a.map(|a| a * 2);\n /// assert_eq(b, [2, 4, 6]);\n /// ```\n pub fn map<U, Env>(&self, f: fn[Env](T) -> U) -> [U; N] {\n let uninitialized = crate::mem::zeroed();\n let mut ret = [uninitialized; N];\n\n for i in 0..self.len() {\n ret[i] = f(self[i]);\n }\n\n ret\n }\n\n /// Applies a function to each element of this array along with its index,\n /// returning a new array containing the mapped elements.\n ///\n /// Example:\n ///\n /// ```rust\n /// let a = [1, 2, 3];\n /// let b = a.mapi(|i, a| i + a * 2);\n /// assert_eq(b, [2, 5, 8]);\n /// ```\n pub fn mapi<U, Env>(&self, f: fn[Env](u32, T) -> U) -> [U; N] {\n let uninitialized = crate::mem::zeroed();\n let mut ret = [uninitialized; N];\n\n for i in 0..self.len() {\n ret[i] = f(i, self[i]);\n }\n\n ret\n }\n\n /// Applies a function to each element of this array.\n ///\n /// Example:\n ///\n /// ```rust\n /// let a = [1, 2, 3];\n /// let mut b = [0; 3];\n /// let mut i = 0;\n /// a.for_each(|x| {\n /// b[i] = x;\n /// i += 1;\n /// });\n /// assert_eq(a, b);\n /// ```\n pub fn for_each<Env>(&self, f: fn[Env](T) -> ()) {\n for i in 0..self.len() {\n f(self[i]);\n }\n }\n\n /// Applies a function to each element of this array along with its index.\n ///\n /// Example:\n ///\n /// ```rust\n /// let a = [1, 2, 3];\n /// let mut b = [0; 3];\n /// a.for_eachi(|i, x| {\n /// b[i] = x;\n /// });\n /// assert_eq(a, b);\n /// ```\n pub fn for_eachi<Env>(&self, f: fn[Env](u32, T) -> ()) {\n for i in 0..self.len() {\n f(i, self[i]);\n }\n }\n\n /// Applies a function to each element of the array, returning the final accumulated value. The first\n /// parameter is the initial value.\n ///\n /// This is a left fold, so the given function will be applied to the accumulator and first element of\n /// the array, then the second, and so on. For a given call the expected result would be equivalent to:\n ///\n /// ```rust\n /// let a1 = [1];\n /// let a2 = [1, 2];\n /// let a3 = [1, 2, 3];\n ///\n /// let f = |a, b| a - b;\n /// a1.fold(10, f); //=> f(10, 1)\n /// a2.fold(10, f); //=> f(f(10, 1), 2)\n /// a3.fold(10, f); //=> f(f(f(10, 1), 2), 3)\n ///\n /// assert_eq(a3.fold(10, f), 10 - 1 - 2 - 3);\n /// ```\n pub fn fold<U, Env>(&self, mut accumulator: U, f: fn[Env](U, T) -> U) -> U {\n for elem in self {\n accumulator = f(accumulator, elem);\n }\n accumulator\n }\n\n /// Same as fold, but uses the first element as the starting element.\n ///\n /// Requires the input array to be non-empty.\n ///\n /// Example:\n ///\n /// ```noir\n /// fn main() {\n /// let arr = [1, 2, 3, 4];\n /// let reduced = arr.reduce(|a, b| a + b);\n /// assert(reduced == 10);\n /// }\n /// ```\n pub fn reduce<Env>(&self, f: fn[Env](T, T) -> T) -> T {\n let mut accumulator = self[0];\n for i in 1..self.len() {\n accumulator = f(accumulator, self[i]);\n }\n accumulator\n }\n\n /// Returns true if all the elements in this array satisfy the given predicate.\n ///\n /// Example:\n ///\n /// ```noir\n /// fn main() {\n /// let arr = [2, 2, 2, 2, 2];\n /// let all = arr.all(|a| a == 2);\n /// assert(all);\n /// }\n /// ```\n pub fn all<Env>(&self, predicate: fn[Env](T) -> bool) -> bool {\n let mut ret = true;\n for elem in self {\n ret &= predicate(elem);\n }\n ret\n }\n\n /// Returns true if any of the elements in this array satisfy the given predicate.\n ///\n /// Example:\n ///\n /// ```noir\n /// fn main() {\n /// let arr = [2, 2, 2, 2, 5];\n /// let any = arr.any(|a| a == 5);\n /// assert(any);\n /// }\n /// ```\n pub fn any<Env>(&self, predicate: fn[Env](T) -> bool) -> bool {\n let mut ret = false;\n for elem in self {\n ret |= predicate(elem);\n }\n ret\n }\n\n /// Concatenates this array with another array.\n ///\n /// Example:\n ///\n /// ```noir\n /// fn main() {\n /// let arr1 = [1, 2, 3, 4];\n /// let arr2 = [6, 7, 8, 9, 10, 11];\n /// let concatenated_arr = arr1.concat(arr2);\n /// assert(concatenated_arr == [1, 2, 3, 4, 6, 7, 8, 9, 10, 11]);\n /// }\n /// ```\n pub fn concat<let M: u32>(&self, array2: [T; M]) -> [T; N + M] {\n let mut result = [crate::mem::zeroed(); N + M];\n for i in 0..N {\n result[i] = self[i];\n }\n for i in 0..M {\n result[i + N] = array2[i];\n }\n result\n }\n}\n\nimpl<T, let N: u32> [T; N]\nwhere\n T: Ord + Eq,\n{\n /// Returns a new sorted array. The original array remains untouched. Notice that this function will\n /// only work for arrays of fields or integers, not for any arbitrary type. This is because the sorting\n /// logic it uses internally is optimized specifically for these values. If you need a sort function to\n /// sort any type, you should use the [`Self::sort_via`] function.\n ///\n /// Example:\n ///\n /// ```rust\n /// fn main() {\n /// let arr = [42, 32];\n /// let sorted = arr.sort();\n /// assert(sorted == [32, 42]);\n /// }\n /// ```\n pub fn sort(&self) -> Self {\n self.sort_via(|a, b| a <= b)\n }\n}\n\nimpl<T, let N: u32> [T; N]\nwhere\n T: Eq,\n{\n /// Returns a new sorted array by sorting it with a custom comparison function.\n /// The original array remains untouched.\n /// The ordering function must return true if the first argument should be sorted to be before the second argument or is equal to the second argument.\n ///\n /// Using this method with an operator like `<` that does not return `true` for equal values will result in an assertion failure for arrays with equal elements.\n ///\n /// Example:\n ///\n /// ```rust\n /// fn main() {\n /// let arr = [42, 32]\n /// let sorted_ascending = arr.sort_via(|a, b| a <= b);\n /// assert(sorted_ascending == [32, 42]); // verifies\n ///\n /// let sorted_descending = arr.sort_via(|a, b| a >= b);\n /// assert(sorted_descending == [32, 42]); // does not verify\n /// }\n /// ```\n pub fn sort_via<Env>(&self, ordering: fn[Env](T, T) -> bool) -> Self {\n if N != 0 {\n // Safety: `sorted` array is checked to be:\n // a. a permutation of `input`'s elements\n // b. satisfying the predicate `ordering`\n let sorted = unsafe { quicksort::quicksort(self, ordering) };\n\n if !is_unconstrained() {\n for i in 0..N - 1 {\n assert(\n ordering(sorted[i], sorted[i + 1]),\n \"Array has not been sorted correctly according to `ordering`.\",\n );\n }\n check_shuffle::check_shuffle(self, &sorted);\n }\n sorted\n } else {\n *self\n }\n }\n}\n\nimpl<let N: u32> [u8; N] {\n /// Converts a byte array of type `[u8; N]` to a string. Note that this performs no UTF-8 validation -\n /// the given array is interpreted as-is as a string.\n ///\n /// Example:\n ///\n /// ```rust\n /// fn main() {\n /// let hi = [104, 105].as_str_unchecked();\n /// assert_eq(hi, \"hi\");\n /// }\n /// ```\n #[builtin(array_as_str_unchecked)]\n pub fn as_str_unchecked(self) -> str<N> {}\n}\n\nimpl<let N: u32> From<str<N>> for [u8; N] {\n /// Returns an array of the string bytes.\n fn from(s: str<N>) -> Self {\n s.as_bytes()\n }\n}\n\nmod test {\n #[test]\n fn map_empty() {\n assert_eq([].map(|x| x + 1), []);\n }\n\n global arr_with_100_values: [u32; 100] = [\n 42, 123, 87, 93, 48, 80, 50, 5, 104, 84, 70, 47, 119, 66, 71, 121, 3, 29, 42, 118, 2, 54,\n 89, 44, 81, 0, 26, 106, 68, 96, 84, 48, 95, 54, 45, 32, 89, 100, 109, 19, 37, 41, 19, 98,\n 53, 114, 107, 66, 6, 74, 13, 19, 105, 64, 123, 28, 44, 50, 89, 58, 123, 126, 21, 43, 86, 35,\n 21, 62, 82, 0, 108, 120, 72, 72, 62, 80, 12, 71, 70, 86, 116, 73, 38, 15, 127, 81, 30, 8,\n 125, 28, 26, 69, 114, 63, 27, 28, 61, 42, 13, 32,\n ];\n global expected_with_100_values: [u32; 100] = [\n 0, 0, 2, 3, 5, 6, 8, 12, 13, 13, 15, 19, 19, 19, 21, 21, 26, 26, 27, 28, 28, 28, 29, 30, 32,\n 32, 35, 37, 38, 41, 42, 42, 42, 43, 44, 44, 45, 47, 48, 48, 50, 50, 53, 54, 54, 58, 61, 62,\n 62, 63, 64, 66, 66, 68, 69, 70, 70, 71, 71, 72, 72, 73, 74, 80, 80, 81, 81, 82, 84, 84, 86,\n 86, 87, 89, 89, 89, 93, 95, 96, 98, 100, 104, 105, 106, 107, 108, 109, 114, 114, 116, 118,\n 119, 120, 121, 123, 123, 123, 125, 126, 127,\n ];\n fn sort_u32(a: u32, b: u32) -> bool {\n a <= b\n }\n\n #[test]\n fn test_sort() {\n let arr: [u32; 7] = [3, 6, 8, 10, 1, 2, 1];\n\n let sorted = arr.sort();\n\n let expected: [u32; 7] = [1, 1, 2, 3, 6, 8, 10];\n assert(sorted == expected);\n }\n\n #[test]\n fn test_sort_empty() {\n let arr: [u32; 0] = [];\n let sorted = arr.sort();\n assert(sorted == arr);\n }\n\n #[test]\n fn test_sort_via_empty() {\n let arr: [u32; 0] = [];\n let sorted = arr.sort_via(sort_u32);\n assert(sorted == arr);\n }\n\n #[test]\n fn test_sort_100_values() {\n let arr: [u32; 100] = [\n 42, 123, 87, 93, 48, 80, 50, 5, 104, 84, 70, 47, 119, 66, 71, 121, 3, 29, 42, 118, 2,\n 54, 89, 44, 81, 0, 26, 106, 68, 96, 84, 48, 95, 54, 45, 32, 89, 100, 109, 19, 37, 41,\n 19, 98, 53, 114, 107, 66, 6, 74, 13, 19, 105, 64, 123, 28, 44, 50, 89, 58, 123, 126, 21,\n 43, 86, 35, 21, 62, 82, 0, 108, 120, 72, 72, 62, 80, 12, 71, 70, 86, 116, 73, 38, 15,\n 127, 81, 30, 8, 125, 28, 26, 69, 114, 63, 27, 28, 61, 42, 13, 32,\n ];\n\n let sorted = arr.sort();\n\n let expected: [u32; 100] = [\n 0, 0, 2, 3, 5, 6, 8, 12, 13, 13, 15, 19, 19, 19, 21, 21, 26, 26, 27, 28, 28, 28, 29, 30,\n 32, 32, 35, 37, 38, 41, 42, 42, 42, 43, 44, 44, 45, 47, 48, 48, 50, 50, 53, 54, 54, 58,\n 61, 62, 62, 63, 64, 66, 66, 68, 69, 70, 70, 71, 71, 72, 72, 73, 74, 80, 80, 81, 81, 82,\n 84, 84, 86, 86, 87, 89, 89, 89, 93, 95, 96, 98, 100, 104, 105, 106, 107, 108, 109, 114,\n 114, 116, 118, 119, 120, 121, 123, 123, 123, 125, 126, 127,\n ];\n assert(sorted == expected);\n }\n\n #[test]\n fn test_sort_100_values_comptime() {\n let sorted = arr_with_100_values.sort();\n assert(sorted == expected_with_100_values);\n }\n\n #[test]\n fn test_sort_via() {\n let arr: [u32; 7] = [3, 6, 8, 10, 1, 2, 1];\n\n let sorted = arr.sort_via(sort_u32);\n\n let expected: [u32; 7] = [1, 1, 2, 3, 6, 8, 10];\n assert(sorted == expected);\n }\n\n #[test]\n fn test_sort_via_100_values() {\n let arr: [u32; 100] = [\n 42, 123, 87, 93, 48, 80, 50, 5, 104, 84, 70, 47, 119, 66, 71, 121, 3, 29, 42, 118, 2,\n 54, 89, 44, 81, 0, 26, 106, 68, 96, 84, 48, 95, 54, 45, 32, 89, 100, 109, 19, 37, 41,\n 19, 98, 53, 114, 107, 66, 6, 74, 13, 19, 105, 64, 123, 28, 44, 50, 89, 58, 123, 126, 21,\n 43, 86, 35, 21, 62, 82, 0, 108, 120, 72, 72, 62, 80, 12, 71, 70, 86, 116, 73, 38, 15,\n 127, 81, 30, 8, 125, 28, 26, 69, 114, 63, 27, 28, 61, 42, 13, 32,\n ];\n\n let sorted = arr.sort_via(sort_u32);\n\n let expected: [u32; 100] = [\n 0, 0, 2, 3, 5, 6, 8, 12, 13, 13, 15, 19, 19, 19, 21, 21, 26, 26, 27, 28, 28, 28, 29, 30,\n 32, 32, 35, 37, 38, 41, 42, 42, 42, 43, 44, 44, 45, 47, 48, 48, 50, 50, 53, 54, 54, 58,\n 61, 62, 62, 63, 64, 66, 66, 68, 69, 70, 70, 71, 71, 72, 72, 73, 74, 80, 80, 81, 81, 82,\n 84, 84, 86, 86, 87, 89, 89, 89, 93, 95, 96, 98, 100, 104, 105, 106, 107, 108, 109, 114,\n 114, 116, 118, 119, 120, 121, 123, 123, 123, 125, 126, 127,\n ];\n assert(sorted == expected);\n }\n\n #[test]\n fn mapi_empty() {\n assert_eq([].mapi(|i, x| i * x + 1), []);\n }\n\n #[test]\n fn for_each_empty() {\n let empty_array: [Field; 0] = [];\n empty_array.for_each(|_x| assert(false));\n }\n\n #[test]\n fn for_eachi_empty() {\n let empty_array: [Field; 0] = [];\n empty_array.for_eachi(|_i, _x| assert(false));\n }\n\n #[test]\n fn map_example() {\n let a = [1, 2, 3];\n let b = a.map(|a| a * 2);\n assert_eq(b, [2, 4, 6]);\n }\n\n #[test]\n fn mapi_example() {\n let a = [1, 2, 3];\n let b = a.mapi(|i, a| i + a * 2);\n assert_eq(b, [2, 5, 8]);\n }\n\n #[test]\n fn for_each_example() {\n let a = [1, 2, 3];\n let mut b = [0, 0, 0];\n let b_ref = &mut b;\n let mut i = 0;\n let i_ref = &mut i;\n a.for_each(|x| {\n b_ref[*i_ref] = x * 2;\n *i_ref += 1;\n });\n assert_eq(b, [2, 4, 6]);\n assert_eq(i, 3);\n }\n\n #[test]\n fn for_eachi_example() {\n let a = [1, 2, 3];\n let mut b = [0, 0, 0];\n let b_ref = &mut b;\n a.for_eachi(|i, a| { b_ref[i] = i + a * 2; });\n assert_eq(b, [2, 5, 8]);\n }\n\n #[test]\n fn concat() {\n let arr1 = [1, 2, 3, 4];\n let arr2 = [6, 7, 8, 9, 10, 11];\n let concatenated_arr = arr1.concat(arr2);\n assert_eq(concatenated_arr, [1, 2, 3, 4, 6, 7, 8, 9, 10, 11]);\n }\n\n #[test]\n fn concat_zero_length_with_something() {\n let arr1 = [];\n let arr2 = [1];\n let concatenated_arr = arr1.concat(arr2);\n assert_eq(concatenated_arr, [1]);\n }\n\n #[test]\n fn concat_something_with_zero_length() {\n let arr1 = [1];\n let arr2 = [];\n let concatenated_arr = arr1.concat(arr2);\n assert_eq(concatenated_arr, [1]);\n }\n\n #[test]\n fn concat_zero_lengths() {\n let arr1: [Field; 0] = [];\n let arr2: [Field; 0] = [];\n let concatenated_arr = arr1.concat(arr2);\n assert_eq(concatenated_arr, []);\n }\n\n #[test]\n fn test_fold() {\n let array = [1, 2, 3];\n let sum_plus_10 = array.fold(10, |x, y| x + y);\n assert_eq(sum_plus_10, 16);\n }\n\n #[test]\n fn test_reduce() {\n let array = [1, 2, 3];\n let sum = array.reduce(|x, y| x + y);\n assert_eq(sum, 6);\n }\n\n #[test(should_fail_with = \"Index out of bounds\")]\n fn test_reduce_failure_on_empty_array() {\n let array: [Field; 0] = [];\n let sum = array.reduce(|x, y| x + y);\n assert_eq(sum, 6);\n }\n\n #[test]\n fn test_all() {\n let array = [1, 2, 3];\n assert(array.all(|x| x >= 1));\n assert(!array.all(|x| x >= 2));\n }\n\n #[test]\n fn test_any() {\n let array = [1, 2, 3];\n assert(array.any(|x| x >= 3));\n assert(!array.any(|x| x >= 4));\n }\n\n #[test]\n fn test_to_string() {\n let str = [78_u8, 111, 105, 114].as_str_unchecked();\n assert_eq(str, \"Noir\");\n }\n\n #[test]\n fn test_bytes_from_string() {\n let bytes: [u8; 4] = crate::convert::From::from(\"Noir\");\n assert_eq(bytes, [78_u8, 111, 105, 114]);\n }\n}\n"
1743
+ "source": "use crate::cmp::{Eq, Ord};\nuse crate::convert::From;\nuse crate::runtime::is_unconstrained;\n\nmod check_shuffle;\nmod quicksort;\n\nimpl<T, let N: u32> [T; N] {\n /// Returns the length of this array.\n ///\n /// ```noir\n /// fn len(self) -> Field\n /// ```\n ///\n /// example\n ///\n /// ```noir\n /// fn main() {\n /// let array = [42, 42];\n /// assert(array.len() == 2);\n /// }\n /// ```\n #[builtin(array_len)]\n pub fn len(self) -> u32 {}\n\n /// Returns this array as a vector.\n ///\n /// ```noir\n /// let array = [1, 2];\n /// let vector = array.as_vector();\n /// assert_eq(vector, [1, 2].as_vector());\n /// ```\n #[builtin(as_vector)]\n pub fn as_vector(self) -> [T] {}\n\n /// Applies a function to each element of this array, returning a new array containing the mapped elements.\n ///\n /// Example:\n ///\n /// ```rust\n /// let a = [1, 2, 3];\n /// let b = a.map(|a| a * 2);\n /// assert_eq(b, [2, 4, 6]);\n /// ```\n pub fn map<U, Env>(&self, f: fn[Env](T) -> U) -> [U; N] {\n let uninitialized = crate::mem::zeroed();\n let mut ret = [uninitialized; N];\n\n for i in 0..self.len() {\n ret[i] = f(self[i]);\n }\n\n ret\n }\n\n /// Applies a function to each element of this array along with its index,\n /// returning a new array containing the mapped elements.\n ///\n /// Example:\n ///\n /// ```rust\n /// let a = [1, 2, 3];\n /// let b = a.mapi(|i, a| i + a * 2);\n /// assert_eq(b, [2, 5, 8]);\n /// ```\n pub fn mapi<U, Env>(&self, f: fn[Env](u32, T) -> U) -> [U; N] {\n let uninitialized = crate::mem::zeroed();\n let mut ret = [uninitialized; N];\n\n for i in 0..self.len() {\n ret[i] = f(i, self[i]);\n }\n\n ret\n }\n\n /// Applies a function to each element of this array.\n ///\n /// Example:\n ///\n /// ```rust\n /// let a = [1, 2, 3];\n /// let mut b = [0; 3];\n /// let mut i = 0;\n /// a.for_each(|x| {\n /// b[i] = x;\n /// i += 1;\n /// });\n /// assert_eq(a, b);\n /// ```\n pub fn for_each<Env>(&self, f: fn[Env](T) -> ()) {\n for i in 0..self.len() {\n f(self[i]);\n }\n }\n\n /// Applies a function to each element of this array along with its index.\n ///\n /// Example:\n ///\n /// ```rust\n /// let a = [1, 2, 3];\n /// let mut b = [0; 3];\n /// a.for_eachi(|i, x| {\n /// b[i] = x;\n /// });\n /// assert_eq(a, b);\n /// ```\n pub fn for_eachi<Env>(&self, f: fn[Env](u32, T) -> ()) {\n for i in 0..self.len() {\n f(i, self[i]);\n }\n }\n\n /// Applies a function to each element of the array, returning the final accumulated value. The first\n /// parameter is the initial value.\n ///\n /// This is a left fold, so the given function will be applied to the accumulator and first element of\n /// the array, then the second, and so on. For a given call the expected result would be equivalent to:\n ///\n /// ```rust\n /// let a1 = [1];\n /// let a2 = [1, 2];\n /// let a3 = [1, 2, 3];\n ///\n /// let f = |a, b| a - b;\n /// a1.fold(10, f); //=> f(10, 1)\n /// a2.fold(10, f); //=> f(f(10, 1), 2)\n /// a3.fold(10, f); //=> f(f(f(10, 1), 2), 3)\n ///\n /// assert_eq(a3.fold(10, f), 10 - 1 - 2 - 3);\n /// ```\n pub fn fold<U, Env>(&self, mut accumulator: U, f: fn[Env](U, T) -> U) -> U {\n for elem in self {\n accumulator = f(accumulator, elem);\n }\n accumulator\n }\n\n /// Same as fold, but uses the first element as the starting element.\n ///\n /// Requires the input array to be non-empty.\n ///\n /// Example:\n ///\n /// ```noir\n /// fn main() {\n /// let arr = [1, 2, 3, 4];\n /// let reduced = arr.reduce(|a, b| a + b);\n /// assert(reduced == 10);\n /// }\n /// ```\n pub fn reduce<Env>(&self, f: fn[Env](T, T) -> T) -> T {\n let mut accumulator = self[0];\n for i in 1..self.len() {\n accumulator = f(accumulator, self[i]);\n }\n accumulator\n }\n\n /// Returns true if all the elements in this array satisfy the given predicate.\n ///\n /// Example:\n ///\n /// ```noir\n /// fn main() {\n /// let arr = [2, 2, 2, 2, 2];\n /// let all = arr.all(|a| a == 2);\n /// assert(all);\n /// }\n /// ```\n pub fn all<Env>(&self, predicate: fn[Env](T) -> bool) -> bool {\n let mut ret = true;\n for elem in self {\n ret &= predicate(elem);\n }\n ret\n }\n\n /// Returns true if any of the elements in this array satisfy the given predicate.\n ///\n /// Example:\n ///\n /// ```noir\n /// fn main() {\n /// let arr = [2, 2, 2, 2, 5];\n /// let any = arr.any(|a| a == 5);\n /// assert(any);\n /// }\n /// ```\n pub fn any<Env>(&self, predicate: fn[Env](T) -> bool) -> bool {\n let mut ret = false;\n for elem in self {\n ret |= predicate(elem);\n }\n ret\n }\n\n /// Concatenates this array with another array.\n ///\n /// Example:\n ///\n /// ```noir\n /// fn main() {\n /// let arr1 = [1, 2, 3, 4];\n /// let arr2 = [6, 7, 8, 9, 10, 11];\n /// let concatenated_arr = arr1.concat(arr2);\n /// assert(concatenated_arr == [1, 2, 3, 4, 6, 7, 8, 9, 10, 11]);\n /// }\n /// ```\n pub fn concat<let M: u32>(&self, array2: [T; M]) -> [T; N + M] {\n let mut result = [crate::mem::zeroed(); N + M];\n for i in 0..N {\n result[i] = self[i];\n }\n for i in 0..M {\n result[i + N] = array2[i];\n }\n result\n }\n}\n\nimpl<T, let N: u32> [T; N]\nwhere\n T: Ord + Eq,\n{\n /// Returns a new sorted array. The original array remains untouched. Notice that this function will\n /// only work for arrays of fields or integers, not for any arbitrary type. This is because the sorting\n /// logic it uses internally is optimized specifically for these values. If you need a sort function to\n /// sort any type, you should use the [`Self::sort_via`] function.\n ///\n /// Example:\n ///\n /// ```rust\n /// fn main() {\n /// let arr = [42, 32];\n /// let sorted = arr.sort();\n /// assert(sorted == [32, 42]);\n /// }\n /// ```\n pub fn sort(&self) -> Self {\n self.sort_via(|a, b| a <= b)\n }\n}\n\nimpl<T, let N: u32> [T; N]\nwhere\n T: Eq,\n{\n /// Returns a new sorted array by sorting it with a custom comparison function.\n /// The original array remains untouched.\n /// The ordering function must return true if the first argument should be sorted to be before the second argument or is equal to the second argument.\n ///\n /// Using this method with an operator like `<` that does not return `true` for equal values will result in an assertion failure for arrays with equal elements.\n ///\n /// Example:\n ///\n /// ```rust\n /// fn main() {\n /// let arr = [42, 32]\n /// let sorted_ascending = arr.sort_via(|a, b| a <= b);\n /// assert(sorted_ascending == [32, 42]); // verifies\n ///\n /// let sorted_descending = arr.sort_via(|a, b| a >= b);\n /// assert(sorted_descending == [32, 42]); // does not verify\n /// }\n /// ```\n pub fn sort_via<Env>(&self, ordering: fn[Env](T, T) -> bool) -> Self {\n if N != 0 {\n // Safety: `sorted` array is checked to be:\n // a. a permutation of `input`'s elements\n // b. satisfying the predicate `ordering`\n let sorted = unsafe { quicksort::quicksort(self, ordering) };\n\n if !is_unconstrained() {\n for i in 0..N - 1 {\n assert(\n ordering(sorted[i], sorted[i + 1]),\n \"Array has not been sorted correctly according to `ordering`.\",\n );\n }\n check_shuffle::check_shuffle(self, &sorted);\n }\n sorted\n } else {\n *self\n }\n }\n}\n\nimpl<let N: u32> [u8; N] {\n /// Converts a byte array of type `[u8; N]` to a string. Note that this performs no UTF-8 validation -\n /// the given array is interpreted as-is as a string.\n ///\n /// Example:\n ///\n /// ```rust\n /// fn main() {\n /// let hi = [104, 105].as_str_unchecked();\n /// assert_eq(hi, \"hi\");\n /// }\n /// ```\n #[builtin(array_as_str_unchecked)]\n pub fn as_str_unchecked(self) -> str<N> {}\n}\n\nimpl<let N: u32> From<str<N>> for [u8; N] {\n /// Returns an array of the string bytes.\n fn from(s: str<N>) -> Self {\n s.as_bytes()\n }\n}\n\nmod test {\n #[test]\n fn map_empty() {\n assert_eq([].map(|x| x + 1), []);\n }\n\n global arr_with_100_values: [u32; 100] = [\n 42, 123, 87, 93, 48, 80, 50, 5, 104, 84, 70, 47, 119, 66, 71, 121, 3, 29, 42, 118, 2, 54,\n 89, 44, 81, 0, 26, 106, 68, 96, 84, 48, 95, 54, 45, 32, 89, 100, 109, 19, 37, 41, 19, 98,\n 53, 114, 107, 66, 6, 74, 13, 19, 105, 64, 123, 28, 44, 50, 89, 58, 123, 126, 21, 43, 86, 35,\n 21, 62, 82, 0, 108, 120, 72, 72, 62, 80, 12, 71, 70, 86, 116, 73, 38, 15, 127, 81, 30, 8,\n 125, 28, 26, 69, 114, 63, 27, 28, 61, 42, 13, 32,\n ];\n global expected_with_100_values: [u32; 100] = [\n 0, 0, 2, 3, 5, 6, 8, 12, 13, 13, 15, 19, 19, 19, 21, 21, 26, 26, 27, 28, 28, 28, 29, 30, 32,\n 32, 35, 37, 38, 41, 42, 42, 42, 43, 44, 44, 45, 47, 48, 48, 50, 50, 53, 54, 54, 58, 61, 62,\n 62, 63, 64, 66, 66, 68, 69, 70, 70, 71, 71, 72, 72, 73, 74, 80, 80, 81, 81, 82, 84, 84, 86,\n 86, 87, 89, 89, 89, 93, 95, 96, 98, 100, 104, 105, 106, 107, 108, 109, 114, 114, 116, 118,\n 119, 120, 121, 123, 123, 123, 125, 126, 127,\n ];\n fn sort_u32(a: u32, b: u32) -> bool {\n a <= b\n }\n\n #[test]\n fn test_sort() {\n let arr: [u32; 7] = [3, 6, 8, 10, 1, 2, 1];\n\n let sorted = arr.sort();\n\n let expected: [u32; 7] = [1, 1, 2, 3, 6, 8, 10];\n assert(sorted == expected);\n }\n\n #[test]\n fn test_sort_empty() {\n let arr: [u32; 0] = [];\n let sorted = arr.sort();\n assert(sorted == arr);\n }\n\n #[test]\n fn test_sort_via_empty() {\n let arr: [u32; 0] = [];\n let sorted = arr.sort_via(sort_u32);\n assert(sorted == arr);\n }\n\n #[test]\n fn test_sort_100_values() {\n let arr: [u32; 100] = [\n 42, 123, 87, 93, 48, 80, 50, 5, 104, 84, 70, 47, 119, 66, 71, 121, 3, 29, 42, 118, 2,\n 54, 89, 44, 81, 0, 26, 106, 68, 96, 84, 48, 95, 54, 45, 32, 89, 100, 109, 19, 37, 41,\n 19, 98, 53, 114, 107, 66, 6, 74, 13, 19, 105, 64, 123, 28, 44, 50, 89, 58, 123, 126, 21,\n 43, 86, 35, 21, 62, 82, 0, 108, 120, 72, 72, 62, 80, 12, 71, 70, 86, 116, 73, 38, 15,\n 127, 81, 30, 8, 125, 28, 26, 69, 114, 63, 27, 28, 61, 42, 13, 32,\n ];\n\n let sorted = arr.sort();\n\n let expected: [u32; 100] = [\n 0, 0, 2, 3, 5, 6, 8, 12, 13, 13, 15, 19, 19, 19, 21, 21, 26, 26, 27, 28, 28, 28, 29, 30,\n 32, 32, 35, 37, 38, 41, 42, 42, 42, 43, 44, 44, 45, 47, 48, 48, 50, 50, 53, 54, 54, 58,\n 61, 62, 62, 63, 64, 66, 66, 68, 69, 70, 70, 71, 71, 72, 72, 73, 74, 80, 80, 81, 81, 82,\n 84, 84, 86, 86, 87, 89, 89, 89, 93, 95, 96, 98, 100, 104, 105, 106, 107, 108, 109, 114,\n 114, 116, 118, 119, 120, 121, 123, 123, 123, 125, 126, 127,\n ];\n assert(sorted == expected);\n }\n\n #[test]\n fn test_sort_100_values_comptime() {\n let sorted = arr_with_100_values.sort();\n assert(sorted == expected_with_100_values);\n }\n\n #[test]\n fn test_sort_via() {\n let arr: [u32; 7] = [3, 6, 8, 10, 1, 2, 1];\n\n let sorted = arr.sort_via(sort_u32);\n\n let expected: [u32; 7] = [1, 1, 2, 3, 6, 8, 10];\n assert(sorted == expected);\n }\n\n #[test]\n fn test_sort_via_100_values() {\n let arr: [u32; 100] = [\n 42, 123, 87, 93, 48, 80, 50, 5, 104, 84, 70, 47, 119, 66, 71, 121, 3, 29, 42, 118, 2,\n 54, 89, 44, 81, 0, 26, 106, 68, 96, 84, 48, 95, 54, 45, 32, 89, 100, 109, 19, 37, 41,\n 19, 98, 53, 114, 107, 66, 6, 74, 13, 19, 105, 64, 123, 28, 44, 50, 89, 58, 123, 126, 21,\n 43, 86, 35, 21, 62, 82, 0, 108, 120, 72, 72, 62, 80, 12, 71, 70, 86, 116, 73, 38, 15,\n 127, 81, 30, 8, 125, 28, 26, 69, 114, 63, 27, 28, 61, 42, 13, 32,\n ];\n\n let sorted = arr.sort_via(sort_u32);\n\n let expected: [u32; 100] = [\n 0, 0, 2, 3, 5, 6, 8, 12, 13, 13, 15, 19, 19, 19, 21, 21, 26, 26, 27, 28, 28, 28, 29, 30,\n 32, 32, 35, 37, 38, 41, 42, 42, 42, 43, 44, 44, 45, 47, 48, 48, 50, 50, 53, 54, 54, 58,\n 61, 62, 62, 63, 64, 66, 66, 68, 69, 70, 70, 71, 71, 72, 72, 73, 74, 80, 80, 81, 81, 82,\n 84, 84, 86, 86, 87, 89, 89, 89, 93, 95, 96, 98, 100, 104, 105, 106, 107, 108, 109, 114,\n 114, 116, 118, 119, 120, 121, 123, 123, 123, 125, 126, 127,\n ];\n assert(sorted == expected);\n }\n\n #[test]\n fn mapi_empty() {\n assert_eq([].mapi(|i, x| i * x + 1), []);\n }\n\n #[test]\n fn for_each_empty() {\n let empty_array: [Field; 0] = [];\n empty_array.for_each(|_x| assert(false));\n }\n\n #[test]\n fn for_eachi_empty() {\n let empty_array: [Field; 0] = [];\n empty_array.for_eachi(|_i, _x| assert(false));\n }\n\n #[test]\n fn map_example() {\n let a = [1, 2, 3];\n let b = a.map(|a| a * 2);\n assert_eq(b, [2, 4, 6]);\n }\n\n #[test]\n fn mapi_example() {\n let a = [1, 2, 3];\n let b = a.mapi(|i, a| i + a * 2);\n assert_eq(b, [2, 5, 8]);\n }\n\n #[test]\n fn for_each_example() {\n let a = [1, 2, 3];\n let mut b = [0, 0, 0];\n let b_ref = &mut b;\n let mut i = 0;\n let i_ref = &mut i;\n a.for_each(|x| {\n b_ref[*i_ref] = x * 2;\n *i_ref += 1;\n });\n assert_eq(b, [2, 4, 6]);\n assert_eq(i, 3);\n }\n\n #[test]\n fn for_eachi_example() {\n let a = [1, 2, 3];\n let mut b = [0, 0, 0];\n let b_ref = &mut b;\n a.for_eachi(|i, a| { b_ref[i] = i + a * 2; });\n assert_eq(b, [2, 5, 8]);\n }\n\n #[test]\n fn concat() {\n let arr1 = [1, 2, 3, 4];\n let arr2 = [6, 7, 8, 9, 10, 11];\n let concatenated_arr = arr1.concat(arr2);\n assert_eq(concatenated_arr, [1, 2, 3, 4, 6, 7, 8, 9, 10, 11]);\n }\n\n #[test]\n fn concat_zero_length_with_something() {\n let arr1 = [];\n let arr2 = [1];\n let concatenated_arr = arr1.concat(arr2);\n assert_eq(concatenated_arr, [1]);\n }\n\n #[test]\n fn concat_something_with_zero_length() {\n let arr1 = [1];\n let arr2 = [];\n let concatenated_arr = arr1.concat(arr2);\n assert_eq(concatenated_arr, [1]);\n }\n\n #[test]\n fn concat_zero_lengths() {\n let arr1: [Field; 0] = [];\n let arr2: [Field; 0] = [];\n let concatenated_arr = arr1.concat(arr2);\n assert_eq(concatenated_arr, []);\n }\n\n #[test]\n fn test_fold() {\n let array = [1, 2, 3];\n let sum_plus_10 = array.fold(10, |x, y| x + y);\n assert_eq(sum_plus_10, 16);\n }\n\n #[test]\n fn test_reduce() {\n let array = [1, 2, 3];\n let sum = array.reduce(|x, y| x + y);\n assert_eq(sum, 6);\n }\n\n #[test(should_fail_with = \"Index out of bounds\")]\n fn test_reduce_failure_on_empty_array() {\n let array: [Field; 0] = [];\n let sum = array.reduce(|x, y| x + y);\n assert_eq(sum, 6);\n }\n\n #[test]\n fn test_all() {\n let array = [1, 2, 3];\n assert(array.all(|x| x >= 1));\n assert(!array.all(|x| x >= 2));\n }\n\n #[test]\n fn test_any() {\n let array = [1, 2, 3];\n assert(array.any(|x| x >= 3));\n assert(!array.any(|x| x >= 4));\n }\n\n #[test]\n fn test_to_string() {\n let str = [78_u8, 111, 105, 114].as_str_unchecked();\n assert_eq(str, \"Noir\");\n }\n\n #[test]\n fn test_bytes_from_string() {\n let bytes: [u8; 4] = crate::convert::From::from(\"Noir\");\n assert_eq(bytes, [78_u8, 111, 105, 114]);\n }\n}\n"
1728
1744
  },
1729
- "307": {
1745
+ "308": {
1730
1746
  "function_locations": [
1731
1747
  {
1732
1748
  "name": "BlockHeader::chain_id",
@@ -1768,7 +1784,7 @@
1768
1784
  "path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/abis/block_header.nr",
1769
1785
  "source": "use crate::{\n abis::{\n append_only_tree_snapshot::AppendOnlyTreeSnapshot, global_variables::GlobalVariables,\n state_reference::StateReference,\n },\n constants::{BLOCK_HEADER_LENGTH, DOM_SEP__BLOCK_HEADER_HASH, GENESIS_BLOCK_HEADER_HASH},\n hash::poseidon2_hash_with_separator,\n traits::{Deserialize, Empty, Hash, Serialize},\n};\nuse std::meta::derive;\n\n// docs:start:block-header\n#[derive(Deserialize, Eq, Serialize)]\npub struct BlockHeader {\n pub last_archive: AppendOnlyTreeSnapshot,\n pub state: StateReference,\n\n // The hash of the sponge blob for this block, which commits to the tx effects added in this block.\n // Note: it may also include tx effects from previous blocks within the same checkpoint.\n // When proving tx effects from this block only, we must refer to the `sponge_blob_hash` in the previous block\n // header to show that the effect was added after the previous block.\n // The previous block header can be validated using a membership proof of the last leaf in `last_archive`.\n pub sponge_blob_hash: Field,\n\n pub global_variables: GlobalVariables,\n pub total_fees: Field,\n pub total_mana_used: Field,\n}\n// docs:end:block-header\n\nimpl BlockHeader {\n pub fn chain_id(self) -> Field {\n self.global_variables.chain_id\n }\n\n pub fn version(self) -> Field {\n self.global_variables.version\n }\n\n pub fn block_number(self) -> u32 {\n self.global_variables.block_number\n }\n\n pub fn timestamp(self) -> u64 {\n self.global_variables.timestamp\n }\n}\n\nimpl Empty for BlockHeader {\n fn empty() -> Self {\n Self {\n last_archive: AppendOnlyTreeSnapshot::empty(),\n state: StateReference::empty(),\n sponge_blob_hash: 0,\n global_variables: GlobalVariables::empty(),\n total_fees: 0,\n total_mana_used: 0,\n }\n }\n}\n\nimpl Hash for BlockHeader {\n fn hash(self) -> Field {\n poseidon2_hash_with_separator(self.serialize(), DOM_SEP__BLOCK_HEADER_HASH)\n }\n}\n\n#[test]\nfn serialization_of_empty() {\n let header = BlockHeader::empty();\n // We use the BLOCK_HEADER_LENGTH constant to ensure that there is a match\n // between the derived trait implementation and the constant.\n let serialized: [Field; BLOCK_HEADER_LENGTH] = header.serialize();\n let deserialized = BlockHeader::deserialize(serialized);\n assert(header.eq(deserialized));\n}\n\n#[test]\nfn hash_of_genesis_block_header() {\n let mut header = BlockHeader::empty();\n // The following values are taken from world_state.test.cpp > WorldStateTest.GetInitialTreeInfoForAllTrees.\n header.state.l1_to_l2_message_tree.root =\n 0x0fef6d80d31109ddb56d6b3f607cbc9c0af0bff3ea0d43e8f278983c64c11f7a;\n header.state.partial.note_hash_tree.root =\n 0x2590f2aab19dd791700b4a43d3f52bb88ef2409a3731da8e848663559202e4c6;\n header.state.partial.nullifier_tree.root =\n 0x18935581a8ed73d08ffd00386fba55ba6c89f3ab848a76b8fedfa9034cee0454;\n header.state.partial.nullifier_tree.next_available_leaf_index = 128;\n header.state.partial.public_data_tree.root =\n 0x1bef38b621017d3c7416663d0cd81369424560710526a3fbaaec13e356b9d084;\n header.state.partial.public_data_tree.next_available_leaf_index = 128;\n\n let hash = header.hash();\n assert_eq(hash, GENESIS_BLOCK_HEADER_HASH);\n}\n\n#[test]\nfn hash_of_empty_block_header_match_typescript() {\n let header = BlockHeader::empty();\n let hash = header.hash();\n\n // Value from block_header.test.ts \"computes empty hash\" test\n let test_data_empty_hash = 0x0bdc537052dea0f80db9698585dff9f32063b86b6d4934ac17c30c81e8e416d3;\n assert_eq(hash, test_data_empty_hash);\n}\n"
1770
1786
  },
1771
- "354": {
1787
+ "355": {
1772
1788
  "function_locations": [
1773
1789
  {
1774
1790
  "name": "<impl Empty for AztecAddress>::empty",
@@ -1858,7 +1874,7 @@
1858
1874
  "path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/address/aztec_address.nr",
1859
1875
  "source": "use crate::{\n address::{\n partial_address::PartialAddress, salted_initialization_hash::SaltedInitializationHash,\n },\n constants::{AZTEC_ADDRESS_LENGTH, DOM_SEP__CONTRACT_ADDRESS_V2, MAX_FIELD_VALUE},\n contract_class_id::ContractClassId,\n hash::poseidon2_hash_with_separator,\n public_keys::{hash_public_key, IvpkM, PublicKeys, ToPoint},\n traits::{Deserialize, Empty, FromField, Packable, Serialize, ToField},\n utils::field::sqrt,\n};\n\nuse crate::point::EmbeddedCurvePoint;\n\nuse crate::public_keys::AddressPoint;\nuse std::{\n embedded_curve_ops::{EmbeddedCurveScalar, fixed_base_scalar_mul as derive_public_key},\n ops::Add,\n};\nuse std::meta::derive;\n\n// Aztec address\n#[derive(Deserialize, Eq, Packable, Serialize)]\npub struct AztecAddress {\n pub inner: Field,\n}\n\nimpl Empty for AztecAddress {\n fn empty() -> Self {\n Self { inner: 0 }\n }\n}\n\nimpl ToField for AztecAddress {\n fn to_field(self) -> Field {\n self.inner\n }\n}\n\nimpl FromField for AztecAddress {\n fn from_field(value: Field) -> AztecAddress {\n AztecAddress { inner: value }\n }\n}\n\nimpl AztecAddress {\n pub fn zero() -> Self {\n Self { inner: 0 }\n }\n\n /// Returns `true` if the address is valid.\n ///\n /// An invalid address is one that can be proven to not be correctly derived, meaning it contains no contract code,\n /// public keys, etc., and can therefore not receive messages nor execute calls.\n pub fn is_valid(self) -> bool {\n self.get_y().is_some()\n }\n\n /// Returns an address's [`AddressPoint`].\n ///\n /// This can be used to create shared secrets with the owner of the address. If the address is invalid (see\n /// [`AztecAddress::is_valid`]) then this returns `Option::none()`, and no shared secrets can be created.\n pub fn to_address_point(self) -> Option<AddressPoint> {\n self.get_y().map(|y| {\n // If we get a negative y coordinate (y > (r - 1) / 2), we swap it to the\n // positive one (where y <= (r - 1) / 2) by negating it.\n let final_y = if Self::is_positive(y) { y } else { -y };\n\n AddressPoint { inner: EmbeddedCurvePoint { x: self.inner, y: final_y } }\n })\n }\n\n /// Determines whether a y-coordinate is in the lower (positive) or upper (negative) \"half\" of the field.\n /// I.e.\n /// y <= (r - 1)/2 => positive.\n /// y > (r - 1)/2 => negative.\n /// An AddressPoint always uses the \"positive\" y.\n fn is_positive(y: Field) -> bool {\n // Note: The field modulus r is MAX_FIELD_VALUE + 1.\n let MID = MAX_FIELD_VALUE / 2; // (r - 1) / 2\n let MID_PLUS_1 = MID + 1; // (r - 1)/2 + 1\n // Note: y <= m implies y < m + 1.\n y.lt(MID_PLUS_1)\n }\n\n /// Returns one of the two possible y-coordinates.\n ///\n /// Not all `AztecAddresses` are valid, in which case there is no corresponding y-coordinate. This returns\n /// `Option::none()` for invalid addresses.\n ///\n /// An `AztecAddress` is defined by an x-coordinate, for which two y-coordinates exist as solutions to the curve\n /// equation. This function returns either of them. Note that an [`AddressPoint`] must **always** have a positive\n /// y-coordinate - if trying to obtain the underlying point use [`AztecAddress::to_address_point`] instead.\n fn get_y(self) -> Option<Field> {\n // We compute the address point by taking our address as x, and then solving for y in the\n // equation which defines the grumpkin curve:\n // y^2 = x^3 - 17; x = address\n let x = self.inner;\n let y_squared = x * x * x - 17;\n\n sqrt(y_squared)\n }\n\n pub fn compute(public_keys: PublicKeys, partial_address: PartialAddress) -> AztecAddress {\n //\n // address = address_point.x\n // |\n // address_point = pre_address * G + Ivpk_m (always choose \"positive\" y-coord)\n // | ^\n // | |.....................\n // pre_address .\n // / \\ .\n // / \\ .\n // partial_address public_keys_hash .\n // / \\ / / | | | \\ .\n // / \\ / / | | | \\ .\n // npk_m_hash Ivpk_m ovpk_m_hash tpk_m_hash mspk_m_hash fbpk_m_hash\n // contract_class_id \\ |.........................\n // / | \\ \\\n // artifact_hash | public_bytecode_commitment salted_initialization_hash\n // | / / \\ \\\n // private_function_tree_root salt initialization_hash deployer_address immutables_hash\n // / \\ / \\\n // ... ... constructor_fn_selector constructor_args_hash\n // / \\\n // / \\ / \\\n // leaf leaf leaf leaf\n // ^\n // |\n // |---h(function_selector, vk_hash)\n // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n // Each of these represents a private function of the contract.\n\n let public_keys_hash = public_keys.hash();\n\n let pre_address = poseidon2_hash_with_separator(\n [public_keys_hash.to_field(), partial_address.to_field()],\n DOM_SEP__CONTRACT_ADDRESS_V2,\n );\n\n // Note: `.add()` will fail within the blackbox fn if either of the points are not on the curve. (See tests below).\n let address_point = derive_public_key(EmbeddedCurveScalar::from_field(pre_address)).add(\n public_keys.ivpk_m.to_point(),\n );\n\n // Note that our address is only the x-coordinate of the full address_point. This is okay because when people want to encrypt something and send it to us\n // they can recover our full point using the x-coordinate (our address itself). To do this, they recompute the y-coordinate according to the equation y^2 = x^3 - 17.\n // When they do this, they may get a positive y-coordinate (a value that is less than or equal to MAX_FIELD_VALUE / 2) or\n // a negative y-coordinate (a value that is more than MAX_FIELD_VALUE), and we cannot dictate which one they get and hence the recovered point may sometimes be different than the one\n // our secret can decrypt. Regardless though, they should and will always encrypt using point with the positive y-coordinate by convention.\n // This ensures that everyone encrypts to the same point given an arbitrary x-coordinate (address). This is allowed because even though our original point may not have a positive y-coordinate,\n // with our original secret, we will be able to derive the secret to the point with the flipped (and now positive) y-coordinate that everyone encrypts to.\n AztecAddress::from_field(address_point.x)\n }\n\n pub fn compute_from_class_id(\n contract_class_id: ContractClassId,\n salted_initialization_hash: SaltedInitializationHash,\n public_keys: PublicKeys,\n ) -> Self {\n let partial_address = PartialAddress::compute_from_salted_initialization_hash(\n contract_class_id,\n salted_initialization_hash,\n );\n\n AztecAddress::compute(public_keys, partial_address)\n }\n\n pub fn is_zero(self) -> bool {\n self.inner == 0\n }\n\n pub fn assert_is_zero(self) {\n assert(self.to_field() == 0);\n }\n}\n\n#[test]\nfn check_max_field_value() {\n // Check that it is indeed r-1.\n assert_eq(MAX_FIELD_VALUE + 1, 0);\n}\n\n#[test]\nfn check_is_positive() {\n assert(AztecAddress::is_positive(0));\n assert(AztecAddress::is_positive(1));\n assert(!AztecAddress::is_positive(-1));\n assert(AztecAddress::is_positive(MAX_FIELD_VALUE / 2));\n assert(!AztecAddress::is_positive((MAX_FIELD_VALUE / 2) + 1));\n}\n\n// Gives us confidence that we don't need to manually check that the input public keys need to be on the curve for `add`,\n// because the blackbox function does this check for us.\n#[test(should_fail_with = \"is not on curve\")]\nfn check_embedded_curve_point_add() {\n // Choose a point not on the curve in the 2nd position.\n let p1 = EmbeddedCurvePoint::generator();\n let key = IvpkM { inner: EmbeddedCurvePoint { x: 1, y: 1 } };\n let _ = p1 + key.to_point();\n}\n\n#[test]\nfn compute_address_from_partial_and_pub_keys() {\n let npk_m_point = EmbeddedCurvePoint {\n x: 0x22f7fcddfa3ce3e8f0cc8e82d7b94cdd740afa3e77f8e4a63ea78a239432dcab,\n y: 0x0471657de2b6216ade6c506d28fbc22ba8b8ed95c871ad9f3e3984e90d9723a7,\n };\n let ovpk_m_point = EmbeddedCurvePoint {\n x: 0x09115c96e962322ffed6522f57194627136b8d03ac7469109707f5e44190c484,\n y: 0x0c49773308a13d740a7f0d4f0e6163b02c5a408b6f965856b6a491002d073d5b,\n };\n let tpk_m_point = EmbeddedCurvePoint {\n x: 0x00d3d81beb009873eb7116327cf47c612d5758ef083d4fda78e9b63980b2a762,\n y: 0x2f567d22d2b02fe1f4ad42db9d58a36afd1983e7e2909d1cab61cafedad6193a,\n };\n let mspk_m_point = EmbeddedCurvePoint {\n x: 0x1bd6cb13e0bc8c6e0c1a8b2c5d7f9e0a4b6c8d0e2f4a6c8e0a2c4e6f8a0b2c4d,\n y: 0x0a032ec7b21c2bdb35f8a13e594764e39ee786c4b275eef3f0435bf6ab2b9822,\n };\n let fbpk_m_point = EmbeddedCurvePoint {\n x: 0x2c8e0a2c4e6f8b0d2f4a6c8e0a2c4e6f8b0d2f4a6c8e0a2c4e6f8b0d2f4a6c90,\n y: 0x2ef338da3a77e65f90b6d48ac686fc9ff3a95de0c39e0426fc443377425e6634,\n };\n\n let public_keys = PublicKeys {\n npk_m_hash: hash_public_key(npk_m_point),\n ivpk_m: IvpkM {\n inner: EmbeddedCurvePoint {\n x: 0x111223493147f6785514b1c195bb37a2589f22a6596d30bb2bb145fdc9ca8f1e,\n y: 0x273bbffd678edce8fe30e0deafc4f66d58357c06fd4a820285294b9746c3be95,\n },\n },\n ovpk_m_hash: hash_public_key(ovpk_m_point),\n tpk_m_hash: hash_public_key(tpk_m_point),\n mspk_m_hash: hash_public_key(mspk_m_point),\n fbpk_m_hash: hash_public_key(fbpk_m_point),\n };\n\n let partial_address = PartialAddress::from_field(\n 0x0a7c585381b10f4666044266a02405bf6e01fa564c8517d4ad5823493abd31de,\n );\n\n let address = AztecAddress::compute(public_keys, partial_address).to_field();\n\n let expected_computed_address_from_partial_and_pubkeys =\n 0x303ffc8bd456d132463b1fc3a633aeb718a7883c268f3956c05e6fe09b5a5424;\n assert_eq(address, expected_computed_address_from_partial_and_pubkeys);\n}\n\n#[test]\nfn compute_preaddress_from_partial_and_pub_keys() {\n let pre_address = poseidon2_hash_with_separator([1, 2], DOM_SEP__CONTRACT_ADDRESS_V2);\n let expected_computed_preaddress_from_partial_and_pubkey =\n 0x0fa1c698858df1a99170cd39d5f4bfad6d0d60f1f8afa3dc92281ee60b36f3bb;\n assert(pre_address == expected_computed_preaddress_from_partial_and_pubkey);\n}\n\n#[test]\nfn from_field_to_field() {\n let address = AztecAddress { inner: 37 };\n assert_eq(FromField::from_field(address.to_field()), address);\n}\n\n#[test]\nfn serde() {\n let address = AztecAddress { inner: 37 };\n // We use the AZTEC_ADDRESS_LENGTH constant to ensure that there is a match between the derived trait\n // implementation and the constant.\n let serialized: [Field; AZTEC_ADDRESS_LENGTH] = address.serialize();\n let deserialized = AztecAddress::deserialize(serialized);\n assert_eq(address, deserialized);\n}\n\n#[test]\nfn to_address_point_valid() {\n // x = 8 where x^3 - 17 = 512 - 17 = 495, which is a residue in this field\n let address = AztecAddress { inner: 8 };\n\n assert(address.get_y().is_some()); // We don't bother checking the result of get_y as it is only used internally\n assert(address.is_valid());\n\n let maybe_point = address.to_address_point();\n assert(maybe_point.is_some());\n\n let point = maybe_point.unwrap().inner;\n // check that x is preserved\n assert_eq(point.x, Field::from(8));\n\n // check that the curve equation holds: y^2 == x^3 - 17\n assert_eq(point.y * point.y, point.x * point.x * point.x - 17);\n}\n\n#[test]\nfn to_address_point_invalid() {\n // x = 3 where x^3 - 17 = 27 - 17 = 10, which is a non-residue in this field\n let address = AztecAddress { inner: 3 };\n\n assert(address.get_y().is_none());\n assert(!address.is_valid());\n\n assert(address.to_address_point().is_none());\n}\n"
1860
1876
  },
1861
- "357": {
1877
+ "358": {
1862
1878
  "function_locations": [
1863
1879
  {
1864
1880
  "name": "<impl ToField for PartialAddress>::to_field",
@@ -1900,7 +1916,7 @@
1900
1916
  "path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/address/partial_address.nr",
1901
1917
  "source": "use crate::{\n address::{aztec_address::AztecAddress, salted_initialization_hash::SaltedInitializationHash},\n constants::DOM_SEP__PARTIAL_ADDRESS,\n contract_class_id::ContractClassId,\n hash::poseidon2_hash_with_separator,\n traits::{Deserialize, Empty, Serialize, ToField},\n};\nuse std::meta::derive;\n\n// Partial address\n#[derive(Deserialize, Eq, Serialize)]\npub struct PartialAddress {\n pub inner: Field,\n}\n\nimpl ToField for PartialAddress {\n fn to_field(self) -> Field {\n self.inner\n }\n}\n\nimpl Empty for PartialAddress {\n fn empty() -> Self {\n Self { inner: 0 }\n }\n}\n\nimpl PartialAddress {\n pub fn from_field(field: Field) -> Self {\n Self { inner: field }\n }\n\n pub fn compute(\n contract_class_id: ContractClassId,\n salt: Field,\n initialization_hash: Field,\n deployer: AztecAddress,\n immutables_hash: Field,\n ) -> Self {\n PartialAddress::compute_from_salted_initialization_hash(\n contract_class_id,\n SaltedInitializationHash::compute(salt, initialization_hash, deployer, immutables_hash),\n )\n }\n\n pub fn compute_from_salted_initialization_hash(\n contract_class_id: ContractClassId,\n salted_initialization_hash: SaltedInitializationHash,\n ) -> Self {\n PartialAddress::from_field(poseidon2_hash_with_separator(\n [contract_class_id.to_field(), salted_initialization_hash.to_field()],\n DOM_SEP__PARTIAL_ADDRESS,\n ))\n }\n\n pub fn to_field(self) -> Field {\n self.inner\n }\n\n pub fn is_zero(self) -> bool {\n self.to_field() == 0\n }\n\n pub fn assert_is_zero(self) {\n assert(self.to_field() == 0);\n }\n}\n\nmod test {\n use crate::{address::partial_address::PartialAddress, traits::{Deserialize, Serialize}};\n\n #[test]\n fn serialization_of_partial_address() {\n let item = PartialAddress::from_field(1);\n let serialized: [Field; 1] = item.serialize();\n let deserialized = PartialAddress::deserialize(serialized);\n assert_eq(item, deserialized);\n }\n}\n"
1902
1918
  },
1903
- "359": {
1919
+ "360": {
1904
1920
  "function_locations": [
1905
1921
  {
1906
1922
  "name": "<impl ToField for SaltedInitializationHash>::to_field",
@@ -1922,7 +1938,7 @@
1922
1938
  "path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/address/salted_initialization_hash.nr",
1923
1939
  "source": "use crate::{\n address::aztec_address::AztecAddress, constants::DOM_SEP__SALTED_INITIALIZATION_HASH,\n hash::poseidon2_hash_with_separator, traits::ToField,\n};\n\n// Salted initialization hash. Used in the computation of a partial address.\n#[derive(Eq)]\npub struct SaltedInitializationHash {\n pub inner: Field,\n}\n\nimpl ToField for SaltedInitializationHash {\n fn to_field(self) -> Field {\n self.inner\n }\n}\n\nimpl SaltedInitializationHash {\n pub fn from_field(field: Field) -> Self {\n Self { inner: field }\n }\n\n pub fn compute(\n salt: Field,\n initialization_hash: Field,\n deployer: AztecAddress,\n immutables_hash: Field,\n ) -> Self {\n SaltedInitializationHash::from_field(poseidon2_hash_with_separator(\n [salt, initialization_hash, deployer.to_field(), immutables_hash],\n DOM_SEP__SALTED_INITIALIZATION_HASH,\n ))\n }\n\n pub fn assert_is_zero(self) {\n assert(self.to_field() == 0);\n }\n}\n"
1924
1940
  },
1925
- "369": {
1941
+ "370": {
1926
1942
  "function_locations": [
1927
1943
  {
1928
1944
  "name": "<impl Hash for ContractInstance>::hash",
@@ -1940,7 +1956,7 @@
1940
1956
  "path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/contract_instance.nr",
1941
1957
  "source": "use crate::{\n address::{aztec_address::AztecAddress, partial_address::PartialAddress},\n contract_class_id::ContractClassId,\n public_keys::PublicKeys,\n traits::{Deserialize, Hash, Serialize, ToField},\n};\nuse std::meta::derive;\n\n/// The complete preimage of an [`AztecAddress`].\n///\n/// All of these values are hashed into the contract's `AztecAddress` (see [`Self::to_address`]), so they are fixed\n/// at deployment time and never change.\n///\n/// In particular, `original_contract_class_id` is the class the contract was *deployed* with. For upgradeable contracts\n/// which utilize the `ContractInstanceRegistry` this is NOT the class currently executing i.e. the 'current' class.\n#[derive(Deserialize, Eq, Serialize)]\npub struct ContractInstance {\n pub salt: Field,\n pub deployer: AztecAddress,\n pub original_contract_class_id: ContractClassId,\n pub initialization_hash: Field,\n pub immutables_hash: Field,\n pub public_keys: PublicKeys,\n}\n\nimpl Hash for ContractInstance {\n fn hash(self) -> Field {\n self.to_address().to_field()\n }\n}\n\nimpl ContractInstance {\n pub fn to_address(self) -> AztecAddress {\n AztecAddress::compute(\n self.public_keys,\n PartialAddress::compute(\n self.original_contract_class_id,\n self.salt,\n self.initialization_hash,\n self.deployer,\n self.immutables_hash,\n ),\n )\n }\n}\n\nmod test {\n use crate::{\n address::AztecAddress,\n constants::CONTRACT_INSTANCE_LENGTH,\n contract_class_id::ContractClassId,\n contract_instance::ContractInstance,\n public_keys::PublicKeys,\n traits::{Deserialize, FromField, Serialize},\n };\n\n #[test]\n fn serde() {\n let instance = ContractInstance {\n salt: 6,\n deployer: AztecAddress::from_field(12),\n original_contract_class_id: ContractClassId::from_field(13),\n initialization_hash: 156,\n immutables_hash: 789,\n public_keys: PublicKeys::default(),\n };\n\n // We use the CONTRACT_INSTANCE_LENGTH constant to ensure that there is a match between the derived trait\n // implementation and the constant.\n let serialized: [Field; CONTRACT_INSTANCE_LENGTH] = instance.serialize();\n\n let deserialized = ContractInstance::deserialize(serialized);\n\n assert(instance.eq(deserialized));\n }\n\n}\n"
1942
1958
  },
1943
- "385": {
1959
+ "386": {
1944
1960
  "function_locations": [
1945
1961
  {
1946
1962
  "name": "sha256_to_field",
@@ -2062,7 +2078,7 @@
2062
2078
  "path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/hash.nr",
2063
2079
  "source": "mod poseidon2_chunks;\n\nuse crate::{\n abis::{\n contract_class_function_leaf_preimage::ContractClassFunctionLeafPreimage,\n function_selector::FunctionSelector, nullifier::Nullifier, private_log::PrivateLog,\n transaction::tx_request::TxRequest,\n },\n address::{AztecAddress, EthAddress},\n constants::{\n CONTRACT_CLASS_LOG_SIZE_IN_FIELDS, DOM_SEP__NOTE_HASH_NONCE,\n DOM_SEP__PRIVATE_LOG_FIRST_FIELD, DOM_SEP__SILOED_NOTE_HASH, DOM_SEP__SILOED_NULLIFIER,\n DOM_SEP__UNIQUE_NOTE_HASH, FUNCTION_TREE_HEIGHT, NULL_MSG_SENDER_CONTRACT_ADDRESS,\n TWO_POW_64,\n },\n merkle_tree::root_from_sibling_path,\n messaging::l2_to_l1_message::L2ToL1Message,\n poseidon2::Poseidon2Sponge,\n side_effect::{Counted, Scoped},\n traits::{FromField, Hash, ToField},\n utils::field::{field_from_bytes, field_from_bytes_32_trunc},\n};\n\npub use poseidon2_chunks::poseidon2_absorb_in_chunks_existing_sponge;\nuse poseidon2_chunks::poseidon2_absorb_in_chunks;\nuse std::embedded_curve_ops::EmbeddedCurveScalar;\n\n// TODO: refactor these into their own files: sha256, poseidon2, some protocol-specific hash computations, some merkle computations.\n\npub fn sha256_to_field<let N: u32>(bytes_to_hash: [u8; N]) -> Field {\n let sha256_hashed = sha256::digest(bytes_to_hash);\n let hash_in_a_field = field_from_bytes_32_trunc(sha256_hashed);\n\n hash_in_a_field\n}\n\npub fn private_functions_root_from_siblings(\n selector: FunctionSelector,\n vk_hash: Field,\n function_leaf_index: Field,\n function_leaf_sibling_path: [Field; FUNCTION_TREE_HEIGHT],\n) -> Field {\n let function_leaf_preimage = ContractClassFunctionLeafPreimage { selector, vk_hash };\n let function_leaf = function_leaf_preimage.hash();\n root_from_sibling_path(\n function_leaf,\n function_leaf_index,\n function_leaf_sibling_path,\n )\n}\n\n/// Siloing in the context of Aztec refers to the process of hashing a note hash with a contract address (this way\n/// the note hash is scoped to a specific contract). This is used to prevent intermingling of notes between contracts.\npub fn compute_siloed_note_hash(contract_address: AztecAddress, note_hash: Field) -> Field {\n poseidon2_hash_with_separator(\n [contract_address.to_field(), note_hash],\n DOM_SEP__SILOED_NOTE_HASH,\n )\n}\n\n/// Computes unique, siloed note hashes from siloed note hashes.\n///\n/// The protocol injects uniqueness into every note_hash, so that every single note_hash in the\n/// tree is unique. This prevents faerie gold attacks, where a malicious sender could create\n/// two identical note_hashes for a recipient (meaning only one would be nullifiable in future).\n///\n/// Most privacy protocols will inject the note's leaf_index (its position in the Note Hashes Tree)\n/// into the note, but this requires the creator of a note to wait until their tx is included in\n/// a block to know the note's final note hash (the unique, siloed note hash), because inserting\n/// leaves into trees is the job of a block producer.\n///\n/// We took a different approach so that the creator of a note will know each note's unique, siloed\n/// note hash before broadcasting their tx to the network.\n/// (There was also a historical requirement relating to \"chained transactions\" -- a feature that\n/// Aztec Connect had to enable notes to be spent from distinct txs earlier in the same block,\n/// and hence before an archive block root had been established for that block -- but that feature\n/// was abandoned for the Aztec Network for having too many bad tradeoffs).\n///\n/// (\n/// Edit: it is no longer true that all final note_hashes will be known by the creator of a tx\n/// before they send it to the network. If a tx makes public function calls, then _revertible_\n/// note_hashes that are created in private will not be made unique in private by the Reset circuit,\n/// but will instead be made unique by the AVM, because the `note_index_in_tx` will not be known\n/// until the AVM has executed the public functions of the tx. (See an explanation in\n/// reset_output_composer.nr for why).\n/// For some such txs, the `note_index_in_tx` might still be predictable through simulation, but\n/// for txs whose public functions create a varying number of non-revertible notes (determined at\n/// runtime), the `note_index_in_tx` will not be deterministically derivable before submitting the\n/// tx to the network.\n/// )\n///\n/// We use the `first_nullifier` of a tx as a seed of uniqueness. We have a guarantee that there will\n/// always be at least one nullifier per tx, because the init circuit will create one if one isn't\n/// created naturally by any functions of the tx. (Search \"protocol_nullifier\").\n/// We combine the `first_nullifier` with the note's index (its position within this tx's new\n/// note_hashes array) (`note_index_in_tx`) to get a truly unique value to inject into a note, which\n/// we call a `note_nonce`.\npub fn compute_unique_note_hash(note_nonce: Field, siloed_note_hash: Field) -> Field {\n let inputs = [note_nonce, siloed_note_hash];\n poseidon2_hash_with_separator(inputs, DOM_SEP__UNIQUE_NOTE_HASH)\n}\n\npub fn compute_note_hash_nonce(first_nullifier_in_tx: Field, note_index_in_tx: u32) -> Field {\n // Hashing the first nullifier with note index in tx is guaranteed to be unique (because all nullifiers are also\n // unique).\n poseidon2_hash_with_separator(\n [first_nullifier_in_tx, note_index_in_tx as Field],\n DOM_SEP__NOTE_HASH_NONCE,\n )\n}\n\npub fn compute_note_nonce_and_unique_note_hash(\n siloed_note_hash: Field,\n first_nullifier: Field,\n note_index_in_tx: u32,\n) -> Field {\n let note_nonce = compute_note_hash_nonce(first_nullifier, note_index_in_tx);\n compute_unique_note_hash(note_nonce, siloed_note_hash)\n}\n\npub fn compute_siloed_nullifier(contract_address: AztecAddress, nullifier: Field) -> Field {\n poseidon2_hash_with_separator(\n [contract_address.to_field(), nullifier],\n DOM_SEP__SILOED_NULLIFIER,\n )\n}\n\npub fn create_protocol_nullifier(tx_request: TxRequest) -> Scoped<Counted<Nullifier>> {\n // The protocol nullifier is ascribed a special side-effect counter of 1. No other side-effect\n // can have counter 1 (see `validate_as_first_call` for that assertion).\n Nullifier { value: tx_request.hash(), note_hash: 0 }.count(1).scope(\n NULL_MSG_SENDER_CONTRACT_ADDRESS,\n )\n}\n\npub fn compute_log_tag(raw_tag: Field, dom_sep: u32) -> Field {\n poseidon2_hash_with_separator([raw_tag], dom_sep)\n}\n\npub fn compute_siloed_private_log_first_field(\n contract_address: AztecAddress,\n field: Field,\n) -> Field {\n poseidon2_hash_with_separator(\n [contract_address.to_field(), field],\n DOM_SEP__PRIVATE_LOG_FIRST_FIELD,\n )\n}\n\npub fn compute_siloed_private_log(contract_address: AztecAddress, log: PrivateLog) -> PrivateLog {\n let mut fields = log.fields;\n fields[0] = compute_siloed_private_log_first_field(contract_address, fields[0]);\n PrivateLog::new(fields, log.length)\n}\n\npub fn compute_contract_class_log_hash(log: [Field; CONTRACT_CLASS_LOG_SIZE_IN_FIELDS]) -> Field {\n poseidon2_hash(log)\n}\n\npub fn compute_app_siloed_secret_key(\n master_secret_key: EmbeddedCurveScalar,\n app_address: AztecAddress,\n key_type_domain_separator: Field,\n) -> Field {\n poseidon2_hash_with_separator(\n [master_secret_key.hi, master_secret_key.lo, app_address.to_field()],\n key_type_domain_separator,\n )\n}\n\npub fn compute_l2_to_l1_message_hash(\n message: Scoped<L2ToL1Message>,\n rollup_version_id: Field,\n chain_id: Field,\n) -> Field {\n let contract_address_bytes: [u8; 32] = message.contract_address.to_field().to_be_bytes();\n let recipient_bytes: [u8; 20] = message.inner.recipient.to_be_bytes();\n let content_bytes: [u8; 32] = message.inner.content.to_be_bytes();\n let rollup_version_id_bytes: [u8; 32] = rollup_version_id.to_be_bytes();\n let chain_id_bytes: [u8; 32] = chain_id.to_be_bytes();\n\n let mut bytes: [u8; 148] = std::mem::zeroed();\n for i in 0..32 {\n bytes[i] = contract_address_bytes[i];\n bytes[i + 32] = rollup_version_id_bytes[i];\n // 64 - 84 are for recipient.\n bytes[i + 84] = chain_id_bytes[i];\n bytes[i + 116] = content_bytes[i];\n }\n\n for i in 0..20 {\n bytes[64 + i] = recipient_bytes[i];\n }\n\n sha256_to_field(bytes)\n}\n\n// TODO: consider a variant that enables domain separation with a u32 (we seem to have standardised u32s for domain separators)\n/// Computes sha256 hash of 2 input fields.\n///\n/// @returns A truncated field (i.e., the first byte is always 0).\npub fn accumulate_sha256(v0: Field, v1: Field) -> Field {\n // Concatenate two fields into 32 x 2 = 64 bytes\n let v0_as_bytes: [u8; 32] = v0.to_be_bytes();\n let v1_as_bytes: [u8; 32] = v1.to_be_bytes();\n let hash_input_flattened = v0_as_bytes.concat(v1_as_bytes);\n\n sha256_to_field(hash_input_flattened)\n}\n\npub fn poseidon2_hash<let N: u32>(inputs: [Field; N]) -> Field {\n poseidon::poseidon2::Poseidon2::hash(inputs, N)\n}\n\n#[no_predicates]\npub fn poseidon2_hash_with_separator<let N: u32, T>(inputs: [Field; N], separator: T) -> Field\nwhere\n T: ToField,\n{\n let inputs_with_separator = [separator.to_field()].concat(inputs);\n poseidon2_hash(inputs_with_separator)\n}\n\n/// Computes a Poseidon2 hash over a dynamic-length subarray of the given input.\n/// Only the first `in_len` fields of `input` are absorbed; any remaining fields are ignored.\n/// The caller is responsible for ensuring that the input is padded with zeros if required.\n#[no_predicates]\npub fn poseidon2_hash_subarray<let N: u32>(input: [Field; N], in_len: u32) -> Field {\n let mut sponge = poseidon2_absorb_in_chunks(input, in_len);\n sponge.squeeze()\n}\n\n// This function is unconstrained because it is intended to be used in unconstrained context only as\n// in constrained contexts it would be too inefficient.\npub unconstrained fn poseidon2_hash_with_separator_bounded_vec<let N: u32, T>(\n inputs: BoundedVec<Field, N>,\n separator: T,\n) -> Field\nwhere\n T: ToField,\n{\n let in_len = inputs.len() + 1;\n let iv: Field = (in_len as Field) * TWO_POW_64;\n let mut sponge = Poseidon2Sponge::new(iv);\n sponge.absorb(separator.to_field());\n\n for i in 0..inputs.len() {\n sponge.absorb(inputs.get(i));\n }\n\n sponge.squeeze()\n}\n\n#[no_predicates]\npub fn poseidon2_hash_bytes<let N: u32>(inputs: [u8; N]) -> Field {\n let mut fields = [0; (N + 30) / 31];\n let mut field_index = 0;\n let mut current_field = [0; 31];\n for i in 0..inputs.len() {\n let index = i % 31;\n current_field[index] = inputs[i];\n if index == 30 {\n fields[field_index] = field_from_bytes(current_field, false);\n current_field = [0; 31];\n field_index += 1;\n }\n }\n if field_index != fields.len() {\n fields[field_index] = field_from_bytes(current_field, false);\n }\n poseidon2_hash(fields)\n}\n\n#[test]\nfn subarray_hash_matches_fixed() {\n let values_to_hash = [3; 17];\n let padded = values_to_hash.concat([0; 11]);\n let subarray_hash = poseidon2_hash_subarray(padded, values_to_hash.len());\n\n // Hash the entire values_to_hash.\n let fixed_len_hash = poseidon::poseidon2::Poseidon2::hash(values_to_hash, values_to_hash.len());\n\n assert_eq(subarray_hash, fixed_len_hash);\n}\n\n#[test]\nfn subarray_hash_matches_variable() {\n let values_to_hash = [3; 17];\n let padded = values_to_hash.concat([0; 11]);\n let subarray_hash = poseidon2_hash_subarray(padded, values_to_hash.len());\n\n // Hash up to values_to_hash.len() fields of the padded array.\n let variable_len_hash = poseidon::poseidon2::Poseidon2::hash(padded, values_to_hash.len());\n\n assert_eq(subarray_hash, variable_len_hash);\n}\n\n#[test]\nfn smoke_sha256_to_field() {\n let full_buffer = [\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,\n 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,\n 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,\n 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,\n 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,\n 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130,\n 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148,\n 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,\n ];\n let result = sha256_to_field(full_buffer);\n\n assert(result == 0x448ebbc9e1a31220a2f3830c18eef61b9bd070e5084b7fa2a359fe729184c7);\n\n // to show correctness of the current ver (truncate one byte) vs old ver (mod full bytes):\n let result_bytes = sha256::digest(full_buffer);\n let truncated_field = crate::utils::field::field_from_bytes_32_trunc(result_bytes);\n assert(truncated_field == result);\n let mod_res = result + (result_bytes[31] as Field);\n assert(mod_res == 0x448ebbc9e1a31220a2f3830c18eef61b9bd070e5084b7fa2a359fe729184e0);\n}\n\n#[test]\nfn unique_siloed_note_hash_matches_typescript() {\n let inner_note_hash = 1;\n let contract_address = AztecAddress::from_field(2);\n let first_nullifier = 3;\n let note_index_in_tx = 4;\n\n let siloed_note_hash = compute_siloed_note_hash(contract_address, inner_note_hash);\n let siloed_note_hash_from_ts =\n 0x1986a4bea3eddb1fff917d629a13e10f63f514f401bdd61838c6b475db949169;\n assert_eq(siloed_note_hash, siloed_note_hash_from_ts);\n\n let nonce: Field = compute_note_hash_nonce(first_nullifier, note_index_in_tx);\n let note_hash_nonce_from_ts =\n 0x28e7799791bf066a57bb51fdd0fbcaf3f0926414314c7db515ea343f44f5d58b;\n assert_eq(nonce, note_hash_nonce_from_ts);\n\n let unique_siloed_note_hash_from_nonce = compute_unique_note_hash(nonce, siloed_note_hash);\n let unique_siloed_note_hash = compute_note_nonce_and_unique_note_hash(\n siloed_note_hash,\n first_nullifier,\n note_index_in_tx,\n );\n assert_eq(unique_siloed_note_hash_from_nonce, unique_siloed_note_hash);\n\n let unique_siloed_note_hash_from_ts =\n 0x29949aef207b715303b24639737c17fbfeb375c1d965ecfa85c7e4f0febb7d16;\n assert_eq(unique_siloed_note_hash, unique_siloed_note_hash_from_ts);\n}\n\n#[test]\nfn siloed_nullifier_matches_typescript() {\n let contract_address = AztecAddress::from_field(123);\n let nullifier = 456;\n\n let res = compute_siloed_nullifier(contract_address, nullifier);\n\n let siloed_nullifier_from_ts =\n 0x169b50336c1f29afdb8a03d955a81e485f5ac7d5f0b8065673d1e407e5877813;\n\n assert_eq(res, siloed_nullifier_from_ts);\n}\n\n#[test]\nfn siloed_private_log_first_field_matches_typescript() {\n let contract_address = AztecAddress::from_field(123);\n let field = 456;\n let res = compute_siloed_private_log_first_field(contract_address, field);\n\n let siloed_private_log_first_field_from_ts =\n 0x29480984f7b9257fded523d50addbcfc8d1d33adcf2db73ef3390a8fd5cdffaa;\n\n assert_eq(res, siloed_private_log_first_field_from_ts);\n}\n\n#[test]\nfn empty_l2_to_l1_message_hash_matches_typescript() {\n // All zeroes\n let res = compute_l2_to_l1_message_hash(\n L2ToL1Message { recipient: EthAddress::zero(), content: 0 }.scope(AztecAddress::from_field(\n 0,\n )),\n 0,\n 0,\n );\n\n let empty_l2_to_l1_msg_hash_from_ts =\n 0x003b18c58c739716e76429634a61375c45b3b5cd470c22ab6d3e14cee23dd992;\n\n assert_eq(res, empty_l2_to_l1_msg_hash_from_ts);\n}\n\n#[test]\nfn l2_to_l1_message_hash_matches_typescript() {\n let message = L2ToL1Message { recipient: EthAddress::from_field(1), content: 2 }.scope(\n AztecAddress::from_field(3),\n );\n let version = 4;\n let chainId = 5;\n\n let hash = compute_l2_to_l1_message_hash(message, version, chainId);\n\n // The following value was generated by `yarn-project/stdlib/src/hash/hash.test.ts`\n let l2_to_l1_message_hash_from_ts =\n 0x0081edf209e087ad31b3fd24263698723d57190bd1d6e9fe056fc0c0a68ee661;\n\n assert_eq(hash, l2_to_l1_message_hash_from_ts);\n}\n\n#[test]\nunconstrained fn poseidon2_hash_with_separator_bounded_vec_matches_non_bounded_vec_version() {\n let inputs = BoundedVec::<Field, 4>::from_array([1, 2, 3]);\n let separator = 42;\n\n // Hash using bounded vec version\n let bounded_result = poseidon2_hash_with_separator_bounded_vec(inputs, separator);\n\n // Hash using regular version\n let regular_result = poseidon2_hash_with_separator([1, 2, 3], separator);\n\n // Results should match\n assert_eq(bounded_result, regular_result);\n}\n"
2064
2080
  },
2065
- "387": {
2081
+ "388": {
2066
2082
  "function_locations": [
2067
2083
  {
2068
2084
  "name": "fatal_log",
@@ -2136,7 +2152,7 @@
2136
2152
  "path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/logging.nr",
2137
2153
  "source": "// Log levels matching the JS logger:\n\n// global SILENT_LOG_LEVEL: u8 = 0;\nglobal FATAL_LOG_LEVEL: u8 = 1;\nglobal ERROR_LOG_LEVEL: u8 = 2;\nglobal WARN_LOG_LEVEL: u8 = 3;\nglobal INFO_LOG_LEVEL: u8 = 4;\nglobal VERBOSE_LOG_LEVEL: u8 = 5;\nglobal DEBUG_LOG_LEVEL: u8 = 6;\nglobal TRACE_LOG_LEVEL: u8 = 7;\n\n// --- Per-level log functions (no format args) ---\n\npub fn fatal_log<let N: u32>(msg: str<N>) {\n fatal_log_format(msg, []);\n}\n\npub fn error_log<let N: u32>(msg: str<N>) {\n error_log_format(msg, []);\n}\n\npub fn warn_log<let N: u32>(msg: str<N>) {\n warn_log_format(msg, []);\n}\n\npub fn info_log<let N: u32>(msg: str<N>) {\n info_log_format(msg, []);\n}\n\npub fn verbose_log<let N: u32>(msg: str<N>) {\n verbose_log_format(msg, []);\n}\n\npub fn debug_log<let N: u32>(msg: str<N>) {\n debug_log_format(msg, []);\n}\n\npub fn trace_log<let N: u32>(msg: str<N>) {\n trace_log_format(msg, []);\n}\n\n// --- Per-level log functions (with format args) ---\n\npub fn fatal_log_format<let M: u32, let N: u32>(msg: str<M>, args: [Field; N]) {\n log_format(FATAL_LOG_LEVEL, msg, args);\n}\n\npub fn error_log_format<let M: u32, let N: u32>(msg: str<M>, args: [Field; N]) {\n log_format(ERROR_LOG_LEVEL, msg, args);\n}\n\npub fn warn_log_format<let M: u32, let N: u32>(msg: str<M>, args: [Field; N]) {\n log_format(WARN_LOG_LEVEL, msg, args);\n}\n\npub fn info_log_format<let M: u32, let N: u32>(msg: str<M>, args: [Field; N]) {\n log_format(INFO_LOG_LEVEL, msg, args);\n}\n\npub fn verbose_log_format<let M: u32, let N: u32>(msg: str<M>, args: [Field; N]) {\n log_format(VERBOSE_LOG_LEVEL, msg, args);\n}\n\npub fn debug_log_format<let M: u32, let N: u32>(msg: str<M>, args: [Field; N]) {\n log_format(DEBUG_LOG_LEVEL, msg, args);\n}\n\npub fn trace_log_format<let M: u32, let N: u32>(msg: str<M>, args: [Field; N]) {\n log_format(TRACE_LOG_LEVEL, msg, args);\n}\n\nfn log_format<let M: u32, let N: u32>(log_level: u8, msg: str<M>, args: [Field; N]) {\n // Safety: This oracle call returns nothing: we only call it for its side effects. It is therefore always safe\n // to call.\n unsafe { log_oracle_wrapper(log_level, msg, args) };\n}\n\nunconstrained fn log_oracle_wrapper<let M: u32, let N: u32>(\n log_level: u8,\n msg: str<M>,\n args: [Field; N],\n) {\n log_oracle(log_level, msg, N, args);\n}\n\n// While the length parameter might seem unnecessary given that we have N, we keep it around because at the AVM\n// bytecode level we want to support non-comptime-known lengths for such opcodes, even if Noir code will not generally\n// take that route. The AVM transpiler maps this oracle to the DEBUGLOG opcode, which reads the fields size from memory.\n#[oracle(aztec_misc_log)]\nunconstrained fn log_oracle<let M: u32, let N: u32>(\n log_level: u8,\n msg: str<M>,\n length: u32,\n args: [Field; N],\n) {}\n"
2138
2154
  },
2139
- "413": {
2155
+ "414": {
2140
2156
  "function_locations": [
2141
2157
  {
2142
2158
  "name": "hash_public_key",
@@ -2206,7 +2222,7 @@
2206
2222
  "path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/public_keys.nr",
2207
2223
  "source": "use crate::{\n address::public_keys_hash::PublicKeysHash,\n constants::{\n DEFAULT_FBPK_M_HASH, DEFAULT_IVPK_M_X, DEFAULT_IVPK_M_Y, DEFAULT_MSPK_M_HASH,\n DEFAULT_NPK_M_HASH, DEFAULT_OVPK_M_HASH, DEFAULT_TPK_M_HASH, DOM_SEP__PUBLIC_KEYS_HASH,\n DOM_SEP__SINGLE_PUBLIC_KEY_HASH,\n },\n hash::poseidon2_hash_with_separator,\n point::{EmbeddedCurvePoint, validate_on_curve},\n traits::{Deserialize, Hash, Serialize},\n};\n\nuse std::{default::Default, meta::derive};\n\npub trait ToPoint {\n fn to_point(self) -> EmbeddedCurvePoint;\n}\n\n/// Hashes a public key point under the canonical single-public-key domain separator.\n///\n/// Defined as `Poseidon2(DOM_SEP__SINGLE_PUBLIC_KEY_HASH, x, y)`.\npub fn hash_public_key(p: EmbeddedCurvePoint) -> Field {\n poseidon2_hash_with_separator([p.x, p.y], DOM_SEP__SINGLE_PUBLIC_KEY_HASH as Field)\n}\n\n#[derive(Deserialize, Eq, Serialize)]\npub struct IvpkM {\n pub inner: EmbeddedCurvePoint,\n}\n\nimpl ToPoint for IvpkM {\n fn to_point(self) -> EmbeddedCurvePoint {\n self.inner\n }\n}\n\nimpl Hash for IvpkM {\n fn hash(self) -> Field {\n hash_public_key(self.inner)\n }\n}\n\n/// A non-owner's view of an account's master public keys.\n///\n/// `npk_m_hash`, `ovpk_m_hash`, `tpk_m_hash`, `mspk_m_hash`, and `fbpk_m_hash` are the\n/// [`hash_public_key`] digests of the underlying points. The points themselves are not exposed\n/// here - they are only known to the owner. `ivpk_m` remains a point because address derivation\n/// (encrypt-to-address) requires the raw point in-circuit.\n#[derive(Deserialize, Eq, Serialize)]\npub struct PublicKeys {\n pub npk_m_hash: Field,\n pub ivpk_m: IvpkM,\n pub ovpk_m_hash: Field,\n pub tpk_m_hash: Field,\n pub mspk_m_hash: Field,\n pub fbpk_m_hash: Field,\n}\n\nimpl Default for PublicKeys {\n fn default() -> Self {\n PublicKeys {\n npk_m_hash: DEFAULT_NPK_M_HASH,\n ivpk_m: IvpkM {\n inner: EmbeddedCurvePoint { x: DEFAULT_IVPK_M_X, y: DEFAULT_IVPK_M_Y },\n },\n ovpk_m_hash: DEFAULT_OVPK_M_HASH,\n tpk_m_hash: DEFAULT_TPK_M_HASH,\n mspk_m_hash: DEFAULT_MSPK_M_HASH,\n fbpk_m_hash: DEFAULT_FBPK_M_HASH,\n }\n }\n}\n\nimpl PublicKeys {\n pub fn hash(self) -> PublicKeysHash {\n PublicKeysHash::from_field(poseidon2_hash_with_separator(\n [\n self.npk_m_hash,\n self.ivpk_m.hash(),\n self.ovpk_m_hash,\n self.tpk_m_hash,\n self.mspk_m_hash,\n self.fbpk_m_hash,\n ],\n DOM_SEP__PUBLIC_KEYS_HASH as Field,\n ))\n }\n\n /// Validates that the (only) point-form key, `ivpk_m`, lies on the Grumpkin curve.\n ///\n /// The other five keys are exposed only as hashes and are unverifiable on-circuit; the PXE\n /// is responsible for ensuring they were derived from on-curve points before persistence.\n pub fn validate_on_curve(self) {\n validate_on_curve(self.ivpk_m.inner);\n }\n\n /// Validates that `ivpk_m` is not the point at infinity.\n ///\n /// As with [`Self::validate_on_curve`], the other five keys are now exposed only as hashes\n /// and this property must be enforced PXE-side.\n pub fn validate_non_infinity(self) {\n assert_eq(self.ivpk_m.inner.is_infinite(), false, \"IvpkM is the point at infinity\");\n }\n}\n\npub struct AddressPoint {\n pub inner: EmbeddedCurvePoint,\n}\n\nimpl ToPoint for AddressPoint {\n fn to_point(self) -> EmbeddedCurvePoint {\n self.inner\n }\n}\n\nmod test {\n use crate::constants::{\n DEFAULT_FBPK_M_HASH, DEFAULT_FBPK_M_X, DEFAULT_FBPK_M_Y, DEFAULT_MSPK_M_HASH,\n DEFAULT_MSPK_M_X, DEFAULT_MSPK_M_Y, DEFAULT_NPK_M_HASH, DEFAULT_NPK_M_X, DEFAULT_NPK_M_Y,\n DEFAULT_OVPK_M_HASH, DEFAULT_OVPK_M_X, DEFAULT_OVPK_M_Y, DEFAULT_TPK_M_HASH,\n DEFAULT_TPK_M_X, DEFAULT_TPK_M_Y,\n };\n use crate::{\n point::EmbeddedCurvePoint,\n public_keys::{hash_public_key, IvpkM, PublicKeys},\n traits::{Deserialize, Serialize},\n };\n\n global PUBLIC_KEYS_LENGTH: u32 = 7;\n\n /// Catches drift between the precomputed `DEFAULT_*_M_HASH` constants and the\n /// `DEFAULT_*_M_X/Y` curve points they're derived from. If anyone updates the X/Y\n /// constants (or the hashing primitive) without also updating the *_HASH constants,\n /// this test fails and `PublicKeys::default()` would silently produce a stale value.\n #[test]\n fn default_hashes_match_default_points() {\n let npk = hash_public_key(\n EmbeddedCurvePoint { x: DEFAULT_NPK_M_X, y: DEFAULT_NPK_M_Y },\n );\n assert_eq(npk, DEFAULT_NPK_M_HASH);\n\n let ovpk = hash_public_key(\n EmbeddedCurvePoint { x: DEFAULT_OVPK_M_X, y: DEFAULT_OVPK_M_Y },\n );\n assert_eq(ovpk, DEFAULT_OVPK_M_HASH);\n\n let tpk = hash_public_key(\n EmbeddedCurvePoint { x: DEFAULT_TPK_M_X, y: DEFAULT_TPK_M_Y },\n );\n assert_eq(tpk, DEFAULT_TPK_M_HASH);\n\n let mspk = hash_public_key(\n EmbeddedCurvePoint { x: DEFAULT_MSPK_M_X, y: DEFAULT_MSPK_M_Y },\n );\n assert_eq(mspk, DEFAULT_MSPK_M_HASH);\n\n let fbpk = hash_public_key(\n EmbeddedCurvePoint { x: DEFAULT_FBPK_M_X, y: DEFAULT_FBPK_M_Y },\n );\n assert_eq(fbpk, DEFAULT_FBPK_M_HASH);\n }\n\n #[test]\n fn compute_public_keys_hash() {\n let keys = PublicKeys {\n npk_m_hash: 11,\n ivpk_m: IvpkM { inner: EmbeddedCurvePoint { x: 3, y: 4 } },\n ovpk_m_hash: 22,\n tpk_m_hash: 33,\n mspk_m_hash: 44,\n fbpk_m_hash: 55,\n };\n\n let actual = keys.hash().to_field();\n\n let expected_public_keys_hash =\n 0x1e57c605207e2b607720b8e3023f69f5af25683277db5ff3b99f7948213c7878;\n\n assert_eq(actual, expected_public_keys_hash);\n }\n\n #[test]\n fn test_validate_on_curve() {\n let keys = PublicKeys {\n npk_m_hash: 0,\n ivpk_m: IvpkM { inner: EmbeddedCurvePoint::generator().double() },\n ovpk_m_hash: 0,\n tpk_m_hash: 0,\n mspk_m_hash: 0,\n fbpk_m_hash: 0,\n };\n\n keys.validate_on_curve();\n }\n\n #[test(should_fail_with = \"Point not on curve\")]\n fn test_validate_not_on_curve() {\n let keys = PublicKeys {\n npk_m_hash: 0,\n ivpk_m: IvpkM { inner: EmbeddedCurvePoint { x: 3, y: 4 } },\n ovpk_m_hash: 0,\n tpk_m_hash: 0,\n mspk_m_hash: 0,\n fbpk_m_hash: 0,\n };\n\n keys.validate_on_curve();\n }\n\n #[test]\n fn test_validate_non_infinity() {\n let keys = PublicKeys {\n npk_m_hash: 0,\n ivpk_m: IvpkM { inner: EmbeddedCurvePoint::generator().double() },\n ovpk_m_hash: 0,\n tpk_m_hash: 0,\n mspk_m_hash: 0,\n fbpk_m_hash: 0,\n };\n\n keys.validate_non_infinity();\n }\n\n #[test(should_fail_with = \"IvpkM is the point at infinity\")]\n fn test_validate_infinity() {\n let keys = PublicKeys {\n npk_m_hash: 0,\n ivpk_m: IvpkM { inner: EmbeddedCurvePoint::point_at_infinity() },\n ovpk_m_hash: 0,\n tpk_m_hash: 0,\n mspk_m_hash: 0,\n fbpk_m_hash: 0,\n };\n\n keys.validate_non_infinity();\n }\n\n #[test]\n fn compute_default_hash() {\n let keys = PublicKeys::default();\n\n let actual = keys.hash().to_field();\n\n let test_data_default_hash =\n 0x13c13fbec22a396f700180c621fb8c67b830b431fed47d4dd71a20d828829eaa;\n\n assert_eq(actual, test_data_default_hash);\n }\n\n #[test]\n fn serde() {\n let keys = PublicKeys {\n npk_m_hash: 11,\n ivpk_m: IvpkM { inner: EmbeddedCurvePoint { x: 3, y: 4 } },\n ovpk_m_hash: 22,\n tpk_m_hash: 33,\n mspk_m_hash: 44,\n fbpk_m_hash: 55,\n };\n\n let serialized: [Field; PUBLIC_KEYS_LENGTH] = keys.serialize();\n let deserialized = PublicKeys::deserialize(serialized);\n\n assert_eq(keys, deserialized);\n }\n}\n"
2208
2224
  },
2209
- "42": {
2225
+ "43": {
2210
2226
  "function_locations": [
2211
2227
  {
2212
2228
  "name": "Option<T>::none",
@@ -2384,7 +2400,7 @@
2384
2400
  "path": "std/option.nr",
2385
2401
  "source": "use crate::cmp::{Eq, Ord, Ordering};\nuse crate::default::Default;\nuse crate::hash::{Hash, Hasher};\n\n/// Represents a value of type T or its absence.\n/// Use `Option::some(value)` to construct a value or `Option::none()` to record the absence of one.\npub struct Option<T> {\n _is_some: bool,\n _value: T,\n}\n\nimpl<T> Option<T> {\n /// Constructs a None value\n pub fn none() -> Self {\n Self { _is_some: false, _value: crate::mem::zeroed() }\n }\n\n /// Constructs a Some wrapper around the given value\n pub fn some(_value: T) -> Self {\n Self { _is_some: true, _value }\n }\n\n /// True if this Option is None\n pub fn is_none(&self) -> bool {\n !self._is_some\n }\n\n /// True if this Option is Some\n pub fn is_some(&self) -> bool {\n self._is_some\n }\n\n /// Asserts `self.is_some()` and returns the wrapped value.\n pub fn unwrap(self) -> T {\n assert(self._is_some);\n self._value\n }\n\n /// Returns the inner value without asserting `self.is_some()`\n /// Note that if `self` is `None`, there is no guarantee what value will be returned,\n /// only that it will be of type `T`.\n pub fn unwrap_unchecked(self) -> T {\n self._value\n }\n\n /// Returns the wrapped value if `self.is_some()`. Otherwise, returns the given default value.\n pub fn unwrap_or(self, default: T) -> T {\n if self._is_some {\n self._value\n } else {\n default\n }\n }\n\n /// Returns the wrapped value if `self.is_some()`. Otherwise, calls the given function to return\n /// a default value.\n pub fn unwrap_or_else<Env>(self, default: fn[Env]() -> T) -> T {\n if self._is_some {\n self._value\n } else {\n default()\n }\n }\n\n /// Asserts `self.is_some()` with a provided custom message and returns the contained `Some` value\n pub fn expect<let N: u32, MessageTypes>(self, message: fmtstr<N, MessageTypes>) -> T {\n assert(self.is_some(), message);\n self._value\n }\n\n /// If self is `Some(x)`, this returns `Some(f(x))`. Otherwise, this returns `None`.\n pub fn map<U, Env>(self, f: fn[Env](T) -> U) -> Option<U> {\n if self._is_some {\n Option::some(f(self._value))\n } else {\n Option::none()\n }\n }\n\n /// If self is `Some(x)`, this returns `f(x)`. Otherwise, this returns the given default value.\n pub fn map_or<U, Env>(self, default: U, f: fn[Env](T) -> U) -> U {\n if self._is_some {\n f(self._value)\n } else {\n default\n }\n }\n\n /// If self is `Some(x)`, this returns `f(x)`. Otherwise, this returns `default()`.\n pub fn map_or_else<U, Env1, Env2>(self, default: fn[Env1]() -> U, f: fn[Env2](T) -> U) -> U {\n if self._is_some {\n f(self._value)\n } else {\n default()\n }\n }\n\n /// Returns None if self is None. Otherwise, this returns `other`.\n pub fn and(self, other: Self) -> Self {\n if self.is_none() {\n Option::none()\n } else {\n other\n }\n }\n\n /// If self is None, this returns None. Otherwise, this calls the given function\n /// with the Some value contained within self, and returns the result of that call.\n ///\n /// In some languages this function is called `flat_map` or `bind`.\n pub fn and_then<U, Env>(self, f: fn[Env](T) -> Option<U>) -> Option<U> {\n if self._is_some {\n f(self._value)\n } else {\n Option::none()\n }\n }\n\n /// If self is Some, return self. Otherwise, return `other`.\n pub fn or(self, other: Self) -> Self {\n if self._is_some {\n self\n } else {\n other\n }\n }\n\n /// If self is Some, return self. Otherwise, return `default()`.\n pub fn or_else<Env>(self, default: fn[Env]() -> Self) -> Self {\n if self._is_some {\n self\n } else {\n default()\n }\n }\n\n // If only one of the two Options is Some, return that option.\n // Otherwise, if both options are Some or both are None, None is returned.\n pub fn xor(self, other: Self) -> Self {\n if self._is_some {\n if other._is_some {\n Option::none()\n } else {\n self\n }\n } else if other._is_some {\n other\n } else {\n Option::none()\n }\n }\n\n /// Returns `Some(x)` if self is `Some(x)` and `predicate(x)` is true.\n /// Otherwise, this returns `None`\n pub fn filter<Env>(self, predicate: fn[Env](T) -> bool) -> Self {\n if self._is_some {\n if predicate(self._value) {\n self\n } else {\n Option::none()\n }\n } else {\n Option::none()\n }\n }\n\n /// Flattens an Option<Option<T>> into a Option<T>.\n /// This returns None if the outer Option is None. Otherwise, this returns the inner Option.\n pub fn flatten(option: Option<Option<T>>) -> Option<T> {\n if option._is_some {\n option._value\n } else {\n Option::none()\n }\n }\n}\n\nimpl<T> Default for Option<T> {\n fn default() -> Self {\n Option::none()\n }\n}\n\nimpl<T> Eq for Option<T>\nwhere\n T: Eq,\n{\n fn eq(self, other: Self) -> bool {\n if self._is_some == other._is_some {\n if self._is_some {\n self._value == other._value\n } else {\n true\n }\n } else {\n false\n }\n }\n}\n\nimpl<T> Hash for Option<T>\nwhere\n T: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self._is_some.hash(state);\n if self._is_some {\n self._value.hash(state);\n }\n }\n}\n\n// For this impl we're declaring Option::none < Option::some\nimpl<T> Ord for Option<T>\nwhere\n T: Ord,\n{\n fn cmp(self, other: Self) -> Ordering {\n if self._is_some {\n if other._is_some {\n self._value.cmp(other._value)\n } else {\n Ordering::greater()\n }\n } else if other._is_some {\n Ordering::less()\n } else {\n Ordering::equal()\n }\n }\n}\n\nmod tests {\n use crate::cmp::Ord;\n use crate::cmp::Ordering;\n use crate::default::Default as _;\n use super::Option;\n\n #[test]\n fn some_and_none() {\n assert(Option::<u8>::none().is_none());\n assert(!Option::<u8>::none().is_some());\n assert(Option::some(1).is_some());\n assert(!Option::some(1).is_none());\n }\n\n #[test]\n fn unwrap_succeeds() {\n assert_eq(Option::some(1).unwrap(), 1);\n }\n\n #[test(should_fail)]\n fn unwrap_fails() {\n let _ = Option::<u8>::none().unwrap();\n }\n\n #[test]\n fn unwrap_or() {\n assert_eq(Option::some(1).unwrap_or(2), 1);\n assert_eq(Option::none().unwrap_or(2), 2);\n }\n\n #[test]\n fn unwrap_or_else() {\n assert_eq(Option::some(1).unwrap_or_else(|| 2), 1);\n assert_eq(Option::none().unwrap_or_else(|| 2), 2);\n }\n\n #[test]\n fn expect_succeeds() {\n assert_eq(Option::some(1).expect(f\"Should be there\"), 1);\n }\n\n #[test(should_fail_with = \"Should be there\")]\n fn expect_fails() {\n let _ = Option::<u8>::none().expect(f\"Should be there\");\n }\n\n #[test]\n fn map() {\n assert(Option::<u8>::none().map(|x| x + 1).is_none());\n assert_eq(Option::some(1).map(|x| x + 1), Option::some(2));\n }\n\n #[test]\n fn map_or() {\n assert_eq(Option::<u8>::none().map_or(0, |x| x + 1), 0);\n assert_eq(Option::some(1).map_or(0, |x| x + 1), 2);\n }\n\n #[test]\n fn map_or_else() {\n assert_eq(Option::<u8>::none().map_or_else(|| 0, |x| x + 1), 0);\n assert_eq(Option::some(1).map_or_else(|| 0, |x| x + 1), 2);\n }\n\n #[test]\n fn and() {\n assert_eq(Option::<u8>::none().and(Option::none()), Option::none());\n assert_eq(Option::<u8>::none().and(Option::some(1)), Option::none());\n assert_eq(Option::some(1).and(Option::some(2)), Option::some(2));\n assert_eq(Option::some(1).and(Option::none()), Option::none());\n }\n\n #[test]\n fn and_then() {\n assert_eq(Option::<u8>::none().and_then(|_| Option::<u8>::none()), Option::none());\n assert_eq(Option::<u8>::none().and_then(|_| Option::some(1)), Option::none());\n assert_eq(Option::some(1).and_then(|x| Option::some(x + 1)), Option::some(2));\n assert_eq(Option::some(1).and_then(|_| Option::<u8>::none()), Option::none());\n }\n\n #[test]\n fn or() {\n assert_eq(Option::<u8>::none().or(Option::none()), Option::none());\n assert_eq(Option::<u8>::none().or(Option::some(1)), Option::some(1));\n assert_eq(Option::some(1).or(Option::some(2)), Option::some(1));\n assert_eq(Option::some(1).or(Option::none()), Option::some(1));\n }\n\n #[test]\n fn or_else() {\n assert_eq(Option::<u8>::none().or_else(|| Option::none()), Option::none());\n assert_eq(Option::<u8>::none().or_else(|| Option::some(1)), Option::some(1));\n assert_eq(Option::some(1).or_else(|| Option::some(2)), Option::some(1));\n assert_eq(Option::some(1).or_else(|| Option::none()), Option::some(1));\n }\n\n #[test]\n fn xor() {\n assert_eq(Option::<u8>::none().xor(Option::none()), Option::none());\n assert_eq(Option::<u8>::none().xor(Option::some(1)), Option::some(1));\n assert_eq(Option::some(1).xor(Option::some(2)), Option::none());\n assert_eq(Option::some(1).xor(Option::none()), Option::some(1));\n }\n\n #[test]\n fn filter() {\n assert_eq(Option::<u8>::none().filter(|_| true), Option::none());\n assert_eq(Option::some(1).filter(|x| x == 1), Option::some(1));\n assert_eq(Option::some(1).filter(|x| x == 2), Option::none());\n assert_eq(Option::some(1).filter(|x| x == 2), Option::none());\n }\n\n #[test]\n fn flatten() {\n assert_eq(Option::<Option<u8>>::none().flatten(), Option::none());\n assert_eq(Option::some(Option::<u8>::none()).flatten(), Option::none());\n assert_eq(Option::some(Option::some(1)).flatten(), Option::some(1));\n }\n\n #[test]\n fn default() {\n assert_eq(Option::<u8>::default(), Option::none());\n }\n\n #[test]\n fn eq() {\n assert(Option::<u8>::none() == Option::none());\n assert(Option::<u8>::some(1) != Option::none());\n assert(Option::<u8>::none() != Option::some(1));\n assert(Option::<u8>::some(1) == Option::some(1));\n assert(Option::<u8>::some(1) != Option::some(2));\n }\n\n #[test]\n fn cmp() {\n let none = Option::<u8>::none();\n let one = Option::<u8>::some(1);\n let two = Option::<u8>::some(2);\n assert_eq(none.cmp(none), Ordering::equal());\n assert_eq(none.cmp(one), Ordering::less());\n assert_eq(one.cmp(none), Ordering::greater());\n assert_eq(one.cmp(one), Ordering::equal());\n assert_eq(one.cmp(two), Ordering::less());\n assert_eq(two.cmp(one), Ordering::greater());\n }\n}\n"
2386
2402
  },
2387
- "43": {
2403
+ "44": {
2388
2404
  "function_locations": [
2389
2405
  {
2390
2406
  "name": "panic",
@@ -2398,7 +2414,7 @@
2398
2414
  "path": "std/panic.nr",
2399
2415
  "source": "/// Halt the program at runtime with the given error message.\n///\n/// The provided error message must be either a `str` or a `fmtstr`.\npub fn panic<T, U>(message: T) -> U\nwhere\n T: StringLike,\n{\n assert(false, message);\n crate::mem::zeroed()\n}\n\ntrait StringLike {}\n\nimpl<let N: u32> StringLike for str<N> {}\nimpl<let N: u32, T> StringLike for fmtstr<N, T> {}\n\nmod tests {\n use crate::prelude::panic;\n\n #[test(should_fail_with = \"OH NO\")]\n fn panics() {\n panic(\"OH NO\");\n }\n}\n"
2400
2416
  },
2401
- "439": {
2417
+ "440": {
2402
2418
  "function_locations": [
2403
2419
  {
2404
2420
  "name": "Reader<N>::new",
@@ -2448,7 +2464,7 @@
2448
2464
  "path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/serde/src/reader.nr",
2449
2465
  "source": "pub struct Reader<let N: u32> {\n data: [Field; N],\n offset: u32,\n}\n\nimpl<let N: u32> Reader<N> {\n pub fn new(data: [Field; N]) -> Self {\n Self { data, offset: 0 }\n }\n\n pub fn read(&mut self) -> Field {\n let result = self.data[self.offset];\n self.offset += 1;\n result\n }\n\n pub fn read_u32(&mut self) -> u32 {\n self.read() as u32\n }\n\n pub fn read_u64(&mut self) -> u64 {\n self.read() as u64\n }\n\n pub fn read_bool(&mut self) -> bool {\n self.read() != 0\n }\n\n pub fn read_array<let K: u32>(&mut self) -> [Field; K] {\n let mut result = [0; K];\n for i in 0..K {\n result[i] = self.data[self.offset + i];\n }\n self.offset += K;\n result\n }\n\n pub fn read_struct<T, let K: u32>(&mut self, deserialise: fn([Field; K]) -> T) -> T {\n let result = deserialise(self.read_array());\n result\n }\n\n pub fn read_struct_array<T, let K: u32, let C: u32>(\n &mut self,\n deserialise: fn([Field; K]) -> T,\n mut result: [T; C],\n ) -> [T; C] {\n for i in 0..C {\n result[i] = self.read_struct(deserialise);\n }\n result\n }\n\n pub fn peek_offset(&mut self, offset: u32) -> Field {\n self.data[self.offset + offset]\n }\n\n pub fn advance_offset(&mut self, offset: u32) {\n self.offset += offset;\n }\n\n pub fn finish(self) {\n assert_eq(self.offset, self.data.len(), \"Reader did not read all data\");\n }\n}\n"
2450
2466
  },
2451
- "440": {
2467
+ "441": {
2452
2468
  "function_locations": [
2453
2469
  {
2454
2470
  "name": "derive_serialize",
@@ -2474,7 +2490,7 @@
2474
2490
  "path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/serde/src/serialization.nr",
2475
2491
  "source": "use crate::{reader::Reader, writer::Writer};\n\n/// Trait for serializing Noir types into arrays of Fields.\n///\n/// An implementation of the Serialize trait has to follow Noir's intrinsic serialization (each member of a struct\n/// converted directly into one or more Fields without any packing or compression). This trait (and Deserialize) are\n/// typically used to communicate between Noir and TypeScript (via oracles and function arguments).\n///\n/// # On Following Noir's Intrinsic Serialization\n/// When calling a Noir function from TypeScript (TS), first the function arguments are serialized into an array\n/// of fields. This array is then included in the initial witness. Noir's intrinsic serialization is then used\n/// to deserialize the arguments from the witness. When the same Noir function is called from Noir this Serialize trait\n/// is used instead of the serialization in TS. For this reason we need to have a match between TS serialization,\n/// Noir's intrinsic serialization and the implementation of this trait. If there is a mismatch, the function calls\n/// fail with an arguments hash mismatch error message.\n///\n/// # Associated Constants\n/// * `N` - The length of the output Field array, known at compile time\n///\n/// # Example\n/// ```\n/// impl<let N: u32> Serialize for str<N> {\n/// let N: u32 = N;\n///\n/// fn serialize(self) -> [Field; Self::N] {\n/// let mut writer: Writer<Self::N> = Writer::new();\n/// self.stream_serialize(&mut writer);\n/// writer.finish()\n/// }\n///\n/// fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n/// let bytes = self.as_bytes();\n/// for i in 0..bytes.len() {\n/// writer.write(bytes[i] as Field);\n/// }\n/// }\n/// }\n/// ```\n#[derive_via(derive_serialize)]\npub trait Serialize {\n let N: u32;\n\n fn serialize(self) -> [Field; Self::N];\n\n fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>);\n}\n\n/// Generates a `Serialize` trait implementation for a struct type.\n///\n/// # Parameters\n/// - `s`: The struct type definition to generate the implementation for\n///\n/// # Returns\n/// A quoted code block containing the trait implementation\n///\n/// # Example\n/// For a struct defined as:\n/// ```\n/// struct Log<N> {\n/// fields: [Field; N],\n/// length: u32\n/// }\n/// ```\n///\n/// This function generates code equivalent to:\n/// ```\n/// impl<let N: u32> Serialize for Log<N> {\n/// let N: u32 = <[Field; N] as Serialize>::N + <u32 as Serialize>::N;\n///\n/// fn serialize(self) -> [Field; Self::N] {\n/// let mut writer: Writer<Self::N> = Writer::new();\n/// self.stream_serialize(&mut writer);\n/// writer.finish()\n/// }\n///\n/// #[inline_always]\n/// fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n/// Serialize::stream_serialize(self.fields, writer);\n/// Serialize::stream_serialize(self.length, writer);\n/// }\n/// }\n/// ```\npub comptime fn derive_serialize(s: TypeDefinition) -> Quoted {\n let typ = s.as_type();\n let nested_struct = typ.as_data_type().unwrap();\n\n // We care only about the name and type so we drop the last item of the tuple\n let params = nested_struct.0.fields(nested_struct.1).map(|(name, typ, _)| (name, typ));\n\n // Generates the generic parameter declarations (to be placed after the `impl` keyword) and the `where` clause\n // for the `Serialize` trait.\n let generics_declarations = get_generics_declarations(s);\n let where_serialize_clause = get_where_trait_clause(s, quote { Serialize });\n\n let params_len_quote = get_params_len_quote(params);\n\n let function_body = params\n .map(|(name, _typ): (Quoted, Type)| {\n quote {\n $crate::serialization::Serialize::stream_serialize(self.$name, writer);\n }\n })\n .join(quote {});\n\n quote {\n impl$generics_declarations $crate::serialization::Serialize for $typ\n $where_serialize_clause\n {\n let N: u32 = $params_len_quote;\n\n\n fn serialize(self) -> [Field; Self::N] {\n let mut writer: $crate::writer::Writer<Self::N> = $crate::writer::Writer::new();\n $crate::serialization::Serialize::stream_serialize(self, &mut writer);\n writer.finish()\n }\n\n\n #[inline_always]\n fn stream_serialize<let K: u32>(self, writer: &mut $crate::writer::Writer<K>) {\n $function_body\n }\n }\n }\n}\n\n/// Trait for deserializing Noir types from arrays of Fields.\n///\n/// An implementation of the Deserialize trait has to follow Noir's intrinsic serialization (each member of a struct\n/// converted directly into one or more Fields without any packing or compression). This trait is typically used when\n/// deserializing return values from function calls in Noir. Since the same function could be called from TypeScript\n/// (TS), in which case the TS deserialization would get used, we need to have a match between the 2.\n///\n/// # Associated Constants\n/// * `N` - The length of the input Field array, known at compile time\n///\n/// # Example\n/// ```\n/// impl<let M: u32> Deserialize for str<M> {\n/// let N: u32 = M;\n///\n/// fn deserialize(fields: [Field; Self::N]) -> Self {\n/// let mut reader = Reader::new(fields);\n/// let result = Self::stream_deserialize(&mut reader);\n/// reader.finish();\n/// result\n/// }\n///\n/// fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self {\n/// let mut bytes = [0 as u8; M];\n/// for i in 0..M {\n/// bytes[i] = reader.read() as u8;\n/// }\n/// str::<M>::from(bytes)\n/// }\n/// }\n/// ```\n#[derive_via(derive_deserialize)]\npub trait Deserialize {\n let N: u32;\n\n fn deserialize(fields: [Field; Self::N]) -> Self;\n\n fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self;\n}\n\n/// Generates a `Deserialize` trait implementation for a given struct `s`.\n///\n/// # Arguments\n/// * `s` - The struct type definition to generate the implementation for\n///\n/// # Returns\n/// A `Quoted` block containing the generated trait implementation\n///\n/// # Requirements\n/// Each struct member type must implement the `Deserialize` trait (it gets used in the generated code).\n///\n/// # Example\n/// For a struct like:\n/// ```\n/// struct MyStruct {\n/// x: AztecAddress,\n/// y: Field,\n/// }\n/// ```\n///\n/// This generates:\n/// ```\n/// impl Deserialize for MyStruct {\n/// let N: u32 = <AztecAddress as Deserialize>::N + <Field as Deserialize>::N;\n///\n/// fn deserialize(fields: [Field; Self::N]) -> Self {\n/// let mut reader = Reader::new(fields);\n/// let result = Self::stream_deserialize(&mut reader);\n/// reader.finish();\n/// result\n/// }\n///\n/// #[inline_always]\n/// fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self {\n/// let x = <AztecAddress as Deserialize>::stream_deserialize(reader);\n/// let y = <Field as Deserialize>::stream_deserialize(reader);\n/// Self { x, y }\n/// }\n/// }\n/// ```\npub comptime fn derive_deserialize(s: TypeDefinition) -> Quoted {\n let typ = s.as_type();\n let nested_struct = typ.as_data_type().unwrap();\n let params = nested_struct.0.fields(nested_struct.1);\n\n // Generates the generic parameter declarations (to be placed after the `impl` keyword) and the `where` clause\n // for the `Deserialize` trait.\n let generics_declarations = get_generics_declarations(s);\n let where_deserialize_clause = get_where_trait_clause(s, quote { Deserialize });\n\n // The following will give us:\n // <type_of_struct_member_1 as Deserialize>::N + <type_of_struct_member_2 as Deserialize>::N + ...\n // (or 0 if the struct has no members)\n let right_hand_side_of_definition_of_n = if params.len() > 0 {\n params\n .map(|(_, param_type, _): (Quoted, Type, Quoted)| {\n quote {\n <$param_type as $crate::serialization::Deserialize>::N\n }\n })\n .join(quote {+})\n } else {\n quote { 0 }\n };\n\n // For structs containing a single member, we can enhance performance by directly deserializing the input array,\n // bypassing the need for loop-based array construction. While this optimization yields significant benefits in\n // Brillig where the loops are expected to not be optimized, it is not relevant in ACIR where the loops are\n // expected to be optimized away.\n let function_body = if params.len() > 1 {\n // This generates deserialization code for each struct member and concatenates them together.\n let deserialization_of_struct_members = params\n .map(|(param_name, param_type, _): (Quoted, Type, Quoted)| {\n quote {\n let $param_name = <$param_type as Deserialize>::stream_deserialize(reader);\n }\n })\n .join(quote {});\n\n // We join the struct member names with a comma to be used in the `Self { ... }` syntax\n // This will give us e.g. `a, b, c` for a struct with three fields named `a`, `b`, and `c`.\n let struct_members = params\n .map(|(param_name, _, _): (Quoted, Type, Quoted)| quote { $param_name })\n .join(quote {,});\n\n quote {\n $deserialization_of_struct_members\n\n Self { $struct_members }\n }\n } else if params.len() == 1 {\n let param_name = params[0].0;\n quote {\n Self { $param_name: $crate::serialization::Deserialize::stream_deserialize(reader) }\n }\n } else {\n quote {\n Self {}\n }\n };\n\n quote {\n impl$generics_declarations $crate::serialization::Deserialize for $typ\n $where_deserialize_clause\n {\n let N: u32 = $right_hand_side_of_definition_of_n;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n let mut reader = $crate::reader::Reader::new(fields);\n let result = Self::stream_deserialize(&mut reader);\n reader.finish();\n result\n }\n\n #[inline_always]\n fn stream_deserialize<let K: u32>(reader: &mut $crate::reader::Reader<K>) -> Self {\n $function_body\n }\n }\n }\n}\n\n/// Generates a quoted expression that computes the total serialized length of function parameters.\n///\n/// # Parameters\n/// * `params` - An array of tuples where each tuple contains a quoted parameter name and its Type. The type needs\n/// to implement the Serialize trait.\n///\n/// # Returns\n/// A quoted expression that evaluates to:\n/// * `0` if there are no parameters\n/// * `(<type1 as Serialize>::N + <type2 as Serialize>::N + ...)` for one or more parameters\ncomptime fn get_params_len_quote(params: [(Quoted, Type)]) -> Quoted {\n if params.len() == 0 {\n quote { 0 }\n } else {\n let params_quote_without_parentheses = params\n .map(|(_, param_type): (Quoted, Type)| {\n quote {\n <$param_type as $crate::serialization::Serialize>::N\n }\n })\n .join(quote {+});\n quote { ($params_quote_without_parentheses) }\n }\n}\n\ncomptime fn get_generics_declarations(s: TypeDefinition) -> Quoted {\n let generics = s.generics();\n\n if generics.len() > 0 {\n let generics_declarations_items = generics\n .map(|(name, maybe_integer_typ)| {\n // The second item in the generics tuple is an Option of an integer type that is Some only if\n // the generic is numeric.\n if maybe_integer_typ.is_some() {\n // The generic is numeric, so we return a quote defined as e.g. \"let N: u32\"\n let integer_type = maybe_integer_typ.unwrap();\n quote {let $name: $integer_type}\n } else {\n // The generic is not numeric, so we return a quote containing the name of the generic (e.g. \"T\")\n quote { $name }\n }\n })\n .join(quote {,});\n quote {<$generics_declarations_items>}\n } else {\n // The struct doesn't have any generics defined, so we just return an empty quote.\n quote {}\n }\n}\n\ncomptime fn get_where_trait_clause(s: TypeDefinition, trait_name: Quoted) -> Quoted {\n let generics = s.generics();\n\n // The second item in the generics tuple is an Option of an integer type that is Some only if the generic is\n // numeric.\n let non_numeric_generics =\n generics.filter(|(_, maybe_integer_typ)| maybe_integer_typ.is_none());\n\n if non_numeric_generics.len() > 0 {\n let non_numeric_generics_declarations =\n non_numeric_generics.map(|(name, _)| quote {$name: $trait_name}).join(quote {,});\n quote {where $non_numeric_generics_declarations}\n } else {\n // There are no non-numeric generics, so we return an empty quote.\n quote {}\n }\n}\n"
2476
2492
  },
2477
- "442": {
2493
+ "443": {
2478
2494
  "function_locations": [
2479
2495
  {
2480
2496
  "name": "<impl Serialize for bool>::serialize",
@@ -2788,7 +2804,7 @@
2788
2804
  "path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/serde/src/type_impls.nr",
2789
2805
  "source": "use crate::{reader::Reader, serialization::{Deserialize, Serialize}, writer::Writer};\nuse std::embedded_curve_ops::EmbeddedCurvePoint;\nuse std::embedded_curve_ops::EmbeddedCurveScalar;\n\nglobal BOOL_SERIALIZED_LEN: u32 = 1;\nglobal U8_SERIALIZED_LEN: u32 = 1;\nglobal U16_SERIALIZED_LEN: u32 = 1;\nglobal U32_SERIALIZED_LEN: u32 = 1;\nglobal U64_SERIALIZED_LEN: u32 = 1;\nglobal U128_SERIALIZED_LEN: u32 = 1;\nglobal FIELD_SERIALIZED_LEN: u32 = 1;\nglobal I8_SERIALIZED_LEN: u32 = 1;\nglobal I16_SERIALIZED_LEN: u32 = 1;\nglobal I32_SERIALIZED_LEN: u32 = 1;\nglobal I64_SERIALIZED_LEN: u32 = 1;\n\nimpl Serialize for bool {\n let N: u32 = BOOL_SERIALIZED_LEN;\n\n fn serialize(self) -> [Field; Self::N] {\n let mut writer: Writer<Self::N> = Writer::new();\n self.stream_serialize(&mut writer);\n writer.finish()\n }\n\n #[inline_always]\n fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n writer.write(self as Field);\n }\n}\n\nimpl Deserialize for bool {\n let N: u32 = BOOL_SERIALIZED_LEN;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n let mut reader = Reader::new(fields);\n let result = Self::stream_deserialize(&mut reader);\n reader.finish();\n result\n }\n\n #[inline_always]\n fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> bool {\n reader.read() != 0\n }\n}\n\nimpl Serialize for u8 {\n let N: u32 = U8_SERIALIZED_LEN;\n\n fn serialize(self) -> [Field; Self::N] {\n let mut writer: Writer<Self::N> = Writer::new();\n self.stream_serialize(&mut writer);\n writer.finish()\n }\n\n #[inline_always]\n fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n writer.write(self as Field);\n }\n}\n\nimpl Deserialize for u8 {\n let N: u32 = U8_SERIALIZED_LEN;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n let mut reader = Reader::new(fields);\n let result = Self::stream_deserialize(&mut reader);\n reader.finish();\n result\n }\n\n #[inline_always]\n fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self {\n reader.read() as u8\n }\n}\n\nimpl Serialize for u16 {\n let N: u32 = U16_SERIALIZED_LEN;\n\n fn serialize(self) -> [Field; Self::N] {\n let mut writer: Writer<Self::N> = Writer::new();\n self.stream_serialize(&mut writer);\n writer.finish()\n }\n\n #[inline_always]\n fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n writer.write(self as Field);\n }\n}\n\nimpl Deserialize for u16 {\n let N: u32 = U16_SERIALIZED_LEN;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n let mut reader = Reader::new(fields);\n let result = Self::stream_deserialize(&mut reader);\n reader.finish();\n result\n }\n\n #[inline_always]\n fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self {\n reader.read() as u16\n }\n}\n\nimpl Serialize for u32 {\n let N: u32 = U32_SERIALIZED_LEN;\n\n fn serialize(self) -> [Field; Self::N] {\n let mut writer: Writer<Self::N> = Writer::new();\n self.stream_serialize(&mut writer);\n writer.finish()\n }\n\n #[inline_always]\n fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n writer.write(self as Field);\n }\n}\n\nimpl Deserialize for u32 {\n let N: u32 = U32_SERIALIZED_LEN;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n let mut reader = Reader::new(fields);\n let result = Self::stream_deserialize(&mut reader);\n reader.finish();\n result\n }\n\n #[inline_always]\n fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self {\n reader.read() as u32\n }\n}\n\nimpl Serialize for u64 {\n let N: u32 = U64_SERIALIZED_LEN;\n\n fn serialize(self) -> [Field; Self::N] {\n let mut writer: Writer<Self::N> = Writer::new();\n self.stream_serialize(&mut writer);\n writer.finish()\n }\n\n #[inline_always]\n fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n writer.write(self as Field);\n }\n}\n\nimpl Deserialize for u64 {\n let N: u32 = U64_SERIALIZED_LEN;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n let mut reader = Reader::new(fields);\n let result = Self::stream_deserialize(&mut reader);\n reader.finish();\n result\n }\n\n #[inline_always]\n fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self {\n reader.read() as u64\n }\n}\n\nimpl Serialize for u128 {\n let N: u32 = U128_SERIALIZED_LEN;\n\n fn serialize(self) -> [Field; Self::N] {\n let mut writer: Writer<Self::N> = Writer::new();\n self.stream_serialize(&mut writer);\n writer.finish()\n }\n\n #[inline_always]\n fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n writer.write(self as Field);\n }\n}\n\nimpl Deserialize for u128 {\n let N: u32 = U128_SERIALIZED_LEN;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n let mut reader = Reader::new(fields);\n let result = Self::stream_deserialize(&mut reader);\n reader.finish();\n result\n }\n\n #[inline_always]\n fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self {\n reader.read() as u128\n }\n}\n\nimpl Serialize for Field {\n let N: u32 = FIELD_SERIALIZED_LEN;\n\n fn serialize(self) -> [Field; Self::N] {\n let mut writer: Writer<Self::N> = Writer::new();\n self.stream_serialize(&mut writer);\n writer.finish()\n }\n\n #[inline_always]\n fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n writer.write(self);\n }\n}\n\nimpl Deserialize for Field {\n let N: u32 = FIELD_SERIALIZED_LEN;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n let mut reader = Reader::new(fields);\n let result = Self::stream_deserialize(&mut reader);\n reader.finish();\n result\n }\n\n #[inline_always]\n fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self {\n reader.read()\n }\n}\n\nimpl Serialize for i8 {\n let N: u32 = I8_SERIALIZED_LEN;\n\n fn serialize(self) -> [Field; Self::N] {\n let mut writer: Writer<Self::N> = Writer::new();\n self.stream_serialize(&mut writer);\n writer.finish()\n }\n\n #[inline_always]\n fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n writer.write(self as u8 as Field);\n }\n}\n\nimpl Deserialize for i8 {\n let N: u32 = I8_SERIALIZED_LEN;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n let mut reader = Reader::new(fields);\n let result = Self::stream_deserialize(&mut reader);\n reader.finish();\n result\n }\n\n #[inline_always]\n fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self {\n reader.read() as u8 as i8\n }\n}\n\nimpl Serialize for i16 {\n let N: u32 = I16_SERIALIZED_LEN;\n\n fn serialize(self) -> [Field; Self::N] {\n let mut writer: Writer<Self::N> = Writer::new();\n self.stream_serialize(&mut writer);\n writer.finish()\n }\n\n #[inline_always]\n fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n writer.write(self as u16 as Field);\n }\n}\n\nimpl Deserialize for i16 {\n let N: u32 = I16_SERIALIZED_LEN;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n let mut reader = Reader::new(fields);\n let result = Self::stream_deserialize(&mut reader);\n reader.finish();\n result\n }\n\n #[inline_always]\n fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self {\n reader.read() as u16 as i16\n }\n}\n\nimpl Serialize for i32 {\n let N: u32 = I32_SERIALIZED_LEN;\n\n fn serialize(self) -> [Field; Self::N] {\n let mut writer: Writer<Self::N> = Writer::new();\n self.stream_serialize(&mut writer);\n writer.finish()\n }\n\n #[inline_always]\n fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n writer.write(self as u32 as Field);\n }\n}\n\nimpl Deserialize for i32 {\n let N: u32 = I32_SERIALIZED_LEN;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n let mut reader = Reader::new(fields);\n let result = Self::stream_deserialize(&mut reader);\n reader.finish();\n result\n }\n\n #[inline_always]\n fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self {\n reader.read() as u32 as i32\n }\n}\n\nimpl Serialize for i64 {\n let N: u32 = I64_SERIALIZED_LEN;\n\n fn serialize(self) -> [Field; Self::N] {\n let mut writer: Writer<Self::N> = Writer::new();\n self.stream_serialize(&mut writer);\n writer.finish()\n }\n\n #[inline_always]\n fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n writer.write(self as u64 as Field);\n }\n}\n\nimpl Deserialize for i64 {\n let N: u32 = I64_SERIALIZED_LEN;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n let mut reader = Reader::new(fields);\n let result = Self::stream_deserialize(&mut reader);\n reader.finish();\n result\n }\n\n #[inline_always]\n fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self {\n reader.read() as u64 as i64\n }\n}\n\nimpl<T, let M: u32> Serialize for [T; M]\nwhere\n T: Serialize,\n{\n let N: u32 = <T as Serialize>::N * M;\n\n fn serialize(self) -> [Field; Self::N] {\n let mut writer: Writer<Self::N> = Writer::new();\n self.stream_serialize(&mut writer);\n writer.finish()\n }\n\n #[inline_always]\n fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n for i in 0..M {\n self[i].stream_serialize(writer);\n }\n }\n}\n\nimpl<T, let M: u32> Deserialize for [T; M]\nwhere\n T: Deserialize,\n{\n let N: u32 = <T as Deserialize>::N * M;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n let mut reader = Reader::new(fields);\n let result = Self::stream_deserialize(&mut reader);\n reader.finish();\n result\n }\n\n #[inline_always]\n fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self {\n let mut result: [T; M] = std::mem::zeroed();\n for i in 0..M {\n result[i] = T::stream_deserialize(reader);\n }\n result\n }\n}\n\nimpl<T> Serialize for Option<T>\nwhere\n T: Serialize,\n{\n let N: u32 = <T as Serialize>::N + 1;\n\n fn serialize(self) -> [Field; Self::N] {\n let mut writer: Writer<Self::N> = Writer::new();\n self.stream_serialize(&mut writer);\n writer.finish()\n }\n\n #[inline_always]\n fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n writer.write_bool(self.is_some());\n if self.is_some() {\n self.unwrap_unchecked().stream_serialize(writer);\n } else {\n writer.advance_offset(<T as Serialize>::N);\n }\n }\n}\n\nimpl<T> Deserialize for Option<T>\nwhere\n T: Deserialize,\n{\n let N: u32 = <T as Deserialize>::N + 1;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n let mut reader = Reader::new(fields);\n let result = Self::stream_deserialize(&mut reader);\n reader.finish();\n result\n }\n\n #[inline_always]\n fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self {\n if reader.read_bool() {\n Option::some(<T as Deserialize>::stream_deserialize(reader))\n } else {\n reader.advance_offset(<T as Deserialize>::N);\n Option::none()\n }\n }\n}\n\nglobal SCALAR_SIZE: u32 = 2;\n\nimpl Serialize for EmbeddedCurveScalar {\n\n let N: u32 = SCALAR_SIZE;\n\n fn serialize(self) -> [Field; SCALAR_SIZE] {\n [self.lo, self.hi]\n }\n\n #[inline_always]\n fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n writer.write(self.lo);\n writer.write(self.hi);\n }\n}\n\nimpl Deserialize for EmbeddedCurveScalar {\n let N: u32 = SCALAR_SIZE;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n Self { lo: fields[0], hi: fields[1] }\n }\n\n #[inline_always]\n fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self {\n Self { lo: reader.read(), hi: reader.read() }\n }\n}\n\nglobal POINT_SIZE: u32 = 2;\n\nimpl Serialize for EmbeddedCurvePoint {\n let N: u32 = POINT_SIZE;\n\n fn serialize(self) -> [Field; Self::N] {\n [self.x, self.y]\n }\n\n fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n writer.write(self.x);\n writer.write(self.y);\n }\n}\n\nimpl Deserialize for EmbeddedCurvePoint {\n let N: u32 = POINT_SIZE;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n Self { x: fields[0], y: fields[1] }\n }\n\n #[inline_always]\n fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self {\n Self { x: reader.read(), y: reader.read() }\n }\n}\n\nimpl<let M: u32> Deserialize for str<M> {\n let N: u32 = M;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n let mut reader = Reader::new(fields);\n let result = Self::stream_deserialize(&mut reader);\n reader.finish();\n result\n }\n\n #[inline_always]\n fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self {\n let u8_arr = <[u8; Self::N] as Deserialize>::stream_deserialize(reader);\n str::<Self::N>::from(u8_arr)\n }\n}\n\nimpl<let M: u32> Serialize for str<M> {\n let N: u32 = M;\n\n fn serialize(self) -> [Field; Self::N] {\n let mut writer: Writer<Self::N> = Writer::new();\n self.stream_serialize(&mut writer);\n writer.finish()\n }\n\n #[inline_always]\n fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n self.as_bytes().stream_serialize(writer);\n }\n}\n\n// Note: Not deriving this because it's not supported to call derive_serialize on a \"remote\" struct (and it will never\n// be supported).\nimpl<T, let M: u32> Deserialize for BoundedVec<T, M>\nwhere\n T: Deserialize,\n{\n let N: u32 = <T as Deserialize>::N * M + 1;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n let mut reader = Reader::new(fields);\n let result = Self::stream_deserialize(&mut reader);\n reader.finish();\n result\n }\n\n #[inline_always]\n fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self {\n let mut new_bounded_vec: BoundedVec<T, M> = BoundedVec::new();\n let payload_len = Self::N - 1;\n\n // Length is stored in the last field as we need to match intrinsic Noir serialization and the `len` struct\n // field is after `storage` struct field (see `bounded_vec.nr` in noir-stdlib)\n let len = reader.peek_offset(payload_len) as u32;\n\n for i in 0..M {\n if i < len {\n new_bounded_vec.push(<T as Deserialize>::stream_deserialize(reader));\n }\n }\n\n // +1 for the length of the BoundedVec\n reader.advance_offset((M - len) * <T as Deserialize>::N + 1);\n\n new_bounded_vec\n }\n}\n\n// This may cause issues if used as program input, because noir disallows empty arrays for program input.\n// I think this is okay because I don't foresee a unit type being used as input. But leaving this comment as a hint\n// if someone does run into this in the future.\nimpl Deserialize for () {\n let N: u32 = 0;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n let mut reader = Reader::new(fields);\n let result = Self::stream_deserialize(&mut reader);\n reader.finish();\n result\n }\n\n #[inline_always]\n fn stream_deserialize<let K: u32>(_reader: &mut Reader<K>) -> Self {\n ()\n }\n}\n\n// Note: Not deriving this because it's not supported to call derive_serialize on a \"remote\" struct (and it will never\n// be supported).\nimpl<T, let M: u32> Serialize for BoundedVec<T, M>\nwhere\n T: Serialize,\n{\n let N: u32 = <T as Serialize>::N * M + 1; // +1 for the length of the BoundedVec\n\n fn serialize(self) -> [Field; Self::N] {\n let mut writer: Writer<Self::N> = Writer::new();\n self.stream_serialize(&mut writer);\n writer.finish()\n }\n\n #[inline_always]\n fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n self.storage().stream_serialize(writer);\n // Length is stored in the last field as we need to match intrinsic Noir serialization and the `len` struct\n // field is after `storage` struct field (see `bounded_vec.nr` in noir-stdlib)\n writer.write_u32(self.len() as u32);\n }\n}\n\n// Create a slice of the given length with each element made from `f(i)` where `i` is the current index\ncomptime fn make_slice<Env, T>(length: u32, f: fn[Env](u32) -> T) -> [T] {\n let mut slice = @[];\n for i in 0..length {\n slice = slice.push_back(f(i));\n }\n slice\n}\n\n// Implements Serialize and Deserialize for an arbitrary tuple type\ncomptime fn impl_serialize_for_tuple(_m: Module, length: u32) -> Quoted {\n // `T0`, `T1`, `T2`\n let type_names = make_slice(length, |i| f\"T{i}\".quoted_contents());\n\n // `result0`, `result1`, `result2`\n let result_names = make_slice(length, |i| f\"result{i}\".quoted_contents());\n\n // `T0, T1, T2`\n let field_generics = type_names.join(quote [,]);\n\n // `<T0 as Serialize>::N + <T1 as Serialize>::N + <T2 as Serialize>::N`\n let full_size_serialize = type_names\n .map(|type_name| quote {\n <$type_name as Serialize>::N\n })\n .join(quote [+]);\n\n // `<T0 as Deserialize>::N + <T1 as Deserialize>::N + <T2 as Deserialize>::N`\n let full_size_deserialize = type_names\n .map(|type_name| quote {\n <$type_name as Deserialize>::N\n })\n .join(quote [+]);\n\n // `T0: Serialize, T1: Serialize, T2: Serialize,`\n let serialize_constraints = type_names\n .map(|field_name| quote {\n $field_name: Serialize,\n })\n .join(quote []);\n\n // `T0: Deserialize, T1: Deserialize, T2: Deserialize,`\n let deserialize_constraints = type_names\n .map(|field_name| quote {\n $field_name: Deserialize,\n })\n .join(quote []);\n\n // Statements to serialize each field\n let serialized_fields = type_names\n .mapi(|i, _type_name| quote {\n $crate::serialization::Serialize::stream_serialize(self.$i, writer);\n })\n .join(quote []);\n\n // Statements to deserialize each field\n let deserialized_fields = type_names\n .mapi(|i, type_name| {\n let result_name = result_names[i];\n quote {\n let $result_name = <$type_name as $crate::serialization::Deserialize>::stream_deserialize(reader);\n }\n })\n .join(quote []);\n let deserialize_results = result_names.join(quote [,]);\n\n quote {\n impl<$field_generics> Serialize for ($field_generics) where $serialize_constraints {\n let N: u32 = $full_size_serialize;\n\n fn serialize(self) -> [Field; Self::N] {\n let mut writer: $crate::writer::Writer<Self::N> = $crate::writer::Writer::new();\n self.stream_serialize(&mut writer);\n writer.finish()\n }\n\n #[inline_always]\n fn stream_serialize<let K: u32>(self, writer: &mut $crate::writer::Writer<K>) {\n\n $serialized_fields\n }\n }\n\n impl<$field_generics> Deserialize for ($field_generics) where $deserialize_constraints {\n let N: u32 = $full_size_deserialize;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n let mut reader = $crate::reader::Reader::new(fields);\n let result = Self::stream_deserialize(&mut reader);\n reader.finish();\n result\n }\n \n #[inline_always]\n fn stream_deserialize<let K: u32>(reader: &mut $crate::reader::Reader<K>) -> Self {\n $deserialized_fields\n ($deserialize_results)\n }\n }\n }\n}\n\n// Keeping these manual impls. They are more efficient since they do not\n// require copying sub-arrays from any serialized arrays.\nimpl<T1> Serialize for (T1,)\nwhere\n T1: Serialize,\n{\n let N: u32 = <T1 as Serialize>::N;\n\n fn serialize(self) -> [Field; Self::N] {\n let mut writer: crate::writer::Writer<Self::N> = crate::writer::Writer::new();\n self.stream_serialize(&mut writer);\n writer.finish()\n }\n\n #[inline_always]\n fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n self.0.stream_serialize(writer);\n }\n}\n\nimpl<T1> Deserialize for (T1,)\nwhere\n T1: Deserialize,\n{\n let N: u32 = <T1 as Deserialize>::N;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n let mut reader = crate::reader::Reader::new(fields);\n let result = Self::stream_deserialize(&mut reader);\n reader.finish();\n result\n }\n\n #[inline_always]\n fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self {\n (<T1 as Deserialize>::stream_deserialize(reader),)\n }\n}\n\n#[impl_serialize_for_tuple(2)]\n#[impl_serialize_for_tuple(3)]\n#[impl_serialize_for_tuple(4)]\n#[impl_serialize_for_tuple(5)]\n#[impl_serialize_for_tuple(6)]\nmod impls {\n use crate::serialization::{Deserialize, Serialize};\n}\n\n#[test]\nunconstrained fn bounded_vec_serialization() {\n // Test empty BoundedVec\n let empty_vec: BoundedVec<Field, 3> = BoundedVec::from_array([]);\n let serialized = empty_vec.serialize();\n let deserialized = BoundedVec::<Field, 3>::deserialize(serialized);\n assert_eq(empty_vec, deserialized);\n assert_eq(deserialized.len(), 0);\n\n // Test partially filled BoundedVec\n let partial_vec: BoundedVec<[u32; 2], 3> = BoundedVec::from_array([[1, 2]]);\n let serialized = partial_vec.serialize();\n let deserialized = BoundedVec::<[u32; 2], 3>::deserialize(serialized);\n assert_eq(partial_vec, deserialized);\n assert_eq(deserialized.len(), 1);\n assert_eq(deserialized.get(0), [1, 2]);\n\n // Test full BoundedVec\n let full_vec: BoundedVec<[u32; 2], 3> = BoundedVec::from_array([[1, 2], [3, 4], [5, 6]]);\n let serialized = full_vec.serialize();\n let deserialized = BoundedVec::<[u32; 2], 3>::deserialize(serialized);\n assert_eq(full_vec, deserialized);\n assert_eq(deserialized.len(), 3);\n assert_eq(deserialized.get(0), [1, 2]);\n assert_eq(deserialized.get(1), [3, 4]);\n assert_eq(deserialized.get(2), [5, 6]);\n}\n"
2790
2806
  },
2791
- "443": {
2807
+ "444": {
2792
2808
  "function_locations": [
2793
2809
  {
2794
2810
  "name": "Writer<N>::new",
@@ -2834,7 +2850,7 @@
2834
2850
  "path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/serde/src/writer.nr",
2835
2851
  "source": "pub struct Writer<let N: u32> {\n data: [Field; N],\n offset: u32,\n}\n\nimpl<let N: u32> Writer<N> {\n pub fn new() -> Self {\n Self { data: [0; N], offset: 0 }\n }\n\n pub fn write(&mut self, value: Field) {\n self.data[self.offset] = value;\n self.offset += 1;\n }\n\n pub fn write_u32(&mut self, value: u32) {\n self.write(value as Field);\n }\n\n pub fn write_u64(&mut self, value: u64) {\n self.write(value as Field);\n }\n\n pub fn write_bool(&mut self, value: bool) {\n self.write(value as Field);\n }\n\n pub fn write_array<let K: u32>(&mut self, value: [Field; K]) {\n for i in 0..K {\n self.data[i + self.offset] = value[i];\n }\n self.offset += K;\n }\n\n pub fn write_struct<T, let K: u32>(&mut self, value: T, serialize: fn(T) -> [Field; K]) {\n self.write_array(serialize(value));\n }\n\n pub fn write_struct_array<T, let K: u32, let C: u32>(\n &mut self,\n value: [T; C],\n serialize: fn(T) -> [Field; K],\n ) {\n for i in 0..C {\n self.write_struct(value[i], serialize);\n }\n }\n\n pub fn advance_offset(&mut self, offset: u32) {\n self.offset += offset;\n }\n\n pub fn finish(self) -> [Field; N] {\n assert_eq(self.offset, self.data.len(), \"Writer did not write all data\");\n self.data\n }\n}\n"
2836
2852
  },
2837
- "453": {
2853
+ "454": {
2838
2854
  "function_locations": [
2839
2855
  {
2840
2856
  "name": "verify_signature",
@@ -3190,37 +3206,33 @@
3190
3206
  "path": "std/cmp.nr",
3191
3207
  "source": "use crate::meta::ctstring::AsCtString;\nuse crate::meta::derive_via;\n\n/// Compare two values for equality\n#[derive_via(derive_eq)]\n// docs:start:eq-trait\npub trait Eq {\n fn eq(self, other: Self) -> bool;\n}\n// docs:end:eq-trait\n\n// docs:start:derive_eq\ncomptime fn derive_eq(s: TypeDefinition) -> Quoted {\n let signature = quote { fn eq(_self: Self, _other: Self) -> bool };\n let for_each_field = |name| quote { (_self.$name == _other.$name) };\n let body = |fields| {\n if s.fields_as_written().len() == 0 {\n quote { true }\n } else {\n fields\n }\n };\n crate::meta::make_trait_impl(\n s,\n quote { $crate::cmp::Eq },\n signature,\n for_each_field,\n quote { & },\n body,\n )\n}\n// docs:end:derive_eq\n\nimpl Eq for Field {\n fn eq(self, other: Field) -> bool {\n self == other\n }\n}\n\nimpl Eq for u128 {\n fn eq(self, other: u128) -> bool {\n self == other\n }\n}\nimpl Eq for u64 {\n fn eq(self, other: u64) -> bool {\n self == other\n }\n}\nimpl Eq for u32 {\n fn eq(self, other: u32) -> bool {\n self == other\n }\n}\nimpl Eq for u16 {\n fn eq(self, other: u16) -> bool {\n self == other\n }\n}\nimpl Eq for u8 {\n fn eq(self, other: u8) -> bool {\n self == other\n }\n}\nimpl Eq for i8 {\n fn eq(self, other: i8) -> bool {\n self == other\n }\n}\nimpl Eq for i16 {\n fn eq(self, other: i16) -> bool {\n self == other\n }\n}\nimpl Eq for i32 {\n fn eq(self, other: i32) -> bool {\n self == other\n }\n}\nimpl Eq for i64 {\n fn eq(self, other: i64) -> bool {\n self == other\n }\n}\n\nimpl Eq for () {\n fn eq(_self: Self, _other: ()) -> bool {\n true\n }\n}\nimpl Eq for bool {\n fn eq(self, other: bool) -> bool {\n self == other\n }\n}\n\nimpl<T, let N: u32> Eq for [T; N]\nwhere\n T: Eq,\n{\n fn eq(self, other: [T; N]) -> bool {\n let mut result = true;\n for i in 0..self.len() {\n result &= self[i].eq(other[i]);\n }\n result\n }\n}\n\nimpl<T> Eq for [T]\nwhere\n T: Eq,\n{\n fn eq(self, other: [T]) -> bool {\n let mut result = self.len() == other.len();\n if result {\n for i in 0..self.len() {\n result &= self[i].eq(other[i]);\n }\n }\n result\n }\n}\n\nimpl<let N: u32> Eq for str<N> {\n fn eq(self, other: str<N>) -> bool {\n let self_bytes = self.as_bytes();\n let other_bytes = other.as_bytes();\n self_bytes == other_bytes\n }\n}\n\ncomptime fn make_tuple_eq_body(n: u32) -> Quoted {\n let mut body = f\"self.0.eq(other.0)\".as_ctstring();\n for i in 1u32..n {\n body = body.append_fmtstr(f\" & self.{i}.eq(other.{i})\");\n }\n f\"{body}\".quoted_contents()\n}\n\nimpl<A: Eq> Eq for (A,) {\n fn eq(self, other: (A,)) -> bool {\n self.0 == other.0\n }\n}\n\nimpl<A: Eq, B: Eq> Eq for (A, B) {\n fn eq(self, other: (A, B)) -> bool {\n make_tuple_eq_body!(2u32)\n }\n}\n\nimpl<A: Eq, B: Eq, C: Eq> Eq for (A, B, C) {\n fn eq(self, other: (A, B, C)) -> bool {\n make_tuple_eq_body!(3u32)\n }\n}\n\nimpl<A: Eq, B: Eq, C: Eq, D: Eq> Eq for (A, B, C, D) {\n fn eq(self, other: (A, B, C, D)) -> bool {\n make_tuple_eq_body!(4u32)\n }\n}\n\nimpl<A: Eq, B: Eq, C: Eq, D: Eq, E: Eq> Eq for (A, B, C, D, E) {\n fn eq(self, other: (A, B, C, D, E)) -> bool {\n make_tuple_eq_body!(5u32)\n }\n}\n\nimpl<A: Eq, B: Eq, C: Eq, D: Eq, E: Eq, F: Eq> Eq for (A, B, C, D, E, F) {\n fn eq(self, other: (A, B, C, D, E, F)) -> bool {\n make_tuple_eq_body!(6u32)\n }\n}\n\nimpl<A: Eq, B: Eq, C: Eq, D: Eq, E: Eq, F: Eq, G: Eq> Eq for (A, B, C, D, E, F, G) {\n fn eq(self, other: (A, B, C, D, E, F, G)) -> bool {\n make_tuple_eq_body!(7u32)\n }\n}\n\nimpl<A: Eq, B: Eq, C: Eq, D: Eq, E: Eq, F: Eq, G: Eq, H: Eq> Eq for (A, B, C, D, E, F, G, H) {\n fn eq(self, other: (A, B, C, D, E, F, G, H)) -> bool {\n make_tuple_eq_body!(8u32)\n }\n}\n\nimpl<A: Eq, B: Eq, C: Eq, D: Eq, E: Eq, F: Eq, G: Eq, H: Eq, I: Eq> Eq for (A, B, C, D, E, F, G, H, I) {\n fn eq(self, other: (A, B, C, D, E, F, G, H, I)) -> bool {\n make_tuple_eq_body!(9u32)\n }\n}\n\nimpl<A: Eq, B: Eq, C: Eq, D: Eq, E: Eq, F: Eq, G: Eq, H: Eq, I: Eq, J: Eq> Eq for (A, B, C, D, E, F, G, H, I, J) {\n fn eq(self, other: (A, B, C, D, E, F, G, H, I, J)) -> bool {\n make_tuple_eq_body!(10u32)\n }\n}\n\nimpl<A: Eq, B: Eq, C: Eq, D: Eq, E: Eq, F: Eq, G: Eq, H: Eq, I: Eq, J: Eq, K: Eq> Eq for (A, B, C, D, E, F, G, H, I, J, K) {\n fn eq(self, other: (A, B, C, D, E, F, G, H, I, J, K)) -> bool {\n make_tuple_eq_body!(11u32)\n }\n}\n\nimpl<A: Eq, B: Eq, C: Eq, D: Eq, E: Eq, F: Eq, G: Eq, H: Eq, I: Eq, J: Eq, K: Eq, L: Eq> Eq for (A, B, C, D, E, F, G, H, I, J, K, L) {\n fn eq(self, other: (A, B, C, D, E, F, G, H, I, J, K, L)) -> bool {\n make_tuple_eq_body!(12u32)\n }\n}\n\nimpl Eq for Ordering {\n fn eq(self, other: Ordering) -> bool {\n self.result == other.result\n }\n}\n\n// Noir doesn't have enums yet so we emulate (Lt | Eq | Gt) with a struct\n// that has 3 public functions for constructing the struct.\n/// A value with three states: `Ordering::less()`, `Ordering::equal()` or `Ordering::greater()`.\n/// Most often used to encode the result of a comparison operation.\npub struct Ordering {\n result: Field,\n}\n\nimpl Ordering {\n // Implementation note: 0, 1, and 2 for Lt, Eq, and Gt are built\n // into the compiler, do not change these without also updating\n // the compiler itself!\n pub fn less() -> Ordering {\n Ordering { result: 0 }\n }\n\n pub fn equal() -> Ordering {\n Ordering { result: 1 }\n }\n\n pub fn greater() -> Ordering {\n Ordering { result: 2 }\n }\n}\n\n/// Compare one object to another, returning whether it is less-than, equal-to,\n/// or greater-than the other object.\n#[derive_via(derive_ord)]\n// docs:start:ord-trait\npub trait Ord {\n fn cmp(self, other: Self) -> Ordering;\n}\n// docs:end:ord-trait\n\n// docs:start:derive_ord\ncomptime fn derive_ord(s: TypeDefinition) -> Quoted {\n let name = quote { $crate::cmp::Ord };\n let signature = quote { fn cmp(_self: Self, _other: Self) -> $crate::cmp::Ordering };\n let for_each_field = |name| quote {\n if result == $crate::cmp::Ordering::equal() {\n result = _self.$name.cmp(_other.$name);\n }\n };\n let body = |fields| quote {\n let mut result = $crate::cmp::Ordering::equal();\n $fields\n result\n };\n crate::meta::make_trait_impl(s, name, signature, for_each_field, quote {}, body)\n}\n// docs:end:derive_ord\n\n// Note: Field deliberately does not implement Ord\n\nimpl Ord for u128 {\n fn cmp(self, other: u128) -> Ordering {\n if self < other {\n Ordering::less()\n } else if self > other {\n Ordering::greater()\n } else {\n Ordering::equal()\n }\n }\n}\nimpl Ord for u64 {\n fn cmp(self, other: u64) -> Ordering {\n if self < other {\n Ordering::less()\n } else if self > other {\n Ordering::greater()\n } else {\n Ordering::equal()\n }\n }\n}\n\nimpl Ord for u32 {\n fn cmp(self, other: u32) -> Ordering {\n if self < other {\n Ordering::less()\n } else if self > other {\n Ordering::greater()\n } else {\n Ordering::equal()\n }\n }\n}\n\nimpl Ord for u16 {\n fn cmp(self, other: u16) -> Ordering {\n if self < other {\n Ordering::less()\n } else if self > other {\n Ordering::greater()\n } else {\n Ordering::equal()\n }\n }\n}\n\nimpl Ord for u8 {\n fn cmp(self, other: u8) -> Ordering {\n if self < other {\n Ordering::less()\n } else if self > other {\n Ordering::greater()\n } else {\n Ordering::equal()\n }\n }\n}\n\nimpl Ord for i8 {\n fn cmp(self, other: i8) -> Ordering {\n if self < other {\n Ordering::less()\n } else if self > other {\n Ordering::greater()\n } else {\n Ordering::equal()\n }\n }\n}\n\nimpl Ord for i16 {\n fn cmp(self, other: i16) -> Ordering {\n if self < other {\n Ordering::less()\n } else if self > other {\n Ordering::greater()\n } else {\n Ordering::equal()\n }\n }\n}\n\nimpl Ord for i32 {\n fn cmp(self, other: i32) -> Ordering {\n if self < other {\n Ordering::less()\n } else if self > other {\n Ordering::greater()\n } else {\n Ordering::equal()\n }\n }\n}\n\nimpl Ord for i64 {\n fn cmp(self, other: i64) -> Ordering {\n if self < other {\n Ordering::less()\n } else if self > other {\n Ordering::greater()\n } else {\n Ordering::equal()\n }\n }\n}\n\nimpl Ord for () {\n fn cmp(_self: Self, _other: ()) -> Ordering {\n Ordering::equal()\n }\n}\n\nimpl Ord for bool {\n fn cmp(self, other: bool) -> Ordering {\n if self {\n if other {\n Ordering::equal()\n } else {\n Ordering::greater()\n }\n } else if other {\n Ordering::less()\n } else {\n Ordering::equal()\n }\n }\n}\n\nimpl<T, let N: u32> Ord for [T; N]\nwhere\n T: Ord,\n{\n // The first non-equal element of both arrays determines\n // the ordering for the whole array.\n fn cmp(self, other: [T; N]) -> Ordering {\n let mut result = Ordering::equal();\n for i in 0..self.len() {\n if result == Ordering::equal() {\n result = self[i].cmp(other[i]);\n }\n }\n result\n }\n}\n\nimpl<T> Ord for [T]\nwhere\n T: Ord,\n{\n // The first non-equal element of both arrays determines\n // the ordering for the whole array.\n fn cmp(self, other: [T]) -> Ordering {\n let self_len = self.len();\n let other_len = other.len();\n let min_len = if self_len < other_len {\n self_len\n } else {\n other_len\n };\n\n let mut result = Ordering::equal();\n for i in 0..min_len {\n if result == Ordering::equal() {\n result = self[i].cmp(other[i]);\n }\n }\n\n if result != Ordering::equal() {\n result\n } else {\n self_len.cmp(other_len)\n }\n }\n}\n\ncomptime fn make_tuple_ord_body(n: u32) -> Quoted {\n let last = n - 1u32;\n let mut body = if last == 1 {\n f\"let result = self.0.cmp(other.0);\".as_ctstring()\n } else {\n f\"let mut result = self.0.cmp(other.0);\".as_ctstring()\n };\n for i in 1u32..last {\n body = body.append_fmtstr(\n f\" if result == Ordering::equal() {{ result = self.{i}.cmp(other.{i}); }}\",\n );\n }\n body = body.append_fmtstr(\n f\" if result != Ordering::equal() {{ result }} else {{ self.{last}.cmp(other.{last}) }}\",\n );\n f\"{body}\".quoted_contents()\n}\n\nimpl<A: Ord> Ord for (A,) {\n fn cmp(self, other: (A,)) -> Ordering {\n self.0.cmp(other.0)\n }\n}\n\nimpl<A: Ord, B: Ord> Ord for (A, B) {\n fn cmp(self, other: (A, B)) -> Ordering {\n make_tuple_ord_body!(2u32)\n }\n}\n\nimpl<A: Ord, B: Ord, C: Ord> Ord for (A, B, C) {\n fn cmp(self, other: (A, B, C)) -> Ordering {\n make_tuple_ord_body!(3u32)\n }\n}\n\nimpl<A: Ord, B: Ord, C: Ord, D: Ord> Ord for (A, B, C, D) {\n fn cmp(self, other: (A, B, C, D)) -> Ordering {\n make_tuple_ord_body!(4u32)\n }\n}\n\nimpl<A: Ord, B: Ord, C: Ord, D: Ord, E: Ord> Ord for (A, B, C, D, E) {\n fn cmp(self, other: (A, B, C, D, E)) -> Ordering {\n make_tuple_ord_body!(5u32)\n }\n}\n\nimpl<A: Ord, B: Ord, C: Ord, D: Ord, E: Ord, F: Ord> Ord for (A, B, C, D, E, F) {\n fn cmp(self, other: (A, B, C, D, E, F)) -> Ordering {\n make_tuple_ord_body!(6u32)\n }\n}\n\nimpl<A: Ord, B: Ord, C: Ord, D: Ord, E: Ord, F: Ord, G: Ord> Ord for (A, B, C, D, E, F, G) {\n fn cmp(self, other: (A, B, C, D, E, F, G)) -> Ordering {\n make_tuple_ord_body!(7u32)\n }\n}\n\nimpl<A: Ord, B: Ord, C: Ord, D: Ord, E: Ord, F: Ord, G: Ord, H: Ord> Ord for (A, B, C, D, E, F, G, H) {\n fn cmp(self, other: (A, B, C, D, E, F, G, H)) -> Ordering {\n make_tuple_ord_body!(8u32)\n }\n}\n\nimpl<A: Ord, B: Ord, C: Ord, D: Ord, E: Ord, F: Ord, G: Ord, H: Ord, I: Ord> Ord for (A, B, C, D, E, F, G, H, I) {\n fn cmp(self, other: (A, B, C, D, E, F, G, H, I)) -> Ordering {\n make_tuple_ord_body!(9u32)\n }\n}\n\nimpl<A: Ord, B: Ord, C: Ord, D: Ord, E: Ord, F: Ord, G: Ord, H: Ord, I: Ord, J: Ord> Ord for (A, B, C, D, E, F, G, H, I, J) {\n fn cmp(self, other: (A, B, C, D, E, F, G, H, I, J)) -> Ordering {\n make_tuple_ord_body!(10u32)\n }\n}\n\nimpl<A: Ord, B: Ord, C: Ord, D: Ord, E: Ord, F: Ord, G: Ord, H: Ord, I: Ord, J: Ord, K: Ord> Ord for (A, B, C, D, E, F, G, H, I, J, K) {\n fn cmp(self, other: (A, B, C, D, E, F, G, H, I, J, K)) -> Ordering {\n make_tuple_ord_body!(11u32)\n }\n}\n\nimpl<A: Ord, B: Ord, C: Ord, D: Ord, E: Ord, F: Ord, G: Ord, H: Ord, I: Ord, J: Ord, K: Ord, L: Ord> Ord for (A, B, C, D, E, F, G, H, I, J, K, L) {\n fn cmp(self, other: (A, B, C, D, E, F, G, H, I, J, K, L)) -> Ordering {\n make_tuple_ord_body!(12u32)\n }\n}\n\n/// Compares and returns the maximum of two values.\n///\n/// Returns the second argument if the comparison determines them to be equal.\n///\n/// # Examples\n///\n/// ```\n/// use std::cmp;\n///\n/// assert_eq(cmp::max(1, 2), 2);\n/// assert_eq(cmp::max(2, 2), 2);\n/// ```\npub fn max<T>(v1: T, v2: T) -> T\nwhere\n T: Ord,\n{\n if v1 > v2 {\n v1\n } else {\n v2\n }\n}\n\n/// Compares and returns the minimum of two values.\n///\n/// Returns the first argument if the comparison determines them to be equal.\n///\n/// # Examples\n///\n/// ```\n/// use std::cmp;\n///\n/// assert_eq(cmp::min(1, 2), 1);\n/// assert_eq(cmp::min(2, 2), 2);\n/// ```\npub fn min<T>(v1: T, v2: T) -> T\nwhere\n T: Ord,\n{\n if v1 > v2 {\n v2\n } else {\n v1\n }\n}\n\nmod cmp_tests {\n use crate::meta::unquote;\n use super::{Eq, max, min, Ord, Ordering};\n\n #[test]\n fn sanity_check_min() {\n assert_eq(min(0_u64, 1), 0);\n assert_eq(min(0_u64, 0), 0);\n assert_eq(min(1_u64, 1), 1);\n assert_eq(min(255_u8, 0), 0);\n }\n\n #[test]\n fn sanity_check_max() {\n assert_eq(max(0_u64, 1), 1);\n assert_eq(max(0_u64, 0), 0);\n assert_eq(max(1_u64, 1), 1);\n assert_eq(max(255_u8, 0), 255);\n }\n\n #[test]\n fn correctly_handles_unequal_length_vectors() {\n let vector_1 = [0, 1, 2, 3].as_vector();\n let vector_2 = [0, 1, 2].as_vector();\n assert(!vector_1.eq(vector_2));\n }\n\n #[test]\n fn lexicographic_ordering_for_vectors() {\n assert(\n [2_u32].as_vector().cmp([1_u32, 1_u32, 1_u32].as_vector())\n == super::Ordering::greater(),\n );\n assert(\n [1_u32, 2_u32].as_vector().cmp([1_u32, 2_u32, 3_u32].as_vector())\n == super::Ordering::less(),\n );\n }\n\n #[test]\n fn eq_unit() {\n assert(().eq(()));\n }\n\n #[test]\n fn eq_bool() {\n assert(false.eq(false));\n assert(!(false.eq(true)));\n assert(!(true.eq(false)));\n assert(true.eq(true));\n }\n\n #[test]\n fn eq_integers() {\n comptime {\n for typ in @[\n quote { u8 },\n quote { i8 },\n quote { u16 },\n quote { i16 },\n quote { u32 },\n quote { i32 },\n quote { u64 },\n quote { i64 },\n quote { u128 },\n quote { Field },\n ] {\n let one = f\"1_{typ}\".quoted_contents();\n let two = f\"2_{typ}\".quoted_contents();\n unquote!(\n quote {\n assert($one.eq($one));\n assert(!($one.eq($two)));\n },\n );\n }\n }\n }\n\n #[test]\n fn eq_tuples() {\n comptime {\n for i in 1..=12 {\n let mut tuple1 = @[];\n let mut tuple2 = @[];\n for _ in 0..i - 1 {\n tuple1 = tuple1.push_back(quote { 0 });\n tuple2 = tuple2.push_back(quote { 0 });\n }\n tuple1 = tuple1.push_back(quote { 0 });\n tuple2 = tuple2.push_back(quote { 1 });\n let tuple1 = tuple1.join(quote { , });\n let tuple2 = tuple2.join(quote { , });\n let tuple1 = quote { ($tuple1,) };\n let tuple2 = quote { ($tuple2,) };\n unquote!(\n quote {\n assert($tuple1.eq($tuple1));\n assert(!($tuple1.eq($tuple2)));\n },\n )\n }\n }\n }\n\n #[test]\n fn cmp_unit() {\n assert_eq(().cmp(()), Ordering::equal());\n }\n\n #[test]\n fn cmp_bool() {\n assert_eq(false.cmp(true), Ordering::less());\n assert_eq(false.cmp(false), Ordering::equal());\n assert_eq(true.cmp(true), Ordering::equal());\n assert_eq(true.cmp(false), Ordering::greater());\n }\n\n #[test]\n fn cmp_integers() {\n comptime {\n for typ in @[\n quote { u8 },\n quote { i8 },\n quote { u16 },\n quote { i16 },\n quote { u32 },\n quote { i32 },\n quote { u64 },\n quote { i64 },\n quote { u128 },\n ] {\n let one = f\"1_{typ}\".quoted_contents();\n let two = f\"2_{typ}\".quoted_contents();\n unquote!(\n quote {\n assert_eq($one.cmp($two), Ordering::less());\n assert_eq($one.cmp($one), Ordering::equal());\n assert_eq($two.cmp($one), Ordering::greater());\n },\n );\n }\n }\n }\n\n #[test]\n fn cmp_tuples() {\n comptime {\n for i in 1..=12 {\n let mut tuple1 = @[];\n let mut tuple2 = @[];\n for _ in 0..i - 1 {\n tuple1 = tuple1.push_back(quote { 0_u8 });\n tuple2 = tuple2.push_back(quote { 0_u8 });\n }\n tuple1 = tuple1.push_back(quote { 0_u8 });\n tuple2 = tuple2.push_back(quote { 1_u8 });\n let tuple1 = tuple1.join(quote { , });\n let tuple2 = tuple2.join(quote { , });\n let tuple1 = quote { ($tuple1,) };\n let tuple2 = quote { ($tuple2,) };\n unquote!(\n quote {\n assert_eq($tuple1.cmp($tuple1), Ordering::equal());\n assert_eq($tuple1.cmp($tuple2), Ordering::less());\n assert_eq($tuple2.cmp($tuple1), Ordering::greater());\n },\n )\n }\n }\n }\n\n #[test]\n fn cmp_array() {\n assert_eq([1_u8, 2, 3].cmp([1, 2, 3]), Ordering::equal());\n assert_eq([1_u8, 2, 3].cmp([1, 3, 2]), Ordering::less());\n assert_eq([1_u8, 3, 3].cmp([1, 2, 3]), Ordering::greater());\n }\n\n #[test]\n fn cmp_vectors() {\n // Equal lengths\n assert_eq(@[1_u8, 2, 3].cmp(@[1, 2, 3]), Ordering::equal());\n assert_eq(@[1_u8, 3, 3].cmp(@[1, 2, 3]), Ordering::greater());\n assert_eq(@[1_u8, 2, 3].cmp(@[1, 3, 3]), Ordering::less());\n\n // Different lengths\n assert_eq(@[1_u8, 2].cmp(@[1, 2, 3]), Ordering::less());\n assert_eq(@[1_u8, 2, 3].cmp(@[1, 2]), Ordering::greater());\n assert_eq(@[10_u8, 0].cmp(@[9]), Ordering::greater());\n assert_eq(@[9_u8, 0].cmp(@[10]), Ordering::less());\n assert_eq(@[9_u8].cmp(@[10, 0]), Ordering::less());\n assert_eq(@[10_u8].cmp(@[9, 0]), Ordering::greater());\n }\n}\n"
3192
3208
  },
3193
- "51": {
3209
+ "52": {
3194
3210
  "function_locations": [
3195
- {
3196
- "name": "no_sync",
3197
- "start": 699
3198
- },
3199
3211
  {
3200
3212
  "name": "SchnorrInitializerlessAccount::constructor",
3201
- "start": 1847
3213
+ "start": 1235
3202
3214
  },
3203
3215
  {
3204
3216
  "name": "SchnorrInitializerlessAccount::entrypoint",
3205
- "start": 2466
3217
+ "start": 1854
3206
3218
  },
3207
3219
  {
3208
3220
  "name": "SchnorrInitializerlessAccount::verify_private_authwit",
3209
- "start": 2719
3221
+ "start": 2107
3210
3222
  },
3211
3223
  {
3212
3224
  "name": "SchnorrInitializerlessAccount::is_valid_impl",
3213
- "start": 2961
3225
+ "start": 2349
3214
3226
  },
3215
3227
  {
3216
3228
  "name": "SchnorrInitializerlessAccount::lookup_validity",
3217
- "start": 4543
3229
+ "start": 3931
3218
3230
  }
3219
3231
  ],
3220
3232
  "path": "/home/aztec-dev/aztec-packages/noir-projects/noir-contracts/contracts/account/schnorr_initializerless_account_contract/src/main.nr",
3221
- "source": "use aztec::{\n macros::{aztec, AztecConfig},\n messages::{\n discovery::{ComputeNoteHash, ComputeNoteNullifier, CustomMessageHandler},\n processing::offchain::OffchainInboxSync,\n },\n protocol::address::AztecAddress,\n};\n\n/// Empty override to opt-out of state syncing. This contract does not hold private state,\n/// so runnning the sync process just results in unnecessary RPC calls\nunconstrained fn no_sync(\n _contract_address: AztecAddress,\n _compute_note_hash: ComputeNoteHash,\n _compute_note_nullifier: ComputeNoteNullifier,\n _process_custom_message: Option<CustomMessageHandler>,\n _offchain_inbox_sync: Option<OffchainInboxSync>,\n _scope: AztecAddress,\n) {}\n\n#[aztec(AztecConfig::new().custom_sync_state(crate::no_sync))]\npub contract SchnorrInitializerlessAccount {\n use aztec::{\n authwit::{\n account::AccountActions,\n auth::{compute_authwit_message_hash, compute_authwit_nullifier},\n entrypoint::app::AppPayload,\n },\n context::PrivateContext,\n macros::functions::{allow_phase_change, external, view},\n oracle::{\n auth_witness::get_auth_witness,\n capsules::{load, store},\n get_contract_instance::get_contract_instance,\n get_nullifier_membership_witness::get_low_nullifier_membership_witness,\n },\n protocol::{\n address::AztecAddress,\n hash::{compute_siloed_nullifier, poseidon2_hash, poseidon2_hash_bytes},\n traits::{Deserialize, Serialize},\n },\n };\n use std::embedded_curve_ops::EmbeddedCurvePoint;\n\n global PUB_KEY_SLOT: Field = comptime { poseidon2_hash_bytes(\"INITIALIZERLESS_ACCOUNT_PUB_KEY\".as_bytes()) };\n\n #[external(\"utility\")]\n unconstrained fn constructor(signing_pub_key_x: Field, signing_pub_key_y: Field) {\n let expected = poseidon2_hash([signing_pub_key_x, signing_pub_key_y]);\n let instance = get_contract_instance(self.address);\n assert_eq(\n expected,\n instance.immutables_hash,\n \"Public key hash does not match the immutables hash, refusing to store\",\n );\n\n store(\n self.address,\n PUB_KEY_SLOT,\n [signing_pub_key_x, signing_pub_key_y],\n self.address,\n );\n }\n\n #[external(\"private\")]\n #[allow_phase_change]\n fn entrypoint(app_payload: AppPayload, fee_payment_method: u8, cancellable: bool) {\n let actions = AccountActions::init(self.context, is_valid_impl);\n actions.entrypoint(app_payload, fee_payment_method, cancellable);\n }\n\n #[external(\"private\")]\n #[view]\n fn verify_private_authwit(inner_hash: Field) -> Field {\n let actions = AccountActions::init(self.context, is_valid_impl);\n actions.verify_private_authwit(inner_hash)\n }\n\n #[contract_library_method]\n fn is_valid_impl(context: &mut PrivateContext, outer_hash: Field) -> bool {\n // Safety: The public key inside the capsule is checked to match the immutables_hash of this instance\n let public_key = unsafe { load(context.this_address(), PUB_KEY_SLOT, context.this_address()) }\n .map(|data| EmbeddedCurvePoint::deserialize(data))\n .unwrap_or_else(|| panic(\n \"Public key was not stored in the Private eXecution Environment. Please call `constructor` first\",\n ));\n\n let expected = poseidon2_hash(public_key.serialize());\n let instance = get_contract_instance(context.this_address());\n\n assert_eq(expected, instance.immutables_hash, \"Immutables do not match instance immutables_hash\");\n\n // Safety: The witness is only used as a \"magical value\" that makes the\n // signature verification below pass.\n let limbs: [Field; 4] = unsafe { get_auth_witness(outer_hash) };\n let signature = (\n std::embedded_curve_ops::EmbeddedCurveScalar::new(limbs[0], limbs[1]),\n std::embedded_curve_ops::EmbeddedCurveScalar::new(limbs[2], limbs[3]),\n );\n\n schnorr::verify_signature(public_key, signature, outer_hash)\n }\n\n /// @notice Helper function to check validity of private authwitnesses\n /// @param consumer The address of the consumer of the message\n /// @param message_hash The message hash of the message to check the validity\n /// @return True if the message_hash can be consumed, false otherwise\n #[external(\"utility\")]\n unconstrained fn lookup_validity(consumer: AztecAddress, inner_hash: Field) -> bool {\n // Safety: The public key inside the capsule is checked to match the immutables_hash of this instance\n let public_key = load(self.address, PUB_KEY_SLOT, self.address)\n .map(|data| EmbeddedCurvePoint::deserialize(data))\n .unwrap_or_else(|| panic(\n \"Public key was not stored in the Private eXecution Environment. Please call `constructor` first\",\n ));\n\n let message_hash = compute_authwit_message_hash(\n consumer,\n self.context.chain_id(),\n self.context.version(),\n inner_hash,\n );\n\n let limbs: [Field; 4] = get_auth_witness(message_hash);\n let signature = (\n std::embedded_curve_ops::EmbeddedCurveScalar::new(limbs[0], limbs[1]),\n std::embedded_curve_ops::EmbeddedCurveScalar::new(limbs[2], limbs[3]),\n );\n let pub_key = std::embedded_curve_ops::EmbeddedCurvePoint { x: public_key.x, y: public_key.y };\n let valid_in_private = schnorr::verify_signature(pub_key, signature, message_hash);\n\n // Compute the nullifier and check if it is spent\n // This will BLINDLY TRUST the oracle, but the oracle is us, and\n // it is not as part of execution of the contract, so we are good.\n let nullifier = compute_authwit_nullifier(self.address, inner_hash);\n let siloed_nullifier = compute_siloed_nullifier(consumer, nullifier);\n let (low_leaf_preimage, _witness) =\n get_low_nullifier_membership_witness(self.context.block_header(), siloed_nullifier);\n let is_spent = low_leaf_preimage.nullifier == siloed_nullifier;\n\n !is_spent & valid_in_private\n }\n}\n"
3233
+ "source": "use aztec::{macros::{aztec, AztecConfig}, messages::discovery::do_sync_state_no_op};\n\n#[aztec(AztecConfig::new().custom_sync_state(do_sync_state_no_op))]\npub contract SchnorrInitializerlessAccount {\n use aztec::{\n authwit::{\n account::AccountActions,\n auth::{compute_authwit_message_hash, compute_authwit_nullifier},\n entrypoint::app::AppPayload,\n },\n context::PrivateContext,\n macros::functions::{allow_phase_change, external, view},\n oracle::{\n auth_witness::get_auth_witness,\n capsules::{load, store},\n get_contract_instance::get_contract_instance,\n get_nullifier_membership_witness::get_low_nullifier_membership_witness,\n },\n protocol::{\n address::AztecAddress,\n hash::{compute_siloed_nullifier, poseidon2_hash, poseidon2_hash_bytes},\n traits::{Deserialize, Serialize},\n },\n };\n use std::embedded_curve_ops::EmbeddedCurvePoint;\n\n global PUB_KEY_SLOT: Field = comptime { poseidon2_hash_bytes(\"INITIALIZERLESS_ACCOUNT_PUB_KEY\".as_bytes()) };\n\n #[external(\"utility\")]\n unconstrained fn constructor(signing_pub_key_x: Field, signing_pub_key_y: Field) {\n let expected = poseidon2_hash([signing_pub_key_x, signing_pub_key_y]);\n let instance = get_contract_instance(self.address);\n assert_eq(\n expected,\n instance.immutables_hash,\n \"Public key hash does not match the immutables hash, refusing to store\",\n );\n\n store(\n self.address,\n PUB_KEY_SLOT,\n [signing_pub_key_x, signing_pub_key_y],\n self.address,\n );\n }\n\n #[external(\"private\")]\n #[allow_phase_change]\n fn entrypoint(app_payload: AppPayload, fee_payment_method: u8, cancellable: bool) {\n let actions = AccountActions::init(self.context, is_valid_impl);\n actions.entrypoint(app_payload, fee_payment_method, cancellable);\n }\n\n #[external(\"private\")]\n #[view]\n fn verify_private_authwit(inner_hash: Field) -> Field {\n let actions = AccountActions::init(self.context, is_valid_impl);\n actions.verify_private_authwit(inner_hash)\n }\n\n #[contract_library_method]\n fn is_valid_impl(context: &mut PrivateContext, outer_hash: Field) -> bool {\n // Safety: The public key inside the capsule is checked to match the immutables_hash of this instance\n let public_key = unsafe { load(context.this_address(), PUB_KEY_SLOT, context.this_address()) }\n .map(|data| EmbeddedCurvePoint::deserialize(data))\n .unwrap_or_else(|| panic(\n \"Public key was not stored in the Private eXecution Environment. Please call `constructor` first\",\n ));\n\n let expected = poseidon2_hash(public_key.serialize());\n let instance = get_contract_instance(context.this_address());\n\n assert_eq(expected, instance.immutables_hash, \"Immutables do not match instance immutables_hash\");\n\n // Safety: The witness is only used as a \"magical value\" that makes the\n // signature verification below pass.\n let limbs: [Field; 4] = unsafe { get_auth_witness(outer_hash) };\n let signature = (\n std::embedded_curve_ops::EmbeddedCurveScalar::new(limbs[0], limbs[1]),\n std::embedded_curve_ops::EmbeddedCurveScalar::new(limbs[2], limbs[3]),\n );\n\n schnorr::verify_signature(public_key, signature, outer_hash)\n }\n\n /// @notice Helper function to check validity of private authwitnesses\n /// @param consumer The address of the consumer of the message\n /// @param message_hash The message hash of the message to check the validity\n /// @return True if the message_hash can be consumed, false otherwise\n #[external(\"utility\")]\n unconstrained fn lookup_validity(consumer: AztecAddress, inner_hash: Field) -> bool {\n // Safety: The public key inside the capsule is checked to match the immutables_hash of this instance\n let public_key = load(self.address, PUB_KEY_SLOT, self.address)\n .map(|data| EmbeddedCurvePoint::deserialize(data))\n .unwrap_or_else(|| panic(\n \"Public key was not stored in the Private eXecution Environment. Please call `constructor` first\",\n ));\n\n let message_hash = compute_authwit_message_hash(\n consumer,\n self.context.chain_id(),\n self.context.version(),\n inner_hash,\n );\n\n let limbs: [Field; 4] = get_auth_witness(message_hash);\n let signature = (\n std::embedded_curve_ops::EmbeddedCurveScalar::new(limbs[0], limbs[1]),\n std::embedded_curve_ops::EmbeddedCurveScalar::new(limbs[2], limbs[3]),\n );\n let pub_key = std::embedded_curve_ops::EmbeddedCurvePoint { x: public_key.x, y: public_key.y };\n let valid_in_private = schnorr::verify_signature(pub_key, signature, message_hash);\n\n // Compute the nullifier and check if it is spent\n // This will BLINDLY TRUST the oracle, but the oracle is us, and\n // it is not as part of execution of the contract, so we are good.\n let nullifier = compute_authwit_nullifier(self.address, inner_hash);\n let siloed_nullifier = compute_siloed_nullifier(consumer, nullifier);\n let (low_leaf_preimage, _witness) =\n get_low_nullifier_membership_witness(self.context.block_header(), siloed_nullifier);\n let is_spent = low_leaf_preimage.nullifier == siloed_nullifier;\n\n !is_spent & valid_in_private\n }\n}\n"
3222
3234
  },
3223
- "52": {
3235
+ "53": {
3224
3236
  "function_locations": [
3225
3237
  {
3226
3238
  "name": "AccountActions<Context>::init",
@@ -3238,7 +3250,7 @@
3238
3250
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/authwit/account.nr",
3239
3251
  "source": "use crate::context::PrivateContext;\n\nuse crate::protocol::{constants::DOM_SEP__TX_NULLIFIER, hash::poseidon2_hash_with_separator, traits::Hash};\n\nuse crate::authwit::auth::{compute_authwit_message_hash, IS_VALID_SELECTOR};\nuse crate::authwit::entrypoint::app::AppPayload;\n\npub struct AccountActions<Context> {\n context: Context,\n is_valid_impl: fn(&mut PrivateContext, Field) -> bool,\n}\n\nimpl<Context> AccountActions<Context> {\n pub fn init(context: Context, is_valid_impl: fn(&mut PrivateContext, Field) -> bool) -> Self {\n AccountActions { context, is_valid_impl }\n }\n}\n\n// See AccountFeePaymentMethodOptions enum in Aztec.js for docs:\n//\n//\n// https://github.com/AztecProtocol/aztec-packages/blob/next/yarn-project/entrypoints/src/account_entrypoint.ts\npub struct AccountFeePaymentMethodOptionsEnum {\n pub EXTERNAL: u8,\n pub PREEXISTING_FEE_JUICE: u8,\n pub FEE_JUICE_WITH_CLAIM: u8,\n}\n\npub global AccountFeePaymentMethodOptions: AccountFeePaymentMethodOptionsEnum =\n AccountFeePaymentMethodOptionsEnum { EXTERNAL: 0, PREEXISTING_FEE_JUICE: 1, FEE_JUICE_WITH_CLAIM: 2 };\n\n/// An implementation of the Account Action struct for the private context.\n///\n/// Implements logic to verify authorization and execute payloads.\nimpl AccountActions<&mut PrivateContext> {\n\n /// Verifies that the `app_hash` is authorized and executes the `app_payload`.\n ///\n /// @param app_payload The payload that contains the calls to be executed in the app phase.\n ///\n /// @param fee_payment_method The mechanism via which the account contract will pay for the transaction:\n /// - EXTERNAL (0): Signals that some other contract is in charge of paying the fee, nothing needs to be done.\n /// - PREEXISTING_FEE_JUICE (1): Makes the account contract publicly pay for the transaction with its own FeeJuice\n /// balance, which it must already have prior to this transaction. The contract will set itself as the fee payer\n /// and end the setup phase.\n /// - FEE_JUICE_WITH_CLAIM (2): Makes the account contract publicly pay for the transaction with its own FeeJuice\n /// balance which is being claimed in the same transaction. The contract will set itself as the fee payer but not\n /// end setup phase - this is done by the FeeJuice contract after enqueuing a public call, which unlike most public\n /// calls is whitelisted to be executable during setup.\n ///\n /// @param cancellable Controls whether to emit app_payload.tx_nonce as a nullifier, allowing a subsequent\n /// transaction to be sent with a higher priority fee. This can be used to cancel the first transaction sent,\n /// assuming it hasn't been mined yet.\n ///\n pub fn entrypoint(self, app_payload: AppPayload, fee_payment_method: u8, cancellable: bool) {\n let valid_fn = self.is_valid_impl;\n\n let message_hash = compute_authwit_message_hash(\n self.context.this_address(),\n self.context.chain_id(),\n self.context.version(),\n app_payload.hash(),\n );\n assert(valid_fn(self.context, message_hash));\n\n if fee_payment_method == AccountFeePaymentMethodOptions.PREEXISTING_FEE_JUICE {\n self.context.set_as_fee_payer();\n self.context.end_setup();\n }\n if fee_payment_method == AccountFeePaymentMethodOptions.FEE_JUICE_WITH_CLAIM {\n self.context.set_as_fee_payer();\n }\n app_payload.execute_calls(self.context);\n\n if cancellable {\n let tx_nullifier = poseidon2_hash_with_separator([app_payload.tx_nonce], DOM_SEP__TX_NULLIFIER);\n self.context.push_nullifier_unsafe(tx_nullifier);\n }\n }\n\n /// Verifies that the `msg_sender` is authorized to consume `inner_hash` by the account.\n ///\n /// Computes the `message_hash` using the `msg_sender`, `chain_id`, `version` and `inner_hash`. Then executes the\n /// `is_valid_impl` function to verify that the message is authorized.\n ///\n /// Will revert if the message is not authorized.\n ///\n /// @param inner_hash The hash of the message that the `msg_sender` is trying to consume.\n pub fn verify_private_authwit(self, inner_hash: Field) -> Field {\n // The `inner_hash` is \"siloed\" with the `msg_sender` to ensure that only it can consume the message. This\n // ensures that contracts cannot consume messages that are not intended for them.\n let message_hash = compute_authwit_message_hash(\n self.context.maybe_msg_sender().unwrap(),\n self.context.chain_id(),\n self.context.version(),\n inner_hash,\n );\n let valid_fn = self.is_valid_impl;\n assert(valid_fn(self.context, message_hash), \"Message not authorized by account\");\n IS_VALID_SELECTOR\n }\n}\n"
3240
3252
  },
3241
- "53": {
3253
+ "54": {
3242
3254
  "function_locations": [
3243
3255
  {
3244
3256
  "name": "emit_authorization_as_offchain_effect",
@@ -3288,7 +3300,7 @@
3288
3300
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/authwit/auth.nr",
3289
3301
  "source": "use crate::{\n authwit::{authorization_interface::AuthorizationInterface, AuthorizationSelector},\n context::{gas::GasOpts, PrivateContext, PublicContext},\n hash::hash_args,\n macros::authorization::authorization,\n oracle::{execution_cache::load, offchain_effect::emit_offchain_effect},\n};\nuse crate::protocol::{\n abis::function_selector::FunctionSelector,\n address::AztecAddress,\n constants::{DOM_SEP__AUTHWIT_INNER, DOM_SEP__AUTHWIT_NULLIFIER, DOM_SEP__AUTHWIT_OUTER},\n hash::poseidon2_hash_with_separator,\n traits::{Serialize, ToField},\n};\nuse crate::standard_addresses::STANDARD_AUTH_REGISTRY_ADDRESS;\n\n/// Authentication witness helper library\n///\n/// Authentication Witness is a scheme for authenticating actions on Aztec, so users can allow third-parties (e.g.\n/// protocols or other users) to execute an action on their behalf.\n///\n/// This library provides helper functions to manage such witnesses. The authentication witness, is some \"witness\"\n/// (data) that authenticates a `message_hash`. The simplest example of an authentication witness, is a signature. The\n/// signature is the \"evidence\", that the signer has seen the message, agrees with it, and has allowed it. It does not\n/// need to be a signature. It could be any kind of \"proof\" that the message is allowed. Another proof could be knowing\n/// some kind of secret, or having some kind of \"token\" that allows the message.\n///\n/// The `message_hash` is a hash of the following structure: hash(consumer, chain_id, version, inner_hash)\n/// - consumer: the address of the contract that is \"consuming\" the message,\n/// - chain_id: the chain id of the chain that the message is being consumed on,\n/// - version: the version of the chain that the message is being consumed on,\n/// - inner_hash: the hash of the \"inner\" message that is being consumed, this is the \"actual\" message or action.\n///\n/// While the `inner_hash` could be anything, such as showing you signed a specific message, it will often be a hash of\n/// the \"action\" to approve, along with who made the call. As part of this library, we provide a few helper functions\n/// to deal with such messages.\n///\n/// For example, we provide helper function that is used for checking that the message is an encoding of the current\n/// call. This can be used to let some contract \"allow\" another contract to act on its behalf, as long as it can show\n/// that it is acting on behalf of the contract.\n///\n/// If we take a case of allowing a contract to transfer tokens on behalf of an account, the `inner_hash` can be\n/// derived as: inner_hash = hash(caller, \"transfer\", hash(to, amount))\n///\n/// Where the `caller` would be the address of the contract that is trying to transfer the tokens, and `to` and\n/// `amount` the arguments for the transfer.\n///\n/// Note that we have both a `caller` and a `consumer`, the `consumer` will be the contract that is consuming the\n/// message, in the case of the transfer, it would be the `Token` contract itself, while the caller, will be the actor\n/// that is allowed to transfer the tokens.\n///\n///\n/// The authentication mechanism works differently in public and private contexts. In private, we recall that\n/// everything is executed on the user's device, so we can use `oracles` to \"ask\" the user (not contract) for\n/// information. In public we cannot do this, since it is executed by the sequencer (someone else). Therefore we can\n/// instead use a \"registry\" to store the messages that we have approved.\n///\n/// A simple example would be a \"token\" that is being \"pulled\" from one account into another. We will first outline how\n/// this would look in private, and then in public later.\n///\n/// Say that a user `Alice` wants to deposit some tokens into a DeFi protocol (say a DEX). `Alice` would make a\n/// `deposit` transaction, that she is executing using her account contract. The account would call the `DeFi` contract\n/// to execute `deposit`, which would try to pull funds from the `Token` contract. Since the `DeFi` contract is trying\n/// to pull funds from an account that is not its own, it needs to convince the `Token` contract that it is allowed to\n/// do so.\n///\n/// This is where the authentication witness comes in The `Token` contract computes a `message_hash` from the\n/// `transfer` call, and then asks `Alice Account` contract to verify that the `DeFi` contract is allowed to execute\n/// that call.\n///\n/// `Alice Account` contract can then ask `Alice` if she wants to allow the `DeFi` contract to pull funds from her\n/// account. If she does, she will sign the `message_hash` and return the signature to the `Alice Account` which will\n/// validate it and return success to the `Token` contract which will then allow the `DeFi` contract to pull funds from\n/// `Alice`.\n///\n/// To ensure that the same \"approval\" cannot be used multiple times, we also compute a `nullifier` for the\n/// authentication witness, and emit it from the `Token` contract (consumer).\n///\n/// Note that we can do this flow as we are in private were we can do oracle calls out from contracts.\n///\n///\n/// Person Contract Contract Contract\n/// Alice Alice Account Token DeFi\n/// | | | |\n/// | Defi.deposit(Token, 1000) | |\n/// |----------------->| | |\n/// | | deposit(Token, 1000) |\n/// | |---------------------------------------->|\n/// | | | |\n/// | | | transfer(Alice, Defi, 1000)\n/// | | |<---------------------|\n/// | | | |\n/// | | Check if Defi may call transfer(Alice, Defi, 1000)\n/// | |<-----------------| |\n/// | | | |\n/// | Please give me AuthWit for DeFi | |\n/// | calling transfer(Alice, Defi, 1000) | |\n/// |<-----------------| | |\n/// | | | |\n/// | | | |\n/// | AuthWit for transfer(Alice, Defi, 1000) |\n/// |----------------->| | |\n/// | | AuthWit validity | |\n/// | |----------------->| |\n/// | | | |\n/// | | throw if invalid AuthWit |\n/// | | | |\n/// | | emit AuthWit nullifier |\n/// | | | |\n/// | | transfer(Alice, Defi, 1000) |\n/// | | | |\n/// | | | |\n/// | | | success |\n/// | | |--------------------->|\n/// | | | |\n/// | | | |\n/// | | | deposit(Token, 1000)\n/// | | | |\n/// | | | |\n///\n///\n/// If we instead were in public, we cannot do the same flow. Instead we would use an authentication registry to store\n/// the messages that we have approved.\n///\n/// To approve a message, `Alice Account` can make a `set_authorized` call to the registry, to set a `message_hash` as\n/// authorized. This is essentially a mapping from `message_hash` to `true` for `Alice Contract`. Every account has its\n/// own map in the registry, so `Alice` cannot approve a message for `Bob`.\n///\n/// The `Token` contract can then try to \"spend\" the approval by calling `consume` on the registry. If the message was\n/// approved, the value is updated to `false`, and we return the success flag. For more information on the registry,\n/// see `main.nr` in `auth_registry_contract`.\n///\n/// Person Contract Contract Contract Contract\n/// Alice Alice Account Registry Token DeFi\n/// | | | | |\n/// | Registry.set_authorized(..., true) | | |\n/// |----------------->| | | |\n/// | | set_authorized(..., true) | |\n/// | |------------------->| | |\n/// | | | | |\n/// | | set authorized to true | |\n/// | | | | |\n/// | | | | |\n/// | Defi.deposit(Token, 1000) | | |\n/// |----------------->| | | |\n/// | | deposit(Token, 1000) | |\n/// | |-------------------------------------------------------------->|\n/// | | | | |\n/// | | | transfer(Alice, Defi, 1000) |\n/// | | | |<---------------------|\n/// | | | | |\n/// | | | Check if Defi may call transfer(Alice, Defi, 1000)\n/// | | |<------------------| |\n/// | | | | |\n/// | | throw if invalid AuthWit | |\n/// | | | | |\n/// | | | | |\n/// | | set authorized to false | |\n/// | | | | |\n/// | | | | |\n/// | | | AuthWit validity | |\n/// | | |------------------>| |\n/// | | | | |\n/// | | | | transfer(Alice, Defi, 1000)\n/// | | | |<-------------------->|\n/// | | | | |\n/// | | | | success |\n/// | | | |--------------------->|\n/// | | | | |\n/// | | | | deposit(Token, 1000)\n/// | | | | |\n///\n///\n/// --- FAQ ---\n/// Q: Why are we using a success flag of `poseidon2_hash_bytes(\"IS_VALID()\")` instead of just returning a boolean?\n/// A: We want to make sure that we don't accidentally return `true` if there is a collision in the function\n/// selector. By returning a hash of `IS_VALID()`, it becomes very unlikely that there is both a collision and we\n/// return a success flag.\n///\n/// Q: Why are we using static calls?\n/// A: We are using static calls to ensure that the account contract cannot re-enter. If it was a normal call, it\n/// could make a new call and do a re-entry attack. Using a static ensures that it cannot update any state.\n///\n/// Q: Would it not be cheaper to use a nullifier instead of updating state in public?\n/// A: At a quick glance, a public state update + nullifier is 96 bytes, but two state updates are 128, so it would\n/// be cheaper to use a nullifier, if this is the way it would always be done. However, if both the approval and the\n/// consumption is done in the same transaction, then we will be able to squash the updates (only final tx state diff\n/// is posted to DA), and now it is cheaper.\n///\n/// Q: Why is the chain id and the version part of the message hash?\n/// A: The chain id and the version is part of the message hash to ensure that the message is only valid on a\n/// specific chain to avoid a case where the same message could be used across multiple chains.\n\npub global IS_VALID_SELECTOR: Field = 0x47dacd73; // 4 last bytes of\n// poseidon2_hash_bytes(\"IS_VALID()\")\n\n/// A struct that represents a contract call the user can authorize. It's associated identifier is generated by\n/// serializing and hashing it. The user is expected to sign this hash to signal the contract call can be performed on\n/// their behalf\n#[authorization]\nstruct CallAuthorization {\n msg_sender: AztecAddress,\n selector: FunctionSelector,\n args_hash: Field,\n}\n\n/// A struct that represents a request to authorize a call, which is used to emit an offchain effect so the user/wallet\n/// can understand what they are being asked to sign. It is generated from a CallAuthorization by adding metadata to\n/// it, such as the selector for the authorization, the inner hash, and the actual arguments that are being passed to\n/// the function call.\n#[derive(Serialize)]\nstruct CallAuthorizationRequest {\n selector: AuthorizationSelector,\n inner_hash: Field,\n on_behalf_of: AztecAddress,\n msg_sender: AztecAddress,\n fn_selector: FunctionSelector,\n args_hash: Field,\n}\n\nunconstrained fn emit_authorization_as_offchain_effect<let N: u32>(\n authorization: CallAuthorization,\n inner_hash: Field,\n on_behalf_of: AztecAddress,\n) {\n let args: [Field; N] = load(authorization.args_hash);\n let authorization_request = CallAuthorizationRequest {\n selector: authorization.get_authorization_selector(),\n inner_hash: inner_hash,\n on_behalf_of: on_behalf_of,\n msg_sender: authorization.msg_sender,\n fn_selector: authorization.selector,\n args_hash: authorization.args_hash,\n };\n emit_offchain_effect(authorization_request.serialize().concat(args))\n}\n\n/// Assert that `on_behalf_of` has authorized the current call with a valid authentication witness\n///\n/// Compute the `inner_hash` using the `msg_sender`, `selector` and `args_hash` and then make a call out to the\n/// `on_behalf_of` contract to verify that the `inner_hash` is valid.\n///\n/// Additionally, this function emits the identifying information of the call as an offchain effect so PXE can rely the\n/// information to the user/wallet in a readable way. To that effect, it is generic over N, where N is the number of\n/// arguments the authorized functions takes. This is used to load the arguments from the execution cache. This\n/// function is intended to be called via a macro, which will use the turbofish operator to specify the number of\n/// arguments.\n///\n/// @param on_behalf_of The address that has allegedly authorized the current call\npub fn assert_current_call_valid_authwit<let N: u32>(context: &mut PrivateContext, on_behalf_of: AztecAddress) {\n let args_hash: Field = context.get_args_hash();\n\n let authorization =\n CallAuthorization { msg_sender: context.maybe_msg_sender().unwrap(), selector: context.selector(), args_hash };\n let inner_hash = compute_inner_authwit_hash(authorization.serialize());\n // Safety: Offchain effects are by definition unconstrained. They are emitted via an oracle which we don't use for\n // anything besides its side effects, therefore this is safe to call.\n unsafe { emit_authorization_as_offchain_effect::<N>(authorization, inner_hash, on_behalf_of) };\n\n assert_inner_hash_valid_authwit(context, on_behalf_of, inner_hash);\n}\n\n/// Assert that a specific `inner_hash` is valid for the `on_behalf_of` address\n///\n/// Used as an internal function for `assert_current_call_valid_authwit` and can be used as a standalone function when\n/// the `inner_hash` is from a different source, e.g., say a block of text etc.\n///\n/// @param on_behalf_of The address that has allegedly authorized the current call @param inner_hash The hash of the\n/// message to authorize\npub fn assert_inner_hash_valid_authwit(context: &mut PrivateContext, on_behalf_of: AztecAddress, inner_hash: Field) {\n // We perform a static call here and not a standard one to ensure that the account contract cannot re-enter.\n let result: Field = context\n .static_call_private_function(\n on_behalf_of,\n comptime { FunctionSelector::from_signature(\"verify_private_authwit(Field)\") },\n [inner_hash],\n )\n .get_preimage();\n assert(result == IS_VALID_SELECTOR, \"Message not authorized by account\");\n // Compute the nullifier, similar computation to the outer hash, but without the chain_id and version. Those should\n // already be handled in the verification, so we just need something to nullify, that allows the same inner_hash\n // for multiple actors.\n let nullifier = compute_authwit_nullifier(on_behalf_of, inner_hash);\n context.push_nullifier_unsafe(nullifier);\n}\n\n/// Assert that `on_behalf_of` has authorized the current call in the authentication registry\n///\n/// Compute the `inner_hash` using the `msg_sender`, `selector` and `args_hash` and then make a call out to the\n/// `on_behalf_of` contract to verify that the `inner_hash` is valid.\n///\n/// Note that the authentication registry will take the `msg_sender` into account as the consumer, so this will only\n/// work if the `msg_sender` is the same as the `consumer` when the `message_hash` was inserted into the registry.\n///\n/// @param on_behalf_of The address that has allegedly authorized the current call\npub unconstrained fn assert_current_call_valid_authwit_public(context: PublicContext, on_behalf_of: AztecAddress) {\n let inner_hash = compute_inner_authwit_hash([\n context.maybe_msg_sender().unwrap().to_field(),\n context.selector().to_field(),\n context.get_args_hash(),\n ]);\n assert_inner_hash_valid_authwit_public(context, on_behalf_of, inner_hash);\n}\n\n/// Assert that `on_behalf_of` has authorized a specific `inner_hash` in the authentication registry\n///\n/// Compute the `inner_hash` using the `msg_sender`, `selector` and `args_hash` and then make a call out to the\n/// `on_behalf_of` contract to verify that the `inner_hash` is valid.\n///\n/// Note that the authentication registry will take the `msg_sender` into account as the consumer, so this will only\n/// work if the `msg_sender` is the same as the `consumer` when the `message_hash` was inserted into the registry.\n///\n/// @param on_behalf_of The address that has allegedly authorized the `inner_hash`\npub unconstrained fn assert_inner_hash_valid_authwit_public(\n context: PublicContext,\n on_behalf_of: AztecAddress,\n inner_hash: Field,\n) {\n let results: [Field] = context.call_public_function(\n STANDARD_AUTH_REGISTRY_ADDRESS,\n comptime { FunctionSelector::from_signature(\"consume((Field),Field)\") },\n [on_behalf_of.to_field(), inner_hash],\n GasOpts::default(),\n );\n assert(results.len() == 1, \"Invalid response from registry\");\n assert(results[0] == IS_VALID_SELECTOR, \"Message not authorized by account\");\n}\n\n/// Compute the `message_hash` from a function call to be used by an authentication witness\n///\n/// Useful for when you need a non-account contract to approve during execution. For example if you need a contract to\n/// make a call to nested contract, e.g., contract A wants to exit token T to L1 using bridge B, so it needs to allow B\n/// to transfer T on its behalf.\n///\n/// @param caller The address of the contract that is calling the function, in the example above, this would be B\n/// @param consumer The address of the contract that is consuming the message, in the example above, this would be T\n/// @param chain_id The chain id of the chain that the message is being consumed on @param version The version of the\n/// chain that the message is being consumed on @param selector The function selector of the function that is being\n/// called @param args The arguments of the function that is being called\npub fn compute_authwit_message_hash_from_call<let N: u32>(\n caller: AztecAddress,\n consumer: AztecAddress,\n chain_id: Field,\n version: Field,\n selector: FunctionSelector,\n args: [Field; N],\n) -> Field {\n let args_hash = hash_args(args);\n let inner_hash = compute_inner_authwit_hash([caller.to_field(), selector.to_field(), args_hash]);\n compute_authwit_message_hash(consumer, chain_id, version, inner_hash)\n}\n\n/// Computes the `inner_hash` of the authentication witness\n///\n/// This is used internally, but also useful in cases where you want to compute the `inner_hash` for a specific message\n/// that is not necessarily a call, but just some \"bytes\" or text.\n///\n/// @param args The arguments to hash\npub fn compute_inner_authwit_hash<let N: u32>(args: [Field; N]) -> Field {\n poseidon2_hash_with_separator(args, DOM_SEP__AUTHWIT_INNER)\n}\n\n/// Computes the `authwit_nullifier` for a specific `on_behalf_of` and `inner_hash`\n///\n/// Using the `on_behalf_of` and the `inner_hash` to ensure that the nullifier is siloed for a specific `on_behalf_of`.\n///\n/// @param on_behalf_of The address that has authorized the `inner_hash` @param inner_hash The hash of the message to\n/// authorize\npub fn compute_authwit_nullifier(on_behalf_of: AztecAddress, inner_hash: Field) -> Field {\n poseidon2_hash_with_separator(\n [on_behalf_of.to_field(), inner_hash],\n DOM_SEP__AUTHWIT_NULLIFIER,\n )\n}\n\n/// Computes the `message_hash` for the authentication witness\n///\n/// @param consumer The address of the contract that is consuming the message @param chain_id The chain id of the chain\n/// that the message is being consumed on @param version The version of the chain that the message is being consumed on\n/// @param inner_hash The hash of the \"inner\" message that is being consumed\npub fn compute_authwit_message_hash(\n consumer: AztecAddress,\n chain_id: Field,\n version: Field,\n inner_hash: Field,\n) -> Field {\n poseidon2_hash_with_separator(\n [consumer.to_field(), chain_id, version, inner_hash],\n DOM_SEP__AUTHWIT_OUTER,\n )\n}\n\n/// Helper function to set the authorization status of a message hash\n///\n/// Wraps a public call to the authentication registry to set the authorization status of a `message_hash`\n///\n/// @param message_hash The hash of the message to authorize @param authorize True if the message should be authorized,\n/// false if it should be revoked\npub unconstrained fn set_authorized(context: PublicContext, message_hash: Field, authorize: bool) {\n let res = context.call_public_function(\n STANDARD_AUTH_REGISTRY_ADDRESS,\n comptime { FunctionSelector::from_signature(\"set_authorized(Field,bool)\") },\n [message_hash, authorize as Field],\n GasOpts::default(),\n );\n assert(res.len() == 0);\n}\n\n/// Helper function to reject all authwits\n///\n/// Wraps a public call to the authentication registry to set the `reject_all` flag\n///\n/// @param reject True if all authwits should be rejected, false otherwise\npub unconstrained fn set_reject_all(context: PublicContext, reject: bool) {\n let res = context.call_public_function(\n STANDARD_AUTH_REGISTRY_ADDRESS,\n comptime { FunctionSelector::from_signature(\"set_reject_all(bool)\") },\n [reject as Field],\n GasOpts::default(),\n );\n assert(res.len() == 0);\n}\n"
3290
3302
  },
3291
- "56": {
3303
+ "57": {
3292
3304
  "function_locations": [
3293
3305
  {
3294
3306
  "name": "<impl Hash for AppPayload>::hash",
@@ -3332,363 +3344,415 @@
3332
3344
  "name": "BoundedVec<T, MaxLen>::len",
3333
3345
  "start": 7072
3334
3346
  },
3347
+ {
3348
+ "name": "BoundedVec<T, MaxLen>::set_len",
3349
+ "start": 7970
3350
+ },
3351
+ {
3352
+ "name": "BoundedVec<T, MaxLen>::truncate",
3353
+ "start": 8742
3354
+ },
3335
3355
  {
3336
3356
  "name": "BoundedVec<T, MaxLen>::max_len",
3337
- "start": 7513
3357
+ "start": 9234
3338
3358
  },
3339
3359
  {
3340
3360
  "name": "BoundedVec<T, MaxLen>::storage",
3341
- "start": 8111
3361
+ "start": 9832
3342
3362
  },
3343
3363
  {
3344
3364
  "name": "BoundedVec<T, MaxLen>::extend_from_array",
3345
- "start": 8667
3365
+ "start": 10388
3346
3366
  },
3347
3367
  {
3348
3368
  "name": "BoundedVec<T, MaxLen>::extend_from_vector",
3349
- "start": 9438
3369
+ "start": 11159
3350
3370
  },
3351
3371
  {
3352
3372
  "name": "BoundedVec<T, MaxLen>::extend_from_bounded_vec",
3353
- "start": 10383
3373
+ "start": 12104
3354
3374
  },
3355
3375
  {
3356
3376
  "name": "BoundedVec<T, MaxLen>::from_array",
3357
- "start": 12778
3377
+ "start": 13251
3358
3378
  },
3359
3379
  {
3360
3380
  "name": "BoundedVec<T, MaxLen>::pop",
3361
- "start": 13521
3381
+ "start": 13994
3362
3382
  },
3363
3383
  {
3364
3384
  "name": "BoundedVec<T, MaxLen>::any",
3365
- "start": 14063
3385
+ "start": 14536
3366
3386
  },
3367
3387
  {
3368
3388
  "name": "BoundedVec<T, MaxLen>::map",
3369
- "start": 14979
3389
+ "start": 15452
3370
3390
  },
3371
3391
  {
3372
3392
  "name": "BoundedVec<T, MaxLen>::mapi",
3373
- "start": 15979
3393
+ "start": 16387
3374
3394
  },
3375
3395
  {
3376
3396
  "name": "BoundedVec<T, MaxLen>::for_each",
3377
- "start": 16937
3397
+ "start": 17280
3378
3398
  },
3379
3399
  {
3380
3400
  "name": "BoundedVec<T, MaxLen>::for_eachi",
3381
- "start": 17742
3401
+ "start": 18085
3382
3402
  },
3383
3403
  {
3384
3404
  "name": "BoundedVec<T, MaxLen>::from_parts",
3385
- "start": 18439
3405
+ "start": 18782
3386
3406
  },
3387
3407
  {
3388
3408
  "name": "BoundedVec<T, MaxLen>::from_parts_unchecked",
3389
- "start": 19903
3409
+ "start": 20246
3390
3410
  },
3391
3411
  {
3392
3412
  "name": "<impl Eq for BoundedVec<T, MaxLen>>::eq",
3393
- "start": 20115
3413
+ "start": 20458
3394
3414
  },
3395
3415
  {
3396
3416
  "name": "unconstrained_eq",
3397
- "start": 21039
3417
+ "start": 21382
3398
3418
  },
3399
3419
  {
3400
3420
  "name": "<impl From<[T; Len]> for BoundedVec<T, MaxLen>>::from",
3401
- "start": 21335
3421
+ "start": 21678
3402
3422
  },
3403
3423
  {
3404
3424
  "name": "bounded_vec_tests::get::panics_when_reading_elements_past_end_of_vec",
3405
- "start": 21618
3425
+ "start": 21961
3406
3426
  },
3407
3427
  {
3408
3428
  "name": "bounded_vec_tests::get::panics_when_reading_beyond_length",
3409
- "start": 21853
3429
+ "start": 22196
3410
3430
  },
3411
3431
  {
3412
3432
  "name": "bounded_vec_tests::get::get_works_within_bounds",
3413
- "start": 22028
3433
+ "start": 22371
3414
3434
  },
3415
3435
  {
3416
3436
  "name": "bounded_vec_tests::get::get_unchecked_works",
3417
- "start": 22287
3437
+ "start": 22630
3418
3438
  },
3419
3439
  {
3420
3440
  "name": "bounded_vec_tests::get::get_unchecked_works_past_len",
3421
- "start": 22531
3441
+ "start": 22874
3422
3442
  },
3423
3443
  {
3424
3444
  "name": "bounded_vec_tests::set::set_updates_values_properly",
3425
- "start": 22804
3445
+ "start": 23147
3426
3446
  },
3427
3447
  {
3428
3448
  "name": "bounded_vec_tests::set::panics_when_writing_elements_past_end_of_vec",
3429
- "start": 23442
3449
+ "start": 23785
3430
3450
  },
3431
3451
  {
3432
3452
  "name": "bounded_vec_tests::set::panics_when_setting_beyond_length",
3433
- "start": 23677
3453
+ "start": 24020
3434
3454
  },
3435
3455
  {
3436
3456
  "name": "bounded_vec_tests::set::set_unchecked_operations",
3437
- "start": 23852
3457
+ "start": 24195
3438
3458
  },
3439
3459
  {
3440
3460
  "name": "bounded_vec_tests::set::set_unchecked_operations_past_len",
3441
- "start": 24184
3461
+ "start": 24527
3442
3462
  },
3443
3463
  {
3444
3464
  "name": "bounded_vec_tests::set::set_preserves_other_elements",
3445
- "start": 24448
3465
+ "start": 24791
3466
+ },
3467
+ {
3468
+ "name": "bounded_vec_tests::set_len::set_len_works_after_multiple_unchecked_sets",
3469
+ "start": 25266
3470
+ },
3471
+ {
3472
+ "name": "bounded_vec_tests::set_len::set_len_can_reduce_the_length",
3473
+ "start": 26113
3474
+ },
3475
+ {
3476
+ "name": "bounded_vec_tests::set_len::panics_when_set_len_beyond_max_len",
3477
+ "start": 26664
3478
+ },
3479
+ {
3480
+ "name": "bounded_vec_tests::truncate::truncate_shortens_to_len",
3481
+ "start": 26923
3482
+ },
3483
+ {
3484
+ "name": "bounded_vec_tests::truncate::truncate_to_zero_empties_the_vec",
3485
+ "start": 27284
3486
+ },
3487
+ {
3488
+ "name": "bounded_vec_tests::truncate::truncate_to_equal_len_is_noop",
3489
+ "start": 27504
3490
+ },
3491
+ {
3492
+ "name": "bounded_vec_tests::truncate::truncate_to_greater_len_is_noop",
3493
+ "start": 27726
3494
+ },
3495
+ {
3496
+ "name": "bounded_vec_tests::truncate::truncate_beyond_max_len_is_noop",
3497
+ "start": 27948
3498
+ },
3499
+ {
3500
+ "name": "bounded_vec_tests::truncate::truncate_does_not_zero_remaining_storage",
3501
+ "start": 28180
3502
+ },
3503
+ {
3504
+ "name": "bounded_vec_tests::truncate::truncate_then_push_continues_from_new_len",
3505
+ "start": 28635
3446
3506
  },
3447
3507
  {
3448
3508
  "name": "bounded_vec_tests::any::returns_false_if_predicate_not_satisfied",
3449
- "start": 24995
3509
+ "start": 29188
3450
3510
  },
3451
3511
  {
3452
3512
  "name": "bounded_vec_tests::any::returns_true_if_predicate_satisfied",
3453
- "start": 25279
3513
+ "start": 29472
3454
3514
  },
3455
3515
  {
3456
3516
  "name": "bounded_vec_tests::any::returns_false_on_empty_boundedvec",
3457
- "start": 25528
3517
+ "start": 29721
3458
3518
  },
3459
3519
  {
3460
3520
  "name": "bounded_vec_tests::any::any_with_complex_predicates",
3461
- "start": 25769
3521
+ "start": 29962
3462
3522
  },
3463
3523
  {
3464
3524
  "name": "bounded_vec_tests::any::any_with_partial_vector",
3465
- "start": 26132
3525
+ "start": 30325
3466
3526
  },
3467
3527
  {
3468
3528
  "name": "bounded_vec_tests::map::applies_function_correctly",
3469
- "start": 26598
3529
+ "start": 30791
3470
3530
  },
3471
3531
  {
3472
3532
  "name": "bounded_vec_tests::map::applies_function_that_changes_return_type",
3473
- "start": 27020
3533
+ "start": 31213
3474
3534
  },
3475
3535
  {
3476
3536
  "name": "bounded_vec_tests::map::does_not_apply_function_past_len",
3477
- "start": 27368
3537
+ "start": 31561
3478
3538
  },
3479
3539
  {
3480
3540
  "name": "bounded_vec_tests::map::map_with_conditional_logic",
3481
- "start": 27741
3541
+ "start": 31934
3482
3542
  },
3483
3543
  {
3484
3544
  "name": "bounded_vec_tests::map::map_preserves_length",
3485
- "start": 28065
3545
+ "start": 32258
3486
3546
  },
3487
3547
  {
3488
3548
  "name": "bounded_vec_tests::map::map_on_empty_vector",
3489
- "start": 28357
3549
+ "start": 32550
3490
3550
  },
3491
3551
  {
3492
3552
  "name": "bounded_vec_tests::mapi::applies_function_correctly",
3493
- "start": 28810
3553
+ "start": 33003
3494
3554
  },
3495
3555
  {
3496
3556
  "name": "bounded_vec_tests::mapi::applies_function_that_changes_return_type",
3497
- "start": 29243
3557
+ "start": 33436
3498
3558
  },
3499
3559
  {
3500
3560
  "name": "bounded_vec_tests::mapi::does_not_apply_function_past_len",
3501
- "start": 29600
3561
+ "start": 33793
3502
3562
  },
3503
3563
  {
3504
3564
  "name": "bounded_vec_tests::mapi::mapi_with_index_branching_logic",
3505
- "start": 29982
3565
+ "start": 34175
3506
3566
  },
3507
3567
  {
3508
3568
  "name": "bounded_vec_tests::for_each::for_each_map",
3509
- "start": 30590
3569
+ "start": 34783
3510
3570
  },
3511
3571
  {
3512
3572
  "name": "bounded_vec_tests::for_each::smoke_test",
3513
- "start": 30850
3573
+ "start": 35043
3514
3574
  },
3515
3575
  {
3516
3576
  "name": "bounded_vec_tests::for_each::applies_function_correctly",
3517
- "start": 31258
3577
+ "start": 35451
3518
3578
  },
3519
3579
  {
3520
3580
  "name": "bounded_vec_tests::for_each::applies_function_that_changes_return_type",
3521
- "start": 31592
3581
+ "start": 35785
3522
3582
  },
3523
3583
  {
3524
3584
  "name": "bounded_vec_tests::for_each::does_not_apply_function_past_len",
3525
- "start": 31950
3585
+ "start": 36143
3526
3586
  },
3527
3587
  {
3528
3588
  "name": "bounded_vec_tests::for_each::for_each_on_empty_vector",
3529
- "start": 32331
3589
+ "start": 36524
3530
3590
  },
3531
3591
  {
3532
3592
  "name": "bounded_vec_tests::for_each::for_each_with_side_effects",
3533
- "start": 32617
3593
+ "start": 36810
3534
3594
  },
3535
3595
  {
3536
3596
  "name": "bounded_vec_tests::for_eachi::for_eachi_mapi",
3537
- "start": 33223
3597
+ "start": 37416
3538
3598
  },
3539
3599
  {
3540
3600
  "name": "bounded_vec_tests::for_eachi::smoke_test",
3541
- "start": 33490
3601
+ "start": 37683
3542
3602
  },
3543
3603
  {
3544
3604
  "name": "bounded_vec_tests::for_eachi::applies_function_correctly",
3545
- "start": 33946
3605
+ "start": 38139
3546
3606
  },
3547
3607
  {
3548
3608
  "name": "bounded_vec_tests::for_eachi::applies_function_that_changes_return_type",
3549
- "start": 34290
3609
+ "start": 38483
3550
3610
  },
3551
3611
  {
3552
3612
  "name": "bounded_vec_tests::for_eachi::does_not_apply_function_past_len",
3553
- "start": 34658
3613
+ "start": 38851
3554
3614
  },
3555
3615
  {
3556
3616
  "name": "bounded_vec_tests::for_eachi::for_eachi_on_empty_vector",
3557
- "start": 35045
3617
+ "start": 39238
3558
3618
  },
3559
3619
  {
3560
3620
  "name": "bounded_vec_tests::for_eachi::for_eachi_with_index_tracking",
3561
- "start": 35338
3621
+ "start": 39531
3562
3622
  },
3563
3623
  {
3564
3624
  "name": "bounded_vec_tests::from_array::empty",
3565
- "start": 35815
3625
+ "start": 40008
3566
3626
  },
3567
3627
  {
3568
3628
  "name": "bounded_vec_tests::from_array::equal_len",
3569
- "start": 36125
3629
+ "start": 40318
3570
3630
  },
3571
3631
  {
3572
3632
  "name": "bounded_vec_tests::from_array::max_len_greater_then_array_len",
3573
- "start": 36442
3633
+ "start": 40635
3574
3634
  },
3575
3635
  {
3576
3636
  "name": "bounded_vec_tests::from_array::max_len_lower_then_array_len",
3577
- "start": 36913
3637
+ "start": 41106
3578
3638
  },
3579
3639
  {
3580
3640
  "name": "bounded_vec_tests::from_array::from_array_preserves_order",
3581
- "start": 37056
3641
+ "start": 41249
3582
3642
  },
3583
3643
  {
3584
3644
  "name": "bounded_vec_tests::from_array::from_array_with_different_types",
3585
- "start": 37345
3645
+ "start": 41538
3586
3646
  },
3587
3647
  {
3588
3648
  "name": "bounded_vec_tests::trait_from::simple",
3589
- "start": 37782
3649
+ "start": 41975
3590
3650
  },
3591
3651
  {
3592
3652
  "name": "bounded_vec_tests::trait_eq::empty_equality",
3593
- "start": 38220
3653
+ "start": 42413
3594
3654
  },
3595
3655
  {
3596
3656
  "name": "bounded_vec_tests::trait_eq::equality",
3597
- "start": 38467
3657
+ "start": 42660
3598
3658
  },
3599
3659
  {
3600
3660
  "name": "bounded_vec_tests::trait_eq::inequality",
3601
- "start": 38791
3661
+ "start": 42984
3602
3662
  },
3603
3663
  {
3604
3664
  "name": "bounded_vec_tests::from_parts::from_parts",
3605
- "start": 39330
3665
+ "start": 43523
3606
3666
  },
3607
3667
  {
3608
3668
  "name": "bounded_vec_tests::push_pop::push_and_pop_operations",
3609
- "start": 40003
3669
+ "start": 44196
3610
3670
  },
3611
3671
  {
3612
3672
  "name": "bounded_vec_tests::push_pop::push_to_full_vector",
3613
- "start": 40629
3673
+ "start": 44822
3614
3674
  },
3615
3675
  {
3616
3676
  "name": "bounded_vec_tests::push_pop::pop_from_empty_vector",
3617
- "start": 40903
3677
+ "start": 45096
3618
3678
  },
3619
3679
  {
3620
3680
  "name": "bounded_vec_tests::push_pop::push_pop_cycle",
3621
- "start": 41072
3681
+ "start": 45265
3622
3682
  },
3623
3683
  {
3624
3684
  "name": "bounded_vec_tests::extend::extend_from_array",
3625
- "start": 41767
3685
+ "start": 45960
3626
3686
  },
3627
3687
  {
3628
3688
  "name": "bounded_vec_tests::extend::extend_from_vector",
3629
- "start": 42113
3689
+ "start": 46306
3630
3690
  },
3631
3691
  {
3632
3692
  "name": "bounded_vec_tests::extend::extend_from_bounded_vec",
3633
- "start": 42507
3693
+ "start": 46700
3634
3694
  },
3635
3695
  {
3636
3696
  "name": "bounded_vec_tests::extend::extend_from_bounded_vec_limit",
3637
- "start": 43128
3697
+ "start": 47321
3638
3698
  },
3639
3699
  {
3640
3700
  "name": "bounded_vec_tests::extend::extend_from_bounded_vec_full_and_empty",
3641
- "start": 43642
3701
+ "start": 47835
3642
3702
  },
3643
3703
  {
3644
3704
  "name": "bounded_vec_tests::extend::extend_from_bounded_vec_zero_len",
3645
- "start": 44146
3705
+ "start": 48339
3646
3706
  },
3647
3707
  {
3648
3708
  "name": "bounded_vec_tests::extend::extend_from_bounded_vec_last_zeroed",
3649
- "start": 44440
3709
+ "start": 48633
3650
3710
  },
3651
3711
  {
3652
3712
  "name": "bounded_vec_tests::extend::extend_from_bounded_vec_empty_self",
3653
- "start": 44865
3713
+ "start": 49058
3714
+ },
3715
+ {
3716
+ "name": "bounded_vec_tests::extend::extend_from_bounded_vec_preserves_tail_storage",
3717
+ "start": 49676
3654
3718
  },
3655
3719
  {
3656
3720
  "name": "bounded_vec_tests::extend::extend_from_bounded_vec_equal_capacity",
3657
- "start": 45432
3721
+ "start": 50280
3658
3722
  },
3659
3723
  {
3660
3724
  "name": "bounded_vec_tests::extend::extend_array_beyond_max_len",
3661
- "start": 46019
3725
+ "start": 50867
3662
3726
  },
3663
3727
  {
3664
3728
  "name": "bounded_vec_tests::extend::extend_vector_beyond_max_len",
3665
- "start": 46297
3729
+ "start": 51145
3666
3730
  },
3667
3731
  {
3668
3732
  "name": "bounded_vec_tests::extend::extend_bounded_vec_beyond_max_len",
3669
- "start": 46600
3733
+ "start": 51448
3670
3734
  },
3671
3735
  {
3672
3736
  "name": "bounded_vec_tests::extend::extend_with_empty_collections",
3673
- "start": 46886
3737
+ "start": 51734
3674
3738
  },
3675
3739
  {
3676
3740
  "name": "bounded_vec_tests::storage::storage_consistency",
3677
- "start": 47486
3741
+ "start": 52334
3678
3742
  },
3679
3743
  {
3680
3744
  "name": "bounded_vec_tests::storage::storage_after_pop",
3681
- "start": 47988
3745
+ "start": 52836
3682
3746
  },
3683
3747
  {
3684
3748
  "name": "bounded_vec_tests::storage::vector_immutable",
3685
- "start": 48310
3749
+ "start": 53158
3686
3750
  }
3687
3751
  ],
3688
3752
  "path": "std/collections/bounded_vec.nr",
3689
- "source": "use crate::{cmp::Eq, convert::From, runtime::is_unconstrained, static_assert};\n\n/// A `BoundedVec<T, MaxLen>` is a growable storage similar to a built-in vector except that it\n/// is bounded with a maximum possible length. `BoundedVec` is also not\n/// subject to the same restrictions vectors are (notably, nested vectors are disallowed).\n///\n/// Since a BoundedVec is backed by a normal array under the hood, growing the BoundedVec by\n/// pushing an additional element is also more efficient - the length only needs to be increased\n/// by one.\n///\n/// For these reasons `BoundedVec<T, N>` should generally be preferred over vectors when there\n/// is a reasonable maximum bound that can be placed on the vector.\n///\n/// Example:\n///\n/// ```noir\n/// let mut vector: BoundedVec<Field, 10> = BoundedVec::new();\n/// for i in 0..5 {\n/// vector.push(i);\n/// }\n/// assert(vector.len() == 5);\n/// assert(vector.max_len() == 10);\n/// ```\npub struct BoundedVec<T, let MaxLen: u32> {\n storage: [T; MaxLen],\n len: u32,\n}\n\nimpl<T, let MaxLen: u32> BoundedVec<T, MaxLen> {\n /// Creates a new, empty vector of length zero.\n ///\n /// Since this container is backed by an array internally, it still needs an initial value\n /// to give each element. To resolve this, each element is zeroed internally. This value\n /// is guaranteed to be inaccessible unless `get_unchecked` is used.\n ///\n /// Example:\n ///\n /// ```noir\n /// let empty_vector: BoundedVec<Field, 10> = BoundedVec::new();\n /// assert(empty_vector.len() == 0);\n /// ```\n ///\n /// Note that whenever calling `new` the maximum length of the vector should generally be specified\n /// via a type signature:\n ///\n /// ```noir\n /// fn good() -> BoundedVec<Field, 10> {\n /// // Ok! MaxLen is specified with a type annotation\n /// let v1: BoundedVec<Field, 3> = BoundedVec::new();\n /// let v2 = BoundedVec::new();\n ///\n /// // Ok! MaxLen is known from the type of `good`'s return value\n /// v2\n /// }\n ///\n /// fn bad() {\n /// // Error: Type annotation needed\n /// // The compiler can't infer `MaxLen` from the following code:\n /// let mut v3 = BoundedVec::new();\n /// v3.push(5);\n /// }\n /// ```\n pub fn new() -> Self {\n let zeroed = crate::mem::zeroed();\n BoundedVec { storage: [zeroed; MaxLen], len: 0 }\n }\n\n /// Retrieves an element from the vector at the given index, starting from zero.\n ///\n /// If the given index is equal to or greater than the length of the vector, this\n /// will issue a constraint failure.\n ///\n /// Example:\n ///\n /// ```noir\n /// fn foo<let N: u32>(v: BoundedVec<u32, N>) {\n /// let first = v.get(0);\n /// let last = v.get(v.len() - 1);\n /// assert(first != last);\n /// }\n /// ```\n pub fn get(&self, index: u32) -> T {\n assert(index < self.len, \"Attempted to read past end of BoundedVec\");\n self.get_unchecked(index)\n }\n\n /// Retrieves an element from the vector at the given index, starting from zero, without\n /// performing a bounds check.\n ///\n /// Since this function does not perform a bounds check on length before accessing the element,\n /// it is unsafe! Use at your own risk!\n ///\n /// Example:\n ///\n /// ```noir\n /// fn sum_of_first_three<let N: u32>(v: BoundedVec<u32, N>) -> u32 {\n /// // Always ensure the length is larger than the largest\n /// // index passed to get_unchecked\n /// assert(v.len() > 2);\n /// let first = v.get_unchecked(0);\n /// let second = v.get_unchecked(1);\n /// let third = v.get_unchecked(2);\n /// first + second + third\n /// }\n /// ```\n pub fn get_unchecked(&self, index: u32) -> T {\n self.storage[index]\n }\n\n /// Writes an element to the vector at the given index, starting from zero.\n ///\n /// If the given index is equal to or greater than the length of the vector, this will issue a constraint failure.\n ///\n /// Example:\n ///\n /// ```noir\n /// fn foo<let N: u32>(v: BoundedVec<u32, N>) {\n /// let first = v.get(0);\n /// assert(first != 42);\n /// v.set(0, 42);\n /// let new_first = v.get(0);\n /// assert(new_first == 42);\n /// }\n /// ```\n pub fn set(&mut self, index: u32, value: T) {\n assert(index < self.len, \"Attempted to write past end of BoundedVec\");\n self.set_unchecked(index, value)\n }\n\n /// Writes an element to the vector at the given index, starting from zero, without performing a bounds check.\n ///\n /// Since this function does not perform a bounds check on length before accessing the element, it is unsafe! Use at your own risk!\n ///\n /// Example:\n ///\n /// ```noir\n /// fn set_unchecked_example() {\n /// let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n /// vec.extend_from_array([1, 2]);\n ///\n /// // Here we're safely writing within the valid range of `vec`\n /// // `vec` now has the value [42, 2]\n /// vec.set_unchecked(0, 42);\n ///\n /// // We can then safely read this value back out of `vec`.\n /// // Notice that we use the checked version of `get` which would prevent reading unsafe values.\n /// assert_eq(vec.get(0), 42);\n ///\n /// // We've now written past the end of `vec`.\n /// // As this index is still within the maximum potential length of `v`,\n /// // it won't cause a constraint failure.\n /// vec.set_unchecked(2, 42);\n /// println(vec);\n ///\n /// // This will write past the end of the maximum potential length of `vec`,\n /// // it will then trigger a constraint failure.\n /// vec.set_unchecked(5, 42);\n /// println(vec);\n /// }\n /// ```\n pub fn set_unchecked(&mut self, index: u32, value: T) {\n self.storage[index] = value;\n }\n\n /// Pushes an element to the end of the vector. This increases the length\n /// of the vector by one.\n ///\n /// Panics if the new length of the vector will be greater than the max length.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<Field, 2> = BoundedVec::new();\n ///\n /// v.push(1);\n /// v.push(2);\n ///\n /// // Panics with failed assertion \"push out of bounds\"\n /// v.push(3);\n /// ```\n pub fn push(&mut self, elem: T) {\n assert(self.len < MaxLen, \"push out of bounds\");\n\n self.storage[self.len] = elem;\n self.len += 1;\n }\n\n /// Returns the current length of this vector\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<Field, 4> = BoundedVec::new();\n /// assert(v.len() == 0);\n ///\n /// v.push(100);\n /// assert(v.len() == 1);\n ///\n /// v.push(200);\n /// v.push(300);\n /// v.push(400);\n /// assert(v.len() == 4);\n ///\n /// let _ = v.pop();\n /// let _ = v.pop();\n /// assert(v.len() == 2);\n /// ```\n pub fn len(&self) -> u32 {\n self.len\n }\n\n /// Returns the maximum length of this vector. This is always\n /// equal to the `MaxLen` parameter this vector was initialized with.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<Field, 5> = BoundedVec::new();\n ///\n /// assert(v.max_len() == 5);\n /// v.push(10);\n /// assert(v.max_len() == 5);\n /// ```\n pub fn max_len(_self: &BoundedVec<T, MaxLen>) -> u32 {\n MaxLen\n }\n\n /// Returns the internal array within this vector.\n ///\n /// Since arrays in Noir are immutable, mutating the returned storage array will not mutate\n /// the storage held internally by this vector.\n ///\n /// Note that uninitialized elements may be zeroed out!\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<Field, 5> = BoundedVec::new();\n ///\n /// assert(v.storage() == [0, 0, 0, 0, 0]);\n ///\n /// v.push(57);\n /// assert(v.storage() == [57, 0, 0, 0, 0]);\n /// ```\n pub fn storage(self) -> [T; MaxLen] {\n self.storage\n }\n\n /// Pushes each element from the given array to this vector.\n ///\n /// Panics if pushing each element would cause the length of this vector\n /// to exceed the maximum length.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut vec: BoundedVec<Field, 3> = BoundedVec::new();\n /// vec.extend_from_array([2, 4]);\n ///\n /// assert(vec.len == 2);\n /// assert(vec.get(0) == 2);\n /// assert(vec.get(1) == 4);\n /// ```\n pub fn extend_from_array<let Len: u32>(&mut self, array: [T; Len]) {\n let new_len = self.len + array.len();\n assert(new_len <= MaxLen, \"extend_from_array out of bounds\");\n for i in 0..array.len() {\n self.storage[self.len + i] = array[i];\n }\n self.len = new_len;\n }\n\n /// Pushes each element from the given vector to this vector.\n ///\n /// Panics if pushing each element would cause the length of this vector\n /// to exceed the maximum length.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut vec: BoundedVec<Field, 3> = BoundedVec::new();\n /// vec.extend_from_vector([2, 4].as_vector());\n ///\n /// assert(vec.len == 2);\n /// assert(vec.get(0) == 2);\n /// assert(vec.get(1) == 4);\n /// ```\n pub fn extend_from_vector(&mut self, vector: [T]) {\n let new_len = self.len + vector.len();\n assert(new_len <= MaxLen, \"extend_from_vector out of bounds\");\n for i in 0..vector.len() {\n self.storage[self.len + i] = vector[i];\n }\n self.len = new_len;\n }\n\n /// Pushes each element from the other vector to this vector. The length of\n /// the other vector is left unchanged.\n ///\n /// Panics if pushing each element would cause the length of this vector\n /// to exceed the maximum length.\n ///\n /// ```noir\n /// let mut v1: BoundedVec<Field, 5> = BoundedVec::new();\n /// let mut v2: BoundedVec<Field, 7> = BoundedVec::new();\n ///\n /// v2.extend_from_array([1, 2, 3]);\n /// v1.extend_from_bounded_vec(v2);\n ///\n /// assert(v1.storage() == [1, 2, 3, 0, 0]);\n /// assert(v2.storage() == [1, 2, 3, 0, 0, 0, 0]);\n /// ```\n pub fn extend_from_bounded_vec<let Len: u32>(&mut self, vec: BoundedVec<T, Len>) {\n let append_len = vec.len();\n let new_len = self.len + append_len;\n assert(new_len <= MaxLen, \"extend_from_bounded_vec out of bounds\");\n\n if is_unconstrained() {\n for i in 0..append_len {\n self.storage[self.len + i] = vec.get_unchecked(i);\n }\n } else {\n // The source vector can be longer than the destination, or vice versa;\n // regardless we will only ever be able to read or write whichever is\n // the shorter max length of the two. We asserted that the actual content fits,\n // but the capacity of the source vector could be higher.\n let max = crate::cmp::min(Len, MaxLen);\n\n // Save the last item in case we have to do a fixup on an already full array.\n let last = if MaxLen > 0 {\n self.storage[MaxLen - 1]\n } else {\n crate::mem::zeroed()\n };\n\n for src in 0..max {\n // Since we are iterating to the static capacity of the arrays,\n // the destination could be out of bounds. If that's the case,\n // overwrite the last item, which we'll fixup in the end.\n // NB using cmp::min resulted in more opcodes here.\n let mut dst = self.len + src;\n if dst >= MaxLen { dst = MaxLen - 1; };\n // Assigning the source or zeroed to avoid having to merge arrays in SSA.\n self.storage[dst] = if src < append_len {\n vec.get_unchecked(src)\n } else {\n last\n }\n }\n\n // Fixup the last item if we have to.\n if MaxLen > 0 {\n self.storage[MaxLen - 1] = if (self.len + append_len == MaxLen) & (append_len > 0) {\n vec.get_unchecked(append_len - 1)\n } else {\n last\n }\n }\n }\n self.len = new_len;\n }\n\n /// Creates a new vector, populating it with values derived from an array input.\n /// The maximum length of the vector is determined based on the type signature.\n ///\n /// Example:\n ///\n /// ```noir\n /// let bounded_vec: BoundedVec<Field, 10> = BoundedVec::from_array([1, 2, 3])\n /// ```\n pub fn from_array<let Len: u32>(array: [T; Len]) -> Self {\n static_assert(Len <= MaxLen, \"from array out of bounds\");\n let mut vec: BoundedVec<T, MaxLen> = BoundedVec::new();\n vec.extend_from_array(array);\n vec\n }\n\n /// Pops the element at the end of the vector. This will decrease the length\n /// of the vector by one.\n ///\n /// Panics if the vector is empty.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<Field, 2> = BoundedVec::new();\n /// v.push(1);\n /// v.push(2);\n ///\n /// let two = v.pop();\n /// let one = v.pop();\n ///\n /// assert(two == 2);\n /// assert(one == 1);\n ///\n /// // error: cannot pop from an empty vector\n /// let _ = v.pop();\n /// ```\n pub fn pop(&mut self) -> T {\n assert(self.len > 0, \"cannot pop from an empty vector\");\n self.len -= 1;\n self.storage[self.len]\n }\n\n /// Returns true if the given predicate returns true for any element\n /// in this vector.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<u32, 3> = BoundedVec::new();\n /// v.extend_from_array([2, 4, 6]);\n ///\n /// let all_even = !v.any(|elem: u32| elem % 2 != 0);\n /// assert(all_even);\n /// ```\n pub fn any<Env>(self, predicate: fn[Env](T) -> bool) -> bool {\n let mut ret = false;\n if is_unconstrained() {\n for i in 0..self.len {\n ret |= predicate(self.storage[i]);\n }\n } else {\n let mut exceeded_len = false;\n for i in 0..MaxLen {\n exceeded_len |= i == self.len;\n if !exceeded_len {\n ret |= predicate(self.storage[i]);\n }\n }\n }\n ret\n }\n\n /// Creates a new vector of equal size by calling a closure on each element in this vector.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n /// let result = vec.map(|value| value * 2);\n ///\n /// let expected = BoundedVec::from_array([2, 4, 6, 8]);\n /// assert_eq(result, expected);\n /// ```\n pub fn map<U, Env>(&self, f: fn[Env](T) -> U) -> BoundedVec<U, MaxLen> {\n let mut ret = BoundedVec::new();\n ret.len = self.len();\n\n if is_unconstrained() {\n for i in 0..self.len() {\n ret.storage[i] = f(self.get_unchecked(i));\n }\n } else {\n for i in 0..MaxLen {\n ret.storage[i] = if i < self.len() {\n f(self.get_unchecked(i))\n } else {\n crate::mem::zeroed()\n }\n }\n }\n\n ret\n }\n\n /// Creates a new vector of equal size by calling a closure on each element\n /// in this vector, along with its index.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n /// let result = vec.mapi(|i, value| i + value * 2);\n ///\n /// let expected = BoundedVec::from_array([2, 5, 8, 11]);\n /// assert_eq(result, expected);\n /// ```\n pub fn mapi<U, Env>(&self, f: fn[Env](u32, T) -> U) -> BoundedVec<U, MaxLen> {\n let mut ret = BoundedVec::new();\n ret.len = self.len();\n\n if is_unconstrained() {\n for i in 0..self.len() {\n ret.storage[i] = f(i, self.get_unchecked(i));\n }\n } else {\n for i in 0..MaxLen {\n ret.storage[i] = if i < self.len() {\n f(i, self.get_unchecked(i))\n } else {\n crate::mem::zeroed()\n }\n }\n }\n\n ret\n }\n\n /// Calls a closure on each element in this vector.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n /// let mut result = BoundedVec::<u32, 4>::new();\n /// vec.for_each(|value| result.push(value * 2));\n ///\n /// let expected = BoundedVec::from_array([2, 4, 6, 8]);\n /// assert_eq(result, expected);\n /// ```\n pub fn for_each<Env>(&self, f: fn[Env](T) -> ()) {\n if is_unconstrained() {\n for i in 0..self.len() {\n f(self.get_unchecked(i));\n }\n } else {\n for i in 0..MaxLen {\n if i < self.len() {\n f(self.get_unchecked(i));\n }\n }\n }\n }\n\n /// Calls a closure on each element in this vector, along with its index.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n /// let mut result = BoundedVec::<u32, 4>::new();\n /// vec.for_eachi(|i, value| result.push(i + value * 2));\n ///\n /// let expected = BoundedVec::from_array([2, 5, 8, 11]);\n /// assert_eq(result, expected);\n /// ```\n pub fn for_eachi<Env>(&self, f: fn[Env](u32, T) -> ()) {\n if is_unconstrained() {\n for i in 0..self.len() {\n f(i, self.get_unchecked(i));\n }\n } else {\n for i in 0..MaxLen {\n if i < self.len() {\n f(i, self.get_unchecked(i));\n }\n }\n }\n }\n\n /// Creates a new BoundedVec from the given array and length.\n /// The given length must be less than or equal to the length of the array.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_parts([1, 2, 3, 0], 3);\n /// assert_eq(vec.len(), 3);\n /// ```\n pub fn from_parts(mut array: [T; MaxLen], len: u32) -> Self {\n assert(len <= MaxLen);\n BoundedVec { storage: array, len }\n }\n\n /// Creates a new BoundedVec from the given array and length.\n /// The given length must be less than or equal to the length of the array.\n ///\n /// This function is unsafe because it expects all elements past the `len` index\n /// of `array` to be zeroed, but does not check for this internally. Use `from_parts`\n /// for a safe version of this function which does zero out any indices past the\n /// given length. Invalidating this assumption can notably cause `BoundedVec::eq`\n /// to give incorrect results since it will check even elements past `len`.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_parts_unchecked([1, 2, 3, 0], 3);\n /// assert_eq(vec.len(), 3);\n ///\n /// // invalid use!\n /// let vec1: BoundedVec<u32, 4> = BoundedVec::from_parts_unchecked([1, 2, 3, 1], 3);\n /// let vec2: BoundedVec<u32, 4> = BoundedVec::from_parts_unchecked([1, 2, 3, 2], 3);\n ///\n /// // both vecs have length 3 so we'd expect them to be equal, but this\n /// // fails because elements past the length are still checked in eq\n /// assert_eq(vec1, vec2); // fails\n /// ```\n #[deprecated(\"`BoundedVec::from_parts` no longer requires an extra loop, `BoundedVec::from_parts_unchecked` is no longer required\")]\n pub fn from_parts_unchecked(array: [T; MaxLen], len: u32) -> Self {\n assert(len <= MaxLen);\n BoundedVec { storage: array, len }\n }\n}\n\nimpl<T, let MaxLen: u32> Eq for BoundedVec<T, MaxLen>\nwhere\n T: Eq,\n{\n fn eq(self, other: BoundedVec<T, MaxLen>) -> bool {\n if self.len == other.len {\n if is_unconstrained() {\n // safety: we are already in an unconstrained context\n unsafe {\n unconstrained_eq(self, other)\n }\n } else {\n let mut eq = true;\n for i in 0..MaxLen {\n if i < self.len {\n eq &= self.storage[i] == other.storage[i];\n }\n }\n eq\n }\n } else {\n false\n }\n }\n}\n\n/// Returns true if both BoundedVecs are equal.\n/// Note: This assumes the lengths of both Vecs are already equal!\n/// This function is broken out of `impl Eq for BoundedVec` to make use of `break` in unconstrained code.\nunconstrained fn unconstrained_eq<T, let MaxLen: u32>(\n a: BoundedVec<T, MaxLen>,\n b: BoundedVec<T, MaxLen>,\n) -> bool\nwhere\n T: Eq,\n{\n let mut eq = true;\n for i in 0..a.len {\n if a.storage[i] != b.storage[i] {\n eq = false;\n break;\n }\n }\n eq\n}\n\nimpl<T, let MaxLen: u32, let Len: u32> From<[T; Len]> for BoundedVec<T, MaxLen> {\n fn from(array: [T; Len]) -> BoundedVec<T, MaxLen> {\n BoundedVec::from_array(array)\n }\n}\n\nmod bounded_vec_tests {\n\n mod get {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test(should_fail_with = \"Attempted to read past end of BoundedVec\")]\n fn panics_when_reading_elements_past_end_of_vec() {\n let vec: BoundedVec<Field, 5> = BoundedVec::new();\n\n let _ = vec.get(0);\n }\n\n #[test(should_fail_with = \"Attempted to read past end of BoundedVec\")]\n fn panics_when_reading_beyond_length() {\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3]);\n let _ = vec.get(3);\n }\n\n #[test]\n fn get_works_within_bounds() {\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3, 4, 5]);\n assert_eq(vec.get(0), 1);\n assert_eq(vec.get(2), 3);\n assert_eq(vec.get(4), 5);\n }\n\n #[test]\n fn get_unchecked_works() {\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3]);\n assert_eq(vec.get_unchecked(0), 1);\n assert_eq(vec.get_unchecked(2), 3);\n }\n\n #[test]\n fn get_unchecked_works_past_len() {\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3]);\n assert_eq(vec.get_unchecked(4), 0);\n }\n }\n\n mod set {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn set_updates_values_properly() {\n let mut vec = BoundedVec::from_array([0, 0, 0, 0, 0]);\n\n vec.set(0, 42);\n assert_eq(vec.storage, [42, 0, 0, 0, 0]);\n\n vec.set(1, 43);\n assert_eq(vec.storage, [42, 43, 0, 0, 0]);\n\n vec.set(2, 44);\n assert_eq(vec.storage, [42, 43, 44, 0, 0]);\n\n vec.set(1, 10);\n assert_eq(vec.storage, [42, 10, 44, 0, 0]);\n\n vec.set(0, 0);\n assert_eq(vec.storage, [0, 10, 44, 0, 0]);\n }\n\n #[test(should_fail_with = \"Attempted to write past end of BoundedVec\")]\n fn panics_when_writing_elements_past_end_of_vec() {\n let mut vec: BoundedVec<Field, 5> = BoundedVec::new();\n vec.set(0, 42);\n }\n\n #[test(should_fail_with = \"Attempted to write past end of BoundedVec\")]\n fn panics_when_setting_beyond_length() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3]);\n vec.set(3, 4);\n }\n\n #[test]\n fn set_unchecked_operations() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n vec.push(1);\n vec.push(2);\n\n vec.set_unchecked(0, 10);\n assert_eq(vec.get(0), 10);\n }\n\n #[test(should_fail_with = \"Attempted to read past end of BoundedVec\")]\n fn set_unchecked_operations_past_len() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n vec.push(1);\n vec.push(2);\n\n vec.set_unchecked(3, 40);\n assert_eq(vec.get(3), 40);\n }\n\n #[test]\n fn set_preserves_other_elements() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3, 4, 5]);\n\n vec.set(2, 30);\n assert_eq(vec.get(0), 1);\n assert_eq(vec.get(1), 2);\n assert_eq(vec.get(2), 30);\n assert_eq(vec.get(3), 4);\n assert_eq(vec.get(4), 5);\n }\n }\n\n mod any {\n use crate::collections::bounded_vec::BoundedVec;\n use crate::internal::test_unconstrained;\n\n #[test]\n #[test_unconstrained]\n fn returns_false_if_predicate_not_satisfied() {\n let vec: BoundedVec<bool, 4> = BoundedVec::from_array([false, false, false, false]);\n let result = vec.any(|value| value);\n\n assert(!result);\n }\n\n #[test]\n #[test_unconstrained]\n fn returns_true_if_predicate_satisfied() {\n let vec: BoundedVec<bool, 4> = BoundedVec::from_array([false, false, true, true]);\n let result = vec.any(|value| value);\n\n assert(result);\n }\n\n #[test]\n fn returns_false_on_empty_boundedvec() {\n let vec: BoundedVec<bool, 0> = BoundedVec::new();\n let result = vec.any(|value| value);\n\n assert(!result);\n }\n\n #[test]\n #[test_unconstrained]\n fn any_with_complex_predicates() {\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3, 4, 5]);\n\n assert(vec.any(|x| x > 3));\n assert(!vec.any(|x| x > 10));\n assert(vec.any(|x| x % 2 == 0)); // has a even number\n assert(vec.any(|x| x == 3)); // has a specific value\n }\n\n #[test]\n fn any_with_partial_vector() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n vec.push(1);\n vec.push(2);\n\n assert(vec.any(|x| x == 1));\n assert(vec.any(|x| x == 2));\n assert(!vec.any(|x| x == 3));\n }\n }\n\n mod map {\n use crate::collections::bounded_vec::BoundedVec;\n use crate::internal::test_unconstrained;\n\n #[test]\n #[test_unconstrained]\n fn applies_function_correctly() {\n // docs:start:bounded-vec-map-example\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = vec.map(|value| value * 2);\n // docs:end:bounded-vec-map-example\n let expected = BoundedVec::from_array([2, 4, 6, 8]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn applies_function_that_changes_return_type() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = vec.map(|value| (value * 2) as Field);\n let expected: BoundedVec<Field, 4> = BoundedVec::from_array([2, 4, 6, 8]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn does_not_apply_function_past_len() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([0, 1]);\n let result = vec.map(|value| if value == 0 { 5 } else { value });\n let expected = BoundedVec::from_array([5, 1]);\n\n assert_eq(result, expected);\n assert_eq(result.get_unchecked(2), 0);\n }\n\n #[test]\n fn map_with_conditional_logic() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n\n let result = vec.map(|x| if x % 2 == 0 { x * 2 } else { x });\n let expected = BoundedVec::from_array([1, 4, 3, 8]);\n assert_eq(result, expected);\n }\n\n #[test]\n fn map_preserves_length() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = vec.map(|x| x * 2);\n\n assert_eq(result.len(), vec.len());\n assert_eq(result.max_len(), vec.max_len());\n }\n\n #[test]\n fn map_on_empty_vector() {\n let vec: BoundedVec<u32, 5> = BoundedVec::new();\n let result = vec.map(|x| x * 2);\n assert_eq(result, vec);\n assert_eq(result.len(), 0);\n assert_eq(result.max_len(), 5);\n }\n }\n\n mod mapi {\n use crate::collections::bounded_vec::BoundedVec;\n use crate::internal::test_unconstrained;\n\n #[test]\n #[test_unconstrained]\n fn applies_function_correctly() {\n // docs:start:bounded-vec-mapi-example\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = vec.mapi(|i, value| i + value * 2);\n // docs:end:bounded-vec-mapi-example\n let expected = BoundedVec::from_array([2, 5, 8, 11]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn applies_function_that_changes_return_type() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = vec.mapi(|i, value| (i + value * 2) as Field);\n let expected: BoundedVec<Field, 4> = BoundedVec::from_array([2, 5, 8, 11]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn does_not_apply_function_past_len() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([0, 1]);\n let result = vec.mapi(|_, value| if value == 0 { 5 } else { value });\n let expected = BoundedVec::from_array([5, 1]);\n\n assert_eq(result, expected);\n assert_eq(result.get_unchecked(2), 0);\n }\n\n #[test]\n fn mapi_with_index_branching_logic() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n\n let result = vec.mapi(|i, x| if i % 2 == 0 { x * 2 } else { x });\n let expected = BoundedVec::from_array([2, 2, 6, 4]);\n assert_eq(result, expected);\n }\n }\n\n mod for_each {\n use crate::collections::bounded_vec::BoundedVec;\n use crate::internal::test_unconstrained;\n\n // map in terms of for_each\n fn for_each_map<T, U, Env, let MaxLen: u32>(\n input: BoundedVec<T, MaxLen>,\n f: fn[Env](T) -> U,\n ) -> BoundedVec<U, MaxLen> {\n let mut output = BoundedVec::<U, MaxLen>::new();\n let output_ref = &mut output;\n input.for_each(|x| output_ref.push(f(x)));\n output\n }\n\n #[test]\n #[test_unconstrained]\n fn smoke_test() {\n let mut acc = 0;\n let acc_ref = &mut acc;\n // docs:start:bounded-vec-for-each-example\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([1, 2, 3]);\n vec.for_each(|value| { *acc_ref += value; });\n // docs:end:bounded-vec-for-each-example\n assert_eq(acc, 6);\n }\n\n #[test]\n fn applies_function_correctly() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = for_each_map(vec, |value| value * 2);\n let expected = BoundedVec::from_array([2, 4, 6, 8]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn applies_function_that_changes_return_type() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = for_each_map(vec, |value| (value * 2) as Field);\n let expected: BoundedVec<Field, 4> = BoundedVec::from_array([2, 4, 6, 8]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn does_not_apply_function_past_len() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([0, 1]);\n let result = for_each_map(vec, |value| if value == 0 { 5 } else { value });\n let expected = BoundedVec::from_array([5, 1]);\n\n assert_eq(result, expected);\n assert_eq(result.get_unchecked(2), 0);\n }\n\n #[test]\n fn for_each_on_empty_vector() {\n let vec: BoundedVec<u32, 5> = BoundedVec::new();\n let mut count = 0;\n let count_ref = &mut count;\n vec.for_each(|_| { *count_ref += 1; });\n assert_eq(count, 0);\n }\n\n #[test]\n fn for_each_with_side_effects() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([1, 2, 3]);\n let mut seen = BoundedVec::<u32, 3>::new();\n let seen_ref = &mut seen;\n vec.for_each(|x| seen_ref.push(x));\n assert_eq(seen, vec);\n }\n }\n\n mod for_eachi {\n use crate::collections::bounded_vec::BoundedVec;\n use crate::internal::test_unconstrained;\n\n // mapi in terms of for_eachi\n fn for_eachi_mapi<T, U, Env, let MaxLen: u32>(\n input: BoundedVec<T, MaxLen>,\n f: fn[Env](u32, T) -> U,\n ) -> BoundedVec<U, MaxLen> {\n let mut output = BoundedVec::<U, MaxLen>::new();\n let output_ref = &mut output;\n input.for_eachi(|i, x| output_ref.push(f(i, x)));\n output\n }\n\n #[test]\n #[test_unconstrained]\n fn smoke_test() {\n let mut acc = 0;\n let acc_ref = &mut acc;\n // docs:start:bounded-vec-for-eachi-example\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([1, 2, 3]);\n vec.for_eachi(|i, value| { *acc_ref += i * value; });\n // docs:end:bounded-vec-for-eachi-example\n\n // 0 * 1 + 1 * 2 + 2 * 3\n assert_eq(acc, 8);\n }\n\n #[test]\n fn applies_function_correctly() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = for_eachi_mapi(vec, |i, value| i + value * 2);\n let expected = BoundedVec::from_array([2, 5, 8, 11]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn applies_function_that_changes_return_type() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = for_eachi_mapi(vec, |i, value| (i + value * 2) as Field);\n let expected: BoundedVec<Field, 4> = BoundedVec::from_array([2, 5, 8, 11]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn does_not_apply_function_past_len() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([0, 1]);\n let result = for_eachi_mapi(vec, |_, value| if value == 0 { 5 } else { value });\n let expected = BoundedVec::from_array([5, 1]);\n\n assert_eq(result, expected);\n assert_eq(result.get_unchecked(2), 0);\n }\n\n #[test]\n fn for_eachi_on_empty_vector() {\n let vec: BoundedVec<u32, 5> = BoundedVec::new();\n let mut count = 0;\n let count_ref = &mut count;\n vec.for_eachi(|_, _| { *count_ref += 1; });\n assert_eq(count, 0);\n }\n\n #[test]\n fn for_eachi_with_index_tracking() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([10, 20, 30]);\n let mut indices = BoundedVec::<u32, 3>::new();\n let indices_ref = &mut indices;\n vec.for_eachi(|i, _| indices_ref.push(i));\n\n let expected = BoundedVec::from_array([0, 1, 2]);\n assert_eq(indices, expected);\n }\n\n }\n\n mod from_array {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn empty() {\n let empty_array: [Field; 0] = [];\n let bounded_vec = BoundedVec::from_array([]);\n\n assert_eq(bounded_vec.max_len(), 0);\n assert_eq(bounded_vec.len(), 0);\n assert_eq(bounded_vec.storage(), empty_array);\n }\n\n #[test]\n fn equal_len() {\n let array = [1, 2, 3];\n let bounded_vec = BoundedVec::from_array(array);\n\n assert_eq(bounded_vec.max_len(), 3);\n assert_eq(bounded_vec.len(), 3);\n assert_eq(bounded_vec.storage(), array);\n }\n\n #[test]\n fn max_len_greater_then_array_len() {\n let array = [1, 2, 3];\n let bounded_vec: BoundedVec<Field, 10> = BoundedVec::from_array(array);\n\n assert_eq(bounded_vec.max_len(), 10);\n assert_eq(bounded_vec.len(), 3);\n assert_eq(bounded_vec.get(0), 1);\n assert_eq(bounded_vec.get(1), 2);\n assert_eq(bounded_vec.get(2), 3);\n }\n\n #[test(should_fail_with = \"from array out of bounds\")]\n fn max_len_lower_then_array_len() {\n let _: BoundedVec<Field, 2> = BoundedVec::from_array([0; 3]);\n }\n\n #[test]\n fn from_array_preserves_order() {\n let array = [5, 3, 1, 4, 2];\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array(array);\n for i in 0..array.len() {\n assert_eq(vec.get(i), array[i]);\n }\n }\n\n #[test]\n fn from_array_with_different_types() {\n let bool_array = [true, false, true];\n let bool_vec: BoundedVec<bool, 3> = BoundedVec::from_array(bool_array);\n assert_eq(bool_vec.len(), 3);\n assert_eq(bool_vec.get(0), true);\n assert_eq(bool_vec.get(1), false);\n }\n }\n\n mod trait_from {\n use crate::collections::bounded_vec::BoundedVec;\n use crate::convert::From;\n\n #[test]\n fn simple() {\n let array = [1, 2];\n let bounded_vec: BoundedVec<Field, 10> = BoundedVec::from(array);\n\n assert_eq(bounded_vec.max_len(), 10);\n assert_eq(bounded_vec.len(), 2);\n assert_eq(bounded_vec.get(0), 1);\n assert_eq(bounded_vec.get(1), 2);\n }\n }\n\n mod trait_eq {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn empty_equality() {\n let bounded_vec1: BoundedVec<Field, 3> = BoundedVec::new();\n let bounded_vec2: BoundedVec<Field, 3> = BoundedVec::new();\n\n assert_eq(bounded_vec1, bounded_vec2);\n }\n\n #[test]\n fn equality() {\n let mut bounded_vec1: BoundedVec<Field, 3> = BoundedVec::new();\n let mut bounded_vec2: BoundedVec<Field, 3> = BoundedVec::new();\n\n bounded_vec1.push(1);\n bounded_vec2.push(1);\n assert(bounded_vec1 == bounded_vec2);\n }\n\n #[test]\n fn inequality() {\n let mut bounded_vec1: BoundedVec<Field, 3> = BoundedVec::new();\n let mut bounded_vec2: BoundedVec<Field, 3> = BoundedVec::new();\n\n bounded_vec1.push(1);\n assert(bounded_vec1 != bounded_vec2);\n\n bounded_vec2.push(2);\n assert(bounded_vec1 != bounded_vec2);\n }\n }\n\n mod from_parts {\n use crate::collections::bounded_vec::BoundedVec;\n use crate::internal::test_unconstrained;\n\n #[test]\n #[test_unconstrained]\n fn from_parts() {\n // docs:start:from-parts\n let vec: BoundedVec<u32, 4> = BoundedVec::from_parts([1, 2, 3, 0], 3);\n assert_eq(vec.len(), 3);\n\n // Any elements past the given length are ignored, so these\n // two BoundedVecs will be completely equal\n let vec1: BoundedVec<u32, 4> = BoundedVec::from_parts([1, 2, 3, 1], 3);\n let vec2: BoundedVec<u32, 4> = BoundedVec::from_parts([1, 2, 3, 2], 3);\n assert_eq(vec1, vec2);\n // docs:end:from-parts\n }\n }\n\n mod push_pop {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn push_and_pop_operations() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n\n assert_eq(vec.len(), 0);\n\n vec.push(1);\n assert_eq(vec.len(), 1);\n assert_eq(vec.get(0), 1);\n\n vec.push(2);\n assert_eq(vec.len(), 2);\n assert_eq(vec.get(1), 2);\n\n let popped = vec.pop();\n assert_eq(popped, 2);\n assert_eq(vec.len(), 1);\n\n let popped2 = vec.pop();\n assert_eq(popped2, 1);\n assert_eq(vec.len(), 0);\n }\n\n #[test(should_fail_with = \"push out of bounds\")]\n fn push_to_full_vector() {\n let mut vec: BoundedVec<u32, 2> = BoundedVec::new();\n vec.push(1);\n vec.push(2);\n vec.push(3); // should panic\n }\n\n #[test(should_fail_with = \"cannot pop from an empty vector\")]\n fn pop_from_empty_vector() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n let _ = vec.pop(); // should panic\n }\n\n #[test]\n fn push_pop_cycle() {\n let mut vec: BoundedVec<u32, 3> = BoundedVec::new();\n\n // push to full\n vec.push(1);\n vec.push(2);\n vec.push(3);\n assert_eq(vec.len(), 3);\n\n // pop all\n assert_eq(vec.pop(), 3);\n assert_eq(vec.pop(), 2);\n assert_eq(vec.pop(), 1);\n assert_eq(vec.len(), 0);\n\n // push again\n vec.push(4);\n assert_eq(vec.len(), 1);\n assert_eq(vec.get(0), 4);\n }\n }\n\n mod extend {\n use crate::collections::bounded_vec::BoundedVec;\n use crate::internal::test_unconstrained;\n\n #[test]\n fn extend_from_array() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n vec.push(1);\n vec.extend_from_array([2, 3]);\n\n assert_eq(vec.len(), 3);\n assert_eq(vec.get(0), 1);\n assert_eq(vec.get(1), 2);\n assert_eq(vec.get(2), 3);\n }\n\n #[test]\n fn extend_from_vector() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n vec.push(1);\n vec.extend_from_vector([2, 3].as_vector());\n\n assert_eq(vec.len(), 3);\n assert_eq(vec.get(0), 1);\n assert_eq(vec.get(1), 2);\n assert_eq(vec.get(2), 3);\n }\n\n #[test]\n #[test_unconstrained]\n fn extend_from_bounded_vec() {\n // The source deliberately has a higher capacity,\n // to make sure we are not trying to assign out-of-bounds.\n let mut vec1: BoundedVec<u32, 5> = BoundedVec::new();\n let mut vec2: BoundedVec<u32, 9> = BoundedVec::new();\n\n vec1.push(1);\n vec2.push(2);\n vec2.push(3);\n\n vec1.extend_from_bounded_vec(vec2);\n\n assert_eq(vec1.len(), 3);\n assert_eq(vec1.get(0), 1);\n assert_eq(vec1.get(1), 2);\n assert_eq(vec1.get(2), 3);\n }\n\n #[test]\n fn extend_from_bounded_vec_limit() {\n // Capacity and contents chosen so the last item must be assigned to.\n let mut vec1: BoundedVec<u32, 2> = BoundedVec::new();\n let mut vec2: BoundedVec<u32, 5> = BoundedVec::new();\n\n vec1.push(1);\n vec2.push(2);\n\n vec1.extend_from_bounded_vec(vec2);\n\n assert_eq(vec1.len(), 2);\n assert_eq(vec1.get(0), 1);\n assert_eq(vec1.get(1), 2);\n }\n\n #[test]\n fn extend_from_bounded_vec_full_and_empty() {\n // Capacity and contents chosen so the last item must be assigned to.\n let mut vec1: BoundedVec<u32, 2> = BoundedVec::new();\n let vec2: BoundedVec<u32, 5> = BoundedVec::new();\n\n vec1.push(1);\n vec1.push(2);\n\n vec1.extend_from_bounded_vec(vec2);\n\n assert_eq(vec1.len(), 2);\n assert_eq(vec1.get(0), 1);\n assert_eq(vec1.get(1), 2);\n }\n\n #[test]\n fn extend_from_bounded_vec_zero_len() {\n let mut vec1: BoundedVec<u32, 0> = BoundedVec::new();\n let vec2: BoundedVec<u32, 0> = BoundedVec::new();\n\n vec1.extend_from_bounded_vec(vec2);\n\n assert_eq(vec1.len(), 0);\n }\n\n #[test]\n fn extend_from_bounded_vec_last_zeroed() {\n let mut vec1: BoundedVec<u32, 4> = BoundedVec::new();\n let mut vec2: BoundedVec<u32, 4> = BoundedVec::new();\n\n vec1.push(1);\n vec1.push(2);\n vec2.push(3);\n\n vec1.extend_from_bounded_vec(vec2);\n\n assert_eq(vec1.len(), 3);\n assert_eq(vec1.get_unchecked(3), 0);\n }\n\n #[test]\n fn extend_from_bounded_vec_empty_self() {\n // self.len == 0 with Len > MaxLen: the loop doesn't reach\n // the last storage slot, so the fixup must write it.\n let mut vec1: BoundedVec<u32, 3> = BoundedVec::new();\n let vec2: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3]);\n\n vec1.extend_from_bounded_vec(vec2);\n\n assert_eq(vec1.len(), 3);\n assert_eq(vec1.get(0), 1);\n assert_eq(vec1.get(1), 2);\n assert_eq(vec1.get(2), 3);\n }\n\n #[test]\n fn extend_from_bounded_vec_equal_capacity() {\n // Len == MaxLen, fills to capacity.\n let mut vec1: BoundedVec<u32, 4> = BoundedVec::new();\n vec1.push(1);\n let vec2: BoundedVec<u32, 4> = BoundedVec::from_array([2, 3, 4]);\n\n vec1.extend_from_bounded_vec(vec2);\n\n assert_eq(vec1.len(), 4);\n assert_eq(vec1.get(0), 1);\n assert_eq(vec1.get(1), 2);\n assert_eq(vec1.get(2), 3);\n assert_eq(vec1.get(3), 4);\n }\n\n #[test(should_fail_with = \"extend_from_array out of bounds\")]\n fn extend_array_beyond_max_len() {\n let mut vec: BoundedVec<u32, 3> = BoundedVec::new();\n vec.push(1);\n vec.extend_from_array([2, 3, 4]); // should panic\n }\n\n #[test(should_fail_with = \"extend_from_vector out of bounds\")]\n fn extend_vector_beyond_max_len() {\n let mut vec: BoundedVec<u32, 3> = BoundedVec::new();\n vec.push(1);\n vec.extend_from_vector([2, 3, 4].as_vector()); // S]should panic\n }\n\n #[test(should_fail_with = \"extend_from_bounded_vec out of bounds\")]\n fn extend_bounded_vec_beyond_max_len() {\n let mut vec: BoundedVec<u32, 3> = BoundedVec::new();\n let other: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3, 4, 5]);\n vec.extend_from_bounded_vec(other); // should panic\n }\n\n #[test]\n fn extend_with_empty_collections() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n let original_len = vec.len();\n\n vec.extend_from_array([]);\n assert_eq(vec.len(), original_len);\n\n vec.extend_from_vector([].as_vector());\n assert_eq(vec.len(), original_len);\n\n let empty: BoundedVec<u32, 3> = BoundedVec::new();\n vec.extend_from_bounded_vec(empty);\n assert_eq(vec.len(), original_len);\n }\n }\n\n mod storage {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn storage_consistency() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n\n // test initial storage state\n assert_eq(vec.storage(), [0, 0, 0, 0, 0]);\n\n vec.push(1);\n vec.push(2);\n\n // test storage after modifications\n assert_eq(vec.storage(), [1, 2, 0, 0, 0]);\n\n // storage doesn't change length\n assert_eq(vec.len(), 2);\n assert_eq(vec.max_len(), 5);\n }\n\n #[test]\n fn storage_after_pop() {\n let mut vec: BoundedVec<u32, 3> = BoundedVec::from_array([1, 2, 3]);\n\n let _ = vec.pop();\n // after pop, the last element should be unmodified\n assert_eq(vec.storage(), [1, 2, 3]);\n assert_eq(vec.len(), 2);\n }\n\n #[test]\n fn vector_immutable() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([1, 2, 3]);\n let storage = vec.storage();\n\n assert_eq(storage, [1, 2, 3]);\n\n // Verify that the original vector is unchanged\n assert_eq(vec.len(), 3);\n assert_eq(vec.get(0), 1);\n assert_eq(vec.get(1), 2);\n assert_eq(vec.get(2), 3);\n }\n }\n}\n"
3753
+ "source": "use crate::{cmp::Eq, convert::From, runtime::is_unconstrained, static_assert};\n\n/// A `BoundedVec<T, MaxLen>` is a growable storage similar to a built-in vector except that it\n/// is bounded with a maximum possible length. `BoundedVec` is also not\n/// subject to the same restrictions vectors are (notably, nested vectors are disallowed).\n///\n/// Since a BoundedVec is backed by a normal array under the hood, growing the BoundedVec by\n/// pushing an additional element is also more efficient - the length only needs to be increased\n/// by one.\n///\n/// For these reasons `BoundedVec<T, N>` should generally be preferred over vectors when there\n/// is a reasonable maximum bound that can be placed on the vector.\n///\n/// Example:\n///\n/// ```noir\n/// let mut vector: BoundedVec<Field, 10> = BoundedVec::new();\n/// for i in 0..5 {\n/// vector.push(i);\n/// }\n/// assert(vector.len() == 5);\n/// assert(vector.max_len() == 10);\n/// ```\npub struct BoundedVec<T, let MaxLen: u32> {\n storage: [T; MaxLen],\n len: u32,\n}\n\nimpl<T, let MaxLen: u32> BoundedVec<T, MaxLen> {\n /// Creates a new, empty vector of length zero.\n ///\n /// Since this container is backed by an array internally, it still needs an initial value\n /// to give each element. To resolve this, each element is zeroed internally. This value\n /// is guaranteed to be inaccessible unless `get_unchecked` is used.\n ///\n /// Example:\n ///\n /// ```noir\n /// let empty_vector: BoundedVec<Field, 10> = BoundedVec::new();\n /// assert(empty_vector.len() == 0);\n /// ```\n ///\n /// Note that whenever calling `new` the maximum length of the vector should generally be specified\n /// via a type signature:\n ///\n /// ```noir\n /// fn good() -> BoundedVec<Field, 10> {\n /// // Ok! MaxLen is specified with a type annotation\n /// let v1: BoundedVec<Field, 3> = BoundedVec::new();\n /// let v2 = BoundedVec::new();\n ///\n /// // Ok! MaxLen is known from the type of `good`'s return value\n /// v2\n /// }\n ///\n /// fn bad() {\n /// // Error: Type annotation needed\n /// // The compiler can't infer `MaxLen` from the following code:\n /// let mut v3 = BoundedVec::new();\n /// v3.push(5);\n /// }\n /// ```\n pub fn new() -> Self {\n let zeroed = crate::mem::zeroed();\n BoundedVec { storage: [zeroed; MaxLen], len: 0 }\n }\n\n /// Retrieves an element from the vector at the given index, starting from zero.\n ///\n /// If the given index is equal to or greater than the length of the vector, this\n /// will issue a constraint failure.\n ///\n /// Example:\n ///\n /// ```noir\n /// fn foo<let N: u32>(v: BoundedVec<u32, N>) {\n /// let first = v.get(0);\n /// let last = v.get(v.len() - 1);\n /// assert(first != last);\n /// }\n /// ```\n pub fn get(&self, index: u32) -> T {\n assert(index < self.len, \"Attempted to read past end of BoundedVec\");\n self.get_unchecked(index)\n }\n\n /// Retrieves an element from the vector at the given index, starting from zero, without\n /// performing a bounds check.\n ///\n /// Since this function does not perform a bounds check on length before accessing the element,\n /// it is unsafe! Use at your own risk!\n ///\n /// Example:\n ///\n /// ```noir\n /// fn sum_of_first_three<let N: u32>(v: BoundedVec<u32, N>) -> u32 {\n /// // Always ensure the length is larger than the largest\n /// // index passed to get_unchecked\n /// assert(v.len() > 2);\n /// let first = v.get_unchecked(0);\n /// let second = v.get_unchecked(1);\n /// let third = v.get_unchecked(2);\n /// first + second + third\n /// }\n /// ```\n pub fn get_unchecked(&self, index: u32) -> T {\n self.storage[index]\n }\n\n /// Writes an element to the vector at the given index, starting from zero.\n ///\n /// If the given index is equal to or greater than the length of the vector, this will issue a constraint failure.\n ///\n /// Example:\n ///\n /// ```noir\n /// fn foo<let N: u32>(v: BoundedVec<u32, N>) {\n /// let first = v.get(0);\n /// assert(first != 42);\n /// v.set(0, 42);\n /// let new_first = v.get(0);\n /// assert(new_first == 42);\n /// }\n /// ```\n pub fn set(&mut self, index: u32, value: T) {\n assert(index < self.len, \"Attempted to write past end of BoundedVec\");\n self.set_unchecked(index, value)\n }\n\n /// Writes an element to the vector at the given index, starting from zero, without performing a bounds check.\n ///\n /// Since this function does not perform a bounds check on length before accessing the element, it is unsafe! Use at your own risk!\n ///\n /// Example:\n ///\n /// ```noir\n /// fn set_unchecked_example() {\n /// let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n /// vec.extend_from_array([1, 2]);\n ///\n /// // Here we're safely writing within the valid range of `vec`\n /// // `vec` now has the value [42, 2]\n /// vec.set_unchecked(0, 42);\n ///\n /// // We can then safely read this value back out of `vec`.\n /// // Notice that we use the checked version of `get` which would prevent reading unsafe values.\n /// assert_eq(vec.get(0), 42);\n ///\n /// // We've now written past the end of `vec`.\n /// // As this index is still within the maximum potential length of `v`,\n /// // it won't cause a constraint failure.\n /// vec.set_unchecked(2, 42);\n /// println(vec);\n ///\n /// // This will write past the end of the maximum potential length of `vec`,\n /// // it will then trigger a constraint failure.\n /// vec.set_unchecked(5, 42);\n /// println(vec);\n /// }\n /// ```\n pub fn set_unchecked(&mut self, index: u32, value: T) {\n self.storage[index] = value;\n }\n\n /// Pushes an element to the end of the vector. This increases the length\n /// of the vector by one.\n ///\n /// Panics if the new length of the vector will be greater than the max length.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<Field, 2> = BoundedVec::new();\n ///\n /// v.push(1);\n /// v.push(2);\n ///\n /// // Panics with failed assertion \"push out of bounds\"\n /// v.push(3);\n /// ```\n pub fn push(&mut self, elem: T) {\n assert(self.len < MaxLen, \"push out of bounds\");\n\n self.storage[self.len] = elem;\n self.len += 1;\n }\n\n /// Returns the current length of this vector\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<Field, 4> = BoundedVec::new();\n /// assert(v.len() == 0);\n ///\n /// v.push(100);\n /// assert(v.len() == 1);\n ///\n /// v.push(200);\n /// v.push(300);\n /// v.push(400);\n /// assert(v.len() == 4);\n ///\n /// let _ = v.pop();\n /// let _ = v.pop();\n /// assert(v.len() == 2);\n /// ```\n pub fn len(&self) -> u32 {\n self.len\n }\n\n /// Sets the length of the vector to any value between `0` and `MaxLen`.\n ///\n /// Increasing the length exposes elements that were written past the current\n /// length (e.g. with `set_unchecked`); decreasing it discards trailing\n /// elements. Note that this does not zero out any element of the backing storage,\n /// so elements beyond the new length remain readable through `storage`.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<Field, 10> = BoundedVec::from([1, 2, 3, 4, 5]);\n ///\n /// assert(v.len() == 5);\n /// v.set_unchecked(5, 6);\n /// v.set_unchecked(6, 7);\n /// v.set_unchecked(7, 8);\n /// v.set_len(8);\n /// assert(v.len() == 8);\n ///\n /// // The length can also be reduced.\n /// v.set_len(2);\n /// assert(v.len() == 2);\n /// ```\n pub fn set_len(&mut self, len: u32) {\n assert(len <= MaxLen, \"set_len out of bounds\");\n self.len = len;\n }\n\n /// Shortens the vector to `len`, keeping the first `len` elements.\n ///\n /// If `len` is greater than or equal to the current length, the vector is\n /// left unchanged. Regardless of the current length, after this call the\n /// vector is guaranteed to hold no more than `len` elements.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<Field, 10> = BoundedVec::from([1, 2, 3, 4, 5]);\n ///\n /// v.truncate(3);\n /// assert(v.len() == 3);\n ///\n /// // Truncating to a length greater than the current length is a no-op.\n /// v.truncate(8);\n /// assert(v.len() == 3);\n /// ```\n pub fn truncate(&mut self, len: u32) {\n if len < self.len() {\n self.len = len;\n }\n }\n\n /// Returns the maximum length of this vector. This is always\n /// equal to the `MaxLen` parameter this vector was initialized with.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<Field, 5> = BoundedVec::new();\n ///\n /// assert(v.max_len() == 5);\n /// v.push(10);\n /// assert(v.max_len() == 5);\n /// ```\n pub fn max_len(_self: &BoundedVec<T, MaxLen>) -> u32 {\n MaxLen\n }\n\n /// Returns the internal array within this vector.\n ///\n /// Since arrays in Noir are immutable, mutating the returned storage array will not mutate\n /// the storage held internally by this vector.\n ///\n /// Note that uninitialized elements may be zeroed out!\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<Field, 5> = BoundedVec::new();\n ///\n /// assert(v.storage() == [0, 0, 0, 0, 0]);\n ///\n /// v.push(57);\n /// assert(v.storage() == [57, 0, 0, 0, 0]);\n /// ```\n pub fn storage(self) -> [T; MaxLen] {\n self.storage\n }\n\n /// Pushes each element from the given array to this vector.\n ///\n /// Panics if pushing each element would cause the length of this vector\n /// to exceed the maximum length.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut vec: BoundedVec<Field, 3> = BoundedVec::new();\n /// vec.extend_from_array([2, 4]);\n ///\n /// assert(vec.len == 2);\n /// assert(vec.get(0) == 2);\n /// assert(vec.get(1) == 4);\n /// ```\n pub fn extend_from_array<let Len: u32>(&mut self, array: [T; Len]) {\n let new_len = self.len + array.len();\n assert(new_len <= MaxLen, \"extend_from_array out of bounds\");\n for i in 0..array.len() {\n self.storage[self.len + i] = array[i];\n }\n self.len = new_len;\n }\n\n /// Pushes each element from the given vector to this vector.\n ///\n /// Panics if pushing each element would cause the length of this vector\n /// to exceed the maximum length.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut vec: BoundedVec<Field, 3> = BoundedVec::new();\n /// vec.extend_from_vector([2, 4].as_vector());\n ///\n /// assert(vec.len == 2);\n /// assert(vec.get(0) == 2);\n /// assert(vec.get(1) == 4);\n /// ```\n pub fn extend_from_vector(&mut self, vector: [T]) {\n let new_len = self.len + vector.len();\n assert(new_len <= MaxLen, \"extend_from_vector out of bounds\");\n for i in 0..vector.len() {\n self.storage[self.len + i] = vector[i];\n }\n self.len = new_len;\n }\n\n /// Pushes each element from the other vector to this vector. The length of\n /// the other vector is left unchanged.\n ///\n /// Panics if pushing each element would cause the length of this vector\n /// to exceed the maximum length.\n ///\n /// ```noir\n /// let mut v1: BoundedVec<Field, 5> = BoundedVec::new();\n /// let mut v2: BoundedVec<Field, 7> = BoundedVec::new();\n ///\n /// v2.extend_from_array([1, 2, 3]);\n /// v1.extend_from_bounded_vec(v2);\n ///\n /// assert(v1.storage() == [1, 2, 3, 0, 0]);\n /// assert(v2.storage() == [1, 2, 3, 0, 0, 0, 0]);\n /// ```\n pub fn extend_from_bounded_vec<let Len: u32>(&mut self, vec: BoundedVec<T, Len>) {\n let append_len = vec.len();\n let new_len = self.len + append_len;\n assert(new_len <= MaxLen, \"extend_from_bounded_vec out of bounds\");\n\n if is_unconstrained() {\n for i in 0..append_len {\n self.storage[self.len + i] = vec.get_unchecked(i);\n }\n } else {\n // Iterate to a static bound: the smaller of the two capacities, since we can\n // neither read nor write past either. The source's actual length is dynamic.\n let max = crate::cmp::min(Len, MaxLen);\n for i in 0..max {\n if i < append_len {\n self.storage[self.len + i] = vec.get_unchecked(i);\n }\n }\n }\n self.len = new_len;\n }\n\n /// Creates a new vector, populating it with values derived from an array input.\n /// The maximum length of the vector is determined based on the type signature.\n ///\n /// Example:\n ///\n /// ```noir\n /// let bounded_vec: BoundedVec<Field, 10> = BoundedVec::from_array([1, 2, 3])\n /// ```\n pub fn from_array<let Len: u32>(array: [T; Len]) -> Self {\n static_assert(Len <= MaxLen, \"from array out of bounds\");\n let mut vec: BoundedVec<T, MaxLen> = BoundedVec::new();\n vec.extend_from_array(array);\n vec\n }\n\n /// Pops the element at the end of the vector. This will decrease the length\n /// of the vector by one.\n ///\n /// Panics if the vector is empty.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<Field, 2> = BoundedVec::new();\n /// v.push(1);\n /// v.push(2);\n ///\n /// let two = v.pop();\n /// let one = v.pop();\n ///\n /// assert(two == 2);\n /// assert(one == 1);\n ///\n /// // error: cannot pop from an empty vector\n /// let _ = v.pop();\n /// ```\n pub fn pop(&mut self) -> T {\n assert(self.len > 0, \"cannot pop from an empty vector\");\n self.len -= 1;\n self.storage[self.len]\n }\n\n /// Returns true if the given predicate returns true for any element\n /// in this vector.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<u32, 3> = BoundedVec::new();\n /// v.extend_from_array([2, 4, 6]);\n ///\n /// let all_even = !v.any(|elem: u32| elem % 2 != 0);\n /// assert(all_even);\n /// ```\n pub fn any<Env>(self, predicate: fn[Env](T) -> bool) -> bool {\n let mut ret = false;\n if is_unconstrained() {\n for i in 0..self.len {\n ret |= predicate(self.storage[i]);\n }\n } else {\n let mut exceeded_len = false;\n for i in 0..MaxLen {\n exceeded_len |= i == self.len;\n if !exceeded_len {\n ret |= predicate(self.storage[i]);\n }\n }\n }\n ret\n }\n\n /// Creates a new vector of equal size by calling a closure on each element in this vector.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n /// let result = vec.map(|value| value * 2);\n ///\n /// let expected = BoundedVec::from_array([2, 4, 6, 8]);\n /// assert_eq(result, expected);\n /// ```\n pub fn map<U, Env>(&self, f: fn[Env](T) -> U) -> BoundedVec<U, MaxLen> {\n let mut ret = BoundedVec::new();\n ret.len = self.len();\n\n if is_unconstrained() {\n for i in 0..self.len() {\n ret.storage[i] = f(self.get_unchecked(i));\n }\n } else {\n for i in 0..MaxLen {\n if i < self.len() {\n ret.storage[i] = f(self.get_unchecked(i));\n }\n }\n }\n\n ret\n }\n\n /// Creates a new vector of equal size by calling a closure on each element\n /// in this vector, along with its index.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n /// let result = vec.mapi(|i, value| i + value * 2);\n ///\n /// let expected = BoundedVec::from_array([2, 5, 8, 11]);\n /// assert_eq(result, expected);\n /// ```\n pub fn mapi<U, Env>(&self, f: fn[Env](u32, T) -> U) -> BoundedVec<U, MaxLen> {\n let mut ret = BoundedVec::new();\n ret.len = self.len();\n\n if is_unconstrained() {\n for i in 0..self.len() {\n ret.storage[i] = f(i, self.get_unchecked(i));\n }\n } else {\n for i in 0..MaxLen {\n if i < self.len() {\n ret.storage[i] = f(i, self.get_unchecked(i));\n }\n }\n }\n\n ret\n }\n\n /// Calls a closure on each element in this vector.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n /// let mut result = BoundedVec::<u32, 4>::new();\n /// vec.for_each(|value| result.push(value * 2));\n ///\n /// let expected = BoundedVec::from_array([2, 4, 6, 8]);\n /// assert_eq(result, expected);\n /// ```\n pub fn for_each<Env>(&self, f: fn[Env](T) -> ()) {\n if is_unconstrained() {\n for i in 0..self.len() {\n f(self.get_unchecked(i));\n }\n } else {\n for i in 0..MaxLen {\n if i < self.len() {\n f(self.get_unchecked(i));\n }\n }\n }\n }\n\n /// Calls a closure on each element in this vector, along with its index.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n /// let mut result = BoundedVec::<u32, 4>::new();\n /// vec.for_eachi(|i, value| result.push(i + value * 2));\n ///\n /// let expected = BoundedVec::from_array([2, 5, 8, 11]);\n /// assert_eq(result, expected);\n /// ```\n pub fn for_eachi<Env>(&self, f: fn[Env](u32, T) -> ()) {\n if is_unconstrained() {\n for i in 0..self.len() {\n f(i, self.get_unchecked(i));\n }\n } else {\n for i in 0..MaxLen {\n if i < self.len() {\n f(i, self.get_unchecked(i));\n }\n }\n }\n }\n\n /// Creates a new BoundedVec from the given array and length.\n /// The given length must be less than or equal to the length of the array.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_parts([1, 2, 3, 0], 3);\n /// assert_eq(vec.len(), 3);\n /// ```\n pub fn from_parts(mut array: [T; MaxLen], len: u32) -> Self {\n assert(len <= MaxLen);\n BoundedVec { storage: array, len }\n }\n\n /// Creates a new BoundedVec from the given array and length.\n /// The given length must be less than or equal to the length of the array.\n ///\n /// This function is unsafe because it expects all elements past the `len` index\n /// of `array` to be zeroed, but does not check for this internally. Use `from_parts`\n /// for a safe version of this function which does zero out any indices past the\n /// given length. Invalidating this assumption can notably cause `BoundedVec::eq`\n /// to give incorrect results since it will check even elements past `len`.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_parts_unchecked([1, 2, 3, 0], 3);\n /// assert_eq(vec.len(), 3);\n ///\n /// // invalid use!\n /// let vec1: BoundedVec<u32, 4> = BoundedVec::from_parts_unchecked([1, 2, 3, 1], 3);\n /// let vec2: BoundedVec<u32, 4> = BoundedVec::from_parts_unchecked([1, 2, 3, 2], 3);\n ///\n /// // both vecs have length 3 so we'd expect them to be equal, but this\n /// // fails because elements past the length are still checked in eq\n /// assert_eq(vec1, vec2); // fails\n /// ```\n #[deprecated(\"`BoundedVec::from_parts` no longer requires an extra loop, `BoundedVec::from_parts_unchecked` is no longer required\")]\n pub fn from_parts_unchecked(array: [T; MaxLen], len: u32) -> Self {\n assert(len <= MaxLen);\n BoundedVec { storage: array, len }\n }\n}\n\nimpl<T, let MaxLen: u32> Eq for BoundedVec<T, MaxLen>\nwhere\n T: Eq,\n{\n fn eq(self, other: BoundedVec<T, MaxLen>) -> bool {\n if self.len == other.len {\n if is_unconstrained() {\n // safety: we are already in an unconstrained context\n unsafe {\n unconstrained_eq(self, other)\n }\n } else {\n let mut eq = true;\n for i in 0..MaxLen {\n if i < self.len {\n eq &= self.storage[i] == other.storage[i];\n }\n }\n eq\n }\n } else {\n false\n }\n }\n}\n\n/// Returns true if both BoundedVecs are equal.\n/// Note: This assumes the lengths of both Vecs are already equal!\n/// This function is broken out of `impl Eq for BoundedVec` to make use of `break` in unconstrained code.\nunconstrained fn unconstrained_eq<T, let MaxLen: u32>(\n a: BoundedVec<T, MaxLen>,\n b: BoundedVec<T, MaxLen>,\n) -> bool\nwhere\n T: Eq,\n{\n let mut eq = true;\n for i in 0..a.len {\n if a.storage[i] != b.storage[i] {\n eq = false;\n break;\n }\n }\n eq\n}\n\nimpl<T, let MaxLen: u32, let Len: u32> From<[T; Len]> for BoundedVec<T, MaxLen> {\n fn from(array: [T; Len]) -> BoundedVec<T, MaxLen> {\n BoundedVec::from_array(array)\n }\n}\n\nmod bounded_vec_tests {\n\n mod get {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test(should_fail_with = \"Attempted to read past end of BoundedVec\")]\n fn panics_when_reading_elements_past_end_of_vec() {\n let vec: BoundedVec<Field, 5> = BoundedVec::new();\n\n let _ = vec.get(0);\n }\n\n #[test(should_fail_with = \"Attempted to read past end of BoundedVec\")]\n fn panics_when_reading_beyond_length() {\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3]);\n let _ = vec.get(3);\n }\n\n #[test]\n fn get_works_within_bounds() {\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3, 4, 5]);\n assert_eq(vec.get(0), 1);\n assert_eq(vec.get(2), 3);\n assert_eq(vec.get(4), 5);\n }\n\n #[test]\n fn get_unchecked_works() {\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3]);\n assert_eq(vec.get_unchecked(0), 1);\n assert_eq(vec.get_unchecked(2), 3);\n }\n\n #[test]\n fn get_unchecked_works_past_len() {\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3]);\n assert_eq(vec.get_unchecked(4), 0);\n }\n }\n\n mod set {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn set_updates_values_properly() {\n let mut vec = BoundedVec::from_array([0, 0, 0, 0, 0]);\n\n vec.set(0, 42);\n assert_eq(vec.storage, [42, 0, 0, 0, 0]);\n\n vec.set(1, 43);\n assert_eq(vec.storage, [42, 43, 0, 0, 0]);\n\n vec.set(2, 44);\n assert_eq(vec.storage, [42, 43, 44, 0, 0]);\n\n vec.set(1, 10);\n assert_eq(vec.storage, [42, 10, 44, 0, 0]);\n\n vec.set(0, 0);\n assert_eq(vec.storage, [0, 10, 44, 0, 0]);\n }\n\n #[test(should_fail_with = \"Attempted to write past end of BoundedVec\")]\n fn panics_when_writing_elements_past_end_of_vec() {\n let mut vec: BoundedVec<Field, 5> = BoundedVec::new();\n vec.set(0, 42);\n }\n\n #[test(should_fail_with = \"Attempted to write past end of BoundedVec\")]\n fn panics_when_setting_beyond_length() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3]);\n vec.set(3, 4);\n }\n\n #[test]\n fn set_unchecked_operations() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n vec.push(1);\n vec.push(2);\n\n vec.set_unchecked(0, 10);\n assert_eq(vec.get(0), 10);\n }\n\n #[test(should_fail_with = \"Attempted to read past end of BoundedVec\")]\n fn set_unchecked_operations_past_len() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n vec.push(1);\n vec.push(2);\n\n vec.set_unchecked(3, 40);\n assert_eq(vec.get(3), 40);\n }\n\n #[test]\n fn set_preserves_other_elements() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3, 4, 5]);\n\n vec.set(2, 30);\n assert_eq(vec.get(0), 1);\n assert_eq(vec.get(1), 2);\n assert_eq(vec.get(2), 30);\n assert_eq(vec.get(3), 4);\n assert_eq(vec.get(4), 5);\n }\n }\n\n mod set_len {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn set_len_works_after_multiple_unchecked_sets() {\n let mut vec: BoundedVec<u8, 10> = BoundedVec::from_array([1, 2, 3]);\n vec.set_unchecked(3, 44);\n vec.set_unchecked(4, 55);\n vec.set_unchecked(5, 66);\n // Index 6 is intentionally left untouched: it stays zeroed.\n vec.set_len(8);\n assert_eq(vec.len(), 8);\n\n // The explicitly written elements are exposed at their indices...\n assert_eq(vec.get(3), 44);\n assert_eq(vec.get(4), 55);\n assert_eq(vec.get(5), 66);\n // ...while the gap between the last write and the new length is zeroed.\n assert_eq(vec.get(6), 0);\n assert_eq(vec.get(7), 0);\n\n vec.extend_from_array([88, 99]);\n assert_eq(vec.len(), 10);\n }\n\n #[test]\n fn set_len_can_reduce_the_length() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3, 4, 5]);\n vec.set_len(2);\n assert_eq(vec.len(), 2);\n // Reducing the length does not zero the backing storage, so the\n // discarded elements remain readable through `storage`.\n assert_eq(vec.storage()[2], 3);\n assert_eq(vec.storage()[3], 4);\n assert_eq(vec.storage()[4], 5);\n }\n\n #[test(should_fail_with = \"set_len out of bounds\")]\n fn panics_when_set_len_beyond_max_len() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3]);\n vec.set_len(6);\n }\n }\n\n mod truncate {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn truncate_shortens_to_len() {\n let mut vec: BoundedVec<u32, 10> = BoundedVec::from_array([1, 2, 3, 4, 5]);\n vec.truncate(3);\n assert_eq(vec.len(), 3);\n assert_eq(vec.storage()[0], 1);\n assert_eq(vec.storage()[1], 2);\n assert_eq(vec.storage()[2], 3);\n }\n\n #[test]\n fn truncate_to_zero_empties_the_vec() {\n let mut vec: BoundedVec<u32, 10> = BoundedVec::from_array([1, 2, 3]);\n vec.truncate(0);\n assert_eq(vec.len(), 0);\n }\n\n #[test]\n fn truncate_to_equal_len_is_noop() {\n let mut vec: BoundedVec<u32, 10> = BoundedVec::from_array([1, 2, 3]);\n vec.truncate(3);\n assert_eq(vec.len(), 3);\n }\n\n #[test]\n fn truncate_to_greater_len_is_noop() {\n let mut vec: BoundedVec<u32, 10> = BoundedVec::from_array([1, 2, 3]);\n vec.truncate(8);\n assert_eq(vec.len(), 3);\n }\n\n #[test]\n fn truncate_beyond_max_len_is_noop() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3]);\n vec.truncate(100);\n assert_eq(vec.len(), 3);\n }\n\n #[test]\n fn truncate_does_not_zero_remaining_storage() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3, 4, 5]);\n vec.truncate(2);\n assert_eq(vec.len(), 2);\n // Items beyond the new length are left untouched in the backing storage.\n assert_eq(vec.storage()[2], 3);\n assert_eq(vec.storage()[3], 4);\n assert_eq(vec.storage()[4], 5);\n }\n\n #[test]\n fn truncate_then_push_continues_from_new_len() {\n let mut vec: BoundedVec<u32, 10> = BoundedVec::from_array([1, 2, 3, 4, 5]);\n vec.truncate(2);\n vec.push(30);\n assert_eq(vec.len(), 3);\n assert_eq(vec.storage()[0], 1);\n assert_eq(vec.storage()[1], 2);\n assert_eq(vec.storage()[2], 30);\n }\n }\n\n mod any {\n use crate::collections::bounded_vec::BoundedVec;\n use crate::internal::test_unconstrained;\n\n #[test]\n #[test_unconstrained]\n fn returns_false_if_predicate_not_satisfied() {\n let vec: BoundedVec<bool, 4> = BoundedVec::from_array([false, false, false, false]);\n let result = vec.any(|value| value);\n\n assert(!result);\n }\n\n #[test]\n #[test_unconstrained]\n fn returns_true_if_predicate_satisfied() {\n let vec: BoundedVec<bool, 4> = BoundedVec::from_array([false, false, true, true]);\n let result = vec.any(|value| value);\n\n assert(result);\n }\n\n #[test]\n fn returns_false_on_empty_boundedvec() {\n let vec: BoundedVec<bool, 0> = BoundedVec::new();\n let result = vec.any(|value| value);\n\n assert(!result);\n }\n\n #[test]\n #[test_unconstrained]\n fn any_with_complex_predicates() {\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3, 4, 5]);\n\n assert(vec.any(|x| x > 3));\n assert(!vec.any(|x| x > 10));\n assert(vec.any(|x| x % 2 == 0)); // has a even number\n assert(vec.any(|x| x == 3)); // has a specific value\n }\n\n #[test]\n fn any_with_partial_vector() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n vec.push(1);\n vec.push(2);\n\n assert(vec.any(|x| x == 1));\n assert(vec.any(|x| x == 2));\n assert(!vec.any(|x| x == 3));\n }\n }\n\n mod map {\n use crate::collections::bounded_vec::BoundedVec;\n use crate::internal::test_unconstrained;\n\n #[test]\n #[test_unconstrained]\n fn applies_function_correctly() {\n // docs:start:bounded-vec-map-example\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = vec.map(|value| value * 2);\n // docs:end:bounded-vec-map-example\n let expected = BoundedVec::from_array([2, 4, 6, 8]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn applies_function_that_changes_return_type() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = vec.map(|value| (value * 2) as Field);\n let expected: BoundedVec<Field, 4> = BoundedVec::from_array([2, 4, 6, 8]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn does_not_apply_function_past_len() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([0, 1]);\n let result = vec.map(|value| if value == 0 { 5 } else { value });\n let expected = BoundedVec::from_array([5, 1]);\n\n assert_eq(result, expected);\n assert_eq(result.get_unchecked(2), 0);\n }\n\n #[test]\n fn map_with_conditional_logic() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n\n let result = vec.map(|x| if x % 2 == 0 { x * 2 } else { x });\n let expected = BoundedVec::from_array([1, 4, 3, 8]);\n assert_eq(result, expected);\n }\n\n #[test]\n fn map_preserves_length() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = vec.map(|x| x * 2);\n\n assert_eq(result.len(), vec.len());\n assert_eq(result.max_len(), vec.max_len());\n }\n\n #[test]\n fn map_on_empty_vector() {\n let vec: BoundedVec<u32, 5> = BoundedVec::new();\n let result = vec.map(|x| x * 2);\n assert_eq(result, vec);\n assert_eq(result.len(), 0);\n assert_eq(result.max_len(), 5);\n }\n }\n\n mod mapi {\n use crate::collections::bounded_vec::BoundedVec;\n use crate::internal::test_unconstrained;\n\n #[test]\n #[test_unconstrained]\n fn applies_function_correctly() {\n // docs:start:bounded-vec-mapi-example\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = vec.mapi(|i, value| i + value * 2);\n // docs:end:bounded-vec-mapi-example\n let expected = BoundedVec::from_array([2, 5, 8, 11]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn applies_function_that_changes_return_type() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = vec.mapi(|i, value| (i + value * 2) as Field);\n let expected: BoundedVec<Field, 4> = BoundedVec::from_array([2, 5, 8, 11]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn does_not_apply_function_past_len() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([0, 1]);\n let result = vec.mapi(|_, value| if value == 0 { 5 } else { value });\n let expected = BoundedVec::from_array([5, 1]);\n\n assert_eq(result, expected);\n assert_eq(result.get_unchecked(2), 0);\n }\n\n #[test]\n fn mapi_with_index_branching_logic() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n\n let result = vec.mapi(|i, x| if i % 2 == 0 { x * 2 } else { x });\n let expected = BoundedVec::from_array([2, 2, 6, 4]);\n assert_eq(result, expected);\n }\n }\n\n mod for_each {\n use crate::collections::bounded_vec::BoundedVec;\n use crate::internal::test_unconstrained;\n\n // map in terms of for_each\n fn for_each_map<T, U, Env, let MaxLen: u32>(\n input: BoundedVec<T, MaxLen>,\n f: fn[Env](T) -> U,\n ) -> BoundedVec<U, MaxLen> {\n let mut output = BoundedVec::<U, MaxLen>::new();\n let output_ref = &mut output;\n input.for_each(|x| output_ref.push(f(x)));\n output\n }\n\n #[test]\n #[test_unconstrained]\n fn smoke_test() {\n let mut acc = 0;\n let acc_ref = &mut acc;\n // docs:start:bounded-vec-for-each-example\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([1, 2, 3]);\n vec.for_each(|value| { *acc_ref += value; });\n // docs:end:bounded-vec-for-each-example\n assert_eq(acc, 6);\n }\n\n #[test]\n fn applies_function_correctly() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = for_each_map(vec, |value| value * 2);\n let expected = BoundedVec::from_array([2, 4, 6, 8]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn applies_function_that_changes_return_type() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = for_each_map(vec, |value| (value * 2) as Field);\n let expected: BoundedVec<Field, 4> = BoundedVec::from_array([2, 4, 6, 8]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn does_not_apply_function_past_len() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([0, 1]);\n let result = for_each_map(vec, |value| if value == 0 { 5 } else { value });\n let expected = BoundedVec::from_array([5, 1]);\n\n assert_eq(result, expected);\n assert_eq(result.get_unchecked(2), 0);\n }\n\n #[test]\n fn for_each_on_empty_vector() {\n let vec: BoundedVec<u32, 5> = BoundedVec::new();\n let mut count = 0;\n let count_ref = &mut count;\n vec.for_each(|_| { *count_ref += 1; });\n assert_eq(count, 0);\n }\n\n #[test]\n fn for_each_with_side_effects() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([1, 2, 3]);\n let mut seen = BoundedVec::<u32, 3>::new();\n let seen_ref = &mut seen;\n vec.for_each(|x| seen_ref.push(x));\n assert_eq(seen, vec);\n }\n }\n\n mod for_eachi {\n use crate::collections::bounded_vec::BoundedVec;\n use crate::internal::test_unconstrained;\n\n // mapi in terms of for_eachi\n fn for_eachi_mapi<T, U, Env, let MaxLen: u32>(\n input: BoundedVec<T, MaxLen>,\n f: fn[Env](u32, T) -> U,\n ) -> BoundedVec<U, MaxLen> {\n let mut output = BoundedVec::<U, MaxLen>::new();\n let output_ref = &mut output;\n input.for_eachi(|i, x| output_ref.push(f(i, x)));\n output\n }\n\n #[test]\n #[test_unconstrained]\n fn smoke_test() {\n let mut acc = 0;\n let acc_ref = &mut acc;\n // docs:start:bounded-vec-for-eachi-example\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([1, 2, 3]);\n vec.for_eachi(|i, value| { *acc_ref += i * value; });\n // docs:end:bounded-vec-for-eachi-example\n\n // 0 * 1 + 1 * 2 + 2 * 3\n assert_eq(acc, 8);\n }\n\n #[test]\n fn applies_function_correctly() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = for_eachi_mapi(vec, |i, value| i + value * 2);\n let expected = BoundedVec::from_array([2, 5, 8, 11]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn applies_function_that_changes_return_type() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = for_eachi_mapi(vec, |i, value| (i + value * 2) as Field);\n let expected: BoundedVec<Field, 4> = BoundedVec::from_array([2, 5, 8, 11]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn does_not_apply_function_past_len() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([0, 1]);\n let result = for_eachi_mapi(vec, |_, value| if value == 0 { 5 } else { value });\n let expected = BoundedVec::from_array([5, 1]);\n\n assert_eq(result, expected);\n assert_eq(result.get_unchecked(2), 0);\n }\n\n #[test]\n fn for_eachi_on_empty_vector() {\n let vec: BoundedVec<u32, 5> = BoundedVec::new();\n let mut count = 0;\n let count_ref = &mut count;\n vec.for_eachi(|_, _| { *count_ref += 1; });\n assert_eq(count, 0);\n }\n\n #[test]\n fn for_eachi_with_index_tracking() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([10, 20, 30]);\n let mut indices = BoundedVec::<u32, 3>::new();\n let indices_ref = &mut indices;\n vec.for_eachi(|i, _| indices_ref.push(i));\n\n let expected = BoundedVec::from_array([0, 1, 2]);\n assert_eq(indices, expected);\n }\n\n }\n\n mod from_array {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn empty() {\n let empty_array: [Field; 0] = [];\n let bounded_vec = BoundedVec::from_array([]);\n\n assert_eq(bounded_vec.max_len(), 0);\n assert_eq(bounded_vec.len(), 0);\n assert_eq(bounded_vec.storage(), empty_array);\n }\n\n #[test]\n fn equal_len() {\n let array = [1, 2, 3];\n let bounded_vec = BoundedVec::from_array(array);\n\n assert_eq(bounded_vec.max_len(), 3);\n assert_eq(bounded_vec.len(), 3);\n assert_eq(bounded_vec.storage(), array);\n }\n\n #[test]\n fn max_len_greater_then_array_len() {\n let array = [1, 2, 3];\n let bounded_vec: BoundedVec<Field, 10> = BoundedVec::from_array(array);\n\n assert_eq(bounded_vec.max_len(), 10);\n assert_eq(bounded_vec.len(), 3);\n assert_eq(bounded_vec.get(0), 1);\n assert_eq(bounded_vec.get(1), 2);\n assert_eq(bounded_vec.get(2), 3);\n }\n\n #[test(should_fail_with = \"from array out of bounds\")]\n fn max_len_lower_then_array_len() {\n let _: BoundedVec<Field, 2> = BoundedVec::from_array([0; 3]);\n }\n\n #[test]\n fn from_array_preserves_order() {\n let array = [5, 3, 1, 4, 2];\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array(array);\n for i in 0..array.len() {\n assert_eq(vec.get(i), array[i]);\n }\n }\n\n #[test]\n fn from_array_with_different_types() {\n let bool_array = [true, false, true];\n let bool_vec: BoundedVec<bool, 3> = BoundedVec::from_array(bool_array);\n assert_eq(bool_vec.len(), 3);\n assert_eq(bool_vec.get(0), true);\n assert_eq(bool_vec.get(1), false);\n }\n }\n\n mod trait_from {\n use crate::collections::bounded_vec::BoundedVec;\n use crate::convert::From;\n\n #[test]\n fn simple() {\n let array = [1, 2];\n let bounded_vec: BoundedVec<Field, 10> = BoundedVec::from(array);\n\n assert_eq(bounded_vec.max_len(), 10);\n assert_eq(bounded_vec.len(), 2);\n assert_eq(bounded_vec.get(0), 1);\n assert_eq(bounded_vec.get(1), 2);\n }\n }\n\n mod trait_eq {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn empty_equality() {\n let bounded_vec1: BoundedVec<Field, 3> = BoundedVec::new();\n let bounded_vec2: BoundedVec<Field, 3> = BoundedVec::new();\n\n assert_eq(bounded_vec1, bounded_vec2);\n }\n\n #[test]\n fn equality() {\n let mut bounded_vec1: BoundedVec<Field, 3> = BoundedVec::new();\n let mut bounded_vec2: BoundedVec<Field, 3> = BoundedVec::new();\n\n bounded_vec1.push(1);\n bounded_vec2.push(1);\n assert(bounded_vec1 == bounded_vec2);\n }\n\n #[test]\n fn inequality() {\n let mut bounded_vec1: BoundedVec<Field, 3> = BoundedVec::new();\n let mut bounded_vec2: BoundedVec<Field, 3> = BoundedVec::new();\n\n bounded_vec1.push(1);\n assert(bounded_vec1 != bounded_vec2);\n\n bounded_vec2.push(2);\n assert(bounded_vec1 != bounded_vec2);\n }\n }\n\n mod from_parts {\n use crate::collections::bounded_vec::BoundedVec;\n use crate::internal::test_unconstrained;\n\n #[test]\n #[test_unconstrained]\n fn from_parts() {\n // docs:start:from-parts\n let vec: BoundedVec<u32, 4> = BoundedVec::from_parts([1, 2, 3, 0], 3);\n assert_eq(vec.len(), 3);\n\n // Any elements past the given length are ignored, so these\n // two BoundedVecs will be completely equal\n let vec1: BoundedVec<u32, 4> = BoundedVec::from_parts([1, 2, 3, 1], 3);\n let vec2: BoundedVec<u32, 4> = BoundedVec::from_parts([1, 2, 3, 2], 3);\n assert_eq(vec1, vec2);\n // docs:end:from-parts\n }\n }\n\n mod push_pop {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn push_and_pop_operations() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n\n assert_eq(vec.len(), 0);\n\n vec.push(1);\n assert_eq(vec.len(), 1);\n assert_eq(vec.get(0), 1);\n\n vec.push(2);\n assert_eq(vec.len(), 2);\n assert_eq(vec.get(1), 2);\n\n let popped = vec.pop();\n assert_eq(popped, 2);\n assert_eq(vec.len(), 1);\n\n let popped2 = vec.pop();\n assert_eq(popped2, 1);\n assert_eq(vec.len(), 0);\n }\n\n #[test(should_fail_with = \"push out of bounds\")]\n fn push_to_full_vector() {\n let mut vec: BoundedVec<u32, 2> = BoundedVec::new();\n vec.push(1);\n vec.push(2);\n vec.push(3); // should panic\n }\n\n #[test(should_fail_with = \"cannot pop from an empty vector\")]\n fn pop_from_empty_vector() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n let _ = vec.pop(); // should panic\n }\n\n #[test]\n fn push_pop_cycle() {\n let mut vec: BoundedVec<u32, 3> = BoundedVec::new();\n\n // push to full\n vec.push(1);\n vec.push(2);\n vec.push(3);\n assert_eq(vec.len(), 3);\n\n // pop all\n assert_eq(vec.pop(), 3);\n assert_eq(vec.pop(), 2);\n assert_eq(vec.pop(), 1);\n assert_eq(vec.len(), 0);\n\n // push again\n vec.push(4);\n assert_eq(vec.len(), 1);\n assert_eq(vec.get(0), 4);\n }\n }\n\n mod extend {\n use crate::collections::bounded_vec::BoundedVec;\n use crate::internal::test_unconstrained;\n\n #[test]\n fn extend_from_array() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n vec.push(1);\n vec.extend_from_array([2, 3]);\n\n assert_eq(vec.len(), 3);\n assert_eq(vec.get(0), 1);\n assert_eq(vec.get(1), 2);\n assert_eq(vec.get(2), 3);\n }\n\n #[test]\n fn extend_from_vector() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n vec.push(1);\n vec.extend_from_vector([2, 3].as_vector());\n\n assert_eq(vec.len(), 3);\n assert_eq(vec.get(0), 1);\n assert_eq(vec.get(1), 2);\n assert_eq(vec.get(2), 3);\n }\n\n #[test]\n #[test_unconstrained]\n fn extend_from_bounded_vec() {\n // The source deliberately has a higher capacity,\n // to make sure we are not trying to assign out-of-bounds.\n let mut vec1: BoundedVec<u32, 5> = BoundedVec::new();\n let mut vec2: BoundedVec<u32, 9> = BoundedVec::new();\n\n vec1.push(1);\n vec2.push(2);\n vec2.push(3);\n\n vec1.extend_from_bounded_vec(vec2);\n\n assert_eq(vec1.len(), 3);\n assert_eq(vec1.get(0), 1);\n assert_eq(vec1.get(1), 2);\n assert_eq(vec1.get(2), 3);\n }\n\n #[test]\n fn extend_from_bounded_vec_limit() {\n // Capacity and contents chosen so the last item must be assigned to.\n let mut vec1: BoundedVec<u32, 2> = BoundedVec::new();\n let mut vec2: BoundedVec<u32, 5> = BoundedVec::new();\n\n vec1.push(1);\n vec2.push(2);\n\n vec1.extend_from_bounded_vec(vec2);\n\n assert_eq(vec1.len(), 2);\n assert_eq(vec1.get(0), 1);\n assert_eq(vec1.get(1), 2);\n }\n\n #[test]\n fn extend_from_bounded_vec_full_and_empty() {\n // Capacity and contents chosen so the last item must be assigned to.\n let mut vec1: BoundedVec<u32, 2> = BoundedVec::new();\n let vec2: BoundedVec<u32, 5> = BoundedVec::new();\n\n vec1.push(1);\n vec1.push(2);\n\n vec1.extend_from_bounded_vec(vec2);\n\n assert_eq(vec1.len(), 2);\n assert_eq(vec1.get(0), 1);\n assert_eq(vec1.get(1), 2);\n }\n\n #[test]\n fn extend_from_bounded_vec_zero_len() {\n let mut vec1: BoundedVec<u32, 0> = BoundedVec::new();\n let vec2: BoundedVec<u32, 0> = BoundedVec::new();\n\n vec1.extend_from_bounded_vec(vec2);\n\n assert_eq(vec1.len(), 0);\n }\n\n #[test]\n fn extend_from_bounded_vec_last_zeroed() {\n let mut vec1: BoundedVec<u32, 4> = BoundedVec::new();\n let mut vec2: BoundedVec<u32, 4> = BoundedVec::new();\n\n vec1.push(1);\n vec1.push(2);\n vec2.push(3);\n\n vec1.extend_from_bounded_vec(vec2);\n\n assert_eq(vec1.len(), 3);\n assert_eq(vec1.get_unchecked(3), 0);\n }\n\n #[test]\n fn extend_from_bounded_vec_empty_self() {\n // self.len == 0 with Len > MaxLen: the source is clamped to\n // MaxLen elements, filling the destination exactly to capacity.\n let mut vec1: BoundedVec<u32, 3> = BoundedVec::new();\n let vec2: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3]);\n\n vec1.extend_from_bounded_vec(vec2);\n\n assert_eq(vec1.len(), 3);\n assert_eq(vec1.get(0), 1);\n assert_eq(vec1.get(1), 2);\n assert_eq(vec1.get(2), 3);\n }\n\n #[test]\n #[test_unconstrained]\n fn extend_from_bounded_vec_preserves_tail_storage() {\n // The destination has meaningful (nonzero) storage past `len`.\n // Extending must leave that tail untouched, identically in the\n // constrained and unconstrained branches.\n let mut dst: BoundedVec<u32, 4> = BoundedVec::from_parts([10, 99, 123, 7], 1);\n let src: BoundedVec<u32, 4> = BoundedVec::from_parts([20, 0, 0, 0], 1);\n\n dst.extend_from_bounded_vec(src);\n\n assert_eq(dst.len(), 2);\n assert_eq(dst.storage(), [10, 20, 123, 7]);\n }\n\n #[test]\n fn extend_from_bounded_vec_equal_capacity() {\n // Len == MaxLen, fills to capacity.\n let mut vec1: BoundedVec<u32, 4> = BoundedVec::new();\n vec1.push(1);\n let vec2: BoundedVec<u32, 4> = BoundedVec::from_array([2, 3, 4]);\n\n vec1.extend_from_bounded_vec(vec2);\n\n assert_eq(vec1.len(), 4);\n assert_eq(vec1.get(0), 1);\n assert_eq(vec1.get(1), 2);\n assert_eq(vec1.get(2), 3);\n assert_eq(vec1.get(3), 4);\n }\n\n #[test(should_fail_with = \"extend_from_array out of bounds\")]\n fn extend_array_beyond_max_len() {\n let mut vec: BoundedVec<u32, 3> = BoundedVec::new();\n vec.push(1);\n vec.extend_from_array([2, 3, 4]); // should panic\n }\n\n #[test(should_fail_with = \"extend_from_vector out of bounds\")]\n fn extend_vector_beyond_max_len() {\n let mut vec: BoundedVec<u32, 3> = BoundedVec::new();\n vec.push(1);\n vec.extend_from_vector([2, 3, 4].as_vector()); // S]should panic\n }\n\n #[test(should_fail_with = \"extend_from_bounded_vec out of bounds\")]\n fn extend_bounded_vec_beyond_max_len() {\n let mut vec: BoundedVec<u32, 3> = BoundedVec::new();\n let other: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3, 4, 5]);\n vec.extend_from_bounded_vec(other); // should panic\n }\n\n #[test]\n fn extend_with_empty_collections() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n let original_len = vec.len();\n\n vec.extend_from_array([]);\n assert_eq(vec.len(), original_len);\n\n vec.extend_from_vector([].as_vector());\n assert_eq(vec.len(), original_len);\n\n let empty: BoundedVec<u32, 3> = BoundedVec::new();\n vec.extend_from_bounded_vec(empty);\n assert_eq(vec.len(), original_len);\n }\n }\n\n mod storage {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn storage_consistency() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n\n // test initial storage state\n assert_eq(vec.storage(), [0, 0, 0, 0, 0]);\n\n vec.push(1);\n vec.push(2);\n\n // test storage after modifications\n assert_eq(vec.storage(), [1, 2, 0, 0, 0]);\n\n // storage doesn't change length\n assert_eq(vec.len(), 2);\n assert_eq(vec.max_len(), 5);\n }\n\n #[test]\n fn storage_after_pop() {\n let mut vec: BoundedVec<u32, 3> = BoundedVec::from_array([1, 2, 3]);\n\n let _ = vec.pop();\n // after pop, the last element should be unmodified\n assert_eq(vec.storage(), [1, 2, 3]);\n assert_eq(vec.len(), 2);\n }\n\n #[test]\n fn vector_immutable() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([1, 2, 3]);\n let storage = vec.storage();\n\n assert_eq(storage, [1, 2, 3]);\n\n // Verify that the original vector is unchanged\n assert_eq(vec.len(), 3);\n assert_eq(vec.get(0), 1);\n assert_eq(vec.get(1), 2);\n assert_eq(vec.get(2), 3);\n }\n }\n}\n"
3690
3754
  },
3691
- "68": {
3755
+ "69": {
3692
3756
  "function_locations": [
3693
3757
  {
3694
3758
  "name": "PrivateContext::new",
@@ -3760,121 +3824,121 @@
3760
3824
  },
3761
3825
  {
3762
3826
  "name": "PrivateContext::set_as_fee_payer",
3763
- "start": 29204
3827
+ "start": 29840
3764
3828
  },
3765
3829
  {
3766
3830
  "name": "PrivateContext::in_revertible_phase",
3767
- "start": 29394
3831
+ "start": 30420
3768
3832
  },
3769
3833
  {
3770
3834
  "name": "PrivateContext::end_setup",
3771
- "start": 31706
3835
+ "start": 32732
3772
3836
  },
3773
3837
  {
3774
3838
  "name": "PrivateContext::set_expiration_timestamp",
3775
- "start": 34971
3839
+ "start": 35997
3776
3840
  },
3777
3841
  {
3778
3842
  "name": "PrivateContext::assert_note_exists",
3779
- "start": 36366
3843
+ "start": 37392
3780
3844
  },
3781
3845
  {
3782
3846
  "name": "PrivateContext::assert_nullifier_exists",
3783
- "start": 39002
3847
+ "start": 40028
3784
3848
  },
3785
3849
  {
3786
3850
  "name": "PrivateContext::request_nhk_app",
3787
- "start": 41099
3851
+ "start": 42125
3788
3852
  },
3789
3853
  {
3790
3854
  "name": "PrivateContext::request_ovsk_app",
3791
- "start": 42745
3855
+ "start": 43771
3792
3856
  },
3793
3857
  {
3794
3858
  "name": "PrivateContext::request_sk_app",
3795
- "start": 44466
3859
+ "start": 45492
3796
3860
  },
3797
3861
  {
3798
3862
  "name": "PrivateContext::message_portal",
3799
- "start": 47771
3863
+ "start": 48797
3800
3864
  },
3801
3865
  {
3802
3866
  "name": "PrivateContext::consume_l1_to_l2_message",
3803
- "start": 49653
3867
+ "start": 50744
3804
3868
  },
3805
3869
  {
3806
3870
  "name": "PrivateContext::emit_private_log_unsafe",
3807
- "start": 53772
3871
+ "start": 54863
3808
3872
  },
3809
3873
  {
3810
3874
  "name": "PrivateContext::emit_raw_note_log_unsafe",
3811
- "start": 55229
3875
+ "start": 56320
3812
3876
  },
3813
3877
  {
3814
3878
  "name": "PrivateContext::emit_contract_class_log",
3815
- "start": 55837
3879
+ "start": 56928
3816
3880
  },
3817
3881
  {
3818
3882
  "name": "PrivateContext::call_private_function",
3819
- "start": 60396
3883
+ "start": 61487
3820
3884
  },
3821
3885
  {
3822
3886
  "name": "PrivateContext::static_call_private_function",
3823
- "start": 61598
3887
+ "start": 62689
3824
3888
  },
3825
3889
  {
3826
3890
  "name": "PrivateContext::call_private_function_no_args",
3827
- "start": 62613
3891
+ "start": 63704
3828
3892
  },
3829
3893
  {
3830
3894
  "name": "PrivateContext::static_call_private_function_no_args",
3831
- "start": 63466
3895
+ "start": 64557
3832
3896
  },
3833
3897
  {
3834
3898
  "name": "PrivateContext::call_private_function_with_args_hash",
3835
- "start": 64444
3899
+ "start": 65535
3836
3900
  },
3837
3901
  {
3838
3902
  "name": "PrivateContext::call_public_function",
3839
- "start": 68343
3903
+ "start": 69466
3840
3904
  },
3841
3905
  {
3842
3906
  "name": "PrivateContext::static_call_public_function",
3843
- "start": 69610
3907
+ "start": 70733
3844
3908
  },
3845
3909
  {
3846
3910
  "name": "PrivateContext::call_public_function_no_args",
3847
- "start": 70629
3911
+ "start": 71752
3848
3912
  },
3849
3913
  {
3850
3914
  "name": "PrivateContext::static_call_public_function_no_args",
3851
- "start": 71528
3915
+ "start": 72651
3852
3916
  },
3853
3917
  {
3854
3918
  "name": "PrivateContext::call_public_function_with_calldata_hash",
3855
- "start": 72717
3919
+ "start": 73840
3856
3920
  },
3857
3921
  {
3858
3922
  "name": "PrivateContext::set_public_teardown_function",
3859
- "start": 75245
3923
+ "start": 76368
3860
3924
  },
3861
3925
  {
3862
3926
  "name": "PrivateContext::set_public_teardown_function_with_calldata_hash",
3863
- "start": 76516
3927
+ "start": 77639
3864
3928
  },
3865
3929
  {
3866
3930
  "name": "PrivateContext::next_counter",
3867
- "start": 81920
3931
+ "start": 83043
3868
3932
  },
3869
3933
  {
3870
3934
  "name": "<impl Empty for PrivateContext>::empty",
3871
- "start": 82089
3935
+ "start": 83212
3872
3936
  }
3873
3937
  ],
3874
3938
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/context/private_context.nr",
3875
- "source": "use crate::{\n context::{inputs::PrivateContextInputs, NoteExistenceRequest, NullifierExistenceRequest, ReturnsHash},\n hash::{hash_args, hash_calldata_array},\n keys::constants::{NULLIFIER_INDEX, NUM_KEY_TYPES, OUTGOING_INDEX, public_key_domain_separators},\n messaging::process_l1_to_l2_message,\n oracle::{\n block_header::get_block_header_at,\n call_private_function::call_private_function_internal,\n execution_cache,\n key_validation_request::get_key_validation_request,\n logs::notify_created_contract_class_log,\n notes::notify_nullified_note,\n nullifiers::notify_created_nullifier,\n public_call::assert_valid_public_call_data,\n tx_phase::{is_execution_in_revertible_phase, notify_revertible_phase_start},\n },\n};\nuse crate::logging::aztecnr_trace_log_format;\nuse crate::protocol::{\n abis::{\n block_header::BlockHeader,\n call_context::CallContext,\n function_selector::FunctionSelector,\n gas_settings::GasSettings,\n log_hash::LogHash,\n note_hash::NoteHash,\n nullifier::Nullifier,\n private_call_request::PrivateCallRequest,\n private_circuit_public_inputs::PrivateCircuitPublicInputs,\n private_log::{PrivateLog, PrivateLogData},\n public_call_request::PublicCallRequest,\n validation_requests::{KeyValidationRequest, KeyValidationRequestAndSeparator},\n },\n address::{AztecAddress, EthAddress},\n constants::{\n CONTRACT_CLASS_LOG_SIZE_IN_FIELDS, MAX_CONTRACT_CLASS_LOGS_PER_CALL, MAX_ENQUEUED_CALLS_PER_CALL,\n MAX_KEY_VALIDATION_REQUESTS_PER_CALL, MAX_L2_TO_L1_MSGS_PER_CALL, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL,\n MAX_NOTE_HASHES_PER_CALL, MAX_NULLIFIER_READ_REQUESTS_PER_CALL, MAX_NULLIFIERS_PER_CALL,\n MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, MAX_PRIVATE_LOGS_PER_CALL, MAX_TX_LIFETIME,\n NULL_MSG_SENDER_CONTRACT_ADDRESS, PRIVATE_LOG_CIPHERTEXT_LEN,\n },\n hash::compute_contract_class_log_hash,\n messaging::l2_to_l1_message::L2ToL1Message,\n side_effect::{Counted, scoped::Scoped},\n traits::{Empty, ToField},\n utils::arrays::{ClaimedLengthArray, trimmed_array_length_hint},\n};\n\n/// # PrivateContext\n///\n/// The **main interface** between an #[external(\"private\")] function and the Aztec blockchain.\n///\n/// An instance of the PrivateContext is initialized automatically at the outset of every private function, within the\n/// #[external(\"private\")] macro, so you'll never need to consciously instantiate this yourself.\n///\n/// The instance is always named `context`, and it is always be available within the body of every\n/// #[external(\"private\")] function in your smart contract.\n///\n/// > For those used to \"vanilla\" Noir, it might be jarring to have access to > `context` without seeing a declaration\n/// `let context = PrivateContext::new(...)` > within the body of your function. This is just a consequence of using >\n/// macros to tidy-up verbose boilerplate. You can use `nargo expand` to > expand all macros, if you dare.\n///\n/// Typical usage for a smart contract developer will be to call getter methods of the PrivateContext.\n///\n/// _Pushing_ data and requests to the context is mostly handled within aztec-nr's own functions, so typically a smart\n/// contract developer won't need to call any setter methods directly.\n///\n/// > Advanced users might occasionally wish to push data to the context > directly for lower-level control. If you\n/// find yourself doing this, please > open an issue on GitHub to describe your use case: it might be that > new\n/// functionality should be added to aztec-nr.\n///\n/// ## Responsibilities\n/// - Exposes contextual data to a private function:\n/// - Data relating to how this private function was called.\n/// - msg_sender\n/// - this_address - (the contract address of the private function being executed)\n/// - See `CallContext` for more data.\n/// - Data relating to the transaction in which this private function is being executed.\n/// - chain_id\n/// - version\n/// - gas_settings\n/// - Provides state access:\n/// - Access to the \"Anchor block\" header. Recall, a private function cannot read from the \"current\" block header, but\n/// must read from some historical block header, because as soon as private function execution begins (asynchronously,\n/// on a user's device), the public state of the chain (the \"current state\") will have progressed forward. We call this\n/// reference the \"Anchor block\". See `BlockHeader`.\n/// - Enables consumption of L1->L2 messages.\n/// - Enables calls to functions of other smart contracts:\n/// - Private function calls\n/// - Enqueueing of public function call requests (Since public functions are executed at a later time, by a block\n/// proposer, we say they are \"enqueued\").\n/// - Writes data to the blockchain:\n/// - New notes\n/// - New nullifiers\n/// - Private logs (for sending encrypted note contents or encrypted events)\n/// - New L2->L1 messages.\n/// - Provides args to the private function (handled by the #[external(\"private\")] macro).\n/// - Returns the return values of this private function (handled by the\n/// #[external(\"private\")] macro).\n/// - Makes Key Validation Requests.\n/// - Private functions are not allowed to see master secret keys, because we do not trust them. They are instead given\n/// \"app-siloed\" secret keys with a claim that they relate to a master public key. They can then request validation of\n/// this claim, by making a \"key validation request\" to the protocol's kernel circuits (which _are_ allowed to see\n/// certain master secret keys).\n///\n/// ## Advanced Responsibilities\n///\n/// - Ultimately, the PrivateContext is responsible for constructing the PrivateCircuitPublicInputs of the private\n/// function being executed. All private functions on Aztec must have public inputs which adhere to the rigid layout of\n/// the PrivateCircuitPublicInputs, in order to be compatible with the protocol's kernel circuits. A well-known\n/// misnomer:\n/// - \"public inputs\" contain both inputs and outputs of this function.\n/// - By \"outputs\" we mean a lot more side-effects than just the \"return values\" of the function.\n/// - Most of the so-called \"public inputs\" are kept _private_, and never leak to the outside world, because they are\n/// 'swallowed' by the protocol's kernel circuits before the tx is sent to the network. Only the following are exposed\n/// to the outside world:\n/// - New note_hashes\n/// - New nullifiers\n/// - New private logs\n/// - New L2->L1 messages\n/// - New enqueued public function call requests All the above-listed arrays of side-effects can be padded by the\n/// user's wallet (through instructions to the kernel circuits, via the PXE) to obscure their true lengths.\n///\n/// ## Syntax Justification\n///\n/// Both user-defined functions _and_ most functions in aztec-nr need access to the PrivateContext instance to\n/// read/write data. This is why you'll see the arguably-ugly pervasiveness of the \"context\" throughout your smart\n/// contract and the aztec-nr library. For example, `&mut context` is prevalent. In some languages, you can access and\n/// mutate a global variable (such as a PrivateContext instance) from a function without polluting the function's\n/// parameters. With Noir, a function must explicitly pass control of a mutable variable to another function, by\n/// reference. Since many functions in aztec-nr need to be able to push new data to the PrivateContext, they need to be\n/// handed a mutable reference _to_ the context as a parameter. For example, `Context` is prevalent as a generic\n/// parameter, to give better type safety at compile time. Many `aztec-nr` functions don't make sense if they're called\n/// in a particular runtime (private, public or utility), and so are intentionally only implemented over certain\n/// [Private|Public|Utility]Context structs. This gives smart contract developers a much faster feedback loop if\n/// they're making a mistake, as an error will be thrown by the LSP or when they compile their contract.\n///\n#[derive(Eq)]\npub struct PrivateContext {\n // docs:start:private-context\n inputs: PrivateContextInputs,\n side_effect_counter: u32,\n\n min_revertible_side_effect_counter: u32,\n is_fee_payer: bool,\n\n args_hash: Field,\n return_hash: Field,\n\n pub(crate) expiration_timestamp: u64,\n\n pub(crate) note_hash_read_requests: BoundedVec<Scoped<Counted<Field>>, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL>,\n pub(crate) nullifier_read_requests: BoundedVec<Scoped<Counted<Field>>, MAX_NULLIFIER_READ_REQUESTS_PER_CALL>,\n key_validation_requests_and_separators: BoundedVec<KeyValidationRequestAndSeparator, MAX_KEY_VALIDATION_REQUESTS_PER_CALL>,\n\n pub(crate) note_hashes: BoundedVec<Counted<NoteHash>, MAX_NOTE_HASHES_PER_CALL>,\n pub(crate) nullifiers: BoundedVec<Counted<Nullifier>, MAX_NULLIFIERS_PER_CALL>,\n\n pub(crate) private_call_requests: BoundedVec<PrivateCallRequest, MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL>,\n public_call_requests: BoundedVec<Counted<PublicCallRequest>, MAX_ENQUEUED_CALLS_PER_CALL>,\n public_teardown_call_request: PublicCallRequest,\n l2_to_l1_msgs: BoundedVec<Counted<L2ToL1Message>, MAX_L2_TO_L1_MSGS_PER_CALL>,\n // docs:end:private-context\n\n // Header of a block whose state is used during private execution (not the block the transaction is included in).\n pub(crate) anchor_block_header: BlockHeader,\n\n private_logs: BoundedVec<Counted<PrivateLogData>, MAX_PRIVATE_LOGS_PER_CALL>,\n contract_class_logs_hashes: BoundedVec<Counted<LogHash>, MAX_CONTRACT_CLASS_LOGS_PER_CALL>,\n\n // Contains the last key validation request for each key type. This is used to cache the last request and avoid\n // fetching the same request multiple times. The index of the array corresponds to the key type (0 nullifier, 1\n // incoming, 2 outgoing, 3 tagging).\n last_key_validation_requests: [Option<KeyValidationRequest>; NUM_KEY_TYPES],\n\n expected_non_revertible_side_effect_counter: u32,\n expected_revertible_side_effect_counter: u32,\n}\n\nimpl PrivateContext {\n pub fn new(inputs: PrivateContextInputs, args_hash: Field) -> PrivateContext {\n PrivateContext {\n inputs,\n side_effect_counter: inputs.start_side_effect_counter + 1,\n min_revertible_side_effect_counter: 0,\n is_fee_payer: false,\n args_hash,\n return_hash: 0,\n expiration_timestamp: inputs.anchor_block_header.timestamp() + MAX_TX_LIFETIME,\n note_hash_read_requests: BoundedVec::new(),\n nullifier_read_requests: BoundedVec::new(),\n key_validation_requests_and_separators: BoundedVec::new(),\n note_hashes: BoundedVec::new(),\n nullifiers: BoundedVec::new(),\n anchor_block_header: inputs.anchor_block_header,\n private_call_requests: BoundedVec::new(),\n public_call_requests: BoundedVec::new(),\n public_teardown_call_request: PublicCallRequest::empty(),\n l2_to_l1_msgs: BoundedVec::new(),\n private_logs: BoundedVec::new(),\n contract_class_logs_hashes: BoundedVec::new(),\n last_key_validation_requests: [Option::none(); NUM_KEY_TYPES],\n expected_non_revertible_side_effect_counter: 0,\n expected_revertible_side_effect_counter: 0,\n }\n }\n\n /// Returns the contract address that initiated this function call.\n ///\n /// This is similar to `msg.sender` in Solidity (hence the name).\n ///\n /// Important Note: Since Aztec doesn't have a concept of an EoA (Externally-owned Account), the msg_sender is\n /// \"none\" for the first function call of every transaction. The first function call of a tx is likely to be a call\n /// to the user's account contract, so this quirk will most often be handled by account contract developers.\n ///\n /// # Returns\n /// * `Option<AztecAddress>` - The address of the smart contract that called this function (be it an app contract\n /// or a user's account contract). Returns `Option<AztecAddress>::none` for the first function call of the tx. No\n /// other _private_ function calls in the tx will have a `none` msg_sender, but _public_ function calls might (see\n /// the PublicContext).\n pub fn maybe_msg_sender(self) -> Option<AztecAddress> {\n let maybe_msg_sender = self.inputs.call_context.msg_sender;\n if maybe_msg_sender == NULL_MSG_SENDER_CONTRACT_ADDRESS {\n Option::none()\n } else {\n Option::some(maybe_msg_sender)\n }\n }\n\n /// Returns the contract address of the current function being executed.\n ///\n /// This is equivalent to `address(this)` in Solidity (hence the name). Use this to identify the current contract's\n /// address, commonly needed for access control or when interacting with other contracts.\n ///\n /// # Returns\n /// * `AztecAddress` - The contract address of the current function being executed.\n ///\n pub fn this_address(self) -> AztecAddress {\n self.inputs.call_context.contract_address\n }\n\n /// Returns the chain ID of the current network.\n ///\n /// This is similar to `block.chainid` in Solidity. Returns the unique identifier for the blockchain network this\n /// transaction is executing on.\n ///\n /// Helps prevent cross-chain replay attacks. Useful if implementing multi-chain contract logic.\n ///\n /// # Returns\n /// * `Field` - The chain ID as a field element\n ///\n pub fn chain_id(self) -> Field {\n self.inputs.tx_context.chain_id\n }\n\n /// Returns the Aztec protocol version that this transaction is executing under. Different versions may have\n /// different rules, opcodes, or cryptographic primitives.\n ///\n /// This is similar to how Ethereum has different EVM versions.\n ///\n /// Useful for forward/backward compatibility checks\n ///\n /// Not to be confused with contract versions; this is the protocol version.\n ///\n /// # Returns\n /// * `Field` - The protocol version as a field element\n ///\n pub fn version(self) -> Field {\n self.inputs.tx_context.version\n }\n\n /// Returns the gas settings for the current transaction.\n ///\n /// This provides information about gas limits and pricing for the transaction, similar to `tx.gasprice` and gas\n /// limits in Ethereum. However, Aztec has a more sophisticated gas model with separate accounting for L2\n /// computation and data availability (DA) costs.\n ///\n /// # Returns\n /// * `GasSettings` - Struct containing gas limits and fee information\n ///\n pub fn gas_settings(self) -> GasSettings {\n self.inputs.tx_context.gas_settings\n }\n\n /// Returns the function selector of the currently executing function.\n ///\n /// Low-level function: Ordinarily, smart contract developers will not need to access this.\n ///\n /// This is similar to `msg.sig` in Solidity, which returns the first 4 bytes of the function signature. In Aztec,\n /// the selector uniquely identifies which function within the contract is being called.\n ///\n /// # Returns\n /// * `FunctionSelector` - The 4-byte function identifier\n ///\n /// # Advanced\n /// Only #[external(\"private\")] functions have a function selector as a protocol- enshrined concept. The function\n /// selectors of private functions are baked into the preimage of the contract address, and are used by the\n /// protocol's kernel circuits to identify each private function and ensure the correct one is being executed.\n ///\n /// Used internally for function dispatch and call verification.\n ///\n pub fn selector(self) -> FunctionSelector {\n self.inputs.call_context.function_selector\n }\n\n /// Returns whether this call is being executed as part of a static call.\n ///\n /// Similar to Solidity's `STATICCALL`, a static call is read-only: neither this function nor any of its nested\n /// calls may emit side-effects (new notes, nullifiers, logs, L2->L1 messages, etc.). A call is considered static\n /// if it was invoked as a static call or if any of its ancestor calls were.\n ///\n /// # Returns\n /// * `bool` - `true` if this call (or an ancestor call) is a static call.\n ///\n pub fn is_static_call(self) -> bool {\n self.inputs.call_context.is_static_call\n }\n\n /// Returns the hash of the arguments passed to the current function.\n ///\n /// Very low-level function: You shouldn't need to call this. The #[external(\"private\")] macro calls this, and it\n /// makes the arguments neatly available to the body of your private function.\n ///\n /// # Returns\n /// * `Field` - Hash of the function arguments\n ///\n /// # Advanced\n /// * Arguments are hashed to reduce proof size and verification time\n /// * Enables efficient argument passing in recursive function calls\n /// * The hash can be used to retrieve the original arguments from the PXE.\n ///\n pub fn get_args_hash(self) -> Field {\n self.args_hash\n }\n\n /// Returns the current value of the side-effect counter, i.e. the counter that will be assigned to the next\n /// side-effect emitted by this function.\n ///\n /// Low-level function: Ordinarily, smart contract developers will not need to access this. See `next_counter` for\n /// details on how side-effect counters are assigned and why they exist.\n ///\n /// # Returns\n /// * `u32` - The current side-effect counter.\n ///\n pub fn get_side_effect_counter(self) -> u32 {\n self.side_effect_counter\n }\n\n /// Pushes a new note_hash to the Aztec blockchain's global Note Hash Tree (a state tree).\n ///\n /// A note_hash is a commitment to a piece of private state.\n ///\n /// Low-level function: Ordinarily, smart contract developers will not need to manually call this. Aztec-nr's state\n /// variables (see `../state_vars/`) are designed to understand when to create and push new note hashes.\n ///\n /// # Arguments\n /// * `note_hash` - The new note_hash.\n ///\n /// # Advanced\n /// From here, the protocol's kernel circuits will take over and insert the note_hash into the protocol's \"note\n /// hash tree\" (in the Base Rollup circuit). Before insertion, the protocol will:\n /// - \"Silo\" the `note_hash` with the contract address of this function, to yield a `siloed_note_hash`. This\n /// prevents state collisions between different smart contracts.\n /// - Ensure uniqueness of the `siloed_note_hash`, to prevent Faerie-Gold attacks, by hashing the\n /// `siloed_note_hash` with a unique value, to yield a `unique_siloed_note_hash` (see the protocol spec for more).\n ///\n /// In addition to calling this function, aztec-nr provides the contents of the newly-created note to the PXE, via\n /// the `notify_created_note` oracle.\n ///\n /// > Advanced users might occasionally wish to push data to the context > directly for lower-level control. If you\n /// find yourself doing this, > please open an issue on GitHub to describe your use case: it might be > that new\n /// functionality should be added to aztec-nr.\n ///\n pub fn push_note_hash(&mut self, note_hash: Field) {\n self.note_hashes.push(Counted::new(note_hash, self.next_counter()));\n }\n\n /// Creates a new [nullifier](crate::nullifier).\n ///\n /// ## Safety\n ///\n /// This is a low-level function that must be used with great care to avoid subtle corruption of contract state.\n /// Instead of calling this function, consider using the higher-level [`crate::state_vars::SingleUseClaim`].\n ///\n /// In particular, callers must ensure all nullifiers created by a contract are properly domain-separated, so that\n /// unrelated components don't interfere with one another (e.g. a transaction nullifier accidentally marking a\n /// variable as initialized). Only [`PrivateContext::push_nullifier_for_note_hash`] should be used for note\n /// nullifiers, never this one.\n ///\n /// ## Advanced\n ///\n /// The raw `nullifier` is not what is inserted into the Aztec state tree: it will be first siloed by contract\n /// address via [`crate::protocol::hash::compute_siloed_nullifier`] in order to prevent accidental or malicious\n /// interference of nullifiers from different contracts.\n pub fn push_nullifier_unsafe(&mut self, nullifier: Field) {\n notify_created_nullifier(nullifier);\n self.nullifiers.push(Nullifier { value: nullifier, note_hash: 0 }.count(self.next_counter()));\n }\n\n /// Creates a new [nullifier](crate::nullifier) associated with a note.\n ///\n /// This is a variant of [`PrivateContext::push_nullifier_unsafe`] that is used for note nullifiers, i.e.\n /// nullifiers that correspond to a note. If a note and its nullifier are created in the same transaction, then\n /// the private kernels will 'squash' these values, deleting them both as if they never existed and reducing\n /// transaction fees.\n ///\n /// The `nullification_note_hash` must be the result of calling\n /// [`crate::note::utils::compute_confirmed_note_hash_for_nullification`] for pending notes, and `0` for settled\n /// notes (which cannot be squashed).\n ///\n /// ## Safety\n ///\n /// This is a low-level function that must be used with great care to avoid subtle corruption of contract state.\n /// Instead of calling this function, consider using the higher-level [`crate::note::lifecycle::destroy_note`].\n ///\n /// The precautions listed for [`PrivateContext::push_nullifier_unsafe`] apply here as well, and callers should\n /// additionally ensure `nullification_note_hash` corresponds to a note emitted by this contract, with its hash\n /// computed in the same transaction execution phase as the call to this function. Finally, only this function\n /// should be used for note nullifiers, never [`PrivateContext::push_nullifier_unsafe`].\n ///\n /// Failure to do these things can result in unprovable contexts, accidental deletion of notes, or double-spend\n /// attacks.\n pub fn push_nullifier_for_note_hash(&mut self, nullifier: Field, nullification_note_hash: Field) {\n let nullifier_counter = self.next_counter();\n notify_nullified_note(nullifier, nullification_note_hash, nullifier_counter);\n self.nullifiers.push(Nullifier { value: nullifier, note_hash: nullification_note_hash }.count(\n nullifier_counter,\n ));\n }\n\n /// Returns the anchor block header - the historical block header that this private function is reading from.\n ///\n /// A private function CANNOT read from the \"current\" block header, but must read from some older block header,\n /// because as soon as private function execution begins (asynchronously, on a user's device), the public state of\n /// the chain (the \"current state\") will have progressed forward.\n ///\n /// # Returns\n /// * `BlockHeader` - The anchor block header.\n ///\n /// # Advanced\n /// * All private functions of a tx read from the same anchor block header.\n /// * The protocol asserts that the `expiration_timestamp` of every tx is at most 24 hours beyond the timestamp of\n /// the tx's chosen anchor block header. This enables the network's nodes to safely prune old txs from the mempool.\n /// Therefore, the chosen block header _must_ be one from within the last 24 hours.\n ///\n pub fn get_anchor_block_header(self) -> BlockHeader {\n self.anchor_block_header\n }\n\n /// Returns the header of any historical block at or before the anchor block.\n ///\n /// This enables private contracts to access information from even older blocks than the anchor block header.\n ///\n /// Useful for time-based contract logic that needs to compare against multiple historical points.\n ///\n /// # Arguments\n /// * `block_number` - The block number to retrieve (must be <= anchor block number)\n ///\n /// # Returns\n /// * `BlockHeader` - The header of the requested historical block\n ///\n /// # Advanced\n /// This function uses an oracle to fetch block header data from the user's PXE. Depending on how much blockchain\n /// data the user's PXE has been set up to store, this might require a query from the PXE to another Aztec node to\n /// get the data. > This is generally true of all oracle getters (see `../oracle`).\n ///\n /// Each block header gets hashed and stored as a leaf in the protocol's Archive Tree. In fact, the i-th block\n /// header gets stored at the i-th leaf index of the Archive Tree. Behind the scenes, this `get_block_header_at`\n /// function will add Archive Tree merkle-membership constraints (~3k) to your smart contract function's circuit,\n /// to prove existence of the block header in the Archive Tree.\n ///\n /// Note: we don't do any caching, so avoid making duplicate calls for the same block header, because each call\n /// will add duplicate constraints.\n ///\n /// Calling this function is more expensive (constraint-wise) than getting the anchor block header (via\n /// `get_block_header`). This is because the anchor block's merkle membership proof is handled by Aztec's protocol\n /// circuits, and is only performed once for the entire tx because all private functions of a tx share a common\n /// anchor block header. Therefore, the cost (constraint-wise) of calling `get_block_header` is effectively free.\n ///\n pub fn get_block_header_at(self, block_number: u32) -> BlockHeader {\n get_block_header_at(block_number, self)\n }\n\n /// Sets the hash of the return values for this private function.\n ///\n /// Very low-level function: this is called by the #[external(\"private\")] macro.\n ///\n /// # Arguments\n /// * `serialized_return_values` - The serialized return values as a field array\n ///\n pub fn set_return_hash<let N: u32>(&mut self, serialized_return_values: [Field; N]) {\n let return_hash = hash_args(serialized_return_values);\n self.return_hash = return_hash;\n execution_cache::store(serialized_return_values, return_hash);\n }\n\n /// Builds the PrivateCircuitPublicInputs for this private function, to ensure compatibility with the protocol's\n /// kernel circuits.\n ///\n /// Very low-level function: This function is automatically called by the #[external(\"private\")] macro.\n pub fn finish(self) -> PrivateCircuitPublicInputs {\n PrivateCircuitPublicInputs {\n call_context: self.inputs.call_context,\n args_hash: self.args_hash,\n returns_hash: self.return_hash,\n min_revertible_side_effect_counter: self.min_revertible_side_effect_counter,\n is_fee_payer: self.is_fee_payer,\n expiration_timestamp: self.expiration_timestamp,\n note_hash_read_requests: ClaimedLengthArray::from_bounded_vec(self.note_hash_read_requests),\n nullifier_read_requests: ClaimedLengthArray::from_bounded_vec(self.nullifier_read_requests),\n key_validation_requests_and_separators: ClaimedLengthArray::from_bounded_vec(\n self.key_validation_requests_and_separators,\n ),\n note_hashes: ClaimedLengthArray::from_bounded_vec(self.note_hashes),\n nullifiers: ClaimedLengthArray::from_bounded_vec(self.nullifiers),\n private_call_requests: ClaimedLengthArray::from_bounded_vec(self.private_call_requests),\n public_call_requests: ClaimedLengthArray::from_bounded_vec(self.public_call_requests),\n public_teardown_call_request: self.public_teardown_call_request,\n l2_to_l1_msgs: ClaimedLengthArray::from_bounded_vec(self.l2_to_l1_msgs),\n start_side_effect_counter: self.inputs.start_side_effect_counter,\n end_side_effect_counter: self.side_effect_counter,\n private_logs: ClaimedLengthArray::from_bounded_vec(self.private_logs),\n contract_class_logs_hashes: ClaimedLengthArray::from_bounded_vec(self.contract_class_logs_hashes),\n anchor_block_header: self.anchor_block_header,\n tx_context: self.inputs.tx_context,\n expected_non_revertible_side_effect_counter: self.expected_non_revertible_side_effect_counter,\n expected_revertible_side_effect_counter: self.expected_revertible_side_effect_counter,\n tx_request_salt: self.inputs.tx_request_salt,\n }\n }\n\n /// Designates this contract as the fee payer for the transaction.\n ///\n /// Unlike Ethereum, where the transaction sender always pays fees, Aztec allows any contract to voluntarily pay\n /// transaction fees. This enables patterns like sponsored transactions or fee abstraction where users don't need\n /// to hold fee-juice themselves. (Fee juice is a fee-paying asset for Aztec).\n ///\n /// Only one contract per transaction can declare itself as the fee payer, and it must have sufficient fee-juice\n /// balance (>= the gas limits specified in the TxContext) by the time we reach the public setup phase of the tx.\n ///\n pub fn set_as_fee_payer(&mut self) {\n aztecnr_trace_log_format!(\"Setting {0} as fee payer\")([self.this_address().to_field()]);\n self.is_fee_payer = true;\n }\n\n pub fn in_revertible_phase(&mut self) -> bool {\n let current_counter = self.side_effect_counter;\n\n // Safety: Kernel will validate that the claim is correct by validating the expected counters.\n let is_revertible = unsafe { is_execution_in_revertible_phase(current_counter) };\n\n if is_revertible {\n if (self.expected_revertible_side_effect_counter == 0)\n | (current_counter < self.expected_revertible_side_effect_counter) {\n self.expected_revertible_side_effect_counter = current_counter;\n }\n } else if current_counter > self.expected_non_revertible_side_effect_counter {\n self.expected_non_revertible_side_effect_counter = current_counter;\n }\n\n is_revertible\n }\n\n /// Declares the end of the \"setup phase\" of this tx.\n ///\n /// Only one function per tx can declare the end of the setup phase.\n ///\n /// Niche function: Only wallet developers and paymaster contract developers (aka Fee-payment contracts) will need\n /// to make use of this function.\n ///\n /// Aztec supports a three-phase execution model: setup, app logic, teardown. The phases exist to enable a fee\n /// payer to take on the risk of paying a transaction fee, safe in the knowledge that their payment (in whatever\n /// token or method the user chooses) will succeed, regardless of whether the app logic will succeed. The \"setup\"\n /// phase enables such a payment to be made, because the setup phase _cannot revert_: a reverting function within\n /// the setup phase would result in an invalid block which cannot be proven. Any side-effects generated during that\n /// phase are guaranteed to be inserted into Aztec's state trees (except for squashed notes & nullifiers, of\n /// course).\n ///\n /// Even though the end of the setup phase is declared within a private function, you might have noticed that\n /// _public_ functions can also execute within the setup phase. This is because any public function calls which\n /// were enqueued _within the setup phase_ by a private function are considered part of the setup phase.\n ///\n /// # Advanced\n /// * Sets the minimum revertible side effect counter of this tx to be the PrivateContext's _current_ side effect\n /// counter.\n ///\n pub fn end_setup(&mut self) {\n // We bump the counter twice: once so that `min_revertible_side_effect_counter` sits strictly above any\n // non-revertible side effect counter (including queries made via `in_revertible_phase` before this call), and\n // once more so that the next revertible side effect counter is strictly greater than\n // `min_revertible_side_effect_counter`. This ensures `min_revertible_side_effect_counter` occupies a gap that\n // no side effect takes, which the kernel relies on when validating the phase split.\n self.side_effect_counter += 1;\n self.min_revertible_side_effect_counter = self.side_effect_counter;\n self.side_effect_counter += 1;\n\n aztecnr_trace_log_format!(\n \"Ending setup, minimum revertible side effect counter is {0}\",\n )(\n [self.min_revertible_side_effect_counter as Field],\n );\n notify_revertible_phase_start(self.min_revertible_side_effect_counter);\n }\n\n /// Sets a deadline (an \"include-by timestamp\") for when this transaction must be included in a block.\n ///\n /// Other functions in this tx might call this setter with differing values for the include-by timestamp. To ensure\n /// that all functions' deadlines are met, the _minimum_ of all these include-by timestamps will be exposed when\n /// this tx is submitted to the network.\n ///\n /// If the transaction is not included in a block by its include-by timestamp, it becomes invalid and it will never\n /// be included.\n ///\n /// This expiry timestamp is publicly visible. See the \"Advanced\" section for privacy concerns.\n ///\n /// # Arguments\n /// * `expiration_timestamp` - Unix timestamp (seconds) deadline for inclusion. The include-by timestamp of this tx\n /// will be _at most_ the timestamp specified.\n ///\n /// # Advanced\n /// * If multiple functions set differing `expiration_timestamp`s, the kernel circuits will set it to be the\n /// _minimum_ of the two. This ensures the tx expiry requirements of all functions in the tx are met.\n /// * Rollup circuits will reject expired txs.\n /// * The protocol enforces that all transactions must be included within 24 hours of their chosen anchor block's\n /// timestamp, to enable safe mempool pruning.\n /// * The DelayedPublicMutable design makes heavy use of this functionality, to enable private functions to read\n /// public state.\n /// * A sophisticated Wallet should cleverly set an include-by timestamp to improve the privacy of the user and the\n /// network as a whole. For example, if a contract interaction sets include-by to some publicly-known value (e.g.\n /// the time when a contract upgrades), then the wallet might wish to set an even lower one to avoid revealing that\n /// this tx is interacting with said contract. Ideally, all wallets should standardize on an approach in order to\n /// provide users with a large privacy set -- although the exact approach\n /// will need to be discussed. Wallets that deviate from a standard might accidentally reveal which wallet each\n /// transaction originates from.\n ///\n // docs:start:expiration-timestamp\n pub fn set_expiration_timestamp(&mut self, expiration_timestamp: u64) {\n // docs:end:expiration-timestamp\n self.expiration_timestamp = std::cmp::min(self.expiration_timestamp, expiration_timestamp);\n }\n\n /// Asserts that a note has been created.\n ///\n /// This function will cause the transaction to fail unless the requested note exists. This is the preferred\n /// mechanism for performing this check, and the only one that works for pending notes.\n ///\n /// ## Pending Notes\n ///\n /// Both settled notes (created in prior transactions) and pending notes (created in the current transaction) will\n /// be considered by this function. Pending notes must have been created **before** this call is made for the check\n /// to pass.\n ///\n /// ## Historical Notes\n ///\n /// If you need to assert that a note existed _by some specific block in the past_, instead of simply proving that\n /// it exists by the current anchor block, use [`crate::history::note::assert_note_existed_by`] instead.\n ///\n /// ## Cost\n ///\n /// This uses up one of the call's kernel note hash read requests, which are limited. Like all kernel requests,\n /// proving time costs are only incurred when the total number of requests exceeds the kernel's capacity, requiring\n /// an additional invocation of the kernel reset circuit.\n pub fn assert_note_exists(&mut self, note_existence_request: NoteExistenceRequest) {\n // Note that the `note_hash_read_requests` array does not hold `NoteExistenceRequest` objects, but rather a\n // custom kernel type. We convert from the aztec-nr type into it.\n\n let note_hash = note_existence_request.note_hash();\n let contract_address = note_existence_request.maybe_contract_address().unwrap_or(AztecAddress::zero());\n\n let side_effect = Scoped::new(\n Counted::new(note_hash, self.next_counter()),\n contract_address,\n );\n\n self.note_hash_read_requests.push(side_effect);\n }\n\n /// Asserts that a nullifier has been emitted.\n ///\n /// This function will cause the transaction to fail unless the requested nullifier exists. This is the preferred\n /// mechanism for performing this check, and the only one that works for pending nullifiers.\n ///\n /// ## Pending Nullifiers\n ///\n /// Both settled nullifiers (emitted in prior transactions) and pending nullifiers (emitted in the current\n /// transaction) will be considered by this function. Pending nullifiers must have been emitted **before** this\n /// call is made for the check to pass.\n ///\n /// ## Historical Nullifiers\n ///\n /// If you need to assert that a nullifier existed _by some specific block in the past_, instead of simply proving\n /// that it exists by the current anchor block, use [`crate::history::nullifier::assert_nullifier_existed_by`]\n /// instead.\n ///\n /// ## Public vs Private\n ///\n /// In general, it is unsafe to check for nullifier non-existence in private, as that will not consider the\n /// possibility of the nullifier having been emitted in any transaction between the anchor block and the inclusion\n /// block. Private functions instead prove existence via this function and 'prove' non-existence by _emitting_ the\n /// nullifer, which would cause the transaction to fail if the nullifier existed.\n ///\n /// This is not the case in public functions, which do have access to the tip of the blockchain and so can reliably\n /// prove whether a nullifier exists or not via\n /// [`crate::context::public_context::PublicContext::nullifier_exists_unsafe`].\n ///\n /// ## Cost\n ///\n /// This uses up one of the call's kernel nullifier read requests, which are limited. Like all kernel requests,\n /// proving time costs are only incurred when the total number of requests exceeds the kernel's capacity, requiring\n /// an additional invocation of the kernel reset circuit.\n pub fn assert_nullifier_exists(&mut self, nullifier_existence_request: NullifierExistenceRequest) {\n let nullifier = nullifier_existence_request.nullifier();\n let contract_address = nullifier_existence_request.maybe_contract_address().unwrap_or(AztecAddress::zero());\n\n let request = Scoped::new(\n Counted::new(nullifier, self.next_counter()),\n contract_address,\n );\n\n self.nullifier_read_requests.push(request);\n }\n\n /// Requests the app-siloed nullifier hiding key (nhk_app) for the given (hashed) master nullifier public key\n /// (npk_m), from the user's PXE.\n ///\n /// Advanced function: Only needed if you're designing your own notes and/or nullifiers.\n ///\n /// Contracts are not allowed to compute nullifiers for other contracts, as that would let them read parts of their\n /// private state. Because of this, a contract is only given an \"app-siloed key\", which is constructed by\n /// hashing the user's master nullifier hiding key with the contract's address. However, because contracts cannot\n /// be trusted with a user's master nullifier hiding key (because we don't know which contracts are honest or\n /// malicious), the PXE refuses to provide any master secret keys to any app smart contract function. This means\n /// app functions are unable to prove that the derivation of an app-siloed nullifier hiding key has been computed\n /// correctly. Instead, an app function can request to the kernel (via `request_nhk_app`) that it validates the\n /// siloed derivation, since the kernel has been vetted to not leak any master secret keys.\n ///\n /// A common nullification scheme is to inject a nullifier hiding key into the preimage of a nullifier, to make the\n /// nullifier deterministic but random-looking. This function enables that flow.\n ///\n /// # Arguments\n /// * `npk_m_hash` - A hash of the master nullifier public key of the user whose PXE is executing this function.\n ///\n /// # Returns\n /// * The app-siloed nullifier hiding key that corresponds to the given `npk_m_hash`.\n ///\n pub fn request_nhk_app(&mut self, npk_m_hash: Field) -> Field {\n self.request_sk_app(npk_m_hash, NULLIFIER_INDEX)\n }\n\n /// Requests the app-siloed outgoing viewing secret key (ovsk_app) for the given (hashed) master outgoing\n /// viewing public key (ovpk_m), from the user's PXE.\n ///\n /// See `request_nhk_app` and `request_sk_app` for more info.\n ///\n /// The intention of the \"outgoing\" keypair is to provide a second secret key for all of a user's outgoing activity\n /// (i.e. for notes that a user creates, as opposed to notes that a user receives from others). The separation of\n /// incoming and outgoing data was a distinction made by zcash, with the intention of enabling a user to optionally\n /// share with a 3rd party a controlled view of only incoming or outgoing notes. Similar functionality of sharing\n /// select data can be achieved with offchain zero-knowledge proofs. It is up to an app developer whether they\n /// choose to make use of a user's outgoing keypair within their application logic, or instead simply use the same\n /// keypair (the address keypair (which is effectively the same as the \"incoming\" keypair)) for all incoming &\n /// outgoing messages to a user.\n ///\n /// Currently, all of the exposed encryption functions in aztec-nr ignore the outgoing viewing keys, and instead\n /// encrypt all note logs and event logs to a user's address public key.\n ///\n /// # Arguments\n /// * `ovpk_m_hash` - Hash of the outgoing viewing public key master\n ///\n /// # Returns\n /// * The application-specific outgoing viewing secret key\n ///\n pub fn request_ovsk_app(&mut self, ovpk_m_hash: Field) -> Field {\n self.request_sk_app(ovpk_m_hash, OUTGOING_INDEX)\n }\n\n /// Pushes a Key Validation Request to the kernel.\n ///\n /// Private functions are not allowed to see a user's master secret keys, because we do not trust them. They are\n /// instead given \"app-siloed\" secret keys with a claim that they relate to a master public key. They can then\n /// request validation of this claim, by making a \"key validation request\" to the protocol's kernel circuits (which\n /// _are_ allowed to see certain master secret keys).\n ///\n /// The app circuit only sees `pk_m_hash` (not the raw point). The kernel derives the\n /// point from `sk_m`, hashes it, and asserts equality. When a Key Validation Request tuple of\n /// (sk_app, pk_m_hash, app_address) is submitted to the kernel, it performs the following\n /// derivations to validate the relationship between the claimed sk_app and the user's pk_m_hash:\n ///\n /// (sk_m) ----> * G ----> pk_m ----> hash_public_key(pk_m)\n /// | |\n /// v | We use the kernel to prove this\n /// h(sk_m, app_address) | sk_app-pk_m_hash relationship, because app\n /// | | circuits must not be trusted to see sk_m.\n /// v |\n /// sk_app - - - - - - - - - - - - - - - - - -\n ///\n /// The function is named \"request_\" instead of \"get_\" to remind the user that a Key Validation Request will be\n /// emitted to the kernel.\n ///\n fn request_sk_app(&mut self, pk_m_hash: Field, key_index: Field) -> Field {\n // Match against the cache only when a request is actually present in the slot.\n let cached_slot = self.last_key_validation_requests[key_index as u32];\n let cache_hit = cached_slot.is_some() & (cached_slot.unwrap_unchecked().pk_m_hash == pk_m_hash);\n\n if cache_hit {\n // We get a match so the cached request is the latest one\n cached_slot.unwrap_unchecked().sk_app\n } else {\n // We didn't get a match meaning the cached result is stale. Typically we'd validate keys by showing that\n // the master secret key derives to a public key matching `pk_m_hash`, but that'd require the oracle\n // returning the master secret keys, which could cause malicious contracts to leak it or learn about\n // secrets from other contracts. We therefore silo secret keys, and rely on the private kernel to validate\n // that the siloed secret key corresponds to correct siloing of the master secret key that hashes to\n // `pk_m_hash`.\n\n // Safety: Kernels verify that the key validation request is valid and below we verify that a request for\n // the correct public key has been received.\n let request = unsafe { get_key_validation_request(pk_m_hash, key_index) };\n assert_eq(request.pk_m_hash, pk_m_hash, \"Obtained key validation request for wrong pk_m_hash\");\n\n self.key_validation_requests_and_separators.push(\n KeyValidationRequestAndSeparator {\n request,\n key_type_domain_separator: public_key_domain_separators[key_index as u32],\n },\n );\n self.last_key_validation_requests[key_index as u32] = Option::some(request);\n request.sk_app\n }\n }\n\n /// Sends an \"L2 -> L1 message\" from this function (Aztec, L2) to a smart contract on Ethereum (L1). L1 contracts\n /// which are designed to send/receive messages to/from Aztec are called \"Portal Contracts\".\n ///\n /// Common use cases include withdrawals, cross-chain asset transfers, and triggering L1 actions based on L2 state\n /// changes.\n ///\n /// The message will be inserted into an Aztec \"Outbox\" contract on L1, when this transaction's block is proposed\n /// to L1. Sending the message will not result in any immediate state changes in the target portal contract. The\n /// message will need to be manually consumed from the Outbox through a separate Ethereum transaction: a user will\n /// need to call a function of the portal contract -- a function specifically designed to make a call to the Outbox\n /// to consume the message. The message will only be available for consumption once the _epoch_ proof has been\n /// submitted. Given that there are multiple Aztec blocks within an epoch, it might take some time for this epoch\n /// proof to be submitted -- especially if the block was near the start of an epoch.\n ///\n /// # Arguments\n /// * `recipient` - Ethereum address that will receive the message\n /// * `content` - Message content (32 bytes as a Field element). This content has a very\n /// specific layout. docs:start:context_message_portal\n pub fn message_portal(&mut self, recipient: EthAddress, content: Field) {\n let message = L2ToL1Message { recipient, content };\n self.l2_to_l1_msgs.push(message.count(self.next_counter()));\n }\n\n /// Consumes a message sent from Ethereum (L1) to Aztec (L2).\n ///\n /// Common use cases include token bridging, cross-chain governance, and triggering L2 actions based on L1 events.\n ///\n /// Use this function if you only want the message to ever be \"referred to\" once. Once consumed using this method,\n /// the message cannot be consumed again, because a nullifier is emitted. If your use case wants for the message to\n /// be read unlimited times, then you can always read any historic message from the L1-to-L2 messages tree;\n /// messages never technically get deleted from that tree.\n ///\n /// The message will first be inserted into an Aztec \"Inbox\" smart contract on L1. Sending the message will not\n /// result in any immediate state changes in the target L2 contract. The message will need to be manually consumed\n /// by the target contract through a separate Aztec transaction. The message will not be available for consumption\n /// immediately. Messages get copied over from the L1 Inbox to L2 by the next Proposer in batches. So you will need\n /// to wait until the messages are copied before you can consume them.\n ///\n /// # Arguments\n /// * `content` - The message content that was sent from L1\n /// * `secret` - Secret value used for message privacy (if needed)\n /// * `sender` - Ethereum address that sent the message\n /// * `leaf_index` - Index of the message in the L1-to-L2 message tree\n ///\n /// # Advanced\n /// Validates message existence in the L1-to-L2 message tree and nullifies the message to prevent\n /// double-consumption.\n pub fn consume_l1_to_l2_message(&mut self, content: Field, secret: Field, sender: EthAddress, leaf_index: Field) {\n let nullifier = process_l1_to_l2_message(\n self.anchor_block_header.state.l1_to_l2_message_tree.root,\n self.this_address(),\n sender,\n self.chain_id(),\n self.version(),\n content,\n secret,\n leaf_index,\n );\n\n // Push nullifier (and the \"commitment\" corresponding to this can be \"empty\")\n self.push_nullifier_unsafe(nullifier)\n }\n\n /// Emits a private log (an array of Fields) that will be published to an Ethereum blob.\n ///\n /// Private logs are intended for the broadcasting of ciphertexts: that is, encrypted events or encrypted note\n /// contents. Since the data in the logs is meant to be _encrypted_, private_logs are broadcast to publicly-visible\n /// Ethereum blobs. The intended recipients of such encrypted messages can then discover and decrypt these\n /// encrypted logs using their viewing secret key. (See `../messages/discovery` for more details).\n ///\n /// Important note: This function DOES NOT _do_ any encryption of the input `log` fields. This function blindly\n /// publishes whatever input `log` data is fed into it, so the caller of this function should have already\n /// performed the encryption, and the `log` should be the result of that encryption.\n ///\n /// The protocol does not dictate what encryption scheme should be used: a smart contract developer can choose\n /// whatever encryption scheme they like. Aztec-nr includes some off-the-shelf encryption libraries that developers\n /// might wish to use, for convenience. These libraries not only encrypt a plaintext (to produce a ciphertext);\n /// they also prepend the ciphertext with a `tag` and `ephemeral public key` for easier message discovery. This is\n /// a very dense topic, and we will be writing more libraries and docs soon.\n ///\n /// > Currently, AES128 CBC encryption is the main scheme included in > aztec.nr. > We are currently making\n /// significant changes to the interfaces of the > encryption library.\n ///\n /// In some niche use cases, an app might be tempted to publish _un-encrypted_ data via a private log, because\n /// _public logs_ are not available to private functions. Be warned that emitting public data via private logs is\n /// strongly discouraged, and is considered a \"privacy anti-pattern\", because it reveals identifiable information\n /// about _which_ function has been executed. A tx which leaks such information does not contribute to the privacy\n /// set of the network.\n ///\n /// * Unlike `emit_raw_note_log_unsafe`, this log is not tied to any specific note\n ///\n /// # Arguments\n /// * `tag` - A tag placed at `fields[0]` of the emitted log. Used by recipients and nodes to identify and\n /// filter for relevant logs without scanning all of them.\n /// * `log` - The log data that will be publicly broadcast (so make sure it's already been encrypted before you\n /// call this function). Private logs are bounded in size (`PRIVATE_LOG_CIPHERTEXT_LEN`), to encourage all logs\n /// from all smart contracts look identical. The protocol's kernel circuits can then append random fields as\n /// \"padding\" after the log's length, so that the logs of this smart contract look indistinguishable from (the\n /// same length as) the logs of all other applications. It's up to wallets how much padding to apply, so\n /// ideally all wallets should agree on standards for this.\n ///\n /// ## Safety\n ///\n /// The `tag` should be domain-separated (e.g. via [`crate::protocol::hash::compute_log_tag`]) to prevent\n /// collisions between logs from different sources. Without domain separation, two unrelated log types that\n /// happen to share a raw tag value become indistinguishable. Prefer the higher-level APIs\n /// ([`crate::messages::delivery::MessageDelivery`] for messages, `self.emit(event)` for events) which\n /// handle tagging automatically.\n pub fn emit_private_log_unsafe(&mut self, tag: Field, log: BoundedVec<Field, PRIVATE_LOG_CIPHERTEXT_LEN>) {\n self.emit_raw_note_log_unsafe(tag, log, 0);\n }\n\n /// Emits a private log that is explicitly tied to a newly-emitted note_hash, to convey to the kernel: \"this log\n /// relates to this note\".\n ///\n /// This linkage is important in case the note gets squashed (due to being read later in this same tx), since we\n /// can then squash the log as well.\n ///\n /// See [`emit_private_log_unsafe`](PrivateContext::emit_private_log_unsafe) for more info about private log\n /// emission.\n ///\n /// # Arguments\n /// * `tag` - A tag placed at `fields[0]`. See\n /// [`emit_private_log_unsafe`](PrivateContext::emit_private_log_unsafe).\n /// * `log` - The log data as a `BoundedVec` of Field elements.\n /// * `note_hash_counter` - The side-effect counter that was assigned to the new note_hash when it was pushed to\n /// this `PrivateContext`.\n ///\n /// Important: If your application logic requires the log to always be emitted regardless of note squashing,\n /// consider using [`emit_private_log_unsafe`](PrivateContext::emit_private_log_unsafe) instead, or emitting\n /// additional events.\n ///\n /// ## Safety\n ///\n /// Same as [`PrivateContext::emit_private_log_unsafe`]: the `tag` should be domain-separated.\n pub fn emit_raw_note_log_unsafe(\n &mut self,\n tag: Field,\n log: BoundedVec<Field, PRIVATE_LOG_CIPHERTEXT_LEN>,\n note_hash_counter: u32,\n ) {\n let counter = self.next_counter();\n let full_log = [tag].concat(log.storage());\n let private_log = PrivateLogData { log: PrivateLog::new(full_log, log.len() + 1), note_hash_counter };\n self.private_logs.push(private_log.count(counter));\n }\n\n /// Emits large data blobs.\n ///\n /// This reuses the Contract Class Log channel to emit blobs of up to [`CONTRACT_CLASS_LOG_SIZE_IN_FIELDS`].\n ///\n /// ## Privacy\n ///\n /// The address of the contract emitting these blobs is revelead.\n pub fn emit_contract_class_log<let N: u32>(&mut self, log: [Field; N]) {\n let contract_address = self.this_address();\n let counter = self.next_counter();\n\n let log_to_emit: [Field; CONTRACT_CLASS_LOG_SIZE_IN_FIELDS] =\n log.concat([0; CONTRACT_CLASS_LOG_SIZE_IN_FIELDS - N]);\n // Note: the length is not always N, it is the number of fields we want to broadcast, omitting trailing zeros\n // to save blob space.\n // Safety: The below length is constrained in the base rollup, which will make sure that all the fields beyond\n // length are zero. However, it won't be able to check that we didn't add extra padding (trailing zeroes) or\n // that we cut trailing zeroes from the end.\n let length = unsafe { trimmed_array_length_hint(log) };\n // We hash the entire padded log to ensure a user cannot pass a shorter length and so emit incorrect shorter\n // bytecode.\n let log_hash = compute_contract_class_log_hash(log_to_emit);\n // Safety: the below only exists to broadcast the raw log, so we can provide it to the base rollup later to be\n // constrained.\n unsafe {\n notify_created_contract_class_log(contract_address, log_to_emit, length, counter);\n }\n\n self.contract_class_logs_hashes.push(LogHash { value: log_hash, length: length }.count(counter));\n }\n\n /// Calls a private function on another contract (or the same contract).\n ///\n /// Very low-level function.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract containing the function\n /// * `function_selector` - 4-byte identifier of the function to call\n /// * `args` - Array of arguments to pass to the called function\n ///\n /// # Returns\n /// * `ReturnsHash` - Hash of the called function's return values. Use `.get_preimage()` to extract the actual\n /// return values.\n ///\n /// This enables contracts to interact with each other while maintaining privacy. This \"composability\" of private\n /// contract functions is a key feature of the Aztec network.\n ///\n /// If a user's transaction includes multiple private function calls, then by the design of Aztec, the following\n /// information will remain private[1]:\n /// - The function selectors and contract addresses of all private function calls will remain private, so an\n /// observer of the public mempool will not be able to look at a tx and deduce which private functions have been\n /// executed.\n /// - The arguments and return values of all private function calls will remain private.\n /// - The person who initiated the tx will remain private.\n /// - The notes and nullifiers and private logs that are emitted by all private function calls will (if designed\n /// well) not leak any user secrets, nor leak which functions have been executed.\n ///\n /// [1] Caveats: Some of these privacy guarantees depend on how app developers design their smart contracts. Some\n /// actions _can_ leak information, such as:\n /// - Calling an internal public function.\n /// - Calling a public function and not setting msg_sender to Option::none (feature not built yet - see github).\n /// - Calling any public function will always leak details about the nature of the transaction, so devs should be\n /// careful in their contract designs. If it can be done in a private function, then that will give the best\n /// privacy.\n /// - Not padding the side-effects of a tx to some standardized, uniform size. The kernel circuits can take hints\n /// to pad side-effects, so a wallet should be able to request for a particular amount of padding. Wallets should\n /// ideally agree on some standard.\n /// - Padding should include:\n /// - Padding the lengths of note & nullifier arrays\n /// - Padding private logs with random fields, up to some standardized size. See also:\n /// https://docs.aztec.network/developers/resources/considerations/privacy_considerations\n ///\n /// # Advanced\n /// * The call is added to the private call stack and executed by kernel circuits after this function completes\n /// * The called function can modify its own contract's private state\n /// * Side effects from the called function are included in this transaction\n /// * The call inherits the current transaction's context and gas limits\n ///\n pub fn call_private_function<let ArgsCount: u32>(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ArgsCount],\n ) -> ReturnsHash {\n let args_hash = hash_args(args);\n execution_cache::store(args, args_hash);\n self.call_private_function_with_args_hash(contract_address, function_selector, args_hash, false)\n }\n\n /// Makes a read-only call to a private function on another contract.\n ///\n /// This is similar to Solidity's `staticcall`. The called function cannot modify state, emit L2->L2 messages, nor\n /// emit events. Any nested calls are constrained to also be staticcalls.\n ///\n /// See `call_private_function` for more general info on private function calls.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract to call\n /// * `function_selector` - 4-byte identifier of the function to call\n /// * `args` - Array of arguments to pass to the called function\n ///\n /// # Returns\n /// * `ReturnsHash` - Hash of the called function's return values. Use `.get_preimage()` to extract the actual\n /// return values.\n ///\n pub fn static_call_private_function<let ArgsCount: u32>(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ArgsCount],\n ) -> ReturnsHash {\n let args_hash = hash_args(args);\n execution_cache::store(args, args_hash);\n self.call_private_function_with_args_hash(contract_address, function_selector, args_hash, true)\n }\n\n /// Calls a private function that takes no arguments.\n ///\n /// This is a convenience function for calling private functions that don't require any input parameters. It's\n /// equivalent to `call_private_function` but slightly more efficient to use when no arguments are needed.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract containing the function\n /// * `function_selector` - 4-byte identifier of the function to call\n ///\n /// # Returns\n /// * `ReturnsHash` - Hash of the called function's return values. Use `.get_preimage()` to extract the actual\n /// return values.\n ///\n pub fn call_private_function_no_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n ) -> ReturnsHash {\n self.call_private_function_with_args_hash(contract_address, function_selector, 0, false)\n }\n\n /// Makes a read-only call to a private function which takes no arguments.\n ///\n /// This combines the optimisation of `call_private_function_no_args` with the safety of\n /// `static_call_private_function`.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract containing the function\n /// * `function_selector` - 4-byte identifier of the function to call\n ///\n /// # Returns\n /// * `ReturnsHash` - Hash of the called function's return values. Use `.get_preimage()` to extract the actual\n /// return values.\n ///\n pub fn static_call_private_function_no_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n ) -> ReturnsHash {\n self.call_private_function_with_args_hash(contract_address, function_selector, 0, true)\n }\n\n /// Low-level private function call.\n ///\n /// This is the underlying implementation used by all other private function call methods. Instead of taking raw\n /// arguments, it accepts a hash of the arguments.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract containing the function\n /// * `function_selector` - 4-byte identifier of the function to call\n /// * `args_hash` - Pre-computed hash of the function arguments\n /// * `is_static_call` - Whether this should be a read-only call\n ///\n /// # Returns\n /// * `ReturnsHash` - Hash of the called function's return values\n ///\n pub fn call_private_function_with_args_hash(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args_hash: Field,\n is_static_call: bool,\n ) -> ReturnsHash {\n let is_static_call = is_static_call | self.inputs.call_context.is_static_call;\n let start_side_effect_counter = self.side_effect_counter;\n\n // Safety: The oracle simulates the private call and returns the value of the side effects counter after\n // execution of the call (which means that end_side_effect_counter - start_side_effect_counter is the number of\n // side effects that took place), along with the hash of the return values. We validate these by requesting a\n // private kernel iteration in which the return values are constrained to hash to `returns_hash` and the side\n // effects counter to increment from start to end.\n let (end_side_effect_counter, returns_hash) = unsafe {\n call_private_function_internal(\n contract_address,\n function_selector,\n args_hash,\n start_side_effect_counter,\n is_static_call,\n )\n };\n\n self.private_call_requests.push(\n PrivateCallRequest {\n call_context: CallContext {\n msg_sender: self.this_address(),\n contract_address,\n function_selector,\n is_static_call,\n },\n args_hash,\n returns_hash,\n start_side_effect_counter,\n end_side_effect_counter,\n },\n );\n\n // The kernel circuits ensure that end_side_effect_counter is greater than start_side_effect_counter, and that\n // all side effects emitted in the child call have counters within the range [start_side_effect_counter,\n // end_side_effect_counter]. Therefore, we only need to ensure that the next side effect from the current call\n // starts after the end side effect from the child call.\n self.side_effect_counter = end_side_effect_counter + 1;\n\n ReturnsHash::new(returns_hash)\n }\n\n /// Enqueues a call to a public function to be executed later.\n ///\n /// Unlike private functions which execute immediately on the user's device, public function calls are \"enqueued\"\n /// and executed some time later by a block proposer.\n ///\n /// This means a public function cannot return any values back to a private function, because by the time the\n /// public function is being executed, the private function which called it has already completed execution. (In\n /// fact, the private function has been executed and proven, along with all other private function calls of the\n /// user's tx. A single proof of the tx has been submitted to the Aztec network, and some time later a proposer has\n /// picked the tx up from the mempool and begun executing all of the enqueued public functions).\n ///\n /// # Privacy warning Enqueueing a public function call is an inherently leaky action. Many interesting applications will require some interaction with public state, but smart contract developers should try to use public function calls sparingly, and carefully. _Internal_ public function calls are especially leaky, because they completely leak which private contract made the call. See also: https://docs.aztec.network/developers/resources/considerations/privacy_considerations\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract containing the function\n /// * `function_selector` - 4-byte identifier of the function to call\n /// * `args` - Array of arguments to pass to the public function\n /// * `hide_msg_sender` - the called function will see a \"null\" value for `msg_sender` if set to `true`\n ///\n pub fn call_public_function<let ArgsCount: u32>(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ArgsCount],\n hide_msg_sender: bool,\n ) {\n let calldata = [function_selector.to_field()].concat(args);\n let calldata_hash = hash_calldata_array(calldata);\n execution_cache::store(calldata, calldata_hash);\n self.call_public_function_with_calldata_hash(contract_address, calldata_hash, false, hide_msg_sender)\n }\n\n /// Enqueues a read-only call to a public function.\n ///\n /// This is similar to Solidity's `staticcall`. The called function cannot modify state or emit events. Any nested\n /// calls are constrained to also be staticcalls.\n ///\n /// See also `call_public_function` for more important information about making private -> public function calls.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract containing the function\n /// * `function_selector` - 4-byte identifier of the function to call\n /// * `args` - Array of arguments to pass to the public function\n /// * `hide_msg_sender` - the called function will see a \"null\" value for `msg_sender` if set to `true`\n ///\n pub fn static_call_public_function<let ArgsCount: u32>(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ArgsCount],\n hide_msg_sender: bool,\n ) {\n let calldata = [function_selector.to_field()].concat(args);\n let calldata_hash = hash_calldata_array(calldata);\n execution_cache::store(calldata, calldata_hash);\n self.call_public_function_with_calldata_hash(contract_address, calldata_hash, true, hide_msg_sender)\n }\n\n /// Enqueues a call to a public function that takes no arguments.\n ///\n /// This is an optimisation for calling public functions that don't take any input parameters. It's otherwise\n /// equivalent to `call_public_function`.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract containing the function\n /// * `function_selector` - 4-byte identifier of the function to call\n /// * `hide_msg_sender` - the called function will see a \"null\" value for `msg_sender` if set to `true`\n ///\n pub fn call_public_function_no_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n hide_msg_sender: bool,\n ) {\n let calldata_hash = hash_calldata_array([function_selector.to_field()]);\n self.call_public_function_with_calldata_hash(contract_address, calldata_hash, false, hide_msg_sender)\n }\n\n /// Enqueues a read-only call to a public function with no arguments.\n ///\n /// This combines the optimisation of `call_public_function_no_args` with the safety of\n /// `static_call_public_function`.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract containing the function\n /// * `function_selector` - 4-byte identifier of the function to call\n /// * `hide_msg_sender` - the called function will see a \"null\" value for `msg_sender` if set to `true`\n ///\n pub fn static_call_public_function_no_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n hide_msg_sender: bool,\n ) {\n let calldata_hash = hash_calldata_array([function_selector.to_field()]);\n self.call_public_function_with_calldata_hash(contract_address, calldata_hash, true, hide_msg_sender)\n }\n\n /// Low-level public function call.\n ///\n /// This is the underlying implementation used by all other public function call methods. Instead of taking raw\n /// arguments, it accepts a hash of the arguments.\n ///\n /// Advanced function: Most developers should use `call_public_function` or `static_call_public_function` instead.\n /// This function is exposed for performance optimization and advanced use cases.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract containing the function\n /// * `calldata_hash` - Hash of the function calldata\n /// * `is_static_call` - Whether this should be a read-only call\n /// * `hide_msg_sender` - the called function will see a \"null\" value for `msg_sender` if set to `true`\n ///\n pub fn call_public_function_with_calldata_hash(\n &mut self,\n contract_address: AztecAddress,\n calldata_hash: Field,\n is_static_call: bool,\n hide_msg_sender: bool,\n ) {\n let counter = self.next_counter();\n\n let is_static_call = is_static_call | self.inputs.call_context.is_static_call;\n\n assert_valid_public_call_data(calldata_hash);\n\n let msg_sender = if hide_msg_sender {\n NULL_MSG_SENDER_CONTRACT_ADDRESS\n } else {\n self.this_address()\n };\n\n let call_request = PublicCallRequest { msg_sender, contract_address, is_static_call, calldata_hash };\n\n self.public_call_requests.push(Counted::new(call_request, counter));\n }\n\n /// Enqueues a public function call, and designates it to be the teardown function for this tx. Only one teardown\n /// function call can be made by a tx.\n ///\n /// Niche function: Only wallet developers and paymaster contract developers (aka Fee-payment contracts) will need\n /// to make use of this function.\n ///\n /// Aztec supports a three-phase execution model: setup, app logic, teardown. The phases exist to enable a fee\n /// payer to take on the risk of paying a transaction fee, safe in the knowledge that their payment (in whatever\n /// token or method the user chooses) will succeed, regardless of whether the app logic will succeed. The \"setup\"\n /// phase ensures the fee payer has sufficient balance to pay the proposer their fees. The teardown phase is\n /// primarily intended to: calculate exactly how much the user owes, based on gas consumption, and refund the user\n /// any change.\n ///\n /// Note: in some cases, the cost of refunding the user (i.e. DA costs of tx side-effects) might exceed the refund\n /// amount. For app logic with fairly stable and predictable gas consumption, a material refund amount is unlikely.\n /// For app logic with unpredictable gas consumption, a refund might be important to the user (e.g. if a hefty\n /// function reverts very early). Wallet/FPC/Paymaster developers should be mindful of this.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract containing the teardown function\n /// * `function_selector` - 4-byte identifier of the function to call\n /// * `args` - An array of fields to pass to the function.\n /// * `hide_msg_sender` - the called function will see a \"null\" value for `msg_sender` if set to `true`\n pub fn set_public_teardown_function<let ArgsCount: u32>(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ArgsCount],\n hide_msg_sender: bool,\n ) {\n let calldata = [function_selector.to_field()].concat(args);\n let calldata_hash = hash_calldata_array(calldata);\n execution_cache::store(calldata, calldata_hash);\n self.set_public_teardown_function_with_calldata_hash(contract_address, calldata_hash, false, hide_msg_sender)\n }\n\n /// Low-level function to set the public teardown function.\n ///\n /// This is the underlying implementation for setting the teardown function call that will execute at the end of\n /// the transaction. Instead of taking raw arguments, it accepts a hash of the arguments.\n ///\n /// Advanced function: Most developers should use `set_public_teardown_function` instead.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract containing the teardown function\n /// * `calldata_hash` - Hash of the function calldata\n /// * `is_static_call` - Whether this should be a read-only call\n /// * `hide_msg_sender` - the called function will see a \"null\" value for `msg_sender` if set to `true`\n ///\n pub fn set_public_teardown_function_with_calldata_hash(\n &mut self,\n contract_address: AztecAddress,\n calldata_hash: Field,\n is_static_call: bool,\n hide_msg_sender: bool,\n ) {\n let is_static_call = is_static_call | self.inputs.call_context.is_static_call;\n\n assert_valid_public_call_data(calldata_hash);\n\n let msg_sender = if hide_msg_sender {\n NULL_MSG_SENDER_CONTRACT_ADDRESS\n } else {\n self.this_address()\n };\n\n self.public_teardown_call_request =\n PublicCallRequest { msg_sender, contract_address, is_static_call, calldata_hash };\n }\n\n /// Increments the side-effect counter.\n ///\n /// Very low-level function.\n ///\n /// # Advanced\n ///\n /// Every side-effect of a private function is given a \"side-effect counter\", based on when it is created. This\n /// PrivateContext is in charge of assigning the counters.\n ///\n /// The reason we have side-effect counters is complicated. Consider this illustrative pseudocode of inter-contract\n /// function calls:\n /// ```\n /// contract A {\n /// let x = 5; // pseudocode for storage var x.\n /// fn a1 {\n /// read x; // value: 5, counter: 1.\n /// x = x + 1;\n /// write x; // value: 6, counter: 2.\n ///\n /// B.b(); // start_counter: 2, end_counter: 4\n ///\n /// read x; // value: 36, counter: 5.\n /// x = x + 1;\n /// write x; // value: 37, counter: 6.\n /// }\n ///\n /// fn a2 {\n /// read x; // value: 6, counter: 3.\n /// x = x * x;\n /// write x; // value: 36, counter: 4.\n /// }\n /// }\n ///\n /// contract B {\n /// fn b() {\n /// A.a2();\n /// }\n /// }\n /// ```\n ///\n /// Suppose a1 is the first function called. The comments show the execution counter of each side-effect, and what\n /// the new value of `x` is.\n ///\n /// These (private) functions are processed by Aztec's kernel circuits in an order that is different from execution\n /// order: All of A.a1 is proven before B.b is proven, before A.a2 is proven. So when we're in the 2nd execution\n /// frame of A.a1 (after the call to B.b), the circuit needs to justify why x went from being `6` to `36`. But the\n /// circuit doesn't know why, and given the order of proving, the kernel hasn't _seen_ a value of 36 get written\n /// yet. The kernel needs to track big arrays of all side-effects of all private functions in a tx. Then, as it\n /// recurses and processes B.b(), it will eventually see a value of 36 get written.\n ///\n /// Suppose side-effect counters weren't exposed: The kernel would only see this ordering (in order of proof\n /// verification): [ A.a1.read, A.a1.write, A.a1.read, A.a1.write, A.a2.read, A.a2.write ]\n /// [ 5, 6, 36, 37, 6, 36 ]\n /// The kernel wouldn't know _when_ B.b() was called within A.a1(), because it can't see what's going on within an\n /// app circuit. So the kernel wouldn't know that the ordering of reads and writes should actually be: [ A.a1.read,\n /// A.a1.write, A.a2.read, A.a2.write, A.a1.read, A.a1.write ]\n /// [ 5, 6, 6, 36, 36, 37 ]\n ///\n /// And so, we introduced side-effect counters: every private function must assign side-effect counters alongside\n /// every side-effect that it emits, and also expose to the kernel the counters that it started and ended with.\n /// This gives the kernel enough information to arrange all side-effects in the correct order. It can then catch\n /// (for example) if a function tries to read state before it has been written (e.g. if A.a2() maliciously tried to\n /// read a value of x=37) (e.g. if A.a1() maliciously tried to read x=6).\n ///\n /// If a malicious app contract _lies_ and does not count correctly:\n /// - It cannot lie about its start and end counters because the kernel will catch this.\n /// - It _could_ lie about its intermediate counters:\n /// - 1. It could not increment its side-effects correctly\n /// - 2. It could label its side-effects with counters outside of its start and end counters' range. The kernel\n /// will catch 2. The kernel will not catch 1., but this would only cause corruption to the private state of the\n /// malicious contract, and not any other contracts (because a contract can only modify its own state). If a \"good\"\n /// contract is given _read access_ to a maliciously-counting contract (via an external getter function, or by\n /// reading historic state from the archive tree directly), and they then make state changes to their _own_ state\n /// accordingly, that could be dangerous. Developers should be mindful not to trust the claimed innards of external\n /// contracts unless they have audited/vetted the contracts including vetting the side-effect counter\n /// incrementation. This is a similar paradigm to Ethereum smart contract development: you must vet external\n /// contracts that your contract relies upon, and you must not make any presumptions about their claimed behaviour.\n /// (Hopefully if a contract imports a version of aztec-nr, we will get contract verification tooling that can\n /// validate the authenticity of the imported aztec-nr package, and hence infer that the side- effect counting will\n /// be correct, without having to re-audit such logic for every contract).\n ///\n fn next_counter(&mut self) -> u32 {\n let counter = self.side_effect_counter;\n self.side_effect_counter += 1;\n counter\n }\n}\n\nimpl Empty for PrivateContext {\n fn empty() -> Self {\n PrivateContext {\n inputs: PrivateContextInputs::empty(),\n side_effect_counter: 0 as u32,\n min_revertible_side_effect_counter: 0 as u32,\n is_fee_payer: false,\n args_hash: 0,\n return_hash: 0,\n expiration_timestamp: 0,\n note_hash_read_requests: BoundedVec::new(),\n nullifier_read_requests: BoundedVec::new(),\n key_validation_requests_and_separators: BoundedVec::new(),\n note_hashes: BoundedVec::new(),\n nullifiers: BoundedVec::new(),\n private_call_requests: BoundedVec::new(),\n public_call_requests: BoundedVec::new(),\n public_teardown_call_request: PublicCallRequest::empty(),\n l2_to_l1_msgs: BoundedVec::new(),\n anchor_block_header: BlockHeader::empty(),\n private_logs: BoundedVec::new(),\n contract_class_logs_hashes: BoundedVec::new(),\n last_key_validation_requests: [Option::none(); NUM_KEY_TYPES],\n expected_non_revertible_side_effect_counter: 0,\n expected_revertible_side_effect_counter: 0,\n }\n }\n}\n"
3939
+ "source": "use crate::{\n context::{inputs::PrivateContextInputs, NoteExistenceRequest, NullifierExistenceRequest, ReturnsHash},\n hash::{hash_args, hash_calldata_array},\n keys::constants::{NULLIFIER_INDEX, NUM_KEY_TYPES, OUTGOING_INDEX, public_key_domain_separators},\n messaging::process_l1_to_l2_message,\n oracle::{\n block_header::get_block_header_at,\n call_private_function::call_private_function_internal,\n execution_cache,\n key_validation_request::get_key_validation_request,\n logs::notify_created_contract_class_log,\n notes::notify_nullified_note,\n nullifiers::notify_created_nullifier,\n public_call::assert_valid_public_call_data,\n tx_phase::{is_execution_in_revertible_phase, notify_revertible_phase_start},\n },\n};\nuse crate::logging::aztecnr_trace_log_format;\nuse crate::protocol::{\n abis::{\n block_header::BlockHeader,\n call_context::CallContext,\n function_selector::FunctionSelector,\n gas_settings::GasSettings,\n log_hash::LogHash,\n note_hash::NoteHash,\n nullifier::Nullifier,\n private_call_request::PrivateCallRequest,\n private_circuit_public_inputs::PrivateCircuitPublicInputs,\n private_log::{PrivateLog, PrivateLogData},\n public_call_request::PublicCallRequest,\n validation_requests::{KeyValidationRequest, KeyValidationRequestAndSeparator},\n },\n address::{AztecAddress, EthAddress},\n constants::{\n CONTRACT_CLASS_LOG_SIZE_IN_FIELDS, MAX_CONTRACT_CLASS_LOGS_PER_CALL, MAX_ENQUEUED_CALLS_PER_CALL,\n MAX_KEY_VALIDATION_REQUESTS_PER_CALL, MAX_L2_TO_L1_MSGS_PER_CALL, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL,\n MAX_NOTE_HASHES_PER_CALL, MAX_NULLIFIER_READ_REQUESTS_PER_CALL, MAX_NULLIFIERS_PER_CALL,\n MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, MAX_PRIVATE_LOGS_PER_CALL, MAX_TX_LIFETIME,\n NULL_MSG_SENDER_CONTRACT_ADDRESS, PRIVATE_LOG_CIPHERTEXT_LEN,\n },\n hash::compute_contract_class_log_hash,\n messaging::l2_to_l1_message::L2ToL1Message,\n side_effect::{Counted, scoped::Scoped},\n traits::{Empty, ToField},\n utils::arrays::{ClaimedLengthArray, trimmed_array_length_hint},\n};\n\n/// # PrivateContext\n///\n/// The **main interface** between an #[external(\"private\")] function and the Aztec blockchain.\n///\n/// An instance of the PrivateContext is initialized automatically at the outset of every private function, within the\n/// #[external(\"private\")] macro, so you'll never need to consciously instantiate this yourself.\n///\n/// The instance is always named `context`, and it is always be available within the body of every\n/// #[external(\"private\")] function in your smart contract.\n///\n/// > For those used to \"vanilla\" Noir, it might be jarring to have access to > `context` without seeing a declaration\n/// `let context = PrivateContext::new(...)` > within the body of your function. This is just a consequence of using >\n/// macros to tidy-up verbose boilerplate. You can use `nargo expand` to > expand all macros, if you dare.\n///\n/// Typical usage for a smart contract developer will be to call getter methods of the PrivateContext.\n///\n/// _Pushing_ data and requests to the context is mostly handled within aztec-nr's own functions, so typically a smart\n/// contract developer won't need to call any setter methods directly.\n///\n/// > Advanced users might occasionally wish to push data to the context > directly for lower-level control. If you\n/// find yourself doing this, please > open an issue on GitHub to describe your use case: it might be that > new\n/// functionality should be added to aztec-nr.\n///\n/// ## Responsibilities\n/// - Exposes contextual data to a private function:\n/// - Data relating to how this private function was called.\n/// - msg_sender\n/// - this_address - (the contract address of the private function being executed)\n/// - See `CallContext` for more data.\n/// - Data relating to the transaction in which this private function is being executed.\n/// - chain_id\n/// - version\n/// - gas_settings\n/// - Provides state access:\n/// - Access to the \"Anchor block\" header. Recall, a private function cannot read from the \"current\" block header, but\n/// must read from some historical block header, because as soon as private function execution begins (asynchronously,\n/// on a user's device), the public state of the chain (the \"current state\") will have progressed forward. We call this\n/// reference the \"Anchor block\". See `BlockHeader`.\n/// - Enables consumption of L1->L2 messages.\n/// - Enables calls to functions of other smart contracts:\n/// - Private function calls\n/// - Enqueueing of public function call requests (Since public functions are executed at a later time, by a block\n/// proposer, we say they are \"enqueued\").\n/// - Writes data to the blockchain:\n/// - New notes\n/// - New nullifiers\n/// - Private logs (for sending encrypted note contents or encrypted events)\n/// - New L2->L1 messages.\n/// - Provides args to the private function (handled by the #[external(\"private\")] macro).\n/// - Returns the return values of this private function (handled by the\n/// #[external(\"private\")] macro).\n/// - Makes Key Validation Requests.\n/// - Private functions are not allowed to see master secret keys, because we do not trust them. They are instead given\n/// \"app-siloed\" secret keys with a claim that they relate to a master public key. They can then request validation of\n/// this claim, by making a \"key validation request\" to the protocol's kernel circuits (which _are_ allowed to see\n/// certain master secret keys).\n///\n/// ## Advanced Responsibilities\n///\n/// - Ultimately, the PrivateContext is responsible for constructing the PrivateCircuitPublicInputs of the private\n/// function being executed. All private functions on Aztec must have public inputs which adhere to the rigid layout of\n/// the PrivateCircuitPublicInputs, in order to be compatible with the protocol's kernel circuits. A well-known\n/// misnomer:\n/// - \"public inputs\" contain both inputs and outputs of this function.\n/// - By \"outputs\" we mean a lot more side-effects than just the \"return values\" of the function.\n/// - Most of the so-called \"public inputs\" are kept _private_, and never leak to the outside world, because they are\n/// 'swallowed' by the protocol's kernel circuits before the tx is sent to the network. Only the following are exposed\n/// to the outside world:\n/// - New note_hashes\n/// - New nullifiers\n/// - New private logs\n/// - New L2->L1 messages\n/// - New enqueued public function call requests All the above-listed arrays of side-effects can be padded by the\n/// user's wallet (through instructions to the kernel circuits, via the PXE) to obscure their true lengths.\n///\n/// ## Syntax Justification\n///\n/// Both user-defined functions _and_ most functions in aztec-nr need access to the PrivateContext instance to\n/// read/write data. This is why you'll see the arguably-ugly pervasiveness of the \"context\" throughout your smart\n/// contract and the aztec-nr library. For example, `&mut context` is prevalent. In some languages, you can access and\n/// mutate a global variable (such as a PrivateContext instance) from a function without polluting the function's\n/// parameters. With Noir, a function must explicitly pass control of a mutable variable to another function, by\n/// reference. Since many functions in aztec-nr need to be able to push new data to the PrivateContext, they need to be\n/// handed a mutable reference _to_ the context as a parameter. For example, `Context` is prevalent as a generic\n/// parameter, to give better type safety at compile time. Many `aztec-nr` functions don't make sense if they're called\n/// in a particular runtime (private, public or utility), and so are intentionally only implemented over certain\n/// [Private|Public|Utility]Context structs. This gives smart contract developers a much faster feedback loop if\n/// they're making a mistake, as an error will be thrown by the LSP or when they compile their contract.\n///\n#[derive(Eq)]\npub struct PrivateContext {\n // docs:start:private-context\n inputs: PrivateContextInputs,\n side_effect_counter: u32,\n\n min_revertible_side_effect_counter: u32,\n is_fee_payer: bool,\n\n args_hash: Field,\n return_hash: Field,\n\n pub(crate) expiration_timestamp: u64,\n\n pub(crate) note_hash_read_requests: BoundedVec<Scoped<Counted<Field>>, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL>,\n pub(crate) nullifier_read_requests: BoundedVec<Scoped<Counted<Field>>, MAX_NULLIFIER_READ_REQUESTS_PER_CALL>,\n key_validation_requests_and_separators: BoundedVec<KeyValidationRequestAndSeparator, MAX_KEY_VALIDATION_REQUESTS_PER_CALL>,\n\n pub(crate) note_hashes: BoundedVec<Counted<NoteHash>, MAX_NOTE_HASHES_PER_CALL>,\n pub(crate) nullifiers: BoundedVec<Counted<Nullifier>, MAX_NULLIFIERS_PER_CALL>,\n\n pub(crate) private_call_requests: BoundedVec<PrivateCallRequest, MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL>,\n public_call_requests: BoundedVec<Counted<PublicCallRequest>, MAX_ENQUEUED_CALLS_PER_CALL>,\n public_teardown_call_request: PublicCallRequest,\n l2_to_l1_msgs: BoundedVec<Counted<L2ToL1Message>, MAX_L2_TO_L1_MSGS_PER_CALL>,\n // docs:end:private-context\n\n // Header of a block whose state is used during private execution (not the block the transaction is included in).\n pub(crate) anchor_block_header: BlockHeader,\n\n private_logs: BoundedVec<Counted<PrivateLogData>, MAX_PRIVATE_LOGS_PER_CALL>,\n contract_class_logs_hashes: BoundedVec<Counted<LogHash>, MAX_CONTRACT_CLASS_LOGS_PER_CALL>,\n\n // Contains the last key validation request for each key type. This is used to cache the last request and avoid\n // fetching the same request multiple times. The index of the array corresponds to the key type (0 nullifier, 1\n // incoming, 2 outgoing, 3 tagging).\n last_key_validation_requests: [Option<KeyValidationRequest>; NUM_KEY_TYPES],\n\n expected_non_revertible_side_effect_counter: u32,\n expected_revertible_side_effect_counter: u32,\n}\n\nimpl PrivateContext {\n pub fn new(inputs: PrivateContextInputs, args_hash: Field) -> PrivateContext {\n PrivateContext {\n inputs,\n side_effect_counter: inputs.start_side_effect_counter + 1,\n min_revertible_side_effect_counter: 0,\n is_fee_payer: false,\n args_hash,\n return_hash: 0,\n expiration_timestamp: inputs.anchor_block_header.timestamp() + MAX_TX_LIFETIME,\n note_hash_read_requests: BoundedVec::new(),\n nullifier_read_requests: BoundedVec::new(),\n key_validation_requests_and_separators: BoundedVec::new(),\n note_hashes: BoundedVec::new(),\n nullifiers: BoundedVec::new(),\n anchor_block_header: inputs.anchor_block_header,\n private_call_requests: BoundedVec::new(),\n public_call_requests: BoundedVec::new(),\n public_teardown_call_request: PublicCallRequest::empty(),\n l2_to_l1_msgs: BoundedVec::new(),\n private_logs: BoundedVec::new(),\n contract_class_logs_hashes: BoundedVec::new(),\n last_key_validation_requests: [Option::none(); NUM_KEY_TYPES],\n expected_non_revertible_side_effect_counter: 0,\n expected_revertible_side_effect_counter: 0,\n }\n }\n\n /// Returns the contract address that initiated this function call.\n ///\n /// This is similar to `msg.sender` in Solidity (hence the name).\n ///\n /// Important Note: Since Aztec doesn't have a concept of an EoA (Externally-owned Account), the msg_sender is\n /// \"none\" for the first function call of every transaction. The first function call of a tx is likely to be a call\n /// to the user's account contract, so this quirk will most often be handled by account contract developers.\n ///\n /// # Returns\n /// * `Option<AztecAddress>` - The address of the smart contract that called this function (be it an app contract\n /// or a user's account contract). Returns `Option<AztecAddress>::none` for the first function call of the tx. No\n /// other _private_ function calls in the tx will have a `none` msg_sender, but _public_ function calls might (see\n /// the PublicContext).\n pub fn maybe_msg_sender(self) -> Option<AztecAddress> {\n let maybe_msg_sender = self.inputs.call_context.msg_sender;\n if maybe_msg_sender == NULL_MSG_SENDER_CONTRACT_ADDRESS {\n Option::none()\n } else {\n Option::some(maybe_msg_sender)\n }\n }\n\n /// Returns the contract address of the current function being executed.\n ///\n /// This is equivalent to `address(this)` in Solidity (hence the name). Use this to identify the current contract's\n /// address, commonly needed for access control or when interacting with other contracts.\n ///\n /// # Returns\n /// * `AztecAddress` - The contract address of the current function being executed.\n ///\n pub fn this_address(self) -> AztecAddress {\n self.inputs.call_context.contract_address\n }\n\n /// Returns the chain ID of the current network.\n ///\n /// This is similar to `block.chainid` in Solidity. Returns the unique identifier for the blockchain network this\n /// transaction is executing on.\n ///\n /// Helps prevent cross-chain replay attacks. Useful if implementing multi-chain contract logic.\n ///\n /// # Returns\n /// * `Field` - The chain ID as a field element\n ///\n pub fn chain_id(self) -> Field {\n self.inputs.tx_context.chain_id\n }\n\n /// Returns the Aztec protocol version that this transaction is executing under. Different versions may have\n /// different rules, opcodes, or cryptographic primitives.\n ///\n /// This is similar to how Ethereum has different EVM versions.\n ///\n /// Useful for forward/backward compatibility checks\n ///\n /// Not to be confused with contract versions; this is the protocol version.\n ///\n /// # Returns\n /// * `Field` - The protocol version as a field element\n ///\n pub fn version(self) -> Field {\n self.inputs.tx_context.version\n }\n\n /// Returns the gas settings for the current transaction.\n ///\n /// This provides information about gas limits and pricing for the transaction, similar to `tx.gasprice` and gas\n /// limits in Ethereum. However, Aztec has a more sophisticated gas model with separate accounting for L2\n /// computation and data availability (DA) costs.\n ///\n /// # Returns\n /// * `GasSettings` - Struct containing gas limits and fee information\n ///\n pub fn gas_settings(self) -> GasSettings {\n self.inputs.tx_context.gas_settings\n }\n\n /// Returns the function selector of the currently executing function.\n ///\n /// Low-level function: Ordinarily, smart contract developers will not need to access this.\n ///\n /// This is similar to `msg.sig` in Solidity, which returns the first 4 bytes of the function signature. In Aztec,\n /// the selector uniquely identifies which function within the contract is being called.\n ///\n /// # Returns\n /// * `FunctionSelector` - The 4-byte function identifier\n ///\n /// # Advanced\n /// Only #[external(\"private\")] functions have a function selector as a protocol- enshrined concept. The function\n /// selectors of private functions are baked into the preimage of the contract address, and are used by the\n /// protocol's kernel circuits to identify each private function and ensure the correct one is being executed.\n ///\n /// Used internally for function dispatch and call verification.\n ///\n pub fn selector(self) -> FunctionSelector {\n self.inputs.call_context.function_selector\n }\n\n /// Returns whether this call is being executed as part of a static call.\n ///\n /// Similar to Solidity's `STATICCALL`, a static call is read-only: neither this function nor any of its nested\n /// calls may emit side-effects (new notes, nullifiers, logs, L2->L1 messages, etc.). A call is considered static\n /// if it was invoked as a static call or if any of its ancestor calls were.\n ///\n /// # Returns\n /// * `bool` - `true` if this call (or an ancestor call) is a static call.\n ///\n pub fn is_static_call(self) -> bool {\n self.inputs.call_context.is_static_call\n }\n\n /// Returns the hash of the arguments passed to the current function.\n ///\n /// Very low-level function: You shouldn't need to call this. The #[external(\"private\")] macro calls this, and it\n /// makes the arguments neatly available to the body of your private function.\n ///\n /// # Returns\n /// * `Field` - Hash of the function arguments\n ///\n /// # Advanced\n /// * Arguments are hashed to reduce proof size and verification time\n /// * Enables efficient argument passing in recursive function calls\n /// * The hash can be used to retrieve the original arguments from the PXE.\n ///\n pub fn get_args_hash(self) -> Field {\n self.args_hash\n }\n\n /// Returns the current value of the side-effect counter, i.e. the counter that will be assigned to the next\n /// side-effect emitted by this function.\n ///\n /// Low-level function: Ordinarily, smart contract developers will not need to access this. See `next_counter` for\n /// details on how side-effect counters are assigned and why they exist.\n ///\n /// # Returns\n /// * `u32` - The current side-effect counter.\n ///\n pub fn get_side_effect_counter(self) -> u32 {\n self.side_effect_counter\n }\n\n /// Pushes a new note_hash to the Aztec blockchain's global Note Hash Tree (a state tree).\n ///\n /// A note_hash is a commitment to a piece of private state.\n ///\n /// Low-level function: Ordinarily, smart contract developers will not need to manually call this. Aztec-nr's state\n /// variables (see `../state_vars/`) are designed to understand when to create and push new note hashes.\n ///\n /// # Arguments\n /// * `note_hash` - The new note_hash.\n ///\n /// # Advanced\n /// From here, the protocol's kernel circuits will take over and insert the note_hash into the protocol's \"note\n /// hash tree\" (in the Base Rollup circuit). Before insertion, the protocol will:\n /// - \"Silo\" the `note_hash` with the contract address of this function, to yield a `siloed_note_hash`. This\n /// prevents state collisions between different smart contracts.\n /// - Ensure uniqueness of the `siloed_note_hash`, to prevent Faerie-Gold attacks, by hashing the\n /// `siloed_note_hash` with a unique value, to yield a `unique_siloed_note_hash` (see the protocol spec for more).\n ///\n /// In addition to calling this function, aztec-nr provides the contents of the newly-created note to the PXE, via\n /// the `notify_created_note` oracle.\n ///\n /// > Advanced users might occasionally wish to push data to the context > directly for lower-level control. If you\n /// find yourself doing this, > please open an issue on GitHub to describe your use case: it might be > that new\n /// functionality should be added to aztec-nr.\n ///\n pub fn push_note_hash(&mut self, note_hash: Field) {\n self.note_hashes.push(Counted::new(note_hash, self.next_counter()));\n }\n\n /// Creates a new [nullifier](crate::nullifier).\n ///\n /// ## Safety\n ///\n /// This is a low-level function that must be used with great care to avoid subtle corruption of contract state.\n /// Instead of calling this function, consider using the higher-level [`crate::state_vars::SingleUseClaim`].\n ///\n /// In particular, callers must ensure all nullifiers created by a contract are properly domain-separated, so that\n /// unrelated components don't interfere with one another (e.g. a transaction nullifier accidentally marking a\n /// variable as initialized). Only [`PrivateContext::push_nullifier_for_note_hash`] should be used for note\n /// nullifiers, never this one.\n ///\n /// ## Advanced\n ///\n /// The raw `nullifier` is not what is inserted into the Aztec state tree: it will be first siloed by contract\n /// address via [`crate::protocol::hash::compute_siloed_nullifier`] in order to prevent accidental or malicious\n /// interference of nullifiers from different contracts.\n pub fn push_nullifier_unsafe(&mut self, nullifier: Field) {\n notify_created_nullifier(nullifier);\n self.nullifiers.push(Nullifier { value: nullifier, note_hash: 0 }.count(self.next_counter()));\n }\n\n /// Creates a new [nullifier](crate::nullifier) associated with a note.\n ///\n /// This is a variant of [`PrivateContext::push_nullifier_unsafe`] that is used for note nullifiers, i.e.\n /// nullifiers that correspond to a note. If a note and its nullifier are created in the same transaction, then\n /// the private kernels will 'squash' these values, deleting them both as if they never existed and reducing\n /// transaction fees.\n ///\n /// The `nullification_note_hash` must be the result of calling\n /// [`crate::note::utils::compute_confirmed_note_hash_for_nullification`] for pending notes, and `0` for settled\n /// notes (which cannot be squashed).\n ///\n /// ## Safety\n ///\n /// This is a low-level function that must be used with great care to avoid subtle corruption of contract state.\n /// Instead of calling this function, consider using the higher-level [`crate::note::lifecycle::destroy_note`].\n ///\n /// The precautions listed for [`PrivateContext::push_nullifier_unsafe`] apply here as well, and callers should\n /// additionally ensure `nullification_note_hash` corresponds to a note emitted by this contract, with its hash\n /// computed in the same transaction execution phase as the call to this function. Finally, only this function\n /// should be used for note nullifiers, never [`PrivateContext::push_nullifier_unsafe`].\n ///\n /// Failure to do these things can result in unprovable contexts, accidental deletion of notes, or double-spend\n /// attacks.\n pub fn push_nullifier_for_note_hash(&mut self, nullifier: Field, nullification_note_hash: Field) {\n let nullifier_counter = self.next_counter();\n notify_nullified_note(nullifier, nullification_note_hash, nullifier_counter);\n self.nullifiers.push(Nullifier { value: nullifier, note_hash: nullification_note_hash }.count(\n nullifier_counter,\n ));\n }\n\n /// Returns the anchor block header - the historical block header that this private function is reading from.\n ///\n /// A private function CANNOT read from the \"current\" block header, but must read from some older block header,\n /// because as soon as private function execution begins (asynchronously, on a user's device), the public state of\n /// the chain (the \"current state\") will have progressed forward.\n ///\n /// # Returns\n /// * `BlockHeader` - The anchor block header.\n ///\n /// # Advanced\n /// * All private functions of a tx read from the same anchor block header.\n /// * The protocol asserts that the `expiration_timestamp` of every tx is at most 24 hours beyond the timestamp of\n /// the tx's chosen anchor block header. This enables the network's nodes to safely prune old txs from the mempool.\n /// Therefore, the chosen block header _must_ be one from within the last 24 hours.\n ///\n pub fn get_anchor_block_header(self) -> BlockHeader {\n self.anchor_block_header\n }\n\n /// Returns the header of any historical block at or before the anchor block.\n ///\n /// This enables private contracts to access information from even older blocks than the anchor block header.\n ///\n /// Useful for time-based contract logic that needs to compare against multiple historical points.\n ///\n /// # Arguments\n /// * `block_number` - The block number to retrieve (must be <= anchor block number)\n ///\n /// # Returns\n /// * `BlockHeader` - The header of the requested historical block\n ///\n /// # Advanced\n /// This function uses an oracle to fetch block header data from the user's PXE. Depending on how much blockchain\n /// data the user's PXE has been set up to store, this might require a query from the PXE to another Aztec node to\n /// get the data. > This is generally true of all oracle getters (see `../oracle`).\n ///\n /// Each block header gets hashed and stored as a leaf in the protocol's Archive Tree. In fact, the i-th block\n /// header gets stored at the i-th leaf index of the Archive Tree. Behind the scenes, this `get_block_header_at`\n /// function will add Archive Tree merkle-membership constraints (~3k) to your smart contract function's circuit,\n /// to prove existence of the block header in the Archive Tree.\n ///\n /// Note: we don't do any caching, so avoid making duplicate calls for the same block header, because each call\n /// will add duplicate constraints.\n ///\n /// Calling this function is more expensive (constraint-wise) than getting the anchor block header (via\n /// `get_block_header`). This is because the anchor block's merkle membership proof is handled by Aztec's protocol\n /// circuits, and is only performed once for the entire tx because all private functions of a tx share a common\n /// anchor block header. Therefore, the cost (constraint-wise) of calling `get_block_header` is effectively free.\n ///\n pub fn get_block_header_at(self, block_number: u32) -> BlockHeader {\n get_block_header_at(block_number, self)\n }\n\n /// Sets the hash of the return values for this private function.\n ///\n /// Very low-level function: this is called by the #[external(\"private\")] macro.\n ///\n /// # Arguments\n /// * `serialized_return_values` - The serialized return values as a field array\n ///\n pub fn set_return_hash<let N: u32>(&mut self, serialized_return_values: [Field; N]) {\n let return_hash = hash_args(serialized_return_values);\n self.return_hash = return_hash;\n execution_cache::store(serialized_return_values, return_hash);\n }\n\n /// Builds the PrivateCircuitPublicInputs for this private function, to ensure compatibility with the protocol's\n /// kernel circuits.\n ///\n /// Very low-level function: This function is automatically called by the #[external(\"private\")] macro.\n pub fn finish(self) -> PrivateCircuitPublicInputs {\n PrivateCircuitPublicInputs {\n call_context: self.inputs.call_context,\n args_hash: self.args_hash,\n returns_hash: self.return_hash,\n min_revertible_side_effect_counter: self.min_revertible_side_effect_counter,\n is_fee_payer: self.is_fee_payer,\n expiration_timestamp: self.expiration_timestamp,\n note_hash_read_requests: ClaimedLengthArray::from_bounded_vec(self.note_hash_read_requests),\n nullifier_read_requests: ClaimedLengthArray::from_bounded_vec(self.nullifier_read_requests),\n key_validation_requests_and_separators: ClaimedLengthArray::from_bounded_vec(\n self.key_validation_requests_and_separators,\n ),\n note_hashes: ClaimedLengthArray::from_bounded_vec(self.note_hashes),\n nullifiers: ClaimedLengthArray::from_bounded_vec(self.nullifiers),\n private_call_requests: ClaimedLengthArray::from_bounded_vec(self.private_call_requests),\n public_call_requests: ClaimedLengthArray::from_bounded_vec(self.public_call_requests),\n public_teardown_call_request: self.public_teardown_call_request,\n l2_to_l1_msgs: ClaimedLengthArray::from_bounded_vec(self.l2_to_l1_msgs),\n start_side_effect_counter: self.inputs.start_side_effect_counter,\n end_side_effect_counter: self.side_effect_counter,\n private_logs: ClaimedLengthArray::from_bounded_vec(self.private_logs),\n contract_class_logs_hashes: ClaimedLengthArray::from_bounded_vec(self.contract_class_logs_hashes),\n anchor_block_header: self.anchor_block_header,\n tx_context: self.inputs.tx_context,\n expected_non_revertible_side_effect_counter: self.expected_non_revertible_side_effect_counter,\n expected_revertible_side_effect_counter: self.expected_revertible_side_effect_counter,\n tx_request_salt: self.inputs.tx_request_salt,\n }\n }\n\n /// Designates this contract as the fee payer for the transaction.\n ///\n /// Unlike Ethereum, where the transaction sender always pays fees, Aztec allows any contract to voluntarily pay\n /// transaction fees. This enables patterns like sponsored transactions or fee abstraction where users don't need\n /// to hold fee-juice themselves. (Fee juice is a fee-paying asset for Aztec).\n ///\n /// Only one contract per transaction can declare itself as the fee payer, and it must have sufficient fee-juice\n /// balance (>= the gas limits specified in the TxContext) by the time we reach the public setup phase of the tx.\n ///\n /// The fee payer must be elected during the setup (non-revertible) phase, i.e. before\n /// [`end_setup`](PrivateContext::end_setup) is called - this function asserts so. This is because any compensation\n /// collected by the fee payer during the revertible phase can be discarded if a public call later reverts, while\n /// the protocol still debits the fee payer's fee-juice balance. Note that `end_setup` does not need to be called\n /// by the electing function itself: it can be called later in the transaction (e.g. by the fee-juice contract when\n /// claiming fee juice that pays for the very same transaction).\n pub fn set_as_fee_payer(&mut self) {\n assert(!self.in_revertible_phase(), \"fee payer must be elected during the setup phase\");\n aztecnr_trace_log_format!(\"Setting {0} as fee payer\")([self.this_address().to_field()]);\n self.is_fee_payer = true;\n }\n\n /// Returns whether execution is currently in the revertible (app) phase of the transaction.\n ///\n /// A transaction is in the revertible phase if [`end_setup`](PrivateContext::end_setup) has already been called -\n /// potentially by a different function of the same transaction.\n pub fn in_revertible_phase(&mut self) -> bool {\n let current_counter = self.side_effect_counter;\n\n // Safety: Kernel will validate that the claim is correct by validating the expected counters.\n let is_revertible = unsafe { is_execution_in_revertible_phase(current_counter) };\n\n if is_revertible {\n if (self.expected_revertible_side_effect_counter == 0)\n | (current_counter < self.expected_revertible_side_effect_counter) {\n self.expected_revertible_side_effect_counter = current_counter;\n }\n } else if current_counter > self.expected_non_revertible_side_effect_counter {\n self.expected_non_revertible_side_effect_counter = current_counter;\n }\n\n is_revertible\n }\n\n /// Declares the end of the \"setup phase\" of this tx.\n ///\n /// Only one function per tx can declare the end of the setup phase.\n ///\n /// Niche function: Only wallet developers and paymaster contract developers (aka Fee-payment contracts) will need\n /// to make use of this function.\n ///\n /// Aztec supports a three-phase execution model: setup, app logic, teardown. The phases exist to enable a fee\n /// payer to take on the risk of paying a transaction fee, safe in the knowledge that their payment (in whatever\n /// token or method the user chooses) will succeed, regardless of whether the app logic will succeed. The \"setup\"\n /// phase enables such a payment to be made, because the setup phase _cannot revert_: a reverting function within\n /// the setup phase would result in an invalid block which cannot be proven. Any side-effects generated during that\n /// phase are guaranteed to be inserted into Aztec's state trees (except for squashed notes & nullifiers, of\n /// course).\n ///\n /// Even though the end of the setup phase is declared within a private function, you might have noticed that\n /// _public_ functions can also execute within the setup phase. This is because any public function calls which\n /// were enqueued _within the setup phase_ by a private function are considered part of the setup phase.\n ///\n /// # Advanced\n /// * Sets the minimum revertible side effect counter of this tx to be the PrivateContext's _current_ side effect\n /// counter.\n ///\n pub fn end_setup(&mut self) {\n // We bump the counter twice: once so that `min_revertible_side_effect_counter` sits strictly above any\n // non-revertible side effect counter (including queries made via `in_revertible_phase` before this call), and\n // once more so that the next revertible side effect counter is strictly greater than\n // `min_revertible_side_effect_counter`. This ensures `min_revertible_side_effect_counter` occupies a gap that\n // no side effect takes, which the kernel relies on when validating the phase split.\n self.side_effect_counter += 1;\n self.min_revertible_side_effect_counter = self.side_effect_counter;\n self.side_effect_counter += 1;\n\n aztecnr_trace_log_format!(\n \"Ending setup, minimum revertible side effect counter is {0}\",\n )(\n [self.min_revertible_side_effect_counter as Field],\n );\n notify_revertible_phase_start(self.min_revertible_side_effect_counter);\n }\n\n /// Sets a deadline (an \"include-by timestamp\") for when this transaction must be included in a block.\n ///\n /// Other functions in this tx might call this setter with differing values for the include-by timestamp. To ensure\n /// that all functions' deadlines are met, the _minimum_ of all these include-by timestamps will be exposed when\n /// this tx is submitted to the network.\n ///\n /// If the transaction is not included in a block by its include-by timestamp, it becomes invalid and it will never\n /// be included.\n ///\n /// This expiry timestamp is publicly visible. See the \"Advanced\" section for privacy concerns.\n ///\n /// # Arguments\n /// * `expiration_timestamp` - Unix timestamp (seconds) deadline for inclusion. The include-by timestamp of this tx\n /// will be _at most_ the timestamp specified.\n ///\n /// # Advanced\n /// * If multiple functions set differing `expiration_timestamp`s, the kernel circuits will set it to be the\n /// _minimum_ of the two. This ensures the tx expiry requirements of all functions in the tx are met.\n /// * Rollup circuits will reject expired txs.\n /// * The protocol enforces that all transactions must be included within 24 hours of their chosen anchor block's\n /// timestamp, to enable safe mempool pruning.\n /// * The DelayedPublicMutable design makes heavy use of this functionality, to enable private functions to read\n /// public state.\n /// * A sophisticated Wallet should cleverly set an include-by timestamp to improve the privacy of the user and the\n /// network as a whole. For example, if a contract interaction sets include-by to some publicly-known value (e.g.\n /// the time when a contract upgrades), then the wallet might wish to set an even lower one to avoid revealing that\n /// this tx is interacting with said contract. Ideally, all wallets should standardize on an approach in order to\n /// provide users with a large privacy set -- although the exact approach\n /// will need to be discussed. Wallets that deviate from a standard might accidentally reveal which wallet each\n /// transaction originates from.\n ///\n // docs:start:expiration-timestamp\n pub fn set_expiration_timestamp(&mut self, expiration_timestamp: u64) {\n // docs:end:expiration-timestamp\n self.expiration_timestamp = std::cmp::min(self.expiration_timestamp, expiration_timestamp);\n }\n\n /// Asserts that a note has been created.\n ///\n /// This function will cause the transaction to fail unless the requested note exists. This is the preferred\n /// mechanism for performing this check, and the only one that works for pending notes.\n ///\n /// ## Pending Notes\n ///\n /// Both settled notes (created in prior transactions) and pending notes (created in the current transaction) will\n /// be considered by this function. Pending notes must have been created **before** this call is made for the check\n /// to pass.\n ///\n /// ## Historical Notes\n ///\n /// If you need to assert that a note existed _by some specific block in the past_, instead of simply proving that\n /// it exists by the current anchor block, use [`crate::history::note::assert_note_existed_by`] instead.\n ///\n /// ## Cost\n ///\n /// This uses up one of the call's kernel note hash read requests, which are limited. Like all kernel requests,\n /// proving time costs are only incurred when the total number of requests exceeds the kernel's capacity, requiring\n /// an additional invocation of the kernel reset circuit.\n pub fn assert_note_exists(&mut self, note_existence_request: NoteExistenceRequest) {\n // Note that the `note_hash_read_requests` array does not hold `NoteExistenceRequest` objects, but rather a\n // custom kernel type. We convert from the aztec-nr type into it.\n\n let note_hash = note_existence_request.note_hash();\n let contract_address = note_existence_request.maybe_contract_address().unwrap_or(AztecAddress::zero());\n\n let side_effect = Scoped::new(\n Counted::new(note_hash, self.next_counter()),\n contract_address,\n );\n\n self.note_hash_read_requests.push(side_effect);\n }\n\n /// Asserts that a nullifier has been emitted.\n ///\n /// This function will cause the transaction to fail unless the requested nullifier exists. This is the preferred\n /// mechanism for performing this check, and the only one that works for pending nullifiers.\n ///\n /// ## Pending Nullifiers\n ///\n /// Both settled nullifiers (emitted in prior transactions) and pending nullifiers (emitted in the current\n /// transaction) will be considered by this function. Pending nullifiers must have been emitted **before** this\n /// call is made for the check to pass.\n ///\n /// ## Historical Nullifiers\n ///\n /// If you need to assert that a nullifier existed _by some specific block in the past_, instead of simply proving\n /// that it exists by the current anchor block, use [`crate::history::nullifier::assert_nullifier_existed_by`]\n /// instead.\n ///\n /// ## Public vs Private\n ///\n /// In general, it is unsafe to check for nullifier non-existence in private, as that will not consider the\n /// possibility of the nullifier having been emitted in any transaction between the anchor block and the inclusion\n /// block. Private functions instead prove existence via this function and 'prove' non-existence by _emitting_ the\n /// nullifer, which would cause the transaction to fail if the nullifier existed.\n ///\n /// This is not the case in public functions, which do have access to the tip of the blockchain and so can reliably\n /// prove whether a nullifier exists or not via\n /// [`crate::context::public_context::PublicContext::nullifier_exists_unsafe`].\n ///\n /// ## Cost\n ///\n /// This uses up one of the call's kernel nullifier read requests, which are limited. Like all kernel requests,\n /// proving time costs are only incurred when the total number of requests exceeds the kernel's capacity, requiring\n /// an additional invocation of the kernel reset circuit.\n pub fn assert_nullifier_exists(&mut self, nullifier_existence_request: NullifierExistenceRequest) {\n let nullifier = nullifier_existence_request.nullifier();\n let contract_address = nullifier_existence_request.maybe_contract_address().unwrap_or(AztecAddress::zero());\n\n let request = Scoped::new(\n Counted::new(nullifier, self.next_counter()),\n contract_address,\n );\n\n self.nullifier_read_requests.push(request);\n }\n\n /// Requests the app-siloed nullifier hiding key (nhk_app) for the given (hashed) master nullifier public key\n /// (npk_m), from the user's PXE.\n ///\n /// Advanced function: Only needed if you're designing your own notes and/or nullifiers.\n ///\n /// Contracts are not allowed to compute nullifiers for other contracts, as that would let them read parts of their\n /// private state. Because of this, a contract is only given an \"app-siloed key\", which is constructed by\n /// hashing the user's master nullifier hiding key with the contract's address. However, because contracts cannot\n /// be trusted with a user's master nullifier hiding key (because we don't know which contracts are honest or\n /// malicious), the PXE refuses to provide any master secret keys to any app smart contract function. This means\n /// app functions are unable to prove that the derivation of an app-siloed nullifier hiding key has been computed\n /// correctly. Instead, an app function can request to the kernel (via `request_nhk_app`) that it validates the\n /// siloed derivation, since the kernel has been vetted to not leak any master secret keys.\n ///\n /// A common nullification scheme is to inject a nullifier hiding key into the preimage of a nullifier, to make the\n /// nullifier deterministic but random-looking. This function enables that flow.\n ///\n /// # Arguments\n /// * `npk_m_hash` - A hash of the master nullifier public key of the user whose PXE is executing this function.\n ///\n /// # Returns\n /// * The app-siloed nullifier hiding key that corresponds to the given `npk_m_hash`.\n ///\n pub fn request_nhk_app(&mut self, npk_m_hash: Field) -> Field {\n self.request_sk_app(npk_m_hash, NULLIFIER_INDEX)\n }\n\n /// Requests the app-siloed outgoing viewing secret key (ovsk_app) for the given (hashed) master outgoing\n /// viewing public key (ovpk_m), from the user's PXE.\n ///\n /// See `request_nhk_app` and `request_sk_app` for more info.\n ///\n /// The intention of the \"outgoing\" keypair is to provide a second secret key for all of a user's outgoing activity\n /// (i.e. for notes that a user creates, as opposed to notes that a user receives from others). The separation of\n /// incoming and outgoing data was a distinction made by zcash, with the intention of enabling a user to optionally\n /// share with a 3rd party a controlled view of only incoming or outgoing notes. Similar functionality of sharing\n /// select data can be achieved with offchain zero-knowledge proofs. It is up to an app developer whether they\n /// choose to make use of a user's outgoing keypair within their application logic, or instead simply use the same\n /// keypair (the address keypair (which is effectively the same as the \"incoming\" keypair)) for all incoming &\n /// outgoing messages to a user.\n ///\n /// Currently, all of the exposed encryption functions in aztec-nr ignore the outgoing viewing keys, and instead\n /// encrypt all note logs and event logs to a user's address public key.\n ///\n /// # Arguments\n /// * `ovpk_m_hash` - Hash of the outgoing viewing public key master\n ///\n /// # Returns\n /// * The application-specific outgoing viewing secret key\n ///\n pub fn request_ovsk_app(&mut self, ovpk_m_hash: Field) -> Field {\n self.request_sk_app(ovpk_m_hash, OUTGOING_INDEX)\n }\n\n /// Pushes a Key Validation Request to the kernel.\n ///\n /// Private functions are not allowed to see a user's master secret keys, because we do not trust them. They are\n /// instead given \"app-siloed\" secret keys with a claim that they relate to a master public key. They can then\n /// request validation of this claim, by making a \"key validation request\" to the protocol's kernel circuits (which\n /// _are_ allowed to see certain master secret keys).\n ///\n /// The app circuit only sees `pk_m_hash` (not the raw point). The kernel derives the\n /// point from `sk_m`, hashes it, and asserts equality. When a Key Validation Request tuple of\n /// (sk_app, pk_m_hash, app_address) is submitted to the kernel, it performs the following\n /// derivations to validate the relationship between the claimed sk_app and the user's pk_m_hash:\n ///\n /// (sk_m) ----> * G ----> pk_m ----> hash_public_key(pk_m)\n /// | |\n /// v | We use the kernel to prove this\n /// h(sk_m, app_address) | sk_app-pk_m_hash relationship, because app\n /// | | circuits must not be trusted to see sk_m.\n /// v |\n /// sk_app - - - - - - - - - - - - - - - - - -\n ///\n /// The function is named \"request_\" instead of \"get_\" to remind the user that a Key Validation Request will be\n /// emitted to the kernel.\n ///\n fn request_sk_app(&mut self, pk_m_hash: Field, key_index: Field) -> Field {\n // Match against the cache only when a request is actually present in the slot.\n let cached_slot = self.last_key_validation_requests[key_index as u32];\n let cache_hit = cached_slot.is_some() & (cached_slot.unwrap_unchecked().pk_m_hash == pk_m_hash);\n\n if cache_hit {\n // We get a match so the cached request is the latest one\n cached_slot.unwrap_unchecked().sk_app\n } else {\n // We didn't get a match meaning the cached result is stale. Typically we'd validate keys by showing that\n // the master secret key derives to a public key matching `pk_m_hash`, but that'd require the oracle\n // returning the master secret keys, which could cause malicious contracts to leak it or learn about\n // secrets from other contracts. We therefore silo secret keys, and rely on the private kernel to validate\n // that the siloed secret key corresponds to correct siloing of the master secret key that hashes to\n // `pk_m_hash`.\n\n // Safety: Kernels verify that the key validation request is valid and below we verify that a request for\n // the correct public key has been received.\n let request = unsafe { get_key_validation_request(pk_m_hash, key_index) };\n assert_eq(request.pk_m_hash, pk_m_hash, \"Obtained key validation request for wrong pk_m_hash\");\n\n self.key_validation_requests_and_separators.push(\n KeyValidationRequestAndSeparator {\n request,\n key_type_domain_separator: public_key_domain_separators[key_index as u32],\n },\n );\n self.last_key_validation_requests[key_index as u32] = Option::some(request);\n request.sk_app\n }\n }\n\n /// Sends an \"L2 -> L1 message\" from this function (Aztec, L2) to a smart contract on Ethereum (L1). L1 contracts\n /// which are designed to send/receive messages to/from Aztec are called \"Portal Contracts\".\n ///\n /// Common use cases include withdrawals, cross-chain asset transfers, and triggering L1 actions based on L2 state\n /// changes.\n ///\n /// The message will be inserted into an Aztec \"Outbox\" contract on L1, when this transaction's block is proposed\n /// to L1. Sending the message will not result in any immediate state changes in the target portal contract. The\n /// message will need to be manually consumed from the Outbox through a separate Ethereum transaction: a user will\n /// need to call a function of the portal contract -- a function specifically designed to make a call to the Outbox\n /// to consume the message. The message will only be available for consumption once the _epoch_ proof has been\n /// submitted. Given that there are multiple Aztec blocks within an epoch, it might take some time for this epoch\n /// proof to be submitted -- especially if the block was near the start of an epoch.\n ///\n /// # Arguments\n /// * `recipient` - Ethereum address that will receive the message\n /// * `content` - Message content (32 bytes as a Field element). This content has a very\n /// specific layout. docs:start:context_message_portal\n pub fn message_portal(&mut self, recipient: EthAddress, content: Field) {\n let message = L2ToL1Message { recipient, content };\n self.l2_to_l1_msgs.push(message.count(self.next_counter()));\n }\n\n /// Consumes a message sent from Ethereum (L1) to Aztec (L2).\n ///\n /// Common use cases include token bridging, cross-chain governance, and triggering L2 actions based on L1 events.\n ///\n /// Use this function if you only want the message to ever be \"referred to\" once. Once consumed using this method,\n /// the message cannot be consumed again, because a nullifier is emitted. If your use case wants for the message to\n /// be read unlimited times, then you can always read any historic message from the L1-to-L2 messages tree;\n /// messages never technically get deleted from that tree.\n ///\n /// The message will first be inserted into an Aztec \"Inbox\" smart contract on L1. Sending the message will not\n /// result in any immediate state changes in the target L2 contract. The message will need to be manually consumed\n /// by the target contract through a separate Aztec transaction. The message will not be available for consumption\n /// immediately. Messages get copied over from the L1 Inbox to L2 by the next Proposer in batches. So you will need\n /// to wait until the messages are copied before you can consume them.\n ///\n /// # Arguments\n /// * `content` - The message content that was sent from L1\n /// * `secret` - Secret fields used for message privacy (if needed)\n /// * `sender` - Ethereum address that sent the message\n /// * `leaf_index` - Index of the message in the L1-to-L2 message tree\n ///\n /// # Advanced\n /// Validates message existence in the L1-to-L2 message tree and nullifies the message to prevent\n /// double-consumption.\n pub fn consume_l1_to_l2_message<let N: u32>(\n &mut self,\n content: Field,\n secret: [Field; N],\n sender: EthAddress,\n leaf_index: Field,\n ) {\n let nullifier = process_l1_to_l2_message(\n self.anchor_block_header.state.l1_to_l2_message_tree.root,\n self.this_address(),\n sender,\n self.chain_id(),\n self.version(),\n content,\n secret,\n leaf_index,\n );\n\n // Push nullifier (and the \"commitment\" corresponding to this can be \"empty\")\n self.push_nullifier_unsafe(nullifier)\n }\n\n /// Emits a private log (an array of Fields) that will be published to an Ethereum blob.\n ///\n /// Private logs are intended for the broadcasting of ciphertexts: that is, encrypted events or encrypted note\n /// contents. Since the data in the logs is meant to be _encrypted_, private_logs are broadcast to publicly-visible\n /// Ethereum blobs. The intended recipients of such encrypted messages can then discover and decrypt these\n /// encrypted logs using their viewing secret key. (See `../messages/discovery` for more details).\n ///\n /// Important note: This function DOES NOT _do_ any encryption of the input `log` fields. This function blindly\n /// publishes whatever input `log` data is fed into it, so the caller of this function should have already\n /// performed the encryption, and the `log` should be the result of that encryption.\n ///\n /// The protocol does not dictate what encryption scheme should be used: a smart contract developer can choose\n /// whatever encryption scheme they like. Aztec-nr includes some off-the-shelf encryption libraries that developers\n /// might wish to use, for convenience. These libraries not only encrypt a plaintext (to produce a ciphertext);\n /// they also prepend the ciphertext with a `tag` and `ephemeral public key` for easier message discovery. This is\n /// a very dense topic, and we will be writing more libraries and docs soon.\n ///\n /// > Currently, AES128 CBC encryption is the main scheme included in > aztec.nr. > We are currently making\n /// significant changes to the interfaces of the > encryption library.\n ///\n /// In some niche use cases, an app might be tempted to publish _un-encrypted_ data via a private log, because\n /// _public logs_ are not available to private functions. Be warned that emitting public data via private logs is\n /// strongly discouraged, and is considered a \"privacy anti-pattern\", because it reveals identifiable information\n /// about _which_ function has been executed. A tx which leaks such information does not contribute to the privacy\n /// set of the network.\n ///\n /// * Unlike `emit_raw_note_log_unsafe`, this log is not tied to any specific note\n ///\n /// # Arguments\n /// * `tag` - A tag placed at `fields[0]` of the emitted log. Used by recipients and nodes to identify and\n /// filter for relevant logs without scanning all of them.\n /// * `log` - The log data that will be publicly broadcast (so make sure it's already been encrypted before you\n /// call this function). Private logs are bounded in size (`PRIVATE_LOG_CIPHERTEXT_LEN`), to encourage all logs\n /// from all smart contracts look identical. The protocol's kernel circuits can then append random fields as\n /// \"padding\" after the log's length, so that the logs of this smart contract look indistinguishable from (the\n /// same length as) the logs of all other applications. It's up to wallets how much padding to apply, so\n /// ideally all wallets should agree on standards for this.\n ///\n /// ## Safety\n ///\n /// The `tag` should be domain-separated (e.g. via [`crate::protocol::hash::compute_log_tag`]) to prevent\n /// collisions between logs from different sources. Without domain separation, two unrelated log types that\n /// happen to share a raw tag value become indistinguishable. Prefer the higher-level APIs\n /// ([`crate::messages::delivery::MessageDelivery`] for messages, `self.emit(event)` for events) which\n /// handle tagging automatically.\n pub fn emit_private_log_unsafe(&mut self, tag: Field, log: BoundedVec<Field, PRIVATE_LOG_CIPHERTEXT_LEN>) {\n self.emit_raw_note_log_unsafe(tag, log, 0);\n }\n\n /// Emits a private log that is explicitly tied to a newly-emitted note_hash, to convey to the kernel: \"this log\n /// relates to this note\".\n ///\n /// This linkage is important in case the note gets squashed (due to being read later in this same tx), since we\n /// can then squash the log as well.\n ///\n /// See [`emit_private_log_unsafe`](PrivateContext::emit_private_log_unsafe) for more info about private log\n /// emission.\n ///\n /// # Arguments\n /// * `tag` - A tag placed at `fields[0]`. See\n /// [`emit_private_log_unsafe`](PrivateContext::emit_private_log_unsafe).\n /// * `log` - The log data as a `BoundedVec` of Field elements.\n /// * `note_hash_counter` - The side-effect counter that was assigned to the new note_hash when it was pushed to\n /// this `PrivateContext`.\n ///\n /// Important: If your application logic requires the log to always be emitted regardless of note squashing,\n /// consider using [`emit_private_log_unsafe`](PrivateContext::emit_private_log_unsafe) instead, or emitting\n /// additional events.\n ///\n /// ## Safety\n ///\n /// Same as [`PrivateContext::emit_private_log_unsafe`]: the `tag` should be domain-separated.\n pub fn emit_raw_note_log_unsafe(\n &mut self,\n tag: Field,\n log: BoundedVec<Field, PRIVATE_LOG_CIPHERTEXT_LEN>,\n note_hash_counter: u32,\n ) {\n let counter = self.next_counter();\n let full_log = [tag].concat(log.storage());\n let private_log = PrivateLogData { log: PrivateLog::new(full_log, log.len() + 1), note_hash_counter };\n self.private_logs.push(private_log.count(counter));\n }\n\n /// Emits large data blobs.\n ///\n /// This reuses the Contract Class Log channel to emit blobs of up to [`CONTRACT_CLASS_LOG_SIZE_IN_FIELDS`].\n ///\n /// ## Privacy\n ///\n /// The address of the contract emitting these blobs is revelead.\n pub fn emit_contract_class_log<let N: u32>(&mut self, log: [Field; N]) {\n let contract_address = self.this_address();\n let counter = self.next_counter();\n\n let log_to_emit: [Field; CONTRACT_CLASS_LOG_SIZE_IN_FIELDS] =\n log.concat([0; CONTRACT_CLASS_LOG_SIZE_IN_FIELDS - N]);\n // Note: the length is not always N, it is the number of fields we want to broadcast, omitting trailing zeros\n // to save blob space.\n // Safety: The below length is constrained in the base rollup, which will make sure that all the fields beyond\n // length are zero. However, it won't be able to check that we didn't add extra padding (trailing zeroes) or\n // that we cut trailing zeroes from the end.\n let length = unsafe { trimmed_array_length_hint(log) };\n // We hash the entire padded log to ensure a user cannot pass a shorter length and so emit incorrect shorter\n // bytecode.\n let log_hash = compute_contract_class_log_hash(log_to_emit);\n // Safety: the below only exists to broadcast the raw log, so we can provide it to the base rollup later to be\n // constrained.\n unsafe {\n notify_created_contract_class_log(contract_address, log_to_emit, length, counter);\n }\n\n self.contract_class_logs_hashes.push(LogHash { value: log_hash, length: length }.count(counter));\n }\n\n /// Calls a private function on another contract (or the same contract).\n ///\n /// Very low-level function.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract containing the function\n /// * `function_selector` - 4-byte identifier of the function to call\n /// * `args` - Array of arguments to pass to the called function\n ///\n /// # Returns\n /// * `ReturnsHash` - Hash of the called function's return values. Use `.get_preimage()` to extract the actual\n /// return values.\n ///\n /// This enables contracts to interact with each other while maintaining privacy. This \"composability\" of private\n /// contract functions is a key feature of the Aztec network.\n ///\n /// If a user's transaction includes multiple private function calls, then by the design of Aztec, the following\n /// information will remain private[1]:\n /// - The function selectors and contract addresses of all private function calls will remain private, so an\n /// observer of the public mempool will not be able to look at a tx and deduce which private functions have been\n /// executed.\n /// - The arguments and return values of all private function calls will remain private.\n /// - The person who initiated the tx will remain private.\n /// - The notes and nullifiers and private logs that are emitted by all private function calls will (if designed\n /// well) not leak any user secrets, nor leak which functions have been executed.\n ///\n /// [1] Caveats: Some of these privacy guarantees depend on how app developers design their smart contracts. Some\n /// actions _can_ leak information, such as:\n /// - Calling an internal public function.\n /// - Calling a public function and not setting msg_sender to Option::none (feature not built yet - see github).\n /// - Calling any public function will always leak details about the nature of the transaction, so devs should be\n /// careful in their contract designs. If it can be done in a private function, then that will give the best\n /// privacy.\n /// - Not padding the side-effects of a tx to some standardized, uniform size. The kernel circuits can take hints\n /// to pad side-effects, so a wallet should be able to request for a particular amount of padding. Wallets should\n /// ideally agree on some standard.\n /// - Padding should include:\n /// - Padding the lengths of note & nullifier arrays\n /// - Padding private logs with random fields, up to some standardized size. See also:\n /// https://docs.aztec.network/developers/resources/considerations/privacy_considerations\n ///\n /// # Advanced\n /// * The call is added to the private call stack and executed by kernel circuits after this function completes\n /// * The called function can modify its own contract's private state\n /// * Side effects from the called function are included in this transaction\n /// * The call inherits the current transaction's context and gas limits\n ///\n pub fn call_private_function<let ArgsCount: u32>(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ArgsCount],\n ) -> ReturnsHash {\n let args_hash = hash_args(args);\n execution_cache::store(args, args_hash);\n self.call_private_function_with_args_hash(contract_address, function_selector, args_hash, false)\n }\n\n /// Makes a read-only call to a private function on another contract.\n ///\n /// This is similar to Solidity's `staticcall`. The called function cannot modify state, emit L2->L2 messages, nor\n /// emit events. Any nested calls are constrained to also be staticcalls.\n ///\n /// See `call_private_function` for more general info on private function calls.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract to call\n /// * `function_selector` - 4-byte identifier of the function to call\n /// * `args` - Array of arguments to pass to the called function\n ///\n /// # Returns\n /// * `ReturnsHash` - Hash of the called function's return values. Use `.get_preimage()` to extract the actual\n /// return values.\n ///\n pub fn static_call_private_function<let ArgsCount: u32>(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ArgsCount],\n ) -> ReturnsHash {\n let args_hash = hash_args(args);\n execution_cache::store(args, args_hash);\n self.call_private_function_with_args_hash(contract_address, function_selector, args_hash, true)\n }\n\n /// Calls a private function that takes no arguments.\n ///\n /// This is a convenience function for calling private functions that don't require any input parameters. It's\n /// equivalent to `call_private_function` but slightly more efficient to use when no arguments are needed.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract containing the function\n /// * `function_selector` - 4-byte identifier of the function to call\n ///\n /// # Returns\n /// * `ReturnsHash` - Hash of the called function's return values. Use `.get_preimage()` to extract the actual\n /// return values.\n ///\n pub fn call_private_function_no_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n ) -> ReturnsHash {\n self.call_private_function_with_args_hash(contract_address, function_selector, 0, false)\n }\n\n /// Makes a read-only call to a private function which takes no arguments.\n ///\n /// This combines the optimisation of `call_private_function_no_args` with the safety of\n /// `static_call_private_function`.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract containing the function\n /// * `function_selector` - 4-byte identifier of the function to call\n ///\n /// # Returns\n /// * `ReturnsHash` - Hash of the called function's return values. Use `.get_preimage()` to extract the actual\n /// return values.\n ///\n pub fn static_call_private_function_no_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n ) -> ReturnsHash {\n self.call_private_function_with_args_hash(contract_address, function_selector, 0, true)\n }\n\n /// Low-level private function call.\n ///\n /// This is the underlying implementation used by all other private function call methods. Instead of taking raw\n /// arguments, it accepts a hash of the arguments.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract containing the function\n /// * `function_selector` - 4-byte identifier of the function to call\n /// * `args_hash` - Pre-computed hash of the function arguments\n /// * `is_static_call` - Whether this should be a read-only call\n ///\n /// # Returns\n /// * `ReturnsHash` - Hash of the called function's return values\n ///\n pub fn call_private_function_with_args_hash(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args_hash: Field,\n is_static_call: bool,\n ) -> ReturnsHash {\n let is_static_call = is_static_call | self.inputs.call_context.is_static_call;\n let start_side_effect_counter = self.side_effect_counter;\n\n // Safety: The oracle simulates the private call and returns the value of the side effects counter after\n // execution of the call (which means that end_side_effect_counter - start_side_effect_counter is the number of\n // side effects that took place), along with the hash of the return values. We validate these by requesting a\n // private kernel iteration in which the return values are constrained to hash to `returns_hash` and the side\n // effects counter to increment from start to end.\n let (end_side_effect_counter, returns_hash) = unsafe {\n call_private_function_internal(\n contract_address,\n function_selector,\n args_hash,\n start_side_effect_counter,\n is_static_call,\n )\n };\n\n self.private_call_requests.push(\n PrivateCallRequest {\n call_context: CallContext {\n msg_sender: self.this_address(),\n contract_address,\n function_selector,\n is_static_call,\n },\n args_hash,\n returns_hash,\n start_side_effect_counter,\n end_side_effect_counter,\n },\n );\n\n // The kernel circuits ensure that end_side_effect_counter is greater than start_side_effect_counter, and that\n // all side effects emitted in the child call have counters within the range [start_side_effect_counter,\n // end_side_effect_counter]. Therefore, we only need to ensure that the next side effect from the current call\n // starts after the end side effect from the child call.\n self.side_effect_counter = end_side_effect_counter + 1;\n\n ReturnsHash::new(returns_hash)\n }\n\n /// Enqueues a call to a public function to be executed later.\n ///\n /// Unlike private functions which execute immediately on the user's device, public function calls are \"enqueued\"\n /// and executed some time later by a block proposer.\n ///\n /// This means a public function cannot return any values back to a private function, because by the time the\n /// public function is being executed, the private function which called it has already completed execution. (In\n /// fact, the private function has been executed and proven, along with all other private function calls of the\n /// user's tx. A single proof of the tx has been submitted to the Aztec network, and some time later a proposer has\n /// picked the tx up from the mempool and begun executing all of the enqueued public functions).\n ///\n /// # Privacy warning Enqueueing a public function call is an inherently leaky action. Many interesting applications\n /// will require some interaction with public state, but smart contract developers should try to use public function\n /// calls sparingly, and carefully. _Internal_ public function calls are especially leaky, because they completely\n /// leak which private contract made the call. See also:\n /// https://docs.aztec.network/developers/resources/considerations/privacy_considerations\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract containing the function\n /// * `function_selector` - 4-byte identifier of the function to call\n /// * `args` - Array of arguments to pass to the public function\n /// * `hide_msg_sender` - the called function will see a \"null\" value for `msg_sender` if set to `true`\n ///\n pub fn call_public_function<let ArgsCount: u32>(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ArgsCount],\n hide_msg_sender: bool,\n ) {\n let calldata = [function_selector.to_field()].concat(args);\n let calldata_hash = hash_calldata_array(calldata);\n execution_cache::store(calldata, calldata_hash);\n self.call_public_function_with_calldata_hash(contract_address, calldata_hash, false, hide_msg_sender)\n }\n\n /// Enqueues a read-only call to a public function.\n ///\n /// This is similar to Solidity's `staticcall`. The called function cannot modify state or emit events. Any nested\n /// calls are constrained to also be staticcalls.\n ///\n /// See also `call_public_function` for more important information about making private -> public function calls.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract containing the function\n /// * `function_selector` - 4-byte identifier of the function to call\n /// * `args` - Array of arguments to pass to the public function\n /// * `hide_msg_sender` - the called function will see a \"null\" value for `msg_sender` if set to `true`\n ///\n pub fn static_call_public_function<let ArgsCount: u32>(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ArgsCount],\n hide_msg_sender: bool,\n ) {\n let calldata = [function_selector.to_field()].concat(args);\n let calldata_hash = hash_calldata_array(calldata);\n execution_cache::store(calldata, calldata_hash);\n self.call_public_function_with_calldata_hash(contract_address, calldata_hash, true, hide_msg_sender)\n }\n\n /// Enqueues a call to a public function that takes no arguments.\n ///\n /// This is an optimisation for calling public functions that don't take any input parameters. It's otherwise\n /// equivalent to `call_public_function`.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract containing the function\n /// * `function_selector` - 4-byte identifier of the function to call\n /// * `hide_msg_sender` - the called function will see a \"null\" value for `msg_sender` if set to `true`\n ///\n pub fn call_public_function_no_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n hide_msg_sender: bool,\n ) {\n let calldata_hash = hash_calldata_array([function_selector.to_field()]);\n self.call_public_function_with_calldata_hash(contract_address, calldata_hash, false, hide_msg_sender)\n }\n\n /// Enqueues a read-only call to a public function with no arguments.\n ///\n /// This combines the optimisation of `call_public_function_no_args` with the safety of\n /// `static_call_public_function`.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract containing the function\n /// * `function_selector` - 4-byte identifier of the function to call\n /// * `hide_msg_sender` - the called function will see a \"null\" value for `msg_sender` if set to `true`\n ///\n pub fn static_call_public_function_no_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n hide_msg_sender: bool,\n ) {\n let calldata_hash = hash_calldata_array([function_selector.to_field()]);\n self.call_public_function_with_calldata_hash(contract_address, calldata_hash, true, hide_msg_sender)\n }\n\n /// Low-level public function call.\n ///\n /// This is the underlying implementation used by all other public function call methods. Instead of taking raw\n /// arguments, it accepts a hash of the arguments.\n ///\n /// Advanced function: Most developers should use `call_public_function` or `static_call_public_function` instead.\n /// This function is exposed for performance optimization and advanced use cases.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract containing the function\n /// * `calldata_hash` - Hash of the function calldata\n /// * `is_static_call` - Whether this should be a read-only call\n /// * `hide_msg_sender` - the called function will see a \"null\" value for `msg_sender` if set to `true`\n ///\n pub fn call_public_function_with_calldata_hash(\n &mut self,\n contract_address: AztecAddress,\n calldata_hash: Field,\n is_static_call: bool,\n hide_msg_sender: bool,\n ) {\n let counter = self.next_counter();\n\n let is_static_call = is_static_call | self.inputs.call_context.is_static_call;\n\n assert_valid_public_call_data(calldata_hash);\n\n let msg_sender = if hide_msg_sender {\n NULL_MSG_SENDER_CONTRACT_ADDRESS\n } else {\n self.this_address()\n };\n\n let call_request = PublicCallRequest { msg_sender, contract_address, is_static_call, calldata_hash };\n\n self.public_call_requests.push(Counted::new(call_request, counter));\n }\n\n /// Enqueues a public function call, and designates it to be the teardown function for this tx. Only one teardown\n /// function call can be made by a tx.\n ///\n /// Niche function: Only wallet developers and paymaster contract developers (aka Fee-payment contracts) will need\n /// to make use of this function.\n ///\n /// Aztec supports a three-phase execution model: setup, app logic, teardown. The phases exist to enable a fee\n /// payer to take on the risk of paying a transaction fee, safe in the knowledge that their payment (in whatever\n /// token or method the user chooses) will succeed, regardless of whether the app logic will succeed. The \"setup\"\n /// phase ensures the fee payer has sufficient balance to pay the proposer their fees. The teardown phase is\n /// primarily intended to: calculate exactly how much the user owes, based on gas consumption, and refund the user\n /// any change.\n ///\n /// Note: in some cases, the cost of refunding the user (i.e. DA costs of tx side-effects) might exceed the refund\n /// amount. For app logic with fairly stable and predictable gas consumption, a material refund amount is unlikely.\n /// For app logic with unpredictable gas consumption, a refund might be important to the user (e.g. if a hefty\n /// function reverts very early). Wallet/FPC/Paymaster developers should be mindful of this.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract containing the teardown function\n /// * `function_selector` - 4-byte identifier of the function to call\n /// * `args` - An array of fields to pass to the function.\n /// * `hide_msg_sender` - the called function will see a \"null\" value for `msg_sender` if set to `true`\n pub fn set_public_teardown_function<let ArgsCount: u32>(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ArgsCount],\n hide_msg_sender: bool,\n ) {\n let calldata = [function_selector.to_field()].concat(args);\n let calldata_hash = hash_calldata_array(calldata);\n execution_cache::store(calldata, calldata_hash);\n self.set_public_teardown_function_with_calldata_hash(contract_address, calldata_hash, false, hide_msg_sender)\n }\n\n /// Low-level function to set the public teardown function.\n ///\n /// This is the underlying implementation for setting the teardown function call that will execute at the end of\n /// the transaction. Instead of taking raw arguments, it accepts a hash of the arguments.\n ///\n /// Advanced function: Most developers should use `set_public_teardown_function` instead.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract containing the teardown function\n /// * `calldata_hash` - Hash of the function calldata\n /// * `is_static_call` - Whether this should be a read-only call\n /// * `hide_msg_sender` - the called function will see a \"null\" value for `msg_sender` if set to `true`\n ///\n pub fn set_public_teardown_function_with_calldata_hash(\n &mut self,\n contract_address: AztecAddress,\n calldata_hash: Field,\n is_static_call: bool,\n hide_msg_sender: bool,\n ) {\n let is_static_call = is_static_call | self.inputs.call_context.is_static_call;\n\n assert_valid_public_call_data(calldata_hash);\n\n let msg_sender = if hide_msg_sender {\n NULL_MSG_SENDER_CONTRACT_ADDRESS\n } else {\n self.this_address()\n };\n\n self.public_teardown_call_request =\n PublicCallRequest { msg_sender, contract_address, is_static_call, calldata_hash };\n }\n\n /// Increments the side-effect counter.\n ///\n /// Very low-level function.\n ///\n /// # Advanced\n ///\n /// Every side-effect of a private function is given a \"side-effect counter\", based on when it is created. This\n /// PrivateContext is in charge of assigning the counters.\n ///\n /// The reason we have side-effect counters is complicated. Consider this illustrative pseudocode of inter-contract\n /// function calls:\n /// ```\n /// contract A {\n /// let x = 5; // pseudocode for storage var x.\n /// fn a1 {\n /// read x; // value: 5, counter: 1.\n /// x = x + 1;\n /// write x; // value: 6, counter: 2.\n ///\n /// B.b(); // start_counter: 2, end_counter: 4\n ///\n /// read x; // value: 36, counter: 5.\n /// x = x + 1;\n /// write x; // value: 37, counter: 6.\n /// }\n ///\n /// fn a2 {\n /// read x; // value: 6, counter: 3.\n /// x = x * x;\n /// write x; // value: 36, counter: 4.\n /// }\n /// }\n ///\n /// contract B {\n /// fn b() {\n /// A.a2();\n /// }\n /// }\n /// ```\n ///\n /// Suppose a1 is the first function called. The comments show the execution counter of each side-effect, and what\n /// the new value of `x` is.\n ///\n /// These (private) functions are processed by Aztec's kernel circuits in an order that is different from execution\n /// order: All of A.a1 is proven before B.b is proven, before A.a2 is proven. So when we're in the 2nd execution\n /// frame of A.a1 (after the call to B.b), the circuit needs to justify why x went from being `6` to `36`. But the\n /// circuit doesn't know why, and given the order of proving, the kernel hasn't _seen_ a value of 36 get written\n /// yet. The kernel needs to track big arrays of all side-effects of all private functions in a tx. Then, as it\n /// recurses and processes B.b(), it will eventually see a value of 36 get written.\n ///\n /// Suppose side-effect counters weren't exposed: The kernel would only see this ordering (in order of proof\n /// verification): [ A.a1.read, A.a1.write, A.a1.read, A.a1.write, A.a2.read, A.a2.write ]\n /// [ 5, 6, 36, 37, 6, 36 ]\n /// The kernel wouldn't know _when_ B.b() was called within A.a1(), because it can't see what's going on within an\n /// app circuit. So the kernel wouldn't know that the ordering of reads and writes should actually be: [ A.a1.read,\n /// A.a1.write, A.a2.read, A.a2.write, A.a1.read, A.a1.write ]\n /// [ 5, 6, 6, 36, 36, 37 ]\n ///\n /// And so, we introduced side-effect counters: every private function must assign side-effect counters alongside\n /// every side-effect that it emits, and also expose to the kernel the counters that it started and ended with.\n /// This gives the kernel enough information to arrange all side-effects in the correct order. It can then catch\n /// (for example) if a function tries to read state before it has been written (e.g. if A.a2() maliciously tried to\n /// read a value of x=37) (e.g. if A.a1() maliciously tried to read x=6).\n ///\n /// If a malicious app contract _lies_ and does not count correctly:\n /// - It cannot lie about its start and end counters because the kernel will catch this.\n /// - It _could_ lie about its intermediate counters:\n /// - 1. It could not increment its side-effects correctly\n /// - 2. It could label its side-effects with counters outside of its start and end counters' range. The kernel\n /// will catch 2. The kernel will not catch 1., but this would only cause corruption to the private state of the\n /// malicious contract, and not any other contracts (because a contract can only modify its own state). If a \"good\"\n /// contract is given _read access_ to a maliciously-counting contract (via an external getter function, or by\n /// reading historic state from the archive tree directly), and they then make state changes to their _own_ state\n /// accordingly, that could be dangerous. Developers should be mindful not to trust the claimed innards of external\n /// contracts unless they have audited/vetted the contracts including vetting the side-effect counter\n /// incrementation. This is a similar paradigm to Ethereum smart contract development: you must vet external\n /// contracts that your contract relies upon, and you must not make any presumptions about their claimed behaviour.\n /// (Hopefully if a contract imports a version of aztec-nr, we will get contract verification tooling that can\n /// validate the authenticity of the imported aztec-nr package, and hence infer that the side- effect counting will\n /// be correct, without having to re-audit such logic for every contract).\n ///\n fn next_counter(&mut self) -> u32 {\n let counter = self.side_effect_counter;\n self.side_effect_counter += 1;\n counter\n }\n}\n\nimpl Empty for PrivateContext {\n fn empty() -> Self {\n PrivateContext {\n inputs: PrivateContextInputs::empty(),\n side_effect_counter: 0 as u32,\n min_revertible_side_effect_counter: 0 as u32,\n is_fee_payer: false,\n args_hash: 0,\n return_hash: 0,\n expiration_timestamp: 0,\n note_hash_read_requests: BoundedVec::new(),\n nullifier_read_requests: BoundedVec::new(),\n key_validation_requests_and_separators: BoundedVec::new(),\n note_hashes: BoundedVec::new(),\n nullifiers: BoundedVec::new(),\n private_call_requests: BoundedVec::new(),\n public_call_requests: BoundedVec::new(),\n public_teardown_call_request: PublicCallRequest::empty(),\n l2_to_l1_msgs: BoundedVec::new(),\n anchor_block_header: BlockHeader::empty(),\n private_logs: BoundedVec::new(),\n contract_class_logs_hashes: BoundedVec::new(),\n last_key_validation_requests: [Option::none(); NUM_KEY_TYPES],\n expected_non_revertible_side_effect_counter: 0,\n expected_revertible_side_effect_counter: 0,\n }\n }\n}\n"
3876
3940
  },
3877
- "71": {
3941
+ "72": {
3878
3942
  "function_locations": [
3879
3943
  {
3880
3944
  "name": "<impl From<UtilityContextData> for UtilityContext>::from",
@@ -3928,7 +3992,7 @@
3928
3992
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/context/utility_context.nr",
3929
3993
  "source": "use crate::oracle::{execution::{get_utility_context, UtilityContextData}, storage::storage_read};\nuse crate::protocol::{\n abis::block_header::BlockHeader, address::AztecAddress, constants::NULL_MSG_SENDER_CONTRACT_ADDRESS,\n traits::Packable,\n};\n\n// If you'll modify this struct don't forget to update utility_context.ts as well.\npub struct UtilityContext {\n block_header: BlockHeader,\n contract_address: AztecAddress,\n msg_sender: AztecAddress,\n}\n\nimpl From<UtilityContextData> for UtilityContext {\n fn from(data: UtilityContextData) -> Self {\n Self { block_header: data.block_header, contract_address: data.contract_address, msg_sender: data.msg_sender }\n }\n}\n\nimpl UtilityContext {\n pub unconstrained fn new() -> Self {\n get_utility_context()\n }\n\n pub unconstrained fn at(contract_address: AztecAddress) -> Self {\n // We get a context with default contract address, and then we construct the final context with the provided\n // contract address.\n let default_context = get_utility_context();\n\n Self { block_header: default_context.block_header, contract_address, msg_sender: default_context.msg_sender }\n }\n\n pub fn block_header(self) -> BlockHeader {\n self.block_header\n }\n\n pub fn block_number(self) -> u32 {\n self.block_header.block_number()\n }\n\n pub fn timestamp(self) -> u64 {\n self.block_header.timestamp()\n }\n\n pub fn this_address(self) -> AztecAddress {\n self.contract_address\n }\n\n /// Returns the address that initiated this utility call.\n ///\n /// This is similar to `msg.sender` in Solidity (hence the name). A utility function called by another contract\n /// (via a nested utility call) sees that contract's address. A utility function invoked directly (e.g. by a wallet\n /// or dApp) has no caller and sees `Option::none`.\n ///\n /// Important Note: utility functions are simulated client-side and never proven, so this value is whatever the\n /// simulator (PXE) set it to: nothing about it is verified onchain. It exists to assist simulation in a\n /// cooperative environment and must not be relied on as a security guarantee.\n pub unconstrained fn maybe_msg_sender(self) -> Option<AztecAddress> {\n if self.msg_sender == NULL_MSG_SENDER_CONTRACT_ADDRESS {\n Option::none()\n } else {\n Option::some(self.msg_sender)\n }\n }\n\n pub fn version(self) -> Field {\n self.block_header.version()\n }\n\n pub fn chain_id(self) -> Field {\n self.block_header.chain_id()\n }\n\n pub unconstrained fn raw_storage_read<let N: u32>(self: Self, storage_slot: Field) -> [Field; N] {\n storage_read(self.block_header, self.this_address(), storage_slot)\n }\n\n pub unconstrained fn storage_read<T>(self, storage_slot: Field) -> T\n where\n T: Packable,\n {\n T::unpack(self.raw_storage_read(storage_slot))\n }\n}\n"
3930
3994
  },
3931
- "76": {
3995
+ "77": {
3932
3996
  "function_locations": [
3933
3997
  {
3934
3998
  "name": "<impl ArrayOracles for EphemeralOracles>::len_oracle",
@@ -3978,7 +4042,7 @@
3978
4042
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/ephemeral/mod.nr",
3979
4043
  "source": "use crate::oracle::ephemeral_oracles;\nuse crate::protocol::traits::{Deserialize, Serialize};\nuse crate::protocol::utils::{reader::Reader, writer::Writer};\nuse crate::unconstrained_array::{ArrayOracles, UnconstrainedArray};\n\n/// A dynamically sized array that exists only during a single contract call frame.\n///\n/// Ephemeral arrays are backed by in-memory storage on the PXE side rather than a persistent database. Each contract\n/// call frame gets its own isolated slot space of ephemeral arrays. Child simulations cannot see the parent's\n/// ephemeral arrays, and vice versa.\n///\n/// Each logical array operation (push, pop, get, etc.) is a single oracle call, making ephemeral arrays significantly\n/// cheaper than capsule arrays.\n///\n/// ## Use Cases\n///\n/// Ephemeral arrays are designed for passing data between PXE (TypeScript) and contracts (Noir) during simulation,\n/// for example, note validation requests or event validation responses. This data type is appropriate for data that\n/// is not supposed to be persisted.\n///\n/// For data that needs to persist across simulations, contract calls, etc, use\n/// [`CapsuleArray`](crate::capsules::CapsuleArray) instead.\n///\n/// For data that must be shared across all frames of the same contract (private and utility) within one top-level PXE\n/// call (transaction simulation or utility call) but not persisted, use\n/// [`TransientArray`](crate::transient::TransientArray).\npub type EphemeralArray<T> = UnconstrainedArray<T, EphemeralOracles>;\n\npub struct EphemeralOracles {}\n\nimpl ArrayOracles for EphemeralOracles {\n unconstrained fn len_oracle(slot: Field) -> u32 {\n ephemeral_oracles::len_oracle(slot)\n }\n\n unconstrained fn push_oracle<let N: u32>(slot: Field, values: [Field; N]) -> u32 {\n ephemeral_oracles::push_oracle(slot, values)\n }\n\n unconstrained fn pop_oracle<let N: u32>(slot: Field) -> [Field; N] {\n ephemeral_oracles::pop_oracle(slot)\n }\n\n unconstrained fn get_oracle<let N: u32>(slot: Field, index: u32) -> [Field; N] {\n ephemeral_oracles::get_oracle(slot, index)\n }\n\n unconstrained fn set_oracle<let N: u32>(slot: Field, index: u32, values: [Field; N]) {\n ephemeral_oracles::set_oracle(slot, index, values)\n }\n\n unconstrained fn remove_oracle(slot: Field, index: u32) {\n ephemeral_oracles::remove_oracle(slot, index)\n }\n\n unconstrained fn clear_oracle(slot: Field) {\n ephemeral_oracles::clear_oracle(slot)\n }\n}\n\n/// Serializes an `EphemeralArray` as its slot, allowing oracle function signatures to use ephemeral array types\n/// instead of opaque `Field` slots.\nimpl<T> Serialize for UnconstrainedArray<T, EphemeralOracles> {\n let N: u32 = 1;\n\n fn serialize(self) -> [Field; Self::N] {\n [self.slot]\n }\n\n fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n writer.write(self.slot);\n }\n}\n\n/// Deserializes a single Field into an `EphemeralArray` handle, treating the field value as the slot identifier.\nimpl<T> Deserialize for UnconstrainedArray<T, EphemeralOracles> {\n let N: u32 = 1;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n Self { slot: fields[0] }\n }\n\n fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self {\n Self { slot: reader.read() }\n }\n}\n\n#[crate::unconstrained_array::test_suite::unconstrained_array_tests(quote { crate::ephemeral::EphemeralOracles })]\nmod test {}\n"
3980
4044
  },
3981
- "82": {
4045
+ "83": {
3982
4046
  "function_locations": [
3983
4047
  {
3984
4048
  "name": "record_retractable_fact",
@@ -4060,51 +4124,51 @@
4060
4124
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/facts/mod.nr",
4061
4125
  "source": "//! Per-contract storage of immutable facts grouped into collections.\n//!\n//! A fact is a contract-defined, typed, immutable datum. Facts are grouped into collections identified by a\n//! `(collection type, collection id)` tuple.\n//!\n//! They are stored in PXE's FactStore, which automatically deals with reorgs by removing any facts\n//! associated with blocks that have been pruned.\nuse crate::ephemeral::EphemeralArray;\nuse crate::oracle::fact_store::{\n delete_fact_collection_oracle, get_fact_collection_oracle, get_fact_collections_by_type_oracle, record_fact_oracle,\n};\nuse crate::protocol::{address::AztecAddress, traits::{Deserialize, Serialize}};\n\nmod origin_state;\npub use origin_state::OriginBlockState;\n\n/// The block a retractable fact originates from.\n#[derive(Deserialize, Eq, Serialize)]\npub struct OriginBlock {\n pub block_number: u32,\n pub block_hash: Field,\n}\n\n/// A retractable fact's origin block.\n#[derive(Deserialize, Eq, Serialize)]\npub struct RetractableFactOrigin {\n pub block_number: u32,\n pub block_hash: Field,\n pub block_state: OriginBlockState,\n}\n\n/// A single immutable fact in a collection.\n#[derive(Deserialize, Serialize)]\npub struct Fact {\n /// A user-defined identifier for fact kinds. Typically used to determine how to deserialize `payload`.\n pub fact_type_id: Field,\n pub payload: EphemeralArray<Field>,\n /// The block the fact is associated to, if any. A fact with an origin block is said to be a 'retractable' fact,\n /// and will be automatically deleted if its origin block gets pruned in a reorg. Typically used by facts\n /// associated with a transaction (e.g. 'processed entry X using data from tx Y in block Z').\n pub origin_block: Option<RetractableFactOrigin>,\n}\n\n/// A fact collection as returned by the store.\n#[derive(Deserialize, Serialize)]\npub struct FactCollection {\n pub contract_address: AztecAddress,\n pub scope: AztecAddress,\n /// The collection's type. A single contract may have facts in collections of different types (e.g. one for the\n /// processing offchain messages, another for partial notes, etc.).\n pub fact_collection_type_id: Field,\n /// The collection's unique identifier among the other collections of this type in this contract and scope.\n pub fact_collection_id: Field,\n pub facts: EphemeralArray<Fact>,\n}\n\n/// Records a retractable fact into a collection: PXE prunes it if `origin_block` is reorg'd away. Re-recording an\n/// identical fact is a no-op.\npub unconstrained fn record_retractable_fact(\n contract_address: AztecAddress,\n scope: AztecAddress,\n fact_collection_type_id: Field,\n fact_collection_id: Field,\n fact_type_id: Field,\n payload: EphemeralArray<Field>,\n origin_block: OriginBlock,\n) {\n record_fact_oracle(\n contract_address,\n scope,\n fact_collection_type_id,\n fact_collection_id,\n fact_type_id,\n payload,\n Option::some(origin_block),\n );\n}\n\n/// Records a non-retractable fact into a collection: it survives reorgs and will persist until the fact collection\n/// itself is deleted. Re-recording an identical fact is a no-op.\npub unconstrained fn record_non_retractable_fact(\n contract_address: AztecAddress,\n scope: AztecAddress,\n fact_collection_type_id: Field,\n fact_collection_id: Field,\n fact_type_id: Field,\n payload: EphemeralArray<Field>,\n) {\n record_fact_oracle(\n contract_address,\n scope,\n fact_collection_type_id,\n fact_collection_id,\n fact_type_id,\n payload,\n Option::none(),\n );\n}\n\n/// Deletes a fact collection, removing all its facts from PXE storage.\n///\n/// Collections must be eventually deleted to reclaim storage and to stop reprocessing past the lifespan of the\n/// workflows they enable.\n///\n/// A no-op if no such collection exists.\npub unconstrained fn delete_fact_collection(\n contract_address: AztecAddress,\n scope: AztecAddress,\n fact_collection_type_id: Field,\n fact_collection_id: Field,\n) {\n delete_fact_collection_oracle(\n contract_address,\n scope,\n fact_collection_type_id,\n fact_collection_id,\n );\n}\n\n/// Fetches a fact collection.\npub unconstrained fn get_fact_collection(\n contract_address: AztecAddress,\n scope: AztecAddress,\n fact_collection_type_id: Field,\n fact_collection_id: Field,\n) -> Option<FactCollection> {\n get_fact_collection_oracle(\n contract_address,\n scope,\n fact_collection_type_id,\n fact_collection_id,\n )\n}\n\n/// Returns every fact collection of `fact_collection_type_id`.\npub unconstrained fn get_fact_collections_by_type(\n contract_address: AztecAddress,\n scope: AztecAddress,\n fact_collection_type_id: Field,\n) -> EphemeralArray<FactCollection> {\n get_fact_collections_by_type_oracle(contract_address, scope, fact_collection_type_id)\n}\n\nmod test {\n use crate::ephemeral::EphemeralArray;\n use crate::facts::{\n delete_fact_collection, get_fact_collection, get_fact_collections_by_type, OriginBlock,\n record_non_retractable_fact, record_retractable_fact,\n };\n use crate::protocol::address::AztecAddress;\n use crate::protocol::traits::{FromField, ToField};\n use crate::test::helpers::test_environment::TestEnvironment;\n\n global TYPE_ID: Field = 42;\n global COLLECTION_ID: Field = 7;\n global FACT_TYPE_ID: Field = 99;\n global PAYLOAD: [Field; 3] = [123, 456, 789];\n\n unconstrained fn setup() -> (TestEnvironment, AztecAddress) {\n let mut env = TestEnvironment::new();\n let scope = env.create_light_account();\n (env, scope)\n }\n\n unconstrained fn make_payload<let N: u32>(values: [Field; N]) -> EphemeralArray<Field> {\n let payload: EphemeralArray<Field> = EphemeralArray::empty();\n for i in 0..N {\n payload.push(values[i]);\n }\n payload\n }\n\n unconstrained fn assert_payload(payload: EphemeralArray<Field>) {\n assert_eq(payload.len(), PAYLOAD.len());\n for i in 0..PAYLOAD.len() {\n assert_eq(payload.get(i), PAYLOAD[i]);\n }\n }\n\n unconstrained fn record_fact(contract_address: AztecAddress, scope: AztecAddress) {\n record_non_retractable_fact(\n contract_address,\n scope,\n TYPE_ID,\n COLLECTION_ID,\n FACT_TYPE_ID,\n make_payload(PAYLOAD),\n );\n }\n\n #[test]\n unconstrained fn records_and_reads_a_fact() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\n record_fact(contract_address, scope);\n\n let collection = get_fact_collection(contract_address, scope, TYPE_ID, COLLECTION_ID).unwrap();\n assert_eq(collection.contract_address, contract_address);\n assert_eq(collection.scope, scope);\n assert_eq(collection.fact_collection_type_id, TYPE_ID);\n assert_eq(collection.fact_collection_id, COLLECTION_ID);\n assert_eq(collection.facts.len(), 1);\n\n let fact = collection.facts.get(0);\n assert_eq(fact.fact_type_id, FACT_TYPE_ID);\n assert_payload(fact.payload);\n assert(fact.origin_block.is_none());\n });\n }\n\n #[test]\n unconstrained fn reads_collections_by_type() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\n record_fact(contract_address, scope);\n\n let collections = get_fact_collections_by_type(contract_address, scope, TYPE_ID);\n assert_eq(collections.len(), 1);\n\n let collection = collections.get(0);\n assert_eq(collection.fact_collection_id, COLLECTION_ID);\n assert_eq(collection.facts.len(), 1);\n\n let fact = collection.facts.get(0);\n assert_eq(fact.fact_type_id, FACT_TYPE_ID);\n assert_payload(fact.payload);\n });\n }\n\n #[test]\n unconstrained fn records_a_retractable_fact_finalized_at_latest_block() {\n let (env, scope) = setup();\n let origin_block_number = env.last_block_number();\n env.private_context(|context| {\n let contract_address = context.this_address();\n record_retractable_fact(\n contract_address,\n scope,\n TYPE_ID,\n COLLECTION_ID,\n FACT_TYPE_ID,\n make_payload(PAYLOAD),\n OriginBlock { block_number: origin_block_number, block_hash: 0xabc },\n );\n\n let collection = get_fact_collection(contract_address, scope, TYPE_ID, COLLECTION_ID).unwrap();\n assert_eq(collection.facts.len(), 1);\n\n let fact = collection.facts.get(0);\n assert_eq(fact.fact_type_id, FACT_TYPE_ID);\n assert_payload(fact.payload);\n\n let origin = fact.origin_block.unwrap();\n assert_eq(origin.block_number, origin_block_number);\n assert_eq(origin.block_hash, 0xabc);\n // TXE finalizes every mined block, so an origin at the latest block is Finalized.\n assert(origin.block_state.is_finalized());\n });\n }\n\n #[test]\n unconstrained fn retractable_fact_above_proven_tip_is_pending() {\n let (env, scope) = setup();\n let future_block_number = env.last_block_number() + 100;\n env.private_context(|context| {\n let contract_address = context.this_address();\n record_retractable_fact(\n contract_address,\n scope,\n TYPE_ID,\n COLLECTION_ID,\n FACT_TYPE_ID,\n make_payload(PAYLOAD),\n OriginBlock { block_number: future_block_number, block_hash: 0xabc },\n );\n\n let origin = get_fact_collection(contract_address, scope, TYPE_ID, COLLECTION_ID)\n .unwrap()\n .facts\n .get(0)\n .origin_block\n .unwrap();\n assert(origin.block_state.is_pending());\n });\n }\n\n #[test]\n unconstrained fn deletes_a_fact_collection() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\n record_fact(contract_address, scope);\n delete_fact_collection(contract_address, scope, TYPE_ID, COLLECTION_ID);\n\n let collections = get_fact_collections_by_type(contract_address, scope, TYPE_ID);\n assert_eq(collections.len(), 0);\n });\n }\n\n #[test]\n unconstrained fn reading_unknown_collection_returns_none() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\n let collection = get_fact_collection(contract_address, scope, TYPE_ID, COLLECTION_ID);\n assert(collection.is_none());\n });\n }\n\n #[test(should_fail_with = \"not allowed to access\")]\n unconstrained fn cannot_record_for_other_contract() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let other = AztecAddress::from_field(context.this_address().to_field() + 1);\n record_fact(other, scope);\n });\n }\n\n #[test]\n unconstrained fn re_recording_an_identical_fact_is_a_no_op() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\n record_fact(contract_address, scope);\n record_fact(contract_address, scope);\n\n let collection = get_fact_collection(contract_address, scope, TYPE_ID, COLLECTION_ID).unwrap();\n assert_eq(collection.facts.len(), 1);\n });\n }\n\n #[test]\n unconstrained fn deleting_a_non_existing_collection_is_a_no_op() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\n delete_fact_collection(contract_address, scope, TYPE_ID, COLLECTION_ID);\n\n assert(get_fact_collection(contract_address, scope, TYPE_ID, COLLECTION_ID).is_none());\n });\n }\n\n #[test]\n unconstrained fn recording_a_fact_after_delete_recreates_the_collection() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n record_fact(contract_address, scope);\n let collection_before_delete =\n get_fact_collection(contract_address, scope, TYPE_ID, COLLECTION_ID).unwrap();\n assert_eq(collection_before_delete.facts.len(), 1);\n\n delete_fact_collection(contract_address, scope, TYPE_ID, COLLECTION_ID);\n assert(get_fact_collection(contract_address, scope, TYPE_ID, COLLECTION_ID).is_none());\n\n record_fact(contract_address, scope);\n let collection_after_recreate =\n get_fact_collection(contract_address, scope, TYPE_ID, COLLECTION_ID).unwrap();\n assert_eq(collection_after_recreate.facts.len(), 1);\n });\n }\n}\n"
4062
4126
  },
4063
- "84": {
4127
+ "85": {
4064
4128
  "function_locations": [
4065
4129
  {
4066
4130
  "name": "compute_secret_hash",
4067
- "start": 519
4131
+ "start": 536
4068
4132
  },
4069
4133
  {
4070
4134
  "name": "compute_l1_to_l2_message_hash",
4071
- "start": 800
4135
+ "start": 815
4072
4136
  },
4073
4137
  {
4074
4138
  "name": "compute_l1_to_l2_message_nullifier",
4075
- "start": 1858
4139
+ "start": 1892
4076
4140
  },
4077
4141
  {
4078
4142
  "name": "hash_args",
4079
- "start": 2110
4143
+ "start": 2151
4080
4144
  },
4081
4145
  {
4082
4146
  "name": "hash_calldata_array",
4083
- "start": 2362
4147
+ "start": 2403
4084
4148
  },
4085
4149
  {
4086
4150
  "name": "compute_public_bytecode_commitment",
4087
- "start": 2994
4151
+ "start": 3035
4088
4152
  },
4089
4153
  {
4090
4154
  "name": "secret_hash_matches_typescript",
4091
- "start": 4153
4155
+ "start": 4194
4092
4156
  },
4093
4157
  {
4094
4158
  "name": "var_args_hash_matches_typescript",
4095
- "start": 4512
4159
+ "start": 4555
4096
4160
  },
4097
4161
  {
4098
4162
  "name": "compute_calldata_hash",
4099
- "start": 4922
4163
+ "start": 4965
4100
4164
  },
4101
4165
  {
4102
4166
  "name": "public_bytecode_commitment",
4103
- "start": 5385
4167
+ "start": 5428
4104
4168
  }
4105
4169
  ],
4106
4170
  "path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/hash.nr",
4107
- "source": "//! Aztec hash functions.\n\nuse crate::protocol::{\n address::{AztecAddress, EthAddress},\n constants::{\n DOM_SEP__FUNCTION_ARGS, DOM_SEP__MESSAGE_NULLIFIER, DOM_SEP__PUBLIC_BYTECODE, DOM_SEP__PUBLIC_CALLDATA,\n DOM_SEP__SECRET_HASH, MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS,\n },\n hash::{poseidon2_hash_subarray, poseidon2_hash_with_separator, sha256_to_field},\n traits::ToField,\n};\n\npub use crate::protocol::hash::compute_siloed_nullifier;\n\npub fn compute_secret_hash(secret: Field) -> Field {\n poseidon2_hash_with_separator([secret], DOM_SEP__SECRET_HASH)\n}\n\npub fn compute_l1_to_l2_message_hash(\n sender: EthAddress,\n chain_id: Field,\n recipient: AztecAddress,\n version: Field,\n content: Field,\n secret_hash: Field,\n leaf_index: Field,\n) -> Field {\n let mut hash_bytes = [0 as u8; 224];\n let sender_bytes: [u8; 32] = sender.to_field().to_be_bytes();\n let chain_id_bytes: [u8; 32] = chain_id.to_be_bytes();\n let recipient_bytes: [u8; 32] = recipient.to_field().to_be_bytes();\n let version_bytes: [u8; 32] = version.to_be_bytes();\n let content_bytes: [u8; 32] = content.to_be_bytes();\n let secret_hash_bytes: [u8; 32] = secret_hash.to_be_bytes();\n let leaf_index_bytes: [u8; 32] = leaf_index.to_be_bytes();\n\n for i in 0..32 {\n hash_bytes[i] = sender_bytes[i];\n hash_bytes[i + 32] = chain_id_bytes[i];\n hash_bytes[i + 64] = recipient_bytes[i];\n hash_bytes[i + 96] = version_bytes[i];\n hash_bytes[i + 128] = content_bytes[i];\n hash_bytes[i + 160] = secret_hash_bytes[i];\n hash_bytes[i + 192] = leaf_index_bytes[i];\n }\n\n sha256_to_field(hash_bytes)\n}\n\n// The nullifier of a l1 to l2 message is the hash of the message salted with the secret\npub fn compute_l1_to_l2_message_nullifier(message_hash: Field, secret: Field) -> Field {\n poseidon2_hash_with_separator([message_hash, secret], DOM_SEP__MESSAGE_NULLIFIER)\n}\n\n// Computes the hash of input arguments or return values for private functions, or for authwit creation.\npub fn hash_args<let N: u32>(args: [Field; N]) -> Field {\n if args.len() == 0 {\n 0\n } else {\n poseidon2_hash_with_separator(args, DOM_SEP__FUNCTION_ARGS)\n }\n}\n\n// Computes the hash of calldata for public functions.\npub fn hash_calldata_array<let N: u32>(calldata: [Field; N]) -> Field {\n poseidon2_hash_with_separator(calldata, DOM_SEP__PUBLIC_CALLDATA)\n}\n\n/// Computes the public bytecode commitment for a contract class. The commitment is `hash([(length | separator),\n/// ...bytecode])`.\n///\n/// @param packed_bytecode - The packed bytecode of the contract class. 0th word is the length in bytes.\n/// packed_bytecode is mutable so that we can avoid copying the array to construct one starting with first_field\n/// instead of length. @returns The public bytecode commitment.\npub fn compute_public_bytecode_commitment(\n mut packed_public_bytecode: [Field; MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS],\n) -> Field {\n // First field element contains the length of the bytecode\n let bytecode_length_in_bytes: u32 = packed_public_bytecode[0] as u32;\n let bytecode_length_in_fields: u32 = (bytecode_length_in_bytes / 31) + (bytecode_length_in_bytes % 31 != 0) as u32;\n // Don't allow empty public bytecode. AVM doesn't handle execution of contracts that exist with empty bytecode.\n assert(bytecode_length_in_fields != 0);\n assert(bytecode_length_in_fields < MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS);\n\n // Packed_bytecode's 0th entry is the length. Append it to the separator before hashing.\n let first_field = DOM_SEP__PUBLIC_BYTECODE.to_field() + (packed_public_bytecode[0] as u64 << 32) as Field;\n packed_public_bytecode[0] = first_field;\n\n // `fields_to_hash` is the number of fields from the start of `packed_public_bytecode` that should be included in\n // the hash. Fields after this length are ignored. +1 to account for the prepended field.\n let num_fields_to_hash = bytecode_length_in_fields + 1;\n\n poseidon2_hash_subarray(packed_public_bytecode, num_fields_to_hash)\n}\n\n#[test]\nunconstrained fn secret_hash_matches_typescript() {\n let secret = 8;\n let hash = compute_secret_hash(secret);\n\n // The following value was generated by `yarn-project/stdlib/src/hash/hash.test.ts`\n let secret_hash_from_ts = 0x1848b066724ab0ffb50ecb0ee3398eb839f162823d262bad959721a9c13d1e96;\n\n assert_eq(hash, secret_hash_from_ts);\n}\n\n#[test]\nunconstrained fn var_args_hash_matches_typescript() {\n let mut input = [0; 100];\n for i in 0..100 {\n input[i] = i as Field;\n }\n let hash = hash_args(input);\n\n // The following value was generated by `yarn-project/stdlib/src/hash/hash.test.ts`\n let var_args_hash_from_ts = 0x262e5e121a8efc0382566ab42f0ae2a78bd85db88484f83018fe07fc2552ba0c;\n\n assert_eq(hash, var_args_hash_from_ts);\n}\n\n#[test]\nunconstrained fn compute_calldata_hash() {\n let mut input = [0; 100];\n for i in 0..input.len() {\n input[i] = i as Field;\n }\n let hash = hash_calldata_array(input);\n\n // The following value was generated by `yarn-project/stdlib/src/hash/hash.test.ts`\n let calldata_hash_from_ts = 0x14a1539bdb1d26e03097cf4d40c87e02ca03f0bb50a3e617ace5a7bfd3943944;\n\n // Used in cpp vm2 tests:\n assert_eq(hash, calldata_hash_from_ts);\n}\n\n#[test]\nunconstrained fn public_bytecode_commitment() {\n let mut input = [0; MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS];\n let len = 99;\n for i in 1..len + 1 {\n input[i] = i as Field;\n }\n input[0] = (len as Field) * 31;\n let hash = compute_public_bytecode_commitment(input);\n // Used in cpp vm2 tests:\n assert_eq(hash, 0x09348974e76c3602893d7a4b4bb52c2ec746f1ade5004ac471d0fbb4587a81a6);\n}\n"
4171
+ "source": "//! Aztec hash functions.\n\nuse crate::protocol::{\n address::{AztecAddress, EthAddress},\n constants::{\n DOM_SEP__FUNCTION_ARGS, DOM_SEP__MESSAGE_NULLIFIER, DOM_SEP__PUBLIC_BYTECODE, DOM_SEP__PUBLIC_CALLDATA,\n DOM_SEP__SECRET_HASH, MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS,\n },\n hash::{poseidon2_hash_subarray, poseidon2_hash_with_separator, sha256_to_field},\n traits::ToField,\n};\n\npub use crate::protocol::hash::compute_siloed_nullifier;\n\npub fn compute_secret_hash<let N: u32>(secret: [Field; N]) -> Field {\n poseidon2_hash_with_separator(secret, DOM_SEP__SECRET_HASH)\n}\n\npub fn compute_l1_to_l2_message_hash(\n sender: EthAddress,\n chain_id: Field,\n recipient: AztecAddress,\n version: Field,\n content: Field,\n secret_hash: Field,\n leaf_index: Field,\n) -> Field {\n let mut hash_bytes = [0 as u8; 224];\n let sender_bytes: [u8; 32] = sender.to_field().to_be_bytes();\n let chain_id_bytes: [u8; 32] = chain_id.to_be_bytes();\n let recipient_bytes: [u8; 32] = recipient.to_field().to_be_bytes();\n let version_bytes: [u8; 32] = version.to_be_bytes();\n let content_bytes: [u8; 32] = content.to_be_bytes();\n let secret_hash_bytes: [u8; 32] = secret_hash.to_be_bytes();\n let leaf_index_bytes: [u8; 32] = leaf_index.to_be_bytes();\n\n for i in 0..32 {\n hash_bytes[i] = sender_bytes[i];\n hash_bytes[i + 32] = chain_id_bytes[i];\n hash_bytes[i + 64] = recipient_bytes[i];\n hash_bytes[i + 96] = version_bytes[i];\n hash_bytes[i + 128] = content_bytes[i];\n hash_bytes[i + 160] = secret_hash_bytes[i];\n hash_bytes[i + 192] = leaf_index_bytes[i];\n }\n\n sha256_to_field(hash_bytes)\n}\n\n// The nullifier of an l1 to l2 message is the hash of the message salted with the secret.\npub fn compute_l1_to_l2_message_nullifier<let N: u32>(message_hash: Field, secret: [Field; N]) -> Field {\n poseidon2_hash_with_separator([message_hash].concat(secret), DOM_SEP__MESSAGE_NULLIFIER)\n}\n\n// Computes the hash of input arguments or return values for private functions, or for authwit creation.\npub fn hash_args<let N: u32>(args: [Field; N]) -> Field {\n if args.len() == 0 {\n 0\n } else {\n poseidon2_hash_with_separator(args, DOM_SEP__FUNCTION_ARGS)\n }\n}\n\n// Computes the hash of calldata for public functions.\npub fn hash_calldata_array<let N: u32>(calldata: [Field; N]) -> Field {\n poseidon2_hash_with_separator(calldata, DOM_SEP__PUBLIC_CALLDATA)\n}\n\n/// Computes the public bytecode commitment for a contract class. The commitment is `hash([(length | separator),\n/// ...bytecode])`.\n///\n/// @param packed_bytecode - The packed bytecode of the contract class. 0th word is the length in bytes.\n/// packed_bytecode is mutable so that we can avoid copying the array to construct one starting with first_field\n/// instead of length. @returns The public bytecode commitment.\npub fn compute_public_bytecode_commitment(\n mut packed_public_bytecode: [Field; MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS],\n) -> Field {\n // First field element contains the length of the bytecode\n let bytecode_length_in_bytes: u32 = packed_public_bytecode[0] as u32;\n let bytecode_length_in_fields: u32 = (bytecode_length_in_bytes / 31) + (bytecode_length_in_bytes % 31 != 0) as u32;\n // Don't allow empty public bytecode. AVM doesn't handle execution of contracts that exist with empty bytecode.\n assert(bytecode_length_in_fields != 0);\n assert(bytecode_length_in_fields < MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS);\n\n // Packed_bytecode's 0th entry is the length. Append it to the separator before hashing.\n let first_field = DOM_SEP__PUBLIC_BYTECODE.to_field() + (packed_public_bytecode[0] as u64 << 32) as Field;\n packed_public_bytecode[0] = first_field;\n\n // `fields_to_hash` is the number of fields from the start of `packed_public_bytecode` that should be included in\n // the hash. Fields after this length are ignored. +1 to account for the prepended field.\n let num_fields_to_hash = bytecode_length_in_fields + 1;\n\n poseidon2_hash_subarray(packed_public_bytecode, num_fields_to_hash)\n}\n\n#[test]\nunconstrained fn secret_hash_matches_typescript() {\n let secret = 8;\n let hash = compute_secret_hash([secret]);\n\n // The following value was generated by `yarn-project/stdlib/src/hash/hash.test.ts`\n let secret_hash_from_ts = 0x1848b066724ab0ffb50ecb0ee3398eb839f162823d262bad959721a9c13d1e96;\n\n assert_eq(hash, secret_hash_from_ts);\n}\n\n#[test]\nunconstrained fn var_args_hash_matches_typescript() {\n let mut input = [0; 100];\n for i in 0..100 {\n input[i] = i as Field;\n }\n let hash = hash_args(input);\n\n // The following value was generated by `yarn-project/stdlib/src/hash/hash.test.ts`\n let var_args_hash_from_ts = 0x262e5e121a8efc0382566ab42f0ae2a78bd85db88484f83018fe07fc2552ba0c;\n\n assert_eq(hash, var_args_hash_from_ts);\n}\n\n#[test]\nunconstrained fn compute_calldata_hash() {\n let mut input = [0; 100];\n for i in 0..input.len() {\n input[i] = i as Field;\n }\n let hash = hash_calldata_array(input);\n\n // The following value was generated by `yarn-project/stdlib/src/hash/hash.test.ts`\n let calldata_hash_from_ts = 0x14a1539bdb1d26e03097cf4d40c87e02ca03f0bb50a3e617ace5a7bfd3943944;\n\n // Used in cpp vm2 tests:\n assert_eq(hash, calldata_hash_from_ts);\n}\n\n#[test]\nunconstrained fn public_bytecode_commitment() {\n let mut input = [0; MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS];\n let len = 99;\n for i in 1..len + 1 {\n input[i] = i as Field;\n }\n input[0] = (len as Field) * 31;\n let hash = compute_public_bytecode_commitment(input);\n // Used in cpp vm2 tests:\n assert_eq(hash, 0x09348974e76c3602893d7a4b4bb52c2ec746f1ade5004ac471d0fbb4587a81a6);\n}\n"
4108
4172
  }
4109
4173
  },
4110
4174
  "functions": [
@@ -4134,11 +4198,11 @@
4134
4198
  ],
4135
4199
  "return_type": null
4136
4200
  },
4137
- "bytecode": "H4sIAAAAAAAA/+1bXWjbVhT2j2zJUWK7lu113di6sdGV/bB0WxmlrDRu0qa0pDRNB/sziq1lZrLlyXJoCuvm/TyOOT/tXgqDxclS2o4+5G0MxuhgL2GPpVAog8EeBiuFvQz2MLn+0ZWujqTrSE1WkqcrH52fe+53zzn3RDc4N3vh5hPZLH9WEXLZkpwtlBRBLvFiJZvNSaWKIldziiTP1i4PyQVRLExleFFc8M3VlscLpSlRmK/Pzl3f6bP+8/tsX/GRCfTbC6zP1+v2guZ8/npdVenAB7f8h2tLmebzfG35UEEWckqg9u2o+u6UIC9OvLTHXpuR30/E//Gokd9Hpn+01mgu3+xAV87KSUHklcK0QJFJCuASQmQSfLUrTVvyvMJnpPJMd0qHUZsQ4YvHpek57YeA9r6BEuxQjrRnm8BtDZD6DZMQJJ1tY1yRyrO6GSDCDOuaWRopCGL++k5638/8G089enJ16cuv0tuLe/8tZS99vv+t1QP7X7wQ333uTyPjoQ6jjTmPGRmHHTKGjIwjZI4ILp8UlKpcql0ekWShMFVqLtH5m8+09l6xUMll+UpFkJWMVCyrzpkUhTGZz4nCaUGuFKRSvT5Xu3pcKEryzMF8XhYqle7Ugd+H78WqYlkUWlM0POns+L5lRlURs1OCMqEUxIIyo85XEc4ot3zbjRoQpEKUEEgJgxQapDAgJQJS+kAKC1L6QcoASImClBhIiYOUbSAlAVI4kJIEKSmQkgYpD4EUGCEPg5QdIOWRJuSssLvpn3SxwfaVvS8TyWxMDO551fpXUrvrdZPM6DAy+kxSog1roMtqyGFhrUDAhNJkATekVm6FEi/PqExj5fNdwYsq3Fqr0tGExp/RUr6ViAzKw6QFj165pqKrHp9zwOgNBjVtSc2jsmBODUDqGFwdo6mzEhl0XyTlvkisPKIsABTyHEAhGECUSwAKWQLIOeoojWllSORz7w9JZ2qrJ6SKUMhLpT0nBLlYVdQ3pdIc4t4QhTz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Od7zTVvQfKkGUyp5CAAA=",
4138
4202
  "custom_attributes": [
4139
4203
  "abi_utility"
4140
4204
  ],
4141
- "debug_symbols": "tZrRbhs5DEX/xc95GImiJPZXiqJIU7cIECSBmyywKPLvS1q8GjsLCa4nfSmPnfpEQ5GSZuLfu+/7b68/v94//nj6tfv0+ffu2+H+4eH+59eHp7vbl/unR333926xf0LdfaKbXZDdp3Kzi/peCBqDx+iRPCaP7DF7LB6rR2mR3EfuI/eR+8h9ZD4dBmWPxWP1KC2mxWPwaL6kkTwmj+bT60nqi6yxeKwepUVePAaP0SN5TB7Zo/vYfew+dl92Xzaf/v4cPZLH5JE9Zo/Fo/mqRmmxmE80Bn8dPZLH5JE9Zo/qo0Vj9SgtVvWR5rsGfx09ksfkkT1mj+bTfNfqUVqUxWPwGD2SR/PpfAh7VF9SnxSP1aO0GJYFEAARQIAEYEAGFEAFwBxgDmaOBhFAgARgQAYUgJmtY6xljmBNw/Yj65oGEUCABGBABhRABYgDwUwwE8wEs7UQJwMGZEABVIA4WCM1MDMbRICasyXKmqkBAzKgACpAHKylGgRABMDMMDPMDDPDbK2V7QKtt45gzdUgACKAAAlgZpsda7EGZrZLtiZr74iDtVmDAIgAApjZ8mO91sDM2aDgnQoQB2u4BgEQAchGRTas63IxQDYqslGR54o8C/IsyLMgG4JsCLJh/dcgAwoAebYezNX2gAVgZjGIeIcACcCADCgANRfbDKwHj2A92CAAIoAACaDmEg0yQM3FdinrwQbiYD3YIAAigAAJwIAMgDnCHGEmmK0Hi2XDerABARKAARlQAGqui4E4WA/WZBAAaq5soOaaDRJAzdWyaj3YoAAqQBysBxsEQAQQIAFgZpgZZoaZYc4wZ5gzzBnmDLP1oNiVWg82KIAKEAfrwQYBEAEEULMcjxsMyIACMLMl03rwCNaDDQIgAghgZsu89WADM1vmrQcbVIA4WA+K1Yb1YIMIsBPJQkapE3fKnUqn2kmcyFrRKXSyM8+SjI6/I7293exwsPv6ctjv7Vx3ctLT89/z7WH/+LL79Pj68HCz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f4RbLOCh6M6vY2s/TYy1uFt5PRWtqZ+H3CyJb67lZ0ZeL2sL0seGWSybKb+2Hk2ueX8qVNmz0gp9EQkWjOREr274570RHRThSQTTSSTdVOzgTrjfPK3i98lcfZ0sfSzTjxRpMtTWtAVTst5Sj/ry9u7+8PZ97HeTHW4v/36sPeX318f705++vLfM36C73M9H57u9t9eD3szrV/q0n/+sZMFRfps31Sxl3ozRjF/frPf/j8=",
4142
4206
  "is_unconstrained": true,
4143
4207
  "name": "constructor"
4144
4208
  },
@@ -4165,6 +4229,10 @@
4165
4229
  "error_kind": "string",
4166
4230
  "string": "attempt to add with overflow"
4167
4231
  },
4232
+ "5990802241885993019": {
4233
+ "error_kind": "string",
4234
+ "string": "fee payer must be elected during the setup phase"
4235
+ },
4168
4236
  "723263401372269001": {
4169
4237
  "error_kind": "string",
4170
4238
  "string": "Immutables do not match instance immutables_hash"
@@ -6026,14 +6094,14 @@
6026
6094
  "visibility": "databus"
6027
6095
  }
6028
6096
  },
6029
- "bytecode": "H4sIAAAAAAAA/+2dB5gUxdq26e6Znp6eIUsSSZIFJAmIgOScsyRxgQVWll1YliwqqIjEZcmKgOQMkgQkR5F5JeecQSQJSBL5a0HZoWCZp5t95f/O5bnO9X11Hmrfp+6q6qru6uoaLXroyAMZmzcP6hEZ3LJ5WETzkLDI4IiwoNBOzZsHh0VGdO8QLpTD3tG955cJDWrZrkx4twqdw1qWDQoN7T2lTukaFctH957WMCQyLLhTJzUjkElTgExJkUjJSwGZUvo+BXKlgnK9hpQqHZIpPZIpA5IpI1TyTFCu16FcmaFcWZDCZ0cy5UQ6zBtIplxIpjxImfIikfIhmfIjmQoiZSqERCqMZCqCZCqKlKkYEqk4kqkEkqkkUqbSSKQySKaySKbyBpCpgtJ7VpmIkNDQkDYx/z48QVTUsKioDRkTPP8/Su+ZpTt1Co6IbBwcET4samj0hoz5WtWIOJF/Qs6ltcov6d37vWY5Cp6v1H1Zh6FlT9wcdlX8CWmDnx92T55T7eyEHRJn2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ZPmr4ydTwAk2803e8ELBYWt7xE3pPQD0Rjx3XL+P0ZZpff0eQQA",
6030
6098
  "custom_attributes": [
6031
6099
  "abi_private"
6032
6100
  ],
6033
- "debug_symbols": "tZ3RjtxGkrXfRde+YERmZGT6VRaLgWdGOxAgeAYa+wd+DPzuW8kiz1dqbaWo7vaNGZbU8bFYPKfI4Kns/3z4+8e//v6Pv3z69X/++e8PP//Xfz789cunz58//eMvn//5t19++/TPX29/+p8P2/yP1Q8/e/vjpw82/89v/20/fXC/b8p9U++buG/afZP7ptyajNvG7hu/b8p9U++buG/afZP3Tb9vxr6ptx+wuG3rsY1j245tHtvbT9mNWsd9G9uxtWPrx7Yc23ps49jOfvPF+v5i57/qt/8r+4G4/de3n+4HZG5vP+N2295+xv22zbm9/euqf12Ov43bn8b+p3P/8van47717djasfVjO8l5+6k2f6rf/vT24nq5b+p9c2s4++bed8Jvf2gTsG/HfTsB81/1/V/d+tTb/4z7j3z4ucy3dX+X57+b+252/p39cfvf83T4y29fPn6cf/NwftzOmn/98uXjr799+PnX3z9//unD//vl8+/7P/r3v375dd/+9suX29/ejtXHX/9+294a/s+nzx9n9cdP/PT2p/xo2+rxw5n8uPW83CDa2WBLNfCtX23QSxwNemcP3OJqA/c4X4N7H2pRrr+IYeeLGL0/HIVxucE4d8E2i6cdcvUq+jhfRdmKWlT/qkN/3qEWOxrUsGc/v9yDynGM/qyDLQ6DbVPix3F42ImXx8FsdSi383weo3BK1Zf74av9sL5pR3wbz7uUlTa28y1ptybPe9TFQa3n2e3t4bWU8SOvpXVOrnx+RBZvTNnyaFFqfXhb6tUGtZ3Hsw72wMZllXY/T65eHyT29c/bWLwb7dRoy3hNg9zK6VS2va7BeXKnP92Dpcuc58Jwe83Px3kejBzPft4XJ6OVsPOMvtXVadKu7oSFTiWL8WjYef1U8NOpuj++Evv6Q8Nz9VK6RFHLq3bjthdFfpeoom5fq8IXp0R1k+k+vpRav/4ELittZj17lG7b8x4r02yyqtH2S7P/2yIu9yjleY/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AAAAAAAAAABoF1ts25bUxjVqMteze0AAAAAAAAAAAAAAAAAAACo8TYIwJDzetN3EXCluIpEFgAAAAAAAAAAAAAAAAAAAAAAFDj+ujuKXWIduMRizNdHAAAAAAAAAAAAAAAAAAAAkieplYTlrN89Gf/LIha2htkAAAAAAAAAAAAAAAAAAAAAABwU3YpYO42HmOzB5o9yngAAAAAAAAAAAAAAAAAAAKyAR3Num5hHCKr58fkJo1QmAAAAAAAAAAAAAAAAAAAAAAAUpL3XjVcbYWx7JOyCbpIAAAAAAAAAAAAAAAAAAACxFJcIs+bjJiqTZRIKWJvMwAAAAAAAAAAAAAAAAAAAAAAAHsoRg9dcqSUJqFeL0ymxAAAAAAAAAAAAAAAAAAAA53LaPE2Fg1siLX4w7JR4aGAAAAAAAAAAAAAAAAAAAAAAAC7fVGI4DEMQ6vLxqrjGhQAAAAAAAAAAAAAAAAAAABiSR0c0TM/iH2kdaNE2RoFiAAAAAAAAAAAAAAAAAAAAAAALlypFEM1PF4G6UaTaZtkAAAAAAAAAAAAAAAAAAADy5cm5k2fZrA6j/Sd8lSVNRAAAAAAAAAAAAAAAAAAAAAAAFYUWow75kFEJ9FArJhlmAAAAAAAAAAAAAAAAAAAAHvnRNJN+BxKgUjx1HkBfaPwAAAAAAAAAAAAAAAAAAAAAAAh+bIz1sk+CvS2lNYZRKAAAAAAAAAAAAAAAAAAAABlH+dQQhaEMfutIwllSwPWnAAAAAAAAAAAAAAAAAAAAAAAiLnwvPP5BxLPDHJUza2U="
6037
6105
  },
6038
6106
  {
6039
6107
  "abi": {
@@ -6083,11 +6151,11 @@
6083
6151
  "visibility": "public"
6084
6152
  }
6085
6153
  },
6086
- "bytecode": "H4sIAAAAAAAA/+1dW2xcRxn2nrP3i+NLfEvWe9zsxbd11YYqqqBSlDhJ7dZuoqQBhABnY584qxzvLmd33RoQZal4o8XrJOWd2CZVSB9QuKgICUTgBVkE8RSRFwTipS9FqniokGAd72XOzPnnnDmek+Q09tN45/zfzPz/N//8M2d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na/qkWX4xD0pNn8yc2nNR7eUmMF1oEbSXW2svzcs9gZTAaWgvF3Wc6aQELlRJDBvuXJa7Tpf1G+50tWXkOt28Nty5UNfpdrQ7BKmjBbOol18wnOAaDL3WBUMvYlH0up8H45r7fmazr79aVJT05bSszsnLl2Q1fyWdq98AdBO8z0cAa1xgjRus8ejfNOQbv4ndGmT+L/0bisYrYB+cYI1YobbEcKIGIbCIHyNCgyLlGJFIHLhBBB2kK2sJbp6TC0U1Q5CxSdgWFY8egan4688GVt78X+/F0vprqpQrV1ryDb41GqqP0PrHrlbM0B1B7k1kvoPLCK3pSOPxLTGijUXIvRhmh2gzUukKeHEBsSWgadnXekDzOTKVrSdz4n5MK54WRiNG4cIe/d758N6BXwc0AHEBv4FAQDtNxJvxEjYJbImDEL2YLwdpaGwUsDIvPv/Tc/aU8KsfRYz5vMOGPnJ/8tlf/rS0ZtjQ/wHq1Dh2KJEAAA==",
6087
6155
  "custom_attributes": [
6088
6156
  "abi_utility"
6089
6157
  ],
6090
- "debug_symbols": "tZzbbt02F4Tfxde50Frk4iGvUhSFmzqFAcMJ3OQHfgR593JRnJFsQ7S8d3oTfrG9ZyiKw6PhHzd/3f35/e8/7h8/f/nn5uNvP27+fLp/eLj/+4+HL59uv91/eWxf/XGz+D+qNx/DhxsNNx9zK+LNx9oKW4u0FnktylrUXoRlLdr3RFtZRlnXMi6jlFHqKMMo4yhtlP750sq6lraMUkbpn29+FkYZR2mjTKPMoyyjrGuZllG2z2t73hRH2T6vsZVplHl8vYyyrl/PzV9bA+UwyjhKG2UaZR5lGWVdy7KMUkY59MrQK0OvDL0y9MrQK0OvDL069OrQq0OvDr069OrQq0OvDr069OrQk2UBCEABARABBkiADCgAKAuUBcoCZYGyQFmgLFAWKAuUBcoKZYWyQlmhrFBWKCuUFcoKZYVygHKAcoBygHKAcoBygHKAcoBygHKEcoRyhHKEcoRyhHKEcoRyhHKEskHZoGxQNigblA3KBmWDskHZoJygnKCcoJygnKCcoJygnKCcoJygnK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t1dxoYRbJk1y7Tk5O0OL4fYZ2rQjJxeHfiI5tzo0l5xcHvqJ5Nz60FRydoFIYv29F+fs9Pknk192pM1b4uHkdzYHN+VDy3Yr/uf318xK2CZFrxcj/mx/u3/3+PLql2d8c9fL4/3fTw/jrx++PL/b/fTz/z/hJ/jlG59ePr57eP/l5cFN22/gaH/8kdu9va2y/+m/5aD9tbS3uLKkP7959f8A",
6091
6159
  "is_unconstrained": true,
6092
6160
  "name": "lookup_validity"
6093
6161
  },
@@ -7886,12 +7954,12 @@
7886
7954
  "visibility": "databus"
7887
7955
  }
7888
7956
  },
7889
- "bytecode": "H4sIAAAAAAAA/+2cB3hURfv2M89sEoogghQVMWJXLIBdFCGEolIEe4tLskI0JHGzCUVRYq+QLIhdUIoIoqiIgKKiWNBzA2KhGBVEBUURFcWC+k0MyZ7NZpPZTW717/e+l9f1Dqf8njlzZuZM2fx0sGTimg7p6d5RAV9Geo4/PSsn4PPneLPz09MLff6sy0am5/mzCr0BX7q3IDB0eFagVL9XNKd7tjfjiu65I3oW5GSkerOzi6YN7NavV1qw6NFzswI5vvx8SbG4SCuLi3azIbU41eKiVs4Yi6taW13V1iZXe9tc1M7mon1sLkqxyvm+Vle1t7pqP6ur9k8pmtXdn5WdnTWk7PyEhOLi8cXFS1ISav6fKprZLT/f5w9c4PPnji8uCS5JOSqzn399x8mHzB+QNq+o6LyLD+68qffIBXklqet/HL/V3AKdUzP2/cM3XBEPNrfW3CbEg82LipVKbGT5zh2Qm+/LyszN6TTA5x9WEPAGsnJzghMqy9uUQmX6QNfRXFc6bwL0ldB+aPOPQHjeg8Ha383+Vs9XYPGSa68/hpMSew5bWOWwsBaQOnOMVQ4LTw2v46qkaPqgrJwh2b7yulBbbm3KKuEv5rC8bB/0cLsWZJP14So86w3IWR8Re+MvGW+VDcO2y/DI2qtGfPFHFsfYUdiRhxvyeKv6PNzqqpFWV42Kp4uu7Q5tUfR1qo4JtV/iqoxXcSqjKb2rglZV8Sqrq64mVFiTx6tL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lxmd9Yeg3hKbj72P6/YE7uv3y39dW/2VXsRfKgzG++ar639rOrWjA5k6zRVb+o8W7I7v2VnX8tOxaP91yUig/VeDIj6D1jn3kJLGyTldObiNjSlQN0A2jPqGW0VWs6ElTe2YXhfrZqjxUNueqx64siOCz7pe3vYgzLi/MC2T7cgN3RWavcaLf1x33N6nn19g4BI5RHjJrR0BXsSSFyifGXWr7WlzovdV6eflSYTQ9rHNz1YOIl9Gk6nH+H59D6laVsAEA",
7890
7958
  "custom_attributes": [
7891
7959
  "abi_private",
7892
7960
  "abi_view"
7893
7961
  ],
7894
- "debug_symbols": "tVzbbtw4D36XXOdCJEUd9lUWP4q0zS4CBGmRbRf4UfTdV5QtWnEhRmO7NyFnMv5MSTyJOvy4+/z48fvfH55e/vryz90ff/64+/j69Pz89PeH5y+fHr49fXkp3/64c/IH/N0fSD/v76B+ovIJyyeUT1i+w8LjQmghfiG8kLCQWAkVSC4EFoILoYX4hfBCwkLiQtJCciW+PABQqF8przSsNK60PAXlrT4vlN1KYaW4UlqpXymvVPCksVQbK7/y5ZNvHQHhvnZPpfJMLFSeSYWKDKn8mvXXefkvQvk21G9FPirf5oWiWymsFFcqT8sQRHlK+gmWfoKf5cs2ZB++vT4+yg+6MSwj+/Xh9fHl290fL9+fn+/v/n14/l5/9M/Xh5dKvz28lv+6+7vHl8+FFsC/np4fhft5vz3txo9yyuvDAaM+DplmAbL0XwXIKW0AKU8DZL8CgAMeItAYAVEbgeRIITy+QfBjBE+wAniG0fOmBL41ApHTCCGMEcAhajd0Muy7IVod6Zoi5EzbYPqdFMmSApJTMdDlIUgegwTnVKcKxhACDKVAz60/Q9cSyje0JKRNr+K4OwwpyMUVgrzvhsTPAvjQetPn3rp4FiBh06vkO+t6+zywMRihmWeIfAQgOloBIrhjAE2xIw4lMB1MU4WMcOR5bnqQYx49jwYAEENT6MJ73EDCrBAhay/6TQicbwWw6iJwdh1EnNclbF4uYd8VJdK96Qtv9UVSq/J0SAyk0FqCHnAshuEtcT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mo5J5AGajmSkAbqStNG84lKk7RsZaVJulKUKxKnJulKWRaVUxN6pUHCxqkNvdK00Xx6XvrSpSwnjeniHtKZXiltlCWKnfqtKw3SSXNqTq80bTSfqDSnS+lMmtMrxY2SnJEVyuLDhXq53lBo2GjcaMGTHl5pWpdWFWlar1Qa5/nUtF4pbZSlKERb13plQmOkB12MyqfG1E748q/gGgONwcZQY7gxvjG1Ib6EmBAbU1vYixpD3pgoyKLgKMiisSjI0nsRqTFcy0yF8Y0JtRpZmNgYQRZbjoIsxx1JkKXSnwRZdJgEWW7xJkGWyzVJkGX1Sb4xoTG1I78oIaXG5I3Jgix3wTM0BhtTkYvMmRvjGyPIcps+x8YIslStct6YkoTKyg/CgXLyowmu/peUY+XEEeRSDLigXFQu1SMf4XLjwCkn31F/UgBQOVKOlfPKhXpoIlysLVHCJeXkO2TmQdxu40A5VK7+NgQLx8p55YJy9TtklOKGYi7Q/BDINaZ+QeVQOVKOlfPtgdCY2JiGTnUAssj8e//yeP/56UGCjcSj1+cvLfaUlz/++97+034P4/vLty8PX19fHiRO1RBVf/iiCPJHWYwjSRgL7Z0iEAV5J+o79IHKZyTc/Q8=",
7895
7963
  "is_unconstrained": false,
7896
7964
  "name": "verify_private_authwit",
7897
7965
  "verification_key": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAv5JMhlsMlvWSmA7qX/phBpkAAAAAAAAAAAAAAAAAAAAAACKa6qdc5kMKDSS7Dz8gxQAAAAAAAAAAAAAAAAAAAPc7lyeMznAJdTkppVBDDKw9AAAAAAAAAAAAAAAAAAAAAAAr1h0zaeVsVJF0ZIFXTLEAAAAAAAAAAAAAAAAAAABRx9yb70YbAcxcCmfXQ/jUwgAAAAAAAAAAAAAAAAAAAAAALxFYwHGp9vOdKm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AAAAAAAAAAAAAAAAAAAuEFWjvnP6JEhySptqC94AAAAAAAAAAAAAAAAAAACisC2cQ1OXvaQ1NOuMjrPjUgAAAAAAAAAAAAAAAAAAAAAAEjV/cELaRJmZENw88WFgAAAAAAAAAAAAAAAAAAAAkNKgvUQQb/Lcgm2JVMzIikQAAAAAAAAAAAAAAAAAAAAAABUswmnFiyDPobvZ6KfImQAAAAAAAAAAAAAAAAAAAFtsSgjYgrN575fwTI+StMEJAAAAAAAAAAAAAAAAAAAAAAAuCQTzka/dmZhMW6VA1SEAAAAAAAAAAAAAAAAAAAAa4PoE+jCgIpSiu2RSyc8x5AAAAAAAAAAAAAAAAAAAAAAAE316Hx0Ik6JFvmWf0zs8AAAAAAAAAAAAAAAAAAAAj65E5LBgofKDSaze8gQ0bZYAAAAAAAAAAAAAAAAAAAAAABEmh6qXIiIGToR/Estq2wAAAAAAAAAAAAAAAAAAAA2DPBNW7lWvS9fH2DYK58V4AAAAAAAAAAAAAAAAAAAAAAAlTJG2sSUVJdi3YqavfPMAAAAAAAAAAAAAAAAAAADhfgqpS99Fz3/A0UeV42TdsAAAAAAAAAAAAAAAAAAAAAAAAF5wAEu0+49fHB0p3lc3AAAAAAAAAAAAAAAAAAAALNrztif7n5RNuPfXmimgo6YAAAAAAAAAAAAAAAAAAAAAAAgF+HKHFNgttl6OFUX1SgAAAAAAAAAAAAAAAAAAAFYsbDx4oISQ0lcD0Lu4124gAAAAAAAAAAAAAAAAAAAAAAANeviMdWzubFev5gfFBdU="
@@ -7907,6 +7975,10 @@
7907
7975
  "error_kind": "string",
7908
7976
  "string": "Index out of bounds"
7909
7977
  },
7978
+ "4215903597095405243": {
7979
+ "error_kind": "string",
7980
+ "string": "offchain message anchor timestamp is implausibly far in the future"
7981
+ },
7910
7982
  "9530675838293881722": {
7911
7983
  "error_kind": "string",
7912
7984
  "string": "Writer did not write all data"
@@ -8018,23 +8090,17 @@
8018
8090
  ],
8019
8091
  "return_type": null
8020
8092
  },
8021
- "bytec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/SnhknPbI4Us0S9gjJOgxW3Ly9l/oLn7ZfMkNR+Rl3n3vZLXwgm/rP4Ky+P7VCu49ippPFUlChNfumxxthwivOEQUgUKEV3/VitJztr8vhC0XmTV8WzF33pphKOOPJd9Leaw+SnGfExanMXidc5npz/bKBT9jzHins/6XbOXUM9XKCzw9J4gMe5y9wNNDPSel4Gf2A55vDJ9uXmvS4+wFngYv/jZ/CaCBiksyLrMmK/DyTeuOeNLNYhvKNvffI50OJTr/PbKTK3F2ciXctNfOKy//MdGPcYv6+WPcweIf43pNf4xrcEJe08teKpWNW38dSvnrbn0sLa5DHv3qYxD2hKEiTxrKM7KZF6vS6Ux7rG9xibexfGZpZ3PdzGjdqtj85rXRxob6rq5NkvzGML3KKxf2cG2ylHiVG+YAvUti8Y62Zt2CmFo00x+eNkUstdcLF8/Ou/cqX2Lr6W3R1u6edP/khQIZeqrgrQNPPL6ya8ANHZ/Y/9Go8ON7zQ0djhOH/5yfnsGGeUkB/8ttbZ+89KqQ/Dj1xDMjgyftidXEJxU3DDsUaTu40h0yLHvTH8j4+6C0a8nJ1Kq5KoVpRnLyazsXGnvn1XonDD9JoLbDIJMOxZmrtdZMkW5MiqmnUSQvj938MXnFOgSj7ALp+ZKZjx796hu7LzTV8/8AGfoiAfVXAQA=",
8022
8094
  "custom_attributes": [
8023
8095
  "abi_utility"
8024
8096
  ],
8025
- "debug_symbols": "tZzdbhy3EoTfRde+mG7++1UCI1AcJRAgyIZiH+Ag8LuH3cNirWIMs9pd3Xg/RztVJIddQ3IU/333+8Nv3//89fH5jy9/3X385e+7314en54e//z16cvn+2+PX577f/37brM/cpC7j+HDXU7l7mPun7n/52afMj51fIbxGcdnGp95fJbxWcdn2z/L0CtDrwy90q+XzaBfIGrQBtT+VYkGCgiACEiADCiACmgD2gaAcoNyg3KDcjPlZJABBVABbYeybQABKMAuLwYFUAFtgGwAASggACIgAaAsUBYoC5QVygplhbJCWaGsUFYoK5QVygrlAOUA5QDlAOUA5QDl0JV1MyiAC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tyjqO74E7u64/sLVd5W4/I9ihqO71EsNS7co7hYY7FHUfPxFUM9PDeth+em6zt76R6Fd/7oFoN3h9dPa4nLukOP31bv4vEriW96Yy/eZmhTzqO7BN7V491R37g7Ltwn8KuTnovrwx/ehVpL/IEOuXSrwC9Pai7cK1g15dJ1vvfleKceTtP1vOGylb6XP7DUX0/Ggp9L/RiC252M+dWOgZbIhfrJLk5r4S8iq+2PWWfh5Dix1c1rroYPqRidXjlBDcWzT6ou+mQ5Q50ryzZDXfXJKlbDPKmN4eyJ+atI/QNhpIe39tc9cjpbPplx/6dHdJVHmVVfPOskv2IVk8qc19WThP/P7dXl1pTj10xONnTK5V/yqEm4INv/NoDXdbHOMjsv1l9O0TWv7i1Xyhp2j/LX7YiFq6l4siJ7lUiaVdZ4/4sJ4fA3Tn7XDs8ESBJ3RJY31/Pm1sX3NFaHSNnh1uaTrUsLk5f37ce7Tw/PZ3974MWknh/uPj7ejx+//Hj6dPLb7///ht/gbxd8e/766f7zj+d7U+IfMGj//NVqpt62Pbb8/vZG28+pDaqkvv1kX4S0X6f261zev1h7/gU=",
8026
8098
  "is_unconstrained": true,
8027
8099
  "name": "offchain_receive"
8028
8100
  },
8029
8101
  {
8030
8102
  "abi": {
8031
- "error_types": {
8032
- "10835969307644359280": {
8033
- "error_kind": "fmtstring",
8034
- "item_types": [],
8035
- "length": 40
8036
- }
8037
- },
8103
+ "error_types": {},
8038
8104
  "parameters": [
8039
8105
  {
8040
8106
  "name": "scope",
@@ -8059,7 +8125,7 @@
8059
8125
  "custom_attributes": [
8060
8126
  "abi_utility"
8061
8127
  ],
8062
- "debug_symbols": "dZHdCoMwDIXfJddeNHObP68yhlSNUihVajsY0ndfKjr1wpsm6cn5CMkMLdW+r5TphgnK1wy1VVqrvtJDI50aDP/OIOKDCGUaQgKbVDlLFJVDLxNGack4KI3XOoGP1H5pmkZpluikZVUkQKblyMBOaYpZSHa3uLaiKB6P1c55cfsjUKQnCF5DsieuiCzfARme/Ldrf47p6s/vuA/Aw4Q3l7JR9rTDEFFWyVrTWnbeNAfVfcdN2W4w2qGh1luKpEVj9g8=",
8128
+ "debug_symbols": "dZHdCoMwDIXfJddetE7nz6uMIVWjFEqV2g6G9N2XSp164U2T9OR8hGSFHls3NlIP0wL1a4XWSKXk2KipE1ZOmn5XYOHhHOqH9wnsUmMNYlBOvUSYhUFtodZOqQQ+QrmtaZmF3qIVhlSWAOqeIgEHqTBkPjnc7N7KWZXn0U55lf4RnGUXCL+HFE8eEUV5AIr04k/v/SV/RH+Z8WOAijb0plJ00lx26APKSNEqjOXgdHdS7Xfelf0Gs5k67J3BQNo0Yv8A",
8063
8129
  "is_unconstrained": true,
8064
8130
  "name": "sync_state"
8065
8131
  },
@@ -8092,7 +8158,7 @@
8092
8158
  }
8093
8159
  ],
8094
8160
  "name": "SchnorrInitializerlessAccount",
8095
- "noir_version": "1.0.0-beta.22+c57152f91260ecdb9faad4efc20abb14b6d2ece7",
8161
+ "noir_version": "1.0.0-beta.25+75061fab15986eedee4e7d9104ff87dd9fa4ca10",
8096
8162
  "outputs": {
8097
8163
  "globals": {},
8098
8164
  "structs": {
@@ -8456,5 +8522,5 @@
8456
8522
  }
8457
8523
  },
8458
8524
  "transpiled": true,
8459
- "aztec_version": "0.0.1-commit.b8a057fa"
8525
+ "aztec_version": "0.0.1-commit.be03c316"
8460
8526
  }