-
Notifications
You must be signed in to change notification settings - Fork 28
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
feat: add an option for selecting priv key type #125
Conversation
privval/file.go
Outdated
privKey := composite.NewPrivKeyComposite(signKey, vrfKey) | ||
func GenFilePV(keyFilePath, stateFilePath, privKeyType string) (filePV *FilePV, err error) { | ||
var privKey crypto.PrivKey | ||
if strings.EqualFold(privKeyType, PrevKeyTypeEd25519) { |
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.
[golangci] reported by reviewdog 🐶
ifElseChain: rewrite if-else to switch statement (gocritic)
privval/file.go
Outdated
@@ -26,6 +27,11 @@ const ( | |||
stepPrecommit int8 = 3 | |||
) | |||
|
|||
const ( | |||
PrevKeyTypeEd25519 string = "ed25519" |
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.
[golangci] reported by reviewdog 🐶
File is not gofmt
-ed with -s
(gofmt)
7a79261
to
a5e6801
Compare
About modifying of
I don't know exactly why this error occurs, but it seems to be a problem that occurs probably because the shared library referenced by libc.so.6 in ubuntu20.10, an environment that builds contract-tests, is not present in the linux environment running contract-tests. To correct this, ubuntu19.10 was used. |
I will switch the base branch from |
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.
LGTM 👍
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.
LGTM
|
||
func AddInitFlags(cmd *cobra.Command) { | ||
cmd.Flags().String("priv-key-type", config.PrivKeyType, | ||
"Specify validator's private key type (ed25519 | composite)") |
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 feel the name composite
seems a bit vague. What about ed25519+bls
, ed25510/bls
, etc., to clarify that it's an Ed25519 and BLS composite key.
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 are already using the name 'composite' in genesis.json and priv_validator_key.json files.
I think it is better to use the same term for unity.
"consensus_params": {
"block": {
"max_bytes": "22020096",
"max_gas": "-1",
"time_iota_ms": "1000"
},
"evidence": {
"max_age_num_blocks": "100000",
"max_age_duration": "172800000000000"
},
"validator": {
"pub_key_types": [
"ed25519",
"composite"
]
}
{
"address": "71463258B3E4A84F7EF1CB54473927726DAF6076",
"pub_key": {
"type": "tendermint/PubKeyComposite",
"value": {
"sign": {
"type": "tendermint/PubKeyBLS12",
"value": "hgq9S306jqNyqQeSX6YXBHV+BmNhoHG80BmuMdbRGyGWjyuDqJl83n+O8c79V9UY"
},
"vrf": {
"type": "tendermint/PubKeyEd25519",
"value": "afUwO/WEjC5l/0/DFM2OLu99n5FGz7pJtEWXqM8loOI="
}
}
},
"priv_key": {
"type": "tendermint/PrivKeyComposite",
"value": {
"sign": {
"type": "tendermint/PrivKeyBLS12",
"value": "DiGI+49LV82oAMod+tu2P9SbqkU08soDbNc1UhsXDW8="
},
"vrf": {
"type": "tendermint/PrivKeyEd25519",
"value": "zcwkHxXUoSTxIa1lNmxA74jzEwMX+SfiIFwMkzqeycpp9TA79YSMLmX/T8MUzY4u732fkUbPukm0RZeozyWg4g=="
}
}
}
}
Closes: #XXX
Description
Added an option for selecting private key type on the
tendermint init
command.Usage:
For contributor use:
docs/
) and code commentsFiles changed
in the Github PR explorer