diff --git a/CHANGELOG.md b/CHANGELOG.md index 01a041f41bbb..dd35f41ab27e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (crypto/keyring) [#8](https://github.com/01builders/cosmos-sdk/pull/8) Fix error wrapping in pkg crypto/keyring. Removed `cockroachdb/errors` in favour of `errorsmod.Wrap`. * (x/consensus) [#9](https://github.com/01builders/cosmos-sdk/pull/9) Address bug where sending `MsgUpdateParams` to `x/consensus` would overwrite `AppVersion` with zero value. Always use existing `AppVersion` param. * (client) [#435](https://github.com/celestiaorg/cosmos-sdk/pull/435) Extend the `CometRPC` interface with cometbft `rpcclient.MempoolClient`. +* (x/authz) [#442](https://github.com/celestiaorg/cosmos-sdk/pull/442) Added a limit of 200 grants pruned per `BeginBlock` and the `PruneExpiredGrants` message that prunes 75 expired grants on every run. ## [Unreleased-Cosmos-SDK] diff --git a/Makefile b/Makefile index 181de584d26e..30e26e22cbcc 100644 --- a/Makefile +++ b/Makefile @@ -393,7 +393,7 @@ lint-fix: ### Protobuf ### ############################################################################### -protoVer=0.14.0 +protoVer=0.15.2 protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer) protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName) diff --git a/README.md b/README.md index 069dbc318299..5a9aecd362ca 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ The fork include the following changes compared to upstream: * Re-add query router for custom abci queries * Add v0.52 helpers to facilitate testing * Disable heavy bank migrations +* Backport improvements for DOS protection for x/authz * Support historical account number queries Read the [CHANGELOG.md](CHANGELOG.md) for more details. diff --git a/api/cosmos/authz/v1beta1/event.pulsar.go b/api/cosmos/authz/v1beta1/event.pulsar.go index 88a142363ea2..cf6f3e196527 100644 --- a/api/cosmos/authz/v1beta1/event.pulsar.go +++ b/api/cosmos/authz/v1beta1/event.pulsar.go @@ -1109,7 +1109,425 @@ func (x *fastReflection_EventRevoke) ProtoMethods() *protoiface.Methods { } } -// Since: cosmos-sdk 0.43 +var ( + md_EventPruneExpiredGrants protoreflect.MessageDescriptor + fd_EventPruneExpiredGrants_pruner protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_authz_v1beta1_event_proto_init() + md_EventPruneExpiredGrants = File_cosmos_authz_v1beta1_event_proto.Messages().ByName("EventPruneExpiredGrants") + fd_EventPruneExpiredGrants_pruner = md_EventPruneExpiredGrants.Fields().ByName("pruner") +} + +var _ protoreflect.Message = (*fastReflection_EventPruneExpiredGrants)(nil) + +type fastReflection_EventPruneExpiredGrants EventPruneExpiredGrants + +func (x *EventPruneExpiredGrants) ProtoReflect() protoreflect.Message { + return (*fastReflection_EventPruneExpiredGrants)(x) +} + +func (x *EventPruneExpiredGrants) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_authz_v1beta1_event_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_EventPruneExpiredGrants_messageType fastReflection_EventPruneExpiredGrants_messageType +var _ protoreflect.MessageType = fastReflection_EventPruneExpiredGrants_messageType{} + +type fastReflection_EventPruneExpiredGrants_messageType struct{} + +func (x fastReflection_EventPruneExpiredGrants_messageType) Zero() protoreflect.Message { + return (*fastReflection_EventPruneExpiredGrants)(nil) +} +func (x fastReflection_EventPruneExpiredGrants_messageType) New() protoreflect.Message { + return new(fastReflection_EventPruneExpiredGrants) +} +func (x fastReflection_EventPruneExpiredGrants_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EventPruneExpiredGrants +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EventPruneExpiredGrants) Descriptor() protoreflect.MessageDescriptor { + return md_EventPruneExpiredGrants +} + +// 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_EventPruneExpiredGrants) Type() protoreflect.MessageType { + return _fastReflection_EventPruneExpiredGrants_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EventPruneExpiredGrants) New() protoreflect.Message { + return new(fastReflection_EventPruneExpiredGrants) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EventPruneExpiredGrants) Interface() protoreflect.ProtoMessage { + return (*EventPruneExpiredGrants)(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_EventPruneExpiredGrants) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Pruner != "" { + value := protoreflect.ValueOfString(x.Pruner) + if !f(fd_EventPruneExpiredGrants_pruner, 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_EventPruneExpiredGrants) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.authz.v1beta1.EventPruneExpiredGrants.pruner": + return x.Pruner != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.authz.v1beta1.EventPruneExpiredGrants")) + } + panic(fmt.Errorf("message cosmos.authz.v1beta1.EventPruneExpiredGrants 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_EventPruneExpiredGrants) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.authz.v1beta1.EventPruneExpiredGrants.pruner": + x.Pruner = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.authz.v1beta1.EventPruneExpiredGrants")) + } + panic(fmt.Errorf("message cosmos.authz.v1beta1.EventPruneExpiredGrants 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_EventPruneExpiredGrants) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.authz.v1beta1.EventPruneExpiredGrants.pruner": + value := x.Pruner + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.authz.v1beta1.EventPruneExpiredGrants")) + } + panic(fmt.Errorf("message cosmos.authz.v1beta1.EventPruneExpiredGrants 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_EventPruneExpiredGrants) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.authz.v1beta1.EventPruneExpiredGrants.pruner": + x.Pruner = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.authz.v1beta1.EventPruneExpiredGrants")) + } + panic(fmt.Errorf("message cosmos.authz.v1beta1.EventPruneExpiredGrants 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_EventPruneExpiredGrants) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.authz.v1beta1.EventPruneExpiredGrants.pruner": + panic(fmt.Errorf("field pruner of message cosmos.authz.v1beta1.EventPruneExpiredGrants is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.authz.v1beta1.EventPruneExpiredGrants")) + } + panic(fmt.Errorf("message cosmos.authz.v1beta1.EventPruneExpiredGrants 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_EventPruneExpiredGrants) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.authz.v1beta1.EventPruneExpiredGrants.pruner": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.authz.v1beta1.EventPruneExpiredGrants")) + } + panic(fmt.Errorf("message cosmos.authz.v1beta1.EventPruneExpiredGrants 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_EventPruneExpiredGrants) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.authz.v1beta1.EventPruneExpiredGrants", 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_EventPruneExpiredGrants) 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_EventPruneExpiredGrants) 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_EventPruneExpiredGrants) 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_EventPruneExpiredGrants) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EventPruneExpiredGrants) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Pruner) + if l > 0 { + 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().(*EventPruneExpiredGrants) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Pruner) > 0 { + i -= len(x.Pruner) + copy(dAtA[i:], x.Pruner) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Pruner))) + i-- + dAtA[i] = 0x12 + } + 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().(*EventPruneExpiredGrants) + 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: EventPruneExpiredGrants: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventPruneExpiredGrants: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Pruner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Pruner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} // Code generated by protoc-gen-go. DO NOT EDIT. // versions: @@ -1125,6 +1543,8 @@ const ( ) // EventGrant is emitted on Msg/Grant +// +// Since: cosmos-sdk 0.43 type EventGrant struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1180,6 +1600,8 @@ func (x *EventGrant) GetGrantee() string { } // EventRevoke is emitted on Msg/Revoke +// +// Since: cosmos-sdk 0.43 type EventRevoke struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1234,6 +1656,45 @@ func (x *EventRevoke) GetGrantee() string { return "" } +// EventPruneExpiredGrants is emitted on Msg/PruneExpiredGrants +// +// Since: x/authz 1.0.0 +type EventPruneExpiredGrants struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Address of the pruner + Pruner string `protobuf:"bytes,2,opt,name=pruner,proto3" json:"pruner,omitempty"` +} + +func (x *EventPruneExpiredGrants) Reset() { + *x = EventPruneExpiredGrants{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_authz_v1beta1_event_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventPruneExpiredGrants) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventPruneExpiredGrants) ProtoMessage() {} + +// Deprecated: Use EventPruneExpiredGrants.ProtoReflect.Descriptor instead. +func (*EventPruneExpiredGrants) Descriptor() ([]byte, []int) { + return file_cosmos_authz_v1beta1_event_proto_rawDescGZIP(), []int{2} +} + +func (x *EventPruneExpiredGrants) GetPruner() string { + if x != nil { + return x.Pruner + } + return "" +} + var File_cosmos_authz_v1beta1_event_proto protoreflect.FileDescriptor var file_cosmos_authz_v1beta1_event_proto_rawDesc = []byte{ @@ -1261,20 +1722,25 @@ var file_cosmos_authz_v1beta1_event_proto_rawDesc = []byte{ 0x65, 0x72, 0x12, 0x32, 0x0a, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x67, - 0x72, 0x61, 0x6e, 0x74, 0x65, 0x65, 0x42, 0xcc, 0x01, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x42, 0x0a, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, - 0x01, 0x5a, 0x32, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x7a, - 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x41, 0x58, 0xaa, 0x02, 0x14, 0x43, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0xca, 0x02, 0x14, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x75, 0x74, 0x68, - 0x7a, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x20, 0x43, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x5c, 0x41, 0x75, 0x74, 0x68, 0x7a, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x16, 0x43, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x75, 0x74, 0x68, 0x7a, 0x3a, 0x3a, 0x56, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x61, 0x6e, 0x74, 0x65, 0x65, 0x22, 0x4b, 0x0a, 0x17, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x50, + 0x72, 0x75, 0x6e, 0x65, 0x45, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x47, 0x72, 0x61, 0x6e, 0x74, + 0x73, 0x12, 0x30, 0x0a, 0x06, 0x70, 0x72, 0x75, 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x06, 0x70, 0x72, 0x75, + 0x6e, 0x65, 0x72, 0x42, 0xcc, 0x01, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x42, 0x0a, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2f, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x41, 0x58, 0xaa, 0x02, 0x14, 0x43, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, + 0x02, 0x14, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x75, 0x74, 0x68, 0x7a, 0x5c, 0x56, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x20, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, + 0x41, 0x75, 0x74, 0x68, 0x7a, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x75, 0x74, 0x68, 0x7a, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1289,10 +1755,11 @@ func file_cosmos_authz_v1beta1_event_proto_rawDescGZIP() []byte { return file_cosmos_authz_v1beta1_event_proto_rawDescData } -var file_cosmos_authz_v1beta1_event_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_cosmos_authz_v1beta1_event_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_cosmos_authz_v1beta1_event_proto_goTypes = []interface{}{ - (*EventGrant)(nil), // 0: cosmos.authz.v1beta1.EventGrant - (*EventRevoke)(nil), // 1: cosmos.authz.v1beta1.EventRevoke + (*EventGrant)(nil), // 0: cosmos.authz.v1beta1.EventGrant + (*EventRevoke)(nil), // 1: cosmos.authz.v1beta1.EventRevoke + (*EventPruneExpiredGrants)(nil), // 2: cosmos.authz.v1beta1.EventPruneExpiredGrants } var file_cosmos_authz_v1beta1_event_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type @@ -1332,6 +1799,18 @@ func file_cosmos_authz_v1beta1_event_proto_init() { return nil } } + file_cosmos_authz_v1beta1_event_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventPruneExpiredGrants); 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{ @@ -1339,7 +1818,7 @@ func file_cosmos_authz_v1beta1_event_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_authz_v1beta1_event_proto_rawDesc, NumEnums: 0, - NumMessages: 2, + NumMessages: 3, NumExtensions: 0, NumServices: 0, }, diff --git a/api/cosmos/authz/v1beta1/tx.pulsar.go b/api/cosmos/authz/v1beta1/tx.pulsar.go index 9b2af65e42cc..ea1ee78c98d4 100644 --- a/api/cosmos/authz/v1beta1/tx.pulsar.go +++ b/api/cosmos/authz/v1beta1/tx.pulsar.go @@ -2878,6 +2878,782 @@ func (x *fastReflection_MsgRevokeResponse) ProtoMethods() *protoiface.Methods { } } +var ( + md_MsgPruneExpiredGrants protoreflect.MessageDescriptor + fd_MsgPruneExpiredGrants_pruner protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_authz_v1beta1_tx_proto_init() + md_MsgPruneExpiredGrants = File_cosmos_authz_v1beta1_tx_proto.Messages().ByName("MsgPruneExpiredGrants") + fd_MsgPruneExpiredGrants_pruner = md_MsgPruneExpiredGrants.Fields().ByName("pruner") +} + +var _ protoreflect.Message = (*fastReflection_MsgPruneExpiredGrants)(nil) + +type fastReflection_MsgPruneExpiredGrants MsgPruneExpiredGrants + +func (x *MsgPruneExpiredGrants) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgPruneExpiredGrants)(x) +} + +func (x *MsgPruneExpiredGrants) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_authz_v1beta1_tx_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgPruneExpiredGrants_messageType fastReflection_MsgPruneExpiredGrants_messageType +var _ protoreflect.MessageType = fastReflection_MsgPruneExpiredGrants_messageType{} + +type fastReflection_MsgPruneExpiredGrants_messageType struct{} + +func (x fastReflection_MsgPruneExpiredGrants_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgPruneExpiredGrants)(nil) +} +func (x fastReflection_MsgPruneExpiredGrants_messageType) New() protoreflect.Message { + return new(fastReflection_MsgPruneExpiredGrants) +} +func (x fastReflection_MsgPruneExpiredGrants_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgPruneExpiredGrants +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgPruneExpiredGrants) Descriptor() protoreflect.MessageDescriptor { + return md_MsgPruneExpiredGrants +} + +// 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_MsgPruneExpiredGrants) Type() protoreflect.MessageType { + return _fastReflection_MsgPruneExpiredGrants_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgPruneExpiredGrants) New() protoreflect.Message { + return new(fastReflection_MsgPruneExpiredGrants) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgPruneExpiredGrants) Interface() protoreflect.ProtoMessage { + return (*MsgPruneExpiredGrants)(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_MsgPruneExpiredGrants) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Pruner != "" { + value := protoreflect.ValueOfString(x.Pruner) + if !f(fd_MsgPruneExpiredGrants_pruner, 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_MsgPruneExpiredGrants) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.authz.v1beta1.MsgPruneExpiredGrants.pruner": + return x.Pruner != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.authz.v1beta1.MsgPruneExpiredGrants")) + } + panic(fmt.Errorf("message cosmos.authz.v1beta1.MsgPruneExpiredGrants 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_MsgPruneExpiredGrants) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.authz.v1beta1.MsgPruneExpiredGrants.pruner": + x.Pruner = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.authz.v1beta1.MsgPruneExpiredGrants")) + } + panic(fmt.Errorf("message cosmos.authz.v1beta1.MsgPruneExpiredGrants 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_MsgPruneExpiredGrants) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.authz.v1beta1.MsgPruneExpiredGrants.pruner": + value := x.Pruner + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.authz.v1beta1.MsgPruneExpiredGrants")) + } + panic(fmt.Errorf("message cosmos.authz.v1beta1.MsgPruneExpiredGrants 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_MsgPruneExpiredGrants) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.authz.v1beta1.MsgPruneExpiredGrants.pruner": + x.Pruner = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.authz.v1beta1.MsgPruneExpiredGrants")) + } + panic(fmt.Errorf("message cosmos.authz.v1beta1.MsgPruneExpiredGrants 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_MsgPruneExpiredGrants) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.authz.v1beta1.MsgPruneExpiredGrants.pruner": + panic(fmt.Errorf("field pruner of message cosmos.authz.v1beta1.MsgPruneExpiredGrants is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.authz.v1beta1.MsgPruneExpiredGrants")) + } + panic(fmt.Errorf("message cosmos.authz.v1beta1.MsgPruneExpiredGrants 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_MsgPruneExpiredGrants) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.authz.v1beta1.MsgPruneExpiredGrants.pruner": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.authz.v1beta1.MsgPruneExpiredGrants")) + } + panic(fmt.Errorf("message cosmos.authz.v1beta1.MsgPruneExpiredGrants 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_MsgPruneExpiredGrants) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.authz.v1beta1.MsgPruneExpiredGrants", 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_MsgPruneExpiredGrants) 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_MsgPruneExpiredGrants) 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_MsgPruneExpiredGrants) 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_MsgPruneExpiredGrants) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgPruneExpiredGrants) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Pruner) + if l > 0 { + 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().(*MsgPruneExpiredGrants) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Pruner) > 0 { + i -= len(x.Pruner) + copy(dAtA[i:], x.Pruner) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Pruner))) + 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().(*MsgPruneExpiredGrants) + 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: MsgPruneExpiredGrants: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgPruneExpiredGrants: 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 Pruner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Pruner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgPruneExpiredGrantsResponse protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_authz_v1beta1_tx_proto_init() + md_MsgPruneExpiredGrantsResponse = File_cosmos_authz_v1beta1_tx_proto.Messages().ByName("MsgPruneExpiredGrantsResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgPruneExpiredGrantsResponse)(nil) + +type fastReflection_MsgPruneExpiredGrantsResponse MsgPruneExpiredGrantsResponse + +func (x *MsgPruneExpiredGrantsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgPruneExpiredGrantsResponse)(x) +} + +func (x *MsgPruneExpiredGrantsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_authz_v1beta1_tx_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgPruneExpiredGrantsResponse_messageType fastReflection_MsgPruneExpiredGrantsResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgPruneExpiredGrantsResponse_messageType{} + +type fastReflection_MsgPruneExpiredGrantsResponse_messageType struct{} + +func (x fastReflection_MsgPruneExpiredGrantsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgPruneExpiredGrantsResponse)(nil) +} +func (x fastReflection_MsgPruneExpiredGrantsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgPruneExpiredGrantsResponse) +} +func (x fastReflection_MsgPruneExpiredGrantsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgPruneExpiredGrantsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgPruneExpiredGrantsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgPruneExpiredGrantsResponse +} + +// 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_MsgPruneExpiredGrantsResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgPruneExpiredGrantsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgPruneExpiredGrantsResponse) New() protoreflect.Message { + return new(fastReflection_MsgPruneExpiredGrantsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgPruneExpiredGrantsResponse) Interface() protoreflect.ProtoMessage { + return (*MsgPruneExpiredGrantsResponse)(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_MsgPruneExpiredGrantsResponse) 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_MsgPruneExpiredGrantsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.authz.v1beta1.MsgPruneExpiredGrantsResponse")) + } + panic(fmt.Errorf("message cosmos.authz.v1beta1.MsgPruneExpiredGrantsResponse 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_MsgPruneExpiredGrantsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.authz.v1beta1.MsgPruneExpiredGrantsResponse")) + } + panic(fmt.Errorf("message cosmos.authz.v1beta1.MsgPruneExpiredGrantsResponse 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_MsgPruneExpiredGrantsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.authz.v1beta1.MsgPruneExpiredGrantsResponse")) + } + panic(fmt.Errorf("message cosmos.authz.v1beta1.MsgPruneExpiredGrantsResponse 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_MsgPruneExpiredGrantsResponse) 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.authz.v1beta1.MsgPruneExpiredGrantsResponse")) + } + panic(fmt.Errorf("message cosmos.authz.v1beta1.MsgPruneExpiredGrantsResponse 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_MsgPruneExpiredGrantsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.authz.v1beta1.MsgPruneExpiredGrantsResponse")) + } + panic(fmt.Errorf("message cosmos.authz.v1beta1.MsgPruneExpiredGrantsResponse 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_MsgPruneExpiredGrantsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.authz.v1beta1.MsgPruneExpiredGrantsResponse")) + } + panic(fmt.Errorf("message cosmos.authz.v1beta1.MsgPruneExpiredGrantsResponse 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_MsgPruneExpiredGrantsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.authz.v1beta1.MsgPruneExpiredGrantsResponse", 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_MsgPruneExpiredGrantsResponse) 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_MsgPruneExpiredGrantsResponse) 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_MsgPruneExpiredGrantsResponse) 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_MsgPruneExpiredGrantsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgPruneExpiredGrantsResponse) + 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().(*MsgPruneExpiredGrantsResponse) + 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().(*MsgPruneExpiredGrantsResponse) + 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: MsgPruneExpiredGrantsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgPruneExpiredGrantsResponse: 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.43 // Code generated by protoc-gen-go. DO NOT EDIT. @@ -3138,6 +3914,73 @@ func (*MsgRevokeResponse) Descriptor() ([]byte, []int) { return file_cosmos_authz_v1beta1_tx_proto_rawDescGZIP(), []int{5} } +// MsgPruneExpiredGrants prunes the expired grants. +// +// Since cosmos-sdk 0.50.x-celestia +type MsgPruneExpiredGrants struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Pruner string `protobuf:"bytes,1,opt,name=pruner,proto3" json:"pruner,omitempty"` +} + +func (x *MsgPruneExpiredGrants) Reset() { + *x = MsgPruneExpiredGrants{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_authz_v1beta1_tx_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgPruneExpiredGrants) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgPruneExpiredGrants) ProtoMessage() {} + +// Deprecated: Use MsgPruneExpiredGrants.ProtoReflect.Descriptor instead. +func (*MsgPruneExpiredGrants) Descriptor() ([]byte, []int) { + return file_cosmos_authz_v1beta1_tx_proto_rawDescGZIP(), []int{6} +} + +func (x *MsgPruneExpiredGrants) GetPruner() string { + if x != nil { + return x.Pruner + } + return "" +} + +// MsgPruneExpiredGrantsResponse defines the Msg/MsgPruneExpiredGrantsResponse response type. +// +// Since cosmos-sdk 0.50.x-celestia +type MsgPruneExpiredGrantsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgPruneExpiredGrantsResponse) Reset() { + *x = MsgPruneExpiredGrantsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_authz_v1beta1_tx_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgPruneExpiredGrantsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgPruneExpiredGrantsResponse) ProtoMessage() {} + +// Deprecated: Use MsgPruneExpiredGrantsResponse.ProtoReflect.Descriptor instead. +func (*MsgPruneExpiredGrantsResponse) Descriptor() ([]byte, []int) { + return file_cosmos_authz_v1beta1_tx_proto_rawDescGZIP(), []int{7} +} + var File_cosmos_authz_v1beta1_tx_proto protoreflect.FileDescriptor var file_cosmos_authz_v1beta1_tx_proto_rawDesc = []byte{ @@ -3195,37 +4038,52 @@ var file_cosmos_authz_v1beta1_tx_proto_rawDesc = []byte{ 0xe7, 0xb0, 0x2a, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x72, 0x8a, 0xe7, 0xb0, 0x2a, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x22, 0x13, 0x0a, 0x11, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x76, 0x6f, 0x6b, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xff, 0x01, 0x0a, 0x03, 0x4d, 0x73, - 0x67, 0x12, 0x4f, 0x0a, 0x05, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x12, 0x1e, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x1a, 0x26, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x4c, 0x0a, 0x04, 0x45, 0x78, 0x65, 0x63, 0x12, 0x1d, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x1a, 0x25, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x52, 0x0a, 0x06, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x12, 0x1f, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x1a, 0x27, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xcd, 0x01, 0x0a, 0x18, - 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, - 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, - 0x68, 0x7a, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x61, 0x75, 0x74, 0x68, 0x7a, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x41, 0x58, 0xaa, 0x02, 0x14, - 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x56, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x14, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x75, - 0x74, 0x68, 0x7a, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x20, 0x43, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x75, 0x74, 0x68, 0x7a, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, - 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x75, 0x74, 0x68, 0x7a, 0x3a, 0x3a, - 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xc8, 0xe1, 0x1e, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x56, 0x0a, 0x15, 0x4d, 0x73, 0x67, + 0x50, 0x72, 0x75, 0x6e, 0x65, 0x45, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x47, 0x72, 0x61, 0x6e, + 0x74, 0x73, 0x12, 0x30, 0x0a, 0x06, 0x70, 0x72, 0x75, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x06, 0x70, 0x72, + 0x75, 0x6e, 0x65, 0x72, 0x3a, 0x0b, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x70, 0x72, 0x75, 0x6e, 0x65, + 0x72, 0x22, 0x1f, 0x0a, 0x1d, 0x4d, 0x73, 0x67, 0x50, 0x72, 0x75, 0x6e, 0x65, 0x45, 0x78, 0x70, + 0x69, 0x72, 0x65, 0x64, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x32, 0xf7, 0x02, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x4f, 0x0a, 0x05, 0x47, 0x72, + 0x61, 0x6e, 0x74, 0x12, 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, + 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x47, 0x72, + 0x61, 0x6e, 0x74, 0x1a, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, + 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x47, 0x72, + 0x61, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4c, 0x0a, 0x04, 0x45, + 0x78, 0x65, 0x63, 0x12, 0x1d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, + 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x78, + 0x65, 0x63, 0x1a, 0x25, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, + 0x7a, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, + 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x52, 0x0a, 0x06, 0x52, 0x65, 0x76, + 0x6f, 0x6b, 0x65, 0x12, 0x1f, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, + 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, + 0x76, 0x6f, 0x6b, 0x65, 0x1a, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, + 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, + 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x76, 0x0a, + 0x12, 0x50, 0x72, 0x75, 0x6e, 0x65, 0x45, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x47, 0x72, 0x61, + 0x6e, 0x74, 0x73, 0x12, 0x2b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, + 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x50, 0x72, + 0x75, 0x6e, 0x65, 0x45, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, + 0x1a, 0x33, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x50, 0x72, 0x75, 0x6e, 0x65, + 0x45, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xcd, 0x01, 0xc8, + 0xe1, 0x1e, 0x00, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x07, 0x54, + 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x7a, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, + 0x61, 0x75, 0x74, 0x68, 0x7a, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, + 0x41, 0x58, 0xaa, 0x02, 0x14, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x75, 0x74, 0x68, + 0x7a, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x14, 0x43, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x5c, 0x41, 0x75, 0x74, 0x68, 0x7a, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0xe2, 0x02, 0x20, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x75, 0x74, 0x68, 0x7a, 0x5c, + 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0xea, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x75, + 0x74, 0x68, 0x7a, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -3240,28 +4098,32 @@ func file_cosmos_authz_v1beta1_tx_proto_rawDescGZIP() []byte { return file_cosmos_authz_v1beta1_tx_proto_rawDescData } -var file_cosmos_authz_v1beta1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_cosmos_authz_v1beta1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_cosmos_authz_v1beta1_tx_proto_goTypes = []interface{}{ - (*MsgGrant)(nil), // 0: cosmos.authz.v1beta1.MsgGrant - (*MsgGrantResponse)(nil), // 1: cosmos.authz.v1beta1.MsgGrantResponse - (*MsgExec)(nil), // 2: cosmos.authz.v1beta1.MsgExec - (*MsgExecResponse)(nil), // 3: cosmos.authz.v1beta1.MsgExecResponse - (*MsgRevoke)(nil), // 4: cosmos.authz.v1beta1.MsgRevoke - (*MsgRevokeResponse)(nil), // 5: cosmos.authz.v1beta1.MsgRevokeResponse - (*Grant)(nil), // 6: cosmos.authz.v1beta1.Grant - (*anypb.Any)(nil), // 7: google.protobuf.Any + (*MsgGrant)(nil), // 0: cosmos.authz.v1beta1.MsgGrant + (*MsgGrantResponse)(nil), // 1: cosmos.authz.v1beta1.MsgGrantResponse + (*MsgExec)(nil), // 2: cosmos.authz.v1beta1.MsgExec + (*MsgExecResponse)(nil), // 3: cosmos.authz.v1beta1.MsgExecResponse + (*MsgRevoke)(nil), // 4: cosmos.authz.v1beta1.MsgRevoke + (*MsgRevokeResponse)(nil), // 5: cosmos.authz.v1beta1.MsgRevokeResponse + (*MsgPruneExpiredGrants)(nil), // 6: cosmos.authz.v1beta1.MsgPruneExpiredGrants + (*MsgPruneExpiredGrantsResponse)(nil), // 7: cosmos.authz.v1beta1.MsgPruneExpiredGrantsResponse + (*Grant)(nil), // 8: cosmos.authz.v1beta1.Grant + (*anypb.Any)(nil), // 9: google.protobuf.Any } var file_cosmos_authz_v1beta1_tx_proto_depIdxs = []int32{ - 6, // 0: cosmos.authz.v1beta1.MsgGrant.grant:type_name -> cosmos.authz.v1beta1.Grant - 7, // 1: cosmos.authz.v1beta1.MsgExec.msgs:type_name -> google.protobuf.Any + 8, // 0: cosmos.authz.v1beta1.MsgGrant.grant:type_name -> cosmos.authz.v1beta1.Grant + 9, // 1: cosmos.authz.v1beta1.MsgExec.msgs:type_name -> google.protobuf.Any 0, // 2: cosmos.authz.v1beta1.Msg.Grant:input_type -> cosmos.authz.v1beta1.MsgGrant 2, // 3: cosmos.authz.v1beta1.Msg.Exec:input_type -> cosmos.authz.v1beta1.MsgExec 4, // 4: cosmos.authz.v1beta1.Msg.Revoke:input_type -> cosmos.authz.v1beta1.MsgRevoke - 1, // 5: cosmos.authz.v1beta1.Msg.Grant:output_type -> cosmos.authz.v1beta1.MsgGrantResponse - 3, // 6: cosmos.authz.v1beta1.Msg.Exec:output_type -> cosmos.authz.v1beta1.MsgExecResponse - 5, // 7: cosmos.authz.v1beta1.Msg.Revoke:output_type -> cosmos.authz.v1beta1.MsgRevokeResponse - 5, // [5:8] is the sub-list for method output_type - 2, // [2:5] is the sub-list for method input_type + 6, // 5: cosmos.authz.v1beta1.Msg.PruneExpiredGrants:input_type -> cosmos.authz.v1beta1.MsgPruneExpiredGrants + 1, // 6: cosmos.authz.v1beta1.Msg.Grant:output_type -> cosmos.authz.v1beta1.MsgGrantResponse + 3, // 7: cosmos.authz.v1beta1.Msg.Exec:output_type -> cosmos.authz.v1beta1.MsgExecResponse + 5, // 8: cosmos.authz.v1beta1.Msg.Revoke:output_type -> cosmos.authz.v1beta1.MsgRevokeResponse + 7, // 9: cosmos.authz.v1beta1.Msg.PruneExpiredGrants:output_type -> cosmos.authz.v1beta1.MsgPruneExpiredGrantsResponse + 6, // [6:10] is the sub-list for method output_type + 2, // [2:6] is the sub-list for method input_type 2, // [2:2] is the sub-list for extension type_name 2, // [2:2] is the sub-list for extension extendee 0, // [0:2] is the sub-list for field type_name @@ -3346,6 +4208,30 @@ func file_cosmos_authz_v1beta1_tx_proto_init() { return nil } } + file_cosmos_authz_v1beta1_tx_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgPruneExpiredGrants); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_authz_v1beta1_tx_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgPruneExpiredGrantsResponse); 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{ @@ -3353,7 +4239,7 @@ func file_cosmos_authz_v1beta1_tx_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_authz_v1beta1_tx_proto_rawDesc, NumEnums: 0, - NumMessages: 6, + NumMessages: 8, NumExtensions: 0, NumServices: 1, }, diff --git a/api/cosmos/authz/v1beta1/tx_grpc.pb.go b/api/cosmos/authz/v1beta1/tx_grpc.pb.go index 2dcbc3ed90f6..2842eb3f5ddc 100644 --- a/api/cosmos/authz/v1beta1/tx_grpc.pb.go +++ b/api/cosmos/authz/v1beta1/tx_grpc.pb.go @@ -21,9 +21,10 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - Msg_Grant_FullMethodName = "/cosmos.authz.v1beta1.Msg/Grant" - Msg_Exec_FullMethodName = "/cosmos.authz.v1beta1.Msg/Exec" - Msg_Revoke_FullMethodName = "/cosmos.authz.v1beta1.Msg/Revoke" + Msg_Grant_FullMethodName = "/cosmos.authz.v1beta1.Msg/Grant" + Msg_Exec_FullMethodName = "/cosmos.authz.v1beta1.Msg/Exec" + Msg_Revoke_FullMethodName = "/cosmos.authz.v1beta1.Msg/Revoke" + Msg_PruneExpiredGrants_FullMethodName = "/cosmos.authz.v1beta1.Msg/PruneExpiredGrants" ) // MsgClient is the client API for Msg service. @@ -42,6 +43,10 @@ type MsgClient interface { // Revoke revokes any authorization corresponding to the provided method name on the // granter's account that has been granted to the grantee. Revoke(ctx context.Context, in *MsgRevoke, opts ...grpc.CallOption) (*MsgRevokeResponse, error) + // PruneExpiredGrants prunes the expired grants. Currently up to 75 at a time. + // + // Since cosmos-sdk 0.51 + PruneExpiredGrants(ctx context.Context, in *MsgPruneExpiredGrants, opts ...grpc.CallOption) (*MsgPruneExpiredGrantsResponse, error) } type msgClient struct { @@ -79,6 +84,15 @@ func (c *msgClient) Revoke(ctx context.Context, in *MsgRevoke, opts ...grpc.Call return out, nil } +func (c *msgClient) PruneExpiredGrants(ctx context.Context, in *MsgPruneExpiredGrants, opts ...grpc.CallOption) (*MsgPruneExpiredGrantsResponse, error) { + out := new(MsgPruneExpiredGrantsResponse) + err := c.cc.Invoke(ctx, Msg_PruneExpiredGrants_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. // All implementations must embed UnimplementedMsgServer // for forward compatibility @@ -95,6 +109,10 @@ type MsgServer interface { // Revoke revokes any authorization corresponding to the provided method name on the // granter's account that has been granted to the grantee. Revoke(context.Context, *MsgRevoke) (*MsgRevokeResponse, error) + // PruneExpiredGrants prunes the expired grants. Currently up to 75 at a time. + // + // Since cosmos-sdk 0.51 + PruneExpiredGrants(context.Context, *MsgPruneExpiredGrants) (*MsgPruneExpiredGrantsResponse, error) mustEmbedUnimplementedMsgServer() } @@ -111,6 +129,9 @@ func (UnimplementedMsgServer) Exec(context.Context, *MsgExec) (*MsgExecResponse, func (UnimplementedMsgServer) Revoke(context.Context, *MsgRevoke) (*MsgRevokeResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Revoke not implemented") } +func (UnimplementedMsgServer) PruneExpiredGrants(context.Context, *MsgPruneExpiredGrants) (*MsgPruneExpiredGrantsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PruneExpiredGrants not implemented") +} func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. @@ -178,6 +199,24 @@ func _Msg_Revoke_Handler(srv interface{}, ctx context.Context, dec func(interfac return interceptor(ctx, in, info, handler) } +func _Msg_PruneExpiredGrants_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgPruneExpiredGrants) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).PruneExpiredGrants(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_PruneExpiredGrants_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).PruneExpiredGrants(ctx, req.(*MsgPruneExpiredGrants)) + } + return interceptor(ctx, in, info, handler) +} + // Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -197,6 +236,10 @@ var Msg_ServiceDesc = grpc.ServiceDesc{ MethodName: "Revoke", Handler: _Msg_Revoke_Handler, }, + { + MethodName: "PruneExpiredGrants", + Handler: _Msg_PruneExpiredGrants_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmos/authz/v1beta1/tx.proto", diff --git a/proto/cosmos/authz/v1beta1/event.proto b/proto/cosmos/authz/v1beta1/event.proto index 0476649afc1b..caa60878c13c 100644 --- a/proto/cosmos/authz/v1beta1/event.proto +++ b/proto/cosmos/authz/v1beta1/event.proto @@ -1,4 +1,3 @@ -// Since: cosmos-sdk 0.43 syntax = "proto3"; package cosmos.authz.v1beta1; @@ -7,6 +6,8 @@ import "cosmos_proto/cosmos.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/authz"; // EventGrant is emitted on Msg/Grant +// +// Since: cosmos-sdk 0.43 message EventGrant { // Msg type URL for which an autorization is granted string msg_type_url = 2; @@ -17,6 +18,8 @@ message EventGrant { } // EventRevoke is emitted on Msg/Revoke +// +// Since: cosmos-sdk 0.43 message EventRevoke { // Msg type URL for which an autorization is revoked string msg_type_url = 2; @@ -25,3 +28,11 @@ message EventRevoke { // Grantee account address string grantee = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } + +// EventPruneExpiredGrants is emitted on Msg/PruneExpiredGrants +// +// Since: x/authz 1.0.0 +message EventPruneExpiredGrants { + // Address of the pruner + string pruner = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} diff --git a/proto/cosmos/authz/v1beta1/tx.proto b/proto/cosmos/authz/v1beta1/tx.proto index a1abff0d6f00..87ce7c095500 100644 --- a/proto/cosmos/authz/v1beta1/tx.proto +++ b/proto/cosmos/authz/v1beta1/tx.proto @@ -30,6 +30,11 @@ service Msg { // Revoke revokes any authorization corresponding to the provided method name on the // granter's account that has been granted to the grantee. rpc Revoke(MsgRevoke) returns (MsgRevokeResponse); + + // PruneExpiredGrants prunes the expired grants. Currently up to 75 at a time. + // + // Since cosmos-sdk 0.50.x-celestia + rpc PruneExpiredGrants(MsgPruneExpiredGrants) returns (MsgPruneExpiredGrantsResponse); } // MsgGrant is a request type for Grant method. It declares authorization to the grantee @@ -79,3 +84,17 @@ message MsgRevoke { // MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. message MsgRevokeResponse {} + +// MsgPruneExpiredGrants prunes the expired grants. +// +// Since cosmos-sdk 0.50.x-celestia +message MsgPruneExpiredGrants { + option (cosmos.msg.v1.signer) = "pruner"; + + string pruner = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgPruneExpiredGrantsResponse defines the Msg/MsgPruneExpiredGrantsResponse response type. +// +// Since cosmos-sdk 0.50.x-celestia +message MsgPruneExpiredGrantsResponse {} diff --git a/x/authz/README.md b/x/authz/README.md index c58326aa21ee..573760d2aa7d 100644 --- a/x/authz/README.md +++ b/x/authz/README.md @@ -22,6 +22,7 @@ granting arbitrary privileges from one account (the granter) to another account * [MsgGrant](#msggrant) * [MsgRevoke](#msgrevoke) * [MsgExec](#msgexec) + * [MsgPruneExpiredGrants](#msgpruneexpiredgrants) * [Events](#events) * [Client](#client) * [CLI](#cli) @@ -181,6 +182,10 @@ The message handling should fail if: * grantee doesn't have permission to run the transaction. * if granted authorization is expired. +### MsgPruneExpiredGrants + +Message that clean up 75 expired grants. A user has no benefit sending this transaction, it is only used by the chain to clean up expired grants. + ## Events The authz module emits proto events defined in [the Protobuf reference](https://buf.build/cosmos/cosmos-sdk/docs/main/cosmos.authz.v1beta1#cosmos.authz.v1beta1.EventGrant). diff --git a/x/authz/event.pb.go b/x/authz/event.pb.go index 454bd1611f15..5149a60513de 100644 --- a/x/authz/event.pb.go +++ b/x/authz/event.pb.go @@ -24,6 +24,8 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // EventGrant is emitted on Msg/Grant +// +// Since: cosmos-sdk 0.43 type EventGrant struct { // Msg type URL for which an autorization is granted MsgTypeUrl string `protobuf:"bytes,2,opt,name=msg_type_url,json=msgTypeUrl,proto3" json:"msg_type_url,omitempty"` @@ -88,6 +90,8 @@ func (m *EventGrant) GetGrantee() string { } // EventRevoke is emitted on Msg/Revoke +// +// Since: cosmos-sdk 0.43 type EventRevoke struct { // Msg type URL for which an autorization is revoked MsgTypeUrl string `protobuf:"bytes,2,opt,name=msg_type_url,json=msgTypeUrl,proto3" json:"msg_type_url,omitempty"` @@ -151,15 +155,64 @@ func (m *EventRevoke) GetGrantee() string { return "" } +// EventPruneExpiredGrants is emitted on Msg/PruneExpiredGrants +// +// Since: x/authz 1.0.0 +type EventPruneExpiredGrants struct { + // Address of the pruner + Pruner string `protobuf:"bytes,2,opt,name=pruner,proto3" json:"pruner,omitempty"` +} + +func (m *EventPruneExpiredGrants) Reset() { *m = EventPruneExpiredGrants{} } +func (m *EventPruneExpiredGrants) String() string { return proto.CompactTextString(m) } +func (*EventPruneExpiredGrants) ProtoMessage() {} +func (*EventPruneExpiredGrants) Descriptor() ([]byte, []int) { + return fileDescriptor_1f88cbc71a8baf1f, []int{2} +} +func (m *EventPruneExpiredGrants) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventPruneExpiredGrants) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventPruneExpiredGrants.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 *EventPruneExpiredGrants) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventPruneExpiredGrants.Merge(m, src) +} +func (m *EventPruneExpiredGrants) XXX_Size() int { + return m.Size() +} +func (m *EventPruneExpiredGrants) XXX_DiscardUnknown() { + xxx_messageInfo_EventPruneExpiredGrants.DiscardUnknown(m) +} + +var xxx_messageInfo_EventPruneExpiredGrants proto.InternalMessageInfo + +func (m *EventPruneExpiredGrants) GetPruner() string { + if m != nil { + return m.Pruner + } + return "" +} + func init() { proto.RegisterType((*EventGrant)(nil), "cosmos.authz.v1beta1.EventGrant") proto.RegisterType((*EventRevoke)(nil), "cosmos.authz.v1beta1.EventRevoke") + proto.RegisterType((*EventPruneExpiredGrants)(nil), "cosmos.authz.v1beta1.EventPruneExpiredGrants") } func init() { proto.RegisterFile("cosmos/authz/v1beta1/event.proto", fileDescriptor_1f88cbc71a8baf1f) } var fileDescriptor_1f88cbc71a8baf1f = []byte{ - // 245 bytes of a gzipped FileDescriptorProto + // 280 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x48, 0xce, 0x2f, 0xce, 0xcd, 0x2f, 0xd6, 0x4f, 0x2c, 0x2d, 0xc9, 0xa8, 0xd2, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x4f, 0x2d, 0x4b, 0xcd, 0x2b, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x81, 0xa8, @@ -170,12 +223,14 @@ var fileDescriptor_1f88cbc71a8baf1f = []byte{ 0xe5, 0x08, 0x19, 0x71, 0xb1, 0xa7, 0x83, 0x94, 0xa6, 0x16, 0x49, 0x30, 0x83, 0x24, 0x9d, 0x24, 0x2e, 0x6d, 0xd1, 0x85, 0x59, 0xeb, 0x98, 0x92, 0x52, 0x94, 0x5a, 0x5c, 0x1c, 0x5c, 0x52, 0x94, 0x99, 0x97, 0x1e, 0x04, 0x53, 0x88, 0xd0, 0x93, 0x2a, 0xc1, 0x42, 0x9c, 0x9e, 0x54, 0xa5, 0xe9, - 0x8c, 0x5c, 0xdc, 0x60, 0x87, 0x05, 0xa5, 0x96, 0xe5, 0x67, 0xa7, 0x0e, 0x1e, 0x97, 0x39, 0xd9, - 0x9d, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, - 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x4a, 0x7a, 0x66, 0x49, 0x46, - 0x69, 0x92, 0x5e, 0x72, 0x7e, 0x2e, 0x34, 0x94, 0xa1, 0x94, 0x6e, 0x71, 0x4a, 0xb6, 0x7e, 0x05, - 0x24, 0xde, 0x92, 0xd8, 0xc0, 0x21, 0x6f, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x5b, 0x74, 0xc2, - 0x29, 0xce, 0x01, 0x00, 0x00, + 0x8c, 0x5c, 0xdc, 0x60, 0x87, 0x05, 0xa5, 0x96, 0xe5, 0x67, 0xa7, 0x0e, 0x22, 0x97, 0x79, 0x73, + 0x89, 0x83, 0x1d, 0x16, 0x50, 0x54, 0x9a, 0x97, 0xea, 0x5a, 0x51, 0x90, 0x59, 0x94, 0x9a, 0x02, + 0x0e, 0xbd, 0x62, 0x21, 0x03, 0x2e, 0xb6, 0x02, 0x90, 0x68, 0x11, 0xc4, 0x79, 0x78, 0x4c, 0x83, + 0xaa, 0x73, 0xb2, 0x3b, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, + 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0x95, 0xf4, + 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x68, 0x94, 0x41, 0x29, 0xdd, 0xe2, 0x94, + 0x6c, 0xfd, 0x0a, 0x48, 0x22, 0x48, 0x62, 0x03, 0x47, 0xa3, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, + 0xeb, 0x7d, 0x9a, 0xa8, 0x1b, 0x02, 0x00, 0x00, } func (m *EventGrant) Marshal() (dAtA []byte, err error) { @@ -266,6 +321,36 @@ func (m *EventRevoke) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *EventPruneExpiredGrants) 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 *EventPruneExpiredGrants) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventPruneExpiredGrants) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Pruner) > 0 { + i -= len(m.Pruner) + copy(dAtA[i:], m.Pruner) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Pruner))) + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} + func encodeVarintEvent(dAtA []byte, offset int, v uint64) int { offset -= sovEvent(v) base := offset @@ -319,6 +404,19 @@ func (m *EventRevoke) Size() (n int) { return n } +func (m *EventPruneExpiredGrants) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Pruner) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + return n +} + func sovEvent(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -617,6 +715,88 @@ func (m *EventRevoke) Unmarshal(dAtA []byte) error { } return nil } +func (m *EventPruneExpiredGrants) 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 ErrIntOverflowEvent + } + 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: EventPruneExpiredGrants: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventPruneExpiredGrants: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pruner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Pruner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvent(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipEvent(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/authz/keeper/keeper.go b/x/authz/keeper/keeper.go index 974c18000e42..2cda9e8beb35 100644 --- a/x/authz/keeper/keeper.go +++ b/x/authz/keeper/keeper.go @@ -413,7 +413,7 @@ func (k Keeper) removeFromGrantQueue(ctx context.Context, grantKey []byte, grant } // DequeueAndDeleteExpiredGrants deletes expired grants from the state and grant queue. -func (k Keeper) DequeueAndDeleteExpiredGrants(ctx context.Context) error { +func (k Keeper) DequeueAndDeleteExpiredGrants(ctx context.Context, limit int) error { store := k.storeService.OpenKVStore(ctx) sdkCtx := sdk.UnwrapSDKContext(ctx) @@ -423,6 +423,7 @@ func (k Keeper) DequeueAndDeleteExpiredGrants(ctx context.Context) error { } defer iterator.Close() + count := 0 for ; iterator.Valid(); iterator.Next() { var queueItem authz.GrantQueueItem if err := k.cdc.Unmarshal(iterator.Value(), &queueItem); err != nil { @@ -434,8 +435,7 @@ func (k Keeper) DequeueAndDeleteExpiredGrants(ctx context.Context) error { return err } - err = store.Delete(iterator.Key()) - if err != nil { + if err = store.Delete(iterator.Key()); err != nil { return err } @@ -445,6 +445,12 @@ func (k Keeper) DequeueAndDeleteExpiredGrants(ctx context.Context) error { return err } } + + // limit the amount of iterations to avoid taking too much time + count++ + if count == limit { + return nil + } } return nil diff --git a/x/authz/keeper/keeper_test.go b/x/authz/keeper/keeper_test.go index 94f3f50fa3c0..070d4d3c1170 100644 --- a/x/authz/keeper/keeper_test.go +++ b/x/authz/keeper/keeper_test.go @@ -378,7 +378,7 @@ func (s *TestSuite) TestDequeueAllGrantsQueue() { require.NoError(err) newCtx := s.ctx.WithBlockTime(exp.AddDate(1, 0, 0)) - err = s.authzKeeper.DequeueAndDeleteExpiredGrants(newCtx) + err = s.authzKeeper.DequeueAndDeleteExpiredGrants(newCtx, 200) require.NoError(err) s.T().Log("verify expired grants are pruned from the state") diff --git a/x/authz/keeper/msg_server.go b/x/authz/keeper/msg_server.go index 98e24a44f2a2..d4c9342f1383 100644 --- a/x/authz/keeper/msg_server.go +++ b/x/authz/keeper/msg_server.go @@ -125,6 +125,18 @@ func (k Keeper) Exec(goCtx context.Context, msg *authz.MsgExec) (*authz.MsgExecR return &authz.MsgExecResponse{Results: results}, nil } +func (k Keeper) PruneExpiredGrants(ctx context.Context, msg *authz.MsgPruneExpiredGrants) (*authz.MsgPruneExpiredGrantsResponse, error) { + // 75 is an arbitrary value, we can change it later if needed + if err := k.DequeueAndDeleteExpiredGrants(ctx, 75); err != nil { + return nil, err + } + + sdkCtx := sdk.UnwrapSDKContext(ctx) + _ = sdkCtx.EventManager().EmitTypedEvent(&authz.EventPruneExpiredGrants{Pruner: msg.Pruner}) + + return &authz.MsgPruneExpiredGrantsResponse{}, nil +} + func validateMsgs(msgs []sdk.Msg) error { for i, msg := range msgs { m, ok := msg.(sdk.HasValidateBasic) diff --git a/x/authz/keeper/msg_server_test.go b/x/authz/keeper/msg_server_test.go index d314c4d2ce08..408caee67e73 100644 --- a/x/authz/keeper/msg_server_test.go +++ b/x/authz/keeper/msg_server_test.go @@ -15,7 +15,7 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" ) -func (suite *TestSuite) createAccounts(accs int) []sdk.AccAddress { +func (suite *TestSuite) createAccounts() []sdk.AccAddress { addrs := simtestutil.CreateIncrementalAccounts(2) suite.accountKeeper.EXPECT().GetAccount(gomock.Any(), suite.addrs[0]).Return(authtypes.NewBaseAccountWithAddress(suite.addrs[0])).AnyTimes() suite.accountKeeper.EXPECT().GetAccount(gomock.Any(), suite.addrs[1]).Return(authtypes.NewBaseAccountWithAddress(suite.addrs[1])).AnyTimes() @@ -24,7 +24,7 @@ func (suite *TestSuite) createAccounts(accs int) []sdk.AccAddress { func (suite *TestSuite) TestGrant() { ctx := suite.ctx.WithBlockTime(time.Now()) - addrs := suite.createAccounts(2) + addrs := suite.createAccounts() curBlockTime := ctx.BlockTime() suite.accountKeeper.EXPECT().AddressCodec().Return(address.NewBech32Codec("cosmos")).AnyTimes() @@ -207,7 +207,7 @@ func (suite *TestSuite) TestGrant() { } func (suite *TestSuite) TestRevoke() { - addrs := suite.createAccounts(2) + addrs := suite.createAccounts() grantee, granter := addrs[0], addrs[1] @@ -305,7 +305,7 @@ func (suite *TestSuite) TestRevoke() { } func (suite *TestSuite) TestExec() { - addrs := suite.createAccounts(2) + addrs := suite.createAccounts() grantee, granter := addrs[0], addrs[1] coins := sdk.NewCoins(sdk.NewCoin("steak", sdkmath.NewInt(10))) @@ -368,3 +368,47 @@ func (suite *TestSuite) TestExec() { }) } } + +func (suite *TestSuite) TestPruneExpiredGrants() { + addrs := suite.createAccounts() + + timeNow := suite.ctx.BlockTime() + expiration := timeNow.Add(time.Hour) + coins := sdk.NewCoins(sdk.NewCoin("steak", sdkmath.NewInt(10))) + grant, err := authz.NewGrant(timeNow, banktypes.NewSendAuthorization(coins, nil), &expiration) + suite.Require().NoError(err) + + _, err = suite.msgSrvr.Grant(suite.ctx, &authz.MsgGrant{ + Granter: addrs[0].String(), + Grantee: addrs[1].String(), + Grant: grant, + }) + suite.Require().NoError(err) + + _, err = suite.msgSrvr.Grant(suite.ctx, &authz.MsgGrant{ + Granter: addrs[1].String(), + Grantee: addrs[0].String(), + Grant: grant, + }) + suite.Require().NoError(err) + + totalGrants := 0 + suite.authzKeeper.IterateGrants(suite.ctx, func(sdk.AccAddress, sdk.AccAddress, authz.Grant) bool { + totalGrants++ + return false + }) + suite.Require().Equal(len(addrs), totalGrants) + + // prune expired grants + suite.ctx = suite.ctx.WithBlockTime(suite.ctx.BlockTime().Add(2 * time.Hour)) + + _, err = suite.authzKeeper.PruneExpiredGrants(suite.ctx, &authz.MsgPruneExpiredGrants{Pruner: addrs[0].String()}) + suite.Require().NoError(err) + + totalGrants = 0 + suite.authzKeeper.IterateGrants(suite.ctx, func(sdk.AccAddress, sdk.AccAddress, authz.Grant) bool { + totalGrants++ + return false + }) + suite.Require().Equal(0, totalGrants) +} diff --git a/x/authz/module/abci.go b/x/authz/module/abci.go index fc405bb8f06f..47d438855707 100644 --- a/x/authz/module/abci.go +++ b/x/authz/module/abci.go @@ -8,5 +8,6 @@ import ( // BeginBlocker is called at the beginning of every block func BeginBlocker(ctx sdk.Context, keeper keeper.Keeper) error { // delete all the mature grants - return keeper.DequeueAndDeleteExpiredGrants(ctx) + // 200 is an arbitrary value, we can change it later if needed + return keeper.DequeueAndDeleteExpiredGrants(ctx, 200) } diff --git a/x/authz/module/autocli.go b/x/authz/module/autocli.go index fc551183e475..fde8e095b955 100644 --- a/x/authz/module/autocli.go +++ b/x/authz/module/autocli.go @@ -70,6 +70,13 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { {ProtoField: "msg_type_url"}, }, }, + { + RpcMethod: "PruneExpiredGrants", + Use: "prune-grants --from [granter]", + Short: "Prune expired grants", + Long: "Prune up to 75 expired grants in order to reduce the size of the store when the number of expired grants is large.", + Example: fmt.Sprintf(`$ %s tx authz prune-grants --from [mykey]`, version.AppName), + }, }, }, } diff --git a/x/authz/tx.pb.go b/x/authz/tx.pb.go index efbb15db7cc7..d97c9951df1d 100644 --- a/x/authz/tx.pb.go +++ b/x/authz/tx.pb.go @@ -270,6 +270,85 @@ func (m *MsgRevokeResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgRevokeResponse proto.InternalMessageInfo +// MsgPruneExpiredGrants prunes the expired grants. +// +// Since cosmos-sdk 0.50.x-celestia +type MsgPruneExpiredGrants struct { + Pruner string `protobuf:"bytes,1,opt,name=pruner,proto3" json:"pruner,omitempty"` +} + +func (m *MsgPruneExpiredGrants) Reset() { *m = MsgPruneExpiredGrants{} } +func (m *MsgPruneExpiredGrants) String() string { return proto.CompactTextString(m) } +func (*MsgPruneExpiredGrants) ProtoMessage() {} +func (*MsgPruneExpiredGrants) Descriptor() ([]byte, []int) { + return fileDescriptor_3ceddab7d8589ad1, []int{6} +} +func (m *MsgPruneExpiredGrants) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgPruneExpiredGrants) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgPruneExpiredGrants.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 *MsgPruneExpiredGrants) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgPruneExpiredGrants.Merge(m, src) +} +func (m *MsgPruneExpiredGrants) XXX_Size() int { + return m.Size() +} +func (m *MsgPruneExpiredGrants) XXX_DiscardUnknown() { + xxx_messageInfo_MsgPruneExpiredGrants.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgPruneExpiredGrants proto.InternalMessageInfo + +// MsgPruneExpiredGrantsResponse defines the Msg/MsgPruneExpiredGrantsResponse response type. +// +// Since cosmos-sdk 0.50.x-celestia +type MsgPruneExpiredGrantsResponse struct { +} + +func (m *MsgPruneExpiredGrantsResponse) Reset() { *m = MsgPruneExpiredGrantsResponse{} } +func (m *MsgPruneExpiredGrantsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgPruneExpiredGrantsResponse) ProtoMessage() {} +func (*MsgPruneExpiredGrantsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_3ceddab7d8589ad1, []int{7} +} +func (m *MsgPruneExpiredGrantsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgPruneExpiredGrantsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgPruneExpiredGrantsResponse.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 *MsgPruneExpiredGrantsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgPruneExpiredGrantsResponse.Merge(m, src) +} +func (m *MsgPruneExpiredGrantsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgPruneExpiredGrantsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgPruneExpiredGrantsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgPruneExpiredGrantsResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgGrant)(nil), "cosmos.authz.v1beta1.MsgGrant") proto.RegisterType((*MsgGrantResponse)(nil), "cosmos.authz.v1beta1.MsgGrantResponse") @@ -277,47 +356,53 @@ func init() { proto.RegisterType((*MsgExecResponse)(nil), "cosmos.authz.v1beta1.MsgExecResponse") proto.RegisterType((*MsgRevoke)(nil), "cosmos.authz.v1beta1.MsgRevoke") proto.RegisterType((*MsgRevokeResponse)(nil), "cosmos.authz.v1beta1.MsgRevokeResponse") + proto.RegisterType((*MsgPruneExpiredGrants)(nil), "cosmos.authz.v1beta1.MsgPruneExpiredGrants") + proto.RegisterType((*MsgPruneExpiredGrantsResponse)(nil), "cosmos.authz.v1beta1.MsgPruneExpiredGrantsResponse") } func init() { proto.RegisterFile("cosmos/authz/v1beta1/tx.proto", fileDescriptor_3ceddab7d8589ad1) } var fileDescriptor_3ceddab7d8589ad1 = []byte{ - // 555 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x54, 0xbf, 0x6e, 0x13, 0x4f, - 0x10, 0xf6, 0xc6, 0x71, 0xfc, 0xf3, 0x26, 0xd2, 0x8f, 0x5c, 0x2c, 0x71, 0xb9, 0x28, 0x97, 0xd3, - 0x91, 0x80, 0x65, 0xe4, 0x5d, 0xd9, 0x74, 0x16, 0x4d, 0x2c, 0x45, 0x34, 0x58, 0x48, 0x07, 0x34, - 0x34, 0xd6, 0xd9, 0x5e, 0x36, 0x56, 0x7c, 0xb7, 0xd6, 0xed, 0xd9, 0xb2, 0xa9, 0x10, 0x25, 0x15, - 0x8f, 0x01, 0x9d, 0x8b, 0x94, 0x3c, 0x80, 0x45, 0x15, 0x51, 0x20, 0x2a, 0x04, 0x76, 0xe1, 0xc7, - 0x00, 0xdd, 0xfe, 0x31, 0x0e, 0x72, 0x42, 0x2a, 0x9a, 0xbb, 0x99, 0xf9, 0xbe, 0xd9, 0x9d, 0x6f, - 0x66, 0xb4, 0x70, 0xbf, 0xc5, 0x78, 0xc0, 0x38, 0xf6, 0xfb, 0xf1, 0xe9, 0x2b, 0x3c, 0x28, 0x37, - 0x49, 0xec, 0x97, 0x71, 0x3c, 0x44, 0xbd, 0x88, 0xc5, 0xcc, 0xc8, 0x4b, 0x18, 0x09, 0x18, 0x29, - 0xd8, 0xda, 0x95, 0xd1, 0x86, 0xe0, 0x60, 0x45, 0x11, 0x8e, 0x95, 0xa7, 0x8c, 0x32, 0x19, 0x4f, - 0x2c, 0x15, 0xdd, 0xa5, 0x8c, 0xd1, 0x2e, 0xc1, 0xc2, 0x6b, 0xf6, 0x5f, 0x62, 0x3f, 0x1c, 0x29, - 0xc8, 0x59, 0x59, 0x80, 0xbc, 0x4f, 0x32, 0x6e, 0x2b, 0x46, 0xc0, 0x29, 0x1e, 0x94, 0x93, 0x9f, - 0x02, 0xb6, 0xfd, 0xa0, 0x13, 0x32, 0x2c, 0xbe, 0x32, 0xe4, 0x7e, 0x01, 0xf0, 0xbf, 0x3a, 0xa7, - 0x8f, 0x22, 0x3f, 0x8c, 0x8d, 0x0a, 0xcc, 0xd2, 0xc4, 0x20, 0x91, 0x09, 0x1c, 0x50, 0xc8, 0xd5, - 0xcc, 0xcf, 0xe7, 0x25, 0xad, 0xe8, 0xb8, 0xdd, 0x8e, 0x08, 0xe7, 0x4f, 0xe3, 0xa8, 0x13, 0x52, - 0x4f, 0x13, 0x7f, 0xe7, 0x10, 0x73, 0xed, 0x66, 0x39, 0xc4, 0x78, 0x08, 0x33, 0xc2, 0x34, 0xd3, - 0x0e, 0x28, 0x6c, 0x56, 0xf6, 0xd0, 0xaa, 0xa6, 0x21, 0x51, 0x53, 0x2d, 0x37, 0xf9, 0x76, 0x90, - 0x7a, 0x3f, 0x1f, 0x17, 0x81, 0x27, 0x93, 0xaa, 0x87, 0x6f, 0xe6, 0xe3, 0xa2, 0xbe, 0xff, 0xed, - 0x7c, 0x5c, 0xdc, 0x91, 0xe9, 0x25, 0xde, 0x3e, 0xc3, 0x5a, 0x8b, 0x6b, 0xc0, 0x5b, 0xda, 0xf6, - 0x08, 0xef, 0xb1, 0x90, 0x13, 0xf7, 0x03, 0x80, 0xd9, 0x3a, 0xa7, 0x27, 0x43, 0xd2, 0x5a, 0xae, - 0x1b, 0xdc, 0xb4, 0xee, 0x13, 0xb8, 0x1e, 0x70, 0xca, 0xcd, 0x35, 0x27, 0x5d, 0xd8, 0xac, 0xe4, - 0x91, 0x1c, 0x12, 0xd2, 0x43, 0x42, 0xc7, 0xe1, 0xa8, 0xb6, 0xf7, 0xe9, 0xbc, 0xa4, 0x06, 0x80, - 0x9a, 0x3e, 0x27, 0x0b, 0x39, 0x75, 0x4e, 0x3d, 0x91, 0x5e, 0xbd, 0xb3, 0x24, 0x80, 0x24, 0x02, - 0x8c, 0xcb, 0x02, 0x92, 0xfa, 0xdc, 0xfb, 0xf0, 0x7f, 0x65, 0xea, 0xf2, 0x0d, 0x13, 0x66, 0x23, - 0xc2, 0xfb, 0xdd, 0x98, 0x9b, 0xc0, 0x49, 0x17, 0xb6, 0x3c, 0xed, 0xba, 0x1f, 0x01, 0xcc, 0x25, - 0xe7, 0x93, 0x01, 0x3b, 0x23, 0xff, 0x6c, 0x8c, 0x0e, 0xdc, 0x0a, 0x38, 0x6d, 0xc4, 0xa3, 0x1e, - 0x69, 0xf4, 0xa3, 0xae, 0x98, 0x66, 0xce, 0x83, 0x01, 0xa7, 0xcf, 0x46, 0x3d, 0xf2, 0x3c, 0xea, - 0x56, 0x8f, 0xfe, 0x1c, 0x55, 0xfe, 0xb2, 0x52, 0x59, 0xb0, 0xbb, 0x03, 0xb7, 0x17, 0x8e, 0x56, - 0x5b, 0xf9, 0x09, 0x60, 0xba, 0xce, 0xa9, 0xf1, 0x04, 0x66, 0xe4, 0x76, 0xda, 0xab, 0xd7, 0x44, - 0x4f, 0xd9, 0xba, 0x7b, 0x3d, 0xbe, 0x68, 0xe3, 0x63, 0xb8, 0x2e, 0x36, 0x60, 0xff, 0x4a, 0x7e, - 0x02, 0x5b, 0x47, 0xd7, 0xc2, 0x8b, 0xd3, 0x3c, 0xb8, 0xa1, 0xda, 0x7e, 0x70, 0x65, 0x82, 0x24, - 0x58, 0xf7, 0xfe, 0x42, 0xd0, 0x67, 0x5a, 0x99, 0xd7, 0xc9, 0xbe, 0xd7, 0x6a, 0x93, 0x1f, 0x76, - 0x6a, 0x32, 0xb5, 0xc1, 0xc5, 0xd4, 0x06, 0xdf, 0xa7, 0x36, 0x78, 0x37, 0xb3, 0x53, 0x17, 0x33, - 0x3b, 0xf5, 0x75, 0x66, 0xa7, 0x5e, 0x1c, 0xd2, 0x4e, 0x7c, 0xda, 0x6f, 0xa2, 0x16, 0x0b, 0xd4, - 0x8b, 0x82, 0x97, 0x9a, 0x3b, 0x94, 0x2f, 0x42, 0x73, 0x43, 0x2c, 0xe7, 0x83, 0x5f, 0x01, 0x00, - 0x00, 0xff, 0xff, 0x13, 0x38, 0x6d, 0x34, 0xb7, 0x04, 0x00, 0x00, + // 612 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x54, 0x3d, 0x6f, 0xd3, 0x40, + 0x18, 0xce, 0x35, 0xfd, 0x20, 0xd7, 0x4a, 0x50, 0x37, 0x08, 0xd7, 0x55, 0x1d, 0xcb, 0xb4, 0x10, + 0xa5, 0x8a, 0x4d, 0xd2, 0x2d, 0x62, 0x69, 0xa4, 0x88, 0x85, 0x08, 0x64, 0x3e, 0x06, 0x96, 0xc8, + 0x49, 0x8e, 0x6b, 0xd4, 0xd8, 0x67, 0xf9, 0xec, 0x28, 0x61, 0x42, 0x8c, 0x4c, 0xfc, 0x0c, 0xd8, + 0x32, 0x74, 0xe4, 0x07, 0x44, 0x4c, 0x15, 0x03, 0x62, 0x42, 0x90, 0x0c, 0xf9, 0x09, 0xac, 0xc8, + 0x77, 0x67, 0x93, 0x42, 0xd2, 0x96, 0x85, 0x25, 0x79, 0x3f, 0x9e, 0xf7, 0xee, 0x79, 0xfc, 0xdc, + 0x1d, 0xdc, 0x6d, 0x11, 0xea, 0x10, 0x6a, 0xda, 0x61, 0x70, 0xfc, 0xca, 0xec, 0x95, 0x9a, 0x28, + 0xb0, 0x4b, 0x66, 0xd0, 0x37, 0x3c, 0x9f, 0x04, 0x44, 0xca, 0xf2, 0xb6, 0xc1, 0xda, 0x86, 0x68, + 0x2b, 0xdb, 0xbc, 0xda, 0x60, 0x18, 0x53, 0x40, 0x58, 0xa2, 0x64, 0x31, 0xc1, 0x84, 0xd7, 0xa3, + 0x48, 0x54, 0xb7, 0x31, 0x21, 0xb8, 0x8b, 0x4c, 0x96, 0x35, 0xc3, 0x97, 0xa6, 0xed, 0x0e, 0x44, + 0x4b, 0x9b, 0x4b, 0x80, 0xef, 0xc7, 0x11, 0xb7, 0x04, 0xc2, 0xa1, 0xd8, 0xec, 0x95, 0xa2, 0x3f, + 0xd1, 0xd8, 0xb4, 0x9d, 0x8e, 0x4b, 0x4c, 0xf6, 0xcb, 0x4b, 0xfa, 0x17, 0x00, 0xaf, 0xd5, 0x29, + 0x7e, 0xe0, 0xdb, 0x6e, 0x20, 0x95, 0xe1, 0x1a, 0x8e, 0x02, 0xe4, 0xcb, 0x40, 0x03, 0xf9, 0x4c, + 0x55, 0xfe, 0x7c, 0x5a, 0x8c, 0x15, 0x1d, 0xb5, 0xdb, 0x3e, 0xa2, 0xf4, 0x49, 0xe0, 0x77, 0x5c, + 0x6c, 0xc5, 0xc0, 0xdf, 0x33, 0x48, 0x5e, 0xba, 0xda, 0x0c, 0x92, 0xee, 0xc3, 0x15, 0x16, 0xca, + 0x69, 0x0d, 0xe4, 0xd7, 0xcb, 0x3b, 0xc6, 0xbc, 0x8f, 0x66, 0x30, 0x4e, 0xd5, 0xcc, 0xe8, 0x5b, + 0x2e, 0xf5, 0x7e, 0x3a, 0x2c, 0x00, 0x8b, 0x0f, 0x55, 0xf6, 0xde, 0x4c, 0x87, 0x85, 0x78, 0xff, + 0xb7, 0xd3, 0x61, 0x61, 0x8b, 0x8f, 0x17, 0x69, 0xfb, 0xc4, 0x8c, 0xb5, 0xe8, 0x12, 0xbc, 0x11, + 0xc7, 0x16, 0xa2, 0x1e, 0x71, 0x29, 0xd2, 0x3f, 0x00, 0xb8, 0x56, 0xa7, 0xb8, 0xd6, 0x47, 0xad, + 0x59, 0xde, 0xe0, 0xaa, 0xbc, 0x6b, 0x70, 0xd9, 0xa1, 0x98, 0xca, 0x4b, 0x5a, 0x3a, 0xbf, 0x5e, + 0xce, 0x1a, 0xdc, 0x24, 0x23, 0x36, 0xc9, 0x38, 0x72, 0x07, 0xd5, 0x9d, 0x4f, 0xa7, 0x45, 0x61, + 0x80, 0xd1, 0xb4, 0x29, 0x4a, 0xe4, 0xd4, 0x29, 0xb6, 0xd8, 0x78, 0xe5, 0xf6, 0x8c, 0x00, 0x14, + 0x09, 0x90, 0xce, 0x0b, 0x88, 0xf8, 0xe9, 0x07, 0xf0, 0xba, 0x08, 0x63, 0xfa, 0x92, 0x0c, 0xd7, + 0x7c, 0x44, 0xc3, 0x6e, 0x40, 0x65, 0xa0, 0xa5, 0xf3, 0x1b, 0x56, 0x9c, 0xea, 0x1f, 0x01, 0xcc, + 0x44, 0xeb, 0xa3, 0x1e, 0x39, 0x41, 0xff, 0xcd, 0x46, 0x0d, 0x6e, 0x38, 0x14, 0x37, 0x82, 0x81, + 0x87, 0x1a, 0xa1, 0xdf, 0x65, 0x6e, 0x66, 0x2c, 0xe8, 0x50, 0xfc, 0x74, 0xe0, 0xa1, 0x67, 0x7e, + 0xb7, 0xb2, 0xff, 0xa7, 0x55, 0xd9, 0xf3, 0x4a, 0x39, 0x61, 0x7d, 0x0b, 0x6e, 0x26, 0x49, 0x62, + 0xd6, 0x73, 0x78, 0xb3, 0x4e, 0xf1, 0x63, 0x3f, 0x74, 0x51, 0xad, 0xef, 0x75, 0x7c, 0xd4, 0x66, + 0x66, 0x52, 0xe9, 0x1e, 0x5c, 0xf5, 0xa2, 0xea, 0xe5, 0xea, 0x04, 0xae, 0xb2, 0x1e, 0xd1, 0x10, + 0x89, 0x9e, 0x83, 0xbb, 0x73, 0xd7, 0x8d, 0x37, 0x2e, 0xff, 0x5c, 0x82, 0xe9, 0x3a, 0xc5, 0xd2, + 0x23, 0xb8, 0xc2, 0xaf, 0x85, 0x3a, 0xff, 0x7c, 0xc6, 0xc7, 0x4b, 0xb9, 0x73, 0x71, 0x3f, 0xf1, + 0xef, 0x21, 0x5c, 0x66, 0x47, 0x6f, 0x77, 0x21, 0x3e, 0x6a, 0x2b, 0xfb, 0x17, 0xb6, 0x93, 0xd5, + 0x2c, 0xb8, 0x2a, 0xfc, 0xce, 0x2d, 0x1c, 0xe0, 0x00, 0xe5, 0xee, 0x25, 0x80, 0x64, 0xcd, 0x1e, + 0x94, 0xe6, 0x7c, 0xf0, 0x83, 0x85, 0xe3, 0x7f, 0x83, 0x95, 0xc3, 0x7f, 0x00, 0xc7, 0xfb, 0x2a, + 0x2b, 0xaf, 0xa3, 0x0b, 0x5e, 0xad, 0x8e, 0x7e, 0xa8, 0xa9, 0xd1, 0x58, 0x05, 0x67, 0x63, 0x15, + 0x7c, 0x1f, 0xab, 0xe0, 0xdd, 0x44, 0x4d, 0x9d, 0x4d, 0xd4, 0xd4, 0xd7, 0x89, 0x9a, 0x7a, 0xb1, + 0x87, 0x3b, 0xc1, 0x71, 0xd8, 0x34, 0x5a, 0xc4, 0x11, 0x4f, 0xa8, 0x39, 0x73, 0x9a, 0xfa, 0xfc, + 0x09, 0x6c, 0xae, 0xb2, 0xdb, 0x78, 0xf8, 0x2b, 0x00, 0x00, 0xff, 0xff, 0xcc, 0x3a, 0x85, 0x7b, + 0xa8, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -344,6 +429,10 @@ type MsgClient interface { // Revoke revokes any authorization corresponding to the provided method name on the // granter's account that has been granted to the grantee. Revoke(ctx context.Context, in *MsgRevoke, opts ...grpc.CallOption) (*MsgRevokeResponse, error) + // PruneExpiredGrants prunes the expired grants. Currently up to 75 at a time. + // + // Since cosmos-sdk 0.50.x-celestia + PruneExpiredGrants(ctx context.Context, in *MsgPruneExpiredGrants, opts ...grpc.CallOption) (*MsgPruneExpiredGrantsResponse, error) } type msgClient struct { @@ -381,6 +470,15 @@ func (c *msgClient) Revoke(ctx context.Context, in *MsgRevoke, opts ...grpc.Call return out, nil } +func (c *msgClient) PruneExpiredGrants(ctx context.Context, in *MsgPruneExpiredGrants, opts ...grpc.CallOption) (*MsgPruneExpiredGrantsResponse, error) { + out := new(MsgPruneExpiredGrantsResponse) + err := c.cc.Invoke(ctx, "/cosmos.authz.v1beta1.Msg/PruneExpiredGrants", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { // Grant grants the provided authorization to the grantee on the granter's @@ -395,6 +493,10 @@ type MsgServer interface { // Revoke revokes any authorization corresponding to the provided method name on the // granter's account that has been granted to the grantee. Revoke(context.Context, *MsgRevoke) (*MsgRevokeResponse, error) + // PruneExpiredGrants prunes the expired grants. Currently up to 75 at a time. + // + // Since cosmos-sdk 0.50.x-celestia + PruneExpiredGrants(context.Context, *MsgPruneExpiredGrants) (*MsgPruneExpiredGrantsResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -410,6 +512,9 @@ func (*UnimplementedMsgServer) Exec(ctx context.Context, req *MsgExec) (*MsgExec func (*UnimplementedMsgServer) Revoke(ctx context.Context, req *MsgRevoke) (*MsgRevokeResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Revoke not implemented") } +func (*UnimplementedMsgServer) PruneExpiredGrants(ctx context.Context, req *MsgPruneExpiredGrants) (*MsgPruneExpiredGrantsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PruneExpiredGrants not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -469,6 +574,25 @@ func _Msg_Revoke_Handler(srv interface{}, ctx context.Context, dec func(interfac return interceptor(ctx, in, info, handler) } +func _Msg_PruneExpiredGrants_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgPruneExpiredGrants) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).PruneExpiredGrants(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.authz.v1beta1.Msg/PruneExpiredGrants", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).PruneExpiredGrants(ctx, req.(*MsgPruneExpiredGrants)) + } + return interceptor(ctx, in, info, handler) +} + +var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.authz.v1beta1.Msg", HandlerType: (*MsgServer)(nil), @@ -485,6 +609,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "Revoke", Handler: _Msg_Revoke_Handler, }, + { + MethodName: "PruneExpiredGrants", + Handler: _Msg_PruneExpiredGrants_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmos/authz/v1beta1/tx.proto", @@ -703,6 +831,59 @@ func (m *MsgRevokeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgPruneExpiredGrants) 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 *MsgPruneExpiredGrants) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgPruneExpiredGrants) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Pruner) > 0 { + i -= len(m.Pruner) + copy(dAtA[i:], m.Pruner) + i = encodeVarintTx(dAtA, i, uint64(len(m.Pruner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgPruneExpiredGrantsResponse) 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 *MsgPruneExpiredGrantsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgPruneExpiredGrantsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -806,6 +987,28 @@ func (m *MsgRevokeResponse) Size() (n int) { return n } +func (m *MsgPruneExpiredGrants) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Pruner) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgPruneExpiredGrantsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1403,6 +1606,138 @@ func (m *MsgRevokeResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgPruneExpiredGrants) 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 ErrIntOverflowTx + } + 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: MsgPruneExpiredGrants: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgPruneExpiredGrants: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pruner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Pruner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgPruneExpiredGrantsResponse) 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 ErrIntOverflowTx + } + 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: MsgPruneExpiredGrantsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgPruneExpiredGrantsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0