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

Create method to track ledger RevEntry writes and compare wallet to ledger state to help in restored-from-backup scenario #24

Open
swcurran opened this issue Aug 27, 2020 · 7 comments

Comments

@swcurran
Copy link

Add a mechanism to the wallet to track in the database what ledger RevEntry writes are made and included that in a startup (or Admin API endpoint?) check that the wallet is in sync with the ledger.

The concern is that when a wallet must be restored from backups we have a way to check if the wallet is in sync with the ledger. For some objects (DIDs, Schema, Cred Defs, RevRegs), we can just check if the ledger objects created by the wallet exist on the ledger. However, I don't think that can be done for RevEntries. If it is not possible then let's make it possible by storing information in the database when we write a RevEntry.

@swcurran
Copy link
Author

@andrewwhitehead @esune -- does this capture it? Are my assumptions correct? What do we do if we find the wallet does NOT contain all of the RevEntries?

@esune
Copy link
Member

esune commented Aug 27, 2020

Should/could we just track a timestamp holding the last time the agent synced up with the ledger, regardless of whether that is a read or write action, and store it in the wallet in the non-secret storage?

@swcurran
Copy link
Author

I don't see that reads are helpful. I was thinking initially we would have a "magic place" to just store the timestamp, but I didn't know how relevant that would be. As I thought about it I thought it would be more useful to have the ledger timestamp stored with the related object. And that is easy, except (AFAIK) for RevEntry (and maybe ATTRIB?).

@esune
Copy link
Member

esune commented Aug 27, 2020

I thought about reads as we would have a more accurate description of when the agent last synced with the ledger, regardless of whether it wrote something to it.

I do not know enough to weigh in about the benefits of storing the timestamp and the related object. However a question comes to mind: the timestamp will need to be stored in non-secret storage so that external backup processes can potentially read it without having access to the wallet - unless we go with an admin endpoint and add this info to the /status endpont ( I believe we have one), we may still want to store this kind of info in a non-encrypted location so that we don't rely on having the right keys to obtain it. In this case, wouldn't storing the related object potentially be exposing information that should otherwise be encrypted?

@swcurran
Copy link
Author

Ah...I didn't think the backup process would see it. How do you foresee that happening?

@esune
Copy link
Member

esune commented Aug 27, 2020

I am not yet sure that is essential, but I think it would be handy to be able to restore the backup and just query the appropriate db/table to pull that information. @WadeBarnes may have thoughts since he is the backup-container mastermind.

@esune esune transferred this issue from bcgov/von Mar 7, 2023
@esune
Copy link
Member

esune commented Mar 7, 2023

Transferred issue from von repo to keep it alive in case this is still something we need to look at. Ifnot, it can be closed.

@swcurran @andrewwhitehead could you please chime in based on the current status of revocation and the direction the community is taking?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants