You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Aztec is in full-speed development. Literally every version breaks compatibility with the previous ones. This page attempts to target errors and difficulties you might encounter when upgrading, and how to resolve them.
8
8
9
+
## TBD
10
+
11
+
### [Aztec.nr] Rework `NoteGetterOptions::select`
12
+
13
+
The `select` function in both `NoteGetterOptions` and `NoteViewerOptions` no longer takes an `Option` of a comparator, but instead requires an explicit comparator to be passed. Additionally, the order of the parameters has been changed so that they are `(lhs, operator, rhs)`. These two changes should make invocations of the function easier to read:
### [Aztec.nr] Remove `OwnedNote` and create `UintNote`
23
+
11
24
`OwnedNote` allowed having a U128 `value` in the custom note while `ValueNote` restricted to just a Field.
12
25
13
26
We have removed `OwnedNote` but are introducing a more genric `UintNote` within aztec.nr
27
+
14
28
```
15
29
#[aztec(note)]
16
30
struct UintNote {
@@ -24,9 +38,11 @@ struct UintNote {
24
38
```
25
39
26
40
### [TXE] logging
41
+
27
42
You can now use `debug_log()` within your contract to print logs when using the TXE
28
43
29
44
Remember to set the following environment variables to activate debug logging:
45
+
30
46
```bash
31
47
export DEBUG="aztec:*"
32
48
export LOG_LEVEL="debug"
@@ -36,7 +52,7 @@ export LOG_LEVEL="debug"
36
52
37
53
`is_valid_impl` method in account contract asserted if signature was true. Instead now we will return the verification to give flexibility to developers to handle it as they please.
38
54
39
-
```diff
55
+
````diff
40
56
- let verification = std::ecdsa_secp256k1::verify_signature(public_key.x, public_key.y, signature, hashed_message);
41
57
- assert(verification == true);
42
58
- true
@@ -57,7 +73,7 @@ Public keys (ivpk, ovpk, npk, tpk) should no longer be fetched using the old `ge
Copy file name to clipboardexpand all lines: docs/docs/reference/developer_references/smart_contract_reference/storage/private_state.md
+5-6
Original file line number
Diff line number
Diff line change
@@ -228,7 +228,6 @@ An example of such options is using the [filter_notes_min_sum (GitHub link)](htt
228
228
229
229
This function has the same behavior as `pop_notes` above but it does not delete the notes.
230
230
231
-
232
231
### `remove`
233
232
234
233
Will remove a note from the `PrivateSet` if it previously has been read from storage, e.g. you have fetched it through a `get_notes` call. This is useful when you want to remove a note that you have previously read from storage and do not have to read it again.
@@ -255,7 +254,7 @@ You can view the implementation [here (GitHub link)](https://github.com/AztecPro
255
254
256
255
### `selects: BoundedVec<Option<Select>, N>`
257
256
258
-
`selects` is a collection of filtering criteria, specified by `Select { property_selector: PropertySelector, value: Field, comparator: u3 }` structs. It instructs the data oracle to find notes whose serialized field (as specified by the PropertySelector) matches the provided `value`, according to the `comparator`. The PropertySelector is in turn specified as having an `index` (nth position of the selected field in the serialized note), an `offset` (byte offset inside the selected serialized field) and `length` (bytes to read of the field from the offset)
257
+
`selects` is a collection of filtering criteria, specified by `Select { property_selector: PropertySelector, comparator: u8, value: Field }` structs. It instructs the data oracle to find notes whose serialized field (as specified by the `PropertySelector`) matches the provided `value`, according to the `comparator`. The PropertySelector is in turn specified as having an `index` (nth position of the selected field in the serialized note), an `offset` (byte offset inside the selected serialized field) and `length` (bytes to read of the field from the offset). These values are not expected to be manually computed, but instead specified by passing functions autogenerated from the note definition.
259
258
260
259
### `sorts: BoundedVec<Option<Sort>, N>`
261
260
@@ -329,17 +328,17 @@ This method sets the status of notes to retrieve (active or nullified).
329
328
330
329
#### Example 1
331
330
332
-
The following code snippet creates an instance of `NoteGetterOptions`, which has been configured to find the cards that belong to `account_address`. The returned cards are sorted by their points in descending order, and the first `offset` cards with the highest points are skipped.
331
+
The following code snippet creates an instance of `NoteGetterOptions`, which has been configured to find the cards that belong to an account with nullifying key hash equal to `account_npk_m_hash`. The returned cards are sorted by their points in descending order, and the first `offset` cards with the highest points are skipped.
The first value of `.select` and `.sort`is the index of a field in a note type. For the note type`CardNote` that has the following fields:
335
+
The first value of `.select` and `.sort`indicates the property of the note we're looking for. For this we use helper functions that are autogenerated from the note definition.`CardNote` that has the following fields:
The indices are: 0 for `points`, 1 for `randomness`, and 2 for `npk_m_hash`.
339
+
`CardNote::properties()` will return a struct with the values to pass for each field, which are related to their indices inside the `CardNote` struct, internal offset and length.
341
340
342
-
In the example, `.select(2, account_address, Option::none())` matches the 2nd field of `CardNote`, which is `npk_m_hash`, and returns the cards whose `npk_m_hash` field equals `account_npk_m_hash`, equality is the comparator used because because including no comparator (the third argument) defaults to using the equality comparator. The current possible values of Comparator are specified in the Note Getter Options implementation linked above.
341
+
In the example, `.select(CardNote::properties().npk_m_hash, Comparator.EQ, account_npk_m_hash)` matches notes which have the `npk_m_hash` field set to `account_npk_m_hash`. In this case we're using the equality comparator, but other operations exist in the `Comparator` utility struct.
343
342
344
343
`.sort(0, SortOrder.DESC)` sorts the 0th field of `CardNote`, which is `points`, in descending order.
0 commit comments