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

parallel validator key generation #2

Merged
merged 1 commit into from
Dec 30, 2021

Conversation

skylenet
Copy link
Contributor

@skylenet skylenet commented Nov 4, 2021

Hey @protolambda . Nice tool! I'm using it to generate the genesis.ssz file for some private testnets on the fly. I was using it with 100k+ validators and it was taking me like 10min just to get the files generated. This change makes spawning my networks from scratch quite faster :)

Parallelize the validator creation.

$ time ./eth2-testnet-genesis phase0 --config config.yaml --mnemonics mnemonics.yaml --timestamp 1623884847 --tranches-dir tranches_new --state-output genesis_new.ssz
# 210.45s user 1.42s system 723% cpu 29.301 total

$ time ./eth2-testnet-genesis-old phase0 --config config.yaml --mnemonics mnemonics.yaml --timestamp 1623884847 --tranches-dir tranches_old --state-output genesis_old.ssz
# 121.11s user 3.50s system 120% cpu 1:43.09 total

Time sample from my local dev machine:
20.000 validators from 1 mnemonic was taking 1min43sec. With the change it's taking me 29sec

A quick sanity check:

# Comparing outputs to make sure we didn't break anything
$ diff tranches_new/tranche_0000.txt tranches_old/tranche_0000.txt # returns nothing, so we're good

$ zcli pretty phase0 BeaconState genesis_old.ssz > genesis_old.json
$ zcli pretty phase0 BeaconState genesis_new.ssz > genesis_new.json
$ diff genesis_old.json genesis_new.json # returns nothing, so we're good.

@protolambda protolambda merged commit bf1739b into protolambda:master Dec 30, 2021
gballet added a commit to gballet/eth2-testnet-genesis that referenced this pull request Aug 27, 2024
gballet added a commit to gballet/eth2-testnet-genesis that referenced this pull request Aug 27, 2024
parithosh added a commit that referenced this pull request Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants