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

Thread blocked #16

Closed
BlueFlicker opened this issue Sep 4, 2018 · 5 comments
Closed

Thread blocked #16

BlueFlicker opened this issue Sep 4, 2018 · 5 comments
Labels
bug Something isn't working

Comments

@BlueFlicker
Copy link

BlueFlicker commented Sep 4, 2018

hello, when I call contract.method(_ method:, parameters: , extraData: , options: ), currentThread will be blocked.
I don't know why.

public func scrypt (password: String, salt: Data, length: Int, N: Int, R: Int, P: Int) -> Data? {
    guard let passwordData = password.data(using: .utf8) else {return nil}
    guard let deriver = try? Scrypt(password: passwordData.bytes, salt: salt.bytes, dkLen: length, N: N, r: R, p: P) else {return nil}

    guard let result = try? deriver.calculate() else {return nil}   
       
   //blocked in here,it's too slow precisely. I need to wait 5 minutes.

    return Data(result)
}
/////
@shamatar
Copy link
Contributor

shamatar commented Sep 4, 2018

Can you try to do the same in the "Release" build? I'm pushing a fix for it now, performance of Scrypt key derivation function is not yet too optimal when written in Swift, but allowed to get rid of the large libsodium dependency.

@shamatar
Copy link
Contributor

shamatar commented Sep 4, 2018

I've also backported a fast C implementation of scrypt, just do pod update, it should pull a new version

@skywinder
Copy link
Collaborator

@BlueFlicker please, let us know, which version are you using? Is this issue still exists on the current version (1.1.6)?

@skywinder skywinder added the bug Something isn't working label Sep 4, 2018
@BlueFlicker
Copy link
Author

Thank you for your answers. I think I used "BIP32Keystore" and not "ethereumstorev3" to create,so it caused this problem.

@shamatar
Copy link
Contributor

shamatar commented Sep 6, 2018

scrypt evaluation was really slow, please run pod update, it will pull the latest dependencies for web3swift. scrypt pod version 1.7 should fix a problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants