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

Keystore Initialization - 100% CPU Usage #457

Closed
virus-zip opened this issue Jan 29, 2022 · 5 comments
Closed

Keystore Initialization - 100% CPU Usage #457

virus-zip opened this issue Jan 29, 2022 · 5 comments

Comments

@virus-zip
Copy link

The initialization of a Keystore freezes the whole application and apparently throws a load of work onto the CPU - 100%.

let keystore = try! EthereumKeystoreV3(privateKey: dataKey, password: password)!

This line is completely copied from the examples and uses simple strings. The function itself is the cause of the issue.

@johnCbogil
Copy link

johnCbogil commented Feb 6, 2022

Experiencing this as well, the whole device locks up. BIP32Keystore suffers from the same issue. I believe the issue is coming from scrypt, line 103 in EthereumKeyStoreV3.swift. Have not found a workaround yet.

@janndriessen
Copy link
Collaborator

Can confirm. Best workaround right now is to run in the background via DispatchQueue. Obviously it would be better if this would happen in the key store classes directly.

@ichikmarev ichikmarev added bug Something isn't working critical labels Mar 20, 2022
@pharms-eth
Copy link
Collaborator

confirmed issue is in scrypt and all its calls to the function rotateLeft

@mloit
Copy link
Contributor

mloit commented Apr 28, 2022

This should only be an issue in debug builds when using SPM. Can someone please confirm if this is still an issue using the latest version of web3swift and building/running in release mode?

@janndriessen
Copy link
Collaborator

This should only be an issue in debug builds when using SPM. Can someone please confirm if this is still an issue using the latest version of web3swift and building/running in release mode?

Can confirm. Have no issues for release builds.

@yaroslavyaroslav yaroslavyaroslav removed critical bug Something isn't working labels Sep 2, 2022
@yaroslavyaroslav yaroslavyaroslav closed this as not planned Won't fix, can't repro, duplicate, stale Sep 2, 2022
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

7 participants