Skip to content

Re-do partial note delivery using pending work db #10724

Closed

Description

@nventuro

Once contracts have access to a PXE DB(#10730), we can migrate to the new (final) partial notes flow. The concept is as follows:

  • Logs are encrypted and emitted from private as soon as partial notes are created. This prevents the tagging index from being left hanging in case the note is not completed soon, since the log will be delivered immediately. This log will of course not be complete.
  • Partial notes will have a different note type id that will mark them as such. Perhaps we could use 127 bits for the id, and leave the msb for a complete/partial boolean flag.
  • Whenever we find a partial note after decrypting a log, we store what we've found in PXE as 'pending work'.
  • As part of the note syncing process, we read the pending work database and try to find any logs that correspond to the public component by searching for their tag. This tag might simply be the hash of the partial note content.
  • If the public log is found, we merge it with the private part and compute the full note content. We'd then require the tx note hashes in order to do nonce discovery (Consider bundling tx effects in getLogsByTag #9789)

Activity

  1. benesjan commented on Dec 19, 2024

    @benesjan
    Contributor

    With this PR note type id is now only 7 bits long but it is serialized to 2 bytes in the to_be_bytes function. This means there is a space for the 1 bit partial note flag.

    Look for TODO(#10724) to spot where in the codebase this is.

  2. nventuro commented on Dec 23, 2024

    @nventuro
    ContributorAuthor

    Note that to_be_bytes will go away once we move to field-based logs.

  3. benesjan commented on Dec 23, 2024

    @benesjan
    Contributor

    As discussed in DMs will leave the encoding as it is now so the comment above no longer applies.

  4. nventuro commented on Jan 8, 2025

    @nventuro
    ContributorAuthor

    #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.

  5. nventuro commented on Feb 6, 2025

    @nventuro
    ContributorAuthor

    Closed via #11641

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-aztec.nrComponent: Aztec smart contract frameworkteam-fairiesNico's team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions