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

Refactor: Improve clarity of note syntax #4199

Closed
Tracked by #4126
LHerskind opened this issue Jan 24, 2024 · 5 comments
Closed
Tracked by #4126

Refactor: Improve clarity of note syntax #4199

LHerskind opened this issue Jan 24, 2024 · 5 comments
Assignees

Comments

@LHerskind
Copy link
Contributor

LHerskind commented Jan 24, 2024

The life-cycle of notes is currently fairly hard to follow. This is partly due to its creation before traits was available, and partly from the fact that parts of the nullifier computation depends on what the nullifier is to be used for.

E.g., when computing a nullifier to emit, that is different than when you wish to prove that some nullifier is in the state.

The difference is an effect of the insertion relying on the kernel to apply transformations before actually being inserted into state, and for reads it needs to apply those transformations itself.

It means that there currently are execution flows that "go in circles" which can be quite strange to follow.

@github-project-automation github-project-automation bot moved this to Todo in A3 Jan 24, 2024
@LHerskind LHerskind changed the title Create proposal for new custom note syntax Refactor: New custom note syntax Jan 24, 2024
@LHerskind LHerskind added this to the Execution Environment milestone Jan 24, 2024
@LHerskind LHerskind self-assigned this Jan 24, 2024
@LHerskind LHerskind moved this from Todo to In Progress in A3 Jan 24, 2024
@LHerskind
Copy link
Contributor Author

#4207 reduces the entry-points for the note/nullifier slightly.

@LHerskind
Copy link
Contributor Author

Discussions with @sirasistant and others lead to updating the compute_note_hash function name to compute_note_content_hash to avoid confusion with the actual note hash. See #4342

@LHerskind
Copy link
Contributor Author

See #4344 for more changes related to the lifecycle naming.

LHerskind added a commit that referenced this issue Jan 31, 2024
…ntent_hash (#4342)

Part of #4199.

Discussions with @sirasistant and others lead to updating the `compute_note_hash` function name to `compute_note_content_hash` to avoid confusion with the actual note hash.
LHerskind added a commit that referenced this issue Jan 31, 2024
…4344)

Part of #4199 

Replaces the `compute_note_hash_for_read_or_nullify` with two functions:
- `compute_note_hash_for_insertion`
- `compute_note_hash_for_consumption`

The practical difference is small, but should make it a bit easier to follow the flow
@LHerskind
Copy link
Contributor Author

#4383 updated the NoteInterface to handle serialization and deserialization specific to notes.

I'm not sure how much more we can change around the note syntax, unless we try removing the header entirely from the note, and have something like a WrappedNote as have been alluded to in other discussions.

@LHerskind LHerskind changed the title Refactor: New custom note syntax Refactor: Improve clarity of note syntax Feb 5, 2024
@LHerskind
Copy link
Contributor Author

For above mentioned reasons. I will close this issue, and create #4419 where this can be discussed.

@github-project-automation github-project-automation bot moved this from In Progress to Done in A3 Feb 5, 2024
michaelelliot pushed a commit to Swoir/noir_rs that referenced this issue Feb 28, 2024
…ntent_hash (AztecProtocol#4342)

Part of AztecProtocol#4199.

Discussions with @sirasistant and others lead to updating the `compute_note_hash` function name to `compute_note_content_hash` to avoid confusion with the actual note hash.
michaelelliot pushed a commit to Swoir/noir_rs that referenced this issue Feb 28, 2024
…ztecProtocol#4344)

Part of AztecProtocol#4199 

Replaces the `compute_note_hash_for_read_or_nullify` with two functions:
- `compute_note_hash_for_insertion`
- `compute_note_hash_for_consumption`

The practical difference is small, but should make it a bit easier to follow the flow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

1 participant