-
Notifications
You must be signed in to change notification settings - Fork 34
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
Note importing process follow-ups #405
Comments
The main reason for this is that currently we can sync before importing the note and we might miss the nullifier update (the I don't think there's a good way to solve this issue right now. We could:
cc @bobbinth |
We do have a CheckNullifiers endpoint in the node - thought, it requires sending full nullifiers and returns back authentication paths for the nullifiers found in the node. So, this is a bit more heaving then needed and also reduced privacy. Maybe it is worth adding an endpoint to the node to return a list of nullifiers based on some prefix and block bounds. Could you create an issue for this in More generally, I think that maybe the root cause of the issues is that we are trying to do too much with the import note endpoint. Specifically, we try to cover 3 separate use cases:
I'm not entirely happy with how we handle case 3, but I also don't have great suggestions here. The issues I'm seeing:
|
I think one way of simplifying the nullifier flow could be to make the sync endpoint return nullifier data regardless of the |
I think this would introduce quite a bit of overhead:
|
Following up on #405 (comment), I think we should first try to solve case "3a" - i.e., tracked expected notes - as it is probably by far the more likely one to happen in practice. When we import such a note, ideally, we'd like to know the following:
I think we have the following options for getting this info:
To summarize some of the above:
Thinking more about the approach 3 above, we could do something like this: To check if a note has been consumed, use a specialized endpoint which would take a set of 16-bit nullifier prefixes and would return a list of nullifiers matching these prefixes regardless of when these nullifiers have been generated. To check if a note has been already recorded on chain, we use a specialized endpoint which could like like a "light sync" (basically, state sync but only for notes). We could call this endpoint |
One other option is to make sure that expected notes always come with some lower bound on when they could be added to the chain. For example, pub enum NoteFile {
NoteId(NoteId),
NoteDetails { details: NoteDetails, after_block_num: u32, tag: Option<Tag> },
NoteWithProof(Note, NoteInclusionProof),
} The One thing to keep in mind though: |
With the addition of the For the Small question: Given that the This will make the |
I think the other case here is that the not was committed in the past but not as far back as I think this case could be handled separately. Specifically, we should probably do something about "stale" expected notes - i.e., notes which we have been expecting "for a while". For example, if an expected note didn't get committed within a week, we try to get it by ID. But this would be a separate issue (i.e., something about "handling of stale notes"). |
You might have been referring to tracked notes here, but we can't always assume that if an expected note is in the future, the normal |
Yes, this is specifically what I called the case |
Some things to fix came up when testing #375:
Originally posted by @mFragaBA in #375 (review)
However, some of this might depend on how we rework the note importing workflow.
The text was updated successfully, but these errors were encountered: