-
Notifications
You must be signed in to change notification settings - Fork 195
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: passing partial note logs through transient storage #9356
refactor: passing partial note logs through transient storage #9356
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
006ab0a
to
a0b45b4
Compare
42381d1
to
d0bd136
Compare
93ae409
to
407f8b4
Compare
d0bd136
to
3d3c8d3
Compare
@@ -283,48 +283,75 @@ export class EnqueuedCallSimulator { | |||
callContext: result.executionRequest.callContext, | |||
proverAddress: AztecAddress.ZERO, | |||
argsHash: computeVarArgsHash(result.executionRequest.args), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the error messages below as the message thrown in padArray was not descriptive enough.
1cf6f85
to
f586e44
Compare
noir-projects/aztec-nr/aztec/src/encrypted_logs/encrypted_note_emission.nr
Show resolved
Hide resolved
noir-projects/aztec-nr/aztec/src/encrypted_logs/encrypted_note_emission.nr
Show resolved
Hide resolved
@@ -13,13 +13,52 @@ use crate::{ | |||
keys::point_to_symmetric_key::point_to_symmetric_key, | |||
}; | |||
|
|||
pub fn compute_encrypted_log<let P: u32, let M: u32>( | |||
pub fn compute_encrypted_note_log<let P: u32, let M: u32>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added compute_encrypted_note_log
and compute_encrypted_event_log
wrapper functions which just call compute_encrypted_log
with different offset.
3ae2f41
to
fb79008
Compare
@@ -24,7 +24,6 @@ contract Token { | |||
encrypted_event_emission::encode_and_encrypt_event_unconstrained, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes in this file are a bit unfortunate because originally we didn't have to deal with "transient" storage as we were able to just pass the values as args to the teardown function.
I decided to use the transient storage approach here as well because:
- I forgot about this flow and I stumbled upon it only after I changed the macros 😂 (and after the change we cannot instantiate finalization payload from raw values as it expects context and loading from storage),
- I think we might need to go with the transient storage approach because that will allow us to eventually not force user to define the note log length manually which I think is extremely important (deriving that manually essentially makes the dev a compiler).
8841d78
to
1e49301
Compare
const excludedIndices: Set<number> = new Set(); | ||
for (const functionLogs of txFunctionLogs) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These diffs are easy to read anyway with the 'hide whitespace` review flag
Looks like we're ready to be done with this for a while 😅 thanks a lot for pushing through the pain! The only thing I don't fully understand is why you say we'd not need to know the length if we were using transient storage. |
07072c9
to
6b42b41
Compare
This appears to have broken two e2e contract tests |
Partial notes log gets passed via transient storage to the public function where it the public values get appended to the log and emitted via the unencrypted log stream. I refactored the partial notes related macros so that it's not all disgusting.
Note for the reviewer
I included a lot of comments in the code in this PR and if you check the files from bottom down all should hopefully make sense.