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
We're currently encrypting in Noir and decrypting in TS, which makes it quite hard to change encryption schemes, and forces all contracts to use the same one. We should change this so that decryption is done in the contracts as part of the process_logs function.
Note that we will not be able to do this for partial notes since those are trickier due to the mixed ciphertext and plaintext in the log payload. Perhaps we'd tackle those first? (#10724) Alternatively we can continue handling the partial flow in PXE and skip those in the contracts if we got them.
The text was updated successfully, but these errors were encountered:
Closes#9576
This PR offloads the later stages of note log processing from PXE into
aztec-nr. The plan is to take over at the decrypted log payload stage,
and later on expand scope to also include decryption and (eventually)
tagging indices management.
Update: this now works, with some caveats. I'll leave some comments here
re. current status in case anyone wants to take a look, and for me to
resume work once I'm back.
Contracts are now expected to have a `process_logs` function that will
be called during note syncing. This function is not yet being
autogenerated, but I did manually add it to SchnorrAccount and
TokenContract for local testing - it should be fairly easy to
autogenerate it.
PXE still performs tagging index synchronization, fetches all relevant
logs, decrypts them, and merges the public and private components when
they are partial note logs. This will continue to be this way for a
while: we'll tackle these problems in #10723 and #10724. However, past
this point we delegate work to the contract.[^1] The contract performs
nonce discovery and computes note hash and nullifier, and then calls a
new PXE oracle called `deliverNote`. PXE validates that the note hash
exists in the tree, and adds the note to its database. **Edit:** I now
updated this section to remove all of the old relevant TS code. We no
longer do nonce discovery in PXE.
With this first step, PXE no longer needs to know about note type ids,
which become exclusively an aztec-nr concept. It will continue to know
about storage slots, but only because we index by them. More importantly
however, this makes us quite ready to continue building on top of this
work in order to fully move the other parts of the stack (notably
decryption and partial notes) into the contract as well.
[^1]: As of right now we're still doing all of the work in PXE,
including payload destructuring and nonce discovery, but we discard the
results and re-compute them in the contract. Changing this involves
deleting a bunch of files and re-structuring some dataflows, and I
haven't gotten round to it yet. We should do this in this PR.
---------
Co-authored-by: Jan Beneš <[email protected]>
We're currently encrypting in Noir and decrypting in TS, which makes it quite hard to change encryption schemes, and forces all contracts to use the same one. We should change this so that decryption is done in the contracts as part of the
process_logs
function.Note that we will not be able to do this for partial notes since those are trickier due to the mixed ciphertext and plaintext in the log payload. Perhaps we'd tackle those first? (#10724) Alternatively we can continue handling the partial flow in PXE and skip those in the contracts if we got them.
The text was updated successfully, but these errors were encountered: