From bc6bf86a0c120df95c04451936d4d847bbdec3ef Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Mon, 19 Feb 2024 22:43:27 +0100 Subject: [PATCH 01/12] add proto message for consensus message --- .../consensus/v1/consensus_msg.pulsar.go | 1366 +++++++++++++++++ proto/cosmos/consensus/v1/consensus_msg.proto | 24 + x/consensus/types/consensus_msg.pb.go | 701 +++++++++ 3 files changed, 2091 insertions(+) create mode 100644 api/cosmos/consensus/v1/consensus_msg.pulsar.go create mode 100644 proto/cosmos/consensus/v1/consensus_msg.proto create mode 100644 x/consensus/types/consensus_msg.pb.go diff --git a/api/cosmos/consensus/v1/consensus_msg.pulsar.go b/api/cosmos/consensus/v1/consensus_msg.pulsar.go new file mode 100644 index 000000000000..b45687a82e0a --- /dev/null +++ b/api/cosmos/consensus/v1/consensus_msg.pulsar.go @@ -0,0 +1,1366 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package consensusv1 + +import ( + types "buf.build/gen/go/tendermint/tendermint/protocolbuffers/go/tendermint/types" + 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 ( + md_MsgParams protoreflect.MessageDescriptor + fd_MsgParams_version protoreflect.FieldDescriptor + fd_MsgParams_block protoreflect.FieldDescriptor + fd_MsgParams_evidence protoreflect.FieldDescriptor + fd_MsgParams_validator protoreflect.FieldDescriptor + fd_MsgParams_abci protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_consensus_v1_consensus_msg_proto_init() + md_MsgParams = File_cosmos_consensus_v1_consensus_msg_proto.Messages().ByName("MsgParams") + fd_MsgParams_version = md_MsgParams.Fields().ByName("version") + fd_MsgParams_block = md_MsgParams.Fields().ByName("block") + fd_MsgParams_evidence = md_MsgParams.Fields().ByName("evidence") + fd_MsgParams_validator = md_MsgParams.Fields().ByName("validator") + fd_MsgParams_abci = md_MsgParams.Fields().ByName("abci") +} + +var _ protoreflect.Message = (*fastReflection_MsgParams)(nil) + +type fastReflection_MsgParams MsgParams + +func (x *MsgParams) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgParams)(x) +} + +func (x *MsgParams) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_consensus_v1_consensus_msg_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_MsgParams_messageType fastReflection_MsgParams_messageType +var _ protoreflect.MessageType = fastReflection_MsgParams_messageType{} + +type fastReflection_MsgParams_messageType struct{} + +func (x fastReflection_MsgParams_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgParams)(nil) +} +func (x fastReflection_MsgParams_messageType) New() protoreflect.Message { + return new(fastReflection_MsgParams) +} +func (x fastReflection_MsgParams_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgParams +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgParams) Descriptor() protoreflect.MessageDescriptor { + return md_MsgParams +} + +// 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_MsgParams) Type() protoreflect.MessageType { + return _fastReflection_MsgParams_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgParams) New() protoreflect.Message { + return new(fastReflection_MsgParams) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgParams) Interface() protoreflect.ProtoMessage { + return (*MsgParams)(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_MsgParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Version != nil { + value := protoreflect.ValueOfMessage(x.Version.ProtoReflect()) + if !f(fd_MsgParams_version, value) { + return + } + } + if x.Block != nil { + value := protoreflect.ValueOfMessage(x.Block.ProtoReflect()) + if !f(fd_MsgParams_block, value) { + return + } + } + if x.Evidence != nil { + value := protoreflect.ValueOfMessage(x.Evidence.ProtoReflect()) + if !f(fd_MsgParams_evidence, value) { + return + } + } + if x.Validator != nil { + value := protoreflect.ValueOfMessage(x.Validator.ProtoReflect()) + if !f(fd_MsgParams_validator, value) { + return + } + } + if x.Abci != nil { + value := protoreflect.ValueOfMessage(x.Abci.ProtoReflect()) + if !f(fd_MsgParams_abci, 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_MsgParams) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.consensus.v1.MsgParams.version": + return x.Version != nil + case "cosmos.consensus.v1.MsgParams.block": + return x.Block != nil + case "cosmos.consensus.v1.MsgParams.evidence": + return x.Evidence != nil + case "cosmos.consensus.v1.MsgParams.validator": + return x.Validator != nil + case "cosmos.consensus.v1.MsgParams.abci": + return x.Abci != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.MsgParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.MsgParams 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_MsgParams) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.consensus.v1.MsgParams.version": + x.Version = nil + case "cosmos.consensus.v1.MsgParams.block": + x.Block = nil + case "cosmos.consensus.v1.MsgParams.evidence": + x.Evidence = nil + case "cosmos.consensus.v1.MsgParams.validator": + x.Validator = nil + case "cosmos.consensus.v1.MsgParams.abci": + x.Abci = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.MsgParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.MsgParams 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_MsgParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.consensus.v1.MsgParams.version": + value := x.Version + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.consensus.v1.MsgParams.block": + value := x.Block + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.consensus.v1.MsgParams.evidence": + value := x.Evidence + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.consensus.v1.MsgParams.validator": + value := x.Validator + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.consensus.v1.MsgParams.abci": + value := x.Abci + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.MsgParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.MsgParams 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_MsgParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.consensus.v1.MsgParams.version": + x.Version = value.Message().Interface().(*types.VersionParams) + case "cosmos.consensus.v1.MsgParams.block": + x.Block = value.Message().Interface().(*types.BlockParams) + case "cosmos.consensus.v1.MsgParams.evidence": + x.Evidence = value.Message().Interface().(*types.EvidenceParams) + case "cosmos.consensus.v1.MsgParams.validator": + x.Validator = value.Message().Interface().(*types.ValidatorParams) + case "cosmos.consensus.v1.MsgParams.abci": + x.Abci = value.Message().Interface().(*types.ABCIParams) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.MsgParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.MsgParams 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_MsgParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.consensus.v1.MsgParams.version": + if x.Version == nil { + x.Version = new(types.VersionParams) + } + return protoreflect.ValueOfMessage(x.Version.ProtoReflect()) + case "cosmos.consensus.v1.MsgParams.block": + if x.Block == nil { + x.Block = new(types.BlockParams) + } + return protoreflect.ValueOfMessage(x.Block.ProtoReflect()) + case "cosmos.consensus.v1.MsgParams.evidence": + if x.Evidence == nil { + x.Evidence = new(types.EvidenceParams) + } + return protoreflect.ValueOfMessage(x.Evidence.ProtoReflect()) + case "cosmos.consensus.v1.MsgParams.validator": + if x.Validator == nil { + x.Validator = new(types.ValidatorParams) + } + return protoreflect.ValueOfMessage(x.Validator.ProtoReflect()) + case "cosmos.consensus.v1.MsgParams.abci": + if x.Abci == nil { + x.Abci = new(types.ABCIParams) + } + return protoreflect.ValueOfMessage(x.Abci.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.MsgParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.MsgParams 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_MsgParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.consensus.v1.MsgParams.version": + m := new(types.VersionParams) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.consensus.v1.MsgParams.block": + m := new(types.BlockParams) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.consensus.v1.MsgParams.evidence": + m := new(types.EvidenceParams) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.consensus.v1.MsgParams.validator": + m := new(types.ValidatorParams) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.consensus.v1.MsgParams.abci": + m := new(types.ABCIParams) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.MsgParams")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.MsgParams 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_MsgParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.consensus.v1.MsgParams", 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_MsgParams) 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_MsgParams) 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_MsgParams) 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_MsgParams) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgParams) + 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.Version != nil { + l = options.Size(x.Version) + n += 1 + l + runtime.Sov(uint64(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.Abci != nil { + l = options.Size(x.Abci) + 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().(*MsgParams) + 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.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 { + 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.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] = 0x1a + } + 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] = 0x12 + } + 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] = 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().(*MsgParams) + 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: MsgParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgParams: 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 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 = &types.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 2: + 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 = &types.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 3: + 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 = &types.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 4: + 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 = &types.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 = &types.ABCIParams{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Abci); 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_MsgParamsResponse protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_consensus_v1_consensus_msg_proto_init() + md_MsgParamsResponse = File_cosmos_consensus_v1_consensus_msg_proto.Messages().ByName("MsgParamsResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgParamsResponse)(nil) + +type fastReflection_MsgParamsResponse MsgParamsResponse + +func (x *MsgParamsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgParamsResponse)(x) +} + +func (x *MsgParamsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_consensus_v1_consensus_msg_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_MsgParamsResponse_messageType fastReflection_MsgParamsResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgParamsResponse_messageType{} + +type fastReflection_MsgParamsResponse_messageType struct{} + +func (x fastReflection_MsgParamsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgParamsResponse)(nil) +} +func (x fastReflection_MsgParamsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgParamsResponse) +} +func (x fastReflection_MsgParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgParamsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgParamsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgParamsResponse +} + +// 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_MsgParamsResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgParamsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgParamsResponse) New() protoreflect.Message { + return new(fastReflection_MsgParamsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgParamsResponse) Interface() protoreflect.ProtoMessage { + return (*MsgParamsResponse)(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_MsgParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// 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_MsgParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.MsgParamsResponse")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.MsgParamsResponse 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_MsgParamsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.MsgParamsResponse")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.MsgParamsResponse 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_MsgParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.MsgParamsResponse")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.MsgParamsResponse 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_MsgParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.MsgParamsResponse")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.MsgParamsResponse 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_MsgParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.MsgParamsResponse")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.MsgParamsResponse 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_MsgParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.MsgParamsResponse")) + } + panic(fmt.Errorf("message cosmos.consensus.v1.MsgParamsResponse 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_MsgParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.consensus.v1.MsgParamsResponse", 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_MsgParamsResponse) 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_MsgParamsResponse) 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_MsgParamsResponse) 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_MsgParamsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgParamsResponse) + 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.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().(*MsgParamsResponse) + 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 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().(*MsgParamsResponse) + 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: MsgParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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.51 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: cosmos/consensus/v1/consensus_msg.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) +) + +// MsgUpdateParams is the Msg/UpdateParams request type. +type MsgParams struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // params defines the x/consensus parameters to be passed from comet. + // + // NOTE: All parameters must be supplied. + Version *types.VersionParams `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + Block *types.BlockParams `protobuf:"bytes,2,opt,name=block,proto3" json:"block,omitempty"` + Evidence *types.EvidenceParams `protobuf:"bytes,3,opt,name=evidence,proto3" json:"evidence,omitempty"` + Validator *types.ValidatorParams `protobuf:"bytes,4,opt,name=validator,proto3" json:"validator,omitempty"` + Abci *types.ABCIParams `protobuf:"bytes,5,opt,name=abci,proto3" json:"abci,omitempty"` +} + +func (x *MsgParams) Reset() { + *x = MsgParams{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_consensus_v1_consensus_msg_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgParams) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgParams) ProtoMessage() {} + +// Deprecated: Use MsgParams.ProtoReflect.Descriptor instead. +func (*MsgParams) Descriptor() ([]byte, []int) { + return file_cosmos_consensus_v1_consensus_msg_proto_rawDescGZIP(), []int{0} +} + +func (x *MsgParams) GetVersion() *types.VersionParams { + if x != nil { + return x.Version + } + return nil +} + +func (x *MsgParams) GetBlock() *types.BlockParams { + if x != nil { + return x.Block + } + return nil +} + +func (x *MsgParams) GetEvidence() *types.EvidenceParams { + if x != nil { + return x.Evidence + } + return nil +} + +func (x *MsgParams) GetValidator() *types.ValidatorParams { + if x != nil { + return x.Validator + } + return nil +} + +func (x *MsgParams) GetAbci() *types.ABCIParams { + if x != nil { + return x.Abci + } + return nil +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +type MsgParamsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgParamsResponse) Reset() { + *x = MsgParamsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_consensus_v1_consensus_msg_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgParamsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgParamsResponse) ProtoMessage() {} + +// Deprecated: Use MsgParamsResponse.ProtoReflect.Descriptor instead. +func (*MsgParamsResponse) Descriptor() ([]byte, []int) { + return file_cosmos_consensus_v1_consensus_msg_proto_rawDescGZIP(), []int{1} +} + +var File_cosmos_consensus_v1_consensus_msg_proto protoreflect.FileDescriptor + +var file_cosmos_consensus_v1_consensus_msg_proto_rawDesc = []byte{ + 0x0a, 0x27, 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, 0x5f, + 0x6d, 0x73, 0x67, 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, 0x1d, + 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xac, 0x02, + 0x0a, 0x09, 0x4d, 0x73, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x39, 0x0a, 0x07, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x74, + 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x07, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, + 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x3c, 0x0a, 0x08, 0x65, + 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, + 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, + 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, 0x3f, 0x0a, 0x09, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x74, + 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 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, 0x30, 0x0a, 0x04, 0x61, 0x62, + 0x63, 0x69, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, + 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x41, 0x42, 0x43, 0x49, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x04, 0x61, 0x62, 0x63, 0x69, 0x22, 0x13, 0x0a, 0x11, + 0x4d, 0x73, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x42, 0xcc, 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, 0x11, 0x43, + 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x4d, 0x73, 0x67, 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_msg_proto_rawDescOnce sync.Once + file_cosmos_consensus_v1_consensus_msg_proto_rawDescData = file_cosmos_consensus_v1_consensus_msg_proto_rawDesc +) + +func file_cosmos_consensus_v1_consensus_msg_proto_rawDescGZIP() []byte { + file_cosmos_consensus_v1_consensus_msg_proto_rawDescOnce.Do(func() { + file_cosmos_consensus_v1_consensus_msg_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_consensus_v1_consensus_msg_proto_rawDescData) + }) + return file_cosmos_consensus_v1_consensus_msg_proto_rawDescData +} + +var file_cosmos_consensus_v1_consensus_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_cosmos_consensus_v1_consensus_msg_proto_goTypes = []interface{}{ + (*MsgParams)(nil), // 0: cosmos.consensus.v1.MsgParams + (*MsgParamsResponse)(nil), // 1: cosmos.consensus.v1.MsgParamsResponse + (*types.VersionParams)(nil), // 2: tendermint.types.VersionParams + (*types.BlockParams)(nil), // 3: tendermint.types.BlockParams + (*types.EvidenceParams)(nil), // 4: tendermint.types.EvidenceParams + (*types.ValidatorParams)(nil), // 5: tendermint.types.ValidatorParams + (*types.ABCIParams)(nil), // 6: tendermint.types.ABCIParams +} +var file_cosmos_consensus_v1_consensus_msg_proto_depIdxs = []int32{ + 2, // 0: cosmos.consensus.v1.MsgParams.version:type_name -> tendermint.types.VersionParams + 3, // 1: cosmos.consensus.v1.MsgParams.block:type_name -> tendermint.types.BlockParams + 4, // 2: cosmos.consensus.v1.MsgParams.evidence:type_name -> tendermint.types.EvidenceParams + 5, // 3: cosmos.consensus.v1.MsgParams.validator:type_name -> tendermint.types.ValidatorParams + 6, // 4: cosmos.consensus.v1.MsgParams.abci:type_name -> tendermint.types.ABCIParams + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] 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_consensus_msg_proto_init() } +func file_cosmos_consensus_v1_consensus_msg_proto_init() { + if File_cosmos_consensus_v1_consensus_msg_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cosmos_consensus_v1_consensus_msg_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_consensus_v1_consensus_msg_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgParamsResponse); 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_msg_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cosmos_consensus_v1_consensus_msg_proto_goTypes, + DependencyIndexes: file_cosmos_consensus_v1_consensus_msg_proto_depIdxs, + MessageInfos: file_cosmos_consensus_v1_consensus_msg_proto_msgTypes, + }.Build() + File_cosmos_consensus_v1_consensus_msg_proto = out.File + file_cosmos_consensus_v1_consensus_msg_proto_rawDesc = nil + file_cosmos_consensus_v1_consensus_msg_proto_goTypes = nil + file_cosmos_consensus_v1_consensus_msg_proto_depIdxs = nil +} diff --git a/proto/cosmos/consensus/v1/consensus_msg.proto b/proto/cosmos/consensus/v1/consensus_msg.proto new file mode 100644 index 000000000000..6737e422d21b --- /dev/null +++ b/proto/cosmos/consensus/v1/consensus_msg.proto @@ -0,0 +1,24 @@ +// Since: cosmos-sdk 0.51 +syntax = "proto3"; +package cosmos.consensus.v1; + +import "tendermint/types/params.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/consensus/types"; + +// MsgeParams is the Msg/Params request type. This is a consensus message that is sent from cometbft. +message MsgParams { + + // params defines the x/consensus parameters to be passed from comet. + // + // NOTE: All parameters must be supplied. + tendermint.types.VersionParams version = 1; + tendermint.types.BlockParams block = 2; + tendermint.types.EvidenceParams evidence = 3; + tendermint.types.ValidatorParams validator = 4; + tendermint.types.ABCIParams abci = 5; +} + +// MsgParamsResponse defines the response structure for executing a +// MsgParams message. +message MsgParamsResponse {} diff --git a/x/consensus/types/consensus_msg.pb.go b/x/consensus/types/consensus_msg.pb.go new file mode 100644 index 000000000000..b738ed8ae112 --- /dev/null +++ b/x/consensus/types/consensus_msg.pb.go @@ -0,0 +1,701 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/consensus/v1/consensus_msg.proto + +package types + +import ( + fmt "fmt" + types "github.com/cometbft/cometbft/proto/tendermint/types" + 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 + +// MsgUpdateParams is the Msg/UpdateParams request type. +type MsgParams struct { + // params defines the x/consensus parameters to be passed from comet. + // + // NOTE: All parameters must be supplied. + Version *types.VersionParams `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + Block *types.BlockParams `protobuf:"bytes,2,opt,name=block,proto3" json:"block,omitempty"` + Evidence *types.EvidenceParams `protobuf:"bytes,3,opt,name=evidence,proto3" json:"evidence,omitempty"` + Validator *types.ValidatorParams `protobuf:"bytes,4,opt,name=validator,proto3" json:"validator,omitempty"` + Abci *types.ABCIParams `protobuf:"bytes,5,opt,name=abci,proto3" json:"abci,omitempty"` +} + +func (m *MsgParams) Reset() { *m = MsgParams{} } +func (m *MsgParams) String() string { return proto.CompactTextString(m) } +func (*MsgParams) ProtoMessage() {} +func (*MsgParams) Descriptor() ([]byte, []int) { + return fileDescriptor_d0eff3b2b2c646b0, []int{0} +} +func (m *MsgParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgParams.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 *MsgParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgParams.Merge(m, src) +} +func (m *MsgParams) XXX_Size() int { + return m.Size() +} +func (m *MsgParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgParams.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgParams proto.InternalMessageInfo + +func (m *MsgParams) GetVersion() *types.VersionParams { + if m != nil { + return m.Version + } + return nil +} + +func (m *MsgParams) GetBlock() *types.BlockParams { + if m != nil { + return m.Block + } + return nil +} + +func (m *MsgParams) GetEvidence() *types.EvidenceParams { + if m != nil { + return m.Evidence + } + return nil +} + +func (m *MsgParams) GetValidator() *types.ValidatorParams { + if m != nil { + return m.Validator + } + return nil +} + +func (m *MsgParams) GetAbci() *types.ABCIParams { + if m != nil { + return m.Abci + } + return nil +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +type MsgParamsResponse struct { +} + +func (m *MsgParamsResponse) Reset() { *m = MsgParamsResponse{} } +func (m *MsgParamsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgParamsResponse) ProtoMessage() {} +func (*MsgParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_d0eff3b2b2c646b0, []int{1} +} +func (m *MsgParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgParamsResponse.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 *MsgParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgParamsResponse.Merge(m, src) +} +func (m *MsgParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgParamsResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgParams)(nil), "cosmos.consensus.v1.MsgParams") + proto.RegisterType((*MsgParamsResponse)(nil), "cosmos.consensus.v1.MsgParamsResponse") +} + +func init() { + proto.RegisterFile("cosmos/consensus/v1/consensus_msg.proto", fileDescriptor_d0eff3b2b2c646b0) +} + +var fileDescriptor_d0eff3b2b2c646b0 = []byte{ + // 310 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0xd1, 0x41, 0x4b, 0xf3, 0x30, + 0x18, 0xc0, 0xf1, 0x75, 0xef, 0xf6, 0xea, 0xe2, 0xc9, 0xec, 0x52, 0xc4, 0xc5, 0xb9, 0x8b, 0x5e, + 0x4c, 0x9c, 0x3b, 0x09, 0x82, 0x38, 0x11, 0xf4, 0x20, 0xc8, 0x0e, 0x1e, 0xbc, 0x48, 0x9b, 0x86, + 0x19, 0xb6, 0x26, 0xa5, 0x4f, 0x56, 0xf4, 0x5b, 0xf8, 0x41, 0xfc, 0x20, 0x1e, 0x77, 0xf4, 0x28, + 0xed, 0x17, 0x91, 0xa6, 0x5d, 0x2b, 0xd4, 0x53, 0x69, 0xf3, 0xff, 0xd1, 0xf0, 0x3c, 0xe8, 0x88, + 0x6b, 0x08, 0x35, 0x30, 0xae, 0x15, 0x08, 0x05, 0x2b, 0x60, 0xc9, 0xb8, 0x7e, 0x79, 0x0e, 0x61, + 0x4e, 0xa3, 0x58, 0x1b, 0x8d, 0xfb, 0x45, 0x48, 0xab, 0x33, 0x9a, 0x8c, 0xf7, 0x06, 0x46, 0xa8, + 0x40, 0xc4, 0xa1, 0x54, 0x86, 0x99, 0xb7, 0x48, 0x00, 0x8b, 0xbc, 0xd8, 0x0b, 0xa1, 0x30, 0xa3, + 0x8f, 0x36, 0xea, 0xdd, 0xc3, 0xfc, 0xc1, 0x7e, 0xc3, 0xe7, 0x68, 0x2b, 0x11, 0x31, 0x48, 0xad, + 0x5c, 0x67, 0xe8, 0x1c, 0xef, 0x9c, 0x1d, 0xd0, 0x9a, 0x53, 0xcb, 0xe9, 0x63, 0x11, 0x14, 0x62, + 0xb6, 0xe9, 0xf1, 0x04, 0x75, 0xfd, 0xa5, 0xe6, 0x0b, 0xb7, 0x6d, 0xe1, 0xa0, 0x09, 0xa7, 0xf9, + 0x71, 0xc9, 0x8a, 0x16, 0x5f, 0xa0, 0x6d, 0x91, 0xc8, 0x40, 0x28, 0x2e, 0xdc, 0x7f, 0xd6, 0x0d, + 0x9b, 0xee, 0xa6, 0x2c, 0x4a, 0x5a, 0x09, 0x7c, 0x89, 0x7a, 0x89, 0xb7, 0x94, 0x81, 0x67, 0x74, + 0xec, 0x76, 0x2c, 0x3f, 0xfc, 0xe3, 0xbe, 0x9b, 0xa4, 0xf4, 0xb5, 0xc1, 0xa7, 0xa8, 0xe3, 0xf9, + 0x5c, 0xba, 0x5d, 0x6b, 0xf7, 0x9b, 0xf6, 0x6a, 0x7a, 0x7d, 0x57, 0x32, 0x5b, 0x8e, 0xfa, 0x68, + 0xb7, 0x9a, 0xd6, 0x4c, 0x40, 0x94, 0x4f, 0x7a, 0x7a, 0xfb, 0x99, 0x12, 0x67, 0x9d, 0x12, 0xe7, + 0x3b, 0x25, 0xce, 0x7b, 0x46, 0x5a, 0xeb, 0x8c, 0xb4, 0xbe, 0x32, 0xd2, 0x7a, 0xa2, 0x73, 0x69, + 0x5e, 0x56, 0x3e, 0xe5, 0x3a, 0x64, 0xd5, 0x16, 0xf3, 0xc7, 0x09, 0x04, 0x0b, 0xf6, 0xfa, 0x6b, + 0xa5, 0xf6, 0x7f, 0xfe, 0x7f, 0xbb, 0x94, 0xc9, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x68, 0x81, + 0x2e, 0x8f, 0xf3, 0x01, 0x00, 0x00, +} + +func (m *MsgParams) 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 *MsgParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Abci != nil { + { + size, err := m.Abci.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintConsensusMsg(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.Validator != nil { + { + size, err := m.Validator.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintConsensusMsg(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Evidence != nil { + { + size, err := m.Evidence.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintConsensusMsg(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Block != nil { + { + size, err := m.Block.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintConsensusMsg(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Version != nil { + { + size, err := m.Version.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintConsensusMsg(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgParamsResponse) 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 *MsgParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintConsensusMsg(dAtA []byte, offset int, v uint64) int { + offset -= sovConsensusMsg(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Version != nil { + l = m.Version.Size() + n += 1 + l + sovConsensusMsg(uint64(l)) + } + if m.Block != nil { + l = m.Block.Size() + n += 1 + l + sovConsensusMsg(uint64(l)) + } + if m.Evidence != nil { + l = m.Evidence.Size() + n += 1 + l + sovConsensusMsg(uint64(l)) + } + if m.Validator != nil { + l = m.Validator.Size() + n += 1 + l + sovConsensusMsg(uint64(l)) + } + if m.Abci != nil { + l = m.Abci.Size() + n += 1 + l + sovConsensusMsg(uint64(l)) + } + return n +} + +func (m *MsgParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovConsensusMsg(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozConsensusMsg(x uint64) (n int) { + return sovConsensusMsg(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgParams) 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 ErrIntOverflowConsensusMsg + } + 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: MsgParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 ErrIntOverflowConsensusMsg + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthConsensusMsg + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthConsensusMsg + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Version == nil { + m.Version = &types.VersionParams{} + } + if err := m.Version.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + 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 ErrIntOverflowConsensusMsg + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthConsensusMsg + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthConsensusMsg + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Block == nil { + m.Block = &types.BlockParams{} + } + if err := m.Block.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + 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 ErrIntOverflowConsensusMsg + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthConsensusMsg + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthConsensusMsg + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Evidence == nil { + m.Evidence = &types.EvidenceParams{} + } + if err := m.Evidence.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + 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 ErrIntOverflowConsensusMsg + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthConsensusMsg + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthConsensusMsg + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Validator == nil { + m.Validator = &types.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 ErrIntOverflowConsensusMsg + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthConsensusMsg + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthConsensusMsg + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Abci == nil { + m.Abci = &types.ABCIParams{} + } + if err := m.Abci.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipConsensusMsg(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthConsensusMsg + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgParamsResponse) 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 ErrIntOverflowConsensusMsg + } + 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: MsgParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipConsensusMsg(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthConsensusMsg + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipConsensusMsg(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, ErrIntOverflowConsensusMsg + } + 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, ErrIntOverflowConsensusMsg + } + 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, ErrIntOverflowConsensusMsg + } + 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, ErrInvalidLengthConsensusMsg + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupConsensusMsg + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthConsensusMsg + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthConsensusMsg = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowConsensusMsg = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupConsensusMsg = fmt.Errorf("proto: unexpected end of group") +) From 20079678c1cdee045fec3f7e65a275d01678033d Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Tue, 20 Feb 2024 14:24:55 +0100 Subject: [PATCH 02/12] add message --- ...nsus_msg.pulsar.go => consensus.pulsar.go} | 514 +++++++++--------- .../{consensus_msg.proto => consensus.proto} | 11 +- x/consensus/keeper/keeper.go | 18 + x/consensus/types/consensus.go | 42 ++ .../{consensus_msg.pb.go => consensus.pb.go} | 248 ++++----- x/consensus/types/msgs.go | 4 - 6 files changed, 446 insertions(+), 391 deletions(-) rename api/cosmos/consensus/v1/{consensus_msg.pulsar.go => consensus.pulsar.go} (65%) rename proto/cosmos/consensus/v1/{consensus_msg.proto => consensus.proto} (68%) create mode 100644 x/consensus/types/consensus.go rename x/consensus/types/{consensus_msg.pb.go => consensus.pb.go} (57%) diff --git a/api/cosmos/consensus/v1/consensus_msg.pulsar.go b/api/cosmos/consensus/v1/consensus.pulsar.go similarity index 65% rename from api/cosmos/consensus/v1/consensus_msg.pulsar.go rename to api/cosmos/consensus/v1/consensus.pulsar.go index b45687a82e0a..22de0262f670 100644 --- a/api/cosmos/consensus/v1/consensus_msg.pulsar.go +++ b/api/cosmos/consensus/v1/consensus.pulsar.go @@ -14,34 +14,34 @@ import ( ) var ( - md_MsgParams protoreflect.MessageDescriptor - fd_MsgParams_version protoreflect.FieldDescriptor - fd_MsgParams_block protoreflect.FieldDescriptor - fd_MsgParams_evidence protoreflect.FieldDescriptor - fd_MsgParams_validator protoreflect.FieldDescriptor - fd_MsgParams_abci protoreflect.FieldDescriptor + md_ConMsgParams protoreflect.MessageDescriptor + fd_ConMsgParams_version protoreflect.FieldDescriptor + fd_ConMsgParams_block protoreflect.FieldDescriptor + fd_ConMsgParams_evidence protoreflect.FieldDescriptor + fd_ConMsgParams_validator protoreflect.FieldDescriptor + fd_ConMsgParams_abci protoreflect.FieldDescriptor ) func init() { - file_cosmos_consensus_v1_consensus_msg_proto_init() - md_MsgParams = File_cosmos_consensus_v1_consensus_msg_proto.Messages().ByName("MsgParams") - fd_MsgParams_version = md_MsgParams.Fields().ByName("version") - fd_MsgParams_block = md_MsgParams.Fields().ByName("block") - fd_MsgParams_evidence = md_MsgParams.Fields().ByName("evidence") - fd_MsgParams_validator = md_MsgParams.Fields().ByName("validator") - fd_MsgParams_abci = md_MsgParams.Fields().ByName("abci") + file_cosmos_consensus_v1_consensus_proto_init() + md_ConMsgParams = File_cosmos_consensus_v1_consensus_proto.Messages().ByName("ConMsgParams") + fd_ConMsgParams_version = md_ConMsgParams.Fields().ByName("version") + fd_ConMsgParams_block = md_ConMsgParams.Fields().ByName("block") + fd_ConMsgParams_evidence = md_ConMsgParams.Fields().ByName("evidence") + fd_ConMsgParams_validator = md_ConMsgParams.Fields().ByName("validator") + fd_ConMsgParams_abci = md_ConMsgParams.Fields().ByName("abci") } -var _ protoreflect.Message = (*fastReflection_MsgParams)(nil) +var _ protoreflect.Message = (*fastReflection_ConMsgParams)(nil) -type fastReflection_MsgParams MsgParams +type fastReflection_ConMsgParams ConMsgParams -func (x *MsgParams) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgParams)(x) +func (x *ConMsgParams) ProtoReflect() protoreflect.Message { + return (*fastReflection_ConMsgParams)(x) } -func (x *MsgParams) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_consensus_v1_consensus_msg_proto_msgTypes[0] +func (x *ConMsgParams) 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 { @@ -52,43 +52,43 @@ func (x *MsgParams) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_MsgParams_messageType fastReflection_MsgParams_messageType -var _ protoreflect.MessageType = fastReflection_MsgParams_messageType{} +var _fastReflection_ConMsgParams_messageType fastReflection_ConMsgParams_messageType +var _ protoreflect.MessageType = fastReflection_ConMsgParams_messageType{} -type fastReflection_MsgParams_messageType struct{} +type fastReflection_ConMsgParams_messageType struct{} -func (x fastReflection_MsgParams_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgParams)(nil) +func (x fastReflection_ConMsgParams_messageType) Zero() protoreflect.Message { + return (*fastReflection_ConMsgParams)(nil) } -func (x fastReflection_MsgParams_messageType) New() protoreflect.Message { - return new(fastReflection_MsgParams) +func (x fastReflection_ConMsgParams_messageType) New() protoreflect.Message { + return new(fastReflection_ConMsgParams) } -func (x fastReflection_MsgParams_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgParams +func (x fastReflection_ConMsgParams_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ConMsgParams } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_MsgParams) Descriptor() protoreflect.MessageDescriptor { - return md_MsgParams +func (x *fastReflection_ConMsgParams) Descriptor() protoreflect.MessageDescriptor { + return md_ConMsgParams } // 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_MsgParams) Type() protoreflect.MessageType { - return _fastReflection_MsgParams_messageType +func (x *fastReflection_ConMsgParams) Type() protoreflect.MessageType { + return _fastReflection_ConMsgParams_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgParams) New() protoreflect.Message { - return new(fastReflection_MsgParams) +func (x *fastReflection_ConMsgParams) New() protoreflect.Message { + return new(fastReflection_ConMsgParams) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgParams) Interface() protoreflect.ProtoMessage { - return (*MsgParams)(x) +func (x *fastReflection_ConMsgParams) Interface() protoreflect.ProtoMessage { + return (*ConMsgParams)(x) } // Range iterates over every populated field in an undefined order, @@ -96,34 +96,34 @@ func (x *fastReflection_MsgParams) Interface() protoreflect.ProtoMessage { // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_MsgParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_ConMsgParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.Version != nil { value := protoreflect.ValueOfMessage(x.Version.ProtoReflect()) - if !f(fd_MsgParams_version, value) { + if !f(fd_ConMsgParams_version, value) { return } } if x.Block != nil { value := protoreflect.ValueOfMessage(x.Block.ProtoReflect()) - if !f(fd_MsgParams_block, value) { + if !f(fd_ConMsgParams_block, value) { return } } if x.Evidence != nil { value := protoreflect.ValueOfMessage(x.Evidence.ProtoReflect()) - if !f(fd_MsgParams_evidence, value) { + if !f(fd_ConMsgParams_evidence, value) { return } } if x.Validator != nil { value := protoreflect.ValueOfMessage(x.Validator.ProtoReflect()) - if !f(fd_MsgParams_validator, value) { + if !f(fd_ConMsgParams_validator, value) { return } } if x.Abci != nil { value := protoreflect.ValueOfMessage(x.Abci.ProtoReflect()) - if !f(fd_MsgParams_abci, value) { + if !f(fd_ConMsgParams_abci, value) { return } } @@ -140,23 +140,23 @@ func (x *fastReflection_MsgParams) Range(f func(protoreflect.FieldDescriptor, pr // 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_MsgParams) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_ConMsgParams) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "cosmos.consensus.v1.MsgParams.version": + case "cosmos.consensus.v1.ConMsgParams.version": return x.Version != nil - case "cosmos.consensus.v1.MsgParams.block": + case "cosmos.consensus.v1.ConMsgParams.block": return x.Block != nil - case "cosmos.consensus.v1.MsgParams.evidence": + case "cosmos.consensus.v1.ConMsgParams.evidence": return x.Evidence != nil - case "cosmos.consensus.v1.MsgParams.validator": + case "cosmos.consensus.v1.ConMsgParams.validator": return x.Validator != nil - case "cosmos.consensus.v1.MsgParams.abci": + case "cosmos.consensus.v1.ConMsgParams.abci": return x.Abci != nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.MsgParams")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConMsgParams")) } - panic(fmt.Errorf("message cosmos.consensus.v1.MsgParams does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.ConMsgParams does not contain field %s", fd.FullName())) } } @@ -166,23 +166,23 @@ func (x *fastReflection_MsgParams) Has(fd protoreflect.FieldDescriptor) bool { // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgParams) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_ConMsgParams) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "cosmos.consensus.v1.MsgParams.version": + case "cosmos.consensus.v1.ConMsgParams.version": x.Version = nil - case "cosmos.consensus.v1.MsgParams.block": + case "cosmos.consensus.v1.ConMsgParams.block": x.Block = nil - case "cosmos.consensus.v1.MsgParams.evidence": + case "cosmos.consensus.v1.ConMsgParams.evidence": x.Evidence = nil - case "cosmos.consensus.v1.MsgParams.validator": + case "cosmos.consensus.v1.ConMsgParams.validator": x.Validator = nil - case "cosmos.consensus.v1.MsgParams.abci": + case "cosmos.consensus.v1.ConMsgParams.abci": x.Abci = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.MsgParams")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConMsgParams")) } - panic(fmt.Errorf("message cosmos.consensus.v1.MsgParams does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.ConMsgParams does not contain field %s", fd.FullName())) } } @@ -192,28 +192,28 @@ func (x *fastReflection_MsgParams) Clear(fd protoreflect.FieldDescriptor) { // 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_MsgParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_ConMsgParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "cosmos.consensus.v1.MsgParams.version": + case "cosmos.consensus.v1.ConMsgParams.version": value := x.Version return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "cosmos.consensus.v1.MsgParams.block": + case "cosmos.consensus.v1.ConMsgParams.block": value := x.Block return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "cosmos.consensus.v1.MsgParams.evidence": + case "cosmos.consensus.v1.ConMsgParams.evidence": value := x.Evidence return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "cosmos.consensus.v1.MsgParams.validator": + case "cosmos.consensus.v1.ConMsgParams.validator": value := x.Validator return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "cosmos.consensus.v1.MsgParams.abci": + case "cosmos.consensus.v1.ConMsgParams.abci": value := x.Abci return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.MsgParams")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConMsgParams")) } - panic(fmt.Errorf("message cosmos.consensus.v1.MsgParams does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.ConMsgParams does not contain field %s", descriptor.FullName())) } } @@ -227,23 +227,23 @@ func (x *fastReflection_MsgParams) Get(descriptor protoreflect.FieldDescriptor) // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_ConMsgParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "cosmos.consensus.v1.MsgParams.version": + case "cosmos.consensus.v1.ConMsgParams.version": x.Version = value.Message().Interface().(*types.VersionParams) - case "cosmos.consensus.v1.MsgParams.block": + case "cosmos.consensus.v1.ConMsgParams.block": x.Block = value.Message().Interface().(*types.BlockParams) - case "cosmos.consensus.v1.MsgParams.evidence": + case "cosmos.consensus.v1.ConMsgParams.evidence": x.Evidence = value.Message().Interface().(*types.EvidenceParams) - case "cosmos.consensus.v1.MsgParams.validator": + case "cosmos.consensus.v1.ConMsgParams.validator": x.Validator = value.Message().Interface().(*types.ValidatorParams) - case "cosmos.consensus.v1.MsgParams.abci": + case "cosmos.consensus.v1.ConMsgParams.abci": x.Abci = value.Message().Interface().(*types.ABCIParams) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.MsgParams")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConMsgParams")) } - panic(fmt.Errorf("message cosmos.consensus.v1.MsgParams does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.ConMsgParams does not contain field %s", fd.FullName())) } } @@ -257,76 +257,76 @@ func (x *fastReflection_MsgParams) Set(fd protoreflect.FieldDescriptor, value pr // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_ConMsgParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.consensus.v1.MsgParams.version": + case "cosmos.consensus.v1.ConMsgParams.version": if x.Version == nil { x.Version = new(types.VersionParams) } return protoreflect.ValueOfMessage(x.Version.ProtoReflect()) - case "cosmos.consensus.v1.MsgParams.block": + case "cosmos.consensus.v1.ConMsgParams.block": if x.Block == nil { x.Block = new(types.BlockParams) } return protoreflect.ValueOfMessage(x.Block.ProtoReflect()) - case "cosmos.consensus.v1.MsgParams.evidence": + case "cosmos.consensus.v1.ConMsgParams.evidence": if x.Evidence == nil { x.Evidence = new(types.EvidenceParams) } return protoreflect.ValueOfMessage(x.Evidence.ProtoReflect()) - case "cosmos.consensus.v1.MsgParams.validator": + case "cosmos.consensus.v1.ConMsgParams.validator": if x.Validator == nil { x.Validator = new(types.ValidatorParams) } return protoreflect.ValueOfMessage(x.Validator.ProtoReflect()) - case "cosmos.consensus.v1.MsgParams.abci": + case "cosmos.consensus.v1.ConMsgParams.abci": if x.Abci == nil { x.Abci = new(types.ABCIParams) } return protoreflect.ValueOfMessage(x.Abci.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.MsgParams")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConMsgParams")) } - panic(fmt.Errorf("message cosmos.consensus.v1.MsgParams does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.ConMsgParams 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_MsgParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_ConMsgParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.consensus.v1.MsgParams.version": + case "cosmos.consensus.v1.ConMsgParams.version": m := new(types.VersionParams) return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "cosmos.consensus.v1.MsgParams.block": + case "cosmos.consensus.v1.ConMsgParams.block": m := new(types.BlockParams) return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "cosmos.consensus.v1.MsgParams.evidence": + case "cosmos.consensus.v1.ConMsgParams.evidence": m := new(types.EvidenceParams) return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "cosmos.consensus.v1.MsgParams.validator": + case "cosmos.consensus.v1.ConMsgParams.validator": m := new(types.ValidatorParams) return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "cosmos.consensus.v1.MsgParams.abci": + case "cosmos.consensus.v1.ConMsgParams.abci": m := new(types.ABCIParams) return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.MsgParams")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConMsgParams")) } - panic(fmt.Errorf("message cosmos.consensus.v1.MsgParams does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.ConMsgParams 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_MsgParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_ConMsgParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.consensus.v1.MsgParams", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in cosmos.consensus.v1.ConMsgParams", d.FullName())) } panic("unreachable") } @@ -334,7 +334,7 @@ func (x *fastReflection_MsgParams) WhichOneof(d protoreflect.OneofDescriptor) pr // 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_MsgParams) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_ConMsgParams) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -345,7 +345,7 @@ func (x *fastReflection_MsgParams) GetUnknown() protoreflect.RawFields { // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgParams) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_ConMsgParams) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -357,7 +357,7 @@ func (x *fastReflection_MsgParams) SetUnknown(fields protoreflect.RawFields) { // 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_MsgParams) IsValid() bool { +func (x *fastReflection_ConMsgParams) IsValid() bool { return x != nil } @@ -367,9 +367,9 @@ func (x *fastReflection_MsgParams) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_MsgParams) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_ConMsgParams) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgParams) + x := input.Message.Interface().(*ConMsgParams) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -411,7 +411,7 @@ func (x *fastReflection_MsgParams) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgParams) + x := input.Message.Interface().(*ConMsgParams) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -511,7 +511,7 @@ func (x *fastReflection_MsgParams) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgParams) + x := input.Message.Interface().(*ConMsgParams) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -543,10 +543,10 @@ func (x *fastReflection_MsgParams) ProtoMethods() *protoiface.Methods { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgParams: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ConMsgParams: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgParams: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ConMsgParams: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -765,24 +765,24 @@ func (x *fastReflection_MsgParams) ProtoMethods() *protoiface.Methods { } var ( - md_MsgParamsResponse protoreflect.MessageDescriptor + md_ConMsgParamsResponse protoreflect.MessageDescriptor ) func init() { - file_cosmos_consensus_v1_consensus_msg_proto_init() - md_MsgParamsResponse = File_cosmos_consensus_v1_consensus_msg_proto.Messages().ByName("MsgParamsResponse") + file_cosmos_consensus_v1_consensus_proto_init() + md_ConMsgParamsResponse = File_cosmos_consensus_v1_consensus_proto.Messages().ByName("ConMsgParamsResponse") } -var _ protoreflect.Message = (*fastReflection_MsgParamsResponse)(nil) +var _ protoreflect.Message = (*fastReflection_ConMsgParamsResponse)(nil) -type fastReflection_MsgParamsResponse MsgParamsResponse +type fastReflection_ConMsgParamsResponse ConMsgParamsResponse -func (x *MsgParamsResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgParamsResponse)(x) +func (x *ConMsgParamsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_ConMsgParamsResponse)(x) } -func (x *MsgParamsResponse) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_consensus_v1_consensus_msg_proto_msgTypes[1] +func (x *ConMsgParamsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_consensus_v1_consensus_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -793,43 +793,43 @@ func (x *MsgParamsResponse) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_MsgParamsResponse_messageType fastReflection_MsgParamsResponse_messageType -var _ protoreflect.MessageType = fastReflection_MsgParamsResponse_messageType{} +var _fastReflection_ConMsgParamsResponse_messageType fastReflection_ConMsgParamsResponse_messageType +var _ protoreflect.MessageType = fastReflection_ConMsgParamsResponse_messageType{} -type fastReflection_MsgParamsResponse_messageType struct{} +type fastReflection_ConMsgParamsResponse_messageType struct{} -func (x fastReflection_MsgParamsResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgParamsResponse)(nil) +func (x fastReflection_ConMsgParamsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_ConMsgParamsResponse)(nil) } -func (x fastReflection_MsgParamsResponse_messageType) New() protoreflect.Message { - return new(fastReflection_MsgParamsResponse) +func (x fastReflection_ConMsgParamsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_ConMsgParamsResponse) } -func (x fastReflection_MsgParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgParamsResponse +func (x fastReflection_ConMsgParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ConMsgParamsResponse } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_MsgParamsResponse) Descriptor() protoreflect.MessageDescriptor { - return md_MsgParamsResponse +func (x *fastReflection_ConMsgParamsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_ConMsgParamsResponse } // 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_MsgParamsResponse) Type() protoreflect.MessageType { - return _fastReflection_MsgParamsResponse_messageType +func (x *fastReflection_ConMsgParamsResponse) Type() protoreflect.MessageType { + return _fastReflection_ConMsgParamsResponse_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgParamsResponse) New() protoreflect.Message { - return new(fastReflection_MsgParamsResponse) +func (x *fastReflection_ConMsgParamsResponse) New() protoreflect.Message { + return new(fastReflection_ConMsgParamsResponse) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgParamsResponse) Interface() protoreflect.ProtoMessage { - return (*MsgParamsResponse)(x) +func (x *fastReflection_ConMsgParamsResponse) Interface() protoreflect.ProtoMessage { + return (*ConMsgParamsResponse)(x) } // Range iterates over every populated field in an undefined order, @@ -837,7 +837,7 @@ func (x *fastReflection_MsgParamsResponse) Interface() protoreflect.ProtoMessage // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_MsgParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_ConMsgParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { } // Has reports whether a field is populated. @@ -851,13 +851,13 @@ func (x *fastReflection_MsgParamsResponse) Range(f func(protoreflect.FieldDescri // 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_MsgParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_ConMsgParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.MsgParamsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConMsgParamsResponse")) } - panic(fmt.Errorf("message cosmos.consensus.v1.MsgParamsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.ConMsgParamsResponse does not contain field %s", fd.FullName())) } } @@ -867,13 +867,13 @@ func (x *fastReflection_MsgParamsResponse) Has(fd protoreflect.FieldDescriptor) // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgParamsResponse) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_ConMsgParamsResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.MsgParamsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConMsgParamsResponse")) } - panic(fmt.Errorf("message cosmos.consensus.v1.MsgParamsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.ConMsgParamsResponse does not contain field %s", fd.FullName())) } } @@ -883,13 +883,13 @@ func (x *fastReflection_MsgParamsResponse) Clear(fd protoreflect.FieldDescriptor // 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_MsgParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_ConMsgParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.MsgParamsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConMsgParamsResponse")) } - panic(fmt.Errorf("message cosmos.consensus.v1.MsgParamsResponse does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.ConMsgParamsResponse does not contain field %s", descriptor.FullName())) } } @@ -903,13 +903,13 @@ func (x *fastReflection_MsgParamsResponse) Get(descriptor protoreflect.FieldDesc // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_ConMsgParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.MsgParamsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConMsgParamsResponse")) } - panic(fmt.Errorf("message cosmos.consensus.v1.MsgParamsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.ConMsgParamsResponse does not contain field %s", fd.FullName())) } } @@ -923,36 +923,36 @@ func (x *fastReflection_MsgParamsResponse) Set(fd protoreflect.FieldDescriptor, // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_ConMsgParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.MsgParamsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConMsgParamsResponse")) } - panic(fmt.Errorf("message cosmos.consensus.v1.MsgParamsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.ConMsgParamsResponse 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_MsgParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_ConMsgParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.MsgParamsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConMsgParamsResponse")) } - panic(fmt.Errorf("message cosmos.consensus.v1.MsgParamsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.ConMsgParamsResponse 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_MsgParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_ConMsgParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.consensus.v1.MsgParamsResponse", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in cosmos.consensus.v1.ConMsgParamsResponse", d.FullName())) } panic("unreachable") } @@ -960,7 +960,7 @@ func (x *fastReflection_MsgParamsResponse) WhichOneof(d protoreflect.OneofDescri // 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_MsgParamsResponse) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_ConMsgParamsResponse) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -971,7 +971,7 @@ func (x *fastReflection_MsgParamsResponse) GetUnknown() protoreflect.RawFields { // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgParamsResponse) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_ConMsgParamsResponse) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -983,7 +983,7 @@ func (x *fastReflection_MsgParamsResponse) SetUnknown(fields protoreflect.RawFie // 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_MsgParamsResponse) IsValid() bool { +func (x *fastReflection_ConMsgParamsResponse) IsValid() bool { return x != nil } @@ -993,9 +993,9 @@ func (x *fastReflection_MsgParamsResponse) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_MsgParamsResponse) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_ConMsgParamsResponse) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgParamsResponse) + x := input.Message.Interface().(*ConMsgParamsResponse) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1017,7 +1017,7 @@ func (x *fastReflection_MsgParamsResponse) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgParamsResponse) + x := input.Message.Interface().(*ConMsgParamsResponse) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1047,7 +1047,7 @@ func (x *fastReflection_MsgParamsResponse) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgParamsResponse) + x := input.Message.Interface().(*ConMsgParamsResponse) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1079,10 +1079,10 @@ func (x *fastReflection_MsgParamsResponse) ProtoMethods() *protoiface.Methods { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgParamsResponse: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ConMsgParamsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ConMsgParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -1126,7 +1126,7 @@ func (x *fastReflection_MsgParamsResponse) ProtoMethods() *protoiface.Methods { // versions: // protoc-gen-go v1.27.0 // protoc (unknown) -// source: cosmos/consensus/v1/consensus_msg.proto +// source: cosmos/consensus/v1/consensus.proto const ( // Verify that this generated code is sufficiently up-to-date. @@ -1135,8 +1135,8 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// MsgUpdateParams is the Msg/UpdateParams request type. -type MsgParams struct { +// ConMsgParams is the Msg/Params request type. This is a consensus message that is sent from cometbft. +type ConMsgParams struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -1151,162 +1151,162 @@ type MsgParams struct { Abci *types.ABCIParams `protobuf:"bytes,5,opt,name=abci,proto3" json:"abci,omitempty"` } -func (x *MsgParams) Reset() { - *x = MsgParams{} +func (x *ConMsgParams) Reset() { + *x = ConMsgParams{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_consensus_v1_consensus_msg_proto_msgTypes[0] + mi := &file_cosmos_consensus_v1_consensus_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *MsgParams) String() string { +func (x *ConMsgParams) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MsgParams) ProtoMessage() {} +func (*ConMsgParams) ProtoMessage() {} -// Deprecated: Use MsgParams.ProtoReflect.Descriptor instead. -func (*MsgParams) Descriptor() ([]byte, []int) { - return file_cosmos_consensus_v1_consensus_msg_proto_rawDescGZIP(), []int{0} +// Deprecated: Use ConMsgParams.ProtoReflect.Descriptor instead. +func (*ConMsgParams) Descriptor() ([]byte, []int) { + return file_cosmos_consensus_v1_consensus_proto_rawDescGZIP(), []int{0} } -func (x *MsgParams) GetVersion() *types.VersionParams { +func (x *ConMsgParams) GetVersion() *types.VersionParams { if x != nil { return x.Version } return nil } -func (x *MsgParams) GetBlock() *types.BlockParams { +func (x *ConMsgParams) GetBlock() *types.BlockParams { if x != nil { return x.Block } return nil } -func (x *MsgParams) GetEvidence() *types.EvidenceParams { +func (x *ConMsgParams) GetEvidence() *types.EvidenceParams { if x != nil { return x.Evidence } return nil } -func (x *MsgParams) GetValidator() *types.ValidatorParams { +func (x *ConMsgParams) GetValidator() *types.ValidatorParams { if x != nil { return x.Validator } return nil } -func (x *MsgParams) GetAbci() *types.ABCIParams { +func (x *ConMsgParams) GetAbci() *types.ABCIParams { if x != nil { return x.Abci } return nil } -// MsgUpdateParamsResponse defines the response structure for executing a -// MsgUpdateParams message. -type MsgParamsResponse struct { +// ConMsgParamsResponse defines the response structure for executing a +// ConMsgParams message. +type ConMsgParamsResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields } -func (x *MsgParamsResponse) Reset() { - *x = MsgParamsResponse{} +func (x *ConMsgParamsResponse) Reset() { + *x = ConMsgParamsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_consensus_v1_consensus_msg_proto_msgTypes[1] + mi := &file_cosmos_consensus_v1_consensus_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *MsgParamsResponse) String() string { +func (x *ConMsgParamsResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MsgParamsResponse) ProtoMessage() {} +func (*ConMsgParamsResponse) ProtoMessage() {} -// Deprecated: Use MsgParamsResponse.ProtoReflect.Descriptor instead. -func (*MsgParamsResponse) Descriptor() ([]byte, []int) { - return file_cosmos_consensus_v1_consensus_msg_proto_rawDescGZIP(), []int{1} +// Deprecated: Use ConMsgParamsResponse.ProtoReflect.Descriptor instead. +func (*ConMsgParamsResponse) Descriptor() ([]byte, []int) { + return file_cosmos_consensus_v1_consensus_proto_rawDescGZIP(), []int{1} } -var File_cosmos_consensus_v1_consensus_msg_proto protoreflect.FileDescriptor - -var file_cosmos_consensus_v1_consensus_msg_proto_rawDesc = []byte{ - 0x0a, 0x27, 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, 0x5f, - 0x6d, 0x73, 0x67, 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, 0x1d, - 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xac, 0x02, - 0x0a, 0x09, 0x4d, 0x73, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x39, 0x0a, 0x07, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x74, +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, 0x1d, 0x74, 0x65, 0x6e, 0x64, + 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xaf, 0x02, 0x0a, 0x0c, 0x43, 0x6f, + 0x6e, 0x4d, 0x73, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x39, 0x0a, 0x07, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x74, 0x65, + 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x56, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x07, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, + 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x3c, 0x0a, 0x08, 0x65, 0x76, + 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, - 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x07, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, - 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x3c, 0x0a, 0x08, 0x65, - 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, - 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, - 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, 0x3f, 0x0a, 0x09, 0x76, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x74, - 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 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, 0x30, 0x0a, 0x04, 0x61, 0x62, - 0x63, 0x69, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, - 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x41, 0x42, 0x43, 0x49, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x04, 0x61, 0x62, 0x63, 0x69, 0x22, 0x13, 0x0a, 0x11, - 0x4d, 0x73, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x42, 0xcc, 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, 0x11, 0x43, - 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x4d, 0x73, 0x67, 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, + 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, 0x3f, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x74, 0x65, + 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 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, 0x30, 0x0a, 0x04, 0x61, 0x62, 0x63, + 0x69, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, + 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x41, 0x42, 0x43, 0x49, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x04, 0x61, 0x62, 0x63, 0x69, 0x22, 0x16, 0x0a, 0x14, 0x43, + 0x6f, 0x6e, 0x4d, 0x73, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 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_msg_proto_rawDescOnce sync.Once - file_cosmos_consensus_v1_consensus_msg_proto_rawDescData = file_cosmos_consensus_v1_consensus_msg_proto_rawDesc + 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_msg_proto_rawDescGZIP() []byte { - file_cosmos_consensus_v1_consensus_msg_proto_rawDescOnce.Do(func() { - file_cosmos_consensus_v1_consensus_msg_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_consensus_v1_consensus_msg_proto_rawDescData) +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_msg_proto_rawDescData + return file_cosmos_consensus_v1_consensus_proto_rawDescData } -var file_cosmos_consensus_v1_consensus_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_cosmos_consensus_v1_consensus_msg_proto_goTypes = []interface{}{ - (*MsgParams)(nil), // 0: cosmos.consensus.v1.MsgParams - (*MsgParamsResponse)(nil), // 1: cosmos.consensus.v1.MsgParamsResponse +var file_cosmos_consensus_v1_consensus_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_cosmos_consensus_v1_consensus_proto_goTypes = []interface{}{ + (*ConMsgParams)(nil), // 0: cosmos.consensus.v1.ConMsgParams + (*ConMsgParamsResponse)(nil), // 1: cosmos.consensus.v1.ConMsgParamsResponse (*types.VersionParams)(nil), // 2: tendermint.types.VersionParams (*types.BlockParams)(nil), // 3: tendermint.types.BlockParams (*types.EvidenceParams)(nil), // 4: tendermint.types.EvidenceParams (*types.ValidatorParams)(nil), // 5: tendermint.types.ValidatorParams (*types.ABCIParams)(nil), // 6: tendermint.types.ABCIParams } -var file_cosmos_consensus_v1_consensus_msg_proto_depIdxs = []int32{ - 2, // 0: cosmos.consensus.v1.MsgParams.version:type_name -> tendermint.types.VersionParams - 3, // 1: cosmos.consensus.v1.MsgParams.block:type_name -> tendermint.types.BlockParams - 4, // 2: cosmos.consensus.v1.MsgParams.evidence:type_name -> tendermint.types.EvidenceParams - 5, // 3: cosmos.consensus.v1.MsgParams.validator:type_name -> tendermint.types.ValidatorParams - 6, // 4: cosmos.consensus.v1.MsgParams.abci:type_name -> tendermint.types.ABCIParams +var file_cosmos_consensus_v1_consensus_proto_depIdxs = []int32{ + 2, // 0: cosmos.consensus.v1.ConMsgParams.version:type_name -> tendermint.types.VersionParams + 3, // 1: cosmos.consensus.v1.ConMsgParams.block:type_name -> tendermint.types.BlockParams + 4, // 2: cosmos.consensus.v1.ConMsgParams.evidence:type_name -> tendermint.types.EvidenceParams + 5, // 3: cosmos.consensus.v1.ConMsgParams.validator:type_name -> tendermint.types.ValidatorParams + 6, // 4: cosmos.consensus.v1.ConMsgParams.abci:type_name -> tendermint.types.ABCIParams 5, // [5:5] is the sub-list for method output_type 5, // [5:5] is the sub-list for method input_type 5, // [5:5] is the sub-list for extension type_name @@ -1314,14 +1314,14 @@ var file_cosmos_consensus_v1_consensus_msg_proto_depIdxs = []int32{ 0, // [0:5] is the sub-list for field type_name } -func init() { file_cosmos_consensus_v1_consensus_msg_proto_init() } -func file_cosmos_consensus_v1_consensus_msg_proto_init() { - if File_cosmos_consensus_v1_consensus_msg_proto != nil { +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_msg_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgParams); i { + file_cosmos_consensus_v1_consensus_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConMsgParams); i { case 0: return &v.state case 1: @@ -1332,8 +1332,8 @@ func file_cosmos_consensus_v1_consensus_msg_proto_init() { return nil } } - file_cosmos_consensus_v1_consensus_msg_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgParamsResponse); i { + file_cosmos_consensus_v1_consensus_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConMsgParamsResponse); i { case 0: return &v.state case 1: @@ -1349,18 +1349,18 @@ func file_cosmos_consensus_v1_consensus_msg_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_cosmos_consensus_v1_consensus_msg_proto_rawDesc, + RawDescriptor: file_cosmos_consensus_v1_consensus_proto_rawDesc, NumEnums: 0, NumMessages: 2, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_cosmos_consensus_v1_consensus_msg_proto_goTypes, - DependencyIndexes: file_cosmos_consensus_v1_consensus_msg_proto_depIdxs, - MessageInfos: file_cosmos_consensus_v1_consensus_msg_proto_msgTypes, + 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_msg_proto = out.File - file_cosmos_consensus_v1_consensus_msg_proto_rawDesc = nil - file_cosmos_consensus_v1_consensus_msg_proto_goTypes = nil - file_cosmos_consensus_v1_consensus_msg_proto_depIdxs = nil + 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/proto/cosmos/consensus/v1/consensus_msg.proto b/proto/cosmos/consensus/v1/consensus.proto similarity index 68% rename from proto/cosmos/consensus/v1/consensus_msg.proto rename to proto/cosmos/consensus/v1/consensus.proto index 6737e422d21b..223a9bc7ad17 100644 --- a/proto/cosmos/consensus/v1/consensus_msg.proto +++ b/proto/cosmos/consensus/v1/consensus.proto @@ -6,9 +6,8 @@ import "tendermint/types/params.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/consensus/types"; -// MsgeParams is the Msg/Params request type. This is a consensus message that is sent from cometbft. -message MsgParams { - +// ConMsgParams is the Msg/Params request type. This is a consensus message that is sent from cometbft. +message ConMsgParams { // params defines the x/consensus parameters to be passed from comet. // // NOTE: All parameters must be supplied. @@ -19,6 +18,6 @@ message MsgParams { tendermint.types.ABCIParams abci = 5; } -// MsgParamsResponse defines the response structure for executing a -// MsgParams message. -message MsgParamsResponse {} +// ConMsgParamsResponse defines the response structure for executing a +// ConMsgParams message. +message ConMsgParamsResponse {} diff --git a/x/consensus/keeper/keeper.go b/x/consensus/keeper/keeper.go index a0ccf562dea2..51bac37ae88f 100644 --- a/x/consensus/keeper/keeper.go +++ b/x/consensus/keeper/keeper.go @@ -88,3 +88,21 @@ func (k Keeper) UpdateParams(ctx context.Context, msg *types.MsgUpdateParams) (* return &types.MsgUpdateParamsResponse{}, nil } + +// SetParams sets the consensus parameters on init of a chain. This is a consensus message. It can only be called by the consensus server +func (k Keeper) SetParams(ctx context.Context, req *types.ConMsgParams) (*types.ConMsgParamsResponse, error) { + + consensusParams, err := req.ToProtoConsensusParams() + if err != nil { + return nil, err + } + if err := cmttypes.ConsensusParamsFromProto(consensusParams).ValidateBasic(); err != nil { + return nil, err + } + + if err := k.ParamsStore.Set(ctx, consensusParams); err != nil { + return nil, err + } + + return &types.ConMsgParamsResponse{}, nil +} diff --git a/x/consensus/types/consensus.go b/x/consensus/types/consensus.go new file mode 100644 index 000000000000..60457466a17e --- /dev/null +++ b/x/consensus/types/consensus.go @@ -0,0 +1,42 @@ +package types + +import ( + "errors" + + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + cmttypes "github.com/cometbft/cometbft/types" +) + +func (msg ConMsgParams) ToProtoConsensusParams() (cmtproto.ConsensusParams, error) { + if msg.Evidence == nil || msg.Block == nil || msg.Validator == nil || msg.Version == nil { + return cmtproto.ConsensusParams{}, errors.New("all parameters must be present") + } + + cp := cmtproto.ConsensusParams{ + Block: &cmtproto.BlockParams{ + MaxBytes: msg.Block.MaxBytes, + MaxGas: msg.Block.MaxGas, + }, + Evidence: &cmtproto.EvidenceParams{ + MaxAgeNumBlocks: msg.Evidence.MaxAgeNumBlocks, + MaxAgeDuration: msg.Evidence.MaxAgeDuration, + MaxBytes: msg.Evidence.MaxBytes, + }, + Validator: &cmtproto.ValidatorParams{ + PubKeyTypes: msg.Validator.PubKeyTypes, + }, + Version: cmttypes.DefaultConsensusParams().ToProto().Version, // Version is stored in x/upgrade + } + + if msg.Abci != nil { + cp.Abci = &cmtproto.ABCIParams{ + VoteExtensionsEnableHeight: msg.Abci.VoteExtensionsEnableHeight, + } + } + + if msg.Version != nil { + cp.Version.App = msg.Version.App + } + + return cp, nil +} diff --git a/x/consensus/types/consensus_msg.pb.go b/x/consensus/types/consensus.pb.go similarity index 57% rename from x/consensus/types/consensus_msg.pb.go rename to x/consensus/types/consensus.pb.go index b738ed8ae112..b81e575a1e3b 100644 --- a/x/consensus/types/consensus_msg.pb.go +++ b/x/consensus/types/consensus.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/consensus/v1/consensus_msg.proto +// source: cosmos/consensus/v1/consensus.proto package types @@ -23,8 +23,8 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// MsgUpdateParams is the Msg/UpdateParams request type. -type MsgParams struct { +// ConMsgParams is the Msg/Params request type. This is a consensus message that is sent from cometbft. +type ConMsgParams struct { // params defines the x/consensus parameters to be passed from comet. // // NOTE: All parameters must be supplied. @@ -35,18 +35,18 @@ type MsgParams struct { Abci *types.ABCIParams `protobuf:"bytes,5,opt,name=abci,proto3" json:"abci,omitempty"` } -func (m *MsgParams) Reset() { *m = MsgParams{} } -func (m *MsgParams) String() string { return proto.CompactTextString(m) } -func (*MsgParams) ProtoMessage() {} -func (*MsgParams) Descriptor() ([]byte, []int) { - return fileDescriptor_d0eff3b2b2c646b0, []int{0} +func (m *ConMsgParams) Reset() { *m = ConMsgParams{} } +func (m *ConMsgParams) String() string { return proto.CompactTextString(m) } +func (*ConMsgParams) ProtoMessage() {} +func (*ConMsgParams) Descriptor() ([]byte, []int) { + return fileDescriptor_7ed86dd7d42fb61b, []int{0} } -func (m *MsgParams) XXX_Unmarshal(b []byte) error { +func (m *ConMsgParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ConMsgParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgParams.Marshal(b, m, deterministic) + return xxx_messageInfo_ConMsgParams.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -56,70 +56,70 @@ func (m *MsgParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *MsgParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgParams.Merge(m, src) +func (m *ConMsgParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConMsgParams.Merge(m, src) } -func (m *MsgParams) XXX_Size() int { +func (m *ConMsgParams) XXX_Size() int { return m.Size() } -func (m *MsgParams) XXX_DiscardUnknown() { - xxx_messageInfo_MsgParams.DiscardUnknown(m) +func (m *ConMsgParams) XXX_DiscardUnknown() { + xxx_messageInfo_ConMsgParams.DiscardUnknown(m) } -var xxx_messageInfo_MsgParams proto.InternalMessageInfo +var xxx_messageInfo_ConMsgParams proto.InternalMessageInfo -func (m *MsgParams) GetVersion() *types.VersionParams { +func (m *ConMsgParams) GetVersion() *types.VersionParams { if m != nil { return m.Version } return nil } -func (m *MsgParams) GetBlock() *types.BlockParams { +func (m *ConMsgParams) GetBlock() *types.BlockParams { if m != nil { return m.Block } return nil } -func (m *MsgParams) GetEvidence() *types.EvidenceParams { +func (m *ConMsgParams) GetEvidence() *types.EvidenceParams { if m != nil { return m.Evidence } return nil } -func (m *MsgParams) GetValidator() *types.ValidatorParams { +func (m *ConMsgParams) GetValidator() *types.ValidatorParams { if m != nil { return m.Validator } return nil } -func (m *MsgParams) GetAbci() *types.ABCIParams { +func (m *ConMsgParams) GetAbci() *types.ABCIParams { if m != nil { return m.Abci } return nil } -// MsgUpdateParamsResponse defines the response structure for executing a -// MsgUpdateParams message. -type MsgParamsResponse struct { +// ConMsgParamsResponse defines the response structure for executing a +// ConMsgParams message. +type ConMsgParamsResponse struct { } -func (m *MsgParamsResponse) Reset() { *m = MsgParamsResponse{} } -func (m *MsgParamsResponse) String() string { return proto.CompactTextString(m) } -func (*MsgParamsResponse) ProtoMessage() {} -func (*MsgParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d0eff3b2b2c646b0, []int{1} +func (m *ConMsgParamsResponse) Reset() { *m = ConMsgParamsResponse{} } +func (m *ConMsgParamsResponse) String() string { return proto.CompactTextString(m) } +func (*ConMsgParamsResponse) ProtoMessage() {} +func (*ConMsgParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7ed86dd7d42fb61b, []int{1} } -func (m *MsgParamsResponse) XXX_Unmarshal(b []byte) error { +func (m *ConMsgParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ConMsgParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgParamsResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_ConMsgParamsResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -129,52 +129,52 @@ func (m *MsgParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return b[:n], nil } } -func (m *MsgParamsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgParamsResponse.Merge(m, src) +func (m *ConMsgParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConMsgParamsResponse.Merge(m, src) } -func (m *MsgParamsResponse) XXX_Size() int { +func (m *ConMsgParamsResponse) XXX_Size() int { return m.Size() } -func (m *MsgParamsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgParamsResponse.DiscardUnknown(m) +func (m *ConMsgParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ConMsgParamsResponse.DiscardUnknown(m) } -var xxx_messageInfo_MsgParamsResponse proto.InternalMessageInfo +var xxx_messageInfo_ConMsgParamsResponse proto.InternalMessageInfo func init() { - proto.RegisterType((*MsgParams)(nil), "cosmos.consensus.v1.MsgParams") - proto.RegisterType((*MsgParamsResponse)(nil), "cosmos.consensus.v1.MsgParamsResponse") + proto.RegisterType((*ConMsgParams)(nil), "cosmos.consensus.v1.ConMsgParams") + proto.RegisterType((*ConMsgParamsResponse)(nil), "cosmos.consensus.v1.ConMsgParamsResponse") } func init() { - proto.RegisterFile("cosmos/consensus/v1/consensus_msg.proto", fileDescriptor_d0eff3b2b2c646b0) + proto.RegisterFile("cosmos/consensus/v1/consensus.proto", fileDescriptor_7ed86dd7d42fb61b) } -var fileDescriptor_d0eff3b2b2c646b0 = []byte{ - // 310 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0xd1, 0x41, 0x4b, 0xf3, 0x30, - 0x18, 0xc0, 0xf1, 0x75, 0xef, 0xf6, 0xea, 0xe2, 0xc9, 0xec, 0x52, 0xc4, 0xc5, 0xb9, 0x8b, 0x5e, - 0x4c, 0x9c, 0x3b, 0x09, 0x82, 0x38, 0x11, 0xf4, 0x20, 0xc8, 0x0e, 0x1e, 0xbc, 0x48, 0x9b, 0x86, - 0x19, 0xb6, 0x26, 0xa5, 0x4f, 0x56, 0xf4, 0x5b, 0xf8, 0x41, 0xfc, 0x20, 0x1e, 0x77, 0xf4, 0x28, - 0xed, 0x17, 0x91, 0xa6, 0x5d, 0x2b, 0xd4, 0x53, 0x69, 0xf3, 0xff, 0xd1, 0xf0, 0x3c, 0xe8, 0x88, - 0x6b, 0x08, 0x35, 0x30, 0xae, 0x15, 0x08, 0x05, 0x2b, 0x60, 0xc9, 0xb8, 0x7e, 0x79, 0x0e, 0x61, - 0x4e, 0xa3, 0x58, 0x1b, 0x8d, 0xfb, 0x45, 0x48, 0xab, 0x33, 0x9a, 0x8c, 0xf7, 0x06, 0x46, 0xa8, - 0x40, 0xc4, 0xa1, 0x54, 0x86, 0x99, 0xb7, 0x48, 0x00, 0x8b, 0xbc, 0xd8, 0x0b, 0xa1, 0x30, 0xa3, - 0x8f, 0x36, 0xea, 0xdd, 0xc3, 0xfc, 0xc1, 0x7e, 0xc3, 0xe7, 0x68, 0x2b, 0x11, 0x31, 0x48, 0xad, - 0x5c, 0x67, 0xe8, 0x1c, 0xef, 0x9c, 0x1d, 0xd0, 0x9a, 0x53, 0xcb, 0xe9, 0x63, 0x11, 0x14, 0x62, - 0xb6, 0xe9, 0xf1, 0x04, 0x75, 0xfd, 0xa5, 0xe6, 0x0b, 0xb7, 0x6d, 0xe1, 0xa0, 0x09, 0xa7, 0xf9, - 0x71, 0xc9, 0x8a, 0x16, 0x5f, 0xa0, 0x6d, 0x91, 0xc8, 0x40, 0x28, 0x2e, 0xdc, 0x7f, 0xd6, 0x0d, - 0x9b, 0xee, 0xa6, 0x2c, 0x4a, 0x5a, 0x09, 0x7c, 0x89, 0x7a, 0x89, 0xb7, 0x94, 0x81, 0x67, 0x74, - 0xec, 0x76, 0x2c, 0x3f, 0xfc, 0xe3, 0xbe, 0x9b, 0xa4, 0xf4, 0xb5, 0xc1, 0xa7, 0xa8, 0xe3, 0xf9, - 0x5c, 0xba, 0x5d, 0x6b, 0xf7, 0x9b, 0xf6, 0x6a, 0x7a, 0x7d, 0x57, 0x32, 0x5b, 0x8e, 0xfa, 0x68, - 0xb7, 0x9a, 0xd6, 0x4c, 0x40, 0x94, 0x4f, 0x7a, 0x7a, 0xfb, 0x99, 0x12, 0x67, 0x9d, 0x12, 0xe7, - 0x3b, 0x25, 0xce, 0x7b, 0x46, 0x5a, 0xeb, 0x8c, 0xb4, 0xbe, 0x32, 0xd2, 0x7a, 0xa2, 0x73, 0x69, - 0x5e, 0x56, 0x3e, 0xe5, 0x3a, 0x64, 0xd5, 0x16, 0xf3, 0xc7, 0x09, 0x04, 0x0b, 0xf6, 0xfa, 0x6b, - 0xa5, 0xf6, 0x7f, 0xfe, 0x7f, 0xbb, 0x94, 0xc9, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x68, 0x81, - 0x2e, 0x8f, 0xf3, 0x01, 0x00, 0x00, +var fileDescriptor_7ed86dd7d42fb61b = []byte{ + // 308 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4e, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x4f, 0xce, 0xcf, 0x2b, 0x4e, 0xcd, 0x2b, 0x2e, 0x2d, 0xd6, 0x2f, 0x33, 0x44, + 0x70, 0xf4, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85, 0x84, 0x21, 0x8a, 0xf4, 0x10, 0xe2, 0x65, 0x86, + 0x52, 0xb2, 0x25, 0xa9, 0x79, 0x29, 0xa9, 0x45, 0xb9, 0x99, 0x79, 0x25, 0xfa, 0x25, 0x95, 0x05, + 0xa9, 0xc5, 0xfa, 0x05, 0x89, 0x45, 0x89, 0xb9, 0x50, 0x3d, 0x4a, 0xeb, 0x99, 0xb8, 0x78, 0x9c, + 0xf3, 0xf3, 0x7c, 0x8b, 0xd3, 0x03, 0xc0, 0xc2, 0x42, 0x96, 0x5c, 0xec, 0x65, 0xa9, 0x45, 0xc5, + 0x99, 0xf9, 0x79, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0xdc, 0x46, 0xf2, 0x7a, 0x08, 0x13, 0xf4, 0xc0, + 0x26, 0xe8, 0x85, 0x41, 0x14, 0x40, 0x74, 0x04, 0xc1, 0xd4, 0x0b, 0x19, 0x73, 0xb1, 0x26, 0xe5, + 0xe4, 0x27, 0x67, 0x4b, 0x30, 0x81, 0x35, 0xca, 0x62, 0x6a, 0x74, 0x02, 0x49, 0x43, 0xb5, 0x41, + 0xd4, 0x0a, 0xd9, 0x70, 0x71, 0xa4, 0x96, 0x65, 0xa6, 0xa4, 0xe6, 0x25, 0xa7, 0x4a, 0x30, 0x83, + 0xf5, 0x29, 0x60, 0xea, 0x73, 0x85, 0xaa, 0x80, 0x6a, 0x85, 0xeb, 0x10, 0xb2, 0xe7, 0xe2, 0x2c, + 0x4b, 0xcc, 0xc9, 0x4c, 0x49, 0x2c, 0xc9, 0x2f, 0x92, 0x60, 0x01, 0x6b, 0x57, 0xc4, 0xe2, 0x5e, + 0x98, 0x12, 0xa8, 0x7e, 0x84, 0x1e, 0x21, 0x03, 0x2e, 0x96, 0xc4, 0xa4, 0xe4, 0x4c, 0x09, 0x56, + 0xb0, 0x5e, 0x19, 0x4c, 0xbd, 0x8e, 0x4e, 0xce, 0x9e, 0x50, 0x6d, 0x60, 0x95, 0x4a, 0x62, 0x5c, + 0x22, 0xc8, 0x01, 0x16, 0x94, 0x5a, 0x5c, 0x00, 0x0a, 0x6f, 0x27, 0x8f, 0x13, 0x8f, 0xe4, 0x18, + 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, + 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0xd2, 0x4b, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, + 0xcf, 0xd5, 0x87, 0xc7, 0x23, 0x88, 0xd2, 0x2d, 0x4e, 0xc9, 0xd6, 0xaf, 0x40, 0x8a, 0x54, 0xb0, + 0x95, 0x49, 0x6c, 0xe0, 0xa8, 0x31, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xcd, 0xd4, 0x53, 0x90, + 0xf5, 0x01, 0x00, 0x00, } -func (m *MsgParams) Marshal() (dAtA []byte, err error) { +func (m *ConMsgParams) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -184,12 +184,12 @@ func (m *MsgParams) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgParams) MarshalTo(dAtA []byte) (int, error) { +func (m *ConMsgParams) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ConMsgParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -201,7 +201,7 @@ func (m *MsgParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintConsensusMsg(dAtA, i, uint64(size)) + i = encodeVarintConsensus(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x2a @@ -213,7 +213,7 @@ func (m *MsgParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintConsensusMsg(dAtA, i, uint64(size)) + i = encodeVarintConsensus(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x22 @@ -225,7 +225,7 @@ func (m *MsgParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintConsensusMsg(dAtA, i, uint64(size)) + i = encodeVarintConsensus(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a @@ -237,7 +237,7 @@ func (m *MsgParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintConsensusMsg(dAtA, i, uint64(size)) + i = encodeVarintConsensus(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 @@ -249,7 +249,7 @@ func (m *MsgParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintConsensusMsg(dAtA, i, uint64(size)) + i = encodeVarintConsensus(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa @@ -257,7 +257,7 @@ func (m *MsgParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgParamsResponse) Marshal() (dAtA []byte, err error) { +func (m *ConMsgParamsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -267,12 +267,12 @@ func (m *MsgParamsResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgParamsResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *ConMsgParamsResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ConMsgParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -280,8 +280,8 @@ func (m *MsgParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func encodeVarintConsensusMsg(dAtA []byte, offset int, v uint64) int { - offset -= sovConsensusMsg(v) +func encodeVarintConsensus(dAtA []byte, offset int, v uint64) int { + offset -= sovConsensus(v) base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) @@ -291,7 +291,7 @@ func encodeVarintConsensusMsg(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *MsgParams) Size() (n int) { +func (m *ConMsgParams) Size() (n int) { if m == nil { return 0 } @@ -299,28 +299,28 @@ func (m *MsgParams) Size() (n int) { _ = l if m.Version != nil { l = m.Version.Size() - n += 1 + l + sovConsensusMsg(uint64(l)) + n += 1 + l + sovConsensus(uint64(l)) } if m.Block != nil { l = m.Block.Size() - n += 1 + l + sovConsensusMsg(uint64(l)) + n += 1 + l + sovConsensus(uint64(l)) } if m.Evidence != nil { l = m.Evidence.Size() - n += 1 + l + sovConsensusMsg(uint64(l)) + n += 1 + l + sovConsensus(uint64(l)) } if m.Validator != nil { l = m.Validator.Size() - n += 1 + l + sovConsensusMsg(uint64(l)) + n += 1 + l + sovConsensus(uint64(l)) } if m.Abci != nil { l = m.Abci.Size() - n += 1 + l + sovConsensusMsg(uint64(l)) + n += 1 + l + sovConsensus(uint64(l)) } return n } -func (m *MsgParamsResponse) Size() (n int) { +func (m *ConMsgParamsResponse) Size() (n int) { if m == nil { return 0 } @@ -329,13 +329,13 @@ func (m *MsgParamsResponse) Size() (n int) { return n } -func sovConsensusMsg(x uint64) (n int) { +func sovConsensus(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } -func sozConsensusMsg(x uint64) (n int) { - return sovConsensusMsg(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +func sozConsensus(x uint64) (n int) { + return sovConsensus(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *MsgParams) Unmarshal(dAtA []byte) error { +func (m *ConMsgParams) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -343,7 +343,7 @@ func (m *MsgParams) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowConsensusMsg + return ErrIntOverflowConsensus } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -358,10 +358,10 @@ func (m *MsgParams) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgParams: wiretype end group for non-group") + return fmt.Errorf("proto: ConMsgParams: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgParams: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ConMsgParams: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -371,7 +371,7 @@ func (m *MsgParams) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowConsensusMsg + return ErrIntOverflowConsensus } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -384,11 +384,11 @@ func (m *MsgParams) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthConsensusMsg + return ErrInvalidLengthConsensus } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthConsensusMsg + return ErrInvalidLengthConsensus } if postIndex > l { return io.ErrUnexpectedEOF @@ -407,7 +407,7 @@ func (m *MsgParams) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowConsensusMsg + return ErrIntOverflowConsensus } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -420,11 +420,11 @@ func (m *MsgParams) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthConsensusMsg + return ErrInvalidLengthConsensus } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthConsensusMsg + return ErrInvalidLengthConsensus } if postIndex > l { return io.ErrUnexpectedEOF @@ -443,7 +443,7 @@ func (m *MsgParams) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowConsensusMsg + return ErrIntOverflowConsensus } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -456,11 +456,11 @@ func (m *MsgParams) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthConsensusMsg + return ErrInvalidLengthConsensus } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthConsensusMsg + return ErrInvalidLengthConsensus } if postIndex > l { return io.ErrUnexpectedEOF @@ -479,7 +479,7 @@ func (m *MsgParams) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowConsensusMsg + return ErrIntOverflowConsensus } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -492,11 +492,11 @@ func (m *MsgParams) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthConsensusMsg + return ErrInvalidLengthConsensus } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthConsensusMsg + return ErrInvalidLengthConsensus } if postIndex > l { return io.ErrUnexpectedEOF @@ -515,7 +515,7 @@ func (m *MsgParams) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowConsensusMsg + return ErrIntOverflowConsensus } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -528,11 +528,11 @@ func (m *MsgParams) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthConsensusMsg + return ErrInvalidLengthConsensus } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthConsensusMsg + return ErrInvalidLengthConsensus } if postIndex > l { return io.ErrUnexpectedEOF @@ -546,12 +546,12 @@ func (m *MsgParams) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipConsensusMsg(dAtA[iNdEx:]) + skippy, err := skipConsensus(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthConsensusMsg + return ErrInvalidLengthConsensus } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -565,7 +565,7 @@ func (m *MsgParams) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgParamsResponse) Unmarshal(dAtA []byte) error { +func (m *ConMsgParamsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -573,7 +573,7 @@ func (m *MsgParamsResponse) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowConsensusMsg + return ErrIntOverflowConsensus } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -588,20 +588,20 @@ func (m *MsgParamsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgParamsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: ConMsgParamsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ConMsgParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: iNdEx = preIndex - skippy, err := skipConsensusMsg(dAtA[iNdEx:]) + skippy, err := skipConsensus(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthConsensusMsg + return ErrInvalidLengthConsensus } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -615,7 +615,7 @@ func (m *MsgParamsResponse) Unmarshal(dAtA []byte) error { } return nil } -func skipConsensusMsg(dAtA []byte) (n int, err error) { +func skipConsensus(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 depth := 0 @@ -623,7 +623,7 @@ func skipConsensusMsg(dAtA []byte) (n int, err error) { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return 0, ErrIntOverflowConsensusMsg + return 0, ErrIntOverflowConsensus } if iNdEx >= l { return 0, io.ErrUnexpectedEOF @@ -640,7 +640,7 @@ func skipConsensusMsg(dAtA []byte) (n int, err error) { case 0: for shift := uint(0); ; shift += 7 { if shift >= 64 { - return 0, ErrIntOverflowConsensusMsg + return 0, ErrIntOverflowConsensus } if iNdEx >= l { return 0, io.ErrUnexpectedEOF @@ -656,7 +656,7 @@ func skipConsensusMsg(dAtA []byte) (n int, err error) { var length int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return 0, ErrIntOverflowConsensusMsg + return 0, ErrIntOverflowConsensus } if iNdEx >= l { return 0, io.ErrUnexpectedEOF @@ -669,14 +669,14 @@ func skipConsensusMsg(dAtA []byte) (n int, err error) { } } if length < 0 { - return 0, ErrInvalidLengthConsensusMsg + return 0, ErrInvalidLengthConsensus } iNdEx += length case 3: depth++ case 4: if depth == 0 { - return 0, ErrUnexpectedEndOfGroupConsensusMsg + return 0, ErrUnexpectedEndOfGroupConsensus } depth-- case 5: @@ -685,7 +685,7 @@ func skipConsensusMsg(dAtA []byte) (n int, err error) { return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } if iNdEx < 0 { - return 0, ErrInvalidLengthConsensusMsg + return 0, ErrInvalidLengthConsensus } if depth == 0 { return iNdEx, nil @@ -695,7 +695,7 @@ func skipConsensusMsg(dAtA []byte) (n int, err error) { } var ( - ErrInvalidLengthConsensusMsg = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowConsensusMsg = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupConsensusMsg = fmt.Errorf("proto: unexpected end of group") + 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 b62c0052f7cb..37bea4c0b7a5 100644 --- a/x/consensus/types/msgs.go +++ b/x/consensus/types/msgs.go @@ -5,12 +5,8 @@ import ( cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" cmttypes "github.com/cometbft/cometbft/types" - - sdk "github.com/cosmos/cosmos-sdk/types" ) -var _ sdk.Msg = &MsgUpdateParams{} - func (msg MsgUpdateParams) ToProtoConsensusParams() (cmtproto.ConsensusParams, error) { if msg.Evidence == nil || msg.Block == nil || msg.Validator == nil { return cmtproto.ConsensusParams{}, errors.New("all parameters must be present") From b95e7ea2e1855e788e80ec9ad802906e0cef0c78 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Tue, 20 Feb 2024 14:53:34 +0100 Subject: [PATCH 03/12] add api --- x/consensus/module.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/x/consensus/module.go b/x/consensus/module.go index a0fcc9b161fe..4f0ff1c26340 100644 --- a/x/consensus/module.go +++ b/x/consensus/module.go @@ -77,3 +77,8 @@ func NewAppModule(cdc codec.Codec, keeper keeper.Keeper) AppModule { // ConsensusVersion implements AppModule/ConsensusVersion. func (AppModule) ConsensusVersion() uint64 { return ConsensusVersion } + +// RegisterConsensusMessages registers the consensus module's messages. +func (am AppModule) RegisterConsensusMessages(builder any) { + // std.RegisterConsensusHandler(builder ,am.keeper.SetParams) // TODO uncomment when api is available +} From f183441f0c398a4da363a3d515bc1c5c05aab3c4 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Tue, 20 Feb 2024 14:56:43 +0100 Subject: [PATCH 04/12] add test case --- x/consensus/keeper/keeper.go | 1 - x/consensus/keeper/keeper_test.go | 98 +++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+), 1 deletion(-) diff --git a/x/consensus/keeper/keeper.go b/x/consensus/keeper/keeper.go index 1e212f558fca..49d3f4934d38 100644 --- a/x/consensus/keeper/keeper.go +++ b/x/consensus/keeper/keeper.go @@ -89,7 +89,6 @@ func (k Keeper) UpdateParams(ctx context.Context, msg *types.MsgUpdateParams) (* // SetParams sets the consensus parameters on init of a chain. This is a consensus message. It can only be called by the consensus server func (k Keeper) SetParams(ctx context.Context, req *types.ConMsgParams) (*types.ConMsgParamsResponse, error) { - consensusParams, err := req.ToProtoConsensusParams() if err != nil { return nil, err diff --git a/x/consensus/keeper/keeper_test.go b/x/consensus/keeper/keeper_test.go index b49c634f75d2..c0002a78a08d 100644 --- a/x/consensus/keeper/keeper_test.go +++ b/x/consensus/keeper/keeper_test.go @@ -233,3 +233,101 @@ func (s *KeeperTestSuite) TestUpdateParams() { }) } } +func (s *KeeperTestSuite) TestSetParams() { + defaultConsensusParams := cmttypes.DefaultConsensusParams().ToProto() + testCases := []struct { + name string + input *types.ConMsgParams + expErr bool + expErrMsg string + }{ + { + name: "valid params", + input: &types.ConMsgParams{ + Version: &cmtproto.VersionParams{App: 1}, + Block: defaultConsensusParams.Block, + Validator: defaultConsensusParams.Validator, + Evidence: defaultConsensusParams.Evidence, + }, + expErr: false, + expErrMsg: "", + }, + { + name: "invalid params", + input: &types.ConMsgParams{ + Version: &cmtproto.VersionParams{App: 1}, + Block: &cmtproto.BlockParams{MaxGas: -10, MaxBytes: -10}, + Validator: defaultConsensusParams.Validator, + Evidence: defaultConsensusParams.Evidence, + }, + expErr: true, + expErrMsg: "block.MaxBytes must be -1 or greater than 0. Got -10", + }, + { + name: "nil version params", + input: &types.ConMsgParams{ + Version: nil, + Block: defaultConsensusParams.Block, + Validator: defaultConsensusParams.Validator, + Evidence: defaultConsensusParams.Evidence, + }, + expErr: true, + expErrMsg: "all parameters must be present", + }, + { + name: "nil evidence params", + input: &types.ConMsgParams{ + Version: &cmtproto.VersionParams{App: 1}, + Block: defaultConsensusParams.Block, + Validator: defaultConsensusParams.Validator, + Evidence: nil, + }, + expErr: true, + expErrMsg: "all parameters must be present", + }, + { + name: "nil block params", + input: &types.ConMsgParams{ + Version: &cmtproto.VersionParams{App: 1}, + Block: nil, + Validator: defaultConsensusParams.Validator, + Evidence: defaultConsensusParams.Evidence, + }, + expErr: true, + expErrMsg: "all parameters must be present", + }, + { + name: "nil validator params", + input: &types.ConMsgParams{ + Version: &cmtproto.VersionParams{App: 1}, + Block: defaultConsensusParams.Block, + Validator: nil, + Evidence: defaultConsensusParams.Evidence, + }, + expErr: true, + expErrMsg: "all parameters must be present", + }, + } + + for _, tc := range testCases { + tc := tc + s.Run(tc.name, func() { + s.SetupTest() + _, err := s.consensusParamsKeeper.SetParams(s.ctx, tc.input) + if tc.expErr { + s.Require().Error(err) + s.Require().Contains(err.Error(), tc.expErrMsg) + } else { + s.Require().NoError(err) + + res, err := s.consensusParamsKeeper.Params(s.ctx, &types.QueryParamsRequest{}) + s.Require().NoError(err) + + s.Require().Equal(tc.input.Abci, res.Params.Abci) + s.Require().Equal(tc.input.Block, res.Params.Block) + s.Require().Equal(tc.input.Evidence, res.Params.Evidence) + s.Require().Equal(tc.input.Validator, res.Params.Validator) + } + }) + } +} From d76c1a6b8811862e354286c5c0e8140a526e17e4 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Tue, 20 Feb 2024 14:58:16 +0100 Subject: [PATCH 05/12] add changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2025ce83652a..007a36747f13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,7 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i * (types) [#18768](https://github.com/cosmos/cosmos-sdk/pull/18768) Add MustValAddressFromBech32 function. * (gRPC) [#19049](https://github.com/cosmos/cosmos-sdk/pull/19049) Add debug log prints for each gRPC request. * (server) [#19280](https://github.com/cosmos/cosmos-sdk/pull/19280) Adds in-place testnet CLI command. +* (x/consensus) [#19483](https://github.com/cosmos-sdk/pull/19483) Add consensus messages registration to consensus module. ### Improvements From d091a6807196da7026f07f591859a02de39c24b6 Mon Sep 17 00:00:00 2001 From: Marko Date: Thu, 22 Feb 2024 12:03:22 +0100 Subject: [PATCH 06/12] Update CHANGELOG.md Co-authored-by: Likhita Polavarapu <78951027+likhita-809@users.noreply.github.com> --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 007a36747f13..2042850e911d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,7 +53,7 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i * (types) [#18768](https://github.com/cosmos/cosmos-sdk/pull/18768) Add MustValAddressFromBech32 function. * (gRPC) [#19049](https://github.com/cosmos/cosmos-sdk/pull/19049) Add debug log prints for each gRPC request. * (server) [#19280](https://github.com/cosmos/cosmos-sdk/pull/19280) Adds in-place testnet CLI command. -* (x/consensus) [#19483](https://github.com/cosmos-sdk/pull/19483) Add consensus messages registration to consensus module. +* (x/consensus) [#19483](https://github.com/cosmos/cosmos-sdk/pull/19483) Add consensus messages registration to consensus module. ### Improvements From ffbc1d163a728b55139837b99ded0d39a39a81f1 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Thu, 22 Feb 2024 12:12:03 +0100 Subject: [PATCH 07/12] comments --- x/consensus/keeper/keeper_test.go | 13 +++++++++++++ x/consensus/types/msgs.go | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/x/consensus/keeper/keeper_test.go b/x/consensus/keeper/keeper_test.go index c0002a78a08d..25a4d0606f6b 100644 --- a/x/consensus/keeper/keeper_test.go +++ b/x/consensus/keeper/keeper_test.go @@ -150,6 +150,7 @@ func (s *KeeperTestSuite) TestUpdateParams() { Block: defaultConsensusParams.Block, Validator: defaultConsensusParams.Validator, Evidence: defaultConsensusParams.Evidence, + Abci: defaultConsensusParams.Abci, }, expErr: false, expErrMsg: "", @@ -161,6 +162,7 @@ func (s *KeeperTestSuite) TestUpdateParams() { Block: &cmtproto.BlockParams{MaxGas: -10, MaxBytes: -10}, Validator: defaultConsensusParams.Validator, Evidence: defaultConsensusParams.Evidence, + Abci: defaultConsensusParams.Abci, }, expErr: true, expErrMsg: "block.MaxBytes must be -1 or greater than 0. Got -10", @@ -172,6 +174,7 @@ func (s *KeeperTestSuite) TestUpdateParams() { Block: defaultConsensusParams.Block, Validator: defaultConsensusParams.Validator, Evidence: defaultConsensusParams.Evidence, + Abci: defaultConsensusParams.Abci, }, expErr: true, expErrMsg: "invalid authority", @@ -183,6 +186,7 @@ func (s *KeeperTestSuite) TestUpdateParams() { Block: defaultConsensusParams.Block, Validator: defaultConsensusParams.Validator, Evidence: nil, + Abci: defaultConsensusParams.Abci, }, expErr: true, expErrMsg: "all parameters must be present", @@ -194,6 +198,7 @@ func (s *KeeperTestSuite) TestUpdateParams() { Block: nil, Validator: defaultConsensusParams.Validator, Evidence: defaultConsensusParams.Evidence, + Abci: defaultConsensusParams.Abci, }, expErr: true, expErrMsg: "all parameters must be present", @@ -205,6 +210,7 @@ func (s *KeeperTestSuite) TestUpdateParams() { Block: defaultConsensusParams.Block, Validator: nil, Evidence: defaultConsensusParams.Evidence, + Abci: defaultConsensusParams.Abci, }, expErr: true, expErrMsg: "all parameters must be present", @@ -244,6 +250,7 @@ func (s *KeeperTestSuite) TestSetParams() { { name: "valid params", input: &types.ConMsgParams{ + Abci: defaultConsensusParams.Abci, Version: &cmtproto.VersionParams{App: 1}, Block: defaultConsensusParams.Block, Validator: defaultConsensusParams.Validator, @@ -255,6 +262,7 @@ func (s *KeeperTestSuite) TestSetParams() { { name: "invalid params", input: &types.ConMsgParams{ + Abci: defaultConsensusParams.Abci, Version: &cmtproto.VersionParams{App: 1}, Block: &cmtproto.BlockParams{MaxGas: -10, MaxBytes: -10}, Validator: defaultConsensusParams.Validator, @@ -266,6 +274,7 @@ func (s *KeeperTestSuite) TestSetParams() { { name: "nil version params", input: &types.ConMsgParams{ + Abci: defaultConsensusParams.Abci, Version: nil, Block: defaultConsensusParams.Block, Validator: defaultConsensusParams.Validator, @@ -277,6 +286,7 @@ func (s *KeeperTestSuite) TestSetParams() { { name: "nil evidence params", input: &types.ConMsgParams{ + Abci: defaultConsensusParams.Abci, Version: &cmtproto.VersionParams{App: 1}, Block: defaultConsensusParams.Block, Validator: defaultConsensusParams.Validator, @@ -288,6 +298,7 @@ func (s *KeeperTestSuite) TestSetParams() { { name: "nil block params", input: &types.ConMsgParams{ + Abci: defaultConsensusParams.Abci, Version: &cmtproto.VersionParams{App: 1}, Block: nil, Validator: defaultConsensusParams.Validator, @@ -299,6 +310,7 @@ func (s *KeeperTestSuite) TestSetParams() { { name: "nil validator params", input: &types.ConMsgParams{ + Abci: defaultConsensusParams.Abci, Version: &cmtproto.VersionParams{App: 1}, Block: defaultConsensusParams.Block, Validator: nil, @@ -327,6 +339,7 @@ func (s *KeeperTestSuite) TestSetParams() { s.Require().Equal(tc.input.Block, res.Params.Block) s.Require().Equal(tc.input.Evidence, res.Params.Evidence) s.Require().Equal(tc.input.Validator, res.Params.Validator) + s.Require().Equal(tc.input.Version, res.Params.Version) } }) } diff --git a/x/consensus/types/msgs.go b/x/consensus/types/msgs.go index 37bea4c0b7a5..a64440f5b139 100644 --- a/x/consensus/types/msgs.go +++ b/x/consensus/types/msgs.go @@ -8,7 +8,7 @@ import ( ) func (msg MsgUpdateParams) ToProtoConsensusParams() (cmtproto.ConsensusParams, error) { - if msg.Evidence == nil || msg.Block == nil || msg.Validator == nil { + if msg.Evidence == nil || msg.Block == nil || msg.Validator == nil || msg.Abci == nil { return cmtproto.ConsensusParams{}, errors.New("all parameters must be present") } From 32e6d7c3412818f8578b3673ce079c9d2a742fc9 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Thu, 22 Feb 2024 12:14:00 +0100 Subject: [PATCH 08/12] lint fix --- x/consensus/keeper/keeper_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/x/consensus/keeper/keeper_test.go b/x/consensus/keeper/keeper_test.go index 25a4d0606f6b..d2e94e91779e 100644 --- a/x/consensus/keeper/keeper_test.go +++ b/x/consensus/keeper/keeper_test.go @@ -239,6 +239,7 @@ func (s *KeeperTestSuite) TestUpdateParams() { }) } } + func (s *KeeperTestSuite) TestSetParams() { defaultConsensusParams := cmttypes.DefaultConsensusParams().ToProto() testCases := []struct { From 381de6452693a9338371223c232fba0c42773a4b Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Thu, 22 Feb 2024 13:56:22 +0100 Subject: [PATCH 09/12] fix --- x/consensus/keeper/keeper_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/x/consensus/keeper/keeper_test.go b/x/consensus/keeper/keeper_test.go index d2e94e91779e..dea63f8684cf 100644 --- a/x/consensus/keeper/keeper_test.go +++ b/x/consensus/keeper/keeper_test.go @@ -69,6 +69,7 @@ func (s *KeeperTestSuite) TestGRPCQueryConsensusParams() { Block: defaultConsensusParams.Block, Validator: defaultConsensusParams.Validator, Evidence: defaultConsensusParams.Evidence, + Abci: defaultConsensusParams.Abci, } _, err := s.consensusParamsKeeper.UpdateParams(s.ctx, input) s.Require().NoError(err) @@ -79,6 +80,7 @@ func (s *KeeperTestSuite) TestGRPCQueryConsensusParams() { Validator: defaultConsensusParams.Validator, Evidence: defaultConsensusParams.Evidence, Version: defaultConsensusParams.Version, + Abci: defaultConsensusParams.Abci, }, }, true, From 09d8a400711d026168604a86854e1c2090fd294b Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Fri, 23 Feb 2024 11:04:44 +0100 Subject: [PATCH 10/12] add docs --- api/cosmos/consensus/v1/consensus.pulsar.go | 449 ++++++++++---------- proto/cosmos/consensus/v1/consensus.proto | 10 +- x/consensus/README.md | 72 ++++ x/consensus/keeper/keeper.go | 5 +- x/consensus/types/consensus.go | 2 +- x/consensus/types/consensus.pb.go | 146 +++---- 6 files changed, 379 insertions(+), 305 deletions(-) diff --git a/api/cosmos/consensus/v1/consensus.pulsar.go b/api/cosmos/consensus/v1/consensus.pulsar.go index 22de0262f670..039a6abf1634 100644 --- a/api/cosmos/consensus/v1/consensus.pulsar.go +++ b/api/cosmos/consensus/v1/consensus.pulsar.go @@ -14,33 +14,33 @@ import ( ) var ( - md_ConMsgParams protoreflect.MessageDescriptor - fd_ConMsgParams_version protoreflect.FieldDescriptor - fd_ConMsgParams_block protoreflect.FieldDescriptor - fd_ConMsgParams_evidence protoreflect.FieldDescriptor - fd_ConMsgParams_validator protoreflect.FieldDescriptor - fd_ConMsgParams_abci protoreflect.FieldDescriptor + md_ConsensusMsgParams protoreflect.MessageDescriptor + fd_ConsensusMsgParams_version protoreflect.FieldDescriptor + fd_ConsensusMsgParams_block protoreflect.FieldDescriptor + fd_ConsensusMsgParams_evidence protoreflect.FieldDescriptor + fd_ConsensusMsgParams_validator protoreflect.FieldDescriptor + fd_ConsensusMsgParams_abci protoreflect.FieldDescriptor ) func init() { file_cosmos_consensus_v1_consensus_proto_init() - md_ConMsgParams = File_cosmos_consensus_v1_consensus_proto.Messages().ByName("ConMsgParams") - fd_ConMsgParams_version = md_ConMsgParams.Fields().ByName("version") - fd_ConMsgParams_block = md_ConMsgParams.Fields().ByName("block") - fd_ConMsgParams_evidence = md_ConMsgParams.Fields().ByName("evidence") - fd_ConMsgParams_validator = md_ConMsgParams.Fields().ByName("validator") - fd_ConMsgParams_abci = md_ConMsgParams.Fields().ByName("abci") + md_ConsensusMsgParams = File_cosmos_consensus_v1_consensus_proto.Messages().ByName("ConsensusMsgParams") + fd_ConsensusMsgParams_version = md_ConsensusMsgParams.Fields().ByName("version") + fd_ConsensusMsgParams_block = md_ConsensusMsgParams.Fields().ByName("block") + fd_ConsensusMsgParams_evidence = md_ConsensusMsgParams.Fields().ByName("evidence") + fd_ConsensusMsgParams_validator = md_ConsensusMsgParams.Fields().ByName("validator") + fd_ConsensusMsgParams_abci = md_ConsensusMsgParams.Fields().ByName("abci") } -var _ protoreflect.Message = (*fastReflection_ConMsgParams)(nil) +var _ protoreflect.Message = (*fastReflection_ConsensusMsgParams)(nil) -type fastReflection_ConMsgParams ConMsgParams +type fastReflection_ConsensusMsgParams ConsensusMsgParams -func (x *ConMsgParams) ProtoReflect() protoreflect.Message { - return (*fastReflection_ConMsgParams)(x) +func (x *ConsensusMsgParams) ProtoReflect() protoreflect.Message { + return (*fastReflection_ConsensusMsgParams)(x) } -func (x *ConMsgParams) slowProtoReflect() protoreflect.Message { +func (x *ConsensusMsgParams) slowProtoReflect() protoreflect.Message { mi := &file_cosmos_consensus_v1_consensus_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -52,43 +52,43 @@ func (x *ConMsgParams) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_ConMsgParams_messageType fastReflection_ConMsgParams_messageType -var _ protoreflect.MessageType = fastReflection_ConMsgParams_messageType{} +var _fastReflection_ConsensusMsgParams_messageType fastReflection_ConsensusMsgParams_messageType +var _ protoreflect.MessageType = fastReflection_ConsensusMsgParams_messageType{} -type fastReflection_ConMsgParams_messageType struct{} +type fastReflection_ConsensusMsgParams_messageType struct{} -func (x fastReflection_ConMsgParams_messageType) Zero() protoreflect.Message { - return (*fastReflection_ConMsgParams)(nil) +func (x fastReflection_ConsensusMsgParams_messageType) Zero() protoreflect.Message { + return (*fastReflection_ConsensusMsgParams)(nil) } -func (x fastReflection_ConMsgParams_messageType) New() protoreflect.Message { - return new(fastReflection_ConMsgParams) +func (x fastReflection_ConsensusMsgParams_messageType) New() protoreflect.Message { + return new(fastReflection_ConsensusMsgParams) } -func (x fastReflection_ConMsgParams_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_ConMsgParams +func (x fastReflection_ConsensusMsgParams_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ConsensusMsgParams } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_ConMsgParams) Descriptor() protoreflect.MessageDescriptor { - return md_ConMsgParams +func (x *fastReflection_ConsensusMsgParams) Descriptor() protoreflect.MessageDescriptor { + return md_ConsensusMsgParams } // 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_ConMsgParams) Type() protoreflect.MessageType { - return _fastReflection_ConMsgParams_messageType +func (x *fastReflection_ConsensusMsgParams) Type() protoreflect.MessageType { + return _fastReflection_ConsensusMsgParams_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_ConMsgParams) New() protoreflect.Message { - return new(fastReflection_ConMsgParams) +func (x *fastReflection_ConsensusMsgParams) New() protoreflect.Message { + return new(fastReflection_ConsensusMsgParams) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_ConMsgParams) Interface() protoreflect.ProtoMessage { - return (*ConMsgParams)(x) +func (x *fastReflection_ConsensusMsgParams) Interface() protoreflect.ProtoMessage { + return (*ConsensusMsgParams)(x) } // Range iterates over every populated field in an undefined order, @@ -96,34 +96,34 @@ func (x *fastReflection_ConMsgParams) Interface() protoreflect.ProtoMessage { // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_ConMsgParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_ConsensusMsgParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.Version != nil { value := protoreflect.ValueOfMessage(x.Version.ProtoReflect()) - if !f(fd_ConMsgParams_version, value) { + if !f(fd_ConsensusMsgParams_version, value) { return } } if x.Block != nil { value := protoreflect.ValueOfMessage(x.Block.ProtoReflect()) - if !f(fd_ConMsgParams_block, value) { + if !f(fd_ConsensusMsgParams_block, value) { return } } if x.Evidence != nil { value := protoreflect.ValueOfMessage(x.Evidence.ProtoReflect()) - if !f(fd_ConMsgParams_evidence, value) { + if !f(fd_ConsensusMsgParams_evidence, value) { return } } if x.Validator != nil { value := protoreflect.ValueOfMessage(x.Validator.ProtoReflect()) - if !f(fd_ConMsgParams_validator, value) { + if !f(fd_ConsensusMsgParams_validator, value) { return } } if x.Abci != nil { value := protoreflect.ValueOfMessage(x.Abci.ProtoReflect()) - if !f(fd_ConMsgParams_abci, value) { + if !f(fd_ConsensusMsgParams_abci, value) { return } } @@ -140,23 +140,23 @@ func (x *fastReflection_ConMsgParams) Range(f func(protoreflect.FieldDescriptor, // 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_ConMsgParams) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_ConsensusMsgParams) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "cosmos.consensus.v1.ConMsgParams.version": + case "cosmos.consensus.v1.ConsensusMsgParams.version": return x.Version != nil - case "cosmos.consensus.v1.ConMsgParams.block": + case "cosmos.consensus.v1.ConsensusMsgParams.block": return x.Block != nil - case "cosmos.consensus.v1.ConMsgParams.evidence": + case "cosmos.consensus.v1.ConsensusMsgParams.evidence": return x.Evidence != nil - case "cosmos.consensus.v1.ConMsgParams.validator": + case "cosmos.consensus.v1.ConsensusMsgParams.validator": return x.Validator != nil - case "cosmos.consensus.v1.ConMsgParams.abci": + case "cosmos.consensus.v1.ConsensusMsgParams.abci": return x.Abci != nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConMsgParams")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConsensusMsgParams")) } - panic(fmt.Errorf("message cosmos.consensus.v1.ConMsgParams does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.ConsensusMsgParams does not contain field %s", fd.FullName())) } } @@ -166,23 +166,23 @@ func (x *fastReflection_ConMsgParams) Has(fd protoreflect.FieldDescriptor) bool // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_ConMsgParams) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_ConsensusMsgParams) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "cosmos.consensus.v1.ConMsgParams.version": + case "cosmos.consensus.v1.ConsensusMsgParams.version": x.Version = nil - case "cosmos.consensus.v1.ConMsgParams.block": + case "cosmos.consensus.v1.ConsensusMsgParams.block": x.Block = nil - case "cosmos.consensus.v1.ConMsgParams.evidence": + case "cosmos.consensus.v1.ConsensusMsgParams.evidence": x.Evidence = nil - case "cosmos.consensus.v1.ConMsgParams.validator": + case "cosmos.consensus.v1.ConsensusMsgParams.validator": x.Validator = nil - case "cosmos.consensus.v1.ConMsgParams.abci": + case "cosmos.consensus.v1.ConsensusMsgParams.abci": x.Abci = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConMsgParams")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConsensusMsgParams")) } - panic(fmt.Errorf("message cosmos.consensus.v1.ConMsgParams does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.ConsensusMsgParams does not contain field %s", fd.FullName())) } } @@ -192,28 +192,28 @@ func (x *fastReflection_ConMsgParams) Clear(fd protoreflect.FieldDescriptor) { // 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_ConMsgParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_ConsensusMsgParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "cosmos.consensus.v1.ConMsgParams.version": + case "cosmos.consensus.v1.ConsensusMsgParams.version": value := x.Version return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "cosmos.consensus.v1.ConMsgParams.block": + case "cosmos.consensus.v1.ConsensusMsgParams.block": value := x.Block return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "cosmos.consensus.v1.ConMsgParams.evidence": + case "cosmos.consensus.v1.ConsensusMsgParams.evidence": value := x.Evidence return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "cosmos.consensus.v1.ConMsgParams.validator": + case "cosmos.consensus.v1.ConsensusMsgParams.validator": value := x.Validator return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "cosmos.consensus.v1.ConMsgParams.abci": + case "cosmos.consensus.v1.ConsensusMsgParams.abci": value := x.Abci return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConMsgParams")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConsensusMsgParams")) } - panic(fmt.Errorf("message cosmos.consensus.v1.ConMsgParams does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.ConsensusMsgParams does not contain field %s", descriptor.FullName())) } } @@ -227,23 +227,23 @@ func (x *fastReflection_ConMsgParams) Get(descriptor protoreflect.FieldDescripto // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_ConMsgParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_ConsensusMsgParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "cosmos.consensus.v1.ConMsgParams.version": + case "cosmos.consensus.v1.ConsensusMsgParams.version": x.Version = value.Message().Interface().(*types.VersionParams) - case "cosmos.consensus.v1.ConMsgParams.block": + case "cosmos.consensus.v1.ConsensusMsgParams.block": x.Block = value.Message().Interface().(*types.BlockParams) - case "cosmos.consensus.v1.ConMsgParams.evidence": + case "cosmos.consensus.v1.ConsensusMsgParams.evidence": x.Evidence = value.Message().Interface().(*types.EvidenceParams) - case "cosmos.consensus.v1.ConMsgParams.validator": + case "cosmos.consensus.v1.ConsensusMsgParams.validator": x.Validator = value.Message().Interface().(*types.ValidatorParams) - case "cosmos.consensus.v1.ConMsgParams.abci": + case "cosmos.consensus.v1.ConsensusMsgParams.abci": x.Abci = value.Message().Interface().(*types.ABCIParams) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConMsgParams")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConsensusMsgParams")) } - panic(fmt.Errorf("message cosmos.consensus.v1.ConMsgParams does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.ConsensusMsgParams does not contain field %s", fd.FullName())) } } @@ -257,76 +257,76 @@ func (x *fastReflection_ConMsgParams) Set(fd protoreflect.FieldDescriptor, value // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_ConMsgParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_ConsensusMsgParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.consensus.v1.ConMsgParams.version": + case "cosmos.consensus.v1.ConsensusMsgParams.version": if x.Version == nil { x.Version = new(types.VersionParams) } return protoreflect.ValueOfMessage(x.Version.ProtoReflect()) - case "cosmos.consensus.v1.ConMsgParams.block": + case "cosmos.consensus.v1.ConsensusMsgParams.block": if x.Block == nil { x.Block = new(types.BlockParams) } return protoreflect.ValueOfMessage(x.Block.ProtoReflect()) - case "cosmos.consensus.v1.ConMsgParams.evidence": + case "cosmos.consensus.v1.ConsensusMsgParams.evidence": if x.Evidence == nil { x.Evidence = new(types.EvidenceParams) } return protoreflect.ValueOfMessage(x.Evidence.ProtoReflect()) - case "cosmos.consensus.v1.ConMsgParams.validator": + case "cosmos.consensus.v1.ConsensusMsgParams.validator": if x.Validator == nil { x.Validator = new(types.ValidatorParams) } return protoreflect.ValueOfMessage(x.Validator.ProtoReflect()) - case "cosmos.consensus.v1.ConMsgParams.abci": + case "cosmos.consensus.v1.ConsensusMsgParams.abci": if x.Abci == nil { x.Abci = new(types.ABCIParams) } return protoreflect.ValueOfMessage(x.Abci.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConMsgParams")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConsensusMsgParams")) } - panic(fmt.Errorf("message cosmos.consensus.v1.ConMsgParams does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.ConsensusMsgParams 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_ConMsgParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_ConsensusMsgParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.consensus.v1.ConMsgParams.version": + case "cosmos.consensus.v1.ConsensusMsgParams.version": m := new(types.VersionParams) return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "cosmos.consensus.v1.ConMsgParams.block": + case "cosmos.consensus.v1.ConsensusMsgParams.block": m := new(types.BlockParams) return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "cosmos.consensus.v1.ConMsgParams.evidence": + case "cosmos.consensus.v1.ConsensusMsgParams.evidence": m := new(types.EvidenceParams) return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "cosmos.consensus.v1.ConMsgParams.validator": + case "cosmos.consensus.v1.ConsensusMsgParams.validator": m := new(types.ValidatorParams) return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "cosmos.consensus.v1.ConMsgParams.abci": + case "cosmos.consensus.v1.ConsensusMsgParams.abci": m := new(types.ABCIParams) return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConMsgParams")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConsensusMsgParams")) } - panic(fmt.Errorf("message cosmos.consensus.v1.ConMsgParams does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.ConsensusMsgParams 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_ConMsgParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_ConsensusMsgParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.consensus.v1.ConMsgParams", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in cosmos.consensus.v1.ConsensusMsgParams", d.FullName())) } panic("unreachable") } @@ -334,7 +334,7 @@ func (x *fastReflection_ConMsgParams) WhichOneof(d protoreflect.OneofDescriptor) // 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_ConMsgParams) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_ConsensusMsgParams) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -345,7 +345,7 @@ func (x *fastReflection_ConMsgParams) GetUnknown() protoreflect.RawFields { // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_ConMsgParams) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_ConsensusMsgParams) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -357,7 +357,7 @@ func (x *fastReflection_ConMsgParams) SetUnknown(fields protoreflect.RawFields) // 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_ConMsgParams) IsValid() bool { +func (x *fastReflection_ConsensusMsgParams) IsValid() bool { return x != nil } @@ -367,9 +367,9 @@ func (x *fastReflection_ConMsgParams) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_ConMsgParams) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_ConsensusMsgParams) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*ConMsgParams) + x := input.Message.Interface().(*ConsensusMsgParams) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -411,7 +411,7 @@ func (x *fastReflection_ConMsgParams) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*ConMsgParams) + x := input.Message.Interface().(*ConsensusMsgParams) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -511,7 +511,7 @@ func (x *fastReflection_ConMsgParams) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*ConMsgParams) + x := input.Message.Interface().(*ConsensusMsgParams) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -543,10 +543,10 @@ func (x *fastReflection_ConMsgParams) ProtoMethods() *protoiface.Methods { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ConMsgParams: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ConsensusMsgParams: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ConMsgParams: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ConsensusMsgParams: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -765,23 +765,23 @@ func (x *fastReflection_ConMsgParams) ProtoMethods() *protoiface.Methods { } var ( - md_ConMsgParamsResponse protoreflect.MessageDescriptor + md_ConsensusMsgParamsResponse protoreflect.MessageDescriptor ) func init() { file_cosmos_consensus_v1_consensus_proto_init() - md_ConMsgParamsResponse = File_cosmos_consensus_v1_consensus_proto.Messages().ByName("ConMsgParamsResponse") + md_ConsensusMsgParamsResponse = File_cosmos_consensus_v1_consensus_proto.Messages().ByName("ConsensusMsgParamsResponse") } -var _ protoreflect.Message = (*fastReflection_ConMsgParamsResponse)(nil) +var _ protoreflect.Message = (*fastReflection_ConsensusMsgParamsResponse)(nil) -type fastReflection_ConMsgParamsResponse ConMsgParamsResponse +type fastReflection_ConsensusMsgParamsResponse ConsensusMsgParamsResponse -func (x *ConMsgParamsResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_ConMsgParamsResponse)(x) +func (x *ConsensusMsgParamsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_ConsensusMsgParamsResponse)(x) } -func (x *ConMsgParamsResponse) slowProtoReflect() protoreflect.Message { +func (x *ConsensusMsgParamsResponse) slowProtoReflect() protoreflect.Message { mi := &file_cosmos_consensus_v1_consensus_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -793,43 +793,43 @@ func (x *ConMsgParamsResponse) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_ConMsgParamsResponse_messageType fastReflection_ConMsgParamsResponse_messageType -var _ protoreflect.MessageType = fastReflection_ConMsgParamsResponse_messageType{} +var _fastReflection_ConsensusMsgParamsResponse_messageType fastReflection_ConsensusMsgParamsResponse_messageType +var _ protoreflect.MessageType = fastReflection_ConsensusMsgParamsResponse_messageType{} -type fastReflection_ConMsgParamsResponse_messageType struct{} +type fastReflection_ConsensusMsgParamsResponse_messageType struct{} -func (x fastReflection_ConMsgParamsResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_ConMsgParamsResponse)(nil) +func (x fastReflection_ConsensusMsgParamsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_ConsensusMsgParamsResponse)(nil) } -func (x fastReflection_ConMsgParamsResponse_messageType) New() protoreflect.Message { - return new(fastReflection_ConMsgParamsResponse) +func (x fastReflection_ConsensusMsgParamsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_ConsensusMsgParamsResponse) } -func (x fastReflection_ConMsgParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_ConMsgParamsResponse +func (x fastReflection_ConsensusMsgParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ConsensusMsgParamsResponse } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_ConMsgParamsResponse) Descriptor() protoreflect.MessageDescriptor { - return md_ConMsgParamsResponse +func (x *fastReflection_ConsensusMsgParamsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_ConsensusMsgParamsResponse } // 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_ConMsgParamsResponse) Type() protoreflect.MessageType { - return _fastReflection_ConMsgParamsResponse_messageType +func (x *fastReflection_ConsensusMsgParamsResponse) Type() protoreflect.MessageType { + return _fastReflection_ConsensusMsgParamsResponse_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_ConMsgParamsResponse) New() protoreflect.Message { - return new(fastReflection_ConMsgParamsResponse) +func (x *fastReflection_ConsensusMsgParamsResponse) New() protoreflect.Message { + return new(fastReflection_ConsensusMsgParamsResponse) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_ConMsgParamsResponse) Interface() protoreflect.ProtoMessage { - return (*ConMsgParamsResponse)(x) +func (x *fastReflection_ConsensusMsgParamsResponse) Interface() protoreflect.ProtoMessage { + return (*ConsensusMsgParamsResponse)(x) } // Range iterates over every populated field in an undefined order, @@ -837,7 +837,7 @@ func (x *fastReflection_ConMsgParamsResponse) Interface() protoreflect.ProtoMess // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_ConMsgParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_ConsensusMsgParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { } // Has reports whether a field is populated. @@ -851,13 +851,13 @@ func (x *fastReflection_ConMsgParamsResponse) Range(f func(protoreflect.FieldDes // 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_ConMsgParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_ConsensusMsgParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConMsgParamsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConsensusMsgParamsResponse")) } - panic(fmt.Errorf("message cosmos.consensus.v1.ConMsgParamsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.ConsensusMsgParamsResponse does not contain field %s", fd.FullName())) } } @@ -867,13 +867,13 @@ func (x *fastReflection_ConMsgParamsResponse) Has(fd protoreflect.FieldDescripto // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_ConMsgParamsResponse) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_ConsensusMsgParamsResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConMsgParamsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConsensusMsgParamsResponse")) } - panic(fmt.Errorf("message cosmos.consensus.v1.ConMsgParamsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.ConsensusMsgParamsResponse does not contain field %s", fd.FullName())) } } @@ -883,13 +883,13 @@ func (x *fastReflection_ConMsgParamsResponse) Clear(fd protoreflect.FieldDescrip // 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_ConMsgParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_ConsensusMsgParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConMsgParamsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConsensusMsgParamsResponse")) } - panic(fmt.Errorf("message cosmos.consensus.v1.ConMsgParamsResponse does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.ConsensusMsgParamsResponse does not contain field %s", descriptor.FullName())) } } @@ -903,13 +903,13 @@ func (x *fastReflection_ConMsgParamsResponse) Get(descriptor protoreflect.FieldD // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_ConMsgParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_ConsensusMsgParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConMsgParamsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConsensusMsgParamsResponse")) } - panic(fmt.Errorf("message cosmos.consensus.v1.ConMsgParamsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.ConsensusMsgParamsResponse does not contain field %s", fd.FullName())) } } @@ -923,36 +923,36 @@ func (x *fastReflection_ConMsgParamsResponse) Set(fd protoreflect.FieldDescripto // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_ConMsgParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_ConsensusMsgParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConMsgParamsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConsensusMsgParamsResponse")) } - panic(fmt.Errorf("message cosmos.consensus.v1.ConMsgParamsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.ConsensusMsgParamsResponse 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_ConMsgParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_ConsensusMsgParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConMsgParamsResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.consensus.v1.ConsensusMsgParamsResponse")) } - panic(fmt.Errorf("message cosmos.consensus.v1.ConMsgParamsResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.consensus.v1.ConsensusMsgParamsResponse 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_ConMsgParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_ConsensusMsgParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.consensus.v1.ConMsgParamsResponse", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in cosmos.consensus.v1.ConsensusMsgParamsResponse", d.FullName())) } panic("unreachable") } @@ -960,7 +960,7 @@ func (x *fastReflection_ConMsgParamsResponse) WhichOneof(d protoreflect.OneofDes // 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_ConMsgParamsResponse) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_ConsensusMsgParamsResponse) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -971,7 +971,7 @@ func (x *fastReflection_ConMsgParamsResponse) GetUnknown() protoreflect.RawField // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_ConMsgParamsResponse) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_ConsensusMsgParamsResponse) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -983,7 +983,7 @@ func (x *fastReflection_ConMsgParamsResponse) SetUnknown(fields protoreflect.Raw // 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_ConMsgParamsResponse) IsValid() bool { +func (x *fastReflection_ConsensusMsgParamsResponse) IsValid() bool { return x != nil } @@ -993,9 +993,9 @@ func (x *fastReflection_ConMsgParamsResponse) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_ConMsgParamsResponse) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_ConsensusMsgParamsResponse) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*ConMsgParamsResponse) + x := input.Message.Interface().(*ConsensusMsgParamsResponse) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1017,7 +1017,7 @@ func (x *fastReflection_ConMsgParamsResponse) ProtoMethods() *protoiface.Methods } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*ConMsgParamsResponse) + x := input.Message.Interface().(*ConsensusMsgParamsResponse) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1047,7 +1047,7 @@ func (x *fastReflection_ConMsgParamsResponse) ProtoMethods() *protoiface.Methods }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*ConMsgParamsResponse) + x := input.Message.Interface().(*ConsensusMsgParamsResponse) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1079,10 +1079,10 @@ func (x *fastReflection_ConMsgParamsResponse) ProtoMethods() *protoiface.Methods fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ConMsgParamsResponse: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ConsensusMsgParamsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ConMsgParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ConsensusMsgParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -1135,8 +1135,8 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// ConMsgParams is the Msg/Params request type. This is a consensus message that is sent from cometbft. -type ConMsgParams struct { +// ConsensusMsgParams is the Msg/Params request type. This is a consensus message that is sent from cometbft. +type ConsensusMsgParams struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -1151,8 +1151,8 @@ type ConMsgParams struct { Abci *types.ABCIParams `protobuf:"bytes,5,opt,name=abci,proto3" json:"abci,omitempty"` } -func (x *ConMsgParams) Reset() { - *x = ConMsgParams{} +func (x *ConsensusMsgParams) Reset() { + *x = ConsensusMsgParams{} if protoimpl.UnsafeEnabled { mi := &file_cosmos_consensus_v1_consensus_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1160,62 +1160,62 @@ func (x *ConMsgParams) Reset() { } } -func (x *ConMsgParams) String() string { +func (x *ConsensusMsgParams) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ConMsgParams) ProtoMessage() {} +func (*ConsensusMsgParams) ProtoMessage() {} -// Deprecated: Use ConMsgParams.ProtoReflect.Descriptor instead. -func (*ConMsgParams) Descriptor() ([]byte, []int) { +// Deprecated: Use ConsensusMsgParams.ProtoReflect.Descriptor instead. +func (*ConsensusMsgParams) Descriptor() ([]byte, []int) { return file_cosmos_consensus_v1_consensus_proto_rawDescGZIP(), []int{0} } -func (x *ConMsgParams) GetVersion() *types.VersionParams { +func (x *ConsensusMsgParams) GetVersion() *types.VersionParams { if x != nil { return x.Version } return nil } -func (x *ConMsgParams) GetBlock() *types.BlockParams { +func (x *ConsensusMsgParams) GetBlock() *types.BlockParams { if x != nil { return x.Block } return nil } -func (x *ConMsgParams) GetEvidence() *types.EvidenceParams { +func (x *ConsensusMsgParams) GetEvidence() *types.EvidenceParams { if x != nil { return x.Evidence } return nil } -func (x *ConMsgParams) GetValidator() *types.ValidatorParams { +func (x *ConsensusMsgParams) GetValidator() *types.ValidatorParams { if x != nil { return x.Validator } return nil } -func (x *ConMsgParams) GetAbci() *types.ABCIParams { +func (x *ConsensusMsgParams) GetAbci() *types.ABCIParams { if x != nil { return x.Abci } return nil } -// ConMsgParamsResponse defines the response structure for executing a -// ConMsgParams message. -type ConMsgParamsResponse struct { +// ConsensusMsgParamsResponse defines the response structure for executing a +// ConsensusMsgParams message. +type ConsensusMsgParamsResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields } -func (x *ConMsgParamsResponse) Reset() { - *x = ConMsgParamsResponse{} +func (x *ConsensusMsgParamsResponse) Reset() { + *x = ConsensusMsgParamsResponse{} if protoimpl.UnsafeEnabled { mi := &file_cosmos_consensus_v1_consensus_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1223,14 +1223,14 @@ func (x *ConMsgParamsResponse) Reset() { } } -func (x *ConMsgParamsResponse) String() string { +func (x *ConsensusMsgParamsResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ConMsgParamsResponse) ProtoMessage() {} +func (*ConsensusMsgParamsResponse) ProtoMessage() {} -// Deprecated: Use ConMsgParamsResponse.ProtoReflect.Descriptor instead. -func (*ConMsgParamsResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use ConsensusMsgParamsResponse.ProtoReflect.Descriptor instead. +func (*ConsensusMsgParamsResponse) Descriptor() ([]byte, []int) { return file_cosmos_consensus_v1_consensus_proto_rawDescGZIP(), []int{1} } @@ -1242,41 +1242,42 @@ var file_cosmos_consensus_v1_consensus_proto_rawDesc = []byte{ 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, 0x1d, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xaf, 0x02, 0x0a, 0x0c, 0x43, 0x6f, - 0x6e, 0x4d, 0x73, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x39, 0x0a, 0x07, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x74, 0x65, - 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x56, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x07, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, - 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x3c, 0x0a, 0x08, 0x65, 0x76, - 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x74, - 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 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, 0x3f, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x74, 0x65, - 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 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, 0x30, 0x0a, 0x04, 0x61, 0x62, 0x63, - 0x69, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, - 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x41, 0x42, 0x43, 0x49, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x04, 0x61, 0x62, 0x63, 0x69, 0x22, 0x16, 0x0a, 0x14, 0x43, - 0x6f, 0x6e, 0x4d, 0x73, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 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, + 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb5, 0x02, 0x0a, 0x12, 0x43, 0x6f, + 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x4d, 0x73, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x12, 0x39, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1f, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x05, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x74, 0x65, 0x6e, + 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x12, 0x3c, 0x0a, 0x08, 0x65, 0x76, 0x69, 0x64, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, + 0x74, 0x79, 0x70, 0x65, 0x73, 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, 0x3f, + 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x21, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, + 0x79, 0x70, 0x65, 0x73, 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, + 0x30, 0x0a, 0x04, 0x61, 0x62, 0x63, 0x69, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, + 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x41, 0x42, 0x43, 0x49, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x04, 0x61, 0x62, 0x63, + 0x69, 0x22, 0x1c, 0x0a, 0x1a, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x4d, 0x73, + 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 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 ( @@ -1293,20 +1294,20 @@ func file_cosmos_consensus_v1_consensus_proto_rawDescGZIP() []byte { var file_cosmos_consensus_v1_consensus_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_cosmos_consensus_v1_consensus_proto_goTypes = []interface{}{ - (*ConMsgParams)(nil), // 0: cosmos.consensus.v1.ConMsgParams - (*ConMsgParamsResponse)(nil), // 1: cosmos.consensus.v1.ConMsgParamsResponse - (*types.VersionParams)(nil), // 2: tendermint.types.VersionParams - (*types.BlockParams)(nil), // 3: tendermint.types.BlockParams - (*types.EvidenceParams)(nil), // 4: tendermint.types.EvidenceParams - (*types.ValidatorParams)(nil), // 5: tendermint.types.ValidatorParams - (*types.ABCIParams)(nil), // 6: tendermint.types.ABCIParams + (*ConsensusMsgParams)(nil), // 0: cosmos.consensus.v1.ConsensusMsgParams + (*ConsensusMsgParamsResponse)(nil), // 1: cosmos.consensus.v1.ConsensusMsgParamsResponse + (*types.VersionParams)(nil), // 2: tendermint.types.VersionParams + (*types.BlockParams)(nil), // 3: tendermint.types.BlockParams + (*types.EvidenceParams)(nil), // 4: tendermint.types.EvidenceParams + (*types.ValidatorParams)(nil), // 5: tendermint.types.ValidatorParams + (*types.ABCIParams)(nil), // 6: tendermint.types.ABCIParams } var file_cosmos_consensus_v1_consensus_proto_depIdxs = []int32{ - 2, // 0: cosmos.consensus.v1.ConMsgParams.version:type_name -> tendermint.types.VersionParams - 3, // 1: cosmos.consensus.v1.ConMsgParams.block:type_name -> tendermint.types.BlockParams - 4, // 2: cosmos.consensus.v1.ConMsgParams.evidence:type_name -> tendermint.types.EvidenceParams - 5, // 3: cosmos.consensus.v1.ConMsgParams.validator:type_name -> tendermint.types.ValidatorParams - 6, // 4: cosmos.consensus.v1.ConMsgParams.abci:type_name -> tendermint.types.ABCIParams + 2, // 0: cosmos.consensus.v1.ConsensusMsgParams.version:type_name -> tendermint.types.VersionParams + 3, // 1: cosmos.consensus.v1.ConsensusMsgParams.block:type_name -> tendermint.types.BlockParams + 4, // 2: cosmos.consensus.v1.ConsensusMsgParams.evidence:type_name -> tendermint.types.EvidenceParams + 5, // 3: cosmos.consensus.v1.ConsensusMsgParams.validator:type_name -> tendermint.types.ValidatorParams + 6, // 4: cosmos.consensus.v1.ConsensusMsgParams.abci:type_name -> tendermint.types.ABCIParams 5, // [5:5] is the sub-list for method output_type 5, // [5:5] is the sub-list for method input_type 5, // [5:5] is the sub-list for extension type_name @@ -1321,7 +1322,7 @@ func file_cosmos_consensus_v1_consensus_proto_init() { } if !protoimpl.UnsafeEnabled { file_cosmos_consensus_v1_consensus_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ConMsgParams); i { + switch v := v.(*ConsensusMsgParams); i { case 0: return &v.state case 1: @@ -1333,7 +1334,7 @@ func file_cosmos_consensus_v1_consensus_proto_init() { } } file_cosmos_consensus_v1_consensus_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ConMsgParamsResponse); i { + switch v := v.(*ConsensusMsgParamsResponse); i { case 0: return &v.state case 1: diff --git a/proto/cosmos/consensus/v1/consensus.proto b/proto/cosmos/consensus/v1/consensus.proto index 223a9bc7ad17..0bf88a3cafde 100644 --- a/proto/cosmos/consensus/v1/consensus.proto +++ b/proto/cosmos/consensus/v1/consensus.proto @@ -6,8 +6,8 @@ import "tendermint/types/params.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/consensus/types"; -// ConMsgParams is the Msg/Params request type. This is a consensus message that is sent from cometbft. -message ConMsgParams { +// ConsensusMsgParams is the Msg/Params request type. This is a consensus message that is sent from cometbft. +message ConsensusMsgParams { // params defines the x/consensus parameters to be passed from comet. // // NOTE: All parameters must be supplied. @@ -18,6 +18,6 @@ message ConMsgParams { tendermint.types.ABCIParams abci = 5; } -// ConMsgParamsResponse defines the response structure for executing a -// ConMsgParams message. -message ConMsgParamsResponse {} +// ConsensusMsgParamsResponse defines the response structure for executing a +// ConsensusMsgParams message. +message ConsensusMsgParamsResponse {} diff --git a/x/consensus/README.md b/x/consensus/README.md index 902280a6ecb9..6933b0084c86 100644 --- a/x/consensus/README.md +++ b/x/consensus/README.md @@ -4,4 +4,76 @@ sidebar_position: 1 # `x/consensus` +## Abstract + Functionality to modify CometBFT's ABCI consensus params. + +## Contents + +* [State](#state) +* [Params](#params) +* [Keepers](#keepers) +* [Messages](#messages) +* [Consensus Messages](#consensus-messages) +* [Events](#events) + * [Message Events](#message-events) + * [Keeper Events](#keeper-events) +* [Parameters](#parameters) + * [SendEnabled](#sendenabled) + * [DefaultSendEnabled](#defaultsendenabled) + + +## State + +The `x/consensus` module keeps state of the consensus params from cometbft.: + +## Params + +The bank module stores it's params in state with the prefix of `0x05`, +it can be updated with governance or the address with authority. + +* Params: `0x05 | ProtocolBuffer(cometbft.ConsensusParams)` + +```protobuf reference +https://github.com/cosmos/cosmos-sdk/blob/381de6452693a9338371223c232fba0c42773a4b/proto/cosmos/consensus/v1/consensus.proto#L11-L18 +``` + +## Keepers + +The consensus module provides methods to Set and Get consensus params. It is recommended to use the `x/consensus` module keeper to get consensus params instead of accessing them through the context. + +## Messages + +### UpdateParams + +Update consensus params. + +```protobuf reference +https://github.com/cosmos/cosmos-sdk/blob/381de6452693a9338371223c232fba0c42773a4b/proto/cosmos/consensus/v1/tx.proto#L12-L47 +``` + +The message will fail under the following conditions: + +* The signer is not the set authority +* Not all values are set + +## Consensus Messages + +The consensus module has a consensus message that is used to set the consensus params when the chain initializes. It is similar to the `UpdateParams` message but it is only used once at the start of the chain. + +```protobuf reference +https://github.com/cosmos/cosmos-sdk/blob/381de6452693a9338371223c232fba0c42773a4b/proto/cosmos/consensus/v1/consensus.proto#L9-L24 +``` + +## Events + +The consensus module emits the following events: + +### Message Events + +#### MsgUpdateParams + +| Type | Attribute Key | Attribute Value | +|--------|---------------|---------------------| +| string | authority | msg.Signer | +| string | parameters | consensus Parmeters | diff --git a/x/consensus/keeper/keeper.go b/x/consensus/keeper/keeper.go index 49d3f4934d38..d9e4baf3dcc8 100644 --- a/x/consensus/keeper/keeper.go +++ b/x/consensus/keeper/keeper.go @@ -88,7 +88,8 @@ func (k Keeper) UpdateParams(ctx context.Context, msg *types.MsgUpdateParams) (* } // SetParams sets the consensus parameters on init of a chain. This is a consensus message. It can only be called by the consensus server -func (k Keeper) SetParams(ctx context.Context, req *types.ConMsgParams) (*types.ConMsgParamsResponse, error) { +// This is used in the consensus message handler set in module.go. +func (k Keeper) SetParams(ctx context.Context, req *types.ConsensusMsgParams) (*types.ConsensusMsgParamsResponse, error) { consensusParams, err := req.ToProtoConsensusParams() if err != nil { return nil, err @@ -101,5 +102,5 @@ func (k Keeper) SetParams(ctx context.Context, req *types.ConMsgParams) (*types. return nil, err } - return &types.ConMsgParamsResponse{}, nil + return &types.ConsensusMsgParamsResponse{}, nil } diff --git a/x/consensus/types/consensus.go b/x/consensus/types/consensus.go index 60457466a17e..d4952bd0b7ae 100644 --- a/x/consensus/types/consensus.go +++ b/x/consensus/types/consensus.go @@ -7,7 +7,7 @@ import ( cmttypes "github.com/cometbft/cometbft/types" ) -func (msg ConMsgParams) ToProtoConsensusParams() (cmtproto.ConsensusParams, error) { +func (msg ConsensusMsgParams) ToProtoConsensusParams() (cmtproto.ConsensusParams, error) { if msg.Evidence == nil || msg.Block == nil || msg.Validator == nil || msg.Version == nil { return cmtproto.ConsensusParams{}, errors.New("all parameters must be present") } diff --git a/x/consensus/types/consensus.pb.go b/x/consensus/types/consensus.pb.go index b81e575a1e3b..d3cdd7b67290 100644 --- a/x/consensus/types/consensus.pb.go +++ b/x/consensus/types/consensus.pb.go @@ -23,8 +23,8 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// ConMsgParams is the Msg/Params request type. This is a consensus message that is sent from cometbft. -type ConMsgParams struct { +// ConsensusMsgParams is the Msg/Params request type. This is a consensus message that is sent from cometbft. +type ConsensusMsgParams struct { // params defines the x/consensus parameters to be passed from comet. // // NOTE: All parameters must be supplied. @@ -35,18 +35,18 @@ type ConMsgParams struct { Abci *types.ABCIParams `protobuf:"bytes,5,opt,name=abci,proto3" json:"abci,omitempty"` } -func (m *ConMsgParams) Reset() { *m = ConMsgParams{} } -func (m *ConMsgParams) String() string { return proto.CompactTextString(m) } -func (*ConMsgParams) ProtoMessage() {} -func (*ConMsgParams) Descriptor() ([]byte, []int) { +func (m *ConsensusMsgParams) Reset() { *m = ConsensusMsgParams{} } +func (m *ConsensusMsgParams) String() string { return proto.CompactTextString(m) } +func (*ConsensusMsgParams) ProtoMessage() {} +func (*ConsensusMsgParams) Descriptor() ([]byte, []int) { return fileDescriptor_7ed86dd7d42fb61b, []int{0} } -func (m *ConMsgParams) XXX_Unmarshal(b []byte) error { +func (m *ConsensusMsgParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ConMsgParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ConsensusMsgParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ConMsgParams.Marshal(b, m, deterministic) + return xxx_messageInfo_ConsensusMsgParams.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -56,70 +56,70 @@ func (m *ConMsgParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } -func (m *ConMsgParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConMsgParams.Merge(m, src) +func (m *ConsensusMsgParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConsensusMsgParams.Merge(m, src) } -func (m *ConMsgParams) XXX_Size() int { +func (m *ConsensusMsgParams) XXX_Size() int { return m.Size() } -func (m *ConMsgParams) XXX_DiscardUnknown() { - xxx_messageInfo_ConMsgParams.DiscardUnknown(m) +func (m *ConsensusMsgParams) XXX_DiscardUnknown() { + xxx_messageInfo_ConsensusMsgParams.DiscardUnknown(m) } -var xxx_messageInfo_ConMsgParams proto.InternalMessageInfo +var xxx_messageInfo_ConsensusMsgParams proto.InternalMessageInfo -func (m *ConMsgParams) GetVersion() *types.VersionParams { +func (m *ConsensusMsgParams) GetVersion() *types.VersionParams { if m != nil { return m.Version } return nil } -func (m *ConMsgParams) GetBlock() *types.BlockParams { +func (m *ConsensusMsgParams) GetBlock() *types.BlockParams { if m != nil { return m.Block } return nil } -func (m *ConMsgParams) GetEvidence() *types.EvidenceParams { +func (m *ConsensusMsgParams) GetEvidence() *types.EvidenceParams { if m != nil { return m.Evidence } return nil } -func (m *ConMsgParams) GetValidator() *types.ValidatorParams { +func (m *ConsensusMsgParams) GetValidator() *types.ValidatorParams { if m != nil { return m.Validator } return nil } -func (m *ConMsgParams) GetAbci() *types.ABCIParams { +func (m *ConsensusMsgParams) GetAbci() *types.ABCIParams { if m != nil { return m.Abci } return nil } -// ConMsgParamsResponse defines the response structure for executing a -// ConMsgParams message. -type ConMsgParamsResponse struct { +// ConsensusMsgParamsResponse defines the response structure for executing a +// ConsensusMsgParams message. +type ConsensusMsgParamsResponse struct { } -func (m *ConMsgParamsResponse) Reset() { *m = ConMsgParamsResponse{} } -func (m *ConMsgParamsResponse) String() string { return proto.CompactTextString(m) } -func (*ConMsgParamsResponse) ProtoMessage() {} -func (*ConMsgParamsResponse) Descriptor() ([]byte, []int) { +func (m *ConsensusMsgParamsResponse) Reset() { *m = ConsensusMsgParamsResponse{} } +func (m *ConsensusMsgParamsResponse) String() string { return proto.CompactTextString(m) } +func (*ConsensusMsgParamsResponse) ProtoMessage() {} +func (*ConsensusMsgParamsResponse) Descriptor() ([]byte, []int) { return fileDescriptor_7ed86dd7d42fb61b, []int{1} } -func (m *ConMsgParamsResponse) XXX_Unmarshal(b []byte) error { +func (m *ConsensusMsgParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ConMsgParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ConsensusMsgParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ConMsgParamsResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_ConsensusMsgParamsResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -129,21 +129,21 @@ func (m *ConMsgParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return b[:n], nil } } -func (m *ConMsgParamsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConMsgParamsResponse.Merge(m, src) +func (m *ConsensusMsgParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConsensusMsgParamsResponse.Merge(m, src) } -func (m *ConMsgParamsResponse) XXX_Size() int { +func (m *ConsensusMsgParamsResponse) XXX_Size() int { return m.Size() } -func (m *ConMsgParamsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ConMsgParamsResponse.DiscardUnknown(m) +func (m *ConsensusMsgParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ConsensusMsgParamsResponse.DiscardUnknown(m) } -var xxx_messageInfo_ConMsgParamsResponse proto.InternalMessageInfo +var xxx_messageInfo_ConsensusMsgParamsResponse proto.InternalMessageInfo func init() { - proto.RegisterType((*ConMsgParams)(nil), "cosmos.consensus.v1.ConMsgParams") - proto.RegisterType((*ConMsgParamsResponse)(nil), "cosmos.consensus.v1.ConMsgParamsResponse") + proto.RegisterType((*ConsensusMsgParams)(nil), "cosmos.consensus.v1.ConsensusMsgParams") + proto.RegisterType((*ConsensusMsgParamsResponse)(nil), "cosmos.consensus.v1.ConsensusMsgParamsResponse") } func init() { @@ -151,30 +151,30 @@ func init() { } var fileDescriptor_7ed86dd7d42fb61b = []byte{ - // 308 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4e, 0xce, 0x2f, 0xce, - 0xcd, 0x2f, 0xd6, 0x4f, 0xce, 0xcf, 0x2b, 0x4e, 0xcd, 0x2b, 0x2e, 0x2d, 0xd6, 0x2f, 0x33, 0x44, - 0x70, 0xf4, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85, 0x84, 0x21, 0x8a, 0xf4, 0x10, 0xe2, 0x65, 0x86, - 0x52, 0xb2, 0x25, 0xa9, 0x79, 0x29, 0xa9, 0x45, 0xb9, 0x99, 0x79, 0x25, 0xfa, 0x25, 0x95, 0x05, - 0xa9, 0xc5, 0xfa, 0x05, 0x89, 0x45, 0x89, 0xb9, 0x50, 0x3d, 0x4a, 0xeb, 0x99, 0xb8, 0x78, 0x9c, - 0xf3, 0xf3, 0x7c, 0x8b, 0xd3, 0x03, 0xc0, 0xc2, 0x42, 0x96, 0x5c, 0xec, 0x65, 0xa9, 0x45, 0xc5, - 0x99, 0xf9, 0x79, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0xdc, 0x46, 0xf2, 0x7a, 0x08, 0x13, 0xf4, 0xc0, - 0x26, 0xe8, 0x85, 0x41, 0x14, 0x40, 0x74, 0x04, 0xc1, 0xd4, 0x0b, 0x19, 0x73, 0xb1, 0x26, 0xe5, - 0xe4, 0x27, 0x67, 0x4b, 0x30, 0x81, 0x35, 0xca, 0x62, 0x6a, 0x74, 0x02, 0x49, 0x43, 0xb5, 0x41, - 0xd4, 0x0a, 0xd9, 0x70, 0x71, 0xa4, 0x96, 0x65, 0xa6, 0xa4, 0xe6, 0x25, 0xa7, 0x4a, 0x30, 0x83, - 0xf5, 0x29, 0x60, 0xea, 0x73, 0x85, 0xaa, 0x80, 0x6a, 0x85, 0xeb, 0x10, 0xb2, 0xe7, 0xe2, 0x2c, - 0x4b, 0xcc, 0xc9, 0x4c, 0x49, 0x2c, 0xc9, 0x2f, 0x92, 0x60, 0x01, 0x6b, 0x57, 0xc4, 0xe2, 0x5e, - 0x98, 0x12, 0xa8, 0x7e, 0x84, 0x1e, 0x21, 0x03, 0x2e, 0x96, 0xc4, 0xa4, 0xe4, 0x4c, 0x09, 0x56, - 0xb0, 0x5e, 0x19, 0x4c, 0xbd, 0x8e, 0x4e, 0xce, 0x9e, 0x50, 0x6d, 0x60, 0x95, 0x4a, 0x62, 0x5c, - 0x22, 0xc8, 0x01, 0x16, 0x94, 0x5a, 0x5c, 0x00, 0x0a, 0x6f, 0x27, 0x8f, 0x13, 0x8f, 0xe4, 0x18, - 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, - 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0xd2, 0x4b, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, - 0xcf, 0xd5, 0x87, 0xc7, 0x23, 0x88, 0xd2, 0x2d, 0x4e, 0xc9, 0xd6, 0xaf, 0x40, 0x8a, 0x54, 0xb0, - 0x95, 0x49, 0x6c, 0xe0, 0xa8, 0x31, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xcd, 0xd4, 0x53, 0x90, - 0xf5, 0x01, 0x00, 0x00, + // 306 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0xd1, 0xcf, 0x4a, 0xc3, 0x30, + 0x1c, 0xc0, 0xf1, 0x76, 0x6e, 0xfe, 0x89, 0xb7, 0x78, 0x29, 0x63, 0x8b, 0x73, 0x5e, 0xbc, 0x98, + 0x38, 0x77, 0x12, 0x04, 0xb1, 0x43, 0xd0, 0x83, 0x20, 0x3b, 0x78, 0xf0, 0xd6, 0xa6, 0x61, 0x86, + 0xad, 0x49, 0x69, 0xb2, 0xa2, 0x6f, 0xe1, 0xcb, 0xf8, 0x0e, 0x1e, 0x77, 0xf4, 0x28, 0xed, 0x8b, + 0x48, 0xd3, 0x74, 0x15, 0xea, 0xa9, 0x34, 0xf9, 0x7e, 0xd2, 0x92, 0x1f, 0x38, 0xa5, 0x52, 0xc5, + 0x52, 0x11, 0x2a, 0x85, 0x62, 0x42, 0xad, 0x15, 0xc9, 0x26, 0xcd, 0x0b, 0x4e, 0x52, 0xa9, 0x25, + 0x3c, 0xaa, 0x22, 0xdc, 0xac, 0x67, 0x93, 0xfe, 0x50, 0x33, 0x11, 0xb1, 0x34, 0xe6, 0x42, 0x13, + 0xfd, 0x9e, 0x30, 0x45, 0x92, 0x20, 0x0d, 0x62, 0x6b, 0xc6, 0x9f, 0x1d, 0x00, 0x67, 0x75, 0xff, + 0xa8, 0x16, 0x4f, 0x66, 0x13, 0x5e, 0x81, 0xbd, 0x8c, 0xa5, 0x8a, 0x4b, 0xe1, 0xb9, 0x23, 0xf7, + 0xec, 0xf0, 0xf2, 0x18, 0x37, 0xe7, 0x60, 0x73, 0x0e, 0x7e, 0xae, 0x82, 0x4a, 0xcc, 0xeb, 0x1e, + 0x4e, 0x41, 0x2f, 0x5c, 0x49, 0xba, 0xf4, 0x3a, 0x06, 0x0e, 0xdb, 0xd0, 0x2f, 0xb7, 0x2d, 0xab, + 0x5a, 0x78, 0x0d, 0xf6, 0x59, 0xc6, 0x23, 0x26, 0x28, 0xf3, 0x76, 0x8c, 0x1b, 0xb5, 0xdd, 0x9d, + 0x2d, 0x2c, 0xdd, 0x0a, 0x78, 0x03, 0x0e, 0xb2, 0x60, 0xc5, 0xa3, 0x40, 0xcb, 0xd4, 0xeb, 0x1a, + 0x7e, 0xf2, 0xcf, 0xff, 0xd6, 0x89, 0xf5, 0x8d, 0x81, 0x17, 0xa0, 0x1b, 0x84, 0x94, 0x7b, 0x3d, + 0x63, 0x07, 0x6d, 0x7b, 0xeb, 0xcf, 0x1e, 0x2c, 0x33, 0xe5, 0x78, 0x00, 0xfa, 0xed, 0x6b, 0x9b, + 0x33, 0x95, 0x94, 0x8b, 0xfe, 0xfd, 0x57, 0x8e, 0xdc, 0x4d, 0x8e, 0xdc, 0x9f, 0x1c, 0xb9, 0x1f, + 0x05, 0x72, 0x36, 0x05, 0x72, 0xbe, 0x0b, 0xe4, 0xbc, 0xe0, 0x05, 0xd7, 0xaf, 0xeb, 0x10, 0x53, + 0x19, 0x93, 0xed, 0x4c, 0xcb, 0xc7, 0xb9, 0x8a, 0x96, 0xe4, 0xed, 0xcf, 0x80, 0xcd, 0x87, 0xc3, + 0x5d, 0x33, 0xa6, 0xe9, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x66, 0x95, 0x46, 0x47, 0x01, 0x02, + 0x00, 0x00, } -func (m *ConMsgParams) Marshal() (dAtA []byte, err error) { +func (m *ConsensusMsgParams) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -184,12 +184,12 @@ func (m *ConMsgParams) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ConMsgParams) MarshalTo(dAtA []byte) (int, error) { +func (m *ConsensusMsgParams) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ConMsgParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ConsensusMsgParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -257,7 +257,7 @@ func (m *ConMsgParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ConMsgParamsResponse) Marshal() (dAtA []byte, err error) { +func (m *ConsensusMsgParamsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -267,12 +267,12 @@ func (m *ConMsgParamsResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ConMsgParamsResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *ConsensusMsgParamsResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ConMsgParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ConsensusMsgParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -291,7 +291,7 @@ func encodeVarintConsensus(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *ConMsgParams) Size() (n int) { +func (m *ConsensusMsgParams) Size() (n int) { if m == nil { return 0 } @@ -320,7 +320,7 @@ func (m *ConMsgParams) Size() (n int) { return n } -func (m *ConMsgParamsResponse) Size() (n int) { +func (m *ConsensusMsgParamsResponse) Size() (n int) { if m == nil { return 0 } @@ -335,7 +335,7 @@ func sovConsensus(x uint64) (n int) { func sozConsensus(x uint64) (n int) { return sovConsensus(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *ConMsgParams) Unmarshal(dAtA []byte) error { +func (m *ConsensusMsgParams) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -358,10 +358,10 @@ func (m *ConMsgParams) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ConMsgParams: wiretype end group for non-group") + return fmt.Errorf("proto: ConsensusMsgParams: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ConMsgParams: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ConsensusMsgParams: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -565,7 +565,7 @@ func (m *ConMsgParams) Unmarshal(dAtA []byte) error { } return nil } -func (m *ConMsgParamsResponse) Unmarshal(dAtA []byte) error { +func (m *ConsensusMsgParamsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -588,10 +588,10 @@ func (m *ConMsgParamsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ConMsgParamsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: ConsensusMsgParamsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ConMsgParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ConsensusMsgParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: From 1cbefb3f5efbccdb5840edf97a9350da0f926f19 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Fri, 23 Feb 2024 14:41:26 +0100 Subject: [PATCH 11/12] bank -> consensus --- x/consensus/README.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/x/consensus/README.md b/x/consensus/README.md index 6933b0084c86..2d38ed39a6ff 100644 --- a/x/consensus/README.md +++ b/x/consensus/README.md @@ -17,10 +17,6 @@ Functionality to modify CometBFT's ABCI consensus params. * [Consensus Messages](#consensus-messages) * [Events](#events) * [Message Events](#message-events) - * [Keeper Events](#keeper-events) -* [Parameters](#parameters) - * [SendEnabled](#sendenabled) - * [DefaultSendEnabled](#defaultsendenabled) ## State @@ -29,7 +25,7 @@ The `x/consensus` module keeps state of the consensus params from cometbft.: ## Params -The bank module stores it's params in state with the prefix of `0x05`, +The consensus module stores it's params in state with the prefix of `0x05`, it can be updated with governance or the address with authority. * Params: `0x05 | ProtocolBuffer(cometbft.ConsensusParams)` From c4fb2752d5acc0e21ec4411667470e265decfcfa Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Fri, 23 Feb 2024 15:01:13 +0100 Subject: [PATCH 12/12] fix test and linting --- x/consensus/keeper/keeper_test.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/x/consensus/keeper/keeper_test.go b/x/consensus/keeper/keeper_test.go index dea63f8684cf..3ab63dc3cf61 100644 --- a/x/consensus/keeper/keeper_test.go +++ b/x/consensus/keeper/keeper_test.go @@ -246,13 +246,13 @@ func (s *KeeperTestSuite) TestSetParams() { defaultConsensusParams := cmttypes.DefaultConsensusParams().ToProto() testCases := []struct { name string - input *types.ConMsgParams + input *types.ConsensusMsgParams expErr bool expErrMsg string }{ { name: "valid params", - input: &types.ConMsgParams{ + input: &types.ConsensusMsgParams{ Abci: defaultConsensusParams.Abci, Version: &cmtproto.VersionParams{App: 1}, Block: defaultConsensusParams.Block, @@ -264,7 +264,7 @@ func (s *KeeperTestSuite) TestSetParams() { }, { name: "invalid params", - input: &types.ConMsgParams{ + input: &types.ConsensusMsgParams{ Abci: defaultConsensusParams.Abci, Version: &cmtproto.VersionParams{App: 1}, Block: &cmtproto.BlockParams{MaxGas: -10, MaxBytes: -10}, @@ -276,7 +276,7 @@ func (s *KeeperTestSuite) TestSetParams() { }, { name: "nil version params", - input: &types.ConMsgParams{ + input: &types.ConsensusMsgParams{ Abci: defaultConsensusParams.Abci, Version: nil, Block: defaultConsensusParams.Block, @@ -288,7 +288,7 @@ func (s *KeeperTestSuite) TestSetParams() { }, { name: "nil evidence params", - input: &types.ConMsgParams{ + input: &types.ConsensusMsgParams{ Abci: defaultConsensusParams.Abci, Version: &cmtproto.VersionParams{App: 1}, Block: defaultConsensusParams.Block, @@ -300,7 +300,7 @@ func (s *KeeperTestSuite) TestSetParams() { }, { name: "nil block params", - input: &types.ConMsgParams{ + input: &types.ConsensusMsgParams{ Abci: defaultConsensusParams.Abci, Version: &cmtproto.VersionParams{App: 1}, Block: nil, @@ -312,7 +312,7 @@ func (s *KeeperTestSuite) TestSetParams() { }, { name: "nil validator params", - input: &types.ConMsgParams{ + input: &types.ConsensusMsgParams{ Abci: defaultConsensusParams.Abci, Version: &cmtproto.VersionParams{App: 1}, Block: defaultConsensusParams.Block,