refactor!: Notes implementing Packable<N>#12004
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Packable<N>
| /// ... | ||
| /// } | ||
| /// } | ||
| comptime fn generate_note_interface(s: StructDefinition, note_type_id: Field) -> Quoted { |
There was a problem hiding this comment.
I separated original generate_note_interface to generate_note_interface_for_partial_note and generate_note_interface because for normal notes we can use poseidon2 which is much cheaper. It also makes it clearer what is partial notes related complexity and what is not.
| quote { packed_content }, // "packed_content" is argument of NoteInterface::unpack_content | ||
| 0, | ||
| packing_enabled, | ||
| ); |
There was a problem hiding this comment.
All this code was related to pack_content and unpack_content ^.
| note_interface::{NoteInterface, NullifiableNote}, | ||
| note_viewer_options::NoteViewerOptions, | ||
| retrieved_note::RetrievedNote, | ||
| utils::compute_note_hash_and_optionally_a_nullifier as utils_compute_note_hash_and_optionally_a_nullifier, |
There was a problem hiding this comment.
This re-export was unused and I see no reason for having it. I think it was just forgottent.
|
|
||
| // docs:start:value-note-def | ||
| #[note] | ||
| #[derive(Eq)] |
There was a problem hiding this comment.
Should have done this in the PR down the stack as this became unblocked after nuking of the NoteHeader.
| // Stores an ECDSA public key composed of two 32-byte elements | ||
| // TODO: Do we need to include a nonce, in case we want to read/nullify/recreate with the same pubkey value? | ||
| #[note_custom_interface] | ||
| #[note] |
There was a problem hiding this comment.
With the separation of the packing functionality from the NoteInterface it no longer made sense to use the #[note_custom_interface] here because the only custom thing here was the packing.
| /// - If the deserialization logic encounters a type it does not support. | ||
| /// - If an incorrect number of fields are consumed when deserializing a string. | ||
| pub comptime fn generate_deserialize_from_fields<N>( | ||
| pub comptime fn generate_deserialize_from_fields( |
There was a problem hiding this comment.
The N here had no use.
Docs PreviewHey there! 👋 You can check your preview at https://67af767f287cbd166c251616--aztec-docs-dev.netlify.app |
Changes to public function bytecode sizes
🧾 Summary (100% most significant diffs)
Full diff report 👇
|
| pub comptime fn note_custom_interface(s: StructDefinition) -> Quoted { | ||
| let note_properties = generate_note_properties(s); | ||
| let (packable_impl, note_packed_len) = derive_packable_if_not_implemented_and_get_len(s); | ||
| // TODO(https://github.com/AztecProtocol/aztec-packages/issues/12012): This is broken |
There was a problem hiding this comment.
This is an issue which I uncovered in this PR.
| }, | ||
| }; | ||
|
|
||
| // TODO(#12008): Remove the need for the manual import of `Packable` trait here. This is a bug in macros. |
There was a problem hiding this comment.
This issue was already present before because we used Packable in the implementations of the pack_content and unpack_content function.s
| } | ||
|
|
||
| // TODO(#12013): We need to do this hack because NoteDao no longer populates noteTypeId | ||
| note.noteTypeId = TestContract.notes.ValueNote.id; |
There was a problem hiding this comment.
I am not really sure why this got triggered now as even before the noteTypeId should have been non-zero but now it caused the test to fail when adding the nullified note.
Given that note type id will be soon nuked from NoteDao and ExtendedNote and given that we will nuke the addNullifiedNote function doesn't make sense to bother with.
de1cc6f to
4a8b6e2
Compare
aafc224 to
14eb329
Compare
4a8b6e2 to
0c4115b
Compare
edd3cac to
b6aa786
Compare
0c4115b to
37ce5ab
Compare
c8e8515 to
d8c127f
Compare
d8c127f to
a1afb7a
Compare
Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
* master: (245 commits) chore: Fix unbound CI variable on release image bootstrap (#12095) fix: dry run on grind (#12088) fix(spartan): eth-execution logging (#12094) fix: aws_handle_evict recovery & termination (#12086) chore: Use native acvm when available on orchestrator tests (#11560) refactor: function macros cleanup (#12066) refactor: remove `addNullifiedNote` from pxe (#11822) fix: `#[aztec]` macro warnings (#12038) refactor!: Notes implementing `Packable<N>` (#12004) chore(ops): add gcloud cli into devbox base image (#12082) fix: hotfix grinding fix: L1 deployment on reth (#12060) fix: Add missing bootstrap fast aliases (#12078) fix: hash_str caching (#12074) fix: Naive attempt to fix nightly deployments (#12079) fix: kind smoke (#12084) refactor!: nuking `NoteHeader` (#11942) fix: inject dockerhub creds (#12072) feat(docs): Note discovery concepts page (#11760) chore: cleanup libp2p logger (#12058) ...

Fixes #11981
+\ note macro cleanup