diff --git a/CHANGELOG.md b/CHANGELOG.md index ea41172cac51..9e3fc88c0c9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -115,7 +115,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [\#10748](https://github.com/cosmos/cosmos-sdk/pull/10748) Move legacy `x/gov` api to `v1beta1` directory. * [\#10816](https://github.com/cosmos/cosmos-sdk/pull/10816) Reuse blocked addresses from the bank module. No need to pass them to distribution. * [\#10852](https://github.com/cosmos/cosmos-sdk/pull/10852) Move `x/gov/types` to `x/gov/types/v1beta2`. -* [\#10868](https://github.com/cosmos/cosmos-sdk/pull/10868) The Gov keeper accepts now a mandatory last argument, the ServiceMsgRouter. +* [\#10868](https://github.com/cosmos/cosmos-sdk/pull/10868), [\#10989](https://github.com/cosmos/cosmos-sdk/pull/10989) The Gov keeper accepts now 2 more mandatory arguments, the ServiceMsgRouter and a maximum proposal metadata length. ### Client Breaking Changes diff --git a/proto/cosmos/gov/v1beta2/gov.proto b/proto/cosmos/gov/v1beta2/gov.proto index 41d87fdcd8a5..c021c6823cd5 100644 --- a/proto/cosmos/gov/v1beta2/gov.proto +++ b/proto/cosmos/gov/v1beta2/gov.proto @@ -49,6 +49,9 @@ message Proposal { repeated cosmos.base.v1beta1.Coin total_deposit = 7 [(gogoproto.nullable) = false]; google.protobuf.Timestamp voting_start_time = 8 [(gogoproto.stdtime) = true]; google.protobuf.Timestamp voting_end_time = 9 [(gogoproto.stdtime) = true]; + + // metadata is any arbitrary metadata attached to the proposal. + bytes metadata = 10; } // ProposalStatus enumerates the valid statuses of a proposal. diff --git a/proto/cosmos/gov/v1beta2/tx.proto b/proto/cosmos/gov/v1beta2/tx.proto index 4aaa68fc241f..97a818ba793a 100644 --- a/proto/cosmos/gov/v1beta2/tx.proto +++ b/proto/cosmos/gov/v1beta2/tx.proto @@ -36,6 +36,8 @@ message MsgSubmitProposal { repeated google.protobuf.Any messages = 1; repeated cosmos.base.v1beta1.Coin initial_deposit = 2 [(gogoproto.nullable) = false]; string proposer = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // metadata is any arbitrary metadata attached to the proposal. + bytes metadata = 4; } // MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. diff --git a/simapp/app.go b/simapp/app.go index ab5cf1ef4bcb..dd7127c098f5 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -302,9 +302,10 @@ func NewSimApp( AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)). AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)). AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)) + govMaxMetadataLen := uint64(10000) govKeeper := govkeeper.NewKeeper( appCodec, keys[govtypes.StoreKey], app.GetSubspace(govtypes.ModuleName), app.AccountKeeper, app.BankKeeper, - &stakingKeeper, govRouter, app.msgSvcRouter, + &stakingKeeper, govRouter, app.msgSvcRouter, govMaxMetadataLen, ) app.GovKeeper = *govKeeper.SetHooks( diff --git a/x/auth/middleware/tips_test.go b/x/auth/middleware/tips_test.go index 7169fbf76f09..2bd6a97276cf 100644 --- a/x/auth/middleware/tips_test.go +++ b/x/auth/middleware/tips_test.go @@ -33,7 +33,7 @@ func (s *MWTestSuite) setupAcctsForTips(ctx sdk.Context) (sdk.Context, []testAcc s.Require().NoError(err) // Create dummy proposal for tipper to vote on. - prop, err := govtypes.NewProposal([]sdk.Msg{banktypes.NewMsgSend(accts[0].acc.GetAddress(), accts[0].acc.GetAddress(), initialRegens)}, 1, time.Now(), time.Now().Add(time.Hour)) + prop, err := govtypes.NewProposal([]sdk.Msg{banktypes.NewMsgSend(accts[0].acc.GetAddress(), accts[0].acc.GetAddress(), initialRegens)}, 1, nil, time.Now(), time.Now().Add(time.Hour)) s.Require().NoError(err) s.app.GovKeeper.SetProposal(ctx, prop) s.app.GovKeeper.ActivateVotingPeriod(ctx, prop) diff --git a/x/gov/abci_test.go b/x/gov/abci_test.go index 9b14f1a6455f..1f9765f1a7f1 100644 --- a/x/gov/abci_test.go +++ b/x/gov/abci_test.go @@ -37,6 +37,7 @@ func TestTickExpiredDepositPeriod(t *testing.T) { []sdk.Msg{mkTestLegacyContent(t)}, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, addrs[0].String(), + nil, ) require.NoError(t, err) @@ -89,6 +90,7 @@ func TestTickMultipleExpiredDepositPeriod(t *testing.T) { []sdk.Msg{mkTestLegacyContent(t)}, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, addrs[0].String(), + nil, ) require.NoError(t, err) @@ -112,6 +114,7 @@ func TestTickMultipleExpiredDepositPeriod(t *testing.T) { []sdk.Msg{mkTestLegacyContent(t)}, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, addrs[0].String(), + nil, ) require.NoError(t, err) @@ -169,6 +172,7 @@ func TestTickPassedDepositPeriod(t *testing.T) { []sdk.Msg{mkTestLegacyContent(t)}, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, addrs[0].String(), + nil, ) require.NoError(t, err) @@ -221,7 +225,7 @@ func TestTickPassedVotingPeriod(t *testing.T) { activeQueue.Close() proposalCoins := sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, app.StakingKeeper.TokensFromConsensusPower(ctx, 5))} - newProposalMsg, err := v1beta2.NewMsgSubmitProposal([]sdk.Msg{mkTestLegacyContent(t)}, proposalCoins, addrs[0].String()) + newProposalMsg, err := v1beta2.NewMsgSubmitProposal([]sdk.Msg{mkTestLegacyContent(t)}, proposalCoins, addrs[0].String(), nil) require.NoError(t, err) wrapCtx := sdk.WrapSDKContext(ctx) @@ -289,7 +293,7 @@ func TestProposalPassedEndblocker(t *testing.T) { require.NotNil(t, macc) initialModuleAccCoins := app.BankKeeper.GetAllBalances(ctx, macc.GetAddress()) - proposal, err := app.GovKeeper.SubmitProposal(ctx, []sdk.Msg{mkTestLegacyContent(t)}) + proposal, err := app.GovKeeper.SubmitProposal(ctx, []sdk.Msg{mkTestLegacyContent(t)}, nil) require.NoError(t, err) proposalCoins := sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, app.StakingKeeper.TokensFromConsensusPower(ctx, 10))} @@ -339,7 +343,7 @@ func TestEndBlockerProposalHandlerFailed(t *testing.T) { // Create a proposal where the handler will pass for the test proposal // because the value of contextKeyBadProposal is true. ctx = ctx.WithValue(contextKeyBadProposal, true) - proposal, err := app.GovKeeper.SubmitProposal(ctx, []sdk.Msg{mkTestLegacyContent(t)}) + proposal, err := app.GovKeeper.SubmitProposal(ctx, []sdk.Msg{mkTestLegacyContent(t)}, nil) require.NoError(t, err) proposalCoins := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, app.StakingKeeper.TokensFromConsensusPower(ctx, 10))) diff --git a/x/gov/client/utils/query.go b/x/gov/client/utils/query.go index 29cf0fb2f77d..97eecfae8154 100644 --- a/x/gov/client/utils/query.go +++ b/x/gov/client/utils/query.go @@ -56,7 +56,7 @@ func QueryDepositsByTxQuery(clientCtx client.Context, params v1beta2.QueryPropos clientCtx, defaultPage, // Query legacy Msgs event action []string{ - fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, v1beta2.TypeMsgDeposit), + fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, v1beta1.TypeMsgDeposit), fmt.Sprintf("%s.%s='%d'", types.EventTypeProposalDeposit, types.AttributeKeyProposalID, params.ProposalID), }, // Query proto Msgs event action v1beta1 @@ -119,7 +119,7 @@ func QueryVotesByTxQuery(clientCtx client.Context, params v1beta2.QueryProposalV clientCtx, nextTxPage, // Query legacy Vote Msgs []string{ - fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, v1beta2.TypeMsgVote), + fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, v1beta1.TypeMsgVote), fmt.Sprintf("%s.%s='%d'", types.EventTypeProposalVote, types.AttributeKeyProposalID, params.ProposalID), }, // Query Vote proto Msgs v1beta1 @@ -134,7 +134,7 @@ func QueryVotesByTxQuery(clientCtx client.Context, params v1beta2.QueryProposalV }, // Query legacy VoteWeighted Msgs []string{ - fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, v1beta2.TypeMsgVoteWeighted), + fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, v1beta1.TypeMsgVoteWeighted), fmt.Sprintf("%s.%s='%d'", types.EventTypeProposalVote, types.AttributeKeyProposalID, params.ProposalID), }, // Query VoteWeighted proto Msgs v1beta1 @@ -210,7 +210,7 @@ func QueryVoteByTxQuery(clientCtx client.Context, params v1beta2.QueryVoteParams clientCtx, defaultPage, // Query legacy Vote Msgs []string{ - fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, v1beta2.TypeMsgVote), + fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, v1beta1.TypeMsgVote), fmt.Sprintf("%s.%s='%d'", types.EventTypeProposalVote, types.AttributeKeyProposalID, params.ProposalID), fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeySender, params.Voter), }, @@ -228,7 +228,7 @@ func QueryVoteByTxQuery(clientCtx client.Context, params v1beta2.QueryVoteParams }, // Query legacy VoteWeighted Msgs []string{ - fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, v1beta2.TypeMsgVoteWeighted), + fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, v1beta1.TypeMsgVoteWeighted), fmt.Sprintf("%s.%s='%d'", types.EventTypeProposalVote, types.AttributeKeyProposalID, params.ProposalID), fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeySender, params.Voter.String()), }, @@ -318,7 +318,7 @@ func QueryDepositByTxQuery(clientCtx client.Context, params v1beta2.QueryDeposit clientCtx, defaultPage, // Query legacy Msgs event action []string{ - fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, v1beta2.TypeMsgDeposit), + fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, v1beta1.TypeMsgDeposit), fmt.Sprintf("%s.%s='%d'", types.EventTypeProposalDeposit, types.AttributeKeyProposalID, params.ProposalID), fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeySender, params.Depositor.String()), }, @@ -385,7 +385,7 @@ func QueryProposerByTxQuery(clientCtx client.Context, proposalID uint64) (Propos defaultPage, // Query legacy Msgs event action []string{ - fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, v1beta2.TypeMsgSubmitProposal), + fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, v1beta1.TypeMsgSubmitProposal), fmt.Sprintf("%s.%s='%d'", types.EventTypeSubmitProposal, types.AttributeKeyProposalID, proposalID), }, // Query proto Msgs event action v1beta1 @@ -463,7 +463,7 @@ func queryInitialDepositByTxQuery(clientCtx client.Context, proposalID uint64) ( clientCtx, defaultPage, // Query legacy Msgs event action []string{ - fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, v1beta2.TypeMsgSubmitProposal), + fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeyAction, v1beta1.TypeMsgSubmitProposal), fmt.Sprintf("%s.%s='%d'", types.EventTypeSubmitProposal, types.AttributeKeyProposalID, proposalID), }, // Query proto Msgs event action v1beta1 diff --git a/x/gov/genesis_test.go b/x/gov/genesis_test.go index 2ef487a64910..206698ef3984 100644 --- a/x/gov/genesis_test.go +++ b/x/gov/genesis_test.go @@ -35,11 +35,11 @@ func TestImportExportQueues(t *testing.T) { ctx = app.BaseApp.NewContext(false, tmproto.Header{}) // Create two proposals, put the second into the voting period - proposal1, err := app.GovKeeper.SubmitProposal(ctx, []sdk.Msg{mkTestLegacyContent(t)}) + proposal1, err := app.GovKeeper.SubmitProposal(ctx, []sdk.Msg{mkTestLegacyContent(t)}, nil) require.NoError(t, err) proposalID1 := proposal1.ProposalId - proposal2, err := app.GovKeeper.SubmitProposal(ctx, []sdk.Msg{mkTestLegacyContent(t)}) + proposal2, err := app.GovKeeper.SubmitProposal(ctx, []sdk.Msg{mkTestLegacyContent(t)}, nil) require.NoError(t, err) proposalID2 := proposal2.ProposalId diff --git a/x/gov/keeper/deposit_test.go b/x/gov/keeper/deposit_test.go index 5b35f2a24141..9d0cee1cb18f 100644 --- a/x/gov/keeper/deposit_test.go +++ b/x/gov/keeper/deposit_test.go @@ -17,7 +17,7 @@ func TestDeposits(t *testing.T) { TestAddrs := simapp.AddTestAddrsIncremental(app, ctx, 2, sdk.NewInt(10000000)) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) require.NoError(t, err) proposalID := proposal.ProposalId @@ -101,7 +101,7 @@ func TestDeposits(t *testing.T) { require.Equal(t, addr1Initial, app.BankKeeper.GetAllBalances(ctx, TestAddrs[1])) // Test delete and burn deposits - proposal, err = app.GovKeeper.SubmitProposal(ctx, tp) + proposal, err = app.GovKeeper.SubmitProposal(ctx, tp, nil) require.NoError(t, err) proposalID = proposal.ProposalId _, err = app.GovKeeper.AddDeposit(ctx, proposalID, TestAddrs[0], fourStake) diff --git a/x/gov/keeper/grpc_query_test.go b/x/gov/keeper/grpc_query_test.go index 5143cf1ea105..0b6088c92f0f 100644 --- a/x/gov/keeper/grpc_query_test.go +++ b/x/gov/keeper/grpc_query_test.go @@ -52,7 +52,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposal() { testProposal := v1beta1.NewTextProposal("Proposal", "testing proposal") msgContent, err := v1beta2.NewLegacyContent(testProposal, govAcct.String()) suite.Require().NoError(err) - submittedProposal, err := app.GovKeeper.SubmitProposal(ctx, []sdk.Msg{msgContent}) + submittedProposal, err := app.GovKeeper.SubmitProposal(ctx, []sdk.Msg{msgContent}, nil) suite.Require().NoError(err) suite.Require().NotEmpty(submittedProposal) @@ -116,7 +116,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() { testProposal := []sdk.Msg{ v1beta2.NewMsgVote(govAddress, uint64(i), v1beta2.OptionYes), } - proposal, err := app.GovKeeper.SubmitProposal(ctx, testProposal) + proposal, err := app.GovKeeper.SubmitProposal(ctx, testProposal, nil) suite.Require().NotEmpty(proposal) suite.Require().NoError(err) testProposals = append(testProposals, &proposal) @@ -291,7 +291,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryVote() { "no votes present", func() { var err error - proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal) + proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal, nil) suite.Require().NoError(err) req = &v1beta2.QueryVoteRequest{ @@ -396,7 +396,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryVotes() { "create a proposal and get votes", func() { var err error - proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal) + proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal, nil) suite.Require().NoError(err) req = &v1beta2.QueryVotesRequest{ @@ -588,7 +588,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposit() { "no deposits proposal", func() { var err error - proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal) + proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal, nil) suite.Require().NoError(err) suite.Require().NotNil(proposal) @@ -677,7 +677,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposits() { "create a proposal and get deposits", func() { var err error - proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal) + proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal, nil) suite.Require().NoError(err) req = &v1beta2.QueryDepositsRequest{ @@ -769,7 +769,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryTally() { "create a proposal and get tally", func() { var err error - proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal) + proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal, nil) suite.Require().NoError(err) suite.Require().NotNil(proposal) diff --git a/x/gov/keeper/hooks_test.go b/x/gov/keeper/hooks_test.go index b8b056a47732..c2553702fbfa 100644 --- a/x/gov/keeper/hooks_test.go +++ b/x/gov/keeper/hooks_test.go @@ -64,7 +64,7 @@ func TestHooks(t *testing.T) { require.False(t, govHooksReceiver.AfterProposalVotingPeriodEndedValid) tp := TestProposal - _, err := app.GovKeeper.SubmitProposal(ctx, tp) + _, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) require.NoError(t, err) require.True(t, govHooksReceiver.AfterProposalSubmissionValid) @@ -75,7 +75,7 @@ func TestHooks(t *testing.T) { require.True(t, govHooksReceiver.AfterProposalFailedMinDepositValid) - p2, err := app.GovKeeper.SubmitProposal(ctx, tp) + p2, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) require.NoError(t, err) activated, err := app.GovKeeper.AddDeposit(ctx, p2.ProposalId, addrs[0], minDeposit) diff --git a/x/gov/keeper/keeper.go b/x/gov/keeper/keeper.go index 895df2070ac0..1d0c20cfd44b 100644 --- a/x/gov/keeper/keeper.go +++ b/x/gov/keeper/keeper.go @@ -41,6 +41,9 @@ type Keeper struct { // Msg server router router *middleware.MsgServiceRouter + + // maxMetadataLen defines the maximum proposal metadata length. + maxMetadataLen uint64 } // NewKeeper returns a governance keeper. It handles: @@ -54,6 +57,7 @@ func NewKeeper( cdc codec.BinaryCodec, key storetypes.StoreKey, paramSpace types.ParamSubspace, authKeeper types.AccountKeeper, bankKeeper types.BankKeeper, sk types.StakingKeeper, legacyRouter v1beta1.Router, router *middleware.MsgServiceRouter, + maxMetadataLen uint64, ) Keeper { // ensure governance module account is set @@ -67,14 +71,15 @@ func NewKeeper( legacyRouter.Seal() return Keeper{ - storeKey: key, - paramSpace: paramSpace, - authKeeper: authKeeper, - bankKeeper: bankKeeper, - sk: sk, - cdc: cdc, - legacyRouter: legacyRouter, - router: router, + storeKey: key, + paramSpace: paramSpace, + authKeeper: authKeeper, + bankKeeper: bankKeeper, + sk: sk, + cdc: cdc, + legacyRouter: legacyRouter, + router: router, + maxMetadataLen: maxMetadataLen, } } diff --git a/x/gov/keeper/keeper_test.go b/x/gov/keeper/keeper_test.go index 1f455813597a..51b1f82d2631 100644 --- a/x/gov/keeper/keeper_test.go +++ b/x/gov/keeper/keeper_test.go @@ -51,17 +51,17 @@ func TestIncrementProposalNumber(t *testing.T) { ctx := app.BaseApp.NewContext(false, tmproto.Header{}) tp := TestProposal - _, err := app.GovKeeper.SubmitProposal(ctx, tp) + _, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) require.NoError(t, err) - _, err = app.GovKeeper.SubmitProposal(ctx, tp) + _, err = app.GovKeeper.SubmitProposal(ctx, tp, nil) require.NoError(t, err) - _, err = app.GovKeeper.SubmitProposal(ctx, tp) + _, err = app.GovKeeper.SubmitProposal(ctx, tp, nil) require.NoError(t, err) - _, err = app.GovKeeper.SubmitProposal(ctx, tp) + _, err = app.GovKeeper.SubmitProposal(ctx, tp, nil) require.NoError(t, err) - _, err = app.GovKeeper.SubmitProposal(ctx, tp) + _, err = app.GovKeeper.SubmitProposal(ctx, tp, nil) require.NoError(t, err) - proposal6, err := app.GovKeeper.SubmitProposal(ctx, tp) + proposal6, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) require.NoError(t, err) require.Equal(t, uint64(6), proposal6.ProposalId) @@ -73,7 +73,7 @@ func TestProposalQueues(t *testing.T) { // create test proposals tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) require.NoError(t, err) inactiveIterator := app.GovKeeper.InactiveProposalQueueIterator(ctx, *proposal.DepositEndTime) diff --git a/x/gov/keeper/msg_server.go b/x/gov/keeper/msg_server.go index fc6fd126be74..577d09fb6f4e 100644 --- a/x/gov/keeper/msg_server.go +++ b/x/gov/keeper/msg_server.go @@ -36,7 +36,7 @@ func (k msgServer) SubmitProposal(goCtx context.Context, msg *v1beta2.MsgSubmitP return nil, err } - proposal, err := k.Keeper.SubmitProposal(ctx, proposalMsgs) + proposal, err := k.Keeper.SubmitProposal(ctx, proposalMsgs, msg.Metadata) if err != nil { return nil, err } @@ -230,6 +230,7 @@ func (k legacyMsgServer) SubmitProposal(goCtx context.Context, msg *v1beta1.MsgS []sdk.Msg{contentMsg}, msg.InitialDeposit, msg.Proposer, + nil, ) if err != nil { return nil, err diff --git a/x/gov/keeper/proposal.go b/x/gov/keeper/proposal.go index bc5cffdf598c..4c630736c559 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -11,7 +11,11 @@ import ( ) // SubmitProposal create new proposal given an array of messages -func (keeper Keeper) SubmitProposal(ctx sdk.Context, messages []sdk.Msg) (v1beta2.Proposal, error) { +func (keeper Keeper) SubmitProposal(ctx sdk.Context, messages []sdk.Msg, metadata []byte) (v1beta2.Proposal, error) { + if metadata != nil && len(metadata) > int(keeper.maxMetadataLen) { + return v1beta2.Proposal{}, types.ErrMetadataTooLong.Wrapf("got metadata with length %d", len(metadata)) + } + // Will hold a comma-separated string of all Msg type URLs. msgsStr := "" @@ -63,7 +67,7 @@ func (keeper Keeper) SubmitProposal(ctx sdk.Context, messages []sdk.Msg) (v1beta submitTime := ctx.BlockHeader().Time depositPeriod := keeper.GetDepositParams(ctx).MaxDepositPeriod - proposal, err := v1beta2.NewProposal(messages, proposalID, submitTime, submitTime.Add(*depositPeriod)) + proposal, err := v1beta2.NewProposal(messages, proposalID, metadata, submitTime, submitTime.Add(*depositPeriod)) if err != nil { return v1beta2.Proposal{}, err } diff --git a/x/gov/keeper/proposal_test.go b/x/gov/keeper/proposal_test.go index 82d12e3150c7..dde5829f8469 100644 --- a/x/gov/keeper/proposal_test.go +++ b/x/gov/keeper/proposal_test.go @@ -1,6 +1,7 @@ package keeper_test import ( + "bytes" "errors" "fmt" "strings" @@ -18,7 +19,7 @@ import ( func (suite *KeeperTestSuite) TestGetSetProposal() { tp := TestProposal - proposal, err := suite.app.GovKeeper.SubmitProposal(suite.ctx, tp) + proposal, err := suite.app.GovKeeper.SubmitProposal(suite.ctx, tp, nil) suite.Require().NoError(err) proposalID := proposal.ProposalId suite.app.GovKeeper.SetProposal(suite.ctx, proposal) @@ -30,7 +31,7 @@ func (suite *KeeperTestSuite) TestGetSetProposal() { func (suite *KeeperTestSuite) TestActivateVotingPeriod() { tp := TestProposal - proposal, err := suite.app.GovKeeper.SubmitProposal(suite.ctx, tp) + proposal, err := suite.app.GovKeeper.SubmitProposal(suite.ctx, tp, nil) suite.Require().NoError(err) suite.Require().Nil(proposal.VotingStartTime) @@ -56,28 +57,32 @@ func (invalidProposalRoute) ProposalRoute() string { return "nonexistingroute" } func (suite *KeeperTestSuite) TestSubmitProposal() { govAcct := suite.app.GovKeeper.GetGovernanceAccount(suite.ctx).GetAddress().String() _, _, randomAddr := testdata.KeyTestPubAddr() + tp := v1beta1.TextProposal{Title: "title", Description: "description"} testCases := []struct { content v1beta1.Content authority string + metadata []byte expectedErr error }{ - {&v1beta1.TextProposal{Title: "title", Description: "description"}, govAcct, nil}, + {&tp, govAcct, nil, nil}, // Keeper does not check the validity of title and description, no error - {&v1beta1.TextProposal{Title: "", Description: "description"}, govAcct, nil}, - {&v1beta1.TextProposal{Title: strings.Repeat("1234567890", 100), Description: "description"}, govAcct, nil}, - {&v1beta1.TextProposal{Title: "title", Description: ""}, govAcct, nil}, - {&v1beta1.TextProposal{Title: "title", Description: strings.Repeat("1234567890", 1000)}, govAcct, nil}, + {&v1beta1.TextProposal{Title: "", Description: "description"}, govAcct, nil, nil}, + {&v1beta1.TextProposal{Title: strings.Repeat("1234567890", 100), Description: "description"}, govAcct, nil, nil}, + {&v1beta1.TextProposal{Title: "title", Description: ""}, govAcct, nil, nil}, + {&v1beta1.TextProposal{Title: "title", Description: strings.Repeat("1234567890", 1000)}, govAcct, nil, nil}, + // error when metadata is too long (>10000) + {&tp, govAcct, bytes.Repeat([]byte{42}, 10001), types.ErrMetadataTooLong}, // error when signer is not gov acct - {&v1beta1.TextProposal{Title: "title", Description: "description"}, randomAddr.String(), types.ErrInvalidSigner}, + {&tp, randomAddr.String(), nil, types.ErrInvalidSigner}, // error only when invalid route - {&invalidProposalRoute{}, govAcct, types.ErrNoProposalHandlerExists}, + {&invalidProposalRoute{}, govAcct, nil, types.ErrNoProposalHandlerExists}, } for i, tc := range testCases { prop, err := v1beta2.NewLegacyContent(tc.content, tc.authority) suite.Require().NoError(err) - _, err = suite.app.GovKeeper.SubmitProposal(suite.ctx, []sdk.Msg{prop}) + _, err = suite.app.GovKeeper.SubmitProposal(suite.ctx, []sdk.Msg{prop}, tc.metadata) suite.Require().True(errors.Is(tc.expectedErr, err), "tc #%d; got: %v, expected: %v", i, err, tc.expectedErr) } } @@ -90,7 +95,7 @@ func (suite *KeeperTestSuite) TestGetProposalsFiltered() { for _, s := range status { for i := 0; i < 50; i++ { - p, err := v1beta2.NewProposal(TestProposal, proposalID, time.Now(), time.Now()) + p, err := v1beta2.NewProposal(TestProposal, proposalID, nil, time.Now(), time.Now()) suite.Require().NoError(err) p.Status = s diff --git a/x/gov/keeper/querier_test.go b/x/gov/keeper/querier_test.go index 7fd1b268de28..74a99acd620a 100644 --- a/x/gov/keeper/querier_test.go +++ b/x/gov/keeper/querier_test.go @@ -161,7 +161,7 @@ func TestQueries(t *testing.T) { depositParams, _, _ := getQueriedParams(t, ctx, legacyQuerierCdc, querier) // TestAddrs[0] proposes (and deposits) proposals #1 and #2 - proposal1, err := app.GovKeeper.SubmitProposal(ctx, tp) + proposal1, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) require.NoError(t, err) deposit1 := v1beta2.NewDeposit(proposal1.ProposalId, TestAddrs[0], oneCoins) depositer1, err := sdk.AccAddressFromBech32(deposit1.Depositor) @@ -171,7 +171,7 @@ func TestQueries(t *testing.T) { proposal1.TotalDeposit = sdk.NewCoins(proposal1.TotalDeposit...).Add(deposit1.Amount...) - proposal2, err := app.GovKeeper.SubmitProposal(ctx, tp) + proposal2, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) require.NoError(t, err) deposit2 := v1beta2.NewDeposit(proposal2.ProposalId, TestAddrs[0], consCoins) depositer2, err := sdk.AccAddressFromBech32(deposit2.Depositor) @@ -182,7 +182,7 @@ func TestQueries(t *testing.T) { proposal2.TotalDeposit = sdk.NewCoins(proposal2.TotalDeposit...).Add(deposit2.Amount...) // TestAddrs[1] proposes (and deposits) on proposal #3 - proposal3, err := app.GovKeeper.SubmitProposal(ctx, tp) + proposal3, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) require.NoError(t, err) deposit3 := v1beta2.NewDeposit(proposal3.ProposalId, TestAddrs[1], oneCoins) depositer3, err := sdk.AccAddressFromBech32(deposit3.Depositor) diff --git a/x/gov/keeper/tally_test.go b/x/gov/keeper/tally_test.go index b98dd7e1376c..2f9d48618f88 100644 --- a/x/gov/keeper/tally_test.go +++ b/x/gov/keeper/tally_test.go @@ -20,7 +20,7 @@ func TestTallyNoOneVotes(t *testing.T) { createValidators(t, ctx, app, []int64{5, 5, 5}) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) require.NoError(t, err) proposalID := proposal.ProposalId proposal.Status = v1beta2.StatusVotingPeriod @@ -44,7 +44,7 @@ func TestTallyNoQuorum(t *testing.T) { addrs := simapp.AddTestAddrsIncremental(app, ctx, 1, sdk.NewInt(10000000)) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) require.NoError(t, err) proposalID := proposal.ProposalId proposal.Status = v1beta2.StatusVotingPeriod @@ -67,7 +67,7 @@ func TestTallyOnlyValidatorsAllYes(t *testing.T) { addrs, _ := createValidators(t, ctx, app, []int64{5, 5, 5}) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) require.NoError(t, err) proposalID := proposal.ProposalId proposal.Status = v1beta2.StatusVotingPeriod @@ -93,7 +93,7 @@ func TestTallyOnlyValidators51No(t *testing.T) { valAccAddrs, _ := createValidators(t, ctx, app, []int64{5, 6, 0}) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) require.NoError(t, err) proposalID := proposal.ProposalId proposal.Status = v1beta2.StatusVotingPeriod @@ -117,7 +117,7 @@ func TestTallyOnlyValidators51Yes(t *testing.T) { valAccAddrs, _ := createValidators(t, ctx, app, []int64{5, 6, 0}) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) require.NoError(t, err) proposalID := proposal.ProposalId proposal.Status = v1beta2.StatusVotingPeriod @@ -142,7 +142,7 @@ func TestTallyOnlyValidatorsVetoed(t *testing.T) { valAccAddrs, _ := createValidators(t, ctx, app, []int64{6, 6, 7}) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) require.NoError(t, err) proposalID := proposal.ProposalId proposal.Status = v1beta2.StatusVotingPeriod @@ -168,7 +168,7 @@ func TestTallyOnlyValidatorsAbstainPasses(t *testing.T) { valAccAddrs, _ := createValidators(t, ctx, app, []int64{6, 6, 7}) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) require.NoError(t, err) proposalID := proposal.ProposalId proposal.Status = v1beta2.StatusVotingPeriod @@ -194,7 +194,7 @@ func TestTallyOnlyValidatorsAbstainFails(t *testing.T) { valAccAddrs, _ := createValidators(t, ctx, app, []int64{6, 6, 7}) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) require.NoError(t, err) proposalID := proposal.ProposalId proposal.Status = v1beta2.StatusVotingPeriod @@ -221,7 +221,7 @@ func TestTallyOnlyValidatorsNonVoter(t *testing.T) { valAccAddr1, valAccAddr2 := valAccAddrs[0], valAccAddrs[1] tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) require.NoError(t, err) proposalID := proposal.ProposalId proposal.Status = v1beta2.StatusVotingPeriod @@ -255,7 +255,7 @@ func TestTallyDelgatorOverride(t *testing.T) { _ = staking.EndBlocker(ctx, app.StakingKeeper) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) require.NoError(t, err) proposalID := proposal.ProposalId proposal.Status = v1beta2.StatusVotingPeriod @@ -291,7 +291,7 @@ func TestTallyDelgatorInherit(t *testing.T) { _ = staking.EndBlocker(ctx, app.StakingKeeper) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) require.NoError(t, err) proposalID := proposal.ProposalId proposal.Status = v1beta2.StatusVotingPeriod @@ -330,7 +330,7 @@ func TestTallyDelgatorMultipleOverride(t *testing.T) { _ = staking.EndBlocker(ctx, app.StakingKeeper) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) require.NoError(t, err) proposalID := proposal.ProposalId proposal.Status = v1beta2.StatusVotingPeriod @@ -372,7 +372,7 @@ func TestTallyDelgatorMultipleInherit(t *testing.T) { _ = staking.EndBlocker(ctx, app.StakingKeeper) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) require.NoError(t, err) proposalID := proposal.ProposalId proposal.Status = v1beta2.StatusVotingPeriod @@ -415,7 +415,7 @@ func TestTallyJailedValidator(t *testing.T) { app.StakingKeeper.Jail(ctx, sdk.ConsAddress(consAddr.Bytes())) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) require.NoError(t, err) proposalID := proposal.ProposalId proposal.Status = v1beta2.StatusVotingPeriod @@ -448,7 +448,7 @@ func TestTallyValidatorMultipleDelegations(t *testing.T) { require.NoError(t, err) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) require.NoError(t, err) proposalID := proposal.ProposalId proposal.Status = v1beta2.StatusVotingPeriod diff --git a/x/gov/keeper/vote_test.go b/x/gov/keeper/vote_test.go index 1ca73f64d2e0..2790a3d03a21 100644 --- a/x/gov/keeper/vote_test.go +++ b/x/gov/keeper/vote_test.go @@ -18,7 +18,7 @@ func TestVotes(t *testing.T) { addrs := simapp.AddTestAddrsIncremental(app, ctx, 5, sdk.NewInt(30000000)) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, nil) require.NoError(t, err) proposalID := proposal.ProposalId diff --git a/x/gov/simulation/operations_test.go b/x/gov/simulation/operations_test.go index 5e39e23c8790..26ef7b04bcc9 100644 --- a/x/gov/simulation/operations_test.go +++ b/x/gov/simulation/operations_test.go @@ -147,7 +147,7 @@ func TestSimulateMsgDeposit(t *testing.T) { submitTime := ctx.BlockHeader().Time depositPeriod := app.GovKeeper.GetDepositParams(ctx).MaxDepositPeriod - proposal, err := v1beta2.NewProposal([]sdk.Msg{contentMsg}, 1, submitTime, submitTime.Add(*depositPeriod)) + proposal, err := v1beta2.NewProposal([]sdk.Msg{contentMsg}, 1, nil, submitTime, submitTime.Add(*depositPeriod)) require.NoError(t, err) app.GovKeeper.SetProposal(ctx, proposal) @@ -191,7 +191,7 @@ func TestSimulateMsgVote(t *testing.T) { submitTime := ctx.BlockHeader().Time depositPeriod := app.GovKeeper.GetDepositParams(ctx).MaxDepositPeriod - proposal, err := v1beta2.NewProposal([]sdk.Msg{contentMsg}, 1, submitTime, submitTime.Add(*depositPeriod)) + proposal, err := v1beta2.NewProposal([]sdk.Msg{contentMsg}, 1, nil, submitTime, submitTime.Add(*depositPeriod)) require.NoError(t, err) app.GovKeeper.ActivateVotingPeriod(ctx, proposal) @@ -234,7 +234,7 @@ func TestSimulateMsgVoteWeighted(t *testing.T) { submitTime := ctx.BlockHeader().Time depositPeriod := app.GovKeeper.GetDepositParams(ctx).MaxDepositPeriod - proposal, err := v1beta2.NewProposal([]sdk.Msg{contentMsg}, 1, submitTime, submitTime.Add(*depositPeriod)) + proposal, err := v1beta2.NewProposal([]sdk.Msg{contentMsg}, 1, nil, submitTime, submitTime.Add(*depositPeriod)) require.NoError(t, err) app.GovKeeper.ActivateVotingPeriod(ctx, proposal) diff --git a/x/gov/types/errors.go b/x/gov/types/errors.go index 18951b0606e2..52cd81648b9d 100644 --- a/x/gov/types/errors.go +++ b/x/gov/types/errors.go @@ -20,4 +20,5 @@ var ( ErrInvalidProposalMsg = sdkerrors.Register(ModuleName, 12, "invalid proposal message") ErrInvalidSigner = sdkerrors.Register(ModuleName, 13, "expected gov account as only signer for proposal message") ErrInvalidSignalMsg = sdkerrors.Register(ModuleName, 14, "signal message is invalid") + ErrMetadataTooLong = sdkerrors.Register(ModuleName, 15, "metadata too long") ) diff --git a/x/gov/types/v1beta2/gov.pb.go b/x/gov/types/v1beta2/gov.pb.go index 31068577d6ef..98e8b1075805 100644 --- a/x/gov/types/v1beta2/gov.pb.go +++ b/x/gov/types/v1beta2/gov.pb.go @@ -246,6 +246,8 @@ type Proposal struct { TotalDeposit []types.Coin `protobuf:"bytes,7,rep,name=total_deposit,json=totalDeposit,proto3" json:"total_deposit"` VotingStartTime *time.Time `protobuf:"bytes,8,opt,name=voting_start_time,json=votingStartTime,proto3,stdtime" json:"voting_start_time,omitempty"` VotingEndTime *time.Time `protobuf:"bytes,9,opt,name=voting_end_time,json=votingEndTime,proto3,stdtime" json:"voting_end_time,omitempty"` + // metadata is any arbitrary metadata to attached to the proposal. + Metadata []byte `protobuf:"bytes,10,opt,name=metadata,proto3" json:"metadata,omitempty"` } func (m *Proposal) Reset() { *m = Proposal{} } @@ -344,6 +346,13 @@ func (m *Proposal) GetVotingEndTime() *time.Time { return nil } +func (m *Proposal) GetMetadata() []byte { + if m != nil { + return m.Metadata + } + return nil +} + // TallyResult defines a standard tally for a governance proposal. type TallyResult struct { Yes string `protobuf:"bytes,1,opt,name=yes,proto3" json:"yes,omitempty"` @@ -671,75 +680,76 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1beta2/gov.proto", fileDescriptor_5abf7b8852811c49) } var fileDescriptor_5abf7b8852811c49 = []byte{ - // 1078 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x56, 0x41, 0x4f, 0x1b, 0x47, - 0x14, 0x66, 0x6d, 0x63, 0xe0, 0x19, 0x9c, 0xed, 0x40, 0x9b, 0x85, 0x10, 0x9b, 0x5a, 0x6d, 0x84, - 0x50, 0xb1, 0x81, 0x4a, 0xa9, 0x94, 0x53, 0x6d, 0xbc, 0x69, 0x16, 0x51, 0xd6, 0xdd, 0xdd, 0x18, - 0xa5, 0x97, 0xd5, 0x9a, 0x9d, 0xd8, 0xab, 0x7a, 0x77, 0xdc, 0x9d, 0x31, 0xc1, 0x3f, 0xa1, 0xb7, - 0x1c, 0x2b, 0xf5, 0x27, 0xf4, 0x9a, 0x1f, 0x91, 0x53, 0x15, 0x45, 0x8a, 0xd4, 0x5e, 0xdc, 0x16, - 0x6e, 0xfc, 0x8a, 0x68, 0x67, 0x67, 0xb1, 0xb1, 0x89, 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0x3d, 0x42, 0x9d, 0xae, 0xed, 0xb9, 0xbc, 0x60, 0xc6, 0x80, 0x24, 0xa4, 0xb9, 0xe8, 0x31, 0x2c, - 0xb8, 0x31, 0x96, 0x84, 0x42, 0x57, 0x79, 0xff, 0x66, 0x7b, 0x45, 0xe8, 0x56, 0x5d, 0x37, 0xc4, - 0x94, 0x9a, 0x2c, 0xf4, 0x82, 0xb6, 0x31, 0x82, 0xa2, 0xef, 0x20, 0xeb, 0xf8, 0xa4, 0x1f, 0x30, - 0x25, 0xbd, 0x91, 0xde, 0xcc, 0xed, 0xad, 0x26, 0x43, 0x44, 0x07, 0x23, 0xa6, 0xd8, 0x2d, 0xef, - 0x13, 0x2f, 0xa8, 0x65, 0xde, 0x0e, 0x8b, 0x33, 0x86, 0x80, 0x97, 0x3e, 0x64, 0x60, 0xbe, 0x21, - 0xea, 0xdf, 0xde, 0xde, 0x0e, 0xcc, 0xfb, 0x98, 0x52, 0xa7, 0x8d, 0xa9, 0x92, 0xe2, 0x85, 0x56, - 0xca, 0xf1, 0x79, 0x94, 0x93, 0xf3, 0x28, 0x57, 0x83, 0x81, 0x71, 0x85, 0x42, 0x4f, 0x20, 0x4b, - 0x99, 0xc3, 0xfa, 0x54, 0x49, 0xf3, 0xdd, 0x2d, 0xdd, 0xb4, 0xbb, 0x49, 0x03, 0x26, 0x47, 0x1a, - 0x82, 0x81, 0x7e, 0x04, 0xf4, 0xd2, 0x0b, 0x9c, 0xae, 0xcd, 0x9c, 0x6e, 0x77, 0x60, 0x87, 0x98, - 0xf6, 0xbb, 0x4c, 0xc9, 0x6c, 0x48, 0x9b, 0xb9, 0xbd, 0xe2, 0x4d, 0x3a, 0x56, 0x84, 0x33, 0x38, - 0xcc, 0x90, 0x39, 0x75, 0x2c, 0x82, 0xaa, 0x90, 0xa3, 0xfd, 0x96, 0xef, 0x31, 0x3b, 0xb2, 0x9b, - 0x32, 0xcb, 0x75, 0xd6, 0xa6, 0xfa, 0xb7, 0x12, 0x2f, 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5a, 0x97, 0x67, 0x6b, 0x07, 0x6f, 0xcf, - 0x0b, 0xd2, 0xbb, 0xf3, 0x82, 0xf4, 0xdf, 0x79, 0x41, 0x7a, 0x7d, 0x51, 0x98, 0x79, 0x77, 0x51, - 0x98, 0xf9, 0xfb, 0xa2, 0x30, 0xf3, 0xf3, 0x4e, 0xdb, 0x63, 0x9d, 0x7e, 0xab, 0x7c, 0x42, 0x7c, - 0xf1, 0x5d, 0x22, 0xfe, 0x6c, 0x53, 0xf7, 0x97, 0xca, 0x19, 0xff, 0xea, 0x62, 0x83, 0x1e, 0xa6, - 0xc9, 0xb7, 0x57, 0x2b, 0xcb, 0x3d, 0xfb, 0xed, 0xc7, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc8, 0x76, - 0x36, 0x02, 0x98, 0x09, 0x00, 0x00, + // 1095 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x56, 0xc1, 0x6e, 0xdb, 0x46, + 0x10, 0x35, 0x25, 0x59, 0xb6, 0x47, 0xb6, 0xc2, 0xae, 0xdd, 0x86, 0x76, 0x1c, 0x49, 0x15, 0xda, + 0x40, 0x30, 0x6a, 0xc9, 0x76, 0x81, 0x14, 0xc8, 0xa9, 0x92, 0xc5, 0x34, 0x32, 0x5c, 0x53, 0x25, + 0x19, 0x19, 0xe9, 0x85, 0xa0, 0xcc, 0x8d, 0x44, 0x54, 0xe4, 0xaa, 0xdc, 0x95, 0x63, 0x7d, 0x42, + 0x6f, 0x39, 0x16, 0xe8, 0x27, 0xf4, 0x9a, 0x8f, 0xc8, 0xa9, 0x08, 0x02, 0x14, 0x68, 0x2f, 0x6a, + 0x6b, 0xdf, 0x7c, 0xeb, 0x1f, 0x04, 0x5c, 0x2e, 0x2d, 0x59, 0x72, 0x60, 0x9f, 0xb4, 0x9a, 0x79, + 0xef, 0xcd, 0x0c, 0xf7, 0xed, 0x92, 0xb0, 0x79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xf3, 0x69, 0xb5, 0x71, 0xa8, 0xd6, 0xe5, 0xf9, 0xda, 0xc1, + 0xdb, 0xf3, 0x9c, 0xf4, 0xee, 0x3c, 0x27, 0xfd, 0x7b, 0x9e, 0x93, 0x5e, 0x5f, 0xe4, 0xe6, 0xde, + 0x5d, 0xe4, 0xe6, 0xfe, 0xba, 0xc8, 0xcd, 0xfd, 0xb8, 0xd3, 0x71, 0x59, 0x77, 0xd0, 0x2e, 0x9f, + 0x10, 0x4f, 0x7c, 0xb3, 0x88, 0x9f, 0x6d, 0xea, 0xfc, 0x54, 0x39, 0xe3, 0x5f, 0x64, 0x6c, 0xd8, + 0xc7, 0x34, 0xfe, 0x2e, 0x6b, 0xa7, 0xb9, 0x67, 0xbf, 0xfe, 0x10, 0x00, 0x00, 0xff, 0xff, 0x64, + 0xbb, 0x92, 0x2d, 0xb4, 0x09, 0x00, 0x00, } func (m *WeightedVoteOption) Marshal() (dAtA []byte, err error) { @@ -846,6 +856,13 @@ func (m *Proposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Metadata) > 0 { + i -= len(m.Metadata) + copy(dAtA[i:], m.Metadata) + i = encodeVarintGov(dAtA, i, uint64(len(m.Metadata))) + i-- + dAtA[i] = 0x52 + } if m.VotingEndTime != nil { n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.VotingEndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.VotingEndTime):]) if err1 != nil { @@ -1261,6 +1278,10 @@ func (m *Proposal) Size() (n int) { l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.VotingEndTime) n += 1 + l + sovGov(uint64(l)) } + l = len(m.Metadata) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } return n } @@ -1924,6 +1945,40 @@ func (m *Proposal) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Metadata = append(m.Metadata[:0], dAtA[iNdEx:postIndex]...) + if m.Metadata == nil { + m.Metadata = []byte{} + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGov(dAtA[iNdEx:]) diff --git a/x/gov/types/v1beta2/msgs.go b/x/gov/types/v1beta2/msgs.go index c228a16881f1..f026c26caacb 100644 --- a/x/gov/types/v1beta2/msgs.go +++ b/x/gov/types/v1beta2/msgs.go @@ -11,15 +11,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) -// Governance message types and routes -const ( - TypeMsgDeposit = "deposit" - TypeMsgVote = "vote" - TypeMsgVoteWeighted = "weighted_vote" - TypeMsgSubmitProposal = "submit_proposal" - TypeMsgSignal = "signal" -) - var ( _, _, _, _, _ sdk.Msg = &MsgSubmitProposal{}, &MsgDeposit{}, &MsgVote{}, &MsgVoteWeighted{}, &MsgExecLegacyContent{} _, _ codectypes.UnpackInterfacesMessage = &MsgSubmitProposal{}, &MsgExecLegacyContent{} @@ -27,10 +18,11 @@ var ( // NewMsgSubmitProposal creates a new MsgSubmitProposal. //nolint:interfacer -func NewMsgSubmitProposal(messages []sdk.Msg, initialDeposit sdk.Coins, proposer string) (*MsgSubmitProposal, error) { +func NewMsgSubmitProposal(messages []sdk.Msg, initialDeposit sdk.Coins, proposer string, metadata []byte) (*MsgSubmitProposal, error) { m := &MsgSubmitProposal{ InitialDeposit: initialDeposit, Proposer: proposer, + Metadata: metadata, } anys, err := sdktx.SetMsgs(messages) @@ -51,7 +43,7 @@ func (m *MsgSubmitProposal) GetMsgs() ([]sdk.Msg, error) { func (m MsgSubmitProposal) Route() string { return types.RouterKey } // Type implements Msg -func (m MsgSubmitProposal) Type() string { return TypeMsgSubmitProposal } +func (m MsgSubmitProposal) Type() string { return sdk.MsgTypeURL(&m) } // ValidateBasic implements Msg func (m MsgSubmitProposal) ValidateBasic() error { @@ -68,11 +60,10 @@ func (m MsgSubmitProposal) ValidateBasic() error { return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, deposit.String()) } - // Empty messages are not allowed - // TODO: ValidateBasic should check that either metadata or length is non nil - // if m.Messages == nil || len(m.Messages) == 0 { - // return ErrNoProposalMsgs - // } + // Check that either metadata or Msgs length is non nil. + if len(m.Messages) == 0 && len(m.Metadata) == 0 { + return sdkerrors.Wrap(types.ErrNoProposalMsgs, "either metadata or Msgs length must be non-nil") + } msgs, err := m.GetMsgs() if err != nil { @@ -116,7 +107,7 @@ func NewMsgDeposit(depositor sdk.AccAddress, proposalID uint64, amount sdk.Coins func (msg MsgDeposit) Route() string { return types.RouterKey } // Type implements Msg -func (msg MsgDeposit) Type() string { return TypeMsgDeposit } +func (msg MsgDeposit) Type() string { return sdk.MsgTypeURL(&msg) } // ValidateBasic implements Msg func (msg MsgDeposit) ValidateBasic() error { @@ -156,7 +147,7 @@ func NewMsgVote(voter sdk.AccAddress, proposalID uint64, option VoteOption) *Msg func (msg MsgVote) Route() string { return types.RouterKey } // Type implements Msg -func (msg MsgVote) Type() string { return TypeMsgVote } +func (msg MsgVote) Type() string { return sdk.MsgTypeURL(&msg) } // ValidateBasic implements Msg func (msg MsgVote) ValidateBasic() error { @@ -192,7 +183,7 @@ func NewMsgVoteWeighted(voter sdk.AccAddress, proposalID uint64, options Weighte func (msg MsgVoteWeighted) Route() string { return types.RouterKey } // Type implements Msg -func (msg MsgVoteWeighted) Type() string { return TypeMsgVoteWeighted } +func (msg MsgVoteWeighted) Type() string { return sdk.MsgTypeURL(&msg) } // ValidateBasic implements Msg func (msg MsgVoteWeighted) ValidateBasic() error { diff --git a/x/gov/types/v1beta2/msgs_test.go b/x/gov/types/v1beta2/msgs_test.go index 65ba980ee9f6..5a64426f6356 100644 --- a/x/gov/types/v1beta2/msgs_test.go +++ b/x/gov/types/v1beta2/msgs_test.go @@ -6,6 +6,7 @@ import ( "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta2" ) @@ -126,10 +127,46 @@ func TestMsgVoteWeighted(t *testing.T) { } } +func TestMsgSubmitProposal_ValidateBasic(t *testing.T) { + metadata := []byte{42} + // Valid msg + msg1, err := v1beta2.NewLegacyContent(v1beta1.NewTextProposal("Title", "description"), addrs[0].String()) + require.NoError(t, err) + // Invalid msg + msg2, err := v1beta2.NewLegacyContent(v1beta1.NewTextProposal("Title", "description"), "foo") + require.NoError(t, err) + + tests := []struct { + name string + proposer string + initialDeposit sdk.Coins + messages []sdk.Msg + metadata []byte + expErr bool + }{ + {"invalid addr", "", coinsPos, []sdk.Msg{msg1}, metadata, true}, + {"empty msgs and metadata", addrs[0].String(), coinsPos, nil, nil, true}, + {"invalid msg", addrs[0].String(), coinsPos, []sdk.Msg{msg1, msg2}, metadata, true}, + {"valid with no Msg", addrs[0].String(), coinsPos, nil, metadata, false}, + {"valid with no metadata", addrs[0].String(), coinsPos, []sdk.Msg{msg1}, nil, false}, + {"valid with everything", addrs[0].String(), coinsPos, []sdk.Msg{msg1}, metadata, false}, + } + + for _, tc := range tests { + msg, err := v1beta2.NewMsgSubmitProposal(tc.messages, tc.initialDeposit, tc.proposer, tc.metadata) + require.NoError(t, err) + if tc.expErr { + require.Error(t, msg.ValidateBasic(), "test: %s", tc.name) + } else { + require.NoError(t, msg.ValidateBasic(), "test: %s", tc.name) + } + } +} + // this tests that Amino JSON MsgSubmitProposal.GetSignBytes() still works with Content as Any using the ModuleCdc func TestMsgSubmitProposal_GetSignBytes(t *testing.T) { proposal := []sdk.Msg{v1beta2.NewMsgVote(addrs[0], 1, v1beta2.OptionYes)} - msg, err := v1beta2.NewMsgSubmitProposal(proposal, sdk.NewCoins(), sdk.AccAddress{}.String()) + msg, err := v1beta2.NewMsgSubmitProposal(proposal, sdk.NewCoins(), sdk.AccAddress{}.String(), nil) require.NoError(t, err) var bz []byte require.NotPanics(t, func() { diff --git a/x/gov/types/v1beta2/proposal.go b/x/gov/types/v1beta2/proposal.go index 22c2cb84c1fd..ebe6076d675c 100644 --- a/x/gov/types/v1beta2/proposal.go +++ b/x/gov/types/v1beta2/proposal.go @@ -23,7 +23,7 @@ const ( ) // NewProposal creates a new Proposal instance -func NewProposal(messages []sdk.Msg, id uint64, submitTime, depositEndTime time.Time) (Proposal, error) { +func NewProposal(messages []sdk.Msg, id uint64, metadata []byte, submitTime, depositEndTime time.Time) (Proposal, error) { msgs, err := sdktx.SetMsgs(messages) if err != nil { @@ -35,6 +35,7 @@ func NewProposal(messages []sdk.Msg, id uint64, submitTime, depositEndTime time. p := Proposal{ ProposalId: id, Messages: msgs, + Metadata: metadata, Status: StatusDepositPeriod, FinalTallyResult: &tally, SubmitTime: &submitTime, diff --git a/x/gov/types/v1beta2/proposals_test.go b/x/gov/types/v1beta2/proposals_test.go index a49a3e14958e..7525ba5361f6 100644 --- a/x/gov/types/v1beta2/proposals_test.go +++ b/x/gov/types/v1beta2/proposals_test.go @@ -37,7 +37,7 @@ func TestNestedAnys(t *testing.T) { testProposal := v1beta1.NewTextProposal("Proposal", "testing proposal") msgContent, err := v1beta2.NewLegacyContent(testProposal, "cosmos1govacct") require.NoError(t, err) - proposal, err := v1beta2.NewProposal([]sdk.Msg{msgContent}, 1, time.Now(), time.Now()) + proposal, err := v1beta2.NewProposal([]sdk.Msg{msgContent}, 1, nil, time.Now(), time.Now()) require.NoError(t, err) require.Equal(t, "TODO Fix panic here", proposal.String()) diff --git a/x/gov/types/v1beta2/tx.pb.go b/x/gov/types/v1beta2/tx.pb.go index c2d7b0b9a487..82d5d9d74872 100644 --- a/x/gov/types/v1beta2/tx.pb.go +++ b/x/gov/types/v1beta2/tx.pb.go @@ -37,6 +37,8 @@ type MsgSubmitProposal struct { Messages []*types.Any `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` InitialDeposit []types1.Coin `protobuf:"bytes,2,rep,name=initial_deposit,json=initialDeposit,proto3" json:"initial_deposit"` Proposer string `protobuf:"bytes,3,opt,name=proposer,proto3" json:"proposer,omitempty"` + // metadata is any arbitrary metadata to attached to the proposal. + Metadata []byte `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` } func (m *MsgSubmitProposal) Reset() { *m = MsgSubmitProposal{} } @@ -93,6 +95,13 @@ func (m *MsgSubmitProposal) GetProposer() string { return "" } +func (m *MsgSubmitProposal) GetMetadata() []byte { + if m != nil { + return m.Metadata + } + return nil +} + // MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. type MsgSubmitProposalResponse struct { ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` @@ -545,50 +554,51 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1beta2/tx.proto", fileDescriptor_4214261f6b3f9ed4) } var fileDescriptor_4214261f6b3f9ed4 = []byte{ - // 681 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0x4f, 0x4f, 0x13, 0x4f, - 0x18, 0xee, 0x52, 0x7e, 0x14, 0x5e, 0x7e, 0x81, 0x30, 0x69, 0xe2, 0x76, 0x21, 0x0b, 0x59, 0x23, - 0x69, 0x62, 0xba, 0x5b, 0xaa, 0xc1, 0x83, 0x1e, 0xa4, 0x68, 0x82, 0xc6, 0x46, 0x5d, 0x12, 0x4d, - 0xbc, 0xe0, 0xb6, 0x3b, 0x0c, 0x13, 0xe9, 0xbe, 0xeb, 0xce, 0xb4, 0xa1, 0xdf, 0xc2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- 0x78, 0xda, 0xb2, 0xfe, 0xf4, 0xe8, 0xd4, 0xd4, 0x8e, 0x4f, 0x4d, 0xed, 0xe7, 0xa9, 0xa9, 0x7d, - 0x38, 0x33, 0x73, 0xc7, 0x67, 0x66, 0xee, 0xfb, 0x99, 0x99, 0x7b, 0x53, 0x65, 0x5c, 0xee, 0x75, - 0x9a, 0x76, 0x0b, 0xdb, 0xea, 0x69, 0x50, 0x3f, 0x15, 0xe1, 0xbf, 0x73, 0x0e, 0xe2, 0x87, 0x46, - 0xf6, 0x42, 0x2a, 0xd2, 0xe7, 0xa6, 0x39, 0x15, 0x7f, 0xe1, 0xee, 0xfc, 0x0e, 0x00, 0x00, 0xff, - 0xff, 0xfd, 0xa4, 0xe8, 0x04, 0xdc, 0x06, 0x00, 0x00, + // 697 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0xcd, 0x6e, 0xd3, 0x4c, + 0x14, 0x8d, 0x9b, 0x7c, 0x4d, 0x7b, 0x5b, 0xb5, 0xea, 0x28, 0xd2, 0xe7, 0xb8, 0x95, 0x1b, 0xf9, + 0xd3, 0x57, 0x45, 0x42, 0xb1, 0xd3, 0x80, 0xca, 0x02, 0x16, 0x34, 0x05, 0xa9, 0x20, 0x22, 0xc0, + 0x95, 0x40, 0x62, 0x53, 0x9c, 0x78, 0x3a, 0xb5, 0x68, 0x7c, 0x8d, 0x67, 0x12, 0x35, 0x6f, 0xc1, + 0x3b, 0xf0, 0x00, 0x6c, 0xca, 0x3b, 0x54, 0xac, 0x2a, 0x56, 0x6c, 0xa8, 0xa0, 0xdd, 0xf1, 0x14, + 0xc8, 0xf6, 0xd8, 0x2d, 0xcd, 0x4f, 0xcb, 0x86, 0x55, 0xec, 0x7b, 0xce, 0xb9, 0x73, 0xce, 0x64, + 0xae, 0x07, 0x96, 0x3b, 0xc8, 0xbb, 0xc8, 0x2d, 0x86, 0x7d,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f7, + 0xda, 0x66, 0x07, 0xbb, 0xf2, 0xda, 0x90, 0x3f, 0x35, 0xee, 0xbe, 0xb5, 0x0e, 0xe3, 0x4b, 0x48, + 0x0c, 0x02, 0xca, 0xd3, 0xab, 0xa8, 0x3d, 0x1d, 0x7f, 0xe1, 0x6e, 0xff, 0x0a, 0x00, 0x00, 0xff, + 0xff, 0x5e, 0xe6, 0x0b, 0x80, 0xf8, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -851,6 +861,13 @@ func (m *MsgSubmitProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Metadata) > 0 { + i -= len(m.Metadata) + copy(dAtA[i:], m.Metadata) + i = encodeVarintTx(dAtA, i, uint64(len(m.Metadata))) + i-- + dAtA[i] = 0x22 + } if len(m.Proposer) > 0 { i -= len(m.Proposer) copy(dAtA[i:], m.Proposer) @@ -1222,6 +1239,10 @@ func (m *MsgSubmitProposal) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } + l = len(m.Metadata) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } return n } @@ -1488,6 +1509,40 @@ func (m *MsgSubmitProposal) Unmarshal(dAtA []byte) error { } m.Proposer = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Metadata = append(m.Metadata[:0], dAtA[iNdEx:postIndex]...) + if m.Metadata == nil { + m.Metadata = []byte{} + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:])