From 4333d15614e3de9609672f51ac5a88350e112384 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Fri, 30 Aug 2024 13:38:15 +0200 Subject: [PATCH 01/23] demo of removing comet from consenuss --- api/cosmos/consensus/v1/params.pulsar.go | 4918 +++++++++++++++++ api/cosmos/consensus/v1/query.pulsar.go | 80 +- api/cosmos/consensus/v1/tx.pulsar.go | 299 +- x/consensus/exported/exported.go | 6 +- .../proto/cosmos/consensus/v1/consensus.proto | 15 - .../proto/cosmos/consensus/v1/params.proto | 136 + .../proto/cosmos/consensus/v1/query.proto | 4 +- .../proto/cosmos/consensus/v1/tx.proto | 14 +- x/consensus/types/consensus.pb.go | 503 -- x/consensus/types/msgs.go | 14 +- x/consensus/types/params.pb.go | 2301 ++++++++ x/consensus/types/query.pb.go | 32 +- x/consensus/types/tx.pb.go | 154 +- 13 files changed, 7574 insertions(+), 902 deletions(-) create mode 100644 api/cosmos/consensus/v1/params.pulsar.go delete mode 100644 x/consensus/proto/cosmos/consensus/v1/consensus.proto create mode 100644 x/consensus/proto/cosmos/consensus/v1/params.proto delete mode 100644 x/consensus/types/consensus.pb.go create mode 100644 x/consensus/types/params.pb.go diff --git a/api/cosmos/consensus/v1/params.pulsar.go b/api/cosmos/consensus/v1/params.pulsar.go new file mode 100644 index 000000000000..930d73130c9c --- /dev/null +++ b/api/cosmos/consensus/v1/params.pulsar.go @@ -0,0 +1,4918 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package consensusv1 + +import ( + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + durationpb "google.golang.org/protobuf/types/known/durationpb" + wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_ConsensusParams protoreflect.MessageDescriptor + fd_ConsensusParams_block protoreflect.FieldDescriptor + fd_ConsensusParams_evidence protoreflect.FieldDescriptor + fd_ConsensusParams_validator protoreflect.FieldDescriptor + fd_ConsensusParams_version protoreflect.FieldDescriptor + fd_ConsensusParams_synchrony protoreflect.FieldDescriptor + fd_ConsensusParams_feature protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_consensus_v1_params_proto_init() + md_ConsensusParams = File_cosmos_consensus_v1_params_proto.Messages().ByName("ConsensusParams") + fd_ConsensusParams_block = md_ConsensusParams.Fields().ByName("block") + fd_ConsensusParams_evidence = md_ConsensusParams.Fields().ByName("evidence") + fd_ConsensusParams_validator = md_ConsensusParams.Fields().ByName("validator") + fd_ConsensusParams_version = md_ConsensusParams.Fields().ByName("version") + fd_ConsensusParams_synchrony = md_ConsensusParams.Fields().ByName("synchrony") + fd_ConsensusParams_feature = md_ConsensusParams.Fields().ByName("feature") +} + +var _ protoreflect.Message = (*fastReflection_ConsensusParams)(nil) + +type fastReflection_ConsensusParams ConsensusParams + +func (x *ConsensusParams) ProtoReflect() protoreflect.Message { + return (*fastReflection_ConsensusParams)(x) +} + +func (x *ConsensusParams) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_consensus_v1_params_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_ConsensusParams_messageType fastReflection_ConsensusParams_messageType +var _ protoreflect.MessageType = fastReflection_ConsensusParams_messageType{} + +type fastReflection_ConsensusParams_messageType struct{} + +func (x fastReflection_ConsensusParams_messageType) Zero() protoreflect.Message { + return (*fastReflection_ConsensusParams)(nil) +} +func (x fastReflection_ConsensusParams_messageType) New() protoreflect.Message { + return new(fastReflection_ConsensusParams) +} +func (x fastReflection_ConsensusParams_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ConsensusParams +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ConsensusParams) Descriptor() protoreflect.MessageDescriptor { + return md_ConsensusParams +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_ConsensusParams) Type() protoreflect.MessageType { + return _fastReflection_ConsensusParams_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ConsensusParams) New() protoreflect.Message { + return new(fastReflection_ConsensusParams) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ConsensusParams) Interface() protoreflect.ProtoMessage { + return (*ConsensusParams)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_ConsensusParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Block != nil { + value := protoreflect.ValueOfMessage(x.Block.ProtoReflect()) + if !f(fd_ConsensusParams_block, value) { + return + } + } + if x.Evidence != nil { + value := protoreflect.ValueOfMessage(x.Evidence.ProtoReflect()) + if !f(fd_ConsensusParams_evidence, value) { + return + } + } + if x.Validator != nil { + value := protoreflect.ValueOfMessage(x.Validator.ProtoReflect()) + if !f(fd_ConsensusParams_validator, value) { + return + } + } + if x.Version != nil { + value := protoreflect.ValueOfMessage(x.Version.ProtoReflect()) + if !f(fd_ConsensusParams_version, value) { + return + } + } + if x.Synchrony != nil { + value := protoreflect.ValueOfMessage(x.Synchrony.ProtoReflect()) + if !f(fd_ConsensusParams_synchrony, value) { + return + } + } + if x.Feature != nil { + value := protoreflect.ValueOfMessage(x.Feature.ProtoReflect()) + if !f(fd_ConsensusParams_feature, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_ConsensusParams) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.consensus.v1.ConsensusParams.block": + return x.Block != nil + case "cosmos.consensus.v1.ConsensusParams.evidence": + return x.Evidence != nil + case "cosmos.consensus.v1.ConsensusParams.validator": + return x.Validator != nil + case "cosmos.consensus.v1.ConsensusParams.version": + return x.Version != nil + case "cosmos.consensus.v1.ConsensusParams.synchrony": + return x.Synchrony != nil + case "cosmos.consensus.v1.ConsensusParams.feature": + return x.Feature != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConsensusParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.ConsensusParams does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ConsensusParams) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.consensus.v1.ConsensusParams.block": + x.Block = nil + case "cosmos.consensus.v1.ConsensusParams.evidence": + x.Evidence = nil + case "cosmos.consensus.v1.ConsensusParams.validator": + x.Validator = nil + case "cosmos.consensus.v1.ConsensusParams.version": + x.Version = nil + case "cosmos.consensus.v1.ConsensusParams.synchrony": + x.Synchrony = nil + case "cosmos.consensus.v1.ConsensusParams.feature": + x.Feature = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConsensusParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.ConsensusParams does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_ConsensusParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.consensus.v1.ConsensusParams.block": + value := x.Block + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.consensus.v1.ConsensusParams.evidence": + value := x.Evidence + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.consensus.v1.ConsensusParams.validator": + value := x.Validator + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.consensus.v1.ConsensusParams.version": + value := x.Version + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.consensus.v1.ConsensusParams.synchrony": + value := x.Synchrony + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.consensus.v1.ConsensusParams.feature": + value := x.Feature + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConsensusParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.ConsensusParams does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ConsensusParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.consensus.v1.ConsensusParams.block": + x.Block = value.Message().Interface().(*BlockParams) + case "cosmos.consensus.v1.ConsensusParams.evidence": + x.Evidence = value.Message().Interface().(*EvidenceParams) + case "cosmos.consensus.v1.ConsensusParams.validator": + x.Validator = value.Message().Interface().(*ValidatorParams) + case "cosmos.consensus.v1.ConsensusParams.version": + x.Version = value.Message().Interface().(*VersionParams) + case "cosmos.consensus.v1.ConsensusParams.synchrony": + x.Synchrony = value.Message().Interface().(*SynchronyParams) + case "cosmos.consensus.v1.ConsensusParams.feature": + x.Feature = value.Message().Interface().(*FeatureParams) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConsensusParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.ConsensusParams does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ConsensusParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.consensus.v1.ConsensusParams.block": + if x.Block == nil { + x.Block = new(BlockParams) + } + return protoreflect.ValueOfMessage(x.Block.ProtoReflect()) + case "cosmos.consensus.v1.ConsensusParams.evidence": + if x.Evidence == nil { + x.Evidence = new(EvidenceParams) + } + return protoreflect.ValueOfMessage(x.Evidence.ProtoReflect()) + case "cosmos.consensus.v1.ConsensusParams.validator": + if x.Validator == nil { + x.Validator = new(ValidatorParams) + } + return protoreflect.ValueOfMessage(x.Validator.ProtoReflect()) + case "cosmos.consensus.v1.ConsensusParams.version": + if x.Version == nil { + x.Version = new(VersionParams) + } + return protoreflect.ValueOfMessage(x.Version.ProtoReflect()) + case "cosmos.consensus.v1.ConsensusParams.synchrony": + if x.Synchrony == nil { + x.Synchrony = new(SynchronyParams) + } + return protoreflect.ValueOfMessage(x.Synchrony.ProtoReflect()) + case "cosmos.consensus.v1.ConsensusParams.feature": + if x.Feature == nil { + x.Feature = new(FeatureParams) + } + return protoreflect.ValueOfMessage(x.Feature.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConsensusParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.ConsensusParams does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_ConsensusParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.consensus.v1.ConsensusParams.block": + m := new(BlockParams) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.consensus.v1.ConsensusParams.evidence": + m := new(EvidenceParams) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.consensus.v1.ConsensusParams.validator": + m := new(ValidatorParams) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.consensus.v1.ConsensusParams.version": + m := new(VersionParams) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.consensus.v1.ConsensusParams.synchrony": + m := new(SynchronyParams) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.consensus.v1.ConsensusParams.feature": + m := new(FeatureParams) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConsensusParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.ConsensusParams does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_ConsensusParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.consensus.v1.ConsensusParams", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_ConsensusParams) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ConsensusParams) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_ConsensusParams) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_ConsensusParams) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ConsensusParams) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Block != nil { + l = options.Size(x.Block) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Evidence != nil { + l = options.Size(x.Evidence) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Validator != nil { + l = options.Size(x.Validator) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Version != nil { + l = options.Size(x.Version) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Synchrony != nil { + l = options.Size(x.Synchrony) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Feature != nil { + l = options.Size(x.Feature) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*ConsensusParams) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Feature != nil { + encoded, err := options.Marshal(x.Feature) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x3a + } + if x.Synchrony != nil { + encoded, err := options.Marshal(x.Synchrony) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x32 + } + if x.Version != nil { + encoded, err := options.Marshal(x.Version) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x22 + } + if x.Validator != nil { + encoded, err := options.Marshal(x.Validator) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x1a + } + if x.Evidence != nil { + encoded, err := options.Marshal(x.Evidence) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if x.Block != nil { + encoded, err := options.Marshal(x.Block) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*ConsensusParams) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire 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++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ConsensusParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ConsensusParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Block == nil { + x.Block = &BlockParams{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Block); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Evidence", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Evidence == nil { + x.Evidence = &EvidenceParams{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Evidence); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Validator", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Validator == nil { + x.Validator = &ValidatorParams{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Validator); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Version == nil { + x.Version = &VersionParams{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Version); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Synchrony", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Synchrony == nil { + x.Synchrony = &SynchronyParams{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Synchrony); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Feature", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Feature == nil { + x.Feature = &FeatureParams{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Feature); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_BlockParams protoreflect.MessageDescriptor + fd_BlockParams_max_bytes protoreflect.FieldDescriptor + fd_BlockParams_max_gas protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_consensus_v1_params_proto_init() + md_BlockParams = File_cosmos_consensus_v1_params_proto.Messages().ByName("BlockParams") + fd_BlockParams_max_bytes = md_BlockParams.Fields().ByName("max_bytes") + fd_BlockParams_max_gas = md_BlockParams.Fields().ByName("max_gas") +} + +var _ protoreflect.Message = (*fastReflection_BlockParams)(nil) + +type fastReflection_BlockParams BlockParams + +func (x *BlockParams) ProtoReflect() protoreflect.Message { + return (*fastReflection_BlockParams)(x) +} + +func (x *BlockParams) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_consensus_v1_params_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_BlockParams_messageType fastReflection_BlockParams_messageType +var _ protoreflect.MessageType = fastReflection_BlockParams_messageType{} + +type fastReflection_BlockParams_messageType struct{} + +func (x fastReflection_BlockParams_messageType) Zero() protoreflect.Message { + return (*fastReflection_BlockParams)(nil) +} +func (x fastReflection_BlockParams_messageType) New() protoreflect.Message { + return new(fastReflection_BlockParams) +} +func (x fastReflection_BlockParams_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_BlockParams +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_BlockParams) Descriptor() protoreflect.MessageDescriptor { + return md_BlockParams +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_BlockParams) Type() protoreflect.MessageType { + return _fastReflection_BlockParams_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_BlockParams) New() protoreflect.Message { + return new(fastReflection_BlockParams) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_BlockParams) Interface() protoreflect.ProtoMessage { + return (*BlockParams)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_BlockParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.MaxBytes != int64(0) { + value := protoreflect.ValueOfInt64(x.MaxBytes) + if !f(fd_BlockParams_max_bytes, value) { + return + } + } + if x.MaxGas != int64(0) { + value := protoreflect.ValueOfInt64(x.MaxGas) + if !f(fd_BlockParams_max_gas, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_BlockParams) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.consensus.v1.BlockParams.max_bytes": + return x.MaxBytes != int64(0) + case "cosmos.consensus.v1.BlockParams.max_gas": + return x.MaxGas != int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.BlockParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.BlockParams does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_BlockParams) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.consensus.v1.BlockParams.max_bytes": + x.MaxBytes = int64(0) + case "cosmos.consensus.v1.BlockParams.max_gas": + x.MaxGas = int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.BlockParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.BlockParams does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_BlockParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.consensus.v1.BlockParams.max_bytes": + value := x.MaxBytes + return protoreflect.ValueOfInt64(value) + case "cosmos.consensus.v1.BlockParams.max_gas": + value := x.MaxGas + return protoreflect.ValueOfInt64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.BlockParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.BlockParams does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_BlockParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.consensus.v1.BlockParams.max_bytes": + x.MaxBytes = value.Int() + case "cosmos.consensus.v1.BlockParams.max_gas": + x.MaxGas = value.Int() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.BlockParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.BlockParams does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_BlockParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.consensus.v1.BlockParams.max_bytes": + panic(fmt.Errorf("field max_bytes of message cosmos.consensus.v1.BlockParams is not mutable")) + case "cosmos.consensus.v1.BlockParams.max_gas": + panic(fmt.Errorf("field max_gas of message cosmos.consensus.v1.BlockParams is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.BlockParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.BlockParams does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_BlockParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.consensus.v1.BlockParams.max_bytes": + return protoreflect.ValueOfInt64(int64(0)) + case "cosmos.consensus.v1.BlockParams.max_gas": + return protoreflect.ValueOfInt64(int64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.BlockParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.BlockParams does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_BlockParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.consensus.v1.BlockParams", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_BlockParams) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_BlockParams) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_BlockParams) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_BlockParams) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*BlockParams) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.MaxBytes != 0 { + n += 1 + runtime.Sov(uint64(x.MaxBytes)) + } + if x.MaxGas != 0 { + n += 1 + runtime.Sov(uint64(x.MaxGas)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*BlockParams) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.MaxGas != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.MaxGas)) + i-- + dAtA[i] = 0x10 + } + if x.MaxBytes != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.MaxBytes)) + i-- + dAtA[i] = 0x8 + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*BlockParams) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire 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++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: BlockParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: BlockParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MaxBytes", wireType) + } + x.MaxBytes = 0 + 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++ + x.MaxBytes |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MaxGas", wireType) + } + x.MaxGas = 0 + 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++ + x.MaxGas |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_EvidenceParams protoreflect.MessageDescriptor + fd_EvidenceParams_max_age_num_blocks protoreflect.FieldDescriptor + fd_EvidenceParams_max_age_duration protoreflect.FieldDescriptor + fd_EvidenceParams_max_bytes protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_consensus_v1_params_proto_init() + md_EvidenceParams = File_cosmos_consensus_v1_params_proto.Messages().ByName("EvidenceParams") + fd_EvidenceParams_max_age_num_blocks = md_EvidenceParams.Fields().ByName("max_age_num_blocks") + fd_EvidenceParams_max_age_duration = md_EvidenceParams.Fields().ByName("max_age_duration") + fd_EvidenceParams_max_bytes = md_EvidenceParams.Fields().ByName("max_bytes") +} + +var _ protoreflect.Message = (*fastReflection_EvidenceParams)(nil) + +type fastReflection_EvidenceParams EvidenceParams + +func (x *EvidenceParams) ProtoReflect() protoreflect.Message { + return (*fastReflection_EvidenceParams)(x) +} + +func (x *EvidenceParams) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_consensus_v1_params_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_EvidenceParams_messageType fastReflection_EvidenceParams_messageType +var _ protoreflect.MessageType = fastReflection_EvidenceParams_messageType{} + +type fastReflection_EvidenceParams_messageType struct{} + +func (x fastReflection_EvidenceParams_messageType) Zero() protoreflect.Message { + return (*fastReflection_EvidenceParams)(nil) +} +func (x fastReflection_EvidenceParams_messageType) New() protoreflect.Message { + return new(fastReflection_EvidenceParams) +} +func (x fastReflection_EvidenceParams_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EvidenceParams +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EvidenceParams) Descriptor() protoreflect.MessageDescriptor { + return md_EvidenceParams +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_EvidenceParams) Type() protoreflect.MessageType { + return _fastReflection_EvidenceParams_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EvidenceParams) New() protoreflect.Message { + return new(fastReflection_EvidenceParams) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EvidenceParams) Interface() protoreflect.ProtoMessage { + return (*EvidenceParams)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_EvidenceParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.MaxAgeNumBlocks != int64(0) { + value := protoreflect.ValueOfInt64(x.MaxAgeNumBlocks) + if !f(fd_EvidenceParams_max_age_num_blocks, value) { + return + } + } + if x.MaxAgeDuration != nil { + value := protoreflect.ValueOfMessage(x.MaxAgeDuration.ProtoReflect()) + if !f(fd_EvidenceParams_max_age_duration, value) { + return + } + } + if x.MaxBytes != int64(0) { + value := protoreflect.ValueOfInt64(x.MaxBytes) + if !f(fd_EvidenceParams_max_bytes, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_EvidenceParams) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.consensus.v1.EvidenceParams.max_age_num_blocks": + return x.MaxAgeNumBlocks != int64(0) + case "cosmos.consensus.v1.EvidenceParams.max_age_duration": + return x.MaxAgeDuration != nil + case "cosmos.consensus.v1.EvidenceParams.max_bytes": + return x.MaxBytes != int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.EvidenceParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.EvidenceParams does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EvidenceParams) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.consensus.v1.EvidenceParams.max_age_num_blocks": + x.MaxAgeNumBlocks = int64(0) + case "cosmos.consensus.v1.EvidenceParams.max_age_duration": + x.MaxAgeDuration = nil + case "cosmos.consensus.v1.EvidenceParams.max_bytes": + x.MaxBytes = int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.EvidenceParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.EvidenceParams does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_EvidenceParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.consensus.v1.EvidenceParams.max_age_num_blocks": + value := x.MaxAgeNumBlocks + return protoreflect.ValueOfInt64(value) + case "cosmos.consensus.v1.EvidenceParams.max_age_duration": + value := x.MaxAgeDuration + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.consensus.v1.EvidenceParams.max_bytes": + value := x.MaxBytes + return protoreflect.ValueOfInt64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.EvidenceParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.EvidenceParams does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EvidenceParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.consensus.v1.EvidenceParams.max_age_num_blocks": + x.MaxAgeNumBlocks = value.Int() + case "cosmos.consensus.v1.EvidenceParams.max_age_duration": + x.MaxAgeDuration = value.Message().Interface().(*durationpb.Duration) + case "cosmos.consensus.v1.EvidenceParams.max_bytes": + x.MaxBytes = value.Int() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.EvidenceParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.EvidenceParams does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EvidenceParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.consensus.v1.EvidenceParams.max_age_duration": + if x.MaxAgeDuration == nil { + x.MaxAgeDuration = new(durationpb.Duration) + } + return protoreflect.ValueOfMessage(x.MaxAgeDuration.ProtoReflect()) + case "cosmos.consensus.v1.EvidenceParams.max_age_num_blocks": + panic(fmt.Errorf("field max_age_num_blocks of message cosmos.consensus.v1.EvidenceParams is not mutable")) + case "cosmos.consensus.v1.EvidenceParams.max_bytes": + panic(fmt.Errorf("field max_bytes of message cosmos.consensus.v1.EvidenceParams is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.EvidenceParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.EvidenceParams does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_EvidenceParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.consensus.v1.EvidenceParams.max_age_num_blocks": + return protoreflect.ValueOfInt64(int64(0)) + case "cosmos.consensus.v1.EvidenceParams.max_age_duration": + m := new(durationpb.Duration) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.consensus.v1.EvidenceParams.max_bytes": + return protoreflect.ValueOfInt64(int64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.EvidenceParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.EvidenceParams does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_EvidenceParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.consensus.v1.EvidenceParams", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_EvidenceParams) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EvidenceParams) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_EvidenceParams) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_EvidenceParams) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EvidenceParams) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.MaxAgeNumBlocks != 0 { + n += 1 + runtime.Sov(uint64(x.MaxAgeNumBlocks)) + } + if x.MaxAgeDuration != nil { + l = options.Size(x.MaxAgeDuration) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.MaxBytes != 0 { + n += 1 + runtime.Sov(uint64(x.MaxBytes)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*EvidenceParams) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.MaxBytes != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.MaxBytes)) + i-- + dAtA[i] = 0x18 + } + if x.MaxAgeDuration != nil { + encoded, err := options.Marshal(x.MaxAgeDuration) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if x.MaxAgeNumBlocks != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.MaxAgeNumBlocks)) + i-- + dAtA[i] = 0x8 + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*EvidenceParams) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire 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++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EvidenceParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EvidenceParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MaxAgeNumBlocks", wireType) + } + x.MaxAgeNumBlocks = 0 + 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++ + x.MaxAgeNumBlocks |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MaxAgeDuration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.MaxAgeDuration == nil { + x.MaxAgeDuration = &durationpb.Duration{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.MaxAgeDuration); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MaxBytes", wireType) + } + x.MaxBytes = 0 + 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++ + x.MaxBytes |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_ValidatorParams_1_list)(nil) + +type _ValidatorParams_1_list struct { + list *[]string +} + +func (x *_ValidatorParams_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_ValidatorParams_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_ValidatorParams_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_ValidatorParams_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_ValidatorParams_1_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message ValidatorParams at list field PubKeyTypes as it is not of Message kind")) +} + +func (x *_ValidatorParams_1_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_ValidatorParams_1_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_ValidatorParams_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_ValidatorParams protoreflect.MessageDescriptor + fd_ValidatorParams_pub_key_types protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_consensus_v1_params_proto_init() + md_ValidatorParams = File_cosmos_consensus_v1_params_proto.Messages().ByName("ValidatorParams") + fd_ValidatorParams_pub_key_types = md_ValidatorParams.Fields().ByName("pub_key_types") +} + +var _ protoreflect.Message = (*fastReflection_ValidatorParams)(nil) + +type fastReflection_ValidatorParams ValidatorParams + +func (x *ValidatorParams) ProtoReflect() protoreflect.Message { + return (*fastReflection_ValidatorParams)(x) +} + +func (x *ValidatorParams) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_consensus_v1_params_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_ValidatorParams_messageType fastReflection_ValidatorParams_messageType +var _ protoreflect.MessageType = fastReflection_ValidatorParams_messageType{} + +type fastReflection_ValidatorParams_messageType struct{} + +func (x fastReflection_ValidatorParams_messageType) Zero() protoreflect.Message { + return (*fastReflection_ValidatorParams)(nil) +} +func (x fastReflection_ValidatorParams_messageType) New() protoreflect.Message { + return new(fastReflection_ValidatorParams) +} +func (x fastReflection_ValidatorParams_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ValidatorParams +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ValidatorParams) Descriptor() protoreflect.MessageDescriptor { + return md_ValidatorParams +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_ValidatorParams) Type() protoreflect.MessageType { + return _fastReflection_ValidatorParams_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ValidatorParams) New() protoreflect.Message { + return new(fastReflection_ValidatorParams) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ValidatorParams) Interface() protoreflect.ProtoMessage { + return (*ValidatorParams)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_ValidatorParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.PubKeyTypes) != 0 { + value := protoreflect.ValueOfList(&_ValidatorParams_1_list{list: &x.PubKeyTypes}) + if !f(fd_ValidatorParams_pub_key_types, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_ValidatorParams) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.consensus.v1.ValidatorParams.pub_key_types": + return len(x.PubKeyTypes) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ValidatorParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.ValidatorParams does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ValidatorParams) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.consensus.v1.ValidatorParams.pub_key_types": + x.PubKeyTypes = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ValidatorParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.ValidatorParams does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_ValidatorParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.consensus.v1.ValidatorParams.pub_key_types": + if len(x.PubKeyTypes) == 0 { + return protoreflect.ValueOfList(&_ValidatorParams_1_list{}) + } + listValue := &_ValidatorParams_1_list{list: &x.PubKeyTypes} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ValidatorParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.ValidatorParams does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ValidatorParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.consensus.v1.ValidatorParams.pub_key_types": + lv := value.List() + clv := lv.(*_ValidatorParams_1_list) + x.PubKeyTypes = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ValidatorParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.ValidatorParams does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ValidatorParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.consensus.v1.ValidatorParams.pub_key_types": + if x.PubKeyTypes == nil { + x.PubKeyTypes = []string{} + } + value := &_ValidatorParams_1_list{list: &x.PubKeyTypes} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ValidatorParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.ValidatorParams does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_ValidatorParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.consensus.v1.ValidatorParams.pub_key_types": + list := []string{} + return protoreflect.ValueOfList(&_ValidatorParams_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ValidatorParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.ValidatorParams does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_ValidatorParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.consensus.v1.ValidatorParams", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_ValidatorParams) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ValidatorParams) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_ValidatorParams) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_ValidatorParams) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ValidatorParams) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.PubKeyTypes) > 0 { + for _, s := range x.PubKeyTypes { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*ValidatorParams) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.PubKeyTypes) > 0 { + for iNdEx := len(x.PubKeyTypes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.PubKeyTypes[iNdEx]) + copy(dAtA[i:], x.PubKeyTypes[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PubKeyTypes[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*ValidatorParams) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire 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++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ValidatorParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ValidatorParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PubKeyTypes", 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.PubKeyTypes = append(x.PubKeyTypes, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_VersionParams protoreflect.MessageDescriptor + fd_VersionParams_app protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_consensus_v1_params_proto_init() + md_VersionParams = File_cosmos_consensus_v1_params_proto.Messages().ByName("VersionParams") + fd_VersionParams_app = md_VersionParams.Fields().ByName("app") +} + +var _ protoreflect.Message = (*fastReflection_VersionParams)(nil) + +type fastReflection_VersionParams VersionParams + +func (x *VersionParams) ProtoReflect() protoreflect.Message { + return (*fastReflection_VersionParams)(x) +} + +func (x *VersionParams) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_consensus_v1_params_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_VersionParams_messageType fastReflection_VersionParams_messageType +var _ protoreflect.MessageType = fastReflection_VersionParams_messageType{} + +type fastReflection_VersionParams_messageType struct{} + +func (x fastReflection_VersionParams_messageType) Zero() protoreflect.Message { + return (*fastReflection_VersionParams)(nil) +} +func (x fastReflection_VersionParams_messageType) New() protoreflect.Message { + return new(fastReflection_VersionParams) +} +func (x fastReflection_VersionParams_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_VersionParams +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_VersionParams) Descriptor() protoreflect.MessageDescriptor { + return md_VersionParams +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_VersionParams) Type() protoreflect.MessageType { + return _fastReflection_VersionParams_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_VersionParams) New() protoreflect.Message { + return new(fastReflection_VersionParams) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_VersionParams) Interface() protoreflect.ProtoMessage { + return (*VersionParams)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_VersionParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.App != uint64(0) { + value := protoreflect.ValueOfUint64(x.App) + if !f(fd_VersionParams_app, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_VersionParams) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.consensus.v1.VersionParams.app": + return x.App != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.VersionParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.VersionParams does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_VersionParams) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.consensus.v1.VersionParams.app": + x.App = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.VersionParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.VersionParams does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_VersionParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.consensus.v1.VersionParams.app": + value := x.App + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.VersionParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.VersionParams does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_VersionParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.consensus.v1.VersionParams.app": + x.App = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.VersionParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.VersionParams does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_VersionParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.consensus.v1.VersionParams.app": + panic(fmt.Errorf("field app of message cosmos.consensus.v1.VersionParams is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.VersionParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.VersionParams does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_VersionParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.consensus.v1.VersionParams.app": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.VersionParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.VersionParams does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_VersionParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.consensus.v1.VersionParams", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_VersionParams) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_VersionParams) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_VersionParams) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_VersionParams) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*VersionParams) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.App != 0 { + n += 1 + runtime.Sov(uint64(x.App)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*VersionParams) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.App != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.App)) + i-- + dAtA[i] = 0x8 + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*VersionParams) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire 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++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: VersionParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: VersionParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field App", wireType) + } + x.App = 0 + 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++ + x.App |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_HashedParams protoreflect.MessageDescriptor + fd_HashedParams_block_max_bytes protoreflect.FieldDescriptor + fd_HashedParams_block_max_gas protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_consensus_v1_params_proto_init() + md_HashedParams = File_cosmos_consensus_v1_params_proto.Messages().ByName("HashedParams") + fd_HashedParams_block_max_bytes = md_HashedParams.Fields().ByName("block_max_bytes") + fd_HashedParams_block_max_gas = md_HashedParams.Fields().ByName("block_max_gas") +} + +var _ protoreflect.Message = (*fastReflection_HashedParams)(nil) + +type fastReflection_HashedParams HashedParams + +func (x *HashedParams) ProtoReflect() protoreflect.Message { + return (*fastReflection_HashedParams)(x) +} + +func (x *HashedParams) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_consensus_v1_params_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_HashedParams_messageType fastReflection_HashedParams_messageType +var _ protoreflect.MessageType = fastReflection_HashedParams_messageType{} + +type fastReflection_HashedParams_messageType struct{} + +func (x fastReflection_HashedParams_messageType) Zero() protoreflect.Message { + return (*fastReflection_HashedParams)(nil) +} +func (x fastReflection_HashedParams_messageType) New() protoreflect.Message { + return new(fastReflection_HashedParams) +} +func (x fastReflection_HashedParams_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_HashedParams +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_HashedParams) Descriptor() protoreflect.MessageDescriptor { + return md_HashedParams +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_HashedParams) Type() protoreflect.MessageType { + return _fastReflection_HashedParams_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_HashedParams) New() protoreflect.Message { + return new(fastReflection_HashedParams) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_HashedParams) Interface() protoreflect.ProtoMessage { + return (*HashedParams)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_HashedParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.BlockMaxBytes != int64(0) { + value := protoreflect.ValueOfInt64(x.BlockMaxBytes) + if !f(fd_HashedParams_block_max_bytes, value) { + return + } + } + if x.BlockMaxGas != int64(0) { + value := protoreflect.ValueOfInt64(x.BlockMaxGas) + if !f(fd_HashedParams_block_max_gas, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_HashedParams) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.consensus.v1.HashedParams.block_max_bytes": + return x.BlockMaxBytes != int64(0) + case "cosmos.consensus.v1.HashedParams.block_max_gas": + return x.BlockMaxGas != int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.HashedParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.HashedParams does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_HashedParams) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.consensus.v1.HashedParams.block_max_bytes": + x.BlockMaxBytes = int64(0) + case "cosmos.consensus.v1.HashedParams.block_max_gas": + x.BlockMaxGas = int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.HashedParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.HashedParams does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_HashedParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.consensus.v1.HashedParams.block_max_bytes": + value := x.BlockMaxBytes + return protoreflect.ValueOfInt64(value) + case "cosmos.consensus.v1.HashedParams.block_max_gas": + value := x.BlockMaxGas + return protoreflect.ValueOfInt64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.HashedParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.HashedParams does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_HashedParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.consensus.v1.HashedParams.block_max_bytes": + x.BlockMaxBytes = value.Int() + case "cosmos.consensus.v1.HashedParams.block_max_gas": + x.BlockMaxGas = value.Int() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.HashedParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.HashedParams does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_HashedParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.consensus.v1.HashedParams.block_max_bytes": + panic(fmt.Errorf("field block_max_bytes of message cosmos.consensus.v1.HashedParams is not mutable")) + case "cosmos.consensus.v1.HashedParams.block_max_gas": + panic(fmt.Errorf("field block_max_gas of message cosmos.consensus.v1.HashedParams is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.HashedParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.HashedParams does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_HashedParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.consensus.v1.HashedParams.block_max_bytes": + return protoreflect.ValueOfInt64(int64(0)) + case "cosmos.consensus.v1.HashedParams.block_max_gas": + return protoreflect.ValueOfInt64(int64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.HashedParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.HashedParams does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_HashedParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.consensus.v1.HashedParams", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_HashedParams) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_HashedParams) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_HashedParams) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_HashedParams) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*HashedParams) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.BlockMaxBytes != 0 { + n += 1 + runtime.Sov(uint64(x.BlockMaxBytes)) + } + if x.BlockMaxGas != 0 { + n += 1 + runtime.Sov(uint64(x.BlockMaxGas)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*HashedParams) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.BlockMaxGas != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.BlockMaxGas)) + i-- + dAtA[i] = 0x10 + } + if x.BlockMaxBytes != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.BlockMaxBytes)) + i-- + dAtA[i] = 0x8 + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*HashedParams) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire 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++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: HashedParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: HashedParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BlockMaxBytes", wireType) + } + x.BlockMaxBytes = 0 + 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++ + x.BlockMaxBytes |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BlockMaxGas", wireType) + } + x.BlockMaxGas = 0 + 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++ + x.BlockMaxGas |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_SynchronyParams protoreflect.MessageDescriptor + fd_SynchronyParams_precision protoreflect.FieldDescriptor + fd_SynchronyParams_message_delay protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_consensus_v1_params_proto_init() + md_SynchronyParams = File_cosmos_consensus_v1_params_proto.Messages().ByName("SynchronyParams") + fd_SynchronyParams_precision = md_SynchronyParams.Fields().ByName("precision") + fd_SynchronyParams_message_delay = md_SynchronyParams.Fields().ByName("message_delay") +} + +var _ protoreflect.Message = (*fastReflection_SynchronyParams)(nil) + +type fastReflection_SynchronyParams SynchronyParams + +func (x *SynchronyParams) ProtoReflect() protoreflect.Message { + return (*fastReflection_SynchronyParams)(x) +} + +func (x *SynchronyParams) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_consensus_v1_params_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_SynchronyParams_messageType fastReflection_SynchronyParams_messageType +var _ protoreflect.MessageType = fastReflection_SynchronyParams_messageType{} + +type fastReflection_SynchronyParams_messageType struct{} + +func (x fastReflection_SynchronyParams_messageType) Zero() protoreflect.Message { + return (*fastReflection_SynchronyParams)(nil) +} +func (x fastReflection_SynchronyParams_messageType) New() protoreflect.Message { + return new(fastReflection_SynchronyParams) +} +func (x fastReflection_SynchronyParams_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_SynchronyParams +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_SynchronyParams) Descriptor() protoreflect.MessageDescriptor { + return md_SynchronyParams +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_SynchronyParams) Type() protoreflect.MessageType { + return _fastReflection_SynchronyParams_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_SynchronyParams) New() protoreflect.Message { + return new(fastReflection_SynchronyParams) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_SynchronyParams) Interface() protoreflect.ProtoMessage { + return (*SynchronyParams)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_SynchronyParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Precision != nil { + value := protoreflect.ValueOfMessage(x.Precision.ProtoReflect()) + if !f(fd_SynchronyParams_precision, value) { + return + } + } + if x.MessageDelay != nil { + value := protoreflect.ValueOfMessage(x.MessageDelay.ProtoReflect()) + if !f(fd_SynchronyParams_message_delay, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_SynchronyParams) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.consensus.v1.SynchronyParams.precision": + return x.Precision != nil + case "cosmos.consensus.v1.SynchronyParams.message_delay": + return x.MessageDelay != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.SynchronyParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.SynchronyParams does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_SynchronyParams) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.consensus.v1.SynchronyParams.precision": + x.Precision = nil + case "cosmos.consensus.v1.SynchronyParams.message_delay": + x.MessageDelay = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.SynchronyParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.SynchronyParams does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_SynchronyParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.consensus.v1.SynchronyParams.precision": + value := x.Precision + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.consensus.v1.SynchronyParams.message_delay": + value := x.MessageDelay + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.SynchronyParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.SynchronyParams does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_SynchronyParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.consensus.v1.SynchronyParams.precision": + x.Precision = value.Message().Interface().(*durationpb.Duration) + case "cosmos.consensus.v1.SynchronyParams.message_delay": + x.MessageDelay = value.Message().Interface().(*durationpb.Duration) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.SynchronyParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.SynchronyParams does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_SynchronyParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.consensus.v1.SynchronyParams.precision": + if x.Precision == nil { + x.Precision = new(durationpb.Duration) + } + return protoreflect.ValueOfMessage(x.Precision.ProtoReflect()) + case "cosmos.consensus.v1.SynchronyParams.message_delay": + if x.MessageDelay == nil { + x.MessageDelay = new(durationpb.Duration) + } + return protoreflect.ValueOfMessage(x.MessageDelay.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.SynchronyParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.SynchronyParams does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_SynchronyParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.consensus.v1.SynchronyParams.precision": + m := new(durationpb.Duration) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.consensus.v1.SynchronyParams.message_delay": + m := new(durationpb.Duration) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.SynchronyParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.SynchronyParams does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_SynchronyParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.consensus.v1.SynchronyParams", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_SynchronyParams) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_SynchronyParams) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_SynchronyParams) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_SynchronyParams) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*SynchronyParams) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Precision != nil { + l = options.Size(x.Precision) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.MessageDelay != nil { + l = options.Size(x.MessageDelay) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*SynchronyParams) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.MessageDelay != nil { + encoded, err := options.Marshal(x.MessageDelay) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if x.Precision != nil { + encoded, err := options.Marshal(x.Precision) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*SynchronyParams) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire 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++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: SynchronyParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: SynchronyParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Precision", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Precision == nil { + x.Precision = &durationpb.Duration{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Precision); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MessageDelay", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.MessageDelay == nil { + x.MessageDelay = &durationpb.Duration{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.MessageDelay); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_FeatureParams protoreflect.MessageDescriptor + fd_FeatureParams_vote_extensions_enable_height protoreflect.FieldDescriptor + fd_FeatureParams_pbts_enable_height protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_consensus_v1_params_proto_init() + md_FeatureParams = File_cosmos_consensus_v1_params_proto.Messages().ByName("FeatureParams") + fd_FeatureParams_vote_extensions_enable_height = md_FeatureParams.Fields().ByName("vote_extensions_enable_height") + fd_FeatureParams_pbts_enable_height = md_FeatureParams.Fields().ByName("pbts_enable_height") +} + +var _ protoreflect.Message = (*fastReflection_FeatureParams)(nil) + +type fastReflection_FeatureParams FeatureParams + +func (x *FeatureParams) ProtoReflect() protoreflect.Message { + return (*fastReflection_FeatureParams)(x) +} + +func (x *FeatureParams) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_consensus_v1_params_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_FeatureParams_messageType fastReflection_FeatureParams_messageType +var _ protoreflect.MessageType = fastReflection_FeatureParams_messageType{} + +type fastReflection_FeatureParams_messageType struct{} + +func (x fastReflection_FeatureParams_messageType) Zero() protoreflect.Message { + return (*fastReflection_FeatureParams)(nil) +} +func (x fastReflection_FeatureParams_messageType) New() protoreflect.Message { + return new(fastReflection_FeatureParams) +} +func (x fastReflection_FeatureParams_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_FeatureParams +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_FeatureParams) Descriptor() protoreflect.MessageDescriptor { + return md_FeatureParams +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_FeatureParams) Type() protoreflect.MessageType { + return _fastReflection_FeatureParams_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_FeatureParams) New() protoreflect.Message { + return new(fastReflection_FeatureParams) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_FeatureParams) Interface() protoreflect.ProtoMessage { + return (*FeatureParams)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_FeatureParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.VoteExtensionsEnableHeight != nil { + value := protoreflect.ValueOfMessage(x.VoteExtensionsEnableHeight.ProtoReflect()) + if !f(fd_FeatureParams_vote_extensions_enable_height, value) { + return + } + } + if x.PbtsEnableHeight != nil { + value := protoreflect.ValueOfMessage(x.PbtsEnableHeight.ProtoReflect()) + if !f(fd_FeatureParams_pbts_enable_height, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_FeatureParams) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.consensus.v1.FeatureParams.vote_extensions_enable_height": + return x.VoteExtensionsEnableHeight != nil + case "cosmos.consensus.v1.FeatureParams.pbts_enable_height": + return x.PbtsEnableHeight != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.FeatureParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.FeatureParams does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_FeatureParams) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.consensus.v1.FeatureParams.vote_extensions_enable_height": + x.VoteExtensionsEnableHeight = nil + case "cosmos.consensus.v1.FeatureParams.pbts_enable_height": + x.PbtsEnableHeight = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.FeatureParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.FeatureParams does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_FeatureParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.consensus.v1.FeatureParams.vote_extensions_enable_height": + value := x.VoteExtensionsEnableHeight + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.consensus.v1.FeatureParams.pbts_enable_height": + value := x.PbtsEnableHeight + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.FeatureParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.FeatureParams does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_FeatureParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.consensus.v1.FeatureParams.vote_extensions_enable_height": + x.VoteExtensionsEnableHeight = value.Message().Interface().(*wrapperspb.Int64Value) + case "cosmos.consensus.v1.FeatureParams.pbts_enable_height": + x.PbtsEnableHeight = value.Message().Interface().(*wrapperspb.Int64Value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.FeatureParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.FeatureParams does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_FeatureParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.consensus.v1.FeatureParams.vote_extensions_enable_height": + if x.VoteExtensionsEnableHeight == nil { + x.VoteExtensionsEnableHeight = new(wrapperspb.Int64Value) + } + return protoreflect.ValueOfMessage(x.VoteExtensionsEnableHeight.ProtoReflect()) + case "cosmos.consensus.v1.FeatureParams.pbts_enable_height": + if x.PbtsEnableHeight == nil { + x.PbtsEnableHeight = new(wrapperspb.Int64Value) + } + return protoreflect.ValueOfMessage(x.PbtsEnableHeight.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.FeatureParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.FeatureParams does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_FeatureParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.consensus.v1.FeatureParams.vote_extensions_enable_height": + m := new(wrapperspb.Int64Value) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.consensus.v1.FeatureParams.pbts_enable_height": + m := new(wrapperspb.Int64Value) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.FeatureParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.FeatureParams does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_FeatureParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.consensus.v1.FeatureParams", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_FeatureParams) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_FeatureParams) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_FeatureParams) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_FeatureParams) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*FeatureParams) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.VoteExtensionsEnableHeight != nil { + l = options.Size(x.VoteExtensionsEnableHeight) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.PbtsEnableHeight != nil { + l = options.Size(x.PbtsEnableHeight) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*FeatureParams) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.PbtsEnableHeight != nil { + encoded, err := options.Marshal(x.PbtsEnableHeight) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if x.VoteExtensionsEnableHeight != nil { + encoded, err := options.Marshal(x.VoteExtensionsEnableHeight) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*FeatureParams) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire 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++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: FeatureParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: FeatureParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field VoteExtensionsEnableHeight", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.VoteExtensionsEnableHeight == nil { + x.VoteExtensionsEnableHeight = &wrapperspb.Int64Value{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.VoteExtensionsEnableHeight); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PbtsEnableHeight", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.PbtsEnableHeight == nil { + x.PbtsEnableHeight = &wrapperspb.Int64Value{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.PbtsEnableHeight); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: cosmos/consensus/v1/params.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// ConsensusParams contains consensus critical parameters that determine the +// validity of blocks. +type ConsensusParams struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Block *BlockParams `protobuf:"bytes,1,opt,name=block,proto3" json:"block,omitempty"` + Evidence *EvidenceParams `protobuf:"bytes,2,opt,name=evidence,proto3" json:"evidence,omitempty"` + Validator *ValidatorParams `protobuf:"bytes,3,opt,name=validator,proto3" json:"validator,omitempty"` + Version *VersionParams `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"` + Synchrony *SynchronyParams `protobuf:"bytes,6,opt,name=synchrony,proto3" json:"synchrony,omitempty"` + Feature *FeatureParams `protobuf:"bytes,7,opt,name=feature,proto3" json:"feature,omitempty"` +} + +func (x *ConsensusParams) Reset() { + *x = ConsensusParams{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_consensus_v1_params_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ConsensusParams) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConsensusParams) ProtoMessage() {} + +// Deprecated: Use ConsensusParams.ProtoReflect.Descriptor instead. +func (*ConsensusParams) Descriptor() ([]byte, []int) { + return file_cosmos_consensus_v1_params_proto_rawDescGZIP(), []int{0} +} + +func (x *ConsensusParams) GetBlock() *BlockParams { + if x != nil { + return x.Block + } + return nil +} + +func (x *ConsensusParams) GetEvidence() *EvidenceParams { + if x != nil { + return x.Evidence + } + return nil +} + +func (x *ConsensusParams) GetValidator() *ValidatorParams { + if x != nil { + return x.Validator + } + return nil +} + +func (x *ConsensusParams) GetVersion() *VersionParams { + if x != nil { + return x.Version + } + return nil +} + +func (x *ConsensusParams) GetSynchrony() *SynchronyParams { + if x != nil { + return x.Synchrony + } + return nil +} + +func (x *ConsensusParams) GetFeature() *FeatureParams { + if x != nil { + return x.Feature + } + return nil +} + +// BlockParams define limits on the block size and gas. +type BlockParams struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Maximum size of a block, in bytes. + // + // Must be greater or equal to -1 and cannot be greater than the hard-coded + // maximum block size, which is 100MB. + // + // If set to -1, the limit is the hard-coded maximum block size. + MaxBytes int64 `protobuf:"varint,1,opt,name=max_bytes,json=maxBytes,proto3" json:"max_bytes,omitempty"` + // Maximum gas wanted by transactions included in a block. + // + // Must be greater or equal to -1. If set to -1, no limit is enforced. + MaxGas int64 `protobuf:"varint,2,opt,name=max_gas,json=maxGas,proto3" json:"max_gas,omitempty"` +} + +func (x *BlockParams) Reset() { + *x = BlockParams{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_consensus_v1_params_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BlockParams) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockParams) ProtoMessage() {} + +// Deprecated: Use BlockParams.ProtoReflect.Descriptor instead. +func (*BlockParams) Descriptor() ([]byte, []int) { + return file_cosmos_consensus_v1_params_proto_rawDescGZIP(), []int{1} +} + +func (x *BlockParams) GetMaxBytes() int64 { + if x != nil { + return x.MaxBytes + } + return 0 +} + +func (x *BlockParams) GetMaxGas() int64 { + if x != nil { + return x.MaxGas + } + return 0 +} + +// EvidenceParams determine the validity of evidences of Byzantine behavior. +type EvidenceParams struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Maximum age of evidence, in blocks. + // + // The recommended formula for calculating it is max_age_duration / {average + // block time}. + MaxAgeNumBlocks int64 `protobuf:"varint,1,opt,name=max_age_num_blocks,json=maxAgeNumBlocks,proto3" json:"max_age_num_blocks,omitempty"` + // Maximum age of evidence, in time. + // + // The recommended value of is should correspond to the application's + // "unbonding period" or other similar mechanism for handling + // Nothing-At-Stake attacks. + // See: + // https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed. + MaxAgeDuration *durationpb.Duration `protobuf:"bytes,2,opt,name=max_age_duration,json=maxAgeDuration,proto3" json:"max_age_duration,omitempty"` + // Maximum size in bytes of evidence allowed to be included in a block. + // + // It should fall comfortably under the maximum size of a block. + MaxBytes int64 `protobuf:"varint,3,opt,name=max_bytes,json=maxBytes,proto3" json:"max_bytes,omitempty"` +} + +func (x *EvidenceParams) Reset() { + *x = EvidenceParams{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_consensus_v1_params_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EvidenceParams) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EvidenceParams) ProtoMessage() {} + +// Deprecated: Use EvidenceParams.ProtoReflect.Descriptor instead. +func (*EvidenceParams) Descriptor() ([]byte, []int) { + return file_cosmos_consensus_v1_params_proto_rawDescGZIP(), []int{2} +} + +func (x *EvidenceParams) GetMaxAgeNumBlocks() int64 { + if x != nil { + return x.MaxAgeNumBlocks + } + return 0 +} + +func (x *EvidenceParams) GetMaxAgeDuration() *durationpb.Duration { + if x != nil { + return x.MaxAgeDuration + } + return nil +} + +func (x *EvidenceParams) GetMaxBytes() int64 { + if x != nil { + return x.MaxBytes + } + return 0 +} + +// ValidatorParams restrict the public key types validators can use. +// +// NOTE: uses ABCI public keys naming, not Amino names. +type ValidatorParams struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PubKeyTypes []string `protobuf:"bytes,1,rep,name=pub_key_types,json=pubKeyTypes,proto3" json:"pub_key_types,omitempty"` +} + +func (x *ValidatorParams) Reset() { + *x = ValidatorParams{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_consensus_v1_params_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ValidatorParams) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidatorParams) ProtoMessage() {} + +// Deprecated: Use ValidatorParams.ProtoReflect.Descriptor instead. +func (*ValidatorParams) Descriptor() ([]byte, []int) { + return file_cosmos_consensus_v1_params_proto_rawDescGZIP(), []int{3} +} + +func (x *ValidatorParams) GetPubKeyTypes() []string { + if x != nil { + return x.PubKeyTypes + } + return nil +} + +// VersionParams contain the version of specific components of CometBFT. +type VersionParams struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The ABCI application version. + // + // It was named app_version in CometBFT 0.34. + App uint64 `protobuf:"varint,1,opt,name=app,proto3" json:"app,omitempty"` +} + +func (x *VersionParams) Reset() { + *x = VersionParams{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_consensus_v1_params_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VersionParams) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VersionParams) ProtoMessage() {} + +// Deprecated: Use VersionParams.ProtoReflect.Descriptor instead. +func (*VersionParams) Descriptor() ([]byte, []int) { + return file_cosmos_consensus_v1_params_proto_rawDescGZIP(), []int{4} +} + +func (x *VersionParams) GetApp() uint64 { + if x != nil { + return x.App + } + return 0 +} + +// HashedParams is a subset of ConsensusParams. +// +// It is hashed into the Header.ConsensusHash. +type HashedParams struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BlockMaxBytes int64 `protobuf:"varint,1,opt,name=block_max_bytes,json=blockMaxBytes,proto3" json:"block_max_bytes,omitempty"` + BlockMaxGas int64 `protobuf:"varint,2,opt,name=block_max_gas,json=blockMaxGas,proto3" json:"block_max_gas,omitempty"` +} + +func (x *HashedParams) Reset() { + *x = HashedParams{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_consensus_v1_params_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HashedParams) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HashedParams) ProtoMessage() {} + +// Deprecated: Use HashedParams.ProtoReflect.Descriptor instead. +func (*HashedParams) Descriptor() ([]byte, []int) { + return file_cosmos_consensus_v1_params_proto_rawDescGZIP(), []int{5} +} + +func (x *HashedParams) GetBlockMaxBytes() int64 { + if x != nil { + return x.BlockMaxBytes + } + return 0 +} + +func (x *HashedParams) GetBlockMaxGas() int64 { + if x != nil { + return x.BlockMaxGas + } + return 0 +} + +// SynchronyParams determine the validity of block timestamps. +// +// These parameters are part of the Proposer-Based Timestamps (PBTS) algorithm. +// For more information on the relationship of the synchrony parameters to +// block timestamps validity, refer to the PBTS specification: +// https://github.com/tendermint/spec/blob/master/spec/consensus/proposer-based-timestamp/README.md +type SynchronyParams struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Bound for how skewed a proposer's clock may be from any validator on the + // network while still producing valid proposals. + Precision *durationpb.Duration `protobuf:"bytes,1,opt,name=precision,proto3" json:"precision,omitempty"` + // Bound for how long a proposal message may take to reach all validators on + // a network and still be considered valid. + MessageDelay *durationpb.Duration `protobuf:"bytes,2,opt,name=message_delay,json=messageDelay,proto3" json:"message_delay,omitempty"` +} + +func (x *SynchronyParams) Reset() { + *x = SynchronyParams{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_consensus_v1_params_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SynchronyParams) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SynchronyParams) ProtoMessage() {} + +// Deprecated: Use SynchronyParams.ProtoReflect.Descriptor instead. +func (*SynchronyParams) Descriptor() ([]byte, []int) { + return file_cosmos_consensus_v1_params_proto_rawDescGZIP(), []int{6} +} + +func (x *SynchronyParams) GetPrecision() *durationpb.Duration { + if x != nil { + return x.Precision + } + return nil +} + +func (x *SynchronyParams) GetMessageDelay() *durationpb.Duration { + if x != nil { + return x.MessageDelay + } + return nil +} + +// FeatureParams configure the height from which features of CometBFT are enabled. +type FeatureParams struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Height during which vote extensions will be enabled. + // + // A value of 0 means vote extensions are disabled. A value > 0 denotes + // the height at which vote extensions will be (or have been) enabled. + // + // During the specified height, and for all subsequent heights, precommit + // messages that do not contain valid extension data will be considered + // invalid. Prior to this height, or when this height is set to 0, vote + // extensions will not be used or accepted by validators on the network. + // + // Once enabled, vote extensions will be created by the application in + // ExtendVote, validated by the application in VerifyVoteExtension, and + // used by the application in PrepareProposal, when proposing the next block. + // + // Cannot be set to heights lower or equal to the current blockchain height. + VoteExtensionsEnableHeight *wrapperspb.Int64Value `protobuf:"bytes,1,opt,name=vote_extensions_enable_height,json=voteExtensionsEnableHeight,proto3" json:"vote_extensions_enable_height,omitempty"` + // Height at which Proposer-Based Timestamps (PBTS) will be enabled. + // + // A value of 0 means PBTS is disabled. A value > 0 denotes the height at + // which PBTS will be (or has been) enabled. + // + // From the specified height, and for all subsequent heights, the PBTS + // algorithm will be used to produce and validate block timestamps. Prior to + // this height, or when this height is set to 0, the legacy BFT Time + // algorithm is used to produce and validate timestamps. + // + // Cannot be set to heights lower or equal to the current blockchain height. + PbtsEnableHeight *wrapperspb.Int64Value `protobuf:"bytes,2,opt,name=pbts_enable_height,json=pbtsEnableHeight,proto3" json:"pbts_enable_height,omitempty"` +} + +func (x *FeatureParams) Reset() { + *x = FeatureParams{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_consensus_v1_params_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FeatureParams) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FeatureParams) ProtoMessage() {} + +// Deprecated: Use FeatureParams.ProtoReflect.Descriptor instead. +func (*FeatureParams) Descriptor() ([]byte, []int) { + return file_cosmos_consensus_v1_params_proto_rawDescGZIP(), []int{7} +} + +func (x *FeatureParams) GetVoteExtensionsEnableHeight() *wrapperspb.Int64Value { + if x != nil { + return x.VoteExtensionsEnableHeight + } + return nil +} + +func (x *FeatureParams) GetPbtsEnableHeight() *wrapperspb.Int64Value { + if x != nil { + return x.PbtsEnableHeight + } + return nil +} + +var File_cosmos_consensus_v1_params_proto protoreflect.FileDescriptor + +var file_cosmos_consensus_v1_params_proto_rawDesc = []byte{ + 0x0a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, + 0x75, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x13, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, + 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, + 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8e, 0x03, + 0x0a, 0x0f, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x12, 0x36, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, + 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x3f, 0x0a, 0x08, 0x65, 0x76, 0x69, + 0x64, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x76, + 0x31, 0x2e, 0x45, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x52, 0x08, 0x65, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x42, 0x0a, 0x09, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, + 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x3c, + 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, + 0x75, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x42, 0x0a, 0x09, + 0x73, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, + 0x75, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x79, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x09, 0x73, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x79, + 0x12, 0x3c, 0x0a, 0x07, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, + 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x07, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x49, + 0x0a, 0x0b, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1b, 0x0a, + 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x08, 0x6d, 0x61, 0x78, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x6d, 0x61, + 0x78, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6d, 0x61, 0x78, + 0x47, 0x61, 0x73, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x22, 0xa9, 0x01, 0x0a, 0x0e, 0x45, 0x76, + 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x2b, 0x0a, 0x12, + 0x6d, 0x61, 0x78, 0x5f, 0x61, 0x67, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x5f, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x6d, 0x61, 0x78, 0x41, 0x67, 0x65, + 0x4e, 0x75, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x4d, 0x0a, 0x10, 0x6d, 0x61, 0x78, + 0x5f, 0x61, 0x67, 0x65, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x08, + 0xc8, 0xde, 0x1f, 0x00, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x0e, 0x6d, 0x61, 0x78, 0x41, 0x67, 0x65, + 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, + 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x61, 0x78, + 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0x3f, 0x0a, 0x0f, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x22, 0x0a, 0x0d, 0x70, 0x75, 0x62, 0x5f, + 0x6b, 0x65, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x0b, 0x70, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x73, 0x3a, 0x08, 0xb8, 0xa0, + 0x1f, 0x01, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0x2b, 0x0a, 0x0d, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x70, 0x70, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x61, 0x70, 0x70, 0x3a, 0x08, 0xb8, 0xa0, 0x1f, 0x01, 0xe8, + 0xa0, 0x1f, 0x01, 0x22, 0x5a, 0x0a, 0x0c, 0x48, 0x61, 0x73, 0x68, 0x65, 0x64, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6d, 0x61, 0x78, + 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x4d, 0x61, 0x78, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x22, 0x0a, 0x0d, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6d, 0x61, 0x78, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4d, 0x61, 0x78, 0x47, 0x61, 0x73, 0x22, + 0x96, 0x01, 0x0a, 0x0f, 0x53, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x79, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x12, 0x3d, 0x0a, 0x09, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, + 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, 0x09, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, + 0x6f, 0x6e, 0x12, 0x44, 0x0a, 0x0d, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x64, 0x65, + 0x6c, 0x61, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x0c, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x22, 0xc6, 0x01, 0x0a, 0x0d, 0x46, 0x65, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x64, 0x0a, 0x1d, 0x76, 0x6f, + 0x74, 0x65, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x65, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x04, + 0xc8, 0xde, 0x1f, 0x01, 0x52, 0x1a, 0x76, 0x6f, 0x74, 0x65, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, + 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, + 0x12, 0x4f, 0x0a, 0x12, 0x70, 0x62, 0x74, 0x73, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, + 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, + 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x01, 0x52, + 0x10, 0x70, 0x62, 0x74, 0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x48, 0x65, 0x69, 0x67, 0x68, + 0x74, 0x42, 0xc6, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2f, + 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x76, 0x31, 0xa2, 0x02, + 0x03, 0x43, 0x43, 0x58, 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x43, 0x6f, + 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5c, 0x56, 0x31, + 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, + 0x73, 0x75, 0x73, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x43, 0x6f, 0x6e, + 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_cosmos_consensus_v1_params_proto_rawDescOnce sync.Once + file_cosmos_consensus_v1_params_proto_rawDescData = file_cosmos_consensus_v1_params_proto_rawDesc +) + +func file_cosmos_consensus_v1_params_proto_rawDescGZIP() []byte { + file_cosmos_consensus_v1_params_proto_rawDescOnce.Do(func() { + file_cosmos_consensus_v1_params_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_consensus_v1_params_proto_rawDescData) + }) + return file_cosmos_consensus_v1_params_proto_rawDescData +} + +var file_cosmos_consensus_v1_params_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_cosmos_consensus_v1_params_proto_goTypes = []interface{}{ + (*ConsensusParams)(nil), // 0: cosmos.consensus.v1.ConsensusParams + (*BlockParams)(nil), // 1: cosmos.consensus.v1.BlockParams + (*EvidenceParams)(nil), // 2: cosmos.consensus.v1.EvidenceParams + (*ValidatorParams)(nil), // 3: cosmos.consensus.v1.ValidatorParams + (*VersionParams)(nil), // 4: cosmos.consensus.v1.VersionParams + (*HashedParams)(nil), // 5: cosmos.consensus.v1.HashedParams + (*SynchronyParams)(nil), // 6: cosmos.consensus.v1.SynchronyParams + (*FeatureParams)(nil), // 7: cosmos.consensus.v1.FeatureParams + (*durationpb.Duration)(nil), // 8: google.protobuf.Duration + (*wrapperspb.Int64Value)(nil), // 9: google.protobuf.Int64Value +} +var file_cosmos_consensus_v1_params_proto_depIdxs = []int32{ + 1, // 0: cosmos.consensus.v1.ConsensusParams.block:type_name -> cosmos.consensus.v1.BlockParams + 2, // 1: cosmos.consensus.v1.ConsensusParams.evidence:type_name -> cosmos.consensus.v1.EvidenceParams + 3, // 2: cosmos.consensus.v1.ConsensusParams.validator:type_name -> cosmos.consensus.v1.ValidatorParams + 4, // 3: cosmos.consensus.v1.ConsensusParams.version:type_name -> cosmos.consensus.v1.VersionParams + 6, // 4: cosmos.consensus.v1.ConsensusParams.synchrony:type_name -> cosmos.consensus.v1.SynchronyParams + 7, // 5: cosmos.consensus.v1.ConsensusParams.feature:type_name -> cosmos.consensus.v1.FeatureParams + 8, // 6: cosmos.consensus.v1.EvidenceParams.max_age_duration:type_name -> google.protobuf.Duration + 8, // 7: cosmos.consensus.v1.SynchronyParams.precision:type_name -> google.protobuf.Duration + 8, // 8: cosmos.consensus.v1.SynchronyParams.message_delay:type_name -> google.protobuf.Duration + 9, // 9: cosmos.consensus.v1.FeatureParams.vote_extensions_enable_height:type_name -> google.protobuf.Int64Value + 9, // 10: cosmos.consensus.v1.FeatureParams.pbts_enable_height:type_name -> google.protobuf.Int64Value + 11, // [11:11] is the sub-list for method output_type + 11, // [11:11] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name +} + +func init() { file_cosmos_consensus_v1_params_proto_init() } +func file_cosmos_consensus_v1_params_proto_init() { + if File_cosmos_consensus_v1_params_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cosmos_consensus_v1_params_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConsensusParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_consensus_v1_params_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BlockParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_consensus_v1_params_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EvidenceParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_consensus_v1_params_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ValidatorParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_consensus_v1_params_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VersionParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_consensus_v1_params_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HashedParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_consensus_v1_params_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SynchronyParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_consensus_v1_params_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FeatureParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cosmos_consensus_v1_params_proto_rawDesc, + NumEnums: 0, + NumMessages: 8, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cosmos_consensus_v1_params_proto_goTypes, + DependencyIndexes: file_cosmos_consensus_v1_params_proto_depIdxs, + MessageInfos: file_cosmos_consensus_v1_params_proto_msgTypes, + }.Build() + File_cosmos_consensus_v1_params_proto = out.File + file_cosmos_consensus_v1_params_proto_rawDesc = nil + file_cosmos_consensus_v1_params_proto_goTypes = nil + file_cosmos_consensus_v1_params_proto_depIdxs = nil +} diff --git a/api/cosmos/consensus/v1/query.pulsar.go b/api/cosmos/consensus/v1/query.pulsar.go index ef4d64ea7464..77f33249ac4c 100644 --- a/api/cosmos/consensus/v1/query.pulsar.go +++ b/api/cosmos/consensus/v1/query.pulsar.go @@ -2,7 +2,6 @@ package consensusv1 import ( - v1 "buf.build/gen/go/cometbft/cometbft/protocolbuffers/go/cometbft/types/v1" fmt "fmt" runtime "github.com/cosmos/cosmos-proto/runtime" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -527,7 +526,7 @@ func (x *fastReflection_QueryParamsResponse) Get(descriptor protoreflect.FieldDe func (x *fastReflection_QueryParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { case "cosmos.consensus.v1.QueryParamsResponse.params": - x.Params = value.Message().Interface().(*v1.ConsensusParams) + x.Params = value.Message().Interface().(*ConsensusParams) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.QueryParamsResponse")) @@ -550,7 +549,7 @@ func (x *fastReflection_QueryParamsResponse) Mutable(fd protoreflect.FieldDescri switch fd.FullName() { case "cosmos.consensus.v1.QueryParamsResponse.params": if x.Params == nil { - x.Params = new(v1.ConsensusParams) + x.Params = new(ConsensusParams) } return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) default: @@ -567,7 +566,7 @@ func (x *fastReflection_QueryParamsResponse) Mutable(fd protoreflect.FieldDescri func (x *fastReflection_QueryParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { case "cosmos.consensus.v1.QueryParamsResponse.params": - m := new(v1.ConsensusParams) + m := new(ConsensusParams) return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { @@ -764,7 +763,7 @@ func (x *fastReflection_QueryParamsResponse) ProtoMethods() *protoiface.Methods return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } if x.Params == nil { - x.Params = &v1.ConsensusParams{} + x.Params = &ConsensusParams{} } if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err @@ -856,7 +855,7 @@ type QueryParamsResponse struct { // params are the tendermint consensus params stored in the consensus module. // Please note that `params.version` is not populated in this response, it is // tracked separately in the x/upgrade module. - Params *v1.ConsensusParams `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` + Params *ConsensusParams `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` } func (x *QueryParamsResponse) Reset() { @@ -879,7 +878,7 @@ func (*QueryParamsResponse) Descriptor() ([]byte, []int) { return file_cosmos_consensus_v1_query_proto_rawDescGZIP(), []int{1} } -func (x *QueryParamsResponse) GetParams() *v1.ConsensusParams { +func (x *QueryParamsResponse) GetParams() *ConsensusParams { if x != nil { return x.Params } @@ -894,37 +893,37 @@ var file_cosmos_consensus_v1_query_proto_rawDesc = []byte{ 0x6f, 0x12, 0x13, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x14, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x51, 0x0a, 0x13, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x3a, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2e, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x32, 0x8a, 0x01, - 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x80, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x12, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, - 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x76, - 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, - 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0xc5, 0x01, 0x0a, 0x17, 0x63, - 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, - 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, - 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, - 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x73, 0x65, - 0x6e, 0x73, 0x75, 0x73, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x43, 0x58, 0xaa, 0x02, 0x13, 0x43, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, - 0x56, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x73, - 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5c, 0x56, 0x31, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x3a, 0x3a, - 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, + 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x14, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x53, 0x0a, 0x13, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, + 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, + 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x32, 0x8a, 0x01, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x80, 0x01, 0x0a, 0x06, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, + 0x75, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x1d, 0x12, 0x1b, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, + 0x6e, 0x73, 0x75, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0xc5, + 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, + 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x63, + 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x43, 0x58, + 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, + 0x73, 0x75, 0x73, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, + 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1f, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5c, + 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, + 0x75, 0x73, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -943,10 +942,10 @@ var file_cosmos_consensus_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo var file_cosmos_consensus_v1_query_proto_goTypes = []interface{}{ (*QueryParamsRequest)(nil), // 0: cosmos.consensus.v1.QueryParamsRequest (*QueryParamsResponse)(nil), // 1: cosmos.consensus.v1.QueryParamsResponse - (*v1.ConsensusParams)(nil), // 2: cometbft.types.v1.ConsensusParams + (*ConsensusParams)(nil), // 2: cosmos.consensus.v1.ConsensusParams } var file_cosmos_consensus_v1_query_proto_depIdxs = []int32{ - 2, // 0: cosmos.consensus.v1.QueryParamsResponse.params:type_name -> cometbft.types.v1.ConsensusParams + 2, // 0: cosmos.consensus.v1.QueryParamsResponse.params:type_name -> cosmos.consensus.v1.ConsensusParams 0, // 1: cosmos.consensus.v1.Query.Params:input_type -> cosmos.consensus.v1.QueryParamsRequest 1, // 2: cosmos.consensus.v1.Query.Params:output_type -> cosmos.consensus.v1.QueryParamsResponse 2, // [2:3] is the sub-list for method output_type @@ -961,6 +960,7 @@ func file_cosmos_consensus_v1_query_proto_init() { if File_cosmos_consensus_v1_query_proto != nil { return } + file_cosmos_consensus_v1_params_proto_init() if !protoimpl.UnsafeEnabled { file_cosmos_consensus_v1_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QueryParamsRequest); i { diff --git a/api/cosmos/consensus/v1/tx.pulsar.go b/api/cosmos/consensus/v1/tx.pulsar.go index addd9db38326..62124c05fcfb 100644 --- a/api/cosmos/consensus/v1/tx.pulsar.go +++ b/api/cosmos/consensus/v1/tx.pulsar.go @@ -2,7 +2,6 @@ package consensusv1 import ( - v1 "buf.build/gen/go/cometbft/cometbft/protocolbuffers/go/cometbft/types/v1" _ "cosmossdk.io/api/amino" _ "cosmossdk.io/api/cosmos/msg/v1" fmt "fmt" @@ -22,7 +21,6 @@ var ( fd_MsgUpdateParams_block protoreflect.FieldDescriptor fd_MsgUpdateParams_evidence protoreflect.FieldDescriptor fd_MsgUpdateParams_validator protoreflect.FieldDescriptor - fd_MsgUpdateParams_abci protoreflect.FieldDescriptor fd_MsgUpdateParams_synchrony protoreflect.FieldDescriptor fd_MsgUpdateParams_feature protoreflect.FieldDescriptor ) @@ -34,7 +32,6 @@ func init() { fd_MsgUpdateParams_block = md_MsgUpdateParams.Fields().ByName("block") fd_MsgUpdateParams_evidence = md_MsgUpdateParams.Fields().ByName("evidence") fd_MsgUpdateParams_validator = md_MsgUpdateParams.Fields().ByName("validator") - fd_MsgUpdateParams_abci = md_MsgUpdateParams.Fields().ByName("abci") fd_MsgUpdateParams_synchrony = md_MsgUpdateParams.Fields().ByName("synchrony") fd_MsgUpdateParams_feature = md_MsgUpdateParams.Fields().ByName("feature") } @@ -128,12 +125,6 @@ func (x *fastReflection_MsgUpdateParams) Range(f func(protoreflect.FieldDescript return } } - if x.Abci != nil { - value := protoreflect.ValueOfMessage(x.Abci.ProtoReflect()) - if !f(fd_MsgUpdateParams_abci, value) { - return - } - } if x.Synchrony != nil { value := protoreflect.ValueOfMessage(x.Synchrony.ProtoReflect()) if !f(fd_MsgUpdateParams_synchrony, value) { @@ -169,8 +160,6 @@ func (x *fastReflection_MsgUpdateParams) Has(fd protoreflect.FieldDescriptor) bo return x.Evidence != nil case "cosmos.consensus.v1.MsgUpdateParams.validator": return x.Validator != nil - case "cosmos.consensus.v1.MsgUpdateParams.abci": - return x.Abci != nil case "cosmos.consensus.v1.MsgUpdateParams.synchrony": return x.Synchrony != nil case "cosmos.consensus.v1.MsgUpdateParams.feature": @@ -199,8 +188,6 @@ func (x *fastReflection_MsgUpdateParams) Clear(fd protoreflect.FieldDescriptor) x.Evidence = nil case "cosmos.consensus.v1.MsgUpdateParams.validator": x.Validator = nil - case "cosmos.consensus.v1.MsgUpdateParams.abci": - x.Abci = nil case "cosmos.consensus.v1.MsgUpdateParams.synchrony": x.Synchrony = nil case "cosmos.consensus.v1.MsgUpdateParams.feature": @@ -233,9 +220,6 @@ func (x *fastReflection_MsgUpdateParams) Get(descriptor protoreflect.FieldDescri case "cosmos.consensus.v1.MsgUpdateParams.validator": value := x.Validator return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "cosmos.consensus.v1.MsgUpdateParams.abci": - value := x.Abci - return protoreflect.ValueOfMessage(value.ProtoReflect()) case "cosmos.consensus.v1.MsgUpdateParams.synchrony": value := x.Synchrony return protoreflect.ValueOfMessage(value.ProtoReflect()) @@ -265,17 +249,15 @@ func (x *fastReflection_MsgUpdateParams) Set(fd protoreflect.FieldDescriptor, va case "cosmos.consensus.v1.MsgUpdateParams.authority": x.Authority = value.Interface().(string) case "cosmos.consensus.v1.MsgUpdateParams.block": - x.Block = value.Message().Interface().(*v1.BlockParams) + x.Block = value.Message().Interface().(*BlockParams) case "cosmos.consensus.v1.MsgUpdateParams.evidence": - x.Evidence = value.Message().Interface().(*v1.EvidenceParams) + x.Evidence = value.Message().Interface().(*EvidenceParams) case "cosmos.consensus.v1.MsgUpdateParams.validator": - x.Validator = value.Message().Interface().(*v1.ValidatorParams) - case "cosmos.consensus.v1.MsgUpdateParams.abci": - x.Abci = value.Message().Interface().(*v1.ABCIParams) + x.Validator = value.Message().Interface().(*ValidatorParams) case "cosmos.consensus.v1.MsgUpdateParams.synchrony": - x.Synchrony = value.Message().Interface().(*v1.SynchronyParams) + x.Synchrony = value.Message().Interface().(*SynchronyParams) case "cosmos.consensus.v1.MsgUpdateParams.feature": - x.Feature = value.Message().Interface().(*v1.FeatureParams) + x.Feature = value.Message().Interface().(*FeatureParams) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.MsgUpdateParams")) @@ -298,32 +280,27 @@ func (x *fastReflection_MsgUpdateParams) Mutable(fd protoreflect.FieldDescriptor switch fd.FullName() { case "cosmos.consensus.v1.MsgUpdateParams.block": if x.Block == nil { - x.Block = new(v1.BlockParams) + x.Block = new(BlockParams) } return protoreflect.ValueOfMessage(x.Block.ProtoReflect()) case "cosmos.consensus.v1.MsgUpdateParams.evidence": if x.Evidence == nil { - x.Evidence = new(v1.EvidenceParams) + x.Evidence = new(EvidenceParams) } return protoreflect.ValueOfMessage(x.Evidence.ProtoReflect()) case "cosmos.consensus.v1.MsgUpdateParams.validator": if x.Validator == nil { - x.Validator = new(v1.ValidatorParams) + x.Validator = new(ValidatorParams) } return protoreflect.ValueOfMessage(x.Validator.ProtoReflect()) - case "cosmos.consensus.v1.MsgUpdateParams.abci": - if x.Abci == nil { - x.Abci = new(v1.ABCIParams) - } - return protoreflect.ValueOfMessage(x.Abci.ProtoReflect()) case "cosmos.consensus.v1.MsgUpdateParams.synchrony": if x.Synchrony == nil { - x.Synchrony = new(v1.SynchronyParams) + x.Synchrony = new(SynchronyParams) } return protoreflect.ValueOfMessage(x.Synchrony.ProtoReflect()) case "cosmos.consensus.v1.MsgUpdateParams.feature": if x.Feature == nil { - x.Feature = new(v1.FeatureParams) + x.Feature = new(FeatureParams) } return protoreflect.ValueOfMessage(x.Feature.ProtoReflect()) case "cosmos.consensus.v1.MsgUpdateParams.authority": @@ -344,22 +321,19 @@ func (x *fastReflection_MsgUpdateParams) NewField(fd protoreflect.FieldDescripto case "cosmos.consensus.v1.MsgUpdateParams.authority": return protoreflect.ValueOfString("") case "cosmos.consensus.v1.MsgUpdateParams.block": - m := new(v1.BlockParams) + m := new(BlockParams) return protoreflect.ValueOfMessage(m.ProtoReflect()) case "cosmos.consensus.v1.MsgUpdateParams.evidence": - m := new(v1.EvidenceParams) + m := new(EvidenceParams) return protoreflect.ValueOfMessage(m.ProtoReflect()) case "cosmos.consensus.v1.MsgUpdateParams.validator": - m := new(v1.ValidatorParams) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "cosmos.consensus.v1.MsgUpdateParams.abci": - m := new(v1.ABCIParams) + m := new(ValidatorParams) return protoreflect.ValueOfMessage(m.ProtoReflect()) case "cosmos.consensus.v1.MsgUpdateParams.synchrony": - m := new(v1.SynchronyParams) + m := new(SynchronyParams) return protoreflect.ValueOfMessage(m.ProtoReflect()) case "cosmos.consensus.v1.MsgUpdateParams.feature": - m := new(v1.FeatureParams) + m := new(FeatureParams) return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { @@ -446,10 +420,6 @@ func (x *fastReflection_MsgUpdateParams) ProtoMethods() *protoiface.Methods { l = options.Size(x.Validator) n += 1 + l + runtime.Sov(uint64(l)) } - if x.Abci != nil { - l = options.Size(x.Abci) - n += 1 + l + runtime.Sov(uint64(l)) - } if x.Synchrony != nil { l = options.Size(x.Synchrony) n += 1 + l + runtime.Sov(uint64(l)) @@ -515,20 +485,6 @@ func (x *fastReflection_MsgUpdateParams) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x32 } - if x.Abci != nil { - encoded, err := options.Marshal(x.Abci) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x2a - } if x.Validator != nil { encoded, err := options.Marshal(x.Validator) if err != nil { @@ -689,7 +645,7 @@ func (x *fastReflection_MsgUpdateParams) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } if x.Block == nil { - x.Block = &v1.BlockParams{} + x.Block = &BlockParams{} } if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Block); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err @@ -725,7 +681,7 @@ func (x *fastReflection_MsgUpdateParams) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } if x.Evidence == nil { - x.Evidence = &v1.EvidenceParams{} + x.Evidence = &EvidenceParams{} } if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Evidence); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err @@ -761,48 +717,12 @@ func (x *fastReflection_MsgUpdateParams) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } if x.Validator == nil { - x.Validator = &v1.ValidatorParams{} + x.Validator = &ValidatorParams{} } if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Validator); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 5: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Abci", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.Abci == nil { - x.Abci = &v1.ABCIParams{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Abci); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex case 6: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Synchrony", wireType) @@ -833,7 +753,7 @@ func (x *fastReflection_MsgUpdateParams) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } if x.Synchrony == nil { - x.Synchrony = &v1.SynchronyParams{} + x.Synchrony = &SynchronyParams{} } if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Synchrony); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err @@ -869,7 +789,7 @@ func (x *fastReflection_MsgUpdateParams) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } if x.Feature == nil { - x.Feature = &v1.FeatureParams{} + x.Feature = &FeatureParams{} } if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Feature); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err @@ -1294,13 +1214,11 @@ type MsgUpdateParams struct { // separarately in x/upgrade. // // NOTE: All parameters must be supplied. - Block *v1.BlockParams `protobuf:"bytes,2,opt,name=block,proto3" json:"block,omitempty"` - Evidence *v1.EvidenceParams `protobuf:"bytes,3,opt,name=evidence,proto3" json:"evidence,omitempty"` - Validator *v1.ValidatorParams `protobuf:"bytes,4,opt,name=validator,proto3" json:"validator,omitempty"` - // Deprecated: Do not use. - Abci *v1.ABCIParams `protobuf:"bytes,5,opt,name=abci,proto3" json:"abci,omitempty"` - Synchrony *v1.SynchronyParams `protobuf:"bytes,6,opt,name=synchrony,proto3" json:"synchrony,omitempty"` - Feature *v1.FeatureParams `protobuf:"bytes,7,opt,name=feature,proto3" json:"feature,omitempty"` + Block *BlockParams `protobuf:"bytes,2,opt,name=block,proto3" json:"block,omitempty"` + Evidence *EvidenceParams `protobuf:"bytes,3,opt,name=evidence,proto3" json:"evidence,omitempty"` + Validator *ValidatorParams `protobuf:"bytes,4,opt,name=validator,proto3" json:"validator,omitempty"` + Synchrony *SynchronyParams `protobuf:"bytes,6,opt,name=synchrony,proto3" json:"synchrony,omitempty"` + Feature *FeatureParams `protobuf:"bytes,7,opt,name=feature,proto3" json:"feature,omitempty"` } func (x *MsgUpdateParams) Reset() { @@ -1330,43 +1248,35 @@ func (x *MsgUpdateParams) GetAuthority() string { return "" } -func (x *MsgUpdateParams) GetBlock() *v1.BlockParams { +func (x *MsgUpdateParams) GetBlock() *BlockParams { if x != nil { return x.Block } return nil } -func (x *MsgUpdateParams) GetEvidence() *v1.EvidenceParams { +func (x *MsgUpdateParams) GetEvidence() *EvidenceParams { if x != nil { return x.Evidence } return nil } -func (x *MsgUpdateParams) GetValidator() *v1.ValidatorParams { +func (x *MsgUpdateParams) GetValidator() *ValidatorParams { if x != nil { return x.Validator } return nil } -// Deprecated: Do not use. -func (x *MsgUpdateParams) GetAbci() *v1.ABCIParams { - if x != nil { - return x.Abci - } - return nil -} - -func (x *MsgUpdateParams) GetSynchrony() *v1.SynchronyParams { +func (x *MsgUpdateParams) GetSynchrony() *SynchronyParams { if x != nil { return x.Synchrony } return nil } -func (x *MsgUpdateParams) GetFeature() *v1.FeatureParams { +func (x *MsgUpdateParams) GetFeature() *FeatureParams { if x != nil { return x.Feature } @@ -1411,67 +1321,63 @@ var file_cosmos_consensus_v1_tx_proto_rawDesc = []byte{ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x73, 0x67, 0x2f, 0x76, 0x31, - 0x2f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x6d, 0x65, - 0x74, 0x62, 0x66, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xad, 0x04, 0x0a, 0x0f, 0x4d, - 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x36, - 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, - 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x34, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, - 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x3d, 0x0a, 0x08, - 0x65, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, - 0x2e, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, - 0x76, 0x31, 0x2e, 0x45, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x52, 0x08, 0x65, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x40, 0x0a, 0x09, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, - 0x2e, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, - 0x76, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x48, 0x0a, - 0x04, 0x61, 0x62, 0x63, 0x69, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x6f, - 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, - 0x41, 0x42, 0x43, 0x49, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x15, 0xda, 0xb4, 0x2d, 0x0f, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x20, 0x30, 0x2e, 0x35, 0x30, 0x18, - 0x01, 0x52, 0x04, 0x61, 0x62, 0x63, 0x69, 0x12, 0x55, 0x0a, 0x09, 0x73, 0x79, 0x6e, 0x63, 0x68, - 0x72, 0x6f, 0x6e, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6f, 0x6d, - 0x65, 0x74, 0x62, 0x66, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, + 0x2f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2f, 0x76, 0x31, 0x2f, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xed, 0x03, 0x0a, + 0x0f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x36, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x12, 0x3f, 0x0a, 0x08, 0x65, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, + 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, + 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x08, 0x65, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, + 0x65, 0x12, 0x42, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, + 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x57, 0x0a, 0x09, 0x73, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, + 0x6e, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x13, 0xda, 0xb4, 0x2d, 0x0f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x20, 0x30, - 0x2e, 0x35, 0x32, 0x52, 0x09, 0x73, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x79, 0x12, 0x4f, + 0x2e, 0x35, 0x32, 0x52, 0x09, 0x73, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x79, 0x12, 0x51, 0x0a, 0x07, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x20, 0x2e, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x42, 0x13, 0xda, 0xb4, 0x2d, 0x0f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, - 0x6b, 0x20, 0x30, 0x2e, 0x35, 0x32, 0x52, 0x07, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x3a, - 0x39, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, - 0xe7, 0xb0, 0x2a, 0x26, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x78, - 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, - 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x85, 0x01, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x77, 0x0a, - 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x24, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, - 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x1a, 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, - 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x13, 0xca, 0xb4, 0x2d, 0x0f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, - 0x6b, 0x20, 0x30, 0x2e, 0x34, 0x37, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xc2, 0x01, - 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, - 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, - 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, - 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x73, 0x65, - 0x6e, 0x73, 0x75, 0x73, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x43, 0x58, 0xaa, 0x02, 0x13, 0x43, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, - 0x56, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x73, - 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5c, 0x56, 0x31, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x3a, 0x3a, - 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, + 0x75, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x42, 0x13, 0xda, 0xb4, 0x2d, 0x0f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, + 0x73, 0x64, 0x6b, 0x20, 0x30, 0x2e, 0x35, 0x32, 0x52, 0x07, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x3a, 0x39, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, + 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x26, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, + 0x2f, 0x78, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2f, 0x4d, 0x73, 0x67, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x19, 0x0a, 0x17, + 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x85, 0x01, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, + 0x77, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, + 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, + 0x75, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, + 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x13, 0xca, 0xb4, 0x2d, 0x0f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, + 0x73, 0x64, 0x6b, 0x20, 0x30, 0x2e, 0x34, 0x37, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, + 0xc2, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, + 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, + 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, + 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, + 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x43, 0x58, 0xaa, 0x02, + 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, + 0x73, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, + 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5c, 0x56, 0x31, + 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, + 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1490,27 +1396,25 @@ var file_cosmos_consensus_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 2 var file_cosmos_consensus_v1_tx_proto_goTypes = []interface{}{ (*MsgUpdateParams)(nil), // 0: cosmos.consensus.v1.MsgUpdateParams (*MsgUpdateParamsResponse)(nil), // 1: cosmos.consensus.v1.MsgUpdateParamsResponse - (*v1.BlockParams)(nil), // 2: cometbft.types.v1.BlockParams - (*v1.EvidenceParams)(nil), // 3: cometbft.types.v1.EvidenceParams - (*v1.ValidatorParams)(nil), // 4: cometbft.types.v1.ValidatorParams - (*v1.ABCIParams)(nil), // 5: cometbft.types.v1.ABCIParams - (*v1.SynchronyParams)(nil), // 6: cometbft.types.v1.SynchronyParams - (*v1.FeatureParams)(nil), // 7: cometbft.types.v1.FeatureParams + (*BlockParams)(nil), // 2: cosmos.consensus.v1.BlockParams + (*EvidenceParams)(nil), // 3: cosmos.consensus.v1.EvidenceParams + (*ValidatorParams)(nil), // 4: cosmos.consensus.v1.ValidatorParams + (*SynchronyParams)(nil), // 5: cosmos.consensus.v1.SynchronyParams + (*FeatureParams)(nil), // 6: cosmos.consensus.v1.FeatureParams } var file_cosmos_consensus_v1_tx_proto_depIdxs = []int32{ - 2, // 0: cosmos.consensus.v1.MsgUpdateParams.block:type_name -> cometbft.types.v1.BlockParams - 3, // 1: cosmos.consensus.v1.MsgUpdateParams.evidence:type_name -> cometbft.types.v1.EvidenceParams - 4, // 2: cosmos.consensus.v1.MsgUpdateParams.validator:type_name -> cometbft.types.v1.ValidatorParams - 5, // 3: cosmos.consensus.v1.MsgUpdateParams.abci:type_name -> cometbft.types.v1.ABCIParams - 6, // 4: cosmos.consensus.v1.MsgUpdateParams.synchrony:type_name -> cometbft.types.v1.SynchronyParams - 7, // 5: cosmos.consensus.v1.MsgUpdateParams.feature:type_name -> cometbft.types.v1.FeatureParams - 0, // 6: cosmos.consensus.v1.Msg.UpdateParams:input_type -> cosmos.consensus.v1.MsgUpdateParams - 1, // 7: cosmos.consensus.v1.Msg.UpdateParams:output_type -> cosmos.consensus.v1.MsgUpdateParamsResponse - 7, // [7:8] is the sub-list for method output_type - 6, // [6:7] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name + 2, // 0: cosmos.consensus.v1.MsgUpdateParams.block:type_name -> cosmos.consensus.v1.BlockParams + 3, // 1: cosmos.consensus.v1.MsgUpdateParams.evidence:type_name -> cosmos.consensus.v1.EvidenceParams + 4, // 2: cosmos.consensus.v1.MsgUpdateParams.validator:type_name -> cosmos.consensus.v1.ValidatorParams + 5, // 3: cosmos.consensus.v1.MsgUpdateParams.synchrony:type_name -> cosmos.consensus.v1.SynchronyParams + 6, // 4: cosmos.consensus.v1.MsgUpdateParams.feature:type_name -> cosmos.consensus.v1.FeatureParams + 0, // 5: cosmos.consensus.v1.Msg.UpdateParams:input_type -> cosmos.consensus.v1.MsgUpdateParams + 1, // 6: cosmos.consensus.v1.Msg.UpdateParams:output_type -> cosmos.consensus.v1.MsgUpdateParamsResponse + 6, // [6:7] is the sub-list for method output_type + 5, // [5:6] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name } func init() { file_cosmos_consensus_v1_tx_proto_init() } @@ -1518,6 +1422,7 @@ func file_cosmos_consensus_v1_tx_proto_init() { if File_cosmos_consensus_v1_tx_proto != nil { return } + file_cosmos_consensus_v1_params_proto_init() if !protoimpl.UnsafeEnabled { file_cosmos_consensus_v1_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgUpdateParams); i { diff --git a/x/consensus/exported/exported.go b/x/consensus/exported/exported.go index 91dfabb451e2..36aa63da3d88 100644 --- a/x/consensus/exported/exported.go +++ b/x/consensus/exported/exported.go @@ -3,13 +3,13 @@ package exported import ( "context" - cmtproto "github.com/cometbft/cometbft/api/cometbft/types/v1" + "cosmossdk.io/x/consensus/types" ) // ConsensusParamSetter defines the interface fulfilled by BaseApp's // ParamStore which allows setting its appVersion field. type ConsensusParamSetter interface { - Get(ctx context.Context) (cmtproto.ConsensusParams, error) + Get(ctx context.Context) (types.ConsensusParams, error) Has(ctx context.Context) (bool, error) - Set(ctx context.Context, cp cmtproto.ConsensusParams) error + Set(ctx context.Context, cp types.ConsensusParams) error } diff --git a/x/consensus/proto/cosmos/consensus/v1/consensus.proto b/x/consensus/proto/cosmos/consensus/v1/consensus.proto deleted file mode 100644 index b45f0c1d4eee..000000000000 --- a/x/consensus/proto/cosmos/consensus/v1/consensus.proto +++ /dev/null @@ -1,15 +0,0 @@ -// Since: cosmos-sdk 0.52 -syntax = "proto3"; -package cosmos.consensus.v1; - -import "cometbft/abci/v1/types.proto"; - -option go_package = "cosmossdk.io/x/consensus/types"; - -// CometInfo defines the structure of the x/consensus module's comet info. -message CometInfo { - repeated cometbft.abci.v1.Misbehavior evidence = 1; - bytes validators_hash = 2; - bytes proposer_address = 3; - cometbft.abci.v1.CommitInfo last_commit = 4; -} diff --git a/x/consensus/proto/cosmos/consensus/v1/params.proto b/x/consensus/proto/cosmos/consensus/v1/params.proto new file mode 100644 index 000000000000..f9d3b1591da0 --- /dev/null +++ b/x/consensus/proto/cosmos/consensus/v1/params.proto @@ -0,0 +1,136 @@ +syntax = "proto3"; +package cosmos.consensus.v1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/wrappers.proto"; + +option go_package = "cosmossdk.io/x/consensus/types"; + +// ConsensusParams contains consensus critical parameters that determine the +// validity of blocks. +message ConsensusParams { + BlockParams block = 1; + EvidenceParams evidence = 2; + ValidatorParams validator = 3; + VersionParams version = 4; + SynchronyParams synchrony = 6; + FeatureParams feature = 7; +} + +// BlockParams define limits on the block size and gas. +message BlockParams { + // Maximum size of a block, in bytes. + // + // Must be greater or equal to -1 and cannot be greater than the hard-coded + // maximum block size, which is 100MB. + // + // If set to -1, the limit is the hard-coded maximum block size. + int64 max_bytes = 1; + // Maximum gas wanted by transactions included in a block. + // + // Must be greater or equal to -1. If set to -1, no limit is enforced. + int64 max_gas = 2; + + reserved 3; // was TimeIotaMs see https://github.com/tendermint/tendermint/pull/5792 +} + +// EvidenceParams determine the validity of evidences of Byzantine behavior. +message EvidenceParams { + // Maximum age of evidence, in blocks. + // + // The recommended formula for calculating it is max_age_duration / {average + // block time}. + int64 max_age_num_blocks = 1; + + // Maximum age of evidence, in time. + // + // The recommended value of is should correspond to the application's + // "unbonding period" or other similar mechanism for handling + // Nothing-At-Stake attacks. + // See: + // https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed. + google.protobuf.Duration max_age_duration = 2 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; + + // Maximum size in bytes of evidence allowed to be included in a block. + // + // It should fall comfortably under the maximum size of a block. + int64 max_bytes = 3; +} + +// ValidatorParams restrict the public key types validators can use. +// +// NOTE: uses ABCI public keys naming, not Amino names. +message ValidatorParams { + option (gogoproto.populate) = true; + option (gogoproto.equal) = true; + + repeated string pub_key_types = 1; +} + +// VersionParams contain the version of specific components of CometBFT. +message VersionParams { + option (gogoproto.populate) = true; + option (gogoproto.equal) = true; + + // The ABCI application version. + // + // It was named app_version in CometBFT 0.34. + uint64 app = 1; +} + +// HashedParams is a subset of ConsensusParams. +// +// It is hashed into the Header.ConsensusHash. +message HashedParams { + int64 block_max_bytes = 1; + int64 block_max_gas = 2; +} + +// SynchronyParams determine the validity of block timestamps. +// +// These parameters are part of the Proposer-Based Timestamps (PBTS) algorithm. +// For more information on the relationship of the synchrony parameters to +// block timestamps validity, refer to the PBTS specification: +// https://github.com/tendermint/spec/blob/master/spec/consensus/proposer-based-timestamp/README.md +message SynchronyParams { + // Bound for how skewed a proposer's clock may be from any validator on the + // network while still producing valid proposals. + google.protobuf.Duration precision = 1 [(gogoproto.stdduration) = true]; + // Bound for how long a proposal message may take to reach all validators on + // a network and still be considered valid. + google.protobuf.Duration message_delay = 2 [(gogoproto.stdduration) = true]; +} + +// FeatureParams configure the height from which features of CometBFT are enabled. +message FeatureParams { + // Height during which vote extensions will be enabled. + // + // A value of 0 means vote extensions are disabled. A value > 0 denotes + // the height at which vote extensions will be (or have been) enabled. + // + // During the specified height, and for all subsequent heights, precommit + // messages that do not contain valid extension data will be considered + // invalid. Prior to this height, or when this height is set to 0, vote + // extensions will not be used or accepted by validators on the network. + // + // Once enabled, vote extensions will be created by the application in + // ExtendVote, validated by the application in VerifyVoteExtension, and + // used by the application in PrepareProposal, when proposing the next block. + // + // Cannot be set to heights lower or equal to the current blockchain height. + google.protobuf.Int64Value vote_extensions_enable_height = 1 [(gogoproto.nullable) = true]; + + // Height at which Proposer-Based Timestamps (PBTS) will be enabled. + // + // A value of 0 means PBTS is disabled. A value > 0 denotes the height at + // which PBTS will be (or has been) enabled. + // + // From the specified height, and for all subsequent heights, the PBTS + // algorithm will be used to produce and validate block timestamps. Prior to + // this height, or when this height is set to 0, the legacy BFT Time + // algorithm is used to produce and validate timestamps. + // + // Cannot be set to heights lower or equal to the current blockchain height. + google.protobuf.Int64Value pbts_enable_height = 2 [(gogoproto.nullable) = true]; +} diff --git a/x/consensus/proto/cosmos/consensus/v1/query.proto b/x/consensus/proto/cosmos/consensus/v1/query.proto index 9a84c1909766..e3fa08223608 100644 --- a/x/consensus/proto/cosmos/consensus/v1/query.proto +++ b/x/consensus/proto/cosmos/consensus/v1/query.proto @@ -3,7 +3,7 @@ syntax = "proto3"; package cosmos.consensus.v1; import "google/api/annotations.proto"; -import "cometbft/types/v1/params.proto"; +import "cosmos/consensus/v1/params.proto"; option go_package = "cosmossdk.io/x/consensus/types"; @@ -23,5 +23,5 @@ message QueryParamsResponse { // params are the tendermint consensus params stored in the consensus module. // Please note that `params.version` is not populated in this response, it is // tracked separately in the x/upgrade module. - cometbft.types.v1.ConsensusParams params = 1; + ConsensusParams params = 1; } diff --git a/x/consensus/proto/cosmos/consensus/v1/tx.proto b/x/consensus/proto/cosmos/consensus/v1/tx.proto index d0cdde493a9c..6eb5faea1511 100644 --- a/x/consensus/proto/cosmos/consensus/v1/tx.proto +++ b/x/consensus/proto/cosmos/consensus/v1/tx.proto @@ -5,7 +5,7 @@ package cosmos.consensus.v1; import "amino/amino.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/msg/v1/msg.proto"; -import "cometbft/types/v1/params.proto"; +import "cosmos/consensus/v1/params.proto"; option go_package = "cosmossdk.io/x/consensus/types"; @@ -33,14 +33,12 @@ message MsgUpdateParams { // separarately in x/upgrade. // // NOTE: All parameters must be supplied. - cometbft.types.v1.BlockParams block = 2; - cometbft.types.v1.EvidenceParams evidence = 3; - cometbft.types.v1.ValidatorParams validator = 4; + BlockParams block = 2; + EvidenceParams evidence = 3; + ValidatorParams validator = 4; - cometbft.types.v1.ABCIParams abci = 5 [deprecated = true, (cosmos_proto.field_added_in) = "cosmos-sdk 0.50"]; - - cometbft.types.v1.SynchronyParams synchrony = 6 [(cosmos_proto.field_added_in) = "cosmos-sdk 0.52"]; - cometbft.types.v1.FeatureParams feature = 7 [(cosmos_proto.field_added_in) = "cosmos-sdk 0.52"]; + SynchronyParams synchrony = 6 [(cosmos_proto.field_added_in) = "cosmos-sdk 0.52"]; + FeatureParams feature = 7 [(cosmos_proto.field_added_in) = "cosmos-sdk 0.52"]; } // MsgUpdateParamsResponse defines the response structure for executing a diff --git a/x/consensus/types/consensus.pb.go b/x/consensus/types/consensus.pb.go deleted file mode 100644 index 0029ca982928..000000000000 --- a/x/consensus/types/consensus.pb.go +++ /dev/null @@ -1,503 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/consensus/v1/consensus.proto - -package types - -import ( - fmt "fmt" - v1 "github.com/cometbft/cometbft/api/cometbft/abci/v1" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// CometInfo defines the structure of the x/consensus module's comet info. -type CometInfo struct { - Evidence []*v1.Misbehavior `protobuf:"bytes,1,rep,name=evidence,proto3" json:"evidence,omitempty"` - ValidatorsHash []byte `protobuf:"bytes,2,opt,name=validators_hash,json=validatorsHash,proto3" json:"validators_hash,omitempty"` - ProposerAddress []byte `protobuf:"bytes,3,opt,name=proposer_address,json=proposerAddress,proto3" json:"proposer_address,omitempty"` - LastCommit *v1.CommitInfo `protobuf:"bytes,4,opt,name=last_commit,json=lastCommit,proto3" json:"last_commit,omitempty"` -} - -func (m *CometInfo) Reset() { *m = CometInfo{} } -func (m *CometInfo) String() string { return proto.CompactTextString(m) } -func (*CometInfo) ProtoMessage() {} -func (*CometInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_7ed86dd7d42fb61b, []int{0} -} -func (m *CometInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CometInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CometInfo.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *CometInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_CometInfo.Merge(m, src) -} -func (m *CometInfo) XXX_Size() int { - return m.Size() -} -func (m *CometInfo) XXX_DiscardUnknown() { - xxx_messageInfo_CometInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_CometInfo proto.InternalMessageInfo - -func (m *CometInfo) GetEvidence() []*v1.Misbehavior { - if m != nil { - return m.Evidence - } - return nil -} - -func (m *CometInfo) GetValidatorsHash() []byte { - if m != nil { - return m.ValidatorsHash - } - return nil -} - -func (m *CometInfo) GetProposerAddress() []byte { - if m != nil { - return m.ProposerAddress - } - return nil -} - -func (m *CometInfo) GetLastCommit() *v1.CommitInfo { - if m != nil { - return m.LastCommit - } - return nil -} - -func init() { - proto.RegisterType((*CometInfo)(nil), "cosmos.consensus.v1.CometInfo") -} - -func init() { - proto.RegisterFile("cosmos/consensus/v1/consensus.proto", fileDescriptor_7ed86dd7d42fb61b) -} - -var fileDescriptor_7ed86dd7d42fb61b = []byte{ - // 285 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x90, 0xb1, 0x4e, 0xf3, 0x30, - 0x14, 0x85, 0xeb, 0xbf, 0xbf, 0x10, 0xb8, 0x88, 0xa2, 0xb0, 0x44, 0xa8, 0x58, 0x15, 0x0c, 0x94, - 0xc5, 0x51, 0xca, 0x02, 0x03, 0x03, 0x74, 0x81, 0x81, 0x25, 0x23, 0x4b, 0xe4, 0x38, 0xae, 0x62, - 0xd1, 0xe4, 0x46, 0xbe, 0xc6, 0x82, 0xb7, 0xe0, 0xb1, 0x18, 0x3b, 0xc2, 0x86, 0x92, 0x17, 0x41, - 0x49, 0x28, 0x41, 0x62, 0x3c, 0xc7, 0xe7, 0x93, 0x7c, 0x3f, 0x7a, 0x22, 0x01, 0x73, 0xc0, 0x40, - 0x42, 0x81, 0xaa, 0xc0, 0x27, 0x0c, 0x5c, 0xd8, 0x07, 0x5e, 0x1a, 0xb0, 0xe0, 0x1d, 0x74, 0x23, - 0xde, 0xf7, 0x2e, 0x3c, 0x9c, 0x48, 0xc8, 0x95, 0x4d, 0x96, 0x36, 0x10, 0x89, 0xd4, 0x0d, 0x66, - 0x5f, 0x4a, 0xf5, 0x8d, 0x1c, 0x7f, 0x10, 0xba, 0xb3, 0x68, 0x06, 0x77, 0xc5, 0x12, 0xbc, 0x4b, - 0xba, 0xad, 0x9c, 0x4e, 0x55, 0x21, 0x95, 0x4f, 0xa6, 0xc3, 0xd9, 0x68, 0x7e, 0xc4, 0x37, 0x38, - 0x6f, 0x70, 0xee, 0x42, 0x7e, 0xaf, 0x31, 0x51, 0x99, 0x70, 0x1a, 0x4c, 0xf4, 0x33, 0xf7, 0x4e, - 0xe9, 0xd8, 0x89, 0x95, 0x4e, 0x85, 0x05, 0x83, 0x71, 0x26, 0x30, 0xf3, 0xff, 0x4d, 0xc9, 0x6c, - 0x37, 0xda, 0xeb, 0xeb, 0x5b, 0x81, 0x99, 0x77, 0x46, 0xf7, 0x4b, 0x03, 0x25, 0xa0, 0x32, 0xb1, - 0x48, 0x53, 0xa3, 0x10, 0xfd, 0x61, 0xbb, 0x1c, 0x6f, 0xfa, 0xeb, 0xae, 0xf6, 0xae, 0xe8, 0x68, - 0x25, 0xd0, 0xc6, 0x12, 0xf2, 0x5c, 0x5b, 0xff, 0xff, 0x94, 0xcc, 0x46, 0xf3, 0xc9, 0xdf, 0x1f, - 0x2d, 0xda, 0xf7, 0xe6, 0x82, 0x88, 0x36, 0x40, 0x97, 0x6f, 0x2e, 0xde, 0x2a, 0x46, 0xd6, 0x15, - 0x23, 0x9f, 0x15, 0x23, 0xaf, 0x35, 0x1b, 0xac, 0x6b, 0x36, 0x78, 0xaf, 0xd9, 0xe0, 0x81, 0x75, - 0xa2, 0x30, 0x7d, 0xe4, 0x1a, 0x82, 0xe7, 0x5f, 0x56, 0x5b, 0x37, 0xc9, 0x56, 0x2b, 0xe7, 0xfc, - 0x2b, 0x00, 0x00, 0xff, 0xff, 0x7c, 0x63, 0x02, 0x4f, 0x76, 0x01, 0x00, 0x00, -} - -func (m *CometInfo) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CometInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CometInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.LastCommit != nil { - { - size, err := m.LastCommit.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintConsensus(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if len(m.ProposerAddress) > 0 { - i -= len(m.ProposerAddress) - copy(dAtA[i:], m.ProposerAddress) - i = encodeVarintConsensus(dAtA, i, uint64(len(m.ProposerAddress))) - i-- - dAtA[i] = 0x1a - } - if len(m.ValidatorsHash) > 0 { - i -= len(m.ValidatorsHash) - copy(dAtA[i:], m.ValidatorsHash) - i = encodeVarintConsensus(dAtA, i, uint64(len(m.ValidatorsHash))) - i-- - dAtA[i] = 0x12 - } - if len(m.Evidence) > 0 { - for iNdEx := len(m.Evidence) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Evidence[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintConsensus(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func encodeVarintConsensus(dAtA []byte, offset int, v uint64) int { - offset -= sovConsensus(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *CometInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Evidence) > 0 { - for _, e := range m.Evidence { - l = e.Size() - n += 1 + l + sovConsensus(uint64(l)) - } - } - l = len(m.ValidatorsHash) - if l > 0 { - n += 1 + l + sovConsensus(uint64(l)) - } - l = len(m.ProposerAddress) - if l > 0 { - n += 1 + l + sovConsensus(uint64(l)) - } - if m.LastCommit != nil { - l = m.LastCommit.Size() - n += 1 + l + sovConsensus(uint64(l)) - } - return n -} - -func sovConsensus(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozConsensus(x uint64) (n int) { - return sovConsensus(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *CometInfo) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConsensus - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CometInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CometInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Evidence", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConsensus - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthConsensus - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthConsensus - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Evidence = append(m.Evidence, &v1.Misbehavior{}) - if err := m.Evidence[len(m.Evidence)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorsHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConsensus - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthConsensus - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthConsensus - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ValidatorsHash = append(m.ValidatorsHash[:0], dAtA[iNdEx:postIndex]...) - if m.ValidatorsHash == nil { - m.ValidatorsHash = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposerAddress", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConsensus - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthConsensus - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthConsensus - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProposerAddress = append(m.ProposerAddress[:0], dAtA[iNdEx:postIndex]...) - if m.ProposerAddress == nil { - m.ProposerAddress = []byte{} - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastCommit", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConsensus - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthConsensus - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthConsensus - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.LastCommit == nil { - m.LastCommit = &v1.CommitInfo{} - } - if err := m.LastCommit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipConsensus(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthConsensus - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipConsensus(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowConsensus - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowConsensus - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowConsensus - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthConsensus - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupConsensus - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthConsensus - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthConsensus = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowConsensus = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupConsensus = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/consensus/types/msgs.go b/x/consensus/types/msgs.go index f6556cc28dbb..942d5ba2f4ec 100644 --- a/x/consensus/types/msgs.go +++ b/x/consensus/types/msgs.go @@ -16,7 +16,7 @@ func (msg MsgUpdateParams) ToProtoConsensusParams() (cmtproto.ConsensusParams, e return cmtproto.ConsensusParams{}, errors.New("all parameters must be present") } - if msg.Abci != nil && msg.Feature != nil && msg.Feature.VoteExtensionsEnableHeight != nil { + if msg.Feature != nil && msg.Feature.VoteExtensionsEnableHeight != nil { return cmtproto.ConsensusParams{}, errors.New("abci in sections Feature and (deprecated) ABCI cannot be used simultaneously") } @@ -38,14 +38,12 @@ func (msg MsgUpdateParams) ToProtoConsensusParams() (cmtproto.ConsensusParams, e Synchrony: msg.Synchrony, } - if msg.Abci != nil { - if cp.Feature == nil { - cp.Feature = &cmtproto.FeatureParams{} - } + if cp.Feature == nil { + cp.Feature = &cmtproto.FeatureParams{} + } - cp.Feature.VoteExtensionsEnableHeight = &types.Int64Value{ - Value: msg.Abci.VoteExtensionsEnableHeight, - } + cp.Feature.VoteExtensionsEnableHeight = &types.Int64Value{ + Value: msg.Abci.VoteExtensionsEnableHeight, } return cp, nil diff --git a/x/consensus/types/params.pb.go b/x/consensus/types/params.pb.go new file mode 100644 index 000000000000..f09697fa77eb --- /dev/null +++ b/x/consensus/types/params.pb.go @@ -0,0 +1,2301 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/consensus/v1/params.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" + _ "google.golang.org/protobuf/types/known/durationpb" + wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// ConsensusParams contains consensus critical parameters that determine the +// validity of blocks. +type ConsensusParams struct { + Block *BlockParams `protobuf:"bytes,1,opt,name=block,proto3" json:"block,omitempty"` + Evidence *EvidenceParams `protobuf:"bytes,2,opt,name=evidence,proto3" json:"evidence,omitempty"` + Validator *ValidatorParams `protobuf:"bytes,3,opt,name=validator,proto3" json:"validator,omitempty"` + Version *VersionParams `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"` + Synchrony *SynchronyParams `protobuf:"bytes,6,opt,name=synchrony,proto3" json:"synchrony,omitempty"` + Feature *FeatureParams `protobuf:"bytes,7,opt,name=feature,proto3" json:"feature,omitempty"` +} + +func (m *ConsensusParams) Reset() { *m = ConsensusParams{} } +func (m *ConsensusParams) String() string { return proto.CompactTextString(m) } +func (*ConsensusParams) ProtoMessage() {} +func (*ConsensusParams) Descriptor() ([]byte, []int) { + return fileDescriptor_4474bc02ecbe53d1, []int{0} +} +func (m *ConsensusParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConsensusParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ConsensusParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ConsensusParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConsensusParams.Merge(m, src) +} +func (m *ConsensusParams) XXX_Size() int { + return m.Size() +} +func (m *ConsensusParams) XXX_DiscardUnknown() { + xxx_messageInfo_ConsensusParams.DiscardUnknown(m) +} + +var xxx_messageInfo_ConsensusParams proto.InternalMessageInfo + +func (m *ConsensusParams) GetBlock() *BlockParams { + if m != nil { + return m.Block + } + return nil +} + +func (m *ConsensusParams) GetEvidence() *EvidenceParams { + if m != nil { + return m.Evidence + } + return nil +} + +func (m *ConsensusParams) GetValidator() *ValidatorParams { + if m != nil { + return m.Validator + } + return nil +} + +func (m *ConsensusParams) GetVersion() *VersionParams { + if m != nil { + return m.Version + } + return nil +} + +func (m *ConsensusParams) GetSynchrony() *SynchronyParams { + if m != nil { + return m.Synchrony + } + return nil +} + +func (m *ConsensusParams) GetFeature() *FeatureParams { + if m != nil { + return m.Feature + } + return nil +} + +// BlockParams define limits on the block size and gas. +type BlockParams struct { + // Maximum size of a block, in bytes. + // + // Must be greater or equal to -1 and cannot be greater than the hard-coded + // maximum block size, which is 100MB. + // + // If set to -1, the limit is the hard-coded maximum block size. + MaxBytes int64 `protobuf:"varint,1,opt,name=max_bytes,json=maxBytes,proto3" json:"max_bytes,omitempty"` + // Maximum gas wanted by transactions included in a block. + // + // Must be greater or equal to -1. If set to -1, no limit is enforced. + MaxGas int64 `protobuf:"varint,2,opt,name=max_gas,json=maxGas,proto3" json:"max_gas,omitempty"` +} + +func (m *BlockParams) Reset() { *m = BlockParams{} } +func (m *BlockParams) String() string { return proto.CompactTextString(m) } +func (*BlockParams) ProtoMessage() {} +func (*BlockParams) Descriptor() ([]byte, []int) { + return fileDescriptor_4474bc02ecbe53d1, []int{1} +} +func (m *BlockParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BlockParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BlockParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *BlockParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockParams.Merge(m, src) +} +func (m *BlockParams) XXX_Size() int { + return m.Size() +} +func (m *BlockParams) XXX_DiscardUnknown() { + xxx_messageInfo_BlockParams.DiscardUnknown(m) +} + +var xxx_messageInfo_BlockParams proto.InternalMessageInfo + +func (m *BlockParams) GetMaxBytes() int64 { + if m != nil { + return m.MaxBytes + } + return 0 +} + +func (m *BlockParams) GetMaxGas() int64 { + if m != nil { + return m.MaxGas + } + return 0 +} + +// EvidenceParams determine the validity of evidences of Byzantine behavior. +type EvidenceParams struct { + // Maximum age of evidence, in blocks. + // + // The recommended formula for calculating it is max_age_duration / {average + // block time}. + MaxAgeNumBlocks int64 `protobuf:"varint,1,opt,name=max_age_num_blocks,json=maxAgeNumBlocks,proto3" json:"max_age_num_blocks,omitempty"` + // Maximum age of evidence, in time. + // + // The recommended value of is should correspond to the application's + // "unbonding period" or other similar mechanism for handling + // Nothing-At-Stake attacks. + // See: + // https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed. + MaxAgeDuration time.Duration `protobuf:"bytes,2,opt,name=max_age_duration,json=maxAgeDuration,proto3,stdduration" json:"max_age_duration"` + // Maximum size in bytes of evidence allowed to be included in a block. + // + // It should fall comfortably under the maximum size of a block. + MaxBytes int64 `protobuf:"varint,3,opt,name=max_bytes,json=maxBytes,proto3" json:"max_bytes,omitempty"` +} + +func (m *EvidenceParams) Reset() { *m = EvidenceParams{} } +func (m *EvidenceParams) String() string { return proto.CompactTextString(m) } +func (*EvidenceParams) ProtoMessage() {} +func (*EvidenceParams) Descriptor() ([]byte, []int) { + return fileDescriptor_4474bc02ecbe53d1, []int{2} +} +func (m *EvidenceParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EvidenceParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EvidenceParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EvidenceParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_EvidenceParams.Merge(m, src) +} +func (m *EvidenceParams) XXX_Size() int { + return m.Size() +} +func (m *EvidenceParams) XXX_DiscardUnknown() { + xxx_messageInfo_EvidenceParams.DiscardUnknown(m) +} + +var xxx_messageInfo_EvidenceParams proto.InternalMessageInfo + +func (m *EvidenceParams) GetMaxAgeNumBlocks() int64 { + if m != nil { + return m.MaxAgeNumBlocks + } + return 0 +} + +func (m *EvidenceParams) GetMaxAgeDuration() time.Duration { + if m != nil { + return m.MaxAgeDuration + } + return 0 +} + +func (m *EvidenceParams) GetMaxBytes() int64 { + if m != nil { + return m.MaxBytes + } + return 0 +} + +// ValidatorParams restrict the public key types validators can use. +// +// NOTE: uses ABCI public keys naming, not Amino names. +type ValidatorParams struct { + PubKeyTypes []string `protobuf:"bytes,1,rep,name=pub_key_types,json=pubKeyTypes,proto3" json:"pub_key_types,omitempty"` +} + +func (m *ValidatorParams) Reset() { *m = ValidatorParams{} } +func (m *ValidatorParams) String() string { return proto.CompactTextString(m) } +func (*ValidatorParams) ProtoMessage() {} +func (*ValidatorParams) Descriptor() ([]byte, []int) { + return fileDescriptor_4474bc02ecbe53d1, []int{3} +} +func (m *ValidatorParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValidatorParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ValidatorParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ValidatorParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorParams.Merge(m, src) +} +func (m *ValidatorParams) XXX_Size() int { + return m.Size() +} +func (m *ValidatorParams) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorParams.DiscardUnknown(m) +} + +var xxx_messageInfo_ValidatorParams proto.InternalMessageInfo + +func (m *ValidatorParams) GetPubKeyTypes() []string { + if m != nil { + return m.PubKeyTypes + } + return nil +} + +// VersionParams contain the version of specific components of CometBFT. +type VersionParams struct { + // The ABCI application version. + // + // It was named app_version in CometBFT 0.34. + App uint64 `protobuf:"varint,1,opt,name=app,proto3" json:"app,omitempty"` +} + +func (m *VersionParams) Reset() { *m = VersionParams{} } +func (m *VersionParams) String() string { return proto.CompactTextString(m) } +func (*VersionParams) ProtoMessage() {} +func (*VersionParams) Descriptor() ([]byte, []int) { + return fileDescriptor_4474bc02ecbe53d1, []int{4} +} +func (m *VersionParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *VersionParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_VersionParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *VersionParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_VersionParams.Merge(m, src) +} +func (m *VersionParams) XXX_Size() int { + return m.Size() +} +func (m *VersionParams) XXX_DiscardUnknown() { + xxx_messageInfo_VersionParams.DiscardUnknown(m) +} + +var xxx_messageInfo_VersionParams proto.InternalMessageInfo + +func (m *VersionParams) GetApp() uint64 { + if m != nil { + return m.App + } + return 0 +} + +// HashedParams is a subset of ConsensusParams. +// +// It is hashed into the Header.ConsensusHash. +type HashedParams struct { + BlockMaxBytes int64 `protobuf:"varint,1,opt,name=block_max_bytes,json=blockMaxBytes,proto3" json:"block_max_bytes,omitempty"` + BlockMaxGas int64 `protobuf:"varint,2,opt,name=block_max_gas,json=blockMaxGas,proto3" json:"block_max_gas,omitempty"` +} + +func (m *HashedParams) Reset() { *m = HashedParams{} } +func (m *HashedParams) String() string { return proto.CompactTextString(m) } +func (*HashedParams) ProtoMessage() {} +func (*HashedParams) Descriptor() ([]byte, []int) { + return fileDescriptor_4474bc02ecbe53d1, []int{5} +} +func (m *HashedParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *HashedParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_HashedParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *HashedParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_HashedParams.Merge(m, src) +} +func (m *HashedParams) XXX_Size() int { + return m.Size() +} +func (m *HashedParams) XXX_DiscardUnknown() { + xxx_messageInfo_HashedParams.DiscardUnknown(m) +} + +var xxx_messageInfo_HashedParams proto.InternalMessageInfo + +func (m *HashedParams) GetBlockMaxBytes() int64 { + if m != nil { + return m.BlockMaxBytes + } + return 0 +} + +func (m *HashedParams) GetBlockMaxGas() int64 { + if m != nil { + return m.BlockMaxGas + } + return 0 +} + +// SynchronyParams determine the validity of block timestamps. +// +// These parameters are part of the Proposer-Based Timestamps (PBTS) algorithm. +// For more information on the relationship of the synchrony parameters to +// block timestamps validity, refer to the PBTS specification: +// https://github.com/tendermint/spec/blob/master/spec/consensus/proposer-based-timestamp/README.md +type SynchronyParams struct { + // Bound for how skewed a proposer's clock may be from any validator on the + // network while still producing valid proposals. + Precision *time.Duration `protobuf:"bytes,1,opt,name=precision,proto3,stdduration" json:"precision,omitempty"` + // Bound for how long a proposal message may take to reach all validators on + // a network and still be considered valid. + MessageDelay *time.Duration `protobuf:"bytes,2,opt,name=message_delay,json=messageDelay,proto3,stdduration" json:"message_delay,omitempty"` +} + +func (m *SynchronyParams) Reset() { *m = SynchronyParams{} } +func (m *SynchronyParams) String() string { return proto.CompactTextString(m) } +func (*SynchronyParams) ProtoMessage() {} +func (*SynchronyParams) Descriptor() ([]byte, []int) { + return fileDescriptor_4474bc02ecbe53d1, []int{6} +} +func (m *SynchronyParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SynchronyParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SynchronyParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SynchronyParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_SynchronyParams.Merge(m, src) +} +func (m *SynchronyParams) XXX_Size() int { + return m.Size() +} +func (m *SynchronyParams) XXX_DiscardUnknown() { + xxx_messageInfo_SynchronyParams.DiscardUnknown(m) +} + +var xxx_messageInfo_SynchronyParams proto.InternalMessageInfo + +func (m *SynchronyParams) GetPrecision() *time.Duration { + if m != nil { + return m.Precision + } + return nil +} + +func (m *SynchronyParams) GetMessageDelay() *time.Duration { + if m != nil { + return m.MessageDelay + } + return nil +} + +// FeatureParams configure the height from which features of CometBFT are enabled. +type FeatureParams struct { + // Height during which vote extensions will be enabled. + // + // A value of 0 means vote extensions are disabled. A value > 0 denotes + // the height at which vote extensions will be (or have been) enabled. + // + // During the specified height, and for all subsequent heights, precommit + // messages that do not contain valid extension data will be considered + // invalid. Prior to this height, or when this height is set to 0, vote + // extensions will not be used or accepted by validators on the network. + // + // Once enabled, vote extensions will be created by the application in + // ExtendVote, validated by the application in VerifyVoteExtension, and + // used by the application in PrepareProposal, when proposing the next block. + // + // Cannot be set to heights lower or equal to the current blockchain height. + VoteExtensionsEnableHeight *wrapperspb.Int64Value `protobuf:"bytes,1,opt,name=vote_extensions_enable_height,json=voteExtensionsEnableHeight,proto3" json:"vote_extensions_enable_height,omitempty"` + // Height at which Proposer-Based Timestamps (PBTS) will be enabled. + // + // A value of 0 means PBTS is disabled. A value > 0 denotes the height at + // which PBTS will be (or has been) enabled. + // + // From the specified height, and for all subsequent heights, the PBTS + // algorithm will be used to produce and validate block timestamps. Prior to + // this height, or when this height is set to 0, the legacy BFT Time + // algorithm is used to produce and validate timestamps. + // + // Cannot be set to heights lower or equal to the current blockchain height. + PbtsEnableHeight *wrapperspb.Int64Value `protobuf:"bytes,2,opt,name=pbts_enable_height,json=pbtsEnableHeight,proto3" json:"pbts_enable_height,omitempty"` +} + +func (m *FeatureParams) Reset() { *m = FeatureParams{} } +func (m *FeatureParams) String() string { return proto.CompactTextString(m) } +func (*FeatureParams) ProtoMessage() {} +func (*FeatureParams) Descriptor() ([]byte, []int) { + return fileDescriptor_4474bc02ecbe53d1, []int{7} +} +func (m *FeatureParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FeatureParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FeatureParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *FeatureParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_FeatureParams.Merge(m, src) +} +func (m *FeatureParams) XXX_Size() int { + return m.Size() +} +func (m *FeatureParams) XXX_DiscardUnknown() { + xxx_messageInfo_FeatureParams.DiscardUnknown(m) +} + +var xxx_messageInfo_FeatureParams proto.InternalMessageInfo + +func (m *FeatureParams) GetVoteExtensionsEnableHeight() *wrapperspb.Int64Value { + if m != nil { + return m.VoteExtensionsEnableHeight + } + return nil +} + +func (m *FeatureParams) GetPbtsEnableHeight() *wrapperspb.Int64Value { + if m != nil { + return m.PbtsEnableHeight + } + return nil +} + +func init() { + proto.RegisterType((*ConsensusParams)(nil), "cosmos.consensus.v1.ConsensusParams") + proto.RegisterType((*BlockParams)(nil), "cosmos.consensus.v1.BlockParams") + proto.RegisterType((*EvidenceParams)(nil), "cosmos.consensus.v1.EvidenceParams") + proto.RegisterType((*ValidatorParams)(nil), "cosmos.consensus.v1.ValidatorParams") + proto.RegisterType((*VersionParams)(nil), "cosmos.consensus.v1.VersionParams") + proto.RegisterType((*HashedParams)(nil), "cosmos.consensus.v1.HashedParams") + proto.RegisterType((*SynchronyParams)(nil), "cosmos.consensus.v1.SynchronyParams") + proto.RegisterType((*FeatureParams)(nil), "cosmos.consensus.v1.FeatureParams") +} + +func init() { proto.RegisterFile("cosmos/consensus/v1/params.proto", fileDescriptor_4474bc02ecbe53d1) } + +var fileDescriptor_4474bc02ecbe53d1 = []byte{ + // 678 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0x4d, 0x6f, 0xd3, 0x40, + 0x10, 0xcd, 0xd6, 0xa1, 0x4d, 0x36, 0x4d, 0x13, 0x2d, 0x48, 0x84, 0x56, 0x38, 0x95, 0x41, 0xa8, + 0x52, 0x25, 0x5b, 0x05, 0x54, 0x21, 0x04, 0xaa, 0x08, 0x2d, 0x6d, 0x41, 0x05, 0x64, 0x50, 0x0f, + 0xbd, 0x58, 0xeb, 0x64, 0xeb, 0x58, 0x8d, 0xbd, 0x96, 0xd7, 0x0e, 0xf6, 0x9f, 0x40, 0x9c, 0x10, + 0xc7, 0x5e, 0xf9, 0x07, 0xfc, 0x02, 0xd4, 0x63, 0x8f, 0x9c, 0x0a, 0x6a, 0x2f, 0xfc, 0x0c, 0xb4, + 0x6b, 0x6f, 0xbe, 0x08, 0x2d, 0x37, 0xdb, 0xf3, 0xde, 0x9b, 0x37, 0x6f, 0x26, 0x81, 0xcb, 0x6d, + 0xca, 0x3c, 0xca, 0x8c, 0x36, 0xf5, 0x19, 0xf1, 0x59, 0xcc, 0x8c, 0xfe, 0x9a, 0x11, 0xe0, 0x10, + 0x7b, 0x4c, 0x0f, 0x42, 0x1a, 0x51, 0x74, 0x3d, 0x43, 0xe8, 0x03, 0x84, 0xde, 0x5f, 0x5b, 0xbc, + 0xe1, 0x50, 0x87, 0x8a, 0xba, 0xc1, 0x9f, 0x32, 0xe8, 0xa2, 0xea, 0x50, 0xea, 0xf4, 0x88, 0x21, + 0xde, 0xec, 0xf8, 0xd0, 0xe8, 0xc4, 0x21, 0x8e, 0x5c, 0xea, 0xff, 0xab, 0xfe, 0x21, 0xc4, 0x41, + 0x40, 0xc2, 0xbc, 0x95, 0xf6, 0x51, 0x81, 0xb5, 0xe7, 0xb2, 0xcd, 0x5b, 0x61, 0x02, 0xad, 0xc3, + 0x6b, 0x76, 0x8f, 0xb6, 0x8f, 0x1a, 0x60, 0x19, 0xac, 0x54, 0xee, 0x2f, 0xeb, 0x53, 0xec, 0xe8, + 0x2d, 0x8e, 0xc8, 0x08, 0x66, 0x06, 0x47, 0x1b, 0xb0, 0x44, 0xfa, 0x6e, 0x87, 0xf8, 0x6d, 0xd2, + 0x98, 0x11, 0xd4, 0x3b, 0x53, 0xa9, 0x5b, 0x39, 0x28, 0x67, 0x0f, 0x48, 0xa8, 0x05, 0xcb, 0x7d, + 0xdc, 0x73, 0x3b, 0x38, 0xa2, 0x61, 0x43, 0x11, 0x0a, 0x77, 0xa7, 0x2a, 0xec, 0x4b, 0x54, 0x2e, + 0x31, 0xa4, 0xa1, 0x27, 0x70, 0xae, 0x4f, 0x42, 0xe6, 0x52, 0xbf, 0x51, 0x14, 0x0a, 0xda, 0x74, + 0x85, 0x0c, 0x93, 0xf3, 0x25, 0x85, 0x3b, 0x60, 0xa9, 0xdf, 0xee, 0x86, 0xd4, 0x4f, 0x1b, 0xb3, + 0x97, 0x38, 0x78, 0x27, 0x51, 0xd2, 0xc1, 0x80, 0xc6, 0x1d, 0x1c, 0x12, 0x1c, 0xc5, 0x21, 0x69, + 0xcc, 0x5d, 0xe2, 0xe0, 0x45, 0x86, 0x91, 0x0e, 0x72, 0x8a, 0xb6, 0x0b, 0x2b, 0x23, 0xd1, 0xa2, + 0x25, 0x58, 0xf6, 0x70, 0x62, 0xd9, 0x69, 0x44, 0x98, 0xd8, 0x87, 0x62, 0x96, 0x3c, 0x9c, 0xb4, + 0xf8, 0x3b, 0xba, 0x09, 0xe7, 0x78, 0xd1, 0xc1, 0x4c, 0xe4, 0xad, 0x98, 0xb3, 0x1e, 0x4e, 0xb6, + 0x31, 0x7b, 0x59, 0x2c, 0x29, 0xf5, 0xa2, 0xf6, 0x15, 0xc0, 0x85, 0xf1, 0xac, 0xd1, 0x2a, 0x44, + 0x9c, 0x81, 0x1d, 0x62, 0xf9, 0xb1, 0x67, 0x89, 0xbd, 0x49, 0xdd, 0x9a, 0x87, 0x93, 0x67, 0x0e, + 0x79, 0x1d, 0x7b, 0xc2, 0x00, 0x43, 0x7b, 0xb0, 0x2e, 0xc1, 0xf2, 0xaa, 0xf2, 0xbd, 0xde, 0xd2, + 0xb3, 0xb3, 0xd2, 0xe5, 0x59, 0xe9, 0x9b, 0x39, 0xa0, 0x55, 0x3a, 0x39, 0x6b, 0x16, 0xbe, 0xfc, + 0x6c, 0x02, 0x73, 0x21, 0xd3, 0x93, 0x95, 0xf1, 0x51, 0x94, 0xf1, 0x51, 0xb4, 0x0d, 0x58, 0x9b, + 0x58, 0x2a, 0xd2, 0x60, 0x35, 0x88, 0x6d, 0xeb, 0x88, 0xa4, 0x56, 0x94, 0x06, 0x62, 0x7c, 0x65, + 0xa5, 0x6c, 0x56, 0x82, 0xd8, 0x7e, 0x45, 0xd2, 0xf7, 0xfc, 0xd3, 0xe3, 0xd2, 0xb7, 0xe3, 0x26, + 0xf8, 0x7d, 0xdc, 0x04, 0xda, 0x2a, 0xac, 0x8e, 0xed, 0x14, 0xd5, 0xa1, 0x82, 0x83, 0x40, 0xcc, + 0x56, 0x34, 0xf9, 0xe3, 0x08, 0xf8, 0x00, 0xce, 0xef, 0x60, 0xd6, 0x25, 0x9d, 0x1c, 0x7b, 0x0f, + 0xd6, 0x44, 0x14, 0xd6, 0x64, 0xd6, 0x55, 0xf1, 0x79, 0x4f, 0x06, 0xae, 0xc1, 0xea, 0x10, 0x37, + 0x8c, 0xbd, 0x22, 0x51, 0xdb, 0x98, 0x69, 0x9f, 0x01, 0xac, 0x4d, 0x5c, 0x07, 0x7a, 0x0a, 0xcb, + 0x41, 0x48, 0xda, 0xae, 0x38, 0x4b, 0x70, 0x55, 0x84, 0x45, 0x11, 0xdf, 0x90, 0x81, 0x36, 0x61, + 0xd5, 0x23, 0x8c, 0x89, 0x45, 0x90, 0x1e, 0x4e, 0xaf, 0xde, 0x42, 0x26, 0x31, 0x9f, 0xb3, 0x36, + 0x39, 0x49, 0xfb, 0x0e, 0x60, 0x75, 0xec, 0xe8, 0x50, 0x07, 0xde, 0xee, 0xd3, 0x88, 0x58, 0x24, + 0x89, 0x88, 0xcf, 0x3b, 0x31, 0x8b, 0xf8, 0xd8, 0xee, 0x11, 0xab, 0x4b, 0x5c, 0xa7, 0x1b, 0xe5, + 0x56, 0x97, 0xfe, 0xea, 0xb3, 0xeb, 0x47, 0xeb, 0x0f, 0xf7, 0x71, 0x2f, 0x26, 0xad, 0xe2, 0xc9, + 0x59, 0x13, 0x98, 0x8b, 0x5c, 0x67, 0x6b, 0x20, 0xb3, 0x25, 0x54, 0x76, 0x84, 0x08, 0x7a, 0x03, + 0x51, 0x60, 0x47, 0x93, 0xd2, 0x33, 0xff, 0x2b, 0x5d, 0xe7, 0xe4, 0x51, 0xc1, 0xd6, 0xa3, 0x93, + 0x73, 0x15, 0x9c, 0x9e, 0xab, 0xe0, 0xd7, 0xb9, 0x0a, 0x3e, 0x5d, 0xa8, 0x85, 0xd3, 0x0b, 0xb5, + 0xf0, 0xe3, 0x42, 0x2d, 0x1c, 0xa8, 0xd9, 0x0f, 0x8d, 0x75, 0x8e, 0x74, 0x97, 0x1a, 0xc9, 0xc8, + 0x5f, 0xac, 0xb8, 0x20, 0x7b, 0x56, 0xb4, 0x79, 0xf0, 0x27, 0x00, 0x00, 0xff, 0xff, 0x61, 0x99, + 0x84, 0x9f, 0x83, 0x05, 0x00, 0x00, +} + +func (this *ValidatorParams) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*ValidatorParams) + if !ok { + that2, ok := that.(ValidatorParams) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if len(this.PubKeyTypes) != len(that1.PubKeyTypes) { + return false + } + for i := range this.PubKeyTypes { + if this.PubKeyTypes[i] != that1.PubKeyTypes[i] { + return false + } + } + return true +} +func (this *VersionParams) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*VersionParams) + if !ok { + that2, ok := that.(VersionParams) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.App != that1.App { + return false + } + return true +} +func (m *ConsensusParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ConsensusParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConsensusParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Feature != nil { + { + size, err := m.Feature.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + if m.Synchrony != nil { + { + size, err := m.Synchrony.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.Version != nil { + { + size, err := m.Version.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Validator != nil { + { + size, err := m.Validator.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Evidence != nil { + { + size, err := m.Evidence.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Block != nil { + { + size, err := m.Block.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BlockParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BlockParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BlockParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.MaxGas != 0 { + i = encodeVarintParams(dAtA, i, uint64(m.MaxGas)) + i-- + dAtA[i] = 0x10 + } + if m.MaxBytes != 0 { + i = encodeVarintParams(dAtA, i, uint64(m.MaxBytes)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *EvidenceParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EvidenceParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EvidenceParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.MaxBytes != 0 { + i = encodeVarintParams(dAtA, i, uint64(m.MaxBytes)) + i-- + dAtA[i] = 0x18 + } + n7, err7 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.MaxAgeDuration, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.MaxAgeDuration):]) + if err7 != nil { + return 0, err7 + } + i -= n7 + i = encodeVarintParams(dAtA, i, uint64(n7)) + i-- + dAtA[i] = 0x12 + if m.MaxAgeNumBlocks != 0 { + i = encodeVarintParams(dAtA, i, uint64(m.MaxAgeNumBlocks)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ValidatorParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ValidatorParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValidatorParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.PubKeyTypes) > 0 { + for iNdEx := len(m.PubKeyTypes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.PubKeyTypes[iNdEx]) + copy(dAtA[i:], m.PubKeyTypes[iNdEx]) + i = encodeVarintParams(dAtA, i, uint64(len(m.PubKeyTypes[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *VersionParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *VersionParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VersionParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.App != 0 { + i = encodeVarintParams(dAtA, i, uint64(m.App)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *HashedParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HashedParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HashedParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.BlockMaxGas != 0 { + i = encodeVarintParams(dAtA, i, uint64(m.BlockMaxGas)) + i-- + dAtA[i] = 0x10 + } + if m.BlockMaxBytes != 0 { + i = encodeVarintParams(dAtA, i, uint64(m.BlockMaxBytes)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *SynchronyParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SynchronyParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SynchronyParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.MessageDelay != nil { + n8, err8 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(*m.MessageDelay, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.MessageDelay):]) + if err8 != nil { + return 0, err8 + } + i -= n8 + i = encodeVarintParams(dAtA, i, uint64(n8)) + i-- + dAtA[i] = 0x12 + } + if m.Precision != nil { + n9, err9 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(*m.Precision, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.Precision):]) + if err9 != nil { + return 0, err9 + } + i -= n9 + i = encodeVarintParams(dAtA, i, uint64(n9)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *FeatureParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *FeatureParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FeatureParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.PbtsEnableHeight != nil { + { + size, err := m.PbtsEnableHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.VoteExtensionsEnableHeight != nil { + { + size, err := m.VoteExtensionsEnableHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintParams(dAtA []byte, offset int, v uint64) int { + offset -= sovParams(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func NewPopulatedValidatorParams(r randyParams, easy bool) *ValidatorParams { + this := &ValidatorParams{} + v1 := r.Intn(10) + this.PubKeyTypes = make([]string, v1) + for i := 0; i < v1; i++ { + this.PubKeyTypes[i] = string(randStringParams(r)) + } + if !easy && r.Intn(10) != 0 { + } + return this +} + +func NewPopulatedVersionParams(r randyParams, easy bool) *VersionParams { + this := &VersionParams{} + this.App = uint64(uint64(r.Uint32())) + if !easy && r.Intn(10) != 0 { + } + return this +} + +type randyParams interface { + Float32() float32 + Float64() float64 + Int63() int64 + Int31() int32 + Uint32() uint32 + Intn(n int) int +} + +func randUTF8RuneParams(r randyParams) rune { + ru := r.Intn(62) + if ru < 10 { + return rune(ru + 48) + } else if ru < 36 { + return rune(ru + 55) + } + return rune(ru + 61) +} +func randStringParams(r randyParams) string { + v2 := r.Intn(100) + tmps := make([]rune, v2) + for i := 0; i < v2; i++ { + tmps[i] = randUTF8RuneParams(r) + } + return string(tmps) +} +func randUnrecognizedParams(r randyParams, maxFieldNumber int) (dAtA []byte) { + l := r.Intn(5) + for i := 0; i < l; i++ { + wire := r.Intn(4) + if wire == 3 { + wire = 5 + } + fieldNumber := maxFieldNumber + r.Intn(100) + dAtA = randFieldParams(dAtA, r, fieldNumber, wire) + } + return dAtA +} +func randFieldParams(dAtA []byte, r randyParams, fieldNumber int, wire int) []byte { + key := uint32(fieldNumber)<<3 | uint32(wire) + switch wire { + case 0: + dAtA = encodeVarintPopulateParams(dAtA, uint64(key)) + v3 := r.Int63() + if r.Intn(2) == 0 { + v3 *= -1 + } + dAtA = encodeVarintPopulateParams(dAtA, uint64(v3)) + case 1: + dAtA = encodeVarintPopulateParams(dAtA, uint64(key)) + dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) + case 2: + dAtA = encodeVarintPopulateParams(dAtA, uint64(key)) + ll := r.Intn(100) + dAtA = encodeVarintPopulateParams(dAtA, uint64(ll)) + for j := 0; j < ll; j++ { + dAtA = append(dAtA, byte(r.Intn(256))) + } + default: + dAtA = encodeVarintPopulateParams(dAtA, uint64(key)) + dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) + } + return dAtA +} +func encodeVarintPopulateParams(dAtA []byte, v uint64) []byte { + for v >= 1<<7 { + dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80)) + v >>= 7 + } + dAtA = append(dAtA, uint8(v)) + return dAtA +} +func (m *ConsensusParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Block != nil { + l = m.Block.Size() + n += 1 + l + sovParams(uint64(l)) + } + if m.Evidence != nil { + l = m.Evidence.Size() + n += 1 + l + sovParams(uint64(l)) + } + if m.Validator != nil { + l = m.Validator.Size() + n += 1 + l + sovParams(uint64(l)) + } + if m.Version != nil { + l = m.Version.Size() + n += 1 + l + sovParams(uint64(l)) + } + if m.Synchrony != nil { + l = m.Synchrony.Size() + n += 1 + l + sovParams(uint64(l)) + } + if m.Feature != nil { + l = m.Feature.Size() + n += 1 + l + sovParams(uint64(l)) + } + return n +} + +func (m *BlockParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.MaxBytes != 0 { + n += 1 + sovParams(uint64(m.MaxBytes)) + } + if m.MaxGas != 0 { + n += 1 + sovParams(uint64(m.MaxGas)) + } + return n +} + +func (m *EvidenceParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.MaxAgeNumBlocks != 0 { + n += 1 + sovParams(uint64(m.MaxAgeNumBlocks)) + } + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.MaxAgeDuration) + n += 1 + l + sovParams(uint64(l)) + if m.MaxBytes != 0 { + n += 1 + sovParams(uint64(m.MaxBytes)) + } + return n +} + +func (m *ValidatorParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.PubKeyTypes) > 0 { + for _, s := range m.PubKeyTypes { + l = len(s) + n += 1 + l + sovParams(uint64(l)) + } + } + return n +} + +func (m *VersionParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.App != 0 { + n += 1 + sovParams(uint64(m.App)) + } + return n +} + +func (m *HashedParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlockMaxBytes != 0 { + n += 1 + sovParams(uint64(m.BlockMaxBytes)) + } + if m.BlockMaxGas != 0 { + n += 1 + sovParams(uint64(m.BlockMaxGas)) + } + return n +} + +func (m *SynchronyParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Precision != nil { + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.Precision) + n += 1 + l + sovParams(uint64(l)) + } + if m.MessageDelay != nil { + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.MessageDelay) + n += 1 + l + sovParams(uint64(l)) + } + return n +} + +func (m *FeatureParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.VoteExtensionsEnableHeight != nil { + l = m.VoteExtensionsEnableHeight.Size() + n += 1 + l + sovParams(uint64(l)) + } + if m.PbtsEnableHeight != nil { + l = m.PbtsEnableHeight.Size() + n += 1 + l + sovParams(uint64(l)) + } + return n +} + +func sovParams(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozParams(x uint64) (n int) { + return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *ConsensusParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ConsensusParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConsensusParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Block == nil { + m.Block = &BlockParams{} + } + if err := m.Block.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Evidence", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Evidence == nil { + m.Evidence = &EvidenceParams{} + } + if err := m.Evidence.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Validator", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Validator == nil { + m.Validator = &ValidatorParams{} + } + if err := m.Validator.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Version == nil { + m.Version = &VersionParams{} + } + if err := m.Version.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Synchrony", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Synchrony == nil { + m.Synchrony = &SynchronyParams{} + } + if err := m.Synchrony.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Feature", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Feature == nil { + m.Feature = &FeatureParams{} + } + if err := m.Feature.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BlockParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BlockParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BlockParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxBytes", wireType) + } + m.MaxBytes = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxBytes |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxGas", wireType) + } + m.MaxGas = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxGas |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EvidenceParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EvidenceParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EvidenceParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxAgeNumBlocks", wireType) + } + m.MaxAgeNumBlocks = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxAgeNumBlocks |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxAgeDuration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.MaxAgeDuration, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxBytes", wireType) + } + m.MaxBytes = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxBytes |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ValidatorParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ValidatorParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ValidatorParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PubKeyTypes", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + 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 ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PubKeyTypes = append(m.PubKeyTypes, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *VersionParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: VersionParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VersionParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field App", wireType) + } + m.App = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.App |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *HashedParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: HashedParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HashedParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockMaxBytes", wireType) + } + m.BlockMaxBytes = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlockMaxBytes |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockMaxGas", wireType) + } + m.BlockMaxGas = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlockMaxGas |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SynchronyParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SynchronyParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SynchronyParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Precision", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Precision == nil { + m.Precision = new(time.Duration) + } + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(m.Precision, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MessageDelay", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MessageDelay == nil { + m.MessageDelay = new(time.Duration) + } + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(m.MessageDelay, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FeatureParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FeatureParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FeatureParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VoteExtensionsEnableHeight", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.VoteExtensionsEnableHeight == nil { + m.VoteExtensionsEnableHeight = &wrapperspb.Int64Value{} + } + if err := m.VoteExtensionsEnableHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PbtsEnableHeight", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PbtsEnableHeight == nil { + m.PbtsEnableHeight = &wrapperspb.Int64Value{} + } + if err := m.PbtsEnableHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipParams(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthParams + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupParams + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthParams + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/consensus/types/query.pb.go b/x/consensus/types/query.pb.go index 8c344063a082..7ca6a7774024 100644 --- a/x/consensus/types/query.pb.go +++ b/x/consensus/types/query.pb.go @@ -6,7 +6,6 @@ package types import ( context "context" fmt "fmt" - v1 "github.com/cometbft/cometbft/api/cometbft/types/v1" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -71,7 +70,7 @@ type QueryParamsResponse struct { // params are the tendermint consensus params stored in the consensus module. // Please note that `params.version` is not populated in this response, it is // tracked separately in the x/upgrade module. - Params *v1.ConsensusParams `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` + Params *ConsensusParams `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` } func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } @@ -107,7 +106,7 @@ func (m *QueryParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo -func (m *QueryParamsResponse) GetParams() *v1.ConsensusParams { +func (m *QueryParamsResponse) GetParams() *ConsensusParams { if m != nil { return m.Params } @@ -122,24 +121,23 @@ func init() { func init() { proto.RegisterFile("cosmos/consensus/v1/query.proto", fileDescriptor_bf54d1e5df04cee9) } var fileDescriptor_bf54d1e5df04cee9 = []byte{ - // 271 bytes of a gzipped FileDescriptorProto + // 250 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4f, 0xce, 0x2f, 0xce, 0xcd, 0x2f, 0xd6, 0x4f, 0xce, 0xcf, 0x2b, 0x4e, 0xcd, 0x2b, 0x2e, 0x2d, 0xd6, 0x2f, 0x33, 0xd4, 0x2f, 0x2c, 0x4d, 0x2d, 0xaa, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x86, 0x28, 0xd0, 0x83, 0x2b, 0xd0, 0x2b, 0x33, 0x94, 0x92, 0x49, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, 0x4f, 0x2c, 0xc8, 0xd4, 0x4f, 0xcc, 0xcb, 0xcb, 0x2f, 0x49, 0x2c, 0xc9, 0xcc, 0xcf, 0x2b, 0x86, 0x68, 0x91, - 0x92, 0x4b, 0xce, 0xcf, 0x4d, 0x2d, 0x49, 0x4a, 0x2b, 0xd1, 0x2f, 0xa9, 0x2c, 0x48, 0x05, 0x9b, - 0x58, 0x90, 0x58, 0x94, 0x98, 0x0b, 0x95, 0x57, 0x12, 0xe1, 0x12, 0x0a, 0x04, 0xd9, 0x10, 0x00, - 0x16, 0x0c, 0x4a, 0x2d, 0x2c, 0x4d, 0x2d, 0x2e, 0x51, 0x0a, 0xe4, 0x12, 0x46, 0x11, 0x2d, 0x2e, - 0x00, 0xd9, 0x28, 0x64, 0xc5, 0xc5, 0x06, 0xd1, 0x2c, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x6d, 0xa4, - 0xa4, 0x07, 0x33, 0x5d, 0x0f, 0x6c, 0xba, 0x5e, 0x99, 0xa1, 0x9e, 0x33, 0xcc, 0x6d, 0x50, 0xbd, - 0x50, 0x1d, 0x46, 0x5d, 0x8c, 0x5c, 0xac, 0x60, 0x33, 0x85, 0x1a, 0x18, 0xb9, 0xd8, 0x20, 0x92, - 0x42, 0xea, 0x7a, 0x58, 0x7c, 0xa4, 0x87, 0xe9, 0x20, 0x29, 0x0d, 0xc2, 0x0a, 0x21, 0x6e, 0x54, - 0x52, 0x6e, 0xba, 0xfc, 0x64, 0x32, 0x93, 0xac, 0x90, 0xb4, 0x3e, 0xb6, 0xd0, 0x84, 0x38, 0xc6, - 0xc9, 0xe2, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, - 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0xe4, 0x20, 0xba, 0x8a, - 0x53, 0xb2, 0xf5, 0x32, 0xf3, 0xf5, 0x2b, 0x90, 0x74, 0x83, 0x7d, 0x98, 0xc4, 0x06, 0x0e, 0x36, - 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x63, 0xcb, 0xf0, 0x2b, 0xac, 0x01, 0x00, 0x00, + 0x52, 0xc0, 0x66, 0x66, 0x41, 0x62, 0x51, 0x62, 0x2e, 0x54, 0x85, 0x92, 0x08, 0x97, 0x50, 0x20, + 0xc8, 0x8e, 0x00, 0xb0, 0x60, 0x50, 0x6a, 0x61, 0x69, 0x6a, 0x71, 0x89, 0x52, 0x30, 0x97, 0x30, + 0x8a, 0x68, 0x71, 0x01, 0xc8, 0x00, 0x21, 0x1b, 0x2e, 0x36, 0x88, 0x66, 0x09, 0x46, 0x05, 0x46, + 0x0d, 0x6e, 0x23, 0x15, 0x3d, 0x2c, 0x4e, 0xd2, 0x73, 0x86, 0x71, 0xa0, 0xba, 0xa1, 0x7a, 0x8c, + 0xba, 0x18, 0xb9, 0x58, 0xc1, 0xa6, 0x0a, 0x35, 0x30, 0x72, 0xb1, 0x41, 0x24, 0x85, 0xd4, 0xb1, + 0x1a, 0x81, 0xe9, 0x24, 0x29, 0x0d, 0xc2, 0x0a, 0x21, 0xae, 0x54, 0x52, 0x6e, 0xba, 0xfc, 0x64, + 0x32, 0x93, 0xac, 0x90, 0xb4, 0x3e, 0x6e, 0xdf, 0x3b, 0x59, 0x9c, 0x78, 0x24, 0xc7, 0x78, 0xe1, + 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, + 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x1c, 0x44, 0x57, 0x71, 0x4a, 0xb6, 0x5e, 0x66, 0xbe, 0x7e, 0x05, + 0x92, 0xee, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0x70, 0xc0, 0x19, 0x03, 0x02, 0x00, 0x00, + 0xff, 0xff, 0x6d, 0x07, 0xe2, 0x57, 0xb0, 0x01, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -431,7 +429,7 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Params == nil { - m.Params = &v1.ConsensusParams{} + m.Params = &ConsensusParams{} } if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/x/consensus/types/tx.pb.go b/x/consensus/types/tx.pb.go index ee6f9cab31a0..b1c1c1467312 100644 --- a/x/consensus/types/tx.pb.go +++ b/x/consensus/types/tx.pb.go @@ -6,7 +6,6 @@ package types import ( context "context" fmt "fmt" - v1 "github.com/cometbft/cometbft/api/cometbft/types/v1" _ "github.com/cosmos/cosmos-proto" _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" @@ -40,12 +39,11 @@ type MsgUpdateParams struct { // separarately in x/upgrade. // // NOTE: All parameters must be supplied. - Block *v1.BlockParams `protobuf:"bytes,2,opt,name=block,proto3" json:"block,omitempty"` - Evidence *v1.EvidenceParams `protobuf:"bytes,3,opt,name=evidence,proto3" json:"evidence,omitempty"` - Validator *v1.ValidatorParams `protobuf:"bytes,4,opt,name=validator,proto3" json:"validator,omitempty"` - Abci *v1.ABCIParams `protobuf:"bytes,5,opt,name=abci,proto3" json:"abci,omitempty"` // Deprecated: Do not use. - Synchrony *v1.SynchronyParams `protobuf:"bytes,6,opt,name=synchrony,proto3" json:"synchrony,omitempty"` - Feature *v1.FeatureParams `protobuf:"bytes,7,opt,name=feature,proto3" json:"feature,omitempty"` + Block *BlockParams `protobuf:"bytes,2,opt,name=block,proto3" json:"block,omitempty"` + Evidence *EvidenceParams `protobuf:"bytes,3,opt,name=evidence,proto3" json:"evidence,omitempty"` + Validator *ValidatorParams `protobuf:"bytes,4,opt,name=validator,proto3" json:"validator,omitempty"` + Synchrony *SynchronyParams `protobuf:"bytes,6,opt,name=synchrony,proto3" json:"synchrony,omitempty"` + Feature *FeatureParams `protobuf:"bytes,7,opt,name=feature,proto3" json:"feature,omitempty"` } func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } @@ -88,43 +86,35 @@ func (m *MsgUpdateParams) GetAuthority() string { return "" } -func (m *MsgUpdateParams) GetBlock() *v1.BlockParams { +func (m *MsgUpdateParams) GetBlock() *BlockParams { if m != nil { return m.Block } return nil } -func (m *MsgUpdateParams) GetEvidence() *v1.EvidenceParams { +func (m *MsgUpdateParams) GetEvidence() *EvidenceParams { if m != nil { return m.Evidence } return nil } -func (m *MsgUpdateParams) GetValidator() *v1.ValidatorParams { +func (m *MsgUpdateParams) GetValidator() *ValidatorParams { if m != nil { return m.Validator } return nil } -// Deprecated: Do not use. -func (m *MsgUpdateParams) GetAbci() *v1.ABCIParams { - if m != nil { - return m.Abci - } - return nil -} - -func (m *MsgUpdateParams) GetSynchrony() *v1.SynchronyParams { +func (m *MsgUpdateParams) GetSynchrony() *SynchronyParams { if m != nil { return m.Synchrony } return nil } -func (m *MsgUpdateParams) GetFeature() *v1.FeatureParams { +func (m *MsgUpdateParams) GetFeature() *FeatureParams { if m != nil { return m.Feature } @@ -177,38 +167,36 @@ func init() { func init() { proto.RegisterFile("cosmos/consensus/v1/tx.proto", fileDescriptor_2135c60575ab504d) } var fileDescriptor_2135c60575ab504d = []byte{ - // 496 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0x4f, 0x8b, 0xd3, 0x40, - 0x18, 0xc6, 0x1b, 0xb7, 0xdd, 0xb5, 0xa3, 0xb0, 0x98, 0x2a, 0x3b, 0x5b, 0x74, 0xa8, 0x45, 0x64, - 0x29, 0x76, 0xb2, 0xad, 0xeb, 0x5f, 0x10, 0xdc, 0x88, 0xa2, 0x87, 0x45, 0xc9, 0xb2, 0x1e, 0xbc, - 0xc8, 0x34, 0x99, 0xcd, 0x86, 0x6e, 0x32, 0x21, 0x33, 0x8d, 0xdb, 0x9b, 0x08, 0x5e, 0x3c, 0xf9, - 0x45, 0x84, 0x1e, 0xf6, 0x43, 0x88, 0xa7, 0xc5, 0x93, 0x78, 0x92, 0xf6, 0xd0, 0xaf, 0x21, 0x9d, - 0x99, 0x6c, 0x6c, 0x8d, 0xb2, 0x97, 0x40, 0xf2, 0x3c, 0xbf, 0xe7, 0xc9, 0xbc, 0x79, 0x03, 0xae, - 0xba, 0x8c, 0x87, 0x8c, 0x5b, 0x2e, 0x8b, 0x38, 0x8d, 0xf8, 0x80, 0x5b, 0x69, 0xc7, 0x12, 0x47, - 0x38, 0x4e, 0x98, 0x60, 0x66, 0x4d, 0xa9, 0xf8, 0x54, 0xc5, 0x69, 0xa7, 0x7e, 0x89, 0x84, 0x41, - 0xc4, 0x2c, 0x79, 0x55, 0xbe, 0xfa, 0xba, 0xf2, 0xbd, 0x95, 0x77, 0x96, 0x86, 0x94, 0xb4, 0xa6, - 0x0b, 0x42, 0xee, 0xcf, 0xa2, 0x43, 0xee, 0x6b, 0x01, 0xb9, 0x2c, 0xa4, 0xa2, 0xb7, 0x2f, 0x2c, - 0x31, 0x8c, 0xa9, 0xec, 0x8d, 0x49, 0x42, 0x42, 0x0d, 0x36, 0xbf, 0x94, 0xc1, 0xea, 0x0e, 0xf7, - 0xf7, 0x62, 0x8f, 0x08, 0xfa, 0x4a, 0x2a, 0xe6, 0x5d, 0x50, 0x25, 0x03, 0x71, 0xc0, 0x92, 0x40, - 0x0c, 0xa1, 0xd1, 0x30, 0x36, 0xaa, 0x36, 0xfc, 0x7e, 0xdc, 0xbe, 0xac, 0x1b, 0xb7, 0x3d, 0x2f, - 0xa1, 0x9c, 0xef, 0x8a, 0x24, 0x88, 0x7c, 0x27, 0xb7, 0x9a, 0x5b, 0xa0, 0xd2, 0x3b, 0x64, 0x6e, - 0x1f, 0x9e, 0x6b, 0x18, 0x1b, 0x17, 0xba, 0x08, 0x67, 0xdd, 0x58, 0x76, 0xe3, 0xb4, 0x83, 0xed, - 0x99, 0xae, 0x6a, 0x1c, 0x65, 0x36, 0x1f, 0x81, 0xf3, 0x34, 0x0d, 0x3c, 0x1a, 0xb9, 0x14, 0x2e, - 0x49, 0xf0, 0x7a, 0x01, 0xf8, 0x54, 0x5b, 0x34, 0x7b, 0x8a, 0x98, 0x8f, 0x41, 0x35, 0x25, 0x87, - 0x81, 0x47, 0x04, 0x4b, 0x60, 0x59, 0xf2, 0xcd, 0x02, 0xfe, 0x75, 0xe6, 0xd1, 0x01, 0x39, 0x64, - 0x3e, 0x07, 0x65, 0xd2, 0x73, 0x03, 0x58, 0x91, 0xf0, 0xb5, 0x02, 0x78, 0xdb, 0x7e, 0xf2, 0x42, - 0x71, 0xf6, 0x95, 0x9f, 0xc7, 0xed, 0x55, 0x35, 0x88, 0x36, 0xf7, 0xfa, 0x8d, 0x4d, 0x7c, 0x67, - 0x13, 0x1a, 0x8e, 0x4c, 0x30, 0xf7, 0x40, 0x95, 0x0f, 0x23, 0xf7, 0x20, 0x61, 0xd1, 0x10, 0x2e, - 0xff, 0xf3, 0x5d, 0x76, 0x33, 0x8f, 0xce, 0xac, 0xfd, 0x9d, 0xd9, 0x75, 0xf2, 0x24, 0xf3, 0x25, - 0x58, 0xd9, 0xa7, 0x44, 0x0c, 0x12, 0x0a, 0x57, 0x64, 0x68, 0xa3, 0x20, 0xf4, 0x99, 0x72, 0xfc, - 0x2f, 0x32, 0x4b, 0x79, 0xf8, 0xe0, 0xc3, 0x74, 0xd4, 0xca, 0x3f, 0xdc, 0xa7, 0xe9, 0xa8, 0x75, - 0x33, 0x37, 0x5b, 0x47, 0x7f, 0xec, 0xe9, 0xc2, 0x6e, 0x34, 0xd7, 0xc1, 0xda, 0xc2, 0x23, 0x87, - 0xf2, 0x78, 0x66, 0xef, 0x7e, 0x34, 0xc0, 0xd2, 0x0e, 0xf7, 0xcd, 0x77, 0xe0, 0xe2, 0xdc, 0x3a, - 0xdd, 0xc0, 0x05, 0xfb, 0x8d, 0x17, 0x52, 0xea, 0xb7, 0xce, 0xe2, 0xca, 0xba, 0x9a, 0xb5, 0x6f, - 0x8b, 0xe7, 0xdb, 0xba, 0x57, 0xaf, 0xbc, 0x9f, 0x8e, 0x5a, 0x86, 0x7d, 0xff, 0xeb, 0x18, 0x19, - 0x27, 0x63, 0x64, 0xfc, 0x1a, 0x23, 0xe3, 0xf3, 0x04, 0x95, 0x4e, 0x26, 0xa8, 0xf4, 0x63, 0x82, - 0x4a, 0x6f, 0x90, 0x22, 0xb8, 0xd7, 0xc7, 0x01, 0x9b, 0x3b, 0xa6, 0x1c, 0x63, 0x6f, 0x59, 0xfe, - 0x13, 0xb7, 0x7f, 0x07, 0x00, 0x00, 0xff, 0xff, 0x3b, 0x57, 0xe6, 0xfa, 0xaf, 0x03, 0x00, 0x00, + // 449 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x49, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x4f, 0xce, 0xcf, 0x2b, 0x4e, 0xcd, 0x2b, 0x2e, 0x2d, 0xd6, 0x2f, 0x33, 0xd4, + 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x86, 0xc8, 0xea, 0xc1, 0x65, 0xf5, + 0xca, 0x0c, 0xa5, 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x9d, 0x94, 0x24, + 0x44, 0x5d, 0x3c, 0x98, 0xa7, 0x0f, 0xd5, 0x04, 0x91, 0x12, 0x87, 0x5a, 0x90, 0x5b, 0x9c, 0x0e, + 0x32, 0x3a, 0xb7, 0x38, 0x1d, 0x2a, 0xa1, 0x80, 0xcd, 0xe6, 0x82, 0xc4, 0xa2, 0xc4, 0x5c, 0xa8, + 0x56, 0xa5, 0xb7, 0xcc, 0x5c, 0xfc, 0xbe, 0xc5, 0xe9, 0xa1, 0x05, 0x29, 0x89, 0x25, 0xa9, 0x01, + 0x60, 0x19, 0x21, 0x33, 0x2e, 0xce, 0xc4, 0xd2, 0x92, 0x8c, 0xfc, 0xa2, 0xcc, 0x92, 0x4a, 0x09, + 0x46, 0x05, 0x46, 0x0d, 0x4e, 0x27, 0x89, 0x4b, 0x5b, 0x74, 0x45, 0xa0, 0x76, 0x3a, 0xa6, 0xa4, + 0x14, 0xa5, 0x16, 0x17, 0x07, 0x97, 0x14, 0x65, 0xe6, 0xa5, 0x07, 0x21, 0x94, 0x0a, 0x99, 0x71, + 0xb1, 0x26, 0xe5, 0xe4, 0x27, 0x67, 0x4b, 0x30, 0x29, 0x30, 0x6a, 0x70, 0x1b, 0x29, 0xe8, 0x61, + 0xf1, 0x99, 0x9e, 0x13, 0x48, 0x05, 0xc4, 0xa2, 0x20, 0x88, 0x72, 0x21, 0x7b, 0x2e, 0x8e, 0xd4, + 0xb2, 0xcc, 0x94, 0xd4, 0xbc, 0xe4, 0x54, 0x09, 0x66, 0xb0, 0x56, 0x65, 0xac, 0x5a, 0x5d, 0xa1, + 0x8a, 0xa0, 0xba, 0xe1, 0x9a, 0x84, 0x9c, 0xb8, 0x38, 0xcb, 0x12, 0x73, 0x32, 0x53, 0x12, 0x4b, + 0xf2, 0x8b, 0x24, 0x58, 0xc0, 0x26, 0xa8, 0x60, 0x35, 0x21, 0x0c, 0xa6, 0x0a, 0x6a, 0x04, 0x42, + 0x9b, 0x50, 0x38, 0x17, 0x67, 0x71, 0x65, 0x5e, 0x72, 0x46, 0x51, 0x7e, 0x5e, 0xa5, 0x04, 0x1b, + 0x1e, 0x33, 0x82, 0x61, 0xaa, 0x20, 0x66, 0x38, 0x09, 0xdf, 0xda, 0xa2, 0xcb, 0x0f, 0x51, 0xa8, + 0x5b, 0x9c, 0x92, 0xad, 0x60, 0xa0, 0x67, 0x6a, 0x14, 0x84, 0x30, 0x4b, 0x28, 0x90, 0x8b, 0x3d, + 0x2d, 0x35, 0xb1, 0xa4, 0xb4, 0x28, 0x55, 0x82, 0x1d, 0x6c, 0xac, 0x12, 0x56, 0x63, 0xdd, 0x20, + 0x6a, 0xf0, 0x19, 0x0a, 0x33, 0xc7, 0xca, 0xb2, 0xe9, 0xf9, 0x06, 0x2d, 0x44, 0xc0, 0x77, 0x3d, + 0xdf, 0xa0, 0xa5, 0x86, 0x50, 0xac, 0x5f, 0x81, 0x14, 0xdf, 0x68, 0x71, 0xab, 0x24, 0xc9, 0x25, + 0x8e, 0x26, 0x14, 0x94, 0x5a, 0x5c, 0x00, 0x52, 0x6e, 0xd4, 0xca, 0xc8, 0xc5, 0xec, 0x5b, 0x9c, + 0x2e, 0x54, 0xce, 0xc5, 0x83, 0x92, 0x1c, 0xb0, 0x07, 0x03, 0x9a, 0x29, 0x52, 0x3a, 0xc4, 0xa8, + 0x82, 0xd9, 0xa5, 0x24, 0x7c, 0x0a, 0xdd, 0x7f, 0x26, 0xe6, 0x52, 0xac, 0x0d, 0xcf, 0x37, 0x68, + 0x31, 0x3a, 0x59, 0x9c, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, + 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x1c, 0x44, + 0x47, 0x71, 0x4a, 0xb6, 0x5e, 0x66, 0x3e, 0x8a, 0x37, 0x4b, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, + 0xc0, 0x69, 0xda, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x2d, 0x29, 0xd1, 0x50, 0x71, 0x03, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -340,18 +328,6 @@ func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x32 } - if m.Abci != nil { - { - size, err := m.Abci.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } if m.Validator != nil { { size, err := m.Validator.MarshalToSizedBuffer(dAtA[:i]) @@ -454,10 +430,6 @@ func (m *MsgUpdateParams) Size() (n int) { l = m.Validator.Size() n += 1 + l + sovTx(uint64(l)) } - if m.Abci != nil { - l = m.Abci.Size() - n += 1 + l + sovTx(uint64(l)) - } if m.Synchrony != nil { l = m.Synchrony.Size() n += 1 + l + sovTx(uint64(l)) @@ -575,7 +547,7 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Block == nil { - m.Block = &v1.BlockParams{} + m.Block = &BlockParams{} } if err := m.Block.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -611,7 +583,7 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Evidence == nil { - m.Evidence = &v1.EvidenceParams{} + m.Evidence = &EvidenceParams{} } if err := m.Evidence.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -647,48 +619,12 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Validator == nil { - m.Validator = &v1.ValidatorParams{} + m.Validator = &ValidatorParams{} } if err := m.Validator.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Abci", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Abci == nil { - m.Abci = &v1.ABCIParams{} - } - if err := m.Abci.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Synchrony", wireType) @@ -719,7 +655,7 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Synchrony == nil { - m.Synchrony = &v1.SynchronyParams{} + m.Synchrony = &SynchronyParams{} } if err := m.Synchrony.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -755,7 +691,7 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Feature == nil { - m.Feature = &v1.FeatureParams{} + m.Feature = &FeatureParams{} } if err := m.Feature.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err From e2059e4012a31941bcfacc6eda6cbe9c2fd64029 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Fri, 30 Aug 2024 13:47:01 +0200 Subject: [PATCH 02/23] ++ --- api/cosmos/consensus/v1/query.pulsar.go | 80 +- api/cosmos/consensus/v1/tx.pulsar.go | 299 ++- x/consensus/exported/exported.go | 6 +- .../proto/cosmos/consensus/v1/params.proto | 136 - .../proto/cosmos/consensus/v1/query.proto | 4 +- .../proto/cosmos/consensus/v1/tx.proto | 14 +- x/consensus/types/params.pb.go | 2301 ----------------- x/consensus/types/query.pb.go | 32 +- x/consensus/types/tx.pb.go | 154 +- 9 files changed, 376 insertions(+), 2650 deletions(-) delete mode 100644 x/consensus/proto/cosmos/consensus/v1/params.proto delete mode 100644 x/consensus/types/params.pb.go diff --git a/api/cosmos/consensus/v1/query.pulsar.go b/api/cosmos/consensus/v1/query.pulsar.go index 77f33249ac4c..ef4d64ea7464 100644 --- a/api/cosmos/consensus/v1/query.pulsar.go +++ b/api/cosmos/consensus/v1/query.pulsar.go @@ -2,6 +2,7 @@ package consensusv1 import ( + v1 "buf.build/gen/go/cometbft/cometbft/protocolbuffers/go/cometbft/types/v1" fmt "fmt" runtime "github.com/cosmos/cosmos-proto/runtime" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -526,7 +527,7 @@ func (x *fastReflection_QueryParamsResponse) Get(descriptor protoreflect.FieldDe func (x *fastReflection_QueryParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { case "cosmos.consensus.v1.QueryParamsResponse.params": - x.Params = value.Message().Interface().(*ConsensusParams) + x.Params = value.Message().Interface().(*v1.ConsensusParams) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.QueryParamsResponse")) @@ -549,7 +550,7 @@ func (x *fastReflection_QueryParamsResponse) Mutable(fd protoreflect.FieldDescri switch fd.FullName() { case "cosmos.consensus.v1.QueryParamsResponse.params": if x.Params == nil { - x.Params = new(ConsensusParams) + x.Params = new(v1.ConsensusParams) } return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) default: @@ -566,7 +567,7 @@ func (x *fastReflection_QueryParamsResponse) Mutable(fd protoreflect.FieldDescri func (x *fastReflection_QueryParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { case "cosmos.consensus.v1.QueryParamsResponse.params": - m := new(ConsensusParams) + m := new(v1.ConsensusParams) return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { @@ -763,7 +764,7 @@ func (x *fastReflection_QueryParamsResponse) ProtoMethods() *protoiface.Methods return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } if x.Params == nil { - x.Params = &ConsensusParams{} + x.Params = &v1.ConsensusParams{} } if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err @@ -855,7 +856,7 @@ type QueryParamsResponse struct { // params are the tendermint consensus params stored in the consensus module. // Please note that `params.version` is not populated in this response, it is // tracked separately in the x/upgrade module. - Params *ConsensusParams `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` + Params *v1.ConsensusParams `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` } func (x *QueryParamsResponse) Reset() { @@ -878,7 +879,7 @@ func (*QueryParamsResponse) Descriptor() ([]byte, []int) { return file_cosmos_consensus_v1_query_proto_rawDescGZIP(), []int{1} } -func (x *QueryParamsResponse) GetParams() *ConsensusParams { +func (x *QueryParamsResponse) GetParams() *v1.ConsensusParams { if x != nil { return x.Params } @@ -893,37 +894,37 @@ var file_cosmos_consensus_v1_query_proto_rawDesc = []byte{ 0x6f, 0x12, 0x13, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, - 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x14, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x53, 0x0a, 0x13, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, - 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, - 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x32, 0x8a, 0x01, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x80, 0x01, 0x0a, 0x06, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, - 0x75, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x1d, 0x12, 0x1b, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, - 0x6e, 0x73, 0x75, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0xc5, - 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, - 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x63, - 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x43, 0x58, - 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, - 0x73, 0x75, 0x73, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, - 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1f, 0x43, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5c, - 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, - 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, - 0x75, 0x73, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x14, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x51, 0x0a, 0x13, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x3a, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x32, 0x8a, 0x01, + 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x80, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x12, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, + 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x76, + 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, + 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0xc5, 0x01, 0x0a, 0x17, 0x63, + 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, + 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, + 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, + 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x73, 0x65, + 0x6e, 0x73, 0x75, 0x73, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x43, 0x58, 0xaa, 0x02, 0x13, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, + 0x56, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x73, + 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5c, 0x56, 0x31, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x3a, 0x3a, + 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -942,10 +943,10 @@ var file_cosmos_consensus_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo var file_cosmos_consensus_v1_query_proto_goTypes = []interface{}{ (*QueryParamsRequest)(nil), // 0: cosmos.consensus.v1.QueryParamsRequest (*QueryParamsResponse)(nil), // 1: cosmos.consensus.v1.QueryParamsResponse - (*ConsensusParams)(nil), // 2: cosmos.consensus.v1.ConsensusParams + (*v1.ConsensusParams)(nil), // 2: cometbft.types.v1.ConsensusParams } var file_cosmos_consensus_v1_query_proto_depIdxs = []int32{ - 2, // 0: cosmos.consensus.v1.QueryParamsResponse.params:type_name -> cosmos.consensus.v1.ConsensusParams + 2, // 0: cosmos.consensus.v1.QueryParamsResponse.params:type_name -> cometbft.types.v1.ConsensusParams 0, // 1: cosmos.consensus.v1.Query.Params:input_type -> cosmos.consensus.v1.QueryParamsRequest 1, // 2: cosmos.consensus.v1.Query.Params:output_type -> cosmos.consensus.v1.QueryParamsResponse 2, // [2:3] is the sub-list for method output_type @@ -960,7 +961,6 @@ func file_cosmos_consensus_v1_query_proto_init() { if File_cosmos_consensus_v1_query_proto != nil { return } - file_cosmos_consensus_v1_params_proto_init() if !protoimpl.UnsafeEnabled { file_cosmos_consensus_v1_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QueryParamsRequest); i { diff --git a/api/cosmos/consensus/v1/tx.pulsar.go b/api/cosmos/consensus/v1/tx.pulsar.go index 62124c05fcfb..addd9db38326 100644 --- a/api/cosmos/consensus/v1/tx.pulsar.go +++ b/api/cosmos/consensus/v1/tx.pulsar.go @@ -2,6 +2,7 @@ package consensusv1 import ( + v1 "buf.build/gen/go/cometbft/cometbft/protocolbuffers/go/cometbft/types/v1" _ "cosmossdk.io/api/amino" _ "cosmossdk.io/api/cosmos/msg/v1" fmt "fmt" @@ -21,6 +22,7 @@ var ( fd_MsgUpdateParams_block protoreflect.FieldDescriptor fd_MsgUpdateParams_evidence protoreflect.FieldDescriptor fd_MsgUpdateParams_validator protoreflect.FieldDescriptor + fd_MsgUpdateParams_abci protoreflect.FieldDescriptor fd_MsgUpdateParams_synchrony protoreflect.FieldDescriptor fd_MsgUpdateParams_feature protoreflect.FieldDescriptor ) @@ -32,6 +34,7 @@ func init() { fd_MsgUpdateParams_block = md_MsgUpdateParams.Fields().ByName("block") fd_MsgUpdateParams_evidence = md_MsgUpdateParams.Fields().ByName("evidence") fd_MsgUpdateParams_validator = md_MsgUpdateParams.Fields().ByName("validator") + fd_MsgUpdateParams_abci = md_MsgUpdateParams.Fields().ByName("abci") fd_MsgUpdateParams_synchrony = md_MsgUpdateParams.Fields().ByName("synchrony") fd_MsgUpdateParams_feature = md_MsgUpdateParams.Fields().ByName("feature") } @@ -125,6 +128,12 @@ func (x *fastReflection_MsgUpdateParams) Range(f func(protoreflect.FieldDescript return } } + if x.Abci != nil { + value := protoreflect.ValueOfMessage(x.Abci.ProtoReflect()) + if !f(fd_MsgUpdateParams_abci, value) { + return + } + } if x.Synchrony != nil { value := protoreflect.ValueOfMessage(x.Synchrony.ProtoReflect()) if !f(fd_MsgUpdateParams_synchrony, value) { @@ -160,6 +169,8 @@ func (x *fastReflection_MsgUpdateParams) Has(fd protoreflect.FieldDescriptor) bo return x.Evidence != nil case "cosmos.consensus.v1.MsgUpdateParams.validator": return x.Validator != nil + case "cosmos.consensus.v1.MsgUpdateParams.abci": + return x.Abci != nil case "cosmos.consensus.v1.MsgUpdateParams.synchrony": return x.Synchrony != nil case "cosmos.consensus.v1.MsgUpdateParams.feature": @@ -188,6 +199,8 @@ func (x *fastReflection_MsgUpdateParams) Clear(fd protoreflect.FieldDescriptor) x.Evidence = nil case "cosmos.consensus.v1.MsgUpdateParams.validator": x.Validator = nil + case "cosmos.consensus.v1.MsgUpdateParams.abci": + x.Abci = nil case "cosmos.consensus.v1.MsgUpdateParams.synchrony": x.Synchrony = nil case "cosmos.consensus.v1.MsgUpdateParams.feature": @@ -220,6 +233,9 @@ func (x *fastReflection_MsgUpdateParams) Get(descriptor protoreflect.FieldDescri case "cosmos.consensus.v1.MsgUpdateParams.validator": value := x.Validator return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.consensus.v1.MsgUpdateParams.abci": + value := x.Abci + return protoreflect.ValueOfMessage(value.ProtoReflect()) case "cosmos.consensus.v1.MsgUpdateParams.synchrony": value := x.Synchrony return protoreflect.ValueOfMessage(value.ProtoReflect()) @@ -249,15 +265,17 @@ func (x *fastReflection_MsgUpdateParams) Set(fd protoreflect.FieldDescriptor, va case "cosmos.consensus.v1.MsgUpdateParams.authority": x.Authority = value.Interface().(string) case "cosmos.consensus.v1.MsgUpdateParams.block": - x.Block = value.Message().Interface().(*BlockParams) + x.Block = value.Message().Interface().(*v1.BlockParams) case "cosmos.consensus.v1.MsgUpdateParams.evidence": - x.Evidence = value.Message().Interface().(*EvidenceParams) + x.Evidence = value.Message().Interface().(*v1.EvidenceParams) case "cosmos.consensus.v1.MsgUpdateParams.validator": - x.Validator = value.Message().Interface().(*ValidatorParams) + x.Validator = value.Message().Interface().(*v1.ValidatorParams) + case "cosmos.consensus.v1.MsgUpdateParams.abci": + x.Abci = value.Message().Interface().(*v1.ABCIParams) case "cosmos.consensus.v1.MsgUpdateParams.synchrony": - x.Synchrony = value.Message().Interface().(*SynchronyParams) + x.Synchrony = value.Message().Interface().(*v1.SynchronyParams) case "cosmos.consensus.v1.MsgUpdateParams.feature": - x.Feature = value.Message().Interface().(*FeatureParams) + x.Feature = value.Message().Interface().(*v1.FeatureParams) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.MsgUpdateParams")) @@ -280,27 +298,32 @@ func (x *fastReflection_MsgUpdateParams) Mutable(fd protoreflect.FieldDescriptor switch fd.FullName() { case "cosmos.consensus.v1.MsgUpdateParams.block": if x.Block == nil { - x.Block = new(BlockParams) + x.Block = new(v1.BlockParams) } return protoreflect.ValueOfMessage(x.Block.ProtoReflect()) case "cosmos.consensus.v1.MsgUpdateParams.evidence": if x.Evidence == nil { - x.Evidence = new(EvidenceParams) + x.Evidence = new(v1.EvidenceParams) } return protoreflect.ValueOfMessage(x.Evidence.ProtoReflect()) case "cosmos.consensus.v1.MsgUpdateParams.validator": if x.Validator == nil { - x.Validator = new(ValidatorParams) + x.Validator = new(v1.ValidatorParams) } return protoreflect.ValueOfMessage(x.Validator.ProtoReflect()) + case "cosmos.consensus.v1.MsgUpdateParams.abci": + if x.Abci == nil { + x.Abci = new(v1.ABCIParams) + } + return protoreflect.ValueOfMessage(x.Abci.ProtoReflect()) case "cosmos.consensus.v1.MsgUpdateParams.synchrony": if x.Synchrony == nil { - x.Synchrony = new(SynchronyParams) + x.Synchrony = new(v1.SynchronyParams) } return protoreflect.ValueOfMessage(x.Synchrony.ProtoReflect()) case "cosmos.consensus.v1.MsgUpdateParams.feature": if x.Feature == nil { - x.Feature = new(FeatureParams) + x.Feature = new(v1.FeatureParams) } return protoreflect.ValueOfMessage(x.Feature.ProtoReflect()) case "cosmos.consensus.v1.MsgUpdateParams.authority": @@ -321,19 +344,22 @@ func (x *fastReflection_MsgUpdateParams) NewField(fd protoreflect.FieldDescripto case "cosmos.consensus.v1.MsgUpdateParams.authority": return protoreflect.ValueOfString("") case "cosmos.consensus.v1.MsgUpdateParams.block": - m := new(BlockParams) + m := new(v1.BlockParams) return protoreflect.ValueOfMessage(m.ProtoReflect()) case "cosmos.consensus.v1.MsgUpdateParams.evidence": - m := new(EvidenceParams) + m := new(v1.EvidenceParams) return protoreflect.ValueOfMessage(m.ProtoReflect()) case "cosmos.consensus.v1.MsgUpdateParams.validator": - m := new(ValidatorParams) + m := new(v1.ValidatorParams) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.consensus.v1.MsgUpdateParams.abci": + m := new(v1.ABCIParams) return protoreflect.ValueOfMessage(m.ProtoReflect()) case "cosmos.consensus.v1.MsgUpdateParams.synchrony": - m := new(SynchronyParams) + m := new(v1.SynchronyParams) return protoreflect.ValueOfMessage(m.ProtoReflect()) case "cosmos.consensus.v1.MsgUpdateParams.feature": - m := new(FeatureParams) + m := new(v1.FeatureParams) return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { @@ -420,6 +446,10 @@ func (x *fastReflection_MsgUpdateParams) ProtoMethods() *protoiface.Methods { l = options.Size(x.Validator) n += 1 + l + runtime.Sov(uint64(l)) } + if x.Abci != nil { + l = options.Size(x.Abci) + n += 1 + l + runtime.Sov(uint64(l)) + } if x.Synchrony != nil { l = options.Size(x.Synchrony) n += 1 + l + runtime.Sov(uint64(l)) @@ -485,6 +515,20 @@ func (x *fastReflection_MsgUpdateParams) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x32 } + if x.Abci != nil { + encoded, err := options.Marshal(x.Abci) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x2a + } if x.Validator != nil { encoded, err := options.Marshal(x.Validator) if err != nil { @@ -645,7 +689,7 @@ func (x *fastReflection_MsgUpdateParams) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } if x.Block == nil { - x.Block = &BlockParams{} + x.Block = &v1.BlockParams{} } if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Block); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err @@ -681,7 +725,7 @@ func (x *fastReflection_MsgUpdateParams) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } if x.Evidence == nil { - x.Evidence = &EvidenceParams{} + x.Evidence = &v1.EvidenceParams{} } if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Evidence); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err @@ -717,12 +761,48 @@ func (x *fastReflection_MsgUpdateParams) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } if x.Validator == nil { - x.Validator = &ValidatorParams{} + x.Validator = &v1.ValidatorParams{} } if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Validator); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Abci", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Abci == nil { + x.Abci = &v1.ABCIParams{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Abci); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex case 6: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Synchrony", wireType) @@ -753,7 +833,7 @@ func (x *fastReflection_MsgUpdateParams) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } if x.Synchrony == nil { - x.Synchrony = &SynchronyParams{} + x.Synchrony = &v1.SynchronyParams{} } if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Synchrony); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err @@ -789,7 +869,7 @@ func (x *fastReflection_MsgUpdateParams) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } if x.Feature == nil { - x.Feature = &FeatureParams{} + x.Feature = &v1.FeatureParams{} } if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Feature); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err @@ -1214,11 +1294,13 @@ type MsgUpdateParams struct { // separarately in x/upgrade. // // NOTE: All parameters must be supplied. - Block *BlockParams `protobuf:"bytes,2,opt,name=block,proto3" json:"block,omitempty"` - Evidence *EvidenceParams `protobuf:"bytes,3,opt,name=evidence,proto3" json:"evidence,omitempty"` - Validator *ValidatorParams `protobuf:"bytes,4,opt,name=validator,proto3" json:"validator,omitempty"` - Synchrony *SynchronyParams `protobuf:"bytes,6,opt,name=synchrony,proto3" json:"synchrony,omitempty"` - Feature *FeatureParams `protobuf:"bytes,7,opt,name=feature,proto3" json:"feature,omitempty"` + Block *v1.BlockParams `protobuf:"bytes,2,opt,name=block,proto3" json:"block,omitempty"` + Evidence *v1.EvidenceParams `protobuf:"bytes,3,opt,name=evidence,proto3" json:"evidence,omitempty"` + Validator *v1.ValidatorParams `protobuf:"bytes,4,opt,name=validator,proto3" json:"validator,omitempty"` + // Deprecated: Do not use. + Abci *v1.ABCIParams `protobuf:"bytes,5,opt,name=abci,proto3" json:"abci,omitempty"` + Synchrony *v1.SynchronyParams `protobuf:"bytes,6,opt,name=synchrony,proto3" json:"synchrony,omitempty"` + Feature *v1.FeatureParams `protobuf:"bytes,7,opt,name=feature,proto3" json:"feature,omitempty"` } func (x *MsgUpdateParams) Reset() { @@ -1248,35 +1330,43 @@ func (x *MsgUpdateParams) GetAuthority() string { return "" } -func (x *MsgUpdateParams) GetBlock() *BlockParams { +func (x *MsgUpdateParams) GetBlock() *v1.BlockParams { if x != nil { return x.Block } return nil } -func (x *MsgUpdateParams) GetEvidence() *EvidenceParams { +func (x *MsgUpdateParams) GetEvidence() *v1.EvidenceParams { if x != nil { return x.Evidence } return nil } -func (x *MsgUpdateParams) GetValidator() *ValidatorParams { +func (x *MsgUpdateParams) GetValidator() *v1.ValidatorParams { if x != nil { return x.Validator } return nil } -func (x *MsgUpdateParams) GetSynchrony() *SynchronyParams { +// Deprecated: Do not use. +func (x *MsgUpdateParams) GetAbci() *v1.ABCIParams { + if x != nil { + return x.Abci + } + return nil +} + +func (x *MsgUpdateParams) GetSynchrony() *v1.SynchronyParams { if x != nil { return x.Synchrony } return nil } -func (x *MsgUpdateParams) GetFeature() *FeatureParams { +func (x *MsgUpdateParams) GetFeature() *v1.FeatureParams { if x != nil { return x.Feature } @@ -1321,63 +1411,67 @@ var file_cosmos_consensus_v1_tx_proto_rawDesc = []byte{ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x73, 0x67, 0x2f, 0x76, 0x31, - 0x2f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2f, 0x76, 0x31, 0x2f, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xed, 0x03, 0x0a, - 0x0f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, - 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x36, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x12, 0x3f, 0x0a, 0x08, 0x65, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, - 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, - 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x08, 0x65, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, - 0x65, 0x12, 0x42, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, - 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x57, 0x0a, 0x09, 0x73, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, - 0x6e, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, + 0x2f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x6d, 0x65, + 0x74, 0x62, 0x66, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xad, 0x04, 0x0a, 0x0f, 0x4d, + 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x36, + 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x34, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, + 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x3d, 0x0a, 0x08, + 0x65, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, + 0x2e, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x76, 0x31, 0x2e, 0x45, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x52, 0x08, 0x65, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x40, 0x0a, 0x09, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, + 0x2e, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x76, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x48, 0x0a, + 0x04, 0x61, 0x62, 0x63, 0x69, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x6f, + 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, + 0x41, 0x42, 0x43, 0x49, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x15, 0xda, 0xb4, 0x2d, 0x0f, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x20, 0x30, 0x2e, 0x35, 0x30, 0x18, + 0x01, 0x52, 0x04, 0x61, 0x62, 0x63, 0x69, 0x12, 0x55, 0x0a, 0x09, 0x73, 0x79, 0x6e, 0x63, 0x68, + 0x72, 0x6f, 0x6e, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6f, 0x6d, + 0x65, 0x74, 0x62, 0x66, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x13, 0xda, 0xb4, 0x2d, 0x0f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x20, 0x30, - 0x2e, 0x35, 0x32, 0x52, 0x09, 0x73, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x79, 0x12, 0x51, + 0x2e, 0x35, 0x32, 0x52, 0x09, 0x73, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x79, 0x12, 0x4f, 0x0a, 0x07, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, - 0x75, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x42, 0x13, 0xda, 0xb4, 0x2d, 0x0f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, - 0x73, 0x64, 0x6b, 0x20, 0x30, 0x2e, 0x35, 0x32, 0x52, 0x07, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x3a, 0x39, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, - 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x26, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, - 0x2f, 0x78, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2f, 0x4d, 0x73, 0x67, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x19, 0x0a, 0x17, - 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x85, 0x01, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, - 0x77, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, - 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, - 0x75, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, - 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x13, 0xca, 0xb4, 0x2d, 0x0f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, - 0x73, 0x64, 0x6b, 0x20, 0x30, 0x2e, 0x34, 0x37, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, - 0xc2, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, - 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, - 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, - 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, - 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x43, 0x58, 0xaa, 0x02, - 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, - 0x73, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, - 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5c, 0x56, 0x31, - 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x43, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, - 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x20, 0x2e, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x42, 0x13, 0xda, 0xb4, 0x2d, 0x0f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, + 0x6b, 0x20, 0x30, 0x2e, 0x35, 0x32, 0x52, 0x07, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x3a, + 0x39, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, + 0xe7, 0xb0, 0x2a, 0x26, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x78, + 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, + 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x85, 0x01, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x77, 0x0a, + 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x24, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, + 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x1a, 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, + 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x13, 0xca, 0xb4, 0x2d, 0x0f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, + 0x6b, 0x20, 0x30, 0x2e, 0x34, 0x37, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xc2, 0x01, + 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, + 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, + 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, + 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x73, 0x65, + 0x6e, 0x73, 0x75, 0x73, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x43, 0x58, 0xaa, 0x02, 0x13, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, + 0x56, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x73, + 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5c, 0x56, 0x31, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x3a, 0x3a, + 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1396,25 +1490,27 @@ var file_cosmos_consensus_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 2 var file_cosmos_consensus_v1_tx_proto_goTypes = []interface{}{ (*MsgUpdateParams)(nil), // 0: cosmos.consensus.v1.MsgUpdateParams (*MsgUpdateParamsResponse)(nil), // 1: cosmos.consensus.v1.MsgUpdateParamsResponse - (*BlockParams)(nil), // 2: cosmos.consensus.v1.BlockParams - (*EvidenceParams)(nil), // 3: cosmos.consensus.v1.EvidenceParams - (*ValidatorParams)(nil), // 4: cosmos.consensus.v1.ValidatorParams - (*SynchronyParams)(nil), // 5: cosmos.consensus.v1.SynchronyParams - (*FeatureParams)(nil), // 6: cosmos.consensus.v1.FeatureParams + (*v1.BlockParams)(nil), // 2: cometbft.types.v1.BlockParams + (*v1.EvidenceParams)(nil), // 3: cometbft.types.v1.EvidenceParams + (*v1.ValidatorParams)(nil), // 4: cometbft.types.v1.ValidatorParams + (*v1.ABCIParams)(nil), // 5: cometbft.types.v1.ABCIParams + (*v1.SynchronyParams)(nil), // 6: cometbft.types.v1.SynchronyParams + (*v1.FeatureParams)(nil), // 7: cometbft.types.v1.FeatureParams } var file_cosmos_consensus_v1_tx_proto_depIdxs = []int32{ - 2, // 0: cosmos.consensus.v1.MsgUpdateParams.block:type_name -> cosmos.consensus.v1.BlockParams - 3, // 1: cosmos.consensus.v1.MsgUpdateParams.evidence:type_name -> cosmos.consensus.v1.EvidenceParams - 4, // 2: cosmos.consensus.v1.MsgUpdateParams.validator:type_name -> cosmos.consensus.v1.ValidatorParams - 5, // 3: cosmos.consensus.v1.MsgUpdateParams.synchrony:type_name -> cosmos.consensus.v1.SynchronyParams - 6, // 4: cosmos.consensus.v1.MsgUpdateParams.feature:type_name -> cosmos.consensus.v1.FeatureParams - 0, // 5: cosmos.consensus.v1.Msg.UpdateParams:input_type -> cosmos.consensus.v1.MsgUpdateParams - 1, // 6: cosmos.consensus.v1.Msg.UpdateParams:output_type -> cosmos.consensus.v1.MsgUpdateParamsResponse - 6, // [6:7] is the sub-list for method output_type - 5, // [5:6] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name + 2, // 0: cosmos.consensus.v1.MsgUpdateParams.block:type_name -> cometbft.types.v1.BlockParams + 3, // 1: cosmos.consensus.v1.MsgUpdateParams.evidence:type_name -> cometbft.types.v1.EvidenceParams + 4, // 2: cosmos.consensus.v1.MsgUpdateParams.validator:type_name -> cometbft.types.v1.ValidatorParams + 5, // 3: cosmos.consensus.v1.MsgUpdateParams.abci:type_name -> cometbft.types.v1.ABCIParams + 6, // 4: cosmos.consensus.v1.MsgUpdateParams.synchrony:type_name -> cometbft.types.v1.SynchronyParams + 7, // 5: cosmos.consensus.v1.MsgUpdateParams.feature:type_name -> cometbft.types.v1.FeatureParams + 0, // 6: cosmos.consensus.v1.Msg.UpdateParams:input_type -> cosmos.consensus.v1.MsgUpdateParams + 1, // 7: cosmos.consensus.v1.Msg.UpdateParams:output_type -> cosmos.consensus.v1.MsgUpdateParamsResponse + 7, // [7:8] is the sub-list for method output_type + 6, // [6:7] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name } func init() { file_cosmos_consensus_v1_tx_proto_init() } @@ -1422,7 +1518,6 @@ func file_cosmos_consensus_v1_tx_proto_init() { if File_cosmos_consensus_v1_tx_proto != nil { return } - file_cosmos_consensus_v1_params_proto_init() if !protoimpl.UnsafeEnabled { file_cosmos_consensus_v1_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgUpdateParams); i { diff --git a/x/consensus/exported/exported.go b/x/consensus/exported/exported.go index 36aa63da3d88..91dfabb451e2 100644 --- a/x/consensus/exported/exported.go +++ b/x/consensus/exported/exported.go @@ -3,13 +3,13 @@ package exported import ( "context" - "cosmossdk.io/x/consensus/types" + cmtproto "github.com/cometbft/cometbft/api/cometbft/types/v1" ) // ConsensusParamSetter defines the interface fulfilled by BaseApp's // ParamStore which allows setting its appVersion field. type ConsensusParamSetter interface { - Get(ctx context.Context) (types.ConsensusParams, error) + Get(ctx context.Context) (cmtproto.ConsensusParams, error) Has(ctx context.Context) (bool, error) - Set(ctx context.Context, cp types.ConsensusParams) error + Set(ctx context.Context, cp cmtproto.ConsensusParams) error } diff --git a/x/consensus/proto/cosmos/consensus/v1/params.proto b/x/consensus/proto/cosmos/consensus/v1/params.proto deleted file mode 100644 index f9d3b1591da0..000000000000 --- a/x/consensus/proto/cosmos/consensus/v1/params.proto +++ /dev/null @@ -1,136 +0,0 @@ -syntax = "proto3"; -package cosmos.consensus.v1; - -import "gogoproto/gogo.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/wrappers.proto"; - -option go_package = "cosmossdk.io/x/consensus/types"; - -// ConsensusParams contains consensus critical parameters that determine the -// validity of blocks. -message ConsensusParams { - BlockParams block = 1; - EvidenceParams evidence = 2; - ValidatorParams validator = 3; - VersionParams version = 4; - SynchronyParams synchrony = 6; - FeatureParams feature = 7; -} - -// BlockParams define limits on the block size and gas. -message BlockParams { - // Maximum size of a block, in bytes. - // - // Must be greater or equal to -1 and cannot be greater than the hard-coded - // maximum block size, which is 100MB. - // - // If set to -1, the limit is the hard-coded maximum block size. - int64 max_bytes = 1; - // Maximum gas wanted by transactions included in a block. - // - // Must be greater or equal to -1. If set to -1, no limit is enforced. - int64 max_gas = 2; - - reserved 3; // was TimeIotaMs see https://github.com/tendermint/tendermint/pull/5792 -} - -// EvidenceParams determine the validity of evidences of Byzantine behavior. -message EvidenceParams { - // Maximum age of evidence, in blocks. - // - // The recommended formula for calculating it is max_age_duration / {average - // block time}. - int64 max_age_num_blocks = 1; - - // Maximum age of evidence, in time. - // - // The recommended value of is should correspond to the application's - // "unbonding period" or other similar mechanism for handling - // Nothing-At-Stake attacks. - // See: - // https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed. - google.protobuf.Duration max_age_duration = 2 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; - - // Maximum size in bytes of evidence allowed to be included in a block. - // - // It should fall comfortably under the maximum size of a block. - int64 max_bytes = 3; -} - -// ValidatorParams restrict the public key types validators can use. -// -// NOTE: uses ABCI public keys naming, not Amino names. -message ValidatorParams { - option (gogoproto.populate) = true; - option (gogoproto.equal) = true; - - repeated string pub_key_types = 1; -} - -// VersionParams contain the version of specific components of CometBFT. -message VersionParams { - option (gogoproto.populate) = true; - option (gogoproto.equal) = true; - - // The ABCI application version. - // - // It was named app_version in CometBFT 0.34. - uint64 app = 1; -} - -// HashedParams is a subset of ConsensusParams. -// -// It is hashed into the Header.ConsensusHash. -message HashedParams { - int64 block_max_bytes = 1; - int64 block_max_gas = 2; -} - -// SynchronyParams determine the validity of block timestamps. -// -// These parameters are part of the Proposer-Based Timestamps (PBTS) algorithm. -// For more information on the relationship of the synchrony parameters to -// block timestamps validity, refer to the PBTS specification: -// https://github.com/tendermint/spec/blob/master/spec/consensus/proposer-based-timestamp/README.md -message SynchronyParams { - // Bound for how skewed a proposer's clock may be from any validator on the - // network while still producing valid proposals. - google.protobuf.Duration precision = 1 [(gogoproto.stdduration) = true]; - // Bound for how long a proposal message may take to reach all validators on - // a network and still be considered valid. - google.protobuf.Duration message_delay = 2 [(gogoproto.stdduration) = true]; -} - -// FeatureParams configure the height from which features of CometBFT are enabled. -message FeatureParams { - // Height during which vote extensions will be enabled. - // - // A value of 0 means vote extensions are disabled. A value > 0 denotes - // the height at which vote extensions will be (or have been) enabled. - // - // During the specified height, and for all subsequent heights, precommit - // messages that do not contain valid extension data will be considered - // invalid. Prior to this height, or when this height is set to 0, vote - // extensions will not be used or accepted by validators on the network. - // - // Once enabled, vote extensions will be created by the application in - // ExtendVote, validated by the application in VerifyVoteExtension, and - // used by the application in PrepareProposal, when proposing the next block. - // - // Cannot be set to heights lower or equal to the current blockchain height. - google.protobuf.Int64Value vote_extensions_enable_height = 1 [(gogoproto.nullable) = true]; - - // Height at which Proposer-Based Timestamps (PBTS) will be enabled. - // - // A value of 0 means PBTS is disabled. A value > 0 denotes the height at - // which PBTS will be (or has been) enabled. - // - // From the specified height, and for all subsequent heights, the PBTS - // algorithm will be used to produce and validate block timestamps. Prior to - // this height, or when this height is set to 0, the legacy BFT Time - // algorithm is used to produce and validate timestamps. - // - // Cannot be set to heights lower or equal to the current blockchain height. - google.protobuf.Int64Value pbts_enable_height = 2 [(gogoproto.nullable) = true]; -} diff --git a/x/consensus/proto/cosmos/consensus/v1/query.proto b/x/consensus/proto/cosmos/consensus/v1/query.proto index e3fa08223608..9a84c1909766 100644 --- a/x/consensus/proto/cosmos/consensus/v1/query.proto +++ b/x/consensus/proto/cosmos/consensus/v1/query.proto @@ -3,7 +3,7 @@ syntax = "proto3"; package cosmos.consensus.v1; import "google/api/annotations.proto"; -import "cosmos/consensus/v1/params.proto"; +import "cometbft/types/v1/params.proto"; option go_package = "cosmossdk.io/x/consensus/types"; @@ -23,5 +23,5 @@ message QueryParamsResponse { // params are the tendermint consensus params stored in the consensus module. // Please note that `params.version` is not populated in this response, it is // tracked separately in the x/upgrade module. - ConsensusParams params = 1; + cometbft.types.v1.ConsensusParams params = 1; } diff --git a/x/consensus/proto/cosmos/consensus/v1/tx.proto b/x/consensus/proto/cosmos/consensus/v1/tx.proto index 6eb5faea1511..d0cdde493a9c 100644 --- a/x/consensus/proto/cosmos/consensus/v1/tx.proto +++ b/x/consensus/proto/cosmos/consensus/v1/tx.proto @@ -5,7 +5,7 @@ package cosmos.consensus.v1; import "amino/amino.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/msg/v1/msg.proto"; -import "cosmos/consensus/v1/params.proto"; +import "cometbft/types/v1/params.proto"; option go_package = "cosmossdk.io/x/consensus/types"; @@ -33,12 +33,14 @@ message MsgUpdateParams { // separarately in x/upgrade. // // NOTE: All parameters must be supplied. - BlockParams block = 2; - EvidenceParams evidence = 3; - ValidatorParams validator = 4; + cometbft.types.v1.BlockParams block = 2; + cometbft.types.v1.EvidenceParams evidence = 3; + cometbft.types.v1.ValidatorParams validator = 4; - SynchronyParams synchrony = 6 [(cosmos_proto.field_added_in) = "cosmos-sdk 0.52"]; - FeatureParams feature = 7 [(cosmos_proto.field_added_in) = "cosmos-sdk 0.52"]; + cometbft.types.v1.ABCIParams abci = 5 [deprecated = true, (cosmos_proto.field_added_in) = "cosmos-sdk 0.50"]; + + cometbft.types.v1.SynchronyParams synchrony = 6 [(cosmos_proto.field_added_in) = "cosmos-sdk 0.52"]; + cometbft.types.v1.FeatureParams feature = 7 [(cosmos_proto.field_added_in) = "cosmos-sdk 0.52"]; } // MsgUpdateParamsResponse defines the response structure for executing a diff --git a/x/consensus/types/params.pb.go b/x/consensus/types/params.pb.go deleted file mode 100644 index f09697fa77eb..000000000000 --- a/x/consensus/types/params.pb.go +++ /dev/null @@ -1,2301 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/consensus/v1/params.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" - _ "google.golang.org/protobuf/types/known/durationpb" - wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" - io "io" - math "math" - math_bits "math/bits" - time "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf -var _ = time.Kitchen - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// ConsensusParams contains consensus critical parameters that determine the -// validity of blocks. -type ConsensusParams struct { - Block *BlockParams `protobuf:"bytes,1,opt,name=block,proto3" json:"block,omitempty"` - Evidence *EvidenceParams `protobuf:"bytes,2,opt,name=evidence,proto3" json:"evidence,omitempty"` - Validator *ValidatorParams `protobuf:"bytes,3,opt,name=validator,proto3" json:"validator,omitempty"` - Version *VersionParams `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"` - Synchrony *SynchronyParams `protobuf:"bytes,6,opt,name=synchrony,proto3" json:"synchrony,omitempty"` - Feature *FeatureParams `protobuf:"bytes,7,opt,name=feature,proto3" json:"feature,omitempty"` -} - -func (m *ConsensusParams) Reset() { *m = ConsensusParams{} } -func (m *ConsensusParams) String() string { return proto.CompactTextString(m) } -func (*ConsensusParams) ProtoMessage() {} -func (*ConsensusParams) Descriptor() ([]byte, []int) { - return fileDescriptor_4474bc02ecbe53d1, []int{0} -} -func (m *ConsensusParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ConsensusParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ConsensusParams.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ConsensusParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConsensusParams.Merge(m, src) -} -func (m *ConsensusParams) XXX_Size() int { - return m.Size() -} -func (m *ConsensusParams) XXX_DiscardUnknown() { - xxx_messageInfo_ConsensusParams.DiscardUnknown(m) -} - -var xxx_messageInfo_ConsensusParams proto.InternalMessageInfo - -func (m *ConsensusParams) GetBlock() *BlockParams { - if m != nil { - return m.Block - } - return nil -} - -func (m *ConsensusParams) GetEvidence() *EvidenceParams { - if m != nil { - return m.Evidence - } - return nil -} - -func (m *ConsensusParams) GetValidator() *ValidatorParams { - if m != nil { - return m.Validator - } - return nil -} - -func (m *ConsensusParams) GetVersion() *VersionParams { - if m != nil { - return m.Version - } - return nil -} - -func (m *ConsensusParams) GetSynchrony() *SynchronyParams { - if m != nil { - return m.Synchrony - } - return nil -} - -func (m *ConsensusParams) GetFeature() *FeatureParams { - if m != nil { - return m.Feature - } - return nil -} - -// BlockParams define limits on the block size and gas. -type BlockParams struct { - // Maximum size of a block, in bytes. - // - // Must be greater or equal to -1 and cannot be greater than the hard-coded - // maximum block size, which is 100MB. - // - // If set to -1, the limit is the hard-coded maximum block size. - MaxBytes int64 `protobuf:"varint,1,opt,name=max_bytes,json=maxBytes,proto3" json:"max_bytes,omitempty"` - // Maximum gas wanted by transactions included in a block. - // - // Must be greater or equal to -1. If set to -1, no limit is enforced. - MaxGas int64 `protobuf:"varint,2,opt,name=max_gas,json=maxGas,proto3" json:"max_gas,omitempty"` -} - -func (m *BlockParams) Reset() { *m = BlockParams{} } -func (m *BlockParams) String() string { return proto.CompactTextString(m) } -func (*BlockParams) ProtoMessage() {} -func (*BlockParams) Descriptor() ([]byte, []int) { - return fileDescriptor_4474bc02ecbe53d1, []int{1} -} -func (m *BlockParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BlockParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BlockParams.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *BlockParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_BlockParams.Merge(m, src) -} -func (m *BlockParams) XXX_Size() int { - return m.Size() -} -func (m *BlockParams) XXX_DiscardUnknown() { - xxx_messageInfo_BlockParams.DiscardUnknown(m) -} - -var xxx_messageInfo_BlockParams proto.InternalMessageInfo - -func (m *BlockParams) GetMaxBytes() int64 { - if m != nil { - return m.MaxBytes - } - return 0 -} - -func (m *BlockParams) GetMaxGas() int64 { - if m != nil { - return m.MaxGas - } - return 0 -} - -// EvidenceParams determine the validity of evidences of Byzantine behavior. -type EvidenceParams struct { - // Maximum age of evidence, in blocks. - // - // The recommended formula for calculating it is max_age_duration / {average - // block time}. - MaxAgeNumBlocks int64 `protobuf:"varint,1,opt,name=max_age_num_blocks,json=maxAgeNumBlocks,proto3" json:"max_age_num_blocks,omitempty"` - // Maximum age of evidence, in time. - // - // The recommended value of is should correspond to the application's - // "unbonding period" or other similar mechanism for handling - // Nothing-At-Stake attacks. - // See: - // https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed. - MaxAgeDuration time.Duration `protobuf:"bytes,2,opt,name=max_age_duration,json=maxAgeDuration,proto3,stdduration" json:"max_age_duration"` - // Maximum size in bytes of evidence allowed to be included in a block. - // - // It should fall comfortably under the maximum size of a block. - MaxBytes int64 `protobuf:"varint,3,opt,name=max_bytes,json=maxBytes,proto3" json:"max_bytes,omitempty"` -} - -func (m *EvidenceParams) Reset() { *m = EvidenceParams{} } -func (m *EvidenceParams) String() string { return proto.CompactTextString(m) } -func (*EvidenceParams) ProtoMessage() {} -func (*EvidenceParams) Descriptor() ([]byte, []int) { - return fileDescriptor_4474bc02ecbe53d1, []int{2} -} -func (m *EvidenceParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EvidenceParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EvidenceParams.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *EvidenceParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_EvidenceParams.Merge(m, src) -} -func (m *EvidenceParams) XXX_Size() int { - return m.Size() -} -func (m *EvidenceParams) XXX_DiscardUnknown() { - xxx_messageInfo_EvidenceParams.DiscardUnknown(m) -} - -var xxx_messageInfo_EvidenceParams proto.InternalMessageInfo - -func (m *EvidenceParams) GetMaxAgeNumBlocks() int64 { - if m != nil { - return m.MaxAgeNumBlocks - } - return 0 -} - -func (m *EvidenceParams) GetMaxAgeDuration() time.Duration { - if m != nil { - return m.MaxAgeDuration - } - return 0 -} - -func (m *EvidenceParams) GetMaxBytes() int64 { - if m != nil { - return m.MaxBytes - } - return 0 -} - -// ValidatorParams restrict the public key types validators can use. -// -// NOTE: uses ABCI public keys naming, not Amino names. -type ValidatorParams struct { - PubKeyTypes []string `protobuf:"bytes,1,rep,name=pub_key_types,json=pubKeyTypes,proto3" json:"pub_key_types,omitempty"` -} - -func (m *ValidatorParams) Reset() { *m = ValidatorParams{} } -func (m *ValidatorParams) String() string { return proto.CompactTextString(m) } -func (*ValidatorParams) ProtoMessage() {} -func (*ValidatorParams) Descriptor() ([]byte, []int) { - return fileDescriptor_4474bc02ecbe53d1, []int{3} -} -func (m *ValidatorParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ValidatorParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ValidatorParams.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ValidatorParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_ValidatorParams.Merge(m, src) -} -func (m *ValidatorParams) XXX_Size() int { - return m.Size() -} -func (m *ValidatorParams) XXX_DiscardUnknown() { - xxx_messageInfo_ValidatorParams.DiscardUnknown(m) -} - -var xxx_messageInfo_ValidatorParams proto.InternalMessageInfo - -func (m *ValidatorParams) GetPubKeyTypes() []string { - if m != nil { - return m.PubKeyTypes - } - return nil -} - -// VersionParams contain the version of specific components of CometBFT. -type VersionParams struct { - // The ABCI application version. - // - // It was named app_version in CometBFT 0.34. - App uint64 `protobuf:"varint,1,opt,name=app,proto3" json:"app,omitempty"` -} - -func (m *VersionParams) Reset() { *m = VersionParams{} } -func (m *VersionParams) String() string { return proto.CompactTextString(m) } -func (*VersionParams) ProtoMessage() {} -func (*VersionParams) Descriptor() ([]byte, []int) { - return fileDescriptor_4474bc02ecbe53d1, []int{4} -} -func (m *VersionParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *VersionParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_VersionParams.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *VersionParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_VersionParams.Merge(m, src) -} -func (m *VersionParams) XXX_Size() int { - return m.Size() -} -func (m *VersionParams) XXX_DiscardUnknown() { - xxx_messageInfo_VersionParams.DiscardUnknown(m) -} - -var xxx_messageInfo_VersionParams proto.InternalMessageInfo - -func (m *VersionParams) GetApp() uint64 { - if m != nil { - return m.App - } - return 0 -} - -// HashedParams is a subset of ConsensusParams. -// -// It is hashed into the Header.ConsensusHash. -type HashedParams struct { - BlockMaxBytes int64 `protobuf:"varint,1,opt,name=block_max_bytes,json=blockMaxBytes,proto3" json:"block_max_bytes,omitempty"` - BlockMaxGas int64 `protobuf:"varint,2,opt,name=block_max_gas,json=blockMaxGas,proto3" json:"block_max_gas,omitempty"` -} - -func (m *HashedParams) Reset() { *m = HashedParams{} } -func (m *HashedParams) String() string { return proto.CompactTextString(m) } -func (*HashedParams) ProtoMessage() {} -func (*HashedParams) Descriptor() ([]byte, []int) { - return fileDescriptor_4474bc02ecbe53d1, []int{5} -} -func (m *HashedParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *HashedParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_HashedParams.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *HashedParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_HashedParams.Merge(m, src) -} -func (m *HashedParams) XXX_Size() int { - return m.Size() -} -func (m *HashedParams) XXX_DiscardUnknown() { - xxx_messageInfo_HashedParams.DiscardUnknown(m) -} - -var xxx_messageInfo_HashedParams proto.InternalMessageInfo - -func (m *HashedParams) GetBlockMaxBytes() int64 { - if m != nil { - return m.BlockMaxBytes - } - return 0 -} - -func (m *HashedParams) GetBlockMaxGas() int64 { - if m != nil { - return m.BlockMaxGas - } - return 0 -} - -// SynchronyParams determine the validity of block timestamps. -// -// These parameters are part of the Proposer-Based Timestamps (PBTS) algorithm. -// For more information on the relationship of the synchrony parameters to -// block timestamps validity, refer to the PBTS specification: -// https://github.com/tendermint/spec/blob/master/spec/consensus/proposer-based-timestamp/README.md -type SynchronyParams struct { - // Bound for how skewed a proposer's clock may be from any validator on the - // network while still producing valid proposals. - Precision *time.Duration `protobuf:"bytes,1,opt,name=precision,proto3,stdduration" json:"precision,omitempty"` - // Bound for how long a proposal message may take to reach all validators on - // a network and still be considered valid. - MessageDelay *time.Duration `protobuf:"bytes,2,opt,name=message_delay,json=messageDelay,proto3,stdduration" json:"message_delay,omitempty"` -} - -func (m *SynchronyParams) Reset() { *m = SynchronyParams{} } -func (m *SynchronyParams) String() string { return proto.CompactTextString(m) } -func (*SynchronyParams) ProtoMessage() {} -func (*SynchronyParams) Descriptor() ([]byte, []int) { - return fileDescriptor_4474bc02ecbe53d1, []int{6} -} -func (m *SynchronyParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SynchronyParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SynchronyParams.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SynchronyParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_SynchronyParams.Merge(m, src) -} -func (m *SynchronyParams) XXX_Size() int { - return m.Size() -} -func (m *SynchronyParams) XXX_DiscardUnknown() { - xxx_messageInfo_SynchronyParams.DiscardUnknown(m) -} - -var xxx_messageInfo_SynchronyParams proto.InternalMessageInfo - -func (m *SynchronyParams) GetPrecision() *time.Duration { - if m != nil { - return m.Precision - } - return nil -} - -func (m *SynchronyParams) GetMessageDelay() *time.Duration { - if m != nil { - return m.MessageDelay - } - return nil -} - -// FeatureParams configure the height from which features of CometBFT are enabled. -type FeatureParams struct { - // Height during which vote extensions will be enabled. - // - // A value of 0 means vote extensions are disabled. A value > 0 denotes - // the height at which vote extensions will be (or have been) enabled. - // - // During the specified height, and for all subsequent heights, precommit - // messages that do not contain valid extension data will be considered - // invalid. Prior to this height, or when this height is set to 0, vote - // extensions will not be used or accepted by validators on the network. - // - // Once enabled, vote extensions will be created by the application in - // ExtendVote, validated by the application in VerifyVoteExtension, and - // used by the application in PrepareProposal, when proposing the next block. - // - // Cannot be set to heights lower or equal to the current blockchain height. - VoteExtensionsEnableHeight *wrapperspb.Int64Value `protobuf:"bytes,1,opt,name=vote_extensions_enable_height,json=voteExtensionsEnableHeight,proto3" json:"vote_extensions_enable_height,omitempty"` - // Height at which Proposer-Based Timestamps (PBTS) will be enabled. - // - // A value of 0 means PBTS is disabled. A value > 0 denotes the height at - // which PBTS will be (or has been) enabled. - // - // From the specified height, and for all subsequent heights, the PBTS - // algorithm will be used to produce and validate block timestamps. Prior to - // this height, or when this height is set to 0, the legacy BFT Time - // algorithm is used to produce and validate timestamps. - // - // Cannot be set to heights lower or equal to the current blockchain height. - PbtsEnableHeight *wrapperspb.Int64Value `protobuf:"bytes,2,opt,name=pbts_enable_height,json=pbtsEnableHeight,proto3" json:"pbts_enable_height,omitempty"` -} - -func (m *FeatureParams) Reset() { *m = FeatureParams{} } -func (m *FeatureParams) String() string { return proto.CompactTextString(m) } -func (*FeatureParams) ProtoMessage() {} -func (*FeatureParams) Descriptor() ([]byte, []int) { - return fileDescriptor_4474bc02ecbe53d1, []int{7} -} -func (m *FeatureParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *FeatureParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_FeatureParams.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *FeatureParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_FeatureParams.Merge(m, src) -} -func (m *FeatureParams) XXX_Size() int { - return m.Size() -} -func (m *FeatureParams) XXX_DiscardUnknown() { - xxx_messageInfo_FeatureParams.DiscardUnknown(m) -} - -var xxx_messageInfo_FeatureParams proto.InternalMessageInfo - -func (m *FeatureParams) GetVoteExtensionsEnableHeight() *wrapperspb.Int64Value { - if m != nil { - return m.VoteExtensionsEnableHeight - } - return nil -} - -func (m *FeatureParams) GetPbtsEnableHeight() *wrapperspb.Int64Value { - if m != nil { - return m.PbtsEnableHeight - } - return nil -} - -func init() { - proto.RegisterType((*ConsensusParams)(nil), "cosmos.consensus.v1.ConsensusParams") - proto.RegisterType((*BlockParams)(nil), "cosmos.consensus.v1.BlockParams") - proto.RegisterType((*EvidenceParams)(nil), "cosmos.consensus.v1.EvidenceParams") - proto.RegisterType((*ValidatorParams)(nil), "cosmos.consensus.v1.ValidatorParams") - proto.RegisterType((*VersionParams)(nil), "cosmos.consensus.v1.VersionParams") - proto.RegisterType((*HashedParams)(nil), "cosmos.consensus.v1.HashedParams") - proto.RegisterType((*SynchronyParams)(nil), "cosmos.consensus.v1.SynchronyParams") - proto.RegisterType((*FeatureParams)(nil), "cosmos.consensus.v1.FeatureParams") -} - -func init() { proto.RegisterFile("cosmos/consensus/v1/params.proto", fileDescriptor_4474bc02ecbe53d1) } - -var fileDescriptor_4474bc02ecbe53d1 = []byte{ - // 678 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0x4d, 0x6f, 0xd3, 0x40, - 0x10, 0xcd, 0xd6, 0xa1, 0x4d, 0x36, 0x4d, 0x13, 0x2d, 0x48, 0x84, 0x56, 0x38, 0x95, 0x41, 0xa8, - 0x52, 0x25, 0x5b, 0x05, 0x54, 0x21, 0x04, 0xaa, 0x08, 0x2d, 0x6d, 0x41, 0x05, 0x64, 0x50, 0x0f, - 0xbd, 0x58, 0xeb, 0x64, 0xeb, 0x58, 0x8d, 0xbd, 0x96, 0xd7, 0x0e, 0xf6, 0x9f, 0x40, 0x9c, 0x10, - 0xc7, 0x5e, 0xf9, 0x07, 0xfc, 0x02, 0xd4, 0x63, 0x8f, 0x9c, 0x0a, 0x6a, 0x2f, 0xfc, 0x0c, 0xb4, - 0x6b, 0x6f, 0xbe, 0x08, 0x2d, 0x37, 0xdb, 0xf3, 0xde, 0x9b, 0x37, 0x6f, 0x26, 0x81, 0xcb, 0x6d, - 0xca, 0x3c, 0xca, 0x8c, 0x36, 0xf5, 0x19, 0xf1, 0x59, 0xcc, 0x8c, 0xfe, 0x9a, 0x11, 0xe0, 0x10, - 0x7b, 0x4c, 0x0f, 0x42, 0x1a, 0x51, 0x74, 0x3d, 0x43, 0xe8, 0x03, 0x84, 0xde, 0x5f, 0x5b, 0xbc, - 0xe1, 0x50, 0x87, 0x8a, 0xba, 0xc1, 0x9f, 0x32, 0xe8, 0xa2, 0xea, 0x50, 0xea, 0xf4, 0x88, 0x21, - 0xde, 0xec, 0xf8, 0xd0, 0xe8, 0xc4, 0x21, 0x8e, 0x5c, 0xea, 0xff, 0xab, 0xfe, 0x21, 0xc4, 0x41, - 0x40, 0xc2, 0xbc, 0x95, 0xf6, 0x51, 0x81, 0xb5, 0xe7, 0xb2, 0xcd, 0x5b, 0x61, 0x02, 0xad, 0xc3, - 0x6b, 0x76, 0x8f, 0xb6, 0x8f, 0x1a, 0x60, 0x19, 0xac, 0x54, 0xee, 0x2f, 0xeb, 0x53, 0xec, 0xe8, - 0x2d, 0x8e, 0xc8, 0x08, 0x66, 0x06, 0x47, 0x1b, 0xb0, 0x44, 0xfa, 0x6e, 0x87, 0xf8, 0x6d, 0xd2, - 0x98, 0x11, 0xd4, 0x3b, 0x53, 0xa9, 0x5b, 0x39, 0x28, 0x67, 0x0f, 0x48, 0xa8, 0x05, 0xcb, 0x7d, - 0xdc, 0x73, 0x3b, 0x38, 0xa2, 0x61, 0x43, 0x11, 0x0a, 0x77, 0xa7, 0x2a, 0xec, 0x4b, 0x54, 0x2e, - 0x31, 0xa4, 0xa1, 0x27, 0x70, 0xae, 0x4f, 0x42, 0xe6, 0x52, 0xbf, 0x51, 0x14, 0x0a, 0xda, 0x74, - 0x85, 0x0c, 0x93, 0xf3, 0x25, 0x85, 0x3b, 0x60, 0xa9, 0xdf, 0xee, 0x86, 0xd4, 0x4f, 0x1b, 0xb3, - 0x97, 0x38, 0x78, 0x27, 0x51, 0xd2, 0xc1, 0x80, 0xc6, 0x1d, 0x1c, 0x12, 0x1c, 0xc5, 0x21, 0x69, - 0xcc, 0x5d, 0xe2, 0xe0, 0x45, 0x86, 0x91, 0x0e, 0x72, 0x8a, 0xb6, 0x0b, 0x2b, 0x23, 0xd1, 0xa2, - 0x25, 0x58, 0xf6, 0x70, 0x62, 0xd9, 0x69, 0x44, 0x98, 0xd8, 0x87, 0x62, 0x96, 0x3c, 0x9c, 0xb4, - 0xf8, 0x3b, 0xba, 0x09, 0xe7, 0x78, 0xd1, 0xc1, 0x4c, 0xe4, 0xad, 0x98, 0xb3, 0x1e, 0x4e, 0xb6, - 0x31, 0x7b, 0x59, 0x2c, 0x29, 0xf5, 0xa2, 0xf6, 0x15, 0xc0, 0x85, 0xf1, 0xac, 0xd1, 0x2a, 0x44, - 0x9c, 0x81, 0x1d, 0x62, 0xf9, 0xb1, 0x67, 0x89, 0xbd, 0x49, 0xdd, 0x9a, 0x87, 0x93, 0x67, 0x0e, - 0x79, 0x1d, 0x7b, 0xc2, 0x00, 0x43, 0x7b, 0xb0, 0x2e, 0xc1, 0xf2, 0xaa, 0xf2, 0xbd, 0xde, 0xd2, - 0xb3, 0xb3, 0xd2, 0xe5, 0x59, 0xe9, 0x9b, 0x39, 0xa0, 0x55, 0x3a, 0x39, 0x6b, 0x16, 0xbe, 0xfc, - 0x6c, 0x02, 0x73, 0x21, 0xd3, 0x93, 0x95, 0xf1, 0x51, 0x94, 0xf1, 0x51, 0xb4, 0x0d, 0x58, 0x9b, - 0x58, 0x2a, 0xd2, 0x60, 0x35, 0x88, 0x6d, 0xeb, 0x88, 0xa4, 0x56, 0x94, 0x06, 0x62, 0x7c, 0x65, - 0xa5, 0x6c, 0x56, 0x82, 0xd8, 0x7e, 0x45, 0xd2, 0xf7, 0xfc, 0xd3, 0xe3, 0xd2, 0xb7, 0xe3, 0x26, - 0xf8, 0x7d, 0xdc, 0x04, 0xda, 0x2a, 0xac, 0x8e, 0xed, 0x14, 0xd5, 0xa1, 0x82, 0x83, 0x40, 0xcc, - 0x56, 0x34, 0xf9, 0xe3, 0x08, 0xf8, 0x00, 0xce, 0xef, 0x60, 0xd6, 0x25, 0x9d, 0x1c, 0x7b, 0x0f, - 0xd6, 0x44, 0x14, 0xd6, 0x64, 0xd6, 0x55, 0xf1, 0x79, 0x4f, 0x06, 0xae, 0xc1, 0xea, 0x10, 0x37, - 0x8c, 0xbd, 0x22, 0x51, 0xdb, 0x98, 0x69, 0x9f, 0x01, 0xac, 0x4d, 0x5c, 0x07, 0x7a, 0x0a, 0xcb, - 0x41, 0x48, 0xda, 0xae, 0x38, 0x4b, 0x70, 0x55, 0x84, 0x45, 0x11, 0xdf, 0x90, 0x81, 0x36, 0x61, - 0xd5, 0x23, 0x8c, 0x89, 0x45, 0x90, 0x1e, 0x4e, 0xaf, 0xde, 0x42, 0x26, 0x31, 0x9f, 0xb3, 0x36, - 0x39, 0x49, 0xfb, 0x0e, 0x60, 0x75, 0xec, 0xe8, 0x50, 0x07, 0xde, 0xee, 0xd3, 0x88, 0x58, 0x24, - 0x89, 0x88, 0xcf, 0x3b, 0x31, 0x8b, 0xf8, 0xd8, 0xee, 0x11, 0xab, 0x4b, 0x5c, 0xa7, 0x1b, 0xe5, - 0x56, 0x97, 0xfe, 0xea, 0xb3, 0xeb, 0x47, 0xeb, 0x0f, 0xf7, 0x71, 0x2f, 0x26, 0xad, 0xe2, 0xc9, - 0x59, 0x13, 0x98, 0x8b, 0x5c, 0x67, 0x6b, 0x20, 0xb3, 0x25, 0x54, 0x76, 0x84, 0x08, 0x7a, 0x03, - 0x51, 0x60, 0x47, 0x93, 0xd2, 0x33, 0xff, 0x2b, 0x5d, 0xe7, 0xe4, 0x51, 0xc1, 0xd6, 0xa3, 0x93, - 0x73, 0x15, 0x9c, 0x9e, 0xab, 0xe0, 0xd7, 0xb9, 0x0a, 0x3e, 0x5d, 0xa8, 0x85, 0xd3, 0x0b, 0xb5, - 0xf0, 0xe3, 0x42, 0x2d, 0x1c, 0xa8, 0xd9, 0x0f, 0x8d, 0x75, 0x8e, 0x74, 0x97, 0x1a, 0xc9, 0xc8, - 0x5f, 0xac, 0xb8, 0x20, 0x7b, 0x56, 0xb4, 0x79, 0xf0, 0x27, 0x00, 0x00, 0xff, 0xff, 0x61, 0x99, - 0x84, 0x9f, 0x83, 0x05, 0x00, 0x00, -} - -func (this *ValidatorParams) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ValidatorParams) - if !ok { - that2, ok := that.(ValidatorParams) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.PubKeyTypes) != len(that1.PubKeyTypes) { - return false - } - for i := range this.PubKeyTypes { - if this.PubKeyTypes[i] != that1.PubKeyTypes[i] { - return false - } - } - return true -} -func (this *VersionParams) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*VersionParams) - if !ok { - that2, ok := that.(VersionParams) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.App != that1.App { - return false - } - return true -} -func (m *ConsensusParams) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ConsensusParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ConsensusParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Feature != nil { - { - size, err := m.Feature.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintParams(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - if m.Synchrony != nil { - { - size, err := m.Synchrony.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintParams(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - if m.Version != nil { - { - size, err := m.Version.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintParams(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.Validator != nil { - { - size, err := m.Validator.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintParams(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.Evidence != nil { - { - size, err := m.Evidence.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintParams(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.Block != nil { - { - size, err := m.Block.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintParams(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *BlockParams) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *BlockParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BlockParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.MaxGas != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.MaxGas)) - i-- - dAtA[i] = 0x10 - } - if m.MaxBytes != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.MaxBytes)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *EvidenceParams) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *EvidenceParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EvidenceParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.MaxBytes != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.MaxBytes)) - i-- - dAtA[i] = 0x18 - } - n7, err7 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.MaxAgeDuration, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.MaxAgeDuration):]) - if err7 != nil { - return 0, err7 - } - i -= n7 - i = encodeVarintParams(dAtA, i, uint64(n7)) - i-- - dAtA[i] = 0x12 - if m.MaxAgeNumBlocks != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.MaxAgeNumBlocks)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *ValidatorParams) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ValidatorParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ValidatorParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.PubKeyTypes) > 0 { - for iNdEx := len(m.PubKeyTypes) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.PubKeyTypes[iNdEx]) - copy(dAtA[i:], m.PubKeyTypes[iNdEx]) - i = encodeVarintParams(dAtA, i, uint64(len(m.PubKeyTypes[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *VersionParams) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *VersionParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *VersionParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.App != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.App)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *HashedParams) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *HashedParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *HashedParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.BlockMaxGas != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.BlockMaxGas)) - i-- - dAtA[i] = 0x10 - } - if m.BlockMaxBytes != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.BlockMaxBytes)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *SynchronyParams) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SynchronyParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SynchronyParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.MessageDelay != nil { - n8, err8 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(*m.MessageDelay, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.MessageDelay):]) - if err8 != nil { - return 0, err8 - } - i -= n8 - i = encodeVarintParams(dAtA, i, uint64(n8)) - i-- - dAtA[i] = 0x12 - } - if m.Precision != nil { - n9, err9 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(*m.Precision, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.Precision):]) - if err9 != nil { - return 0, err9 - } - i -= n9 - i = encodeVarintParams(dAtA, i, uint64(n9)) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *FeatureParams) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *FeatureParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *FeatureParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.PbtsEnableHeight != nil { - { - size, err := m.PbtsEnableHeight.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintParams(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.VoteExtensionsEnableHeight != nil { - { - size, err := m.VoteExtensionsEnableHeight.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintParams(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintParams(dAtA []byte, offset int, v uint64) int { - offset -= sovParams(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func NewPopulatedValidatorParams(r randyParams, easy bool) *ValidatorParams { - this := &ValidatorParams{} - v1 := r.Intn(10) - this.PubKeyTypes = make([]string, v1) - for i := 0; i < v1; i++ { - this.PubKeyTypes[i] = string(randStringParams(r)) - } - if !easy && r.Intn(10) != 0 { - } - return this -} - -func NewPopulatedVersionParams(r randyParams, easy bool) *VersionParams { - this := &VersionParams{} - this.App = uint64(uint64(r.Uint32())) - if !easy && r.Intn(10) != 0 { - } - return this -} - -type randyParams interface { - Float32() float32 - Float64() float64 - Int63() int64 - Int31() int32 - Uint32() uint32 - Intn(n int) int -} - -func randUTF8RuneParams(r randyParams) rune { - ru := r.Intn(62) - if ru < 10 { - return rune(ru + 48) - } else if ru < 36 { - return rune(ru + 55) - } - return rune(ru + 61) -} -func randStringParams(r randyParams) string { - v2 := r.Intn(100) - tmps := make([]rune, v2) - for i := 0; i < v2; i++ { - tmps[i] = randUTF8RuneParams(r) - } - return string(tmps) -} -func randUnrecognizedParams(r randyParams, maxFieldNumber int) (dAtA []byte) { - l := r.Intn(5) - for i := 0; i < l; i++ { - wire := r.Intn(4) - if wire == 3 { - wire = 5 - } - fieldNumber := maxFieldNumber + r.Intn(100) - dAtA = randFieldParams(dAtA, r, fieldNumber, wire) - } - return dAtA -} -func randFieldParams(dAtA []byte, r randyParams, fieldNumber int, wire int) []byte { - key := uint32(fieldNumber)<<3 | uint32(wire) - switch wire { - case 0: - dAtA = encodeVarintPopulateParams(dAtA, uint64(key)) - v3 := r.Int63() - if r.Intn(2) == 0 { - v3 *= -1 - } - dAtA = encodeVarintPopulateParams(dAtA, uint64(v3)) - case 1: - dAtA = encodeVarintPopulateParams(dAtA, uint64(key)) - dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - case 2: - dAtA = encodeVarintPopulateParams(dAtA, uint64(key)) - ll := r.Intn(100) - dAtA = encodeVarintPopulateParams(dAtA, uint64(ll)) - for j := 0; j < ll; j++ { - dAtA = append(dAtA, byte(r.Intn(256))) - } - default: - dAtA = encodeVarintPopulateParams(dAtA, uint64(key)) - dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - } - return dAtA -} -func encodeVarintPopulateParams(dAtA []byte, v uint64) []byte { - for v >= 1<<7 { - dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80)) - v >>= 7 - } - dAtA = append(dAtA, uint8(v)) - return dAtA -} -func (m *ConsensusParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Block != nil { - l = m.Block.Size() - n += 1 + l + sovParams(uint64(l)) - } - if m.Evidence != nil { - l = m.Evidence.Size() - n += 1 + l + sovParams(uint64(l)) - } - if m.Validator != nil { - l = m.Validator.Size() - n += 1 + l + sovParams(uint64(l)) - } - if m.Version != nil { - l = m.Version.Size() - n += 1 + l + sovParams(uint64(l)) - } - if m.Synchrony != nil { - l = m.Synchrony.Size() - n += 1 + l + sovParams(uint64(l)) - } - if m.Feature != nil { - l = m.Feature.Size() - n += 1 + l + sovParams(uint64(l)) - } - return n -} - -func (m *BlockParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MaxBytes != 0 { - n += 1 + sovParams(uint64(m.MaxBytes)) - } - if m.MaxGas != 0 { - n += 1 + sovParams(uint64(m.MaxGas)) - } - return n -} - -func (m *EvidenceParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MaxAgeNumBlocks != 0 { - n += 1 + sovParams(uint64(m.MaxAgeNumBlocks)) - } - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.MaxAgeDuration) - n += 1 + l + sovParams(uint64(l)) - if m.MaxBytes != 0 { - n += 1 + sovParams(uint64(m.MaxBytes)) - } - return n -} - -func (m *ValidatorParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.PubKeyTypes) > 0 { - for _, s := range m.PubKeyTypes { - l = len(s) - n += 1 + l + sovParams(uint64(l)) - } - } - return n -} - -func (m *VersionParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.App != 0 { - n += 1 + sovParams(uint64(m.App)) - } - return n -} - -func (m *HashedParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.BlockMaxBytes != 0 { - n += 1 + sovParams(uint64(m.BlockMaxBytes)) - } - if m.BlockMaxGas != 0 { - n += 1 + sovParams(uint64(m.BlockMaxGas)) - } - return n -} - -func (m *SynchronyParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Precision != nil { - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.Precision) - n += 1 + l + sovParams(uint64(l)) - } - if m.MessageDelay != nil { - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.MessageDelay) - n += 1 + l + sovParams(uint64(l)) - } - return n -} - -func (m *FeatureParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.VoteExtensionsEnableHeight != nil { - l = m.VoteExtensionsEnableHeight.Size() - n += 1 + l + sovParams(uint64(l)) - } - if m.PbtsEnableHeight != nil { - l = m.PbtsEnableHeight.Size() - n += 1 + l + sovParams(uint64(l)) - } - return n -} - -func sovParams(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozParams(x uint64) (n int) { - return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *ConsensusParams) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ConsensusParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ConsensusParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Block == nil { - m.Block = &BlockParams{} - } - if err := m.Block.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Evidence", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Evidence == nil { - m.Evidence = &EvidenceParams{} - } - if err := m.Evidence.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Validator", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Validator == nil { - m.Validator = &ValidatorParams{} - } - if err := m.Validator.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Version == nil { - m.Version = &VersionParams{} - } - if err := m.Version.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Synchrony", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Synchrony == nil { - m.Synchrony = &SynchronyParams{} - } - if err := m.Synchrony.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Feature", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Feature == nil { - m.Feature = &FeatureParams{} - } - if err := m.Feature.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipParams(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthParams - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *BlockParams) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: BlockParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BlockParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxBytes", wireType) - } - m.MaxBytes = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxBytes |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxGas", wireType) - } - m.MaxGas = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxGas |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipParams(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthParams - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EvidenceParams) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: EvidenceParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EvidenceParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxAgeNumBlocks", wireType) - } - m.MaxAgeNumBlocks = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxAgeNumBlocks |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxAgeDuration", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.MaxAgeDuration, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxBytes", wireType) - } - m.MaxBytes = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxBytes |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipParams(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthParams - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ValidatorParams) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ValidatorParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ValidatorParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PubKeyTypes", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - 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 ErrInvalidLengthParams - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PubKeyTypes = append(m.PubKeyTypes, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipParams(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthParams - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *VersionParams) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: VersionParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: VersionParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field App", wireType) - } - m.App = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.App |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipParams(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthParams - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *HashedParams) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: HashedParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: HashedParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockMaxBytes", wireType) - } - m.BlockMaxBytes = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BlockMaxBytes |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockMaxGas", wireType) - } - m.BlockMaxGas = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BlockMaxGas |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipParams(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthParams - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SynchronyParams) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SynchronyParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SynchronyParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Precision", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Precision == nil { - m.Precision = new(time.Duration) - } - if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(m.Precision, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MessageDelay", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.MessageDelay == nil { - m.MessageDelay = new(time.Duration) - } - if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(m.MessageDelay, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipParams(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthParams - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *FeatureParams) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: FeatureParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: FeatureParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VoteExtensionsEnableHeight", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.VoteExtensionsEnableHeight == nil { - m.VoteExtensionsEnableHeight = &wrapperspb.Int64Value{} - } - if err := m.VoteExtensionsEnableHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PbtsEnableHeight", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.PbtsEnableHeight == nil { - m.PbtsEnableHeight = &wrapperspb.Int64Value{} - } - if err := m.PbtsEnableHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipParams(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthParams - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipParams(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowParams - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowParams - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowParams - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthParams - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupParams - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthParams - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/consensus/types/query.pb.go b/x/consensus/types/query.pb.go index 7ca6a7774024..8c344063a082 100644 --- a/x/consensus/types/query.pb.go +++ b/x/consensus/types/query.pb.go @@ -6,6 +6,7 @@ package types import ( context "context" fmt "fmt" + v1 "github.com/cometbft/cometbft/api/cometbft/types/v1" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -70,7 +71,7 @@ type QueryParamsResponse struct { // params are the tendermint consensus params stored in the consensus module. // Please note that `params.version` is not populated in this response, it is // tracked separately in the x/upgrade module. - Params *ConsensusParams `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` + Params *v1.ConsensusParams `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` } func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } @@ -106,7 +107,7 @@ func (m *QueryParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo -func (m *QueryParamsResponse) GetParams() *ConsensusParams { +func (m *QueryParamsResponse) GetParams() *v1.ConsensusParams { if m != nil { return m.Params } @@ -121,23 +122,24 @@ func init() { func init() { proto.RegisterFile("cosmos/consensus/v1/query.proto", fileDescriptor_bf54d1e5df04cee9) } var fileDescriptor_bf54d1e5df04cee9 = []byte{ - // 250 bytes of a gzipped FileDescriptorProto + // 271 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4f, 0xce, 0x2f, 0xce, 0xcd, 0x2f, 0xd6, 0x4f, 0xce, 0xcf, 0x2b, 0x4e, 0xcd, 0x2b, 0x2e, 0x2d, 0xd6, 0x2f, 0x33, 0xd4, 0x2f, 0x2c, 0x4d, 0x2d, 0xaa, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x86, 0x28, 0xd0, 0x83, 0x2b, 0xd0, 0x2b, 0x33, 0x94, 0x92, 0x49, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, 0x4f, 0x2c, 0xc8, 0xd4, 0x4f, 0xcc, 0xcb, 0xcb, 0x2f, 0x49, 0x2c, 0xc9, 0xcc, 0xcf, 0x2b, 0x86, 0x68, 0x91, - 0x52, 0xc0, 0x66, 0x66, 0x41, 0x62, 0x51, 0x62, 0x2e, 0x54, 0x85, 0x92, 0x08, 0x97, 0x50, 0x20, - 0xc8, 0x8e, 0x00, 0xb0, 0x60, 0x50, 0x6a, 0x61, 0x69, 0x6a, 0x71, 0x89, 0x52, 0x30, 0x97, 0x30, - 0x8a, 0x68, 0x71, 0x01, 0xc8, 0x00, 0x21, 0x1b, 0x2e, 0x36, 0x88, 0x66, 0x09, 0x46, 0x05, 0x46, - 0x0d, 0x6e, 0x23, 0x15, 0x3d, 0x2c, 0x4e, 0xd2, 0x73, 0x86, 0x71, 0xa0, 0xba, 0xa1, 0x7a, 0x8c, - 0xba, 0x18, 0xb9, 0x58, 0xc1, 0xa6, 0x0a, 0x35, 0x30, 0x72, 0xb1, 0x41, 0x24, 0x85, 0xd4, 0xb1, - 0x1a, 0x81, 0xe9, 0x24, 0x29, 0x0d, 0xc2, 0x0a, 0x21, 0xae, 0x54, 0x52, 0x6e, 0xba, 0xfc, 0x64, - 0x32, 0x93, 0xac, 0x90, 0xb4, 0x3e, 0x6e, 0xdf, 0x3b, 0x59, 0x9c, 0x78, 0x24, 0xc7, 0x78, 0xe1, - 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, - 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x1c, 0x44, 0x57, 0x71, 0x4a, 0xb6, 0x5e, 0x66, 0xbe, 0x7e, 0x05, - 0x92, 0xee, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0x70, 0xc0, 0x19, 0x03, 0x02, 0x00, 0x00, - 0xff, 0xff, 0x6d, 0x07, 0xe2, 0x57, 0xb0, 0x01, 0x00, 0x00, + 0x92, 0x4b, 0xce, 0xcf, 0x4d, 0x2d, 0x49, 0x4a, 0x2b, 0xd1, 0x2f, 0xa9, 0x2c, 0x48, 0x05, 0x9b, + 0x58, 0x90, 0x58, 0x94, 0x98, 0x0b, 0x95, 0x57, 0x12, 0xe1, 0x12, 0x0a, 0x04, 0xd9, 0x10, 0x00, + 0x16, 0x0c, 0x4a, 0x2d, 0x2c, 0x4d, 0x2d, 0x2e, 0x51, 0x0a, 0xe4, 0x12, 0x46, 0x11, 0x2d, 0x2e, + 0x00, 0xd9, 0x28, 0x64, 0xc5, 0xc5, 0x06, 0xd1, 0x2c, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x6d, 0xa4, + 0xa4, 0x07, 0x33, 0x5d, 0x0f, 0x6c, 0xba, 0x5e, 0x99, 0xa1, 0x9e, 0x33, 0xcc, 0x6d, 0x50, 0xbd, + 0x50, 0x1d, 0x46, 0x5d, 0x8c, 0x5c, 0xac, 0x60, 0x33, 0x85, 0x1a, 0x18, 0xb9, 0xd8, 0x20, 0x92, + 0x42, 0xea, 0x7a, 0x58, 0x7c, 0xa4, 0x87, 0xe9, 0x20, 0x29, 0x0d, 0xc2, 0x0a, 0x21, 0x6e, 0x54, + 0x52, 0x6e, 0xba, 0xfc, 0x64, 0x32, 0x93, 0xac, 0x90, 0xb4, 0x3e, 0xb6, 0xd0, 0x84, 0x38, 0xc6, + 0xc9, 0xe2, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, + 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0xe4, 0x20, 0xba, 0x8a, + 0x53, 0xb2, 0xf5, 0x32, 0xf3, 0xf5, 0x2b, 0x90, 0x74, 0x83, 0x7d, 0x98, 0xc4, 0x06, 0x0e, 0x36, + 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x63, 0xcb, 0xf0, 0x2b, 0xac, 0x01, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -429,7 +431,7 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Params == nil { - m.Params = &ConsensusParams{} + m.Params = &v1.ConsensusParams{} } if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/x/consensus/types/tx.pb.go b/x/consensus/types/tx.pb.go index b1c1c1467312..ee6f9cab31a0 100644 --- a/x/consensus/types/tx.pb.go +++ b/x/consensus/types/tx.pb.go @@ -6,6 +6,7 @@ package types import ( context "context" fmt "fmt" + v1 "github.com/cometbft/cometbft/api/cometbft/types/v1" _ "github.com/cosmos/cosmos-proto" _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" @@ -39,11 +40,12 @@ type MsgUpdateParams struct { // separarately in x/upgrade. // // NOTE: All parameters must be supplied. - Block *BlockParams `protobuf:"bytes,2,opt,name=block,proto3" json:"block,omitempty"` - Evidence *EvidenceParams `protobuf:"bytes,3,opt,name=evidence,proto3" json:"evidence,omitempty"` - Validator *ValidatorParams `protobuf:"bytes,4,opt,name=validator,proto3" json:"validator,omitempty"` - Synchrony *SynchronyParams `protobuf:"bytes,6,opt,name=synchrony,proto3" json:"synchrony,omitempty"` - Feature *FeatureParams `protobuf:"bytes,7,opt,name=feature,proto3" json:"feature,omitempty"` + Block *v1.BlockParams `protobuf:"bytes,2,opt,name=block,proto3" json:"block,omitempty"` + Evidence *v1.EvidenceParams `protobuf:"bytes,3,opt,name=evidence,proto3" json:"evidence,omitempty"` + Validator *v1.ValidatorParams `protobuf:"bytes,4,opt,name=validator,proto3" json:"validator,omitempty"` + Abci *v1.ABCIParams `protobuf:"bytes,5,opt,name=abci,proto3" json:"abci,omitempty"` // Deprecated: Do not use. + Synchrony *v1.SynchronyParams `protobuf:"bytes,6,opt,name=synchrony,proto3" json:"synchrony,omitempty"` + Feature *v1.FeatureParams `protobuf:"bytes,7,opt,name=feature,proto3" json:"feature,omitempty"` } func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } @@ -86,35 +88,43 @@ func (m *MsgUpdateParams) GetAuthority() string { return "" } -func (m *MsgUpdateParams) GetBlock() *BlockParams { +func (m *MsgUpdateParams) GetBlock() *v1.BlockParams { if m != nil { return m.Block } return nil } -func (m *MsgUpdateParams) GetEvidence() *EvidenceParams { +func (m *MsgUpdateParams) GetEvidence() *v1.EvidenceParams { if m != nil { return m.Evidence } return nil } -func (m *MsgUpdateParams) GetValidator() *ValidatorParams { +func (m *MsgUpdateParams) GetValidator() *v1.ValidatorParams { if m != nil { return m.Validator } return nil } -func (m *MsgUpdateParams) GetSynchrony() *SynchronyParams { +// Deprecated: Do not use. +func (m *MsgUpdateParams) GetAbci() *v1.ABCIParams { + if m != nil { + return m.Abci + } + return nil +} + +func (m *MsgUpdateParams) GetSynchrony() *v1.SynchronyParams { if m != nil { return m.Synchrony } return nil } -func (m *MsgUpdateParams) GetFeature() *FeatureParams { +func (m *MsgUpdateParams) GetFeature() *v1.FeatureParams { if m != nil { return m.Feature } @@ -167,36 +177,38 @@ func init() { func init() { proto.RegisterFile("cosmos/consensus/v1/tx.proto", fileDescriptor_2135c60575ab504d) } var fileDescriptor_2135c60575ab504d = []byte{ - // 449 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x49, 0xce, 0x2f, 0xce, - 0xcd, 0x2f, 0xd6, 0x4f, 0xce, 0xcf, 0x2b, 0x4e, 0xcd, 0x2b, 0x2e, 0x2d, 0xd6, 0x2f, 0x33, 0xd4, - 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x86, 0xc8, 0xea, 0xc1, 0x65, 0xf5, - 0xca, 0x0c, 0xa5, 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x9d, 0x94, 0x24, - 0x44, 0x5d, 0x3c, 0x98, 0xa7, 0x0f, 0xd5, 0x04, 0x91, 0x12, 0x87, 0x5a, 0x90, 0x5b, 0x9c, 0x0e, - 0x32, 0x3a, 0xb7, 0x38, 0x1d, 0x2a, 0xa1, 0x80, 0xcd, 0xe6, 0x82, 0xc4, 0xa2, 0xc4, 0x5c, 0xa8, - 0x56, 0xa5, 0xb7, 0xcc, 0x5c, 0xfc, 0xbe, 0xc5, 0xe9, 0xa1, 0x05, 0x29, 0x89, 0x25, 0xa9, 0x01, - 0x60, 0x19, 0x21, 0x33, 0x2e, 0xce, 0xc4, 0xd2, 0x92, 0x8c, 0xfc, 0xa2, 0xcc, 0x92, 0x4a, 0x09, - 0x46, 0x05, 0x46, 0x0d, 0x4e, 0x27, 0x89, 0x4b, 0x5b, 0x74, 0x45, 0xa0, 0x76, 0x3a, 0xa6, 0xa4, - 0x14, 0xa5, 0x16, 0x17, 0x07, 0x97, 0x14, 0x65, 0xe6, 0xa5, 0x07, 0x21, 0x94, 0x0a, 0x99, 0x71, - 0xb1, 0x26, 0xe5, 0xe4, 0x27, 0x67, 0x4b, 0x30, 0x29, 0x30, 0x6a, 0x70, 0x1b, 0x29, 0xe8, 0x61, - 0xf1, 0x99, 0x9e, 0x13, 0x48, 0x05, 0xc4, 0xa2, 0x20, 0x88, 0x72, 0x21, 0x7b, 0x2e, 0x8e, 0xd4, - 0xb2, 0xcc, 0x94, 0xd4, 0xbc, 0xe4, 0x54, 0x09, 0x66, 0xb0, 0x56, 0x65, 0xac, 0x5a, 0x5d, 0xa1, - 0x8a, 0xa0, 0xba, 0xe1, 0x9a, 0x84, 0x9c, 0xb8, 0x38, 0xcb, 0x12, 0x73, 0x32, 0x53, 0x12, 0x4b, - 0xf2, 0x8b, 0x24, 0x58, 0xc0, 0x26, 0xa8, 0x60, 0x35, 0x21, 0x0c, 0xa6, 0x0a, 0x6a, 0x04, 0x42, - 0x9b, 0x50, 0x38, 0x17, 0x67, 0x71, 0x65, 0x5e, 0x72, 0x46, 0x51, 0x7e, 0x5e, 0xa5, 0x04, 0x1b, - 0x1e, 0x33, 0x82, 0x61, 0xaa, 0x20, 0x66, 0x38, 0x09, 0xdf, 0xda, 0xa2, 0xcb, 0x0f, 0x51, 0xa8, - 0x5b, 0x9c, 0x92, 0xad, 0x60, 0xa0, 0x67, 0x6a, 0x14, 0x84, 0x30, 0x4b, 0x28, 0x90, 0x8b, 0x3d, - 0x2d, 0x35, 0xb1, 0xa4, 0xb4, 0x28, 0x55, 0x82, 0x1d, 0x6c, 0xac, 0x12, 0x56, 0x63, 0xdd, 0x20, - 0x6a, 0xf0, 0x19, 0x0a, 0x33, 0xc7, 0xca, 0xb2, 0xe9, 0xf9, 0x06, 0x2d, 0x44, 0xc0, 0x77, 0x3d, - 0xdf, 0xa0, 0xa5, 0x86, 0x50, 0xac, 0x5f, 0x81, 0x14, 0xdf, 0x68, 0x71, 0xab, 0x24, 0xc9, 0x25, - 0x8e, 0x26, 0x14, 0x94, 0x5a, 0x5c, 0x00, 0x52, 0x6e, 0xd4, 0xca, 0xc8, 0xc5, 0xec, 0x5b, 0x9c, - 0x2e, 0x54, 0xce, 0xc5, 0x83, 0x92, 0x1c, 0xb0, 0x07, 0x03, 0x9a, 0x29, 0x52, 0x3a, 0xc4, 0xa8, - 0x82, 0xd9, 0xa5, 0x24, 0x7c, 0x0a, 0xdd, 0x7f, 0x26, 0xe6, 0x52, 0xac, 0x0d, 0xcf, 0x37, 0x68, - 0x31, 0x3a, 0x59, 0x9c, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, - 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x1c, 0x44, - 0x47, 0x71, 0x4a, 0xb6, 0x5e, 0x66, 0x3e, 0x8a, 0x37, 0x4b, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, - 0xc0, 0x69, 0xda, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x2d, 0x29, 0xd1, 0x50, 0x71, 0x03, 0x00, - 0x00, + // 496 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0x4f, 0x8b, 0xd3, 0x40, + 0x18, 0xc6, 0x1b, 0xb7, 0xdd, 0xb5, 0xa3, 0xb0, 0x98, 0x2a, 0x3b, 0x5b, 0x74, 0xa8, 0x45, 0x64, + 0x29, 0x76, 0xb2, 0xad, 0xeb, 0x5f, 0x10, 0xdc, 0x88, 0xa2, 0x87, 0x45, 0xc9, 0xb2, 0x1e, 0xbc, + 0xc8, 0x34, 0x99, 0xcd, 0x86, 0x6e, 0x32, 0x21, 0x33, 0x8d, 0xdb, 0x9b, 0x08, 0x5e, 0x3c, 0xf9, + 0x45, 0x84, 0x1e, 0xf6, 0x43, 0x88, 0xa7, 0xc5, 0x93, 0x78, 0x92, 0xf6, 0xd0, 0xaf, 0x21, 0x9d, + 0x99, 0x6c, 0x6c, 0x8d, 0xb2, 0x97, 0x40, 0xf2, 0x3c, 0xbf, 0xe7, 0xc9, 0xbc, 0x79, 0x03, 0xae, + 0xba, 0x8c, 0x87, 0x8c, 0x5b, 0x2e, 0x8b, 0x38, 0x8d, 0xf8, 0x80, 0x5b, 0x69, 0xc7, 0x12, 0x47, + 0x38, 0x4e, 0x98, 0x60, 0x66, 0x4d, 0xa9, 0xf8, 0x54, 0xc5, 0x69, 0xa7, 0x7e, 0x89, 0x84, 0x41, + 0xc4, 0x2c, 0x79, 0x55, 0xbe, 0xfa, 0xba, 0xf2, 0xbd, 0x95, 0x77, 0x96, 0x86, 0x94, 0xb4, 0xa6, + 0x0b, 0x42, 0xee, 0xcf, 0xa2, 0x43, 0xee, 0x6b, 0x01, 0xb9, 0x2c, 0xa4, 0xa2, 0xb7, 0x2f, 0x2c, + 0x31, 0x8c, 0xa9, 0xec, 0x8d, 0x49, 0x42, 0x42, 0x0d, 0x36, 0xbf, 0x94, 0xc1, 0xea, 0x0e, 0xf7, + 0xf7, 0x62, 0x8f, 0x08, 0xfa, 0x4a, 0x2a, 0xe6, 0x5d, 0x50, 0x25, 0x03, 0x71, 0xc0, 0x92, 0x40, + 0x0c, 0xa1, 0xd1, 0x30, 0x36, 0xaa, 0x36, 0xfc, 0x7e, 0xdc, 0xbe, 0xac, 0x1b, 0xb7, 0x3d, 0x2f, + 0xa1, 0x9c, 0xef, 0x8a, 0x24, 0x88, 0x7c, 0x27, 0xb7, 0x9a, 0x5b, 0xa0, 0xd2, 0x3b, 0x64, 0x6e, + 0x1f, 0x9e, 0x6b, 0x18, 0x1b, 0x17, 0xba, 0x08, 0x67, 0xdd, 0x58, 0x76, 0xe3, 0xb4, 0x83, 0xed, + 0x99, 0xae, 0x6a, 0x1c, 0x65, 0x36, 0x1f, 0x81, 0xf3, 0x34, 0x0d, 0x3c, 0x1a, 0xb9, 0x14, 0x2e, + 0x49, 0xf0, 0x7a, 0x01, 0xf8, 0x54, 0x5b, 0x34, 0x7b, 0x8a, 0x98, 0x8f, 0x41, 0x35, 0x25, 0x87, + 0x81, 0x47, 0x04, 0x4b, 0x60, 0x59, 0xf2, 0xcd, 0x02, 0xfe, 0x75, 0xe6, 0xd1, 0x01, 0x39, 0x64, + 0x3e, 0x07, 0x65, 0xd2, 0x73, 0x03, 0x58, 0x91, 0xf0, 0xb5, 0x02, 0x78, 0xdb, 0x7e, 0xf2, 0x42, + 0x71, 0xf6, 0x95, 0x9f, 0xc7, 0xed, 0x55, 0x35, 0x88, 0x36, 0xf7, 0xfa, 0x8d, 0x4d, 0x7c, 0x67, + 0x13, 0x1a, 0x8e, 0x4c, 0x30, 0xf7, 0x40, 0x95, 0x0f, 0x23, 0xf7, 0x20, 0x61, 0xd1, 0x10, 0x2e, + 0xff, 0xf3, 0x5d, 0x76, 0x33, 0x8f, 0xce, 0xac, 0xfd, 0x9d, 0xd9, 0x75, 0xf2, 0x24, 0xf3, 0x25, + 0x58, 0xd9, 0xa7, 0x44, 0x0c, 0x12, 0x0a, 0x57, 0x64, 0x68, 0xa3, 0x20, 0xf4, 0x99, 0x72, 0xfc, + 0x2f, 0x32, 0x4b, 0x79, 0xf8, 0xe0, 0xc3, 0x74, 0xd4, 0xca, 0x3f, 0xdc, 0xa7, 0xe9, 0xa8, 0x75, + 0x33, 0x37, 0x5b, 0x47, 0x7f, 0xec, 0xe9, 0xc2, 0x6e, 0x34, 0xd7, 0xc1, 0xda, 0xc2, 0x23, 0x87, + 0xf2, 0x78, 0x66, 0xef, 0x7e, 0x34, 0xc0, 0xd2, 0x0e, 0xf7, 0xcd, 0x77, 0xe0, 0xe2, 0xdc, 0x3a, + 0xdd, 0xc0, 0x05, 0xfb, 0x8d, 0x17, 0x52, 0xea, 0xb7, 0xce, 0xe2, 0xca, 0xba, 0x9a, 0xb5, 0x6f, + 0x8b, 0xe7, 0xdb, 0xba, 0x57, 0xaf, 0xbc, 0x9f, 0x8e, 0x5a, 0x86, 0x7d, 0xff, 0xeb, 0x18, 0x19, + 0x27, 0x63, 0x64, 0xfc, 0x1a, 0x23, 0xe3, 0xf3, 0x04, 0x95, 0x4e, 0x26, 0xa8, 0xf4, 0x63, 0x82, + 0x4a, 0x6f, 0x90, 0x22, 0xb8, 0xd7, 0xc7, 0x01, 0x9b, 0x3b, 0xa6, 0x1c, 0x63, 0x6f, 0x59, 0xfe, + 0x13, 0xb7, 0x7f, 0x07, 0x00, 0x00, 0xff, 0xff, 0x3b, 0x57, 0xe6, 0xfa, 0xaf, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -328,6 +340,18 @@ func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x32 } + if m.Abci != nil { + { + size, err := m.Abci.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } if m.Validator != nil { { size, err := m.Validator.MarshalToSizedBuffer(dAtA[:i]) @@ -430,6 +454,10 @@ func (m *MsgUpdateParams) Size() (n int) { l = m.Validator.Size() n += 1 + l + sovTx(uint64(l)) } + if m.Abci != nil { + l = m.Abci.Size() + n += 1 + l + sovTx(uint64(l)) + } if m.Synchrony != nil { l = m.Synchrony.Size() n += 1 + l + sovTx(uint64(l)) @@ -547,7 +575,7 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Block == nil { - m.Block = &BlockParams{} + m.Block = &v1.BlockParams{} } if err := m.Block.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -583,7 +611,7 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Evidence == nil { - m.Evidence = &EvidenceParams{} + m.Evidence = &v1.EvidenceParams{} } if err := m.Evidence.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -619,12 +647,48 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Validator == nil { - m.Validator = &ValidatorParams{} + m.Validator = &v1.ValidatorParams{} } if err := m.Validator.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Abci", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Abci == nil { + m.Abci = &v1.ABCIParams{} + } + if err := m.Abci.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Synchrony", wireType) @@ -655,7 +719,7 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Synchrony == nil { - m.Synchrony = &SynchronyParams{} + m.Synchrony = &v1.SynchronyParams{} } if err := m.Synchrony.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -691,7 +755,7 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Feature == nil { - m.Feature = &FeatureParams{} + m.Feature = &v1.FeatureParams{} } if err := m.Feature.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err From 8b919fd234414deacbfa2d3873f6c11e0e8a2ad2 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Fri, 30 Aug 2024 14:21:31 +0200 Subject: [PATCH 03/23] test --- x/auth/ante/ante.go | 3 +- x/auth/ante/expected_keepers.go | 3 +- x/auth/ante/setup.go | 27 ++++------- x/evidence/go.mod | 2 +- x/evidence/keeper/infraction.go | 32 ++++++------- x/evidence/keeper/keeper.go | 11 +++-- x/evidence/types/expected_keepers.go | 4 ++ x/staking/keeper/keeper.go | 1 + x/staking/keeper/msg_server.go | 69 +++++++++++----------------- x/staking/types/expected_keepers.go | 3 +- x/upgrade/keeper/abci.go | 16 +------ x/upgrade/keeper/keeper.go | 2 + x/upgrade/types/expected_keeper.go | 7 +++ 13 files changed, 76 insertions(+), 104 deletions(-) create mode 100644 x/upgrade/types/expected_keeper.go diff --git a/x/auth/ante/ante.go b/x/auth/ante/ante.go index b052f943b624..7e53474f87cd 100644 --- a/x/auth/ante/ante.go +++ b/x/auth/ante/ante.go @@ -19,6 +19,7 @@ type HandlerOptions struct { AccountKeeper AccountKeeper AccountAbstractionKeeper AccountAbstractionKeeper BankKeeper types.BankKeeper + ConsensusKeeper ConsensusKeeper ExtensionOptionChecker ExtensionOptionChecker FeegrantKeeper FeegrantKeeper SignModeHandler *txsigning.HandlerMap @@ -44,7 +45,7 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) { } anteDecorators := []sdk.AnteDecorator{ - NewSetUpContextDecorator(options.Environment), // outermost AnteDecorator. SetUpContext must be called first + NewSetUpContextDecorator(options.Environment, options.ConsensusKeeper), // outermost AnteDecorator. SetUpContext must be called first NewExtensionOptionsDecorator(options.ExtensionOptionChecker), NewValidateBasicDecorator(options.Environment), NewTxTimeoutHeightDecorator(options.Environment), diff --git a/x/auth/ante/expected_keepers.go b/x/auth/ante/expected_keepers.go index 82fc9846a3af..4f4fc28d8f9f 100644 --- a/x/auth/ante/expected_keepers.go +++ b/x/auth/ante/expected_keepers.go @@ -6,7 +6,6 @@ import ( "cosmossdk.io/core/address" "cosmossdk.io/core/appmodule" "cosmossdk.io/x/auth/types" - consensustypes "cosmossdk.io/x/consensus/types" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -29,5 +28,5 @@ type FeegrantKeeper interface { } type ConsensusKeeper interface { - Params(context.Context, *consensustypes.QueryParamsRequest) (*consensustypes.QueryParamsResponse, error) + BlockGas(context.Context) (uint64, error) } diff --git a/x/auth/ante/setup.go b/x/auth/ante/setup.go index e81a7cba5051..20617d3fff77 100644 --- a/x/auth/ante/setup.go +++ b/x/auth/ante/setup.go @@ -6,7 +6,6 @@ import ( "cosmossdk.io/core/appmodule" errorsmod "cosmossdk.io/errors" storetypes "cosmossdk.io/store/types" - consensusv1 "cosmossdk.io/x/consensus/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -24,12 +23,14 @@ type GasTx interface { // CONTRACT: Must be first decorator in the chain // CONTRACT: Tx must implement GasTx interface type SetUpContextDecorator struct { - env appmodule.Environment + env appmodule.Environment + consensusKeeper ConsensusKeeper } -func NewSetUpContextDecorator(env appmodule.Environment) SetUpContextDecorator { +func NewSetUpContextDecorator(env appmodule.Environment, consensusKeeper ConsensusKeeper) SetUpContextDecorator { return SetUpContextDecorator{ - env: env, + env: env, + consensusKeeper: consensusKeeper, } } @@ -45,23 +46,15 @@ func (sud SetUpContextDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, _ bool, newCtx = SetGasMeter(ctx, gasTx.GetGas()) - // TODO: possibly cache the result of this query for other antehandlers to use - resp, err := sud.env.QueryRouterService.Invoke(ctx, &consensusv1.QueryParamsRequest{}) + maxGas, err := sud.consensusKeeper.BlockGas(ctx) if err != nil { return newCtx, err } - res, ok := resp.(*consensusv1.QueryParamsResponse) - if !ok { - return newCtx, fmt.Errorf("unexpected response type: %T", resp) - } - - if res.Params.Block != nil { - // If there exists a maximum block gas limit, we must ensure that the tx - // does not exceed it. - if res.Params.Block.MaxGas > 0 && gasTx.GetGas() > uint64(res.Params.Block.MaxGas) { - return newCtx, errorsmod.Wrapf(sdkerrors.ErrInvalidGasLimit, "tx gas limit %d exceeds block max gas %d", gasTx.GetGas(), res.Params.Block.MaxGas) - } + // If there exists a maximum block gas limit, we must ensure that the tx + // does not exceed it. + if maxGas > 0 && gasTx.GetGas() > uint64(maxGas) { + return newCtx, errorsmod.Wrapf(sdkerrors.ErrInvalidGasLimit, "tx gas limit %d exceeds block max gas %d", gasTx.GetGas(), maxGas) } // Decorator will catch an OutOfGasPanic caused in the next antehandler diff --git a/x/evidence/go.mod b/x/evidence/go.mod index 4313ede7792e..78d8aaf1de4d 100644 --- a/x/evidence/go.mod +++ b/x/evidence/go.mod @@ -11,7 +11,6 @@ require ( cosmossdk.io/errors v1.0.1 cosmossdk.io/math v1.3.0 cosmossdk.io/store v1.1.1-0.20240418092142-896cdf1971bc - cosmossdk.io/x/consensus v0.0.0-00010101000000-000000000000 github.com/cosmos/cosmos-proto v1.0.0-beta.5 github.com/cosmos/cosmos-sdk v0.53.0 github.com/cosmos/gogoproto v1.7.0 @@ -27,6 +26,7 @@ require ( require ( buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.34.2-20240701160653-fedbb9acfd2f.2 // indirect + cosmossdk.io/x/consensus v0.0.0-00010101000000-000000000000 // indirect buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.34.2-20240130113600-88ef6483f90f.2 // indirect cosmossdk.io/log v1.4.1 // indirect cosmossdk.io/schema v0.1.1 // indirect diff --git a/x/evidence/keeper/infraction.go b/x/evidence/keeper/infraction.go index ac417aa6c664..354c81de600e 100644 --- a/x/evidence/keeper/infraction.go +++ b/x/evidence/keeper/infraction.go @@ -5,7 +5,6 @@ import ( "fmt" st "cosmossdk.io/api/cosmos/staking/v1beta1" - consensusv1 "cosmossdk.io/x/consensus/types" "cosmossdk.io/x/evidence/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -73,27 +72,22 @@ func (k Keeper) handleEquivocationEvidence(ctx context.Context, evidence *types. // Reject evidence if the double-sign is too old. Evidence is considered stale // if the difference in time and number of blocks is greater than the allowed // parameters defined. - resp, err := k.QueryRouterService.Invoke(ctx, &consensusv1.QueryParamsRequest{}) + + eviAgeBlocks, eviAgeDuration, err := k.consensusKeeper.EvidenceAge(ctx) if err != nil { - return fmt.Errorf("failed to query consensus params: %w", err) - } - res, ok := resp.(*consensusv1.QueryParamsResponse) - if !ok { - return fmt.Errorf("unexpected response type: %T", resp) + return err } - if res.Params.Evidence != nil { - if ageDuration > res.Params.Evidence.MaxAgeDuration && ageBlocks > res.Params.Evidence.MaxAgeNumBlocks { - k.Logger.Info( - "ignored equivocation; evidence too old", - "validator", consAddr, - "infraction_height", infractionHeight, - "max_age_num_blocks", res.Params.Evidence.MaxAgeNumBlocks, - "infraction_time", infractionTime, - "max_age_duration", res.Params.Evidence.MaxAgeDuration, - ) - return nil - } + if ageDuration > eviAgeDuration && ageBlocks > eviAgeBlocks { + k.Logger.Info( + "ignored equivocation; evidence too old", + "validator", consAddr, + "infraction_height", infractionHeight, + "max_age_num_blocks", eviAgeBlocks, + "infraction_time", infractionTime, + "max_age_duration", eviAgeDuration, + ) + return nil } if ok := k.slashingKeeper.HasValidatorSigningInfo(ctx, consAddr); !ok { diff --git a/x/evidence/keeper/keeper.go b/x/evidence/keeper/keeper.go index 1a3356f420ae..edc099ed1496 100644 --- a/x/evidence/keeper/keeper.go +++ b/x/evidence/keeper/keeper.go @@ -23,11 +23,12 @@ import ( type Keeper struct { appmodule.Environment - cdc codec.BinaryCodec - router types.Router - stakingKeeper types.StakingKeeper - slashingKeeper types.SlashingKeeper - addressCodec address.Codec + cdc codec.BinaryCodec + router types.Router + stakingKeeper types.StakingKeeper + slashingKeeper types.SlashingKeeper + consensusKeeper types.ConsensusKeeper + addressCodec address.Codec Schema collections.Schema // Evidences key: evidence hash bytes | value: Evidence diff --git a/x/evidence/types/expected_keepers.go b/x/evidence/types/expected_keepers.go index 3362deb8c4b6..eccbf90758ec 100644 --- a/x/evidence/types/expected_keepers.go +++ b/x/evidence/types/expected_keepers.go @@ -37,3 +37,7 @@ type SlashingKeeper interface { type AccountKeeper interface { SetAccount(ctx context.Context, acc sdk.AccountI) } + +type ConsensusKeeper interface { + EvidenceAge(context.Context) (int64, time.Duration, error) +} diff --git a/x/staking/keeper/keeper.go b/x/staking/keeper/keeper.go index caa49e44a55e..17e38633548b 100644 --- a/x/staking/keeper/keeper.go +++ b/x/staking/keeper/keeper.go @@ -57,6 +57,7 @@ type Keeper struct { cdc codec.BinaryCodec authKeeper types.AccountKeeper bankKeeper types.BankKeeper + consensusKeeper types.ConsensusKeeper hooks types.StakingHooks authority string validatorAddressCodec addresscodec.Codec diff --git a/x/staking/keeper/msg_server.go b/x/staking/keeper/msg_server.go index cd8fc499c012..b1c2c5717300 100644 --- a/x/staking/keeper/msg_server.go +++ b/x/staking/keeper/msg_server.go @@ -17,7 +17,6 @@ import ( "cosmossdk.io/core/event" errorsmod "cosmossdk.io/errors" "cosmossdk.io/math" - consensusv1 "cosmossdk.io/x/consensus/types" "cosmossdk.io/x/staking/types" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" @@ -69,30 +68,24 @@ func (k msgServer) CreateValidator(ctx context.Context, msg *types.MsgCreateVali return nil, errorsmod.Wrapf(sdkerrors.ErrInvalidType, "Expecting cryptotypes.PubKey, got %T", msg.Pubkey.GetCachedValue()) } - resp, err := k.QueryRouterService.Invoke(ctx, &consensusv1.QueryParamsRequest{}) + pubkeyTypes, err := k.consensusKeeper.ValidatorPubKeyTypes(ctx) if err != nil { return nil, errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "failed to query consensus params: %s", err) } - res, ok := resp.(*consensusv1.QueryParamsResponse) - if !ok { - return nil, errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "unexpected response type: %T", resp) - } - if res.Params.Validator != nil { - pkType := pk.Type() - if !slices.Contains(res.Params.Validator.PubKeyTypes, pkType) { - return nil, errorsmod.Wrapf( - types.ErrValidatorPubKeyTypeNotSupported, - "got: %s, expected: %s", pk.Type(), res.Params.Validator.PubKeyTypes, - ) - } + pkType := pk.Type() + if !slices.Contains(pubkeyTypes, pkType) { + return nil, errorsmod.Wrapf( + types.ErrValidatorPubKeyTypeNotSupported, + "got: %s, expected: %s", pk.Type(), pubkeyTypes, + ) + } - if pkType == sdk.PubKeyEd25519Type && len(pk.Bytes()) != ed25519.PubKeySize { - return nil, errorsmod.Wrapf( - types.ErrConsensusPubKeyLenInvalid, - "got: %d, expected: %d", len(pk.Bytes()), ed25519.PubKeySize, - ) - } + if pkType == sdk.PubKeyEd25519Type && len(pk.Bytes()) != ed25519.PubKeySize { + return nil, errorsmod.Wrapf( + types.ErrConsensusPubKeyLenInvalid, + "got: %d, expected: %d", len(pk.Bytes()), ed25519.PubKeySize, + ) } err = k.checkConsKeyAlreadyUsed(ctx, pk) @@ -656,31 +649,21 @@ func (k msgServer) RotateConsPubKey(ctx context.Context, msg *types.MsgRotateCon return nil, errorsmod.Wrapf(sdkerrors.ErrInvalidType, "expecting cryptotypes.PubKey, got %T", cv) } - // check if the new public key type is valid - resp, err := k.QueryRouterService.Invoke(ctx, &consensusv1.QueryParamsRequest{}) - if err != nil { - return nil, errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "failed to query consensus params: %s", err) - } - paramsRes, ok := resp.(*consensusv1.QueryParamsResponse) - if !ok { - return nil, errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "unexpected response type: %T", resp) - } + pubkeyTypes, err := k.consensusKeeper.ValidatorPubKeyTypes(ctx) - if paramsRes.Params.Validator != nil { - pkType := pk.Type() - if !slices.Contains(paramsRes.Params.Validator.PubKeyTypes, pkType) { - return nil, errorsmod.Wrapf( - types.ErrValidatorPubKeyTypeNotSupported, - "got: %s, expected: %s", pk.Type(), paramsRes.Params.Validator.PubKeyTypes, - ) - } + pkType := pk.Type() + if !slices.Contains(pubkeyTypes, pkType) { + return nil, errorsmod.Wrapf( + types.ErrValidatorPubKeyTypeNotSupported, + "got: %s, expected: %s", pk.Type(), pubkeyTypes, + ) + } - if pkType == sdk.PubKeyEd25519Type && len(pk.Bytes()) != ed25519.PubKeySize { - return nil, errorsmod.Wrapf( - types.ErrConsensusPubKeyLenInvalid, - "got: %d, expected: %d", len(pk.Bytes()), ed25519.PubKeySize, - ) - } + if pkType == sdk.PubKeyEd25519Type && len(pk.Bytes()) != ed25519.PubKeySize { + return nil, errorsmod.Wrapf( + types.ErrConsensusPubKeyLenInvalid, + "got: %d, expected: %d", len(pk.Bytes()), ed25519.PubKeySize, + ) } err = k.checkConsKeyAlreadyUsed(ctx, pk) diff --git a/x/staking/types/expected_keepers.go b/x/staking/types/expected_keepers.go index bd246775a8b6..e757c2c2b586 100644 --- a/x/staking/types/expected_keepers.go +++ b/x/staking/types/expected_keepers.go @@ -6,7 +6,6 @@ import ( st "cosmossdk.io/api/cosmos/staking/v1beta1" "cosmossdk.io/core/address" "cosmossdk.io/math" - consensustypes "cosmossdk.io/x/consensus/types" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -117,5 +116,5 @@ type StakingHooksWrapper struct{ StakingHooks } func (StakingHooksWrapper) IsOnePerModuleType() {} type ConsensusKeeper interface { - Params(context.Context, *consensustypes.QueryParamsRequest) (*consensustypes.QueryParamsResponse, error) + ValidatorPubKeyTypes(context.Context) ([]string, error) } diff --git a/x/upgrade/keeper/abci.go b/x/upgrade/keeper/abci.go index 926dd4afec09..afaad8cf849b 100644 --- a/x/upgrade/keeper/abci.go +++ b/x/upgrade/keeper/abci.go @@ -5,7 +5,6 @@ import ( "errors" "fmt" - consensusv1 "cosmossdk.io/x/consensus/types" "cosmossdk.io/x/upgrade/types" "github.com/cosmos/cosmos-sdk/telemetry" @@ -43,20 +42,9 @@ func (k Keeper) PreBlocker(ctx context.Context) error { } if lastAppliedPlan != "" && !k.HasHandler(lastAppliedPlan) { - var appVersion uint64 - - resp, err := k.QueryRouterService.Invoke(ctx, &consensusv1.QueryParamsRequest{}) + appVersion, err := k.consensusKeeper.AppVersion(ctx) if err != nil { - return errors.New("failed to query consensus params") - } - - res, ok := resp.(*consensusv1.QueryParamsResponse) - if !ok { - return fmt.Errorf("unexpected response type: %T", resp) - } - - if res.Params.Version != nil { - appVersion = res.Params.Version.App + return err } return fmt.Errorf("wrong app version %d, upgrade handler is missing for %s upgrade plan", appVersion, lastAppliedPlan) diff --git a/x/upgrade/keeper/keeper.go b/x/upgrade/keeper/keeper.go index 6ca6a53d26f2..98871d6bd346 100644 --- a/x/upgrade/keeper/keeper.go +++ b/x/upgrade/keeper/keeper.go @@ -38,6 +38,8 @@ type Keeper struct { downgradeVerified bool // tells if we've already sanity checked that this binary version isn't being used against an old state. authority string // the address capable of executing and canceling an upgrade. Usually the gov module account initVersionMap appmodule.VersionMap // the module version map at init genesis + + consensusKeeper types.ConsensusKeeper } // NewKeeper constructs an upgrade Keeper which requires the following arguments: diff --git a/x/upgrade/types/expected_keeper.go b/x/upgrade/types/expected_keeper.go new file mode 100644 index 000000000000..7fcd2db94630 --- /dev/null +++ b/x/upgrade/types/expected_keeper.go @@ -0,0 +1,7 @@ +package types + +import "context" + +type ConsensusKeeper interface { + AppVersion(ctx context.Context) (uint64, error) +} From f503e17eb1990cc1de182a6e4251c9a53bc01d84 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Fri, 30 Aug 2024 14:22:14 +0200 Subject: [PATCH 04/23] remove unused pulsar --- api/cosmos/consensus/v1/consensus.pulsar.go | 899 ---- api/cosmos/consensus/v1/params.pulsar.go | 4918 ------------------- 2 files changed, 5817 deletions(-) delete mode 100644 api/cosmos/consensus/v1/consensus.pulsar.go delete mode 100644 api/cosmos/consensus/v1/params.pulsar.go diff --git a/api/cosmos/consensus/v1/consensus.pulsar.go b/api/cosmos/consensus/v1/consensus.pulsar.go deleted file mode 100644 index 7168b5e078a3..000000000000 --- a/api/cosmos/consensus/v1/consensus.pulsar.go +++ /dev/null @@ -1,899 +0,0 @@ -// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package consensusv1 - -import ( - v1 "buf.build/gen/go/cometbft/cometbft/protocolbuffers/go/cometbft/abci/v1" - fmt "fmt" - runtime "github.com/cosmos/cosmos-proto/runtime" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoiface "google.golang.org/protobuf/runtime/protoiface" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - io "io" - reflect "reflect" - sync "sync" -) - -var _ protoreflect.List = (*_CometInfo_1_list)(nil) - -type _CometInfo_1_list struct { - list *[]*v1.Misbehavior -} - -func (x *_CometInfo_1_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_CometInfo_1_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_CometInfo_1_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*v1.Misbehavior) - (*x.list)[i] = concreteValue -} - -func (x *_CometInfo_1_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*v1.Misbehavior) - *x.list = append(*x.list, concreteValue) -} - -func (x *_CometInfo_1_list) AppendMutable() protoreflect.Value { - v := new(v1.Misbehavior) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_CometInfo_1_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_CometInfo_1_list) NewElement() protoreflect.Value { - v := new(v1.Misbehavior) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_CometInfo_1_list) IsValid() bool { - return x.list != nil -} - -var ( - md_CometInfo protoreflect.MessageDescriptor - fd_CometInfo_evidence protoreflect.FieldDescriptor - fd_CometInfo_validators_hash protoreflect.FieldDescriptor - fd_CometInfo_proposer_address protoreflect.FieldDescriptor - fd_CometInfo_last_commit protoreflect.FieldDescriptor -) - -func init() { - file_cosmos_consensus_v1_consensus_proto_init() - md_CometInfo = File_cosmos_consensus_v1_consensus_proto.Messages().ByName("CometInfo") - fd_CometInfo_evidence = md_CometInfo.Fields().ByName("evidence") - fd_CometInfo_validators_hash = md_CometInfo.Fields().ByName("validators_hash") - fd_CometInfo_proposer_address = md_CometInfo.Fields().ByName("proposer_address") - fd_CometInfo_last_commit = md_CometInfo.Fields().ByName("last_commit") -} - -var _ protoreflect.Message = (*fastReflection_CometInfo)(nil) - -type fastReflection_CometInfo CometInfo - -func (x *CometInfo) ProtoReflect() protoreflect.Message { - return (*fastReflection_CometInfo)(x) -} - -func (x *CometInfo) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_consensus_v1_consensus_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_CometInfo_messageType fastReflection_CometInfo_messageType -var _ protoreflect.MessageType = fastReflection_CometInfo_messageType{} - -type fastReflection_CometInfo_messageType struct{} - -func (x fastReflection_CometInfo_messageType) Zero() protoreflect.Message { - return (*fastReflection_CometInfo)(nil) -} -func (x fastReflection_CometInfo_messageType) New() protoreflect.Message { - return new(fastReflection_CometInfo) -} -func (x fastReflection_CometInfo_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_CometInfo -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_CometInfo) Descriptor() protoreflect.MessageDescriptor { - return md_CometInfo -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_CometInfo) Type() protoreflect.MessageType { - return _fastReflection_CometInfo_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_CometInfo) New() protoreflect.Message { - return new(fastReflection_CometInfo) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_CometInfo) Interface() protoreflect.ProtoMessage { - return (*CometInfo)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_CometInfo) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.Evidence) != 0 { - value := protoreflect.ValueOfList(&_CometInfo_1_list{list: &x.Evidence}) - if !f(fd_CometInfo_evidence, value) { - return - } - } - if len(x.ValidatorsHash) != 0 { - value := protoreflect.ValueOfBytes(x.ValidatorsHash) - if !f(fd_CometInfo_validators_hash, value) { - return - } - } - if len(x.ProposerAddress) != 0 { - value := protoreflect.ValueOfBytes(x.ProposerAddress) - if !f(fd_CometInfo_proposer_address, value) { - return - } - } - if x.LastCommit != nil { - value := protoreflect.ValueOfMessage(x.LastCommit.ProtoReflect()) - if !f(fd_CometInfo_last_commit, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_CometInfo) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "cosmos.consensus.v1.CometInfo.evidence": - return len(x.Evidence) != 0 - case "cosmos.consensus.v1.CometInfo.validators_hash": - return len(x.ValidatorsHash) != 0 - case "cosmos.consensus.v1.CometInfo.proposer_address": - return len(x.ProposerAddress) != 0 - case "cosmos.consensus.v1.CometInfo.last_commit": - return x.LastCommit != nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.CometInfo")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.CometInfo does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_CometInfo) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "cosmos.consensus.v1.CometInfo.evidence": - x.Evidence = nil - case "cosmos.consensus.v1.CometInfo.validators_hash": - x.ValidatorsHash = nil - case "cosmos.consensus.v1.CometInfo.proposer_address": - x.ProposerAddress = nil - case "cosmos.consensus.v1.CometInfo.last_commit": - x.LastCommit = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.CometInfo")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.CometInfo does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_CometInfo) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "cosmos.consensus.v1.CometInfo.evidence": - if len(x.Evidence) == 0 { - return protoreflect.ValueOfList(&_CometInfo_1_list{}) - } - listValue := &_CometInfo_1_list{list: &x.Evidence} - return protoreflect.ValueOfList(listValue) - case "cosmos.consensus.v1.CometInfo.validators_hash": - value := x.ValidatorsHash - return protoreflect.ValueOfBytes(value) - case "cosmos.consensus.v1.CometInfo.proposer_address": - value := x.ProposerAddress - return protoreflect.ValueOfBytes(value) - case "cosmos.consensus.v1.CometInfo.last_commit": - value := x.LastCommit - return protoreflect.ValueOfMessage(value.ProtoReflect()) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.CometInfo")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.CometInfo does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_CometInfo) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "cosmos.consensus.v1.CometInfo.evidence": - lv := value.List() - clv := lv.(*_CometInfo_1_list) - x.Evidence = *clv.list - case "cosmos.consensus.v1.CometInfo.validators_hash": - x.ValidatorsHash = value.Bytes() - case "cosmos.consensus.v1.CometInfo.proposer_address": - x.ProposerAddress = value.Bytes() - case "cosmos.consensus.v1.CometInfo.last_commit": - x.LastCommit = value.Message().Interface().(*v1.CommitInfo) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.CometInfo")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.CometInfo does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_CometInfo) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.consensus.v1.CometInfo.evidence": - if x.Evidence == nil { - x.Evidence = []*v1.Misbehavior{} - } - value := &_CometInfo_1_list{list: &x.Evidence} - return protoreflect.ValueOfList(value) - case "cosmos.consensus.v1.CometInfo.last_commit": - if x.LastCommit == nil { - x.LastCommit = new(v1.CommitInfo) - } - return protoreflect.ValueOfMessage(x.LastCommit.ProtoReflect()) - case "cosmos.consensus.v1.CometInfo.validators_hash": - panic(fmt.Errorf("field validators_hash of message cosmos.consensus.v1.CometInfo is not mutable")) - case "cosmos.consensus.v1.CometInfo.proposer_address": - panic(fmt.Errorf("field proposer_address of message cosmos.consensus.v1.CometInfo is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.CometInfo")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.CometInfo does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_CometInfo) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.consensus.v1.CometInfo.evidence": - list := []*v1.Misbehavior{} - return protoreflect.ValueOfList(&_CometInfo_1_list{list: &list}) - case "cosmos.consensus.v1.CometInfo.validators_hash": - return protoreflect.ValueOfBytes(nil) - case "cosmos.consensus.v1.CometInfo.proposer_address": - return protoreflect.ValueOfBytes(nil) - case "cosmos.consensus.v1.CometInfo.last_commit": - m := new(v1.CommitInfo) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.CometInfo")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.CometInfo does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_CometInfo) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.consensus.v1.CometInfo", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_CometInfo) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_CometInfo) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_CometInfo) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_CometInfo) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*CometInfo) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if len(x.Evidence) > 0 { - for _, e := range x.Evidence { - l = options.Size(e) - n += 1 + l + runtime.Sov(uint64(l)) - } - } - l = len(x.ValidatorsHash) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.ProposerAddress) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.LastCommit != nil { - l = options.Size(x.LastCommit) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*CometInfo) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if x.LastCommit != nil { - encoded, err := options.Marshal(x.LastCommit) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x22 - } - if len(x.ProposerAddress) > 0 { - i -= len(x.ProposerAddress) - copy(dAtA[i:], x.ProposerAddress) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ProposerAddress))) - i-- - dAtA[i] = 0x1a - } - if len(x.ValidatorsHash) > 0 { - i -= len(x.ValidatorsHash) - copy(dAtA[i:], x.ValidatorsHash) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ValidatorsHash))) - i-- - dAtA[i] = 0x12 - } - if len(x.Evidence) > 0 { - for iNdEx := len(x.Evidence) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.Evidence[iNdEx]) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0xa - } - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*CometInfo) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire 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++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: CometInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: CometInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Evidence", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Evidence = append(x.Evidence, &v1.Misbehavior{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Evidence[len(x.Evidence)-1]); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ValidatorsHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + byteLen - 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.ValidatorsHash = append(x.ValidatorsHash[:0], dAtA[iNdEx:postIndex]...) - if x.ValidatorsHash == nil { - x.ValidatorsHash = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ProposerAddress", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + byteLen - 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.ProposerAddress = append(x.ProposerAddress[:0], dAtA[iNdEx:postIndex]...) - if x.ProposerAddress == nil { - x.ProposerAddress = []byte{} - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field LastCommit", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.LastCommit == nil { - x.LastCommit = &v1.CommitInfo{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.LastCommit); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -// Since: cosmos-sdk 0.52 - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.0 -// protoc (unknown) -// source: cosmos/consensus/v1/consensus.proto - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// CometInfo defines the structure of the x/consensus module's comet info. -type CometInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Evidence []*v1.Misbehavior `protobuf:"bytes,1,rep,name=evidence,proto3" json:"evidence,omitempty"` - ValidatorsHash []byte `protobuf:"bytes,2,opt,name=validators_hash,json=validatorsHash,proto3" json:"validators_hash,omitempty"` - ProposerAddress []byte `protobuf:"bytes,3,opt,name=proposer_address,json=proposerAddress,proto3" json:"proposer_address,omitempty"` - LastCommit *v1.CommitInfo `protobuf:"bytes,4,opt,name=last_commit,json=lastCommit,proto3" json:"last_commit,omitempty"` -} - -func (x *CometInfo) Reset() { - *x = CometInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_consensus_v1_consensus_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CometInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CometInfo) ProtoMessage() {} - -// Deprecated: Use CometInfo.ProtoReflect.Descriptor instead. -func (*CometInfo) Descriptor() ([]byte, []int) { - return file_cosmos_consensus_v1_consensus_proto_rawDescGZIP(), []int{0} -} - -func (x *CometInfo) GetEvidence() []*v1.Misbehavior { - if x != nil { - return x.Evidence - } - return nil -} - -func (x *CometInfo) GetValidatorsHash() []byte { - if x != nil { - return x.ValidatorsHash - } - return nil -} - -func (x *CometInfo) GetProposerAddress() []byte { - if x != nil { - return x.ProposerAddress - } - return nil -} - -func (x *CometInfo) GetLastCommit() *v1.CommitInfo { - if x != nil { - return x.LastCommit - } - return nil -} - -var File_cosmos_consensus_v1_consensus_proto protoreflect.FileDescriptor - -var file_cosmos_consensus_v1_consensus_proto_rawDesc = []byte{ - 0x0a, 0x23, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, - 0x75, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, - 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x1c, 0x63, 0x6f, 0x6d, 0x65, - 0x74, 0x62, 0x66, 0x74, 0x2f, 0x61, 0x62, 0x63, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd9, 0x01, 0x0a, 0x09, 0x43, 0x6f, 0x6d, - 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x39, 0x0a, 0x08, 0x65, 0x76, 0x69, 0x64, 0x65, 0x6e, - 0x63, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x6f, 0x6d, 0x65, 0x74, - 0x62, 0x66, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x69, 0x73, 0x62, - 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x52, 0x08, 0x65, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, - 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x5f, - 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x48, 0x61, 0x73, 0x68, 0x12, 0x29, 0x0a, 0x10, 0x70, 0x72, - 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x3d, 0x0a, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x63, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x6d, - 0x65, 0x74, 0x62, 0x66, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x6c, 0x61, 0x73, 0x74, 0x43, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x42, 0xc9, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, - 0x42, 0x0e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x73, - 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, - 0x75, 0x73, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x43, 0x58, 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x56, 0x31, - 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, - 0x73, 0x75, 0x73, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, - 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x3a, 0x3a, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x3a, 0x3a, 0x56, 0x31, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_cosmos_consensus_v1_consensus_proto_rawDescOnce sync.Once - file_cosmos_consensus_v1_consensus_proto_rawDescData = file_cosmos_consensus_v1_consensus_proto_rawDesc -) - -func file_cosmos_consensus_v1_consensus_proto_rawDescGZIP() []byte { - file_cosmos_consensus_v1_consensus_proto_rawDescOnce.Do(func() { - file_cosmos_consensus_v1_consensus_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_consensus_v1_consensus_proto_rawDescData) - }) - return file_cosmos_consensus_v1_consensus_proto_rawDescData -} - -var file_cosmos_consensus_v1_consensus_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_cosmos_consensus_v1_consensus_proto_goTypes = []interface{}{ - (*CometInfo)(nil), // 0: cosmos.consensus.v1.CometInfo - (*v1.Misbehavior)(nil), // 1: cometbft.abci.v1.Misbehavior - (*v1.CommitInfo)(nil), // 2: cometbft.abci.v1.CommitInfo -} -var file_cosmos_consensus_v1_consensus_proto_depIdxs = []int32{ - 1, // 0: cosmos.consensus.v1.CometInfo.evidence:type_name -> cometbft.abci.v1.Misbehavior - 2, // 1: cosmos.consensus.v1.CometInfo.last_commit:type_name -> cometbft.abci.v1.CommitInfo - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_cosmos_consensus_v1_consensus_proto_init() } -func file_cosmos_consensus_v1_consensus_proto_init() { - if File_cosmos_consensus_v1_consensus_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_cosmos_consensus_v1_consensus_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CometInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_cosmos_consensus_v1_consensus_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_cosmos_consensus_v1_consensus_proto_goTypes, - DependencyIndexes: file_cosmos_consensus_v1_consensus_proto_depIdxs, - MessageInfos: file_cosmos_consensus_v1_consensus_proto_msgTypes, - }.Build() - File_cosmos_consensus_v1_consensus_proto = out.File - file_cosmos_consensus_v1_consensus_proto_rawDesc = nil - file_cosmos_consensus_v1_consensus_proto_goTypes = nil - file_cosmos_consensus_v1_consensus_proto_depIdxs = nil -} diff --git a/api/cosmos/consensus/v1/params.pulsar.go b/api/cosmos/consensus/v1/params.pulsar.go deleted file mode 100644 index 930d73130c9c..000000000000 --- a/api/cosmos/consensus/v1/params.pulsar.go +++ /dev/null @@ -1,4918 +0,0 @@ -// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package consensusv1 - -import ( - fmt "fmt" - runtime "github.com/cosmos/cosmos-proto/runtime" - _ "github.com/cosmos/gogoproto/gogoproto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoiface "google.golang.org/protobuf/runtime/protoiface" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - durationpb "google.golang.org/protobuf/types/known/durationpb" - wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" - io "io" - reflect "reflect" - sync "sync" -) - -var ( - md_ConsensusParams protoreflect.MessageDescriptor - fd_ConsensusParams_block protoreflect.FieldDescriptor - fd_ConsensusParams_evidence protoreflect.FieldDescriptor - fd_ConsensusParams_validator protoreflect.FieldDescriptor - fd_ConsensusParams_version protoreflect.FieldDescriptor - fd_ConsensusParams_synchrony protoreflect.FieldDescriptor - fd_ConsensusParams_feature protoreflect.FieldDescriptor -) - -func init() { - file_cosmos_consensus_v1_params_proto_init() - md_ConsensusParams = File_cosmos_consensus_v1_params_proto.Messages().ByName("ConsensusParams") - fd_ConsensusParams_block = md_ConsensusParams.Fields().ByName("block") - fd_ConsensusParams_evidence = md_ConsensusParams.Fields().ByName("evidence") - fd_ConsensusParams_validator = md_ConsensusParams.Fields().ByName("validator") - fd_ConsensusParams_version = md_ConsensusParams.Fields().ByName("version") - fd_ConsensusParams_synchrony = md_ConsensusParams.Fields().ByName("synchrony") - fd_ConsensusParams_feature = md_ConsensusParams.Fields().ByName("feature") -} - -var _ protoreflect.Message = (*fastReflection_ConsensusParams)(nil) - -type fastReflection_ConsensusParams ConsensusParams - -func (x *ConsensusParams) ProtoReflect() protoreflect.Message { - return (*fastReflection_ConsensusParams)(x) -} - -func (x *ConsensusParams) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_consensus_v1_params_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_ConsensusParams_messageType fastReflection_ConsensusParams_messageType -var _ protoreflect.MessageType = fastReflection_ConsensusParams_messageType{} - -type fastReflection_ConsensusParams_messageType struct{} - -func (x fastReflection_ConsensusParams_messageType) Zero() protoreflect.Message { - return (*fastReflection_ConsensusParams)(nil) -} -func (x fastReflection_ConsensusParams_messageType) New() protoreflect.Message { - return new(fastReflection_ConsensusParams) -} -func (x fastReflection_ConsensusParams_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_ConsensusParams -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_ConsensusParams) Descriptor() protoreflect.MessageDescriptor { - return md_ConsensusParams -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_ConsensusParams) Type() protoreflect.MessageType { - return _fastReflection_ConsensusParams_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_ConsensusParams) New() protoreflect.Message { - return new(fastReflection_ConsensusParams) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_ConsensusParams) Interface() protoreflect.ProtoMessage { - return (*ConsensusParams)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_ConsensusParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Block != nil { - value := protoreflect.ValueOfMessage(x.Block.ProtoReflect()) - if !f(fd_ConsensusParams_block, value) { - return - } - } - if x.Evidence != nil { - value := protoreflect.ValueOfMessage(x.Evidence.ProtoReflect()) - if !f(fd_ConsensusParams_evidence, value) { - return - } - } - if x.Validator != nil { - value := protoreflect.ValueOfMessage(x.Validator.ProtoReflect()) - if !f(fd_ConsensusParams_validator, value) { - return - } - } - if x.Version != nil { - value := protoreflect.ValueOfMessage(x.Version.ProtoReflect()) - if !f(fd_ConsensusParams_version, value) { - return - } - } - if x.Synchrony != nil { - value := protoreflect.ValueOfMessage(x.Synchrony.ProtoReflect()) - if !f(fd_ConsensusParams_synchrony, value) { - return - } - } - if x.Feature != nil { - value := protoreflect.ValueOfMessage(x.Feature.ProtoReflect()) - if !f(fd_ConsensusParams_feature, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_ConsensusParams) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "cosmos.consensus.v1.ConsensusParams.block": - return x.Block != nil - case "cosmos.consensus.v1.ConsensusParams.evidence": - return x.Evidence != nil - case "cosmos.consensus.v1.ConsensusParams.validator": - return x.Validator != nil - case "cosmos.consensus.v1.ConsensusParams.version": - return x.Version != nil - case "cosmos.consensus.v1.ConsensusParams.synchrony": - return x.Synchrony != nil - case "cosmos.consensus.v1.ConsensusParams.feature": - return x.Feature != nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConsensusParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.ConsensusParams does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_ConsensusParams) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "cosmos.consensus.v1.ConsensusParams.block": - x.Block = nil - case "cosmos.consensus.v1.ConsensusParams.evidence": - x.Evidence = nil - case "cosmos.consensus.v1.ConsensusParams.validator": - x.Validator = nil - case "cosmos.consensus.v1.ConsensusParams.version": - x.Version = nil - case "cosmos.consensus.v1.ConsensusParams.synchrony": - x.Synchrony = nil - case "cosmos.consensus.v1.ConsensusParams.feature": - x.Feature = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConsensusParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.ConsensusParams does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_ConsensusParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "cosmos.consensus.v1.ConsensusParams.block": - value := x.Block - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "cosmos.consensus.v1.ConsensusParams.evidence": - value := x.Evidence - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "cosmos.consensus.v1.ConsensusParams.validator": - value := x.Validator - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "cosmos.consensus.v1.ConsensusParams.version": - value := x.Version - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "cosmos.consensus.v1.ConsensusParams.synchrony": - value := x.Synchrony - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "cosmos.consensus.v1.ConsensusParams.feature": - value := x.Feature - return protoreflect.ValueOfMessage(value.ProtoReflect()) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConsensusParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.ConsensusParams does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_ConsensusParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "cosmos.consensus.v1.ConsensusParams.block": - x.Block = value.Message().Interface().(*BlockParams) - case "cosmos.consensus.v1.ConsensusParams.evidence": - x.Evidence = value.Message().Interface().(*EvidenceParams) - case "cosmos.consensus.v1.ConsensusParams.validator": - x.Validator = value.Message().Interface().(*ValidatorParams) - case "cosmos.consensus.v1.ConsensusParams.version": - x.Version = value.Message().Interface().(*VersionParams) - case "cosmos.consensus.v1.ConsensusParams.synchrony": - x.Synchrony = value.Message().Interface().(*SynchronyParams) - case "cosmos.consensus.v1.ConsensusParams.feature": - x.Feature = value.Message().Interface().(*FeatureParams) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConsensusParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.ConsensusParams does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_ConsensusParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.consensus.v1.ConsensusParams.block": - if x.Block == nil { - x.Block = new(BlockParams) - } - return protoreflect.ValueOfMessage(x.Block.ProtoReflect()) - case "cosmos.consensus.v1.ConsensusParams.evidence": - if x.Evidence == nil { - x.Evidence = new(EvidenceParams) - } - return protoreflect.ValueOfMessage(x.Evidence.ProtoReflect()) - case "cosmos.consensus.v1.ConsensusParams.validator": - if x.Validator == nil { - x.Validator = new(ValidatorParams) - } - return protoreflect.ValueOfMessage(x.Validator.ProtoReflect()) - case "cosmos.consensus.v1.ConsensusParams.version": - if x.Version == nil { - x.Version = new(VersionParams) - } - return protoreflect.ValueOfMessage(x.Version.ProtoReflect()) - case "cosmos.consensus.v1.ConsensusParams.synchrony": - if x.Synchrony == nil { - x.Synchrony = new(SynchronyParams) - } - return protoreflect.ValueOfMessage(x.Synchrony.ProtoReflect()) - case "cosmos.consensus.v1.ConsensusParams.feature": - if x.Feature == nil { - x.Feature = new(FeatureParams) - } - return protoreflect.ValueOfMessage(x.Feature.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConsensusParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.ConsensusParams does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_ConsensusParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.consensus.v1.ConsensusParams.block": - m := new(BlockParams) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "cosmos.consensus.v1.ConsensusParams.evidence": - m := new(EvidenceParams) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "cosmos.consensus.v1.ConsensusParams.validator": - m := new(ValidatorParams) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "cosmos.consensus.v1.ConsensusParams.version": - m := new(VersionParams) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "cosmos.consensus.v1.ConsensusParams.synchrony": - m := new(SynchronyParams) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "cosmos.consensus.v1.ConsensusParams.feature": - m := new(FeatureParams) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConsensusParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.ConsensusParams does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_ConsensusParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.consensus.v1.ConsensusParams", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_ConsensusParams) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_ConsensusParams) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_ConsensusParams) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_ConsensusParams) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*ConsensusParams) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if x.Block != nil { - l = options.Size(x.Block) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.Evidence != nil { - l = options.Size(x.Evidence) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.Validator != nil { - l = options.Size(x.Validator) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.Version != nil { - l = options.Size(x.Version) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.Synchrony != nil { - l = options.Size(x.Synchrony) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.Feature != nil { - l = options.Size(x.Feature) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*ConsensusParams) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if x.Feature != nil { - encoded, err := options.Marshal(x.Feature) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x3a - } - if x.Synchrony != nil { - encoded, err := options.Marshal(x.Synchrony) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x32 - } - if x.Version != nil { - encoded, err := options.Marshal(x.Version) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x22 - } - if x.Validator != nil { - encoded, err := options.Marshal(x.Validator) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x1a - } - if x.Evidence != nil { - encoded, err := options.Marshal(x.Evidence) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x12 - } - if x.Block != nil { - encoded, err := options.Marshal(x.Block) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0xa - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*ConsensusParams) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire 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++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ConsensusParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ConsensusParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.Block == nil { - x.Block = &BlockParams{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Block); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Evidence", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.Evidence == nil { - x.Evidence = &EvidenceParams{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Evidence); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Validator", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.Validator == nil { - x.Validator = &ValidatorParams{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Validator); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.Version == nil { - x.Version = &VersionParams{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Version); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Synchrony", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.Synchrony == nil { - x.Synchrony = &SynchronyParams{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Synchrony); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Feature", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.Feature == nil { - x.Feature = &FeatureParams{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Feature); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_BlockParams protoreflect.MessageDescriptor - fd_BlockParams_max_bytes protoreflect.FieldDescriptor - fd_BlockParams_max_gas protoreflect.FieldDescriptor -) - -func init() { - file_cosmos_consensus_v1_params_proto_init() - md_BlockParams = File_cosmos_consensus_v1_params_proto.Messages().ByName("BlockParams") - fd_BlockParams_max_bytes = md_BlockParams.Fields().ByName("max_bytes") - fd_BlockParams_max_gas = md_BlockParams.Fields().ByName("max_gas") -} - -var _ protoreflect.Message = (*fastReflection_BlockParams)(nil) - -type fastReflection_BlockParams BlockParams - -func (x *BlockParams) ProtoReflect() protoreflect.Message { - return (*fastReflection_BlockParams)(x) -} - -func (x *BlockParams) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_consensus_v1_params_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_BlockParams_messageType fastReflection_BlockParams_messageType -var _ protoreflect.MessageType = fastReflection_BlockParams_messageType{} - -type fastReflection_BlockParams_messageType struct{} - -func (x fastReflection_BlockParams_messageType) Zero() protoreflect.Message { - return (*fastReflection_BlockParams)(nil) -} -func (x fastReflection_BlockParams_messageType) New() protoreflect.Message { - return new(fastReflection_BlockParams) -} -func (x fastReflection_BlockParams_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_BlockParams -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_BlockParams) Descriptor() protoreflect.MessageDescriptor { - return md_BlockParams -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_BlockParams) Type() protoreflect.MessageType { - return _fastReflection_BlockParams_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_BlockParams) New() protoreflect.Message { - return new(fastReflection_BlockParams) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_BlockParams) Interface() protoreflect.ProtoMessage { - return (*BlockParams)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_BlockParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.MaxBytes != int64(0) { - value := protoreflect.ValueOfInt64(x.MaxBytes) - if !f(fd_BlockParams_max_bytes, value) { - return - } - } - if x.MaxGas != int64(0) { - value := protoreflect.ValueOfInt64(x.MaxGas) - if !f(fd_BlockParams_max_gas, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_BlockParams) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "cosmos.consensus.v1.BlockParams.max_bytes": - return x.MaxBytes != int64(0) - case "cosmos.consensus.v1.BlockParams.max_gas": - return x.MaxGas != int64(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.BlockParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.BlockParams does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_BlockParams) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "cosmos.consensus.v1.BlockParams.max_bytes": - x.MaxBytes = int64(0) - case "cosmos.consensus.v1.BlockParams.max_gas": - x.MaxGas = int64(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.BlockParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.BlockParams does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_BlockParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "cosmos.consensus.v1.BlockParams.max_bytes": - value := x.MaxBytes - return protoreflect.ValueOfInt64(value) - case "cosmos.consensus.v1.BlockParams.max_gas": - value := x.MaxGas - return protoreflect.ValueOfInt64(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.BlockParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.BlockParams does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_BlockParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "cosmos.consensus.v1.BlockParams.max_bytes": - x.MaxBytes = value.Int() - case "cosmos.consensus.v1.BlockParams.max_gas": - x.MaxGas = value.Int() - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.BlockParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.BlockParams does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_BlockParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.consensus.v1.BlockParams.max_bytes": - panic(fmt.Errorf("field max_bytes of message cosmos.consensus.v1.BlockParams is not mutable")) - case "cosmos.consensus.v1.BlockParams.max_gas": - panic(fmt.Errorf("field max_gas of message cosmos.consensus.v1.BlockParams is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.BlockParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.BlockParams does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_BlockParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.consensus.v1.BlockParams.max_bytes": - return protoreflect.ValueOfInt64(int64(0)) - case "cosmos.consensus.v1.BlockParams.max_gas": - return protoreflect.ValueOfInt64(int64(0)) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.BlockParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.BlockParams does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_BlockParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.consensus.v1.BlockParams", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_BlockParams) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_BlockParams) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_BlockParams) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_BlockParams) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*BlockParams) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if x.MaxBytes != 0 { - n += 1 + runtime.Sov(uint64(x.MaxBytes)) - } - if x.MaxGas != 0 { - n += 1 + runtime.Sov(uint64(x.MaxGas)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*BlockParams) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if x.MaxGas != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.MaxGas)) - i-- - dAtA[i] = 0x10 - } - if x.MaxBytes != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.MaxBytes)) - i-- - dAtA[i] = 0x8 - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*BlockParams) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire 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++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: BlockParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: BlockParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MaxBytes", wireType) - } - x.MaxBytes = 0 - 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++ - x.MaxBytes |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MaxGas", wireType) - } - x.MaxGas = 0 - 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++ - x.MaxGas |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_EvidenceParams protoreflect.MessageDescriptor - fd_EvidenceParams_max_age_num_blocks protoreflect.FieldDescriptor - fd_EvidenceParams_max_age_duration protoreflect.FieldDescriptor - fd_EvidenceParams_max_bytes protoreflect.FieldDescriptor -) - -func init() { - file_cosmos_consensus_v1_params_proto_init() - md_EvidenceParams = File_cosmos_consensus_v1_params_proto.Messages().ByName("EvidenceParams") - fd_EvidenceParams_max_age_num_blocks = md_EvidenceParams.Fields().ByName("max_age_num_blocks") - fd_EvidenceParams_max_age_duration = md_EvidenceParams.Fields().ByName("max_age_duration") - fd_EvidenceParams_max_bytes = md_EvidenceParams.Fields().ByName("max_bytes") -} - -var _ protoreflect.Message = (*fastReflection_EvidenceParams)(nil) - -type fastReflection_EvidenceParams EvidenceParams - -func (x *EvidenceParams) ProtoReflect() protoreflect.Message { - return (*fastReflection_EvidenceParams)(x) -} - -func (x *EvidenceParams) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_consensus_v1_params_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_EvidenceParams_messageType fastReflection_EvidenceParams_messageType -var _ protoreflect.MessageType = fastReflection_EvidenceParams_messageType{} - -type fastReflection_EvidenceParams_messageType struct{} - -func (x fastReflection_EvidenceParams_messageType) Zero() protoreflect.Message { - return (*fastReflection_EvidenceParams)(nil) -} -func (x fastReflection_EvidenceParams_messageType) New() protoreflect.Message { - return new(fastReflection_EvidenceParams) -} -func (x fastReflection_EvidenceParams_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_EvidenceParams -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_EvidenceParams) Descriptor() protoreflect.MessageDescriptor { - return md_EvidenceParams -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_EvidenceParams) Type() protoreflect.MessageType { - return _fastReflection_EvidenceParams_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_EvidenceParams) New() protoreflect.Message { - return new(fastReflection_EvidenceParams) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_EvidenceParams) Interface() protoreflect.ProtoMessage { - return (*EvidenceParams)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_EvidenceParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.MaxAgeNumBlocks != int64(0) { - value := protoreflect.ValueOfInt64(x.MaxAgeNumBlocks) - if !f(fd_EvidenceParams_max_age_num_blocks, value) { - return - } - } - if x.MaxAgeDuration != nil { - value := protoreflect.ValueOfMessage(x.MaxAgeDuration.ProtoReflect()) - if !f(fd_EvidenceParams_max_age_duration, value) { - return - } - } - if x.MaxBytes != int64(0) { - value := protoreflect.ValueOfInt64(x.MaxBytes) - if !f(fd_EvidenceParams_max_bytes, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_EvidenceParams) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "cosmos.consensus.v1.EvidenceParams.max_age_num_blocks": - return x.MaxAgeNumBlocks != int64(0) - case "cosmos.consensus.v1.EvidenceParams.max_age_duration": - return x.MaxAgeDuration != nil - case "cosmos.consensus.v1.EvidenceParams.max_bytes": - return x.MaxBytes != int64(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.EvidenceParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.EvidenceParams does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_EvidenceParams) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "cosmos.consensus.v1.EvidenceParams.max_age_num_blocks": - x.MaxAgeNumBlocks = int64(0) - case "cosmos.consensus.v1.EvidenceParams.max_age_duration": - x.MaxAgeDuration = nil - case "cosmos.consensus.v1.EvidenceParams.max_bytes": - x.MaxBytes = int64(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.EvidenceParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.EvidenceParams does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_EvidenceParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "cosmos.consensus.v1.EvidenceParams.max_age_num_blocks": - value := x.MaxAgeNumBlocks - return protoreflect.ValueOfInt64(value) - case "cosmos.consensus.v1.EvidenceParams.max_age_duration": - value := x.MaxAgeDuration - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "cosmos.consensus.v1.EvidenceParams.max_bytes": - value := x.MaxBytes - return protoreflect.ValueOfInt64(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.EvidenceParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.EvidenceParams does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_EvidenceParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "cosmos.consensus.v1.EvidenceParams.max_age_num_blocks": - x.MaxAgeNumBlocks = value.Int() - case "cosmos.consensus.v1.EvidenceParams.max_age_duration": - x.MaxAgeDuration = value.Message().Interface().(*durationpb.Duration) - case "cosmos.consensus.v1.EvidenceParams.max_bytes": - x.MaxBytes = value.Int() - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.EvidenceParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.EvidenceParams does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_EvidenceParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.consensus.v1.EvidenceParams.max_age_duration": - if x.MaxAgeDuration == nil { - x.MaxAgeDuration = new(durationpb.Duration) - } - return protoreflect.ValueOfMessage(x.MaxAgeDuration.ProtoReflect()) - case "cosmos.consensus.v1.EvidenceParams.max_age_num_blocks": - panic(fmt.Errorf("field max_age_num_blocks of message cosmos.consensus.v1.EvidenceParams is not mutable")) - case "cosmos.consensus.v1.EvidenceParams.max_bytes": - panic(fmt.Errorf("field max_bytes of message cosmos.consensus.v1.EvidenceParams is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.EvidenceParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.EvidenceParams does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_EvidenceParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.consensus.v1.EvidenceParams.max_age_num_blocks": - return protoreflect.ValueOfInt64(int64(0)) - case "cosmos.consensus.v1.EvidenceParams.max_age_duration": - m := new(durationpb.Duration) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "cosmos.consensus.v1.EvidenceParams.max_bytes": - return protoreflect.ValueOfInt64(int64(0)) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.EvidenceParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.EvidenceParams does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_EvidenceParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.consensus.v1.EvidenceParams", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_EvidenceParams) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_EvidenceParams) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_EvidenceParams) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_EvidenceParams) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*EvidenceParams) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if x.MaxAgeNumBlocks != 0 { - n += 1 + runtime.Sov(uint64(x.MaxAgeNumBlocks)) - } - if x.MaxAgeDuration != nil { - l = options.Size(x.MaxAgeDuration) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.MaxBytes != 0 { - n += 1 + runtime.Sov(uint64(x.MaxBytes)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*EvidenceParams) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if x.MaxBytes != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.MaxBytes)) - i-- - dAtA[i] = 0x18 - } - if x.MaxAgeDuration != nil { - encoded, err := options.Marshal(x.MaxAgeDuration) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x12 - } - if x.MaxAgeNumBlocks != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.MaxAgeNumBlocks)) - i-- - dAtA[i] = 0x8 - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*EvidenceParams) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire 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++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EvidenceParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EvidenceParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MaxAgeNumBlocks", wireType) - } - x.MaxAgeNumBlocks = 0 - 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++ - x.MaxAgeNumBlocks |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MaxAgeDuration", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.MaxAgeDuration == nil { - x.MaxAgeDuration = &durationpb.Duration{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.MaxAgeDuration); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MaxBytes", wireType) - } - x.MaxBytes = 0 - 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++ - x.MaxBytes |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var _ protoreflect.List = (*_ValidatorParams_1_list)(nil) - -type _ValidatorParams_1_list struct { - list *[]string -} - -func (x *_ValidatorParams_1_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_ValidatorParams_1_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfString((*x.list)[i]) -} - -func (x *_ValidatorParams_1_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - (*x.list)[i] = concreteValue -} - -func (x *_ValidatorParams_1_list) Append(value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - *x.list = append(*x.list, concreteValue) -} - -func (x *_ValidatorParams_1_list) AppendMutable() protoreflect.Value { - panic(fmt.Errorf("AppendMutable can not be called on message ValidatorParams at list field PubKeyTypes as it is not of Message kind")) -} - -func (x *_ValidatorParams_1_list) Truncate(n int) { - *x.list = (*x.list)[:n] -} - -func (x *_ValidatorParams_1_list) NewElement() protoreflect.Value { - v := "" - return protoreflect.ValueOfString(v) -} - -func (x *_ValidatorParams_1_list) IsValid() bool { - return x.list != nil -} - -var ( - md_ValidatorParams protoreflect.MessageDescriptor - fd_ValidatorParams_pub_key_types protoreflect.FieldDescriptor -) - -func init() { - file_cosmos_consensus_v1_params_proto_init() - md_ValidatorParams = File_cosmos_consensus_v1_params_proto.Messages().ByName("ValidatorParams") - fd_ValidatorParams_pub_key_types = md_ValidatorParams.Fields().ByName("pub_key_types") -} - -var _ protoreflect.Message = (*fastReflection_ValidatorParams)(nil) - -type fastReflection_ValidatorParams ValidatorParams - -func (x *ValidatorParams) ProtoReflect() protoreflect.Message { - return (*fastReflection_ValidatorParams)(x) -} - -func (x *ValidatorParams) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_consensus_v1_params_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_ValidatorParams_messageType fastReflection_ValidatorParams_messageType -var _ protoreflect.MessageType = fastReflection_ValidatorParams_messageType{} - -type fastReflection_ValidatorParams_messageType struct{} - -func (x fastReflection_ValidatorParams_messageType) Zero() protoreflect.Message { - return (*fastReflection_ValidatorParams)(nil) -} -func (x fastReflection_ValidatorParams_messageType) New() protoreflect.Message { - return new(fastReflection_ValidatorParams) -} -func (x fastReflection_ValidatorParams_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_ValidatorParams -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_ValidatorParams) Descriptor() protoreflect.MessageDescriptor { - return md_ValidatorParams -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_ValidatorParams) Type() protoreflect.MessageType { - return _fastReflection_ValidatorParams_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_ValidatorParams) New() protoreflect.Message { - return new(fastReflection_ValidatorParams) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_ValidatorParams) Interface() protoreflect.ProtoMessage { - return (*ValidatorParams)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_ValidatorParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.PubKeyTypes) != 0 { - value := protoreflect.ValueOfList(&_ValidatorParams_1_list{list: &x.PubKeyTypes}) - if !f(fd_ValidatorParams_pub_key_types, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_ValidatorParams) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "cosmos.consensus.v1.ValidatorParams.pub_key_types": - return len(x.PubKeyTypes) != 0 - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ValidatorParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.ValidatorParams does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_ValidatorParams) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "cosmos.consensus.v1.ValidatorParams.pub_key_types": - x.PubKeyTypes = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ValidatorParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.ValidatorParams does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_ValidatorParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "cosmos.consensus.v1.ValidatorParams.pub_key_types": - if len(x.PubKeyTypes) == 0 { - return protoreflect.ValueOfList(&_ValidatorParams_1_list{}) - } - listValue := &_ValidatorParams_1_list{list: &x.PubKeyTypes} - return protoreflect.ValueOfList(listValue) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ValidatorParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.ValidatorParams does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_ValidatorParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "cosmos.consensus.v1.ValidatorParams.pub_key_types": - lv := value.List() - clv := lv.(*_ValidatorParams_1_list) - x.PubKeyTypes = *clv.list - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ValidatorParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.ValidatorParams does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_ValidatorParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.consensus.v1.ValidatorParams.pub_key_types": - if x.PubKeyTypes == nil { - x.PubKeyTypes = []string{} - } - value := &_ValidatorParams_1_list{list: &x.PubKeyTypes} - return protoreflect.ValueOfList(value) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ValidatorParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.ValidatorParams does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_ValidatorParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.consensus.v1.ValidatorParams.pub_key_types": - list := []string{} - return protoreflect.ValueOfList(&_ValidatorParams_1_list{list: &list}) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ValidatorParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.ValidatorParams does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_ValidatorParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.consensus.v1.ValidatorParams", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_ValidatorParams) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_ValidatorParams) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_ValidatorParams) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_ValidatorParams) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*ValidatorParams) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if len(x.PubKeyTypes) > 0 { - for _, s := range x.PubKeyTypes { - l = len(s) - n += 1 + l + runtime.Sov(uint64(l)) - } - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*ValidatorParams) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if len(x.PubKeyTypes) > 0 { - for iNdEx := len(x.PubKeyTypes) - 1; iNdEx >= 0; iNdEx-- { - i -= len(x.PubKeyTypes[iNdEx]) - copy(dAtA[i:], x.PubKeyTypes[iNdEx]) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PubKeyTypes[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*ValidatorParams) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire 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++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ValidatorParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ValidatorParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PubKeyTypes", 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.PubKeyTypes = append(x.PubKeyTypes, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_VersionParams protoreflect.MessageDescriptor - fd_VersionParams_app protoreflect.FieldDescriptor -) - -func init() { - file_cosmos_consensus_v1_params_proto_init() - md_VersionParams = File_cosmos_consensus_v1_params_proto.Messages().ByName("VersionParams") - fd_VersionParams_app = md_VersionParams.Fields().ByName("app") -} - -var _ protoreflect.Message = (*fastReflection_VersionParams)(nil) - -type fastReflection_VersionParams VersionParams - -func (x *VersionParams) ProtoReflect() protoreflect.Message { - return (*fastReflection_VersionParams)(x) -} - -func (x *VersionParams) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_consensus_v1_params_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_VersionParams_messageType fastReflection_VersionParams_messageType -var _ protoreflect.MessageType = fastReflection_VersionParams_messageType{} - -type fastReflection_VersionParams_messageType struct{} - -func (x fastReflection_VersionParams_messageType) Zero() protoreflect.Message { - return (*fastReflection_VersionParams)(nil) -} -func (x fastReflection_VersionParams_messageType) New() protoreflect.Message { - return new(fastReflection_VersionParams) -} -func (x fastReflection_VersionParams_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_VersionParams -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_VersionParams) Descriptor() protoreflect.MessageDescriptor { - return md_VersionParams -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_VersionParams) Type() protoreflect.MessageType { - return _fastReflection_VersionParams_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_VersionParams) New() protoreflect.Message { - return new(fastReflection_VersionParams) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_VersionParams) Interface() protoreflect.ProtoMessage { - return (*VersionParams)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_VersionParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.App != uint64(0) { - value := protoreflect.ValueOfUint64(x.App) - if !f(fd_VersionParams_app, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_VersionParams) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "cosmos.consensus.v1.VersionParams.app": - return x.App != uint64(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.VersionParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.VersionParams does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_VersionParams) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "cosmos.consensus.v1.VersionParams.app": - x.App = uint64(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.VersionParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.VersionParams does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_VersionParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "cosmos.consensus.v1.VersionParams.app": - value := x.App - return protoreflect.ValueOfUint64(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.VersionParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.VersionParams does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_VersionParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "cosmos.consensus.v1.VersionParams.app": - x.App = value.Uint() - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.VersionParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.VersionParams does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_VersionParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.consensus.v1.VersionParams.app": - panic(fmt.Errorf("field app of message cosmos.consensus.v1.VersionParams is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.VersionParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.VersionParams does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_VersionParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.consensus.v1.VersionParams.app": - return protoreflect.ValueOfUint64(uint64(0)) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.VersionParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.VersionParams does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_VersionParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.consensus.v1.VersionParams", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_VersionParams) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_VersionParams) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_VersionParams) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_VersionParams) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*VersionParams) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if x.App != 0 { - n += 1 + runtime.Sov(uint64(x.App)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*VersionParams) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if x.App != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.App)) - i-- - dAtA[i] = 0x8 - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*VersionParams) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire 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++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: VersionParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: VersionParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field App", wireType) - } - x.App = 0 - 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++ - x.App |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_HashedParams protoreflect.MessageDescriptor - fd_HashedParams_block_max_bytes protoreflect.FieldDescriptor - fd_HashedParams_block_max_gas protoreflect.FieldDescriptor -) - -func init() { - file_cosmos_consensus_v1_params_proto_init() - md_HashedParams = File_cosmos_consensus_v1_params_proto.Messages().ByName("HashedParams") - fd_HashedParams_block_max_bytes = md_HashedParams.Fields().ByName("block_max_bytes") - fd_HashedParams_block_max_gas = md_HashedParams.Fields().ByName("block_max_gas") -} - -var _ protoreflect.Message = (*fastReflection_HashedParams)(nil) - -type fastReflection_HashedParams HashedParams - -func (x *HashedParams) ProtoReflect() protoreflect.Message { - return (*fastReflection_HashedParams)(x) -} - -func (x *HashedParams) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_consensus_v1_params_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_HashedParams_messageType fastReflection_HashedParams_messageType -var _ protoreflect.MessageType = fastReflection_HashedParams_messageType{} - -type fastReflection_HashedParams_messageType struct{} - -func (x fastReflection_HashedParams_messageType) Zero() protoreflect.Message { - return (*fastReflection_HashedParams)(nil) -} -func (x fastReflection_HashedParams_messageType) New() protoreflect.Message { - return new(fastReflection_HashedParams) -} -func (x fastReflection_HashedParams_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_HashedParams -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_HashedParams) Descriptor() protoreflect.MessageDescriptor { - return md_HashedParams -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_HashedParams) Type() protoreflect.MessageType { - return _fastReflection_HashedParams_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_HashedParams) New() protoreflect.Message { - return new(fastReflection_HashedParams) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_HashedParams) Interface() protoreflect.ProtoMessage { - return (*HashedParams)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_HashedParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.BlockMaxBytes != int64(0) { - value := protoreflect.ValueOfInt64(x.BlockMaxBytes) - if !f(fd_HashedParams_block_max_bytes, value) { - return - } - } - if x.BlockMaxGas != int64(0) { - value := protoreflect.ValueOfInt64(x.BlockMaxGas) - if !f(fd_HashedParams_block_max_gas, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_HashedParams) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "cosmos.consensus.v1.HashedParams.block_max_bytes": - return x.BlockMaxBytes != int64(0) - case "cosmos.consensus.v1.HashedParams.block_max_gas": - return x.BlockMaxGas != int64(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.HashedParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.HashedParams does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_HashedParams) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "cosmos.consensus.v1.HashedParams.block_max_bytes": - x.BlockMaxBytes = int64(0) - case "cosmos.consensus.v1.HashedParams.block_max_gas": - x.BlockMaxGas = int64(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.HashedParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.HashedParams does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_HashedParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "cosmos.consensus.v1.HashedParams.block_max_bytes": - value := x.BlockMaxBytes - return protoreflect.ValueOfInt64(value) - case "cosmos.consensus.v1.HashedParams.block_max_gas": - value := x.BlockMaxGas - return protoreflect.ValueOfInt64(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.HashedParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.HashedParams does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_HashedParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "cosmos.consensus.v1.HashedParams.block_max_bytes": - x.BlockMaxBytes = value.Int() - case "cosmos.consensus.v1.HashedParams.block_max_gas": - x.BlockMaxGas = value.Int() - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.HashedParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.HashedParams does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_HashedParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.consensus.v1.HashedParams.block_max_bytes": - panic(fmt.Errorf("field block_max_bytes of message cosmos.consensus.v1.HashedParams is not mutable")) - case "cosmos.consensus.v1.HashedParams.block_max_gas": - panic(fmt.Errorf("field block_max_gas of message cosmos.consensus.v1.HashedParams is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.HashedParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.HashedParams does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_HashedParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.consensus.v1.HashedParams.block_max_bytes": - return protoreflect.ValueOfInt64(int64(0)) - case "cosmos.consensus.v1.HashedParams.block_max_gas": - return protoreflect.ValueOfInt64(int64(0)) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.HashedParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.HashedParams does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_HashedParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.consensus.v1.HashedParams", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_HashedParams) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_HashedParams) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_HashedParams) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_HashedParams) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*HashedParams) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if x.BlockMaxBytes != 0 { - n += 1 + runtime.Sov(uint64(x.BlockMaxBytes)) - } - if x.BlockMaxGas != 0 { - n += 1 + runtime.Sov(uint64(x.BlockMaxGas)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*HashedParams) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if x.BlockMaxGas != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.BlockMaxGas)) - i-- - dAtA[i] = 0x10 - } - if x.BlockMaxBytes != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.BlockMaxBytes)) - i-- - dAtA[i] = 0x8 - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*HashedParams) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire 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++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: HashedParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: HashedParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BlockMaxBytes", wireType) - } - x.BlockMaxBytes = 0 - 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++ - x.BlockMaxBytes |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BlockMaxGas", wireType) - } - x.BlockMaxGas = 0 - 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++ - x.BlockMaxGas |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_SynchronyParams protoreflect.MessageDescriptor - fd_SynchronyParams_precision protoreflect.FieldDescriptor - fd_SynchronyParams_message_delay protoreflect.FieldDescriptor -) - -func init() { - file_cosmos_consensus_v1_params_proto_init() - md_SynchronyParams = File_cosmos_consensus_v1_params_proto.Messages().ByName("SynchronyParams") - fd_SynchronyParams_precision = md_SynchronyParams.Fields().ByName("precision") - fd_SynchronyParams_message_delay = md_SynchronyParams.Fields().ByName("message_delay") -} - -var _ protoreflect.Message = (*fastReflection_SynchronyParams)(nil) - -type fastReflection_SynchronyParams SynchronyParams - -func (x *SynchronyParams) ProtoReflect() protoreflect.Message { - return (*fastReflection_SynchronyParams)(x) -} - -func (x *SynchronyParams) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_consensus_v1_params_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_SynchronyParams_messageType fastReflection_SynchronyParams_messageType -var _ protoreflect.MessageType = fastReflection_SynchronyParams_messageType{} - -type fastReflection_SynchronyParams_messageType struct{} - -func (x fastReflection_SynchronyParams_messageType) Zero() protoreflect.Message { - return (*fastReflection_SynchronyParams)(nil) -} -func (x fastReflection_SynchronyParams_messageType) New() protoreflect.Message { - return new(fastReflection_SynchronyParams) -} -func (x fastReflection_SynchronyParams_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_SynchronyParams -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_SynchronyParams) Descriptor() protoreflect.MessageDescriptor { - return md_SynchronyParams -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_SynchronyParams) Type() protoreflect.MessageType { - return _fastReflection_SynchronyParams_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_SynchronyParams) New() protoreflect.Message { - return new(fastReflection_SynchronyParams) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_SynchronyParams) Interface() protoreflect.ProtoMessage { - return (*SynchronyParams)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_SynchronyParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Precision != nil { - value := protoreflect.ValueOfMessage(x.Precision.ProtoReflect()) - if !f(fd_SynchronyParams_precision, value) { - return - } - } - if x.MessageDelay != nil { - value := protoreflect.ValueOfMessage(x.MessageDelay.ProtoReflect()) - if !f(fd_SynchronyParams_message_delay, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_SynchronyParams) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "cosmos.consensus.v1.SynchronyParams.precision": - return x.Precision != nil - case "cosmos.consensus.v1.SynchronyParams.message_delay": - return x.MessageDelay != nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.SynchronyParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.SynchronyParams does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_SynchronyParams) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "cosmos.consensus.v1.SynchronyParams.precision": - x.Precision = nil - case "cosmos.consensus.v1.SynchronyParams.message_delay": - x.MessageDelay = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.SynchronyParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.SynchronyParams does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_SynchronyParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "cosmos.consensus.v1.SynchronyParams.precision": - value := x.Precision - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "cosmos.consensus.v1.SynchronyParams.message_delay": - value := x.MessageDelay - return protoreflect.ValueOfMessage(value.ProtoReflect()) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.SynchronyParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.SynchronyParams does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_SynchronyParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "cosmos.consensus.v1.SynchronyParams.precision": - x.Precision = value.Message().Interface().(*durationpb.Duration) - case "cosmos.consensus.v1.SynchronyParams.message_delay": - x.MessageDelay = value.Message().Interface().(*durationpb.Duration) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.SynchronyParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.SynchronyParams does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_SynchronyParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.consensus.v1.SynchronyParams.precision": - if x.Precision == nil { - x.Precision = new(durationpb.Duration) - } - return protoreflect.ValueOfMessage(x.Precision.ProtoReflect()) - case "cosmos.consensus.v1.SynchronyParams.message_delay": - if x.MessageDelay == nil { - x.MessageDelay = new(durationpb.Duration) - } - return protoreflect.ValueOfMessage(x.MessageDelay.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.SynchronyParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.SynchronyParams does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_SynchronyParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.consensus.v1.SynchronyParams.precision": - m := new(durationpb.Duration) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "cosmos.consensus.v1.SynchronyParams.message_delay": - m := new(durationpb.Duration) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.SynchronyParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.SynchronyParams does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_SynchronyParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.consensus.v1.SynchronyParams", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_SynchronyParams) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_SynchronyParams) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_SynchronyParams) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_SynchronyParams) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*SynchronyParams) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if x.Precision != nil { - l = options.Size(x.Precision) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.MessageDelay != nil { - l = options.Size(x.MessageDelay) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*SynchronyParams) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if x.MessageDelay != nil { - encoded, err := options.Marshal(x.MessageDelay) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x12 - } - if x.Precision != nil { - encoded, err := options.Marshal(x.Precision) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0xa - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*SynchronyParams) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire 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++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: SynchronyParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: SynchronyParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Precision", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.Precision == nil { - x.Precision = &durationpb.Duration{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Precision); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MessageDelay", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.MessageDelay == nil { - x.MessageDelay = &durationpb.Duration{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.MessageDelay); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_FeatureParams protoreflect.MessageDescriptor - fd_FeatureParams_vote_extensions_enable_height protoreflect.FieldDescriptor - fd_FeatureParams_pbts_enable_height protoreflect.FieldDescriptor -) - -func init() { - file_cosmos_consensus_v1_params_proto_init() - md_FeatureParams = File_cosmos_consensus_v1_params_proto.Messages().ByName("FeatureParams") - fd_FeatureParams_vote_extensions_enable_height = md_FeatureParams.Fields().ByName("vote_extensions_enable_height") - fd_FeatureParams_pbts_enable_height = md_FeatureParams.Fields().ByName("pbts_enable_height") -} - -var _ protoreflect.Message = (*fastReflection_FeatureParams)(nil) - -type fastReflection_FeatureParams FeatureParams - -func (x *FeatureParams) ProtoReflect() protoreflect.Message { - return (*fastReflection_FeatureParams)(x) -} - -func (x *FeatureParams) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_consensus_v1_params_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_FeatureParams_messageType fastReflection_FeatureParams_messageType -var _ protoreflect.MessageType = fastReflection_FeatureParams_messageType{} - -type fastReflection_FeatureParams_messageType struct{} - -func (x fastReflection_FeatureParams_messageType) Zero() protoreflect.Message { - return (*fastReflection_FeatureParams)(nil) -} -func (x fastReflection_FeatureParams_messageType) New() protoreflect.Message { - return new(fastReflection_FeatureParams) -} -func (x fastReflection_FeatureParams_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_FeatureParams -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_FeatureParams) Descriptor() protoreflect.MessageDescriptor { - return md_FeatureParams -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_FeatureParams) Type() protoreflect.MessageType { - return _fastReflection_FeatureParams_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_FeatureParams) New() protoreflect.Message { - return new(fastReflection_FeatureParams) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_FeatureParams) Interface() protoreflect.ProtoMessage { - return (*FeatureParams)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_FeatureParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.VoteExtensionsEnableHeight != nil { - value := protoreflect.ValueOfMessage(x.VoteExtensionsEnableHeight.ProtoReflect()) - if !f(fd_FeatureParams_vote_extensions_enable_height, value) { - return - } - } - if x.PbtsEnableHeight != nil { - value := protoreflect.ValueOfMessage(x.PbtsEnableHeight.ProtoReflect()) - if !f(fd_FeatureParams_pbts_enable_height, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_FeatureParams) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "cosmos.consensus.v1.FeatureParams.vote_extensions_enable_height": - return x.VoteExtensionsEnableHeight != nil - case "cosmos.consensus.v1.FeatureParams.pbts_enable_height": - return x.PbtsEnableHeight != nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.FeatureParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.FeatureParams does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_FeatureParams) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "cosmos.consensus.v1.FeatureParams.vote_extensions_enable_height": - x.VoteExtensionsEnableHeight = nil - case "cosmos.consensus.v1.FeatureParams.pbts_enable_height": - x.PbtsEnableHeight = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.FeatureParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.FeatureParams does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_FeatureParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "cosmos.consensus.v1.FeatureParams.vote_extensions_enable_height": - value := x.VoteExtensionsEnableHeight - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "cosmos.consensus.v1.FeatureParams.pbts_enable_height": - value := x.PbtsEnableHeight - return protoreflect.ValueOfMessage(value.ProtoReflect()) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.FeatureParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.FeatureParams does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_FeatureParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "cosmos.consensus.v1.FeatureParams.vote_extensions_enable_height": - x.VoteExtensionsEnableHeight = value.Message().Interface().(*wrapperspb.Int64Value) - case "cosmos.consensus.v1.FeatureParams.pbts_enable_height": - x.PbtsEnableHeight = value.Message().Interface().(*wrapperspb.Int64Value) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.FeatureParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.FeatureParams does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_FeatureParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.consensus.v1.FeatureParams.vote_extensions_enable_height": - if x.VoteExtensionsEnableHeight == nil { - x.VoteExtensionsEnableHeight = new(wrapperspb.Int64Value) - } - return protoreflect.ValueOfMessage(x.VoteExtensionsEnableHeight.ProtoReflect()) - case "cosmos.consensus.v1.FeatureParams.pbts_enable_height": - if x.PbtsEnableHeight == nil { - x.PbtsEnableHeight = new(wrapperspb.Int64Value) - } - return protoreflect.ValueOfMessage(x.PbtsEnableHeight.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.FeatureParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.FeatureParams does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_FeatureParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.consensus.v1.FeatureParams.vote_extensions_enable_height": - m := new(wrapperspb.Int64Value) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "cosmos.consensus.v1.FeatureParams.pbts_enable_height": - m := new(wrapperspb.Int64Value) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.FeatureParams")) - } - panic(fmt.Errorf("message cosmos.consensus.v1.FeatureParams does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_FeatureParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.consensus.v1.FeatureParams", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_FeatureParams) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_FeatureParams) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_FeatureParams) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_FeatureParams) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*FeatureParams) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if x.VoteExtensionsEnableHeight != nil { - l = options.Size(x.VoteExtensionsEnableHeight) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.PbtsEnableHeight != nil { - l = options.Size(x.PbtsEnableHeight) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*FeatureParams) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if x.PbtsEnableHeight != nil { - encoded, err := options.Marshal(x.PbtsEnableHeight) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x12 - } - if x.VoteExtensionsEnableHeight != nil { - encoded, err := options.Marshal(x.VoteExtensionsEnableHeight) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0xa - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*FeatureParams) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire 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++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: FeatureParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: FeatureParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field VoteExtensionsEnableHeight", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.VoteExtensionsEnableHeight == nil { - x.VoteExtensionsEnableHeight = &wrapperspb.Int64Value{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.VoteExtensionsEnableHeight); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PbtsEnableHeight", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.PbtsEnableHeight == nil { - x.PbtsEnableHeight = &wrapperspb.Int64Value{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.PbtsEnableHeight); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.0 -// protoc (unknown) -// source: cosmos/consensus/v1/params.proto - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// ConsensusParams contains consensus critical parameters that determine the -// validity of blocks. -type ConsensusParams struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Block *BlockParams `protobuf:"bytes,1,opt,name=block,proto3" json:"block,omitempty"` - Evidence *EvidenceParams `protobuf:"bytes,2,opt,name=evidence,proto3" json:"evidence,omitempty"` - Validator *ValidatorParams `protobuf:"bytes,3,opt,name=validator,proto3" json:"validator,omitempty"` - Version *VersionParams `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"` - Synchrony *SynchronyParams `protobuf:"bytes,6,opt,name=synchrony,proto3" json:"synchrony,omitempty"` - Feature *FeatureParams `protobuf:"bytes,7,opt,name=feature,proto3" json:"feature,omitempty"` -} - -func (x *ConsensusParams) Reset() { - *x = ConsensusParams{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_consensus_v1_params_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ConsensusParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ConsensusParams) ProtoMessage() {} - -// Deprecated: Use ConsensusParams.ProtoReflect.Descriptor instead. -func (*ConsensusParams) Descriptor() ([]byte, []int) { - return file_cosmos_consensus_v1_params_proto_rawDescGZIP(), []int{0} -} - -func (x *ConsensusParams) GetBlock() *BlockParams { - if x != nil { - return x.Block - } - return nil -} - -func (x *ConsensusParams) GetEvidence() *EvidenceParams { - if x != nil { - return x.Evidence - } - return nil -} - -func (x *ConsensusParams) GetValidator() *ValidatorParams { - if x != nil { - return x.Validator - } - return nil -} - -func (x *ConsensusParams) GetVersion() *VersionParams { - if x != nil { - return x.Version - } - return nil -} - -func (x *ConsensusParams) GetSynchrony() *SynchronyParams { - if x != nil { - return x.Synchrony - } - return nil -} - -func (x *ConsensusParams) GetFeature() *FeatureParams { - if x != nil { - return x.Feature - } - return nil -} - -// BlockParams define limits on the block size and gas. -type BlockParams struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Maximum size of a block, in bytes. - // - // Must be greater or equal to -1 and cannot be greater than the hard-coded - // maximum block size, which is 100MB. - // - // If set to -1, the limit is the hard-coded maximum block size. - MaxBytes int64 `protobuf:"varint,1,opt,name=max_bytes,json=maxBytes,proto3" json:"max_bytes,omitempty"` - // Maximum gas wanted by transactions included in a block. - // - // Must be greater or equal to -1. If set to -1, no limit is enforced. - MaxGas int64 `protobuf:"varint,2,opt,name=max_gas,json=maxGas,proto3" json:"max_gas,omitempty"` -} - -func (x *BlockParams) Reset() { - *x = BlockParams{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_consensus_v1_params_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BlockParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BlockParams) ProtoMessage() {} - -// Deprecated: Use BlockParams.ProtoReflect.Descriptor instead. -func (*BlockParams) Descriptor() ([]byte, []int) { - return file_cosmos_consensus_v1_params_proto_rawDescGZIP(), []int{1} -} - -func (x *BlockParams) GetMaxBytes() int64 { - if x != nil { - return x.MaxBytes - } - return 0 -} - -func (x *BlockParams) GetMaxGas() int64 { - if x != nil { - return x.MaxGas - } - return 0 -} - -// EvidenceParams determine the validity of evidences of Byzantine behavior. -type EvidenceParams struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Maximum age of evidence, in blocks. - // - // The recommended formula for calculating it is max_age_duration / {average - // block time}. - MaxAgeNumBlocks int64 `protobuf:"varint,1,opt,name=max_age_num_blocks,json=maxAgeNumBlocks,proto3" json:"max_age_num_blocks,omitempty"` - // Maximum age of evidence, in time. - // - // The recommended value of is should correspond to the application's - // "unbonding period" or other similar mechanism for handling - // Nothing-At-Stake attacks. - // See: - // https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed. - MaxAgeDuration *durationpb.Duration `protobuf:"bytes,2,opt,name=max_age_duration,json=maxAgeDuration,proto3" json:"max_age_duration,omitempty"` - // Maximum size in bytes of evidence allowed to be included in a block. - // - // It should fall comfortably under the maximum size of a block. - MaxBytes int64 `protobuf:"varint,3,opt,name=max_bytes,json=maxBytes,proto3" json:"max_bytes,omitempty"` -} - -func (x *EvidenceParams) Reset() { - *x = EvidenceParams{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_consensus_v1_params_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EvidenceParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EvidenceParams) ProtoMessage() {} - -// Deprecated: Use EvidenceParams.ProtoReflect.Descriptor instead. -func (*EvidenceParams) Descriptor() ([]byte, []int) { - return file_cosmos_consensus_v1_params_proto_rawDescGZIP(), []int{2} -} - -func (x *EvidenceParams) GetMaxAgeNumBlocks() int64 { - if x != nil { - return x.MaxAgeNumBlocks - } - return 0 -} - -func (x *EvidenceParams) GetMaxAgeDuration() *durationpb.Duration { - if x != nil { - return x.MaxAgeDuration - } - return nil -} - -func (x *EvidenceParams) GetMaxBytes() int64 { - if x != nil { - return x.MaxBytes - } - return 0 -} - -// ValidatorParams restrict the public key types validators can use. -// -// NOTE: uses ABCI public keys naming, not Amino names. -type ValidatorParams struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - PubKeyTypes []string `protobuf:"bytes,1,rep,name=pub_key_types,json=pubKeyTypes,proto3" json:"pub_key_types,omitempty"` -} - -func (x *ValidatorParams) Reset() { - *x = ValidatorParams{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_consensus_v1_params_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ValidatorParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ValidatorParams) ProtoMessage() {} - -// Deprecated: Use ValidatorParams.ProtoReflect.Descriptor instead. -func (*ValidatorParams) Descriptor() ([]byte, []int) { - return file_cosmos_consensus_v1_params_proto_rawDescGZIP(), []int{3} -} - -func (x *ValidatorParams) GetPubKeyTypes() []string { - if x != nil { - return x.PubKeyTypes - } - return nil -} - -// VersionParams contain the version of specific components of CometBFT. -type VersionParams struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ABCI application version. - // - // It was named app_version in CometBFT 0.34. - App uint64 `protobuf:"varint,1,opt,name=app,proto3" json:"app,omitempty"` -} - -func (x *VersionParams) Reset() { - *x = VersionParams{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_consensus_v1_params_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *VersionParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*VersionParams) ProtoMessage() {} - -// Deprecated: Use VersionParams.ProtoReflect.Descriptor instead. -func (*VersionParams) Descriptor() ([]byte, []int) { - return file_cosmos_consensus_v1_params_proto_rawDescGZIP(), []int{4} -} - -func (x *VersionParams) GetApp() uint64 { - if x != nil { - return x.App - } - return 0 -} - -// HashedParams is a subset of ConsensusParams. -// -// It is hashed into the Header.ConsensusHash. -type HashedParams struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - BlockMaxBytes int64 `protobuf:"varint,1,opt,name=block_max_bytes,json=blockMaxBytes,proto3" json:"block_max_bytes,omitempty"` - BlockMaxGas int64 `protobuf:"varint,2,opt,name=block_max_gas,json=blockMaxGas,proto3" json:"block_max_gas,omitempty"` -} - -func (x *HashedParams) Reset() { - *x = HashedParams{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_consensus_v1_params_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *HashedParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HashedParams) ProtoMessage() {} - -// Deprecated: Use HashedParams.ProtoReflect.Descriptor instead. -func (*HashedParams) Descriptor() ([]byte, []int) { - return file_cosmos_consensus_v1_params_proto_rawDescGZIP(), []int{5} -} - -func (x *HashedParams) GetBlockMaxBytes() int64 { - if x != nil { - return x.BlockMaxBytes - } - return 0 -} - -func (x *HashedParams) GetBlockMaxGas() int64 { - if x != nil { - return x.BlockMaxGas - } - return 0 -} - -// SynchronyParams determine the validity of block timestamps. -// -// These parameters are part of the Proposer-Based Timestamps (PBTS) algorithm. -// For more information on the relationship of the synchrony parameters to -// block timestamps validity, refer to the PBTS specification: -// https://github.com/tendermint/spec/blob/master/spec/consensus/proposer-based-timestamp/README.md -type SynchronyParams struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Bound for how skewed a proposer's clock may be from any validator on the - // network while still producing valid proposals. - Precision *durationpb.Duration `protobuf:"bytes,1,opt,name=precision,proto3" json:"precision,omitempty"` - // Bound for how long a proposal message may take to reach all validators on - // a network and still be considered valid. - MessageDelay *durationpb.Duration `protobuf:"bytes,2,opt,name=message_delay,json=messageDelay,proto3" json:"message_delay,omitempty"` -} - -func (x *SynchronyParams) Reset() { - *x = SynchronyParams{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_consensus_v1_params_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SynchronyParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SynchronyParams) ProtoMessage() {} - -// Deprecated: Use SynchronyParams.ProtoReflect.Descriptor instead. -func (*SynchronyParams) Descriptor() ([]byte, []int) { - return file_cosmos_consensus_v1_params_proto_rawDescGZIP(), []int{6} -} - -func (x *SynchronyParams) GetPrecision() *durationpb.Duration { - if x != nil { - return x.Precision - } - return nil -} - -func (x *SynchronyParams) GetMessageDelay() *durationpb.Duration { - if x != nil { - return x.MessageDelay - } - return nil -} - -// FeatureParams configure the height from which features of CometBFT are enabled. -type FeatureParams struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Height during which vote extensions will be enabled. - // - // A value of 0 means vote extensions are disabled. A value > 0 denotes - // the height at which vote extensions will be (or have been) enabled. - // - // During the specified height, and for all subsequent heights, precommit - // messages that do not contain valid extension data will be considered - // invalid. Prior to this height, or when this height is set to 0, vote - // extensions will not be used or accepted by validators on the network. - // - // Once enabled, vote extensions will be created by the application in - // ExtendVote, validated by the application in VerifyVoteExtension, and - // used by the application in PrepareProposal, when proposing the next block. - // - // Cannot be set to heights lower or equal to the current blockchain height. - VoteExtensionsEnableHeight *wrapperspb.Int64Value `protobuf:"bytes,1,opt,name=vote_extensions_enable_height,json=voteExtensionsEnableHeight,proto3" json:"vote_extensions_enable_height,omitempty"` - // Height at which Proposer-Based Timestamps (PBTS) will be enabled. - // - // A value of 0 means PBTS is disabled. A value > 0 denotes the height at - // which PBTS will be (or has been) enabled. - // - // From the specified height, and for all subsequent heights, the PBTS - // algorithm will be used to produce and validate block timestamps. Prior to - // this height, or when this height is set to 0, the legacy BFT Time - // algorithm is used to produce and validate timestamps. - // - // Cannot be set to heights lower or equal to the current blockchain height. - PbtsEnableHeight *wrapperspb.Int64Value `protobuf:"bytes,2,opt,name=pbts_enable_height,json=pbtsEnableHeight,proto3" json:"pbts_enable_height,omitempty"` -} - -func (x *FeatureParams) Reset() { - *x = FeatureParams{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_consensus_v1_params_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FeatureParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FeatureParams) ProtoMessage() {} - -// Deprecated: Use FeatureParams.ProtoReflect.Descriptor instead. -func (*FeatureParams) Descriptor() ([]byte, []int) { - return file_cosmos_consensus_v1_params_proto_rawDescGZIP(), []int{7} -} - -func (x *FeatureParams) GetVoteExtensionsEnableHeight() *wrapperspb.Int64Value { - if x != nil { - return x.VoteExtensionsEnableHeight - } - return nil -} - -func (x *FeatureParams) GetPbtsEnableHeight() *wrapperspb.Int64Value { - if x != nil { - return x.PbtsEnableHeight - } - return nil -} - -var File_cosmos_consensus_v1_params_proto protoreflect.FileDescriptor - -var file_cosmos_consensus_v1_params_proto_rawDesc = []byte{ - 0x0a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, - 0x75, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x12, 0x13, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, - 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, - 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, - 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8e, 0x03, - 0x0a, 0x0f, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x12, 0x36, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, - 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x3f, 0x0a, 0x08, 0x65, 0x76, 0x69, - 0x64, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x76, - 0x31, 0x2e, 0x45, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x52, 0x08, 0x65, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x42, 0x0a, 0x09, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, - 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x3c, - 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, - 0x75, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x42, 0x0a, 0x09, - 0x73, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, - 0x75, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x79, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x09, 0x73, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x79, - 0x12, 0x3c, 0x0a, 0x07, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, - 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x07, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x49, - 0x0a, 0x0b, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1b, 0x0a, - 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x08, 0x6d, 0x61, 0x78, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x6d, 0x61, - 0x78, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6d, 0x61, 0x78, - 0x47, 0x61, 0x73, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x22, 0xa9, 0x01, 0x0a, 0x0e, 0x45, 0x76, - 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x2b, 0x0a, 0x12, - 0x6d, 0x61, 0x78, 0x5f, 0x61, 0x67, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x5f, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x6d, 0x61, 0x78, 0x41, 0x67, 0x65, - 0x4e, 0x75, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x4d, 0x0a, 0x10, 0x6d, 0x61, 0x78, - 0x5f, 0x61, 0x67, 0x65, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x08, - 0xc8, 0xde, 0x1f, 0x00, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x0e, 0x6d, 0x61, 0x78, 0x41, 0x67, 0x65, - 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, - 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x61, 0x78, - 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0x3f, 0x0a, 0x0f, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x22, 0x0a, 0x0d, 0x70, 0x75, 0x62, 0x5f, - 0x6b, 0x65, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x0b, 0x70, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x73, 0x3a, 0x08, 0xb8, 0xa0, - 0x1f, 0x01, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0x2b, 0x0a, 0x0d, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x70, 0x70, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x61, 0x70, 0x70, 0x3a, 0x08, 0xb8, 0xa0, 0x1f, 0x01, 0xe8, - 0xa0, 0x1f, 0x01, 0x22, 0x5a, 0x0a, 0x0c, 0x48, 0x61, 0x73, 0x68, 0x65, 0x64, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6d, 0x61, 0x78, - 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x4d, 0x61, 0x78, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x22, 0x0a, 0x0d, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6d, 0x61, 0x78, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4d, 0x61, 0x78, 0x47, 0x61, 0x73, 0x22, - 0x96, 0x01, 0x0a, 0x0f, 0x53, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x79, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x12, 0x3d, 0x0a, 0x09, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, - 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, 0x09, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, - 0x6f, 0x6e, 0x12, 0x44, 0x0a, 0x0d, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x64, 0x65, - 0x6c, 0x61, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x0c, 0x6d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x22, 0xc6, 0x01, 0x0a, 0x0d, 0x46, 0x65, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x64, 0x0a, 0x1d, 0x76, 0x6f, - 0x74, 0x65, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x65, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x04, - 0xc8, 0xde, 0x1f, 0x01, 0x52, 0x1a, 0x76, 0x6f, 0x74, 0x65, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, - 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, - 0x12, 0x4f, 0x0a, 0x12, 0x70, 0x62, 0x74, 0x73, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, - 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, - 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x01, 0x52, - 0x10, 0x70, 0x62, 0x74, 0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x48, 0x65, 0x69, 0x67, 0x68, - 0x74, 0x42, 0xc6, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2f, - 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x76, 0x31, 0xa2, 0x02, - 0x03, 0x43, 0x43, 0x58, 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x43, 0x6f, - 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5c, 0x56, 0x31, - 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, - 0x73, 0x75, 0x73, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0xea, 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x43, 0x6f, 0x6e, - 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, -} - -var ( - file_cosmos_consensus_v1_params_proto_rawDescOnce sync.Once - file_cosmos_consensus_v1_params_proto_rawDescData = file_cosmos_consensus_v1_params_proto_rawDesc -) - -func file_cosmos_consensus_v1_params_proto_rawDescGZIP() []byte { - file_cosmos_consensus_v1_params_proto_rawDescOnce.Do(func() { - file_cosmos_consensus_v1_params_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_consensus_v1_params_proto_rawDescData) - }) - return file_cosmos_consensus_v1_params_proto_rawDescData -} - -var file_cosmos_consensus_v1_params_proto_msgTypes = make([]protoimpl.MessageInfo, 8) -var file_cosmos_consensus_v1_params_proto_goTypes = []interface{}{ - (*ConsensusParams)(nil), // 0: cosmos.consensus.v1.ConsensusParams - (*BlockParams)(nil), // 1: cosmos.consensus.v1.BlockParams - (*EvidenceParams)(nil), // 2: cosmos.consensus.v1.EvidenceParams - (*ValidatorParams)(nil), // 3: cosmos.consensus.v1.ValidatorParams - (*VersionParams)(nil), // 4: cosmos.consensus.v1.VersionParams - (*HashedParams)(nil), // 5: cosmos.consensus.v1.HashedParams - (*SynchronyParams)(nil), // 6: cosmos.consensus.v1.SynchronyParams - (*FeatureParams)(nil), // 7: cosmos.consensus.v1.FeatureParams - (*durationpb.Duration)(nil), // 8: google.protobuf.Duration - (*wrapperspb.Int64Value)(nil), // 9: google.protobuf.Int64Value -} -var file_cosmos_consensus_v1_params_proto_depIdxs = []int32{ - 1, // 0: cosmos.consensus.v1.ConsensusParams.block:type_name -> cosmos.consensus.v1.BlockParams - 2, // 1: cosmos.consensus.v1.ConsensusParams.evidence:type_name -> cosmos.consensus.v1.EvidenceParams - 3, // 2: cosmos.consensus.v1.ConsensusParams.validator:type_name -> cosmos.consensus.v1.ValidatorParams - 4, // 3: cosmos.consensus.v1.ConsensusParams.version:type_name -> cosmos.consensus.v1.VersionParams - 6, // 4: cosmos.consensus.v1.ConsensusParams.synchrony:type_name -> cosmos.consensus.v1.SynchronyParams - 7, // 5: cosmos.consensus.v1.ConsensusParams.feature:type_name -> cosmos.consensus.v1.FeatureParams - 8, // 6: cosmos.consensus.v1.EvidenceParams.max_age_duration:type_name -> google.protobuf.Duration - 8, // 7: cosmos.consensus.v1.SynchronyParams.precision:type_name -> google.protobuf.Duration - 8, // 8: cosmos.consensus.v1.SynchronyParams.message_delay:type_name -> google.protobuf.Duration - 9, // 9: cosmos.consensus.v1.FeatureParams.vote_extensions_enable_height:type_name -> google.protobuf.Int64Value - 9, // 10: cosmos.consensus.v1.FeatureParams.pbts_enable_height:type_name -> google.protobuf.Int64Value - 11, // [11:11] is the sub-list for method output_type - 11, // [11:11] is the sub-list for method input_type - 11, // [11:11] is the sub-list for extension type_name - 11, // [11:11] is the sub-list for extension extendee - 0, // [0:11] is the sub-list for field type_name -} - -func init() { file_cosmos_consensus_v1_params_proto_init() } -func file_cosmos_consensus_v1_params_proto_init() { - if File_cosmos_consensus_v1_params_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_cosmos_consensus_v1_params_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ConsensusParams); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cosmos_consensus_v1_params_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BlockParams); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cosmos_consensus_v1_params_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EvidenceParams); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cosmos_consensus_v1_params_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ValidatorParams); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cosmos_consensus_v1_params_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VersionParams); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cosmos_consensus_v1_params_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HashedParams); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cosmos_consensus_v1_params_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SynchronyParams); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cosmos_consensus_v1_params_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FeatureParams); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_cosmos_consensus_v1_params_proto_rawDesc, - NumEnums: 0, - NumMessages: 8, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_cosmos_consensus_v1_params_proto_goTypes, - DependencyIndexes: file_cosmos_consensus_v1_params_proto_depIdxs, - MessageInfos: file_cosmos_consensus_v1_params_proto_msgTypes, - }.Build() - File_cosmos_consensus_v1_params_proto = out.File - file_cosmos_consensus_v1_params_proto_rawDesc = nil - file_cosmos_consensus_v1_params_proto_goTypes = nil - file_cosmos_consensus_v1_params_proto_depIdxs = nil -} From fde70e0cac997aa72dc0c0afce1f86b2664e2458 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Fri, 30 Aug 2024 14:36:07 +0200 Subject: [PATCH 05/23] remove consensus from all indirect imports --- client/v2/go.mod | 1 - simapp/app.go | 5 +- x/accounts/defaults/lockup/go.mod | 1 - x/accounts/defaults/multisig/go.mod | 1 - x/accounts/go.mod | 1 - .../ante/testutil/expected_keepers_mocks.go | 33 +++-- x/authz/go.mod | 1 - x/bank/go.mod | 1 - x/circuit/go.mod | 1 - x/consensus/keeper/keeper.go | 41 ++++++ x/epochs/go.mod | 1 - x/evidence/depinject.go | 9 +- x/evidence/go.mod | 1 - x/evidence/keeper/keeper.go | 15 ++- x/evidence/keeper/keeper_test.go | 2 + x/evidence/testutil/expected_keepers_mocks.go | 39 ++++++ x/feegrant/go.mod | 1 - x/gov/go.mod | 1 - x/mint/go.mod | 1 - x/nft/go.mod | 1 - x/params/go.mod | 1 - x/protocolpool/go.mod | 1 - x/slashing/go.mod | 1 - x/staking/depinject.go | 2 + x/staking/go.mod | 1 - x/staking/keeper/keeper.go | 2 + x/staking/keeper/keeper_test.go | 12 +- x/staking/testutil/expected_keepers_mocks.go | 121 +++++++++--------- x/upgrade/depinject.go | 3 +- x/upgrade/go.mod | 1 - x/upgrade/keeper/keeper.go | 2 + 31 files changed, 185 insertions(+), 119 deletions(-) diff --git a/client/v2/go.mod b/client/v2/go.mod index 8d2d1fe32d53..dba2945677d9 100644 --- a/client/v2/go.mod +++ b/client/v2/go.mod @@ -28,7 +28,6 @@ require ( cosmossdk.io/math v1.3.0 cosmossdk.io/store v1.1.1-0.20240418092142-896cdf1971bc // indirect cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000 - cosmossdk.io/x/consensus v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect diff --git a/simapp/app.go b/simapp/app.go index 1e64e65dee18..21e87e152e03 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -350,6 +350,7 @@ func NewSimApp( runtime.EnvWithQueryRouterService(app.GRPCQueryRouter())), app.AuthKeeper, app.BankKeeper, + app.ConsensusParamsKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(), signingCtx.ValidatorAddressCodec(), authcodec.NewBech32Codec(sdk.Bech32PrefixConsAddr), @@ -396,7 +397,7 @@ func NewSimApp( } homePath := cast.ToString(appOpts.Get(flags.FlagHome)) // set the governance module account as the authority for conducting upgrades - app.UpgradeKeeper = upgradekeeper.NewKeeper(runtime.NewEnvironment(runtime.NewKVStoreService(keys[upgradetypes.StoreKey]), logger.With(log.ModuleKey, "x/upgrade"), runtime.EnvWithMsgRouterService(app.MsgServiceRouter()), runtime.EnvWithQueryRouterService(app.GRPCQueryRouter())), skipUpgradeHeights, appCodec, homePath, app.BaseApp, authtypes.NewModuleAddress(govtypes.ModuleName).String()) + app.UpgradeKeeper = upgradekeeper.NewKeeper(runtime.NewEnvironment(runtime.NewKVStoreService(keys[upgradetypes.StoreKey]), logger.With(log.ModuleKey, "x/upgrade"), runtime.EnvWithMsgRouterService(app.MsgServiceRouter()), runtime.EnvWithQueryRouterService(app.GRPCQueryRouter())), skipUpgradeHeights, appCodec, homePath, app.BaseApp, authtypes.NewModuleAddress(govtypes.ModuleName).String(), app.ConsensusParamsKeeper) // Register the proposal types // Deprecated: Avoid adding new handlers, instead use the new proposal flow @@ -423,7 +424,7 @@ func NewSimApp( // create evidence keeper with router evidenceKeeper := evidencekeeper.NewKeeper( - appCodec, runtime.NewEnvironment(runtime.NewKVStoreService(keys[evidencetypes.StoreKey]), logger.With(log.ModuleKey, "x/evidence"), runtime.EnvWithMsgRouterService(app.MsgServiceRouter()), runtime.EnvWithQueryRouterService(app.GRPCQueryRouter())), app.StakingKeeper, app.SlashingKeeper, app.AuthKeeper.AddressCodec(), + appCodec, runtime.NewEnvironment(runtime.NewKVStoreService(keys[evidencetypes.StoreKey]), logger.With(log.ModuleKey, "x/evidence"), runtime.EnvWithMsgRouterService(app.MsgServiceRouter()), runtime.EnvWithQueryRouterService(app.GRPCQueryRouter())), app.StakingKeeper, app.SlashingKeeper, app.ConsensusParamsKeeper, app.AuthKeeper.AddressCodec(), ) // If evidence needs to be handled for the app, set routes in router here and seal app.EvidenceKeeper = *evidenceKeeper diff --git a/x/accounts/defaults/lockup/go.mod b/x/accounts/defaults/lockup/go.mod index a4092c606960..46d7cc37b13c 100644 --- a/x/accounts/defaults/lockup/go.mod +++ b/x/accounts/defaults/lockup/go.mod @@ -26,7 +26,6 @@ require ( cosmossdk.io/math v1.3.0 cosmossdk.io/store v1.1.1-0.20240418092142-896cdf1971bc // indirect cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000 // indirect - cosmossdk.io/x/consensus v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/tx v0.13.3 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect diff --git a/x/accounts/defaults/multisig/go.mod b/x/accounts/defaults/multisig/go.mod index 6fdd2912273c..3de951d25699 100644 --- a/x/accounts/defaults/multisig/go.mod +++ b/x/accounts/defaults/multisig/go.mod @@ -26,7 +26,6 @@ require ( cosmossdk.io/schema v0.1.1 // indirect cosmossdk.io/store v1.1.1-0.20240418092142-896cdf1971bc // indirect cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000 // indirect - cosmossdk.io/x/consensus v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/tx v0.13.3 // indirect filippo.io/edwards25519 v1.1.0 // indirect diff --git a/x/accounts/go.mod b/x/accounts/go.mod index 44587ea23a2c..c71b0244f9f4 100644 --- a/x/accounts/go.mod +++ b/x/accounts/go.mod @@ -30,7 +30,6 @@ require ( cosmossdk.io/store v1.1.1-0.20240418092142-896cdf1971bc // indirect cosmossdk.io/x/accounts/defaults/lockup v0.0.0-20240417181816-5e7aae0db1f5 cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000 // indirect - cosmossdk.io/x/consensus v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/distribution v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 // indirect filippo.io/edwards25519 v1.1.0 // indirect diff --git a/x/auth/ante/testutil/expected_keepers_mocks.go b/x/auth/ante/testutil/expected_keepers_mocks.go index e848a52342cf..e087b2a45044 100644 --- a/x/auth/ante/testutil/expected_keepers_mocks.go +++ b/x/auth/ante/testutil/expected_keepers_mocks.go @@ -11,8 +11,7 @@ import ( address "cosmossdk.io/core/address" appmodule "cosmossdk.io/core/appmodule" types "cosmossdk.io/x/auth/types" - types0 "cosmossdk.io/x/consensus/types" - types1 "github.com/cosmos/cosmos-sdk/types" + types0 "github.com/cosmos/cosmos-sdk/types" gomock "github.com/golang/mock/gomock" ) @@ -54,10 +53,10 @@ func (mr *MockAccountKeeperMockRecorder) AddressCodec() *gomock.Call { } // GetAccount mocks base method. -func (m *MockAccountKeeper) GetAccount(ctx context.Context, addr types1.AccAddress) types1.AccountI { +func (m *MockAccountKeeper) GetAccount(ctx context.Context, addr types0.AccAddress) types0.AccountI { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetAccount", ctx, addr) - ret0, _ := ret[0].(types1.AccountI) + ret0, _ := ret[0].(types0.AccountI) return ret0 } @@ -82,10 +81,10 @@ func (mr *MockAccountKeeperMockRecorder) GetEnvironment() *gomock.Call { } // GetModuleAddress mocks base method. -func (m *MockAccountKeeper) GetModuleAddress(moduleName string) types1.AccAddress { +func (m *MockAccountKeeper) GetModuleAddress(moduleName string) types0.AccAddress { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetModuleAddress", moduleName) - ret0, _ := ret[0].(types1.AccAddress) + ret0, _ := ret[0].(types0.AccAddress) return ret0 } @@ -110,10 +109,10 @@ func (mr *MockAccountKeeperMockRecorder) GetParams(ctx interface{}) *gomock.Call } // NewAccountWithAddress mocks base method. -func (m *MockAccountKeeper) NewAccountWithAddress(ctx context.Context, addr types1.AccAddress) types1.AccountI { +func (m *MockAccountKeeper) NewAccountWithAddress(ctx context.Context, addr types0.AccAddress) types0.AccountI { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "NewAccountWithAddress", ctx, addr) - ret0, _ := ret[0].(types1.AccountI) + ret0, _ := ret[0].(types0.AccountI) return ret0 } @@ -124,7 +123,7 @@ func (mr *MockAccountKeeperMockRecorder) NewAccountWithAddress(ctx, addr interfa } // SetAccount mocks base method. -func (m *MockAccountKeeper) SetAccount(ctx context.Context, acc types1.AccountI) { +func (m *MockAccountKeeper) SetAccount(ctx context.Context, acc types0.AccountI) { m.ctrl.T.Helper() m.ctrl.Call(m, "SetAccount", ctx, acc) } @@ -159,7 +158,7 @@ func (m *MockFeegrantKeeper) EXPECT() *MockFeegrantKeeperMockRecorder { } // UseGrantedFees mocks base method. -func (m *MockFeegrantKeeper) UseGrantedFees(ctx context.Context, granter, grantee types1.AccAddress, fee types1.Coins, msgs []types1.Msg) error { +func (m *MockFeegrantKeeper) UseGrantedFees(ctx context.Context, granter, grantee types0.AccAddress, fee types0.Coins, msgs []types0.Msg) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "UseGrantedFees", ctx, granter, grantee, fee, msgs) ret0, _ := ret[0].(error) @@ -195,17 +194,17 @@ func (m *MockConsensusKeeper) EXPECT() *MockConsensusKeeperMockRecorder { return m.recorder } -// Params mocks base method. -func (m *MockConsensusKeeper) Params(arg0 context.Context, arg1 *types0.QueryParamsRequest) (*types0.QueryParamsResponse, error) { +// BlockGas mocks base method. +func (m *MockConsensusKeeper) BlockGas(arg0 context.Context) (uint64, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Params", arg0, arg1) - ret0, _ := ret[0].(*types0.QueryParamsResponse) + ret := m.ctrl.Call(m, "BlockGas", arg0) + ret0, _ := ret[0].(uint64) ret1, _ := ret[1].(error) return ret0, ret1 } -// Params indicates an expected call of Params. -func (mr *MockConsensusKeeperMockRecorder) Params(arg0, arg1 interface{}) *gomock.Call { +// BlockGas indicates an expected call of BlockGas. +func (mr *MockConsensusKeeperMockRecorder) BlockGas(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Params", reflect.TypeOf((*MockConsensusKeeper)(nil).Params), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BlockGas", reflect.TypeOf((*MockConsensusKeeper)(nil).BlockGas), arg0) } diff --git a/x/authz/go.mod b/x/authz/go.mod index 95a6b083c9e4..686358cea59e 100644 --- a/x/authz/go.mod +++ b/x/authz/go.mod @@ -32,7 +32,6 @@ require ( cosmossdk.io/collections v0.4.0 // indirect cosmossdk.io/core/testing v0.0.0-00010101000000-000000000000 cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000 - cosmossdk.io/x/consensus v0.0.0-00010101000000-000000000000 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect diff --git a/x/bank/go.mod b/x/bank/go.mod index 46ff207b3128..97296e6dda49 100644 --- a/x/bank/go.mod +++ b/x/bank/go.mod @@ -31,7 +31,6 @@ require ( buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.34.2-20240701160653-fedbb9acfd2f.2 // indirect buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.34.2-20240130113600-88ef6483f90f.2 // indirect cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000 - cosmossdk.io/x/consensus v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/tx v0.13.3 // indirect filippo.io/edwards25519 v1.1.0 // indirect diff --git a/x/circuit/go.mod b/x/circuit/go.mod index c790e0b0b507..d691bcdc4d95 100644 --- a/x/circuit/go.mod +++ b/x/circuit/go.mod @@ -27,7 +27,6 @@ require ( cosmossdk.io/math v1.3.0 // indirect cosmossdk.io/schema v0.1.1 // indirect cosmossdk.io/x/bank v0.0.0-20240226161501-23359a0b6d91 // indirect - cosmossdk.io/x/consensus v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/tx v0.13.3 // indirect filippo.io/edwards25519 v1.1.0 // indirect diff --git a/x/consensus/keeper/keeper.go b/x/consensus/keeper/keeper.go index 958d50072c1a..c54a13f7994a 100644 --- a/x/consensus/keeper/keeper.go +++ b/x/consensus/keeper/keeper.go @@ -4,6 +4,7 @@ import ( "context" "errors" "fmt" + "time" cmtproto "github.com/cometbft/cometbft/api/cometbft/types/v1" cmttypes "github.com/cometbft/cometbft/types" @@ -139,3 +140,43 @@ func (k Keeper) paramCheck(ctx context.Context, consensusParams cmtproto.Consens return &nextParams, nil } + +// BlockGas returns the maximum gas allowed in a block. +func (k Keeper) BlockGas(ctx context.Context) (uint64, error) { + params, err := k.ParamsStore.Get(ctx) + if err != nil { + return 0, err + } + + return uint64(params.Block.MaxGas), nil +} + +// AppVersion returns the current application version. +func (k Keeper) AppVersion(ctx context.Context) (uint64, error) { + params, err := k.ParamsStore.Get(ctx) + if err != nil { + return 0, err + } + + return params.Version.App, nil +} + +// ValidatorPubKeyTypes returns the list of public key types that are allowed to be used for validators. +func (k Keeper) ValidatorPubKeyTypes(ctx context.Context) ([]string, error) { + params, err := k.ParamsStore.Get(ctx) + if err != nil { + return nil, err + } + + return params.Validator.PubKeyTypes, nil +} + +// EvidenceAge returns the maximum age of evidence and the time duration of the maximum age. +func (k Keeper) EvidenceAge(ctx context.Context) (int64, time.Duration, error) { + params, err := k.ParamsStore.Get(ctx) + if err != nil { + return 0, 0, err + } + + return params.Evidence.MaxAgeNumBlocks, params.Evidence.MaxAgeDuration, nil +} diff --git a/x/epochs/go.mod b/x/epochs/go.mod index ead1cee16e5b..a6ecfd7d956d 100644 --- a/x/epochs/go.mod +++ b/x/epochs/go.mod @@ -167,7 +167,6 @@ require ( require ( cosmossdk.io/log v1.4.1 // indirect cosmossdk.io/schema v0.1.1 // indirect - cosmossdk.io/x/consensus v0.0.0-00010101000000-000000000000 // indirect github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect ) diff --git a/x/evidence/depinject.go b/x/evidence/depinject.go index 9f72496a21a1..ecbbbbde0330 100644 --- a/x/evidence/depinject.go +++ b/x/evidence/depinject.go @@ -33,9 +33,10 @@ type ModuleInputs struct { EvidenceHandlers []eviclient.EvidenceHandler `optional:"true"` CometService comet.Service - StakingKeeper types.StakingKeeper - SlashingKeeper types.SlashingKeeper - AddressCodec address.Codec + StakingKeeper types.StakingKeeper + SlashingKeeper types.SlashingKeeper + ConsensusKeeper types.ConsensusKeeper + AddressCodec address.Codec } type ModuleOutputs struct { @@ -46,7 +47,7 @@ type ModuleOutputs struct { } func ProvideModule(in ModuleInputs) ModuleOutputs { - k := keeper.NewKeeper(in.Cdc, in.Environment, in.StakingKeeper, in.SlashingKeeper, in.AddressCodec) + k := keeper.NewKeeper(in.Cdc, in.Environment, in.StakingKeeper, in.SlashingKeeper, in.ConsensusKeeper, in.AddressCodec) m := NewAppModule(in.Cdc, *k, in.CometService, in.EvidenceHandlers...) return ModuleOutputs{EvidenceKeeper: *k, Module: m} diff --git a/x/evidence/go.mod b/x/evidence/go.mod index 78d8aaf1de4d..68fdb9619966 100644 --- a/x/evidence/go.mod +++ b/x/evidence/go.mod @@ -26,7 +26,6 @@ require ( require ( buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.34.2-20240701160653-fedbb9acfd2f.2 // indirect - cosmossdk.io/x/consensus v0.0.0-00010101000000-000000000000 // indirect buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.34.2-20240130113600-88ef6483f90f.2 // indirect cosmossdk.io/log v1.4.1 // indirect cosmossdk.io/schema v0.1.1 // indirect diff --git a/x/evidence/keeper/keeper.go b/x/evidence/keeper/keeper.go index edc099ed1496..8cab89fbdd0e 100644 --- a/x/evidence/keeper/keeper.go +++ b/x/evidence/keeper/keeper.go @@ -38,16 +38,17 @@ type Keeper struct { // NewKeeper creates a new Keeper object. func NewKeeper( cdc codec.BinaryCodec, env appmodule.Environment, stakingKeeper types.StakingKeeper, - slashingKeeper types.SlashingKeeper, ac address.Codec, + slashingKeeper types.SlashingKeeper, ck types.ConsensusKeeper, ac address.Codec, ) *Keeper { sb := collections.NewSchemaBuilder(env.KVStoreService) k := &Keeper{ - Environment: env, - cdc: cdc, - stakingKeeper: stakingKeeper, - slashingKeeper: slashingKeeper, - addressCodec: ac, - Evidences: collections.NewMap(sb, types.KeyPrefixEvidence, "evidences", collections.BytesKey, codec.CollInterfaceValue[exported.Evidence](cdc)), + Environment: env, + cdc: cdc, + stakingKeeper: stakingKeeper, + slashingKeeper: slashingKeeper, + consensusKeeper: ck, + addressCodec: ac, + Evidences: collections.NewMap(sb, types.KeyPrefixEvidence, "evidences", collections.BytesKey, codec.CollInterfaceValue[exported.Evidence](cdc)), } schema, err := sb.Build() if err != nil { diff --git a/x/evidence/keeper/keeper_test.go b/x/evidence/keeper/keeper_test.go index 3ec2a425e607..6820bb826511 100644 --- a/x/evidence/keeper/keeper_test.go +++ b/x/evidence/keeper/keeper_test.go @@ -102,12 +102,14 @@ func (suite *KeeperTestSuite) SetupTest() { stakingKeeper := evidencetestutil.NewMockStakingKeeper(ctrl) slashingKeeper := evidencetestutil.NewMockSlashingKeeper(ctrl) accountKeeper := evidencetestutil.NewMockAccountKeeper(ctrl) + ck := evidencetestutil.NewMockConsensusKeeper(ctrl) evidenceKeeper := keeper.NewKeeper( encCfg.Codec, env, stakingKeeper, slashingKeeper, + ck, address.NewBech32Codec("cosmos"), ) diff --git a/x/evidence/testutil/expected_keepers_mocks.go b/x/evidence/testutil/expected_keepers_mocks.go index 77aaba045a5c..5922b6f22fb2 100644 --- a/x/evidence/testutil/expected_keepers_mocks.go +++ b/x/evidence/testutil/expected_keepers_mocks.go @@ -254,3 +254,42 @@ func (mr *MockAccountKeeperMockRecorder) SetAccount(ctx, acc interface{}) *gomoc mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetAccount", reflect.TypeOf((*MockAccountKeeper)(nil).SetAccount), ctx, acc) } + +// MockConsensusKeeper is a mock of ConsensusKeeper interface. +type MockConsensusKeeper struct { + ctrl *gomock.Controller + recorder *MockConsensusKeeperMockRecorder +} + +// MockConsensusKeeperMockRecorder is the mock recorder for MockConsensusKeeper. +type MockConsensusKeeperMockRecorder struct { + mock *MockConsensusKeeper +} + +// NewMockConsensusKeeper creates a new mock instance. +func NewMockConsensusKeeper(ctrl *gomock.Controller) *MockConsensusKeeper { + mock := &MockConsensusKeeper{ctrl: ctrl} + mock.recorder = &MockConsensusKeeperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockConsensusKeeper) EXPECT() *MockConsensusKeeperMockRecorder { + return m.recorder +} + +// EvidenceAge mocks base method. +func (m *MockConsensusKeeper) EvidenceAge(arg0 context.Context) (int64, time.Duration, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "EvidenceAge", arg0) + ret0, _ := ret[0].(int64) + ret1, _ := ret[1].(time.Duration) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// EvidenceAge indicates an expected call of EvidenceAge. +func (mr *MockConsensusKeeperMockRecorder) EvidenceAge(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EvidenceAge", reflect.TypeOf((*MockConsensusKeeper)(nil).EvidenceAge), arg0) +} diff --git a/x/feegrant/go.mod b/x/feegrant/go.mod index ad63b6c5da24..61e95866146e 100644 --- a/x/feegrant/go.mod +++ b/x/feegrant/go.mod @@ -34,7 +34,6 @@ require ( cosmossdk.io/log v1.4.1 // indirect cosmossdk.io/schema v0.1.1 // indirect cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000 - cosmossdk.io/x/consensus v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/protocolpool v0.0.0-20230925135524-a1bc045b3190 // indirect cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/tx v0.13.3 // indirect diff --git a/x/gov/go.mod b/x/gov/go.mod index 6392f3775f47..c22f20ac6eca 100644 --- a/x/gov/go.mod +++ b/x/gov/go.mod @@ -38,7 +38,6 @@ require ( buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.34.2-20240701160653-fedbb9acfd2f.2 // indirect buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.34.2-20240130113600-88ef6483f90f.2 // indirect cosmossdk.io/schema v0.1.1 // indirect - cosmossdk.io/x/consensus v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/tx v0.13.3 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect diff --git a/x/mint/go.mod b/x/mint/go.mod index 31effa390b4b..0690f7069eaf 100644 --- a/x/mint/go.mod +++ b/x/mint/go.mod @@ -161,7 +161,6 @@ require ( require ( buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.34.2-20240701160653-fedbb9acfd2f.2 // indirect cosmossdk.io/schema v0.1.1 // indirect - cosmossdk.io/x/consensus v0.0.0-00010101000000-000000000000 // indirect github.com/cometbft/cometbft/api v1.0.0-rc.1 // indirect github.com/cosmos/crypto v0.1.2 // indirect github.com/dgraph-io/badger/v4 v4.2.0 // indirect diff --git a/x/nft/go.mod b/x/nft/go.mod index 07a04ad214f9..811846f0f31e 100644 --- a/x/nft/go.mod +++ b/x/nft/go.mod @@ -28,7 +28,6 @@ require ( cosmossdk.io/schema v0.1.1 // indirect cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/bank v0.0.0-20240226161501-23359a0b6d91 // indirect - cosmossdk.io/x/consensus v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/tx v0.13.3 // indirect filippo.io/edwards25519 v1.1.0 // indirect diff --git a/x/params/go.mod b/x/params/go.mod index 2b2b06e8e0f5..5b1c00586486 100644 --- a/x/params/go.mod +++ b/x/params/go.mod @@ -32,7 +32,6 @@ require ( cosmossdk.io/schema v0.1.1 // indirect cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/bank v0.0.0-20240226161501-23359a0b6d91 // indirect - cosmossdk.io/x/consensus v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/tx v0.13.3 // indirect filippo.io/edwards25519 v1.1.0 // indirect diff --git a/x/protocolpool/go.mod b/x/protocolpool/go.mod index 54ec34c85f93..03e95c37d02f 100644 --- a/x/protocolpool/go.mod +++ b/x/protocolpool/go.mod @@ -31,7 +31,6 @@ require ( cosmossdk.io/log v1.4.1 // indirect cosmossdk.io/schema v0.1.1 // indirect cosmossdk.io/x/bank v0.0.0-20240226161501-23359a0b6d91 // indirect - cosmossdk.io/x/consensus v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/tx v0.13.3 // indirect filippo.io/edwards25519 v1.1.0 // indirect diff --git a/x/slashing/go.mod b/x/slashing/go.mod index e9717b8c53c2..9afb97d0b479 100644 --- a/x/slashing/go.mod +++ b/x/slashing/go.mod @@ -33,7 +33,6 @@ require ( cosmossdk.io/log v1.4.1 // indirect cosmossdk.io/schema v0.1.1 // indirect cosmossdk.io/x/bank v0.0.0-20240226161501-23359a0b6d91 // indirect - cosmossdk.io/x/consensus v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/tx v0.13.3 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect diff --git a/x/staking/depinject.go b/x/staking/depinject.go index 4adee385d4d1..28e061d860ab 100644 --- a/x/staking/depinject.go +++ b/x/staking/depinject.go @@ -43,6 +43,7 @@ type ModuleInputs struct { ConsensusAddressCodec address.ConsensusAddressCodec AccountKeeper types.AccountKeeper BankKeeper types.BankKeeper + ConsensusKeeper types.ConsensusKeeper Cdc codec.Codec Environment appmodule.Environment CometInfoService comet.Service @@ -73,6 +74,7 @@ func ProvideModule(in ModuleInputs) ModuleOutputs { in.Environment, in.AccountKeeper, in.BankKeeper, + in.ConsensusKeeper, as, in.ValidatorAddressCodec, in.ConsensusAddressCodec, diff --git a/x/staking/go.mod b/x/staking/go.mod index 816519e02499..f6b41f3faf23 100644 --- a/x/staking/go.mod +++ b/x/staking/go.mod @@ -158,7 +158,6 @@ require ( require ( buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.34.2-20240701160653-fedbb9acfd2f.2 // indirect cosmossdk.io/log v1.4.1 - cosmossdk.io/x/consensus v0.0.0-00010101000000-000000000000 github.com/cosmos/crypto v0.1.2 // indirect github.com/dgraph-io/badger/v4 v4.2.0 // indirect github.com/gofrs/uuid v4.4.0+incompatible // indirect diff --git a/x/staking/keeper/keeper.go b/x/staking/keeper/keeper.go index 17e38633548b..b85bab1bbc8b 100644 --- a/x/staking/keeper/keeper.go +++ b/x/staking/keeper/keeper.go @@ -120,6 +120,7 @@ func NewKeeper( env appmodule.Environment, ak types.AccountKeeper, bk types.BankKeeper, + ck types.ConsensusKeeper, authority string, validatorAddressCodec addresscodec.Codec, consensusAddressCodec addresscodec.Codec, @@ -149,6 +150,7 @@ func NewKeeper( cdc: cdc, authKeeper: ak, bankKeeper: bk, + consensusKeeper: ck, hooks: nil, authority: authority, validatorAddressCodec: validatorAddressCodec, diff --git a/x/staking/keeper/keeper_test.go b/x/staking/keeper/keeper_test.go index 0c4311a906ed..d0a720d564ea 100644 --- a/x/staking/keeper/keeper_test.go +++ b/x/staking/keeper/keeper_test.go @@ -15,7 +15,6 @@ import ( "cosmossdk.io/math" storetypes "cosmossdk.io/store/types" authtypes "cosmossdk.io/x/auth/types" - consensustypes "cosmossdk.io/x/consensus/types" stakingkeeper "cosmossdk.io/x/staking/keeper" stakingtestutil "cosmossdk.io/x/staking/testutil" stakingtypes "cosmossdk.io/x/staking/types" @@ -81,14 +80,10 @@ func (s *KeeperTestSuite) SetupTest() { // create consensus keeper ck := stakingtestutil.NewMockConsensusKeeper(ctrl) - ck.EXPECT().Params(gomock.Any(), gomock.Any()).Return(&consensustypes.QueryParamsResponse{ - Params: simtestutil.DefaultConsensusParams, - }, nil).AnyTimes() - queryHelper := baseapp.NewQueryServerTestHelper(ctx, encCfg.InterfaceRegistry) - consensustypes.RegisterQueryServer(queryHelper, ck) + ck.EXPECT().ValidatorPubKeyTypes(gomock.Any()).Return(simtestutil.DefaultConsensusParams.Validator.PubKeyTypes, nil).AnyTimes() bankKeeper := stakingtestutil.NewMockBankKeeper(ctrl) - env := runtime.NewEnvironment(storeService, coretesting.NewNopLogger(), runtime.EnvWithQueryRouterService(queryHelper.GRPCQueryRouter), runtime.EnvWithMsgRouterService(s.baseApp.MsgServiceRouter())) + env := runtime.NewEnvironment(storeService, coretesting.NewNopLogger(), runtime.EnvWithMsgRouterService(s.baseApp.MsgServiceRouter())) authority, err := accountKeeper.AddressCodec().BytesToString(authtypes.NewModuleAddress(stakingtypes.GovModuleName)) s.Require().NoError(err) keeper := stakingkeeper.NewKeeper( @@ -96,6 +91,7 @@ func (s *KeeperTestSuite) SetupTest() { env, accountKeeper, bankKeeper, + ck, authority, address.NewBech32Codec("cosmosvaloper"), address.NewBech32Codec("cosmosvalcons"), @@ -109,8 +105,6 @@ func (s *KeeperTestSuite) SetupTest() { s.accountKeeper = accountKeeper stakingtypes.RegisterInterfaces(encCfg.InterfaceRegistry) - stakingtypes.RegisterQueryServer(queryHelper, stakingkeeper.Querier{Keeper: keeper}) - s.queryClient = stakingtypes.NewQueryClient(queryHelper) s.msgServer = stakingkeeper.NewMsgServerImpl(keeper) } diff --git a/x/staking/testutil/expected_keepers_mocks.go b/x/staking/testutil/expected_keepers_mocks.go index 152d25e217f3..322243108cf5 100644 --- a/x/staking/testutil/expected_keepers_mocks.go +++ b/x/staking/testutil/expected_keepers_mocks.go @@ -11,10 +11,9 @@ import ( stakingv1beta1 "cosmossdk.io/api/cosmos/staking/v1beta1" address "cosmossdk.io/core/address" math "cosmossdk.io/math" - types "cosmossdk.io/x/consensus/types" - types0 "cosmossdk.io/x/staking/types" - types1 "github.com/cosmos/cosmos-sdk/crypto/types" - types2 "github.com/cosmos/cosmos-sdk/types" + types "cosmossdk.io/x/staking/types" + types0 "github.com/cosmos/cosmos-sdk/crypto/types" + types1 "github.com/cosmos/cosmos-sdk/types" gomock "github.com/golang/mock/gomock" ) @@ -56,10 +55,10 @@ func (mr *MockAccountKeeperMockRecorder) AddressCodec() *gomock.Call { } // GetAccount mocks base method. -func (m *MockAccountKeeper) GetAccount(ctx context.Context, addr types2.AccAddress) types2.AccountI { +func (m *MockAccountKeeper) GetAccount(ctx context.Context, addr types1.AccAddress) types1.AccountI { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetAccount", ctx, addr) - ret0, _ := ret[0].(types2.AccountI) + ret0, _ := ret[0].(types1.AccountI) return ret0 } @@ -70,10 +69,10 @@ func (mr *MockAccountKeeperMockRecorder) GetAccount(ctx, addr interface{}) *gomo } // GetModuleAccount mocks base method. -func (m *MockAccountKeeper) GetModuleAccount(ctx context.Context, moduleName string) types2.ModuleAccountI { +func (m *MockAccountKeeper) GetModuleAccount(ctx context.Context, moduleName string) types1.ModuleAccountI { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetModuleAccount", ctx, moduleName) - ret0, _ := ret[0].(types2.ModuleAccountI) + ret0, _ := ret[0].(types1.ModuleAccountI) return ret0 } @@ -84,10 +83,10 @@ func (mr *MockAccountKeeperMockRecorder) GetModuleAccount(ctx, moduleName interf } // GetModuleAddress mocks base method. -func (m *MockAccountKeeper) GetModuleAddress(name string) types2.AccAddress { +func (m *MockAccountKeeper) GetModuleAddress(name string) types1.AccAddress { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetModuleAddress", name) - ret0, _ := ret[0].(types2.AccAddress) + ret0, _ := ret[0].(types1.AccAddress) return ret0 } @@ -98,7 +97,7 @@ func (mr *MockAccountKeeperMockRecorder) GetModuleAddress(name interface{}) *gom } // SetModuleAccount mocks base method. -func (m *MockAccountKeeper) SetModuleAccount(arg0 context.Context, arg1 types2.ModuleAccountI) { +func (m *MockAccountKeeper) SetModuleAccount(arg0 context.Context, arg1 types1.ModuleAccountI) { m.ctrl.T.Helper() m.ctrl.Call(m, "SetModuleAccount", arg0, arg1) } @@ -133,7 +132,7 @@ func (m *MockBankKeeper) EXPECT() *MockBankKeeperMockRecorder { } // BurnCoins mocks base method. -func (m *MockBankKeeper) BurnCoins(arg0 context.Context, arg1 []byte, arg2 types2.Coins) error { +func (m *MockBankKeeper) BurnCoins(arg0 context.Context, arg1 []byte, arg2 types1.Coins) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "BurnCoins", arg0, arg1, arg2) ret0, _ := ret[0].(error) @@ -147,7 +146,7 @@ func (mr *MockBankKeeperMockRecorder) BurnCoins(arg0, arg1, arg2 interface{}) *g } // DelegateCoinsFromAccountToModule mocks base method. -func (m *MockBankKeeper) DelegateCoinsFromAccountToModule(ctx context.Context, senderAddr types2.AccAddress, recipientModule string, amt types2.Coins) error { +func (m *MockBankKeeper) DelegateCoinsFromAccountToModule(ctx context.Context, senderAddr types1.AccAddress, recipientModule string, amt types1.Coins) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DelegateCoinsFromAccountToModule", ctx, senderAddr, recipientModule, amt) ret0, _ := ret[0].(error) @@ -161,10 +160,10 @@ func (mr *MockBankKeeperMockRecorder) DelegateCoinsFromAccountToModule(ctx, send } // GetAllBalances mocks base method. -func (m *MockBankKeeper) GetAllBalances(ctx context.Context, addr types2.AccAddress) types2.Coins { +func (m *MockBankKeeper) GetAllBalances(ctx context.Context, addr types1.AccAddress) types1.Coins { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetAllBalances", ctx, addr) - ret0, _ := ret[0].(types2.Coins) + ret0, _ := ret[0].(types1.Coins) return ret0 } @@ -175,10 +174,10 @@ func (mr *MockBankKeeperMockRecorder) GetAllBalances(ctx, addr interface{}) *gom } // GetBalance mocks base method. -func (m *MockBankKeeper) GetBalance(ctx context.Context, addr types2.AccAddress, denom string) types2.Coin { +func (m *MockBankKeeper) GetBalance(ctx context.Context, addr types1.AccAddress, denom string) types1.Coin { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetBalance", ctx, addr, denom) - ret0, _ := ret[0].(types2.Coin) + ret0, _ := ret[0].(types1.Coin) return ret0 } @@ -189,10 +188,10 @@ func (mr *MockBankKeeperMockRecorder) GetBalance(ctx, addr, denom interface{}) * } // GetSupply mocks base method. -func (m *MockBankKeeper) GetSupply(ctx context.Context, denom string) types2.Coin { +func (m *MockBankKeeper) GetSupply(ctx context.Context, denom string) types1.Coin { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetSupply", ctx, denom) - ret0, _ := ret[0].(types2.Coin) + ret0, _ := ret[0].(types1.Coin) return ret0 } @@ -217,10 +216,10 @@ func (mr *MockBankKeeperMockRecorder) IsSendEnabledDenom(ctx, denom interface{}) } // LockedCoins mocks base method. -func (m *MockBankKeeper) LockedCoins(ctx context.Context, addr types2.AccAddress) types2.Coins { +func (m *MockBankKeeper) LockedCoins(ctx context.Context, addr types1.AccAddress) types1.Coins { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "LockedCoins", ctx, addr) - ret0, _ := ret[0].(types2.Coins) + ret0, _ := ret[0].(types1.Coins) return ret0 } @@ -231,7 +230,7 @@ func (mr *MockBankKeeperMockRecorder) LockedCoins(ctx, addr interface{}) *gomock } // SendCoinsFromAccountToModule mocks base method. -func (m *MockBankKeeper) SendCoinsFromAccountToModule(ctx context.Context, senderAddr types2.AccAddress, recipientModule string, amt types2.Coins) error { +func (m *MockBankKeeper) SendCoinsFromAccountToModule(ctx context.Context, senderAddr types1.AccAddress, recipientModule string, amt types1.Coins) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SendCoinsFromAccountToModule", ctx, senderAddr, recipientModule, amt) ret0, _ := ret[0].(error) @@ -245,7 +244,7 @@ func (mr *MockBankKeeperMockRecorder) SendCoinsFromAccountToModule(ctx, senderAd } // SendCoinsFromModuleToModule mocks base method. -func (m *MockBankKeeper) SendCoinsFromModuleToModule(ctx context.Context, senderPool, recipientPool string, amt types2.Coins) error { +func (m *MockBankKeeper) SendCoinsFromModuleToModule(ctx context.Context, senderPool, recipientPool string, amt types1.Coins) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SendCoinsFromModuleToModule", ctx, senderPool, recipientPool, amt) ret0, _ := ret[0].(error) @@ -259,10 +258,10 @@ func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToModule(ctx, senderPoo } // SpendableCoins mocks base method. -func (m *MockBankKeeper) SpendableCoins(ctx context.Context, addr types2.AccAddress) types2.Coins { +func (m *MockBankKeeper) SpendableCoins(ctx context.Context, addr types1.AccAddress) types1.Coins { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SpendableCoins", ctx, addr) - ret0, _ := ret[0].(types2.Coins) + ret0, _ := ret[0].(types1.Coins) return ret0 } @@ -273,7 +272,7 @@ func (mr *MockBankKeeperMockRecorder) SpendableCoins(ctx, addr interface{}) *gom } // UndelegateCoinsFromModuleToAccount mocks base method. -func (m *MockBankKeeper) UndelegateCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr types2.AccAddress, amt types2.Coins) error { +func (m *MockBankKeeper) UndelegateCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr types1.AccAddress, amt types1.Coins) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "UndelegateCoinsFromModuleToAccount", ctx, senderModule, recipientAddr, amt) ret0, _ := ret[0].(error) @@ -310,10 +309,10 @@ func (m *MockValidatorSet) EXPECT() *MockValidatorSetMockRecorder { } // Delegation mocks base method. -func (m *MockValidatorSet) Delegation(arg0 context.Context, arg1 types2.AccAddress, arg2 types2.ValAddress) (types2.DelegationI, error) { +func (m *MockValidatorSet) Delegation(arg0 context.Context, arg1 types1.AccAddress, arg2 types1.ValAddress) (types1.DelegationI, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Delegation", arg0, arg1, arg2) - ret0, _ := ret[0].(types2.DelegationI) + ret0, _ := ret[0].(types1.DelegationI) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -325,10 +324,10 @@ func (mr *MockValidatorSetMockRecorder) Delegation(arg0, arg1, arg2 interface{}) } // GetPubKeyByConsAddr mocks base method. -func (m *MockValidatorSet) GetPubKeyByConsAddr(arg0 context.Context, arg1 types2.ConsAddress) (types1.PubKey, error) { +func (m *MockValidatorSet) GetPubKeyByConsAddr(arg0 context.Context, arg1 types1.ConsAddress) (types0.PubKey, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetPubKeyByConsAddr", arg0, arg1) - ret0, _ := ret[0].(types1.PubKey) + ret0, _ := ret[0].(types0.PubKey) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -340,7 +339,7 @@ func (mr *MockValidatorSetMockRecorder) GetPubKeyByConsAddr(arg0, arg1 interface } // IterateBondedValidatorsByPower mocks base method. -func (m *MockValidatorSet) IterateBondedValidatorsByPower(arg0 context.Context, arg1 func(int64, types2.ValidatorI) bool) error { +func (m *MockValidatorSet) IterateBondedValidatorsByPower(arg0 context.Context, arg1 func(int64, types1.ValidatorI) bool) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "IterateBondedValidatorsByPower", arg0, arg1) ret0, _ := ret[0].(error) @@ -354,7 +353,7 @@ func (mr *MockValidatorSetMockRecorder) IterateBondedValidatorsByPower(arg0, arg } // IterateValidators mocks base method. -func (m *MockValidatorSet) IterateValidators(arg0 context.Context, arg1 func(int64, types2.ValidatorI) bool) error { +func (m *MockValidatorSet) IterateValidators(arg0 context.Context, arg1 func(int64, types1.ValidatorI) bool) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "IterateValidators", arg0, arg1) ret0, _ := ret[0].(error) @@ -368,7 +367,7 @@ func (mr *MockValidatorSetMockRecorder) IterateValidators(arg0, arg1 interface{} } // Jail mocks base method. -func (m *MockValidatorSet) Jail(arg0 context.Context, arg1 types2.ConsAddress) error { +func (m *MockValidatorSet) Jail(arg0 context.Context, arg1 types1.ConsAddress) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Jail", arg0, arg1) ret0, _ := ret[0].(error) @@ -397,7 +396,7 @@ func (mr *MockValidatorSetMockRecorder) MaxValidators(arg0 interface{}) *gomock. } // Slash mocks base method. -func (m *MockValidatorSet) Slash(arg0 context.Context, arg1 types2.ConsAddress, arg2, arg3 int64, arg4 math.LegacyDec) (math.Int, error) { +func (m *MockValidatorSet) Slash(arg0 context.Context, arg1 types1.ConsAddress, arg2, arg3 int64, arg4 math.LegacyDec) (math.Int, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Slash", arg0, arg1, arg2, arg3, arg4) ret0, _ := ret[0].(math.Int) @@ -412,7 +411,7 @@ func (mr *MockValidatorSetMockRecorder) Slash(arg0, arg1, arg2, arg3, arg4 inter } // SlashWithInfractionReason mocks base method. -func (m *MockValidatorSet) SlashWithInfractionReason(arg0 context.Context, arg1 types2.ConsAddress, arg2, arg3 int64, arg4 math.LegacyDec, arg5 stakingv1beta1.Infraction) (math.Int, error) { +func (m *MockValidatorSet) SlashWithInfractionReason(arg0 context.Context, arg1 types1.ConsAddress, arg2, arg3 int64, arg4 math.LegacyDec, arg5 stakingv1beta1.Infraction) (math.Int, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SlashWithInfractionReason", arg0, arg1, arg2, arg3, arg4, arg5) ret0, _ := ret[0].(math.Int) @@ -457,7 +456,7 @@ func (mr *MockValidatorSetMockRecorder) TotalBondedTokens(arg0 interface{}) *gom } // Unjail mocks base method. -func (m *MockValidatorSet) Unjail(arg0 context.Context, arg1 types2.ConsAddress) error { +func (m *MockValidatorSet) Unjail(arg0 context.Context, arg1 types1.ConsAddress) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Unjail", arg0, arg1) ret0, _ := ret[0].(error) @@ -471,10 +470,10 @@ func (mr *MockValidatorSetMockRecorder) Unjail(arg0, arg1 interface{}) *gomock.C } // Validator mocks base method. -func (m *MockValidatorSet) Validator(arg0 context.Context, arg1 types2.ValAddress) (types2.ValidatorI, error) { +func (m *MockValidatorSet) Validator(arg0 context.Context, arg1 types1.ValAddress) (types1.ValidatorI, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Validator", arg0, arg1) - ret0, _ := ret[0].(types2.ValidatorI) + ret0, _ := ret[0].(types1.ValidatorI) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -486,10 +485,10 @@ func (mr *MockValidatorSetMockRecorder) Validator(arg0, arg1 interface{}) *gomoc } // ValidatorByConsAddr mocks base method. -func (m *MockValidatorSet) ValidatorByConsAddr(arg0 context.Context, arg1 types2.ConsAddress) (types2.ValidatorI, error) { +func (m *MockValidatorSet) ValidatorByConsAddr(arg0 context.Context, arg1 types1.ConsAddress) (types1.ValidatorI, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ValidatorByConsAddr", arg0, arg1) - ret0, _ := ret[0].(types2.ValidatorI) + ret0, _ := ret[0].(types1.ValidatorI) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -524,10 +523,10 @@ func (m *MockDelegationSet) EXPECT() *MockDelegationSetMockRecorder { } // GetValidatorSet mocks base method. -func (m *MockDelegationSet) GetValidatorSet() types0.ValidatorSet { +func (m *MockDelegationSet) GetValidatorSet() types.ValidatorSet { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetValidatorSet") - ret0, _ := ret[0].(types0.ValidatorSet) + ret0, _ := ret[0].(types.ValidatorSet) return ret0 } @@ -538,7 +537,7 @@ func (mr *MockDelegationSetMockRecorder) GetValidatorSet() *gomock.Call { } // IterateDelegations mocks base method. -func (m *MockDelegationSet) IterateDelegations(ctx context.Context, delegator types2.AccAddress, fn func(int64, types2.DelegationI) bool) error { +func (m *MockDelegationSet) IterateDelegations(ctx context.Context, delegator types1.AccAddress, fn func(int64, types1.DelegationI) bool) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "IterateDelegations", ctx, delegator, fn) ret0, _ := ret[0].(error) @@ -575,7 +574,7 @@ func (m *MockStakingHooks) EXPECT() *MockStakingHooksMockRecorder { } // AfterConsensusPubKeyUpdate mocks base method. -func (m *MockStakingHooks) AfterConsensusPubKeyUpdate(ctx context.Context, oldPubKey, newPubKey types1.PubKey, rotationFee types2.Coin) error { +func (m *MockStakingHooks) AfterConsensusPubKeyUpdate(ctx context.Context, oldPubKey, newPubKey types0.PubKey, rotationFee types1.Coin) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AfterConsensusPubKeyUpdate", ctx, oldPubKey, newPubKey, rotationFee) ret0, _ := ret[0].(error) @@ -589,7 +588,7 @@ func (mr *MockStakingHooksMockRecorder) AfterConsensusPubKeyUpdate(ctx, oldPubKe } // AfterDelegationModified mocks base method. -func (m *MockStakingHooks) AfterDelegationModified(ctx context.Context, delAddr types2.AccAddress, valAddr types2.ValAddress) error { +func (m *MockStakingHooks) AfterDelegationModified(ctx context.Context, delAddr types1.AccAddress, valAddr types1.ValAddress) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AfterDelegationModified", ctx, delAddr, valAddr) ret0, _ := ret[0].(error) @@ -617,7 +616,7 @@ func (mr *MockStakingHooksMockRecorder) AfterUnbondingInitiated(ctx, id interfac } // AfterValidatorBeginUnbonding mocks base method. -func (m *MockStakingHooks) AfterValidatorBeginUnbonding(ctx context.Context, consAddr types2.ConsAddress, valAddr types2.ValAddress) error { +func (m *MockStakingHooks) AfterValidatorBeginUnbonding(ctx context.Context, consAddr types1.ConsAddress, valAddr types1.ValAddress) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AfterValidatorBeginUnbonding", ctx, consAddr, valAddr) ret0, _ := ret[0].(error) @@ -631,7 +630,7 @@ func (mr *MockStakingHooksMockRecorder) AfterValidatorBeginUnbonding(ctx, consAd } // AfterValidatorBonded mocks base method. -func (m *MockStakingHooks) AfterValidatorBonded(ctx context.Context, consAddr types2.ConsAddress, valAddr types2.ValAddress) error { +func (m *MockStakingHooks) AfterValidatorBonded(ctx context.Context, consAddr types1.ConsAddress, valAddr types1.ValAddress) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AfterValidatorBonded", ctx, consAddr, valAddr) ret0, _ := ret[0].(error) @@ -645,7 +644,7 @@ func (mr *MockStakingHooksMockRecorder) AfterValidatorBonded(ctx, consAddr, valA } // AfterValidatorCreated mocks base method. -func (m *MockStakingHooks) AfterValidatorCreated(ctx context.Context, valAddr types2.ValAddress) error { +func (m *MockStakingHooks) AfterValidatorCreated(ctx context.Context, valAddr types1.ValAddress) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AfterValidatorCreated", ctx, valAddr) ret0, _ := ret[0].(error) @@ -659,7 +658,7 @@ func (mr *MockStakingHooksMockRecorder) AfterValidatorCreated(ctx, valAddr inter } // AfterValidatorRemoved mocks base method. -func (m *MockStakingHooks) AfterValidatorRemoved(ctx context.Context, consAddr types2.ConsAddress, valAddr types2.ValAddress) error { +func (m *MockStakingHooks) AfterValidatorRemoved(ctx context.Context, consAddr types1.ConsAddress, valAddr types1.ValAddress) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AfterValidatorRemoved", ctx, consAddr, valAddr) ret0, _ := ret[0].(error) @@ -673,7 +672,7 @@ func (mr *MockStakingHooksMockRecorder) AfterValidatorRemoved(ctx, consAddr, val } // BeforeDelegationCreated mocks base method. -func (m *MockStakingHooks) BeforeDelegationCreated(ctx context.Context, delAddr types2.AccAddress, valAddr types2.ValAddress) error { +func (m *MockStakingHooks) BeforeDelegationCreated(ctx context.Context, delAddr types1.AccAddress, valAddr types1.ValAddress) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "BeforeDelegationCreated", ctx, delAddr, valAddr) ret0, _ := ret[0].(error) @@ -687,7 +686,7 @@ func (mr *MockStakingHooksMockRecorder) BeforeDelegationCreated(ctx, delAddr, va } // BeforeDelegationRemoved mocks base method. -func (m *MockStakingHooks) BeforeDelegationRemoved(ctx context.Context, delAddr types2.AccAddress, valAddr types2.ValAddress) error { +func (m *MockStakingHooks) BeforeDelegationRemoved(ctx context.Context, delAddr types1.AccAddress, valAddr types1.ValAddress) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "BeforeDelegationRemoved", ctx, delAddr, valAddr) ret0, _ := ret[0].(error) @@ -701,7 +700,7 @@ func (mr *MockStakingHooksMockRecorder) BeforeDelegationRemoved(ctx, delAddr, va } // BeforeDelegationSharesModified mocks base method. -func (m *MockStakingHooks) BeforeDelegationSharesModified(ctx context.Context, delAddr types2.AccAddress, valAddr types2.ValAddress) error { +func (m *MockStakingHooks) BeforeDelegationSharesModified(ctx context.Context, delAddr types1.AccAddress, valAddr types1.ValAddress) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "BeforeDelegationSharesModified", ctx, delAddr, valAddr) ret0, _ := ret[0].(error) @@ -715,7 +714,7 @@ func (mr *MockStakingHooksMockRecorder) BeforeDelegationSharesModified(ctx, delA } // BeforeValidatorModified mocks base method. -func (m *MockStakingHooks) BeforeValidatorModified(ctx context.Context, valAddr types2.ValAddress) error { +func (m *MockStakingHooks) BeforeValidatorModified(ctx context.Context, valAddr types1.ValAddress) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "BeforeValidatorModified", ctx, valAddr) ret0, _ := ret[0].(error) @@ -729,7 +728,7 @@ func (mr *MockStakingHooksMockRecorder) BeforeValidatorModified(ctx, valAddr int } // BeforeValidatorSlashed mocks base method. -func (m *MockStakingHooks) BeforeValidatorSlashed(ctx context.Context, valAddr types2.ValAddress, fraction math.LegacyDec) error { +func (m *MockStakingHooks) BeforeValidatorSlashed(ctx context.Context, valAddr types1.ValAddress, fraction math.LegacyDec) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "BeforeValidatorSlashed", ctx, valAddr, fraction) ret0, _ := ret[0].(error) @@ -765,17 +764,17 @@ func (m *MockConsensusKeeper) EXPECT() *MockConsensusKeeperMockRecorder { return m.recorder } -// Params mocks base method. -func (m *MockConsensusKeeper) Params(arg0 context.Context, arg1 *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { +// ValidatorPubKeyTypes mocks base method. +func (m *MockConsensusKeeper) ValidatorPubKeyTypes(arg0 context.Context) ([]string, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Params", arg0, arg1) - ret0, _ := ret[0].(*types.QueryParamsResponse) + ret := m.ctrl.Call(m, "ValidatorPubKeyTypes", arg0) + ret0, _ := ret[0].([]string) ret1, _ := ret[1].(error) return ret0, ret1 } -// Params indicates an expected call of Params. -func (mr *MockConsensusKeeperMockRecorder) Params(arg0, arg1 interface{}) *gomock.Call { +// ValidatorPubKeyTypes indicates an expected call of ValidatorPubKeyTypes. +func (mr *MockConsensusKeeperMockRecorder) ValidatorPubKeyTypes(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Params", reflect.TypeOf((*MockConsensusKeeper)(nil).Params), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorPubKeyTypes", reflect.TypeOf((*MockConsensusKeeper)(nil).ValidatorPubKeyTypes), arg0) } diff --git a/x/upgrade/depinject.go b/x/upgrade/depinject.go index ef056c668a8b..724d2af372d9 100644 --- a/x/upgrade/depinject.go +++ b/x/upgrade/depinject.go @@ -41,6 +41,7 @@ type ModuleInputs struct { Cdc codec.Codec AddressCodec address.Codec AppVersionModifier coreserver.VersionModifier + ConsensusKeeper types.ConsensusKeeper AppOpts servertypes.AppOptions `optional:"true"` // server v0 Viper *viper.Viper `optional:"true"` // server v2 @@ -85,7 +86,7 @@ func ProvideModule(in ModuleInputs) ModuleOutputs { } // set the governance module account as the authority for conducting upgrades - k := keeper.NewKeeper(in.Environment, skipUpgradeHeights, in.Cdc, homePath, in.AppVersionModifier, authorityStr) + k := keeper.NewKeeper(in.Environment, skipUpgradeHeights, in.Cdc, homePath, in.AppVersionModifier, authorityStr, in.ConsensusKeeper) m := NewAppModule(k) return ModuleOutputs{UpgradeKeeper: k, Module: m} diff --git a/x/upgrade/go.mod b/x/upgrade/go.mod index 0ecfae681763..97729965816a 100644 --- a/x/upgrade/go.mod +++ b/x/upgrade/go.mod @@ -11,7 +11,6 @@ require ( cosmossdk.io/log v1.4.1 cosmossdk.io/store v1.1.1-0.20240418092142-896cdf1971bc cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000 - cosmossdk.io/x/consensus v0.0.0-00010101000000-000000000000 cosmossdk.io/x/gov v0.0.0-20230925135524-a1bc045b3190 github.com/cometbft/cometbft v1.0.0-rc1 github.com/cometbft/cometbft/api v1.0.0-rc.1 diff --git a/x/upgrade/keeper/keeper.go b/x/upgrade/keeper/keeper.go index 98871d6bd346..a7e54a68dc6a 100644 --- a/x/upgrade/keeper/keeper.go +++ b/x/upgrade/keeper/keeper.go @@ -55,6 +55,7 @@ func NewKeeper( homePath string, vs server.VersionModifier, authority string, + ck types.ConsensusKeeper, ) *Keeper { k := &Keeper{ Environment: env, @@ -64,6 +65,7 @@ func NewKeeper( upgradeHandlers: map[string]types.UpgradeHandler{}, versionModifier: vs, authority: authority, + consensusKeeper: ck, } if homePath == "" { From d885fa3cb340cb8bc428c77db49bd664183fca0d Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Fri, 30 Aug 2024 14:37:56 +0200 Subject: [PATCH 06/23] ++ --- simapp/ante.go | 2 +- simapp/app.go | 1 + x/upgrade/keeper/keeper_test.go | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/simapp/ante.go b/simapp/ante.go index 8fd68c613076..8a99b52f66d0 100644 --- a/simapp/ante.go +++ b/simapp/ante.go @@ -33,7 +33,7 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) { } anteDecorators := []sdk.AnteDecorator{ - ante.NewSetUpContextDecorator(options.Environment), // outermost AnteDecorator. SetUpContext must be called first + ante.NewSetUpContextDecorator(options.Environment, options.ConsensusKeeper), // outermost AnteDecorator. SetUpContext must be called first circuitante.NewCircuitBreakerDecorator(options.CircuitKeeper), ante.NewExtensionOptionsDecorator(options.ExtensionOptionChecker), ante.NewValidateBasicDecorator(options.Environment), diff --git a/simapp/app.go b/simapp/app.go index 21e87e152e03..a9ba3cd4cc8b 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -636,6 +636,7 @@ func (app *SimApp) setAnteHandler(txConfig client.TxConfig) { AccountAbstractionKeeper: app.AccountsKeeper, AccountKeeper: app.AuthKeeper, BankKeeper: app.BankKeeper, + ConsensusKeeper: app.ConsensusParamsKeeper, SignModeHandler: txConfig.SignModeHandler(), FeegrantKeeper: app.FeeGrantKeeper, SigGasConsumer: ante.DefaultSigVerificationGasConsumer, diff --git a/x/upgrade/keeper/keeper_test.go b/x/upgrade/keeper/keeper_test.go index a7add3e24f6e..a1999db9150e 100644 --- a/x/upgrade/keeper/keeper_test.go +++ b/x/upgrade/keeper/keeper_test.go @@ -71,7 +71,8 @@ func (s *KeeperTestSuite) SetupTest() { authority, err := ac.BytesToString(authtypes.NewModuleAddress(types.GovModuleName)) s.Require().NoError(err) s.encodedAuthority = authority - s.upgradeKeeper = keeper.NewKeeper(env, skipUpgradeHeights, s.encCfg.Codec, homeDir, s.baseApp, authority) + + s.upgradeKeeper = keeper.NewKeeper(env, skipUpgradeHeights, s.encCfg.Codec, homeDir, s.baseApp, authority, nil) //TODO: pass consensus keeper s.T().Log("home dir:", homeDir) s.homeDir = homeDir From fe8fa0f82d18b4c861a451aa9a14370ef6ae9a37 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Fri, 30 Aug 2024 14:47:06 +0200 Subject: [PATCH 07/23] move dist test and cleanup tests --- .../distribution/migration_v4_test.go | 34 +++++++++++++- x/auth/ante/testutil_test.go | 6 +-- x/auth/go.mod | 1 - x/authz/go.mod | 16 +++---- x/distribution/go.mod | 14 +++--- x/distribution/migrations/v4/migrate_test.go | 47 ------------------- 6 files changed, 45 insertions(+), 73 deletions(-) rename x/distribution/migrations/v4/migrate_funds_test.go => tests/integration/distribution/migration_v4_test.go (79%) delete mode 100644 x/distribution/migrations/v4/migrate_test.go diff --git a/x/distribution/migrations/v4/migrate_funds_test.go b/tests/integration/distribution/migration_v4_test.go similarity index 79% rename from x/distribution/migrations/v4/migrate_funds_test.go rename to tests/integration/distribution/migration_v4_test.go index 90f557e130c3..cea3fa645448 100644 --- a/x/distribution/migrations/v4/migrate_funds_test.go +++ b/tests/integration/distribution/migration_v4_test.go @@ -1,4 +1,4 @@ -package v4_test +package distribution_test import ( "context" @@ -8,6 +8,7 @@ import ( "github.com/stretchr/testify/require" "cosmossdk.io/core/comet" + coretesting "cosmossdk.io/core/testing" "cosmossdk.io/log" storetypes "cosmossdk.io/store/types" "cosmossdk.io/x/auth" @@ -23,15 +24,44 @@ import ( distrtestutil "cosmossdk.io/x/distribution/testutil" disttypes "cosmossdk.io/x/distribution/types" pooltypes "cosmossdk.io/x/protocolpool/types" - addresscodec "github.com/cosmos/cosmos-sdk/codec/address" codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil" + "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" "github.com/cosmos/cosmos-sdk/runtime" + "github.com/cosmos/cosmos-sdk/testutil" "github.com/cosmos/cosmos-sdk/testutil/integration" sdk "github.com/cosmos/cosmos-sdk/types" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" ) +func TestMigration(t *testing.T) { + cdc := moduletestutil.MakeTestEncodingConfig(codectestutil.CodecOptions{}, distribution.AppModule{}).Codec + storeKey := storetypes.NewKVStoreKey("distribution") + storeService := runtime.NewKVStoreService(storeKey) + tKey := storetypes.NewTransientStoreKey("transient_test") + ctx := testutil.DefaultContext(storeKey, tKey) + + env := runtime.NewEnvironment(storeService, coretesting.NewNopLogger()) + + addr1 := secp256k1.GenPrivKey().PubKey().Address() + consAddr1 := sdk.ConsAddress(addr1) + + // Set and check the previous proposer + err := v4.SetPreviousProposerConsAddr(ctx, storeService, cdc, consAddr1) + require.NoError(t, err) + + gotAddr, err := v4.GetPreviousProposerConsAddr(ctx, storeService, cdc) + require.NoError(t, err) + require.Equal(t, consAddr1, gotAddr) + + err = v4.MigrateStore(ctx, env, cdc) + require.NoError(t, err) + + // Check that the previous proposer has been removed + _, err = v4.GetPreviousProposerConsAddr(ctx, storeService, cdc) + require.ErrorContains(t, err, "previous proposer not set") +} + type emptyCometService struct{} // CometInfo implements comet.Service. diff --git a/x/auth/ante/testutil_test.go b/x/auth/ante/testutil_test.go index 04b8f63f8555..40a43531f2b1 100644 --- a/x/auth/ante/testutil_test.go +++ b/x/auth/ante/testutil_test.go @@ -25,7 +25,6 @@ import ( authtestutil "cosmossdk.io/x/auth/testutil" txtestutil "cosmossdk.io/x/auth/tx/testutil" "cosmossdk.io/x/auth/types" - consensustypes "cosmossdk.io/x/consensus/types" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" @@ -101,10 +100,7 @@ func SetupTestSuite(t *testing.T, isCheckTx bool) *AnteTestSuite { grpcQueryRouter.SetInterfaceRegistry(suite.encCfg.InterfaceRegistry) suite.consensusKeeper = antetestutil.NewMockConsensusKeeper(ctrl) - suite.consensusKeeper.EXPECT().Params(gomock.Any(), gomock.Any()).Return(&consensustypes.QueryParamsResponse{ - Params: simtestutil.DefaultConsensusParams, - }, nil).AnyTimes() - consensustypes.RegisterQueryServer(grpcQueryRouter, suite.consensusKeeper) + suite.consensusKeeper.EXPECT().BlockGas(gomock.Any()).Return(simtestutil.DefaultConsensusParams.Block.MaxGas, nil).AnyTimes() suite.env = runtime.NewEnvironment(runtime.NewKVStoreService(key), coretesting.NewNopLogger(), runtime.EnvWithQueryRouterService(grpcQueryRouter), runtime.EnvWithMsgRouterService(msgRouter)) suite.accountKeeper = keeper.NewAccountKeeper( diff --git a/x/auth/go.mod b/x/auth/go.mod index ef411a96080f..81586af8cdd3 100644 --- a/x/auth/go.mod +++ b/x/auth/go.mod @@ -11,7 +11,6 @@ require ( cosmossdk.io/errors v1.0.1 cosmossdk.io/math v1.3.0 cosmossdk.io/store v1.1.1-0.20240418092142-896cdf1971bc - cosmossdk.io/x/consensus v0.0.0-00010101000000-000000000000 cosmossdk.io/x/tx v0.13.3 github.com/cometbft/cometbft v1.0.0-rc1 github.com/cometbft/cometbft/api v1.0.0-rc.1 diff --git a/x/authz/go.mod b/x/authz/go.mod index 686358cea59e..276c2f433828 100644 --- a/x/authz/go.mod +++ b/x/authz/go.mod @@ -7,13 +7,12 @@ require ( cosmossdk.io/core v1.0.0 cosmossdk.io/depinject v1.0.0 cosmossdk.io/errors v1.0.1 + cosmossdk.io/log v1.4.1 cosmossdk.io/math v1.3.0 cosmossdk.io/store v1.1.1-0.20240418092142-896cdf1971bc cosmossdk.io/x/bank v0.0.0-20240226161501-23359a0b6d91 cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 cosmossdk.io/x/tx v0.13.3 - github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cometbft/cometbft v1.0.0-rc1 // indirect github.com/cosmos/cosmos-proto v1.0.0-beta.5 github.com/cosmos/cosmos-sdk v0.53.0 github.com/cosmos/gogoproto v1.7.0 @@ -29,8 +28,10 @@ require ( require ( buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.34.2-20240701160653-fedbb9acfd2f.2 // indirect + buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.34.2-20240130113600-88ef6483f90f.2 // indirect cosmossdk.io/collections v0.4.0 // indirect cosmossdk.io/core/testing v0.0.0-00010101000000-000000000000 + cosmossdk.io/schema v0.1.1 // indirect cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000 filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect @@ -46,6 +47,8 @@ require ( github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect github.com/cockroachdb/pebble v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect + github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect + github.com/cometbft/cometbft v1.0.0-rc1 // indirect github.com/cometbft/cometbft-db v0.12.0 // indirect github.com/cometbft/cometbft/api v1.0.0-rc.1 // indirect github.com/cosmos/btcutil v1.0.5 // indirect @@ -113,6 +116,7 @@ require ( github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mtibben/percent v0.2.1 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect github.com/pelletier/go-toml/v2 v2.2.3 // indirect @@ -165,14 +169,6 @@ require ( sigs.k8s.io/yaml v1.4.0 // indirect ) -require cosmossdk.io/log v1.4.1 - -require ( - buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.34.2-20240130113600-88ef6483f90f.2 // indirect - cosmossdk.io/schema v0.1.1 // indirect - github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect -) - replace github.com/cosmos/cosmos-sdk => ../../. // TODO remove post spinning out all modules diff --git a/x/distribution/go.mod b/x/distribution/go.mod index 58ba7d22642c..c83af69f3c39 100644 --- a/x/distribution/go.mod +++ b/x/distribution/go.mod @@ -9,11 +9,8 @@ require ( cosmossdk.io/core/testing v0.0.0-00010101000000-000000000000 cosmossdk.io/depinject v1.0.0 cosmossdk.io/errors v1.0.1 - cosmossdk.io/log v1.4.1 cosmossdk.io/math v1.3.0 cosmossdk.io/store v1.1.1-0.20240418092142-896cdf1971bc - cosmossdk.io/x/bank v0.0.0-20240226161501-23359a0b6d91 - cosmossdk.io/x/protocolpool v0.0.0-20230925135524-a1bc045b3190 cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 github.com/cosmos/cosmos-proto v1.0.0-beta.5 github.com/cosmos/cosmos-sdk v0.53.0 @@ -31,17 +28,15 @@ require ( ) require ( - cosmossdk.io/schema v0.1.1 // indirect - github.com/cockroachdb/errors v1.11.1 // indirect - github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect - github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + cosmossdk.io/log v1.4.1 // indirect + cosmossdk.io/x/bank v0.0.0-20240226161501-23359a0b6d91 // indirect ) require ( buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.34.2-20240701160653-fedbb9acfd2f.2 // indirect buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.34.2-20240130113600-88ef6483f90f.2 // indirect + cosmossdk.io/schema v0.1.1 // indirect cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000 - cosmossdk.io/x/consensus v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/tx v0.13.3 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect @@ -53,6 +48,7 @@ require ( github.com/bgentry/speakeasy v0.2.0 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.3 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/cockroachdb/errors v1.11.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect github.com/cockroachdb/pebble v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect @@ -103,6 +99,7 @@ require ( github.com/hashicorp/go-immutable-radix v1.3.1 // indirect github.com/hashicorp/go-plugin v1.6.1 // indirect github.com/hashicorp/golang-lru v1.0.2 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/hashicorp/yamux v0.1.1 // indirect github.com/hdevalence/ed25519consensus v0.2.0 // indirect @@ -123,6 +120,7 @@ require ( github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mtibben/percent v0.2.1 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect github.com/pelletier/go-toml/v2 v2.2.3 // indirect diff --git a/x/distribution/migrations/v4/migrate_test.go b/x/distribution/migrations/v4/migrate_test.go deleted file mode 100644 index 8b5ef70c4dfe..000000000000 --- a/x/distribution/migrations/v4/migrate_test.go +++ /dev/null @@ -1,47 +0,0 @@ -package v4_test - -import ( - "testing" - - "github.com/stretchr/testify/require" - - coretesting "cosmossdk.io/core/testing" - storetypes "cosmossdk.io/store/types" - "cosmossdk.io/x/distribution" - v4 "cosmossdk.io/x/distribution/migrations/v4" - - codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil" - "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" - "github.com/cosmos/cosmos-sdk/runtime" - "github.com/cosmos/cosmos-sdk/testutil" - sdk "github.com/cosmos/cosmos-sdk/types" - moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" -) - -func TestMigration(t *testing.T) { - cdc := moduletestutil.MakeTestEncodingConfig(codectestutil.CodecOptions{}, distribution.AppModule{}).Codec - storeKey := storetypes.NewKVStoreKey("distribution") - storeService := runtime.NewKVStoreService(storeKey) - tKey := storetypes.NewTransientStoreKey("transient_test") - ctx := testutil.DefaultContext(storeKey, tKey) - - env := runtime.NewEnvironment(storeService, coretesting.NewNopLogger()) - - addr1 := secp256k1.GenPrivKey().PubKey().Address() - consAddr1 := sdk.ConsAddress(addr1) - - // Set and check the previous proposer - err := v4.SetPreviousProposerConsAddr(ctx, storeService, cdc, consAddr1) - require.NoError(t, err) - - gotAddr, err := v4.GetPreviousProposerConsAddr(ctx, storeService, cdc) - require.NoError(t, err) - require.Equal(t, consAddr1, gotAddr) - - err = v4.MigrateStore(ctx, env, cdc) - require.NoError(t, err) - - // Check that the previous proposer has been removed - _, err = v4.GetPreviousProposerConsAddr(ctx, storeService, cdc) - require.ErrorContains(t, err, "previous proposer not set") -} From 1cbd777e6455ce8102d96a5aeb576e6e97304149 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Fri, 30 Aug 2024 15:11:02 +0200 Subject: [PATCH 08/23] rewrite tests --- go.mod | 2 -- .../distribution/keeper/msg_server_test.go | 17 +++++++---- .../evidence/keeper/infraction_test.go | 20 ++++++++----- tests/integration/gov/keeper/keeper_test.go | 23 +++++++++------ .../slashing/keeper/keeper_test.go | 14 +++++++--- .../integration/staking/keeper/common_test.go | 14 +++++++--- .../staking/keeper/deterministic_test.go | 17 +++++++---- testutil/integration/router.go | 28 +++++++++---------- x/accounts/go.mod | 1 - x/auth/ante/setup_test.go | 6 ++-- x/auth/go.mod | 1 - x/authz/go.mod | 1 - x/bank/go.mod | 1 - x/circuit/go.mod | 1 - x/distribution/go.mod | 1 - x/epochs/go.mod | 1 - x/evidence/go.mod | 1 - x/feegrant/go.mod | 1 - x/gov/go.mod | 1 - x/mint/go.mod | 1 - x/nft/go.mod | 1 - x/params/go.mod | 1 - x/protocolpool/go.mod | 1 - x/slashing/go.mod | 1 - x/staking/go.mod | 1 - x/upgrade/go.mod | 1 - x/upgrade/keeper/abci_test.go | 4 +-- x/upgrade/keeper/grpc_query_test.go | 2 +- x/upgrade/keeper/keeper_test.go | 2 +- 29 files changed, 92 insertions(+), 74 deletions(-) diff --git a/go.mod b/go.mod index de2731fbeeb3..45bd607f8fcf 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,6 @@ require ( cosmossdk.io/store v1.1.1-0.20240418092142-896cdf1971bc cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000 cosmossdk.io/x/bank v0.0.0-20240226161501-23359a0b6d91 - cosmossdk.io/x/consensus v0.0.0-00010101000000-000000000000 cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 cosmossdk.io/x/tx v0.13.3 github.com/99designs/keyring v1.2.2 @@ -192,7 +191,6 @@ replace ( cosmossdk.io/x/accounts => ./x/accounts cosmossdk.io/x/auth => ./x/auth cosmossdk.io/x/bank => ./x/bank - cosmossdk.io/x/consensus => ./x/consensus cosmossdk.io/x/staking => ./x/staking cosmossdk.io/x/tx => ./x/tx ) diff --git a/tests/integration/distribution/keeper/msg_server_test.go b/tests/integration/distribution/keeper/msg_server_test.go index e0bd5b0548b6..b31010e6ecc1 100644 --- a/tests/integration/distribution/keeper/msg_server_test.go +++ b/tests/integration/distribution/keeper/msg_server_test.go @@ -23,6 +23,8 @@ import ( "cosmossdk.io/x/bank" bankkeeper "cosmossdk.io/x/bank/keeper" banktypes "cosmossdk.io/x/bank/types" + "cosmossdk.io/x/consensus" + consensusparamkeeper "cosmossdk.io/x/consensus/keeper" consensustypes "cosmossdk.io/x/consensus/types" "cosmossdk.io/x/distribution" distrkeeper "cosmossdk.io/x/distribution/keeper" @@ -132,7 +134,8 @@ func initFixture(t *testing.T) *fixture { grpcRouter := baseapp.NewGRPCQueryRouter() cometService := runtime.NewContextAwareCometInfoService() - stakingKeeper := stakingkeeper.NewKeeper(cdc, runtime.NewEnvironment(runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), log.NewNopLogger(), runtime.EnvWithQueryRouterService(grpcRouter), runtime.EnvWithMsgRouterService(msgRouter)), accountKeeper, bankKeeper, authority.String(), addresscodec.NewBech32Codec(sdk.Bech32PrefixValAddr), addresscodec.NewBech32Codec(sdk.Bech32PrefixConsAddr), cometService) + consensusParamsKeeper := consensusparamkeeper.NewKeeper(cdc, runtime.NewEnvironment(runtime.NewKVStoreService(keys[consensustypes.StoreKey]), log.NewNopLogger(), runtime.EnvWithQueryRouterService(grpcRouter), runtime.EnvWithMsgRouterService(msgRouter)), authtypes.NewModuleAddress("gov").String()) + stakingKeeper := stakingkeeper.NewKeeper(cdc, runtime.NewEnvironment(runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), log.NewNopLogger(), runtime.EnvWithQueryRouterService(grpcRouter), runtime.EnvWithMsgRouterService(msgRouter)), accountKeeper, bankKeeper, consensusParamsKeeper, authority.String(), addresscodec.NewBech32Codec(sdk.Bech32PrefixValAddr), addresscodec.NewBech32Codec(sdk.Bech32PrefixConsAddr), cometService) require.NoError(t, stakingKeeper.Params.Set(newCtx, stakingtypes.DefaultParams())) poolKeeper := poolkeeper.NewKeeper(cdc, runtime.NewEnvironment(runtime.NewKVStoreService(keys[pooltypes.StoreKey]), log.NewNopLogger()), accountKeeper, bankKeeper, stakingKeeper, authority.String()) @@ -146,6 +149,7 @@ func initFixture(t *testing.T) *fixture { stakingModule := staking.NewAppModule(cdc, stakingKeeper, accountKeeper, bankKeeper) distrModule := distribution.NewAppModule(cdc, distrKeeper, accountKeeper, bankKeeper, stakingKeeper) poolModule := protocolpool.NewAppModule(cdc, poolKeeper, accountKeeper, bankKeeper) + consensusModule := consensus.NewAppModule(cdc, consensusParamsKeeper) addr := sdk.AccAddress(PKS[0].Address()) valAddr := sdk.ValAddress(addr) @@ -171,11 +175,12 @@ func initFixture(t *testing.T) *fixture { encodingCfg.InterfaceRegistry.SigningContext().AddressCodec(), encodingCfg.InterfaceRegistry.SigningContext().ValidatorAddressCodec(), map[string]appmodule.AppModule{ - authtypes.ModuleName: authModule, - banktypes.ModuleName: bankModule, - stakingtypes.ModuleName: stakingModule, - distrtypes.ModuleName: distrModule, - pooltypes.ModuleName: poolModule, + authtypes.ModuleName: authModule, + banktypes.ModuleName: bankModule, + stakingtypes.ModuleName: stakingModule, + distrtypes.ModuleName: distrModule, + pooltypes.ModuleName: poolModule, + consensustypes.ModuleName: consensusModule, }, msgRouter, grpcRouter, diff --git a/tests/integration/evidence/keeper/infraction_test.go b/tests/integration/evidence/keeper/infraction_test.go index 62fa116ec07d..b51fc00e869c 100644 --- a/tests/integration/evidence/keeper/infraction_test.go +++ b/tests/integration/evidence/keeper/infraction_test.go @@ -25,6 +25,8 @@ import ( "cosmossdk.io/x/bank" bankkeeper "cosmossdk.io/x/bank/keeper" banktypes "cosmossdk.io/x/bank/types" + "cosmossdk.io/x/consensus" + consensusparamkeeper "cosmossdk.io/x/consensus/keeper" consensusparamtypes "cosmossdk.io/x/consensus/types" "cosmossdk.io/x/evidence" "cosmossdk.io/x/evidence/exported" @@ -144,13 +146,15 @@ func initFixture(tb testing.TB) *fixture { assert.NilError(tb, bankKeeper.SetParams(newCtx, banktypes.DefaultParams())) - stakingKeeper := stakingkeeper.NewKeeper(cdc, runtime.NewEnvironment(runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), log.NewNopLogger(), runtime.EnvWithQueryRouterService(grpcQueryRouter), runtime.EnvWithMsgRouterService(msgRouter)), accountKeeper, bankKeeper, authority.String(), addresscodec.NewBech32Codec(sdk.Bech32PrefixValAddr), addresscodec.NewBech32Codec(sdk.Bech32PrefixConsAddr), runtime.NewContextAwareCometInfoService()) + consensusParamsKeeper := consensusparamkeeper.NewKeeper(cdc, runtime.NewEnvironment(runtime.NewKVStoreService(keys[consensusparamtypes.StoreKey]), log.NewNopLogger(), runtime.EnvWithQueryRouterService(grpcQueryRouter), runtime.EnvWithMsgRouterService(msgRouter)), authtypes.NewModuleAddress("gov").String()) + + stakingKeeper := stakingkeeper.NewKeeper(cdc, runtime.NewEnvironment(runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), log.NewNopLogger(), runtime.EnvWithQueryRouterService(grpcQueryRouter), runtime.EnvWithMsgRouterService(msgRouter)), accountKeeper, bankKeeper, consensusParamsKeeper, authority.String(), addresscodec.NewBech32Codec(sdk.Bech32PrefixValAddr), addresscodec.NewBech32Codec(sdk.Bech32PrefixConsAddr), runtime.NewContextAwareCometInfoService()) slashingKeeper := slashingkeeper.NewKeeper(runtime.NewEnvironment(runtime.NewKVStoreService(keys[slashingtypes.StoreKey]), log.NewNopLogger()), cdc, codec.NewLegacyAmino(), stakingKeeper, authority.String()) stakingKeeper.SetHooks(stakingtypes.NewMultiStakingHooks(slashingKeeper.Hooks())) - evidenceKeeper := keeper.NewKeeper(cdc, runtime.NewEnvironment(runtime.NewKVStoreService(keys[evidencetypes.StoreKey]), log.NewNopLogger(), runtime.EnvWithQueryRouterService(grpcQueryRouter), runtime.EnvWithMsgRouterService(msgRouter)), stakingKeeper, slashingKeeper, addresscodec.NewBech32Codec(sdk.Bech32PrefixAccAddr)) + evidenceKeeper := keeper.NewKeeper(cdc, runtime.NewEnvironment(runtime.NewKVStoreService(keys[evidencetypes.StoreKey]), log.NewNopLogger(), runtime.EnvWithQueryRouterService(grpcQueryRouter), runtime.EnvWithMsgRouterService(msgRouter)), stakingKeeper, slashingKeeper, consensusParamsKeeper, addresscodec.NewBech32Codec(sdk.Bech32PrefixAccAddr)) router := evidencetypes.NewRouter() router = router.AddRoute(evidencetypes.RouteEquivocation, testEquivocationHandler(evidenceKeeper)) evidenceKeeper.SetRouter(router) @@ -160,16 +164,18 @@ func initFixture(tb testing.TB) *fixture { stakingModule := staking.NewAppModule(cdc, stakingKeeper, accountKeeper, bankKeeper) slashingModule := slashing.NewAppModule(cdc, slashingKeeper, accountKeeper, bankKeeper, stakingKeeper, cdc.InterfaceRegistry(), cometInfoService) evidenceModule := evidence.NewAppModule(cdc, *evidenceKeeper, cometInfoService) + consensusModule := consensus.NewAppModule(cdc, consensusParamsKeeper) integrationApp := integration.NewIntegrationApp(newCtx, logger, keys, cdc, encodingCfg.InterfaceRegistry.SigningContext().AddressCodec(), encodingCfg.InterfaceRegistry.SigningContext().ValidatorAddressCodec(), map[string]appmodule.AppModule{ - authtypes.ModuleName: authModule, - banktypes.ModuleName: bankModule, - stakingtypes.ModuleName: stakingModule, - slashingtypes.ModuleName: slashingModule, - evidencetypes.ModuleName: evidenceModule, + authtypes.ModuleName: authModule, + banktypes.ModuleName: bankModule, + stakingtypes.ModuleName: stakingModule, + slashingtypes.ModuleName: slashingModule, + evidencetypes.ModuleName: evidenceModule, + consensusparamtypes.ModuleName: consensusModule, }, msgRouter, grpcQueryRouter, diff --git a/tests/integration/gov/keeper/keeper_test.go b/tests/integration/gov/keeper/keeper_test.go index 0fe367219ee3..a58124947a45 100644 --- a/tests/integration/gov/keeper/keeper_test.go +++ b/tests/integration/gov/keeper/keeper_test.go @@ -18,6 +18,9 @@ import ( "cosmossdk.io/x/bank" bankkeeper "cosmossdk.io/x/bank/keeper" banktypes "cosmossdk.io/x/bank/types" + "cosmossdk.io/x/consensus" + consensusparamkeeper "cosmossdk.io/x/consensus/keeper" + consensusparamtypes "cosmossdk.io/x/consensus/types" "cosmossdk.io/x/gov" "cosmossdk.io/x/gov/keeper" "cosmossdk.io/x/gov/types" @@ -54,7 +57,7 @@ type fixture struct { func initFixture(tb testing.TB) *fixture { tb.Helper() keys := storetypes.NewKVStoreKeys( - authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey, pooltypes.StoreKey, types.StoreKey, + authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey, pooltypes.StoreKey, types.StoreKey, consensusparamtypes.StoreKey, ) encodingCfg := moduletestutil.MakeTestEncodingConfig(codectestutil.CodecOptions{}, auth.AppModule{}, bank.AppModule{}, gov.AppModule{}) cdc := encodingCfg.Codec @@ -110,7 +113,11 @@ func initFixture(tb testing.TB) *fixture { assert.NilError(tb, bankKeeper.SetParams(newCtx, banktypes.DefaultParams())) - stakingKeeper := stakingkeeper.NewKeeper(cdc, runtime.NewEnvironment(runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), log.NewNopLogger()), accountKeeper, bankKeeper, authority.String(), addresscodec.NewBech32Codec(sdk.Bech32PrefixValAddr), addresscodec.NewBech32Codec(sdk.Bech32PrefixConsAddr), runtime.NewContextAwareCometInfoService()) + router := baseapp.NewMsgServiceRouter() + queryRouter := baseapp.NewGRPCQueryRouter() + consensusParamsKeeper := consensusparamkeeper.NewKeeper(cdc, runtime.NewEnvironment(runtime.NewKVStoreService(keys[consensusparamtypes.StoreKey]), log.NewNopLogger(), runtime.EnvWithQueryRouterService(queryRouter), runtime.EnvWithMsgRouterService(router)), authtypes.NewModuleAddress("gov").String()) + + stakingKeeper := stakingkeeper.NewKeeper(cdc, runtime.NewEnvironment(runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), log.NewNopLogger()), accountKeeper, bankKeeper, consensusParamsKeeper, authority.String(), addresscodec.NewBech32Codec(sdk.Bech32PrefixValAddr), addresscodec.NewBech32Codec(sdk.Bech32PrefixConsAddr), runtime.NewContextAwareCometInfoService()) poolKeeper := poolkeeper.NewKeeper(cdc, runtime.NewEnvironment(runtime.NewKVStoreService(keys[pooltypes.StoreKey]), log.NewNopLogger()), accountKeeper, bankKeeper, stakingKeeper, authority.String()) @@ -120,9 +127,7 @@ func initFixture(tb testing.TB) *fixture { // Create MsgServiceRouter, but don't populate it before creating the gov // keeper. - router := baseapp.NewMsgServiceRouter() router.SetInterfaceRegistry(cdc.InterfaceRegistry()) - queryRouter := baseapp.NewGRPCQueryRouter() queryRouter.SetInterfaceRegistry(cdc.InterfaceRegistry()) govKeeper := keeper.NewKeeper( @@ -146,15 +151,17 @@ func initFixture(tb testing.TB) *fixture { bankModule := bank.NewAppModule(cdc, bankKeeper, accountKeeper) stakingModule := staking.NewAppModule(cdc, stakingKeeper, accountKeeper, bankKeeper) govModule := gov.NewAppModule(cdc, govKeeper, accountKeeper, bankKeeper, poolKeeper) + consensusModule := consensus.NewAppModule(cdc, consensusParamsKeeper) integrationApp := integration.NewIntegrationApp(newCtx, logger, keys, cdc, encodingCfg.InterfaceRegistry.SigningContext().AddressCodec(), encodingCfg.InterfaceRegistry.SigningContext().ValidatorAddressCodec(), map[string]appmodule.AppModule{ - authtypes.ModuleName: authModule, - banktypes.ModuleName: bankModule, - stakingtypes.ModuleName: stakingModule, - types.ModuleName: govModule, + authtypes.ModuleName: authModule, + banktypes.ModuleName: bankModule, + stakingtypes.ModuleName: stakingModule, + types.ModuleName: govModule, + consensusparamtypes.ModuleName: consensusModule, }, baseapp.NewMsgServiceRouter(), baseapp.NewGRPCQueryRouter(), diff --git a/tests/integration/slashing/keeper/keeper_test.go b/tests/integration/slashing/keeper/keeper_test.go index 2e925d49c4e7..aa4eb073bae1 100644 --- a/tests/integration/slashing/keeper/keeper_test.go +++ b/tests/integration/slashing/keeper/keeper_test.go @@ -21,6 +21,8 @@ import ( "cosmossdk.io/x/bank" bankkeeper "cosmossdk.io/x/bank/keeper" banktypes "cosmossdk.io/x/bank/types" + "cosmossdk.io/x/consensus" + consensusparamkeeper "cosmossdk.io/x/consensus/keeper" consensustypes "cosmossdk.io/x/consensus/types" minttypes "cosmossdk.io/x/mint/types" "cosmossdk.io/x/slashing" @@ -117,21 +119,25 @@ func initFixture(tb testing.TB) *fixture { cometInfoService := runtime.NewContextAwareCometInfoService() - stakingKeeper := stakingkeeper.NewKeeper(cdc, runtime.NewEnvironment(runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), log.NewNopLogger(), runtime.EnvWithQueryRouterService(queryRouter), runtime.EnvWithMsgRouterService(msgRouter)), accountKeeper, bankKeeper, authority.String(), addresscodec.NewBech32Codec(sdk.Bech32PrefixValAddr), addresscodec.NewBech32Codec(sdk.Bech32PrefixConsAddr), cometInfoService) + consensusParamsKeeper := consensusparamkeeper.NewKeeper(cdc, runtime.NewEnvironment(runtime.NewKVStoreService(keys[consensustypes.StoreKey]), log.NewNopLogger(), runtime.EnvWithQueryRouterService(queryRouter), runtime.EnvWithMsgRouterService(msgRouter)), authtypes.NewModuleAddress("gov").String()) + + stakingKeeper := stakingkeeper.NewKeeper(cdc, runtime.NewEnvironment(runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), log.NewNopLogger(), runtime.EnvWithQueryRouterService(queryRouter), runtime.EnvWithMsgRouterService(msgRouter)), accountKeeper, bankKeeper, consensusParamsKeeper, authority.String(), addresscodec.NewBech32Codec(sdk.Bech32PrefixValAddr), addresscodec.NewBech32Codec(sdk.Bech32PrefixConsAddr), cometInfoService) slashingKeeper := slashingkeeper.NewKeeper(runtime.NewEnvironment(runtime.NewKVStoreService(keys[slashingtypes.StoreKey]), log.NewNopLogger(), runtime.EnvWithQueryRouterService(queryRouter), runtime.EnvWithMsgRouterService(msgRouter)), cdc, &codec.LegacyAmino{}, stakingKeeper, authority.String()) bankModule := bank.NewAppModule(cdc, bankKeeper, accountKeeper) stakingModule := staking.NewAppModule(cdc, stakingKeeper, accountKeeper, bankKeeper) slashingModule := slashing.NewAppModule(cdc, slashingKeeper, accountKeeper, bankKeeper, stakingKeeper, cdc.InterfaceRegistry(), cometInfoService) + consensusModule := consensus.NewAppModule(cdc, consensusParamsKeeper) integrationApp := integration.NewIntegrationApp(newCtx, logger, keys, cdc, encodingCfg.InterfaceRegistry.SigningContext().AddressCodec(), encodingCfg.InterfaceRegistry.SigningContext().ValidatorAddressCodec(), map[string]appmodule.AppModule{ - banktypes.ModuleName: bankModule, - stakingtypes.ModuleName: stakingModule, - slashingtypes.ModuleName: slashingModule, + banktypes.ModuleName: bankModule, + stakingtypes.ModuleName: stakingModule, + slashingtypes.ModuleName: slashingModule, + consensustypes.ModuleName: consensusModule, }, msgRouter, queryRouter, diff --git a/tests/integration/staking/keeper/common_test.go b/tests/integration/staking/keeper/common_test.go index d3fc1a18cd09..76db9f74e244 100644 --- a/tests/integration/staking/keeper/common_test.go +++ b/tests/integration/staking/keeper/common_test.go @@ -20,6 +20,8 @@ import ( "cosmossdk.io/x/bank" bankkeeper "cosmossdk.io/x/bank/keeper" banktypes "cosmossdk.io/x/bank/types" + "cosmossdk.io/x/consensus" + consensusparamkeeper "cosmossdk.io/x/consensus/keeper" consensustypes "cosmossdk.io/x/consensus/types" minttypes "cosmossdk.io/x/mint/types" pooltypes "cosmossdk.io/x/protocolpool/types" @@ -162,19 +164,23 @@ func initFixture(tb testing.TB) *fixture { assert.NilError(tb, bankKeeper.SetParams(newCtx, banktypes.DefaultParams())) - stakingKeeper := stakingkeeper.NewKeeper(cdc, runtime.NewEnvironment(runtime.NewKVStoreService(keys[types.StoreKey]), log.NewNopLogger(), runtime.EnvWithQueryRouterService(queryRouter), runtime.EnvWithMsgRouterService(msgRouter)), accountKeeper, bankKeeper, authority.String(), addresscodec.NewBech32Codec(sdk.Bech32PrefixValAddr), addresscodec.NewBech32Codec(sdk.Bech32PrefixConsAddr), runtime.NewContextAwareCometInfoService()) + consensusParamsKeeper := consensusparamkeeper.NewKeeper(cdc, runtime.NewEnvironment(runtime.NewKVStoreService(keys[consensustypes.StoreKey]), log.NewNopLogger()), authtypes.NewModuleAddress("gov").String()) + + stakingKeeper := stakingkeeper.NewKeeper(cdc, runtime.NewEnvironment(runtime.NewKVStoreService(keys[types.StoreKey]), log.NewNopLogger(), runtime.EnvWithQueryRouterService(queryRouter), runtime.EnvWithMsgRouterService(msgRouter)), accountKeeper, bankKeeper, consensusParamsKeeper, authority.String(), addresscodec.NewBech32Codec(sdk.Bech32PrefixValAddr), addresscodec.NewBech32Codec(sdk.Bech32PrefixConsAddr), runtime.NewContextAwareCometInfoService()) authModule := auth.NewAppModule(cdc, accountKeeper, acctsModKeeper, authsims.RandomGenesisAccounts, nil) bankModule := bank.NewAppModule(cdc, bankKeeper, accountKeeper) stakingModule := staking.NewAppModule(cdc, stakingKeeper, accountKeeper, bankKeeper) + consensusModule := consensus.NewAppModule(cdc, consensusParamsKeeper) integrationApp := integration.NewIntegrationApp(newCtx, logger, keys, cdc, encodingCfg.InterfaceRegistry.SigningContext().AddressCodec(), encodingCfg.InterfaceRegistry.SigningContext().ValidatorAddressCodec(), map[string]appmodule.AppModule{ - authtypes.ModuleName: authModule, - banktypes.ModuleName: bankModule, - types.ModuleName: stakingModule, + authtypes.ModuleName: authModule, + banktypes.ModuleName: bankModule, + types.ModuleName: stakingModule, + consensustypes.ModuleName: consensusModule, }, msgRouter, queryRouter, diff --git a/tests/integration/staking/keeper/deterministic_test.go b/tests/integration/staking/keeper/deterministic_test.go index 6703025fe90a..28886d981131 100644 --- a/tests/integration/staking/keeper/deterministic_test.go +++ b/tests/integration/staking/keeper/deterministic_test.go @@ -22,6 +22,9 @@ import ( bankkeeper "cosmossdk.io/x/bank/keeper" banktestutil "cosmossdk.io/x/bank/testutil" banktypes "cosmossdk.io/x/bank/types" + "cosmossdk.io/x/consensus" + consensusparamkeeper "cosmossdk.io/x/consensus/keeper" + consensusparamtypes "cosmossdk.io/x/consensus/types" "cosmossdk.io/x/distribution" minttypes "cosmossdk.io/x/mint/types" "cosmossdk.io/x/staking" @@ -71,7 +74,7 @@ type deterministicFixture struct { func initDeterministicFixture(t *testing.T) *deterministicFixture { t.Helper() keys := storetypes.NewKVStoreKeys( - authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey, + authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey, consensusparamtypes.StoreKey, ) encodingCfg := moduletestutil.MakeTestEncodingConfig(codectestutil.CodecOptions{}, auth.AppModule{}, distribution.AppModule{}) cdc := encodingCfg.Codec @@ -124,19 +127,23 @@ func initDeterministicFixture(t *testing.T) *deterministicFixture { assert.NilError(t, bankKeeper.SetParams(newCtx, banktypes.DefaultParams())) - stakingKeeper := stakingkeeper.NewKeeper(cdc, runtime.NewEnvironment(runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), log.NewNopLogger()), accountKeeper, bankKeeper, authority.String(), addresscodec.NewBech32Codec(sdk.Bech32PrefixValAddr), addresscodec.NewBech32Codec(sdk.Bech32PrefixConsAddr), runtime.NewContextAwareCometInfoService()) + consensusParamsKeeper := consensusparamkeeper.NewKeeper(cdc, runtime.NewEnvironment(runtime.NewKVStoreService(keys[consensusparamtypes.StoreKey]), log.NewNopLogger()), authtypes.NewModuleAddress("gov").String()) + + stakingKeeper := stakingkeeper.NewKeeper(cdc, runtime.NewEnvironment(runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), log.NewNopLogger()), accountKeeper, bankKeeper, consensusParamsKeeper, authority.String(), addresscodec.NewBech32Codec(sdk.Bech32PrefixValAddr), addresscodec.NewBech32Codec(sdk.Bech32PrefixConsAddr), runtime.NewContextAwareCometInfoService()) authModule := auth.NewAppModule(cdc, accountKeeper, acctsModKeeper, authsims.RandomGenesisAccounts, nil) bankModule := bank.NewAppModule(cdc, bankKeeper, accountKeeper) stakingModule := staking.NewAppModule(cdc, stakingKeeper, accountKeeper, bankKeeper) + consensusModule := consensus.NewAppModule(cdc, consensusParamsKeeper) integrationApp := integration.NewIntegrationApp(newCtx, logger, keys, cdc, encodingCfg.InterfaceRegistry.SigningContext().AddressCodec(), encodingCfg.InterfaceRegistry.SigningContext().ValidatorAddressCodec(), map[string]appmodule.AppModule{ - authtypes.ModuleName: authModule, - banktypes.ModuleName: bankModule, - stakingtypes.ModuleName: stakingModule, + authtypes.ModuleName: authModule, + banktypes.ModuleName: bankModule, + stakingtypes.ModuleName: stakingModule, + consensusparamtypes.ModuleName: consensusModule, }, baseapp.NewMsgServiceRouter(), baseapp.NewGRPCQueryRouter(), diff --git a/testutil/integration/router.go b/testutil/integration/router.go index 952d371df191..f56c04ed5266 100644 --- a/testutil/integration/router.go +++ b/testutil/integration/router.go @@ -16,20 +16,19 @@ import ( "cosmossdk.io/store/metrics" storetypes "cosmossdk.io/store/types" authtx "cosmossdk.io/x/auth/tx" - authtypes "cosmossdk.io/x/auth/types" - consensusparamkeeper "cosmossdk.io/x/consensus/keeper" - consensusparamtypes "cosmossdk.io/x/consensus/types" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/runtime" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" ) -const appName = "integration-app" +const ( + appName = "integration-app" + consensus = "consensus" +) // App is a test application that can be used to test the integration of modules. type App struct { @@ -88,16 +87,17 @@ func NewIntegrationApp( grpcRouter.SetInterfaceRegistry(interfaceRegistry) bApp.SetGRPCQueryRouter(grpcRouter) - if keys[consensusparamtypes.StoreKey] != nil { + if keys[consensus] != nil { // set baseApp param store - consensusParamsKeeper := consensusparamkeeper.NewKeeper(appCodec, runtime.NewEnvironment(runtime.NewKVStoreService(keys[consensusparamtypes.StoreKey]), log.NewNopLogger(), runtime.EnvWithQueryRouterService(grpcRouter), runtime.EnvWithMsgRouterService(msgRouter)), authtypes.NewModuleAddress("gov").String()) - bApp.SetParamStore(consensusParamsKeeper.ParamsStore) - consensusparamtypes.RegisterQueryServer(grpcRouter, consensusParamsKeeper) - - params := cmttypes.ConsensusParamsFromProto(*simtestutil.DefaultConsensusParams) // This fills up missing param sections - err := consensusParamsKeeper.ParamsStore.Set(sdkCtx, params.ToProto()) - if err != nil { - panic(fmt.Errorf("failed to set consensus params: %w", err)) + consensusParamsKeeper, ok := modules[consensus].(baseapp.ParamStore) + if ok { + bApp.SetParamStore(consensusParamsKeeper) + + params := cmttypes.ConsensusParamsFromProto(*simtestutil.DefaultConsensusParams) // This fills up missing param sections + err := consensusParamsKeeper.Set(sdkCtx, params.ToProto()) + if err != nil { + panic(fmt.Errorf("failed to set consensus params: %w", err)) + } } if err := bApp.LoadLatestVersion(); err != nil { diff --git a/x/accounts/go.mod b/x/accounts/go.mod index c71b0244f9f4..8eaaf3afcda1 100644 --- a/x/accounts/go.mod +++ b/x/accounts/go.mod @@ -184,7 +184,6 @@ replace ( cosmossdk.io/x/accounts/defaults/multisig => ./defaults/multisig cosmossdk.io/x/auth => ../auth cosmossdk.io/x/bank => ../bank - cosmossdk.io/x/consensus => ../consensus cosmossdk.io/x/distribution => ../distribution cosmossdk.io/x/mint => ../mint cosmossdk.io/x/slashing => ../slashing diff --git a/x/auth/ante/setup_test.go b/x/auth/ante/setup_test.go index 1e10cafa9ed0..cd6f7a64dc31 100644 --- a/x/auth/ante/setup_test.go +++ b/x/auth/ante/setup_test.go @@ -33,7 +33,7 @@ func TestSetupDecorator_BlockMaxGas(t *testing.T) { tx, err := suite.CreateTestTx(suite.ctx, privs, accNums, accSeqs, suite.ctx.ChainID(), signing.SignMode_SIGN_MODE_DIRECT) require.NoError(t, err) - sud := ante.NewSetUpContextDecorator(suite.env) + sud := ante.NewSetUpContextDecorator(suite.env, suite.consensusKeeper) antehandler := sdk.ChainAnteDecorators(sud) suite.ctx = suite.ctx. @@ -63,7 +63,7 @@ func TestSetup(t *testing.T) { tx, err := suite.CreateTestTx(suite.ctx, privs, accNums, accSeqs, suite.ctx.ChainID(), signing.SignMode_SIGN_MODE_DIRECT) require.NoError(t, err) - sud := ante.NewSetUpContextDecorator(suite.env) + sud := ante.NewSetUpContextDecorator(suite.env, suite.consensusKeeper) antehandler := sdk.ChainAnteDecorators(sud) // Set height to non-zero value for GasMeter to be set @@ -98,7 +98,7 @@ func TestRecoverPanic(t *testing.T) { tx, err := suite.CreateTestTx(suite.ctx, privs, accNums, accSeqs, suite.ctx.ChainID(), signing.SignMode_SIGN_MODE_DIRECT) require.NoError(t, err) - sud := ante.NewSetUpContextDecorator(suite.env) + sud := ante.NewSetUpContextDecorator(suite.env, suite.consensusKeeper) antehandler := sdk.ChainAnteDecorators(sud, OutOfGasDecorator{}) // Set height to non-zero value for GasMeter to be set diff --git a/x/auth/go.mod b/x/auth/go.mod index 81586af8cdd3..e67caf65b3e6 100644 --- a/x/auth/go.mod +++ b/x/auth/go.mod @@ -178,7 +178,6 @@ replace ( cosmossdk.io/core/testing => ../../core/testing cosmossdk.io/x/accounts => ../accounts cosmossdk.io/x/bank => ../bank - cosmossdk.io/x/consensus => ../consensus cosmossdk.io/x/staking => ../staking cosmossdk.io/x/tx => ../tx ) diff --git a/x/authz/go.mod b/x/authz/go.mod index 276c2f433828..9e40c748b511 100644 --- a/x/authz/go.mod +++ b/x/authz/go.mod @@ -181,7 +181,6 @@ replace ( cosmossdk.io/x/accounts => ../accounts cosmossdk.io/x/auth => ../auth cosmossdk.io/x/bank => ../bank - cosmossdk.io/x/consensus => ../consensus cosmossdk.io/x/staking => ../staking cosmossdk.io/x/tx => ../tx ) diff --git a/x/bank/go.mod b/x/bank/go.mod index 97296e6dda49..446dec354c3d 100644 --- a/x/bank/go.mod +++ b/x/bank/go.mod @@ -182,7 +182,6 @@ replace ( cosmossdk.io/core/testing => ../../core/testing cosmossdk.io/x/accounts => ../accounts cosmossdk.io/x/auth => ../auth - cosmossdk.io/x/consensus => ../consensus cosmossdk.io/x/staking => ../staking cosmossdk.io/x/tx => ../tx ) diff --git a/x/circuit/go.mod b/x/circuit/go.mod index d691bcdc4d95..1d4c36db74cc 100644 --- a/x/circuit/go.mod +++ b/x/circuit/go.mod @@ -179,7 +179,6 @@ replace ( cosmossdk.io/x/accounts => ../accounts cosmossdk.io/x/auth => ../auth cosmossdk.io/x/bank => ../bank - cosmossdk.io/x/consensus => ../consensus cosmossdk.io/x/staking => ../staking cosmossdk.io/x/tx => ../tx ) diff --git a/x/distribution/go.mod b/x/distribution/go.mod index c83af69f3c39..b563768c491c 100644 --- a/x/distribution/go.mod +++ b/x/distribution/go.mod @@ -183,7 +183,6 @@ replace ( cosmossdk.io/x/accounts => ../accounts cosmossdk.io/x/auth => ../auth cosmossdk.io/x/bank => ../bank - cosmossdk.io/x/consensus => ../consensus cosmossdk.io/x/protocolpool => ../protocolpool cosmossdk.io/x/staking => ../staking cosmossdk.io/x/tx => ../tx diff --git a/x/epochs/go.mod b/x/epochs/go.mod index a6ecfd7d956d..1edf9192d028 100644 --- a/x/epochs/go.mod +++ b/x/epochs/go.mod @@ -181,7 +181,6 @@ replace ( cosmossdk.io/x/accounts => ../accounts cosmossdk.io/x/auth => ../auth cosmossdk.io/x/bank => ../bank - cosmossdk.io/x/consensus => ../consensus cosmossdk.io/x/staking => ../staking cosmossdk.io/x/tx => ../tx ) diff --git a/x/evidence/go.mod b/x/evidence/go.mod index 68fdb9619966..def5a9c0b3bd 100644 --- a/x/evidence/go.mod +++ b/x/evidence/go.mod @@ -179,7 +179,6 @@ replace ( cosmossdk.io/x/accounts => ../accounts cosmossdk.io/x/auth => ../auth cosmossdk.io/x/bank => ../bank - cosmossdk.io/x/consensus => ../consensus cosmossdk.io/x/staking => ../staking cosmossdk.io/x/tx => ../tx ) diff --git a/x/feegrant/go.mod b/x/feegrant/go.mod index 61e95866146e..5e4767fbc533 100644 --- a/x/feegrant/go.mod +++ b/x/feegrant/go.mod @@ -184,7 +184,6 @@ replace ( cosmossdk.io/x/accounts => ../accounts cosmossdk.io/x/auth => ../auth cosmossdk.io/x/bank => ../bank - cosmossdk.io/x/consensus => ../consensus cosmossdk.io/x/gov => ../gov cosmossdk.io/x/staking => ../staking cosmossdk.io/x/tx => ../tx diff --git a/x/gov/go.mod b/x/gov/go.mod index c22f20ac6eca..3d335cdbcdc7 100644 --- a/x/gov/go.mod +++ b/x/gov/go.mod @@ -183,7 +183,6 @@ replace ( cosmossdk.io/x/accounts => ../accounts cosmossdk.io/x/auth => ../auth cosmossdk.io/x/bank => ../bank - cosmossdk.io/x/consensus => ../consensus cosmossdk.io/x/protocolpool => ../protocolpool cosmossdk.io/x/staking => ../staking cosmossdk.io/x/tx => ../tx diff --git a/x/mint/go.mod b/x/mint/go.mod index 0690f7069eaf..841b6c162810 100644 --- a/x/mint/go.mod +++ b/x/mint/go.mod @@ -183,7 +183,6 @@ replace ( cosmossdk.io/x/accounts => ../accounts cosmossdk.io/x/auth => ../auth cosmossdk.io/x/bank => ../bank - cosmossdk.io/x/consensus => ../consensus cosmossdk.io/x/staking => ../staking cosmossdk.io/x/tx => ../tx ) diff --git a/x/nft/go.mod b/x/nft/go.mod index 811846f0f31e..daaadc80ace3 100644 --- a/x/nft/go.mod +++ b/x/nft/go.mod @@ -178,7 +178,6 @@ replace ( cosmossdk.io/x/accounts => ../accounts cosmossdk.io/x/auth => ../auth cosmossdk.io/x/bank => ../bank - cosmossdk.io/x/consensus => ../consensus cosmossdk.io/x/staking => ../staking cosmossdk.io/x/tx => ../tx ) diff --git a/x/params/go.mod b/x/params/go.mod index 5b1c00586486..6c9ef3345d8d 100644 --- a/x/params/go.mod +++ b/x/params/go.mod @@ -179,7 +179,6 @@ replace ( cosmossdk.io/x/accounts => ../accounts cosmossdk.io/x/auth => ../auth cosmossdk.io/x/bank => ../bank - cosmossdk.io/x/consensus => ../consensus cosmossdk.io/x/distribution => ../distribution cosmossdk.io/x/gov => ../gov cosmossdk.io/x/mint => ../mint diff --git a/x/protocolpool/go.mod b/x/protocolpool/go.mod index 03e95c37d02f..2524eaa50255 100644 --- a/x/protocolpool/go.mod +++ b/x/protocolpool/go.mod @@ -179,7 +179,6 @@ replace ( cosmossdk.io/x/accounts => ../accounts cosmossdk.io/x/auth => ../auth cosmossdk.io/x/bank => ../bank - cosmossdk.io/x/consensus => ../consensus cosmossdk.io/x/staking => ../staking cosmossdk.io/x/tx => ../tx ) diff --git a/x/slashing/go.mod b/x/slashing/go.mod index 9afb97d0b479..aa86f98bc1fe 100644 --- a/x/slashing/go.mod +++ b/x/slashing/go.mod @@ -180,7 +180,6 @@ replace ( cosmossdk.io/x/accounts => ../accounts cosmossdk.io/x/auth => ../auth cosmossdk.io/x/bank => ../bank - cosmossdk.io/x/consensus => ../consensus cosmossdk.io/x/staking => ../staking cosmossdk.io/x/tx => ../tx ) diff --git a/x/staking/go.mod b/x/staking/go.mod index f6b41f3faf23..3df800ae23f7 100644 --- a/x/staking/go.mod +++ b/x/staking/go.mod @@ -185,6 +185,5 @@ replace ( cosmossdk.io/x/accounts => ../accounts cosmossdk.io/x/auth => ../auth cosmossdk.io/x/bank => ../bank - cosmossdk.io/x/consensus => ../consensus cosmossdk.io/x/tx => ../tx ) diff --git a/x/upgrade/go.mod b/x/upgrade/go.mod index 97729965816a..909b146ef292 100644 --- a/x/upgrade/go.mod +++ b/x/upgrade/go.mod @@ -211,7 +211,6 @@ replace ( cosmossdk.io/x/accounts => ../accounts cosmossdk.io/x/auth => ../auth cosmossdk.io/x/bank => ../bank - cosmossdk.io/x/consensus => ../consensus cosmossdk.io/x/gov => ../gov cosmossdk.io/x/staking => ../staking cosmossdk.io/x/tx => ../tx diff --git a/x/upgrade/keeper/abci_test.go b/x/upgrade/keeper/abci_test.go index c55d47fe0e73..e568d3f0cc16 100644 --- a/x/upgrade/keeper/abci_test.go +++ b/x/upgrade/keeper/abci_test.go @@ -136,7 +136,7 @@ func setupTest(t *testing.T, height int64, skip map[int64]bool) *TestSuite { authority, err := addresscodec.NewBech32Codec("cosmos").BytesToString(authtypes.NewModuleAddress(govModuleName)) require.NoError(t, err) - s.keeper = keeper.NewKeeper(s.env, skip, s.encCfg.Codec, t.TempDir(), s.baseApp, authority) + s.keeper = keeper.NewKeeper(s.env, skip, s.encCfg.Codec, t.TempDir(), s.baseApp, authority, nil) //TODO: s.ctx = testCtx.Ctx.WithHeaderInfo(header.Info{Time: time.Now(), Height: height}) @@ -511,7 +511,7 @@ func TestDowngradeVerification(t *testing.T) { require.NoError(t, err) // downgrade. now keeper does not have the handler. - k := keeper.NewKeeper(s.env, map[int64]bool{}, s.encCfg.Codec, t.TempDir(), nil, authority) + k := keeper.NewKeeper(s.env, map[int64]bool{}, s.encCfg.Codec, t.TempDir(), nil, authority, nil) //TODO: m := upgrade.NewAppModule(k) // assertions diff --git a/x/upgrade/keeper/grpc_query_test.go b/x/upgrade/keeper/grpc_query_test.go index 7e6042257e17..a6d2097a9e84 100644 --- a/x/upgrade/keeper/grpc_query_test.go +++ b/x/upgrade/keeper/grpc_query_test.go @@ -47,7 +47,7 @@ func (suite *UpgradeTestSuite) SetupTest() { authority, err := addresscodec.NewBech32Codec("cosmos").BytesToString(authtypes.NewModuleAddress(types.GovModuleName)) suite.Require().NoError(err) suite.encodedAuthority = authority - suite.upgradeKeeper = keeper.NewKeeper(env, skipUpgradeHeights, suite.encCfg.Codec, suite.T().TempDir(), nil, authority) + suite.upgradeKeeper = keeper.NewKeeper(env, skipUpgradeHeights, suite.encCfg.Codec, suite.T().TempDir(), nil, authority, nil) //TODO: err = suite.upgradeKeeper.SetModuleVersionMap(suite.ctx, appmodule.VersionMap{ "bank": 0, }) diff --git a/x/upgrade/keeper/keeper_test.go b/x/upgrade/keeper/keeper_test.go index a1999db9150e..30196c7cb125 100644 --- a/x/upgrade/keeper/keeper_test.go +++ b/x/upgrade/keeper/keeper_test.go @@ -256,7 +256,7 @@ func (s *KeeperTestSuite) TestIsSkipHeight() { skip := map[int64]bool{skipOne: true} storeService := runtime.NewKVStoreService(s.key) env := runtime.NewEnvironment(storeService, coretesting.NewNopLogger()) - upgradeKeeper := keeper.NewKeeper(env, skip, s.encCfg.Codec, s.T().TempDir(), s.baseApp, s.encodedAuthority) + upgradeKeeper := keeper.NewKeeper(env, skip, s.encCfg.Codec, s.T().TempDir(), s.baseApp, s.encodedAuthority, nil) //TODO: s.Require().True(upgradeKeeper.IsSkipHeight(9)) s.Require().False(upgradeKeeper.IsSkipHeight(10)) } From b16950fcd98c895a4798e5fdf84bf8dac9c42498 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Fri, 30 Aug 2024 15:16:40 +0200 Subject: [PATCH 09/23] fix todos --- scripts/mockgen.sh | 1 + x/upgrade/keeper/abci_test.go | 9 +++- x/upgrade/keeper/grpc_query_test.go | 5 +- x/upgrade/keeper/keeper_test.go | 8 ++- x/upgrade/testutil/expected_keepers_mocks.go | 50 +++++++++++++++++++ ...expected_keeper.go => expected_keepers.go} | 0 6 files changed, 68 insertions(+), 5 deletions(-) create mode 100644 x/upgrade/testutil/expected_keepers_mocks.go rename x/upgrade/types/{expected_keeper.go => expected_keepers.go} (100%) diff --git a/scripts/mockgen.sh b/scripts/mockgen.sh index 80869055797c..57ef89cef1c5 100755 --- a/scripts/mockgen.sh +++ b/scripts/mockgen.sh @@ -26,4 +26,5 @@ $mockgen_cmd -source=x/gov/testutil/expected_keepers.go -package testutil -desti $mockgen_cmd -source=x/staking/types/expected_keepers.go -package testutil -destination x/staking/testutil/expected_keepers_mocks.go # $mockgen_cmd -source=x/auth/vesting/types/expected_keepers.go -package testutil -destination x/auth/vesting/testutil/expected_keepers_mocks.go $mockgen_cmd -source=x/protocolpool/types/expected_keepers.go -package testutil -destination x/protocolpool/testutil/expected_keepers_mocks.go +$mockgen_cmd -source=x/upgrade/types/expected_keepers.go -package testutil -destination x/upgrade/testutil/expected_keepers_mocks.go $mockgen_cmd -source=core/gas/service.go -package gas -destination core/testing/gas/service_mocks.go diff --git a/x/upgrade/keeper/abci_test.go b/x/upgrade/keeper/abci_test.go index e568d3f0cc16..e2f13746ce9d 100644 --- a/x/upgrade/keeper/abci_test.go +++ b/x/upgrade/keeper/abci_test.go @@ -8,6 +8,7 @@ import ( "time" cmtproto "github.com/cometbft/cometbft/api/cometbft/types/v1" + "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" "cosmossdk.io/core/appmodule" @@ -18,6 +19,7 @@ import ( authtypes "cosmossdk.io/x/auth/types" "cosmossdk.io/x/upgrade" "cosmossdk.io/x/upgrade/keeper" + upgradetestutil "cosmossdk.io/x/upgrade/testutil" "cosmossdk.io/x/upgrade/types" "github.com/cosmos/cosmos-sdk/baseapp" @@ -136,7 +138,9 @@ func setupTest(t *testing.T, height int64, skip map[int64]bool) *TestSuite { authority, err := addresscodec.NewBech32Codec("cosmos").BytesToString(authtypes.NewModuleAddress(govModuleName)) require.NoError(t, err) - s.keeper = keeper.NewKeeper(s.env, skip, s.encCfg.Codec, t.TempDir(), s.baseApp, authority, nil) //TODO: + ctrl := gomock.NewController(t) + + s.keeper = keeper.NewKeeper(s.env, skip, s.encCfg.Codec, t.TempDir(), s.baseApp, authority, upgradetestutil.NewMockConsensusKeeper(ctrl)) s.ctx = testCtx.Ctx.WithHeaderInfo(header.Info{Time: time.Now(), Height: height}) @@ -510,8 +514,9 @@ func TestDowngradeVerification(t *testing.T) { authority, err := addresscodec.NewBech32Codec("cosmos").BytesToString(authtypes.NewModuleAddress(govModuleName)) require.NoError(t, err) + ctrl := gomock.NewController(t) // downgrade. now keeper does not have the handler. - k := keeper.NewKeeper(s.env, map[int64]bool{}, s.encCfg.Codec, t.TempDir(), nil, authority, nil) //TODO: + k := keeper.NewKeeper(s.env, map[int64]bool{}, s.encCfg.Codec, t.TempDir(), nil, authority, upgradetestutil.NewMockConsensusKeeper(ctrl)) m := upgrade.NewAppModule(k) // assertions diff --git a/x/upgrade/keeper/grpc_query_test.go b/x/upgrade/keeper/grpc_query_test.go index a6d2097a9e84..42005d789361 100644 --- a/x/upgrade/keeper/grpc_query_test.go +++ b/x/upgrade/keeper/grpc_query_test.go @@ -5,6 +5,7 @@ import ( "fmt" "testing" + "github.com/golang/mock/gomock" "github.com/stretchr/testify/suite" "cosmossdk.io/core/appmodule" @@ -14,6 +15,7 @@ import ( authtypes "cosmossdk.io/x/auth/types" "cosmossdk.io/x/upgrade" "cosmossdk.io/x/upgrade/keeper" + upgradetestutil "cosmossdk.io/x/upgrade/testutil" "cosmossdk.io/x/upgrade/types" "github.com/cosmos/cosmos-sdk/baseapp" @@ -47,7 +49,8 @@ func (suite *UpgradeTestSuite) SetupTest() { authority, err := addresscodec.NewBech32Codec("cosmos").BytesToString(authtypes.NewModuleAddress(types.GovModuleName)) suite.Require().NoError(err) suite.encodedAuthority = authority - suite.upgradeKeeper = keeper.NewKeeper(env, skipUpgradeHeights, suite.encCfg.Codec, suite.T().TempDir(), nil, authority, nil) //TODO: + ctrl := gomock.NewController(suite.T()) + suite.upgradeKeeper = keeper.NewKeeper(env, skipUpgradeHeights, suite.encCfg.Codec, suite.T().TempDir(), nil, authority, upgradetestutil.NewMockConsensusKeeper(ctrl)) err = suite.upgradeKeeper.SetModuleVersionMap(suite.ctx, appmodule.VersionMap{ "bank": 0, }) diff --git a/x/upgrade/keeper/keeper_test.go b/x/upgrade/keeper/keeper_test.go index 30196c7cb125..875cb518a355 100644 --- a/x/upgrade/keeper/keeper_test.go +++ b/x/upgrade/keeper/keeper_test.go @@ -7,6 +7,7 @@ import ( cmtproto "github.com/cometbft/cometbft/api/cometbft/types/v1" cmttypes "github.com/cometbft/cometbft/types" + "github.com/golang/mock/gomock" "github.com/stretchr/testify/suite" "cosmossdk.io/core/appmodule" @@ -17,6 +18,7 @@ import ( authtypes "cosmossdk.io/x/auth/types" "cosmossdk.io/x/upgrade" "cosmossdk.io/x/upgrade/keeper" + upgradetestutil "cosmossdk.io/x/upgrade/testutil" "cosmossdk.io/x/upgrade/types" "github.com/cosmos/cosmos-sdk/baseapp" @@ -72,7 +74,8 @@ func (s *KeeperTestSuite) SetupTest() { s.Require().NoError(err) s.encodedAuthority = authority - s.upgradeKeeper = keeper.NewKeeper(env, skipUpgradeHeights, s.encCfg.Codec, homeDir, s.baseApp, authority, nil) //TODO: pass consensus keeper + ctrl := gomock.NewController(s.T()) + s.upgradeKeeper = keeper.NewKeeper(env, skipUpgradeHeights, s.encCfg.Codec, homeDir, s.baseApp, authority, upgradetestutil.NewMockConsensusKeeper(ctrl)) s.T().Log("home dir:", homeDir) s.homeDir = homeDir @@ -256,7 +259,8 @@ func (s *KeeperTestSuite) TestIsSkipHeight() { skip := map[int64]bool{skipOne: true} storeService := runtime.NewKVStoreService(s.key) env := runtime.NewEnvironment(storeService, coretesting.NewNopLogger()) - upgradeKeeper := keeper.NewKeeper(env, skip, s.encCfg.Codec, s.T().TempDir(), s.baseApp, s.encodedAuthority, nil) //TODO: + ctrl := gomock.NewController(s.T()) + upgradeKeeper := keeper.NewKeeper(env, skip, s.encCfg.Codec, s.T().TempDir(), s.baseApp, s.encodedAuthority, upgradetestutil.NewMockConsensusKeeper(ctrl)) s.Require().True(upgradeKeeper.IsSkipHeight(9)) s.Require().False(upgradeKeeper.IsSkipHeight(10)) } diff --git a/x/upgrade/testutil/expected_keepers_mocks.go b/x/upgrade/testutil/expected_keepers_mocks.go new file mode 100644 index 000000000000..31d3d209248f --- /dev/null +++ b/x/upgrade/testutil/expected_keepers_mocks.go @@ -0,0 +1,50 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: x/upgrade/types/expected_keepers.go + +// Package testutil is a generated GoMock package. +package testutil + +import ( + context "context" + reflect "reflect" + + gomock "github.com/golang/mock/gomock" +) + +// MockConsensusKeeper is a mock of ConsensusKeeper interface. +type MockConsensusKeeper struct { + ctrl *gomock.Controller + recorder *MockConsensusKeeperMockRecorder +} + +// MockConsensusKeeperMockRecorder is the mock recorder for MockConsensusKeeper. +type MockConsensusKeeperMockRecorder struct { + mock *MockConsensusKeeper +} + +// NewMockConsensusKeeper creates a new mock instance. +func NewMockConsensusKeeper(ctrl *gomock.Controller) *MockConsensusKeeper { + mock := &MockConsensusKeeper{ctrl: ctrl} + mock.recorder = &MockConsensusKeeperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockConsensusKeeper) EXPECT() *MockConsensusKeeperMockRecorder { + return m.recorder +} + +// AppVersion mocks base method. +func (m *MockConsensusKeeper) AppVersion(ctx context.Context) (uint64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "AppVersion", ctx) + ret0, _ := ret[0].(uint64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// AppVersion indicates an expected call of AppVersion. +func (mr *MockConsensusKeeperMockRecorder) AppVersion(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AppVersion", reflect.TypeOf((*MockConsensusKeeper)(nil).AppVersion), ctx) +} diff --git a/x/upgrade/types/expected_keeper.go b/x/upgrade/types/expected_keepers.go similarity index 100% rename from x/upgrade/types/expected_keeper.go rename to x/upgrade/types/expected_keepers.go From 25d937dfc38b39ea7809c3599cbd0b0328e6f934 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Fri, 30 Aug 2024 15:24:50 +0200 Subject: [PATCH 10/23] fix lints --- schema/diff/diff_test.go | 1 + tests/integration/distribution/migration_v4_test.go | 1 + x/auth/ante/setup.go | 2 +- x/staking/keeper/msg_server.go | 3 +++ x/upgrade/go.mod | 2 +- 5 files changed, 7 insertions(+), 2 deletions(-) diff --git a/schema/diff/diff_test.go b/schema/diff/diff_test.go index 867d3e1d660c..411f2feb9177 100644 --- a/schema/diff/diff_test.go +++ b/schema/diff/diff_test.go @@ -332,6 +332,7 @@ func TestCompareModuleSchemas(t *testing.T) { } func requireModuleSchema(t *testing.T, types ...schema.Type) schema.ModuleSchema { + t.Helper() s, err := schema.NewModuleSchema(types...) if err != nil { t.Fatal(err) diff --git a/tests/integration/distribution/migration_v4_test.go b/tests/integration/distribution/migration_v4_test.go index cea3fa645448..413611b495b4 100644 --- a/tests/integration/distribution/migration_v4_test.go +++ b/tests/integration/distribution/migration_v4_test.go @@ -24,6 +24,7 @@ import ( distrtestutil "cosmossdk.io/x/distribution/testutil" disttypes "cosmossdk.io/x/distribution/types" pooltypes "cosmossdk.io/x/protocolpool/types" + addresscodec "github.com/cosmos/cosmos-sdk/codec/address" codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" diff --git a/x/auth/ante/setup.go b/x/auth/ante/setup.go index 20617d3fff77..e5d0fa54e400 100644 --- a/x/auth/ante/setup.go +++ b/x/auth/ante/setup.go @@ -53,7 +53,7 @@ func (sud SetUpContextDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, _ bool, // If there exists a maximum block gas limit, we must ensure that the tx // does not exceed it. - if maxGas > 0 && gasTx.GetGas() > uint64(maxGas) { + if maxGas > 0 && gasTx.GetGas() > maxGas { return newCtx, errorsmod.Wrapf(sdkerrors.ErrInvalidGasLimit, "tx gas limit %d exceeds block max gas %d", gasTx.GetGas(), maxGas) } diff --git a/x/staking/keeper/msg_server.go b/x/staking/keeper/msg_server.go index b1c2c5717300..980d66ffc136 100644 --- a/x/staking/keeper/msg_server.go +++ b/x/staking/keeper/msg_server.go @@ -650,6 +650,9 @@ func (k msgServer) RotateConsPubKey(ctx context.Context, msg *types.MsgRotateCon } pubkeyTypes, err := k.consensusKeeper.ValidatorPubKeyTypes(ctx) + if err != nil { + return nil, err + } pkType := pk.Type() if !slices.Contains(pubkeyTypes, pkType) { diff --git a/x/upgrade/go.mod b/x/upgrade/go.mod index 909b146ef292..6896f17740bd 100644 --- a/x/upgrade/go.mod +++ b/x/upgrade/go.mod @@ -18,6 +18,7 @@ require ( github.com/cosmos/cosmos-proto v1.0.0-beta.5 github.com/cosmos/cosmos-sdk v0.53.0 github.com/cosmos/gogoproto v1.7.0 + github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.4 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/hashicorp/go-cleanhttp v0.5.2 @@ -97,7 +98,6 @@ require ( github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/glog v1.2.1 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/golang/mock v1.6.0 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/btree v1.1.2 // indirect github.com/google/flatbuffers v2.0.8+incompatible // indirect From 7d78fca23bf0ba3d983f8cafd5553ef817010ba6 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Fri, 30 Aug 2024 15:41:49 +0200 Subject: [PATCH 11/23] revert abci removal --- x/consensus/types/msgs.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/consensus/types/msgs.go b/x/consensus/types/msgs.go index 942d5ba2f4ec..1908fd77cce2 100644 --- a/x/consensus/types/msgs.go +++ b/x/consensus/types/msgs.go @@ -16,7 +16,7 @@ func (msg MsgUpdateParams) ToProtoConsensusParams() (cmtproto.ConsensusParams, e return cmtproto.ConsensusParams{}, errors.New("all parameters must be present") } - if msg.Feature != nil && msg.Feature.VoteExtensionsEnableHeight != nil { + if msg.Abci != nil && msg.Feature != nil && msg.Feature.VoteExtensionsEnableHeight != nil { return cmtproto.ConsensusParams{}, errors.New("abci in sections Feature and (deprecated) ABCI cannot be used simultaneously") } From 7affd64eb6ea0e69aecdd370edecdcf4bc1df74a Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Fri, 30 Aug 2024 15:48:03 +0200 Subject: [PATCH 12/23] ammend integration app testing --- .../distribution/keeper/msg_server_test.go | 10 ++++++++++ tests/integration/evidence/keeper/infraction_test.go | 9 +++++++++ tests/integration/gov/keeper/keeper_test.go | 10 ++++++++++ tests/integration/staking/keeper/common_test.go | 10 ++++++++++ .../integration/staking/keeper/deterministic_test.go | 11 +++++++++++ 5 files changed, 50 insertions(+) diff --git a/tests/integration/distribution/keeper/msg_server_test.go b/tests/integration/distribution/keeper/msg_server_test.go index b31010e6ecc1..9d42ba2945d9 100644 --- a/tests/integration/distribution/keeper/msg_server_test.go +++ b/tests/integration/distribution/keeper/msg_server_test.go @@ -36,6 +36,8 @@ import ( stakingkeeper "cosmossdk.io/x/staking/keeper" stakingtestutil "cosmossdk.io/x/staking/testutil" stakingtypes "cosmossdk.io/x/staking/types" + cmttypes "github.com/cometbft/cometbft/types" + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" @@ -186,6 +188,14 @@ func initFixture(t *testing.T) *fixture { grpcRouter, ) + integrationApp.BaseApp.SetParamStore(consensusParamsKeeper.ParamsStore) + + params := cmttypes.ConsensusParamsFromProto(*simtestutil.DefaultConsensusParams) // This fills up missing param sections + err := consensusParamsKeeper.ParamsStore.Set(integrationApp.Context(), params.ToProto()) + if err != nil { + panic(fmt.Errorf("failed to set consensus params: %w", err)) + } + sdkCtx := sdk.UnwrapSDKContext(integrationApp.Context()) // Register MsgServer and QueryServer diff --git a/tests/integration/evidence/keeper/infraction_test.go b/tests/integration/evidence/keeper/infraction_test.go index b51fc00e869c..845e09ea805d 100644 --- a/tests/integration/evidence/keeper/infraction_test.go +++ b/tests/integration/evidence/keeper/infraction_test.go @@ -42,6 +42,7 @@ import ( stakingkeeper "cosmossdk.io/x/staking/keeper" stakingtestutil "cosmossdk.io/x/staking/testutil" stakingtypes "cosmossdk.io/x/staking/types" + cmttypes "github.com/cometbft/cometbft/types" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" @@ -181,6 +182,14 @@ func initFixture(tb testing.TB) *fixture { grpcQueryRouter, ) + integrationApp.BaseApp.SetParamStore(consensusParamsKeeper.ParamsStore) + + params := cmttypes.ConsensusParamsFromProto(*simtestutil.DefaultConsensusParams) // This fills up missing param sections + err := consensusParamsKeeper.ParamsStore.Set(integrationApp.Context(), params.ToProto()) + if err != nil { + panic(fmt.Errorf("failed to set consensus params: %w", err)) + } + sdkCtx := sdk.UnwrapSDKContext(integrationApp.Context()) // Register MsgServer and QueryServer diff --git a/tests/integration/gov/keeper/keeper_test.go b/tests/integration/gov/keeper/keeper_test.go index a58124947a45..478d0bae212f 100644 --- a/tests/integration/gov/keeper/keeper_test.go +++ b/tests/integration/gov/keeper/keeper_test.go @@ -2,6 +2,7 @@ package keeper_test import ( "context" + "fmt" "testing" "github.com/golang/mock/gomock" @@ -32,6 +33,8 @@ import ( "cosmossdk.io/x/staking" stakingkeeper "cosmossdk.io/x/staking/keeper" stakingtypes "cosmossdk.io/x/staking/types" + cmttypes "github.com/cometbft/cometbft/types" + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" "github.com/cosmos/cosmos-sdk/baseapp" addresscodec "github.com/cosmos/cosmos-sdk/codec/address" @@ -167,6 +170,13 @@ func initFixture(tb testing.TB) *fixture { baseapp.NewGRPCQueryRouter(), ) + integrationApp.BaseApp.SetParamStore(consensusParamsKeeper.ParamsStore) + + params := cmttypes.ConsensusParamsFromProto(*simtestutil.DefaultConsensusParams) // This fills up missing param sections + if err := consensusParamsKeeper.ParamsStore.Set(integrationApp.Context(), params.ToProto()); err != nil { + panic(fmt.Errorf("failed to set consensus params: %w", err)) + } + sdkCtx := sdk.UnwrapSDKContext(integrationApp.Context()) msgSrvr := keeper.NewMsgServerImpl(govKeeper) diff --git a/tests/integration/staking/keeper/common_test.go b/tests/integration/staking/keeper/common_test.go index 76db9f74e244..1fdb95868d75 100644 --- a/tests/integration/staking/keeper/common_test.go +++ b/tests/integration/staking/keeper/common_test.go @@ -2,6 +2,7 @@ package keeper_test import ( "context" + "fmt" "math/big" "testing" @@ -29,6 +30,7 @@ import ( stakingkeeper "cosmossdk.io/x/staking/keeper" "cosmossdk.io/x/staking/testutil" "cosmossdk.io/x/staking/types" + cmttypes "github.com/cometbft/cometbft/types" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" @@ -186,6 +188,14 @@ func initFixture(tb testing.TB) *fixture { queryRouter, ) + integrationApp.BaseApp.SetParamStore(consensusParamsKeeper.ParamsStore) + + params := cmttypes.ConsensusParamsFromProto(*simtestutil.DefaultConsensusParams) // This fills up missing param sections + err := consensusParamsKeeper.ParamsStore.Set(integrationApp.Context(), params.ToProto()) + if err != nil { + panic(fmt.Errorf("failed to set consensus params: %w", err)) + } + sdkCtx := sdk.UnwrapSDKContext(integrationApp.Context()) // Register MsgServer and QueryServer diff --git a/tests/integration/staking/keeper/deterministic_test.go b/tests/integration/staking/keeper/deterministic_test.go index 28886d981131..a25abe947b18 100644 --- a/tests/integration/staking/keeper/deterministic_test.go +++ b/tests/integration/staking/keeper/deterministic_test.go @@ -2,6 +2,7 @@ package keeper_test import ( "context" + "fmt" "testing" "time" @@ -30,6 +31,7 @@ import ( "cosmossdk.io/x/staking" stakingkeeper "cosmossdk.io/x/staking/keeper" stakingtypes "cosmossdk.io/x/staking/types" + cmttypes "github.com/cometbft/cometbft/types" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" @@ -39,6 +41,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" "github.com/cosmos/cosmos-sdk/runtime" "github.com/cosmos/cosmos-sdk/testutil/integration" + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" @@ -151,6 +154,14 @@ func initDeterministicFixture(t *testing.T) *deterministicFixture { ctx := integrationApp.Context() + integrationApp.BaseApp.SetParamStore(consensusParamsKeeper.ParamsStore) + + params := cmttypes.ConsensusParamsFromProto(*simtestutil.DefaultConsensusParams) // This fills up missing param sections + err := consensusParamsKeeper.ParamsStore.Set(integrationApp.Context(), params.ToProto()) + if err != nil { + panic(fmt.Errorf("failed to set consensus params: %w", err)) + } + // Register MsgServer and QueryServer stakingtypes.RegisterMsgServer(integrationApp.MsgServiceRouter(), stakingkeeper.NewMsgServerImpl(stakingKeeper)) stakingtypes.RegisterQueryServer(integrationApp.QueryHelper(), stakingkeeper.NewQuerier(stakingKeeper)) From bb29c4f70a412dde855ee1e00a5cbdb46cd5208e Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Fri, 30 Aug 2024 15:48:38 +0200 Subject: [PATCH 13/23] cleanup router --- testutil/integration/router.go | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/testutil/integration/router.go b/testutil/integration/router.go index f56c04ed5266..b35a26e0aadb 100644 --- a/testutil/integration/router.go +++ b/testutil/integration/router.go @@ -6,7 +6,6 @@ import ( cmtabcitypes "github.com/cometbft/cometbft/api/cometbft/abci/v1" cmtproto "github.com/cometbft/cometbft/api/cometbft/types/v1" - cmttypes "github.com/cometbft/cometbft/types" dbm "github.com/cosmos/cosmos-db" "cosmossdk.io/core/address" @@ -88,18 +87,6 @@ func NewIntegrationApp( bApp.SetGRPCQueryRouter(grpcRouter) if keys[consensus] != nil { - // set baseApp param store - consensusParamsKeeper, ok := modules[consensus].(baseapp.ParamStore) - if ok { - bApp.SetParamStore(consensusParamsKeeper) - - params := cmttypes.ConsensusParamsFromProto(*simtestutil.DefaultConsensusParams) // This fills up missing param sections - err := consensusParamsKeeper.Set(sdkCtx, params.ToProto()) - if err != nil { - panic(fmt.Errorf("failed to set consensus params: %w", err)) - } - } - if err := bApp.LoadLatestVersion(); err != nil { panic(fmt.Errorf("failed to load application version from store: %w", err)) } From 2f65a5326ac5c8fc018f26b87f225b27e3169117 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Fri, 30 Aug 2024 16:09:49 +0200 Subject: [PATCH 14/23] nil checks --- x/consensus/keeper/keeper.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/x/consensus/keeper/keeper.go b/x/consensus/keeper/keeper.go index c54a13f7994a..13d781a61670 100644 --- a/x/consensus/keeper/keeper.go +++ b/x/consensus/keeper/keeper.go @@ -147,6 +147,9 @@ func (k Keeper) BlockGas(ctx context.Context) (uint64, error) { if err != nil { return 0, err } + if params.Block == nil { + return 0, nil + } return uint64(params.Block.MaxGas), nil } @@ -158,6 +161,10 @@ func (k Keeper) AppVersion(ctx context.Context) (uint64, error) { return 0, err } + if params.Version == nil { + return 0, nil + } + return params.Version.App, nil } @@ -168,6 +175,10 @@ func (k Keeper) ValidatorPubKeyTypes(ctx context.Context) ([]string, error) { return nil, err } + if params.Validator == nil { + return []string{}, nil + } + return params.Validator.PubKeyTypes, nil } @@ -177,6 +188,9 @@ func (k Keeper) EvidenceAge(ctx context.Context) (int64, time.Duration, error) { if err != nil { return 0, 0, err } + if params.Evidence == nil { + return 0, 0, nil + } return params.Evidence.MaxAgeNumBlocks, params.Evidence.MaxAgeDuration, nil } From 7b0e9059b5702758d84ecb37fdc9cefc698fa962 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Fri, 30 Aug 2024 16:13:18 +0200 Subject: [PATCH 15/23] nil checks --- x/auth/ante/setup.go | 2 -- x/consensus/keeper/keeper.go | 8 ++++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/x/auth/ante/setup.go b/x/auth/ante/setup.go index e5d0fa54e400..7cbb3f116bb2 100644 --- a/x/auth/ante/setup.go +++ b/x/auth/ante/setup.go @@ -51,8 +51,6 @@ func (sud SetUpContextDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, _ bool, return newCtx, err } - // If there exists a maximum block gas limit, we must ensure that the tx - // does not exceed it. if maxGas > 0 && gasTx.GetGas() > maxGas { return newCtx, errorsmod.Wrapf(sdkerrors.ErrInvalidGasLimit, "tx gas limit %d exceeds block max gas %d", gasTx.GetGas(), maxGas) } diff --git a/x/consensus/keeper/keeper.go b/x/consensus/keeper/keeper.go index 13d781a61670..bdff4e7eaff1 100644 --- a/x/consensus/keeper/keeper.go +++ b/x/consensus/keeper/keeper.go @@ -148,7 +148,7 @@ func (k Keeper) BlockGas(ctx context.Context) (uint64, error) { return 0, err } if params.Block == nil { - return 0, nil + return 0, errors.New("block gas is nil") } return uint64(params.Block.MaxGas), nil @@ -162,7 +162,7 @@ func (k Keeper) AppVersion(ctx context.Context) (uint64, error) { } if params.Version == nil { - return 0, nil + return 0, errors.New("app version is nil") } return params.Version.App, nil @@ -176,7 +176,7 @@ func (k Keeper) ValidatorPubKeyTypes(ctx context.Context) ([]string, error) { } if params.Validator == nil { - return []string{}, nil + return []string{}, errors.New("validator pub key types is nil") } return params.Validator.PubKeyTypes, nil @@ -189,7 +189,7 @@ func (k Keeper) EvidenceAge(ctx context.Context) (int64, time.Duration, error) { return 0, 0, err } if params.Evidence == nil { - return 0, 0, nil + return 0, 0, errors.New("evidence age is nil") } return params.Evidence.MaxAgeNumBlocks, params.Evidence.MaxAgeDuration, nil From 83b56f6768cc24fc166f5188480e65ed9026f1aa Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Fri, 30 Aug 2024 17:08:47 +0200 Subject: [PATCH 16/23] better handling --- x/auth/ante/expected_keepers.go | 2 +- x/auth/ante/setup.go | 2 +- .../ante/testutil/expected_keepers_mocks.go | 17 ++++++++-------- x/auth/ante/testutil_test.go | 2 +- x/consensus/keeper/keeper.go | 20 +++++++++---------- x/evidence/keeper/infraction.go | 2 +- x/evidence/testutil/expected_keepers_mocks.go | 17 ++++++++-------- x/evidence/types/expected_keepers.go | 2 +- 8 files changed, 33 insertions(+), 31 deletions(-) diff --git a/x/auth/ante/expected_keepers.go b/x/auth/ante/expected_keepers.go index 4f4fc28d8f9f..ef826a91d930 100644 --- a/x/auth/ante/expected_keepers.go +++ b/x/auth/ante/expected_keepers.go @@ -28,5 +28,5 @@ type FeegrantKeeper interface { } type ConsensusKeeper interface { - BlockGas(context.Context) (uint64, error) + BlockParams(context.Context) (uint64, uint64, error) } diff --git a/x/auth/ante/setup.go b/x/auth/ante/setup.go index 7cbb3f116bb2..f61f585e1391 100644 --- a/x/auth/ante/setup.go +++ b/x/auth/ante/setup.go @@ -46,7 +46,7 @@ func (sud SetUpContextDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, _ bool, newCtx = SetGasMeter(ctx, gasTx.GetGas()) - maxGas, err := sud.consensusKeeper.BlockGas(ctx) + maxGas, _, err := sud.consensusKeeper.BlockParams(ctx) if err != nil { return newCtx, err } diff --git a/x/auth/ante/testutil/expected_keepers_mocks.go b/x/auth/ante/testutil/expected_keepers_mocks.go index e087b2a45044..08bb6423d450 100644 --- a/x/auth/ante/testutil/expected_keepers_mocks.go +++ b/x/auth/ante/testutil/expected_keepers_mocks.go @@ -194,17 +194,18 @@ func (m *MockConsensusKeeper) EXPECT() *MockConsensusKeeperMockRecorder { return m.recorder } -// BlockGas mocks base method. -func (m *MockConsensusKeeper) BlockGas(arg0 context.Context) (uint64, error) { +// BlockParams mocks base method. +func (m *MockConsensusKeeper) BlockParams(arg0 context.Context) (uint64, uint64, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "BlockGas", arg0) + ret := m.ctrl.Call(m, "BlockParams", arg0) ret0, _ := ret[0].(uint64) - ret1, _ := ret[1].(error) - return ret0, ret1 + ret1, _ := ret[1].(uint64) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 } -// BlockGas indicates an expected call of BlockGas. -func (mr *MockConsensusKeeperMockRecorder) BlockGas(arg0 interface{}) *gomock.Call { +// BlockParams indicates an expected call of BlockParams. +func (mr *MockConsensusKeeperMockRecorder) BlockParams(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BlockGas", reflect.TypeOf((*MockConsensusKeeper)(nil).BlockGas), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BlockParams", reflect.TypeOf((*MockConsensusKeeper)(nil).BlockParams), arg0) } diff --git a/x/auth/ante/testutil_test.go b/x/auth/ante/testutil_test.go index 40a43531f2b1..ab75b091011f 100644 --- a/x/auth/ante/testutil_test.go +++ b/x/auth/ante/testutil_test.go @@ -100,7 +100,7 @@ func SetupTestSuite(t *testing.T, isCheckTx bool) *AnteTestSuite { grpcQueryRouter.SetInterfaceRegistry(suite.encCfg.InterfaceRegistry) suite.consensusKeeper = antetestutil.NewMockConsensusKeeper(ctrl) - suite.consensusKeeper.EXPECT().BlockGas(gomock.Any()).Return(simtestutil.DefaultConsensusParams.Block.MaxGas, nil).AnyTimes() + suite.consensusKeeper.EXPECT().BlockParams(gomock.Any()).Return(simtestutil.DefaultConsensusParams.Block.MaxGas, simtestutil.DefaultConsensusParams.Block.MaxBytes, nil).AnyTimes() suite.env = runtime.NewEnvironment(runtime.NewKVStoreService(key), coretesting.NewNopLogger(), runtime.EnvWithQueryRouterService(grpcQueryRouter), runtime.EnvWithMsgRouterService(msgRouter)) suite.accountKeeper = keeper.NewAccountKeeper( diff --git a/x/consensus/keeper/keeper.go b/x/consensus/keeper/keeper.go index bdff4e7eaff1..7910d3c7ef2b 100644 --- a/x/consensus/keeper/keeper.go +++ b/x/consensus/keeper/keeper.go @@ -141,17 +141,17 @@ func (k Keeper) paramCheck(ctx context.Context, consensusParams cmtproto.Consens return &nextParams, nil } -// BlockGas returns the maximum gas allowed in a block. -func (k Keeper) BlockGas(ctx context.Context) (uint64, error) { +// BlockParams returns the maximum gas allowed in a block and the maximum bytes allowed in a block. +func (k Keeper) BlockParams(ctx context.Context) (uint64, uint64, error) { params, err := k.ParamsStore.Get(ctx) if err != nil { - return 0, err + return 0, 0, err } if params.Block == nil { - return 0, errors.New("block gas is nil") + return 0, 0, errors.New("block gas is nil") } - return uint64(params.Block.MaxGas), nil + return uint64(params.Block.MaxGas), uint64(params.Block.MaxBytes), nil } // AppVersion returns the current application version. @@ -182,15 +182,15 @@ func (k Keeper) ValidatorPubKeyTypes(ctx context.Context) ([]string, error) { return params.Validator.PubKeyTypes, nil } -// EvidenceAge returns the maximum age of evidence and the time duration of the maximum age. -func (k Keeper) EvidenceAge(ctx context.Context) (int64, time.Duration, error) { +// EvidenceParams returns the maximum age of evidence, the time duration of the maximum age, and the maximum bytes. +func (k Keeper) EvidenceParams(ctx context.Context) (int64, time.Duration, uint64, error) { params, err := k.ParamsStore.Get(ctx) if err != nil { - return 0, 0, err + return 0, 0, 0, err } if params.Evidence == nil { - return 0, 0, errors.New("evidence age is nil") + return 0, 0, 0, errors.New("evidence age is nil") } - return params.Evidence.MaxAgeNumBlocks, params.Evidence.MaxAgeDuration, nil + return params.Evidence.MaxAgeNumBlocks, params.Evidence.MaxAgeDuration, uint64(params.Evidence.MaxBytes), nil } diff --git a/x/evidence/keeper/infraction.go b/x/evidence/keeper/infraction.go index 354c81de600e..970cac544acc 100644 --- a/x/evidence/keeper/infraction.go +++ b/x/evidence/keeper/infraction.go @@ -73,7 +73,7 @@ func (k Keeper) handleEquivocationEvidence(ctx context.Context, evidence *types. // if the difference in time and number of blocks is greater than the allowed // parameters defined. - eviAgeBlocks, eviAgeDuration, err := k.consensusKeeper.EvidenceAge(ctx) + eviAgeBlocks, eviAgeDuration, _, err := k.consensusKeeper.EvidenceParams(ctx) if err != nil { return err } diff --git a/x/evidence/testutil/expected_keepers_mocks.go b/x/evidence/testutil/expected_keepers_mocks.go index 5922b6f22fb2..eb6c0f2785ad 100644 --- a/x/evidence/testutil/expected_keepers_mocks.go +++ b/x/evidence/testutil/expected_keepers_mocks.go @@ -278,18 +278,19 @@ func (m *MockConsensusKeeper) EXPECT() *MockConsensusKeeperMockRecorder { return m.recorder } -// EvidenceAge mocks base method. -func (m *MockConsensusKeeper) EvidenceAge(arg0 context.Context) (int64, time.Duration, error) { +// EvidenceParams mocks base method. +func (m *MockConsensusKeeper) EvidenceParams(arg0 context.Context) (int64, time.Duration, uint64, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "EvidenceAge", arg0) + ret := m.ctrl.Call(m, "EvidenceParams", arg0) ret0, _ := ret[0].(int64) ret1, _ := ret[1].(time.Duration) - ret2, _ := ret[2].(error) - return ret0, ret1, ret2 + ret2, _ := ret[2].(uint64) + ret3, _ := ret[3].(error) + return ret0, ret1, ret2, ret3 } -// EvidenceAge indicates an expected call of EvidenceAge. -func (mr *MockConsensusKeeperMockRecorder) EvidenceAge(arg0 interface{}) *gomock.Call { +// EvidenceParams indicates an expected call of EvidenceParams. +func (mr *MockConsensusKeeperMockRecorder) EvidenceParams(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EvidenceAge", reflect.TypeOf((*MockConsensusKeeper)(nil).EvidenceAge), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EvidenceParams", reflect.TypeOf((*MockConsensusKeeper)(nil).EvidenceParams), arg0) } diff --git a/x/evidence/types/expected_keepers.go b/x/evidence/types/expected_keepers.go index eccbf90758ec..a7ecdaf2ca38 100644 --- a/x/evidence/types/expected_keepers.go +++ b/x/evidence/types/expected_keepers.go @@ -39,5 +39,5 @@ type AccountKeeper interface { } type ConsensusKeeper interface { - EvidenceAge(context.Context) (int64, time.Duration, error) + EvidenceParams(context.Context) (maxAge int64, maxAgeDuration time.Duration, maxBytes uint64, err error) } From fa0e8813929865e7ce4ef186a32ba86b5e54f8e6 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Tue, 3 Sep 2024 14:45:43 +0200 Subject: [PATCH 17/23] fix tests --- x/consensus/types/msgs.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/x/consensus/types/msgs.go b/x/consensus/types/msgs.go index 1908fd77cce2..f6556cc28dbb 100644 --- a/x/consensus/types/msgs.go +++ b/x/consensus/types/msgs.go @@ -38,12 +38,14 @@ func (msg MsgUpdateParams) ToProtoConsensusParams() (cmtproto.ConsensusParams, e Synchrony: msg.Synchrony, } - if cp.Feature == nil { - cp.Feature = &cmtproto.FeatureParams{} - } - - cp.Feature.VoteExtensionsEnableHeight = &types.Int64Value{ - Value: msg.Abci.VoteExtensionsEnableHeight, + if msg.Abci != nil { + if cp.Feature == nil { + cp.Feature = &cmtproto.FeatureParams{} + } + + cp.Feature.VoteExtensionsEnableHeight = &types.Int64Value{ + Value: msg.Abci.VoteExtensionsEnableHeight, + } } return cp, nil From 3e8e2b88cfc772088c58b215b24cbc995dee3994 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Tue, 10 Sep 2024 11:37:51 +0200 Subject: [PATCH 18/23] fix unit tests --- server/v2/testdata/app.toml | 38 +++-------------------------- x/auth/ante/ante_test.go | 1 + x/auth/ante/testutil_test.go | 3 ++- x/staking/keeper/keeper_test.go | 3 +++ x/upgrade/keeper/abci_test.go | 8 +++--- x/upgrade/keeper/grpc_query_test.go | 3 ++- 6 files changed, 17 insertions(+), 39 deletions(-) diff --git a/server/v2/testdata/app.toml b/server/v2/testdata/app.toml index 192dc8d67865..3d54aca93fbd 100644 --- a/server/v2/testdata/app.toml +++ b/server/v2/testdata/app.toml @@ -10,42 +10,12 @@ max-recv-msg-size = 10485760 # The default value is math.MaxInt32. max-send-msg-size = 2147483647 -[server] -# minimum-gas-prices defines the price which a validator is willing to accept for processing a transaction. A transaction's fees must meet the minimum of any denomination specified in this config (e.g. 0.25token1;0.0001token2). -minimum-gas-prices = '0stake' - -[store] -# The type of database for application and snapshots databases. -app-db-backend = 'goleveldb' - -[store.options] -# State storage database type. Currently we support: 0 for SQLite, 1 for Pebble -ss-type = 0 -# State commitment database type. Currently we support:0 for iavl, 1 for iavl v2 -sc-type = 0 - -# Pruning options for state storage -[store.options.ss-pruning-option] -# Number of recent heights to keep on disk. -keep-recent = 2 -# Height interval at which pruned heights are removed from disk. -interval = 100 - -# Pruning options for state commitment -[store.options.sc-pruning-option] -# Number of recent heights to keep on disk. -keep-recent = 2 -# Height interval at which pruned heights are removed from disk. -interval = 100 - -[store.options.iavl-config] -# CacheSize set the size of the iavl tree cache. -cache-size = 100000 -# If true, the tree will work like no fast storage and always not upgrade fast storage. -skip-fast-storage-upgrade = true - [mock-server-1] # Mock field mock_field = 'default' # Mock field two mock_field_two = 1 + +[server] +# minimum-gas-prices defines the price which a validator is willing to accept for processing a transaction. A transaction's fees must meet the minimum of any denomination specified in this config (e.g. 0.25token1;0.0001token2). +minimum-gas-prices = '0stake' diff --git a/x/auth/ante/ante_test.go b/x/auth/ante/ante_test.go index 638f6623b171..fbc4491b9091 100644 --- a/x/auth/ante/ante_test.go +++ b/x/auth/ante/ante_test.go @@ -1249,6 +1249,7 @@ func TestCustomSignatureVerificationGasConsumer(t *testing.T) { ante.HandlerOptions{ AccountKeeper: suite.accountKeeper, BankKeeper: suite.bankKeeper, + ConsensusKeeper: suite.consensusKeeper, FeegrantKeeper: suite.feeGrantKeeper, SignModeHandler: suite.clientCtx.TxConfig.SignModeHandler(), SigGasConsumer: func(meter gas.Meter, sig signing.SignatureV2, params authtypes.Params) error { diff --git a/x/auth/ante/testutil_test.go b/x/auth/ante/testutil_test.go index 2f11fc8cbeba..b82d2429d3ea 100644 --- a/x/auth/ante/testutil_test.go +++ b/x/auth/ante/testutil_test.go @@ -100,7 +100,7 @@ func SetupTestSuite(t *testing.T, isCheckTx bool) *AnteTestSuite { grpcQueryRouter.SetInterfaceRegistry(suite.encCfg.InterfaceRegistry) suite.consensusKeeper = antetestutil.NewMockConsensusKeeper(ctrl) - suite.consensusKeeper.EXPECT().BlockParams(gomock.Any()).Return(simtestutil.DefaultConsensusParams.Block.MaxGas, simtestutil.DefaultConsensusParams.Block.MaxBytes, nil).AnyTimes() + suite.consensusKeeper.EXPECT().BlockParams(gomock.Any()).Return(uint64(simtestutil.DefaultConsensusParams.Block.MaxGas), uint64(simtestutil.DefaultConsensusParams.Block.MaxBytes), nil).AnyTimes() suite.env = runtime.NewEnvironment(runtime.NewKVStoreService(key), coretesting.NewNopLogger(), runtime.EnvWithQueryRouterService(grpcQueryRouter), runtime.EnvWithMsgRouterService(msgRouter)) suite.accountKeeper = keeper.NewAccountKeeper( @@ -123,6 +123,7 @@ func SetupTestSuite(t *testing.T, isCheckTx bool) *AnteTestSuite { ante.HandlerOptions{ AccountKeeper: suite.accountKeeper, BankKeeper: suite.bankKeeper, + ConsensusKeeper: suite.consensusKeeper, FeegrantKeeper: suite.feeGrantKeeper, SignModeHandler: suite.encCfg.TxConfig.SignModeHandler(), SigGasConsumer: ante.DefaultSigVerificationGasConsumer, diff --git a/x/staking/keeper/keeper_test.go b/x/staking/keeper/keeper_test.go index 928fb8b5ab94..92561bc6e7f3 100644 --- a/x/staking/keeper/keeper_test.go +++ b/x/staking/keeper/keeper_test.go @@ -81,6 +81,7 @@ func (s *KeeperTestSuite) SetupTest() { // create consensus keeper ck := stakingtestutil.NewMockConsensusKeeper(ctrl) ck.EXPECT().ValidatorPubKeyTypes(gomock.Any()).Return(simtestutil.DefaultConsensusParams.Validator.PubKeyTypes, nil).AnyTimes() + queryHelper := baseapp.NewQueryServerTestHelper(ctx, encCfg.InterfaceRegistry) bankKeeper := stakingtestutil.NewMockBankKeeper(ctrl) env := runtime.NewEnvironment(storeService, coretesting.NewNopLogger(), runtime.EnvWithMsgRouterService(s.baseApp.MsgServiceRouter())) @@ -105,6 +106,8 @@ func (s *KeeperTestSuite) SetupTest() { s.accountKeeper = accountKeeper stakingtypes.RegisterInterfaces(encCfg.InterfaceRegistry) + stakingtypes.RegisterQueryServer(queryHelper, stakingkeeper.Querier{Keeper: keeper}) + s.queryClient = stakingtypes.NewQueryClient(queryHelper) s.msgServer = stakingkeeper.NewMsgServerImpl(keeper) } diff --git a/x/upgrade/keeper/abci_test.go b/x/upgrade/keeper/abci_test.go index 0f8e76a4059f..8838abbd469b 100644 --- a/x/upgrade/keeper/abci_test.go +++ b/x/upgrade/keeper/abci_test.go @@ -141,8 +141,8 @@ func setupTest(t *testing.T, height int64, skip map[int64]bool) *TestSuite { require.NoError(t, err) ctrl := gomock.NewController(t) - - s.keeper = keeper.NewKeeper(s.env, skip, s.encCfg.Codec, t.TempDir(), s.baseApp, authority, upgradetestutil.NewMockConsensusKeeper(ctrl)) + ck := upgradetestutil.NewMockConsensusKeeper(ctrl) + s.keeper = keeper.NewKeeper(s.env, skip, s.encCfg.Codec, t.TempDir(), s.baseApp, authority, ck) s.ctx = testCtx.Ctx.WithHeaderInfo(header.Info{Time: time.Now(), Height: height}) @@ -535,7 +535,9 @@ func TestDowngradeVerification(t *testing.T) { ctrl := gomock.NewController(t) // downgrade. now keeper does not have the handler. - k := keeper.NewKeeper(s.env, map[int64]bool{}, s.encCfg.Codec, t.TempDir(), nil, authority, upgradetestutil.NewMockConsensusKeeper(ctrl)) + ck := upgradetestutil.NewMockConsensusKeeper(ctrl) + ck.EXPECT().AppVersion(gomock.Any()).Return(uint64(0), nil).AnyTimes() + k := keeper.NewKeeper(s.env, map[int64]bool{}, s.encCfg.Codec, t.TempDir(), nil, authority, ck) m := upgrade.NewAppModule(k) // assertions diff --git a/x/upgrade/keeper/grpc_query_test.go b/x/upgrade/keeper/grpc_query_test.go index b8becea594d1..2f799677273f 100644 --- a/x/upgrade/keeper/grpc_query_test.go +++ b/x/upgrade/keeper/grpc_query_test.go @@ -50,7 +50,8 @@ func (suite *UpgradeTestSuite) SetupTest() { suite.Require().NoError(err) suite.encodedAuthority = authority ctrl := gomock.NewController(suite.T()) - suite.upgradeKeeper = keeper.NewKeeper(env, skipUpgradeHeights, suite.encCfg.Codec, suite.T().TempDir(), nil, authority, upgradetestutil.NewMockConsensusKeeper(ctrl)) + ck := upgradetestutil.NewMockConsensusKeeper(ctrl) + suite.upgradeKeeper = keeper.NewKeeper(env, skipUpgradeHeights, suite.encCfg.Codec, suite.T().TempDir(), nil, authority, ck) err = suite.upgradeKeeper.SetModuleVersionMap(suite.ctx, appmodule.VersionMap{ "bank": 0, }) From 1aa27a586eabbd84d0fa8b0c240509746199a486 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Tue, 10 Sep 2024 12:38:10 +0200 Subject: [PATCH 19/23] fix integration tests --- .../distribution/keeper/msg_server_test.go | 10 ------ .../evidence/keeper/infraction_test.go | 9 ----- tests/integration/gov/keeper/keeper_test.go | 10 ------ .../integration/staking/keeper/common_test.go | 10 ------ .../staking/keeper/deterministic_test.go | 11 ------ testutil/integration/router.go | 36 +++++++++++++++++++ x/auth/tx/config/depinject.go | 2 ++ 7 files changed, 38 insertions(+), 50 deletions(-) diff --git a/tests/integration/distribution/keeper/msg_server_test.go b/tests/integration/distribution/keeper/msg_server_test.go index 38cbc408f1f4..a7be5653566a 100644 --- a/tests/integration/distribution/keeper/msg_server_test.go +++ b/tests/integration/distribution/keeper/msg_server_test.go @@ -31,8 +31,6 @@ import ( stakingkeeper "cosmossdk.io/x/staking/keeper" stakingtestutil "cosmossdk.io/x/staking/testutil" stakingtypes "cosmossdk.io/x/staking/types" - cmttypes "github.com/cometbft/cometbft/types" - simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" @@ -188,14 +186,6 @@ func initFixture(t *testing.T) *fixture { grpcRouter, ) - integrationApp.BaseApp.SetParamStore(consensusParamsKeeper.ParamsStore) - - params := cmttypes.ConsensusParamsFromProto(*simtestutil.DefaultConsensusParams) // This fills up missing param sections - err := consensusParamsKeeper.ParamsStore.Set(integrationApp.Context(), params.ToProto()) - if err != nil { - panic(fmt.Errorf("failed to set consensus params: %w", err)) - } - sdkCtx := sdk.UnwrapSDKContext(integrationApp.Context()) // Register MsgServer and QueryServer diff --git a/tests/integration/evidence/keeper/infraction_test.go b/tests/integration/evidence/keeper/infraction_test.go index e140f5540dfb..b666bd3fcb5b 100644 --- a/tests/integration/evidence/keeper/infraction_test.go +++ b/tests/integration/evidence/keeper/infraction_test.go @@ -37,7 +37,6 @@ import ( stakingkeeper "cosmossdk.io/x/staking/keeper" stakingtestutil "cosmossdk.io/x/staking/testutil" stakingtypes "cosmossdk.io/x/staking/types" - cmttypes "github.com/cometbft/cometbft/types" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" @@ -182,14 +181,6 @@ func initFixture(tb testing.TB) *fixture { grpcQueryRouter, ) - integrationApp.BaseApp.SetParamStore(consensusParamsKeeper.ParamsStore) - - params := cmttypes.ConsensusParamsFromProto(*simtestutil.DefaultConsensusParams) // This fills up missing param sections - err := consensusParamsKeeper.ParamsStore.Set(integrationApp.Context(), params.ToProto()) - if err != nil { - panic(fmt.Errorf("failed to set consensus params: %w", err)) - } - sdkCtx := sdk.UnwrapSDKContext(integrationApp.Context()) // Register MsgServer and QueryServer diff --git a/tests/integration/gov/keeper/keeper_test.go b/tests/integration/gov/keeper/keeper_test.go index 66caf4962543..da20fc9b2b98 100644 --- a/tests/integration/gov/keeper/keeper_test.go +++ b/tests/integration/gov/keeper/keeper_test.go @@ -2,7 +2,6 @@ package keeper_test import ( "context" - "fmt" "testing" "github.com/golang/mock/gomock" @@ -28,8 +27,6 @@ import ( "cosmossdk.io/x/staking" stakingkeeper "cosmossdk.io/x/staking/keeper" stakingtypes "cosmossdk.io/x/staking/types" - cmttypes "github.com/cometbft/cometbft/types" - simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" "github.com/cosmos/cosmos-sdk/baseapp" addresscodec "github.com/cosmos/cosmos-sdk/codec/address" @@ -170,13 +167,6 @@ func initFixture(tb testing.TB) *fixture { baseapp.NewGRPCQueryRouter(), ) - integrationApp.BaseApp.SetParamStore(consensusParamsKeeper.ParamsStore) - - params := cmttypes.ConsensusParamsFromProto(*simtestutil.DefaultConsensusParams) // This fills up missing param sections - if err := consensusParamsKeeper.ParamsStore.Set(integrationApp.Context(), params.ToProto()); err != nil { - panic(fmt.Errorf("failed to set consensus params: %w", err)) - } - sdkCtx := sdk.UnwrapSDKContext(integrationApp.Context()) msgSrvr := keeper.NewMsgServerImpl(govKeeper) diff --git a/tests/integration/staking/keeper/common_test.go b/tests/integration/staking/keeper/common_test.go index 7fa31050b1d8..26d0e217afaa 100644 --- a/tests/integration/staking/keeper/common_test.go +++ b/tests/integration/staking/keeper/common_test.go @@ -2,7 +2,6 @@ package keeper_test import ( "context" - "fmt" "math/big" "testing" @@ -25,7 +24,6 @@ import ( stakingkeeper "cosmossdk.io/x/staking/keeper" "cosmossdk.io/x/staking/testutil" "cosmossdk.io/x/staking/types" - cmttypes "github.com/cometbft/cometbft/types" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" @@ -188,14 +186,6 @@ func initFixture(tb testing.TB) *fixture { queryRouter, ) - integrationApp.BaseApp.SetParamStore(consensusParamsKeeper.ParamsStore) - - params := cmttypes.ConsensusParamsFromProto(*simtestutil.DefaultConsensusParams) // This fills up missing param sections - err := consensusParamsKeeper.ParamsStore.Set(integrationApp.Context(), params.ToProto()) - if err != nil { - panic(fmt.Errorf("failed to set consensus params: %w", err)) - } - sdkCtx := sdk.UnwrapSDKContext(integrationApp.Context()) // Register MsgServer and QueryServer diff --git a/tests/integration/staking/keeper/deterministic_test.go b/tests/integration/staking/keeper/deterministic_test.go index 7502b8f0f982..ca5f1047808d 100644 --- a/tests/integration/staking/keeper/deterministic_test.go +++ b/tests/integration/staking/keeper/deterministic_test.go @@ -2,7 +2,6 @@ package keeper_test import ( "context" - "fmt" "testing" "time" @@ -26,7 +25,6 @@ import ( "cosmossdk.io/x/staking" stakingkeeper "cosmossdk.io/x/staking/keeper" stakingtypes "cosmossdk.io/x/staking/types" - cmttypes "github.com/cometbft/cometbft/types" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" @@ -36,7 +34,6 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" "github.com/cosmos/cosmos-sdk/runtime" "github.com/cosmos/cosmos-sdk/testutil/integration" - simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" @@ -154,14 +151,6 @@ func initDeterministicFixture(t *testing.T) *deterministicFixture { ctx := integrationApp.Context() - integrationApp.BaseApp.SetParamStore(consensusParamsKeeper.ParamsStore) - - params := cmttypes.ConsensusParamsFromProto(*simtestutil.DefaultConsensusParams) // This fills up missing param sections - err := consensusParamsKeeper.ParamsStore.Set(integrationApp.Context(), params.ToProto()) - if err != nil { - panic(fmt.Errorf("failed to set consensus params: %w", err)) - } - // Register MsgServer and QueryServer stakingtypes.RegisterMsgServer(integrationApp.MsgServiceRouter(), stakingkeeper.NewMsgServerImpl(stakingKeeper)) stakingtypes.RegisterQueryServer(integrationApp.QueryHelper(), stakingkeeper.NewQuerier(stakingKeeper)) diff --git a/testutil/integration/router.go b/testutil/integration/router.go index f416028defc5..e12519490ca5 100644 --- a/testutil/integration/router.go +++ b/testutil/integration/router.go @@ -6,10 +6,13 @@ import ( cmtabcitypes "github.com/cometbft/cometbft/api/cometbft/abci/v1" cmtproto "github.com/cometbft/cometbft/api/cometbft/types/v1" + cmttypes "github.com/cometbft/cometbft/types" dbm "github.com/cosmos/cosmos-db" + "cosmossdk.io/collections" "cosmossdk.io/core/address" "cosmossdk.io/core/appmodule" + corestore "cosmossdk.io/core/store" "cosmossdk.io/log" "cosmossdk.io/store" "cosmossdk.io/store/metrics" @@ -18,6 +21,7 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/runtime" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" @@ -87,6 +91,15 @@ func NewIntegrationApp( bApp.SetGRPCQueryRouter(grpcRouter) if keys[consensus] != nil { + cps := newParamStore(runtime.NewKVStoreService(keys[consensus]), appCodec) + bApp.SetParamStore(cps) + + params := cmttypes.ConsensusParamsFromProto(*simtestutil.DefaultConsensusParams) // This fills up missing param sections + err := cps.Set(sdkCtx, params.ToProto()) + if err != nil { + panic(fmt.Errorf("failed to set consensus params: %w", err)) + } + if err := bApp.LoadLatestVersion(); err != nil { panic(fmt.Errorf("failed to load application version from store: %w", err)) } @@ -198,3 +211,26 @@ func CreateMultiStore(keys map[string]*storetypes.KVStoreKey, logger log.Logger) _ = cms.LoadLatestVersion() return cms } + +type paramStoreService struct { + ParamsStore collections.Item[cmtproto.ConsensusParams] +} + +func newParamStore(storeService corestore.KVStoreService, cdc codec.Codec) paramStoreService { + sb := collections.NewSchemaBuilder(storeService) + return paramStoreService{ + ParamsStore: collections.NewItem(sb, collections.NewPrefix("Consensus"), "params", codec.CollValue[cmtproto.ConsensusParams](cdc)), + } +} + +func (pss paramStoreService) Get(ctx context.Context) (cmtproto.ConsensusParams, error) { + return pss.ParamsStore.Get(ctx) +} + +func (pss paramStoreService) Has(ctx context.Context) (bool, error) { + return pss.ParamsStore.Has(ctx) +} + +func (pss paramStoreService) Set(ctx context.Context, cp cmtproto.ConsensusParams) error { + return pss.ParamsStore.Set(ctx, cp) +} diff --git a/x/auth/tx/config/depinject.go b/x/auth/tx/config/depinject.go index 7bd438c6767d..5efed67e2c79 100644 --- a/x/auth/tx/config/depinject.go +++ b/x/auth/tx/config/depinject.go @@ -55,6 +55,7 @@ type ModuleInputs struct { ProtoFileResolver txsigning.ProtoFileResolver Environment appmodulev2.Environment // BankKeeper is the expected bank keeper to be passed to AnteHandlers / Tx Validators + ConsensusKeeper ante.ConsensusKeeper BankKeeper authtypes.BankKeeper `optional:"true"` MetadataBankKeeper BankKeeper `optional:"true"` AccountKeeper ante.AccountKeeper `optional:"true"` @@ -200,6 +201,7 @@ func newAnteHandler(txConfig client.TxConfig, in ModuleInputs) (sdk.AnteHandler, ante.HandlerOptions{ Environment: in.Environment, AccountKeeper: in.AccountKeeper, + ConsensusKeeper: in.ConsensusKeeper, BankKeeper: in.BankKeeper, SignModeHandler: txConfig.SignModeHandler(), FeegrantKeeper: in.FeeGrantKeeper, From bd27d8929d53ba75dc3f96da4696d4c4a0eb9f31 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Tue, 10 Sep 2024 13:06:42 +0200 Subject: [PATCH 20/23] fix e2e tests --- simapp/app_di.go | 1 + x/auth/CHANGELOG.md | 1 + x/consensus/keeper/keeper.go | 2 +- x/evidence/CHANGELOG.md | 1 + x/staking/CHANGELOG.md | 1 + x/upgrade/CHANGELOG.md | 1 + 6 files changed, 6 insertions(+), 1 deletion(-) diff --git a/simapp/app_di.go b/simapp/app_di.go index e5c0d406cefc..543655c02b87 100644 --- a/simapp/app_di.go +++ b/simapp/app_di.go @@ -298,6 +298,7 @@ func (app *SimApp) setCustomAnteHandler() { ante.HandlerOptions{ AccountKeeper: app.AuthKeeper, BankKeeper: app.BankKeeper, + ConsensusKeeper: app.ConsensusParamsKeeper, SignModeHandler: app.txConfig.SignModeHandler(), FeegrantKeeper: app.FeeGrantKeeper, SigGasConsumer: ante.DefaultSigVerificationGasConsumer, diff --git a/x/auth/CHANGELOG.md b/x/auth/CHANGELOG.md index 587639c40030..2e32274153f3 100644 --- a/x/auth/CHANGELOG.md +++ b/x/auth/CHANGELOG.md @@ -53,6 +53,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [#19535](https://github.com/cosmos/cosmos-sdk/pull/19535) Remove vesting account creation when the chain is running. The accounts module is required for creating [#vesting accounts](../accounts/defaults/lockup/README.md) on a running chain. * [#19600](https://github.com/cosmos/cosmos-sdk/pull/19600) add a consensus query method to the consensus module in order for modules to query consensus for the consensus params. * [#19600](https://github.com/cosmos/cosmos-sdk/pull/21403) NewAppModule now takes in `ante.ExtensionOptionChecker`, but it's only used in server/v2 chains, so it's safe to pass in nil for the rest of the users. +* [#21480](https://github.com/cosmos/cosmos-sdk/pull/21480) ConsensusKeeper is a required keeper for ante handlers. ### Consensus Breaking Changes diff --git a/x/consensus/keeper/keeper.go b/x/consensus/keeper/keeper.go index a9a1ae5abbde..f16a5dc01a70 100644 --- a/x/consensus/keeper/keeper.go +++ b/x/consensus/keeper/keeper.go @@ -178,7 +178,7 @@ func (k Keeper) ValidatorPubKeyTypes(ctx context.Context) ([]string, error) { if err != nil { return nil, err } - + fmt.Println("keyhere") if params.Validator == nil { return []string{}, errors.New("validator pub key types is nil") } diff --git a/x/evidence/CHANGELOG.md b/x/evidence/CHANGELOG.md index cd91ad4345ac..b2e8c9d76acc 100644 --- a/x/evidence/CHANGELOG.md +++ b/x/evidence/CHANGELOG.md @@ -31,6 +31,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [#20016](https://github.com/cosmos/cosmos-sdk/pull/20016) `NewMsgSubmitEvidence` now takes a string as argument instead of an `AccAddress`. * [#19482](https://github.com/cosmos/cosmos-sdk/pull/19482) `appmodule.Environment` is passed to `NewKeeper` instead of individual services * [#19627](https://github.com/cosmos/cosmos-sdk/pull/19627) `NewAppModule` now takes in a `codec.Codec` as its first argument +* [#21480](https://github.com/cosmos/cosmos-sdk/pull/21480) ConsensusKeeper is required to be passed to the keeper. ## [v0.1.1](https://github.com/cosmos/cosmos-sdk/releases/tag/x/evidence/v0.1.1) - 2024-04-22 diff --git a/x/staking/CHANGELOG.md b/x/staking/CHANGELOG.md index 7185c83c2855..b185542abed4 100644 --- a/x/staking/CHANGELOG.md +++ b/x/staking/CHANGELOG.md @@ -96,6 +96,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [#17335](https://github.com/cosmos/cosmos-sdk/pull/17335) Remove usage of `"cosmossdk.io/x/staking/types".Infraction_*` in favour of `"cosmossdk.io/api/cosmos/staking/v1beta1".Infraction_` in order to remove dependency between modules on staking * [#20295](https://github.com/cosmos/cosmos-sdk/pull/20295) `GetValidatorByConsAddr` now returns the Cosmos SDK `cryptotypes.Pubkey` instead of `cometcrypto.Publickey`. The caller is responsible to translate the returned value to the expected type. * Remove `CmtConsPublicKey()` and `TmConsPublicKey()` from `Validator` interface and as methods on the `Validator` struct. +* [#21480](https://github.com/cosmos/cosmos-sdk/pull/21480) ConsensusKeeper is required to be passed to the keeper. ### State Breaking changes diff --git a/x/upgrade/CHANGELOG.md b/x/upgrade/CHANGELOG.md index 3b72a8e4c6bd..129782697380 100644 --- a/x/upgrade/CHANGELOG.md +++ b/x/upgrade/CHANGELOG.md @@ -33,6 +33,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [#19443](https://github.com/cosmos/cosmos-sdk/pull/19443) `NewKeeper` takes an `appmodule.Environment` instead of individual services. * [#21259](https://github.com/cosmos/cosmos-sdk/pull/21259) Upgrade has been migrated to cosrestore.StoreUpgrades. Renaming keys support has been removed from the upgrade module. +* [#21480](https://github.com/cosmos/cosmos-sdk/pull/21480) ConsensusKeeper is required to be passed to the keeper. ### State Machine Breaking From 51a3427c70bcc735b8f579828b7775760f87f97d Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Tue, 10 Sep 2024 13:24:43 +0200 Subject: [PATCH 21/23] check err is nil --- x/evidence/keeper/infraction.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/x/evidence/keeper/infraction.go b/x/evidence/keeper/infraction.go index 970cac544acc..bfb5e95ed1a8 100644 --- a/x/evidence/keeper/infraction.go +++ b/x/evidence/keeper/infraction.go @@ -74,11 +74,7 @@ func (k Keeper) handleEquivocationEvidence(ctx context.Context, evidence *types. // parameters defined. eviAgeBlocks, eviAgeDuration, _, err := k.consensusKeeper.EvidenceParams(ctx) - if err != nil { - return err - } - - if ageDuration > eviAgeDuration && ageBlocks > eviAgeBlocks { + if err == nil && ageDuration > eviAgeDuration && ageBlocks > eviAgeBlocks { k.Logger.Info( "ignored equivocation; evidence too old", "validator", consAddr, From eb800cc39024353aa72a0034e22d285c7b150214 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Tue, 10 Sep 2024 13:31:03 +0200 Subject: [PATCH 22/23] linting --- server/v2/cometbft/abci_test.go | 16 +++++++--------- server/v2/cometbft/internal/mock/mock_store.go | 3 +-- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/server/v2/cometbft/abci_test.go b/server/v2/cometbft/abci_test.go index 64b321630cc0..fc67c2aa9635 100644 --- a/server/v2/cometbft/abci_test.go +++ b/server/v2/cometbft/abci_test.go @@ -3,11 +3,18 @@ package cometbft import ( "context" "crypto/sha256" + "encoding/json" "io" "strings" "testing" "time" + abciproto "github.com/cometbft/cometbft/api/cometbft/abci/v1" + v1 "github.com/cometbft/cometbft/api/cometbft/types/v1" + "github.com/cosmos/gogoproto/proto" + gogotypes "github.com/cosmos/gogoproto/types" + "github.com/stretchr/testify/require" + appmodulev2 "cosmossdk.io/core/appmodule/v2" "cosmossdk.io/core/store" "cosmossdk.io/core/transaction" @@ -20,16 +27,7 @@ import ( "cosmossdk.io/server/v2/stf" "cosmossdk.io/server/v2/stf/branch" "cosmossdk.io/server/v2/stf/mock" - abciproto "github.com/cometbft/cometbft/api/cometbft/abci/v1" - v1 "github.com/cometbft/cometbft/api/cometbft/types/v1" - - "github.com/cosmos/gogoproto/proto" - - "encoding/json" - consensustypes "cosmossdk.io/x/consensus/types" - gogotypes "github.com/cosmos/gogoproto/types" - "github.com/stretchr/testify/require" ) var ( diff --git a/server/v2/cometbft/internal/mock/mock_store.go b/server/v2/cometbft/internal/mock/mock_store.go index dee4d8baf915..e3e7f4dc708c 100644 --- a/server/v2/cometbft/internal/mock/mock_store.go +++ b/server/v2/cometbft/internal/mock/mock_store.go @@ -6,7 +6,6 @@ import ( "cosmossdk.io/core/log" corestore "cosmossdk.io/core/store" - storev2 "cosmossdk.io/store/v2" "cosmossdk.io/store/v2/commitment" "cosmossdk.io/store/v2/commitment/iavl" @@ -17,7 +16,7 @@ import ( ) type MockStore struct { - Storage storev2.VersionedDatabase + Storage storev2.VersionedDatabase Committer storev2.Committer } From bcc7957686fa9b55b8e4c6fbd6e8f267ac947771 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Tue, 10 Sep 2024 17:21:32 +0200 Subject: [PATCH 23/23] revert appdata --- server/v2/testdata/app.toml | 38 +++++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/server/v2/testdata/app.toml b/server/v2/testdata/app.toml index 3d54aca93fbd..192dc8d67865 100644 --- a/server/v2/testdata/app.toml +++ b/server/v2/testdata/app.toml @@ -10,12 +10,42 @@ max-recv-msg-size = 10485760 # The default value is math.MaxInt32. max-send-msg-size = 2147483647 +[server] +# minimum-gas-prices defines the price which a validator is willing to accept for processing a transaction. A transaction's fees must meet the minimum of any denomination specified in this config (e.g. 0.25token1;0.0001token2). +minimum-gas-prices = '0stake' + +[store] +# The type of database for application and snapshots databases. +app-db-backend = 'goleveldb' + +[store.options] +# State storage database type. Currently we support: 0 for SQLite, 1 for Pebble +ss-type = 0 +# State commitment database type. Currently we support:0 for iavl, 1 for iavl v2 +sc-type = 0 + +# Pruning options for state storage +[store.options.ss-pruning-option] +# Number of recent heights to keep on disk. +keep-recent = 2 +# Height interval at which pruned heights are removed from disk. +interval = 100 + +# Pruning options for state commitment +[store.options.sc-pruning-option] +# Number of recent heights to keep on disk. +keep-recent = 2 +# Height interval at which pruned heights are removed from disk. +interval = 100 + +[store.options.iavl-config] +# CacheSize set the size of the iavl tree cache. +cache-size = 100000 +# If true, the tree will work like no fast storage and always not upgrade fast storage. +skip-fast-storage-upgrade = true + [mock-server-1] # Mock field mock_field = 'default' # Mock field two mock_field_two = 1 - -[server] -# minimum-gas-prices defines the price which a validator is willing to accept for processing a transaction. A transaction's fees must meet the minimum of any denomination specified in this config (e.g. 0.25token1;0.0001token2). -minimum-gas-prices = '0stake'