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

Time to load keys #914

Closed
yorickdowne opened this issue Sep 15, 2023 · 8 comments
Closed

Time to load keys #914

yorickdowne opened this issue Sep 15, 2023 · 8 comments
Assignees
Labels
question Further information is requested TeamCerberus Under active development by TeamCerberus @Consensys

Comments

@yorickdowne
Copy link

web3signer w/ 10k keys that were created by staking-deposit-cli, Holesky, loaded via keymanager API

I am wondering whether the time to load keys can be improved on startup. Every startup web3signer takes ~20 mins

eth-holesky-web3signer-1  | 2023-09-15 15:42:24.472+00:00 | ForkJoinPool.commonPool-worker-2 | INFO  | SignerLoader | 9980 signing metadata processed
eth-holesky-web3signer-1  | 2023-09-15 15:42:26.832+00:00 | pool-2-thread-1 | INFO  | SignerLoader | 9990 signing metadata processed
eth-holesky-web3signer-1  | 2023-09-15 15:42:29.404+00:00 | ForkJoinPool.commonPool-worker-10 | INFO  | SignerLoader | 10000 signing metadata processed
eth-holesky-web3signer-1  | 2023-09-15 15:42:29.979+00:00 | pool-2-thread-1 | INFO  | SignerLoader | Total Artifact Signer loaded via configuration files: 10000
eth-holesky-web3signer-1  | Error count 0
eth-holesky-web3signer-1  | Time Taken: 00:19:14.756.
@jframe jframe added the TeamCerberus Under active development by TeamCerberus @Consensys label Sep 18, 2023
@jframe
Copy link
Contributor

jframe commented Sep 21, 2023

Does it take the same time to load keys using the keyManager API as does loading by restarting web3signer?

The keys that are generated using the staking-deposit-cli can take a long time to load as encrypted using scrypt. There might not be much we do and can still take a look.

@yorickdowne
Copy link
Author

I believe it does take just as long, yes.

I know scrypt decode takes a minute. Clients like Teku store this in an optimized format somehow while still keeping it encrypted - maybe you can crib from how it's handled there?

@usmansaleem
Copy link
Contributor

usmansaleem commented Oct 4, 2023

@yorickdowne the main reason for slow loading at start up is due to scrypt encryption on the v4 wallet files. Teku also doesn't convert any of the v4 imported parameters. We also identify one potential enhancement during the import phase though and will be incorporating it via #921. You should be able to convert scrypt to pbkdf2 to decrease the decryption time, but with the caveat of lower security. Let us know if you need more information around how to convert or lower the v4 file parameters, it would need a small Java program to achieve it.

@yorickdowne
Copy link
Author

Got it. Yes that Java program for conversion would be helpful.

@usmansaleem
Copy link
Contributor

@yorickdowne I created a small Java program that should help you to convert existing SCRYPT v4 keystore files to either SCRYPT or PBKDF2 with lower n or c respectively. https://github.com/usmansaleem/v4keystore_converter . Let me know if you need more information.

@yorickdowne
Copy link
Author

Thank you, amazing! Will give this a try next week.

@usmansaleem
Copy link
Contributor

Closing the ticket. Feel free reopen the ticket or reach out on Consensys Discord channel if you have further queries regarding the java program. Discord handle: usmans.info.

@yorickdowne
Copy link
Author

Great success! Converting to pbkdf2 with c=10 loads keys almost instantly. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested TeamCerberus Under active development by TeamCerberus @Consensys
Projects
None yet
Development

No branches or pull requests

4 participants