Find next tag as sender #9762
Labels
C-aztec.nr
Component: Aztec smart contract framework
C-pxe
Component: PXE (Private eXecution Envrionment)
team-fairies
Nico's team
Follow up to #9373: the implementation in #9566 simply reads the next tag from the database, but we can do better: we can try to find the last used tag by searching for tagged notes in the node, the same way we do when looking for received notes (except in this case we are the sender and not the recipient). Once we find a tag that has no notes associated to it then we've found the one that we want to use.
Implementing this will mean that we can start a brand new PXE instance from just private keys and find the correct sending tag - currently we'll start using old indices if we ever clear this db.
Note that because we'll be searching for unused tags in TS but computing the tags in Noir, we'll end up computing the tags twice: once in PXE to search for tagged notes, and once in Noir as we send the tagging secret and index. This will eventually go away as we move the TS code into Noir.
We should still update the 'next index' database in order to skip already-seen tags when we next sync, though we may want to change the
incrementIndex
oracle to something likesetIndex
, since we won't necessarily increment it one by one.The text was updated successfully, but these errors were encountered: