From 2bb4ed00f800c208550e347c4a412636db05eab9 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Thu, 12 Sep 2024 13:07:17 +0200 Subject: [PATCH 1/5] remove nvw option, default pass threshold to 2/3 --- proto/atomone/gov/v1/gov.proto | 19 +- proto/atomone/gov/v1beta1/gov.proto | 4 +- tests/e2e/genesis.go | 4 +- x/gov/client/cli/query.go | 2 +- x/gov/client/cli/tx_test.go | 6 +- x/gov/client/utils/utils.go | 3 - x/gov/client/utils/utils_test.go | 12 +- x/gov/keeper/grpc_query.go | 8 +- x/gov/keeper/grpc_query_test.go | 86 +++---- x/gov/keeper/msg_server_test.go | 42 ---- x/gov/keeper/tally.go | 11 +- x/gov/keeper/tally_test.go | 116 +++------ x/gov/keeper/vote_test.go | 8 +- x/gov/migrations/v3/convert.go | 6 +- x/gov/simulation/genesis.go | 8 +- x/gov/simulation/genesis_test.go | 1 - x/gov/simulation/operations.go | 13 +- x/gov/types/v1/genesis_test.go | 10 - x/gov/types/v1/gov.pb.go | 375 ++++++---------------------- x/gov/types/v1/msgs_test.go | 2 - x/gov/types/v1/params.go | 28 +-- x/gov/types/v1/params_legacy.go | 11 - x/gov/types/v1/tally.go | 15 +- x/gov/types/v1/vote.go | 12 +- x/gov/types/v1beta1/params.go | 4 +- 25 files changed, 205 insertions(+), 601 deletions(-) diff --git a/proto/atomone/gov/v1/gov.proto b/proto/atomone/gov/v1/gov.proto index 6ab8bea4..9cff33e8 100644 --- a/proto/atomone/gov/v1/gov.proto +++ b/proto/atomone/gov/v1/gov.proto @@ -22,8 +22,6 @@ enum VoteOption { VOTE_OPTION_ABSTAIN = 2; // VOTE_OPTION_NO defines a no vote option. VOTE_OPTION_NO = 3; - // VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. - VOTE_OPTION_NO_WITH_VETO = 4; } // WeightedVoteOption defines a unit of vote for vote split. @@ -127,8 +125,6 @@ message TallyResult { string abstain_count = 2 [(cosmos_proto.scalar) = "cosmos.Int"]; // no_count is the number of no votes on a proposal. string no_count = 3 [(cosmos_proto.scalar) = "cosmos.Int"]; - // no_with_veto_count is the number of no with veto votes on a proposal. - string no_with_veto_count = 4 [(cosmos_proto.scalar) = "cosmos.Int"]; } // Vote defines a vote on a governance proposal. @@ -173,12 +169,8 @@ message TallyParams { // considered valid. string quorum = 1 [(cosmos_proto.scalar) = "cosmos.Dec"]; - // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. + // Minimum proportion of Yes votes for proposal to pass. Default value: 2/3. string threshold = 2 [(cosmos_proto.scalar) = "cosmos.Dec"]; - - // Minimum value of Veto votes to Total votes ratio for proposal to be - // vetoed. Default value: 1/3. - string veto_threshold = 3 [(cosmos_proto.scalar) = "cosmos.Dec"]; } // Params defines the parameters for the x/gov module. @@ -199,13 +191,9 @@ message Params { // considered valid. string quorum = 4 [(cosmos_proto.scalar) = "cosmos.Dec"]; - // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. + // Minimum proportion of Yes votes for proposal to pass. Default value: 2/3. string threshold = 5 [(cosmos_proto.scalar) = "cosmos.Dec"]; - // Minimum value of Veto votes to Total votes ratio for proposal to be - // vetoed. Default value: 1/3. - string veto_threshold = 6 [(cosmos_proto.scalar) = "cosmos.Dec"]; - // The ratio representing the proportion of the deposit value that must be paid at proposal submission. string min_initial_deposit_ratio = 7 [(cosmos_proto.scalar) = "cosmos.Dec"]; @@ -214,7 +202,4 @@ message Params { // burn deposits if the proposal does not enter voting period bool burn_proposal_deposit_prevote = 14; - - // burn deposits if quorum with vote type no_veto is met - bool burn_vote_veto = 15; } diff --git a/proto/atomone/gov/v1beta1/gov.proto b/proto/atomone/gov/v1beta1/gov.proto index bd5e04a4..d355709f 100644 --- a/proto/atomone/gov/v1beta1/gov.proto +++ b/proto/atomone/gov/v1beta1/gov.proto @@ -235,7 +235,7 @@ message TallyParams { (gogoproto.jsontag) = "quorum,omitempty" ]; - // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. + // Minimum proportion of Yes votes for proposal to pass. Default value: 2/3. bytes threshold = 2 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false, @@ -243,7 +243,7 @@ message TallyParams { ]; // Minimum value of Veto votes to Total votes ratio for proposal to be - // vetoed. Default value: 1/3. + // vetoed. Default value: 0 (disabled). bytes veto_threshold = 3 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false, diff --git a/tests/e2e/genesis.go b/tests/e2e/genesis.go index 7dd9ad28..d876f8d9 100644 --- a/tests/e2e/genesis.go +++ b/tests/e2e/genesis.go @@ -132,9 +132,9 @@ func modifyGenesis(path, moniker, amountStr string, addrAll []sdk.AccAddress, de govv1.NewParams( sdk.NewCoins(sdk.NewCoin(denom, amnt)), maxDepositPeriod, votingPeriod, - quorum.String(), threshold.String(), govv1.DefaultVetoThreshold.String(), + quorum.String(), threshold.String(), sdk.ZeroDec().String(), - false, false, true, + false, false, ), ) govGenStateBz, err := cdc.MarshalJSON(govGenState) diff --git a/x/gov/client/cli/query.go b/x/gov/client/cli/query.go index be807bd2..1c3707c0 100644 --- a/x/gov/client/cli/query.go +++ b/x/gov/client/cli/query.go @@ -547,7 +547,7 @@ $ %s query gov params vp := v1.NewVotingParams(res.Params.VotingPeriod) res.VotingParams = &vp - tp := v1.NewTallyParams(res.Params.Quorum, res.Params.Threshold, res.Params.VetoThreshold) + tp := v1.NewTallyParams(res.Params.Quorum, res.Params.Threshold) res.TallyParams = &tp return clientCtx.PrintProto(res) diff --git a/x/gov/client/cli/tx_test.go b/x/gov/client/cli/tx_test.go index 13f991c8..7772362e 100644 --- a/x/gov/client/cli/tx_test.go +++ b/x/gov/client/cli/tx_test.go @@ -89,7 +89,7 @@ func (s *CLITestSuite) SetupSuite() { s.Require().NoError(err) // vote for proposal3 as val - _, err = govclitestutil.MsgVote(s.clientCtx, val[0].Address.String(), "3", "yes=0.6,no=0.3,abstain=0.05,no_with_veto=0.05") + _, err = govclitestutil.MsgVote(s.clientCtx, val[0].Address.String(), "3", "yes=0.6,no=0.3,abstain=0.1") s.Require().NoError(err) } @@ -457,7 +457,7 @@ func (s *CLITestSuite) TestNewCmdWeightedVote() { "invalid valid split vote string", []string{ "1", - "yes/0.6,no/0.3,abstain/0.05,no_with_veto/0.05", + "yes/0.6,no/0.3,abstain/0.1", fmt.Sprintf("--%s=%s", flags.FlagFrom, val[0].Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), @@ -469,7 +469,7 @@ func (s *CLITestSuite) TestNewCmdWeightedVote() { "valid split vote", []string{ "1", - "yes=0.6,no=0.3,abstain=0.05,no_with_veto=0.05", + "yes=0.6,no=0.3,abstain=0.1", fmt.Sprintf("--%s=%s", flags.FlagFrom, val[0].Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), diff --git a/x/gov/client/utils/utils.go b/x/gov/client/utils/utils.go index d798c041..dc958c43 100644 --- a/x/gov/client/utils/utils.go +++ b/x/gov/client/utils/utils.go @@ -18,9 +18,6 @@ func NormalizeVoteOption(option string) string { case "No", "no": return v1beta1.OptionNo.String() - case "NoWithVeto", "no_with_veto": - return v1beta1.OptionNoWithVeto.String() - default: return option } diff --git a/x/gov/client/utils/utils_test.go b/x/gov/client/utils/utils_test.go index 85a45452..f972f5cc 100644 --- a/x/gov/client/utils/utils_test.go +++ b/x/gov/client/utils/utils_test.go @@ -30,16 +30,16 @@ func TestNormalizeWeightedVoteOptions(t *testing.T) { normalized: "VOTE_OPTION_YES=0.5,VOTE_OPTION_NO=0.5", }, "3 options": { - options: "Yes=0.5,No=0.4,NoWithVeto=0.1", - normalized: "VOTE_OPTION_YES=0.5,VOTE_OPTION_NO=0.4,VOTE_OPTION_NO_WITH_VETO=0.1", + options: "Yes=0.5,No=0.4,Abstain=0.1", + normalized: "VOTE_OPTION_YES=0.5,VOTE_OPTION_NO=0.4,VOTE_OPTION_ABSTAIN=0.1", }, "zero weight option": { - options: "Yes=0.5,No=0.5,NoWithVeto=0", - normalized: "VOTE_OPTION_YES=0.5,VOTE_OPTION_NO=0.5,VOTE_OPTION_NO_WITH_VETO=0", + options: "Yes=0.5,No=0.5,Abstain=0", + normalized: "VOTE_OPTION_YES=0.5,VOTE_OPTION_NO=0.5,VOTE_OPTION_ABSTAIN=0", }, "minus weight option": { - options: "Yes=0.5,No=0.6,NoWithVeto=-0.1", - normalized: "VOTE_OPTION_YES=0.5,VOTE_OPTION_NO=0.6,VOTE_OPTION_NO_WITH_VETO=-0.1", + options: "Yes=0.5,No=0.6,Abstain=-0.1", + normalized: "VOTE_OPTION_YES=0.5,VOTE_OPTION_NO=0.6,VOTE_OPTION_ABSTAIN=-0.1", }, "empty options": { options: "", diff --git a/x/gov/keeper/grpc_query.go b/x/gov/keeper/grpc_query.go index 8314d898..1893c6fa 100644 --- a/x/gov/keeper/grpc_query.go +++ b/x/gov/keeper/grpc_query.go @@ -174,7 +174,7 @@ func (q Keeper) Params(c context.Context, req *v1.QueryParamsRequest) (*v1.Query response.VotingParams = &votingParams case v1.ParamTallying: - tallyParams := v1.NewTallyParams(params.Quorum, params.Threshold, params.VetoThreshold) + tallyParams := v1.NewTallyParams(params.Quorum, params.Threshold) response.TallyParams = &tallyParams default: @@ -403,12 +403,8 @@ func (q legacyQueryServer) Params(c context.Context, req *v1beta1.QueryParamsReq if err != nil { return nil, err } - vetoThreshold, err := sdk.NewDecFromStr(resp.TallyParams.VetoThreshold) - if err != nil { - return nil, err - } - response.TallyParams = v1beta1.NewTallyParams(quorum, threshold, vetoThreshold) + response.TallyParams = v1beta1.NewTallyParams(quorum, threshold, sdk.ZeroDec()) } return response, nil diff --git a/x/gov/keeper/grpc_query_test.go b/x/gov/keeper/grpc_query_test.go index 5b718cce..ec03ca2c 100644 --- a/x/gov/keeper/grpc_query_test.go +++ b/x/gov/keeper/grpc_query_test.go @@ -843,7 +843,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryParams() { "tally params request", func() { req = &v1.QueryParamsRequest{ParamsType: v1.ParamTallying} - tallyParams := v1.NewTallyParams(params.Quorum, params.Threshold, params.VetoThreshold) + tallyParams := v1.NewTallyParams(params.Quorum, params.Threshold) expRes = &v1.QueryParamsResponse{ TallyParams: &tallyParams, } @@ -1406,10 +1406,9 @@ func (suite *KeeperTestSuite) TestGRPCQueryTallyResult() { Id: 1, Status: v1.StatusPassed, FinalTallyResult: &v1.TallyResult{ - YesCount: "4", - AbstainCount: "1", - NoCount: "0", - NoWithVetoCount: "0", + YesCount: "4", + AbstainCount: "1", + NoCount: "0", }, SubmitTime: &propTime, VotingStartTime: &propTime, @@ -1421,10 +1420,9 @@ func (suite *KeeperTestSuite) TestGRPCQueryTallyResult() { req = &v1.QueryTallyResultRequest{ProposalId: proposal.Id} expTally = &v1.TallyResult{ - YesCount: "4", - AbstainCount: "1", - NoCount: "0", - NoWithVetoCount: "0", + YesCount: "4", + AbstainCount: "1", + NoCount: "0", } }, true, @@ -1446,10 +1444,9 @@ func (suite *KeeperTestSuite) TestGRPCQueryTallyResult() { req = &v1.QueryTallyResultRequest{ProposalId: proposal.Id} expTally = &v1.TallyResult{ - YesCount: "0", - AbstainCount: "0", - NoCount: "0", - NoWithVetoCount: "0", + YesCount: "0", + AbstainCount: "0", + NoCount: "0", } }, true, @@ -1471,10 +1468,9 @@ func (suite *KeeperTestSuite) TestGRPCQueryTallyResult() { req = &v1.QueryTallyResultRequest{ProposalId: proposal.Id} expTally = &v1.TallyResult{ - YesCount: "0", - AbstainCount: "0", - NoCount: "0", - NoWithVetoCount: "0", + YesCount: "0", + AbstainCount: "0", + NoCount: "0", } }, true, @@ -1487,10 +1483,9 @@ func (suite *KeeperTestSuite) TestGRPCQueryTallyResult() { Id: 1, Status: v1.StatusFailed, FinalTallyResult: &v1.TallyResult{ - YesCount: "4", - AbstainCount: "1", - NoCount: "0", - NoWithVetoCount: "0", + YesCount: "4", + AbstainCount: "1", + NoCount: "0", }, SubmitTime: &propTime, VotingStartTime: &propTime, @@ -1502,10 +1497,9 @@ func (suite *KeeperTestSuite) TestGRPCQueryTallyResult() { req = &v1.QueryTallyResultRequest{ProposalId: proposal.Id} expTally = &v1.TallyResult{ - YesCount: "4", - AbstainCount: "1", - NoCount: "0", - NoWithVetoCount: "0", + YesCount: "4", + AbstainCount: "1", + NoCount: "0", } }, true, @@ -1573,10 +1567,9 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryTallyResult() { Id: 1, Status: v1.StatusPassed, FinalTallyResult: &v1.TallyResult{ - YesCount: "4", - AbstainCount: "1", - NoCount: "0", - NoWithVetoCount: "0", + YesCount: "4", + AbstainCount: "1", + NoCount: "0", }, SubmitTime: &propTime, VotingStartTime: &propTime, @@ -1588,10 +1581,9 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryTallyResult() { req = &v1beta1.QueryTallyResultRequest{ProposalId: proposal.Id} expTally = &v1beta1.TallyResult{ - Yes: math.NewInt(4), - Abstain: math.NewInt(1), - No: math.NewInt(0), - NoWithVeto: math.NewInt(0), + Yes: math.NewInt(4), + Abstain: math.NewInt(1), + No: math.NewInt(0), } }, true, @@ -1613,10 +1605,9 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryTallyResult() { req = &v1beta1.QueryTallyResultRequest{ProposalId: proposal.Id} expTally = &v1beta1.TallyResult{ - Yes: math.NewInt(0), - Abstain: math.NewInt(0), - No: math.NewInt(0), - NoWithVeto: math.NewInt(0), + Yes: math.NewInt(0), + Abstain: math.NewInt(0), + No: math.NewInt(0), } }, true, @@ -1638,10 +1629,9 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryTallyResult() { req = &v1beta1.QueryTallyResultRequest{ProposalId: proposal.Id} expTally = &v1beta1.TallyResult{ - Yes: math.NewInt(0), - Abstain: math.NewInt(0), - No: math.NewInt(0), - NoWithVeto: math.NewInt(0), + Yes: math.NewInt(0), + Abstain: math.NewInt(0), + No: math.NewInt(0), } }, true, @@ -1654,10 +1644,9 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryTallyResult() { Id: 1, Status: v1.StatusFailed, FinalTallyResult: &v1.TallyResult{ - YesCount: "4", - AbstainCount: "1", - NoCount: "0", - NoWithVetoCount: "0", + YesCount: "4", + AbstainCount: "1", + NoCount: "0", }, SubmitTime: &propTime, VotingStartTime: &propTime, @@ -1669,10 +1658,9 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryTallyResult() { req = &v1beta1.QueryTallyResultRequest{ProposalId: proposal.Id} expTally = &v1beta1.TallyResult{ - Yes: math.NewInt(4), - Abstain: math.NewInt(1), - No: math.NewInt(0), - NoWithVeto: math.NewInt(0), + Yes: math.NewInt(4), + Abstain: math.NewInt(1), + No: math.NewInt(0), } }, true, diff --git a/x/gov/keeper/msg_server_test.go b/x/gov/keeper/msg_server_test.go index 865c26cb..dced654d 100644 --- a/x/gov/keeper/msg_server_test.go +++ b/x/gov/keeper/msg_server_test.go @@ -954,48 +954,6 @@ func (suite *KeeperTestSuite) TestMsgUpdateParams() { expErr: true, expErrMsg: "vote threshold too large", }, - { - name: "invalid veto threshold", - input: func() *v1.MsgUpdateParams { - params1 := params - params1.VetoThreshold = "abc" - - return &v1.MsgUpdateParams{ - Authority: authority, - Params: params1, - } - }, - expErr: true, - expErrMsg: "invalid vetoThreshold string", - }, - { - name: "negative veto threshold", - input: func() *v1.MsgUpdateParams { - params1 := params - params1.VetoThreshold = "-0.1" - - return &v1.MsgUpdateParams{ - Authority: authority, - Params: params1, - } - }, - expErr: true, - expErrMsg: "veto threshold must be positive", - }, - { - name: "veto threshold > 1", - input: func() *v1.MsgUpdateParams { - params1 := params - params1.VetoThreshold = "2" - - return &v1.MsgUpdateParams{ - Authority: authority, - Params: params1, - } - }, - expErr: true, - expErrMsg: "veto threshold too large", - }, { name: "invalid voting period", input: func() *v1.MsgUpdateParams { diff --git a/x/gov/keeper/tally.go b/x/gov/keeper/tally.go index 9c335f52..33e73c06 100644 --- a/x/gov/keeper/tally.go +++ b/x/gov/keeper/tally.go @@ -18,7 +18,6 @@ func (keeper Keeper) Tally(ctx sdk.Context, proposal v1.Proposal) (passes bool, results[v1.OptionYes] = math.LegacyZeroDec() results[v1.OptionAbstain] = math.LegacyZeroDec() results[v1.OptionNo] = math.LegacyZeroDec() - results[v1.OptionNoWithVeto] = math.LegacyZeroDec() totalVotingPower := math.LegacyZeroDec() currValidators := make(map[string]stakingtypes.ValidatorI) @@ -95,18 +94,12 @@ func (keeper Keeper) Tally(ctx sdk.Context, proposal v1.Proposal) (passes bool, return false, false, tallyResults } - // If more than 1/3 of voters veto, proposal fails - vetoThreshold, _ := sdk.NewDecFromStr(params.VetoThreshold) - if results[v1.OptionNoWithVeto].Quo(totalVotingPower).GT(vetoThreshold) { - return false, params.BurnVoteVeto, tallyResults - } - - // If more than 1/2 of non-abstaining voters vote Yes, proposal passes + // If more than 2/3 of non-abstaining voters vote Yes, proposal passes threshold, _ := sdk.NewDecFromStr(params.Threshold) if results[v1.OptionYes].Quo(totalVotingPower.Sub(results[v1.OptionAbstain])).GT(threshold) { return true, false, tallyResults } - // If more than 1/2 of non-abstaining voters vote No, proposal fails + // If more than 1/3 of non-abstaining voters vote No, proposal fails return false, false, tallyResults } diff --git a/x/gov/keeper/tally_test.go b/x/gov/keeper/tally_test.go index 2f772b3f..6af5bf09 100644 --- a/x/gov/keeper/tally_test.go +++ b/x/gov/keeper/tally_test.go @@ -131,10 +131,9 @@ func TestTally(t *testing.T) { expectedPass: false, expectedBurn: true, expectedTally: v1.TallyResult{ - YesCount: "0", - AbstainCount: "0", - NoCount: "0", - NoWithVetoCount: "0", + YesCount: "0", + AbstainCount: "0", + NoCount: "0", }, }, { @@ -145,10 +144,9 @@ func TestTally(t *testing.T) { expectedPass: false, expectedBurn: true, // burn because quorum not reached expectedTally: v1.TallyResult{ - YesCount: "0", - AbstainCount: "0", - NoCount: "1", - NoWithVetoCount: "0", + YesCount: "0", + AbstainCount: "0", + NoCount: "1", }, }, { @@ -159,10 +157,9 @@ func TestTally(t *testing.T) { expectedPass: false, expectedBurn: true, // burn because quorum not reached expectedTally: v1.TallyResult{ - YesCount: "0", - AbstainCount: "0", - NoCount: "0", - NoWithVetoCount: "0", + YesCount: "0", + AbstainCount: "0", + NoCount: "0", }, }, { @@ -174,10 +171,9 @@ func TestTally(t *testing.T) { expectedPass: false, expectedBurn: true, // burn because quorum not reached expectedTally: v1.TallyResult{ - YesCount: "2", - AbstainCount: "0", - NoCount: "0", - NoWithVetoCount: "0", + YesCount: "2", + AbstainCount: "0", + NoCount: "0", }, }, { @@ -190,10 +186,9 @@ func TestTally(t *testing.T) { expectedPass: false, expectedBurn: true, // burn because quorum not reached expectedTally: v1.TallyResult{ - YesCount: "3", - AbstainCount: "0", - NoCount: "0", - NoWithVetoCount: "0", + YesCount: "3", + AbstainCount: "0", + NoCount: "0", }, }, { @@ -206,10 +201,9 @@ func TestTally(t *testing.T) { expectedPass: false, expectedBurn: true, // burn because quorum not reached expectedTally: v1.TallyResult{ - YesCount: "2", - AbstainCount: "0", - NoCount: "1", - NoWithVetoCount: "0", + YesCount: "2", + AbstainCount: "0", + NoCount: "1", }, }, { @@ -222,10 +216,9 @@ func TestTally(t *testing.T) { expectedPass: false, expectedBurn: true, // burn because quorum not reached expectedTally: v1.TallyResult{ - YesCount: "0", - AbstainCount: "0", - NoCount: "1", - NoWithVetoCount: "0", + YesCount: "0", + AbstainCount: "0", + NoCount: "1", }, }, { @@ -246,10 +239,9 @@ func TestTally(t *testing.T) { expectedPass: true, expectedBurn: false, expectedTally: v1.TallyResult{ - YesCount: "5", - AbstainCount: "1", - NoCount: "1", - NoWithVetoCount: "0", + YesCount: "5", + AbstainCount: "1", + NoCount: "1", }, }, { @@ -263,34 +255,13 @@ func TestTally(t *testing.T) { expectedPass: false, expectedBurn: false, expectedTally: v1.TallyResult{ - YesCount: "0", - AbstainCount: "4", - NoCount: "0", - NoWithVetoCount: "0", + YesCount: "0", + AbstainCount: "4", + NoCount: "0", }, }, { - name: "quorum reached with veto>1/3: prop fails/burn deposit", - setup: func(s *tallyFixture) { - s.validatorVote(s.valAddrs[0], v1.VoteOption_VOTE_OPTION_YES) - s.validatorVote(s.valAddrs[1], v1.VoteOption_VOTE_OPTION_YES) - s.validatorVote(s.valAddrs[2], v1.VoteOption_VOTE_OPTION_YES) - s.validatorVote(s.valAddrs[3], v1.VoteOption_VOTE_OPTION_YES) - s.validatorVote(s.valAddrs[4], v1.VoteOption_VOTE_OPTION_NO_WITH_VETO) - s.validatorVote(s.valAddrs[5], v1.VoteOption_VOTE_OPTION_NO_WITH_VETO) - s.validatorVote(s.valAddrs[6], v1.VoteOption_VOTE_OPTION_NO_WITH_VETO) - }, - expectedPass: false, - expectedBurn: true, - expectedTally: v1.TallyResult{ - YesCount: "4", - AbstainCount: "0", - NoCount: "0", - NoWithVetoCount: "3", - }, - }, - { - name: "quorum reached with yes<=.5: prop fails", + name: "quorum reached with yes<=.667: prop fails", setup: func(s *tallyFixture) { s.validatorVote(s.valAddrs[0], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[1], v1.VoteOption_VOTE_OPTION_YES) @@ -300,49 +271,45 @@ func TestTally(t *testing.T) { expectedPass: false, expectedBurn: false, expectedTally: v1.TallyResult{ - YesCount: "2", - AbstainCount: "0", - NoCount: "2", - NoWithVetoCount: "0", + YesCount: "2", + AbstainCount: "0", + NoCount: "2", }, }, { - name: "quorum reached with yes>.5: prop succeeds", + name: "quorum reached with yes>.667: prop succeeds", setup: func(s *tallyFixture) { s.validatorVote(s.valAddrs[0], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[1], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[2], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[3], v1.VoteOption_VOTE_OPTION_YES) - s.validatorVote(s.valAddrs[4], v1.VoteOption_VOTE_OPTION_NO) + s.validatorVote(s.valAddrs[4], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[5], v1.VoteOption_VOTE_OPTION_NO) - s.validatorVote(s.valAddrs[6], v1.VoteOption_VOTE_OPTION_NO_WITH_VETO) }, expectedPass: true, expectedBurn: false, expectedTally: v1.TallyResult{ - YesCount: "4", - AbstainCount: "0", - NoCount: "2", - NoWithVetoCount: "1", + YesCount: "5", + AbstainCount: "0", + NoCount: "1", }, }, { - name: "quorum reached thanks to abstain, yes>.5: prop succeeds", + name: "quorum reached thanks to abstain, yes>.667: prop succeeds", setup: func(s *tallyFixture) { s.validatorVote(s.valAddrs[0], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[1], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[2], v1.VoteOption_VOTE_OPTION_NO) - s.validatorVote(s.valAddrs[3], v1.VoteOption_VOTE_OPTION_ABSTAIN) + s.validatorVote(s.valAddrs[3], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[4], v1.VoteOption_VOTE_OPTION_ABSTAIN) s.validatorVote(s.valAddrs[5], v1.VoteOption_VOTE_OPTION_ABSTAIN) }, expectedPass: true, expectedBurn: false, expectedTally: v1.TallyResult{ - YesCount: "2", - AbstainCount: "3", - NoCount: "1", - NoWithVetoCount: "0", + YesCount: "3", + AbstainCount: "2", + NoCount: "1", }, }, } @@ -352,7 +319,6 @@ func TestTally(t *testing.T) { params := v1.DefaultParams() // Ensure params value are different than false params.BurnVoteQuorum = true - params.BurnVoteVeto = true err := govKeeper.SetParams(ctx, params) require.NoError(t, err) var ( diff --git a/x/gov/keeper/vote_test.go b/x/gov/keeper/vote_test.go index 5b9e6fb4..045e1437 100644 --- a/x/gov/keeper/vote_test.go +++ b/x/gov/keeper/vote_test.go @@ -57,21 +57,18 @@ func TestVotes(t *testing.T) { v1.NewWeightedVoteOption(v1.OptionYes, sdk.NewDecWithPrec(60, 2)), v1.NewWeightedVoteOption(v1.OptionNo, sdk.NewDecWithPrec(30, 2)), v1.NewWeightedVoteOption(v1.OptionAbstain, sdk.NewDecWithPrec(5, 2)), - v1.NewWeightedVoteOption(v1.OptionNoWithVeto, sdk.NewDecWithPrec(5, 2)), }, "")) vote, found = govKeeper.GetVote(ctx, proposalID, addrs[1]) require.True(t, found) require.Equal(t, addrs[1].String(), vote.Voter) require.Equal(t, proposalID, vote.ProposalId) - require.True(t, len(vote.Options) == 4) + require.True(t, len(vote.Options) == 3) require.Equal(t, v1.OptionYes, vote.Options[0].Option) require.Equal(t, v1.OptionNo, vote.Options[1].Option) require.Equal(t, v1.OptionAbstain, vote.Options[2].Option) - require.Equal(t, v1.OptionNoWithVeto, vote.Options[3].Option) require.Equal(t, vote.Options[0].Weight, sdk.NewDecWithPrec(60, 2).String()) require.Equal(t, vote.Options[1].Weight, sdk.NewDecWithPrec(30, 2).String()) require.Equal(t, vote.Options[2].Weight, sdk.NewDecWithPrec(5, 2).String()) - require.Equal(t, vote.Options[3].Weight, sdk.NewDecWithPrec(5, 2).String()) // Test vote iterator // NOTE order of deposits is determined by the addresses @@ -84,9 +81,8 @@ func TestVotes(t *testing.T) { require.Equal(t, v1.OptionYes, votes[0].Options[0].Option) require.Equal(t, addrs[1].String(), votes[1].Voter) require.Equal(t, proposalID, votes[1].ProposalId) - require.True(t, len(votes[1].Options) == 4) + require.True(t, len(votes[1].Options) == 3) require.Equal(t, votes[1].Options[0].Weight, sdk.NewDecWithPrec(60, 2).String()) require.Equal(t, votes[1].Options[1].Weight, sdk.NewDecWithPrec(30, 2).String()) require.Equal(t, votes[1].Options[2].Weight, sdk.NewDecWithPrec(5, 2).String()) - require.Equal(t, votes[1].Options[3].Weight, sdk.NewDecWithPrec(5, 2).String()) } diff --git a/x/gov/migrations/v3/convert.go b/x/gov/migrations/v3/convert.go index 81b90595..0fa2ec55 100644 --- a/x/gov/migrations/v3/convert.go +++ b/x/gov/migrations/v3/convert.go @@ -78,10 +78,6 @@ func ConvertToLegacyTallyResult(tally *v1.TallyResult) (v1beta1.TallyResult, err if !ok { return v1beta1.TallyResult{}, fmt.Errorf("unable to convert no tally string (%s) to int", tally.NoCount) } - veto, ok := types.NewIntFromString(tally.NoWithVetoCount) - if !ok { - return v1beta1.TallyResult{}, fmt.Errorf("unable to convert no with veto tally string (%s) to int", tally.NoWithVetoCount) - } abstain, ok := types.NewIntFromString(tally.AbstainCount) if !ok { return v1beta1.TallyResult{}, fmt.Errorf("unable to convert abstain tally string (%s) to int", tally.AbstainCount) @@ -90,7 +86,7 @@ func ConvertToLegacyTallyResult(tally *v1.TallyResult) (v1beta1.TallyResult, err return v1beta1.TallyResult{ Yes: yes, No: no, - NoWithVeto: veto, + NoWithVeto: types.ZeroInt(), Abstain: abstain, }, nil } diff --git a/x/gov/simulation/genesis.go b/x/gov/simulation/genesis.go index 82b78f21..bced9184 100644 --- a/x/gov/simulation/genesis.go +++ b/x/gov/simulation/genesis.go @@ -104,15 +104,9 @@ func RandomizedGenState(simState *module.SimulationState) { func(r *rand.Rand) { threshold = GenTallyParamsThreshold(r) }, ) - var veto sdk.Dec - simState.AppParams.GetOrGenerate( - simState.Cdc, TallyParamsVeto, &veto, simState.Rand, - func(r *rand.Rand) { veto = GenTallyParamsVeto(r) }, - ) - govGenesis := v1.NewGenesisState( startingProposalID, - v1.NewParams(minDeposit, depositPeriod, votingPeriod, quorum.String(), threshold.String(), veto.String(), minInitialDepositRatio.String(), simState.Rand.Intn(2) == 0, simState.Rand.Intn(2) == 0, simState.Rand.Intn(2) == 0), + v1.NewParams(minDeposit, depositPeriod, votingPeriod, quorum.String(), threshold.String(), minInitialDepositRatio.String(), simState.Rand.Intn(2) == 0, simState.Rand.Intn(2) == 0), ) bz, err := json.MarshalIndent(&govGenesis, "", " ") diff --git a/x/gov/simulation/genesis_test.go b/x/gov/simulation/genesis_test.go index c8347850..3e16c276 100644 --- a/x/gov/simulation/genesis_test.go +++ b/x/gov/simulation/genesis_test.go @@ -55,7 +55,6 @@ func TestRandomizedGenState(t *testing.T) { require.Equal(t, float64(275567), govGenesis.Params.VotingPeriod.Seconds()) require.Equal(t, tallyQuorum, govGenesis.Params.Quorum) require.Equal(t, tallyThreshold, govGenesis.Params.Threshold) - require.Equal(t, tallyVetoThreshold, govGenesis.Params.VetoThreshold) require.Equal(t, uint64(0x28), govGenesis.StartingProposalId) require.Equal(t, []*v1.Deposit{}, govGenesis.Deposits) require.Equal(t, []*v1.Vote{}, govGenesis.Votes) diff --git a/x/gov/simulation/operations.go b/x/gov/simulation/operations.go index 83ea5469..91990efa 100644 --- a/x/gov/simulation/operations.go +++ b/x/gov/simulation/operations.go @@ -503,15 +503,13 @@ func randomProposalID(r *rand.Rand, k *keeper.Keeper, ctx sdk.Context, status v1 // Pick a random voting option func randomVotingOption(r *rand.Rand) v1.VoteOption { - switch r.Intn(4) { + switch r.Intn(3) { case 0: return v1.OptionYes case 1: return v1.OptionAbstain case 2: return v1.OptionNo - case 3: - return v1.OptionNoWithVeto default: panic("invalid vote option") } @@ -521,8 +519,7 @@ func randomVotingOption(r *rand.Rand) v1.VoteOption { func randomWeightedVotingOptions(r *rand.Rand) v1.WeightedVoteOptions { w1 := r.Intn(100 + 1) w2 := r.Intn(100 - w1 + 1) - w3 := r.Intn(100 - w1 - w2 + 1) - w4 := 100 - w1 - w2 - w3 + w3 := 100 - w1 - w2 weightedVoteOptions := v1.WeightedVoteOptions{} if w1 > 0 { weightedVoteOptions = append(weightedVoteOptions, &v1.WeightedVoteOption{ @@ -542,11 +539,5 @@ func randomWeightedVotingOptions(r *rand.Rand) v1.WeightedVoteOptions { Weight: sdk.NewDecWithPrec(int64(w3), 2).String(), }) } - if w4 > 0 { - weightedVoteOptions = append(weightedVoteOptions, &v1.WeightedVoteOption{ - Option: v1.OptionNoWithVeto, - Weight: sdk.NewDecWithPrec(int64(w4), 2).String(), - }) - } return weightedVoteOptions } diff --git a/x/gov/types/v1/genesis_test.go b/x/gov/types/v1/genesis_test.go index cf9883b5..ddd75fd9 100644 --- a/x/gov/types/v1/genesis_test.go +++ b/x/gov/types/v1/genesis_test.go @@ -82,16 +82,6 @@ func TestValidateGenesis(t *testing.T) { }, expErrMsg: "vote threshold too large", }, - { - name: "invalid veto threshold", - genesisState: func() *v1.GenesisState { - params1 := params - params1.VetoThreshold = "2" - - return v1.NewGenesisState(v1.DefaultStartingProposalID, params1) - }, - expErrMsg: "veto threshold too large", - }, { name: "duplicate proposals", genesisState: func() *v1.GenesisState { diff --git a/x/gov/types/v1/gov.pb.go b/x/gov/types/v1/gov.pb.go index 1856e844..737ff57e 100644 --- a/x/gov/types/v1/gov.pb.go +++ b/x/gov/types/v1/gov.pb.go @@ -44,8 +44,6 @@ const ( VoteOption_VOTE_OPTION_ABSTAIN VoteOption = 2 // VOTE_OPTION_NO defines a no vote option. VoteOption_VOTE_OPTION_NO VoteOption = 3 - // VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. - VoteOption_VOTE_OPTION_NO_WITH_VETO VoteOption = 4 ) var VoteOption_name = map[int32]string{ @@ -53,15 +51,13 @@ var VoteOption_name = map[int32]string{ 1: "VOTE_OPTION_YES", 2: "VOTE_OPTION_ABSTAIN", 3: "VOTE_OPTION_NO", - 4: "VOTE_OPTION_NO_WITH_VETO", } var VoteOption_value = map[string]int32{ - "VOTE_OPTION_UNSPECIFIED": 0, - "VOTE_OPTION_YES": 1, - "VOTE_OPTION_ABSTAIN": 2, - "VOTE_OPTION_NO": 3, - "VOTE_OPTION_NO_WITH_VETO": 4, + "VOTE_OPTION_UNSPECIFIED": 0, + "VOTE_OPTION_YES": 1, + "VOTE_OPTION_ABSTAIN": 2, + "VOTE_OPTION_NO": 3, } func (x VoteOption) String() string { @@ -411,8 +407,6 @@ type TallyResult struct { AbstainCount string `protobuf:"bytes,2,opt,name=abstain_count,json=abstainCount,proto3" json:"abstain_count,omitempty"` // no_count is the number of no votes on a proposal. NoCount string `protobuf:"bytes,3,opt,name=no_count,json=noCount,proto3" json:"no_count,omitempty"` - // no_with_veto_count is the number of no with veto votes on a proposal. - NoWithVetoCount string `protobuf:"bytes,4,opt,name=no_with_veto_count,json=noWithVetoCount,proto3" json:"no_with_veto_count,omitempty"` } func (m *TallyResult) Reset() { *m = TallyResult{} } @@ -469,13 +463,6 @@ func (m *TallyResult) GetNoCount() string { return "" } -func (m *TallyResult) GetNoWithVetoCount() string { - if m != nil { - return m.NoWithVetoCount - } - return "" -} - // Vote defines a vote on a governance proposal. // A Vote consists of a proposal ID, the voter, and the vote option. type Vote struct { @@ -657,11 +644,8 @@ type TallyParams struct { // Minimum percentage of total stake needed to vote for a result to be // considered valid. Quorum string `protobuf:"bytes,1,opt,name=quorum,proto3" json:"quorum,omitempty"` - // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. + // Minimum proportion of Yes votes for proposal to pass. Default value: 2/3. Threshold string `protobuf:"bytes,2,opt,name=threshold,proto3" json:"threshold,omitempty"` - // Minimum value of Veto votes to Total votes ratio for proposal to be - // vetoed. Default value: 1/3. - VetoThreshold string `protobuf:"bytes,3,opt,name=veto_threshold,json=vetoThreshold,proto3" json:"veto_threshold,omitempty"` } func (m *TallyParams) Reset() { *m = TallyParams{} } @@ -711,13 +695,6 @@ func (m *TallyParams) GetThreshold() string { return "" } -func (m *TallyParams) GetVetoThreshold() string { - if m != nil { - return m.VetoThreshold - } - return "" -} - // Params defines the parameters for the x/gov module. // // Since: cosmos-sdk 0.47 @@ -732,19 +709,14 @@ type Params struct { // Minimum percentage of total stake needed to vote for a result to be // considered valid. Quorum string `protobuf:"bytes,4,opt,name=quorum,proto3" json:"quorum,omitempty"` - // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. + // Minimum proportion of Yes votes for proposal to pass. Default value: 2/3. Threshold string `protobuf:"bytes,5,opt,name=threshold,proto3" json:"threshold,omitempty"` - // Minimum value of Veto votes to Total votes ratio for proposal to be - // vetoed. Default value: 1/3. - VetoThreshold string `protobuf:"bytes,6,opt,name=veto_threshold,json=vetoThreshold,proto3" json:"veto_threshold,omitempty"` // The ratio representing the proportion of the deposit value that must be paid at proposal submission. MinInitialDepositRatio string `protobuf:"bytes,7,opt,name=min_initial_deposit_ratio,json=minInitialDepositRatio,proto3" json:"min_initial_deposit_ratio,omitempty"` // burn deposits if a proposal does not meet quorum BurnVoteQuorum bool `protobuf:"varint,13,opt,name=burn_vote_quorum,json=burnVoteQuorum,proto3" json:"burn_vote_quorum,omitempty"` // burn deposits if the proposal does not enter voting period BurnProposalDepositPrevote bool `protobuf:"varint,14,opt,name=burn_proposal_deposit_prevote,json=burnProposalDepositPrevote,proto3" json:"burn_proposal_deposit_prevote,omitempty"` - // burn deposits if quorum with vote type no_veto is met - BurnVoteVeto bool `protobuf:"varint,15,opt,name=burn_vote_veto,json=burnVoteVeto,proto3" json:"burn_vote_veto,omitempty"` } func (m *Params) Reset() { *m = Params{} } @@ -815,13 +787,6 @@ func (m *Params) GetThreshold() string { return "" } -func (m *Params) GetVetoThreshold() string { - if m != nil { - return m.VetoThreshold - } - return "" -} - func (m *Params) GetMinInitialDepositRatio() string { if m != nil { return m.MinInitialDepositRatio @@ -843,13 +808,6 @@ func (m *Params) GetBurnProposalDepositPrevote() bool { return false } -func (m *Params) GetBurnVoteVeto() bool { - if m != nil { - return m.BurnVoteVeto - } - return false -} - func init() { proto.RegisterEnum("atomone.gov.v1.VoteOption", VoteOption_name, VoteOption_value) proto.RegisterEnum("atomone.gov.v1.ProposalStatus", ProposalStatus_name, ProposalStatus_value) @@ -867,88 +825,83 @@ func init() { func init() { proto.RegisterFile("atomone/gov/v1/gov.proto", fileDescriptor_ecf0f9950ff6986c) } var fileDescriptor_ecf0f9950ff6986c = []byte{ - // 1282 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0x4f, 0x73, 0xd3, 0x46, - 0x14, 0x8f, 0x6c, 0xd9, 0x71, 0x9e, 0x13,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d, 0x06, 0x19, 0x0f, 0x87, 0xa1, 0xd3, 0xc1, 0xa1, 0x96, 0x10, 0xc6, 0xd7, 0x2a, - 0x51, 0x49, 0x2a, 0x71, 0x49, 0x2a, 0x35, 0x7f, 0x64, 0x8e, 0x51, 0xe8, 0x16, 0xa4, 0x43, 0xe6, - 0xb0, 0x41, 0xa8, 0x25, 0x45, 0x36, 0x8b, 0xb3, 0xd9, 0x8c, 0x7d, 0xb5, 0x04, 0xca, 0x94, 0x68, - 0x64, 0x00, 0x7a, 0x42, 0x7c, 0xa7, 0x67, 0x33, 0xa7, 0xd7, 0x1b, 0xd9, 0x01, 0x0e, 0x07, 0x3d, - 0xa6, 0xa9, 0x1b, 0xca, 0x66, 0x76, 0xe7, 0xd2, 0xac, 0x0d, 0x8b, 0x63, 0x4c, 0x01, 0x31, 0xf3, - 0x82, 0x36, 0x25, 0x41, 0x35, 0xc8, 0x86, 0x83, 0xb6, 0x47, 0x98, 0xcd, 0x3b, 0x4d, 0x4b, 0x09, - 0x1b, 0x85, 0x63, 0x71, 0x5b, 0x71, 0x1b, 0xee, 0xaa, 0xcf, 0xff, 0x2e, 0x29, 0x26, 0x44, 0x24, - 0x2e, 0x46, 0xf7, 0x21, 0x2f, 0xf3, 0x6b, 0x63, 0xdf, 0x8d, 0xec, 0xa4, 0x4f, 0x69, 0x27, 0x27, - 0x99, 0xba, 0xef, 0x0a, 0x5b, 0x06, 0xac, 0x30, 0xca, 0x9c, 0x9e, 0x2d, 0xe5, 0xda, 0xe2, 0x19, - 0xaa, 0xb4, 0x2c, 0xa8, 0x71, 0x0b, 0x3d, 0x80, 0x73, 0x43, 0xca, 0x88, 0xdf, 0xb1, 0x43, 0xe6, - 0x04, 0xf2, 0x7c, 0x99, 0x53, 0xc6, 0xb5, 0x1a, 0x51, 0x5b, 0x9c, 0x29, 0x02, 0xbb, 0x07, 0x52, - 0x34, 0x39, 0xe3, 0xd2, 0x29, 0x6d, 0xad, 0x44, 0xc4, 0xf8, 0x88,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 0x6e, 0x35, 0xf2, 0xea, - 0xf5, 0xdf, 0x14, 0xc8, 0x1d, 0xfd, 0x34, 0x41, 0x25, 0xb8, 0xd4, 0x34, 0x1b, 0xcd, 0x46, 0xab, - 0xf6, 0xc0, 0x6e, 0x59, 0x35, 0xeb, 0x61, 0x6b, 0x26, 0xa6, 0x32, 0x14, 0x67, 0x01, 0x75, 0xbd, - 0xd9, 0x68, 0x19, 0x96, 0xdd, 0xd4, 0x4d, 0xa3, 0x51, 0xcf, 0x2b, 0xe8, 0x63, 0xb8, 0x32, 0x8b, - 0x39, 0x68, 0x58, 0xc6, 0xfe, 0xdd, 0x18, 0x92, 0x40, 0x05, 0xb8, 0x30, 0x0b, 0x69, 0xd6, 0x5a, - 0x2d, 0xbd, 0x1e, 0x05, 0x3d, 0xab, 0x33, 0xf5, 0xfb, 0xfa, 0x9e, 0xa5, 0xd7, 0xf3, 0xea, 0x3c, - 0xe6, 0x9d, 0x9a, 0xf1, 0x40, 0xaf, 0xe7, 0x53, 0xbb, 0x77, 0x5f, 0xbe, 0x2d, 0x2a, 0xaf, 0xde, - 0x16, 0x95, 0x7f, 0xde, 0x16, 0x95, 0xe7, 0xef, 0x8a, 0x0b, 0xaf, 0xde, 0x15, 0x17, 0xfe, 0x7c, - 0x57, 0x5c, 0xf8, 0x66, 0xab, 0x43, 0x58, 0x77, 0xd0, 0xae, 0x1c, 0x52, 0xaf, 0x2a, 0x17, 0xfe, - 0x56, 0x77, 0xd0, 0x8e, 0x9f, 0xab, 0xcf, 0xc4, 0x2f, 0x01, 0x36, 0xea, 0xe3, 0x90, 0x7f, 0xe5, - 0xa7, 0xc5, 0xdc, 0xdc, 0xfc, 0x2f, 0x00, 0x00, 0xff, 0xff, 0xb9, 0x04, 0x79, 0x98, 0x28, 0x0c, - 0x00, 0x00, + // 1208 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xcf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 0xb1, 0x9b, 0x66, 0x1a, 0x5d, 0x03, 0x6b, 0xd6, 0xe7, 0xda, 0x0f, 0xec, 0xdd, + 0xae, 0xdd, 0x34, 0x33, 0x67, 0x31, 0xef, 0x35, 0x9c, 0x87, 0x76, 0xd3, 0xcc, 0xee, 0xdc, 0x7f, + 0xf1, 0xa6, 0x6c, 0xbc, 0x7c, 0x53, 0x36, 0xfe, 0x7a, 0x53, 0x36, 0x9e, 0xbd, 0x2d, 0x2f, 0xbc, + 0x7c, 0x5b, 0x5e, 0xf8, 0xfd, 0x6d, 0x79, 0xe1, 0xeb, 0xcd, 0x3e, 0x15, 0x87, 0xa3, 0x5e, 0xed, + 0x80, 0x05, 0x75, 0x7d, 0x79, 0x6e, 0x1e, 0x8e, 0x7a, 0xc9, 0x77, 0xfd, 0xa9, 0xfa, 0x61, 0x2c, + 0xc6, 0x43, 0xc2, 0xe5, 0x8f, 0xde, 0x9c, 0xd2, 0xee, 0xed, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, + 0xec, 0xba, 0x74, 0x03, 0x37, 0x0b, 0x00, 0x00, } func (m *WeightedVoteOption) Marshal() (dAtA []byte, err error) { @@ -1196,13 +1149,6 @@ func (m *TallyResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.NoWithVetoCount) > 0 { - i -= len(m.NoWithVetoCount) - copy(dAtA[i:], m.NoWithVetoCount) - i = encodeVarintGov(dAtA, i, uint64(len(m.NoWithVetoCount))) - i-- - dAtA[i] = 0x22 - } if len(m.NoCount) > 0 { i -= len(m.NoCount) copy(dAtA[i:], m.NoCount) @@ -1383,13 +1329,6 @@ func (m *TallyParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.VetoThreshold) > 0 { - i -= len(m.VetoThreshold) - copy(dAtA[i:], m.VetoThreshold) - i = encodeVarintGov(dAtA, i, uint64(len(m.VetoThreshold))) - i-- - dAtA[i] = 0x1a - } if len(m.Threshold) > 0 { i -= len(m.Threshold) copy(dAtA[i:], m.Threshold) @@ -1427,16 +1366,6 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.BurnVoteVeto { - i-- - if m.BurnVoteVeto { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x78 - } if m.BurnProposalDepositPrevote { i-- if m.BurnProposalDepositPrevote { @@ -1464,13 +1393,6 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x3a } - if len(m.VetoThreshold) > 0 { - i -= len(m.VetoThreshold) - copy(dAtA[i:], m.VetoThreshold) - i = encodeVarintGov(dAtA, i, uint64(len(m.VetoThreshold))) - i-- - dAtA[i] = 0x32 - } if len(m.Threshold) > 0 { i -= len(m.Threshold) copy(dAtA[i:], m.Threshold) @@ -1652,10 +1574,6 @@ func (m *TallyResult) Size() (n int) { if l > 0 { n += 1 + l + sovGov(uint64(l)) } - l = len(m.NoWithVetoCount) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } return n } @@ -1731,10 +1649,6 @@ func (m *TallyParams) Size() (n int) { if l > 0 { n += 1 + l + sovGov(uint64(l)) } - l = len(m.VetoThreshold) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } return n } @@ -1766,10 +1680,6 @@ func (m *Params) Size() (n int) { if l > 0 { n += 1 + l + sovGov(uint64(l)) } - l = len(m.VetoThreshold) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } l = len(m.MinInitialDepositRatio) if l > 0 { n += 1 + l + sovGov(uint64(l)) @@ -1780,9 +1690,6 @@ func (m *Params) Size() (n int) { if m.BurnProposalDepositPrevote { n += 2 } - if m.BurnVoteVeto { - n += 2 - } return n } @@ -2617,38 +2524,6 @@ func (m *TallyResult) Unmarshal(dAtA []byte) error { } m.NoCount = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NoWithVetoCount", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NoWithVetoCount = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGov(dAtA[iNdEx:]) @@ -3136,38 +3011,6 @@ func (m *TallyParams) Unmarshal(dAtA []byte) error { } m.Threshold = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VetoThreshold", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.VetoThreshold = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGov(dAtA[iNdEx:]) @@ -3388,38 +3231,6 @@ func (m *Params) Unmarshal(dAtA []byte) error { } m.Threshold = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VetoThreshold", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.VetoThreshold = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field MinInitialDepositRatio", wireType) @@ -3492,26 +3303,6 @@ func (m *Params) Unmarshal(dAtA []byte) error { } } m.BurnProposalDepositPrevote = bool(v != 0) - case 15: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BurnVoteVeto", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.BurnVoteVeto = bool(v != 0) default: iNdEx = preIndex skippy, err := skipGov(dAtA[iNdEx:]) diff --git a/x/gov/types/v1/msgs_test.go b/x/gov/types/v1/msgs_test.go index bb402a25..d8cffa7e 100644 --- a/x/gov/types/v1/msgs_test.go +++ b/x/gov/types/v1/msgs_test.go @@ -75,7 +75,6 @@ func TestMsgVote(t *testing.T) { {0, addrs[0], v1.OptionYes, metadata, true}, {0, sdk.AccAddress{}, v1.OptionYes, "", false}, {0, addrs[0], v1.OptionNo, metadata, true}, - {0, addrs[0], v1.OptionNoWithVeto, "", true}, {0, addrs[0], v1.OptionAbstain, "", true}, {0, addrs[0], v1.VoteOption(0x13), "", false}, } @@ -103,7 +102,6 @@ func TestMsgVoteWeighted(t *testing.T) { {0, addrs[0], v1.NewNonSplitVoteOption(v1.OptionYes), metadata, true}, {0, sdk.AccAddress{}, v1.NewNonSplitVoteOption(v1.OptionYes), "", false}, {0, addrs[0], v1.NewNonSplitVoteOption(v1.OptionNo), "", true}, - {0, addrs[0], v1.NewNonSplitVoteOption(v1.OptionNoWithVeto), "", true}, {0, addrs[0], v1.NewNonSplitVoteOption(v1.OptionAbstain), "", true}, {0, addrs[0], v1.WeightedVoteOptions{ // weight sum > 1 v1.NewWeightedVoteOption(v1.OptionYes, math.LegacyNewDec(1)), diff --git a/x/gov/types/v1/params.go b/x/gov/types/v1/params.go index ef72de65..7020dc0b 100644 --- a/x/gov/types/v1/params.go +++ b/x/gov/types/v1/params.go @@ -18,12 +18,10 @@ const ( var ( DefaultMinDepositTokens = sdk.NewInt(10000000) DefaultQuorum = sdk.NewDecWithPrec(334, 3) - DefaultThreshold = sdk.NewDecWithPrec(5, 1) - DefaultVetoThreshold = sdk.NewDecWithPrec(334, 3) + DefaultThreshold = sdk.NewDecWithPrec(667, 3) DefaultMinInitialDepositRatio = sdk.ZeroDec() DefaultBurnProposalPrevote = false // set to false to replicate behavior of when this change was made (0.47) DefaultBurnVoteQuorom = false // set to false to replicate behavior of when this change was made (0.47) - DefaultBurnVoteVeto = true // set to true to replicate behavior of when this change was made (0.47) ) // Deprecated: NewDepositParams creates a new DepositParams object @@ -35,11 +33,10 @@ func NewDepositParams(minDeposit sdk.Coins, maxDepositPeriod *time.Duration) Dep } // Deprecated: NewTallyParams creates a new TallyParams object -func NewTallyParams(quorum, threshold, vetoThreshold string) TallyParams { +func NewTallyParams(quorum, threshold string) TallyParams { return TallyParams{ - Quorum: quorum, - Threshold: threshold, - VetoThreshold: vetoThreshold, + Quorum: quorum, + Threshold: threshold, } } @@ -53,7 +50,7 @@ func NewVotingParams(votingPeriod *time.Duration) VotingParams { // NewParams creates a new Params instance with given values. func NewParams( minDeposit sdk.Coins, maxDepositPeriod, votingPeriod time.Duration, - quorum, threshold, vetoThreshold, minInitialDepositRatio string, burnProposalDeposit, burnVoteQuorum, burnVoteVeto bool, + quorum, threshold, minInitialDepositRatio string, burnProposalDeposit, burnVoteQuorum bool, ) Params { return Params{ MinDeposit: minDeposit, @@ -61,11 +58,9 @@ func NewParams( VotingPeriod: &votingPeriod, Quorum: quorum, Threshold: threshold, - VetoThreshold: vetoThreshold, MinInitialDepositRatio: minInitialDepositRatio, BurnProposalDepositPrevote: burnProposalDeposit, BurnVoteQuorum: burnVoteQuorum, - BurnVoteVeto: burnVoteVeto, } } @@ -77,11 +72,9 @@ func DefaultParams() Params { DefaultPeriod, DefaultQuorum.String(), DefaultThreshold.String(), - DefaultVetoThreshold.String(), DefaultMinInitialDepositRatio.String(), DefaultBurnProposalPrevote, DefaultBurnVoteQuorom, - DefaultBurnVoteVeto, ) } @@ -121,17 +114,6 @@ func (p Params) ValidateBasic() error { return fmt.Errorf("vote threshold too large: %s", threshold) } - vetoThreshold, err := sdk.NewDecFromStr(p.VetoThreshold) - if err != nil { - return fmt.Errorf("invalid vetoThreshold string: %w", err) - } - if !vetoThreshold.IsPositive() { - return fmt.Errorf("veto threshold must be positive: %s", vetoThreshold) - } - if vetoThreshold.GT(math.LegacyOneDec()) { - return fmt.Errorf("veto threshold too large: %s", vetoThreshold) - } - if p.VotingPeriod == nil { return fmt.Errorf("voting period must not be nil: %d", p.VotingPeriod) } diff --git a/x/gov/types/v1/params_legacy.go b/x/gov/types/v1/params_legacy.go index f7a8dbc8..0f2ef638 100644 --- a/x/gov/types/v1/params_legacy.go +++ b/x/gov/types/v1/params_legacy.go @@ -70,17 +70,6 @@ func validateTallyParams(i interface{}) error { return fmt.Errorf("vote threshold too large: %s", v) } - vetoThreshold, err := sdk.NewDecFromStr(v.VetoThreshold) - if err != nil { - return fmt.Errorf("invalid vetoThreshold string: %w", err) - } - if !vetoThreshold.IsPositive() { - return fmt.Errorf("veto threshold must be positive: %s", vetoThreshold) - } - if vetoThreshold.GT(math.LegacyOneDec()) { - return fmt.Errorf("veto threshold too large: %s", v) - } - return nil } diff --git a/x/gov/types/v1/tally.go b/x/gov/types/v1/tally.go index a134a43d..11f7f804 100644 --- a/x/gov/types/v1/tally.go +++ b/x/gov/types/v1/tally.go @@ -29,12 +29,11 @@ func NewValidatorGovInfo(address sdk.ValAddress, bondedTokens math.Int, delegato } // NewTallyResult creates a new TallyResult instance -func NewTallyResult(yes, abstain, no, noWithVeto math.Int) TallyResult { +func NewTallyResult(yes, abstain, no math.Int) TallyResult { return TallyResult{ - YesCount: yes.String(), - AbstainCount: abstain.String(), - NoCount: no.String(), - NoWithVetoCount: noWithVeto.String(), + YesCount: yes.String(), + AbstainCount: abstain.String(), + NoCount: no.String(), } } @@ -44,19 +43,17 @@ func NewTallyResultFromMap(results map[VoteOption]sdk.Dec) TallyResult { results[OptionYes].TruncateInt(), results[OptionAbstain].TruncateInt(), results[OptionNo].TruncateInt(), - results[OptionNoWithVeto].TruncateInt(), ) } // EmptyTallyResult returns an empty TallyResult. func EmptyTallyResult() TallyResult { - return NewTallyResult(math.ZeroInt(), math.ZeroInt(), math.ZeroInt(), math.ZeroInt()) + return NewTallyResult(math.ZeroInt(), math.ZeroInt(), math.ZeroInt()) } // Equals returns if two tally results are equal. func (tr TallyResult) Equals(comp TallyResult) bool { return tr.YesCount == comp.YesCount && tr.AbstainCount == comp.AbstainCount && - tr.NoCount == comp.NoCount && - tr.NoWithVetoCount == comp.NoWithVetoCount + tr.NoCount == comp.NoCount } diff --git a/x/gov/types/v1/vote.go b/x/gov/types/v1/vote.go index cb1f9066..996b86b8 100644 --- a/x/gov/types/v1/vote.go +++ b/x/gov/types/v1/vote.go @@ -10,11 +10,10 @@ import ( ) const ( - OptionEmpty = VoteOption_VOTE_OPTION_UNSPECIFIED - OptionYes = VoteOption_VOTE_OPTION_YES - OptionNo = VoteOption_VOTE_OPTION_NO - OptionNoWithVeto = VoteOption_VOTE_OPTION_NO_WITH_VETO - OptionAbstain = VoteOption_VOTE_OPTION_ABSTAIN + OptionEmpty = VoteOption_VOTE_OPTION_UNSPECIFIED + OptionYes = VoteOption_VOTE_OPTION_YES + OptionNo = VoteOption_VOTE_OPTION_NO + OptionAbstain = VoteOption_VOTE_OPTION_ABSTAIN ) // NewVote creates a new Vote instance @@ -138,8 +137,7 @@ func WeightedVoteOptionsFromString(str string) (WeightedVoteOptions, error) { func ValidVoteOption(option VoteOption) bool { if option == OptionYes || option == OptionAbstain || - option == OptionNo || - option == OptionNoWithVeto { + option == OptionNo { return true } return false diff --git a/x/gov/types/v1beta1/params.go b/x/gov/types/v1beta1/params.go index f64314c7..0a0d9334 100644 --- a/x/gov/types/v1beta1/params.go +++ b/x/gov/types/v1beta1/params.go @@ -17,8 +17,8 @@ const ( var ( DefaultMinDepositTokens = sdk.NewInt(10000000) DefaultQuorum = sdk.NewDecWithPrec(334, 3) - DefaultThreshold = sdk.NewDecWithPrec(5, 1) - DefaultVetoThreshold = sdk.NewDecWithPrec(334, 3) + DefaultThreshold = sdk.NewDecWithPrec(667, 3) + DefaultVetoThreshold = sdk.ZeroDec() ) // NewDepositParams creates a new DepositParams object From 865b1bb2800a307e0f123be145f667d232d2428f Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Thu, 12 Sep 2024 13:26:28 +0200 Subject: [PATCH 2/5] set quorum to 0.25 --- proto/atomone/gov/v1/gov.proto | 2 +- x/gov/keeper/tally_test.go | 8 ++++---- x/gov/simulation/operations_test.go | 2 +- x/gov/types/v1/params.go | 2 +- x/gov/types/v1beta1/params.go | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/proto/atomone/gov/v1/gov.proto b/proto/atomone/gov/v1/gov.proto index 9cff33e8..cae1b662 100644 --- a/proto/atomone/gov/v1/gov.proto +++ b/proto/atomone/gov/v1/gov.proto @@ -188,7 +188,7 @@ message Params { google.protobuf.Duration voting_period = 3 [(gogoproto.stdduration) = true]; // Minimum percentage of total stake needed to vote for a result to be - // considered valid. + // considered valid. Default value: 0.25. string quorum = 4 [(cosmos_proto.scalar) = "cosmos.Dec"]; // Minimum proportion of Yes votes for proposal to pass. Default value: 2/3. diff --git a/x/gov/keeper/tally_test.go b/x/gov/keeper/tally_test.go index 6af5bf09..79aed2dd 100644 --- a/x/gov/keeper/tally_test.go +++ b/x/gov/keeper/tally_test.go @@ -179,14 +179,14 @@ func TestTally(t *testing.T) { { name: "one delegator votes yes, validator votes also yes: prop fails/burn deposit", setup: func(s *tallyFixture) { - s.delegate(s.delAddrs[0], s.valAddrs[0], 2) + s.delegate(s.delAddrs[0], s.valAddrs[0], 1) s.vote(s.delAddrs[0], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[0], v1.VoteOption_VOTE_OPTION_YES) }, expectedPass: false, expectedBurn: true, // burn because quorum not reached expectedTally: v1.TallyResult{ - YesCount: "3", + YesCount: "2", AbstainCount: "0", NoCount: "0", }, @@ -194,14 +194,14 @@ func TestTally(t *testing.T) { { name: "one delegator votes yes, validator votes no: prop fails/burn deposit", setup: func(s *tallyFixture) { - s.delegate(s.delAddrs[0], s.valAddrs[0], 2) + s.delegate(s.delAddrs[0], s.valAddrs[0], 1) s.vote(s.delAddrs[0], v1.VoteOption_VOTE_OPTION_YES) s.validatorVote(s.valAddrs[0], v1.VoteOption_VOTE_OPTION_NO) }, expectedPass: false, expectedBurn: true, // burn because quorum not reached expectedTally: v1.TallyResult{ - YesCount: "2", + YesCount: "1", AbstainCount: "0", NoCount: "1", }, diff --git a/x/gov/simulation/operations_test.go b/x/gov/simulation/operations_test.go index 2d040054..a0000f33 100644 --- a/x/gov/simulation/operations_test.go +++ b/x/gov/simulation/operations_test.go @@ -279,7 +279,7 @@ func TestSimulateMsgVote(t *testing.T) { require.True(t, operationMsg.OK) require.Equal(t, uint64(1), msg.ProposalId) require.Equal(t, "cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", msg.Voter) - require.Equal(t, v1.OptionYes, msg.Option) + require.Equal(t, v1.OptionAbstain, msg.Option) require.Equal(t, "gov", msg.Route()) require.Equal(t, simulation.TypeMsgVote, msg.Type()) } diff --git a/x/gov/types/v1/params.go b/x/gov/types/v1/params.go index 7020dc0b..37854ad2 100644 --- a/x/gov/types/v1/params.go +++ b/x/gov/types/v1/params.go @@ -17,7 +17,7 @@ const ( // Default governance params var ( DefaultMinDepositTokens = sdk.NewInt(10000000) - DefaultQuorum = sdk.NewDecWithPrec(334, 3) + DefaultQuorum = sdk.NewDecWithPrec(25, 2) DefaultThreshold = sdk.NewDecWithPrec(667, 3) DefaultMinInitialDepositRatio = sdk.ZeroDec() DefaultBurnProposalPrevote = false // set to false to replicate behavior of when this change was made (0.47) diff --git a/x/gov/types/v1beta1/params.go b/x/gov/types/v1beta1/params.go index 0a0d9334..5a03143f 100644 --- a/x/gov/types/v1beta1/params.go +++ b/x/gov/types/v1beta1/params.go @@ -16,7 +16,7 @@ const ( // Default governance params var ( DefaultMinDepositTokens = sdk.NewInt(10000000) - DefaultQuorum = sdk.NewDecWithPrec(334, 3) + DefaultQuorum = sdk.NewDecWithPrec(25, 2) DefaultThreshold = sdk.NewDecWithPrec(667, 3) DefaultVetoThreshold = sdk.ZeroDec() ) From 8d763d575454f9b00850629ffe7a86beb37e632c Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Thu, 12 Sep 2024 14:23:41 +0200 Subject: [PATCH 3/5] adjust simulation --- x/gov/simulation/genesis.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/x/gov/simulation/genesis.go b/x/gov/simulation/genesis.go index bced9184..2cc793dd 100644 --- a/x/gov/simulation/genesis.go +++ b/x/gov/simulation/genesis.go @@ -51,17 +51,12 @@ func GenVotingParamsVotingPeriod(r *rand.Rand) time.Duration { // GenTallyParamsQuorum returns randomized TallyParamsQuorum func GenTallyParamsQuorum(r *rand.Rand) math.LegacyDec { - return sdk.NewDecWithPrec(int64(simulation.RandIntBetween(r, 334, 500)), 3) + return sdk.NewDecWithPrec(int64(simulation.RandIntBetween(r, 200, 400)), 3) } // GenTallyParamsThreshold returns randomized TallyParamsThreshold func GenTallyParamsThreshold(r *rand.Rand) math.LegacyDec { - return sdk.NewDecWithPrec(int64(simulation.RandIntBetween(r, 450, 550)), 3) -} - -// GenTallyParamsVeto returns randomized TallyParamsVeto -func GenTallyParamsVeto(r *rand.Rand) math.LegacyDec { - return sdk.NewDecWithPrec(int64(simulation.RandIntBetween(r, 250, 334)), 3) + return sdk.NewDecWithPrec(int64(simulation.RandIntBetween(r, 550, 700)), 3) } // RandomizedGenState generates a random GenesisState for gov From dd66b0637473af704edaa7046953821161f8771c Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Thu, 12 Sep 2024 18:48:18 +0200 Subject: [PATCH 4/5] fix tests --- tests/e2e/e2e_gov_test.go | 2 +- x/gov/simulation/genesis_test.go | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/e2e/e2e_gov_test.go b/tests/e2e/e2e_gov_test.go index ed59e56a..fad4d0c7 100644 --- a/tests/e2e/e2e_gov_test.go +++ b/tests/e2e/e2e_gov_test.go @@ -42,7 +42,7 @@ func (s *IntegrationTestSuite) GovSoftwareUpgrade() { } depositGovFlags := []string{strconv.Itoa(proposalCounter), depositAmount.String()} - voteGovFlags := []string{strconv.Itoa(proposalCounter), "yes=0.8,no=0.1,abstain=0.05,no_with_veto=0.05"} + voteGovFlags := []string{strconv.Itoa(proposalCounter), "yes=0.8,no=0.1,abstain=0.1"} s.submitLegacyGovProposal(chainAAPIEndpoint, sender, proposalCounter, upgradetypes.ProposalTypeSoftwareUpgrade, submitGovFlags, depositGovFlags, voteGovFlags, "weighted-vote", true) s.verifyChainHaltedAtUpgradeHeight(s.chainA, 0, proposalHeight) diff --git a/x/gov/simulation/genesis_test.go b/x/gov/simulation/genesis_test.go index 3e16c276..1437109a 100644 --- a/x/gov/simulation/genesis_test.go +++ b/x/gov/simulation/genesis_test.go @@ -44,9 +44,8 @@ func TestRandomizedGenState(t *testing.T) { simState.Cdc.MustUnmarshalJSON(simState.GenState[types.ModuleName], &govGenesis) const ( - tallyQuorum = "0.400000000000000000" - tallyThreshold = "0.539000000000000000" - tallyVetoThreshold = "0.314000000000000000" + tallyQuorum = "0.362000000000000000" + tallyThreshold = "0.639000000000000000" minInitialDepositDec = "0.590000000000000000" ) From 8aba220b72d09f000227883bcb1877969b2e7759 Mon Sep 17 00:00:00 2001 From: Giuseppe Natale <12249307+giunatale@users.noreply.github.com> Date: Fri, 13 Sep 2024 18:21:16 +0200 Subject: [PATCH 5/5] remove nvw mentions --- x/gov/client/cli/tx.go | 6 +++--- x/gov/types/v1/vote.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/x/gov/client/cli/tx.go b/x/gov/client/cli/tx.go index 240c5fcd..f9f98a6b 100644 --- a/x/gov/client/cli/tx.go +++ b/x/gov/client/cli/tx.go @@ -273,7 +273,7 @@ func NewCmdVote() *cobra.Command { cmd := &cobra.Command{ Use: "vote [proposal-id] [option]", Args: cobra.ExactArgs(2), - Short: "Vote for an active proposal, options: yes/no/no_with_veto/abstain", + Short: "Vote for an active proposal, options: yes/no/abstain", Long: strings.TrimSpace( fmt.Sprintf(`Submit a vote for an active proposal. You can find the proposal-id by running "%s query gov proposals". @@ -327,13 +327,13 @@ func NewCmdWeightedVote() *cobra.Command { cmd := &cobra.Command{ Use: "weighted-vote [proposal-id] [weighted-options]", Args: cobra.ExactArgs(2), - Short: "Vote for an active proposal, options: yes/no/no_with_veto/abstain", + Short: "Vote for an active proposal, options: yes/no/abstain", Long: strings.TrimSpace( fmt.Sprintf(`Submit a vote for an active proposal. You can find the proposal-id by running "%s query gov proposals". Example: -$ %s tx gov weighted-vote 1 yes=0.6,no=0.3,abstain=0.05,no_with_veto=0.05 --from mykey +$ %s tx gov weighted-vote 1 yes=0.6,no=0.3,abstain=0.1 --from mykey `, version.AppName, version.AppName, ), diff --git a/x/gov/types/v1/vote.go b/x/gov/types/v1/vote.go index 996b86b8..e426faa0 100644 --- a/x/gov/types/v1/vote.go +++ b/x/gov/types/v1/vote.go @@ -106,7 +106,7 @@ func (v WeightedVoteOptions) String() (out string) { func VoteOptionFromString(str string) (VoteOption, error) { option, ok := VoteOption_value[str] if !ok { - return OptionEmpty, fmt.Errorf("'%s' is not a valid vote option, available options: yes/no/no_with_veto/abstain", str) + return OptionEmpty, fmt.Errorf("'%s' is not a valid vote option, available options: yes/no/abstain", str) } return VoteOption(option), nil }