Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: allow expressions in constant generation #5839

Merged
merged 1 commit into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ Functionally similar to [`get_notes`](#get_notes), but executed unconstrained an

#include_code view_notes /noir-projects/aztec-nr/value-note/src/balance_utils.nr rust

There's also a limit on the maximum number of notes that can be returned in one go. To find the current limit, refer to [this file](https://github.com/AztecProtocol/aztec-packages/blob/#include_aztec_version/noir-projects/noir-protocol-circuits/crates/types/src/constants.nr) and look for `MAX_NOTES_PER_PAGE`.
There's also a limit on the maximum number of notes that can be returned in one go. To find the current limit, refer to [this file](https://github.com/AztecProtocol/aztec-packages/blob/#include_aztec_version/noir-projects/aztec-nr/aztec/src/note/constants.nr) and look for `MAX_NOTES_PER_PAGE`.

The key distinction is that this method is unconstrained. It does not perform a check to verify if the notes actually exist, which is something the [`get_notes`](#get_notes) method does under the hood. Therefore, it should only be used in an unconstrained contract function.

Expand Down
55 changes: 39 additions & 16 deletions l1-contracts/src/core/libraries/ConstantsGen.sol
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,10 @@ library Constants {
uint256 internal constant FUNCTION_SELECTOR_NUM_BYTES = 4;
uint256 internal constant ARGS_HASH_CHUNK_LENGTH = 64;
uint256 internal constant ARGS_HASH_CHUNK_COUNT = 64;
uint256 internal constant MAX_ARGS_LENGTH = ARGS_HASH_CHUNK_COUNT * ARGS_HASH_CHUNK_LENGTH;
uint256 internal constant INITIALIZATION_SLOT_SEPARATOR = 1000_000_000;
uint256 internal constant INITIAL_L2_BLOCK_NUM = 1;
uint256 internal constant BLOB_SIZE_IN_BYTES = 126976;
uint256 internal constant BLOB_SIZE_IN_BYTES = 31 * 4096;
uint256 internal constant NESTED_CALL_L2_GAS_BUFFER = 20000;
uint256 internal constant MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS = 16200;
uint256 internal constant MAX_PACKED_BYTECODE_SIZE_PER_PRIVATE_FUNCTION_IN_FIELDS = 3000;
Expand All @@ -89,39 +90,61 @@ library Constants {
0x85864497636cf755ae7bde03f267ce01a520981c21c3682aaf82a631;
uint256 internal constant DEPLOYER_CONTRACT_ADDRESS =
0x1b5ecf3d26907648cf737f4304759b8c5850478e839e72f8ce1f5791b286e8f2;
uint256 internal constant L1_TO_L2_MESSAGE_ORACLE_CALL_LENGTH = 17;
uint256 internal constant MAX_NOTE_FIELDS_LENGTH = 20;
uint256 internal constant GET_NOTE_ORACLE_RETURN_LENGTH = 23;
uint256 internal constant MAX_NOTES_PER_PAGE = 10;
uint256 internal constant VIEW_NOTE_ORACLE_RETURN_LENGTH = 212;
uint256 internal constant AZTEC_ADDRESS_LENGTH = 1;
uint256 internal constant CALL_CONTEXT_LENGTH = 21;
uint256 internal constant GAS_SETTINGS_LENGTH = 10;
uint256 internal constant DIMENSION_GAS_SETTINGS_LENGTH = 3;
uint256 internal constant GAS_FEES_LENGTH = 3;
uint256 internal constant GAS_LENGTH = 3;
uint256 internal constant GAS_SETTINGS_LENGTH = 1 + 3 * DIMENSION_GAS_SETTINGS_LENGTH;
uint256 internal constant CALL_CONTEXT_LENGTH = 8 + GAS_SETTINGS_LENGTH + GAS_LENGTH;
uint256 internal constant CONTENT_COMMITMENT_LENGTH = 4;
uint256 internal constant CONTRACT_INSTANCE_LENGTH = 6;
uint256 internal constant CONTRACT_STORAGE_READ_LENGTH = 2;
uint256 internal constant CONTRACT_STORAGE_UPDATE_REQUEST_LENGTH = 2;
uint256 internal constant ETH_ADDRESS_LENGTH = 1;
uint256 internal constant FUNCTION_DATA_LENGTH = 2;
uint256 internal constant FUNCTION_LEAF_PREIMAGE_LENGTH = 5;
uint256 internal constant GLOBAL_VARIABLES_LENGTH = 9;
uint256 internal constant HEADER_LENGTH = 23;
uint256 internal constant GLOBAL_VARIABLES_LENGTH = 6 + GAS_FEES_LENGTH;
uint256 internal constant APPEND_ONLY_TREE_SNAPSHOT_LENGTH = 2;
uint256 internal constant L1_TO_L2_MESSAGE_LENGTH = 6;
uint256 internal constant L2_TO_L1_MESSAGE_LENGTH = 2;
uint256 internal constant MAX_BLOCK_NUMBER_LENGTH = 2;
uint256 internal constant NULLIFIER_KEY_VALIDATION_REQUEST_LENGTH = 4;
uint256 internal constant NULLIFIER_KEY_VALIDATION_REQUEST_CONTEXT_LENGTH = 5;
uint256 internal constant PARTIAL_STATE_REFERENCE_LENGTH = 6;
uint256 internal constant PRIVATE_CALL_STACK_ITEM_LENGTH = 238;
uint256 internal constant PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH = 235;
uint256 internal constant PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH = 222;
uint256 internal constant STATE_REFERENCE_LENGTH = 8;
uint256 internal constant READ_REQUEST_LENGTH = 2;
uint256 internal constant SIDE_EFFECT_LENGTH = 2;
uint256 internal constant SIDE_EFFECT_LINKED_TO_NOTE_HASH_LENGTH = 3;
uint256 internal constant STATE_REFERENCE_LENGTH =
APPEND_ONLY_TREE_SNAPSHOT_LENGTH + PARTIAL_STATE_REFERENCE_LENGTH;
uint256 internal constant TX_CONTEXT_DATA_LENGTH = 4;
uint256 internal constant TX_REQUEST_LENGTH = 18;
uint256 internal constant ENQUEUE_PUBLIC_FUNCTION_CALL_RETURN_LENGTH = 25;
uint256 internal constant TX_REQUEST_LENGTH =
2 + TX_CONTEXT_DATA_LENGTH + FUNCTION_DATA_LENGTH + GAS_SETTINGS_LENGTH;
uint256 internal constant HEADER_LENGTH = APPEND_ONLY_TREE_SNAPSHOT_LENGTH
+ CONTENT_COMMITMENT_LENGTH + STATE_REFERENCE_LENGTH + GLOBAL_VARIABLES_LENGTH;
uint256 internal constant PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH = CALL_CONTEXT_LENGTH + 3
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noir tests were failing when I had this wrong. So maybe it doesn't need laser-focused review.

+ MAX_BLOCK_NUMBER_LENGTH + (SIDE_EFFECT_LENGTH * MAX_NOTE_HASH_READ_REQUESTS_PER_CALL)
+ (READ_REQUEST_LENGTH * MAX_NULLIFIER_READ_REQUESTS_PER_CALL)
+ (NULLIFIER_KEY_VALIDATION_REQUEST_LENGTH * MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_CALL)
+ (SIDE_EFFECT_LENGTH * MAX_NEW_NOTE_HASHES_PER_CALL)
+ (SIDE_EFFECT_LINKED_TO_NOTE_HASH_LENGTH * MAX_NEW_NULLIFIERS_PER_CALL)
+ MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL + MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL
+ (L2_TO_L1_MESSAGE_LENGTH * MAX_NEW_L2_TO_L1_MSGS_PER_CALL) + 2
+ (SIDE_EFFECT_LENGTH * MAX_ENCRYPTED_LOGS_PER_CALL)
+ (SIDE_EFFECT_LENGTH * MAX_UNENCRYPTED_LOGS_PER_CALL) + 2 + HEADER_LENGTH + 2;
uint256 internal constant PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH = CALL_CONTEXT_LENGTH + 2
+ (READ_REQUEST_LENGTH * MAX_NULLIFIER_READ_REQUESTS_PER_CALL)
+ (READ_REQUEST_LENGTH * MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_CALL)
+ (CONTRACT_STORAGE_UPDATE_REQUEST_LENGTH * MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL)
+ (CONTRACT_STORAGE_READ_LENGTH * MAX_PUBLIC_DATA_READS_PER_CALL)
+ MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL + (SIDE_EFFECT_LENGTH * MAX_NEW_NOTE_HASHES_PER_CALL)
+ (SIDE_EFFECT_LINKED_TO_NOTE_HASH_LENGTH * MAX_NEW_NULLIFIERS_PER_CALL)
+ (L2_TO_L1_MESSAGE_LENGTH * MAX_NEW_L2_TO_L1_MSGS_PER_CALL) + 2
+ (SIDE_EFFECT_LENGTH * MAX_UNENCRYPTED_LOGS_PER_CALL) + 1 + HEADER_LENGTH + AZTEC_ADDRESS_LENGTH /* revert_code */
+ 1 + GAS_LENGTH;
uint256 internal constant PRIVATE_CALL_STACK_ITEM_LENGTH =
AZTEC_ADDRESS_LENGTH + FUNCTION_DATA_LENGTH + PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH;
uint256 internal constant ENQUEUE_PUBLIC_FUNCTION_CALL_RETURN_LENGTH =
2 + FUNCTION_DATA_LENGTH + CALL_CONTEXT_LENGTH;
uint256 internal constant GET_NOTES_ORACLE_RETURN_LENGTH = 674;
uint256 internal constant NOTE_HASHES_NUM_BYTES_PER_BASE_ROLLUP = 2048;
uint256 internal constant NULLIFIERS_NUM_BYTES_PER_BASE_ROLLUP = 2048;
Expand Down
1 change: 1 addition & 0 deletions noir-projects/aztec-nr/aztec/src/note.nr
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
mod constants;
mod lifecycle;
mod note_getter;
mod note_getter_options;
Expand Down
6 changes: 6 additions & 0 deletions noir-projects/aztec-nr/aztec/src/note/constants.nr
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
global MAX_NOTE_FIELDS_LENGTH: u64 = 20;
// The plus 1 is 1 extra field for nonce.
// + 2 for EXTRA_DATA: [number_of_return_notes, contract_address]
global GET_NOTE_ORACLE_RETURN_LENGTH: u64 = MAX_NOTE_FIELDS_LENGTH + 1 + 2;
global MAX_NOTES_PER_PAGE: u64 = 10;
global VIEW_NOTE_ORACLE_RETURN_LENGTH: u64 = MAX_NOTES_PER_PAGE * (MAX_NOTE_FIELDS_LENGTH + 1) + 2;
8 changes: 2 additions & 6 deletions noir-projects/aztec-nr/aztec/src/note/note_getter.nr
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
use dep::protocol_types::{
constants::{
MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, GET_NOTE_ORACLE_RETURN_LENGTH, GET_NOTES_ORACLE_RETURN_LENGTH,
MAX_NOTES_PER_PAGE, VIEW_NOTE_ORACLE_RETURN_LENGTH
}
};
use dep::protocol_types::{constants::{MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, GET_NOTES_ORACLE_RETURN_LENGTH}};
use crate::context::PrivateContext;
use crate::note::{
constants::{GET_NOTE_ORACLE_RETURN_LENGTH, MAX_NOTES_PER_PAGE, VIEW_NOTE_ORACLE_RETURN_LENGTH},
note_getter_options::{NoteGetterOptions, Select, Sort, SortOrder, Comparator, NoteStatus, PropertySelector},
note_interface::NoteInterface, note_viewer_options::NoteViewerOptions,
utils::compute_note_hash_for_consumption
Expand Down
3 changes: 2 additions & 1 deletion noir-projects/aztec-nr/aztec/src/note/note_viewer_options.nr
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use dep::std::option::Option;
use crate::note::note_getter_options::{PropertySelector, Select, Sort, Comparator, NoteStatus};
use dep::protocol_types::{constants::MAX_NOTES_PER_PAGE, traits::ToField};
use dep::protocol_types::traits::ToField;
use crate::note::note_interface::NoteInterface;
use crate::note::constants::MAX_NOTES_PER_PAGE;

// docs:start:NoteViewerOptions
struct NoteViewerOptions<Note, N> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
use dep::protocol_types::{address::AztecAddress, constants::L1_TO_L2_MESSAGE_ORACLE_CALL_LENGTH};
use dep::protocol_types::{address::AztecAddress};

global L1_TO_L2_MESSAGE_ORACLE_CALL_LENGTH: u64 = 17;

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious why this one was moved out of constants.nr

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to move out things that were only used in Noir (and therefore were not needed in TS, Solidity).

// Obtains membership witness (index and sibling path) for a message in the L1 to L2 message tree.
#[oracle(getL1ToL2MembershipWitness)]
Expand Down
3 changes: 2 additions & 1 deletion noir-projects/aztec-nr/aztec/src/state_vars/private_set.nr
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
use dep::protocol_types::{
constants::{MAX_NOTES_PER_PAGE, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL},
constants::MAX_NOTE_HASH_READ_REQUESTS_PER_CALL,
abis::side_effect::{SideEffect, SideEffectLinkedToNoteHash}
};
use crate::context::{PrivateContext, PublicContext, Context};
use crate::note::{
constants::MAX_NOTES_PER_PAGE,
lifecycle::{create_note, create_note_hash_from_public, destroy_note},
note_getter::{get_notes, view_notes}, note_getter_options::NoteGetterOptions,
note_header::NoteHeader, note_interface::NoteInterface, note_viewer_options::NoteViewerOptions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ use dep::aztec::prelude::{AztecAddress, FunctionSelector, PrivateContext, NoteHe
use dep::aztec::{
protocol_types::{
traits::{ToField, Serialize, FromField},
constants::{MAX_NOTES_PER_PAGE, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL}
constants::MAX_NOTE_HASH_READ_REQUESTS_PER_CALL,
},
context::{PublicContext, Context}, note::note_getter::view_notes, state_vars::PrivateSet
context::{PublicContext, Context}, note::note_getter::view_notes, state_vars::PrivateSet,
note::constants::MAX_NOTES_PER_PAGE,
};
use dep::std;
use dep::std::{option::Option};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ mod cards;
mod game;

contract CardGame {
use dep::aztec::protocol_types::{abis::function_selector::FunctionSelector, address::AztecAddress, constants::MAX_NOTES_PER_PAGE};
use dep::aztec::protocol_types::{abis::function_selector::FunctionSelector, address::AztecAddress};
use dep::aztec::{context::Context, hash::pedersen_hash, state_vars::{Map, PublicMutable}};

use dep::value_note::{balance_utils, value_note::{ValueNote, VALUE_NOTE_LEN}};

use dep::aztec::note::note_header::NoteHeader;
use dep::aztec::note::{note_header::NoteHeader, constants::MAX_NOTES_PER_PAGE};

use crate::cards::{PACK_CARDS, Deck, Card, get_pack_cards, compute_deck_strength};
use crate::game::{NUMBER_OF_PLAYERS, NUMBER_OF_CARDS_DECK, PLAYABLE_CARDS, PlayerEntry, Game, GAME_SERIALIZED_LEN};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ contract Test {

use dep::aztec::protocol_types::{
abis::private_circuit_public_inputs::PrivateCircuitPublicInputs,
constants::{MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, MAX_NOTES_PER_PAGE}, traits::Serialize
constants::{MAX_NOTE_HASH_READ_REQUESTS_PER_CALL}, traits::Serialize
};

use dep::aztec::note::constants::MAX_NOTES_PER_PAGE;

use dep::aztec::state_vars::shared_mutable::SharedMutablePrivateGetter;

// docs:start:unencrypted_import
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,32 +93,32 @@ impl Serialize<PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH> for PrivateCircuitPublicInp

fields.extend_from_array(self.max_block_number.serialize());

for i in 0..MAX_NOTE_HASH_READ_REQUESTS_PER_CALL{
for i in 0..self.note_hash_read_requests.len() {
fields.extend_from_array(self.note_hash_read_requests[i].serialize());
}
for i in 0..MAX_NULLIFIER_READ_REQUESTS_PER_CALL{
for i in 0..self.nullifier_read_requests.len() {
fields.extend_from_array(self.nullifier_read_requests[i].serialize());
}
for i in 0..MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_CALL{
for i in 0..self.nullifier_key_validation_requests.len() {
fields.extend_from_array(self.nullifier_key_validation_requests[i].serialize());
}
for i in 0..MAX_NEW_NOTE_HASHES_PER_CALL{
for i in 0..self.new_note_hashes.len() {
fields.extend_from_array(self.new_note_hashes[i].serialize());
}
for i in 0..MAX_NEW_NULLIFIERS_PER_CALL{
for i in 0..self.new_nullifiers.len() {
fields.extend_from_array(self.new_nullifiers[i].serialize());
}
fields.extend_from_array(self.private_call_stack_hashes);
fields.extend_from_array(self.public_call_stack_hashes);
for i in 0..MAX_NEW_L2_TO_L1_MSGS_PER_CALL {
for i in 0..self.new_l2_to_l1_msgs.len() {
fields.extend_from_array(self.new_l2_to_l1_msgs[i].serialize());
}
fields.push(self.start_side_effect_counter as Field);
fields.push(self.end_side_effect_counter as Field);
for i in 0..MAX_ENCRYPTED_LOGS_PER_CALL{
for i in 0..self.encrypted_logs_hashes.len() {
fields.extend_from_array(self.encrypted_logs_hashes[i].serialize());
}
for i in 0..MAX_UNENCRYPTED_LOGS_PER_CALL{
for i in 0..self.unencrypted_logs_hashes.len() {
fields.extend_from_array(self.unencrypted_logs_hashes[i].serialize());
}
fields.push(self.encrypted_log_preimages_length);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use crate::{
traits::{Hash, Serialize, Deserialize, Empty}, utils::reader::Reader
};

struct PublicCircuitPublicInputs{
struct PublicCircuitPublicInputs {
call_context: CallContext,

args_hash: Field,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use crate::{
abis::side_effect::{OrderedValue, ContractScopedOrderedValue},
traits::{Empty, Serialize, Deserialize}, address::AztecAddress
traits::{Empty, Serialize, Deserialize}, address::AztecAddress,
constants::READ_REQUEST_LENGTH,
};
use dep::std::cmp::Eq;

global READ_REQUEST_SERIALIZED_LEN = 2;
global READ_REQUEST_CONTEXT_SERIALIZED_LEN = 3;

struct ReadRequest {
Expand Down Expand Up @@ -37,14 +37,14 @@ impl Empty for ReadRequest {
}
}

impl Serialize<READ_REQUEST_SERIALIZED_LEN> for ReadRequest {
fn serialize(self) -> [Field; READ_REQUEST_SERIALIZED_LEN] {
impl Serialize<READ_REQUEST_LENGTH> for ReadRequest {
fn serialize(self) -> [Field; READ_REQUEST_LENGTH] {
[self.value, self.counter as Field]
}
}

impl Deserialize<READ_REQUEST_SERIALIZED_LEN> for ReadRequest {
fn deserialize(values: [Field; READ_REQUEST_SERIALIZED_LEN]) -> Self {
impl Deserialize<READ_REQUEST_LENGTH> for ReadRequest {
fn deserialize(values: [Field; READ_REQUEST_LENGTH]) -> Self {
Self {
value: values[0],
counter: values[1] as u32,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
use crate::{
address::AztecAddress, constants::GENERATOR_INDEX__SIDE_EFFECT,
traits::{Empty, Hash, Serialize, Deserialize}
traits::{Empty, Hash, Serialize, Deserialize},
constants::{SIDE_EFFECT_LENGTH, SIDE_EFFECT_LINKED_TO_NOTE_HASH_LENGTH},
};
use dep::std::cmp::Eq;

global SIDE_EFFECT_SERIALIZED_LEN = 2;

trait Ordered {
fn counter(self) -> u32;
}
Expand Down Expand Up @@ -64,22 +63,22 @@ impl Hash for SideEffect {
}
}

impl Serialize<SIDE_EFFECT_SERIALIZED_LEN> for SideEffect {
fn serialize(self) -> [Field; SIDE_EFFECT_SERIALIZED_LEN] {
impl Serialize<SIDE_EFFECT_LENGTH> for SideEffect {
fn serialize(self) -> [Field; SIDE_EFFECT_LENGTH] {
[self.value, self.counter as Field]
}
}

impl Deserialize<SIDE_EFFECT_SERIALIZED_LEN> for SideEffect {
fn deserialize(values: [Field; SIDE_EFFECT_SERIALIZED_LEN]) -> Self {
impl Deserialize<SIDE_EFFECT_LENGTH> for SideEffect {
fn deserialize(values: [Field; SIDE_EFFECT_LENGTH]) -> Self {
Self {
value: values[0],
counter: values[1] as u32,
}
}
}

struct SideEffectLinkedToNoteHash{
struct SideEffectLinkedToNoteHash {
value: Field,
note_hash: Field,
counter: u32,
Expand Down Expand Up @@ -126,14 +125,14 @@ impl Hash for SideEffectLinkedToNoteHash {
}
}

impl Serialize<3> for SideEffectLinkedToNoteHash {
fn serialize(self) -> [Field; 3] {
impl Serialize<SIDE_EFFECT_LINKED_TO_NOTE_HASH_LENGTH> for SideEffectLinkedToNoteHash {
fn serialize(self) -> [Field; SIDE_EFFECT_LINKED_TO_NOTE_HASH_LENGTH] {
[self.value, self.note_hash, self.counter as Field]
}
}

impl Deserialize<3> for SideEffectLinkedToNoteHash {
fn deserialize(values: [Field; 3]) -> Self {
impl Deserialize<SIDE_EFFECT_LINKED_TO_NOTE_HASH_LENGTH> for SideEffectLinkedToNoteHash {
fn deserialize(values: [Field; SIDE_EFFECT_LINKED_TO_NOTE_HASH_LENGTH]) -> Self {
Self {
value: values[0],
note_hash: values[1],
Expand Down
Loading
Loading