Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Call persistAllKeyrings in setLocked? #130

Open
alex-miller-0 opened this issue Mar 19, 2022 · 0 comments
Open

Call persistAllKeyrings in setLocked? #130

alex-miller-0 opened this issue Mar 19, 2022 · 0 comments

Comments

@alex-miller-0
Copy link

alex-miller-0 commented Mar 19, 2022

GridPlus' keyring recently added a state caching mechanism under a mistaken assumption that serialize would be called when the MetaMask extension locked. Since the Lattice is an internet-connected device with its own state, we would normally need to asynchronously connect to the device in order to sync state, which takes 2-4 seconds, depending on internet connection. With the latest changes, we can now dry state and rehydrate a connection without having to do any asynchronous calls.

However, this is dependent on they keyring controller persisting keyring state or else every time the extension locks, we will lose our most recent state data and we will need to asynchronously reconnect with a retry mechanism (which is actually slower than initially forcing asynchronous resync like we were doing before, since it adds another call that ends up failing and forcing the resync). This would not be an issue if setLocked called persistAllKeyrings to save state.

Is there any reason you do not call persistAllKeyrings in setLocked? And if the answer is no, would you be open to adding that serialization hook?

alex-miller-0 added a commit to GridPlus/eth-lattice-keyring that referenced this issue Mar 19, 2022
Unless MetaMask caches state at lock time, this actually slows down
the initialization process...
MetaMask/KeyringController#130
alex-miller-0 added a commit to GridPlus/eth-lattice-keyring that referenced this issue Mar 19, 2022
Unless MetaMask caches state at lock time, this actually slows down
the initialization process...
MetaMask/KeyringController#130
alex-miller-0 added a commit to GridPlus/eth-lattice-keyring that referenced this issue Mar 19, 2022
Unless MetaMask caches state at lock time, this actually slows down
the initialization process...
MetaMask/KeyringController#130
alex-miller-0 added a commit to GridPlus/eth-lattice-keyring that referenced this issue Mar 19, 2022
Unless MetaMask caches state at lock time, this actually slows down
the initialization process...
MetaMask/KeyringController#130
alex-miller-0 added a commit to GridPlus/eth-lattice-keyring that referenced this issue Mar 19, 2022
Unless MetaMask caches state at lock time, this actually slows down
the initialization process...
MetaMask/KeyringController#130
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant