diff --git a/api/poktroll/service/params.pulsar.go b/api/poktroll/service/params.pulsar.go index 981c7d4a5..6b180a66a 100644 --- a/api/poktroll/service/params.pulsar.go +++ b/api/poktroll/service/params.pulsar.go @@ -16,14 +16,16 @@ import ( ) var ( - md_Params protoreflect.MessageDescriptor - fd_Params_add_service_fee protoreflect.FieldDescriptor + md_Params protoreflect.MessageDescriptor + fd_Params_add_service_fee protoreflect.FieldDescriptor + fd_Params_target_num_relays protoreflect.FieldDescriptor ) func init() { file_poktroll_service_params_proto_init() md_Params = File_poktroll_service_params_proto.Messages().ByName("Params") fd_Params_add_service_fee = md_Params.Fields().ByName("add_service_fee") + fd_Params_target_num_relays = md_Params.Fields().ByName("target_num_relays") } var _ protoreflect.Message = (*fastReflection_Params)(nil) @@ -97,6 +99,12 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto return } } + if x.TargetNumRelays != uint64(0) { + value := protoreflect.ValueOfUint64(x.TargetNumRelays) + if !f(fd_Params_target_num_relays, value) { + return + } + } } // Has reports whether a field is populated. @@ -114,6 +122,8 @@ func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { case "poktroll.service.Params.add_service_fee": return x.AddServiceFee != nil + case "poktroll.service.Params.target_num_relays": + return x.TargetNumRelays != uint64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.Params")) @@ -132,6 +142,8 @@ func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { case "poktroll.service.Params.add_service_fee": x.AddServiceFee = nil + case "poktroll.service.Params.target_num_relays": + x.TargetNumRelays = uint64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.Params")) @@ -151,6 +163,9 @@ func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) pro case "poktroll.service.Params.add_service_fee": value := x.AddServiceFee return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "poktroll.service.Params.target_num_relays": + value := x.TargetNumRelays + return protoreflect.ValueOfUint64(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.Params")) @@ -173,6 +188,8 @@ func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value proto switch fd.FullName() { case "poktroll.service.Params.add_service_fee": x.AddServiceFee = value.Message().Interface().(*v1beta1.Coin) + case "poktroll.service.Params.target_num_relays": + x.TargetNumRelays = value.Uint() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.Params")) @@ -198,6 +215,8 @@ func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protore x.AddServiceFee = new(v1beta1.Coin) } return protoreflect.ValueOfMessage(x.AddServiceFee.ProtoReflect()) + case "poktroll.service.Params.target_num_relays": + panic(fmt.Errorf("field target_num_relays of message poktroll.service.Params is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.Params")) @@ -214,6 +233,8 @@ func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protor case "poktroll.service.Params.add_service_fee": m := new(v1beta1.Coin) return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "poktroll.service.Params.target_num_relays": + return protoreflect.ValueOfUint64(uint64(0)) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.Params")) @@ -287,6 +308,9 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { l = options.Size(x.AddServiceFee) n += 1 + l + runtime.Sov(uint64(l)) } + if x.TargetNumRelays != 0 { + n += 1 + runtime.Sov(uint64(x.TargetNumRelays)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -316,6 +340,11 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.TargetNumRelays != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.TargetNumRelays)) + i-- + dAtA[i] = 0x10 + } if x.AddServiceFee != nil { encoded, err := options.Marshal(x.AddServiceFee) if err != nil { @@ -415,6 +444,25 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TargetNumRelays", wireType) + } + x.TargetNumRelays = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.TargetNumRelays |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -473,6 +521,9 @@ type Params struct { // This will be deducted from the signer's account balance, // and transferred to the pocket network foundation. AddServiceFee *v1beta1.Coin `protobuf:"bytes,1,opt,name=add_service_fee,json=addServiceFee,proto3" json:"add_service_fee,omitempty"` + // target_num_relays is the target for the EMA of the number of relays per session. + // Per service, on-chain relay mining difficulty will be adjusted to maintain this target. + TargetNumRelays uint64 `protobuf:"varint,2,opt,name=target_num_relays,json=targetNumRelays,proto3" json:"target_num_relays,omitempty"` } func (x *Params) Reset() { @@ -502,6 +553,13 @@ func (x *Params) GetAddServiceFee() *v1beta1.Coin { return nil } +func (x *Params) GetTargetNumRelays() uint64 { + if x != nil { + return x.TargetNumRelays + } + return 0 +} + var File_poktroll_service_params_proto protoreflect.FileDescriptor var file_poktroll_service_params_proto_rawDesc = []byte{ @@ -512,7 +570,7 @@ var file_poktroll_service_params_proto_rawDesc = []byte{ 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, 0x1a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, - 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9e, 0x01, 0x0a, 0x06, 0x50, + 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xfd, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x70, 0x0a, 0x0f, 0x61, 0x64, 0x64, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, @@ -520,21 +578,26 @@ var file_poktroll_service_params_proto_rawDesc = []byte{ 0x64, 0x64, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x66, 0x65, 0x65, 0xf2, 0xde, 0x1f, 0x16, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x61, 0x64, 0x64, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x22, 0x52, 0x0d, 0x61, 0x64, 0x64, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x46, 0x65, 0x65, 0x3a, 0x22, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, - 0x2a, 0x19, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x78, 0x2f, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x2f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0xab, 0x01, 0xd8, 0xe2, - 0x1e, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x42, 0x0b, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x21, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, - 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0xa2, 0x02, 0x03, 0x50, 0x53, 0x58, - 0xaa, 0x02, 0x10, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0xca, 0x02, 0x10, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0xe2, 0x02, 0x1c, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x3a, 0x3a, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x76, 0x69, 0x63, 0x65, 0x46, 0x65, 0x65, 0x12, 0x5d, 0x0a, 0x11, 0x74, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x04, 0x42, 0x31, 0xea, 0xde, 0x1f, 0x11, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x6e, + 0x75, 0x6d, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, 0xf2, 0xde, 0x1f, 0x18, 0x79, 0x61, 0x6d, + 0x6c, 0x3a, 0x22, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x65, + 0x6c, 0x61, 0x79, 0x73, 0x22, 0x52, 0x0f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x75, 0x6d, + 0x52, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x3a, 0x22, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, + 0x19, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x78, 0x2f, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0xab, 0x01, 0xd8, 0xe2, 0x1e, + 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x42, 0x0b, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x21, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, + 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0xa2, 0x02, 0x03, 0x50, 0x53, 0x58, 0xaa, + 0x02, 0x10, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0xca, 0x02, 0x10, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0xe2, 0x02, 0x1c, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, + 0x3a, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/poktroll/service/tx.pulsar.go b/api/poktroll/service/tx.pulsar.go index ae03ea849..3b140dce5 100644 --- a/api/poktroll/service/tx.pulsar.go +++ b/api/poktroll/service/tx.pulsar.go @@ -5,11 +5,11 @@ import ( _ "cosmossdk.io/api/amino" v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" _ "cosmossdk.io/api/cosmos/msg/v1" - shared "github.com/pokt-network/poktroll/api/poktroll/shared" fmt "fmt" _ "github.com/cosmos/cosmos-proto" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" + shared "github.com/pokt-network/poktroll/api/poktroll/shared" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -878,6 +878,7 @@ var ( fd_MsgUpdateParam_authority protoreflect.FieldDescriptor fd_MsgUpdateParam_name protoreflect.FieldDescriptor fd_MsgUpdateParam_as_coin protoreflect.FieldDescriptor + fd_MsgUpdateParam_as_uint64 protoreflect.FieldDescriptor ) func init() { @@ -886,6 +887,7 @@ func init() { fd_MsgUpdateParam_authority = md_MsgUpdateParam.Fields().ByName("authority") fd_MsgUpdateParam_name = md_MsgUpdateParam.Fields().ByName("name") fd_MsgUpdateParam_as_coin = md_MsgUpdateParam.Fields().ByName("as_coin") + fd_MsgUpdateParam_as_uint64 = md_MsgUpdateParam.Fields().ByName("as_uint64") } var _ protoreflect.Message = (*fastReflection_MsgUpdateParam)(nil) @@ -973,6 +975,12 @@ func (x *fastReflection_MsgUpdateParam) Range(f func(protoreflect.FieldDescripto if !f(fd_MsgUpdateParam_as_coin, value) { return } + case *MsgUpdateParam_AsUint64: + v := o.AsUint64 + value := protoreflect.ValueOfUint64(v) + if !f(fd_MsgUpdateParam_as_uint64, value) { + return + } } } } @@ -1002,6 +1010,14 @@ func (x *fastReflection_MsgUpdateParam) Has(fd protoreflect.FieldDescriptor) boo } else { return false } + case "poktroll.service.MsgUpdateParam.as_uint64": + if x.AsType == nil { + return false + } else if _, ok := x.AsType.(*MsgUpdateParam_AsUint64); ok { + return true + } else { + return false + } default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.MsgUpdateParam")) @@ -1024,6 +1040,8 @@ func (x *fastReflection_MsgUpdateParam) Clear(fd protoreflect.FieldDescriptor) { x.Name = "" case "poktroll.service.MsgUpdateParam.as_coin": x.AsType = nil + case "poktroll.service.MsgUpdateParam.as_uint64": + x.AsType = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.MsgUpdateParam")) @@ -1054,6 +1072,14 @@ func (x *fastReflection_MsgUpdateParam) Get(descriptor protoreflect.FieldDescrip } else { return protoreflect.ValueOfMessage((*v1beta1.Coin)(nil).ProtoReflect()) } + case "poktroll.service.MsgUpdateParam.as_uint64": + if x.AsType == nil { + return protoreflect.ValueOfUint64(uint64(0)) + } else if v, ok := x.AsType.(*MsgUpdateParam_AsUint64); ok { + return protoreflect.ValueOfUint64(v.AsUint64) + } else { + return protoreflect.ValueOfUint64(uint64(0)) + } default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.MsgUpdateParam")) @@ -1081,6 +1107,9 @@ func (x *fastReflection_MsgUpdateParam) Set(fd protoreflect.FieldDescriptor, val case "poktroll.service.MsgUpdateParam.as_coin": cv := value.Message().Interface().(*v1beta1.Coin) x.AsType = &MsgUpdateParam_AsCoin{AsCoin: cv} + case "poktroll.service.MsgUpdateParam.as_uint64": + cv := value.Uint() + x.AsType = &MsgUpdateParam_AsUint64{AsUint64: cv} default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.MsgUpdateParam")) @@ -1121,6 +1150,8 @@ func (x *fastReflection_MsgUpdateParam) Mutable(fd protoreflect.FieldDescriptor) panic(fmt.Errorf("field authority of message poktroll.service.MsgUpdateParam is not mutable")) case "poktroll.service.MsgUpdateParam.name": panic(fmt.Errorf("field name of message poktroll.service.MsgUpdateParam is not mutable")) + case "poktroll.service.MsgUpdateParam.as_uint64": + panic(fmt.Errorf("field as_uint64 of message poktroll.service.MsgUpdateParam is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.MsgUpdateParam")) @@ -1141,6 +1172,8 @@ func (x *fastReflection_MsgUpdateParam) NewField(fd protoreflect.FieldDescriptor case "poktroll.service.MsgUpdateParam.as_coin": value := &v1beta1.Coin{} return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "poktroll.service.MsgUpdateParam.as_uint64": + return protoreflect.ValueOfUint64(uint64(0)) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.MsgUpdateParam")) @@ -1161,6 +1194,8 @@ func (x *fastReflection_MsgUpdateParam) WhichOneof(d protoreflect.OneofDescripto switch x.AsType.(type) { case *MsgUpdateParam_AsCoin: return x.Descriptor().Fields().ByName("as_coin") + case *MsgUpdateParam_AsUint64: + return x.Descriptor().Fields().ByName("as_uint64") } default: panic(fmt.Errorf("%s is not a oneof field in poktroll.service.MsgUpdateParam", d.FullName())) @@ -1233,6 +1268,11 @@ func (x *fastReflection_MsgUpdateParam) ProtoMethods() *protoiface.Methods { } l = options.Size(x.AsCoin) n += 1 + l + runtime.Sov(uint64(l)) + case *MsgUpdateParam_AsUint64: + if x == nil { + break + } + n += 1 + runtime.Sov(uint64(x.AsUint64)) } if x.unknownFields != nil { n += len(x.unknownFields) @@ -1276,7 +1316,11 @@ func (x *fastReflection_MsgUpdateParam) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x4a + dAtA[i] = 0x1a + case *MsgUpdateParam_AsUint64: + i = runtime.EncodeVarint(dAtA, i, uint64(x.AsUint64)) + i-- + dAtA[i] = 0x20 } if len(x.Name) > 0 { i -= len(x.Name) @@ -1405,7 +1449,7 @@ func (x *fastReflection_MsgUpdateParam) ProtoMethods() *protoiface.Methods { } x.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 9: + case 3: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AsCoin", wireType) } @@ -1440,6 +1484,26 @@ func (x *fastReflection_MsgUpdateParam) ProtoMethods() *protoiface.Methods { } x.AsType = &MsgUpdateParam_AsCoin{v} iNdEx = postIndex + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AsUint64", wireType) + } + var v 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++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.AsType = &MsgUpdateParam_AsUint64{v} default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -2867,6 +2931,7 @@ type MsgUpdateParam struct { // Types that are assignable to AsType: // // *MsgUpdateParam_AsCoin + // *MsgUpdateParam_AsUint64 AsType isMsgUpdateParam_AsType `protobuf_oneof:"as_type"` } @@ -2918,16 +2983,29 @@ func (x *MsgUpdateParam) GetAsCoin() *v1beta1.Coin { return nil } +func (x *MsgUpdateParam) GetAsUint64() uint64 { + if x, ok := x.GetAsType().(*MsgUpdateParam_AsUint64); ok { + return x.AsUint64 + } + return 0 +} + type isMsgUpdateParam_AsType interface { isMsgUpdateParam_AsType() } type MsgUpdateParam_AsCoin struct { - AsCoin *v1beta1.Coin `protobuf:"bytes,9,opt,name=as_coin,json=asCoin,proto3,oneof"` + AsCoin *v1beta1.Coin `protobuf:"bytes,3,opt,name=as_coin,json=asCoin,proto3,oneof"` +} + +type MsgUpdateParam_AsUint64 struct { + AsUint64 uint64 `protobuf:"varint,4,opt,name=as_uint64,json=asUint64,proto3,oneof"` } func (*MsgUpdateParam_AsCoin) isMsgUpdateParam_AsType() {} +func (*MsgUpdateParam_AsUint64) isMsgUpdateParam_AsType() {} + // MsgUpdateParamResponse defines the response structure for executing a // MsgUpdateParam message after a single param update. type MsgUpdateParamResponse struct { @@ -3068,64 +3146,67 @@ var file_poktroll_service_tx_proto_rawDesc = []byte{ 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0xba, 0x01, 0x0a, 0x0e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x6e, 0x73, 0x65, 0x22, 0xe8, 0x01, 0x0a, 0x0e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x41, 0x0a, 0x07, 0x61, 0x73, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x18, 0x09, 0x20, + 0x6d, 0x65, 0x12, 0x41, 0x0a, 0x07, 0x61, 0x73, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x0b, 0xea, 0xde, 0x1f, 0x07, 0x61, 0x73, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x48, 0x00, 0x52, 0x06, 0x61, - 0x73, 0x43, 0x6f, 0x69, 0x6e, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, - 0x6f, 0x72, 0x69, 0x74, 0x79, 0x42, 0x09, 0x0a, 0x07, 0x61, 0x73, 0x5f, 0x74, 0x79, 0x70, 0x65, - 0x22, 0x4a, 0x0a, 0x16, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x06, 0x70, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x6f, 0x6b, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x9c, 0x01, 0x0a, - 0x0d, 0x4d, 0x73, 0x67, 0x41, 0x64, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3d, - 0x0a, 0x0d, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 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, - 0x0c, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x38, 0x0a, - 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, - 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, - 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x07, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3a, 0x12, 0x82, 0xe7, 0xb0, 0x2a, 0x0d, 0x6f, 0x77, - 0x6e, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x17, 0x0a, 0x15, 0x4d, - 0x73, 0x67, 0x41, 0x64, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x9d, 0x02, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x5c, 0x0a, 0x0c, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x21, 0x2e, 0x70, - 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, - 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, - 0x29, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x59, 0x0a, 0x0b, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x20, 0x2e, 0x70, 0x6f, 0x6b, 0x74, + 0x73, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x2c, 0x0a, 0x09, 0x61, 0x73, 0x5f, 0x75, 0x69, 0x6e, 0x74, + 0x36, 0x34, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x42, 0x0d, 0xea, 0xde, 0x1f, 0x09, 0x61, 0x73, + 0x5f, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x48, 0x00, 0x52, 0x08, 0x61, 0x73, 0x55, 0x69, 0x6e, + 0x74, 0x36, 0x34, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x74, 0x79, 0x42, 0x09, 0x0a, 0x07, 0x61, 0x73, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x22, 0x4a, + 0x0a, 0x16, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x9c, 0x01, 0x0a, 0x0d, 0x4d, + 0x73, 0x67, 0x41, 0x64, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3d, 0x0a, 0x0d, + 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 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, 0x0c, 0x6f, + 0x77, 0x6e, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x38, 0x0a, 0x07, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x07, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x3a, 0x12, 0x82, 0xe7, 0xb0, 0x2a, 0x0d, 0x6f, 0x77, 0x6e, 0x65, + 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x17, 0x0a, 0x15, 0x4d, 0x73, 0x67, + 0x41, 0x64, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x32, 0x9d, 0x02, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x5c, 0x0a, 0x0c, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x21, 0x2e, 0x70, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, 0x73, + 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x29, 0x2e, + 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x59, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x20, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x1a, 0x28, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, 0x73, 0x67, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x1a, 0x28, 0x2e, 0x70, 0x6f, - 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, - 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x0a, 0x41, 0x64, 0x64, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x12, 0x1f, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x64, 0x64, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x1a, 0x27, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x64, 0x64, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, - 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xa7, 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, - 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x21, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, - 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0xa2, - 0x02, 0x03, 0x50, 0x53, 0x58, 0xaa, 0x02, 0x10, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0xca, 0x02, 0x10, 0x50, 0x6f, 0x6b, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0xe2, 0x02, 0x1c, 0x50, 0x6f, - 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x50, 0x6f, 0x6b, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x0a, 0x41, 0x64, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x12, 0x1f, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x64, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x1a, 0x27, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x64, 0x64, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, + 0x2a, 0x01, 0x42, 0xa7, 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x70, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x42, + 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x21, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0xa2, 0x02, 0x03, + 0x50, 0x53, 0x58, 0xaa, 0x02, 0x10, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0xca, 0x02, 0x10, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0xe2, 0x02, 0x1c, 0x50, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x47, 0x50, 0x42, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -3252,6 +3333,7 @@ func file_poktroll_service_tx_proto_init() { } file_poktroll_service_tx_proto_msgTypes[2].OneofWrappers = []interface{}{ (*MsgUpdateParam_AsCoin)(nil), + (*MsgUpdateParam_AsUint64)(nil), } type x struct{} out := protoimpl.TypeBuilder{ diff --git a/config.yml b/config.yml index a2cab35ab..2b972684d 100644 --- a/config.yml +++ b/config.yml @@ -251,6 +251,7 @@ genesis: add_service_fee: amount: "1000000000" denom: upokt + target_num_relays: 1 serviceList: - id: anvil name: "anvil" diff --git a/makefiles/params.mk b/makefiles/params.mk index 823f0ecbc..bbe99698a 100644 --- a/makefiles/params.mk +++ b/makefiles/params.mk @@ -31,6 +31,10 @@ params_update_service_all: ## Update the service module params params_update_service_add_service_fee: ## Update the service module add_service_fee param poktrolld tx authz exec ./tools/scripts/params/service_add_service_fee.json $(PARAM_FLAGS) +.PHONY: params_update_service_target_num_relays +params_update_service_target_num_relays: ## Update the service module target_num_relays param + poktrolld tx authz exec ./tools/scripts/params/service_target_num_relays.json $(PARAM_FLAGS) + ### Proof Module Params ### .PHONY: params_get_proof params_get_proof: ## Get the proof module params diff --git a/proto/poktroll/service/params.proto b/proto/poktroll/service/params.proto index 66677c9b3..78c5da623 100644 --- a/proto/poktroll/service/params.proto +++ b/proto/poktroll/service/params.proto @@ -18,4 +18,8 @@ message Params { // This will be deducted from the signer's account balance, // and transferred to the pocket network foundation. cosmos.base.v1beta1.Coin add_service_fee = 1 [(gogoproto.jsontag) = "add_service_fee", (gogoproto.moretags) = "yaml:\"add_service_fee\""]; + + // target_num_relays is the target for the EMA of the number of relays per session. + // Per service, on-chain relay mining difficulty will be adjusted to maintain this target. + uint64 target_num_relays = 2 [(gogoproto.jsontag) = "target_num_relays", (gogoproto.moretags) = "yaml:\"target_num_relays\""]; } diff --git a/proto/poktroll/service/tx.proto b/proto/poktroll/service/tx.proto index 44bc0c988..b80a5d5d2 100644 --- a/proto/poktroll/service/tx.proto +++ b/proto/poktroll/service/tx.proto @@ -53,7 +53,8 @@ message MsgUpdateParam { // specified in the `Params` message in `proof/params.proto.` string name = 2; oneof as_type { - cosmos.base.v1beta1.Coin as_coin = 9 [(gogoproto.jsontag) = "as_coin"]; + cosmos.base.v1beta1.Coin as_coin = 3 [(gogoproto.jsontag) = "as_coin"]; + uint64 as_uint64 = 4 [(gogoproto.jsontag) = "as_uint64"]; } } diff --git a/testutil/integration/suites/param_configs.go b/testutil/integration/suites/param_configs.go index 9a509587e..1e3a52e9e 100644 --- a/testutil/integration/suites/param_configs.go +++ b/testutil/integration/suites/param_configs.go @@ -131,10 +131,12 @@ var ( QueryParamsResponse: servicetypes.QueryParamsResponse{}, }, ValidParams: servicetypes.Params{ - AddServiceFee: &ValidAddServiceFeeCoin, + AddServiceFee: &ValidAddServiceFeeCoin, + TargetNumRelays: servicetypes.DefaultTargetNumRelays, }, ParamTypes: map[ParamType]any{ - ParamTypeCoin: servicetypes.MsgUpdateParam_AsCoin{}, + ParamTypeCoin: servicetypes.MsgUpdateParam_AsCoin{}, + ParamTypeUint64: servicetypes.MsgUpdateParam_AsUint64{}, }, DefaultParams: servicetypes.DefaultParams(), NewParamClientFn: servicetypes.NewQueryClient, diff --git a/tools/scripts/params/service_all.json b/tools/scripts/params/service_all.json index 9a1f3f682..f04949fa8 100644 --- a/tools/scripts/params/service_all.json +++ b/tools/scripts/params/service_all.json @@ -8,7 +8,8 @@ "add_service_fee": { "denom": "upokt", "amount": "1000000000" - } + }, + "target_num_relays": 1 } } ] diff --git a/tools/scripts/params/service_target_num_relays.json b/tools/scripts/params/service_target_num_relays.json new file mode 100644 index 000000000..6f7b4e89e --- /dev/null +++ b/tools/scripts/params/service_target_num_relays.json @@ -0,0 +1,12 @@ +{ + "body": { + "messages": [ + { + "@type": "/poktroll.service.MsgUpdateParam", + "authority": "pokt10d07y265gmmuvt4z0w9aw880jnsr700j8yv32t", + "name": "target_num_relays", + "as_uint64": 1 + } + ] + } +} diff --git a/x/application/types/message_update_param.go b/x/application/types/message_update_param.go index ed66a4ee4..251ab6a4b 100644 --- a/x/application/types/message_update_param.go +++ b/x/application/types/message_update_param.go @@ -43,12 +43,12 @@ func (msg *MsgUpdateParam) ValidateBasic() error { // Parameter name MUST be supported by this module. switch msg.Name { case ParamMaxDelegatedGateways: - if err := msg.paramTypeIsUint64(); err != nil { + if err := genericParamTypeIs[*MsgUpdateParam_AsUint64](msg); err != nil { return err } return ValidateMaxDelegatedGateways(msg.GetAsUint64()) case ParamMinStake: - if err := msg.paramTypeIsCoin(); err != nil { + if err := genericParamTypeIs[*MsgUpdateParam_AsCoin](msg); err != nil { return err } return ValidateMinStake(msg.GetAsCoin()) @@ -57,22 +57,14 @@ func (msg *MsgUpdateParam) ValidateBasic() error { } } -func (msg *MsgUpdateParam) paramTypeIsUint64() error { - if _, ok := msg.AsType.(*MsgUpdateParam_AsUint64); !ok { - return ErrAppParamInvalid.Wrapf(""+ +// genericTypeIsCoin checks if the parameter type is T, returning an error if not. +func genericParamTypeIs[T any](msg *MsgUpdateParam) error { + if _, ok := msg.AsType.(T); !ok { + return ErrAppParamInvalid.Wrapf( "invalid type for param %q; expected %T, got %T", - msg.Name, &MsgUpdateParam_AsUint64{}, msg.AsType, + msg.Name, *new(T), msg.AsType, ) } - return nil -} -func (msg *MsgUpdateParam) paramTypeIsCoin() error { - if _, ok := msg.AsType.(*MsgUpdateParam_AsCoin); !ok { - return ErrAppParamInvalid.Wrapf(""+ - "invalid type for param %q; expected %T, got %T", - msg.Name, &MsgUpdateParam_AsCoin{}, msg.AsType, - ) - } return nil } diff --git a/x/service/keeper/msg_server_update_param.go b/x/service/keeper/msg_server_update_param.go index ac1ea6a6c..bcbe2cb39 100644 --- a/x/service/keeper/msg_server_update_param.go +++ b/x/service/keeper/msg_server_update_param.go @@ -6,15 +6,15 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/pokt-network/poktroll/x/service/types" + servicetypes "github.com/pokt-network/poktroll/x/service/types" ) // UpdateParam updates a single parameter in the service module and returns // all active parameters. func (k msgServer) UpdateParam( ctx context.Context, - msg *types.MsgUpdateParam, -) (*types.MsgUpdateParamResponse, error) { + msg *servicetypes.MsgUpdateParam, +) (*servicetypes.MsgUpdateParamResponse, error) { logger := k.logger.With( "method", "UpdateParam", "param_name", msg.Name, @@ -27,7 +27,7 @@ func (k msgServer) UpdateParam( if k.GetAuthority() != msg.Authority { return nil, status.Error( codes.InvalidArgument, - types.ErrServiceInvalidSigner.Wrapf( + servicetypes.ErrServiceInvalidSigner.Wrapf( "invalid authority; expected %s, got %s", k.GetAuthority(), msg.Authority, ).Error(), @@ -37,13 +37,16 @@ func (k msgServer) UpdateParam( params := k.GetParams(ctx) switch msg.Name { - case types.ParamAddServiceFee: + case servicetypes.ParamAddServiceFee: logger = logger.With("param_value", msg.GetAsCoin()) params.AddServiceFee = msg.GetAsCoin() + case servicetypes.ParamTargetNumRelays: + logger = logger.With("param_value", msg.GetAsUint64()) + params.TargetNumRelays = msg.GetAsUint64() default: return nil, status.Error( codes.InvalidArgument, - types.ErrServiceParamInvalid.Wrapf("unsupported param %q", msg.Name).Error(), + servicetypes.ErrServiceParamInvalid.Wrapf("unsupported param %q", msg.Name).Error(), ) } @@ -60,7 +63,7 @@ func (k msgServer) UpdateParam( updatedParams := k.GetParams(ctx) - return &types.MsgUpdateParamResponse{ + return &servicetypes.MsgUpdateParamResponse{ Params: &updatedParams, }, nil } diff --git a/x/service/keeper/msg_server_update_param_test.go b/x/service/keeper/msg_server_update_param_test.go index 67c2eb979..d6d774872 100644 --- a/x/service/keeper/msg_server_update_param_test.go +++ b/x/service/keeper/msg_server_update_param_test.go @@ -40,3 +40,30 @@ func TestMsgUpdateParam_UpdateAddServiceFeeOnly(t *testing.T) { // Ensure the other parameters are unchanged testkeeper.AssertDefaultParamsEqualExceptFields(t, &defaultParams, res.Params, "AddServiceFee") } + +func TestMsgUpdateParam_UpdateTargetNumRelaysOnly(t *testing.T) { + expectedTargetNumRelays := uint64(9001) + + // Set the parameters to their default values + k, msgSrv, ctx := setupMsgServer(t) + defaultParams := servicetypes.DefaultParams() + require.NoError(t, k.SetParams(ctx, defaultParams)) + + // Ensure the default values are different from the new values we want to set + require.NotEqual(t, expectedTargetNumRelays, defaultParams.TargetNumRelays) + + // Update the add service fee parameter + updateParamMsg := &servicetypes.MsgUpdateParam{ + Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(), + Name: servicetypes.ParamTargetNumRelays, + AsType: &servicetypes.MsgUpdateParam_AsUint64{AsUint64: expectedTargetNumRelays}, + } + res, err := msgSrv.UpdateParam(ctx, updateParamMsg) + require.NoError(t, err) + + require.NotEqual(t, defaultParams.TargetNumRelays, res.Params.TargetNumRelays) + require.Equal(t, expectedTargetNumRelays, res.Params.TargetNumRelays) + + // Ensure the other parameters are unchanged + testkeeper.AssertDefaultParamsEqualExceptFields(t, &defaultParams, res.Params, "TargetNumRelays") +} diff --git a/x/service/keeper/msg_update_params_test.go b/x/service/keeper/msg_update_params_test.go index e473aab7d..c26be8e48 100644 --- a/x/service/keeper/msg_update_params_test.go +++ b/x/service/keeper/msg_update_params_test.go @@ -5,24 +5,24 @@ import ( "github.com/stretchr/testify/require" - "github.com/pokt-network/poktroll/x/service/types" + servicetypes "github.com/pokt-network/poktroll/x/service/types" ) func TestMsgUpdateParams(t *testing.T) { k, ms, ctx := setupMsgServer(t) - params := types.DefaultParams() + params := servicetypes.DefaultParams() require.NoError(t, k.SetParams(ctx, params)) // default params tests := []struct { desc string - input *types.MsgUpdateParams + input *servicetypes.MsgUpdateParams shouldError bool expectedErrMsg string }{ { desc: "invalid: authority address invalid", - input: &types.MsgUpdateParams{ + input: &servicetypes.MsgUpdateParams{ Authority: "invalid", Params: params, }, @@ -31,19 +31,31 @@ func TestMsgUpdateParams(t *testing.T) { }, { desc: "invalid: send empty params", - input: &types.MsgUpdateParams{ + input: &servicetypes.MsgUpdateParams{ Authority: k.GetAuthority(), - Params: types.Params{}, + Params: servicetypes.Params{}, }, shouldError: true, expectedErrMsg: "missing add_service_fee", }, { - desc: "valid: send default params", - input: &types.MsgUpdateParams{ + desc: "invalid: send default params", + input: &servicetypes.MsgUpdateParams{ Authority: k.GetAuthority(), Params: params, }, + shouldError: true, + expectedErrMsg: "target_num_relays must be greater than 0: got 0", + }, + { + desc: "valid: send minimal params", + input: &servicetypes.MsgUpdateParams{ + Authority: k.GetAuthority(), + Params: servicetypes.Params{ + AddServiceFee: &servicetypes.MinAddServiceFee, + TargetNumRelays: 1, + }, + }, shouldError: false, }, } diff --git a/x/service/keeper/params_test.go b/x/service/keeper/params_test.go index 556f1de0f..71afe275e 100644 --- a/x/service/keeper/params_test.go +++ b/x/service/keeper/params_test.go @@ -46,3 +46,38 @@ func TestParams_ValidateAddServiceFee(t *testing.T) { }) } } + +func TestParams_ValidateTargetNumRelays(t *testing.T) { + tests := []struct { + desc string + targetNumRelays any + expectedErr error + }{ + { + desc: "invalid type", + targetNumRelays: "999", + expectedErr: servicetypes.ErrServiceParamInvalid, + }, + { + desc: "invalid value", + targetNumRelays: 0, + expectedErr: servicetypes.ErrServiceParamInvalid, + }, + { + desc: "valid TargetNumRelays", + targetNumRelays: 999, + }, + } + + for _, test := range tests { + t.Run(test.desc, func(t *testing.T) { + err := servicetypes.ValidateTargetNumRelays(test.targetNumRelays) + if test.expectedErr != nil { + require.Error(t, err) + require.Contains(t, err.Error(), test.expectedErr.Error()) + } else { + require.NoError(t, err) + } + }) + } +} diff --git a/x/service/types/message_update_param.go b/x/service/types/message_update_param.go index 7d3ad2c15..ccef3422a 100644 --- a/x/service/types/message_update_param.go +++ b/x/service/types/message_update_param.go @@ -1,10 +1,10 @@ package types import ( - sdk "github.com/cosmos/cosmos-sdk/types" + cosmostypes "github.com/cosmos/cosmos-sdk/types" ) -var _ sdk.Msg = (*MsgUpdateParam)(nil) +var _ cosmostypes.Msg = (*MsgUpdateParam)(nil) // NewMsgUpdateParam creates a new MsgUpdateParam instance for a single // governance parameter update. @@ -12,8 +12,10 @@ func NewMsgUpdateParam(authority string, name string, asType any) (*MsgUpdatePar var asTypeIface isMsgUpdateParam_AsType switch t := asType.(type) { - case *sdk.Coin: + case *cosmostypes.Coin: asTypeIface = &MsgUpdateParam_AsCoin{AsCoin: t} + case uint64: + asTypeIface = &MsgUpdateParam_AsUint64{AsUint64: t} default: return nil, ErrServiceParamInvalid.Wrapf("unexpected param value type: %T", asType) } @@ -30,7 +32,7 @@ func NewMsgUpdateParam(authority string, name string, asType any) (*MsgUpdatePar // a given parameter name. func (msg *MsgUpdateParam) ValidateBasic() error { // Validate the address - if _, err := sdk.AccAddressFromBech32(msg.Authority); err != nil { + if _, err := cosmostypes.AccAddressFromBech32(msg.Authority); err != nil { return ErrServiceInvalidAddress.Wrapf("invalid authority address %s; (%v)", msg.Authority, err) } @@ -42,23 +44,25 @@ func (msg *MsgUpdateParam) ValidateBasic() error { // Parameter name MUST be supported by this module. switch msg.Name { case ParamAddServiceFee: - if err := msg.paramTypeIsCoin(); err != nil { + if err := genericParamTypeIs[*MsgUpdateParam_AsCoin](msg); err != nil { return err } return ValidateAddServiceFee(msg.GetAsCoin()) + case ParamTargetNumRelays: + return ValidateTargetNumRelays(msg.GetAsUint64()) default: return ErrServiceParamInvalid.Wrapf("unsupported param %q", msg.Name) } } -// paramTypeIsCoin checks if the parameter type is *cosmostypes.Coin, returning an error if not. -func (msg *MsgUpdateParam) paramTypeIsCoin() error { - if _, ok := msg.AsType.(*MsgUpdateParam_AsCoin); !ok { +// genericTypeIsCoin checks if the parameter type is T, returning an error if not. +func genericParamTypeIs[T any](msg *MsgUpdateParam) error { + if _, ok := msg.AsType.(T); !ok { return ErrServiceParamInvalid.Wrapf( - "invalid type for param %q expected %T, got %T", - msg.Name, &MsgUpdateParam_AsCoin{}, - msg.AsType, + "invalid type for param %q; expected %T, got %T", + msg.Name, *new(T), msg.AsType, ) } + return nil } diff --git a/x/service/types/message_update_param_test.go b/x/service/types/message_update_param_test.go index 75a45c41a..3bfb599d1 100644 --- a/x/service/types/message_update_param_test.go +++ b/x/service/types/message_update_param_test.go @@ -25,7 +25,8 @@ func TestMsgUpdateParam_ValidateBasic(t *testing.T) { AsType: &MsgUpdateParam_AsCoin{AsCoin: nil}, }, expectedErr: sdkerrors.ErrInvalidAddress, - }, { + }, + { desc: "invalid: param name incorrect (non-existent)", msg: MsgUpdateParam{ Authority: sample.AccAddress(), @@ -33,7 +34,8 @@ func TestMsgUpdateParam_ValidateBasic(t *testing.T) { AsType: &MsgUpdateParam_AsCoin{AsCoin: &MinAddServiceFee}, }, expectedErr: ErrServiceParamInvalid, - }, { + }, + { name: "valid address", desc: "valid: correct address, param name, and type", msg: MsgUpdateParam{ diff --git a/x/service/types/params.go b/x/service/types/params.go index b9bc3026b..2e30b7f22 100644 --- a/x/service/types/params.go +++ b/x/service/types/params.go @@ -14,11 +14,14 @@ import ( var ( _ paramtypes.ParamSet = (*Params)(nil) - KeyAddServiceFee = []byte("AddServiceFee") - ParamAddServiceFee = "add_service_fee" - // TODO_TECHDEBT: Determine a sensible default/min value for the add service fee. - // MinAddServiceFee is the default and minimum fee for adding a new service. - MinAddServiceFee = cosmostypes.NewCoin(volatile.DenomuPOKT, math.NewInt(1000000000)) + // TODO_MAINNET: Determine a sensible default/min values. + + KeyAddServiceFee = []byte("AddServiceFee") + ParamAddServiceFee = "add_service_fee" + MinAddServiceFee = cosmostypes.NewCoin(volatile.DenomuPOKT, math.NewInt(1000000000)) + KeyTargetNumRelays = []byte("TargetNumRelays") + ParamTargetNumRelays = "target_num_relays" + DefaultTargetNumRelays = uint64(1) ) // ParamKeyTable the param key table for launch module @@ -27,9 +30,13 @@ func ParamKeyTable() paramtypes.KeyTable { } // NewParams creates a new Params instance -func NewParams(addServiceFee *cosmostypes.Coin) Params { +func NewParams( + addServiceFee *cosmostypes.Coin, + targetNumRelays uint64, +) Params { return Params{ - AddServiceFee: addServiceFee, + AddServiceFee: addServiceFee, + TargetNumRelays: targetNumRelays, } } @@ -37,6 +44,7 @@ func NewParams(addServiceFee *cosmostypes.Coin) Params { func DefaultParams() Params { return NewParams( &MinAddServiceFee, + DefaultTargetNumRelays, ) } @@ -44,6 +52,7 @@ func DefaultParams() Params { func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { return paramtypes.ParamSetPairs{ paramtypes.NewParamSetPair(KeyAddServiceFee, &p.AddServiceFee, ValidateAddServiceFee), + paramtypes.NewParamSetPair(KeyTargetNumRelays, &p.AddServiceFee, ValidateTargetNumRelays), } } @@ -52,10 +61,15 @@ func (p Params) ValidateBasic() error { if err := ValidateAddServiceFee(p.AddServiceFee); err != nil { return err } + + if err := ValidateTargetNumRelays(p.TargetNumRelays); err != nil { + return err + } + return nil } -// validateAddServiceFee validates the AddServiceFee param +// ValidateAddServiceFee validates the AddServiceFee param func ValidateAddServiceFee(addServiceFeeAny any) error { addServiceFee, ok := addServiceFeeAny.(*cosmostypes.Coin) if !ok { @@ -81,3 +95,17 @@ func ValidateAddServiceFee(addServiceFeeAny any) error { return nil } + +// ValidateTargetNumRelays validates the TargetNumRelays param +func ValidateTargetNumRelays(targetNumRelaysAny any) error { + targetNumRelays, ok := targetNumRelaysAny.(uint64) + if !ok { + return ErrServiceParamInvalid.Wrapf("invalid parameter type: %T", targetNumRelaysAny) + } + + if targetNumRelays < 1 { + return ErrServiceParamInvalid.Wrapf("target_num_relays must be greater than 0: got %d", targetNumRelays) + } + + return nil +} diff --git a/x/service/types/params.pb.go b/x/service/types/params.pb.go index 8a12bc9f0..3fd9295e8 100644 --- a/x/service/types/params.pb.go +++ b/x/service/types/params.pb.go @@ -31,6 +31,9 @@ type Params struct { // This will be deducted from the signer's account balance, // and transferred to the pocket network foundation. AddServiceFee *types.Coin `protobuf:"bytes,1,opt,name=add_service_fee,json=addServiceFee,proto3" json:"add_service_fee" yaml:"add_service_fee"` + // target_num_relays is the target for the EMA of the number of relays per session. + // Per service, on-chain relay mining difficulty will be adjusted to maintain this target. + TargetNumRelays uint64 `protobuf:"varint,2,opt,name=target_num_relays,json=targetNumRelays,proto3" json:"target_num_relays" yaml:"target_num_relays"` } func (m *Params) Reset() { *m = Params{} } @@ -69,6 +72,13 @@ func (m *Params) GetAddServiceFee() *types.Coin { return nil } +func (m *Params) GetTargetNumRelays() uint64 { + if m != nil { + return m.TargetNumRelays + } + return 0 +} + func init() { proto.RegisterType((*Params)(nil), "poktroll.service.Params") } @@ -76,25 +86,28 @@ func init() { func init() { proto.RegisterFile("poktroll/service/params.proto", fileDescriptor_69b5d0104478b383) } var fileDescriptor_69b5d0104478b383 = []byte{ - // 277 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2d, 0xc8, 0xcf, 0x2e, - 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x2f, 0x4e, 0x2d, 0x2a, 0xcb, 0x4c, 0x4e, 0xd5, 0x2f, 0x48, 0x2c, - 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x80, 0x49, 0xeb, 0x41, 0xa5, - 0xa5, 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x91, 0x94, 0x48, 0x7a, 0x7e, - 0x7a, 0x3e, 0x98, 0xa9, 0x0f, 0x62, 0x41, 0x45, 0xe5, 0x92, 0xf3, 0x8b, 0x73, 0xf3, 0x8b, 0xf5, - 0x93, 0x12, 0x8b, 0x53, 0xf5, 0xcb, 0x0c, 0x93, 0x52, 0x4b, 0x12, 0x0d, 0xf5, 0x93, 0xf3, 0x33, - 0xf3, 0x20, 0xf2, 0x4a, 0xf3, 0x18, 0xb9, 0xd8, 0x02, 0xc0, 0x76, 0x09, 0x15, 0x70, 0xf1, 0x27, - 0xa6, 0xa4, 0xc4, 0x43, 0xad, 0x88, 0x4f, 0x4b, 0x4d, 0x95, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x36, - 0x92, 0xd4, 0x83, 0x18, 0xa2, 0x07, 0x32, 0x44, 0x0f, 0x6a, 0x88, 0x9e, 0x73, 0x7e, 0x66, 0x9e, - 0x93, 0xee, 0xab, 0x7b, 0xf2, 0xe8, 0xba, 0x3e, 0xdd, 0x93, 0x17, 0xab, 0x4c, 0xcc, 0xcd, 0xb1, - 0x52, 0x42, 0x93, 0x50, 0x0a, 0xe2, 0x4d, 0x4c, 0x49, 0x09, 0x86, 0x08, 0xb8, 0xa5, 0xa6, 0x5a, - 0x29, 0xbd, 0x58, 0x20, 0xcf, 0xd8, 0xf5, 0x7c, 0x83, 0x96, 0x24, 0xdc, 0xff, 0x15, 0xf0, 0x10, - 0x80, 0xb8, 0xca, 0xc9, 0xef, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x6f, 0x3c, 0x92, - 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, - 0x96, 0x63, 0x88, 0x32, 0x48, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x07, - 0x99, 0xa1, 0x9b, 0x97, 0x5a, 0x52, 0x9e, 0x5f, 0x94, 0xad, 0x8f, 0xc5, 0xc0, 0x92, 0xca, 0x82, - 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0xbf, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x0f, 0x60, 0xd1, - 0x42, 0x73, 0x01, 0x00, 0x00, + // 330 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0xb1, 0x4a, 0xc3, 0x40, + 0x18, 0xc7, 0x7b, 0x22, 0x1d, 0x22, 0x52, 0x5b, 0x44, 0xda, 0x82, 0x97, 0x92, 0xa9, 0x08, 0xcd, + 0x59, 0xdd, 0x3a, 0x56, 0x70, 0x2c, 0x52, 0x37, 0x41, 0xc2, 0x25, 0x39, 0x63, 0x68, 0x2e, 0x5f, + 0xb8, 0xbb, 0x56, 0xfb, 0x0a, 0x4e, 0x3e, 0x82, 0x8f, 0xe0, 0x63, 0x38, 0x76, 0xec, 0x14, 0x24, + 0x1d, 0x94, 0x8e, 0xdd, 0x05, 0x69, 0x2e, 0x76, 0x68, 0x5d, 0x8e, 0x8f, 0xff, 0xef, 0xee, 0xf7, + 0x71, 0x7f, 0xe3, 0x34, 0x81, 0x91, 0x12, 0x10, 0x45, 0x44, 0x32, 0x31, 0x09, 0x3d, 0x46, 0x12, + 0x2a, 0x28, 0x97, 0x76, 0x22, 0x40, 0x41, 0xed, 0xe8, 0x0f, 0xdb, 0x05, 0x6e, 0x56, 0x29, 0x0f, + 0x63, 0x20, 0xf9, 0xa9, 0x2f, 0x35, 0x8f, 0x03, 0x08, 0x20, 0x1f, 0xc9, 0x7a, 0x2a, 0x52, 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0x26, 0xdd, 0x72, 0x5e, 0xeb, 0xe5, 0x6f, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xcf, 0xf3, 0x1c, 0x51, 0xd2, 0x01, 0x00, 0x00, } func (this *Params) Equal(that interface{}) bool { @@ -119,6 +132,9 @@ func (this *Params) Equal(that interface{}) bool { if !this.AddServiceFee.Equal(that1.AddServiceFee) { return false } + if this.TargetNumRelays != that1.TargetNumRelays { + return false + } return true } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -141,6 +157,11 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.TargetNumRelays != 0 { + i = encodeVarintParams(dAtA, i, uint64(m.TargetNumRelays)) + i-- + dAtA[i] = 0x10 + } if m.AddServiceFee != nil { { size, err := m.AddServiceFee.MarshalToSizedBuffer(dAtA[:i]) @@ -177,6 +198,9 @@ func (m *Params) Size() (n int) { l = m.AddServiceFee.Size() n += 1 + l + sovParams(uint64(l)) } + if m.TargetNumRelays != 0 { + n += 1 + sovParams(uint64(m.TargetNumRelays)) + } return n } @@ -251,6 +275,25 @@ func (m *Params) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TargetNumRelays", wireType) + } + m.TargetNumRelays = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TargetNumRelays |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipParams(dAtA[iNdEx:]) diff --git a/x/service/types/tx.pb.go b/x/service/types/tx.pb.go index 098020211..c6c9e1259 100644 --- a/x/service/types/tx.pb.go +++ b/x/service/types/tx.pb.go @@ -128,6 +128,7 @@ type MsgUpdateParam struct { Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // Types that are valid to be assigned to AsType: // *MsgUpdateParam_AsCoin + // *MsgUpdateParam_AsUint64 AsType isMsgUpdateParam_AsType `protobuf_oneof:"as_type"` } @@ -167,10 +168,14 @@ type isMsgUpdateParam_AsType interface { } type MsgUpdateParam_AsCoin struct { - AsCoin *types.Coin `protobuf:"bytes,9,opt,name=as_coin,json=asCoin,proto3,oneof" json:"as_coin"` + AsCoin *types.Coin `protobuf:"bytes,3,opt,name=as_coin,json=asCoin,proto3,oneof" json:"as_coin"` +} +type MsgUpdateParam_AsUint64 struct { + AsUint64 uint64 `protobuf:"varint,4,opt,name=as_uint64,json=asUint64,proto3,oneof" json:"as_uint64"` } -func (*MsgUpdateParam_AsCoin) isMsgUpdateParam_AsType() {} +func (*MsgUpdateParam_AsCoin) isMsgUpdateParam_AsType() {} +func (*MsgUpdateParam_AsUint64) isMsgUpdateParam_AsType() {} func (m *MsgUpdateParam) GetAsType() isMsgUpdateParam_AsType { if m != nil { @@ -200,10 +205,18 @@ func (m *MsgUpdateParam) GetAsCoin() *types.Coin { return nil } +func (m *MsgUpdateParam) GetAsUint64() uint64 { + if x, ok := m.GetAsType().(*MsgUpdateParam_AsUint64); ok { + return x.AsUint64 + } + return 0 +} + // XXX_OneofWrappers is for the internal use of the proto package. func (*MsgUpdateParam) XXX_OneofWrappers() []interface{} { return []interface{}{ (*MsgUpdateParam_AsCoin)(nil), + (*MsgUpdateParam_AsUint64)(nil), } } @@ -344,43 +357,45 @@ func init() { func init() { proto.RegisterFile("poktroll/service/tx.proto", fileDescriptor_31ba9559706e649e) } var fileDescriptor_31ba9559706e649e = []byte{ - // 575 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xbf, 0x6f, 0xd3, 0x40, - 0x14, 0xce, 0x95, 0x92, 0xca, 0x97, 0xb6, 0x80, 0x55, 0x48, 0x62, 0x09, 0x27, 0x78, 0x21, 0x44, - 0xaa, 0xdd, 0x14, 0x81, 0x50, 0x10, 0x43, 0xcc, 0x82, 0x90, 0x82, 0x90, 0x2b, 0x90, 0x40, 0x48, - 0xd1, 0x25, 0x3e, 0x39, 0x56, 0x6b, 0x9f, 0xe5, 0xbb, 0xa6, 0xed, 0x86, 0x18, 0x99, 0xf8, 0x03, - 0x60, 0x67, 0xcc, 0xc0, 0x84, 0xc4, 0xde, 0xb1, 0x62, 0xea, 0x54, 0xa1, 0x64, 0x88, 0xc4, 0x5f, - 0x81, 0x7c, 0x3e, 0x27, 0x75, 0x12, 0x61, 0xa9, 0x4b, 0x72, 0xf7, 0xbe, 0xef, 0xfd, 0xf8, 0xde, - 0x7b, 0x67, 0x58, 0x0e, 0xc8, 0x3e, 0x0b, 0xc9, 0xc1, 0x81, 0x41, 0x71, 0x38, 0x70, 0x7b, 0xd8, - 0x60, 0xc7, 0x7a, 0x10, 0x12, 0x46, 0xe4, 0x9b, 0x09, 0xa4, 0x0b, 0x48, 0xb9, 0x85, 0x3c, 0xd7, - 0x27, 0x06, 0xff, 0x8d, 0x49, 0x8a, 0xda, 0x23, 0xd4, 0x23, 0xd4, 0xe8, 0x22, 0x8a, 0x8d, 0x41, - 0xa3, 0x8b, 0x19, 0x6a, 0x18, 0x3d, 0xe2, 0xfa, 0x02, 0x2f, 0x0a, 0xdc, 0xa3, 0x8e, 0x31, 0x68, - 0x44, 0x7f, 0x02, 0x28, 0xc7, 0x40, 0x87, 0xdf, 0x8c, 0xf8, 0x22, 0xa0, 0x2d, 0x87, 0x38, 0x24, - 0xb6, 0x47, 0x27, 0x61, 0xbd, 0xbb, 0x50, 0x69, 0x80, 0x42, 0xe4, 0xd1, 0x45, 0xb8, 0x8f, 0x42, - 0x6c, 0x27, 0xac, 0x18, 0xd6, 0x7e, 0x01, 0x78, 0xa3, 0x4d, 0x9d, 0x37, 0x81, 0x8d, 0x18, 0x7e, - 0xcd, 0x1d, 0xe5, 0xc7, 0x50, 0x42, 0x87, 0xac, 0x4f, 0x42, 0x97, 0x9d, 0x94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0xb0, 0x83, 0x62, 0xc5, 0x99, 0xbd, 0x58, 0xe7, 0x74, 0x61, 0x93, 0x9f, - 0xc0, 0x35, 0x91, 0x6a, 0xc9, 0xa4, 0xf9, 0x96, 0xe9, 0x22, 0x93, 0xb9, 0x1a, 0x4d, 0xda, 0x4a, - 0xe8, 0x4d, 0x39, 0x52, 0x9c, 0xce, 0xad, 0x15, 0xe1, 0xed, 0x54, 0x75, 0x89, 0xd2, 0xdd, 0x6f, - 0x2b, 0xf0, 0x5a, 0x9b, 0x3a, 0xf2, 0x07, 0xb8, 0x9e, 0xda, 0xcf, 0x7b, 0x8b, 0x8a, 0xe7, 0x76, - 0x40, 0x79, 0x90, 0x49, 0x99, 0xf6, 0xf3, 0x1d, 0x2c, 0x5c, 0x5e, 0x91, 0x6a, 0x96, 0xa7, 0x52, - 0xcb, 0x62, 0x4c, 0x43, 0xbf, 0x85, 0xf0, 0x52, 0xd3, 0x2b, 0x4b, 0xfd, 0x66, 0x04, 0xe5, 0x7e, - 0x06, 0x21, 0x89, 0xab, 0x5c, 0xff, 0x18, 0x3d, 0x1d, 0xf3, 0xd5, 0xe9, 0x48, 0x05, 0x67, 0x23, - 0x15, 0x9c, 0x8f, 0x54, 0xf0, 0x67, 0xa4, 0x82, 0x2f, 0x63, 0x35, 0x77, 0x36, 0x56, 0x73, 0xe7, - 0x63, 0x35, 0xf7, 0x7e, 0xc7, 0x71, 0x59, 0xff, 0xb0, 0xab, 0xf7, 0x88, 0x67, 0x44, 0x71, 0xb7, - 0x7d, 0xcc, 0x8e, 0x48, 0xb8, 0x6f, 0x2c, 0x79, 0x55, 0xd1, 0xca, 0xd1, 0x6e, 0x9e, 0x7f, 0x12, - 0x1e, 0xfe, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x9f, 0xce, 0x8f, 0xce, 0xfc, 0x04, 0x00, 0x00, + // 607 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 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a, 0x97, + 0x03, 0x55, 0x78, 0xb7, 0xe3, 0xb8, 0xac, 0xd5, 0x6e, 0xe8, 0x4d, 0xe2, 0x19, 0x51, 0xdc, 0x6d, + 0x1f, 0xb3, 0x13, 0x12, 0x1e, 0x19, 0x33, 0xde, 0x60, 0xb4, 0x72, 0xb4, 0xb1, 0x14, 0x7f, 0x40, + 0x1e, 0xfd, 0x09, 0x00, 0x00, 0xff, 0xff, 0xb4, 0xe3, 0x94, 0x22, 0x2a, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -665,10 +680,22 @@ func (m *MsgUpdateParam_AsCoin) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintTx(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x4a + dAtA[i] = 0x1a } return len(dAtA) - i, nil } +func (m *MsgUpdateParam_AsUint64) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParam_AsUint64) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i = encodeVarintTx(dAtA, i, uint64(m.AsUint64)) + i-- + dAtA[i] = 0x20 + return len(dAtA) - i, nil +} func (m *MsgUpdateParamResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -834,6 +861,15 @@ func (m *MsgUpdateParam_AsCoin) Size() (n int) { } return n } +func (m *MsgUpdateParam_AsUint64) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovTx(uint64(m.AsUint64)) + return n +} func (m *MsgUpdateParamResponse) Size() (n int) { if m == nil { return 0 @@ -1135,7 +1171,7 @@ func (m *MsgUpdateParam) Unmarshal(dAtA []byte) error { } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 9: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field AsCoin", wireType) } @@ -1170,6 +1206,26 @@ func (m *MsgUpdateParam) Unmarshal(dAtA []byte) error { } m.AsType = &MsgUpdateParam_AsCoin{v} iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AsUint64", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AsType = &MsgUpdateParam_AsUint64{v} default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) diff --git a/x/tokenomics/types/message_update_param.go b/x/tokenomics/types/message_update_param.go index 735b390aa..0875f40cf 100644 --- a/x/tokenomics/types/message_update_param.go +++ b/x/tokenomics/types/message_update_param.go @@ -66,10 +66,7 @@ func (msg *MsgUpdateParam) paramTypeIsString() error { return genericParamTypeIs[*MsgUpdateParam_AsString](msg) } -// TODO_TECHDEBT(@bryanchriswhite): -// 1. Move this to a shared package. -// 2. Refactor other module message_update_param.go files to use this. -// 3. Update "adding on-chain module params" docs. +// genericTypeIsCoin checks if the parameter type is T, returning an error if not. func genericParamTypeIs[T any](msg *MsgUpdateParam) error { if _, ok := msg.AsType.(T); !ok { return ErrTokenomicsParamInvalid.Wrapf(