Closed skylenet closed 2 years ago
@protolambda I've noticed that you've added the --insecure
flag which make it even go faster, that's cool! I've updated the PR with your new changes and solved the code conflicts. I ran the following test locally on my machine:
time ./eth2-val-tools keystores --source-mnemonic="$MNEMONIC" --source-min=0 --source-max=100000 --prysm-pass Publ1cS3cret --out-loc test_new --insecure
# 666.36s user 42.88s system 715% cpu 1:39.15 total
time ./eth2-val-tools-prev keystores --source-mnemonic="$MNEMONIC" --source-min=0 --source-max=100000 --prysm-pass Publ1cS3cret --out-loc test_old --insecure
# 390.66s user 16.93s system 126% cpu 5:21.41 total
# verfiy pub keys are ordered the same
diff test_old/pubkeys.json test_new/pubkeys.json
# returns nothing, so we're good
Generating 100.000 insecure keys took 1min 39sec compared to previously 5min 21sec
This got to my attention when @parithosh was generating a lot of keys for testnet purposes. It was taking him a long time.
This change will benefit from all your CPUs and paralellize the creation of the keystores.
Sample timings on my local machine (4 cores with hyperthreading) when creating 1000 keys from a mnemonic:
As you can see, before it took 4min 43sec and on this branch it took 1min 22sec.