-
Notifications
You must be signed in to change notification settings - Fork 11.3k
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
Let validator reads key pair from network config and remove --address and --validator_idx #1736
Conversation
genesis(genesis_conf_copy, Some(authority.address)).await?; | ||
let genesis_conf: GenesisConfig = PersistedConfig::read(&cfg.genesis_config_path)?; | ||
let adddress = SuiAddress::from(genesis_conf.key_pair.public_key_bytes()); | ||
let (network_config, _, _) = genesis(genesis_conf, Some(adddress)).await?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, we don't need address
here
We can infer it from the config
So we should remove the field in genesis method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can get the address from here implicitly
Line 388 in 1caf0cc
let num_to_provision = if single_address.is_none() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right we don't (https://github.com/MystenLabs/sui/pull/1661/files#r863973592). We should clean that up later, trying to get this PR very small and modest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dont you think its small enough that we can fix it now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's tiny enough that we should make it here - calls into genesis
are spread into multiple files. Also this PR itself does not trigger address
becoming unused, so they are sorta orthogonal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be happy with an issue addressing the cleaning up of the superfluous address calculation, as long as the bench isn't broken here (@oxade feel free to chime in).
@huitseeker #1758 has context |
… and --validator_idx (#1736) * remove duplicated src/validator.rs * validator can read network config keypair to decide identity * fmt * revert * fix * update bench too Co-authored-by: Lu Zhang <luzhang@Lus-MacBook-Pro.local>
… and --validator_idx (#1736) * remove duplicated src/validator.rs * validator can read network config keypair to decide identity * fmt * revert * fix * update bench too Co-authored-by: Lu Zhang <luzhang@Lus-MacBook-Pro.local>
Since we separate private keys out of
AuthorityPrivateInfo
into a singleKeyPair
in network/genesis config, now we can deterministically know which authority to represent when running a validator. This PR adds this logic to pickAuthorityPrivateInfo
and removes--address
and--validator_idx
as they become unnecessary.