diff --git a/CHANGELOG.md b/CHANGELOG.md index 0945d05349..2131b19ca5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -196,6 +196,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### State Machine Breaking +* (x/gov) [#18146](https://github.com/cosmos/cosmos-sdk/pull/18146) Add denom check to reject denoms outside of those listed in `MinDeposit`. A new `MinDepositRatio` param is added (with a default value of `0.001`) and now deposits are required to be at least `MinDepositRatio*MinDeposit` to be accepted. * (x/distribution) [#17657](https://github.com/cosmos/cosmos-sdk/pull/17657) Migrate community pool funds from x/distribution to x/protocolpool. * (x/distribution) [#17115](https://github.com/cosmos/cosmos-sdk/pull/17115) Migrate `PreviousProposer` to collections. * (x/upgrade) [#16244](https://github.com/cosmos/cosmos-sdk/pull/16244) upgrade module no longer stores the app version but gets and sets the app version stored in the `ParamStore` of baseapp. diff --git a/api/cosmos/gov/v1/gov.pulsar.go b/api/cosmos/gov/v1/gov.pulsar.go index 175c72422a..4623ed96da 100644 --- a/api/cosmos/gov/v1/gov.pulsar.go +++ b/api/cosmos/gov/v1/gov.pulsar.go @@ -5547,6 +5547,7 @@ var ( fd_Params_burn_vote_quorum protoreflect.FieldDescriptor fd_Params_burn_proposal_deposit_prevote protoreflect.FieldDescriptor fd_Params_burn_vote_veto protoreflect.FieldDescriptor + fd_Params_min_deposit_ratio protoreflect.FieldDescriptor ) func init() { @@ -5567,6 +5568,7 @@ func init() { 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") + fd_Params_min_deposit_ratio = md_Params.Fields().ByName("min_deposit_ratio") } var _ protoreflect.Message = (*fastReflection_Params)(nil) @@ -5724,6 +5726,12 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto return } } + if x.MinDepositRatio != "" { + value := protoreflect.ValueOfString(x.MinDepositRatio) + if !f(fd_Params_min_deposit_ratio, value) { + return + } + } } // Has reports whether a field is populated. @@ -5769,6 +5777,8 @@ func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { return x.BurnProposalDepositPrevote != false case "cosmos.gov.v1.Params.burn_vote_veto": return x.BurnVoteVeto != false + case "cosmos.gov.v1.Params.min_deposit_ratio": + return x.MinDepositRatio != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Params")) @@ -5815,6 +5825,8 @@ func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { x.BurnProposalDepositPrevote = false case "cosmos.gov.v1.Params.burn_vote_veto": x.BurnVoteVeto = false + case "cosmos.gov.v1.Params.min_deposit_ratio": + x.MinDepositRatio = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Params")) @@ -5882,6 +5894,9 @@ func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) pro case "cosmos.gov.v1.Params.burn_vote_veto": value := x.BurnVoteVeto return protoreflect.ValueOfBool(value) + case "cosmos.gov.v1.Params.min_deposit_ratio": + value := x.MinDepositRatio + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Params")) @@ -5936,6 +5951,8 @@ func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value proto x.BurnProposalDepositPrevote = value.Bool() case "cosmos.gov.v1.Params.burn_vote_veto": x.BurnVoteVeto = value.Bool() + case "cosmos.gov.v1.Params.min_deposit_ratio": + x.MinDepositRatio = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Params")) @@ -6003,6 +6020,8 @@ func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protore panic(fmt.Errorf("field burn_proposal_deposit_prevote of message cosmos.gov.v1.Params is not mutable")) case "cosmos.gov.v1.Params.burn_vote_veto": panic(fmt.Errorf("field burn_vote_veto of message cosmos.gov.v1.Params is not mutable")) + case "cosmos.gov.v1.Params.min_deposit_ratio": + panic(fmt.Errorf("field min_deposit_ratio of message cosmos.gov.v1.Params is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Params")) @@ -6051,6 +6070,8 @@ func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protor return protoreflect.ValueOfBool(false) case "cosmos.gov.v1.Params.burn_vote_veto": return protoreflect.ValueOfBool(false) + case "cosmos.gov.v1.Params.min_deposit_ratio": + return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Params")) @@ -6181,6 +6202,10 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { if x.BurnVoteVeto { n += 2 } + l = len(x.MinDepositRatio) + if l > 0 { + n += 2 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -6210,6 +6235,15 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.MinDepositRatio) > 0 { + i -= len(x.MinDepositRatio) + copy(dAtA[i:], x.MinDepositRatio) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MinDepositRatio))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } if x.BurnVoteVeto { i-- if x.BurnVoteVeto { @@ -6872,6 +6906,38 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { } } x.BurnVoteVeto = bool(v != 0) + case 16: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MinDepositRatio", 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.MinDepositRatio = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -7659,6 +7725,12 @@ type Params struct { BurnProposalDepositPrevote bool `protobuf:"varint,14,opt,name=burn_proposal_deposit_prevote,json=burnProposalDepositPrevote,proto3" json:"burn_proposal_deposit_prevote,omitempty"` // burn deposits if quorum with vote type no_veto is met BurnVoteVeto bool `protobuf:"varint,15,opt,name=burn_vote_veto,json=burnVoteVeto,proto3" json:"burn_vote_veto,omitempty"` + // The ratio representing the proportion of the deposit value minimum that must be met when making a deposit. + // Default value: 0.01. Meaning that for a chain with a min_deposit of 1000stake, a deposit of 1stake would be + // required. + // + // Since: cosmos-sdk 0.50 + MinDepositRatio string `protobuf:"bytes,16,opt,name=min_deposit_ratio,json=minDepositRatio,proto3" json:"min_deposit_ratio,omitempty"` } func (x *Params) Reset() { @@ -7786,6 +7858,13 @@ func (x *Params) GetBurnVoteVeto() bool { return false } +func (x *Params) GetMinDepositRatio() string { + if x != nil { + return x.MinDepositRatio + } + return "" +} + var File_cosmos_gov_v1_gov_proto protoreflect.FileDescriptor var file_cosmos_gov_v1_gov_proto_rawDesc = []byte{ @@ -7924,7 +8003,7 @@ var file_cosmos_gov_v1_gov_proto_rawDesc = []byte{ 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, 0x3a, 0x02, 0x18, - 0x01, 0x22, 0xd3, 0x07, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x45, 0x0a, 0x0b, + 0x01, 0x22, 0x8f, 0x08, 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, @@ -7985,39 +8064,43 @@ var file_cosmos_gov_v1_gov_proto_rawDesc = []byte{ 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, 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, + 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 ( diff --git a/proto/cosmos/gov/v1/gov.proto b/proto/cosmos/gov/v1/gov.proto index ccaf83acec..8ab849500d 100644 --- a/proto/cosmos/gov/v1/gov.proto +++ b/proto/cosmos/gov/v1/gov.proto @@ -261,4 +261,11 @@ message Params { // burn deposits if quorum with vote type no_veto is met bool burn_vote_veto = 15; + + // The ratio representing the proportion of the deposit value minimum that must be met when making a deposit. + // Default value: 0.01. Meaning that for a chain with a min_deposit of 100stake, a deposit of 1stake would be + // required. + // + // Since: cosmos-sdk 0.50 + string min_deposit_ratio = 16 [(cosmos_proto.scalar) = "cosmos.Dec"]; } diff --git a/tests/e2e/gov/deposits.go b/tests/e2e/gov/deposits.go index 68d860a5f6..baf3f88980 100644 --- a/tests/e2e/gov/deposits.go +++ b/tests/e2e/gov/deposits.go @@ -14,7 +14,6 @@ import ( "cosmossdk.io/x/gov/types/v1beta1" "github.com/cosmos/cosmos-sdk/testutil" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" "github.com/cosmos/cosmos-sdk/testutil/network" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -72,33 +71,6 @@ func (s *DepositTestSuite) TearDownSuite() { s.network.Cleanup() } -func (s *DepositTestSuite) TestQueryDepositsWithoutInitialDeposit() { - val := s.network.Validators[0] - - // submit proposal without initial deposit - id := s.submitProposal(val, sdk.NewCoin(s.cfg.BondDenom, math.NewInt(0)), "TestQueryDepositsWithoutInitialDeposit") - - // deposit amount - depositAmount := sdk.NewCoin(s.cfg.BondDenom, v1.DefaultMinDepositTokens.Add(math.NewInt(50))) - msg := v1.NewMsgDeposit(val.Address, id, sdk.NewCoins(depositAmount)) - _, err := clitestutil.SubmitTestTx(val.ClientCtx, msg, val.Address, clitestutil.TestTxConfig{}) - s.Require().NoError(err) - s.Require().NoError(s.network.WaitForNextBlock()) - - // query deposit - proposalID := strconv.FormatUint(id, 10) - deposit := s.queryDeposit(val, proposalID, false, "") - s.Require().NotNil(deposit) - s.Require().Equal(depositAmount.String(), sdk.Coins(deposit.Deposit.Amount).String()) - - // query deposits - deposits := s.queryDeposits(val, proposalID, false, "") - s.Require().NotNil(deposits) - s.Require().Len(deposits.Deposits, 1) - // verify initial deposit - s.Require().Equal(depositAmount.String(), sdk.Coins(deposits.Deposits[0].Amount).String()) -} - func (s *DepositTestSuite) TestQueryDepositsWithInitialDeposit() { val := s.network.Validators[0] depositAmount := sdk.NewCoin(s.cfg.BondDenom, v1.DefaultMinDepositTokens) diff --git a/tests/e2e/gov/tx.go b/tests/e2e/gov/tx.go index 4226ffb111..6bcd862168 100644 --- a/tests/e2e/gov/tx.go +++ b/tests/e2e/gov/tx.go @@ -59,9 +59,12 @@ func (s *E2ETestSuite) SetupSuite() { s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &resp), out.String()) s.Require().NoError(clitestutil.CheckTxCode(s.network, clientCtx, resp.TxHash, 0)) - // create a proposal without deposit + // create a proposal with a small deposit + minimumAcceptedDep := v1.DefaultMinDepositTokens.ToLegacyDec().Mul(v1.DefaultMinDepositRatio).Ceil().TruncateInt() out, err = govclitestutil.MsgSubmitLegacyProposal(val.ClientCtx, val.Address.String(), - "Text Proposal 2", "Where is the title!?", v1beta1.ProposalTypeText) + "Text Proposal 2", "Where is the title!?", v1beta1.ProposalTypeText, + fmt.Sprintf("--%s=%s", cli.FlagDeposit, sdk.NewCoin(s.cfg.BondDenom, minimumAcceptedDep).String())) + s.Require().NoError(err) s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), &resp), out.String()) s.Require().NoError(clitestutil.CheckTxCode(s.network, clientCtx, resp.TxHash, 0)) @@ -127,7 +130,7 @@ func (s *E2ETestSuite) TestNewCmdSubmitProposal() { "summary": "My awesome description", "metadata": "%s", "deposit": "%s" -}`, authtypes.NewModuleAddress(types.ModuleName), base64.StdEncoding.EncodeToString(propMetadata), sdk.NewCoin(s.cfg.BondDenom, math.NewInt(5431))) +}`, authtypes.NewModuleAddress(types.ModuleName), base64.StdEncoding.EncodeToString(propMetadata), sdk.NewCoin(s.cfg.BondDenom, math.NewInt(100000))) validPropFile := testutil.WriteToNewTempFile(s.T(), validProp) defer validPropFile.Close() @@ -195,7 +198,7 @@ func (s *E2ETestSuite) TestNewCmdSubmitLegacyProposal() { "description": "Hello, World!", "type": "Text", "deposit": "%s" - }`, sdk.NewCoin(s.cfg.BondDenom, math.NewInt(5431))) + }`, sdk.NewCoin(s.cfg.BondDenom, math.NewInt(154310))) validPropFile := testutil.WriteToNewTempFile(s.T(), validProp) defer validPropFile.Close() @@ -221,7 +224,7 @@ func (s *E2ETestSuite) TestNewCmdSubmitLegacyProposal() { []string{ fmt.Sprintf("--%s='Where is the title!?'", cli.FlagDescription), //nolint:staticcheck // we are intentionally using a deprecated flag here. fmt.Sprintf("--%s=%s", cli.FlagProposalType, v1beta1.ProposalTypeText), //nolint:staticcheck // we are intentionally using a deprecated flag here. - fmt.Sprintf("--%s=%s", cli.FlagDeposit, sdk.NewCoin(s.cfg.BondDenom, math.NewInt(5431)).String()), + fmt.Sprintf("--%s=%s", cli.FlagDeposit, sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10000)).String()), fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, math.NewInt(10))).String()), @@ -246,7 +249,7 @@ func (s *E2ETestSuite) TestNewCmdSubmitLegacyProposal() { fmt.Sprintf("--%s='Text Proposal'", cli.FlagTitle), fmt.Sprintf("--%s='Where is the title!?'", cli.FlagDescription), //nolint:staticcheck // we are intentionally using a deprecated flag here. fmt.Sprintf("--%s=%s", cli.FlagProposalType, v1beta1.ProposalTypeText), //nolint:staticcheck // we are intentionally using a deprecated flag here. - fmt.Sprintf("--%s=%s", cli.FlagDeposit, sdk.NewCoin(s.cfg.BondDenom, math.NewInt(5431)).String()), + fmt.Sprintf("--%s=%s", cli.FlagDeposit, sdk.NewCoin(s.cfg.BondDenom, math.NewInt(100000)).String()), fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), diff --git a/tests/integration/bank/app_test.go b/tests/integration/bank/app_test.go index f62d95923c..58f280bf57 100644 --- a/tests/integration/bank/app_test.go +++ b/tests/integration/bank/app_test.go @@ -373,14 +373,15 @@ func TestMsgSetSendEnabled(t *testing.T) { s := createTestSuite(t, genAccs) ctx := s.App.BaseApp.NewContext(false) - require.NoError(t, testutil.FundAccount(ctx, s.BankKeeper, addr1, sdk.NewCoins(sdk.NewInt64Coin("stake", 101)))) + require.NoError(t, testutil.FundAccount(ctx, s.BankKeeper, addr1, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 101)))) + require.NoError(t, testutil.FundAccount(ctx, s.BankKeeper, addr1, sdk.NewCoins(sdk.NewInt64Coin("stake", 100000)))) addr1Str := addr1.String() govAddr := s.BankKeeper.GetAuthority() goodGovProp, err := govv1.NewMsgSubmitProposal( []sdk.Msg{ types.NewMsgSetSendEnabled(govAddr, nil, nil), }, - sdk.Coins{{Denom: "stake", Amount: sdkmath.NewInt(5)}}, + sdk.Coins{{Denom: "stake", Amount: sdkmath.NewInt(100000)}}, addr1Str, "set default send enabled to true", "Change send enabled", diff --git a/x/gov/abci_test.go b/x/gov/abci_test.go index 01ce23dad5..ae98b97fe5 100644 --- a/x/gov/abci_test.go +++ b/x/gov/abci_test.go @@ -92,7 +92,7 @@ func TestTickExpiredDepositPeriod(t *testing.T) { newProposalMsg, err := v1.NewMsgSubmitProposal( []sdk.Msg{mkTestLegacyContent(t)}, - sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, + sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 100000)}, addrs[0].String(), "", "Proposal", @@ -137,7 +137,7 @@ func TestTickMultipleExpiredDepositPeriod(t *testing.T) { newProposalMsg, err := v1.NewMsgSubmitProposal( []sdk.Msg{mkTestLegacyContent(t)}, - sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, + sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 100000)}, addrs[0].String(), "", "Proposal", @@ -160,7 +160,7 @@ func TestTickMultipleExpiredDepositPeriod(t *testing.T) { newProposalMsg2, err := v1.NewMsgSubmitProposal( []sdk.Msg{mkTestLegacyContent(t)}, - sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, + sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 100000)}, addrs[0].String(), "", "Proposal", @@ -200,7 +200,7 @@ func TestTickPassedDepositPeriod(t *testing.T) { newProposalMsg, err := v1.NewMsgSubmitProposal( []sdk.Msg{mkTestLegacyContent(t)}, - sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}, + sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 100000)}, addrs[0].String(), "", "Proposal", @@ -223,7 +223,7 @@ func TestTickPassedDepositPeriod(t *testing.T) { checkInactiveProposalsQueue(t, ctx, suite.GovKeeper) - newDepositMsg := v1.NewMsgDeposit(addrs[1], proposalID, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 5)}) + newDepositMsg := v1.NewMsgDeposit(addrs[1], proposalID, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 100000)}) res1, err := govMsgSvr.Deposit(ctx, newDepositMsg) require.NoError(t, err) diff --git a/x/gov/keeper/deposit.go b/x/gov/keeper/deposit.go index a3f16a72a2..c149ca560b 100644 --- a/x/gov/keeper/deposit.go +++ b/x/gov/keeper/deposit.go @@ -3,6 +3,7 @@ package keeper import ( "context" "fmt" + "strings" "cosmossdk.io/collections" "cosmossdk.io/errors" @@ -12,6 +13,7 @@ import ( pooltypes "cosmossdk.io/x/protocolpool/types" sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) // SetDeposit sets a Deposit to the gov store @@ -76,10 +78,48 @@ func (keeper Keeper) AddDeposit(ctx context.Context, proposalID uint64, deposito return false, err } + minDepositAmount := proposal.GetMinDepositFromParams(params) + minDepositRatio, err := sdkmath.LegacyNewDecFromStr(params.GetMinDepositRatio()) + if err != nil { + return false, err + } + + // the deposit must only contain valid denoms (listed in the min deposit param) if err := keeper.validateDepositDenom(ctx, params, depositAmount); err != nil { return false, err } + // If minDepositRatio is set, the deposit must be equal or greater than minDepositAmount*minDepositRatio + // for at least one denom. If minDepositRatio is zero we skip this check. + if !minDepositRatio.IsZero() { + var ( + depositThresholdMet bool + thresholds []string + ) + for _, minDep := range minDepositAmount { + // calculate the threshold for this denom, and hold a list to later return a useful error message + threshold := sdk.NewCoin(minDep.GetDenom(), minDep.Amount.ToLegacyDec().Mul(minDepositRatio).TruncateInt()) + thresholds = append(thresholds, threshold.String()) + + found, deposit := depositAmount.Find(minDep.Denom) + if !found { // if not found, continue, as we know the deposit contains at least 1 valid denom + continue + } + + // Once we know at least one threshold has been met, we can break. The deposit + // might contain other denoms but we don't care. + if deposit.IsGTE(threshold) { + depositThresholdMet = true + break + } + } + + // the threshold must be met with at least one denom, if not, return the list of minimum deposits + if !depositThresholdMet { + return false, errors.Wrapf(types.ErrMinDepositTooSmall, "received %s but need at least one of the following: %s", depositAmount, strings.Join(thresholds, ",")) + } + } + // update the governance module's account coins pool err = keeper.bankKeeper.SendCoinsFromAccountToModule(ctx, depositorAddr, types.ModuleName, depositAmount) if err != nil { @@ -94,8 +134,6 @@ func (keeper Keeper) AddDeposit(ctx context.Context, proposalID uint64, deposito } // Check if deposit has provided sufficient total funds to transition the proposal into the voting period - minDepositAmount := proposal.GetMinDepositFromParams(params) - activatedVotingPeriod := false if proposal.Status == v1.StatusDepositPeriod && sdk.NewCoins(proposal.TotalDeposit...).IsAllGTE(minDepositAmount) { err = keeper.ActivateVotingPeriod(ctx, proposal) @@ -244,6 +282,10 @@ func (keeper Keeper) RefundAndDeleteDeposits(ctx context.Context, proposalID uin // 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 context.Context, params v1.Params, initialDeposit sdk.Coins, expedited bool) error { + if !initialDeposit.IsValid() || initialDeposit.IsAnyNegative() { + return errors.Wrap(sdkerrors.ErrInvalidCoins, initialDeposit.String()) + } + minInitialDepositRatio, err := sdkmath.LegacyNewDecFromStr(params.MinInitialDepositRatio) if err != nil { return err @@ -279,7 +321,7 @@ func (keeper Keeper) validateDepositDenom(ctx context.Context, params v1.Params, for _, coin := range depositAmount { if _, ok := acceptedDenoms[coin.Denom]; !ok { - return errors.Wrapf(types.ErrInvalidDepositDenom, "deposited %s, but gov accepts only the following denom(s): %v", coin, denoms) + return errors.Wrapf(types.ErrInvalidDepositDenom, "deposited %s, but gov accepts only the following denom(s): %v", depositAmount, denoms) } } diff --git a/x/gov/keeper/deposit_test.go b/x/gov/keeper/deposit_test.go index 456b6b30de..bd5f8fa7ac 100644 --- a/x/gov/keeper/deposit_test.go +++ b/x/gov/keeper/deposit_test.go @@ -161,6 +161,86 @@ func TestDeposits(t *testing.T) { } } +func TestDepositAmount(t *testing.T) { + testcases := []struct { + name string + deposit sdk.Coins + minDepositRatio string + err string + }{ + { + name: "good amount and denoms", + deposit: sdk.NewCoins(sdk.NewInt64Coin("stake", 10000)), + minDepositRatio: "0.001", + }, + { + name: "good amount and denoms but not enough balance for zcoin", + deposit: sdk.NewCoins(sdk.NewInt64Coin("stake", 10000), sdk.NewInt64Coin("zcoin", 1)), + minDepositRatio: "0.001", + err: "not enough balance", + }, + { + name: "too small amount", + deposit: sdk.NewCoins(sdk.NewInt64Coin("stake", 10)), + minDepositRatio: "0.001", + err: "received 10stake but need at least one of the following: 10000stake,10zcoin: minimum deposit is too small", + }, + { + name: "too small amount with another coin", + deposit: sdk.NewCoins(sdk.NewInt64Coin("zcoin", 1)), + minDepositRatio: "0.001", + err: "received 1zcoin but need at least one of the following: 10000stake,10zcoin: minimum deposit is too small", + }, + { + name: "bad denom", + deposit: sdk.NewCoins(sdk.NewInt64Coin("euro", 10000)), + minDepositRatio: "0.001", + err: "deposited 10000euro, but gov accepts only the following denom(s): [stake zcoin]: invalid deposit denom", + }, + { + name: "mix containing bad and good denom", + deposit: sdk.NewCoins(sdk.NewInt64Coin("stake", 10000), sdk.NewInt64Coin("euro", 10000)), + minDepositRatio: "0.001", + err: "deposited 10000euro,10000stake, but gov accepts only the following denom(s): [stake zcoin]: invalid deposit denom", + }, + { + name: "minDepositRatio is zero", + deposit: sdk.NewCoins(sdk.NewInt64Coin("stake", 10)), + minDepositRatio: "0.0", + }, + } + + for _, tc := range testcases { + t.Run(tc.name, func(t *testing.T) { + govKeeper, mocks, _, ctx := setupGovKeeper(t) + authKeeper, bankKeeper, stakingKeeper := mocks.acctKeeper, mocks.bankKeeper, mocks.stakingKeeper + trackMockBalances(bankKeeper) + + testAddrs := simtestutil.AddTestAddrsIncremental(bankKeeper, stakingKeeper, ctx, 2, sdkmath.NewInt(1000000000000000)) + authKeeper.EXPECT().AddressCodec().Return(address.NewBech32Codec("cosmos")).AnyTimes() + + params, _ := govKeeper.Params.Get(ctx) + params.MinDepositRatio = tc.minDepositRatio + params.MinDeposit = sdk.NewCoins(params.MinDeposit...).Add(sdk.NewCoin("zcoin", sdkmath.NewInt(10000))) // coins must be sorted by denom + err := govKeeper.Params.Set(ctx, params) + require.NoError(t, err) + + tp := TestProposal + proposal, err := govKeeper.SubmitProposal(ctx, tp, "", "title", "summary", testAddrs[0], false) + require.NoError(t, err) + proposalID := proposal.Id + + _, err = govKeeper.AddDeposit(ctx, proposalID, testAddrs[0], tc.deposit) + if tc.err != "" { + require.Error(t, err) + require.Equal(t, tc.err, err.Error()) + } else { + require.NoError(t, err) + } + }) + } +} + func TestValidateInitialDeposit(t *testing.T) { testcases := map[string]struct { minDeposit sdk.Coins diff --git a/x/gov/keeper/msg_server.go b/x/gov/keeper/msg_server.go index 658f4dc16b..87c5c4c347 100644 --- a/x/gov/keeper/msg_server.go +++ b/x/gov/keeper/msg_server.go @@ -41,10 +41,6 @@ func (k msgServer) SubmitProposal(goCtx context.Context, msg *v1.MsgSubmitPropos return nil, sdkerrors.ErrInvalidAddress.Wrapf("invalid proposer address: %s", err) } - if err := validateDeposit(sdk.NewCoins(msg.InitialDeposit...)); err != nil { - return nil, err - } - // check that either metadata or Msgs length is non nil. if len(msg.Messages) == 0 && len(msg.Metadata) == 0 { return nil, errors.Wrap(govtypes.ErrNoProposalMsgs, "either metadata or Msgs length must be non-nil") @@ -249,7 +245,7 @@ func (k msgServer) Deposit(goCtx context.Context, msg *v1.MsgDeposit) (*v1.MsgDe return nil, sdkerrors.ErrInvalidAddress.Wrapf("invalid depositor address: %s", err) } - if err := validateAmount(sdk.NewCoins(msg.Amount...)); err != nil { + if err := validateDeposit(msg.Amount); err != nil { return nil, err } @@ -383,26 +379,11 @@ func (k legacyMsgServer) Deposit(goCtx context.Context, msg *v1beta1.MsgDeposit) return &v1beta1.MsgDepositResponse{}, nil } -func validateAmount(amount sdk.Coins) error { - if !amount.IsValid() { - return sdkerrors.ErrInvalidCoins.Wrap(amount.String()) - } - - if !amount.IsAllPositive() { +// validateDeposit validates the deposit amount, do not use for initial deposit. +func validateDeposit(amount sdk.Coins) error { + if !amount.IsValid() || !amount.IsAllPositive() { return sdkerrors.ErrInvalidCoins.Wrap(amount.String()) } return nil } - -func validateDeposit(deposit sdk.Coins) error { - if !deposit.IsValid() { - return errors.Wrap(sdkerrors.ErrInvalidCoins, deposit.String()) - } - - if deposit.IsAnyNegative() { - return errors.Wrap(sdkerrors.ErrInvalidCoins, deposit.String()) - } - - return nil -} diff --git a/x/gov/keeper/msg_server_test.go b/x/gov/keeper/msg_server_test.go index 77e9620c35..3eb34aa964 100644 --- a/x/gov/keeper/msg_server_test.go +++ b/x/gov/keeper/msg_server_test.go @@ -27,7 +27,7 @@ func (suite *KeeperTestSuite) TestMsgSubmitProposal() { addrs := suite.addrs proposer := addrs[0] - coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100))) + coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100000))) initialDeposit := coins params, _ := suite.govKeeper.Params.Get(suite.ctx) minDeposit := params.MinDeposit @@ -226,7 +226,7 @@ func (suite *KeeperTestSuite) TestMsgSubmitProposal() { preRun: func() (*v1.MsgSubmitProposal, error) { return v1.NewMsgSubmitProposal( []sdk.Msg{bankMsg}, - append(initialDeposit, sdk.NewCoin("invalid", sdkmath.NewInt(100))), + initialDeposit.Add(sdk.NewCoin("invalid", sdkmath.NewInt(100))), proposer.String(), "", "Proposal", @@ -235,7 +235,7 @@ func (suite *KeeperTestSuite) TestMsgSubmitProposal() { ) }, expErr: true, - expErrMsg: "deposited 100invalid, but gov accepts only the following denom(s): [stake]: invalid deposit denom", + expErrMsg: "deposited 100invalid,100000stake, but gov accepts only the following denom(s): [stake]: invalid deposit denom", }, "all good": { preRun: func() (*v1.MsgSubmitProposal, error) { @@ -288,7 +288,7 @@ func (suite *KeeperTestSuite) TestMsgCancelProposal() { addrs := suite.addrs proposer := addrs[0] - coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100))) + coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100000))) bankMsg := &banktypes.MsgSend{ FromAddress: govAcct.String(), ToAddress: proposer.String(), @@ -384,7 +384,7 @@ func (suite *KeeperTestSuite) TestMsgVote() { addrs := suite.addrs proposer := addrs[0] - coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100))) + coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100000))) params, _ := suite.govKeeper.Params.Get(suite.ctx) minDeposit := params.MinDeposit bankMsg := &banktypes.MsgSend{ @@ -527,7 +527,7 @@ func (suite *KeeperTestSuite) TestMsgVoteWeighted() { proposer := simtestutil.AddTestAddrsIncremental(suite.bankKeeper, suite.stakingKeeper, suite.ctx, 1, sdkmath.NewInt(50000000))[0] - coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100))) + coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100000))) params, _ := suite.govKeeper.Params.Get(suite.ctx) minDeposit := params.MinDeposit bankMsg := &banktypes.MsgSend{ @@ -771,9 +771,9 @@ func (suite *KeeperTestSuite) TestMsgDeposit() { addrs := suite.addrs proposer := addrs[0] - coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100))) + coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100000))) params, _ := suite.govKeeper.Params.Get(suite.ctx) - minDeposit := params.MinDeposit + minDeposit := sdk.Coins(params.MinDeposit) bankMsg := &banktypes.MsgSend{ FromAddress: govAcct.String(), ToAddress: proposer.String(), @@ -836,9 +836,9 @@ func (suite *KeeperTestSuite) TestMsgDeposit() { return pID }, depositor: proposer, - deposit: append(minDeposit, sdk.NewCoin("ibc/badcoin", sdkmath.NewInt(1000))), + deposit: minDeposit.Add(sdk.NewCoin("ibc/badcoin", sdkmath.NewInt(1000))), expErr: true, - expErrMsg: "deposited 1000ibc/badcoin, but gov accepts only the following denom(s): [stake]", + expErrMsg: "deposited 1000ibc/badcoin,10000000stake, but gov accepts only the following denom(s): [stake]: invalid deposit denom", }, "all good": { preRun: func() uint64 { @@ -868,7 +868,7 @@ func (suite *KeeperTestSuite) TestMsgDeposit() { // legacy msg server tests func (suite *KeeperTestSuite) TestLegacyMsgSubmitProposal() { proposer := simtestutil.AddTestAddrsIncremental(suite.bankKeeper, suite.stakingKeeper, suite.ctx, 1, sdkmath.NewInt(50000000))[0] - coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100))) + coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100000))) initialDeposit := coins params, _ := suite.govKeeper.Params.Get(suite.ctx) minDeposit := params.MinDeposit @@ -981,7 +981,7 @@ func (suite *KeeperTestSuite) TestLegacyMsgVote() { addrs := suite.addrs proposer := addrs[0] - coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100))) + coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100000))) params, _ := suite.govKeeper.Params.Get(suite.ctx) minDeposit := params.MinDeposit bankMsg := &banktypes.MsgSend{ @@ -1114,7 +1114,7 @@ func (suite *KeeperTestSuite) TestLegacyVoteWeighted() { addrs := suite.addrs proposer := addrs[0] - coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100))) + coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100000))) params, _ := suite.govKeeper.Params.Get(suite.ctx) minDeposit := params.MinDeposit bankMsg := &banktypes.MsgSend{ @@ -1365,7 +1365,7 @@ func (suite *KeeperTestSuite) TestLegacyMsgDeposit() { addrs := suite.addrs proposer := addrs[0] - coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100))) + coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100000))) params, _ := suite.govKeeper.Params.Get(suite.ctx) minDeposit := params.MinDeposit bankMsg := &banktypes.MsgSend{ diff --git a/x/gov/migrations/v5/store.go b/x/gov/migrations/v5/store.go index 5844cd4313..62f7328bba 100644 --- a/x/gov/migrations/v5/store.go +++ b/x/gov/migrations/v5/store.go @@ -40,6 +40,7 @@ func MigrateStore(ctx sdk.Context, storeService corestoretypes.KVStoreService, c params.ExpeditedThreshold = defaultParams.ExpeditedThreshold params.ProposalCancelRatio = defaultParams.ProposalCancelRatio params.ProposalCancelDest = defaultParams.ProposalCancelDest + params.MinDepositRatio = defaultParams.MinDepositRatio bz, err := cdc.Marshal(¶ms) if err != nil { diff --git a/x/gov/migrations/v5/store_test.go b/x/gov/migrations/v5/store_test.go index e8ee2ea893..fbdd415591 100644 --- a/x/gov/migrations/v5/store_test.go +++ b/x/gov/migrations/v5/store_test.go @@ -45,6 +45,7 @@ func TestMigrateStore(t *testing.T) { require.Equal(t, v1.DefaultParams().ExpeditedMinDeposit, params.ExpeditedMinDeposit) require.Equal(t, v1.DefaultParams().ExpeditedThreshold, params.ExpeditedThreshold) require.Equal(t, v1.DefaultParams().ExpeditedVotingPeriod, params.ExpeditedVotingPeriod) + require.Equal(t, v1.DefaultParams().MinDepositRatio, params.MinDepositRatio) // Check constitution result, err := constitutionCollection.Get(ctx) diff --git a/x/gov/simulation/genesis.go b/x/gov/simulation/genesis.go index 5ffcd1dc4b..21f2a555eb 100644 --- a/x/gov/simulation/genesis.go +++ b/x/gov/simulation/genesis.go @@ -28,6 +28,7 @@ const ( ExpeditedThreshold = "expedited_threshold" Veto = "veto" ProposalCancelRate = "proposal_cancel_rate" + MinDepositRatio = "min_deposit_ratio" // ExpeditedThreshold must be at least as large as the regular Threshold // Therefore, we use this break out point in randomization. @@ -94,6 +95,11 @@ func GenVeto(r *rand.Rand) sdkmath.LegacyDec { return sdkmath.LegacyNewDecWithPrec(int64(simulation.RandIntBetween(r, 250, 334)), 3) } +// GenMinDepositRatio returns randomized DepositMinRatio +func GenMinDepositRatio(r *rand.Rand) sdkmath.LegacyDec { + return sdkmath.LegacyMustNewDecFromStr("0.01") +} + // RandomizedGenState generates a random GenesisState for gov func RandomizedGenState(simState *module.SimulationState) { startingProposalID := uint64(simState.Rand.Intn(100)) @@ -131,9 +137,12 @@ func RandomizedGenState(simState *module.SimulationState) { var veto sdkmath.LegacyDec simState.AppParams.GetOrGenerate(Veto, &veto, simState.Rand, func(r *rand.Rand) { veto = GenVeto(r) }) + var minDepositRatio sdkmath.LegacyDec + simState.AppParams.GetOrGenerate(MinDepositRatio, &minDepositRatio, simState.Rand, func(r *rand.Rand) { minDepositRatio = GenMinDepositRatio(r) }) + govGenesis := v1.NewGenesisState( startingProposalID, - v1.NewParams(minDeposit, expeditedMinDeposit, depositPeriod, votingPeriod, expeditedVotingPeriod, quorum.String(), threshold.String(), expitedVotingThreshold.String(), veto.String(), minInitialDepositRatio.String(), proposalCancelRate.String(), "", simState.Rand.Intn(2) == 0, simState.Rand.Intn(2) == 0, simState.Rand.Intn(2) == 0), + v1.NewParams(minDeposit, expeditedMinDeposit, depositPeriod, votingPeriod, expeditedVotingPeriod, quorum.String(), threshold.String(), expitedVotingThreshold.String(), veto.String(), minInitialDepositRatio.String(), proposalCancelRate.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/operations.go b/x/gov/simulation/operations.go index 90e0b52548..9c8dd13d5b 100644 --- a/x/gov/simulation/operations.go +++ b/x/gov/simulation/operations.go @@ -570,6 +570,13 @@ func randomDeposit( minDepositAmount := minDeposit[denomIndex].Amount + minDepositRatio, err := sdkmath.LegacyNewDecFromStr(params.GetMinDepositRatio()) + if err != nil { + return nil, false, err + } + + threshold := minDepositAmount.ToLegacyDec().Mul(minDepositRatio).TruncateInt() + minAmount := sdkmath.ZeroInt() if useMinAmount { minDepositPercent, err := sdkmath.LegacyNewDecFromStr(params.MinInitialDepositRatio) @@ -585,8 +592,9 @@ func randomDeposit( return nil, false, err } amount = amount.Add(minAmount) + 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) { + 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 0cee14b7fe..7cf6c935c7 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, "47841094stake", msg.InitialDeposit[0].String()) + require.Equal(t, "143523282stake", msg.InitialDeposit[0].String()) require.Equal(t, simulation.TypeMsgSubmitProposal, sdk.MsgTypeURL(&msg)) } @@ -185,7 +185,7 @@ 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, "25166256stake", msg.InitialDeposit[0].String()) + require.Equal(t, "75498768stake", msg.InitialDeposit[0].String()) require.Equal(t, "title-3: ZBSpYuLyYggwexjxusrBqDOTtGTOWeLrQKjLxzIivHSlcxgdXhhuTSkuxKGLwQvuyNhYFmBZHeAerqyNEUzXPFGkqEGqiQWIXnku", textProposal.GetTitle()) require.Equal(t, "description-3: NJWzHdBNpAXKJPHWQdrGYcAHSctgVlqwqHoLfHsXUdStwfefwzqLuKEhmMyYLdbZrcPgYqjNHxPexsruwEGStAneKbWkQDDIlCWBLSiAASNhZqNFlPtfqPJoxKsgMdzjWqLWdqKQuJqWPMvwPQWZUtVMOTMYKJbfdlZsjdsomuScvDmbDkgRualsxDvRJuCAmPOXitIbcyWsKGSdrEunFAOdmXnsuyFVgJqEjbklvmwrUlsxjRSfKZxGcpayDdgoFcnVSutxjRgOSFzPwidAjubMncNweqpbxhXGchpZUxuFDOtpnhNUycJICRYqsPhPSCjPTWZFLkstHWJxvdPEAyEIxXgLwbNOjrgzmaujiBABBIXvcXpLrbcEWNNQsbjvgJFgJkflpRohHUutvnaUqoopuKjTDaemDeSdqbnOzcfJpcTuAQtZoiLZOoAIlboFDAeGmSNwkvObPRvRWQgWkGkxwtPauYgdkmypLjbqhlHJIQTntgWjXwZdOyYEdQRRLfMSdnxqppqUofqLbLQDUjwKVKfZJUJQPsWIPwIVaSTrmKskoAhvmZyJgeRpkaTfGgrJzAigcxtfshmiDCFkuiluqtMOkidknnTBtumyJYlIsWLnCQclqdVmikUoMOPdPWwYbJxXyqUVicNxFxyqJTenNblyyKSdlCbiXxUiYUiMwXZASYfvMDPFgxniSjWaZTjHkqlJvtBsXqwPpyVxnJVGFWhfSxgOcduoxkiopJvFjMmFabrGYeVtTXLhxVUEiGwYUvndjFG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tATwEdZlLfoBKiTvodQBGOEcuATWXfiinSjPmJKcWgQrTVYVrwlyMWhxqNbCMpIQNoSMGTiWfPTCezUjYcdWppnsYJihLQCqbNLRGgqrwHuIvsazapTpoPZIyZyeeSueJuTIhpHMEJfJpScshJubJGfkusuVBgfTWQoywSSliQQSfbvaHKiLnyjdSbpMkdBgXepoSsHnCQaYuHQqZsoEOmJCiuQUpJkmfyfbIShzlZpHFmLCsbknEAkKXKfRTRnuwdBeuOGgFbJLbDksHVapaRayWzwoYBEpmrlAxrUxYMUekKbpjPNfjUCjhbdMAnJmYQVZBQZkFVweHDAlaqJjRqoQPoOMLhyvYCzqEuQsAFoxWrzRnTVjStPadhsESlERnKhpEPsfDxNvxqcOyIulaCkmPdambLHvGhTZzysvqFauEgkFRItPfvisehFmoBhQqmkfbHVsgfHXDPJVyhwPllQpuYLRYvGodxKjkarnSNgsXoKEMlaSKxKdcVgvOkuLcfLFfdtXGTclqfPOfeoVLbqcjcXCUEBgAGplrkgsmIEhWRZLlGPGCwKWRaCKMkBHTAcypUrYjWwCLtOPVygMwMANGoQwFnCqFrUGMCRZUGJKTZIGPyldsifauoMnJPLTcDHmilcmahlqOELaAUYDBuzsVywnDQfwRLGIWozYaOAilMBcObErwgTDNGWnwQMUgFFSKtPDMEoEQCTKVREqrXZSGLqwTMcxHfWotDllNkIJPMbXzjDVjPOOjCFuIvTyhXKLyhUScOXvYthRXpPfKwMhptXaxIxgqBoUqzrWbaoLTVpQoottZyPFfNOoMioXHRuFwMRYUiKvcWPkrayyTLOCFJlAyslDameIuqVAuxErqFPEWIScKpBORIuZqoXlZuTvAjEdlEWDODFRregDTqGNoFBIHxvimmIZwLfFyKUfEWAnNBdtdzDmTPXtpHRGdIbuucfTjOygZsTxPjfweXhSUkMhPjMaxKlMIJMOXcnQfyzeOcbWwNbeH", @@ -276,7 +276,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, "560969stake", msg.Amount[0].String()) + require.Equal(t, "1682907stake", msg.Amount[0].String()) require.Equal(t, simulation.TypeMsgDeposit, sdk.MsgTypeURL(&msg)) } diff --git a/x/gov/types/v1/gov.pb.go b/x/gov/types/v1/gov.pb.go index c0859c8e74..18f78a568c 100644 --- a/x/gov/types/v1/gov.pb.go +++ b/x/gov/types/v1/gov.pb.go @@ -795,6 +795,12 @@ type Params struct { BurnProposalDepositPrevote bool `protobuf:"varint,14,opt,name=burn_proposal_deposit_prevote,json=burnProposalDepositPrevote,proto3" json:"burn_proposal_deposit_prevote,omitempty"` // burn deposits if quorum with vote type no_veto is met BurnVoteVeto bool `protobuf:"varint,15,opt,name=burn_vote_veto,json=burnVoteVeto,proto3" json:"burn_vote_veto,omitempty"` + // The ratio representing the proportion of the deposit value minimum that must be met when making a deposit. + // Default value: 0.01. Meaning that for a chain with a min_deposit of 1000stake, a deposit of 1stake would be + // required. + // + // Since: cosmos-sdk 0.50 + MinDepositRatio string `protobuf:"bytes,16,opt,name=min_deposit_ratio,json=minDepositRatio,proto3" json:"min_deposit_ratio,omitempty"` } func (m *Params) Reset() { *m = Params{} } @@ -935,6 +941,13 @@ func (m *Params) GetBurnVoteVeto() bool { return false } +func (m *Params) GetMinDepositRatio() string { + if m != nil { + return m.MinDepositRatio + } + return "" +} + func init() { proto.RegisterEnum("cosmos.gov.v1.VoteOption", VoteOption_name, VoteOption_value) proto.RegisterEnum("cosmos.gov.v1.ProposalStatus", ProposalStatus_name, ProposalStatus_value) @@ -952,95 +965,96 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1/gov.proto", fileDescriptor_e05cb1c0d030febb) } var fileDescriptor_e05cb1c0d030febb = []byte{ - // 1405 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57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0x28, 0x07, 0xb1, 0x41, 0x68, 0x31, 0xe2, 0xa0, 0x0f, - 0x21, 0xe5, 0x62, 0xc6, 0xec, 0x36, 0x66, 0x7a, 0x4c, 0x88, 0xcf, 0x95, 0x64, 0x45, 0x4a, 0x61, - 0x45, 0x4a, 0x15, 0xaf, 0x6f, 0x0e, 0x50, 0xe8, 0x36, 0x24, 0x19, 0xb7, 0x79, 0x8f, 0xe9, 0x71, - 0x91, 0xcc, 0xa5, 0x91, 0x64, 0x86, 0x4b, 0x35, 0x05, 0xc8, 0x54, 0x60, 0x74, 0x0f, 0xd0, 0x13, - 0xe2, 0xd9, 0x1d, 0x8b, 0xdb, 0x9d, 0x4e, 0xdf, 0xf2, 0x31, 0xeb, 0x75, 0xb8, 0x9e, 0x58, 0xd1, - 0x56, 0xd3, 0x37, 0x17, 0x47, 0x24, 0x5a, 0x01, 0xc4, 0x14, 0x08, 0x33, 0x2f, 0x58, 0x43, 0x16, - 0x54, 0x81, 0x34, 0xeb, 0xed, 0xba, 0x84, 0x5b, 0x41, 0x9b, 0xe9, 0x93, 0x4a, 0x62, 0x34, 0xea, - 0x56, 0xd8, 0x83, 0xeb, 0x89, 0x67, 0x7f, 0x2e, 0x6b, 0x26, 0x48, 0x52, 0x60, 0x46, 0x9b, 0x90, - 0x57, 0xd9, 0xb5, 0xb0, 0xe7, 0x48, 0x9d, 0xe4, 0x29, 0x75, 0x72, 0x8a, 0x59, 0xf3, 0x1c, 0xa1, - 0x65, 0x40, 0x96, 0x53, 0x6e, 0x77, 0x2c, 0x65, 0xd7, 0xa7, 0xce, 0x50, 0xa3, 0x8c, 0xa0, 0x86, - 0x0d, 0x74, 0x1f, 0xce, 0x1d, 0x50, 0x4e, 0xbc, 0xb6, 0xc5, 0xb8, 0xed, 0xab, 0xfd, 0xa5, 0x4e, - 0x19, 0xd7, 0x8c, 0xa4, 0x36, 0x03, 0xa6, 0x08, 0xec, 0x1e, 0x28, 0x53, 0xb4, 0xc7, 0xe9, 0x53, -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35, 0x6a, 0xa6, 0x51, 0xaf, 0xe6, 0x35, 0x74, 0x19, - 0x96, 0x46, 0x31, 0xdb, 0xf5, 0x96, 0xb1, 0xf5, 0x79, 0x08, 0x89, 0xa1, 0x45, 0xb8, 0x30, 0x0a, - 0x69, 0x54, 0x9a, 0xcd, 0x5a, 0x55, 0x06, 0x3d, 0xea, 0x33, 0x6b, 0x9b, 0xb5, 0x8d, 0x56, 0xad, - 0x9a, 0x4f, 0x8c, 0x63, 0xde, 0xad, 0x18, 0xf7, 0x6b, 0xd5, 0xfc, 0xe4, 0xfa, 0xed, 0x17, 0x6f, - 0x0a, 0xda, 0xcb, 0x37, 0x05, 0xed, 0xaf, 0x37, 0x05, 0xed, 0xd9, 0xdb, 0xc2, 0xc4, 0xcb, 0xb7, - 0x85, 0x89, 0xdf, 0xdf, 0x16, 0x26, 0xbe, 0xbc, 0x28, 0x7b, 0x88, 0x39, 0x5f, 0x95, 0x08, 0x2d, - 0x1f, 0x8a, 0x5f, 0x71, 0xbc, 0xdf, 0xc5, 0x2c, 0xf8, 0x89, 0x96, 0x14, 0x1d, 0x7f, 0xeb, 0x9f, - 0x00, 0x00, 0x00, 0xff, 0xff, 0xe5, 0x98, 0x2e, 0xa7, 0xe3, 0x0d, 0x00, 0x00, + // 1422 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0xcf, 0x73, 0xd3, 0x46, + 0x1b, 0x8e, 0x6c, 0xc7, 0x71, 0x5e, 0xff, 0x88, 0xd9, 0x04, 0xa2, 0x04, 0xe2, 0x04, 0x7f, 0x0c, + 0x93, 0x8f, 0x0f, 0xec, 0x2f, 0x50, 0x7a, 0x80, 0xce, 0x74, 0x9c, 0xd8, 0x14, 0x67, 0x20, 0x76, + 0x65, 0x93, 0x40, 0x2f, 0x1a, 0x25, 0x5a, 0x9c, 0x9d, 0x5a, 0x5a, 0x57, 0xbb, 0x0e,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x7a, 0xd4, 0x67, 0xd4, 0x36, 0x6b, 0x1b, 0xed, + 0x5a, 0x35, 0x9f, 0x18, 0xc7, 0xbc, 0x57, 0xa9, 0x3f, 0xa8, 0x55, 0xf3, 0x93, 0xeb, 0xb7, 0x5f, + 0xbe, 0x2d, 0x68, 0xaf, 0xde, 0x16, 0xb4, 0x3f, 0xdf, 0x16, 0xb4, 0xe7, 0xef, 0x0a, 0x13, 0xaf, + 0xde, 0x15, 0x26, 0x7e, 0x7b, 0x57, 0x98, 0xf8, 0xe2, 0xa2, 0xac, 0x09, 0xb3, 0xbf, 0x2c, 0x11, + 0x5a, 0x3e, 0x14, 0xbf, 0x00, 0xf9, 0xa0, 0x87, 0x99, 0xff, 0xf3, 0x2e, 0x29, 0xa6, 0xe5, 0xd6, + 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xdf, 0xb5, 0x41, 0x36, 0x1f, 0x0e, 0x00, 0x00, } func (m *WeightedVoteOption) Marshal() (dAtA []byte, err error) { @@ -1536,6 +1550,15 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.MinDepositRatio) > 0 { + i -= len(m.MinDepositRatio) + copy(dAtA[i:], m.MinDepositRatio) + i = encodeVarintGov(dAtA, i, uint64(len(m.MinDepositRatio))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } if m.BurnVoteVeto { i-- if m.BurnVoteVeto { @@ -1966,6 +1989,10 @@ func (m *Params) Size() (n int) { if m.BurnVoteVeto { n += 2 } + l = len(m.MinDepositRatio) + if l > 0 { + n += 2 + l + sovGov(uint64(l)) + } return n } @@ -3913,6 +3940,38 @@ func (m *Params) Unmarshal(dAtA []byte) error { } } m.BurnVoteVeto = bool(v != 0) + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MinDepositRatio", 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.MinDepositRatio = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGov(dAtA[iNdEx:]) diff --git a/x/gov/types/v1/params.go b/x/gov/types/v1/params.go index 5633ebb4c5..658104a954 100644 --- a/x/gov/types/v1/params.go +++ b/x/gov/types/v1/params.go @@ -30,6 +30,7 @@ var ( 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 = sdkmath.LegacyMustNewDecFromStr("0.01") ) // Deprecated: NewDepositParams creates a new DepositParams object @@ -59,7 +60,8 @@ func NewVotingParams(votingPeriod *time.Duration) VotingParams { // NewParams creates a new Params instance with given values. func NewParams( minDeposit, expeditedminDeposit sdk.Coins, maxDepositPeriod, votingPeriod, expeditedVotingPeriod time.Duration, - quorum, threshold, expeditedThreshold, vetoThreshold, minInitialDepositRatio, proposalCancelRatio, proposalCancelDest string, burnProposalDeposit, burnVoteQuorum, burnVoteVeto bool, + quorum, threshold, expeditedThreshold, vetoThreshold, minInitialDepositRatio, proposalCancelRatio, proposalCancelDest string, + burnProposalDeposit, burnVoteQuorum, burnVoteVeto bool, minDepositRatio string, ) Params { return Params{ MinDeposit: minDeposit, @@ -77,6 +79,7 @@ func NewParams( BurnProposalDepositPrevote: burnProposalDeposit, BurnVoteQuorum: burnVoteQuorum, BurnVoteVeto: burnVoteVeto, + MinDepositRatio: minDepositRatio, } } @@ -98,6 +101,7 @@ func DefaultParams() Params { DefaultBurnProposalPrevote, DefaultBurnVoteQuorom, DefaultBurnVoteVeto, + DefaultMinDepositRatio.String(), ) }