diff --git a/api/feemarket/feemarket/module/v1/module.pulsar.go b/api/feemarket/feemarket/module/v1/module.pulsar.go index 0f2df29..577c0ae 100644 --- a/api/feemarket/feemarket/module/v1/module.pulsar.go +++ b/api/feemarket/feemarket/module/v1/module.pulsar.go @@ -14,14 +14,16 @@ import ( ) var ( - md_Module protoreflect.MessageDescriptor - fd_Module_authority protoreflect.FieldDescriptor + md_Module protoreflect.MessageDescriptor + fd_Module_authority protoreflect.FieldDescriptor + fd_Module_fee_recipient_module protoreflect.FieldDescriptor ) func init() { file_feemarket_feemarket_module_v1_module_proto_init() md_Module = File_feemarket_feemarket_module_v1_module_proto.Messages().ByName("Module") fd_Module_authority = md_Module.Fields().ByName("authority") + fd_Module_fee_recipient_module = md_Module.Fields().ByName("fee_recipient_module") } var _ protoreflect.Message = (*fastReflection_Module)(nil) @@ -95,6 +97,12 @@ func (x *fastReflection_Module) Range(f func(protoreflect.FieldDescriptor, proto return } } + if x.FeeRecipientModule != "" { + value := protoreflect.ValueOfString(x.FeeRecipientModule) + if !f(fd_Module_fee_recipient_module, value) { + return + } + } } // Has reports whether a field is populated. @@ -112,6 +120,8 @@ func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { case "feemarket.feemarket.module.v1.Module.authority": return x.Authority != "" + case "feemarket.feemarket.module.v1.Module.fee_recipient_module": + return x.FeeRecipientModule != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.module.v1.Module")) @@ -130,6 +140,8 @@ func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { case "feemarket.feemarket.module.v1.Module.authority": x.Authority = "" + case "feemarket.feemarket.module.v1.Module.fee_recipient_module": + x.FeeRecipientModule = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.module.v1.Module")) @@ -149,6 +161,9 @@ func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) pro case "feemarket.feemarket.module.v1.Module.authority": value := x.Authority return protoreflect.ValueOfString(value) + case "feemarket.feemarket.module.v1.Module.fee_recipient_module": + value := x.FeeRecipientModule + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.module.v1.Module")) @@ -171,6 +186,8 @@ func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value proto switch fd.FullName() { case "feemarket.feemarket.module.v1.Module.authority": x.Authority = value.Interface().(string) + case "feemarket.feemarket.module.v1.Module.fee_recipient_module": + x.FeeRecipientModule = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.module.v1.Module")) @@ -193,6 +210,8 @@ func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protore switch fd.FullName() { case "feemarket.feemarket.module.v1.Module.authority": panic(fmt.Errorf("field authority of message feemarket.feemarket.module.v1.Module is not mutable")) + case "feemarket.feemarket.module.v1.Module.fee_recipient_module": + panic(fmt.Errorf("field fee_recipient_module of message feemarket.feemarket.module.v1.Module is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.module.v1.Module")) @@ -208,6 +227,8 @@ func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protor switch fd.FullName() { case "feemarket.feemarket.module.v1.Module.authority": return protoreflect.ValueOfString("") + case "feemarket.feemarket.module.v1.Module.fee_recipient_module": + return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.module.v1.Module")) @@ -281,6 +302,10 @@ func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } + l = len(x.FeeRecipientModule) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -310,6 +335,13 @@ func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.FeeRecipientModule) > 0 { + i -= len(x.FeeRecipientModule) + copy(dAtA[i:], x.FeeRecipientModule) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.FeeRecipientModule))) + i-- + dAtA[i] = 0x12 + } if len(x.Authority) > 0 { i -= len(x.Authority) copy(dAtA[i:], x.Authority) @@ -398,6 +430,38 @@ func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods { } x.Authority = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field FeeRecipientModule", 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.FeeRecipientModule = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -455,6 +519,8 @@ type Module struct { // Authority defines the custom module authority. If not set, defaults to the // governance module. Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // FeeRecipientModule defines the custom module account that the fee will be sent to. + FeeRecipientModule string `protobuf:"bytes,2,opt,name=fee_recipient_module,json=feeRecipientModule,proto3" json:"fee_recipient_module,omitempty"` } func (x *Module) Reset() { @@ -484,6 +550,13 @@ func (x *Module) GetAuthority() string { return "" } +func (x *Module) GetFeeRecipientModule() string { + if x != nil { + return x.FeeRecipientModule + } + return "" +} + var File_feemarket_feemarket_module_v1_module_proto protoreflect.FileDescriptor var file_feemarket_feemarket_module_v1_module_proto_rawDesc = []byte{ @@ -493,30 +566,33 @@ var file_feemarket_feemarket_module_v1_module_proto_rawDesc = []byte{ 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x59, 0x0a, - 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, - 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, - 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, 0x31, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x2b, 0x0a, 0x29, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x6b, 0x69, 0x70, 0x2d, 0x6d, - 0x65, 0x76, 0x2f, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2f, 0x78, 0x2f, 0x66, - 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x42, 0x80, 0x02, 0x0a, 0x21, 0x63, 0x6f, 0x6d, - 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, - 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, - 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x37, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2f, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, - 0x6b, 0x65, 0x74, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x46, 0x46, 0x4d, 0xaa, 0x02, 0x1d, 0x46, - 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, - 0x65, 0x74, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x1d, 0x46, - 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5c, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, - 0x65, 0x74, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x29, 0x46, - 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5c, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, - 0x65, 0x74, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x20, 0x46, 0x65, 0x65, 0x6d, 0x61, - 0x72, 0x6b, 0x65, 0x74, 0x3a, 0x3a, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x3a, - 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8b, 0x01, + 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, + 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x30, 0x0a, 0x14, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, + 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x66, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, + 0x6e, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x31, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x2b, + 0x0a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x6b, 0x69, + 0x70, 0x2d, 0x6d, 0x65, 0x76, 0x2f, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2f, + 0x78, 0x2f, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x42, 0x80, 0x02, 0x0a, 0x21, + 0x63, 0x6f, 0x6d, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x66, 0x65, + 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, + 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, + 0x5a, 0x37, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2f, 0x66, 0x65, 0x65, + 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, + 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x46, 0x46, 0x4d, 0xaa, + 0x02, 0x1d, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x46, 0x65, 0x65, 0x6d, + 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, + 0x02, 0x1d, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5c, 0x46, 0x65, 0x65, 0x6d, + 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, + 0x02, 0x29, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5c, 0x46, 0x65, 0x65, 0x6d, + 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x20, 0x46, 0x65, + 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x3a, 0x3a, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, + 0x65, 0x74, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/feemarket/feemarket/v1/params.pulsar.go b/api/feemarket/feemarket/v1/params.pulsar.go index c288cb5..72a23c0 100644 --- a/api/feemarket/feemarket/v1/params.pulsar.go +++ b/api/feemarket/feemarket/v1/params.pulsar.go @@ -28,6 +28,7 @@ var ( fd_Params_fee_denom protoreflect.FieldDescriptor fd_Params_enabled protoreflect.FieldDescriptor fd_Params_distribute_fees protoreflect.FieldDescriptor + fd_Params_send_tip_to_proposer protoreflect.FieldDescriptor ) func init() { @@ -45,6 +46,7 @@ func init() { fd_Params_fee_denom = md_Params.Fields().ByName("fee_denom") fd_Params_enabled = md_Params.Fields().ByName("enabled") fd_Params_distribute_fees = md_Params.Fields().ByName("distribute_fees") + fd_Params_send_tip_to_proposer = md_Params.Fields().ByName("send_tip_to_proposer") } var _ protoreflect.Message = (*fastReflection_Params)(nil) @@ -184,6 +186,12 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto return } } + if x.SendTipToProposer != false { + value := protoreflect.ValueOfBool(x.SendTipToProposer) + if !f(fd_Params_send_tip_to_proposer, value) { + return + } + } } // Has reports whether a field is populated. @@ -223,6 +231,8 @@ func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { return x.Enabled != false case "feemarket.feemarket.v1.Params.distribute_fees": return x.DistributeFees != false + case "feemarket.feemarket.v1.Params.send_tip_to_proposer": + return x.SendTipToProposer != false default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.Params")) @@ -263,6 +273,8 @@ func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { x.Enabled = false case "feemarket.feemarket.v1.Params.distribute_fees": x.DistributeFees = false + case "feemarket.feemarket.v1.Params.send_tip_to_proposer": + x.SendTipToProposer = false default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.Params")) @@ -315,6 +327,9 @@ func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) pro case "feemarket.feemarket.v1.Params.distribute_fees": value := x.DistributeFees return protoreflect.ValueOfBool(value) + case "feemarket.feemarket.v1.Params.send_tip_to_proposer": + value := x.SendTipToProposer + return protoreflect.ValueOfBool(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.Params")) @@ -359,6 +374,8 @@ func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value proto x.Enabled = value.Bool() case "feemarket.feemarket.v1.Params.distribute_fees": x.DistributeFees = value.Bool() + case "feemarket.feemarket.v1.Params.send_tip_to_proposer": + x.SendTipToProposer = value.Bool() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.Params")) @@ -403,6 +420,8 @@ func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protore panic(fmt.Errorf("field enabled of message feemarket.feemarket.v1.Params is not mutable")) case "feemarket.feemarket.v1.Params.distribute_fees": panic(fmt.Errorf("field distribute_fees of message feemarket.feemarket.v1.Params is not mutable")) + case "feemarket.feemarket.v1.Params.send_tip_to_proposer": + panic(fmt.Errorf("field send_tip_to_proposer of message feemarket.feemarket.v1.Params is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.Params")) @@ -440,6 +459,8 @@ func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protor return protoreflect.ValueOfBool(false) case "feemarket.feemarket.v1.Params.distribute_fees": return protoreflect.ValueOfBool(false) + case "feemarket.feemarket.v1.Params.send_tip_to_proposer": + return protoreflect.ValueOfBool(false) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: feemarket.feemarket.v1.Params")) @@ -553,6 +574,9 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { if x.DistributeFees { n += 2 } + if x.SendTipToProposer { + n += 2 + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -582,6 +606,16 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.SendTipToProposer { + i-- + if x.SendTipToProposer { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x68 + } if x.DistributeFees { i-- if x.DistributeFees { @@ -1051,6 +1085,26 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { } } x.DistributeFees = bool(v != 0) + case 13: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SendTipToProposer", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.SendTipToProposer = bool(v != 0) default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -1147,6 +1201,9 @@ type Params struct { // DistributeFees is a boolean that determines whether the fees are burned or // distributed to all stakers. DistributeFees bool `protobuf:"varint,12,opt,name=distribute_fees,json=distributeFees,proto3" json:"distribute_fees,omitempty"` + // SendTipToProposer is a boolean that determines whether the tip is sent to a + // proposer or to a module account. + SendTipToProposer bool `protobuf:"varint,13,opt,name=send_tip_to_proposer,json=sendTipToProposer,proto3" json:"send_tip_to_proposer,omitempty"` } func (x *Params) Reset() { @@ -1253,6 +1310,13 @@ func (x *Params) GetDistributeFees() bool { return false } +func (x *Params) GetSendTipToProposer() bool { + if x != nil { + return x.SendTipToProposer + } + return false +} + var File_feemarket_feemarket_v1_params_proto protoreflect.FileDescriptor var file_feemarket_feemarket_v1_params_proto_rawDesc = []byte{ @@ -1262,8 +1326,8 @@ var file_feemarket_feemarket_v1_params_proto_rawDesc = []byte{ 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x76, 0x31, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf4, - 0x05, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x47, 0x0a, 0x05, 0x61, 0x6c, 0x70, + 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa5, + 0x06, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x47, 0x0a, 0x05, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, @@ -1310,21 +1374,24 @@ var file_feemarket_feemarket_v1_params_proto_rawDesc = []byte{ 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, - 0x65, 0x46, 0x65, 0x65, 0x73, 0x42, 0xd8, 0x01, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x66, 0x65, - 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, - 0x74, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x33, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, - 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2f, - 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x66, 0x65, 0x65, - 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x46, 0x46, 0x58, 0xaa, 0x02, - 0x16, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x46, 0x65, 0x65, 0x6d, 0x61, - 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x16, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, - 0x6b, 0x65, 0x74, 0x5c, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5c, 0x56, 0x31, - 0xe2, 0x02, 0x22, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5c, 0x46, 0x65, 0x65, - 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x18, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, - 0x74, 0x3a, 0x3a, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x3a, 0x3a, 0x56, 0x31, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x46, 0x65, 0x65, 0x73, 0x12, 0x2f, 0x0a, 0x14, 0x73, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, + 0x70, 0x5f, 0x74, 0x6f, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x18, 0x0d, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x11, 0x73, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x70, 0x54, 0x6f, 0x50, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x42, 0xd8, 0x01, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x66, + 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, + 0x65, 0x74, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x33, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, + 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, + 0x2f, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x66, 0x65, + 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x46, 0x46, 0x58, 0xaa, + 0x02, 0x16, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x46, 0x65, 0x65, 0x6d, + 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x16, 0x46, 0x65, 0x65, 0x6d, 0x61, + 0x72, 0x6b, 0x65, 0x74, 0x5c, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5c, 0x56, + 0x31, 0xe2, 0x02, 0x22, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5c, 0x46, 0x65, + 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x18, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, + 0x65, 0x74, 0x3a, 0x3a, 0x46, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x3a, 0x3a, 0x56, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/feemarket/feemarket/v1/query_grpc.pb.go b/api/feemarket/feemarket/v1/query_grpc.pb.go index 804edad..54713f3 100644 --- a/api/feemarket/feemarket/v1/query_grpc.pb.go +++ b/api/feemarket/feemarket/v1/query_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.4.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: feemarket/feemarket/v1/query.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Query_Params_FullMethodName = "/feemarket.feemarket.v1.Query/Params" @@ -93,7 +93,7 @@ func (c *queryClient) GasPrices(ctx context.Context, in *GasPricesRequest, opts // QueryServer is the server API for Query service. // All implementations must embed UnimplementedQueryServer -// for forward compatibility +// for forward compatibility. // // Query Service for the feemarket module. type QueryServer interface { @@ -110,9 +110,12 @@ type QueryServer interface { mustEmbedUnimplementedQueryServer() } -// UnimplementedQueryServer must be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} +// UnimplementedQueryServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedQueryServer struct{} func (UnimplementedQueryServer) Params(context.Context, *ParamsRequest) (*ParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") @@ -127,6 +130,7 @@ func (UnimplementedQueryServer) GasPrices(context.Context, *GasPricesRequest) (* return nil, status.Errorf(codes.Unimplemented, "method GasPrices not implemented") } func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} +func (UnimplementedQueryServer) testEmbeddedByValue() {} // UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to QueryServer will @@ -136,6 +140,13 @@ type UnsafeQueryServer interface { } func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + // If the following call pancis, it indicates UnimplementedQueryServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Query_ServiceDesc, srv) } diff --git a/api/feemarket/feemarket/v1/tx_grpc.pb.go b/api/feemarket/feemarket/v1/tx_grpc.pb.go index f21094d..b8b5822 100644 --- a/api/feemarket/feemarket/v1/tx_grpc.pb.go +++ b/api/feemarket/feemarket/v1/tx_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.4.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: feemarket/feemarket/v1/tx.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Msg_Params_FullMethodName = "/feemarket.feemarket.v1.Msg/Params" @@ -53,7 +53,7 @@ func (c *msgClient) Params(ctx context.Context, in *MsgParams, opts ...grpc.Call // MsgServer is the server API for Msg service. // All implementations must embed UnimplementedMsgServer -// for forward compatibility +// for forward compatibility. // // Message service defines the types of messages supported by the feemarket // module. @@ -63,14 +63,18 @@ type MsgServer interface { mustEmbedUnimplementedMsgServer() } -// UnimplementedMsgServer must be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} +// UnimplementedMsgServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedMsgServer struct{} func (UnimplementedMsgServer) Params(context.Context, *MsgParams) (*MsgParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} +func (UnimplementedMsgServer) testEmbeddedByValue() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to MsgServer will @@ -80,6 +84,13 @@ type UnsafeMsgServer interface { } func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + // If the following call pancis, it indicates UnimplementedMsgServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Msg_ServiceDesc, srv) } diff --git a/proto/feemarket/feemarket/module/v1/module.proto b/proto/feemarket/feemarket/module/v1/module.proto index 9bddd03..48f92c0 100644 --- a/proto/feemarket/feemarket/module/v1/module.proto +++ b/proto/feemarket/feemarket/module/v1/module.proto @@ -13,4 +13,7 @@ message Module { // Authority defines the custom module authority. If not set, defaults to the // governance module. string authority = 1; + + // FeeRecipientModule defines the custom module account that the fee will be sent to. + string fee_recipient_module = 2; } diff --git a/proto/feemarket/feemarket/v1/params.proto b/proto/feemarket/feemarket/v1/params.proto index 3038ada..864aa73 100644 --- a/proto/feemarket/feemarket/v1/params.proto +++ b/proto/feemarket/feemarket/v1/params.proto @@ -89,4 +89,8 @@ message Params { // DistributeFees is a boolean that determines whether the fees are burned or // distributed to all stakers. bool distribute_fees = 12; + + // SendTipToProposer is a boolean that determines whether the tip is sent to a + // proposer or to a module account. + bool send_tip_to_proposer = 13; } diff --git a/tests/app/app.go b/tests/app/app.go index f5aab81..b7bd46b 100644 --- a/tests/app/app.go +++ b/tests/app/app.go @@ -370,7 +370,7 @@ func NewSimApp( ), ) - app.FeeMarketKeeper = feemarketkeeper.NewKeeper(appCodec, keys[feemarkettypes.StoreKey], app.AccountKeeper, &feemarkettypes.TestDenomResolver{}, authtypes.NewModuleAddress(govtypes.ModuleName).String()) + app.FeeMarketKeeper = feemarketkeeper.NewKeeper(appCodec, keys[feemarkettypes.StoreKey], app.AccountKeeper, &feemarkettypes.TestDenomResolver{}, authtypes.NewModuleAddress(govtypes.ModuleName).String(), authtypes.FeeCollectorName) /**** Module Options ****/ diff --git a/testutils/keeper/keeper.go b/testutils/keeper/keeper.go index 6f15b49..5e3fbc1 100644 --- a/testutils/keeper/keeper.go +++ b/testutils/keeper/keeper.go @@ -85,5 +85,6 @@ func FeeMarket( authKeeper, &feemarkettypes.TestDenomResolver{}, authtypes.NewModuleAddress(govtypes.ModuleName).String(), + authtypes.FeeCollectorName, ) } diff --git a/x/feemarket/keeper/keeper.go b/x/feemarket/keeper/keeper.go index f5bcb51..193117e 100644 --- a/x/feemarket/keeper/keeper.go +++ b/x/feemarket/keeper/keeper.go @@ -22,7 +22,8 @@ type Keeper struct { // The address that is capable of executing a MsgParams message. // Typically, this will be the governance module's address. - authority string + authority string + feeRecipientModule string } // NewKeeper constructs a new feemarket keeper. @@ -32,20 +33,24 @@ func NewKeeper( authKeeper types.AccountKeeper, resolver types.DenomResolver, authority string, + feeRecipientModule string, ) *Keeper { if _, err := sdk.AccAddressFromBech32(authority); err != nil { panic(fmt.Sprintf("invalid authority address: %s", authority)) } - k := &Keeper{ - cdc: cdc, - storeKey: storeKey, - ak: authKeeper, - resolver: resolver, - authority: authority, + if recipientAddr := authKeeper.GetModuleAddress(feeRecipientModule); recipientAddr == nil { + panic(fmt.Sprintf("%s module account has not been set", feeRecipientModule)) } - return k + return &Keeper{ + cdc: cdc, + storeKey: storeKey, + ak: authKeeper, + resolver: resolver, + authority: authority, + feeRecipientModule: feeRecipientModule, + } } // Logger returns a feemarket module-specific logger. @@ -58,6 +63,11 @@ func (k *Keeper) GetAuthority() string { return k.authority } +// GetFeeRecipientModule returns the module account that the fee will be sent to. +func (k *Keeper) GetFeeRecipientModule() string { + return k.feeRecipientModule +} + // GetEnabledHeight returns the height at which the feemarket was enabled. func (k *Keeper) GetEnabledHeight(ctx sdk.Context) (int64, error) { store := ctx.KVStore(k.storeKey) diff --git a/x/feemarket/keeper/migrations.go b/x/feemarket/keeper/migrations.go new file mode 100644 index 0000000..92b9513 --- /dev/null +++ b/x/feemarket/keeper/migrations.go @@ -0,0 +1,22 @@ +package keeper + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + + v2 "github.com/skip-mev/feemarket/x/feemarket/migrations/v2" +) + +// Migrator is a struct for handling in-place store migrations. +type Migrator struct { + keeper Keeper +} + +// NewMigrator returns a new Migrator. +func NewMigrator(keeper Keeper) Migrator { + return Migrator{keeper: keeper} +} + +// Migrate1to2 migrates from version 1 to 2. +func (m Migrator) Migrate1to2(ctx sdk.Context) error { + return v2.MigrateStore(ctx, m.keeper.cdc, m.keeper.storeKey) +} diff --git a/x/feemarket/migrations/v2/store.go b/x/feemarket/migrations/v2/store.go new file mode 100644 index 0000000..88952d9 --- /dev/null +++ b/x/feemarket/migrations/v2/store.go @@ -0,0 +1,62 @@ +package v2 + +import ( + "errors" + + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/skip-mev/feemarket/x/feemarket/types" +) + +// MigrateStore performs in-place store migrations. +// The migration adds new feemarket param -- SendTipToProposer. +func MigrateStore(ctx sdk.Context, cdc codec.BinaryCodec, storeKey storetypes.StoreKey) error { + if err := migrateParams(ctx, cdc, storeKey); err != nil { + return err + } + + return nil +} + +func migrateParams(ctx sdk.Context, cdc codec.BinaryCodec, storeKey storetypes.StoreKey) error { + ctx.Logger().Info("Migrating feemarket params...") + + // fetch old params + store := ctx.KVStore(storeKey) + bz := store.Get(types.KeyParams) + if bz == nil { + return errors.New("cannot fetch feemarket params from KV store") + } + var oldParams types.Params + cdc.MustUnmarshal(bz, &oldParams) + + // add new param values + newParams := types.Params{ + Alpha: oldParams.Alpha, + Beta: oldParams.Beta, + Gamma: oldParams.Gamma, + Delta: oldParams.Delta, + MinBaseGasPrice: oldParams.MinBaseGasPrice, + MinLearningRate: oldParams.MinLearningRate, + MaxLearningRate: oldParams.MaxLearningRate, + MaxBlockUtilization: oldParams.MaxBlockUtilization, + Window: oldParams.Window, + FeeDenom: oldParams.FeeDenom, + Enabled: oldParams.Enabled, + DistributeFees: oldParams.DistributeFees, + SendTipToProposer: true, + } + + // set params + bz, err := cdc.Marshal(&newParams) + if err != nil { + return err + } + store.Set(types.KeyParams, bz) + + ctx.Logger().Info("Finished migrating feemarket params") + + return nil +} diff --git a/x/feemarket/migrations/v2/store_test.go b/x/feemarket/migrations/v2/store_test.go new file mode 100644 index 0000000..5707946 --- /dev/null +++ b/x/feemarket/migrations/v2/store_test.go @@ -0,0 +1,74 @@ +package v2_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + + "cosmossdk.io/math" + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/testutil" + moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" + + "github.com/skip-mev/feemarket/x/feemarket" + v2 "github.com/skip-mev/feemarket/x/feemarket/migrations/v2" + "github.com/skip-mev/feemarket/x/feemarket/types" +) + +func TestParamsUpgrade(t *testing.T) { + var ( + encCfg = moduletestutil.MakeTestEncodingConfig(feemarket.AppModuleBasic{}) + cdc = encCfg.Codec + + storeKey = storetypes.NewKVStoreKey(types.StoreKey) + tKey = storetypes.NewTransientStoreKey("transient_test") + ctx = testutil.DefaultContext(storeKey, tKey) + ) + + // Write old params + oldParams := types.Params{ + Alpha: math.LegacyMustNewDecFromStr("0.0"), + Beta: math.LegacyMustNewDecFromStr("1.0"), + Gamma: math.LegacyMustNewDecFromStr("0.0"), + Delta: math.LegacyMustNewDecFromStr("0.0"), + MinBaseGasPrice: math.LegacyOneDec(), + MinLearningRate: math.LegacyMustNewDecFromStr("0.125"), + MaxLearningRate: math.LegacyMustNewDecFromStr("0.125"), + MaxBlockUtilization: 30_000_000, + Window: 1, + FeeDenom: types.DefaultFeeDenom, + Enabled: true, + DistributeFees: true, + SendTipToProposer: false, + } + + store := ctx.KVStore(storeKey) + bz, err := cdc.Marshal(&oldParams) + require.NoError(t, err) + + store.Set(types.KeyParams, bz) + + // Run migration + require.NoError(t, v2.MigrateStore(ctx, cdc, storeKey)) + + bz = store.Get(types.KeyParams) + require.NotNil(t, bz) + + var newParams types.Params + cdc.MustUnmarshal(bz, &newParams) + + // Check params are correct + require.EqualValues(t, oldParams.Alpha, newParams.Alpha) + require.EqualValues(t, oldParams.Beta, newParams.Beta) + require.EqualValues(t, oldParams.Gamma, newParams.Gamma) + require.EqualValues(t, oldParams.Delta, newParams.Delta) + require.EqualValues(t, oldParams.MinBaseGasPrice, newParams.MinBaseGasPrice) + require.EqualValues(t, oldParams.MinLearningRate, newParams.MinLearningRate) + require.EqualValues(t, oldParams.MaxLearningRate, newParams.MaxLearningRate) + require.EqualValues(t, oldParams.MaxBlockUtilization, newParams.MaxBlockUtilization) + require.EqualValues(t, oldParams.Window, newParams.Window) + require.EqualValues(t, oldParams.FeeDenom, newParams.FeeDenom) + require.EqualValues(t, oldParams.Enabled, newParams.Enabled) + require.EqualValues(t, oldParams.DistributeFees, newParams.DistributeFees) + require.EqualValues(t, true, newParams.SendTipToProposer) +} diff --git a/x/feemarket/module.go b/x/feemarket/module.go index 4f01b64..9c6575b 100644 --- a/x/feemarket/module.go +++ b/x/feemarket/module.go @@ -3,6 +3,7 @@ package feemarket import ( "context" "encoding/json" + "fmt" "cosmossdk.io/core/appmodule" "cosmossdk.io/depinject" @@ -25,7 +26,7 @@ import ( ) // ConsensusVersion is the x/feemarket module's consensus version identifier. -const ConsensusVersion = 1 +const ConsensusVersion = 2 var ( _ module.HasName = AppModule{} @@ -115,9 +116,14 @@ func (am AppModule) IsOnePerModuleType() {} func (AppModule) ConsensusVersion() uint64 { return ConsensusVersion } // RegisterServices registers the module's services with the app's module configurator. -func (am AppModule) RegisterServices(cfc module.Configurator) { - types.RegisterMsgServer(cfc.MsgServer(), keeper.NewMsgServer(&am.k)) - types.RegisterQueryServer(cfc.QueryServer(), keeper.NewQueryServer(am.k)) +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServer(&am.k)) + types.RegisterQueryServer(cfg.QueryServer(), keeper.NewQueryServer(am.k)) + + m := keeper.NewMigrator(am.k) + if err := cfg.RegisterMigration(types.ModuleName, 1, m.Migrate1to2); err != nil { + panic(fmt.Sprintf("failed to migrate x/feemarket from version 1 to 2: %v", err)) + } } // DefaultGenesis returns default genesis state as raw bytes for the feemarket @@ -177,8 +183,9 @@ type Outputs struct { func ProvideModule(in Inputs) Outputs { var ( - authority sdk.AccAddress - err error + authority sdk.AccAddress + feeRecipientModule string + err error ) if in.Config.Authority != "" { authority, err = sdk.AccAddressFromBech32(in.Config.Authority) @@ -189,12 +196,19 @@ func ProvideModule(in Inputs) Outputs { authority = authtypes.NewModuleAddress(govtypes.ModuleName) } + if in.Config.FeeRecipientModule != "" { + feeRecipientModule = in.Config.FeeRecipientModule + } else { + feeRecipientModule = authtypes.FeeCollectorName + } + Keeper := keeper.NewKeeper( in.Cdc, in.Key, in.AccountKeeper, nil, authority.String(), + feeRecipientModule, ) m := NewAppModule(in.Cdc, *Keeper) diff --git a/x/feemarket/post/expected_keeper.go b/x/feemarket/post/expected_keeper.go index a759656..64d7f1d 100644 --- a/x/feemarket/post/expected_keeper.go +++ b/x/feemarket/post/expected_keeper.go @@ -44,4 +44,5 @@ type FeeMarketKeeper interface { ResolveToDenom(ctx sdk.Context, coin sdk.DecCoin, denom string) (sdk.DecCoin, error) GetMinGasPrice(ctx sdk.Context, denom string) (sdk.DecCoin, error) GetEnabledHeight(ctx sdk.Context) (int64, error) + GetFeeRecipientModule() string } diff --git a/x/feemarket/post/fee.go b/x/feemarket/post/fee.go index 108af3e..adf9630 100644 --- a/x/feemarket/post/fee.go +++ b/x/feemarket/post/fee.go @@ -9,7 +9,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/skip-mev/feemarket/x/feemarket/ante" feemarkettypes "github.com/skip-mev/feemarket/x/feemarket/types" @@ -158,9 +157,11 @@ func (dfd FeeMarketDeductDecorator) PayOutFeeAndTip(ctx sdk.Context, fee, tip sd var events sdk.Events + feeRecipientModule := dfd.feemarketKeeper.GetFeeRecipientModule() + // deduct the fees and tip if !fee.IsNil() { - err := DeductCoins(dfd.bankKeeper, ctx, sdk.NewCoins(fee), params.DistributeFees) + err := DeductCoins(dfd.bankKeeper, ctx, sdk.NewCoins(fee), feeRecipientModule, params.DistributeFees) if err != nil { return err } @@ -173,7 +174,13 @@ func (dfd FeeMarketDeductDecorator) PayOutFeeAndTip(ctx sdk.Context, fee, tip sd proposer := sdk.AccAddress(ctx.BlockHeader().ProposerAddress) if !tip.IsNil() { - err := SendTip(dfd.bankKeeper, ctx, proposer, sdk.NewCoins(tip)) + tipPayee := proposer.String() + + if !params.SendTipToProposer { + tipPayee = dfd.accountKeeper.GetModuleAddress(feeRecipientModule).String() + } + + err := SendTip(dfd.bankKeeper, ctx, params.SendTipToProposer, feeRecipientModule, proposer, sdk.NewCoins(tip)) if err != nil { return err } @@ -181,7 +188,7 @@ func (dfd FeeMarketDeductDecorator) PayOutFeeAndTip(ctx sdk.Context, fee, tip sd events = append(events, sdk.NewEvent( feemarkettypes.EventTypeTipPay, sdk.NewAttribute(feemarkettypes.AttributeKeyTip, tip.String()), - sdk.NewAttribute(feemarkettypes.AttributeKeyTipPayee, proposer.String()), + sdk.NewAttribute(feemarkettypes.AttributeKeyTipPayee, tipPayee), )) } @@ -190,11 +197,11 @@ func (dfd FeeMarketDeductDecorator) PayOutFeeAndTip(ctx sdk.Context, fee, tip sd } // DeductCoins deducts coins from the given account. -// Coins can be sent to the default fee collector ( -// causes coins to be distributed to stakers) or kept in the fee collector account (soft burn). -func DeductCoins(bankKeeper BankKeeper, ctx sdk.Context, coins sdk.Coins, distributeFees bool) error { +// Coins can be sent to the module account (causes coins to be distributed to stakers), +// or kept in the fee collector account (soft burn). +func DeductCoins(bankKeeper BankKeeper, ctx sdk.Context, coins sdk.Coins, feeRecipientModule string, distributeFees bool) error { if distributeFees { - err := bankKeeper.SendCoinsFromModuleToModule(ctx, feemarkettypes.FeeCollectorName, authtypes.FeeCollectorName, coins) + err := bankKeeper.SendCoinsFromModuleToModule(ctx, feemarkettypes.FeeCollectorName, feeRecipientModule, coins) if err != nil { return err } @@ -202,9 +209,23 @@ func DeductCoins(bankKeeper BankKeeper, ctx sdk.Context, coins sdk.Coins, distri return nil } -// SendTip sends a tip to the current block proposer. -func SendTip(bankKeeper BankKeeper, ctx sdk.Context, proposer sdk.AccAddress, coins sdk.Coins) error { - err := bankKeeper.SendCoinsFromModuleToAccount(ctx, feemarkettypes.FeeCollectorName, proposer, coins) +// SendTip sends a tip to the current block proposer or to the module account. +func SendTip( + bankKeeper BankKeeper, + ctx sdk.Context, + sendToProposer bool, + feeRecipientModule string, + proposer sdk.AccAddress, + coins sdk.Coins, +) error { + var err error + + if sendToProposer { + err = bankKeeper.SendCoinsFromModuleToAccount(ctx, feemarkettypes.FeeCollectorName, proposer, coins) + } else { + err = bankKeeper.SendCoinsFromModuleToModule(ctx, feemarkettypes.FeeCollectorName, feeRecipientModule, coins) + } + if err != nil { return err } diff --git a/x/feemarket/post/fee_test.go b/x/feemarket/post/fee_test.go index af67585..46de093 100644 --- a/x/feemarket/post/fee_test.go +++ b/x/feemarket/post/fee_test.go @@ -19,46 +19,53 @@ import ( func TestDeductCoins(t *testing.T) { tests := []struct { - name string - coins sdk.Coins - distributeFees bool - wantErr bool + name string + coins sdk.Coins + recipientModule string + distributeFees bool + wantErr bool }{ { - name: "valid", - coins: sdk.NewCoins(sdk.NewCoin("test", math.NewInt(10))), - distributeFees: false, - wantErr: false, + name: "valid", + coins: sdk.NewCoins(sdk.NewCoin("test", math.NewInt(10))), + recipientModule: "test_fee_collector", + distributeFees: false, + wantErr: false, }, { - name: "valid no coins", - coins: sdk.NewCoins(), - distributeFees: false, - wantErr: false, + name: "valid no coins", + coins: sdk.NewCoins(), + recipientModule: "test_fee_collector", + distributeFees: false, + wantErr: false, }, { - name: "valid zero coin", - coins: sdk.NewCoins(sdk.NewCoin("test", math.ZeroInt())), - distributeFees: false, - wantErr: false, + name: "valid zero coin", + coins: sdk.NewCoins(sdk.NewCoin("test", math.ZeroInt())), + recipientModule: "test_fee_collector", + distributeFees: false, + wantErr: false, }, { - name: "valid - distribute", - coins: sdk.NewCoins(sdk.NewCoin("test", math.NewInt(10))), - distributeFees: true, - wantErr: false, + name: "valid - distribute", + coins: sdk.NewCoins(sdk.NewCoin("test", math.NewInt(10))), + recipientModule: "test_fee_collector", + distributeFees: true, + wantErr: false, }, { - name: "valid no coins - distribute", - coins: sdk.NewCoins(), - distributeFees: true, - wantErr: false, + name: "valid no coins - distribute", + coins: sdk.NewCoins(), + recipientModule: "test_fee_collector", + distributeFees: true, + wantErr: false, }, { - name: "valid zero coin - distribute", - coins: sdk.NewCoins(sdk.NewCoin("test", math.ZeroInt())), - distributeFees: true, - wantErr: false, + name: "valid zero coin - distribute", + coins: sdk.NewCoins(sdk.NewCoin("test", math.ZeroInt())), + recipientModule: "test_fee_collector", + distributeFees: true, + wantErr: false, }, } for _, tc := range tests { @@ -66,11 +73,11 @@ func TestDeductCoins(t *testing.T) { s := antesuite.SetupTestSuite(t, true) if tc.distributeFees { s.MockBankKeeper.On("SendCoinsFromModuleToModule", s.Ctx, types.FeeCollectorName, - authtypes.FeeCollectorName, + tc.recipientModule, tc.coins).Return(nil).Once() } - if err := post.DeductCoins(s.MockBankKeeper, s.Ctx, tc.coins, tc.distributeFees); (err != nil) != tc.wantErr { + if err := post.DeductCoins(s.MockBankKeeper, s.Ctx, tc.coins, tc.recipientModule, tc.distributeFees); (err != nil) != tc.wantErr { s.Errorf(err, "DeductCoins() error = %v, wantErr %v", err, tc.wantErr) } }) @@ -79,33 +86,38 @@ func TestDeductCoins(t *testing.T) { func TestDeductCoinsAndDistribute(t *testing.T) { tests := []struct { - name string - coins sdk.Coins - wantErr bool + name string + coins sdk.Coins + recipientModule string + wantErr bool }{ { - name: "valid", - coins: sdk.NewCoins(sdk.NewCoin("test", math.NewInt(10))), - wantErr: false, + name: "valid", + coins: sdk.NewCoins(sdk.NewCoin("test", math.NewInt(10))), + recipientModule: "test_fee_collector", + wantErr: false, }, { - name: "valid no coins", - coins: sdk.NewCoins(), - wantErr: false, + name: "valid no coins", + coins: sdk.NewCoins(), + recipientModule: "test_fee_collector", + wantErr: false, }, { - name: "valid zero coin", - coins: sdk.NewCoins(sdk.NewCoin("test", math.ZeroInt())), - wantErr: false, + name: "valid zero coin", + coins: sdk.NewCoins(sdk.NewCoin("test", math.ZeroInt())), + recipientModule: "test_fee_collector", + wantErr: false, }, } for _, tc := range tests { t.Run(fmt.Sprintf("Case %s", tc.name), func(t *testing.T) { s := antesuite.SetupTestSuite(t, true) - s.MockBankKeeper.On("SendCoinsFromModuleToModule", s.Ctx, types.FeeCollectorName, authtypes.FeeCollectorName, + s.MockBankKeeper.On("SendCoinsFromModuleToModule", s.Ctx, types.FeeCollectorName, + tc.recipientModule, tc.coins).Return(nil).Once() - if err := post.DeductCoins(s.MockBankKeeper, s.Ctx, tc.coins, true); (err != nil) != tc.wantErr { + if err := post.DeductCoins(s.MockBankKeeper, s.Ctx, tc.coins, tc.recipientModule, true); (err != nil) != tc.wantErr { s.Errorf(err, "DeductCoins() error = %v, wantErr %v", err, tc.wantErr) } }) @@ -114,34 +126,68 @@ func TestDeductCoinsAndDistribute(t *testing.T) { func TestSendTip(t *testing.T) { tests := []struct { - name string - coins sdk.Coins - wantErr bool + name string + sendToProposer bool + recipientModule string + coins sdk.Coins + wantErr bool }{ { - name: "valid", - coins: sdk.NewCoins(sdk.NewCoin("test", math.NewInt(10))), - wantErr: false, + name: "valid - to account", + sendToProposer: true, + recipientModule: "", + coins: sdk.NewCoins(sdk.NewCoin("test", math.NewInt(10))), + wantErr: false, }, { - name: "valid no coins", - coins: sdk.NewCoins(), - wantErr: false, + name: "valid no coins - to account", + sendToProposer: true, + recipientModule: "", + coins: sdk.NewCoins(), + wantErr: false, }, { - name: "valid zero coin", - coins: sdk.NewCoins(sdk.NewCoin("test", math.ZeroInt())), - wantErr: false, + name: "valid zero coin - to account", + sendToProposer: false, + recipientModule: "", + coins: sdk.NewCoins(sdk.NewCoin("test", math.ZeroInt())), + wantErr: false, + }, + { + name: "valid - to module", + sendToProposer: false, + recipientModule: "test_fee_collector", + coins: sdk.NewCoins(sdk.NewCoin("test", math.NewInt(10))), + wantErr: false, + }, + { + name: "valid no coins - to module", + sendToProposer: false, + recipientModule: "test_fee_collector", + coins: sdk.NewCoins(), + wantErr: false, + }, + { + name: "valid zero coin - to module", + sendToProposer: false, + recipientModule: "test_fee_collector", + coins: sdk.NewCoins(sdk.NewCoin("test", math.ZeroInt())), + wantErr: false, }, } for _, tc := range tests { t.Run(fmt.Sprintf("Case %s", tc.name), func(t *testing.T) { s := antesuite.SetupTestSuite(t, true) accs := s.CreateTestAccounts(2) - s.MockBankKeeper.On("SendCoinsFromModuleToAccount", s.Ctx, types.FeeCollectorName, mock.Anything, - tc.coins).Return(nil).Once() + if tc.sendToProposer { + s.MockBankKeeper.On("SendCoinsFromModuleToAccount", s.Ctx, types.FeeCollectorName, mock.Anything, + tc.coins).Return(nil).Once() + } else { + s.MockBankKeeper.On("SendCoinsFromModuleToModule", s.Ctx, types.FeeCollectorName, tc.recipientModule, + tc.coins).Return(nil).Once() + } - if err := post.SendTip(s.MockBankKeeper, s.Ctx, accs[1].Account.GetAddress(), tc.coins); (err != nil) != tc.wantErr { + if err := post.SendTip(s.MockBankKeeper, s.Ctx, tc.sendToProposer, tc.recipientModule, accs[1].Account.GetAddress(), tc.coins); (err != nil) != tc.wantErr { s.Errorf(err, "SendTip() error = %v, wantErr %v", err, tc.wantErr) } }) @@ -153,7 +199,7 @@ func TestPostHandleMock(t *testing.T) { const ( baseDenom = "stake" resolvableDenom = "atom" - expectedConsumedGas = 10631 + expectedConsumedGas = 10649 expectedConsumedSimGas = expectedConsumedGas + post.BankSendGasConsumption gasLimit = expectedConsumedSimGas ) @@ -353,7 +399,7 @@ func TestPostHandleMock(t *testing.T) { Simulate: false, ExpPass: true, ExpErr: nil, - ExpectConsumedGas: 15340, // extra gas consumed because msg server is run, but deduction is skipped + ExpectConsumedGas: 15412, // extra gas consumed because msg server is run, but deduction is skipped Mock: true, }, { @@ -539,9 +585,9 @@ func TestPostHandle(t *testing.T) { const ( baseDenom = "stake" resolvableDenom = "atom" - expectedConsumedGas = 36650 + expectedConsumedGas = 36668 - expectedConsumedGasResolve = 36524 // slight difference due to denom resolver + expectedConsumedGasResolve = 36542 // slight difference due to denom resolver gasLimit = 100000 ) @@ -650,7 +696,7 @@ func TestPostHandle(t *testing.T) { Simulate: false, ExpPass: true, ExpErr: nil, - ExpectConsumedGas: 36650, + ExpectConsumedGas: expectedConsumedGas, Mock: false, }, { @@ -699,7 +745,7 @@ func TestPostHandle(t *testing.T) { Simulate: false, ExpPass: true, ExpErr: nil, - ExpectConsumedGas: 36650, + ExpectConsumedGas: expectedConsumedGas, Mock: false, }, { @@ -765,7 +811,7 @@ func TestPostHandle(t *testing.T) { Simulate: false, ExpPass: true, ExpErr: nil, - ExpectConsumedGas: 15340, // extra gas consumed because msg server is run, but bank keepers are skipped + ExpectConsumedGas: 15412, // extra gas consumed because msg server is run, but bank keepers are skipped Mock: false, }, { diff --git a/x/feemarket/post/mocks/mock_feemarket_keeper.go b/x/feemarket/post/mocks/mock_feemarket_keeper.go index 0d69365..bd3cf82 100644 --- a/x/feemarket/post/mocks/mock_feemarket_keeper.go +++ b/x/feemarket/post/mocks/mock_feemarket_keeper.go @@ -43,6 +43,24 @@ func (_m *FeeMarketKeeper) GetEnabledHeight(ctx types.Context) (int64, error) { return r0, r1 } +// GetFeeRecipientModule provides a mock function with given fields: +func (_m *FeeMarketKeeper) GetFeeRecipientModule() string { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetFeeRecipientModule") + } + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + // GetMinGasPrice provides a mock function with given fields: ctx, denom func (_m *FeeMarketKeeper) GetMinGasPrice(ctx types.Context, denom string) (types.DecCoin, error) { ret := _m.Called(ctx, denom) diff --git a/x/feemarket/types/eip1559.go b/x/feemarket/types/eip1559.go index b42757c..d381cd8 100644 --- a/x/feemarket/types/eip1559.go +++ b/x/feemarket/types/eip1559.go @@ -60,6 +60,8 @@ func DefaultParams() Params { DefaultMaxLearningRate, DefaultFeeDenom, true, + false, + true, ) } diff --git a/x/feemarket/types/eip1559_aimd.go b/x/feemarket/types/eip1559_aimd.go index ac07474..c173b0e 100644 --- a/x/feemarket/types/eip1559_aimd.go +++ b/x/feemarket/types/eip1559_aimd.go @@ -68,6 +68,8 @@ func DefaultAIMDParams() Params { DefaultAIMDMaxLearningRate, DefaultAIMDFeeDenom, true, + false, + true, ) } diff --git a/x/feemarket/types/params.go b/x/feemarket/types/params.go index 267f2b0..252d9da 100644 --- a/x/feemarket/types/params.go +++ b/x/feemarket/types/params.go @@ -20,6 +20,8 @@ func NewParams( maxLearningRate math.LegacyDec, feeDenom string, enabled bool, + distributeFees bool, + sendTipToProposer bool, ) Params { return Params{ Alpha: alpha, @@ -33,6 +35,8 @@ func NewParams( Window: window, FeeDenom: feeDenom, Enabled: enabled, + DistributeFees: distributeFees, + SendTipToProposer: sendTipToProposer, } } diff --git a/x/feemarket/types/params.pb.go b/x/feemarket/types/params.pb.go index ac312b3..5388598 100644 --- a/x/feemarket/types/params.pb.go +++ b/x/feemarket/types/params.pb.go @@ -45,7 +45,7 @@ type Params struct { // // Must be [0, 0.5]. Gamma cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=gamma,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"gamma"` - // Delta is the amount we additively increase/decrease the base fee when the + // Delta is the amount we additively increase/decrease the gas price when the // net block utilization difference in the window is above/below the target // utilization. Delta cosmossdk_io_math.LegacyDec `protobuf:"bytes,4,opt,name=delta,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"delta"` @@ -69,6 +69,9 @@ type Params struct { // DistributeFees is a boolean that determines whether the fees are burned or // distributed to all stakers. DistributeFees bool `protobuf:"varint,12,opt,name=distribute_fees,json=distributeFees,proto3" json:"distribute_fees,omitempty"` + // SendTipToProposer is a boolean that determines whether the tip is sent to a + // proposer or to a module account. + SendTipToProposer bool `protobuf:"varint,13,opt,name=send_tip_to_proposer,json=sendTipToProposer,proto3" json:"send_tip_to_proposer,omitempty"` } func (m *Params) Reset() { *m = Params{} } @@ -139,6 +142,13 @@ func (m *Params) GetDistributeFees() bool { return false } +func (m *Params) GetSendTipToProposer() bool { + if m != nil { + return m.SendTipToProposer + } + return false +} + func init() { proto.RegisterType((*Params)(nil), "feemarket.feemarket.v1.Params") } @@ -148,35 +158,37 @@ func init() { } var fileDescriptor_3907de4df2e1c66e = []byte{ - // 447 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x93, 0xc1, 0x6e, 0xd3, 0x40, - 0x10, 0x86, 0x63, 0x48, 0xd2, 0x64, 0x41, 0x54, 0x2c, 0x50, 0x2d, 0xad, 0xe4, 0x46, 0x70, 0x20, - 0x97, 0xda, 0x0a, 0xbc, 0x41, 0x14, 0xa8, 0x90, 0x7a, 0xa8, 0x2c, 0x71, 0x41, 0x02, 0x6b, 0x6c, - 0x4f, 0x9c, 0x55, 0xbc, 0xbb, 0x96, 0x77, 0x93, 0xa6, 0x3c, 0x05, 0x0f, 0xc3, 0x43, 0xf4, 0x58, - 0x71, 0x42, 0x1c, 0x2a, 0x94, 0xbc, 0x02, 0x0f, 0x80, 0x76, 0x1d, 0x48, 0xe1, 0x68, 0x6e, 0xff, - 0x3f, 0x33, 0xff, 0xb7, 0xa3, 0x95, 0x86, 0x3c, 0x9f, 0x22, 0x0a, 0xa8, 0xe6, 0x68, 0xc2, 0x9d, - 0x5a, 0x8e, 0xc2, 0x12, 0x2a, 0x10, 0x3a, 0x28, 0x2b, 0x65, 0x14, 0x3d, 0xf8, 0xd3, 0x0a, 0x76, - 0x6a, 0x39, 0x3a, 0x7c, 0x9a, 0x2a, 0x2d, 0x94, 0x8e, 0xdd, 0x54, 0x58, 0x9b, 0x3a, 0x72, 0xf8, - 0x38, 0x57, 0xb9, 0xaa, 0xeb, 0x56, 0xd5, 0xd5, 0x67, 0x3f, 0x3b, 0xa4, 0x7b, 0xee, 0xc8, 0xf4, - 0x94, 0x74, 0xa0, 0x28, 0x67, 0xc0, 0xbc, 0x81, 0x37, 0xec, 0x8f, 0x47, 0x57, 0x37, 0xc7, 0xad, - 0xef, 0x37, 0xc7, 0x47, 0x35, 0x45, 0x67, 0xf3, 0x80, 0xab, 0x50, 0x80, 0x99, 0x05, 0x67, 0x98, - 0x43, 0x7a, 0x39, 0xc1, 0xf4, 0xeb, 0x97, 0x13, 0xb2, 0x7d, 0x64, 0x82, 0x69, 0x54, 0xe7, 0xe9, - 0x6b, 0xd2, 0x4e, 0xd0, 0x00, 0xbb, 0xd3, 0x94, 0xe3, 0xe2, 0x76, 0x9f, 0x1c, 0x84, 0x00, 0x76, - 0xb7, 0xf1, 0x3e, 0x2e, 0x6f, 0x41, 0x19, 0x16, 0x06, 0x58, 0xbb, 0x31, 0xc8, 0xe5, 0xe9, 0x47, - 0x42, 0x05, 0x97, 0x71, 0x02, 0x1a, 0xe3, 0x1c, 0xec, 0x2f, 0xf3, 0x14, 0x59, 0xa7, 0x29, 0x75, - 0x5f, 0x70, 0x39, 0x06, 0x8d, 0xa7, 0xa0, 0xcf, 0x2d, 0x89, 0x7e, 0x20, 0x0f, 0x2d, 0xbf, 0x40, - 0xa8, 0x24, 0x97, 0x79, 0x5c, 0x81, 0x41, 0xd6, 0xfd, 0x1f, 0xfc, 0xd9, 0x16, 0x15, 0x81, 0xa9, - 0xf1, 0xb0, 0xfa, 0x07, 0xbf, 0xd7, 0x1c, 0x0f, 0xab, 0xbf, 0xf0, 0x2f, 0xc9, 0x13, 0x8b, 0x4f, - 0x0a, 0x95, 0xce, 0xe3, 0x85, 0xe1, 0x05, 0xff, 0x04, 0x86, 0x2b, 0xc9, 0x7a, 0x03, 0x6f, 0xd8, - 0x8e, 0x1e, 0x09, 0x58, 0x8d, 0x6d, 0xef, 0xdd, 0xae, 0x45, 0x0f, 0x48, 0xf7, 0x82, 0xcb, 0x4c, - 0x5d, 0xb0, 0xbe, 0x1b, 0xda, 0x3a, 0x7a, 0x44, 0xfa, 0x53, 0xc4, 0x38, 0x43, 0xa9, 0x04, 0x23, - 0x76, 0xc5, 0xa8, 0x37, 0x45, 0x9c, 0x58, 0x4f, 0x19, 0xd9, 0x43, 0x09, 0x49, 0x81, 0x19, 0xbb, - 0x37, 0xf0, 0x86, 0xbd, 0xe8, 0xb7, 0xa5, 0x2f, 0xc8, 0x7e, 0xc6, 0xb5, 0xa9, 0x78, 0xb2, 0x30, - 0x18, 0x4f, 0x11, 0x35, 0xbb, 0xef, 0x26, 0x1e, 0xec, 0xca, 0x6f, 0x10, 0xf5, 0xf8, 0xed, 0xd5, - 0xda, 0xf7, 0xae, 0xd7, 0xbe, 0xf7, 0x63, 0xed, 0x7b, 0x9f, 0x37, 0x7e, 0xeb, 0x7a, 0xe3, 0xb7, - 0xbe, 0x6d, 0xfc, 0xd6, 0xfb, 0x30, 0xe7, 0x66, 0xb6, 0x48, 0x82, 0x54, 0x89, 0x50, 0xcf, 0x79, - 0x79, 0x22, 0x70, 0x79, 0xeb, 0x10, 0x57, 0xb7, 0xb4, 0xb9, 0x2c, 0x51, 0x27, 0x5d, 0x77, 0x48, - 0xaf, 0x7e, 0x05, 0x00, 0x00, 0xff, 0xff, 0x33, 0xa4, 0xbf, 0xc2, 0xb8, 0x03, 0x00, 0x00, + // 478 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x93, 0xcf, 0x6e, 0xd3, 0x4c, + 0x14, 0xc5, 0xe3, 0xef, 0x4b, 0xdd, 0x64, 0xf8, 0x53, 0x75, 0x28, 0xd5, 0xd0, 0x4a, 0x6e, 0x04, + 0x0b, 0xb2, 0xa9, 0xad, 0xc0, 0x1b, 0x44, 0x81, 0x0a, 0xa9, 0x8b, 0xc8, 0x2a, 0x1b, 0x24, 0xb0, + 0xae, 0xed, 0x1b, 0x67, 0x14, 0x8f, 0xc7, 0xf2, 0x4c, 0xd2, 0x94, 0xa7, 0xe0, 0x25, 0x78, 0x03, + 0x1e, 0xa2, 0xcb, 0x8a, 0x15, 0x62, 0x51, 0xa1, 0xe4, 0x45, 0xd0, 0x8c, 0x03, 0x29, 0x2c, 0xcd, + 0xee, 0xde, 0x7b, 0xce, 0xf9, 0xcd, 0xd5, 0x48, 0x97, 0x3c, 0x9b, 0x20, 0x0a, 0xa8, 0x66, 0xa8, + 0x83, 0x6d, 0xb5, 0x18, 0x04, 0x25, 0x54, 0x20, 0x94, 0x5f, 0x56, 0x52, 0x4b, 0x7a, 0xf8, 0x5b, + 0xf2, 0xb7, 0xd5, 0x62, 0x70, 0xf4, 0x24, 0x91, 0x4a, 0x48, 0x15, 0x59, 0x57, 0x50, 0x37, 0x75, + 0xe4, 0xe8, 0x20, 0x93, 0x99, 0xac, 0xe7, 0xa6, 0xaa, 0xa7, 0x4f, 0x3f, 0xbb, 0xc4, 0x1d, 0x5b, + 0x32, 0x3d, 0x23, 0x3b, 0x90, 0x97, 0x53, 0x60, 0x4e, 0xcf, 0xe9, 0x77, 0x87, 0x83, 0xeb, 0xdb, + 0x93, 0xd6, 0xf7, 0xdb, 0x93, 0xe3, 0x9a, 0xa2, 0xd2, 0x99, 0xcf, 0x65, 0x20, 0x40, 0x4f, 0xfd, + 0x73, 0xcc, 0x20, 0xb9, 0x1a, 0x61, 0xf2, 0xf5, 0xcb, 0x29, 0xd9, 0x3c, 0x32, 0xc2, 0x24, 0xac, + 0xf3, 0xf4, 0x15, 0x69, 0xc7, 0xa8, 0x81, 0xfd, 0xd7, 0x94, 0x63, 0xe3, 0x66, 0x9f, 0x0c, 0x84, + 0x00, 0xf6, 0x7f, 0xe3, 0x7d, 0x6c, 0xde, 0x80, 0x52, 0xcc, 0x35, 0xb0, 0x76, 0x63, 0x90, 0xcd, + 0xd3, 0x0f, 0x84, 0x0a, 0x5e, 0x44, 0x31, 0x28, 0x8c, 0x32, 0x30, 0xbf, 0xcc, 0x13, 0x64, 0x3b, + 0x4d, 0xa9, 0x7b, 0x82, 0x17, 0x43, 0x50, 0x78, 0x06, 0x6a, 0x6c, 0x48, 0xf4, 0x3d, 0xd9, 0x37, + 0xfc, 0x1c, 0xa1, 0x2a, 0x78, 0x91, 0x45, 0x15, 0x68, 0x64, 0xee, 0xbf, 0xe0, 0xcf, 0x37, 0xa8, + 0x10, 0x74, 0x8d, 0x87, 0xe5, 0x5f, 0xf8, 0xdd, 0xe6, 0x78, 0x58, 0xfe, 0x81, 0x7f, 0x41, 0x1e, + 0x1b, 0x7c, 0x9c, 0xcb, 0x64, 0x16, 0xcd, 0x35, 0xcf, 0xf9, 0x47, 0xd0, 0x5c, 0x16, 0xac, 0xd3, + 0x73, 0xfa, 0xed, 0xf0, 0x91, 0x80, 0xe5, 0xd0, 0x68, 0x6f, 0xb7, 0x12, 0x3d, 0x24, 0xee, 0x25, + 0x2f, 0x52, 0x79, 0xc9, 0xba, 0xd6, 0xb4, 0xe9, 0xe8, 0x31, 0xe9, 0x4e, 0x10, 0xa3, 0x14, 0x0b, + 0x29, 0x18, 0x31, 0x2b, 0x86, 0x9d, 0x09, 0xe2, 0xc8, 0xf4, 0x94, 0x91, 0x5d, 0x2c, 0x20, 0xce, + 0x31, 0x65, 0xf7, 0x7a, 0x4e, 0xbf, 0x13, 0xfe, 0x6a, 0xe9, 0x73, 0xb2, 0x97, 0x72, 0xa5, 0x2b, + 0x1e, 0xcf, 0x35, 0x46, 0x13, 0x44, 0xc5, 0xee, 0x5b, 0xc7, 0xc3, 0xed, 0xf8, 0x35, 0xa2, 0xa2, + 0x01, 0x39, 0x50, 0x58, 0xa4, 0x91, 0xe6, 0x65, 0xa4, 0xa5, 0x39, 0x97, 0x52, 0x2a, 0xac, 0xd8, + 0x03, 0xeb, 0xde, 0x37, 0xda, 0x05, 0x2f, 0x2f, 0xe4, 0x78, 0x23, 0x0c, 0xdf, 0x5c, 0xaf, 0x3c, + 0xe7, 0x66, 0xe5, 0x39, 0x3f, 0x56, 0x9e, 0xf3, 0x69, 0xed, 0xb5, 0x6e, 0xd6, 0x5e, 0xeb, 0xdb, + 0xda, 0x6b, 0xbd, 0x0b, 0x32, 0xae, 0xa7, 0xf3, 0xd8, 0x4f, 0xa4, 0x08, 0xd4, 0x8c, 0x97, 0xa7, + 0x02, 0x17, 0x77, 0x2e, 0x77, 0x79, 0xa7, 0xd6, 0x57, 0x25, 0xaa, 0xd8, 0xb5, 0x97, 0xf7, 0xf2, + 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa7, 0xb2, 0x79, 0x06, 0xe9, 0x03, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -199,6 +211,16 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.SendTipToProposer { + i-- + if m.SendTipToProposer { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x68 + } if m.DistributeFees { i-- if m.DistributeFees { @@ -356,6 +378,9 @@ func (m *Params) Size() (n int) { if m.DistributeFees { n += 2 } + if m.SendTipToProposer { + n += 2 + } return n } @@ -742,6 +767,26 @@ func (m *Params) Unmarshal(dAtA []byte) error { } } m.DistributeFees = bool(v != 0) + case 13: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SendTipToProposer", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.SendTipToProposer = bool(v != 0) default: iNdEx = preIndex skippy, err := skipParams(dAtA[iNdEx:])