Remove governance GovPubKey
This commit is contained in:
parent
38975ac695
commit
0012f42057
Binary file not shown.
Binary file not shown.
|
@ -164,13 +164,7 @@ making it mechanically impossible for some validators to vote on it.
|
|||
|
||||
### Governance key and governance address
|
||||
|
||||
Validators can make use of a slot where they can designate a
|
||||
`Governance PubKey`. By default, a validator's `Governance PubKey` will be the
|
||||
same as its main PubKey. Validators can change this `Governance PubKey` by
|
||||
sending a `Change Governance PubKey` transaction signed by their main
|
||||
`Consensus PrivKey`. From there, they will be able to sign votes using the
|
||||
`Governance PrivKey` associated with their `Governance PubKey`. The
|
||||
`Governance PubKey` can be changed at any moment.
|
||||
Later, we may add permissionned keys that could only sign txs from certain modules. For the MVP, the `Governance PubKey` will be the main validator PubKey generated at account creation. This PubKey corresponds to a different PrivKey than the Tendermint PrivKey which is responsible for signing consensus messages. Validators thus do not have to sign governance transactions with the sensitive Tendermint PrivKey.
|
||||
|
||||
## Software Upgrade
|
||||
|
||||
|
|
|
@ -71,9 +71,9 @@ type ValidatorGovInfo struct {
|
|||
this `PubKey` for this validator (`nil` if `PubKey` has not voted under this
|
||||
validator)
|
||||
* `ValidatorGovInfos`: A mapping `map[[]byte]ValidatorGovInfo` of validator's
|
||||
governance infos indexed by `<proposalID>:<validatorGovPubKey>`. Returns
|
||||
governance infos indexed by `<proposalID>:<validatorPubKey>`. Returns
|
||||
`nil` if proposal has not entered voting period or if `PubKey` was not the
|
||||
governance public key of a validator when proposal entered voting period.
|
||||
public key of a validator when proposal entered voting period.
|
||||
|
||||
For pseudocode purposes, here are the two function we will use to read or write in stores:
|
||||
|
||||
|
@ -126,12 +126,12 @@ And the pseudocode for the `ProposalProcessingQueue`:
|
|||
activeProcedure = load(Procedures, activeProcedureNumber)
|
||||
|
||||
for each validator in CurrentBondedValidators
|
||||
validatorGovInfo = load(multistore, ValidatorGovInfos, validator.GovPubKey)
|
||||
validatorGovInfo = load(multistore, ValidatorGovInfos, validator.PubKey)
|
||||
|
||||
if (validatorGovInfo.InitVotingPower != nil)
|
||||
// validator was bonded when vote started
|
||||
|
||||
validatorOption = load(Options, validator.GovPubKey)
|
||||
validatorOption = load(Options, validator.PubKey)
|
||||
if (validatorOption == nil)
|
||||
// validator did not vote
|
||||
slash validator by activeProcedure.GovernancePenalty
|
||||
|
|
|
@ -83,7 +83,7 @@ upon receiving txGovSubmitProposal from sender do
|
|||
validatorGovInfo.InitVotingPower = validator.VotingPower
|
||||
validatorGovInfo.Minus = 0
|
||||
|
||||
store(ValidatorGovInfos, <proposalID>:<validator.GovPubKey>, validatorGovInfo)
|
||||
store(ValidatorGovInfos, <proposalID>:<validator.PubKey>, validatorGovInfo)
|
||||
|
||||
ProposalProcessingQueue.push(proposalID)
|
||||
|
||||
|
@ -186,7 +186,7 @@ upon receiving txGovDeposit from sender do
|
|||
validatorGovInfo.InitVotingPower = validator.VotingPower
|
||||
validatorGovInfo.Minus = 0
|
||||
|
||||
store(ValidatorGovInfos, <proposalID>:<validator.GovPubKey>, validatorGovInfo)
|
||||
store(ValidatorGovInfos, <proposalID>:<validator.PubKey>, validatorGovInfo)
|
||||
|
||||
ProposalProcessingQueue.push(txGovDeposit.ProposalID)
|
||||
```
|
||||
|
@ -338,7 +338,7 @@ handled:
|
|||
|
||||
// Throws if
|
||||
// Option is not in Option Set of procedure that was active when vote opened OR if
|
||||
// ValidatorPubKey is not the GovPubKey of a current validator
|
||||
// ValidatorPubKey is not the PubKey of a current validator
|
||||
|
||||
throw
|
||||
|
||||
|
@ -369,7 +369,7 @@ handled:
|
|||
throw
|
||||
|
||||
else
|
||||
validatorGovInfo = load(ValidatorGovInfos, <txGovVote.ProposalID>:<validator.ValidatorGovPubKey>)
|
||||
validatorGovInfo = load(ValidatorGovInfos, <txGovVote.ProposalID>:<validator.ValidatorPubKey>)
|
||||
|
||||
if (validatorGovInfo == nil)
|
||||
// validator became validator after proposal entered voting period
|
||||
|
@ -381,8 +381,8 @@ handled:
|
|||
|
||||
store(Options, <txGovVote.ProposalID>:<sender>:<txGovVote.ValidatorPubKey>, txGovVote.Option)
|
||||
|
||||
if (sender != validator.GovPubKey)
|
||||
// Here, sender is not the Governance PubKey of the validator whose PubKey is txGovVote.ValidatorPubKey
|
||||
if (sender != validator.PubKey)
|
||||
// Here, sender is not the PubKey of the validator whose PubKey is txGovVote.ValidatorPubKey
|
||||
|
||||
if sender does not have bonded Atoms to txGovVote.ValidatorPubKey then
|
||||
// check in Staking module
|
||||
|
@ -396,7 +396,7 @@ handled:
|
|||
// Validator has not voted already
|
||||
|
||||
validatorGovInfo.Minus += sender.bondedAmounTo(txGovVote.ValidatorPubKey)
|
||||
store(ValidatorGovInfos, <txGovVote.ProposalID>:<validator.ValidatorGovPubKey>, validatorGovInfo)
|
||||
store(ValidatorGovInfos, <txGovVote.ProposalID>:<validator.ValidatorPubKey>, validatorGovInfo)
|
||||
|
||||
else
|
||||
// Validator has already voted
|
||||
|
@ -411,7 +411,7 @@ handled:
|
|||
|
||||
|
||||
else
|
||||
// sender is the Governance PubKey of the validator whose main PubKey is txGovVote.ValidatorPubKey
|
||||
// sender is the PubKey of the validator whose main PubKey is txGovVote.ValidatorPubKey
|
||||
// i.e. sender == validator
|
||||
|
||||
optionVotes = load(Votes, <txGovVote.ProposalID>:<txGovVote.Option>)
|
||||
|
|
Loading…
Reference in New Issue