-
Notifications
You must be signed in to change notification settings - Fork 305
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
Re-do partial note delivery using pending work db #10724
Comments
|
Note that |
As discussed in DMs will leave the encoding as it is now so the comment above no longer applies. |
#10867 introduced an end to end test for the pxe database that we should remove once we implement this, as the note discovery tests will indirectly be testing the db already. |
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]>
This extends the features introduced in #10867 so that we can also delete entries and copy multiple entries from one place to another. With these two new primitives I also built a Noir `DBArray`, which is a dynamic array backed by this database supporting pushes and deletion of arbitrary indexes (which we'll need for #10724). I took the liberty of renaming `store` and `load` to `dbStore` and `dbLoad` in TS, since I found the original names to be too generic. I kept those in Noir since we call them as `pxe_db::store` etc. anyway, and don't really expose them much either. I also renamed `key` to `slot`, since the actual kv store _does_ have a key, but it's not what we now call the slot (the key is `${contract}:${slot}`). I found it slightly annoying that I had to modify so many TS files to get this working, perhaps a symptom of over-abstraction? --------- Co-authored-by: Gregorio Juliana <[email protected]>
This extends the features introduced in AztecProtocol/aztec-packages#10867 so that we can also delete entries and copy multiple entries from one place to another. With these two new primitives I also built a Noir `DBArray`, which is a dynamic array backed by this database supporting pushes and deletion of arbitrary indexes (which we'll need for AztecProtocol/aztec-packages#10724). I took the liberty of renaming `store` and `load` to `dbStore` and `dbLoad` in TS, since I found the original names to be too generic. I kept those in Noir since we call them as `pxe_db::store` etc. anyway, and don't really expose them much either. I also renamed `key` to `slot`, since the actual kv store _does_ have a key, but it's not what we now call the slot (the key is `${contract}:${slot}`). I found it slightly annoying that I had to modify so many TS files to get this working, perhaps a symptom of over-abstraction? --------- Co-authored-by: Gregorio Juliana <[email protected]>
Once contracts have access to a PXE DB(#10730), we can migrate to the new (final) partial notes flow. The concept is as follows:
The text was updated successfully, but these errors were encountered: