From 82745d91259e71b79896b3286f02c76ce5e33077 Mon Sep 17 00:00:00 2001 From: MSalopek Date: Tue, 18 Jun 2024 17:44:38 +0200 Subject: [PATCH] feat(x/gov)!: upstream expedited proposals (backport #14720) (#20657) Co-authored-by: Julien Robert --- api/cosmos/gov/v1/gov.pulsar.go | 662 ++++++++++++++---- api/cosmos/gov/v1/query_grpc.pb.go | 34 +- api/cosmos/gov/v1/tx.pulsar.go | 317 +++++---- api/cosmos/gov/v1/tx_grpc.pb.go | 28 +- api/cosmos/gov/v1beta1/gov.pulsar.go | 26 +- api/cosmos/gov/v1beta1/query_grpc.pb.go | 34 +- api/cosmos/gov/v1beta1/tx_grpc.pb.go | 22 +- proto/cosmos/gov/v1/gov.proto | 23 +- proto/cosmos/gov/v1/tx.proto | 5 + tests/e2e/gov/query.go | 7 +- tests/integration/gov/genesis_test.go | 4 +- .../integration/gov/keeper/grpc_query_test.go | 8 +- tests/integration/gov/keeper/tally_test.go | 30 +- x/bank/app_test.go | 2 + x/evidence/client/cli/query_test.go | 4 +- x/gov/README.md | 30 +- x/gov/abci.go | 69 +- x/gov/abci_test.go | 121 ++-- x/gov/client/cli/tx.go | 5 +- x/gov/client/cli/util.go | 23 +- x/gov/client/cli/util_test.go | 16 +- x/gov/keeper/deposit.go | 11 +- x/gov/keeper/deposit_test.go | 9 +- x/gov/keeper/export_test.go | 4 +- x/gov/keeper/grpc_query_test.go | 41 +- x/gov/keeper/hooks_test.go | 4 +- x/gov/keeper/keeper_test.go | 14 +- x/gov/keeper/migrations.go | 6 + x/gov/keeper/msg_server.go | 5 +- x/gov/keeper/msg_server_test.go | 24 +- x/gov/keeper/proposal.go | 12 +- x/gov/keeper/proposal_test.go | 132 ++-- x/gov/keeper/tally.go | 10 +- x/gov/keeper/vote_test.go | 2 +- x/gov/migrations/v3/json_test.go | 1 + x/gov/migrations/v4/json.go | 3 + x/gov/migrations/v4/json_test.go | 8 + x/gov/migrations/v4/store.go | 3 + x/gov/migrations/v4/store_test.go | 4 +- x/gov/migrations/v5/store.go | 37 + x/gov/migrations/v5/store_test.go | 44 ++ x/gov/module.go | 17 +- x/gov/simulation/decoder.go | 28 +- x/gov/simulation/decoder_test.go | 22 +- x/gov/simulation/genesis.go | 95 ++- x/gov/simulation/genesis_test.go | 18 +- x/gov/simulation/operations.go | 21 +- x/gov/simulation/operations_test.go | 15 +- x/gov/types/events.go | 4 + x/gov/types/v1/gov.pb.go | 414 ++++++++--- x/gov/types/v1/msgs.go | 8 +- x/gov/types/v1/msgs_test.go | 36 +- x/gov/types/v1/params.go | 69 +- x/gov/types/v1/proposal.go | 13 +- x/gov/types/v1/proposals_test.go | 41 +- x/gov/types/v1/tx.pb.go | 161 +++-- x/upgrade/client/cli/tx.go | 1 - 57 files changed, 2043 insertions(+), 764 deletions(-) create mode 100644 x/gov/migrations/v5/store.go create mode 100644 x/gov/migrations/v5/store_test.go diff --git a/api/cosmos/gov/v1/gov.pulsar.go b/api/cosmos/gov/v1/gov.pulsar.go index f961a3d21f86..f579d80b151e 100644 --- a/api/cosmos/gov/v1/gov.pulsar.go +++ b/api/cosmos/gov/v1/gov.pulsar.go @@ -1210,6 +1210,7 @@ var ( fd_Proposal_title protoreflect.FieldDescriptor fd_Proposal_summary protoreflect.FieldDescriptor fd_Proposal_proposer protoreflect.FieldDescriptor + fd_Proposal_expedited protoreflect.FieldDescriptor ) func init() { @@ -1228,6 +1229,7 @@ func init() { fd_Proposal_title = md_Proposal.Fields().ByName("title") fd_Proposal_summary = md_Proposal.Fields().ByName("summary") fd_Proposal_proposer = md_Proposal.Fields().ByName("proposer") + fd_Proposal_expedited = md_Proposal.Fields().ByName("expedited") } var _ protoreflect.Message = (*fastReflection_Proposal)(nil) @@ -1373,6 +1375,12 @@ func (x *fastReflection_Proposal) Range(f func(protoreflect.FieldDescriptor, pro return } } + if x.Expedited != false { + value := protoreflect.ValueOfBool(x.Expedited) + if !f(fd_Proposal_expedited, value) { + return + } + } } // Has reports whether a field is populated. @@ -1414,6 +1422,8 @@ func (x *fastReflection_Proposal) Has(fd protoreflect.FieldDescriptor) bool { return x.Summary != "" case "cosmos.gov.v1.Proposal.proposer": return x.Proposer != "" + case "cosmos.gov.v1.Proposal.expedited": + return x.Expedited != false default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Proposal")) @@ -1456,6 +1466,8 @@ func (x *fastReflection_Proposal) Clear(fd protoreflect.FieldDescriptor) { x.Summary = "" case "cosmos.gov.v1.Proposal.proposer": x.Proposer = "" + case "cosmos.gov.v1.Proposal.expedited": + x.Expedited = false default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Proposal")) @@ -1517,6 +1529,9 @@ func (x *fastReflection_Proposal) Get(descriptor protoreflect.FieldDescriptor) p case "cosmos.gov.v1.Proposal.proposer": value := x.Proposer return protoreflect.ValueOfString(value) + case "cosmos.gov.v1.Proposal.expedited": + value := x.Expedited + return protoreflect.ValueOfBool(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Proposal")) @@ -1567,6 +1582,8 @@ func (x *fastReflection_Proposal) Set(fd protoreflect.FieldDescriptor, value pro x.Summary = value.Interface().(string) case "cosmos.gov.v1.Proposal.proposer": x.Proposer = value.Interface().(string) + case "cosmos.gov.v1.Proposal.expedited": + x.Expedited = value.Bool() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Proposal")) @@ -1636,6 +1653,8 @@ func (x *fastReflection_Proposal) Mutable(fd protoreflect.FieldDescriptor) proto panic(fmt.Errorf("field summary of message cosmos.gov.v1.Proposal is not mutable")) case "cosmos.gov.v1.Proposal.proposer": panic(fmt.Errorf("field proposer of message cosmos.gov.v1.Proposal is not mutable")) + case "cosmos.gov.v1.Proposal.expedited": + panic(fmt.Errorf("field expedited of message cosmos.gov.v1.Proposal is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Proposal")) @@ -1682,6 +1701,8 @@ func (x *fastReflection_Proposal) NewField(fd protoreflect.FieldDescriptor) prot return protoreflect.ValueOfString("") case "cosmos.gov.v1.Proposal.proposer": return protoreflect.ValueOfString("") + case "cosmos.gov.v1.Proposal.expedited": + return protoreflect.ValueOfBool(false) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Proposal")) @@ -1805,6 +1826,9 @@ func (x *fastReflection_Proposal) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } + if x.Expedited { + n += 2 + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -1834,6 +1858,16 @@ func (x *fastReflection_Proposal) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.Expedited { + i-- + if x.Expedited { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x70 + } if len(x.Proposer) > 0 { i -= len(x.Proposer) copy(dAtA[i:], x.Proposer) @@ -2437,6 +2471,26 @@ func (x *fastReflection_Proposal) ProtoMethods() *protoiface.Methods { } x.Proposer = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 14: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Expedited", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Expedited = bool(v != 0) default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -5361,6 +5415,57 @@ func (x *_Params_1_list) IsValid() bool { return x.list != nil } +var _ protoreflect.List = (*_Params_12_list)(nil) + +type _Params_12_list struct { + list *[]*v1beta1.Coin +} + +func (x *_Params_12_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Params_12_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_Params_12_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + (*x.list)[i] = concreteValue +} + +func (x *_Params_12_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + *x.list = append(*x.list, concreteValue) +} + +func (x *_Params_12_list) AppendMutable() protoreflect.Value { + v := new(v1beta1.Coin) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Params_12_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_Params_12_list) NewElement() protoreflect.Value { + v := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Params_12_list) IsValid() bool { + return x.list != nil +} + var ( md_Params protoreflect.MessageDescriptor fd_Params_min_deposit protoreflect.FieldDescriptor @@ -5370,6 +5475,9 @@ var ( fd_Params_threshold protoreflect.FieldDescriptor fd_Params_veto_threshold protoreflect.FieldDescriptor fd_Params_min_initial_deposit_ratio protoreflect.FieldDescriptor + fd_Params_expedited_voting_period protoreflect.FieldDescriptor + fd_Params_expedited_threshold protoreflect.FieldDescriptor + fd_Params_expedited_min_deposit protoreflect.FieldDescriptor fd_Params_burn_vote_quorum protoreflect.FieldDescriptor fd_Params_burn_proposal_deposit_prevote protoreflect.FieldDescriptor fd_Params_burn_vote_veto protoreflect.FieldDescriptor @@ -5386,6 +5494,9 @@ func init() { fd_Params_threshold = md_Params.Fields().ByName("threshold") fd_Params_veto_threshold = md_Params.Fields().ByName("veto_threshold") fd_Params_min_initial_deposit_ratio = md_Params.Fields().ByName("min_initial_deposit_ratio") + fd_Params_expedited_voting_period = md_Params.Fields().ByName("expedited_voting_period") + fd_Params_expedited_threshold = md_Params.Fields().ByName("expedited_threshold") + fd_Params_expedited_min_deposit = md_Params.Fields().ByName("expedited_min_deposit") fd_Params_burn_vote_quorum = md_Params.Fields().ByName("burn_vote_quorum") fd_Params_burn_proposal_deposit_prevote = md_Params.Fields().ByName("burn_proposal_deposit_prevote") fd_Params_burn_vote_veto = md_Params.Fields().ByName("burn_vote_veto") @@ -5499,6 +5610,24 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto return } } + if x.ExpeditedVotingPeriod != nil { + value := protoreflect.ValueOfMessage(x.ExpeditedVotingPeriod.ProtoReflect()) + if !f(fd_Params_expedited_voting_period, value) { + return + } + } + if x.ExpeditedThreshold != "" { + value := protoreflect.ValueOfString(x.ExpeditedThreshold) + if !f(fd_Params_expedited_threshold, value) { + return + } + } + if len(x.ExpeditedMinDeposit) != 0 { + value := protoreflect.ValueOfList(&_Params_12_list{list: &x.ExpeditedMinDeposit}) + if !f(fd_Params_expedited_min_deposit, value) { + return + } + } if x.BurnVoteQuorum != false { value := protoreflect.ValueOfBool(x.BurnVoteQuorum) if !f(fd_Params_burn_vote_quorum, value) { @@ -5552,6 +5681,12 @@ func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { return x.VetoThreshold != "" case "cosmos.gov.v1.Params.min_initial_deposit_ratio": return x.MinInitialDepositRatio != "" + case "cosmos.gov.v1.Params.expedited_voting_period": + return x.ExpeditedVotingPeriod != nil + case "cosmos.gov.v1.Params.expedited_threshold": + return x.ExpeditedThreshold != "" + case "cosmos.gov.v1.Params.expedited_min_deposit": + return len(x.ExpeditedMinDeposit) != 0 case "cosmos.gov.v1.Params.burn_vote_quorum": return x.BurnVoteQuorum != false case "cosmos.gov.v1.Params.burn_proposal_deposit_prevote": @@ -5590,6 +5725,12 @@ func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { x.VetoThreshold = "" case "cosmos.gov.v1.Params.min_initial_deposit_ratio": x.MinInitialDepositRatio = "" + case "cosmos.gov.v1.Params.expedited_voting_period": + x.ExpeditedVotingPeriod = nil + case "cosmos.gov.v1.Params.expedited_threshold": + x.ExpeditedThreshold = "" + case "cosmos.gov.v1.Params.expedited_min_deposit": + x.ExpeditedMinDeposit = nil case "cosmos.gov.v1.Params.burn_vote_quorum": x.BurnVoteQuorum = false case "cosmos.gov.v1.Params.burn_proposal_deposit_prevote": @@ -5638,6 +5779,18 @@ func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) pro case "cosmos.gov.v1.Params.min_initial_deposit_ratio": value := x.MinInitialDepositRatio return protoreflect.ValueOfString(value) + case "cosmos.gov.v1.Params.expedited_voting_period": + value := x.ExpeditedVotingPeriod + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.gov.v1.Params.expedited_threshold": + value := x.ExpeditedThreshold + return protoreflect.ValueOfString(value) + case "cosmos.gov.v1.Params.expedited_min_deposit": + if len(x.ExpeditedMinDeposit) == 0 { + return protoreflect.ValueOfList(&_Params_12_list{}) + } + listValue := &_Params_12_list{list: &x.ExpeditedMinDeposit} + return protoreflect.ValueOfList(listValue) case "cosmos.gov.v1.Params.burn_vote_quorum": value := x.BurnVoteQuorum return protoreflect.ValueOfBool(value) @@ -5686,6 +5839,14 @@ func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value proto x.VetoThreshold = value.Interface().(string) case "cosmos.gov.v1.Params.min_initial_deposit_ratio": x.MinInitialDepositRatio = value.Interface().(string) + case "cosmos.gov.v1.Params.expedited_voting_period": + x.ExpeditedVotingPeriod = value.Message().Interface().(*durationpb.Duration) + case "cosmos.gov.v1.Params.expedited_threshold": + x.ExpeditedThreshold = value.Interface().(string) + case "cosmos.gov.v1.Params.expedited_min_deposit": + lv := value.List() + clv := lv.(*_Params_12_list) + x.ExpeditedMinDeposit = *clv.list case "cosmos.gov.v1.Params.burn_vote_quorum": x.BurnVoteQuorum = value.Bool() case "cosmos.gov.v1.Params.burn_proposal_deposit_prevote": @@ -5730,6 +5891,17 @@ func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protore x.VotingPeriod = new(durationpb.Duration) } return protoreflect.ValueOfMessage(x.VotingPeriod.ProtoReflect()) + case "cosmos.gov.v1.Params.expedited_voting_period": + if x.ExpeditedVotingPeriod == nil { + x.ExpeditedVotingPeriod = new(durationpb.Duration) + } + return protoreflect.ValueOfMessage(x.ExpeditedVotingPeriod.ProtoReflect()) + case "cosmos.gov.v1.Params.expedited_min_deposit": + if x.ExpeditedMinDeposit == nil { + x.ExpeditedMinDeposit = []*v1beta1.Coin{} + } + value := &_Params_12_list{list: &x.ExpeditedMinDeposit} + return protoreflect.ValueOfList(value) case "cosmos.gov.v1.Params.quorum": panic(fmt.Errorf("field quorum of message cosmos.gov.v1.Params is not mutable")) case "cosmos.gov.v1.Params.threshold": @@ -5738,6 +5910,8 @@ func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protore panic(fmt.Errorf("field veto_threshold of message cosmos.gov.v1.Params is not mutable")) case "cosmos.gov.v1.Params.min_initial_deposit_ratio": panic(fmt.Errorf("field min_initial_deposit_ratio of message cosmos.gov.v1.Params is not mutable")) + case "cosmos.gov.v1.Params.expedited_threshold": + panic(fmt.Errorf("field expedited_threshold of message cosmos.gov.v1.Params is not mutable")) case "cosmos.gov.v1.Params.burn_vote_quorum": panic(fmt.Errorf("field burn_vote_quorum of message cosmos.gov.v1.Params is not mutable")) case "cosmos.gov.v1.Params.burn_proposal_deposit_prevote": @@ -5776,6 +5950,14 @@ func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protor return protoreflect.ValueOfString("") case "cosmos.gov.v1.Params.min_initial_deposit_ratio": return protoreflect.ValueOfString("") + case "cosmos.gov.v1.Params.expedited_voting_period": + m := new(durationpb.Duration) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.gov.v1.Params.expedited_threshold": + return protoreflect.ValueOfString("") + case "cosmos.gov.v1.Params.expedited_min_deposit": + list := []*v1beta1.Coin{} + return protoreflect.ValueOfList(&_Params_12_list{list: &list}) case "cosmos.gov.v1.Params.burn_vote_quorum": return protoreflect.ValueOfBool(false) case "cosmos.gov.v1.Params.burn_proposal_deposit_prevote": @@ -5883,6 +6065,20 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } + if x.ExpeditedVotingPeriod != nil { + l = options.Size(x.ExpeditedVotingPeriod) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.ExpeditedThreshold) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.ExpeditedMinDeposit) > 0 { + for _, e := range x.ExpeditedMinDeposit { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } if x.BurnVoteQuorum { n += 2 } @@ -5964,6 +6160,43 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x68 } + if len(x.ExpeditedMinDeposit) > 0 { + for iNdEx := len(x.ExpeditedMinDeposit) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.ExpeditedMinDeposit[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x62 + } + } + if len(x.ExpeditedThreshold) > 0 { + i -= len(x.ExpeditedThreshold) + copy(dAtA[i:], x.ExpeditedThreshold) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ExpeditedThreshold))) + i-- + dAtA[i] = 0x5a + } + if x.ExpeditedVotingPeriod != nil { + encoded, err := options.Marshal(x.ExpeditedVotingPeriod) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x52 + } if len(x.MinInitialDepositRatio) > 0 { i -= len(x.MinInitialDepositRatio) copy(dAtA[i:], x.MinInitialDepositRatio) @@ -6319,6 +6552,108 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { } x.MinInitialDepositRatio = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 10: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ExpeditedVotingPeriod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.ExpeditedVotingPeriod == nil { + x.ExpeditedVotingPeriod = &durationpb.Duration{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ExpeditedVotingPeriod); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ExpeditedThreshold", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.ExpeditedThreshold = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 12: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ExpeditedMinDeposit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.ExpeditedMinDeposit = append(x.ExpeditedMinDeposit, &v1beta1.Coin{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ExpeditedMinDeposit[len(x.ExpeditedMinDeposit)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex case 13: if wireType != 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BurnVoteQuorum", wireType) @@ -6730,10 +7065,14 @@ type Proposal struct { // // Since: cosmos-sdk 0.47 Summary string `protobuf:"bytes,12,opt,name=summary,proto3" json:"summary,omitempty"` - // Proposer is the address of the proposal sumbitter + // proposer is the address of the proposal sumbitter // // Since: cosmos-sdk 0.47 Proposer string `protobuf:"bytes,13,opt,name=proposer,proto3" json:"proposer,omitempty"` + // expedited defines if the proposal is expedited + // + // NOTE: backported from v50 (https://github.com/cosmos/cosmos-sdk/pull/14720) + Expedited bool `protobuf:"varint,14,opt,name=expedited,proto3" json:"expedited,omitempty"` } func (x *Proposal) Reset() { @@ -6847,6 +7186,13 @@ func (x *Proposal) GetProposer() string { return "" } +func (x *Proposal) GetExpedited() bool { + if x != nil { + return x.Expedited + } + return false +} + // TallyResult defines a standard tally for a governance proposal. type TallyResult struct { state protoimpl.MessageState @@ -7142,6 +7488,18 @@ type Params struct { 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"` + // Duration of the voting period of an expedited proposal. + // + // NOTE: backported from v50 (https://github.com/cosmos/cosmos-sdk/pull/14720) + ExpeditedVotingPeriod *durationpb.Duration `protobuf:"bytes,10,opt,name=expedited_voting_period,json=expeditedVotingPeriod,proto3" json:"expedited_voting_period,omitempty"` + // Minimum proportion of Yes votes for proposal to pass. Default value: 0.67. + // + // NOTE: backported from v50 (https://github.com/cosmos/cosmos-sdk/pull/14720) + ExpeditedThreshold string `protobuf:"bytes,11,opt,name=expedited_threshold,json=expeditedThreshold,proto3" json:"expedited_threshold,omitempty"` + // Minimum expedited deposit for a proposal to enter voting period. + // + // NOTE: backported from v50 (https://github.com/cosmos/cosmos-sdk/pull/14720) + ExpeditedMinDeposit []*v1beta1.Coin `protobuf:"bytes,12,rep,name=expedited_min_deposit,json=expeditedMinDeposit,proto3" json:"expedited_min_deposit,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 @@ -7226,6 +7584,27 @@ func (x *Params) GetMinInitialDepositRatio() string { return "" } +func (x *Params) GetExpeditedVotingPeriod() *durationpb.Duration { + if x != nil { + return x.ExpeditedVotingPeriod + } + return nil +} + +func (x *Params) GetExpeditedThreshold() string { + if x != nil { + return x.ExpeditedThreshold + } + return "" +} + +func (x *Params) GetExpeditedMinDeposit() []*v1beta1.Coin { + if x != nil { + return x.ExpeditedMinDeposit + } + return nil +} + func (x *Params) GetBurnVoteQuorum() bool { if x != nil { return x.BurnVoteQuorum @@ -7288,7 +7667,7 @@ var file_cosmos_gov_v1_gov_proto_rawDesc = []byte{ 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, - 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xc1, 0x05, 0x0a, + 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xdf, 0x05, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x30, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, @@ -7333,134 +7712,151 @@ var file_cosmos_gov_v1_gov_proto_rawDesc = []byte{ 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, - 0x22, 0xd7, 0x01, 0x0a, 0x0b, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, - 0x12, 0x2b, 0x0a, 0x09, 0x79, 0x65, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x49, 0x6e, 0x74, 0x52, 0x08, 0x79, 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x33, 0x0a, - 0x0d, 0x61, 0x62, 0x73, 0x74, 0x61, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x0c, 0x61, 0x62, 0x73, 0x74, 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x75, - 0x6e, 0x74, 0x12, 0x29, 0x0a, 0x08, 0x6e, 0x6f, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x07, 0x6e, 0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x3b, 0x0a, - 0x12, 0x6e, 0x6f, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x76, 0x65, 0x74, 0x6f, 0x5f, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x0f, 0x6e, 0x6f, 0x57, 0x69, 0x74, - 0x68, 0x56, 0x65, 0x74, 0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xb6, 0x01, 0x0a, 0x04, 0x56, - 0x6f, 0x74, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, - 0x61, 0x6c, 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x05, 0x76, - 0x6f, 0x74, 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, - 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, - 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x56, 0x6f, - 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x4a, 0x04, 0x08, - 0x03, 0x10, 0x04, 0x22, 0xd9, 0x01, 0x0a, 0x0d, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x59, 0x0a, 0x0b, 0x6d, 0x69, 0x6e, 0x5f, 0x64, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x1d, 0xc8, 0xde, 0x1f, 0x00, 0xea, 0xde, 0x1f, 0x15, 0x6d, - 0x69, 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, - 0x6d, 0x70, 0x74, 0x79, 0x52, 0x0a, 0x6d, 0x69, 0x6e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x12, 0x6d, 0x0a, 0x12, 0x6d, 0x61, 0x78, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, - 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, - 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x24, 0xea, 0xde, 0x1f, 0x1c, 0x6d, 0x61, 0x78, - 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x2c, - 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x10, 0x6d, - 0x61, 0x78, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x22, - 0x54, 0x0a, 0x0c, 0x56, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, - 0x44, 0x0a, 0x0d, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x42, 0x04, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x0c, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x50, - 0x65, 0x72, 0x69, 0x6f, 0x64, 0x22, 0x9a, 0x01, 0x0a, 0x0b, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x26, 0x0a, 0x06, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x06, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x12, 0x2c, 0x0a, - 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, - 0x52, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x35, 0x0a, 0x0e, 0x76, - 0x65, 0x74, 0x6f, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x03, 0x20, + 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x18, 0x0e, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x09, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x22, 0xd7, + 0x01, 0x0a, 0x0b, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x2b, + 0x0a, 0x09, 0x79, 0x65, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, + 0x74, 0x52, 0x08, 0x79, 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x33, 0x0a, 0x0d, 0x61, + 0x62, 0x73, 0x74, 0x61, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, + 0x6e, 0x74, 0x52, 0x0c, 0x61, 0x62, 0x73, 0x74, 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x29, 0x0a, 0x08, 0x6e, 0x6f, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, + 0x6e, 0x74, 0x52, 0x07, 0x6e, 0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x3b, 0x0a, 0x12, 0x6e, + 0x6f, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x76, 0x65, 0x74, 0x6f, 0x5f, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x0f, 0x6e, 0x6f, 0x57, 0x69, 0x74, 0x68, 0x56, + 0x65, 0x74, 0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xb6, 0x01, 0x0a, 0x04, 0x56, 0x6f, 0x74, + 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, + 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x05, 0x76, 0x6f, 0x74, + 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, + 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x56, 0x6f, 0x74, 0x65, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, + 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x4a, 0x04, 0x08, 0x03, 0x10, + 0x04, 0x22, 0xd9, 0x01, 0x0a, 0x0d, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x12, 0x59, 0x0a, 0x0b, 0x6d, 0x69, 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, + 0x6f, 0x69, 0x6e, 0x42, 0x1d, 0xc8, 0xde, 0x1f, 0x00, 0xea, 0xde, 0x1f, 0x15, 0x6d, 0x69, 0x6e, + 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, + 0x74, 0x79, 0x52, 0x0a, 0x6d, 0x69, 0x6e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x6d, + 0x0a, 0x12, 0x6d, 0x61, 0x78, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x70, 0x65, + 0x72, 0x69, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x24, 0xea, 0xde, 0x1f, 0x1c, 0x6d, 0x61, 0x78, 0x5f, 0x64, + 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x2c, 0x6f, 0x6d, + 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x10, 0x6d, 0x61, 0x78, + 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x22, 0x54, 0x0a, + 0x0c, 0x56, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x44, 0x0a, + 0x0d, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, + 0x04, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x0c, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x65, 0x72, + 0x69, 0x6f, 0x64, 0x22, 0x9a, 0x01, 0x0a, 0x0b, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x12, 0x26, 0x0a, 0x06, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x44, 0x65, 0x63, 0x52, 0x0d, 0x76, 0x65, 0x74, 0x6f, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, - 0x6c, 0x64, 0x22, 0x8b, 0x05, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x45, 0x0a, - 0x0b, 0x6d, 0x69, 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x09, 0xc8, - 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x6d, 0x69, 0x6e, 0x44, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x12, 0x4d, 0x0a, 0x12, 0x6d, 0x61, 0x78, 0x5f, 0x64, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x44, 0x65, 0x63, 0x52, 0x06, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x12, 0x2c, 0x0a, 0x09, 0x74, + 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, + 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x09, + 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x35, 0x0a, 0x0e, 0x76, 0x65, 0x74, + 0x6f, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, + 0x63, 0x52, 0x0d, 0x76, 0x65, 0x74, 0x6f, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, + 0x22, 0xff, 0x06, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x45, 0x0a, 0x0b, 0x6d, + 0x69, 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, + 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x6d, 0x69, 0x6e, 0x44, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x12, 0x4d, 0x0a, 0x12, 0x6d, 0x61, 0x78, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0x98, 0xdf, 0x1f, 0x01, 0x52, + 0x10, 0x6d, 0x61, 0x78, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, 0x65, 0x72, 0x69, 0x6f, + 0x64, 0x12, 0x44, 0x0a, 0x0d, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, 0x72, 0x69, + 0x6f, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x42, 0x04, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x0c, 0x76, 0x6f, 0x74, 0x69, 0x6e, + 0x67, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x26, 0x0a, 0x06, 0x71, 0x75, 0x6f, 0x72, 0x75, + 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x06, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x12, + 0x2c, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, + 0x65, 0x63, 0x52, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x35, 0x0a, + 0x0e, 0x76, 0x65, 0x74, 0x6f, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0d, 0x76, 0x65, 0x74, 0x6f, 0x54, 0x68, 0x72, 0x65, 0x73, + 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x49, 0x0a, 0x19, 0x6d, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x69, 0x74, + 0x69, 0x61, 0x6c, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x16, 0x6d, 0x69, 0x6e, 0x49, 0x6e, 0x69, 0x74, + 0x69, 0x61, 0x6c, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x12, + 0x57, 0x0a, 0x17, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x5f, 0x76, 0x6f, 0x74, + 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0x98, 0xdf, 0x1f, - 0x01, 0x52, 0x10, 0x6d, 0x61, 0x78, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, 0x65, 0x72, - 0x69, 0x6f, 0x64, 0x12, 0x44, 0x0a, 0x0d, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, - 0x72, 0x69, 0x6f, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x0c, 0x76, 0x6f, 0x74, - 0x69, 0x6e, 0x67, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x26, 0x0a, 0x06, 0x71, 0x75, 0x6f, - 0x72, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x06, 0x71, 0x75, 0x6f, 0x72, 0x75, - 0x6d, 0x12, 0x2c, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x44, 0x65, 0x63, 0x52, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, - 0x35, 0x0a, 0x0e, 0x76, 0x65, 0x74, 0x6f, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, - 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0d, 0x76, 0x65, 0x74, 0x6f, 0x54, 0x68, 0x72, - 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x49, 0x0a, 0x19, 0x6d, 0x69, 0x6e, 0x5f, 0x69, 0x6e, - 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x16, 0x6d, 0x69, 0x6e, 0x49, 0x6e, - 0x69, 0x74, 0x69, 0x61, 0x6c, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x61, 0x74, 0x69, - 0x6f, 0x12, 0x28, 0x0a, 0x10, 0x62, 0x75, 0x72, 0x6e, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x5f, 0x71, - 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x62, 0x75, 0x72, - 0x6e, 0x56, 0x6f, 0x74, 0x65, 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x12, 0x41, 0x0a, 0x1d, 0x62, - 0x75, 0x72, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x64, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x70, 0x72, 0x65, 0x76, 0x6f, 0x74, 0x65, 0x18, 0x0e, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x1a, 0x62, 0x75, 0x72, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, - 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, 0x72, 0x65, 0x76, 0x6f, 0x74, 0x65, 0x12, 0x24, - 0x0a, 0x0e, 0x62, 0x75, 0x72, 0x6e, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x5f, 0x76, 0x65, 0x74, 0x6f, - 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x62, 0x75, 0x72, 0x6e, 0x56, 0x6f, 0x74, 0x65, - 0x56, 0x65, 0x74, 0x6f, 0x12, 0x3a, 0x0a, 0x11, 0x6d, 0x69, 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x5f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, - 0x0f, 0x6d, 0x69, 0x6e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x61, 0x74, 0x69, 0x6f, - 0x2a, 0x89, 0x01, 0x0a, 0x0a, 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x1b, 0x0a, 0x17, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, - 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, - 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x59, 0x45, 0x53, 0x10, - 0x01, 0x12, 0x17, 0x0a, 0x13, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, - 0x5f, 0x41, 0x42, 0x53, 0x54, 0x41, 0x49, 0x4e, 0x10, 0x02, 0x12, 0x12, 0x0a, 0x0e, 0x56, 0x4f, - 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4e, 0x4f, 0x10, 0x03, 0x12, 0x1c, - 0x0a, 0x18, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4e, 0x4f, - 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, 0x56, 0x45, 0x54, 0x4f, 0x10, 0x04, 0x2a, 0xce, 0x01, 0x0a, - 0x0e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, - 0x1f, 0x0a, 0x1b, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, - 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, - 0x12, 0x22, 0x0a, 0x1e, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, - 0x54, 0x55, 0x53, 0x5f, 0x44, 0x45, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x5f, 0x50, 0x45, 0x52, 0x49, - 0x4f, 0x44, 0x10, 0x01, 0x12, 0x21, 0x0a, 0x1d, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, - 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x56, 0x4f, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x50, - 0x45, 0x52, 0x49, 0x4f, 0x44, 0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x50, 0x52, 0x4f, 0x50, 0x4f, - 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x50, 0x41, 0x53, 0x53, 0x45, - 0x44, 0x10, 0x03, 0x12, 0x1c, 0x0a, 0x18, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, - 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52, 0x45, 0x4a, 0x45, 0x43, 0x54, 0x45, 0x44, 0x10, - 0x04, 0x12, 0x1a, 0x0a, 0x16, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, - 0x41, 0x54, 0x55, 0x53, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x05, 0x42, 0x99, 0x01, - 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, - 0x2e, 0x76, 0x31, 0x42, 0x08, 0x47, 0x6f, 0x76, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, - 0x24, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x3b, - 0x67, 0x6f, 0x76, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x47, 0x58, 0xaa, 0x02, 0x0d, 0x43, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x47, 0x6f, 0x76, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x43, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x43, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x3a, 0x3a, 0x47, 0x6f, 0x76, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x01, 0x52, 0x15, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x56, 0x6f, 0x74, 0x69, + 0x6e, 0x67, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x3f, 0x0a, 0x13, 0x65, 0x78, 0x70, 0x65, + 0x64, 0x69, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, + 0x0b, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x12, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, + 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x58, 0x0a, 0x15, 0x65, 0x78, 0x70, + 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x5f, 0x6d, 0x69, 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, + 0x6f, 0x69, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x13, + 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x4d, 0x69, 0x6e, 0x44, 0x65, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x12, 0x28, 0x0a, 0x10, 0x62, 0x75, 0x72, 0x6e, 0x5f, 0x76, 0x6f, 0x74, 0x65, + 0x5f, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x62, + 0x75, 0x72, 0x6e, 0x56, 0x6f, 0x74, 0x65, 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x12, 0x41, 0x0a, + 0x1d, 0x62, 0x75, 0x72, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x64, + 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x70, 0x72, 0x65, 0x76, 0x6f, 0x74, 0x65, 0x18, 0x0e, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x1a, 0x62, 0x75, 0x72, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x61, 0x6c, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, 0x72, 0x65, 0x76, 0x6f, 0x74, 0x65, + 0x12, 0x24, 0x0a, 0x0e, 0x62, 0x75, 0x72, 0x6e, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x5f, 0x76, 0x65, + 0x74, 0x6f, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x62, 0x75, 0x72, 0x6e, 0x56, 0x6f, + 0x74, 0x65, 0x56, 0x65, 0x74, 0x6f, 0x12, 0x3a, 0x0a, 0x11, 0x6d, 0x69, 0x6e, 0x5f, 0x64, 0x65, + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x18, 0x10, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, + 0x63, 0x52, 0x0f, 0x6d, 0x69, 0x6e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x61, 0x74, + 0x69, 0x6f, 0x2a, 0x89, 0x01, 0x0a, 0x0a, 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x1b, 0x0a, 0x17, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, + 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x13, + 0x0a, 0x0f, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x59, 0x45, + 0x53, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, + 0x4f, 0x4e, 0x5f, 0x41, 0x42, 0x53, 0x54, 0x41, 0x49, 0x4e, 0x10, 0x02, 0x12, 0x12, 0x0a, 0x0e, + 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4e, 0x4f, 0x10, 0x03, + 0x12, 0x1c, 0x0a, 0x18, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, + 0x4e, 0x4f, 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, 0x56, 0x45, 0x54, 0x4f, 0x10, 0x04, 0x2a, 0xce, + 0x01, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x1f, 0x0a, 0x1b, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, + 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, + 0x10, 0x00, 0x12, 0x22, 0x0a, 0x1e, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, + 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x44, 0x45, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x5f, 0x50, 0x45, + 0x52, 0x49, 0x4f, 0x44, 0x10, 0x01, 0x12, 0x21, 0x0a, 0x1d, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, + 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x56, 0x4f, 0x54, 0x49, 0x4e, 0x47, + 0x5f, 0x50, 0x45, 0x52, 0x49, 0x4f, 0x44, 0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x50, 0x52, 0x4f, + 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x50, 0x41, 0x53, + 0x53, 0x45, 0x44, 0x10, 0x03, 0x12, 0x1c, 0x0a, 0x18, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, + 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52, 0x45, 0x4a, 0x45, 0x43, 0x54, 0x45, + 0x44, 0x10, 0x04, 0x12, 0x1a, 0x0a, 0x16, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, + 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x05, 0x42, + 0x99, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, + 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x42, 0x08, 0x47, 0x6f, 0x76, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x24, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, + 0x31, 0x3b, 0x67, 0x6f, 0x76, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x47, 0x58, 0xaa, 0x02, 0x0d, + 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x47, 0x6f, 0x76, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, + 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, + 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x43, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x3a, 0x3a, 0x47, 0x6f, 0x76, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( @@ -7512,11 +7908,13 @@ var file_cosmos_gov_v1_gov_proto_depIdxs = []int32{ 11, // 14: cosmos.gov.v1.Params.min_deposit:type_name -> cosmos.base.v1beta1.Coin 14, // 15: cosmos.gov.v1.Params.max_deposit_period:type_name -> google.protobuf.Duration 14, // 16: cosmos.gov.v1.Params.voting_period:type_name -> google.protobuf.Duration - 17, // [17:17] is the sub-list for method output_type - 17, // [17:17] is the sub-list for method input_type - 17, // [17:17] is the sub-list for extension type_name - 17, // [17:17] is the sub-list for extension extendee - 0, // [0:17] is the sub-list for field type_name + 14, // 17: cosmos.gov.v1.Params.expedited_voting_period:type_name -> google.protobuf.Duration + 11, // 18: cosmos.gov.v1.Params.expedited_min_deposit:type_name -> cosmos.base.v1beta1.Coin + 19, // [19:19] is the sub-list for method output_type + 19, // [19:19] is the sub-list for method input_type + 19, // [19:19] is the sub-list for extension type_name + 19, // [19:19] is the sub-list for extension extendee + 0, // [0:19] is the sub-list for field type_name } func init() { file_cosmos_gov_v1_gov_proto_init() } diff --git a/api/cosmos/gov/v1/query_grpc.pb.go b/api/cosmos/gov/v1/query_grpc.pb.go index ed21401b1539..18637a10906f 100644 --- a/api/cosmos/gov/v1/query_grpc.pb.go +++ b/api/cosmos/gov/v1/query_grpc.pb.go @@ -2,7 +2,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.4.0 // - protoc (unknown) // source: cosmos/gov/v1/query.proto @@ -17,8 +17,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.62.0 or later. +const _ = grpc.SupportPackageIsVersion8 const ( Query_Proposal_FullMethodName = "/cosmos.gov.v1.Query/Proposal" @@ -34,6 +34,8 @@ const ( // QueryClient is the client API for Query service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Query defines the gRPC querier service for gov module type QueryClient interface { // Proposal queries proposal details based on ProposalID. Proposal(ctx context.Context, in *QueryProposalRequest, opts ...grpc.CallOption) (*QueryProposalResponse, error) @@ -62,8 +64,9 @@ func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { } func (c *queryClient) Proposal(ctx context.Context, in *QueryProposalRequest, opts ...grpc.CallOption) (*QueryProposalResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryProposalResponse) - err := c.cc.Invoke(ctx, Query_Proposal_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Proposal_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -71,8 +74,9 @@ func (c *queryClient) Proposal(ctx context.Context, in *QueryProposalRequest, op } func (c *queryClient) Proposals(ctx context.Context, in *QueryProposalsRequest, opts ...grpc.CallOption) (*QueryProposalsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryProposalsResponse) - err := c.cc.Invoke(ctx, Query_Proposals_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Proposals_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -80,8 +84,9 @@ func (c *queryClient) Proposals(ctx context.Context, in *QueryProposalsRequest, } func (c *queryClient) Vote(ctx context.Context, in *QueryVoteRequest, opts ...grpc.CallOption) (*QueryVoteResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryVoteResponse) - err := c.cc.Invoke(ctx, Query_Vote_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Vote_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -89,8 +94,9 @@ func (c *queryClient) Vote(ctx context.Context, in *QueryVoteRequest, opts ...gr } func (c *queryClient) Votes(ctx context.Context, in *QueryVotesRequest, opts ...grpc.CallOption) (*QueryVotesResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryVotesResponse) - err := c.cc.Invoke(ctx, Query_Votes_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Votes_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -98,8 +104,9 @@ func (c *queryClient) Votes(ctx context.Context, in *QueryVotesRequest, opts ... } func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -107,8 +114,9 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . } func (c *queryClient) Deposit(ctx context.Context, in *QueryDepositRequest, opts ...grpc.CallOption) (*QueryDepositResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryDepositResponse) - err := c.cc.Invoke(ctx, Query_Deposit_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Deposit_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -116,8 +124,9 @@ func (c *queryClient) Deposit(ctx context.Context, in *QueryDepositRequest, opts } func (c *queryClient) Deposits(ctx context.Context, in *QueryDepositsRequest, opts ...grpc.CallOption) (*QueryDepositsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryDepositsResponse) - err := c.cc.Invoke(ctx, Query_Deposits_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Deposits_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -125,8 +134,9 @@ func (c *queryClient) Deposits(ctx context.Context, in *QueryDepositsRequest, op } func (c *queryClient) TallyResult(ctx context.Context, in *QueryTallyResultRequest, opts ...grpc.CallOption) (*QueryTallyResultResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryTallyResultResponse) - err := c.cc.Invoke(ctx, Query_TallyResult_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_TallyResult_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -136,6 +146,8 @@ func (c *queryClient) TallyResult(ctx context.Context, in *QueryTallyResultReque // QueryServer is the server API for Query service. // All implementations must embed UnimplementedQueryServer // for forward compatibility +// +// Query defines the gRPC querier service for gov module type QueryServer interface { // Proposal queries proposal details based on ProposalID. Proposal(context.Context, *QueryProposalRequest) (*QueryProposalResponse, error) diff --git a/api/cosmos/gov/v1/tx.pulsar.go b/api/cosmos/gov/v1/tx.pulsar.go index e2062e7017eb..54ede1c8d2a3 100644 --- a/api/cosmos/gov/v1/tx.pulsar.go +++ b/api/cosmos/gov/v1/tx.pulsar.go @@ -128,6 +128,7 @@ var ( fd_MsgSubmitProposal_metadata protoreflect.FieldDescriptor fd_MsgSubmitProposal_title protoreflect.FieldDescriptor fd_MsgSubmitProposal_summary protoreflect.FieldDescriptor + fd_MsgSubmitProposal_expedited protoreflect.FieldDescriptor ) func init() { @@ -139,6 +140,7 @@ func init() { fd_MsgSubmitProposal_metadata = md_MsgSubmitProposal.Fields().ByName("metadata") fd_MsgSubmitProposal_title = md_MsgSubmitProposal.Fields().ByName("title") fd_MsgSubmitProposal_summary = md_MsgSubmitProposal.Fields().ByName("summary") + fd_MsgSubmitProposal_expedited = md_MsgSubmitProposal.Fields().ByName("expedited") } var _ protoreflect.Message = (*fastReflection_MsgSubmitProposal)(nil) @@ -242,6 +244,12 @@ func (x *fastReflection_MsgSubmitProposal) Range(f func(protoreflect.FieldDescri return } } + if x.Expedited != false { + value := protoreflect.ValueOfBool(x.Expedited) + if !f(fd_MsgSubmitProposal_expedited, value) { + return + } + } } // Has reports whether a field is populated. @@ -269,6 +277,8 @@ func (x *fastReflection_MsgSubmitProposal) Has(fd protoreflect.FieldDescriptor) return x.Title != "" case "cosmos.gov.v1.MsgSubmitProposal.summary": return x.Summary != "" + case "cosmos.gov.v1.MsgSubmitProposal.expedited": + return x.Expedited != false default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgSubmitProposal")) @@ -297,6 +307,8 @@ func (x *fastReflection_MsgSubmitProposal) Clear(fd protoreflect.FieldDescriptor x.Title = "" case "cosmos.gov.v1.MsgSubmitProposal.summary": x.Summary = "" + case "cosmos.gov.v1.MsgSubmitProposal.expedited": + x.Expedited = false default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgSubmitProposal")) @@ -337,6 +349,9 @@ func (x *fastReflection_MsgSubmitProposal) Get(descriptor protoreflect.FieldDesc case "cosmos.gov.v1.MsgSubmitProposal.summary": value := x.Summary return protoreflect.ValueOfString(value) + case "cosmos.gov.v1.MsgSubmitProposal.expedited": + value := x.Expedited + return protoreflect.ValueOfBool(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgSubmitProposal")) @@ -373,6 +388,8 @@ func (x *fastReflection_MsgSubmitProposal) Set(fd protoreflect.FieldDescriptor, x.Title = value.Interface().(string) case "cosmos.gov.v1.MsgSubmitProposal.summary": x.Summary = value.Interface().(string) + case "cosmos.gov.v1.MsgSubmitProposal.expedited": + x.Expedited = value.Bool() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgSubmitProposal")) @@ -413,6 +430,8 @@ func (x *fastReflection_MsgSubmitProposal) Mutable(fd protoreflect.FieldDescript panic(fmt.Errorf("field title of message cosmos.gov.v1.MsgSubmitProposal is not mutable")) case "cosmos.gov.v1.MsgSubmitProposal.summary": panic(fmt.Errorf("field summary of message cosmos.gov.v1.MsgSubmitProposal is not mutable")) + case "cosmos.gov.v1.MsgSubmitProposal.expedited": + panic(fmt.Errorf("field expedited of message cosmos.gov.v1.MsgSubmitProposal is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgSubmitProposal")) @@ -440,6 +459,8 @@ func (x *fastReflection_MsgSubmitProposal) NewField(fd protoreflect.FieldDescrip return protoreflect.ValueOfString("") case "cosmos.gov.v1.MsgSubmitProposal.summary": return protoreflect.ValueOfString("") + case "cosmos.gov.v1.MsgSubmitProposal.expedited": + return protoreflect.ValueOfBool(false) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgSubmitProposal")) @@ -537,6 +558,9 @@ func (x *fastReflection_MsgSubmitProposal) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } + if x.Expedited { + n += 2 + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -566,6 +590,16 @@ func (x *fastReflection_MsgSubmitProposal) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.Expedited { + i-- + if x.Expedited { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + } if len(x.Summary) > 0 { i -= len(x.Summary) copy(dAtA[i:], x.Summary) @@ -871,6 +905,26 @@ func (x *fastReflection_MsgSubmitProposal) ProtoMethods() *protoiface.Methods { } x.Summary = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 7: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Expedited", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Expedited = bool(v != 0) default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -5982,6 +6036,10 @@ type MsgSubmitProposal struct { // // Since: cosmos-sdk 0.47 Summary string `protobuf:"bytes,6,opt,name=summary,proto3" json:"summary,omitempty"` + // expedided defines if the proposal is expedited or not + // + // NOTE: backported from v50 (https://github.com/cosmos/cosmos-sdk/pull/14720) + Expedited bool `protobuf:"varint,7,opt,name=expedited,proto3" json:"expedited,omitempty"` } func (x *MsgSubmitProposal) Reset() { @@ -6046,6 +6104,13 @@ func (x *MsgSubmitProposal) GetSummary() string { return "" } +func (x *MsgSubmitProposal) GetExpedited() bool { + if x != nil { + return x.Expedited + } + return false +} + // MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. type MsgSubmitProposalResponse struct { state protoimpl.MessageState @@ -6517,7 +6582,7 @@ var file_cosmos_gov_v1_tx_proto_rawDesc = []byte{ 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x73, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, - 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc9, 0x02, 0x0a, 0x11, 0x4d, 0x73, 0x67, + 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe7, 0x02, 0x0a, 0x11, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x30, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, @@ -6535,133 +6600,135 @@ var file_cosmos_gov_v1_tx_proto_rawDesc = []byte{ 0x61, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, - 0x79, 0x3a, 0x31, 0x82, 0xe7, 0xb0, 0x2a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, - 0x8a, 0xe7, 0xb0, 0x2a, 0x1f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, - 0x76, 0x31, 0x2f, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x70, - 0x6f, 0x73, 0x61, 0x6c, 0x22, 0x3c, 0x0a, 0x19, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, - 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, - 0x49, 0x64, 0x22, 0xbb, 0x01, 0x0a, 0x14, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x4c, 0x65, - 0x67, 0x61, 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x4e, 0x0a, 0x07, 0x63, - 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, - 0x6e, 0x79, 0x42, 0x1e, 0xca, 0xb4, 0x2d, 0x1a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, - 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, - 0x6e, 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x61, - 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, 0x35, 0x82, 0xe7, 0xb0, 0x2a, 0x09, - 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x22, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x76, 0x31, 0x2f, 0x4d, 0x73, 0x67, 0x45, - 0x78, 0x65, 0x63, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, - 0x22, 0x1e, 0x0a, 0x1c, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x4c, 0x65, 0x67, 0x61, 0x63, - 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0xe5, 0x01, 0x0a, 0x07, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x35, 0x0a, 0x0b, - 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x04, 0x42, 0x14, 0xea, 0xde, 0x1f, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, - 0x69, 0x64, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, - 0x6c, 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x05, 0x76, 0x6f, - 0x74, 0x65, 0x72, 0x12, 0x31, 0x0a, 0x06, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, - 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, - 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0x3a, 0x24, 0x82, 0xe7, 0xb0, 0x2a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x8a, 0xe7, - 0xb0, 0x2a, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x76, 0x31, - 0x2f, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x22, 0x11, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x56, - 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xff, 0x01, 0x0a, 0x0f, - 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x12, - 0x35, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x04, 0x42, 0x14, 0xea, 0xde, 0x1f, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, - 0x61, 0x6c, 0x5f, 0x69, 0x64, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, - 0x6f, 0x73, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, - 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, - 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x3a, - 0x2c, 0x82, 0xe7, 0xb0, 0x2a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x8a, 0xe7, 0xb0, 0x2a, 0x1d, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x76, 0x31, 0x2f, 0x4d, 0x73, - 0x67, 0x56, 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x22, 0x19, 0x0a, - 0x17, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xe6, 0x01, 0x0a, 0x0a, 0x4d, 0x73, 0x67, - 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x35, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, - 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x14, 0xea, 0xde, - 0x1f, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0xa8, 0xe7, 0xb0, - 0x2a, 0x01, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x36, - 0x0a, 0x09, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x64, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x12, 0x3c, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, - 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, - 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x2b, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x64, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x8a, 0xe7, 0xb0, 0x2a, 0x18, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, - 0x73, 0x64, 0x6b, 0x2f, 0x76, 0x31, 0x2f, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x22, 0x14, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xbb, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, - 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, - 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, - 0x69, 0x74, 0x79, 0x12, 0x38, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, - 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, - 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x36, 0x82, - 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, - 0x2a, 0x23, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x78, 0x2f, 0x67, - 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x32, 0x8a, 0x04, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x5c, 0x0a, 0x0e, 0x53, 0x75, 0x62, 0x6d, - 0x69, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x20, 0x2e, 0x63, 0x6f, 0x73, + 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x3a, + 0x31, 0x82, 0xe7, 0xb0, 0x2a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x8a, 0xe7, + 0xb0, 0x2a, 0x1f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x76, 0x31, + 0x2f, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x61, 0x6c, 0x22, 0x3c, 0x0a, 0x19, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, + 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, 0x64, + 0x22, 0xbb, 0x01, 0x0a, 0x14, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x4c, 0x65, 0x67, 0x61, + 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x4e, 0x0a, 0x07, 0x63, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, + 0x42, 0x1e, 0xca, 0xb4, 0x2d, 0x1a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, + 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, 0x35, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, + 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x22, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x76, 0x31, 0x2f, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, + 0x63, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x1e, + 0x0a, 0x1c, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x43, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xe5, + 0x01, 0x0a, 0x07, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x35, 0x0a, 0x0b, 0x70, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, + 0x14, 0xea, 0xde, 0x1f, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, + 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, + 0x64, 0x12, 0x2e, 0x0a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x05, 0x76, 0x6f, 0x74, 0x65, + 0x72, 0x12, 0x31, 0x0a, 0x06, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, + 0x31, 0x2e, 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x6f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x3a, 0x24, 0x82, 0xe7, 0xb0, 0x2a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x8a, 0xe7, 0xb0, 0x2a, + 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x76, 0x31, 0x2f, 0x4d, + 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x22, 0x11, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xff, 0x01, 0x0a, 0x0f, 0x4d, 0x73, + 0x67, 0x56, 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x12, 0x35, 0x0a, + 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x04, 0x42, 0x14, 0xea, 0xde, 0x1f, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, + 0x5f, 0x69, 0x64, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x61, 0x6c, 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x05, 0x76, + 0x6f, 0x74, 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, + 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x56, 0x6f, + 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x2c, 0x82, + 0xe7, 0xb0, 0x2a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x8a, 0xe7, 0xb0, 0x2a, 0x1d, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x76, 0x31, 0x2f, 0x4d, 0x73, 0x67, 0x56, + 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x22, 0x19, 0x0a, 0x17, 0x4d, + 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xe6, 0x01, 0x0a, 0x0a, 0x4d, 0x73, 0x67, 0x44, 0x65, + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x35, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, + 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x14, 0xea, 0xde, 0x1f, 0x0b, + 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, + 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x36, 0x0a, 0x09, + 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x64, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x6f, 0x72, 0x12, 0x3c, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, + 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, + 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x3a, 0x2b, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, + 0x6f, 0x72, 0x8a, 0xe7, 0xb0, 0x2a, 0x18, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, + 0x6b, 0x2f, 0x76, 0x31, 0x2f, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x22, + 0x14, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xbb, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, + 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, + 0x79, 0x12, 0x38, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, + 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, + 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x36, 0x82, 0xe7, 0xb0, + 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x23, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x78, 0x2f, 0x67, 0x6f, 0x76, + 0x2f, 0x76, 0x31, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x8a, + 0x04, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x5c, 0x0a, 0x0e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, + 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x20, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, + 0x69, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x1a, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x75, - 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x1a, 0x28, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, - 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x65, 0x0a, 0x11, 0x45, 0x78, 0x65, 0x63, 0x4c, 0x65, - 0x67, 0x61, 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x23, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, - 0x78, 0x65, 0x63, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, - 0x1a, 0x2b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, - 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x43, 0x6f, - 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, - 0x04, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x16, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, - 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x1a, 0x1e, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, - 0x67, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, - 0x0c, 0x56, 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x12, 0x1e, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, - 0x67, 0x56, 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x1a, 0x26, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, - 0x67, 0x56, 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x07, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x12, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, - 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x1a, 0x21, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x44, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, - 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1e, + 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x65, 0x0a, 0x11, 0x45, 0x78, 0x65, 0x63, 0x4c, 0x65, 0x67, 0x61, + 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, + 0x63, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x1a, 0x2b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, - 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x26, + 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x04, 0x56, + 0x6f, 0x74, 0x65, 0x12, 0x16, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, + 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x1a, 0x1e, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x56, + 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x0c, 0x56, + 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x12, 0x1e, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x56, + 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x1a, 0x26, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x56, + 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x07, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, - 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0x98, 0x01, - 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, - 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x24, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x3b, 0x67, - 0x6f, 0x76, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x47, 0x58, 0xaa, 0x02, 0x0d, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x47, 0x6f, 0x76, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, - 0x3a, 0x47, 0x6f, 0x76, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x67, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x1a, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x70, + 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x0c, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1e, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x26, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0x98, 0x01, 0x0a, 0x11, + 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, + 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x24, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x3b, 0x67, 0x6f, 0x76, + 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x47, 0x58, 0xaa, 0x02, 0x0d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x47, 0x6f, 0x76, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x43, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x47, + 0x6f, 0x76, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/cosmos/gov/v1/tx_grpc.pb.go b/api/cosmos/gov/v1/tx_grpc.pb.go index eb59a3f78fcb..f9c33c45517f 100644 --- a/api/cosmos/gov/v1/tx_grpc.pb.go +++ b/api/cosmos/gov/v1/tx_grpc.pb.go @@ -2,7 +2,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.4.0 // - protoc (unknown) // source: cosmos/gov/v1/tx.proto @@ -17,8 +17,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.62.0 or later. +const _ = grpc.SupportPackageIsVersion8 const ( Msg_SubmitProposal_FullMethodName = "/cosmos.gov.v1.Msg/SubmitProposal" @@ -32,6 +32,8 @@ const ( // MsgClient is the client API for Msg service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Msg defines the gov Msg service. type MsgClient interface { // SubmitProposal defines a method to create new proposal given the messages. SubmitProposal(ctx context.Context, in *MsgSubmitProposal, opts ...grpc.CallOption) (*MsgSubmitProposalResponse, error) @@ -60,8 +62,9 @@ func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { } func (c *msgClient) SubmitProposal(ctx context.Context, in *MsgSubmitProposal, opts ...grpc.CallOption) (*MsgSubmitProposalResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgSubmitProposalResponse) - err := c.cc.Invoke(ctx, Msg_SubmitProposal_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_SubmitProposal_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -69,8 +72,9 @@ func (c *msgClient) SubmitProposal(ctx context.Context, in *MsgSubmitProposal, o } func (c *msgClient) ExecLegacyContent(ctx context.Context, in *MsgExecLegacyContent, opts ...grpc.CallOption) (*MsgExecLegacyContentResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgExecLegacyContentResponse) - err := c.cc.Invoke(ctx, Msg_ExecLegacyContent_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_ExecLegacyContent_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -78,8 +82,9 @@ func (c *msgClient) ExecLegacyContent(ctx context.Context, in *MsgExecLegacyCont } func (c *msgClient) Vote(ctx context.Context, in *MsgVote, opts ...grpc.CallOption) (*MsgVoteResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgVoteResponse) - err := c.cc.Invoke(ctx, Msg_Vote_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_Vote_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -87,8 +92,9 @@ func (c *msgClient) Vote(ctx context.Context, in *MsgVote, opts ...grpc.CallOpti } func (c *msgClient) VoteWeighted(ctx context.Context, in *MsgVoteWeighted, opts ...grpc.CallOption) (*MsgVoteWeightedResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgVoteWeightedResponse) - err := c.cc.Invoke(ctx, Msg_VoteWeighted_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_VoteWeighted_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -96,8 +102,9 @@ func (c *msgClient) VoteWeighted(ctx context.Context, in *MsgVoteWeighted, opts } func (c *msgClient) Deposit(ctx context.Context, in *MsgDeposit, opts ...grpc.CallOption) (*MsgDepositResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgDepositResponse) - err := c.cc.Invoke(ctx, Msg_Deposit_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_Deposit_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -105,8 +112,9 @@ func (c *msgClient) Deposit(ctx context.Context, in *MsgDeposit, opts ...grpc.Ca } func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -116,6 +124,8 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts // MsgServer is the server API for Msg service. // All implementations must embed UnimplementedMsgServer // for forward compatibility +// +// Msg defines the gov Msg service. type MsgServer interface { // SubmitProposal defines a method to create new proposal given the messages. SubmitProposal(context.Context, *MsgSubmitProposal) (*MsgSubmitProposalResponse, error) diff --git a/api/cosmos/gov/v1beta1/gov.pulsar.go b/api/cosmos/gov/v1beta1/gov.pulsar.go index 7a2b662d0195..bf54e0ac2688 100644 --- a/api/cosmos/gov/v1beta1/gov.pulsar.go +++ b/api/cosmos/gov/v1beta1/gov.pulsar.go @@ -6367,19 +6367,19 @@ var file_cosmos_gov_v1beta1_gov_proto_rawDesc = []byte{ 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x05, 0x1a, 0x10, 0x8a, 0x9d, 0x20, 0x0c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x1a, 0x04, 0x88, 0xa3, 0x1e, 0x00, - 0x42, 0xc8, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x08, 0x47, 0x6f, 0x76, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, - 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x67, 0x6f, 0x76, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x47, 0x58, 0xaa, 0x02, 0x12, - 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x47, 0x6f, 0x76, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0xca, 0x02, 0x12, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, - 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1e, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, 0x43, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x3a, 0x3a, 0x47, 0x6f, 0x76, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xc8, - 0xe1, 0x1e, 0x00, 0xd8, 0xe1, 0x1e, 0x00, 0x80, 0xe2, 0x1e, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x42, 0xc8, 0x01, 0xc8, 0xe1, 0x1e, 0x00, 0xd8, 0xe1, 0x1e, 0x00, 0x80, 0xe2, 0x1e, 0x00, 0x0a, + 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x08, 0x47, 0x6f, 0x76, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, + 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x67, 0x6f, 0x76, + 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x67, 0x6f, 0x76, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x47, 0x58, 0xaa, 0x02, 0x12, 0x43, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x47, 0x6f, 0x76, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, + 0x12, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1e, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, + 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x47, + 0x6f, 0x76, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } diff --git a/api/cosmos/gov/v1beta1/query_grpc.pb.go b/api/cosmos/gov/v1beta1/query_grpc.pb.go index 807c4893cf6c..032552cf32e6 100644 --- a/api/cosmos/gov/v1beta1/query_grpc.pb.go +++ b/api/cosmos/gov/v1beta1/query_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.4.0 // - protoc (unknown) // source: cosmos/gov/v1beta1/query.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.62.0 or later. +const _ = grpc.SupportPackageIsVersion8 const ( Query_Proposal_FullMethodName = "/cosmos.gov.v1beta1.Query/Proposal" @@ -32,6 +32,8 @@ const ( // QueryClient is the client API for Query service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Query defines the gRPC querier service for gov module type QueryClient interface { // Proposal queries proposal details based on ProposalID. Proposal(ctx context.Context, in *QueryProposalRequest, opts ...grpc.CallOption) (*QueryProposalResponse, error) @@ -60,8 +62,9 @@ func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { } func (c *queryClient) Proposal(ctx context.Context, in *QueryProposalRequest, opts ...grpc.CallOption) (*QueryProposalResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryProposalResponse) - err := c.cc.Invoke(ctx, Query_Proposal_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Proposal_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -69,8 +72,9 @@ func (c *queryClient) Proposal(ctx context.Context, in *QueryProposalRequest, op } func (c *queryClient) Proposals(ctx context.Context, in *QueryProposalsRequest, opts ...grpc.CallOption) (*QueryProposalsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryProposalsResponse) - err := c.cc.Invoke(ctx, Query_Proposals_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Proposals_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -78,8 +82,9 @@ func (c *queryClient) Proposals(ctx context.Context, in *QueryProposalsRequest, } func (c *queryClient) Vote(ctx context.Context, in *QueryVoteRequest, opts ...grpc.CallOption) (*QueryVoteResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryVoteResponse) - err := c.cc.Invoke(ctx, Query_Vote_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Vote_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -87,8 +92,9 @@ func (c *queryClient) Vote(ctx context.Context, in *QueryVoteRequest, opts ...gr } func (c *queryClient) Votes(ctx context.Context, in *QueryVotesRequest, opts ...grpc.CallOption) (*QueryVotesResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryVotesResponse) - err := c.cc.Invoke(ctx, Query_Votes_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Votes_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -96,8 +102,9 @@ func (c *queryClient) Votes(ctx context.Context, in *QueryVotesRequest, opts ... } func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -105,8 +112,9 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . } func (c *queryClient) Deposit(ctx context.Context, in *QueryDepositRequest, opts ...grpc.CallOption) (*QueryDepositResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryDepositResponse) - err := c.cc.Invoke(ctx, Query_Deposit_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Deposit_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -114,8 +122,9 @@ func (c *queryClient) Deposit(ctx context.Context, in *QueryDepositRequest, opts } func (c *queryClient) Deposits(ctx context.Context, in *QueryDepositsRequest, opts ...grpc.CallOption) (*QueryDepositsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryDepositsResponse) - err := c.cc.Invoke(ctx, Query_Deposits_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_Deposits_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -123,8 +132,9 @@ func (c *queryClient) Deposits(ctx context.Context, in *QueryDepositsRequest, op } func (c *queryClient) TallyResult(ctx context.Context, in *QueryTallyResultRequest, opts ...grpc.CallOption) (*QueryTallyResultResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(QueryTallyResultResponse) - err := c.cc.Invoke(ctx, Query_TallyResult_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Query_TallyResult_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -134,6 +144,8 @@ func (c *queryClient) TallyResult(ctx context.Context, in *QueryTallyResultReque // QueryServer is the server API for Query service. // All implementations must embed UnimplementedQueryServer // for forward compatibility +// +// Query defines the gRPC querier service for gov module type QueryServer interface { // Proposal queries proposal details based on ProposalID. Proposal(context.Context, *QueryProposalRequest) (*QueryProposalResponse, error) diff --git a/api/cosmos/gov/v1beta1/tx_grpc.pb.go b/api/cosmos/gov/v1beta1/tx_grpc.pb.go index 6d389258cad1..587c87d4624e 100644 --- a/api/cosmos/gov/v1beta1/tx_grpc.pb.go +++ b/api/cosmos/gov/v1beta1/tx_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.4.0 // - protoc (unknown) // source: cosmos/gov/v1beta1/tx.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.62.0 or later. +const _ = grpc.SupportPackageIsVersion8 const ( Msg_SubmitProposal_FullMethodName = "/cosmos.gov.v1beta1.Msg/SubmitProposal" @@ -28,6 +28,8 @@ const ( // MsgClient is the client API for Msg service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Msg defines the bank Msg service. type MsgClient interface { // SubmitProposal defines a method to create new proposal given a content. SubmitProposal(ctx context.Context, in *MsgSubmitProposal, opts ...grpc.CallOption) (*MsgSubmitProposalResponse, error) @@ -50,8 +52,9 @@ func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { } func (c *msgClient) SubmitProposal(ctx context.Context, in *MsgSubmitProposal, opts ...grpc.CallOption) (*MsgSubmitProposalResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgSubmitProposalResponse) - err := c.cc.Invoke(ctx, Msg_SubmitProposal_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_SubmitProposal_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -59,8 +62,9 @@ func (c *msgClient) SubmitProposal(ctx context.Context, in *MsgSubmitProposal, o } func (c *msgClient) Vote(ctx context.Context, in *MsgVote, opts ...grpc.CallOption) (*MsgVoteResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgVoteResponse) - err := c.cc.Invoke(ctx, Msg_Vote_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_Vote_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -68,8 +72,9 @@ func (c *msgClient) Vote(ctx context.Context, in *MsgVote, opts ...grpc.CallOpti } func (c *msgClient) VoteWeighted(ctx context.Context, in *MsgVoteWeighted, opts ...grpc.CallOption) (*MsgVoteWeightedResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgVoteWeightedResponse) - err := c.cc.Invoke(ctx, Msg_VoteWeighted_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_VoteWeighted_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -77,8 +82,9 @@ func (c *msgClient) VoteWeighted(ctx context.Context, in *MsgVoteWeighted, opts } func (c *msgClient) Deposit(ctx context.Context, in *MsgDeposit, opts ...grpc.CallOption) (*MsgDepositResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgDepositResponse) - err := c.cc.Invoke(ctx, Msg_Deposit_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, Msg_Deposit_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -88,6 +94,8 @@ func (c *msgClient) Deposit(ctx context.Context, in *MsgDeposit, opts ...grpc.Ca // MsgServer is the server API for Msg service. // All implementations must embed UnimplementedMsgServer // for forward compatibility +// +// Msg defines the bank Msg service. type MsgServer interface { // SubmitProposal defines a method to create new proposal given a content. SubmitProposal(context.Context, *MsgSubmitProposal) (*MsgSubmitProposalResponse, error) diff --git a/proto/cosmos/gov/v1/gov.proto b/proto/cosmos/gov/v1/gov.proto index 0fe1681eb874..10e79ef2726d 100644 --- a/proto/cosmos/gov/v1/gov.proto +++ b/proto/cosmos/gov/v1/gov.proto @@ -92,10 +92,15 @@ message Proposal { // Since: cosmos-sdk 0.47 string summary = 12; - // Proposer is the address of the proposal sumbitter + // proposer is the address of the proposal sumbitter // // Since: cosmos-sdk 0.47 string proposer = 13 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // expedited defines if the proposal is expedited + // + // NOTE: backported from v50 (https://github.com/cosmos/cosmos-sdk/pull/14720) + bool expedited = 14; } // ProposalStatus enumerates the valid statuses of a proposal. @@ -209,6 +214,22 @@ message Params { // 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"]; + // Duration of the voting period of an expedited proposal. + // + // NOTE: backported from v50 (https://github.com/cosmos/cosmos-sdk/pull/14720) + google.protobuf.Duration expedited_voting_period = 10 [(gogoproto.stdduration) = true]; + + // Minimum proportion of Yes votes for proposal to pass. Default value: 0.67. + // + // NOTE: backported from v50 (https://github.com/cosmos/cosmos-sdk/pull/14720) + string expedited_threshold = 11 [(cosmos_proto.scalar) = "cosmos.Dec"]; + + // Minimum expedited deposit for a proposal to enter voting period. + // + // NOTE: backported from v50 (https://github.com/cosmos/cosmos-sdk/pull/14720) + repeated cosmos.base.v1beta1.Coin expedited_min_deposit = 12 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + // burn deposits if a proposal does not meet quorum bool burn_vote_quorum = 13; diff --git a/proto/cosmos/gov/v1/tx.proto b/proto/cosmos/gov/v1/tx.proto index 1708066c6598..ba42d1bd3bdb 100644 --- a/proto/cosmos/gov/v1/tx.proto +++ b/proto/cosmos/gov/v1/tx.proto @@ -66,6 +66,11 @@ message MsgSubmitProposal { // // Since: cosmos-sdk 0.47 string summary = 6; + + // expedided defines if the proposal is expedited or not + // + // NOTE: backported from v50 (https://github.com/cosmos/cosmos-sdk/pull/14720) + bool expedited = 7; } // MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. diff --git a/tests/e2e/gov/query.go b/tests/e2e/gov/query.go index 5a14e9025e96..21deb1f0e3ee 100644 --- a/tests/e2e/gov/query.go +++ b/tests/e2e/gov/query.go @@ -23,7 +23,7 @@ func (s *E2ETestSuite) TestCmdParams() { { "json output", []string{fmt.Sprintf("--%s=json", flags.FlagOutput)}, - `{"voting_params":{"voting_period":"172800s"},"deposit_params":{"min_deposit":[{"denom":"stake","amount":"10000000"}],"max_deposit_period":"172800s"},"tally_params":{"quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000"},"params":{"min_deposit":[{"denom":"stake","amount":"10000000"}],"max_deposit_period":"172800s","voting_period":"172800s","quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000","min_initial_deposit_ratio":"0.000000000000000000","burn_vote_quorum":false,"burn_proposal_deposit_prevote":false,"burn_vote_veto":true,"min_deposit_ratio":"0.010000000000000000"}}`, + `{"voting_params":{"voting_period":"172800s"},"deposit_params":{"min_deposit":[{"denom":"stake","amount":"10000000"}],"max_deposit_period":"172800s"},"tally_params":{"quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000"},"params":{"min_deposit":[{"denom":"stake","amount":"10000000"}],"max_deposit_period":"172800s","voting_period":"172800s","quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000","min_initial_deposit_ratio":"0.000000000000000000","expedited_voting_period":"86400s","expedited_threshold":"0.667000000000000000","expedited_min_deposit":[{"denom":"stake","amount":"50000000"}],"burn_vote_quorum":false,"burn_proposal_deposit_prevote":false,"burn_vote_veto":true,"min_deposit_ratio":"0.010000000000000000"}}`, }, { "text output", @@ -38,6 +38,11 @@ params: burn_proposal_deposit_prevote: false burn_vote_quorum: false burn_vote_veto: true + expedited_min_deposit: + - amount: "50000000" + denom: stake + expedited_threshold: "0.667000000000000000" + expedited_voting_period: 86400s max_deposit_period: 172800s min_deposit: - amount: "10000000" diff --git a/tests/integration/gov/genesis_test.go b/tests/integration/gov/genesis_test.go index 19adca6ac742..faf59c9c4801 100644 --- a/tests/integration/gov/genesis_test.go +++ b/tests/integration/gov/genesis_test.go @@ -74,11 +74,11 @@ func TestImportExportQueues(t *testing.T) { ctx = s1.app.BaseApp.NewContext(false, tmproto.Header{}) // Create two proposals, put the second into the voting period - proposal1, err := s1.GovKeeper.SubmitProposal(ctx, []sdk.Msg{mkTestLegacyContent(t)}, "", "test", "description", addrs[0]) + proposal1, err := s1.GovKeeper.SubmitProposal(ctx, []sdk.Msg{mkTestLegacyContent(t)}, "", "test", "description", addrs[0], false) require.NoError(t, err) proposalID1 := proposal1.Id - proposal2, err := s1.GovKeeper.SubmitProposal(ctx, []sdk.Msg{mkTestLegacyContent(t)}, "", "test", "description", addrs[0]) + proposal2, err := s1.GovKeeper.SubmitProposal(ctx, []sdk.Msg{mkTestLegacyContent(t)}, "", "test", "description", addrs[0], false) require.NoError(t, err) proposalID2 := proposal2.Id diff --git a/tests/integration/gov/keeper/grpc_query_test.go b/tests/integration/gov/keeper/grpc_query_test.go index d0e47cdc98fd..515f3f651c77 100644 --- a/tests/integration/gov/keeper/grpc_query_test.go +++ b/tests/integration/gov/keeper/grpc_query_test.go @@ -50,9 +50,9 @@ func (suite *KeeperTestSuite) TestGRPCQueryTally() { "create a proposal and get tally", func() { var err error - proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal, "", "test", "description", addrs[0]) + proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal, "", "test", "description", addrs[0], false) suite.Require().NoError(err) - suite.Require().NotNil(proposal) + suite.Require().NotEqual(proposal.String(), "") req = &v1.QueryTallyResultRequest{ProposalId: proposal.Id} @@ -161,9 +161,9 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryTally() { "create a proposal and get tally", func() { var err error - proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal, "", "test", "description", addrs[0]) + proposal, err = app.GovKeeper.SubmitProposal(ctx, TestProposal, "", "test", "description", addrs[0], false) suite.Require().NoError(err) - suite.Require().NotNil(proposal) + suite.Require().NotEqual(proposal.String(), "") req = &v1beta1.QueryTallyResultRequest{ProposalId: proposal.Id} diff --git a/tests/integration/gov/keeper/tally_test.go b/tests/integration/gov/keeper/tally_test.go index 9658cb74e102..11abdbd0e983 100644 --- a/tests/integration/gov/keeper/tally_test.go +++ b/tests/integration/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, "", "test", "description", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r")) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "", "test", "description", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), false) require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1.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, "", "test", "description", addrs[0]) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "", "test", "description", addrs[0], false) require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1.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, "", "test", "description", addrs[0]) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "", "test", "description", addrs[0], false) require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1.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, "", "test", "description", valAccAddrs[0]) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "", "test", "description", valAccAddrs[0], false) require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1.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, "", "test", "description", valAccAddrs[0]) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "", "test", "description", valAccAddrs[0], false) require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1.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, "", "test", "description", valAccAddrs[0]) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "", "test", "description", valAccAddrs[0], false) require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1.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, "", "test", "description", valAccAddrs[0]) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "", "test", "description", valAccAddrs[0], false) require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1.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, "", "test", "description", valAccAddrs[0]) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "", "test", "description", valAccAddrs[0], false) require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1.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, "", "test", "description", valAccAddrs[0]) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "", "test", "description", valAccAddrs[0], false) require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -255,7 +255,7 @@ func TestTallyDelgatorOverride(t *testing.T) { _ = staking.EndBlocker(ctx, app.StakingKeeper) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "", "test", "description", addrs[0]) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "", "test", "description", addrs[0], false) require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -291,7 +291,7 @@ func TestTallyDelgatorInherit(t *testing.T) { _ = staking.EndBlocker(ctx, app.StakingKeeper) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "", "test", "description", addrs[0]) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "", "test", "description", addrs[0], false) require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -330,7 +330,7 @@ func TestTallyDelgatorMultipleOverride(t *testing.T) { _ = staking.EndBlocker(ctx, app.StakingKeeper) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "", "test", "description", addrs[0]) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "", "test", "description", addrs[0], false) require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -372,7 +372,7 @@ func TestTallyDelgatorMultipleInherit(t *testing.T) { _ = staking.EndBlocker(ctx, app.StakingKeeper) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "", "test", "description", addrs[0]) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "", "test", "description", addrs[0], false) require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1.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, "", "test", "description", addrs[0]) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "", "test", "description", addrs[0], false) require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod @@ -448,7 +448,7 @@ func TestTallyValidatorMultipleDelegations(t *testing.T) { require.NoError(t, err) tp := TestProposal - proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "", "test", "description", addrs[0]) + proposal, err := app.GovKeeper.SubmitProposal(ctx, tp, "", "test", "description", addrs[0], false) require.NoError(t, err) proposalID := proposal.Id proposal.Status = v1.StatusVotingPeriod diff --git a/x/bank/app_test.go b/x/bank/app_test.go index a19d7b2731f1..4f42feabe4d5 100644 --- a/x/bank/app_test.go +++ b/x/bank/app_test.go @@ -362,6 +362,7 @@ func TestMsgSetSendEnabled(t *testing.T) { "set default send enabled to true", "Change send enabled", "Modify send enabled and set to true", + false, ) require.NoError(t, err, "making goodGovProp") badGovProp, err := govv1.NewMsgSubmitProposal( @@ -373,6 +374,7 @@ func TestMsgSetSendEnabled(t *testing.T) { "set default send enabled to true", "Change send enabled", "Modify send enabled and set to true", + false, ) require.NoError(t, err, "making badGovProp") diff --git a/x/evidence/client/cli/query_test.go b/x/evidence/client/cli/query_test.go index db9d9b4cc9ff..e93b9001c517 100644 --- a/x/evidence/client/cli/query_test.go +++ b/x/evidence/client/cli/query_test.go @@ -60,7 +60,9 @@ func TestGetQueryCmd(t *testing.T) { true, }, "all evidence (default pagination)": { - []string{}, + []string{ + fmt.Sprintf("--%s=text", flags.FlagOutput), + }, func() client.Context { bz, _ := encCfg.Codec.Marshal(&sdk.TxResponse{}) c := clitestutil.NewMockTendermintRPC(abci.ResponseQuery{ diff --git a/x/gov/README.md b/x/gov/README.md index c6a3acdff070..48058b70aa48 100644 --- a/x/gov/README.md +++ b/x/gov/README.md @@ -188,6 +188,10 @@ For a weighted vote to be valid, the `options` field must not contain duplicate Quorum is defined as the minimum percentage of voting power that needs to be cast on a proposal for the result to be valid. +### Expedited Proposals + +A proposal can be expedited, making the proposal use shorter voting duration and a higher tally threshold by its default. If an expedited proposal fails to meet the threshold within the scope of shorter voting duration, the expedited proposal is then converted to a regular proposal and restarts voting under regular voting conditions. + #### Threshold Threshold is defined as the minimum proportion of `Yes` votes (excluding @@ -207,6 +211,8 @@ This means that proposals are accepted iff: * The proportion of `Yes` votes, excluding `Abstain` votes, at the end of the voting period is superior to 1/2. +For expedited proposals, it has a higher minimum threshold as its initial parameter, set at 66.7%. + #### Inheritance If a delegator does not vote, it will inherit its validator vote. @@ -699,13 +705,13 @@ The governance module emits the following events: #### MsgVoteWeighted -| Type | Attribute Key | Attribute Value | -| ------------- | ------------- | ------------------------ | -| proposal_vote | option | {weightedVoteOptions} | -| proposal_vote | proposal_id | {proposalID} | -| message | module | governance | -| message | action | vote | -| message | sender | {senderAddress} | +| Type | Attribute Key | Attribute Value | +| ------------- | ------------- | --------------------- | +| proposal_vote | option | {weightedVoteOptions} | +| proposal_vote | proposal_id | {proposalID} | +| message | module | governance | +| message | action | vote | +| message | sender | {senderAddress} | #### MsgDeposit @@ -735,6 +741,11 @@ The governance module contains the following parameters: | burn_proposal_deposit_prevote | bool | false | | burn_vote_quorum | bool | false | | burn_vote_veto | bool | true | +| expedited_threshold | string (time ns) | "0.667000000000000000" | +| expedited_voting_period | string (time ns) | "86400000000000" | +| expedited_min_deposit | array (coins) | [{"denom":"uatom","amount":"50000000"}] | + + **NOTE**: The governance module contains parameters that are objects unlike other modules. If only a subset of parameters are desired to be changed, only they need @@ -848,12 +859,17 @@ deposit_params: min_deposit: - amount: "10000000" denom: stake + expedited_min_deposit: + - amount: "50000000" + denom: stake tally_params: quorum: "0.334000000000000000" threshold: "0.500000000000000000" veto_threshold: "0.334000000000000000" + expedited_threshold: "0.670000000000000000" voting_params: voting_period: "172800000000000" + expedited_voting_period: 86400s ``` ##### proposal diff --git a/x/gov/abci.go b/x/gov/abci.go index bc8764aec0dc..b3cf2bb0c607 100644 --- a/x/gov/abci.go +++ b/x/gov/abci.go @@ -50,7 +50,9 @@ func EndBlocker(ctx sdk.Context, keeper *keeper.Keeper) { logger.Info( "proposal did not meet minimum deposit; deleted", "proposal", proposal.Id, - "min_deposit", sdk.NewCoins(params.MinDeposit...).String(), + "expedited", proposal.Expedited, + "title", proposal.Title, + "min_deposit", sdk.NewCoins(keeper.GetParams(ctx).MinDeposit...).String(), "total_deposit", sdk.NewCoins(proposal.TotalDeposit...).String(), ) @@ -63,13 +65,22 @@ func EndBlocker(ctx sdk.Context, keeper *keeper.Keeper) { passes, burnDeposits, tallyResults := keeper.Tally(ctx, proposal) - if burnDeposits { - keeper.DeleteAndBurnDeposits(ctx, proposal.Id) - } else { - keeper.RefundAndDeleteDeposits(ctx, proposal.Id) + // If an expedited proposal fails, we do not want to update + // the deposit at this point since the proposal is converted to regular. + // As a result, the deposits are either deleted or refunded in all casses + // EXCEPT when an expedited proposal fails. + if !(proposal.Expedited && !passes) { + if burnDeposits { + keeper.DeleteAndBurnDeposits(ctx, proposal.Id) + } else { + keeper.RefundAndDeleteDeposits(ctx, proposal.Id) + } } - if passes { + keeper.RemoveFromActiveProposalQueue(ctx, proposal.Id, *proposal.VotingEndTime) + + switch { + case passes: var ( idx int events sdk.Events @@ -82,17 +93,22 @@ func EndBlocker(ctx sdk.Context, keeper *keeper.Keeper) { // message is logged. cacheCtx, writeCache := ctx.CacheContext() messages, err := proposal.GetMsgs() - if err == nil { - for idx, msg = range messages { - handler := keeper.Router().Handler(msg) - var res *sdk.Result - res, err = safeExecuteHandler(cacheCtx, msg, handler) - if err != nil { - break - } - - events = append(events, res.GetEvents()...) + if err != nil { + proposal.Status = v1.StatusFailed + tagValue = types.AttributeValueProposalFailed + logMsg = fmt.Sprintf("passed proposal (%v) failed to execute; msgs: %s", proposal, err) + + break + } + for idx, msg = range messages { + handler := keeper.Router().Handler(msg) + var res *sdk.Result + res, err = safeExecuteHandler(cacheCtx, msg, handler) + if err != nil { + break } + + events = append(events, res.GetEvents()...) } // `err == nil` when all handlers passed. @@ -112,7 +128,21 @@ func EndBlocker(ctx sdk.Context, keeper *keeper.Keeper) { tagValue = types.AttributeValueProposalFailed logMsg = fmt.Sprintf("passed, but msg %d (%s) failed on execution: %s", idx, sdk.MsgTypeURL(msg), err) } - } else { + case proposal.Expedited: + // When expedited proposal fails, it is converted + // to a regular proposal. As a result, the voting period is extended, and, + // once the regular voting period expires again, the tally is repeated + // according to the regular proposal rules. + proposal.Expedited = false + params := keeper.GetParams(ctx) + endTime := proposal.VotingStartTime.Add(*params.VotingPeriod) + proposal.VotingEndTime = &endTime + + keeper.InsertActiveProposalQueue(ctx, proposal.Id, *proposal.VotingEndTime) + + tagValue = types.AttributeValueExpeditedProposalRejected + logMsg = "expedited proposal converted to regular" + default: proposal.Status = v1.StatusRejected tagValue = types.AttributeValueProposalRejected logMsg = "rejected" @@ -121,7 +151,6 @@ func EndBlocker(ctx sdk.Context, keeper *keeper.Keeper) { proposal.FinalTallyResult = &tallyResults keeper.SetProposal(ctx, proposal) - keeper.RemoveFromActiveProposalQueue(ctx, proposal.Id, *proposal.VotingEndTime) // when proposal become active cacheCtx, writeCache := ctx.CacheContext() @@ -135,6 +164,9 @@ func EndBlocker(ctx sdk.Context, keeper *keeper.Keeper) { logger.Info( "proposal tallied", "proposal", proposal.Id, + "status", proposal.Status.String(), + "expedited", proposal.Expedited, + "title", proposal.Title, "results", logMsg, ) @@ -143,6 +175,7 @@ func EndBlocker(ctx sdk.Context, keeper *keeper.Keeper) { types.EventTypeActiveProposal, sdk.NewAttribute(types.AttributeKeyProposalID, fmt.Sprintf("%d", proposal.Id)), sdk.NewAttribute(types.AttributeKeyProposalResult, tagValue), + sdk.NewAttribute(types.AttributeKeyProposalLog, logMsg), ), ) return false diff --git a/x/gov/abci_test.go b/x/gov/abci_test.go index 19df1494a5b2..115dd84500ef 100644 --- a/x/gov/abci_test.go +++ b/x/gov/abci_test.go @@ -43,6 +43,7 @@ func TestTickExpiredDepositPeriod(t *testing.T) { "", "Proposal", "description of proposal", + false, ) require.NoError(t, err) @@ -99,6 +100,7 @@ func TestTickMultipleExpiredDepositPeriod(t *testing.T) { "", "Proposal", "description of proposal", + false, ) require.NoError(t, err) @@ -125,6 +127,7 @@ func TestTickMultipleExpiredDepositPeriod(t *testing.T) { "", "Proposal", "description of proposal", + false, ) require.NoError(t, err) @@ -186,6 +189,7 @@ func TestTickPassedDepositPeriod(t *testing.T) { "", "Proposal", "description of proposal", + false, ) require.NoError(t, err) @@ -219,70 +223,91 @@ func TestTickPassedDepositPeriod(t *testing.T) { } func TestTickPassedVotingPeriod(t *testing.T) { - suite := createTestSuite(t) - app := suite.App - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - addrs := simtestutil.AddTestAddrs(suite.BankKeeper, suite.StakingKeeper, ctx, 10, valTokens) + testcases := []struct { + name string + expedited bool + }{ + { + name: "regular - deleted", + }, + { + name: "expedited - converted to regular", + expedited: true, + }, + } - SortAddresses(addrs) + for _, tc := range testcases { + t.Run(tc.name, func(t *testing.T) { + suite := createTestSuite(t) + app := suite.App + ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + addrs := simtestutil.AddTestAddrs(suite.BankKeeper, suite.StakingKeeper, ctx, 10, valTokens) - header := tmproto.Header{Height: app.LastBlockHeight() + 1} - app.BeginBlock(abci.RequestBeginBlock{Header: header}) + SortAddresses(addrs) - govMsgSvr := keeper.NewMsgServerImpl(suite.GovKeeper) + header := tmproto.Header{Height: app.LastBlockHeight() + 1} + app.BeginBlock(abci.RequestBeginBlock{Header: header}) - inactiveQueue := suite.GovKeeper.InactiveProposalQueueIterator(ctx, ctx.BlockHeader().Time) - require.False(t, inactiveQueue.Valid()) - inactiveQueue.Close() - activeQueue := suite.GovKeeper.ActiveProposalQueueIterator(ctx, ctx.BlockHeader().Time) - require.False(t, activeQueue.Valid()) - activeQueue.Close() + govMsgSvr := keeper.NewMsgServerImpl(suite.GovKeeper) - proposalCoins := sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, suite.StakingKeeper.TokensFromConsensusPower(ctx, 5))} - newProposalMsg, err := v1.NewMsgSubmitProposal([]sdk.Msg{mkTestLegacyContent(t)}, proposalCoins, addrs[0].String(), "", "Proposal", "description of proposal") - require.NoError(t, err) + inactiveQueue := suite.GovKeeper.InactiveProposalQueueIterator(ctx, ctx.BlockHeader().Time) + require.False(t, inactiveQueue.Valid()) + inactiveQueue.Close() + activeQueue := suite.GovKeeper.ActiveProposalQueueIterator(ctx, ctx.BlockHeader().Time) + require.False(t, activeQueue.Valid()) + activeQueue.Close() - wrapCtx := sdk.WrapSDKContext(ctx) + wrapCtx := sdk.WrapSDKContext(ctx) - res, err := govMsgSvr.SubmitProposal(wrapCtx, newProposalMsg) - require.NoError(t, err) - require.NotNil(t, res) + proposalCoins := sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, suite.StakingKeeper.TokensFromConsensusPower(ctx, 5))} + newProposalMsg, err := v1.NewMsgSubmitProposal([]sdk.Msg{mkTestLegacyContent(t)}, proposalCoins, addrs[0].String(), "", "Proposal", "description of proposal", tc.expedited) + require.NoError(t, err) - proposalID := res.ProposalId + res, err := govMsgSvr.SubmitProposal(wrapCtx, newProposalMsg) + require.NoError(t, err) + require.NotNil(t, res) - newHeader := ctx.BlockHeader() - newHeader.Time = ctx.BlockHeader().Time.Add(time.Duration(1) * time.Second) - ctx = ctx.WithBlockHeader(newHeader) + proposalID := res.ProposalId - newDepositMsg := v1.NewMsgDeposit(addrs[1], proposalID, proposalCoins) + newHeader := ctx.BlockHeader() + newHeader.Time = ctx.BlockHeader().Time.Add(time.Duration(1) * time.Second) + ctx = ctx.WithBlockHeader(newHeader) - res1, err := govMsgSvr.Deposit(wrapCtx, newDepositMsg) - require.NoError(t, err) - require.NotNil(t, res1) + newDepositMsg := v1.NewMsgDeposit(addrs[1], proposalID, proposalCoins) - newHeader = ctx.BlockHeader() - newHeader.Time = ctx.BlockHeader().Time.Add(*suite.GovKeeper.GetParams(ctx).MaxDepositPeriod).Add(*suite.GovKeeper.GetParams(ctx).VotingPeriod) - ctx = ctx.WithBlockHeader(newHeader) + res1, err := govMsgSvr.Deposit(ctx, newDepositMsg) + require.NoError(t, err) + require.NotNil(t, res1) - inactiveQueue = suite.GovKeeper.InactiveProposalQueueIterator(ctx, ctx.BlockHeader().Time) - require.False(t, inactiveQueue.Valid()) - inactiveQueue.Close() + newHeader = ctx.BlockHeader() + newHeader.Time = ctx.BlockHeader().Time.Add(*suite.GovKeeper.GetParams(ctx).MaxDepositPeriod).Add(*suite.GovKeeper.GetParams(ctx).VotingPeriod) + ctx = ctx.WithBlockHeader(newHeader) - activeQueue = suite.GovKeeper.ActiveProposalQueueIterator(ctx, ctx.BlockHeader().Time) - require.True(t, activeQueue.Valid()) + inactiveQueue = suite.GovKeeper.InactiveProposalQueueIterator(ctx, ctx.BlockHeader().Time) + require.False(t, inactiveQueue.Valid()) + inactiveQueue.Close() - activeProposalID := types.GetProposalIDFromBytes(activeQueue.Value()) - proposal, ok := suite.GovKeeper.GetProposal(ctx, activeProposalID) - require.True(t, ok) - require.Equal(t, v1.StatusVotingPeriod, proposal.Status) + activeQueue = suite.GovKeeper.ActiveProposalQueueIterator(ctx, ctx.BlockHeader().Time) + require.True(t, activeQueue.Valid()) - activeQueue.Close() + activeProposalID := types.GetProposalIDFromBytes(activeQueue.Value()) + proposal, ok := suite.GovKeeper.GetProposal(ctx, activeProposalID) + require.True(t, ok) + require.Equal(t, v1.StatusVotingPeriod, proposal.Status) - gov.EndBlocker(ctx, suite.GovKeeper) + activeQueue.Close() - activeQueue = suite.GovKeeper.ActiveProposalQueueIterator(ctx, ctx.BlockHeader().Time) - require.False(t, activeQueue.Valid()) - activeQueue.Close() + gov.EndBlocker(ctx, suite.GovKeeper) + + activeQueue = suite.GovKeeper.ActiveProposalQueueIterator(ctx, ctx.BlockHeader().Time) + if tc.expedited { + require.True(t, activeQueue.Valid()) + } else { + require.False(t, activeQueue.Valid()) + } + activeQueue.Close() + }) + } } func TestProposalPassedEndblocker(t *testing.T) { @@ -308,7 +333,7 @@ func TestProposalPassedEndblocker(t *testing.T) { require.NotNil(t, macc) initialModuleAccCoins := suite.BankKeeper.GetAllBalances(ctx, macc.GetAddress()) - proposal, err := suite.GovKeeper.SubmitProposal(ctx, []sdk.Msg{mkTestLegacyContent(t)}, "", "title", "summary", addrs[0]) + proposal, err := suite.GovKeeper.SubmitProposal(ctx, []sdk.Msg{mkTestLegacyContent(t)}, "", "title", "summary", addrs[0], false) require.NoError(t, err) proposalCoins := sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, suite.StakingKeeper.TokensFromConsensusPower(ctx, 10))} @@ -357,7 +382,7 @@ func TestEndBlockerProposalHandlerFailed(t *testing.T) { staking.EndBlocker(ctx, suite.StakingKeeper) msg := banktypes.NewMsgSend(authtypes.NewModuleAddress(types.ModuleName), addrs[0], sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100000)))) - proposal, err := suite.GovKeeper.SubmitProposal(ctx, []sdk.Msg{msg}, "", "Bank Msg Send", "send message", addrs[0]) + proposal, err := suite.GovKeeper.SubmitProposal(ctx, []sdk.Msg{msg}, "", "Bank Msg Send", "send message", addrs[0], false) require.NoError(t, err) proposalCoins := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, suite.StakingKeeper.TokensFromConsensusPower(ctx, 10))) diff --git a/x/gov/client/cli/tx.go b/x/gov/client/cli/tx.go index b31cedc5e80d..28c27b695410 100644 --- a/x/gov/client/cli/tx.go +++ b/x/gov/client/cli/tx.go @@ -110,6 +110,7 @@ Where proposal.json contains: "deposit": "10stake", "title": "My proposal", "summary": "A short summary of my proposal" + "expedited": false } metadata example: @@ -131,12 +132,12 @@ metadata example: return err } - msgs, metadata, title, summary, deposit, err := parseSubmitProposal(clientCtx.Codec, args[0]) + proposal, msgs, deposit, err := parseSubmitProposal(clientCtx.Codec, args[0]) if err != nil { return err } - msg, err := v1.NewMsgSubmitProposal(msgs, deposit, clientCtx.GetFromAddress().String(), metadata, title, summary) + msg, err := v1.NewMsgSubmitProposal(msgs, deposit, clientCtx.GetFromAddress().String(), proposal.Metadata, proposal.Title, proposal.Summary, proposal.Expedited) if err != nil { return fmt.Errorf("invalid message: %w", err) } diff --git a/x/gov/client/cli/util.go b/x/gov/client/cli/util.go index fe3e8d0a26e3..63be49dc354e 100644 --- a/x/gov/client/cli/util.go +++ b/x/gov/client/cli/util.go @@ -82,25 +82,26 @@ func parseSubmitLegacyProposal(fs *pflag.FlagSet) (*legacyProposal, error) { // proposal defines the new Msg-based proposal. type proposal struct { // Msgs defines an array of sdk.Msgs proto-JSON-encoded as Anys. - Messages []json.RawMessage `json:"messages,omitempty"` - Metadata string `json:"metadata"` - Deposit string `json:"deposit"` - Title string `json:"title"` - Summary string `json:"summary"` + Messages []json.RawMessage `json:"messages,omitempty"` + Metadata string `json:"metadata"` + Deposit string `json:"deposit"` + Title string `json:"title"` + Summary string `json:"summary"` + Expedited bool `json:"expedited"` } // parseSubmitProposal reads and parses the proposal. -func parseSubmitProposal(cdc codec.Codec, path string) ([]sdk.Msg, string, string, string, sdk.Coins, error) { +func parseSubmitProposal(cdc codec.Codec, path string) (proposal, []sdk.Msg, sdk.Coins, error) { var proposal proposal contents, err := os.ReadFile(path) if err != nil { - return nil, "", "", "", nil, err + return proposal, nil, nil, err } err = json.Unmarshal(contents, &proposal) if err != nil { - return nil, "", "", "", nil, err + return proposal, nil, nil, err } msgs := make([]sdk.Msg, len(proposal.Messages)) @@ -108,7 +109,7 @@ func parseSubmitProposal(cdc codec.Codec, path string) ([]sdk.Msg, string, strin var msg sdk.Msg err := cdc.UnmarshalInterfaceJSON(anyJSON, &msg) if err != nil { - return nil, "", "", "", nil, err + return proposal, nil, nil, err } msgs[i] = msg @@ -116,10 +117,10 @@ func parseSubmitProposal(cdc codec.Codec, path string) ([]sdk.Msg, string, strin deposit, err := sdk.ParseCoinsNormalized(proposal.Deposit) if err != nil { - return nil, "", "", "", nil, err + return proposal, nil, nil, err } - return msgs, proposal.Metadata, proposal.Title, proposal.Summary, deposit, nil + return proposal, msgs, deposit, nil } // AddGovPropFlagsToCmd adds flags for defining MsgSubmitProposal fields. diff --git a/x/gov/client/cli/util_test.go b/x/gov/client/cli/util_test.go index 7abfd86c0eb4..64306b9fa580 100644 --- a/x/gov/client/cli/util_test.go +++ b/x/gov/client/cli/util_test.go @@ -163,25 +163,26 @@ func TestParseSubmitProposal(t *testing.T) { "metadata": "%s", "title": "My awesome title", "summary": "My awesome summary", - "deposit": "1000test" + "deposit": "1000test", + "expedited": true } `, addr, addr, addr, addr, addr, base64.StdEncoding.EncodeToString(expectedMetadata))) badJSON := testutil.WriteToNewTempFile(t, "bad json") // nonexistent json - _, _, _, _, _, err := parseSubmitProposal(cdc, "fileDoesNotExist") //nolint: dogsled + _, _, _, err := parseSubmitProposal(cdc, "fileDoesNotExist") //nolint: dogsled require.Error(t, err) // invalid json - _, _, _, _, _, err = parseSubmitProposal(cdc, badJSON.Name()) //nolint: dogsled + _, _, _, err = parseSubmitProposal(cdc, badJSON.Name()) //nolint: dogsled require.Error(t, err) // ok json - msgs, metadata, title, summary, deposit, err := parseSubmitProposal(cdc, okJSON.Name()) + proposal, msgs, deposit, err := parseSubmitProposal(cdc, okJSON.Name()) require.NoError(t, err, "unexpected error") require.Equal(t, sdk.NewCoins(sdk.NewCoin("test", sdk.NewInt(1000))), deposit) - require.Equal(t, base64.StdEncoding.EncodeToString(expectedMetadata), metadata) + require.Equal(t, base64.StdEncoding.EncodeToString(expectedMetadata), proposal.Metadata) require.Len(t, msgs, 3) msg1, ok := msgs[0].(*banktypes.MsgSend) require.True(t, ok) @@ -200,8 +201,9 @@ func TestParseSubmitProposal(t *testing.T) { require.True(t, ok) require.Equal(t, "My awesome title", textProp.Title) require.Equal(t, "My awesome description", textProp.Description) - require.Equal(t, "My awesome title", title) - require.Equal(t, "My awesome summary", summary) + require.Equal(t, "My awesome title", proposal.Title) + require.Equal(t, "My awesome summary", proposal.Summary) + require.Equal(t, true, proposal.Expedited) err = okJSON.Close() require.Nil(t, err, "unexpected error") diff --git a/x/gov/keeper/deposit.go b/x/gov/keeper/deposit.go index bee247d71b15..987161350159 100644 --- a/x/gov/keeper/deposit.go +++ b/x/gov/keeper/deposit.go @@ -232,7 +232,7 @@ func (keeper Keeper) RefundAndDeleteDeposits(ctx sdk.Context, proposalID uint64) // validateInitialDeposit validates if initial deposit is greater than or equal to the minimum // required at the time of proposal submission. This threshold amount is determined by // the deposit parameters. Returns nil on success, error otherwise. -func (keeper Keeper) validateInitialDeposit(ctx sdk.Context, params v1.Params, initialDeposit sdk.Coins) error { +func (keeper Keeper) validateInitialDeposit(ctx sdk.Context, params v1.Params, initialDeposit sdk.Coins, expedited bool) error { if !initialDeposit.IsValid() || initialDeposit.IsAnyNegative() { return sdkerrors.Wrapf(sdkerrors.ErrInvalidCoins, initialDeposit.String()) } @@ -244,7 +244,14 @@ func (keeper Keeper) validateInitialDeposit(ctx sdk.Context, params v1.Params, i if minInitialDepositRatio.IsZero() { return nil } - minDepositCoins := params.MinDeposit + + var minDepositCoins sdk.Coins + if expedited { + minDepositCoins = params.ExpeditedMinDeposit + } else { + minDepositCoins = params.MinDeposit + } + for i := range minDepositCoins { minDepositCoins[i].Amount = sdk.NewDecFromInt(minDepositCoins[i].Amount).Mul(minInitialDepositRatio).RoundInt() } diff --git a/x/gov/keeper/deposit_test.go b/x/gov/keeper/deposit_test.go index d87825cd3144..a323dbfc3a56 100644 --- a/x/gov/keeper/deposit_test.go +++ b/x/gov/keeper/deposit_test.go @@ -21,7 +21,7 @@ func TestDeposits(t *testing.T) { TestAddrs := simtestutil.AddTestAddrsIncremental(bankKeeper, stakingKeeper, ctx, 2, sdk.NewInt(10000000)) tp := TestProposal - proposal, err := govKeeper.SubmitProposal(ctx, tp, "", "title", "description", TestAddrs[0]) + proposal, err := govKeeper.SubmitProposal(ctx, tp, "", "title", "summary", TestAddrs[0], false) require.NoError(t, err) proposalID := proposal.Id @@ -105,7 +105,7 @@ func TestDeposits(t *testing.T) { require.Equal(t, addr1Initial, bankKeeper.GetAllBalances(ctx, TestAddrs[1])) // Test delete and burn deposits - proposal, err = govKeeper.SubmitProposal(ctx, tp, "", "title", "description", TestAddrs[0]) + proposal, err = govKeeper.SubmitProposal(ctx, tp, "", "title", "summary", TestAddrs[0], true) require.NoError(t, err) proposalID = proposal.Id _, err = govKeeper.AddDeposit(ctx, proposalID, TestAddrs[0], fourStake) @@ -179,7 +179,7 @@ func TestDepositAmount(t *testing.T) { require.NoError(t, err) tp := TestProposal - proposal, err := govKeeper.SubmitProposal(ctx, tp, "", "title", "summary", testAddrs[0]) + proposal, err := govKeeper.SubmitProposal(ctx, tp, "", "title", "summary", testAddrs[0], false) require.NoError(t, err) proposalID := proposal.Id @@ -199,6 +199,7 @@ func TestValidateInitialDeposit(t *testing.T) { minDeposit sdk.Coins minInitialDepositPercent int64 initialDeposit sdk.Coins + expedited bool expectError bool }{ @@ -279,7 +280,7 @@ func TestValidateInitialDeposit(t *testing.T) { govKeeper.SetParams(ctx, params) - err := govKeeper.ValidateInitialDeposit(ctx, tc.initialDeposit) + err := govKeeper.ValidateInitialDeposit(ctx, tc.initialDeposit, tc.expedited) if tc.expectError { require.Error(t, err) diff --git a/x/gov/keeper/export_test.go b/x/gov/keeper/export_test.go index bada822866cc..08f8c5137222 100644 --- a/x/gov/keeper/export_test.go +++ b/x/gov/keeper/export_test.go @@ -4,6 +4,6 @@ import sdk "github.com/cosmos/cosmos-sdk/types" // ValidateInitialDeposit is a helper function used only in deposit tests which returns the same // functionality of validateInitialDeposit private function. -func (k Keeper) ValidateInitialDeposit(ctx sdk.Context, initialDeposit sdk.Coins) error { - return k.validateInitialDeposit(ctx, k.GetParams(ctx), initialDeposit) +func (k Keeper) ValidateInitialDeposit(ctx sdk.Context, initialDeposit sdk.Coins, expedited bool) error { + return k.validateInitialDeposit(ctx, k.GetParams(ctx), initialDeposit, expedited) } diff --git a/x/gov/keeper/grpc_query_test.go b/x/gov/keeper/grpc_query_test.go index 6675e4793178..9b98e1d88be1 100644 --- a/x/gov/keeper/grpc_query_test.go +++ b/x/gov/keeper/grpc_query_test.go @@ -57,7 +57,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposal() { testProposal := v1beta1.NewTextProposal("Proposal", "testing proposal") msgContent, err := v1.NewLegacyContent(testProposal, govAcct.String()) suite.Require().NoError(err) - submittedProposal, err := suite.govKeeper.SubmitProposal(ctx, []sdk.Msg{msgContent}, "", "test", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r")) + submittedProposal, err := suite.govKeeper.SubmitProposal(ctx, []sdk.Msg{msgContent}, "", "test", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), false) suite.Require().NoError(err) suite.Require().NotEmpty(submittedProposal) @@ -132,7 +132,23 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryProposal() { testProposal := v1beta1.NewTextProposal("Proposal", "testing proposal") msgContent, err := v1.NewLegacyContent(testProposal, govAcct.String()) suite.Require().NoError(err) - submittedProposal, err := suite.govKeeper.SubmitProposal(ctx, []sdk.Msg{msgContent}, "", "test", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r")) + submittedProposal, err := suite.govKeeper.SubmitProposal(ctx, []sdk.Msg{msgContent}, "", "test", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), false) + suite.Require().NoError(err) + suite.Require().NotEmpty(submittedProposal) + + expProposal, err = v3.ConvertToLegacyProposal(submittedProposal) + suite.Require().NoError(err) + }, + true, + }, + { + "valid request - expedited", + func() { + req = &v1beta1.QueryProposalRequest{ProposalId: 2} + testProposal := v1beta1.NewTextProposal("Proposal", "testing proposal") + msgContent, err := v1.NewLegacyContent(testProposal, govAcct.String()) + suite.Require().NoError(err) + submittedProposal, err := suite.govKeeper.SubmitProposal(ctx, []sdk.Msg{msgContent}, "", "test", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), true) suite.Require().NoError(err) suite.Require().NotEmpty(submittedProposal) @@ -198,7 +214,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() { testProposal := []sdk.Msg{ v1.NewMsgVote(govAddress, uint64(i), v1.OptionYes, ""), } - proposal, err := suite.govKeeper.SubmitProposal(ctx, testProposal, "", "test", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r")) + proposal, err := suite.govKeeper.SubmitProposal(ctx, testProposal, "", "test", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), false) suite.Require().NotEmpty(proposal) suite.Require().NoError(err) testProposals = append(testProposals, &proposal) @@ -336,7 +352,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryProposals() { testProposal := v1beta1.NewTextProposal("Proposal", "testing proposal") msgContent, err := v1.NewLegacyContent(testProposal, govAcct.String()) suite.Require().NoError(err) - submittedProposal, err := suite.govKeeper.SubmitProposal(ctx, []sdk.Msg{msgContent}, "", "test", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r")) + submittedProposal, err := suite.govKeeper.SubmitProposal(ctx, []sdk.Msg{msgContent}, "", "test", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), false) suite.Require().NoError(err) suite.Require().NotEmpty(submittedProposal) }, @@ -417,7 +433,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryVote() { "no votes present", func() { var err error - proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "", "test", "summary", addrs[0]) + proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "", "test", "summary", addrs[0], false) suite.Require().NoError(err) req = &v1.QueryVoteRequest{ @@ -531,7 +547,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryVote() { "no votes present", func() { var err error - proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "", "test", "summary", addrs[0]) + proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "", "test", "summary", addrs[0], false) suite.Require().NoError(err) req = &v1beta1.QueryVoteRequest{ @@ -637,7 +653,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryVotes() { "create a proposal and get votes", func() { var err error - proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "", "test", "summary", addrs[0]) + proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "", "test", "summary", addrs[0], false) suite.Require().NoError(err) req = &v1.QueryVotesRequest{ @@ -739,7 +755,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryVotes() { "create a proposal and get votes", func() { var err error - proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "", "test", "summary", addrs[0]) + proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "", "test", "summary", addrs[0], false) suite.Require().NoError(err) req = &v1beta1.QueryVotesRequest{ @@ -1024,7 +1040,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposit() { "no deposits proposal", func() { var err error - proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "", "test", "summary", addrs[0]) + proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "", "test", "summary", addrs[0], false) suite.Require().NoError(err) suite.Require().NotNil(proposal) @@ -1071,6 +1087,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposit() { } func (suite *KeeperTestSuite) TestLegacyGRPCQueryDeposit() { + suite.reset() ctx, queryClient, addrs := suite.ctx, suite.legacyQueryClient, suite.addrs var ( @@ -1125,7 +1142,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryDeposit() { "no deposits proposal", func() { var err error - proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "", "test", "summary", addrs[0]) + proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "", "test", "summary", addrs[0], false) suite.Require().NoError(err) suite.Require().NotNil(proposal) @@ -1215,7 +1232,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposits() { "create a proposal and get deposits", func() { var err error - proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "", "test", "summary", addrs[0]) + proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "", "title", "summary", addrs[0], false) suite.Require().NoError(err) req = &v1.QueryDepositsRequest{ @@ -1309,7 +1326,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryDeposits() { "create a proposal and get deposits", func() { var err error - proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "", "test", "summary", addrs[0]) + proposal, err = suite.govKeeper.SubmitProposal(ctx, TestProposal, "", "test", "summary", addrs[0], false) suite.Require().NoError(err) req = &v1beta1.QueryDepositsRequest{ diff --git a/x/gov/keeper/hooks_test.go b/x/gov/keeper/hooks_test.go index f24c37f2b29a..17b58172d3c1 100644 --- a/x/gov/keeper/hooks_test.go +++ b/x/gov/keeper/hooks_test.go @@ -68,7 +68,7 @@ func TestHooks(t *testing.T) { require.False(t, govHooksReceiver.AfterProposalVotingPeriodEndedValid) tp := TestProposal - _, err := govKeeper.SubmitProposal(ctx, tp, "", "test", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r")) + _, err := govKeeper.SubmitProposal(ctx, tp, "", "test", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), false) require.NoError(t, err) require.True(t, govHooksReceiver.AfterProposalSubmissionValid) @@ -79,7 +79,7 @@ func TestHooks(t *testing.T) { require.True(t, govHooksReceiver.AfterProposalFailedMinDepositValid) - p2, err := govKeeper.SubmitProposal(ctx, tp, "", "test", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r")) + p2, err := govKeeper.SubmitProposal(ctx, tp, "", "test", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), false) require.NoError(t, err) activated, err := govKeeper.AddDeposit(ctx, p2.Id, addrs[0], minDeposit) diff --git a/x/gov/keeper/keeper_test.go b/x/gov/keeper/keeper_test.go index 9e8d2009bca0..27d1ef8bfa07 100644 --- a/x/gov/keeper/keeper_test.go +++ b/x/gov/keeper/keeper_test.go @@ -74,17 +74,17 @@ func TestIncrementProposalNumber(t *testing.T) { govKeeper, _, _, _, _, ctx := setupGovKeeper(t) tp := TestProposal - _, err := govKeeper.SubmitProposal(ctx, tp, "", "test", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r")) + _, err := govKeeper.SubmitProposal(ctx, tp, "", "test", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), false) require.NoError(t, err) - _, err = govKeeper.SubmitProposal(ctx, tp, "", "test", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r")) + _, err = govKeeper.SubmitProposal(ctx, tp, "", "test", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), false) require.NoError(t, err) - _, err = govKeeper.SubmitProposal(ctx, tp, "", "test", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r")) + _, err = govKeeper.SubmitProposal(ctx, tp, "", "test", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), true) require.NoError(t, err) - _, err = govKeeper.SubmitProposal(ctx, tp, "", "test", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r")) + _, err = govKeeper.SubmitProposal(ctx, tp, "", "test", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), true) require.NoError(t, err) - _, err = govKeeper.SubmitProposal(ctx, tp, "", "test", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r")) + _, err = govKeeper.SubmitProposal(ctx, tp, "", "test", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), false) require.NoError(t, err) - proposal6, err := govKeeper.SubmitProposal(ctx, tp, "", "test", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r")) + proposal6, err := govKeeper.SubmitProposal(ctx, tp, "", "test", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), false) require.NoError(t, err) require.Equal(t, uint64(6), proposal6.Id) @@ -95,7 +95,7 @@ func TestProposalQueues(t *testing.T) { // create test proposals tp := TestProposal - proposal, err := govKeeper.SubmitProposal(ctx, tp, "", "test", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r")) + proposal, err := govKeeper.SubmitProposal(ctx, tp, "", "test", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), false) require.NoError(t, err) inactiveIterator := govKeeper.InactiveProposalQueueIterator(ctx, *proposal.DepositEndTime) diff --git a/x/gov/keeper/migrations.go b/x/gov/keeper/migrations.go index bc5b0beb3c6c..ab66ac0dcdc2 100644 --- a/x/gov/keeper/migrations.go +++ b/x/gov/keeper/migrations.go @@ -6,6 +6,7 @@ import ( v2 "github.com/cosmos/cosmos-sdk/x/gov/migrations/v2" v3 "github.com/cosmos/cosmos-sdk/x/gov/migrations/v3" v4 "github.com/cosmos/cosmos-sdk/x/gov/migrations/v4" + v5 "github.com/cosmos/cosmos-sdk/x/gov/migrations/v5" ) // Migrator is a struct for handling in-place store migrations. @@ -36,3 +37,8 @@ func (m Migrator) Migrate2to3(ctx sdk.Context) error { func (m Migrator) Migrate3to4(ctx sdk.Context) error { return v4.MigrateStore(ctx, m.keeper.storeKey, m.legacySubspace, m.keeper.cdc) } + +// Migrate3to4 migrates from version 4 to 5. +func (m Migrator) Migrate4to5(ctx sdk.Context) error { + return v5.MigrateStore(ctx, m.keeper.storeKey, m.keeper.cdc) +} diff --git a/x/gov/keeper/msg_server.go b/x/gov/keeper/msg_server.go index e54bade006c5..a42a2829687d 100644 --- a/x/gov/keeper/msg_server.go +++ b/x/gov/keeper/msg_server.go @@ -32,7 +32,7 @@ func (k msgServer) SubmitProposal(goCtx context.Context, msg *v1.MsgSubmitPropos params := k.Keeper.GetParams(ctx) - if err := k.validateInitialDeposit(ctx, params, initialDeposit); err != nil { + if err := k.validateInitialDeposit(ctx, params, initialDeposit, msg.Expedited); err != nil { return nil, err } @@ -50,7 +50,7 @@ func (k msgServer) SubmitProposal(goCtx context.Context, msg *v1.MsgSubmitPropos return nil, err } - proposal, err := k.Keeper.SubmitProposal(ctx, proposalMsgs, msg.Metadata, msg.Title, msg.Summary, proposer) + proposal, err := k.Keeper.SubmitProposal(ctx, proposalMsgs, msg.Metadata, msg.Title, msg.Summary, proposer, msg.Expedited) if err != nil { return nil, err } @@ -219,6 +219,7 @@ func (k legacyMsgServer) SubmitProposal(goCtx context.Context, msg *v1beta1.MsgS "", msg.GetContent().GetTitle(), msg.GetContent().GetDescription(), + false, // legacy proposals cannot be expedited ) if err != nil { return nil, err diff --git a/x/gov/keeper/msg_server_test.go b/x/gov/keeper/msg_server_test.go index 8e6b4a4f3de5..c407fbd10d6c 100644 --- a/x/gov/keeper/msg_server_test.go +++ b/x/gov/keeper/msg_server_test.go @@ -41,6 +41,7 @@ func (suite *KeeperTestSuite) TestSubmitProposalReq() { strings.Repeat("1", 300), "Proposal", "description of proposal", + false, ) }, expErr: true, @@ -55,6 +56,7 @@ func (suite *KeeperTestSuite) TestSubmitProposalReq() { "", "Proposal", "description of proposal", + false, ) }, expErr: true, @@ -69,6 +71,7 @@ func (suite *KeeperTestSuite) TestSubmitProposalReq() { "", "Proposal", "description of proposal", + false, ) }, expErr: true, @@ -83,6 +86,7 @@ func (suite *KeeperTestSuite) TestSubmitProposalReq() { "", "Proposal", "description of proposal", + false, ) }, expErr: true, @@ -97,6 +101,7 @@ func (suite *KeeperTestSuite) TestSubmitProposalReq() { "", "Proposal", "description of proposal", + false, ) }, expErr: true, @@ -111,6 +116,7 @@ func (suite *KeeperTestSuite) TestSubmitProposalReq() { "", "Proposal", "description of proposal", + false, ) }, expErr: true, @@ -125,6 +131,7 @@ func (suite *KeeperTestSuite) TestSubmitProposalReq() { "", "Proposal", "description of proposal", + false, ) }, expErr: false, @@ -138,6 +145,7 @@ func (suite *KeeperTestSuite) TestSubmitProposalReq() { "", "Proposal", "description of proposal", + false, ) }, expErr: false, @@ -181,6 +189,7 @@ func (suite *KeeperTestSuite) TestVoteReq() { "", "Proposal", "description of proposal", + false, ) suite.Require().NoError(err) @@ -206,6 +215,7 @@ func (suite *KeeperTestSuite) TestVoteReq() { "", "Proposal", "description of proposal", + false, ) suite.Require().NoError(err) @@ -249,6 +259,7 @@ func (suite *KeeperTestSuite) TestVoteReq() { "", "Proposal", "description of proposal", + false, ) suite.Require().NoError(err) @@ -300,6 +311,7 @@ func (suite *KeeperTestSuite) TestVoteWeightedReq() { "", "Proposal", "description of proposal", + false, ) suite.Require().NoError(err) @@ -326,6 +338,7 @@ func (suite *KeeperTestSuite) TestVoteWeightedReq() { "", "Proposal", "description of proposal", + false, ) suite.Require().NoError(err) @@ -369,6 +382,7 @@ func (suite *KeeperTestSuite) TestVoteWeightedReq() { "", "Proposal", "description of proposal", + false, ) suite.Require().NoError(err) @@ -419,6 +433,7 @@ func (suite *KeeperTestSuite) TestDepositReq() { "", "Proposal", "description of proposal", + false, ) suite.Require().NoError(err) @@ -556,6 +571,7 @@ func (suite *KeeperTestSuite) TestLegacyMsgVote() { "", "Proposal", "description of proposal", + false, ) suite.Require().NoError(err) @@ -581,6 +597,7 @@ func (suite *KeeperTestSuite) TestLegacyMsgVote() { "", "Proposal", "description of proposal", + false, ) suite.Require().NoError(err) @@ -614,6 +631,7 @@ func (suite *KeeperTestSuite) TestLegacyMsgVote() { "", "Proposal", "description of proposal", + false, ) suite.Require().NoError(err) @@ -665,6 +683,7 @@ func (suite *KeeperTestSuite) TestLegacyVoteWeighted() { "", "Proposal", "description of proposal", + false, ) suite.Require().NoError(err) @@ -691,6 +710,7 @@ func (suite *KeeperTestSuite) TestLegacyVoteWeighted() { "", "Proposal", "description of proposal", + false, ) suite.Require().NoError(err) @@ -724,6 +744,7 @@ func (suite *KeeperTestSuite) TestLegacyVoteWeighted() { "", "Proposal", "description of proposal", + false, ) suite.Require().NoError(err) @@ -774,6 +795,7 @@ func (suite *KeeperTestSuite) TestLegacyMsgDeposit() { "", "Proposal", "description of proposal", + false, ) suite.Require().NoError(err) @@ -1152,7 +1174,7 @@ func (suite *KeeperTestSuite) TestSubmitProposal_InitialDeposit() { params.MinInitialDepositRatio = tc.minInitialDepositRatio.String() govKeeper.SetParams(ctx, params) - msg, err := v1.NewMsgSubmitProposal(TestProposal, tc.initialDeposit, address.String(), "test", "Proposal", "description of proposal") + msg, err := v1.NewMsgSubmitProposal(TestProposal, tc.initialDeposit, address.String(), "test", "Proposal", "description of proposal", false) suite.Require().NoError(err) // System under test diff --git a/x/gov/keeper/proposal.go b/x/gov/keeper/proposal.go index ee1ac5e0c431..bfa3803500be 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -3,6 +3,7 @@ package keeper import ( "errors" "fmt" + "time" "github.com/cosmos/cosmos-sdk/client" sdk "github.com/cosmos/cosmos-sdk/types" @@ -12,7 +13,7 @@ import ( ) // SubmitProposal creates a new proposal given an array of messages -func (keeper Keeper) SubmitProposal(ctx sdk.Context, messages []sdk.Msg, metadata, title, summary string, proposer sdk.AccAddress) (v1.Proposal, error) { +func (keeper Keeper) SubmitProposal(ctx sdk.Context, messages []sdk.Msg, metadata, title, summary string, proposer sdk.AccAddress, expedited bool) (v1.Proposal, error) { err := keeper.assertMetadataLength(metadata) if err != nil { return v1.Proposal{}, err @@ -84,7 +85,7 @@ func (keeper Keeper) SubmitProposal(ctx sdk.Context, messages []sdk.Msg, metadat submitTime := ctx.BlockHeader().Time depositPeriod := keeper.GetParams(ctx).MaxDepositPeriod - proposal, err := v1.NewProposal(messages, proposalID, submitTime, submitTime.Add(*depositPeriod), metadata, title, summary, proposer) + proposal, err := v1.NewProposal(messages, proposalID, submitTime, submitTime.Add(*depositPeriod), metadata, title, summary, proposer, expedited) if err != nil { return v1.Proposal{}, err } @@ -265,7 +266,12 @@ func (keeper Keeper) SetProposalID(ctx sdk.Context, proposalID uint64) { func (keeper Keeper) ActivateVotingPeriod(ctx sdk.Context, proposal v1.Proposal) { startTime := ctx.BlockHeader().Time proposal.VotingStartTime = &startTime - votingPeriod := keeper.GetParams(ctx).VotingPeriod + var votingPeriod *time.Duration + if proposal.Expedited { + votingPeriod = keeper.GetParams(ctx).ExpeditedVotingPeriod + } else { + votingPeriod = keeper.GetParams(ctx).VotingPeriod + } endTime := proposal.VotingStartTime.Add(*votingPeriod) proposal.VotingEndTime = &endTime proposal.Status = v1.StatusVotingPeriod diff --git a/x/gov/keeper/proposal_test.go b/x/gov/keeper/proposal_test.go index 876edd6f809d..ee26be991cc3 100644 --- a/x/gov/keeper/proposal_test.go +++ b/x/gov/keeper/proposal_test.go @@ -17,64 +17,96 @@ import ( ) func (suite *KeeperTestSuite) TestGetSetProposal() { - tp := TestProposal - proposal, err := suite.govKeeper.SubmitProposal(suite.ctx, tp, "", "test", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r")) - suite.Require().NoError(err) - proposalID := proposal.Id - suite.govKeeper.SetProposal(suite.ctx, proposal) + testCases := map[string]struct { + expedited bool + }{ + "regular proposal": {}, + "expedited proposal": { + expedited: true, + }, + } - gotProposal, ok := suite.govKeeper.GetProposal(suite.ctx, proposalID) - suite.Require().True(ok) - suite.Require().Equal(proposal, gotProposal) + for _, tc := range testCases { + tp := TestProposal + proposal, err := suite.govKeeper.SubmitProposal(suite.ctx, tp, "", "test", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), tc.expedited) + suite.Require().NoError(err) + proposalID := proposal.Id + suite.govKeeper.SetProposal(suite.ctx, proposal) + + gotProposal, ok := suite.govKeeper.GetProposal(suite.ctx, proposalID) + suite.Require().True(ok) + suite.Require().Equal(proposal, gotProposal) + } } func (suite *KeeperTestSuite) TestDeleteProposal() { - // delete non-existing proposal - suite.Require().PanicsWithValue(fmt.Sprintf("couldn't find proposal with id#%d", 10), - func() { - suite.govKeeper.DeleteProposal(suite.ctx, 10) + testCases := map[string]struct { + expedited bool + }{ + "regular proposal": {}, + "expedited proposal": { + expedited: true, }, - ) - tp := TestProposal - proposal, err := suite.govKeeper.SubmitProposal(suite.ctx, tp, "", "test", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r")) - suite.Require().NoError(err) - proposalID := proposal.Id - suite.govKeeper.SetProposal(suite.ctx, proposal) - suite.Require().NotPanics(func() { - suite.govKeeper.DeleteProposal(suite.ctx, proposalID) - }, "") + } + + for _, tc := range testCases { + // delete non-existing proposal + suite.Require().PanicsWithValue(fmt.Sprintf("couldn't find proposal with id#%d", 10), + func() { + suite.govKeeper.DeleteProposal(suite.ctx, 10) + }, + ) + tp := TestProposal + proposal, err := suite.govKeeper.SubmitProposal(suite.ctx, tp, "", "test", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), tc.expedited) + suite.Require().NoError(err) + proposalID := proposal.Id + suite.govKeeper.SetProposal(suite.ctx, proposal) + suite.Require().NotPanics(func() { + suite.govKeeper.DeleteProposal(suite.ctx, proposalID) + }, "") + } } func (suite *KeeperTestSuite) TestActivateVotingPeriod() { - tp := TestProposal - proposal, err := suite.govKeeper.SubmitProposal(suite.ctx, tp, "", "test", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r")) - suite.Require().NoError(err) + testCases := map[string]struct { + expedited bool + }{ + "regular proposal": {}, + "expedited proposal": { + expedited: true, + }, + } - suite.Require().Nil(proposal.VotingStartTime) + for _, tc := range testCases { + tp := TestProposal + proposal, err := suite.govKeeper.SubmitProposal(suite.ctx, tp, "", "test", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), tc.expedited) + suite.Require().NoError(err) - suite.govKeeper.ActivateVotingPeriod(suite.ctx, proposal) + suite.Require().Nil(proposal.VotingStartTime) - proposal, ok := suite.govKeeper.GetProposal(suite.ctx, proposal.Id) - suite.Require().True(ok) - suite.Require().True(proposal.VotingStartTime.Equal(suite.ctx.BlockHeader().Time)) + suite.govKeeper.ActivateVotingPeriod(suite.ctx, proposal) - activeIterator := suite.govKeeper.ActiveProposalQueueIterator(suite.ctx, *proposal.VotingEndTime) - suite.Require().True(activeIterator.Valid()) + proposal, ok := suite.govKeeper.GetProposal(suite.ctx, proposal.Id) + suite.Require().True(ok) + suite.Require().True(proposal.VotingStartTime.Equal(suite.ctx.BlockHeader().Time)) - proposalID := types.GetProposalIDFromBytes(activeIterator.Value()) - suite.Require().Equal(proposalID, proposal.Id) - activeIterator.Close() + activeIterator := suite.govKeeper.ActiveProposalQueueIterator(suite.ctx, *proposal.VotingEndTime) + suite.Require().True(activeIterator.Valid()) - // delete the proposal to avoid issues with other tests - suite.Require().NotPanics(func() { - suite.govKeeper.DeleteProposal(suite.ctx, proposalID) - }, "") + proposalID := types.GetProposalIDFromBytes(activeIterator.Value()) + suite.Require().Equal(proposalID, proposal.Id) + activeIterator.Close() + // delete the proposal to avoid issues with other tests + suite.Require().NotPanics(func() { + suite.govKeeper.DeleteProposal(suite.ctx, proposalID) + }, "") + } } func (suite *KeeperTestSuite) TestDeleteProposalInVotingPeriod() { suite.reset() tp := TestProposal - proposal, err := suite.govKeeper.SubmitProposal(suite.ctx, tp, "", "test", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r")) + proposal, err := suite.govKeeper.SubmitProposal(suite.ctx, tp, "", "test", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), false) suite.Require().NoError(err) suite.Require().Nil(proposal.VotingStartTime) @@ -118,26 +150,28 @@ func (suite *KeeperTestSuite) TestSubmitProposal() { content v1beta1.Content authority string metadata string + expedited bool expectedErr error }{ - {&tp, govAcct, "", nil}, + {&tp, govAcct, "", false, nil}, + {&tp, govAcct, "", true, 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, "", false, nil}, + {&v1beta1.TextProposal{Title: strings.Repeat("1234567890", 100), Description: "description"}, govAcct, "", false, nil}, + {&v1beta1.TextProposal{Title: "title", Description: ""}, govAcct, "", false, nil}, + {&v1beta1.TextProposal{Title: "title", Description: strings.Repeat("1234567890", 1000)}, govAcct, "", true, nil}, // error when metadata is too long (>10000) - {&tp, govAcct, strings.Repeat("a", 100001), types.ErrMetadataTooLong}, + {&tp, govAcct, strings.Repeat("a", 100001), true, types.ErrMetadataTooLong}, // error when signer is not gov acct - {&tp, randomAddr.String(), "", types.ErrInvalidSigner}, + {&tp, randomAddr.String(), "", false, types.ErrInvalidSigner}, // error only when invalid route - {&invalidProposalRoute{}, govAcct, "", types.ErrNoProposalHandlerExists}, + {&invalidProposalRoute{}, govAcct, "", false, types.ErrNoProposalHandlerExists}, } for i, tc := range testCases { prop, err := v1.NewLegacyContent(tc.content, tc.authority) suite.Require().NoError(err) - _, err = suite.govKeeper.SubmitProposal(suite.ctx, []sdk.Msg{prop}, tc.metadata, "title", "", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r")) + _, err = suite.govKeeper.SubmitProposal(suite.ctx, []sdk.Msg{prop}, tc.metadata, "title", "", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), tc.expedited) suite.Require().True(errors.Is(tc.expectedErr, err), "tc #%d; got: %v, expected: %v", i, err, tc.expectedErr) } } @@ -150,7 +184,7 @@ func (suite *KeeperTestSuite) TestGetProposalsFiltered() { for _, s := range status { for i := 0; i < 50; i++ { - p, err := v1.NewProposal(TestProposal, proposalID, time.Now(), time.Now(), "", "title", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r")) + p, err := v1.NewProposal(TestProposal, proposalID, time.Now(), time.Now(), "metadata", "title", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), false) suite.Require().NoError(err) p.Status = s diff --git a/x/gov/keeper/tally.go b/x/gov/keeper/tally.go index 863c64f51443..37c1b2af1a9f 100644 --- a/x/gov/keeper/tally.go +++ b/x/gov/keeper/tally.go @@ -117,7 +117,15 @@ func (keeper Keeper) Tally(ctx sdk.Context, proposal v1.Proposal) (passes bool, } // If more than 1/2 of non-abstaining voters vote Yes, proposal passes - threshold, _ := sdk.NewDecFromStr(params.Threshold) + // For expedited 2/3 + var thresholdStr string + if proposal.Expedited { + thresholdStr = params.GetExpeditedThreshold() + } else { + thresholdStr = params.GetThreshold() + } + + threshold, _ := sdk.NewDecFromStr(thresholdStr) if results[v1.OptionYes].Quo(totalVotingPower.Sub(results[v1.OptionAbstain])).GT(threshold) { return true, false, tallyResults } diff --git a/x/gov/keeper/vote_test.go b/x/gov/keeper/vote_test.go index 048b75c38d0c..913d3b9f4e38 100644 --- a/x/gov/keeper/vote_test.go +++ b/x/gov/keeper/vote_test.go @@ -15,7 +15,7 @@ func TestVotes(t *testing.T) { addrs := simtestutil.AddTestAddrsIncremental(bankKeeper, stakingKeeper, ctx, 2, sdk.NewInt(10000000)) tp := TestProposal - proposal, err := govKeeper.SubmitProposal(ctx, tp, "", "title", "description", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r")) + proposal, err := govKeeper.SubmitProposal(ctx, tp, "", "title", "description", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), false) require.NoError(t, err) proposalID := proposal.Id metadata := "metadata" diff --git a/x/gov/migrations/v3/json_test.go b/x/gov/migrations/v3/json_test.go index 29f70ff5f715..726d6c506d18 100644 --- a/x/gov/migrations/v3/json_test.go +++ b/x/gov/migrations/v3/json_test.go @@ -87,6 +87,7 @@ func TestMigrateJSON(t *testing.T) { "proposals": [ { "deposit_end_time": "2001-09-09T01:46:40Z", + "expedited": false, "final_tally_result": { "abstain_count": "0", "no_count": "0", diff --git a/x/gov/migrations/v4/json.go b/x/gov/migrations/v4/json.go index 3797e0a36ce7..03959c544ef2 100644 --- a/x/gov/migrations/v4/json.go +++ b/x/gov/migrations/v4/json.go @@ -15,10 +15,13 @@ func MigrateJSON(oldState *v1.GenesisState) (*v1.GenesisState, error) { params := v1.NewParams( oldState.DepositParams.MinDeposit, + defaultParams.ExpeditedMinDeposit, *oldState.DepositParams.MaxDepositPeriod, *oldState.VotingParams.VotingPeriod, + *defaultParams.ExpeditedVotingPeriod, oldState.TallyParams.Quorum, oldState.TallyParams.Threshold, + defaultParams.ExpeditedThreshold, oldState.TallyParams.VetoThreshold, defaultParams.MinInitialDepositRatio, defaultParams.BurnProposalDepositPrevote, diff --git a/x/gov/migrations/v4/json_test.go b/x/gov/migrations/v4/json_test.go index cb32ada39842..1ad673fdaab4 100644 --- a/x/gov/migrations/v4/json_test.go +++ b/x/gov/migrations/v4/json_test.go @@ -62,6 +62,14 @@ func TestMigrateJSON(t *testing.T) { "burn_proposal_deposit_prevote": false, "burn_vote_quorum": false, "burn_vote_veto": true, + "expedited_min_deposit": [ + { + "amount": "50000000", + "denom": "stake" + } + ], + "expedited_threshold": "0.667000000000000000", + "expedited_voting_period": "86400s", "max_deposit_period": "172800s", "min_deposit": [ { diff --git a/x/gov/migrations/v4/store.go b/x/gov/migrations/v4/store.go index d0f3b3532735..d91e04619d9f 100644 --- a/x/gov/migrations/v4/store.go +++ b/x/gov/migrations/v4/store.go @@ -27,10 +27,13 @@ func migrateParams(ctx sdk.Context, storeKey storetypes.StoreKey, legacySubspace defaultParams := govv1.DefaultParams() params := govv1.NewParams( dp.MinDeposit, + govv1.DefaultParams().ExpeditedMinDeposit, *dp.MaxDepositPeriod, *vp.VotingPeriod, + *govv1.DefaultParams().ExpeditedVotingPeriod, tp.Quorum, tp.Threshold, + govv1.DefaultParams().ExpeditedThreshold, tp.VetoThreshold, defaultParams.MinInitialDepositRatio, defaultParams.BurnProposalDepositPrevote, diff --git a/x/gov/migrations/v4/store_test.go b/x/gov/migrations/v4/store_test.go index 858b11c86cd6..e85ff91ad7f5 100644 --- a/x/gov/migrations/v4/store_test.go +++ b/x/gov/migrations/v4/store_test.go @@ -75,13 +75,13 @@ func TestMigrateStore(t *testing.T) { // Create 2 proposals prop1Content, err := v1.NewLegacyContent(v1beta1.NewTextProposal("Test", "description"), authtypes.NewModuleAddress("gov").String()) require.NoError(t, err) - proposal1, err := v1.NewProposal([]sdk.Msg{prop1Content}, 1, propTime, propTime, "some metadata for the legacy content", "Test", "description", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r")) + proposal1, err := v1.NewProposal([]sdk.Msg{prop1Content}, 1, propTime, propTime, "some metadata for the legacy content", "Test", "description", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), false) require.NoError(t, err) prop1Bz, err := cdc.Marshal(&proposal1) require.NoError(t, err) store.Set(v1gov.ProposalKey(proposal1.Id), prop1Bz) - proposal2, err := v1.NewProposal(getTestProposal(), 2, propTime, propTime, "some metadata for the legacy content", "Test", "description", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r")) + proposal2, err := v1.NewProposal(getTestProposal(), 2, propTime, propTime, "some metadata for the legacy content", "Test", "description", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), false) proposal2.Status = v1.StatusVotingPeriod require.NoError(t, err) prop2Bz, err := cdc.Marshal(&proposal2) diff --git a/x/gov/migrations/v5/store.go b/x/gov/migrations/v5/store.go new file mode 100644 index 000000000000..be485a2573c6 --- /dev/null +++ b/x/gov/migrations/v5/store.go @@ -0,0 +1,37 @@ +package v5 + +import ( + storetypes "github.com/cosmos/cosmos-sdk/store/types" + + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + v4 "github.com/cosmos/cosmos-sdk/x/gov/migrations/v4" + govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" +) + +// NOTE: added during expedite proposal migration (backport https://github.com/cosmos/cosmos-sdk/pull/18146) +// MigrateStore performs in-place store migrations from v4 (v0.47) to v5 (v0.50). The +// migration includes: +// +// Addition of the new proposal expedited parameters that are set to 0 by default. +func MigrateStore(ctx sdk.Context, storeKey storetypes.StoreKey, cdc codec.BinaryCodec) error { + store := ctx.KVStore(storeKey) + paramsBz := store.Get(v4.ParamsKey) + + var params govv1.Params + cdc.MustUnmarshal(paramsBz, ¶ms) + + defaultParams := govv1.DefaultParams() + params.ExpeditedMinDeposit = defaultParams.ExpeditedMinDeposit + params.ExpeditedVotingPeriod = defaultParams.ExpeditedVotingPeriod + params.ExpeditedThreshold = defaultParams.ExpeditedThreshold + + bz, err := cdc.Marshal(¶ms) + if err != nil { + return err + } + + store.Set(v4.ParamsKey, bz) + + return nil +} diff --git a/x/gov/migrations/v5/store_test.go b/x/gov/migrations/v5/store_test.go new file mode 100644 index 000000000000..069dc4ca169e --- /dev/null +++ b/x/gov/migrations/v5/store_test.go @@ -0,0 +1,44 @@ +package v5_test + +import ( + "testing" + "time" + + "github.com/stretchr/testify/require" + + storetypes "github.com/cosmos/cosmos-sdk/store/types" + + "github.com/cosmos/cosmos-sdk/testutil" + moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" + "github.com/cosmos/cosmos-sdk/x/bank" + "github.com/cosmos/cosmos-sdk/x/gov" + v4 "github.com/cosmos/cosmos-sdk/x/gov/migrations/v4" + v5 "github.com/cosmos/cosmos-sdk/x/gov/migrations/v5" + v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" +) + +func TestMigrateStore(t *testing.T) { + cdc := moduletestutil.MakeTestEncodingConfig(gov.AppModuleBasic{}, bank.AppModuleBasic{}).Codec + govKey := storetypes.NewKVStoreKey("gov") + ctx := testutil.DefaultContext(govKey, storetypes.NewTransientStoreKey("transient_test")) + store := ctx.KVStore(govKey) + + var params v1.Params + bz := store.Get(v4.ParamsKey) + require.NoError(t, cdc.Unmarshal(bz, ¶ms)) + require.NotNil(t, params) + require.Equal(t, "", params.ExpeditedThreshold) + require.Equal(t, (*time.Duration)(nil), params.ExpeditedVotingPeriod) + + // Run migrations. + err := v5.MigrateStore(ctx, govKey, cdc) + require.NoError(t, err) + + // Check params + bz = store.Get(v4.ParamsKey) + require.NoError(t, cdc.Unmarshal(bz, ¶ms)) + require.NotNil(t, params) + require.Equal(t, v1.DefaultParams().ExpeditedMinDeposit, params.ExpeditedMinDeposit) + require.Equal(t, v1.DefaultParams().ExpeditedThreshold, params.ExpeditedThreshold) + require.Equal(t, v1.DefaultParams().ExpeditedVotingPeriod, params.ExpeditedVotingPeriod) +} diff --git a/x/gov/module.go b/x/gov/module.go index 1755638ed665..ad5347c9b490 100644 --- a/x/gov/module.go +++ b/x/gov/module.go @@ -37,7 +37,7 @@ import ( paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" ) -const ConsensusVersion = 4 +const ConsensusVersion = 5 var ( _ module.EndBlockAppModule = AppModule{} @@ -282,18 +282,21 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { v1.RegisterQueryServer(cfg.QueryServer(), am.keeper) m := keeper.NewMigrator(am.keeper, am.legacySubspace) - err := cfg.RegisterMigration(govtypes.ModuleName, 1, m.Migrate1to2) - if err != nil { + if err := cfg.RegisterMigration(govtypes.ModuleName, 1, m.Migrate1to2); err != nil { panic(fmt.Sprintf("failed to migrate x/gov from version 1 to 2: %v", err)) } - err = cfg.RegisterMigration(govtypes.ModuleName, 2, m.Migrate2to3) - if err != nil { + + if err := cfg.RegisterMigration(govtypes.ModuleName, 2, m.Migrate2to3); err != nil { panic(fmt.Sprintf("failed to migrate x/gov from version 2 to 3: %v", err)) } - err = cfg.RegisterMigration(govtypes.ModuleName, 3, m.Migrate3to4) - if err != nil { + + if err := cfg.RegisterMigration(govtypes.ModuleName, 3, m.Migrate3to4); err != nil { panic(fmt.Sprintf("failed to migrate x/gov from version 3 to 4: %v", err)) } + + if err := cfg.RegisterMigration(govtypes.ModuleName, 4, m.Migrate4to5); err != nil { + panic(fmt.Sprintf("failed to migrate x/gov from version 4 to 5: %v", err)) + } } // InitGenesis performs genesis initialization for the gov module. It returns diff --git a/x/gov/simulation/decoder.go b/x/gov/simulation/decoder.go index 25af6b254ae4..6e0f99a292da 100644 --- a/x/gov/simulation/decoder.go +++ b/x/gov/simulation/decoder.go @@ -8,6 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/types/kv" "github.com/cosmos/cosmos-sdk/x/gov/types" + v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) @@ -17,18 +18,27 @@ func NewDecodeStore(cdc codec.Codec) func(kvA, kvB kv.Pair) string { return func(kvA, kvB kv.Pair) string { switch { case bytes.Equal(kvA.Key[:1], types.ProposalsKeyPrefix): - var proposalA v1beta1.Proposal - err := cdc.Unmarshal(kvA.Value, &proposalA) - if err != nil { - panic(err) + var ( + proposalA v1beta1.Proposal + proposalB v1beta1.Proposal + + proposalD v1.Proposal + proposalC v1.Proposal + ) + if err := cdc.Unmarshal(kvA.Value, &proposalC); err != nil { + cdc.MustUnmarshal(kvA.Value, &proposalA) } - var proposalB v1beta1.Proposal - err = cdc.Unmarshal(kvB.Value, &proposalB) - if err != nil { - panic(err) + + if err := cdc.Unmarshal(kvB.Value, &proposalD); err != nil { + cdc.MustUnmarshal(kvB.Value, &proposalB) } - return fmt.Sprintf("%v\n%v", proposalA, proposalB) + // this is to check if the proposal has been unmarshalled as v1 correctly (and not v1beta1) + if proposalC.Title != "" || proposalD.Title != "" { + return fmt.Sprintf("%v\n%v", proposalC, proposalD) + } + + return fmt.Sprintf("%v\n%v", proposalA, proposalB) case bytes.Equal(kvA.Key[:1], types.ActiveProposalQueuePrefix), bytes.Equal(kvA.Key[:1], types.InactiveProposalQueuePrefix), bytes.Equal(kvA.Key[:1], types.ProposalIDKey): diff --git a/x/gov/simulation/decoder_test.go b/x/gov/simulation/decoder_test.go index 8f97b00afd4f..0d6957249c6b 100644 --- a/x/gov/simulation/decoder_test.go +++ b/x/gov/simulation/decoder_test.go @@ -16,6 +16,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/gov" "github.com/cosmos/cosmos-sdk/x/gov/simulation" "github.com/cosmos/cosmos-sdk/x/gov/types" + v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) @@ -35,17 +36,16 @@ func TestDecodeStore(t *testing.T) { require.NoError(t, err) proposalB, err := v1beta1.NewProposal(content, 2, endTime, endTime.Add(24*time.Hour)) require.NoError(t, err) + proposalC, err := v1.NewProposal([]sdk.Msg{}, 3, endTime, endTime.Add(24*time.Hour), "metadata", "title", "summary", delAddr1, false) + require.NoError(t, err) + proposalD, err := v1.NewProposal([]sdk.Msg{}, 4, endTime, endTime.Add(24*time.Hour), "metadata", "title", "summary", delAddr1, true) + require.NoError(t, err) proposalIDBz := make([]byte, 8) binary.LittleEndian.PutUint64(proposalIDBz, 1) deposit := v1beta1.NewDeposit(1, delAddr1, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.OneInt()))) vote := v1beta1.NewVote(1, delAddr1, v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes)) - proposalBzA, err := cdc.Marshal(&proposalA) - require.NoError(t, err) - proposalBzB, err := cdc.Marshal(&proposalB) - require.NoError(t, err) - tests := []struct { name string kvA, kvB kv.Pair @@ -53,11 +53,17 @@ func TestDecodeStore(t *testing.T) { wantPanic bool }{ { - "proposals", - kv.Pair{Key: types.ProposalKey(1), Value: proposalBzA}, - kv.Pair{Key: types.ProposalKey(2), Value: proposalBzB}, + "proposals v1beta", + kv.Pair{Key: types.ProposalKey(1), Value: cdc.MustMarshal(&proposalA)}, + kv.Pair{Key: types.ProposalKey(2), Value: cdc.MustMarshal(&proposalB)}, fmt.Sprintf("%v\n%v", proposalA, proposalB), false, }, + { + "proposals v1", + kv.Pair{Key: types.ProposalKey(3), Value: cdc.MustMarshal(&proposalC)}, + kv.Pair{Key: types.ProposalKey(4), Value: cdc.MustMarshal(&proposalD)}, + fmt.Sprintf("%v\n%v", proposalC, proposalD), false, + }, { "proposal IDs", kv.Pair{Key: types.InactiveProposalQueueKey(1, endTime), Value: proposalIDBz}, diff --git a/x/gov/simulation/genesis.go b/x/gov/simulation/genesis.go index c44071de674f..ee149a32a5da 100644 --- a/x/gov/simulation/genesis.go +++ b/x/gov/simulation/genesis.go @@ -28,17 +28,28 @@ const ( TallyParamsVeto = "tally_params_veto" // NOTE: backport from v50 - MinDepositRatio = "min_deposit_ratio" + MinDepositRatio = "min_deposit_ratio" + ExpeditedMinDeposit = "expedited_min_deposit" + ExpeditedVotingPeriod = "expedited_voting_period" + ExpeditedThreshold = "expedited_threshold" + + // ExpeditedThreshold must be at least as large as the regular Threshold + // Therefore, we use this break out point in randomization. + tallyNonExpeditedMax = 500 + + // Similarly, expedited voting period must be strictly less than the regular + // voting period to be valid. Therefore, we use this break out point in randomization. + expeditedMaxVotingPeriod = 60 * 60 * 24 * 2 ) -// GenDepositParamsDepositPeriod returns randomized DepositParamsDepositPeriod -func GenDepositParamsDepositPeriod(r *rand.Rand) time.Duration { +// GenDepositPeriod returns randomized DepositPeriod +func GenDepositPeriod(r *rand.Rand) time.Duration { return time.Duration(simulation.RandIntBetween(r, 1, 2*60*60*24*2)) * time.Second } -// GenDepositParamsMinDeposit returns randomized DepositParamsMinDeposit -func GenDepositParamsMinDeposit(r *rand.Rand) sdk.Coins { - return sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, int64(simulation.RandIntBetween(r, 1, 1e3)))) +// GenMinDeposit returns randomized MinDeposit +func GenMinDeposit(r *rand.Rand, bondDenom string) sdk.Coins { + return sdk.NewCoins(sdk.NewInt64Coin(bondDenom, int64(simulation.RandIntBetween(r, 1, 1e3/2)))) } // GenDepositMinInitialRatio returns randomized DepositMinInitialRatio @@ -47,22 +58,23 @@ func GenDepositMinInitialDepositRatio(r *rand.Rand) sdk.Dec { } // GenVotingParamsVotingPeriod returns randomized VotingParamsVotingPeriod -func GenVotingParamsVotingPeriod(r *rand.Rand) time.Duration { - return time.Duration(simulation.RandIntBetween(r, 1, 2*60*60*24*2)) * time.Second +// GenVotingPeriod returns randomized VotingPeriod +func GenVotingPeriod(r *rand.Rand) time.Duration { + return time.Duration(simulation.RandIntBetween(r, expeditedMaxVotingPeriod, 2*expeditedMaxVotingPeriod)) * time.Second } -// GenTallyParamsQuorum returns randomized TallyParamsQuorum -func GenTallyParamsQuorum(r *rand.Rand) math.LegacyDec { +// GenQuorum returns randomized Quorum +func GenQuorum(r *rand.Rand) math.LegacyDec { return sdk.NewDecWithPrec(int64(simulation.RandIntBetween(r, 334, 500)), 3) } -// GenTallyParamsThreshold returns randomized TallyParamsThreshold -func GenTallyParamsThreshold(r *rand.Rand) math.LegacyDec { - return sdk.NewDecWithPrec(int64(simulation.RandIntBetween(r, 450, 550)), 3) +// GenThreshold returns randomized Threshold +func GenThreshold(r *rand.Rand) math.LegacyDec { + return sdk.NewDecWithPrec(int64(simulation.RandIntBetween(r, 450, tallyNonExpeditedMax+1)), 3) } -// GenTallyParamsVeto returns randomized TallyParamsVeto -func GenTallyParamsVeto(r *rand.Rand) math.LegacyDec { +// GenVeto returns randomized Veto +func GenVeto(r *rand.Rand) math.LegacyDec { return sdk.NewDecWithPrec(int64(simulation.RandIntBetween(r, 250, 334)), 3) } @@ -71,6 +83,22 @@ func GenMinDepositRatio(r *rand.Rand) math.LegacyDec { return math.LegacyMustNewDecFromStr("0.01") } +// GenExpeditedMinDeposit returns randomized ExpeditedMinDeposit +// It is always greater than GenMinDeposit +func GenExpeditedMinDeposit(r *rand.Rand, bondDenom string) sdk.Coins { + return sdk.NewCoins(sdk.NewInt64Coin(bondDenom, int64(simulation.RandIntBetween(r, 1e3/2, 1e3)))) +} + +// GenExpeditedThreshold randomized ExpeditedThreshold +func GenExpeditedThreshold(r *rand.Rand) sdk.Dec { + return sdk.NewDecWithPrec(int64(simulation.RandIntBetween(r, tallyNonExpeditedMax, 550)), 3) +} + +// GenExpeditedVotingPeriod randomized ExpeditedVotingPeriod +func GenExpeditedVotingPeriod(r *rand.Rand) time.Duration { + return time.Duration(simulation.RandIntBetween(r, 1, expeditedMaxVotingPeriod)) * time.Second +} + // RandomizedGenState generates a random GenesisState for gov func RandomizedGenState(simState *module.SimulationState) { startingProposalID := uint64(simState.Rand.Intn(100)) @@ -78,13 +106,13 @@ func RandomizedGenState(simState *module.SimulationState) { var minDeposit sdk.Coins simState.AppParams.GetOrGenerate( simState.Cdc, DepositParamsMinDeposit, &minDeposit, simState.Rand, - func(r *rand.Rand) { minDeposit = GenDepositParamsMinDeposit(r) }, + func(r *rand.Rand) { minDeposit = GenMinDeposit(r, sdk.DefaultBondDenom) }, ) var depositPeriod time.Duration simState.AppParams.GetOrGenerate( simState.Cdc, DepositParamsDepositPeriod, &depositPeriod, simState.Rand, - func(r *rand.Rand) { depositPeriod = GenDepositParamsDepositPeriod(r) }, + func(r *rand.Rand) { depositPeriod = GenDepositPeriod(r) }, ) var minInitialDepositRatio sdk.Dec @@ -96,33 +124,54 @@ func RandomizedGenState(simState *module.SimulationState) { var votingPeriod time.Duration simState.AppParams.GetOrGenerate( simState.Cdc, VotingParamsVotingPeriod, &votingPeriod, simState.Rand, - func(r *rand.Rand) { votingPeriod = GenVotingParamsVotingPeriod(r) }, + func(r *rand.Rand) { votingPeriod = GenVotingPeriod(r) }, ) var quorum sdk.Dec simState.AppParams.GetOrGenerate( simState.Cdc, TallyParamsQuorum, &quorum, simState.Rand, - func(r *rand.Rand) { quorum = GenTallyParamsQuorum(r) }, + func(r *rand.Rand) { quorum = GenQuorum(r) }, ) var threshold sdk.Dec simState.AppParams.GetOrGenerate( simState.Cdc, TallyParamsThreshold, &threshold, simState.Rand, - func(r *rand.Rand) { threshold = GenTallyParamsThreshold(r) }, + func(r *rand.Rand) { threshold = GenThreshold(r) }, ) var veto sdk.Dec simState.AppParams.GetOrGenerate( simState.Cdc, TallyParamsVeto, &veto, simState.Rand, - func(r *rand.Rand) { veto = GenTallyParamsVeto(r) }, + func(r *rand.Rand) { veto = GenVeto(r) }, ) var minDepositRatio math.LegacyDec - simState.AppParams.GetOrGenerate(simState.Cdc, MinDepositRatio, &minDepositRatio, simState.Rand, func(r *rand.Rand) { minDepositRatio = GenMinDepositRatio(r) }) + simState.AppParams.GetOrGenerate( + simState.Cdc, MinDepositRatio, &minDepositRatio, simState.Rand, + func(r *rand.Rand) { minDepositRatio = GenMinDepositRatio(r) }) + + var expeditedMinDeposit sdk.Coins + simState.AppParams.GetOrGenerate( + simState.Cdc, ExpeditedMinDeposit, &expeditedMinDeposit, simState.Rand, + func(r *rand.Rand) { expeditedMinDeposit = GenExpeditedMinDeposit(r, sdk.DefaultBondDenom) }, + ) + + var expitedVotingThreshold sdk.Dec + simState.AppParams.GetOrGenerate( + simState.Cdc, ExpeditedThreshold, &expitedVotingThreshold, simState.Rand, + func(r *rand.Rand) { expitedVotingThreshold = GenExpeditedThreshold(r) }, + ) + + var expeditedVotingPeriod time.Duration + simState.AppParams.GetOrGenerate( + simState.Cdc, ExpeditedVotingPeriod, &expeditedVotingPeriod, simState.Rand, + func(r *rand.Rand) { expeditedVotingPeriod = GenExpeditedVotingPeriod(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, minDepositRatio.String()), + v1.NewParams(minDeposit, expeditedMinDeposit, depositPeriod, votingPeriod, expeditedVotingPeriod, quorum.String(), threshold.String(), expitedVotingThreshold.String(), veto.String(), minInitialDepositRatio.String(), + simState.Rand.Intn(2) == 0, simState.Rand.Intn(2) == 0, simState.Rand.Intn(2) == 0, minDepositRatio.String()), ) bz, err := json.MarshalIndent(&govGenesis, "", " ") diff --git a/x/gov/simulation/genesis_test.go b/x/gov/simulation/genesis_test.go index f7bd89cbb690..960f30e87e0b 100644 --- a/x/gov/simulation/genesis_test.go +++ b/x/gov/simulation/genesis_test.go @@ -41,16 +41,20 @@ func TestRandomizedGenState(t *testing.T) { var govGenesis v1.GenesisState simState.Cdc.MustUnmarshalJSON(simState.GenState[types.ModuleName], &govGenesis) + // values below are hardcoded + // changing s := rand.NewSource() will change the values const ( - tallyQuorum = "0.400000000000000000" - tallyThreshold = "0.539000000000000000" - tallyVetoThreshold = "0.314000000000000000" - minInitialDepositDec = "0.590000000000000000" + tallyQuorum = "0.400000000000000000" + tallyThreshold = "0.458000000000000000" + tallyVetoThreshold = "0.314000000000000000" + tallyExpeditedThreshold = "0.511000000000000000" + minInitialDepositDec = "0.590000000000000000" ) - require.Equal(t, "905stake", govGenesis.Params.MinDeposit[0].String()) + require.Equal(t, "272stake", govGenesis.Params.MinDeposit[0].String()) + require.Equal(t, "774stake", govGenesis.Params.ExpeditedMinDeposit[0].String()) require.Equal(t, "77h26m10s", govGenesis.Params.MaxDepositPeriod.String()) - require.Equal(t, float64(275567), govGenesis.Params.VotingPeriod.Seconds()) + require.Equal(t, float64(270511), 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) @@ -58,6 +62,8 @@ func TestRandomizedGenState(t *testing.T) { require.Equal(t, []*v1.Deposit{}, govGenesis.Deposits) require.Equal(t, []*v1.Vote{}, govGenesis.Votes) require.Equal(t, []*v1.Proposal{}, govGenesis.Proposals) + require.Equal(t, float64(97488), govGenesis.Params.ExpeditedVotingPeriod.Seconds()) + require.Equal(t, tallyExpeditedThreshold, govGenesis.Params.ExpeditedThreshold) } // TestRandomizedGenState tests abnormal scenarios of applying RandomizedGenState. diff --git a/x/gov/simulation/operations.go b/x/gov/simulation/operations.go index 5ad4f3700bfc..eb58de84010d 100644 --- a/x/gov/simulation/operations.go +++ b/x/gov/simulation/operations.go @@ -15,6 +15,8 @@ import ( "github.com/cosmos/cosmos-sdk/x/gov/types" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" "github.com/cosmos/cosmos-sdk/x/simulation" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) var initialProposalID = uint64(100000000000000) @@ -189,7 +191,8 @@ func simulateMsgSubmitProposal(ak types.AccountKeeper, bk types.BankKeeper, k *k chainID string, ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { simAccount, _ := simtypes.RandomAcc(r, accs) - deposit, skip, err := randomDeposit(r, ctx, ak, bk, k, simAccount.Address, true) + expedited := r.Intn(2) == 0 + deposit, skip, err := randomDeposit(r, ctx, ak, bk, k, simAccount.Address, true, expedited) switch { case skip: return simtypes.NoOpMsg(types.ModuleName, TypeMsgSubmitProposal, "skip deposit"), nil, nil @@ -204,6 +207,7 @@ func simulateMsgSubmitProposal(ak types.AccountKeeper, bk types.BankKeeper, k *k simtypes.RandStringOfLength(r, 100), simtypes.RandStringOfLength(r, 100), simtypes.RandStringOfLength(r, 100), + expedited, ) if err != nil { return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to generate a submit proposal msg"), nil, err @@ -275,8 +279,11 @@ func SimulateMsgDeposit(ak types.AccountKeeper, bk types.BankKeeper, k *keeper.K if !ok { return simtypes.NoOpMsg(types.ModuleName, TypeMsgDeposit, "unable to generate proposalID"), nil, nil } - - deposit, skip, err := randomDeposit(r, ctx, ak, bk, k, simAccount.Address, false) + p, found := k.GetProposal(ctx, proposalID) + if !found { + return simtypes.NoOpMsg(types.ModuleName, TypeMsgDeposit, "unable to get proposal"), nil, sdkerrors.ErrNotFound + } + deposit, skip, err := randomDeposit(r, ctx, ak, bk, k, simAccount.Address, false, p.Expedited) switch { case skip: return simtypes.NoOpMsg(types.ModuleName, TypeMsgDeposit, "skip deposit"), nil, nil @@ -431,6 +438,7 @@ func randomDeposit( k *keeper.Keeper, addr sdk.AccAddress, useMinAmount bool, + expedited bool, ) (deposit sdk.Coins, skip bool, err error) { account := ak.GetAccount(ctx, addr) spendable := bk.SpendableCoins(ctx, account.GetAddress()) @@ -441,6 +449,9 @@ func randomDeposit( params := k.GetParams(ctx) minDeposit := params.MinDeposit + if expedited { + minDeposit = params.ExpeditedMinDeposit + } denomIndex := r.Intn(len(minDeposit)) denom := minDeposit[denomIndex].Denom @@ -474,8 +485,8 @@ func randomDeposit( } amount = amount.Add(minAmount) - // NOTE: backport from v50 - amount = amount.MulRaw(3) // 3x what's required // TODO: this is a hack, we need to be able to calculate the correct amount using params + // // NOTE: backport from v50 + // amount = amount.MulRaw(3) // 3x what's required // TODO: this is a hack, we need to be able to calculate the correct amount using params if amount.GT(spendableBalance) || amount.LT(threshold) { return nil, true, nil diff --git a/x/gov/simulation/operations_test.go b/x/gov/simulation/operations_test.go index b7dfb41cc42f..0086d3ab0874 100644 --- a/x/gov/simulation/operations_test.go +++ b/x/gov/simulation/operations_test.go @@ -152,7 +152,7 @@ func TestSimulateMsgSubmitProposal(t *testing.T) { require.True(t, operationMsg.OK) require.Equal(t, "cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", msg.Proposer) require.NotEqual(t, len(msg.InitialDeposit), 0) - require.Equal(t, "1682907stake", msg.InitialDeposit[0].String()) + require.Equal(t, "47841094stake", msg.InitialDeposit[0].String()) require.Equal(t, simulation.TypeMsgSubmitProposal, sdk.MsgTypeURL(&msg)) } @@ -182,11 +182,14 @@ func TestSimulateMsgSubmitLegacyProposal(t *testing.T) { require.True(t, operationMsg.OK) require.Equal(t, "cosmos1p8wcgrjr4pjju90xg6u9cgq55dxwq8j7u4x9a0", msg.Proposer) require.NotEqual(t, len(msg.InitialDeposit), 0) - require.Equal(t, "8058033stake", msg.InitialDeposit[0].String()) + require.Equal(t, "25166256stake", msg.InitialDeposit[0].String()) require.Equal(t, "title-3: ZBSpYuLyYggwexjxusrBqDOTtGTOWeLrQKjLxzIivHSlcxgdXhhuTSkuxKGLwQvuyNhYFmBZHeAerqyNEUzXPFGkqEGqiQWIXnku", msg.Messages[0].GetCachedValue().(*v1.MsgExecLegacyContent).Content.GetCachedValue().(v1beta1.Content).GetTitle()) require.Equal(t, "description-3: NJWzHdBNpAXKJPHWQdrGYcAHSctgVlqwqHoLfHsXUdStwfefwzqLuKEhmMyYLdbZrcPgYqjNHxPexsruwEGStAneKbWkQDDIlCWBLSiAASNhZqNFlPtfqPJoxKsgMdzjWqLWdqKQuJqWPMvwPQWZUtVMOTMYKJbfdlZsjdsomuScvDmbDkgRualsxDvRJuCAmPOXitIbcyWsKGSdrEunFAOdmXnsuyFVgJqEjbklvmwrUlsxjRSfKZxGcpayDdgoFcnVSutxjRgOSFzPwidAjubMncNweqpbxhXGchpZUxuFDOtpnhNUycJICRYqsPhPSCjPTWZFLkstHWJxvdPEAyEIxXgLwbNOjrgzmaujiBABBIXvcXpLrbcEWNNQsbjvgJFgJkflpRohHUutvnaUqoopuKjTDaemDeSdqbnOzcfJpcTuAQtZoiLZOoAIlboFDAeGmSNwkvObPRvRWQgWkGkxwtPauYgdkmypLjbqhlHJIQTntgWjXwZdOyYEdQRRLfMSdnxqppqUofqLbLQDUjwKVKfZJUJQPsWIPwIVaSTrmKskoAhvmZyJgeRpkaTfGgrJzAigcxtfshmiDCFkuiluqtMOkidknnTBtumyJYlIsWLnCQclqdVmikUoMOPdPWwYbJxXyqUVicNxFxyqJTenNblyyKSdlCbiXxUiYUiMwXZASYfvMDPFgxniSjWaZTjHkqlJvtBsXqwPpyVxnJVGFWhfSxgOcduoxkiopJvFjMmFabrGYeVtTXLhxVUEiGwYUvndjFGzDVntUvibiyZhfMQdMhgsiuysLMiePBNXifRLMsSmXPkwlPloUbJveCvUlaalhZHuvdkCnkSHb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iWfPTCezUjYcdWppnsYJihLQCqbNLRGgqrwHuIvsazapTpoPZIyZyeeSueJuTIhpHMEJfJpScshJubJGfkusuVBgfTWQoywSSliQQSfbvaHKiLnyjdSbpMkdBgXepoSsHnCQaYuHQqZsoEOmJCiuQUpJkmfyfbIShzlZpHFmLCsbknEAkKXKfRTRnuwdBeuOGgFbJLbDksHVapaRayWzwoYBEpmrlAxrUxYMUekKbpjPNfjUCjhbdMAnJmYQVZBQZkFVweHDAlaqJjRqoQPoOMLhyvYCzqEuQsAFoxWrzRnTVjStPadhsESlERnKhpEPsfDxNvxqcOyIulaCkmPdambLHvGhTZzysvqFauEgkFRItPfvisehFmoBhQqmkfbHVsgfHXDPJVyhwPllQpuYLRYvGodxKjkarnSNgsXoKEMlaSKxKdcVgvOkuLcfLFfdtXGTclqfPOfeoVLbqcjcXCUEBgAGplrkgsmIEhWRZLlGPGCwKWRaCKMkBHTAcypUrYjWwCLtOPVygMwMANGoQwFnCqFrUGMCRZUGJKTZIGPyldsifauoMnJPLTcDHmilcmahlqOELaAUYDBuzsVywnDQfwRLGIWozYaOAilMBcObErwgTDNGWnwQMUgFFSKtPDMEoEQCTKVREqrXZSGLqwTMcxHfWotDllNkIJPMbXzjDVjPOOjCFuIvTyhXKLyhUScOXvYthRXpPfKwMhptXaxIxgqBoUqzrWbaoLTVpQoottZyPFfNOoMioXHRuFwMRYUiKvcWPkrayyTLOCFJlAyslDameIuqVAuxErqFPEWIScKpBORIuZqoXlZuTvAjEdlEWDODFRregDTqGNoFBIHxvimmIZwLfFyKUfEWAnNBdtdzDmTPXtpHRGdIbuucfTjOygZsTxPjfweXhSUkMhPjMaxKlMIJMOXcnQfyzeOcbWwNbeH", msg.Messages[0].GetCachedValue().(*v1.MsgExecLegacyContent).Content.GetCachedValue().(v1beta1.Content).GetDescription()) require.Equal(t, "gov", msg.Route()) require.Equal(t, simulation.TypeMsgSubmitProposal, msg.Type()) + + // TODO: check + require.Equal(t, simulation.TypeMsgSubmitProposal, sdk.MsgTypeURL(&msg)) } // TestSimulateMsgDeposit tests the normal scenario of a valid message of type TypeMsgDeposit. @@ -210,7 +213,7 @@ func TestSimulateMsgDeposit(t *testing.T) { submitTime := ctx.BlockHeader().Time depositPeriod := suite.GovKeeper.GetParams(ctx).MaxDepositPeriod - proposal, err := v1.NewProposal([]sdk.Msg{contentMsg}, 1, submitTime, submitTime.Add(*depositPeriod), "", "text proposal", "description", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r")) + proposal, err := v1.NewProposal([]sdk.Msg{contentMsg}, 1, submitTime, submitTime.Add(*depositPeriod), "", "text proposal", "description", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), false) require.NoError(t, err) suite.GovKeeper.SetProposal(ctx, proposal) @@ -231,7 +234,7 @@ func TestSimulateMsgDeposit(t *testing.T) { require.Equal(t, uint64(1), msg.ProposalId) require.Equal(t, "cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", msg.Depositor) require.NotEqual(t, len(msg.Amount), 0) - require.Equal(t, "1682907stake", msg.Amount[0].String()) + require.Equal(t, "560969stake", msg.Amount[0].String()) require.Equal(t, "gov", msg.Route()) require.Equal(t, simulation.TypeMsgDeposit, msg.Type()) } @@ -257,7 +260,7 @@ func TestSimulateMsgVote(t *testing.T) { submitTime := ctx.BlockHeader().Time depositPeriod := suite.GovKeeper.GetParams(ctx).MaxDepositPeriod - proposal, err := v1.NewProposal([]sdk.Msg{contentMsg}, 1, submitTime, submitTime.Add(*depositPeriod), "", "text proposal", "description", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r")) + proposal, err := v1.NewProposal([]sdk.Msg{contentMsg}, 1, submitTime, submitTime.Add(*depositPeriod), "", "text proposal", "description", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), false) require.NoError(t, err) suite.GovKeeper.ActivateVotingPeriod(ctx, proposal) @@ -301,7 +304,7 @@ func TestSimulateMsgVoteWeighted(t *testing.T) { submitTime := ctx.BlockHeader().Time depositPeriod := suite.GovKeeper.GetParams(ctx).MaxDepositPeriod - proposal, err := v1.NewProposal([]sdk.Msg{contentMsg}, 1, submitTime, submitTime.Add(*depositPeriod), "", "text proposal", "test", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r")) + proposal, err := v1.NewProposal([]sdk.Msg{contentMsg}, 1, submitTime, submitTime.Add(*depositPeriod), "", "text proposal", "test", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), false) require.NoError(t, err) suite.GovKeeper.ActivateVotingPeriod(ctx, proposal) diff --git a/x/gov/types/events.go b/x/gov/types/events.go index 709d5b02c70a..5fb201b5607a 100644 --- a/x/gov/types/events.go +++ b/x/gov/types/events.go @@ -14,6 +14,7 @@ const ( AttributeKeyOption = "option" AttributeKeyProposalID = "proposal_id" AttributeKeyProposalMessages = "proposal_messages" // Msg type_urls in the proposal + AttributeKeyProposalLog = "proposal_log" // log of proposal execution AttributeKeyVotingPeriodStart = "voting_period_start" AttributeValueProposalDropped = "proposal_dropped" // didn't meet min deposit AttributeValueProposalPassed = "proposal_passed" // met vote quorum @@ -22,4 +23,7 @@ const ( AttributeKeyProposalType = "proposal_type" AttributeSignalTitle = "signal_title" AttributeSignalDescription = "signal_description" + + AttributeValueExpeditedProposalRejected = "expedited_proposal_rejected" // didn't meet expedited vote quorum + ) diff --git a/x/gov/types/v1/gov.pb.go b/x/gov/types/v1/gov.pb.go index 3adf4af91017..c2d3029f67d1 100644 --- a/x/gov/types/v1/gov.pb.go +++ b/x/gov/types/v1/gov.pb.go @@ -273,10 +273,14 @@ type Proposal struct { // // Since: cosmos-sdk 0.47 Summary string `protobuf:"bytes,12,opt,name=summary,proto3" json:"summary,omitempty"` - // Proposer is the address of the proposal sumbitter + // proposer is the address of the proposal sumbitter // // Since: cosmos-sdk 0.47 Proposer string `protobuf:"bytes,13,opt,name=proposer,proto3" json:"proposer,omitempty"` + // expedited defines if the proposal is expedited + // + // NOTE: backported from v50 (https://github.com/cosmos/cosmos-sdk/pull/14720) + Expedited bool `protobuf:"varint,14,opt,name=expedited,proto3" json:"expedited,omitempty"` } func (m *Proposal) Reset() { *m = Proposal{} } @@ -403,6 +407,13 @@ func (m *Proposal) GetProposer() string { return "" } +func (m *Proposal) GetExpedited() bool { + if m != nil { + return m.Expedited + } + return false +} + // TallyResult defines a standard tally for a governance proposal. type TallyResult struct { // yes_count is the number of yes votes on a proposal. @@ -739,6 +750,18 @@ type Params struct { 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"` + // Duration of the voting period of an expedited proposal. + // + // NOTE: backported from v50 (https://github.com/cosmos/cosmos-sdk/pull/14720) + ExpeditedVotingPeriod *time.Duration `protobuf:"bytes,10,opt,name=expedited_voting_period,json=expeditedVotingPeriod,proto3,stdduration" json:"expedited_voting_period,omitempty"` + // Minimum proportion of Yes votes for proposal to pass. Default value: 0.67. + // + // NOTE: backported from v50 (https://github.com/cosmos/cosmos-sdk/pull/14720) + ExpeditedThreshold string `protobuf:"bytes,11,opt,name=expedited_threshold,json=expeditedThreshold,proto3" json:"expedited_threshold,omitempty"` + // Minimum expedited deposit for a proposal to enter voting period. + // + // NOTE: backported from v50 (https://github.com/cosmos/cosmos-sdk/pull/14720) + ExpeditedMinDeposit []types.Coin `protobuf:"bytes,12,rep,name=expedited_min_deposit,json=expeditedMinDeposit,proto3" json:"expedited_min_deposit"` // 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 @@ -836,6 +859,27 @@ func (m *Params) GetMinInitialDepositRatio() string { return "" } +func (m *Params) GetExpeditedVotingPeriod() *time.Duration { + if m != nil { + return m.ExpeditedVotingPeriod + } + return nil +} + +func (m *Params) GetExpeditedThreshold() string { + if m != nil { + return m.ExpeditedThreshold + } + return "" +} + +func (m *Params) GetExpeditedMinDeposit() []types.Coin { + if m != nil { + return m.ExpeditedMinDeposit + } + return nil +} + func (m *Params) GetBurnVoteQuorum() bool { if m != nil { return m.BurnVoteQuorum @@ -881,88 +925,92 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1/gov.proto", fileDescriptor_e05cb1c0d030febb) } var fileDescriptor_e05cb1c0d030febb = []byte{ - // 1294 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0x4f, 0x73, 0xd3, 0xd6, - 0x16, 0x8f, 0x6c, 0xd9, 0x71, 0x8e, 0x63, 0x47, 0x5c, 0xf2, 0x40, 0x09, 0xc4, 0x0e, 0x1e, 0x86, - 0xc9, 0xe3, 0x8f, 0xfd, 0x02, 0x8f, 0xb7, 0x78, 0x74, 0xe3, 0xc4, 0xa2, 0x88, 0xa1, 0xb1, 0x2b, - 0x8b, 0x30, 0x74, 0xa3, 0x91, 0xa3, 0x8b, 0x73, 0xa7, 0x96, 0xae, 0x2b, 0x5d, 0x1b, 0xfc, 0x11, - 0x3a, 0xdd, 0xb0, 0xec, 0x74, 0xd5, 0x65, 0x97, 0x5d, 0x30, 0xdd, 0x77, 0xc7, 0xaa, 0xc3, 0xb0, - 0x69, 0xbb, 0xa1, 0x1d, 0x58, 0x74, 0x86, 0x4f, 0xd1, 0xb9, 0x57, 0x57, 0xb6, 0xe3, 0xb8, 0x93, - 0xc0, 0x26, 0x91, 0xce, 0xf9, 0xfd, 0xce, 0xff, 0x73, 0xaf, 0x0c, 0xe7, 0x0f, 0x68, 0xe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48, 0x13, 0xb3, 0x51, - 0xdb, 0xc9, 0x0c, 0xee, 0xa8, 0xcf, 0xff, 0x28, 0x2b, 0x16, 0xc4, 0x24, 0x2e, 0x46, 0xf7, 0x41, - 0x93, 0xd5, 0x75, 0x70, 0xe0, 0xc5, 0x76, 0xb2, 0xa7, 0xb4, 0x53, 0x94, 0x4c, 0x23, 0xf0, 0x84, - 0x2d, 0x13, 0x0a, 0x8c, 0x32, 0xb7, 0xe7, 0x48, 0xb9, 0xbe, 0xf8, 0x01, 0x3d, 0x5a, 0x16, 0xd4, - 0x64, 0x80, 0x1e, 0xc0, 0x99, 0x21, 0x65, 0x24, 0xe8, 0x3a, 0x11, 0x73, 0x43, 0x99, 0x5f, 0xee, - 0x94, 0x71, 0xad, 0xc4, 0xd4, 0x36, 0x67, 0x8a, 0xc0, 0xee, 0x81, 0x14, 0x4d, 0x72, 0x5c, 0x3a, - 0xa5, 0xad, 0x42, 0x4c, 0x4c, 0x52, 0x5c, 0xe7, 0x43, 0xc2, 0x5c, 0xcf, 0x65, 0xae, 0x0e, 0x7c, - 0x6c, 0xad, 0xf1, 0x3b, 0x5a, 0x85, 0x0c, 0x23, 0xac, 0x87, 0xf5, 0xbc, 0x50, 0xc4, 0x2f, 0x48, - 0x87, 0xc5, 0x68, 0xe0, 0xfb, 0x6e, 0x38, 0xd2, 0x97, 0x85, 0x3c, 0x79, 0x45, 0xff, 0x85, 0x5c, - 0xbc, 0x11, 0x38, 0xd4, 0x0b, 0x27, 0xac, 0xc0, 0x18, 0x59, 0xf9, 0x55, 0x81, 0xfc, 0xf4, 0x0c, - 0x5c, 0x83, 0xa5, 0x11, 0x8e, 0x9c, 0x03, 0xb1, 0x14, 0xca, 0xb1, 0x0d, 0x35, 0x03, 0x66, 0xe5, - 0x46, 0x38, 0xda, 0xe5, 0x7a, 0x74, 0x0b, 0x0a, 0x6e, 0x27, 0x62, 0x2e, 0x09, 0x24, 0x21, 0x35, - 0x97, 0xb0, 0x2c, 0x41, 0x31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 0x6b, 0x1b, 0x0d, 0x4d, 0x9d, 0xc7, 0xbc, 0x5b, 0x37, 0x1f, - 0x18, 0x0d, 0x2d, 0xb3, 0x63, 0xbc, 0x7c, 0x5b, 0x52, 0x5e, 0xbd, 0x2d, 0x29, 0x7f, 0xbe, 0x2d, - 0x29, 0xcf, 0xdf, 0x95, 0x16, 0x5e, 0xbd, 0x2b, 0x2d, 0xfc, 0xf6, 0xae, 0xb4, 0xf0, 0xc5, 0xb5, - 0x2e, 0x61, 0x87, 0x83, 0x4e, 0xf5, 0x80, 0xfa, 0xf2, 0x53, 0x5b, 0xfe, 0xbb, 0x11, 0x79, 0x5f, - 0xd6, 0x9e, 0x89, 0x9f, 0x0f, 0x6c, 0xd4, 0xc7, 0x11, 0xff, 0x6d, 0x90, 0x15, 0x1b, 0x77, 0xeb, - 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0x4c, 0x82, 0xde, 0x1e, 0x5c, 0x0c, 0x00, 0x00, + // 1360 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0xcd, 0x6e, 0xdb, 0xc6, + 0x16, 0x36, 0x2d, 0x59, 0x96, 0x8e, 0x7e, 0xcc, 0x4c, 0x9c, 0x98, 0x76, 0x62, 0xc9, 0x11, 0x82, + 0xc0, 0x37, 0x3f, 0xd2, 0x75, 0x72, 0x73, 0x17, 0x37, 0x17, 0x28, 0x64, 0x8b, 0x69, 0x18, 0x24, + 0x96, 0x4a, 0x31, 0x72, 0xd3, 0x0d, 0x41, 0x99, 0x13, 0x99, 0xa8, 0xc8, 0x51, 0xc9, 0x91, 0x62, + 0x3d, 0x42, 0x77, 0x59, 0x16, 0x5d, 0x75, 0xd9, 0x65, 0x17, 0x41, 0x9f, 0x21, 0xab, 0x22, 0xc8, + 0xa6, 0xed, 0x26, 0x29, 0x92, 0x45, 0x81, 0xbc, 0x44, 0x8b, 0x19, 0x0e,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x60, 0x10, 0x9d, 0x23, 0x74, 0x99, 0xb3, + 0x26, 0x24, 0xa8, 0x06, 0xd9, 0x60, 0xd0, 0x71, 0x1d, 0x6a, 0xb2, 0x36, 0x53, 0x16, 0x84, 0x89, + 0x69, 0xaf, 0x8d, 0xa8, 0x07, 0xb7, 0x93, 0x2f, 0xde, 0x95, 0x24, 0x1d, 0x42, 0x12, 0x13, 0xa3, + 0x87, 0x20, 0x8b, 0xec, 0x9a, 0xd8, 0xb3, 0x43, 0x3b, 0xa9, 0x53, 0xda, 0x29, 0x08, 0xa6, 0xea, + 0xd9, 0xdc, 0x96, 0x06, 0x79, 0x4a, 0xa8, 0xd5, 0x33, 0x85, 0x5c, 0x59, 0x3c, 0x43, 0x8d, 0x72, + 0x9c, 0x1a, 0x35, 0xd0, 0x23, 0x38, 0x37, 0x24, 0xd4, 0xf1, 0xba, 0x66, 0x40, 0x2d, 0x5f, 0xc4, + 0x97, 0x3e, 0xa5, 0x5f, 0x4b, 0x21, 0xb5, 0xc5, 0x98, 0xdc, 0xb1, 0x07, 0x20, 0x44, 0x71, 0x8c, + 0x99, 0x53, 0xda, 0xca, 0x87, 0xc4, 0x28, 0xc4, 0x35, 0xd6, 0x24, 0xd4, 0xb2, 0x2d, 0x6a, 0x29, + 0xc0, 0xda, 0x56, 0x1f, 0x3f, 0xa3, 0x65, 0x58, 0xa0, 0x0e, 0xed, 0x61, 0x25, 0xcb, 0x15, 0xe1, + 0x03, 0x52, 0x60, 0x31, 0x18, 0xb8, 0xae, 0xe5, 0x8f, 0x94, 0x1c, 0x97, 0x47, 0x8f, 0xe8, 0x3f, + 0x90, 0x0e, 0x27, 0x02, 0xfb, 0x4a, 0xfe, 0x84, 0x11, 0x18, 0x23, 0xd1, 0x65, 0xc8, 0xe0, 0xc3, + 0x3e, 0xb6, 0x1d, 0x8a, 0x6d, 0xa5, 0xb0, 0x21, 0x6d, 0xa6, 0xf5, 0x58, 0x50, 0xfe, 0x55, 0x82, + 0xec, 0x64, 0x87, 0xdc, 0x80, 0xcc, 0x08, 0x07, 0xe6, 0x3e, 0x1f, 0x19, 0xe9, 0xd8, 0xfc, 0x6a, + 0x1e, 0xd5, 0xd3, 0x23, 0x1c, 0xec, 0x30, 0x3d, 0xba, 0x03, 0x79, 0xab, 0x13, 0x50, 0xcb, 0xf1, + 0x04, 0x61, 0x7e, 0x26, 0x21, 0x27, 0x40, 0x21, 0xe9, 0x5f, 0x90, 0xf6, 0x88, 0xc0, 0x27, 0x66, + 0xe2, 0x17, 0x3d, 0x12, 0x42, 0xef, 0x01, 0xf2, 0x88, 0xf9, 0xdc, 0xa1, 0x07, 0xe6, 0x10, 0xd3, + 0x88, 0x94, 0x9c, 0x49, 0x5a, 0xf2, 0xc8, 0x9e, 0x43, 0x0f, 0xda, 0x98, 0x86, 0xe4, 0xf2, 0xcf, + 0x12, 0x24, 0xd9, 0x76, 0x3a, 0x79, 0xb7, 0x54, 0x60, 0x61, 0x48, 0x28, 0x3e, 0x79, 0xaf, 0x84, + 0x30, 0x74, 0x0f, 0x16, 0xc3, 0x55, 0x17, 0x28, 0x49, 0xde, 0xb0, 0x57, 0xa6, 0x86, 0xf0, 0xf8, + 0x1e, 0xd5, 0x23, 0xc6, 0x91, 0x86, 0x58, 0x38, 0xda, 0x10, 0x0f, 0x93, 0xe9, 0x84, 0x9c, 0x2c, + 0xff, 0x2e, 0x41, 0x5e, 0xb4, 0x75, 0xd3, 0xf2, 0x2d, 0x37, 0x40, 0x4f, 0x21, 0xeb, 0x3a, 0xde, + 0x78, 0x4a, 0xa4, 0x93, 0xa6, 0x64, 0x9d, 0x4d, 0xc9, 0xc7, 0xb7, 0xa5, 0x0b, 0x13, 0xac, 0x9b, + 0xc4, 0x75, 0x28, 0x76, 0xfb, 0x74, 0xa4, 0x83, 0xeb, 0x78, 0xd1, 0xdc, 0xb8, 0x80, 0x5c, 0xeb, + 0x30, 0x02, 0x99, 0x7d, 0xec, 0x3b, 0xc4, 0xe6, 0x89, 0x60, 0x27,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0x8c, 0x07, 0x66, 0x5b, 0x35, 0x1a, 0x72, 0xf2, 0xfa, 0x2f, + 0x12, 0x14, 0x8e, 0xbe, 0xe6, 0xa1, 0x12, 0x5c, 0x6a, 0xea, 0x8d, 0x66, 0xa3, 0x55, 0x7b, 0x64, + 0xb6, 0x8c, 0x9a, 0xf1, 0xa4, 0x35, 0xe5, 0x53, 0x19, 0x8a, 0xd3, 0x80, 0xba, 0xda, 0x6c, 0xb4, + 0x34, 0xc3, 0x6c, 0xaa, 0xba, 0xd6, 0xa8, 0xcb, 0x12, 0xba, 0x02, 0xeb, 0xd3, 0x98, 0x76, 0xc3, + 0xd0, 0x76, 0x3f, 0x8f, 0x20, 0xf3, 0x68, 0x0d, 0x2e, 0x4e, 0x43, 0x9a, 0xb5, 0x56, 0x4b, 0xad, + 0x87, 0x4e, 0x4f, 0xeb, 0x74, 0xf5, 0xa1, 0xba, 0x63, 0xa8, 0x75, 0x39, 0x39, 0x8b, 0x79, 0xbf, + 0xa6, 0x3d, 0x52, 0xeb, 0xf2, 0xc2, 0xb6, 0xfa, 0xea, 0x7d, 0x51, 0x7a, 0xfd, 0xbe, 0x28, 0xfd, + 0xf1, 0xbe, 0x28, 0xbd, 0xf8, 0x50, 0x9c, 0x7b, 0xfd, 0xa1, 0x38, 0xf7, 0xdb, 0x87, 0xe2, 0xdc, + 0x57, 0x37, 0xba, 0x0e, 0x3d, 0x18, 0x74, 0x2a, 0xfb, 0xc4, 0x15, 0x1f, 0x1f, 0xe2, 0xdf, 0xad, + 0xc0, 0xfe, 0xba, 0x7a, 0xc8, 0x3f, 0xa8, 0xe8, 0xa8, 0x8f, 0x03, 0xf6, 0xb5, 0x94, 0xe2, 0xd3, + 0x73, 0xe7, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0x14, 0x5f, 0xa3, 0x90, 0x6e, 0x0d, 0x00, 0x00, } func (m *WeightedVoteOption) Marshal() (dAtA []byte, err error) { @@ -1069,6 +1117,16 @@ func (m *Proposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Expedited { + i-- + if m.Expedited { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x70 + } if len(m.Proposer) > 0 { i -= len(m.Proposer) copy(dAtA[i:], m.Proposer) @@ -1480,6 +1538,37 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x68 } + if len(m.ExpeditedMinDeposit) > 0 { + for iNdEx := len(m.ExpeditedMinDeposit) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ExpeditedMinDeposit[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + } + } + if len(m.ExpeditedThreshold) > 0 { + i -= len(m.ExpeditedThreshold) + copy(dAtA[i:], m.ExpeditedThreshold) + i = encodeVarintGov(dAtA, i, uint64(len(m.ExpeditedThreshold))) + i-- + dAtA[i] = 0x5a + } + if m.ExpeditedVotingPeriod != nil { + n8, err8 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(*m.ExpeditedVotingPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.ExpeditedVotingPeriod):]) + if err8 != nil { + return 0, err8 + } + i -= n8 + i = encodeVarintGov(dAtA, i, uint64(n8)) + i-- + dAtA[i] = 0x52 + } if len(m.MinInitialDepositRatio) > 0 { i -= len(m.MinInitialDepositRatio) copy(dAtA[i:], m.MinInitialDepositRatio) @@ -1509,22 +1598,22 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x22 } if m.VotingPeriod != nil { - n8, err8 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(*m.VotingPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.VotingPeriod):]) - if err8 != nil { - return 0, err8 + n9, err9 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(*m.VotingPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.VotingPeriod):]) + if err9 != nil { + return 0, err9 } - i -= n8 - i = encodeVarintGov(dAtA, i, uint64(n8)) + i -= n9 + i = encodeVarintGov(dAtA, i, uint64(n9)) i-- dAtA[i] = 0x1a } if m.MaxDepositPeriod != nil { - n9, err9 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(*m.MaxDepositPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.MaxDepositPeriod):]) - if err9 != nil { - return 0, err9 + n10, err10 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(*m.MaxDepositPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.MaxDepositPeriod):]) + if err10 != nil { + return 0, err10 } - i -= n9 - i = encodeVarintGov(dAtA, i, uint64(n9)) + i -= n10 + i = encodeVarintGov(dAtA, i, uint64(n10)) i-- dAtA[i] = 0x12 } @@ -1654,6 +1743,9 @@ func (m *Proposal) Size() (n int) { if l > 0 { n += 1 + l + sovGov(uint64(l)) } + if m.Expedited { + n += 2 + } return n } @@ -1797,6 +1889,20 @@ func (m *Params) Size() (n int) { if l > 0 { n += 1 + l + sovGov(uint64(l)) } + if m.ExpeditedVotingPeriod != nil { + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.ExpeditedVotingPeriod) + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.ExpeditedThreshold) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + if len(m.ExpeditedMinDeposit) > 0 { + for _, e := range m.ExpeditedMinDeposit { + l = e.Size() + n += 1 + l + sovGov(uint64(l)) + } + } if m.BurnVoteQuorum { n += 2 } @@ -2498,6 +2604,26 @@ func (m *Proposal) Unmarshal(dAtA []byte) error { } m.Proposer = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 14: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Expedited", 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.Expedited = bool(v != 0) default: iNdEx = preIndex skippy, err := skipGov(dAtA[iNdEx:]) @@ -3479,6 +3605,108 @@ func (m *Params) Unmarshal(dAtA []byte) error { } m.MinInitialDepositRatio = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExpeditedVotingPeriod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ExpeditedVotingPeriod == nil { + m.ExpeditedVotingPeriod = new(time.Duration) + } + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(m.ExpeditedVotingPeriod, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExpeditedThreshold", 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.ExpeditedThreshold = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExpeditedMinDeposit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExpeditedMinDeposit = append(m.ExpeditedMinDeposit, types.Coin{}) + if err := m.ExpeditedMinDeposit[len(m.ExpeditedMinDeposit)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 13: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field BurnVoteQuorum", wireType) diff --git a/x/gov/types/v1/msgs.go b/x/gov/types/v1/msgs.go index 64fefce8d357..5f758407dc3b 100644 --- a/x/gov/types/v1/msgs.go +++ b/x/gov/types/v1/msgs.go @@ -22,13 +22,19 @@ var ( // NewMsgSubmitProposal creates a new MsgSubmitProposal. // //nolint:interfacer -func NewMsgSubmitProposal(messages []sdk.Msg, initialDeposit sdk.Coins, proposer, metadata, title, summary string) (*MsgSubmitProposal, error) { +func NewMsgSubmitProposal( + messages []sdk.Msg, + initialDeposit sdk.Coins, + proposer, metadata, title, summary string, + expedited bool, +) (*MsgSubmitProposal, error) { m := &MsgSubmitProposal{ InitialDeposit: initialDeposit, Proposer: proposer, Metadata: metadata, Title: title, Summary: summary, + Expedited: expedited, } anys, err := sdktx.SetMsgs(messages) diff --git a/x/gov/types/v1/msgs_test.go b/x/gov/types/v1/msgs_test.go index 174bc2b6df10..1b69770283b6 100644 --- a/x/gov/types/v1/msgs_test.go +++ b/x/gov/types/v1/msgs_test.go @@ -144,26 +144,25 @@ func TestMsgSubmitProposal_ValidateBasic(t *testing.T) { require.NoError(t, err) tests := []struct { - name string - proposer string - initialDeposit sdk.Coins - messages []sdk.Msg - metadata string - title string - summary string - expErr bool + name string + proposer string + initialDeposit sdk.Coins + messages []sdk.Msg + metadata, title, summary string + expedited bool + expErr bool }{ - {"invalid addr", "", coinsPos, []sdk.Msg{msg1}, metadata, "Title", "Summary", true}, - {"empty msgs and metadata", addrs[0].String(), coinsPos, nil, "", "Title", "Summary", true}, - {"empty title and summary", addrs[0].String(), coinsPos, nil, "", "", "", true}, - {"invalid msg", addrs[0].String(), coinsPos, []sdk.Msg{msg1, msg2}, metadata, "Title", "Summary", true}, - {"valid with no Msg", addrs[0].String(), coinsPos, nil, metadata, "Title", "Summary", false}, - {"valid with no metadata", addrs[0].String(), coinsPos, []sdk.Msg{msg1}, "", "Title", "Summary", false}, - {"valid with everything", addrs[0].String(), coinsPos, []sdk.Msg{msg1}, metadata, "Title", "Summary", false}, + {"invalid addr", "", coinsPos, []sdk.Msg{msg1}, metadata, "Title", "Summary", false, true}, + {"empty msgs and metadata", addrs[0].String(), coinsPos, nil, "", "Title", "Summary", false, true}, + {"empty title and summary", addrs[0].String(), coinsPos, nil, "", "", "", false, true}, + {"invalid msg", addrs[0].String(), coinsPos, []sdk.Msg{msg1, msg2}, metadata, "Title", "Summary", false, true}, + {"valid with no Msg", addrs[0].String(), coinsPos, nil, metadata, "Title", "Summary", false, false}, + {"valid with no metadata", addrs[0].String(), coinsPos, []sdk.Msg{msg1}, "", "Title", "Summary", false, false}, + {"valid with everything", addrs[0].String(), coinsPos, []sdk.Msg{msg1}, metadata, "Title", "Summary", true, false}, } for _, tc := range tests { - msg, err := v1.NewMsgSubmitProposal(tc.messages, tc.initialDeposit, tc.proposer, tc.metadata, tc.title, tc.summary) + msg, err := v1.NewMsgSubmitProposal(tc.messages, tc.initialDeposit, tc.proposer, tc.metadata, tc.title, tc.summary, tc.expedited) require.NoError(t, err) if tc.expErr { require.Error(t, msg.ValidateBasic(), "test: %s", tc.name) @@ -180,6 +179,7 @@ func TestMsgSubmitProposal_GetSignBytes(t *testing.T) { proposal []sdk.Msg title string summary string + expedited bool expSignBz string }{ { @@ -187,6 +187,7 @@ func TestMsgSubmitProposal_GetSignBytes(t *testing.T) { []sdk.Msg{v1.NewMsgVote(addrs[0], 1, v1.OptionYes, "")}, "gov/MsgVote", "Proposal for a governance vote msg", + false, `{"type":"cosmos-sdk/v1/MsgSubmitProposal","value":{"initial_deposit":[],"messages":[{"type":"cosmos-sdk/v1/MsgVote","value":{"option":1,"proposal_id":"1","voter":"cosmos1w3jhxap3gempvr"}}],"summary":"Proposal for a governance vote msg","title":"gov/MsgVote"}}`, }, { @@ -194,13 +195,14 @@ func TestMsgSubmitProposal_GetSignBytes(t *testing.T) { []sdk.Msg{banktypes.NewMsgSend(addrs[0], addrs[0], sdk.NewCoins())}, "bank/MsgSend", "Proposal for a bank msg send", + false, fmt.Sprintf(`{"type":"cosmos-sdk/v1/MsgSubmitProposal","value":{"initial_deposit":[],"messages":[{"type":"cosmos-sdk/MsgSend","value":{"amount":[],"from_address":"%s","to_address":"%s"}}],"summary":"Proposal for a bank msg send","title":"bank/MsgSend"}}`, addrs[0], addrs[0]), }, } for _, tc := range testcases { t.Run(tc.name, func(t *testing.T) { - msg, err := v1.NewMsgSubmitProposal(tc.proposal, sdk.NewCoins(), sdk.AccAddress{}.String(), "", tc.title, tc.summary) + msg, err := v1.NewMsgSubmitProposal(tc.proposal, sdk.NewCoins(), sdk.AccAddress{}.String(), "", tc.title, tc.summary, tc.expedited) require.NoError(t, err) var bz []byte require.NotPanics(t, func() { diff --git a/x/gov/types/v1/params.go b/x/gov/types/v1/params.go index 1eefbf85ad38..b9d42afa2dc7 100644 --- a/x/gov/types/v1/params.go +++ b/x/gov/types/v1/params.go @@ -11,21 +11,24 @@ import ( // Default period for deposits & voting const ( - DefaultPeriod time.Duration = time.Hour * 24 * 2 // 2 days + DefaultPeriod time.Duration = time.Hour * 24 * 2 // 2 days + DefaultExpeditedPeriod time.Duration = time.Hour * 24 * 1 // 1 day + DefaultMinExpeditedDepositTokensRatio = 5 ) // Default governance params var ( - DefaultMinDepositTokens = sdk.NewInt(10000000) - DefaultQuorum = sdk.NewDecWithPrec(334, 3) - DefaultThreshold = sdk.NewDecWithPrec(5, 1) - DefaultVetoThreshold = sdk.NewDecWithPrec(334, 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) - DefaultMinDepositRatio = sdk.MustNewDecFromStr("0.01") // NOTE: backport from v50 - + DefaultMinDepositTokens = sdk.NewInt(10000000) + DefaultQuorum = sdk.NewDecWithPrec(334, 3) + DefaultThreshold = sdk.NewDecWithPrec(5, 1) + DefaultVetoThreshold = sdk.NewDecWithPrec(334, 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) + DefaultMinDepositRatio = sdk.MustNewDecFromStr("0.01") // NOTE: backport from v50 + DefaultExpeditedThreshold = sdk.NewDecWithPrec(667, 3) + DefaultMinExpeditedDepositTokens = DefaultMinDepositTokens.Mul(math.NewInt(DefaultMinExpeditedDepositTokensRatio)) ) // Deprecated: NewDepositParams creates a new DepositParams object @@ -54,8 +57,8 @@ 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, minDepositRatio string, + minDeposit, expeditedminDeposit sdk.Coins, maxDepositPeriod, votingPeriod, expeditedVotingPeriod time.Duration, + quorum, threshold, expeditedThreshold, vetoThreshold, minInitialDepositRatio string, burnProposalDeposit, burnVoteQuorum, burnVoteVeto bool, minDepositRatio string, ) Params { return Params{ MinDeposit: minDeposit, @@ -69,6 +72,9 @@ func NewParams( BurnVoteQuorum: burnVoteQuorum, BurnVoteVeto: burnVoteVeto, MinDepositRatio: minDepositRatio, + ExpeditedMinDeposit: expeditedminDeposit, + ExpeditedVotingPeriod: &expeditedVotingPeriod, + ExpeditedThreshold: expeditedThreshold, } } @@ -76,10 +82,13 @@ func NewParams( func DefaultParams() Params { return NewParams( sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, DefaultMinDepositTokens)), + sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, DefaultMinExpeditedDepositTokens)), DefaultPeriod, DefaultPeriod, + DefaultExpeditedPeriod, DefaultQuorum.String(), DefaultThreshold.String(), + DefaultExpeditedThreshold.String(), DefaultVetoThreshold.String(), DefaultMinInitialDepositRatio.String(), DefaultBurnProposalPrevote, @@ -91,10 +100,17 @@ func DefaultParams() Params { // ValidateBasic performs basic validation on governance parameters. func (p Params) ValidateBasic() error { - if minDeposit := sdk.Coins(p.MinDeposit); minDeposit.Empty() || !minDeposit.IsValid() { + minDeposit := sdk.Coins(p.MinDeposit) + if minDeposit.Empty() || !minDeposit.IsValid() { return fmt.Errorf("invalid minimum deposit: %s", minDeposit) } + if minExpeditedDeposit := sdk.Coins(p.ExpeditedMinDeposit); minExpeditedDeposit.Empty() || !minExpeditedDeposit.IsValid() { + return fmt.Errorf("invalid expedited minimum deposit: %s", minExpeditedDeposit) + } else if minExpeditedDeposit.IsAllLTE(minDeposit) { + return fmt.Errorf("expedited minimum deposit must be greater than minimum deposit: %s", minExpeditedDeposit) + } + if p.MaxDepositPeriod == nil { return fmt.Errorf("maximum deposit period must not be nil: %d", p.MaxDepositPeriod) } @@ -125,6 +141,20 @@ func (p Params) ValidateBasic() error { return fmt.Errorf("vote threshold too large: %s", threshold) } + expeditedThreshold, err := sdk.NewDecFromStr(p.ExpeditedThreshold) + if err != nil { + return fmt.Errorf("invalid expedited threshold string: %w", err) + } + if !threshold.IsPositive() { + return fmt.Errorf("expedited vote threshold must be positive: %s", threshold) + } + if threshold.GT(math.LegacyOneDec()) { + return fmt.Errorf("expedited vote threshold too large: %s", threshold) + } + if expeditedThreshold.LTE(threshold) { + return fmt.Errorf("expedited vote threshold %s, must be greater than the regular threshold %s", expeditedThreshold, threshold) + } + vetoThreshold, err := sdk.NewDecFromStr(p.VetoThreshold) if err != nil { return fmt.Errorf("invalid vetoThreshold string: %w", err) @@ -139,7 +169,6 @@ func (p Params) ValidateBasic() error { if p.VotingPeriod == nil { return fmt.Errorf("voting period must not be nil: %d", p.VotingPeriod) } - if p.VotingPeriod.Seconds() <= 0 { return fmt.Errorf("voting period must be positive: %s", p.VotingPeriod) } @@ -155,5 +184,15 @@ func (p Params) ValidateBasic() error { return fmt.Errorf("mininum initial deposit ratio of proposal is too large: %s", minInitialDepositRatio) } + if p.ExpeditedVotingPeriod == nil { + return fmt.Errorf("expedited voting period must not be nil: %d", p.ExpeditedVotingPeriod) + } + if p.ExpeditedVotingPeriod.Seconds() <= 0 { + return fmt.Errorf("expedited voting period must be positive: %s", p.ExpeditedVotingPeriod) + } + if p.ExpeditedVotingPeriod.Seconds() >= p.VotingPeriod.Seconds() { + return fmt.Errorf("expedited voting period %s must be strictly less that the regular voting period %s", p.ExpeditedVotingPeriod, p.VotingPeriod) + } + return nil } diff --git a/x/gov/types/v1/proposal.go b/x/gov/types/v1/proposal.go index a9053a529ad9..79bc095b56e1 100644 --- a/x/gov/types/v1/proposal.go +++ b/x/gov/types/v1/proposal.go @@ -23,7 +23,7 @@ const ( ) // NewProposal creates a new Proposal instance -func NewProposal(messages []sdk.Msg, id uint64, submitTime, depositEndTime time.Time, metadata, title, summary string, proposer sdk.AccAddress) (Proposal, error) { +func NewProposal(messages []sdk.Msg, id uint64, submitTime, depositEndTime time.Time, metadata, title, summary string, proposer sdk.AccAddress, expedited bool) (Proposal, error) { msgs, err := sdktx.SetMsgs(messages) if err != nil { return Proposal{}, err @@ -42,6 +42,7 @@ func NewProposal(messages []sdk.Msg, id uint64, submitTime, depositEndTime time. Title: title, Summary: summary, Proposer: proposer.String(), + Expedited: expedited, } return p, nil @@ -52,6 +53,16 @@ func (p Proposal) GetMsgs() ([]sdk.Msg, error) { return sdktx.GetMsgs(p.Messages, "sdk.MsgProposal") } +// GetMinDepositFromParams returns min expedited deposit from the gov params if +// the proposal is expedited. Otherwise, returns the regular min deposit from +// gov params. +func (p Proposal) GetMinDepositFromParams(params Params) sdk.Coins { + if p.Expedited { + return params.ExpeditedMinDeposit + } + return params.MinDeposit +} + // UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces func (p Proposal) UnpackInterfaces(unpacker types.AnyUnpacker) error { return sdktx.UnpackInterfaces(unpacker, p.Messages) diff --git a/x/gov/types/v1/proposals_test.go b/x/gov/types/v1/proposals_test.go index f97d58ac7d31..70bd1eb9db64 100644 --- a/x/gov/types/v1/proposals_test.go +++ b/x/gov/types/v1/proposals_test.go @@ -5,6 +5,7 @@ import ( "testing" "time" + "cosmossdk.io/math" "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" @@ -37,8 +38,46 @@ func TestNestedAnys(t *testing.T) { testProposal := v1beta1.NewTextProposal("Proposal", "testing proposal") msgContent, err := v1.NewLegacyContent(testProposal, "cosmos1govacct") require.NoError(t, err) - proposal, err := v1.NewProposal([]sdk.Msg{msgContent}, 1, time.Now(), time.Now(), "", "title", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r")) + proposal, err := v1.NewProposal([]sdk.Msg{msgContent}, 1, time.Now(), time.Now(), "", "title", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), false) require.NoError(t, err) require.Equal(t, "TODO Fix panic here", proposal.String()) } + +func TestProposalSetExpedited(t *testing.T) { + const startExpedited = false + proposal, err := v1.NewProposal([]sdk.Msg{}, 1, time.Now(), time.Now(), "", "title", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), startExpedited) + require.NoError(t, err) + require.Equal(t, startExpedited, proposal.Expedited) + + proposal, err = v1.NewProposal([]sdk.Msg{}, 1, time.Now(), time.Now(), "", "title", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), !startExpedited) + require.NoError(t, err) + require.Equal(t, !startExpedited, proposal.Expedited) +} + +func TestProposalGetMinDepositFromParams(t *testing.T) { + testcases := []struct { + expedited bool + expectedMinDeposit math.Int + }{ + { + expedited: true, + expectedMinDeposit: v1.DefaultMinExpeditedDepositTokens, + }, + { + expedited: false, + expectedMinDeposit: v1.DefaultMinDepositTokens, + }, + } + + for _, tc := range testcases { + proposal, err := v1.NewProposal([]sdk.Msg{}, 1, time.Now(), time.Now(), "", "title", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), tc.expedited) + require.NoError(t, err) + + actualMinDeposit := proposal.GetMinDepositFromParams(v1.DefaultParams()) + + require.Equal(t, 1, len(actualMinDeposit)) + require.Equal(t, sdk.DefaultBondDenom, actualMinDeposit[0].Denom) + require.Equal(t, tc.expectedMinDeposit, actualMinDeposit[0].Amount) + } +} diff --git a/x/gov/types/v1/tx.pb.go b/x/gov/types/v1/tx.pb.go index 4a27b2077ef6..f1d68ff65475 100644 --- a/x/gov/types/v1/tx.pb.go +++ b/x/gov/types/v1/tx.pb.go @@ -52,6 +52,10 @@ type MsgSubmitProposal struct { // // Since: cosmos-sdk 0.47 Summary string `protobuf:"bytes,6,opt,name=summary,proto3" json:"summary,omitempty"` + // expedided defines if the proposal is expedited or not + // + // NOTE: backported from v50 (https://github.com/cosmos/cosmos-sdk/pull/14720) + Expedited bool `protobuf:"varint,7,opt,name=expedited,proto3" json:"expedited,omitempty"` } func (m *MsgSubmitProposal) Reset() { *m = MsgSubmitProposal{} } @@ -129,6 +133,13 @@ func (m *MsgSubmitProposal) GetSummary() string { return "" } +func (m *MsgSubmitProposal) GetExpedited() bool { + if m != nil { + return m.Expedited + } + return false +} + // MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. type MsgSubmitProposalResponse struct { // proposal_id defines the unique id of the proposal. @@ -706,64 +717,65 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1/tx.proto", fileDescriptor_9ff8f4a63b6fc9a9) } var fileDescriptor_9ff8f4a63b6fc9a9 = []byte{ - // 908 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xcf, 0x6f, 0x1b, 0x45, - 0x14, 0xce, 0xe6, 0x87, 0xdd, 0xbc, 0x40, 0xaa, 0x8c, 0xdc, 0x76, 0xbd, 0x2a, 0x9b, 0x74, 0x8b, - 0x50, 0x94, 0x90, 0x5d, 0x1c, 0x68, 0x85, 0x4c, 0x85, 0x54, 0x97, 0x0a, 0x21, 0x61, 0xa8, 0x5c, - 0x51, 0x24, 0x84, 0x14, 0x8d, 0xbd, 0xc3, 0x64, 0x45, 0x76, 0x67, 0xb5, 0x33, 0xb6, 0xe2, 0x1b, - 0xe2, 0xd8, 0x13, 0x7f, 0x06, 0xc7, 0x1c, 0x7a, 0xeb, 0x3f, 0x50, 0x38, 0x55, 0x9c, 0x38, 0x55, - 0x28, 0x11, 0x44, 0xe2, 0x9f, 0x00, 0xcd, 0x8f, 0x5d, 0xff, 0x58, 0xc7, 0xa9, 0x38, 0x70, 0xb1, - 0x76, 0xbe, 0xf7, 0xbd, 0x37, 0xef, 0xfb, 0xf6, 0xcd, 0xac, 0xe1, 0x7a, 0x8f, 0xf1, 0x98, 0xf1, - 0x80, 0xb2, 0x41, 0x30, 0x68, 0x04, 0xe2, 0xd8, 0x4f, 0x33, 0x26, 0x18, 0x7a, 0x53, 0xe3, 0x3e, - 0x65, 0x03, 0x7f, 0xd0, 0x70, 0x5c, 0x43, 0xeb, 0x62, 0x4e, 0x82, 0x41, 0xa3, 0x4b, 0x04, 0x6e, - 0x04, 0x3d, 0x16, 0x25, 0x9a, 0xee, 0xdc, 0x98, 0x2c, 0x23, 0xb3, 0x74, 0xa0, 0x46, 0x19, 0x65, - 0xea, 0x31, 0x90, 0x4f, 0x06, 0xad, 0x6b, 0xfa, 0x81, 0x0e, 0x98, 0xad, 0x4c, 0x88, 0x32, 0x46, - 0x8f, 0x48, 0xa0, 0x56, 0xdd, 0xfe, 0x77, 0x01, 0x4e, 0x86, 0x53, 0x9b, 0xc4, 0x9c, 0xca, 0x4d, - 0x62, 0x4e, 0x4d, 0x60, 0x03, 0xc7, 0x51, 0xc2, 0x02, 0xf5, 0xab, 0x21, 0xef, 0x97, 0x45, 0xd8, - 0x68, 0x73, 0xfa, 0xb8, 0xdf, 0x8d, 0x23, 0xf1, 0x28, 0x63, 0x29, 0xe3, 0xf8, 0x08, 0xbd, 0x07, - 0x57, 0x62, 0xc2, 0x39, 0xa6, 0x84, 0xdb, 0xd6, 0xd6, 0xd2, 0xf6, 0xda, 0x7e, 0xcd, 0xd7, 0xfb, - 0xf9, 0xf9, 0x7e, 0xfe, 0xfd, 0x64, 0xd8, 0x29, 0x58, 0xa8, 0x0d, 0x57, 0xa3, 0x24, 0x12, 0x11, - 0x3e, 0x3a, 0x08, 0x49, 0xca, 0x78, 0x24, 0xec, 0x45, 0x95, 0x58, 0xf7, 0x4d, 0xdb, 0xd2, 0x12, - 0xdf, 0x58, 0xe2, 0x3f, 0x60, 0x51, 0xd2, 0x5a, 0x7d, 0xf1, 0x6a, 0x73, 0xe1, 0xe7, 0xf3, 0x93, - 0x1d, 0xab, 0xb3, 0x6e, 0x92, 0x3f, 0xd1, 0xb9, 0xe8, 0x03, 0xb8, 0x92, 0xaa, 0x66, 0x48, 0x66, - 0x2f, 0x6d, 0x59, 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4, 0xb5, 0x7e, 0x3a, 0x73, 0x17, 0x5e, 0x9e, 0xb9, 0x0b, 0xbf, - 0x9f, 0xb9, 0x0b, 0xdf, 0xec, 0xd2, 0x48, 0x1c, 0xf6, 0xbb, 0x7e, 0x8f, 0xc5, 0xe6, 0xef, 0x4d, - 0x50, 0x1a, 0x3c, 0x31, 0x4c, 0x09, 0x97, 0x7f, 0xa6, 0x2a, 0xea, 0x7b, 0xf7, 0xfe, 0xbf, 0x01, - 0x00, 0x00, 0xff, 0xff, 0xc2, 0x00, 0x8f, 0x53, 0x8c, 0x09, 0x00, 0x00, + // 924 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xcd, 0x6f, 0x1b, 0x45, + 0x14, 0xcf, 0xe6, 0xc3, 0x4e, 0x26, 0x90, 0x2a, 0x23, 0xb7, 0x5d, 0xaf, 0xca, 0xc6, 0xdd, 0x22, + 0x64, 0x25, 0x64, 0x17, 0x07, 0x5a, 0x21, 0x53, 0x21, 0xd5, 0xa5, 0x42, 0x48, 0x18, 0xaa, 0xad, + 0x28, 0x12, 0x42, 0x8a, 0xc6, 0xde, 0x61, 0x32, 0x22, 0xbb, 0xb3, 0xda, 0x19, 0x5b, 0xf1, 0x0d, + 0x71, 0xec, 0x89, 0x3f, 0x83, 0x63, 0x0e, 0xbd, 0xf5, 0x1f, 0xa8, 0x38, 0x55, 0x9c, 0x38, 0x55, + 0x28, 0x11, 0x44, 0xe2, 0x9f, 0x00, 0xcd, 0xc7, 0xae, 0x3f, 0xd6, 0xf9, 0x10, 0x87, 0x5e, 0xac, + 0x99, 0xdf, 0xfb, 0xbd, 0x37, 0xef, 0xfd, 0xe6, 0xcd, 0x5b, 0x83, 0x1b, 0x7d, 0xc6, 0x63, 0xc6, + 0x03, 0xc2, 0x86, 0xc1, 0xb0, 0x15, 0x88, 0x23, 0x3f, 0xcd, 0x98, 0x60, 0xf0,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18, 0x68, 0xdf, 0x95, 0x75, 0x8f, 0xf7, + 0xb2, 0x70, 0xaf, 0x54, 0x78, 0x29, 0x49, 0xcf, 0x05, 0xb7, 0xe6, 0xe1, 0x79, 0xf9, 0xde, 0x5f, + 0x16, 0xa8, 0x76, 0x39, 0x79, 0xca, 0x04, 0x86, 0x77, 0xe7, 0x48, 0xd1, 0xa9, 0xfd, 0xf3, 0x7a, + 0x6b, 0x12, 0xd6, 0x5d, 0x33, 0x21, 0x10, 0xf4, 0xc1, 0xca, 0x90, 0x09, 0x9c, 0xe9, 0x9c, 0x2f, + 0x68, 0x17, 0x4d, 0x83, 0x2d, 0x50, 0x61, 0xa9, 0xa0, 0x2c, 0x51, 0xfd, 0xb5, 0x31, 0xee, 0x53, + 0xad, 0x8e, 0x2f, 0x73, 0xf9, 0x5a, 0x11, 0x42, 0x43, 0xbc, 0xa8, 0xbd, 0xda, 0xef, 0x4a, 0x61, + 0x74, 0x68, 0x29, 0xca, 0xf5, 0x92, 0x28, 0x32, 0x9e, 0xb7, 0x09, 0xae, 0x99, 0x65, 0x51, 0xfa, + 0xbf, 0x56, 0x81, 0x7d, 0x8b, 0x29, 0x39, 0x10, 0x38, 0x7a, 0x53, 0x12, 0x7c, 0x02, 0xaa, 0xba, + 0x32, 0x6e, 0x2f, 0xa9, 0xb7, 0x7a, 0x7b, 0x46, 0x83, 0x3c, 0xa1, 0x09, 0x2d, 0x72, 0x8f, 0x0b, + 0xc5, 0x78, 0x7f, 0x5a, 0x8c, 0x77, 0xe6, 0x8a, 0x91, 0x07, 0xf7, 0xea, 0xe0, 0xe6, 0x0c, 0x54, + 0x88, 0xf3, 0xb7, 0x05, 0x40, 0x97, 0x93, 0x7c, 0x2a, 0xfc, 0x4f, 0x5d, 0xee, 0x81, 0x35, 0x33, + 0x93, 0xd8, 0xe5, 0xda, 0x8c, 0xa9, 0xf0, 0x3e, 0xa8, 0xa0, 0x98, 0x0d, 0x12, 0x61, 0xe4, 0xb9, + 0xda, 0x28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 0xc9, 0x3e, 0xeb, 0x3c, 0x7a, 0x79, 0xe2, 0x5a, + 0xaf, 0x4e, 0x5c, 0xeb, 0xcf, 0x13, 0xd7, 0xfa, 0xe5, 0xd4, 0x5d, 0x78, 0x75, 0xea, 0x2e, 0xfc, + 0x71, 0xea, 0x2e, 0x7c, 0xb7, 0x43, 0xa8, 0x38, 0x18, 0xf4, 0xfc, 0x3e, 0x8b, 0xcd, 0x9f, 0x9f, + 0xa0, 0xd4, 0x78, 0x62, 0x94, 0x62, 0x2e, 0xff, 0x6a, 0x55, 0xd4, 0xf7, 0xee, 0xc3, 0xff, 0x02, + 0x00, 0x00, 0xff, 0xff, 0x7c, 0x5b, 0x83, 0x61, 0xaa, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1066,6 +1078,16 @@ func (m *MsgSubmitProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Expedited { + i-- + if m.Expedited { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + } if len(m.Summary) > 0 { i -= len(m.Summary) copy(dAtA[i:], m.Summary) @@ -1547,6 +1569,9 @@ func (m *MsgSubmitProposal) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } + if m.Expedited { + n += 2 + } return n } @@ -1941,6 +1966,26 @@ func (m *MsgSubmitProposal) Unmarshal(dAtA []byte) error { } m.Summary = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Expedited", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Expedited = bool(v != 0) default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) diff --git a/x/upgrade/client/cli/tx.go b/x/upgrade/client/cli/tx.go index db1683a057bf..6ff5aba0999e 100644 --- a/x/upgrade/client/cli/tx.go +++ b/x/upgrade/client/cli/tx.go @@ -35,7 +35,6 @@ func GetTxCmd() *cobra.Command { } // NewCmdSubmitLegacyUpgradeProposal implements a command handler for submitting a software upgrade proposal transaction. -// Deprecated: please use NewCmdSubmitUpgradeProposal instead. func NewCmdSubmitLegacyUpgradeProposal() *cobra.Command { cmd := &cobra.Command{ Use: "software-upgrade [name] (--upgrade-height [height]) (--upgrade-info [info]) [flags]",