-
Notifications
You must be signed in to change notification settings - Fork 251
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
Add auto-shielding to the data access API #341
Add auto-shielding to the data access API #341
Conversation
a6d02ea
to
97498f0
Compare
One thing I'm not yet clear on is what role does the cachedb play here? it seems like we're inserting directly into the wallet_db, bypassing cache. If so, it seems like the workflow would be:
Is that about right? Update: |
Another question I would have would be the For normal transactions, code for this exists on the Android side. It might be good to migrate that into the data_access_api for both |
The thing that I wanted to preserve here was that read access has to be implemented in the WalletRead trait; the existence of the cachedb is kind of an artifact. In fact, in terms of the public API, I don't think that the The main reason that I didn't put the writes into the cachedb is that we don't have any analog of scanning for this UTXO data; we get it "already scanned for" from lightwalletd, right? Now, that's something that I think is actually a problem with this prototype, because it reveals to the lightwalletd server which transparent addresses are associated with a given wallet, and so you get a lot more information about who is shielding which transactions as potential metadata for an adversary to work from. I mentioned this and tagged @defuse in Slack about this a few days ago. In any case, I think that the write side of this interface should currently be considered only a prototype. I'm not sure whether I'll get time to work on the broader WalletWrite changes soon, since I have a couple of higher-priority NU5 items that need to get done first, but I'll try to find time for it. |
That's interesting. I think that I'd like to implement that by making the back-end use a "journaled writes" strategy, but I'll have to give it some thought. So instead of a "cancel" flow it'd be more of a "commit" flow - propagate the changes to the tables that are used to query from in the future only once the transaction has been successfully submitted to the network. Then the failure path is that in the future someone's wallet might attempt a double-spend if something had gone wrong in the past, instead of having changes committed to the DB that incorrectly indicate that some UTXOs had already been shielded and are therefore unavailable. The other nice thing about this approach is that it'd be easy to detect if you have a dirty journal, and that therefore balances might be unreliable. That's not the case if you use a rollback strategy instead. |
8d49274
to
9a77580
Compare
Codecov Report
@@ Coverage Diff @@
## non-consensus-changes-on-branchid-37519621 #341 +/- ##
==============================================================================
- Coverage 50.23% 49.35% -0.88%
==============================================================================
Files 88 90 +2
Lines 7963 8338 +375
==============================================================================
+ Hits 4000 4115 +115
- Misses 3963 4223 +260
Continue to review full report at Codecov.
|
4253f8e
to
e6316ee
Compare
9bb9cc5
to
ce5115c
Compare
Add retrieval of transparent UTXOs to WalletRead Co-authored-by: Kris Nuttycombe <[email protected]> Co-authored-by: Kevin Gorham <[email protected]>
This value can be obtained internally within the implementation of `store_decrypted_tx` and does not need to be part of the public API.
Co-authored-by: str4d <[email protected]> Co-authored-by: Daira Hopwood <[email protected]>
Internal key test vectors
85dbc12
to
1507d1d
Compare
e61cd7e
to
9293e56
Compare
9293e56
to
488d13f
Compare
Co-authored-by: str4d <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK cdd899d 🎉
This page is so slow for me now that I cannot even access the review drop-down. utACK with typo-only suggestions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK with typo-only suggestions.
This is mostly @pacu's work, now integrated with the data access API.