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

refactor(Keys_Nullifier): Allow multiple key derivation validation lookups #6313

Closed
Tracked by #5606
LHerskind opened this issue May 9, 2024 · 0 comments · Fixed by #6405
Closed
Tracked by #5606

refactor(Keys_Nullifier): Allow multiple key derivation validation lookups #6313

LHerskind opened this issue May 9, 2024 · 0 comments · Fixed by #6405
Assignees

Comments

@LHerskind
Copy link
Contributor

LHerskind commented May 9, 2024

We currently only support a single key derivation request in a call. This should be altered to ensure that we can make additional request as we are otherwise unable to use notes that have been received before and after a key rotation within the same call.

Example where we encounter this issue:

  • Alice sends 10 $ to Bob
  • Bob rotates his keys
  • Alice sends 5 $ to Bob
  • Bob wants to spend his 15$
    • Bob can't because he need to nullify notes with two different npk_m_h specified, and he only have one request 😭

Unclear if we really need the caching or not, if we are to cache, we likely need to just cache the "last" read value, and then need to lookup if different. Could potentially run into issues if the notes are returned as k1 | k2 | k1 | k2 and so on, as we can never use the cache and potentially adds a lot of validation requests. Something that might be totally fine could be to alter the oracle such that it is returning them sorted by the key as well as other values, but that is really annoying when also dealing with applications that might wants their own sorting etc 🤷. Pain.

At the same time, we should update the number of notes and encrypted logs to be similar, as we might otherwise run into issues where we cannot emit enough logs and our transaction will fail.

This should be done after #6215 to avoid to much pain.

@github-project-automation github-project-automation bot moved this to Todo in A3 May 9, 2024
@LHerskind LHerskind changed the title refactor(Keys): Allow multiple key derivation validation lookups refactor(Keys_Nullifier): Allow multiple key derivation validation lookups May 10, 2024
@sklppy88 sklppy88 moved this from Todo to In Progress in A3 May 10, 2024
@sklppy88 sklppy88 moved this from In Progress to In Review in A3 May 15, 2024
sklppy88 added a commit that referenced this issue May 16, 2024
Resolves #6313
Resolves #6296
Resolves #5630

Have created #6417 to refactor the rotate call

---------

Co-authored-by: Jan Beneš <janbenes1234@gmail.com>
@github-project-automation github-project-automation bot moved this from In Review to Done in A3 May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment