From 02435bb1f88a42f4ddeee10660f3fa94e10eae48 Mon Sep 17 00:00:00 2001 From: gamarin Date: Mon, 26 Feb 2018 18:15:48 +0100 Subject: [PATCH] From two processes to one process (jae's pick) --- docs/spec/governance/overview.md | 28 +++++----------------------- docs/spec/governance/state.md | 3 +-- docs/spec/governance/transactions.md | 10 ++++------ 3 files changed, 10 insertions(+), 31 deletions(-) diff --git a/docs/spec/governance/overview.md b/docs/spec/governance/overview.md index 153b19740..93bb40dee 100644 --- a/docs/spec/governance/overview.md +++ b/docs/spec/governance/overview.md @@ -62,15 +62,6 @@ proposal: `PlainTextProposals`, but actual software upgrades must be performed via `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 @@ -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` votes). -`Urgent` proposals also work with the aforementioned threshold, except there is -another condition that can accelerate the acceptance of the proposal. Namely, -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. +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. +This condition exists so that the network can react quickly in case of urgency. ### 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 validator's vote. * 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 - override their validator's vote. This is not a problem, as `Urgent` 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. + 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. ### Validator’s 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`* -**Exception:** If a proposal is an `Urgent` proposal and 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. +**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. 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. diff --git a/docs/spec/governance/state.md b/docs/spec/governance/state.md index b0633ea83..1fb2581c2 100644 --- a/docs/spec/governance/state.md +++ b/docs/spec/governance/state.md @@ -34,7 +34,6 @@ type Proposal struct { Title string // Title of the proposal Description string // Description of the proposal 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 SubmitBlock int64 // Height of the block where TxGovSubmitProposal was included @@ -112,7 +111,7 @@ And the pseudocode for the `ProposalProcessingQueue`: proposal = load(Proposals, proposalID) 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 // no punishment diff --git a/docs/spec/governance/transactions.md b/docs/spec/governance/transactions.md index 06e20ffd9..2288d3989 100644 --- a/docs/spec/governance/transactions.md +++ b/docs/spec/governance/transactions.md @@ -12,7 +12,6 @@ type TxGovSubmitProposal struct { Title string // Title of the proposal Description string // Description of the proposal 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. } ``` @@ -56,7 +55,6 @@ upon receiving txGovSubmitProposal from sender do proposal.Title = txGovSubmitProposal.Title proposal.Description = txGovSubmitProposal.Description proposal.Type = txGovSubmitProposal.Type - proposal.Category = txGovSubmitProposal.Category proposal.Deposit = txGovSubmitProposal.InitialDeposit proposal.SubmitBlock = CurrentBlock @@ -267,10 +265,10 @@ And the associated pseudocode. 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 urgent and special condition was met + // pecial condition was met OR // Voting period ended and vote satisfies threshold store(Deposits, :, 0) @@ -354,14 +352,14 @@ handled: (CurrentBlock > proposal.VotingStartBlock + initProcedure.VotingPeriod) OR (proposal.VotingStartBlock < lastBondingBlock(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 // Vote has not started OR if // Vote had ended OR if // sender bonded Atoms to 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