Closed resimon closed 7 years ago
You can try with Geth.LightScryptN and Geth.LightScryptP. But yes, any solution to make it work with StandardScrypt would be welcomed !
Please read https://github.com/ethereum/go-ethereum/wiki/Mobile:-Account-management#encrypted-keystores
Notably:
The important thing to know when using the encrypted keystore is that the cryptographic primitives used within can operate either in standard or light mode. The former provides a higher level of security at the cost of increased computational burden and resource consumption:
- standard needs 256MB memory and 1 second processing on a modern CPU to access a key
- light needs 4MB memory and 100 millisecond processing on a modern CPU to access a key
As such, light is more suitable for mobile applications, but you should be aware of the trade-offs nonetheless.
@Nigui There's no way to make standard scrypt use less memory. That's the whole point of it :)
Thank you for the hint, I will try it as soon as possible with the light variant.
But I am still curious why it had worked without largeHeap flag in Android Manifest, if it takes 256MB memory.
light mode is ok, standard mode with largeHeap always crash.
scrypt allocate 256M on nativie stack, always crash on my nexus 4, works on some China brand phone, such as Xiaomi.
System information
Geth version: 1.6.2-unstable, 1.6.1-stable (already started in 1.6.0-Snapshot, sorry i do not remember Commit Hash) OS & Version: Android Commit hash : (if
develop
)While still trying to interact with a smart contract #14363:
I already tried to set largeHeap Flag in Android Manifest for my application to be able to allocate more memory. Tried it on Android Emulator (multiple Android versions), Google Pixel XL (Android 7.1.2), LG G2 (Android 5.0.2). There should be enough RAM available , even if not on a mobile device, then on the Emulator. My development computer has 32 GB RAM and emulators are able to allocate up to 8GB. It started with a new commit, sorry i do not remember which exactly. I have not payed attention.
Expected behaviour
Create Wallet
Actual behaviour
Go: Out of Memory Exception
Steps to reproduce the behaviour
KeyStore keyStore = new KeyStore(getFilesDir() + "/keystore", Geth.StandardScryptN, Geth.StandardScryptP); Account account = keyStore.newAccount("password"); //Exception thrown here see backtrace
Backtrace
Note: I marked problem start.