From two processes to one process (jae's pick)

This commit is contained in:
gamarin 2018-02-26 18:15:48 +01:00
parent aa19612dd0
commit 02435bb1f8
3 changed files with 10 additions and 31 deletions

View File

@ -62,15 +62,6 @@ proposal:
`PlainTextProposals`, but actual software upgrades must be performed via `PlainTextProposals`, but actual software upgrades must be performed via
`SoftwareUpgradeProposals`. `SoftwareUpgradeProposals`.
### Proposal categories
There are two categories of proposal:
* `Regular`
* `Urgent`
These two categories are strictly identical except that `Urgent` proposals can
be accepted faster if a certain condition is met. For more information, see
[Threshold](#threshold) section.
## Vote ## Vote
@ -140,12 +131,8 @@ that proposals are accepted if the proportion of `Yes` votes (excluding
proportion of `NoWithVeto` votes is inferior to 1/3 (excluding `Abstain` proportion of `NoWithVeto` votes is inferior to 1/3 (excluding `Abstain`
votes). votes).
`Urgent` proposals also work with the aforementioned threshold, except there is Proposals can be accepted before the end of the voting period if they meet a special condtion. Namely, if the ratio of `Yes` votes to `InitTotalVotingPower`exceeds 2:3, the proposal will be immediately accepted, even if the `Voting period` is not finished. `InitTotalVotingPower` is the total voting power of all bonded Atom holders at the moment when the vote opens.
another condition that can accelerate the acceptance of the proposal. Namely, This condition exists so that the network can react quickly in case of urgency.
if the ratio of `Yes` votes to `InitTotalVotingPower` exceeds 2:3,
`UrgentProposal` will be immediately accepted, even if the `Voting period` is
not finished. `InitTotalVotingPower` is the total voting power of all bonded
Atom holders at the moment when the vote opens.
### Inheritance ### Inheritance
@ -154,12 +141,9 @@ If a delegator does not vote, it will inherit its validator vote.
* If the delegator votes before its validator, it will not inherit from the * If the delegator votes before its validator, it will not inherit from the
validator's vote. validator's vote.
* If the delegator votes after its validator, it will override its validator * If the delegator votes after its validator, it will override its validator
vote with its own. If the proposal is a `Urgent` proposal, it is possible vote with its own. If the proposal is urgent, it is possible
that the vote will close before delegators have a chance to react and that the vote will close before delegators have a chance to react and
override their validator's vote. This is not a problem, as `Urgent` proposals override their validator's vote. This is not a problem, as proposals require more than 2/3rd of the total voting power to pass before the end of the voting period. If more than 2/3rd of validators collude, they can censor the votes of delegators anyway.
require more than 2/3rd of the total voting power to pass before the end of
the voting period. If more than 2/3rd of validators collude, they can censor
the votes of delegators anyway.
### Validators punishment for non-voting ### Validators punishment for non-voting
@ -174,9 +158,7 @@ period` is over), then the validator will automatically be partially slashed by
*Note: Need to define values for `GovernancePenalty`* *Note: Need to define values for `GovernancePenalty`*
**Exception:** If a proposal is an `Urgent` proposal and is accepted via the **Exception:** If a proposal is accepted via the special condition of having a ratio of `Yes` votes to `InitTotalVotingPower` that exceeds 2:3, validators cannot be punished for not having voted on it.
special condition of having a ratio of `Yes` votes to `InitTotalVotingPower`
that exceeds 2:3, validators cannot be punished for not having voted on it.
That is because the proposal will close as soon as the ratio exceeds 2:3, That is because the proposal will close as soon as the ratio exceeds 2:3,
making it mechanically impossible for some validators to vote on it. making it mechanically impossible for some validators to vote on it.

View File

@ -34,7 +34,6 @@ type Proposal struct {
Title string // Title of the proposal Title string // Title of the proposal
Description string // Description of the proposal Description string // Description of the proposal
Type string // Type of proposal. Initial set {PlainTextProposal, SoftwareUpgradeProposal} Type string // Type of proposal. Initial set {PlainTextProposal, SoftwareUpgradeProposal}
Category bool // false=regular, true=urgent
Deposit int64 // Current deposit on this proposal. Initial value is set at InitialDeposit Deposit int64 // Current deposit on this proposal. Initial value is set at InitialDeposit
SubmitBlock int64 // Height of the block where TxGovSubmitProposal was included SubmitBlock int64 // Height of the block where TxGovSubmitProposal was included
@ -112,7 +111,7 @@ And the pseudocode for the `ProposalProcessingQueue`:
proposal = load(Proposals, proposalID) proposal = load(Proposals, proposalID)
initProcedure = load(Procedures, proposal.InitProcedureNumber) initProcedure = load(Procedures, proposal.InitProcedureNumber)
if (proposal.Category AND proposal.Votes['Yes']/proposal.InitTotalVotingPower >= 2/3) if (proposal.Votes['Yes']/proposal.InitTotalVotingPower >= 2/3)
// proposal was urgent and accepted under the special condition // proposal was urgent and accepted under the special condition
// no punishment // no punishment

View File

@ -12,7 +12,6 @@ type TxGovSubmitProposal struct {
Title string // Title of the proposal Title string // Title of the proposal
Description string // Description of the proposal Description string // Description of the proposal
Type string // Type of proposal. Initial set {PlainTextProposal, SoftwareUpgradeProposal} Type string // Type of proposal. Initial set {PlainTextProposal, SoftwareUpgradeProposal}
Category bool // false=regular, true=urgent
InitialDeposit int64 // Initial deposit paid by sender. Must be strictly positive. InitialDeposit int64 // Initial deposit paid by sender. Must be strictly positive.
} }
``` ```
@ -56,7 +55,6 @@ upon receiving txGovSubmitProposal from sender do
proposal.Title = txGovSubmitProposal.Title proposal.Title = txGovSubmitProposal.Title
proposal.Description = txGovSubmitProposal.Description proposal.Description = txGovSubmitProposal.Description
proposal.Type = txGovSubmitProposal.Type proposal.Type = txGovSubmitProposal.Type
proposal.Category = txGovSubmitProposal.Category
proposal.Deposit = txGovSubmitProposal.InitialDeposit proposal.Deposit = txGovSubmitProposal.InitialDeposit
proposal.SubmitBlock = CurrentBlock proposal.SubmitBlock = CurrentBlock
@ -267,10 +265,10 @@ And the associated pseudocode.
initProcedure = load(Procedures, proposal.InitProcedureNumber) initProcedure = load(Procedures, proposal.InitProcedureNumber)
if (proposal.Category AND proposal.Votes['Yes']/proposal.InitTotalVotingPower >= 2/3) OR ((CurrentBlock > proposal.VotingStartBlock + initProcedure.VotingPeriod) AND (proposal.Votes['NoWithVeto']/(proposal.Votes['Yes']+proposal.Votes['No']+proposal.Votes['NoWithVeto']) < 1/3) AND (proposal.Votes['Yes']/(proposal.Votes['Yes']+proposal.Votes['No']+proposal.Votes['NoWithVeto']) > 1/2)) then if (proposal.Votes['Yes']/proposal.InitTotalVotingPower >= 2/3) OR ((CurrentBlock > proposal.VotingStartBlock + initProcedure.VotingPeriod) AND (proposal.Votes['NoWithVeto']/(proposal.Votes['Yes']+proposal.Votes['No']+proposal.Votes['NoWithVeto']) < 1/3) AND (proposal.Votes['Yes']/(proposal.Votes['Yes']+proposal.Votes['No']+proposal.Votes['NoWithVeto']) > 1/2)) then
// Proposal was accepted either because // Proposal was accepted either because
// Proposal was urgent and special condition was met // pecial condition was met OR
// Voting period ended and vote satisfies threshold // Voting period ended and vote satisfies threshold
store(Deposits, <txGovClaimDeposit.ProposalID>:<sender>, 0) store(Deposits, <txGovClaimDeposit.ProposalID>:<sender>, 0)
@ -354,14 +352,14 @@ handled:
(CurrentBlock > proposal.VotingStartBlock + initProcedure.VotingPeriod) OR (CurrentBlock > proposal.VotingStartBlock + initProcedure.VotingPeriod) OR
(proposal.VotingStartBlock < lastBondingBlock(sender, txGovVote.ValidatorPubKey) OR (proposal.VotingStartBlock < lastBondingBlock(sender, txGovVote.ValidatorPubKey) OR
(proposal.VotingStartBlock < lastUnbondingBlock(sender, txGovVote.ValidatorPubKey) OR (proposal.VotingStartBlock < lastUnbondingBlock(sender, txGovVote.ValidatorPubKey) OR
(proposal.Category AND proposal.Votes['Yes']/proposal.InitTotalVotingPower >= 2/3) then (proposal.Votes['Yes']/proposal.InitTotalVotingPower >= 2/3) then
// Throws if // Throws if
// Vote has not started OR if // Vote has not started OR if
// Vote had ended OR if // Vote had ended OR if
// sender bonded Atoms to ValidatorPubKey after start of vote OR if // sender bonded Atoms to ValidatorPubKey after start of vote OR if
// sender unbonded Atoms from ValidatorPubKey after start of vote OR if // sender unbonded Atoms from ValidatorPubKey after start of vote OR if
// proposal is urgent and special condition is met, i.e. proposal is accepted and closed // special condition is met, i.e. proposal is accepted and closed
throw throw