Skip to content
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

Find next tag as sender #9762

Closed
Tracked by #9119
nventuro opened this issue Nov 5, 2024 · 0 comments · Fixed by #10071
Closed
Tracked by #9119

Find next tag as sender #9762

nventuro opened this issue Nov 5, 2024 · 0 comments · Fixed by #10071
Assignees
Labels
C-aztec.nr Component: Aztec smart contract framework C-pxe Component: PXE (Private eXecution Envrionment) team-fairies Nico's team

Comments

@nventuro
Copy link
Contributor

nventuro commented Nov 5, 2024

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 like setIndex, since we won't necessarily increment it one by one.

@nventuro nventuro added the C-aztec.nr Component: Aztec smart contract framework label Nov 5, 2024
@nventuro nventuro added team-fairies Nico's team C-aztec.js Component: aztec.js client library C-pxe Component: PXE (Private eXecution Envrionment) and removed C-aztec.js Component: aztec.js client library labels Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-aztec.nr Component: Aztec smart contract framework C-pxe Component: PXE (Private eXecution Envrionment) team-fairies Nico's team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants