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
|
### Governance key and governance address
|
||||||
|
|
||||||
Validators can make use of a slot where they can designate a
|
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.
|
||||||
`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.
|
|
||||||
|
|
||||||
## Software Upgrade
|
## Software Upgrade
|
||||||
|
|
||||||
|
|
|
@ -71,9 +71,9 @@ type ValidatorGovInfo struct {
|
||||||
this `PubKey` for this validator (`nil` if `PubKey` has not voted under this
|
this `PubKey` for this validator (`nil` if `PubKey` has not voted under this
|
||||||
validator)
|
validator)
|
||||||
* `ValidatorGovInfos`: A mapping `map[[]byte]ValidatorGovInfo` of validator's
|
* `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
|
`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:
|
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)
|
activeProcedure = load(Procedures, activeProcedureNumber)
|
||||||
|
|
||||||
for each validator in CurrentBondedValidators
|
for each validator in CurrentBondedValidators
|
||||||
validatorGovInfo = load(multistore, ValidatorGovInfos, validator.GovPubKey)
|
validatorGovInfo = load(multistore, ValidatorGovInfos, validator.PubKey)
|
||||||
|
|
||||||
if (validatorGovInfo.InitVotingPower != nil)
|
if (validatorGovInfo.InitVotingPower != nil)
|
||||||
// validator was bonded when vote started
|
// validator was bonded when vote started
|
||||||
|
|
||||||
validatorOption = load(Options, validator.GovPubKey)
|
validatorOption = load(Options, validator.PubKey)
|
||||||
if (validatorOption == nil)
|
if (validatorOption == nil)
|
||||||
// validator did not vote
|
// validator did not vote
|
||||||
slash validator by activeProcedure.GovernancePenalty
|
slash validator by activeProcedure.GovernancePenalty
|
||||||
|
|
|
@ -83,7 +83,7 @@ upon receiving txGovSubmitProposal from sender do
|
||||||
validatorGovInfo.InitVotingPower = validator.VotingPower
|
validatorGovInfo.InitVotingPower = validator.VotingPower
|
||||||
validatorGovInfo.Minus = 0
|
validatorGovInfo.Minus = 0
|
||||||
|
|
||||||
store(ValidatorGovInfos, <proposalID>:<validator.GovPubKey>, validatorGovInfo)
|
store(ValidatorGovInfos, <proposalID>:<validator.PubKey>, validatorGovInfo)
|
||||||
|
|
||||||
ProposalProcessingQueue.push(proposalID)
|
ProposalProcessingQueue.push(proposalID)
|
||||||
|
|
||||||
|
@ -186,7 +186,7 @@ upon receiving txGovDeposit from sender do
|
||||||
validatorGovInfo.InitVotingPower = validator.VotingPower
|
validatorGovInfo.InitVotingPower = validator.VotingPower
|
||||||
validatorGovInfo.Minus = 0
|
validatorGovInfo.Minus = 0
|
||||||
|
|
||||||
store(ValidatorGovInfos, <proposalID>:<validator.GovPubKey>, validatorGovInfo)
|
store(ValidatorGovInfos, <proposalID>:<validator.PubKey>, validatorGovInfo)
|
||||||
|
|
||||||
ProposalProcessingQueue.push(txGovDeposit.ProposalID)
|
ProposalProcessingQueue.push(txGovDeposit.ProposalID)
|
||||||
```
|
```
|
||||||
|
@ -338,7 +338,7 @@ handled:
|
||||||
|
|
||||||
// Throws if
|
// Throws if
|
||||||
// Option is not in Option Set of procedure that was active when vote opened OR 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
|
throw
|
||||||
|
|
||||||
|
@ -369,7 +369,7 @@ handled:
|
||||||
throw
|
throw
|
||||||
|
|
||||||
else
|
else
|
||||||
validatorGovInfo = load(ValidatorGovInfos, <txGovVote.ProposalID>:<validator.ValidatorGovPubKey>)
|
validatorGovInfo = load(ValidatorGovInfos, <txGovVote.ProposalID>:<validator.ValidatorPubKey>)
|
||||||
|
|
||||||
if (validatorGovInfo == nil)
|
if (validatorGovInfo == nil)
|
||||||
// validator became validator after proposal entered voting period
|
// validator became validator after proposal entered voting period
|
||||||
|
@ -381,8 +381,8 @@ handled:
|
||||||
|
|
||||||
store(Options, <txGovVote.ProposalID>:<sender>:<txGovVote.ValidatorPubKey>, txGovVote.Option)
|
store(Options, <txGovVote.ProposalID>:<sender>:<txGovVote.ValidatorPubKey>, txGovVote.Option)
|
||||||
|
|
||||||
if (sender != validator.GovPubKey)
|
if (sender != validator.PubKey)
|
||||||
// Here, sender is not the Governance PubKey of the validator whose PubKey is txGovVote.ValidatorPubKey
|
// 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
|
if sender does not have bonded Atoms to txGovVote.ValidatorPubKey then
|
||||||
// check in Staking module
|
// check in Staking module
|
||||||
|
@ -396,7 +396,7 @@ handled:
|
||||||
// Validator has not voted already
|
// Validator has not voted already
|
||||||
|
|
||||||
validatorGovInfo.Minus += sender.bondedAmounTo(txGovVote.ValidatorPubKey)
|
validatorGovInfo.Minus += sender.bondedAmounTo(txGovVote.ValidatorPubKey)
|
||||||
store(ValidatorGovInfos, <txGovVote.ProposalID>:<validator.ValidatorGovPubKey>, validatorGovInfo)
|
store(ValidatorGovInfos, <txGovVote.ProposalID>:<validator.ValidatorPubKey>, validatorGovInfo)
|
||||||
|
|
||||||
else
|
else
|
||||||
// Validator has already voted
|
// Validator has already voted
|
||||||
|
@ -411,7 +411,7 @@ handled:
|
||||||
|
|
||||||
|
|
||||||
else
|
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
|
// i.e. sender == validator
|
||||||
|
|
||||||
optionVotes = load(Votes, <txGovVote.ProposalID>:<txGovVote.Option>)
|
optionVotes = load(Votes, <txGovVote.ProposalID>:<txGovVote.Option>)
|
||||||
|
|
Loading…
Reference in New Issue