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

Make sure used keys are saved into a file. #10780

Merged
merged 4 commits into from Jun 16, 2023
Merged

Conversation

molnard
Copy link
Collaborator

@molnard molnard commented May 25, 2023

In addition to this #10711.

Making sure to save the used keys state to file - right after the modification.

@molnard
Copy link
Collaborator Author

molnard commented May 25, 2023

@lontivero The solution here is dirty but the interface is not letting me touch the file directly. However, it is not worse than before.

Copy link
Collaborator

@lontivero lontivero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to make sure the keys' state are always persisted immediately then you should pass the this keymanaget to this method:

https://github.com/zkSNACKs/WalletWasabi/blob/master/WalletWasabi/Blockchain/Keys/KeyManager.cs#L503

@molnard
Copy link
Collaborator Author

molnard commented May 26, 2023

keys' state are always persisted immediately

I did not say always. I want to do that only here.

https://github.com/zkSNACKs/WalletWasabi/pull/10780/files#diff-28444f49c77fd0c2cd05f91515914d63fc3c9264ff1f24a56b2fc8e8167df850R523.

@lontivero
Copy link
Collaborator

The thing is that CoinJoinManager shouldn't even know about the persistence mechanism. The KeyManager is the one that should abstract all that. If the changes in the key state have to be persisted in all or some situations and that is not happening then it is the KeyManager that have to be improved and not the CoinJoinManager.

@molnard
Copy link
Collaborator Author

molnard commented Jun 9, 2023

@lontivero I tried my best. I think it is even better because any time we use TrySetScriptStates it is saved in the file.

@molnard molnard requested a review from lontivero June 12, 2023 12:15
@molnard molnard merged commit f1dd6b3 into zkSNACKs:master Jun 16, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants