From 9c47292d8d59a9a29a5b0d5d9c91cf7133f44636 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Wed, 13 Mar 2024 19:34:55 +0100 Subject: [PATCH] feat(x/gov): add expedited proposal quorum param (#19741) Co-authored-by: Likhita Polavarapu <78951027+likhita-809@users.noreply.github.com> --- api/cosmos/gov/v1/gov.pulsar.go | 220 ++++++++++++++------- x/gov/CHANGELOG.md | 3 +- x/gov/README.md | 20 +- x/gov/keeper/msg_server_test.go | 84 ++++++++ x/gov/keeper/tally.go | 6 +- x/gov/keeper/tally_test.go | 17 +- x/gov/migrations/v6/store.go | 1 + x/gov/migrations/v6/store_test.go | 2 + x/gov/proto/cosmos/gov/v1/gov.proto | 6 + x/gov/simulation/genesis.go | 32 ++- x/gov/simulation/genesis_test.go | 39 ++-- x/gov/types/v1/gov.pb.go | 292 +++++++++++++++++----------- x/gov/types/v1/params.go | 23 ++- 13 files changed, 516 insertions(+), 229 deletions(-) diff --git a/api/cosmos/gov/v1/gov.pulsar.go b/api/cosmos/gov/v1/gov.pulsar.go index 9efdf3c56d..f09b58293b 100644 --- a/api/cosmos/gov/v1/gov.pulsar.go +++ b/api/cosmos/gov/v1/gov.pulsar.go @@ -6644,6 +6644,7 @@ var ( fd_Params_optimistic_authorized_addresses protoreflect.FieldDescriptor fd_Params_optimistic_rejected_threshold protoreflect.FieldDescriptor fd_Params_yes_quorum protoreflect.FieldDescriptor + fd_Params_expedited_quorum protoreflect.FieldDescriptor ) func init() { @@ -6669,6 +6670,7 @@ func init() { fd_Params_optimistic_authorized_addresses = md_Params.Fields().ByName("optimistic_authorized_addresses") fd_Params_optimistic_rejected_threshold = md_Params.Fields().ByName("optimistic_rejected_threshold") fd_Params_yes_quorum = md_Params.Fields().ByName("yes_quorum") + fd_Params_expedited_quorum = md_Params.Fields().ByName("expedited_quorum") } var _ protoreflect.Message = (*fastReflection_Params)(nil) @@ -6856,6 +6858,12 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto return } } + if x.ExpeditedQuorum != "" { + value := protoreflect.ValueOfString(x.ExpeditedQuorum) + if !f(fd_Params_expedited_quorum, value) { + return + } + } } // Has reports whether a field is populated. @@ -6911,6 +6919,8 @@ func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { return x.OptimisticRejectedThreshold != "" case "cosmos.gov.v1.Params.yes_quorum": return x.YesQuorum != "" + case "cosmos.gov.v1.Params.expedited_quorum": + return x.ExpeditedQuorum != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Params")) @@ -6967,6 +6977,8 @@ func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { x.OptimisticRejectedThreshold = "" case "cosmos.gov.v1.Params.yes_quorum": x.YesQuorum = "" + case "cosmos.gov.v1.Params.expedited_quorum": + x.ExpeditedQuorum = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Params")) @@ -7052,6 +7064,9 @@ func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) pro case "cosmos.gov.v1.Params.yes_quorum": value := x.YesQuorum return protoreflect.ValueOfString(value) + case "cosmos.gov.v1.Params.expedited_quorum": + value := x.ExpeditedQuorum + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Params")) @@ -7118,6 +7133,8 @@ func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value proto x.OptimisticRejectedThreshold = value.Interface().(string) case "cosmos.gov.v1.Params.yes_quorum": x.YesQuorum = value.Interface().(string) + case "cosmos.gov.v1.Params.expedited_quorum": + x.ExpeditedQuorum = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Params")) @@ -7199,6 +7216,8 @@ func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protore panic(fmt.Errorf("field optimistic_rejected_threshold of message cosmos.gov.v1.Params is not mutable")) case "cosmos.gov.v1.Params.yes_quorum": panic(fmt.Errorf("field yes_quorum of message cosmos.gov.v1.Params is not mutable")) + case "cosmos.gov.v1.Params.expedited_quorum": + panic(fmt.Errorf("field expedited_quorum 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")) @@ -7258,6 +7277,8 @@ func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protor return protoreflect.ValueOfString("") case "cosmos.gov.v1.Params.yes_quorum": return protoreflect.ValueOfString("") + case "cosmos.gov.v1.Params.expedited_quorum": + return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.Params")) @@ -7410,6 +7431,10 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { if l > 0 { n += 2 + l + runtime.Sov(uint64(l)) } + l = len(x.ExpeditedQuorum) + if l > 0 { + n += 2 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -7439,6 +7464,15 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.ExpeditedQuorum) > 0 { + i -= len(x.ExpeditedQuorum) + copy(dAtA[i:], x.ExpeditedQuorum) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ExpeditedQuorum))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xaa + } if len(x.YesQuorum) > 0 { i -= len(x.YesQuorum) copy(dAtA[i:], x.YesQuorum) @@ -8308,6 +8342,38 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { } x.YesQuorum = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 21: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ExpeditedQuorum", 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.ExpeditedQuorum = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -10055,6 +10121,11 @@ type Params struct { // // Since: x/gov v1.0.0 YesQuorum string `protobuf:"bytes,20,opt,name=yes_quorum,json=yesQuorum,proto3" json:"yes_quorum,omitempty"` + // Minimum percentage of total stake needed to vote for a result to be + // considered valid for an expedited proposal. + // + // Since: x/gov v1.0.0 + ExpeditedQuorum string `protobuf:"bytes,21,opt,name=expedited_quorum,json=expeditedQuorum,proto3" json:"expedited_quorum,omitempty"` } func (x *Params) Reset() { @@ -10217,6 +10288,13 @@ func (x *Params) GetYesQuorum() string { return "" } +func (x *Params) GetExpeditedQuorum() string { + if x != nil { + return x.ExpeditedQuorum + } + return "" +} + // MessageBasedParams defines the parameters of specific messages in a proposal. // It is used to define the parameters of a proposal that is based on a specific message. // Once a message has message based params, it only supports a standard proposal type. @@ -10467,7 +10545,7 @@ var file_cosmos_gov_v1_gov_proto_rawDesc = []byte{ 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, 0x3a, 0x02, 0x18, 0x01, 0x22, 0xc1, 0x0a, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, + 0x6f, 0x6c, 0x64, 0x3a, 0x02, 0x18, 0x01, 0x22, 0xfc, 0x0a, 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, @@ -10551,74 +10629,78 @@ var file_cosmos_gov_v1_gov_proto_rawDesc = []byte{ 0x74, 0x65, 0x64, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x2d, 0x0a, 0x0a, 0x79, 0x65, 0x73, 0x5f, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x18, 0x14, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, - 0x52, 0x09, 0x79, 0x65, 0x73, 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x22, 0x96, 0x02, 0x0a, 0x12, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x61, 0x73, 0x65, 0x64, 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, 0x12, 0x26, 0x0a, 0x06, 0x71, 0x75, 0x6f, 0x72, - 0x75, 0x6d, 0x18, 0x02, 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, 0x2d, 0x0a, 0x0a, 0x79, 0x65, 0x73, 0x5f, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x18, 0x14, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x44, 0x65, 0x63, 0x52, 0x09, 0x79, 0x65, 0x73, 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x12, - 0x2c, 0x0a, 0x09, 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, 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, - 0x04, 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, 0x2a, 0xa7, 0x01, 0x0a, 0x0c, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, - 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x19, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, - 0x4c, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, - 0x45, 0x44, 0x10, 0x00, 0x12, 0x1a, 0x0a, 0x16, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, - 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x4e, 0x44, 0x41, 0x52, 0x44, 0x10, 0x01, - 0x12, 0x21, 0x0a, 0x1d, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x54, 0x59, 0x50, - 0x45, 0x5f, 0x4d, 0x55, 0x4c, 0x54, 0x49, 0x50, 0x4c, 0x45, 0x5f, 0x43, 0x48, 0x4f, 0x49, 0x43, - 0x45, 0x10, 0x02, 0x12, 0x1c, 0x0a, 0x18, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, - 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4d, 0x49, 0x53, 0x54, 0x49, 0x43, 0x10, - 0x03, 0x12, 0x1b, 0x0a, 0x17, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x54, 0x59, - 0x50, 0x45, 0x5f, 0x45, 0x58, 0x50, 0x45, 0x44, 0x49, 0x54, 0x45, 0x44, 0x10, 0x04, 0x2a, 0xfa, - 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, - 0x13, 0x0a, 0x0f, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4f, - 0x4e, 0x45, 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, 0x13, 0x0a, - 0x0f, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x54, 0x57, 0x4f, - 0x10, 0x02, 0x12, 0x12, 0x0a, 0x0e, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, - 0x4e, 0x5f, 0x4e, 0x4f, 0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, - 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x54, 0x48, 0x52, 0x45, 0x45, 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, 0x12, 0x14, 0x0a, 0x10, 0x56, - 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x46, 0x4f, 0x55, 0x52, 0x10, - 0x04, 0x12, 0x14, 0x0a, 0x10, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, - 0x5f, 0x53, 0x50, 0x41, 0x4d, 0x10, 0x05, 0x1a, 0x02, 0x10, 0x01, 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, + 0x52, 0x09, 0x79, 0x65, 0x73, 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x12, 0x39, 0x0a, 0x10, 0x65, + 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x5f, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x18, + 0x15, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0f, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, + 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x22, 0x96, 0x02, 0x0a, 0x12, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x42, 0x61, 0x73, 0x65, 0x64, 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, 0x12, 0x26, 0x0a, 0x06, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x18, 0x02, 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, 0x2d, 0x0a, 0x0a, 0x79, + 0x65, 0x73, 0x5f, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x18, 0x14, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, + 0x09, 0x79, 0x65, 0x73, 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x12, 0x2c, 0x0a, 0x09, 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, 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, 0x04, 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, 0x2a, + 0xa7, 0x01, 0x0a, 0x0c, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x1d, 0x0a, 0x19, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x54, 0x59, 0x50, + 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, + 0x1a, 0x0a, 0x16, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x54, 0x59, 0x50, 0x45, + 0x5f, 0x53, 0x54, 0x41, 0x4e, 0x44, 0x41, 0x52, 0x44, 0x10, 0x01, 0x12, 0x21, 0x0a, 0x1d, 0x50, + 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x55, 0x4c, + 0x54, 0x49, 0x50, 0x4c, 0x45, 0x5f, 0x43, 0x48, 0x4f, 0x49, 0x43, 0x45, 0x10, 0x02, 0x12, 0x1c, + 0x0a, 0x18, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, + 0x4f, 0x50, 0x54, 0x49, 0x4d, 0x49, 0x53, 0x54, 0x49, 0x43, 0x10, 0x03, 0x12, 0x1b, 0x0a, 0x17, + 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x58, + 0x50, 0x45, 0x44, 0x49, 0x54, 0x45, 0x44, 0x10, 0x04, 0x2a, 0xfa, 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, 0x13, 0x0a, 0x0f, 0x56, 0x4f, + 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4f, 0x4e, 0x45, 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, 0x13, 0x0a, 0x0f, 0x56, 0x4f, 0x54, 0x45, + 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x54, 0x57, 0x4f, 0x10, 0x02, 0x12, 0x12, 0x0a, + 0x0e, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4e, 0x4f, 0x10, + 0x03, 0x12, 0x15, 0x0a, 0x11, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, + 0x5f, 0x54, 0x48, 0x52, 0x45, 0x45, 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, 0x12, 0x14, 0x0a, 0x10, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, + 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x46, 0x4f, 0x55, 0x52, 0x10, 0x04, 0x12, 0x14, 0x0a, 0x10, + 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x50, 0x41, 0x4d, + 0x10, 0x05, 0x1a, 0x02, 0x10, 0x01, 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/x/gov/CHANGELOG.md b/x/gov/CHANGELOG.md index b1d565a9a4..94bc8b201f 100644 --- a/x/gov/CHANGELOG.md +++ b/x/gov/CHANGELOG.md @@ -37,6 +37,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements +* [#19741](https://github.com/cosmos/cosmos-sdk/pull/19741) Add `ExpeditedQuorum` parameter specifying a minimum quorum for expedited proposals, that can differ from the regular quorum. * [#19352](https://github.com/cosmos/cosmos-sdk/pull/19352) `TallyResult` include vote options counts. Those counts replicates the now deprecated (but not removed) yes, no, abstain and veto count fields. * [#18976](https://github.com/cosmos/cosmos-sdk/pull/18976) Log and send an event when a proposal deposit refund or burn has failed. * [#18856](https://github.com/cosmos/cosmos-sdk/pull/18856) Add `ProposalCancelMaxPeriod` parameter for modifying how long a proposal can be cancelled after it has been submitted. @@ -61,7 +62,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### API Breaking Changes * [#19481](https://github.com/cosmos/cosmos-sdk/pull/19481) Migrate module to use `appmodule.Environment`; `NewKeeper` now takes `appmodule.Environment` instead of a store service and no `baseapp.MessageRouter` anymore. -* [#19481](https://github.com/cosmos/cosmos-sdk/pull/19481) v1beta1 proposal handlers now take a `context.Context` instead of an `sdk.Context`. +* [#19481](https://github.com/cosmos/cosmos-sdk/pull/19481) v1beta1 proposal handlers now take a `context.Context` instead of an `sdk.Context`. * [#19592](https://github.com/cosmos/cosmos-sdk/pull/19592) `types.Config` and `types.DefaultConfig` have been moved to the keeper package in order to support the custom tallying function. * [#19349](https://github.com/cosmos/cosmos-sdk/pull/19349) Simplify state management in `x/gov`. Note `k.VotingPeriodProposals` and `k.SetProposal` are no longer needed and have been removed. * [#18532](https://github.com/cosmos/cosmos-sdk/pull/18532) All functions that were taking an expedited bool parameter now take a `ProposalType` parameter instead. diff --git a/x/gov/README.md b/x/gov/README.md index 2d0d82bf07..919afe01ec 100644 --- a/x/gov/README.md +++ b/x/gov/README.md @@ -188,6 +188,18 @@ 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 Quorum + +Expedited Quorum is defined as the minimum percentage of voting power that needs to be +cast on an **expedited** proposal for the result to be valid. + +### Yes Quorum + +Yes quorum is a more restrictive quorum that is used to determine if a proposal passes. +It is defined as the minimum percentage of voting power that needs to have voted `Yes` for the proposal to pass. +It differs from `Threshold` as it takes the whole voting power into account, not only `Yes` and `No` votes. +By default, `YesQuorum` is set to 0, which means no minimum. + ### Proposal Types Proposal types have been introduced in ADR-069. @@ -235,13 +247,6 @@ This means that proposals are accepted iff: For expedited proposals, by default, the threshold is higher than with a *normal proposal*, namely, 66.7%. -### Yes Quorum - -Yes quorum is a more restrictive quorum that is used to determine if a proposal passes. -It is defined as the minimum percentage of voting power that needs to have voted `Yes` for the proposal to pass. -It differs from `Threshold` as it takes the whole voting power into account, not only `Yes` and `No` votes. -By default, `YesQuorum` is set to 0, which means no minimum. - #### Inheritance If a delegator does not vote, it will inherit its validator vote. @@ -616,6 +621,7 @@ The governance module contains the following parameters: | expedited_threshold | string (time ns) | "0.667000000000000000" | | expedited_voting_period | string (time ns) | "86400000000000" (8600s) | | expedited_min_deposit | array (coins) | [{"denom":"uatom","amount":"50000000"}] | +| expedited_quorum | string (dec) | "0.5" | | burn_proposal_deposit_prevote | bool | false | | burn_vote_quorum | bool | false | | burn_vote_veto | bool | true | diff --git a/x/gov/keeper/msg_server_test.go b/x/gov/keeper/msg_server_test.go index 5425c3fd21..994d467282 100644 --- a/x/gov/keeper/msg_server_test.go +++ b/x/gov/keeper/msg_server_test.go @@ -1727,6 +1727,90 @@ func (suite *KeeperTestSuite) TestMsgUpdateParams() { expErr: true, expErrMsg: "quorum too large", }, + { + name: "invalid yes quorum", + input: func() *v1.MsgUpdateParams { + params1 := params + params1.YesQuorum = abc + + return &v1.MsgUpdateParams{ + Authority: authority, + Params: params1, + } + }, + expErr: true, + expErrMsg: "invalid yes_quorum string", + }, + { + name: "negative yes quorum", + input: func() *v1.MsgUpdateParams { + params1 := params + params1.YesQuorum = o1 + + return &v1.MsgUpdateParams{ + Authority: authority, + Params: params1, + } + }, + expErr: true, + expErrMsg: "yes_quorum cannot be negative", + }, + { + name: "yes quorum > 1", + input: func() *v1.MsgUpdateParams { + params1 := params + params1.YesQuorum = "2" + + return &v1.MsgUpdateParams{ + Authority: authority, + Params: params1, + } + }, + expErr: true, + expErrMsg: "yes_quorum too large", + }, + { + name: "invalid expedited quorum", + input: func() *v1.MsgUpdateParams { + params1 := params + params1.ExpeditedQuorum = abc + + return &v1.MsgUpdateParams{ + Authority: authority, + Params: params1, + } + }, + expErr: true, + expErrMsg: "invalid expedited_quorum string", + }, + { + name: "negative expedited quorum", + input: func() *v1.MsgUpdateParams { + params1 := params + params1.ExpeditedQuorum = o1 + + return &v1.MsgUpdateParams{ + Authority: authority, + Params: params1, + } + }, + expErr: true, + expErrMsg: "expedited_quorum cannot be negative", + }, + { + name: "expedited quorum > 1", + input: func() *v1.MsgUpdateParams { + params1 := params + params1.ExpeditedQuorum = "2" + + return &v1.MsgUpdateParams{ + Authority: authority, + Params: params1, + } + }, + expErr: true, + expErrMsg: "expedited_quorum too large", + }, { name: "invalid threshold", input: func() *v1.MsgUpdateParams { diff --git a/x/gov/keeper/tally.go b/x/gov/keeper/tally.go index 8f87ec3570..dc1b1c5728 100644 --- a/x/gov/keeper/tally.go +++ b/x/gov/keeper/tally.go @@ -125,7 +125,7 @@ func (k Keeper) tallyStandard(ctx context.Context, proposal v1.Proposal, totalVo } // tallyExpedited tallies the votes of an expedited proposal -// If there is not enough quorum of votes, the proposal fails +// If there is not enough expedited quorum of votes, the proposal fails // If no one votes (everyone abstains), proposal fails // If more than 1/3 of voters veto, proposal fails // If more than 2/3 of non-abstaining voters vote Yes, proposal passes @@ -136,8 +136,8 @@ func (k Keeper) tallyExpedited(totalVoterPower math.LegacyDec, totalBonded math. // If there is not enough quorum of votes, the proposal fails percentVoting := totalVoterPower.Quo(math.LegacyNewDecFromInt(totalBonded)) - quorum, _ := math.LegacyNewDecFromStr(params.Quorum) - if percentVoting.LT(quorum) { + expeditedQuorum, _ := math.LegacyNewDecFromStr(params.ExpeditedQuorum) + if percentVoting.LT(expeditedQuorum) { return false, params.BurnVoteQuorum, tallyResults, nil } diff --git a/x/gov/keeper/tally_test.go b/x/gov/keeper/tally_test.go index 90de90a33b..723cfb779f 100644 --- a/x/gov/keeper/tally_test.go +++ b/x/gov/keeper/tally_test.go @@ -712,16 +712,17 @@ func TestTally_Expedited(t *testing.T) { validatorVote(s, s.valAddrs[1], v1.VoteOption_VOTE_OPTION_TWO) validatorVote(s, s.valAddrs[2], v1.VoteOption_VOTE_OPTION_TWO) validatorVote(s, s.valAddrs[3], v1.VoteOption_VOTE_OPTION_TWO) + validatorVote(s, s.valAddrs[4], v1.VoteOption_VOTE_OPTION_TWO) }, expectedPass: false, expectedBurn: false, expectedTally: v1.TallyResult{ YesCount: "0", - AbstainCount: "4000000", + AbstainCount: "5000000", NoCount: "0", NoWithVetoCount: "0", OptionOneCount: "0", - OptionTwoCount: "4000000", + OptionTwoCount: "5000000", OptionThreeCount: "0", OptionFourCount: "0", SpamCount: "0", @@ -759,19 +760,21 @@ func TestTally_Expedited(t *testing.T) { setTotalBonded(s, 10000000) validatorVote(s, s.valAddrs[0], v1.VoteOption_VOTE_OPTION_ONE) validatorVote(s, s.valAddrs[1], v1.VoteOption_VOTE_OPTION_ONE) - validatorVote(s, s.valAddrs[2], v1.VoteOption_VOTE_OPTION_THREE) + validatorVote(s, s.valAddrs[2], v1.VoteOption_VOTE_OPTION_ONE) validatorVote(s, s.valAddrs[3], v1.VoteOption_VOTE_OPTION_THREE) + validatorVote(s, s.valAddrs[4], v1.VoteOption_VOTE_OPTION_THREE) + validatorVote(s, s.valAddrs[5], v1.VoteOption_VOTE_OPTION_THREE) }, expectedPass: false, expectedBurn: false, expectedTally: v1.TallyResult{ - YesCount: "2000000", + YesCount: "3000000", AbstainCount: "0", - NoCount: "2000000", + NoCount: "3000000", NoWithVetoCount: "0", - OptionOneCount: "2000000", + OptionOneCount: "3000000", OptionTwoCount: "0", - OptionThreeCount: "2000000", + OptionThreeCount: "3000000", OptionFourCount: "0", SpamCount: "0", }, diff --git a/x/gov/migrations/v6/store.go b/x/gov/migrations/v6/store.go index be30f95f50..f45388e89a 100644 --- a/x/gov/migrations/v6/store.go +++ b/x/gov/migrations/v6/store.go @@ -49,6 +49,7 @@ func MigrateStore(ctx context.Context, storeService corestoretypes.KVStoreServic if err != nil { return fmt.Errorf("failed to get gov params: %w", err) } + govParams.ExpeditedQuorum = govParams.Quorum defaultParams := v1.DefaultParams() govParams.YesQuorum = defaultParams.YesQuorum diff --git a/x/gov/migrations/v6/store_test.go b/x/gov/migrations/v6/store_test.go index 76a6aa654e..ffeff54213 100644 --- a/x/gov/migrations/v6/store_test.go +++ b/x/gov/migrations/v6/store_test.go @@ -31,6 +31,7 @@ func TestMigrateStore(t *testing.T) { // set defaults without newly added fields previousParams := v1.DefaultParams() previousParams.YesQuorum = "" + previousParams.ExpeditedQuorum = "" previousParams.ProposalCancelMaxPeriod = "" previousParams.OptimisticAuthorizedAddresses = nil previousParams.OptimisticRejectedThreshold = "" @@ -45,6 +46,7 @@ func TestMigrateStore(t *testing.T) { newParams, err := paramsCollection.Get(ctx) require.NoError(t, err) require.Equal(t, v1.DefaultParams().YesQuorum, newParams.YesQuorum) + require.Equal(t, v1.DefaultParams().Quorum, newParams.ExpeditedQuorum) // ExpeditedQuorum is set to Quorum during the migration instead of the default SDK value, for avoiding behavior change. require.Equal(t, v1.DefaultParams().ProposalCancelMaxPeriod, newParams.ProposalCancelMaxPeriod) require.Equal(t, v1.DefaultParams().OptimisticAuthorizedAddresses, newParams.OptimisticAuthorizedAddresses) require.Equal(t, v1.DefaultParams().OptimisticRejectedThreshold, newParams.OptimisticRejectedThreshold) diff --git a/x/gov/proto/cosmos/gov/v1/gov.proto b/x/gov/proto/cosmos/gov/v1/gov.proto index 3ce0608c69..f83ef8735b 100644 --- a/x/gov/proto/cosmos/gov/v1/gov.proto +++ b/x/gov/proto/cosmos/gov/v1/gov.proto @@ -367,6 +367,12 @@ message Params { // // Since: x/gov v1.0.0 string yes_quorum = 20 [(cosmos_proto.scalar) = "cosmos.Dec"]; + + // Minimum percentage of total stake needed to vote for a result to be + // considered valid for an expedited proposal. + // + // Since: x/gov v1.0.0 + string expedited_quorum = 21 [(cosmos_proto.scalar) = "cosmos.Dec"]; } // MessageBasedParams defines the parameters of specific messages in a proposal. diff --git a/x/gov/simulation/genesis.go b/x/gov/simulation/genesis.go index 39d73037ec..f029f692f0 100644 --- a/x/gov/simulation/genesis.go +++ b/x/gov/simulation/genesis.go @@ -24,6 +24,7 @@ const ( VotingPeriod = "voting_period" ExpeditedVotingPeriod = "expedited_voting_period" Quorum = "quorum" + ExpeditedQuorum = "expedited_quorum" YesQuorum = "yes_quorum" Threshold = "threshold" ExpeditedThreshold = "expedited_threshold" @@ -151,11 +152,14 @@ func RandomizedGenState(simState *module.SimulationState) { var yesQuorum sdkmath.LegacyDec simState.AppParams.GetOrGenerate(YesQuorum, &yesQuorum, simState.Rand, func(r *rand.Rand) { yesQuorum = GenQuorum(r) }) + var expeditedQuorum sdkmath.LegacyDec + simState.AppParams.GetOrGenerate(ExpeditedQuorum, &expeditedQuorum, simState.Rand, func(r *rand.Rand) { expeditedQuorum = GenQuorum(r) }) + var threshold sdkmath.LegacyDec simState.AppParams.GetOrGenerate(Threshold, &threshold, simState.Rand, func(r *rand.Rand) { threshold = GenThreshold(r) }) - var expitedVotingThreshold sdkmath.LegacyDec - simState.AppParams.GetOrGenerate(ExpeditedThreshold, &expitedVotingThreshold, simState.Rand, func(r *rand.Rand) { expitedVotingThreshold = GenExpeditedThreshold(r) }) + var expeditedVotingThreshold sdkmath.LegacyDec + simState.AppParams.GetOrGenerate(ExpeditedThreshold, &expeditedVotingThreshold, simState.Rand, func(r *rand.Rand) { expeditedVotingThreshold = GenExpeditedThreshold(r) }) var veto sdkmath.LegacyDec simState.AppParams.GetOrGenerate(Veto, &veto, simState.Rand, func(r *rand.Rand) { veto = GenVeto(r) }) @@ -168,7 +172,29 @@ func RandomizedGenState(simState *module.SimulationState) { govGenesis := v1.NewGenesisState( startingProposalID, - v1.NewParams(minDeposit, expeditedMinDeposit, depositPeriod, votingPeriod, expeditedVotingPeriod, quorum.String(), yesQuorum.String(), threshold.String(), expitedVotingThreshold.String(), veto.String(), minInitialDepositRatio.String(), proposalCancelRate.String(), "", proposalMaxCancelVotingPeriod.String(), simState.Rand.Intn(2) == 0, simState.Rand.Intn(2) == 0, simState.Rand.Intn(2) == 0, minDepositRatio.String(), optimisticRejectedThreshold.String(), []string{}), + v1.NewParams( + minDeposit, + expeditedMinDeposit, + depositPeriod, + votingPeriod, + expeditedVotingPeriod, + quorum.String(), + yesQuorum.String(), + expeditedQuorum.String(), + threshold.String(), + expeditedVotingThreshold.String(), + veto.String(), + minInitialDepositRatio.String(), + proposalCancelRate.String(), + "", + proposalMaxCancelVotingPeriod.String(), + simState.Rand.Intn(2) == 0, + simState.Rand.Intn(2) == 0, + simState.Rand.Intn(2) == 0, + minDepositRatio.String(), + optimisticRejectedThreshold.String(), + []string{}, + ), ) bz, err := json.MarshalIndent(&govGenesis, "", " ") diff --git a/x/gov/simulation/genesis_test.go b/x/gov/simulation/genesis_test.go index 5a9cbd8982..702350a409 100644 --- a/x/gov/simulation/genesis_test.go +++ b/x/gov/simulation/genesis_test.go @@ -6,7 +6,6 @@ import ( "testing" "github.com/stretchr/testify/require" - "gotest.tools/v3/assert" sdkmath "cosmossdk.io/math" "cosmossdk.io/x/gov/simulation" @@ -48,28 +47,30 @@ func TestRandomizedGenState(t *testing.T) { const ( tallyQuorum = "0.387000000000000000" tallyYesQuorum = "0.449000000000000000" - tallyThreshold = "0.464000000000000000" - tallyExpeditedThreshold = "0.506000000000000000" - tallyVetoThreshold = "0.309000000000000000" + tallyExpeditedQuorum = "0.457000000000000000" + tallyThreshold = "0.479000000000000000" + tallyExpeditedThreshold = "0.545000000000000000" + tallyVetoThreshold = "0.280000000000000000" minInitialDepositDec = "0.880000000000000000" proposalCancelMaxPeriod = "0.110000000000000000" ) - assert.Equal(t, "272stake", govGenesis.Params.MinDeposit[0].String()) - assert.Equal(t, "800stake", govGenesis.Params.ExpeditedMinDeposit[0].String()) - assert.Equal(t, "41h11m36s", govGenesis.Params.MaxDepositPeriod.String()) - assert.Equal(t, float64(291928), govGenesis.Params.VotingPeriod.Seconds()) - assert.Equal(t, float64(33502), govGenesis.Params.ExpeditedVotingPeriod.Seconds()) - assert.Equal(t, tallyQuorum, govGenesis.Params.Quorum) - assert.Equal(t, tallyYesQuorum, govGenesis.Params.YesQuorum) - assert.Equal(t, tallyThreshold, govGenesis.Params.Threshold) - assert.Equal(t, tallyExpeditedThreshold, govGenesis.Params.ExpeditedThreshold) - assert.Equal(t, tallyVetoThreshold, govGenesis.Params.VetoThreshold) - assert.Equal(t, proposalCancelMaxPeriod, govGenesis.Params.ProposalCancelMaxPeriod) - assert.Equal(t, uint64(0x28), govGenesis.StartingProposalId) - assert.DeepEqual(t, []*v1.Deposit{}, govGenesis.Deposits) - assert.DeepEqual(t, []*v1.Vote{}, govGenesis.Votes) - assert.DeepEqual(t, []*v1.Proposal{}, govGenesis.Proposals) + require.Equal(t, "272stake", govGenesis.Params.MinDeposit[0].String()) + require.Equal(t, "800stake", govGenesis.Params.ExpeditedMinDeposit[0].String()) + require.Equal(t, "41h11m36s", govGenesis.Params.MaxDepositPeriod.String()) + require.Equal(t, float64(291928), govGenesis.Params.VotingPeriod.Seconds()) + require.Equal(t, float64(33502), govGenesis.Params.ExpeditedVotingPeriod.Seconds()) + require.Equal(t, tallyQuorum, govGenesis.Params.Quorum) + require.Equal(t, tallyYesQuorum, govGenesis.Params.YesQuorum) + require.Equal(t, tallyExpeditedQuorum, govGenesis.Params.ExpeditedQuorum) + require.Equal(t, tallyThreshold, govGenesis.Params.Threshold) + require.Equal(t, tallyExpeditedThreshold, govGenesis.Params.ExpeditedThreshold) + require.Equal(t, tallyVetoThreshold, govGenesis.Params.VetoThreshold) + require.Equal(t, proposalCancelMaxPeriod, govGenesis.Params.ProposalCancelMaxPeriod) + require.Equal(t, uint64(0x28), govGenesis.StartingProposalId) + require.Equal(t, []*v1.Deposit{}, govGenesis.Deposits) + require.Equal(t, []*v1.Vote{}, govGenesis.Votes) + require.Equal(t, []*v1.Proposal{}, govGenesis.Proposals) } // TestRandomizedGenState tests abnormal scenarios of applying RandomizedGenState. diff --git a/x/gov/types/v1/gov.pb.go b/x/gov/types/v1/gov.pb.go index 9dfd99de9a..cc9b058d7d 100644 --- a/x/gov/types/v1/gov.pb.go +++ b/x/gov/types/v1/gov.pb.go @@ -1040,6 +1040,11 @@ type Params struct { // // Since: x/gov v1.0.0 YesQuorum string `protobuf:"bytes,20,opt,name=yes_quorum,json=yesQuorum,proto3" json:"yes_quorum,omitempty"` + // Minimum percentage of total stake needed to vote for a result to be + // considered valid for an expedited proposal. + // + // Since: x/gov v1.0.0 + ExpeditedQuorum string `protobuf:"bytes,21,opt,name=expedited_quorum,json=expeditedQuorum,proto3" json:"expedited_quorum,omitempty"` } func (m *Params) Reset() { *m = Params{} } @@ -1215,6 +1220,13 @@ func (m *Params) GetYesQuorum() string { return "" } +func (m *Params) GetExpeditedQuorum() string { + if m != nil { + return m.ExpeditedQuorum + } + return "" +} + // MessageBasedParams defines the parameters of specific messages in a proposal. // It is used to define the parameters of a proposal that is based on a specific message. // Once a message has message based params, it only supports a standard proposal type. @@ -1322,123 +1334,124 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1/gov.proto", fileDescriptor_e05cb1c0d030febb) } var fileDescriptor_e05cb1c0d030febb = []byte{ - // 1854 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0xcd, 0x73, 0xe3, 0x48, - 0x15, 0x1f, 0xd9, 0x8e, 0x63, 0xbf, 0x38, 0x8e, 0xa6, 0x93, 0xd9, 0x28, 0xc9, 0xe6, 0x63, 0xcc, - 0xd6, 0x56, 0x6a, 0xd8, 0xd8, 0x64, 0x61, 0x28, 0x6a, 0x59, 0x0a, 0xec, 0x58, 0x43, 0x34, 0x24, - 0xb1, 0x91, 0x35, 0xc9, 0x0c, 0x17, 0xa1, 0x44, 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0x5e, 0x90, 0x06, 0xd3, 0x51, 0xdf, 0xf7, - 0x9d, 0x70, 0xa0, 0x95, 0xb8, 0x3c, 0x7e, 0x45, 0xdf, 0x81, 0x82, 0xe8, 0x08, 0x1c, 0x6a, 0xb3, - 0x37, 0xb4, 0xc0, 0x10, 0x89, 0x36, 0xa0, 0x88, 0x2f, 0x7b, 0xd8, 0xf5, 0x28, 0x76, 0xb5, 0xf2, - 0x86, 0xb2, 0x59, 0x68, 0x64, 0x34, 0xc5, 0x4c, 0x84, 0xe8, 0x1b, 0x30, 0xfb, 0xd2, 0xf1, 0xba, - 0xd8, 0xb5, 0x43, 0xec, 0x44, 0x24, 0xd0, 0xe6, 0xf8, 0xba, 0x25, 0x21, 0x34, 0xb9, 0x0c, 0xfd, - 0x08, 0x66, 0x87, 0x1d, 0x4a, 0x07, 0x3d, 0xac, 0xa9, 0xbc, 0x84, 0x57, 0xae, 0x29, 0x61, 0x6b, - 0xd0, 0xc3, 0x66, 0xa9, 0x97, 0x7a, 0xab, 0xfc, 0x45, 0x81, 0xf9, 0x58, 0x9d, 0x8c, 0x8d, 0x08, - 0xad, 0x02, 0x88, 0xc9, 0x61, 0x93, 0x00, 0xf3, 0xfe, 0x2a, 0x9a, 0x45, 0x21, 0x69, 0x05, 0x38, - 0xa5, 0xa6, 0x17, 0x44, 0xb4, 0x7e, 0xac, 0xb6, 0x2e, 0x08, 0x7a, 0x08, 0xa5, 0x58, 0x7d, 0x16, - 0x62, 0xcc, 0x3b, 0xab, 0x68, 0xce, 0x48, 0x00, 0x13, 0xb1, 0xe1, 0x22, 0x21, 0x2f, 0x49, 0x3f, - 0xe4, 0x8d, 0x53, 0x34, 0xa5, 0xd1, 0x27, 0xa4, 0x1f, 0xa6, 0x00, 0x51, 0xcf, 0xf1, 0x79, 0x5b, - 0x0c, 0x01, 0x9d, 0x9e, 0xe3, 0x57, 0xfe, 0x97, 0x85, 0x99, 0x74, 0x1f, 0x6d, 0x41, 0x71, 0x80, - 0x23, 0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35, 0xad, 0x7d, - 0xd2, 0x7a, 0x66, 0x5e, 0x95, 0x76, 0xda, 0xf5, 0x7d, 0x75, 0x6a, 0x39, 0xa3, 0x2a, 0x8f, 0xfe, - 0xae, 0x40, 0x79, 0xf4, 0x9b, 0x01, 0x5a, 0x87, 0x95, 0x61, 0xb0, 0x3a, 0x56, 0xdd, 0x7a, 0xd6, - 0x19, 0x0b, 0x42, 0x05, 0xd6, 0xc6, 0x01, 0x4d, 0xbd, 0xdd, 0xea, 0x18, 0x96, 0xdd, 0xd6, 0x4d, - 0xa3, 0x35, 0x9e, 0x32, 0x89, 0x39, 0x6c, 0x59, 0xc6, 0xc1, 0x8f, 0x63, 0x48, 0x66, 0x24, 0xe3, - 0x12, 0xd2, 0xae, 0x77, 0x3a, 0x7a, 0x53, 0x6c, 0x72, 0x5c, 0x67, 0xea, 0x4f, 0xf5, 0x1d, 0x9e, - 0xb1, 0x49, 0xcc, 0x27, 0x75, 0x63, 0x4f, 0x6f, 0xaa, 0x53, 0x8d, 0xc7, 0x9f, 0xbd, 0x5e, 0x53, - 0x3e, 0x7f, 0xbd, 0xa6, 0xfc, 0xfb, 0xf5, 0x9a, 0xf2, 0xc9, 0x9b, 0xb5, 0x7b, 0x9f, 0xbf, 0x59, - 0xbb, 0xf7, 0x8f, 0x37, 0x6b, 0xf7, 0x7e, 0xb6, 0x22, 0x8a, 0x35, 0x72, 0x7f, 0x59, 0xf5, 0x48, - 0xed, 0x92, 0x7f, 0x8d, 0x63, 0x3f, 0x43, 0xa3, 0xda, 0xf9, 0xf6, 0x71, 0x9e, 0x77, 0xe4, 0xb7, - 0xff, 0x1f, 0x00, 0x00, 0xff, 0xff, 0xdf, 0x80, 0xb6, 0x5a, 0xab, 0x13, 0x00, 0x00, + // 1867 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0x4f, 0x73, 0xe3, 0x48, + 0x15, 0x1f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25, 0xff, + 0x90, 0xc7, 0xde, 0x60, 0xa3, 0xda, 0xf9, 0xf6, 0x71, 0x9e, 0x77, 0xe4, 0xb7, 0xff, 0x17, 0x00, + 0x00, 0xff, 0xff, 0xb0, 0x5e, 0x88, 0xa8, 0xe6, 0x13, 0x00, 0x00, } func (m *WeightedVoteOption) Marshal() (dAtA []byte, err error) { @@ -2034,6 +2047,15 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.ExpeditedQuorum) > 0 { + i -= len(m.ExpeditedQuorum) + copy(dAtA[i:], m.ExpeditedQuorum) + i = encodeVarintGov(dAtA, i, uint64(len(m.ExpeditedQuorum))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xaa + } if len(m.YesQuorum) > 0 { i -= len(m.YesQuorum) copy(dAtA[i:], m.YesQuorum) @@ -2648,6 +2670,10 @@ func (m *Params) Size() (n int) { if l > 0 { n += 2 + l + sovGov(uint64(l)) } + l = len(m.ExpeditedQuorum) + if l > 0 { + n += 2 + l + sovGov(uint64(l)) + } return n } @@ -5173,6 +5199,38 @@ func (m *Params) Unmarshal(dAtA []byte) error { } m.YesQuorum = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 21: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExpeditedQuorum", 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.ExpeditedQuorum = 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 00c54ee8be..66efdf0d43 100644 --- a/x/gov/types/v1/params.go +++ b/x/gov/types/v1/params.go @@ -23,6 +23,7 @@ var ( DefaultMinExpeditedDepositTokens = DefaultMinDepositTokens.Mul(sdkmath.NewInt(DefaultMinExpeditedDepositTokensRatio)) DefaultQuorum = sdkmath.LegacyNewDecWithPrec(334, 3) DefaultYesQuorum = sdkmath.LegacyNewDecWithPrec(0, 1) + DefaultExpeditedQuorum = sdkmath.LegacyNewDecWithPrec(500, 3) DefaultThreshold = sdkmath.LegacyNewDecWithPrec(5, 1) DefaultExpeditedThreshold = sdkmath.LegacyNewDecWithPrec(667, 3) DefaultVetoThreshold = sdkmath.LegacyNewDecWithPrec(334, 3) @@ -40,9 +41,12 @@ var ( // NewParams creates a new Params instance with given values. func NewParams( - minDeposit, expeditedminDeposit sdk.Coins, maxDepositPeriod, votingPeriod, expeditedVotingPeriod time.Duration, - quorum, yesQuorum, threshold, expeditedThreshold, vetoThreshold, minInitialDepositRatio, proposalCancelRatio, proposalCancelDest, proposalMaxCancelVotingPeriod string, - burnProposalDeposit, burnVoteQuorum, burnVoteVeto bool, minDepositRatio, optimisticRejectedThreshold string, optimisticAuthorizedAddresses []string, + minDeposit, expeditedminDeposit sdk.Coins, + maxDepositPeriod, votingPeriod, expeditedVotingPeriod time.Duration, + quorum, yesQuorum, expeditedQuorum, threshold, expeditedThreshold, vetoThreshold, minInitialDepositRatio, proposalCancelRatio, proposalCancelDest, proposalMaxCancelVotingPeriod string, + burnProposalDeposit, burnVoteQuorum, burnVoteVeto bool, + minDepositRatio, optimisticRejectedThreshold string, + optimisticAuthorizedAddresses []string, ) Params { return Params{ MinDeposit: minDeposit, @@ -52,6 +56,7 @@ func NewParams( ExpeditedVotingPeriod: &expeditedVotingPeriod, Quorum: quorum, YesQuorum: yesQuorum, + ExpeditedQuorum: expeditedQuorum, Threshold: threshold, ExpeditedThreshold: expeditedThreshold, VetoThreshold: vetoThreshold, @@ -78,6 +83,7 @@ func DefaultParams() Params { DefaultExpeditedPeriod, DefaultQuorum.String(), DefaultYesQuorum.String(), + DefaultExpeditedQuorum.String(), DefaultThreshold.String(), DefaultExpeditedThreshold.String(), DefaultVetoThreshold.String(), @@ -137,6 +143,17 @@ func (p Params) ValidateBasic(addressCodec address.Codec) error { return fmt.Errorf("yes_quorum too large: %s", p.YesQuorum) } + expeditedQuorum, err := sdkmath.LegacyNewDecFromStr(p.ExpeditedQuorum) + if err != nil { + return fmt.Errorf("invalid expedited_quorum string: %w", err) + } + if expeditedQuorum.IsNegative() { + return fmt.Errorf("expedited_quorum cannot be negative: %s", expeditedQuorum) + } + if expeditedQuorum.GT(sdkmath.LegacyOneDec()) { + return fmt.Errorf("expedited_quorum too large: %s", p.ExpeditedQuorum) + } + threshold, err := sdkmath.LegacyNewDecFromStr(p.Threshold) if err != nil { return fmt.Errorf("invalid threshold string: %w", err)