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

Improvements to startup speed #787

Merged
merged 2 commits into from
Nov 7, 2023
Merged

Improvements to startup speed #787

merged 2 commits into from
Nov 7, 2023

Conversation

benthecarman
Copy link
Collaborator

@benthecarman benthecarman commented Oct 3, 2023

With the service worker / push notification stuff I imagine we'll need to get our startup time faster. This is one step towards that.

This changes so we don't read all of storage an extra time just to get our seed for vss.

Found a couple clean ups to go along with this

  • found somewhere we were making an extra cipher
  • small error conversion cleanup
  • fixed a potential issue where if you passed in a mnemonic while you already had a wallet created, it would just overwrite it, now we check to make sure there isn't already a wallet.

@benthecarman benthecarman force-pushed the improve-startup branch 2 times, most recently from 136ea06 to 8ab4e36 Compare October 3, 2023 08:31
Copy link
Contributor

@TonyGiorgio TonyGiorgio left a comment

Choose a reason for hiding this comment

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

I don't see any tests here. Last time we changed encryption stuff it ended badly.

mutiny-wasm/src/indexed_db.rs Outdated Show resolved Hide resolved
@benthecarman
Copy link
Collaborator Author

benthecarman commented Nov 7, 2023

Added a test for a different mnemonic, needed to remove the panic and just change to an error, otherwise couldnt test it properly

Our other tests handled all the other cases

@TonyGiorgio
Copy link
Contributor

Okay that looks good. Last thought, I was revisiting some of this with this pr: #752

Is that something we'd want to do? I dont know if we want to attempt to remove some of the cipher re-initializations, but this PR does fix some of the investigations I was looking through when I was attempting it again. Namely, the double storage init.

@benthecarman
Copy link
Collaborator Author

Yeah I think the idea of that is good, probably good for a follow up. I think this handles it so we aren't doing anything inefficiently now but the API isn't as clean as it could be with that

Copy link
Contributor

@TonyGiorgio TonyGiorgio left a comment

Choose a reason for hiding this comment

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

Nice work, sorry it took awhile. Needed to grok it again.

@TonyGiorgio TonyGiorgio merged commit 71fbc97 into master Nov 7, 2023
9 checks passed
@TonyGiorgio TonyGiorgio deleted the improve-startup branch November 7, 2023 22:54
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

Successfully merging this pull request may close these issues.

2 participants