Skip to content
This repository has been archived by the owner on Aug 8, 2018. It is now read-only.

Slow account creation #292

Open
AndreMiras opened this issue Apr 8, 2018 · 1 comment
Open

Slow account creation #292

AndreMiras opened this issue Apr 8, 2018 · 1 comment

Comments

@AndreMiras
Copy link

I'm using pyethapp for two cross platform apps and noticed from the beginning the account creation and unlock was very slow. In fact this is a follow up from ethereum/pyethereum#750.
This is specially more annoying on smart device because it has less resources and the user has to wait for ages to unlock account to sign a transaction. Up to a point where I had to decrease the security by lowering the number of pbkdf2 iterations.

In fact the fix should be pretty straightforward since the new eth_keyfile.keyfile.create_keyfile_json() implementation is way more faster. So I guess we should "just" pull the dependency and switch to that one.

Checklist

  • [ x ] installed pyethapp inside a virtualenv

System/environment

  • OS: Linux and OS X and Android
  • python version: Python2 and Python3
  • pyethapp version: develop 9af6e64
  • installation method (pip & pypi/git & setup.py): git & setup.py
  • pyethapp branch (if applicable): develop

Expected behaviour

Almost instant account creation on:

from pyethapp import accounts
accounts.Account.new("password")

Observed behaviour

Just super slow.

Steps to reproduce

from pyethapp import accounts
accounts.Account.new("password")

And cry 😢

AndreMiras added a commit to AndreMiras/pyethapp that referenced this issue Apr 8, 2018
Use the new eth-keyfile module to encrypt/decrypt keyfile.
This makes it way faster to create and unlock accounts.
For instance with 100K PBKDF2 iteration rather than 100.
Running `pyethapp/tests/test_accounts.py` was outputing:
```
9 passed in 112.07 seconds
```
After the pull request it's now:
```
9 passed in 2.41 seconds
```
@AndreMiras
Copy link
Author

Pull request that fixes it #293

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