Reuse staking keys from `gen_keys`
Opened this issue · 0 comments
shenkeyao commented
We sometimes call gen_keys
multiple times to get the staking keys. We can instead reuse the first key generation result to avoid redundant computation.
E.g., in the minimal_test_network
function, we first use gen_keys
to get the staking keys pub_keys
, then for each validator, we call the genesis
function which also calls gen_keys
to get staking keys known_nodes
. known_nodes
and pub_keys
are the same, so we can just pass pub_keys
as an input to genesis
.