From 32c99d8dfe7425e92f2e73dae8507fbe83e2a613 Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Sat, 21 Oct 2023 02:20:16 -0500 Subject: [PATCH] SetPower unsafe option (30%VP), --- api/v1/tx.pulsar.go | 289 +++++++++++++-------- client/cli/tx.go | 9 +- keeper/msg_server.go | 102 +++++++- proto/strangelove_ventures/poa/v1/tx.proto | 3 +- simapp/test_node.sh | 8 +- tx.pb.go | 137 ++++++---- 6 files changed, 370 insertions(+), 178 deletions(-) diff --git a/api/v1/tx.pulsar.go b/api/v1/tx.pulsar.go index 015ac2b..05480ec 100644 --- a/api/v1/tx.pulsar.go +++ b/api/v1/tx.pulsar.go @@ -23,6 +23,7 @@ var ( fd_MsgSetPower_from_address protoreflect.FieldDescriptor fd_MsgSetPower_validator_address protoreflect.FieldDescriptor fd_MsgSetPower_power protoreflect.FieldDescriptor + fd_MsgSetPower_unsafe protoreflect.FieldDescriptor ) func init() { @@ -31,6 +32,7 @@ func init() { fd_MsgSetPower_from_address = md_MsgSetPower.Fields().ByName("from_address") fd_MsgSetPower_validator_address = md_MsgSetPower.Fields().ByName("validator_address") fd_MsgSetPower_power = md_MsgSetPower.Fields().ByName("power") + fd_MsgSetPower_unsafe = md_MsgSetPower.Fields().ByName("unsafe") } var _ protoreflect.Message = (*fastReflection_MsgSetPower)(nil) @@ -116,6 +118,12 @@ func (x *fastReflection_MsgSetPower) Range(f func(protoreflect.FieldDescriptor, return } } + if x.Unsafe != false { + value := protoreflect.ValueOfBool(x.Unsafe) + if !f(fd_MsgSetPower_unsafe, value) { + return + } + } } // Has reports whether a field is populated. @@ -137,6 +145,8 @@ func (x *fastReflection_MsgSetPower) Has(fd protoreflect.FieldDescriptor) bool { return x.ValidatorAddress != "" case "strangelove_ventures.poa.v1.MsgSetPower.power": return x.Power != uint64(0) + case "strangelove_ventures.poa.v1.MsgSetPower.unsafe": + return x.Unsafe != false default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.v1.MsgSetPower")) @@ -159,6 +169,8 @@ func (x *fastReflection_MsgSetPower) Clear(fd protoreflect.FieldDescriptor) { x.ValidatorAddress = "" case "strangelove_ventures.poa.v1.MsgSetPower.power": x.Power = uint64(0) + case "strangelove_ventures.poa.v1.MsgSetPower.unsafe": + x.Unsafe = false default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.v1.MsgSetPower")) @@ -184,6 +196,9 @@ func (x *fastReflection_MsgSetPower) Get(descriptor protoreflect.FieldDescriptor case "strangelove_ventures.poa.v1.MsgSetPower.power": value := x.Power return protoreflect.ValueOfUint64(value) + case "strangelove_ventures.poa.v1.MsgSetPower.unsafe": + value := x.Unsafe + return protoreflect.ValueOfBool(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.v1.MsgSetPower")) @@ -210,6 +225,8 @@ func (x *fastReflection_MsgSetPower) Set(fd protoreflect.FieldDescriptor, value x.ValidatorAddress = value.Interface().(string) case "strangelove_ventures.poa.v1.MsgSetPower.power": x.Power = value.Uint() + case "strangelove_ventures.poa.v1.MsgSetPower.unsafe": + x.Unsafe = value.Bool() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.v1.MsgSetPower")) @@ -236,6 +253,8 @@ func (x *fastReflection_MsgSetPower) Mutable(fd protoreflect.FieldDescriptor) pr panic(fmt.Errorf("field validator_address of message strangelove_ventures.poa.v1.MsgSetPower is not mutable")) case "strangelove_ventures.poa.v1.MsgSetPower.power": panic(fmt.Errorf("field power of message strangelove_ventures.poa.v1.MsgSetPower is not mutable")) + case "strangelove_ventures.poa.v1.MsgSetPower.unsafe": + panic(fmt.Errorf("field unsafe of message strangelove_ventures.poa.v1.MsgSetPower is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.v1.MsgSetPower")) @@ -255,6 +274,8 @@ func (x *fastReflection_MsgSetPower) NewField(fd protoreflect.FieldDescriptor) p return protoreflect.ValueOfString("") case "strangelove_ventures.poa.v1.MsgSetPower.power": return protoreflect.ValueOfUint64(uint64(0)) + case "strangelove_ventures.poa.v1.MsgSetPower.unsafe": + return protoreflect.ValueOfBool(false) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: strangelove_ventures.poa.v1.MsgSetPower")) @@ -335,6 +356,9 @@ func (x *fastReflection_MsgSetPower) ProtoMethods() *protoiface.Methods { if x.Power != 0 { n += 1 + runtime.Sov(uint64(x.Power)) } + if x.Unsafe { + n += 2 + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -364,6 +388,16 @@ func (x *fastReflection_MsgSetPower) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.Unsafe { + i-- + if x.Unsafe { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } if x.Power != 0 { i = runtime.EncodeVarint(dAtA, i, uint64(x.Power)) i-- @@ -515,6 +549,26 @@ func (x *fastReflection_MsgSetPower) ProtoMethods() *protoiface.Methods { break } } + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Unsafe", 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.Unsafe = bool(v != 0) default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -3764,6 +3818,7 @@ type MsgSetPower struct { FromAddress string `protobuf:"bytes,1,opt,name=from_address,json=fromAddress,proto3" json:"from_address,omitempty"` ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` Power uint64 `protobuf:"varint,3,opt,name=power,proto3" json:"power,omitempty"` + Unsafe bool `protobuf:"varint,4,opt,name=unsafe,proto3" json:"unsafe,omitempty"` } func (x *MsgSetPower) Reset() { @@ -3807,6 +3862,13 @@ func (x *MsgSetPower) GetPower() uint64 { return 0 } +func (x *MsgSetPower) GetUnsafe() bool { + if x != nil { + return x.Unsafe + } + return false +} + // MsgSetPowerResponse type MsgSetPowerResponse struct { state protoimpl.MessageState @@ -4113,7 +4175,7 @@ var file_strangelove_ventures_poa_v1_tx_proto_rawDesc = []byte{ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x73, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0xd6, 0x01, 0x0a, 0x0b, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x50, 0x6f, 0x77, + 0x74, 0x6f, 0x22, 0xee, 0x01, 0x0a, 0x0b, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x0c, 0x66, 0x72, 0x6f, 0x6d, 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, @@ -4123,124 +4185,125 @@ var file_strangelove_ventures_poa_v1_tx_proto_rawDesc = []byte{ 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x3a, 0x2d, 0x88, 0xa0, - 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x0c, 0x66, 0x72, 0x6f, 0x6d, 0x5f, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x8a, 0xe7, 0xb0, 0x2a, 0x0f, 0x70, 0x6f, 0x61, 0x2f, - 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x22, 0x15, 0x0a, 0x13, 0x4d, - 0x73, 0x67, 0x53, 0x65, 0x74, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0xce, 0x01, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, - 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x3b, 0x0a, 0x0c, 0x66, 0x72, 0x6f, - 0x6d, 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, 0x0b, 0x66, 0x72, 0x6f, 0x6d, 0x41, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x45, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x10, 0x76, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x34, 0x88, - 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x0c, 0x66, 0x72, 0x6f, 0x6d, - 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x8a, 0xe7, 0xb0, 0x2a, 0x16, 0x70, 0x6f, 0x61, - 0x2f, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x22, 0x1c, 0x0a, 0x1a, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, - 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0xa4, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x3b, 0x0a, 0x0c, 0x66, 0x72, 0x6f, 0x6d, 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, 0x0b, 0x66, 0x72, 0x6f, 0x6d, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x12, 0x41, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, - 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, - 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x11, 0x82, 0xe7, 0xb0, 0x2a, 0x0c, 0x66, 0x72, 0x6f, 0x6d, - 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 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, 0xc2, 0x04, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x55, 0x0a, 0x0b, 0x64, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x28, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, - 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, - 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x57, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, - 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, - 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x61, - 0x74, 0x65, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, - 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x60, 0x0a, 0x13, 0x6d, 0x69, - 0x6e, 0x5f, 0x73, 0x65, 0x6c, 0x66, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, - 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, - 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x49, 0x6e, 0x74, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x11, 0x6d, 0x69, 0x6e, 0x53, 0x65, - 0x6c, 0x66, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x47, 0x0a, 0x11, - 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1a, 0x18, 0x01, 0xd2, 0xb4, 0x2d, 0x14, 0x63, + 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, + 0x75, 0x6e, 0x73, 0x61, 0x66, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x75, 0x6e, + 0x73, 0x61, 0x66, 0x65, 0x3a, 0x2d, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, + 0xb0, 0x2a, 0x0c, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x8a, + 0xe7, 0xb0, 0x2a, 0x0f, 0x70, 0x6f, 0x61, 0x2f, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x50, 0x6f, + 0x77, 0x65, 0x72, 0x22, 0x15, 0x0a, 0x13, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x50, 0x6f, 0x77, + 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xce, 0x01, 0x0a, 0x12, 0x4d, + 0x73, 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x12, 0x3b, 0x0a, 0x0c, 0x66, 0x72, 0x6f, 0x6d, 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, 0x0b, 0x66, 0x72, 0x6f, 0x6d, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x45, + 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x52, 0x10, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x4e, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x21, 0xd2, 0xb4, 0x2d, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x56, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x46, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x42, 0x18, 0xca, 0xb4, 0x2d, - 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x50, - 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x3a, 0x39, 0x88, - 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x11, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x8a, 0xe7, 0xb0, - 0x2a, 0x16, 0x70, 0x6f, 0x61, 0x2f, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x22, 0x1c, 0x0a, 0x1a, 0x4d, 0x73, 0x67, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xe2, 0x03, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x7b, - 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x12, 0x2f, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, - 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x34, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, + 0xe7, 0xb0, 0x2a, 0x0c, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x8a, 0xe7, 0xb0, 0x2a, 0x16, 0x70, 0x6f, 0x61, 0x2f, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6d, 0x6f, + 0x76, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x22, 0x1c, 0x0a, 0x1a, 0x4d, + 0x73, 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xa4, 0x01, 0x0a, 0x0f, 0x4d, 0x73, + 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x3b, 0x0a, + 0x0c, 0x66, 0x72, 0x6f, 0x6d, 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, 0x0b, 0x66, + 0x72, 0x6f, 0x6d, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x41, 0x0a, 0x06, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x73, 0x74, 0x72, + 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, + 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, + 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x11, 0x82, + 0xe7, 0xb0, 0x2a, 0x0c, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 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, 0xc2, 0x04, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x1a, 0x37, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, - 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, - 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x66, 0x0a, 0x08, 0x53, - 0x65, 0x74, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x12, 0x28, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, + 0x6f, 0x72, 0x12, 0x55, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, - 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x50, 0x6f, 0x77, 0x65, - 0x72, 0x1a, 0x30, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, - 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, - 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x7b, 0x0a, 0x0f, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x56, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x2f, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, - 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, - 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x1a, 0x37, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, - 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, - 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x56, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x72, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x12, 0x2c, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, - 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x4d, - 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x34, + 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0b, 0x64, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x57, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, + 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, + 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, + 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, + 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x74, 0x65, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, + 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x12, 0x60, 0x0a, 0x13, 0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x65, 0x6c, 0x66, 0x5f, 0x64, + 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, + 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, + 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0xa8, 0xe7, 0xb0, 0x2a, + 0x01, 0x52, 0x11, 0x6d, 0x69, 0x6e, 0x53, 0x65, 0x6c, 0x66, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x47, 0x0a, 0x11, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, + 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x1a, 0x18, 0x01, 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, 0x10, 0x64, 0x65, 0x6c, + 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x4e, 0x0a, + 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xd2, 0xb4, 0x2d, 0x1d, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x10, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x46, 0x0a, + 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x41, 0x6e, 0x79, 0x42, 0x18, 0xca, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x06, 0x70, + 0x75, 0x62, 0x6b, 0x65, 0x79, 0x3a, 0x39, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, + 0xe7, 0xb0, 0x2a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x8a, 0xe7, 0xb0, 0x2a, 0x16, 0x70, 0x6f, 0x61, 0x2f, 0x4d, 0x73, + 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x22, 0x1c, 0x0a, 0x1a, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xe2, + 0x03, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x7b, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x2f, 0x2e, 0x73, 0x74, 0x72, 0x61, + 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, + 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x1a, 0x37, 0x2e, 0x73, 0x74, 0x72, + 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, + 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x66, 0x0a, 0x08, 0x53, 0x65, 0x74, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x12, + 0x28, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, + 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, + 0x67, 0x53, 0x65, 0x74, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x1a, 0x30, 0x2e, 0x73, 0x74, 0x72, 0x61, + 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, + 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x50, 0x6f, + 0x77, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7b, 0x0a, 0x0f, 0x52, + 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x2f, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xff, 0x01, 0x0a, 0x1f, - 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, - 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x42, - 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x49, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, - 0x76, 0x65, 0x2d, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2f, 0x70, 0x6f, 0x61, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, - 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2f, 0x70, 0x6f, 0x61, 0x2f, 0x76, 0x31, 0x3b, - 0x70, 0x6f, 0x61, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x50, 0x58, 0xaa, 0x02, 0x1a, 0x53, 0x74, - 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, - 0x73, 0x2e, 0x50, 0x6f, 0x61, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x1a, 0x53, 0x74, 0x72, 0x61, 0x6e, - 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x5c, 0x50, - 0x6f, 0x61, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x26, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, - 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x5c, 0x50, 0x6f, 0x61, 0x5c, - 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, - 0x1c, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, - 0x75, 0x72, 0x65, 0x73, 0x3a, 0x3a, 0x50, 0x6f, 0x61, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x1a, + 0x37, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, + 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, + 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x72, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x2c, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, + 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, + 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x34, 0x2e, 0x73, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, + 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x70, 0x6f, + 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, + 0xb0, 0x2a, 0x01, 0x42, 0xff, 0x01, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x74, 0x72, 0x61, + 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, + 0x2e, 0x70, 0x6f, 0x61, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x49, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, + 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x2d, 0x76, 0x65, 0x6e, 0x74, 0x75, + 0x72, 0x65, 0x73, 0x2f, 0x70, 0x6f, 0x61, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x74, 0x72, 0x61, + 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, + 0x2f, 0x70, 0x6f, 0x61, 0x2f, 0x76, 0x31, 0x3b, 0x70, 0x6f, 0x61, 0x76, 0x31, 0xa2, 0x02, 0x03, + 0x53, 0x50, 0x58, 0xaa, 0x02, 0x1a, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, + 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x50, 0x6f, 0x61, 0x2e, 0x56, 0x31, + 0xca, 0x02, 0x1a, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, + 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x5c, 0x50, 0x6f, 0x61, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x26, + 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, + 0x72, 0x65, 0x73, 0x5c, 0x50, 0x6f, 0x61, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1c, 0x53, 0x74, 0x72, 0x61, 0x6e, 0x67, 0x65, + 0x6c, 0x6f, 0x76, 0x65, 0x56, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x3a, 0x3a, 0x50, 0x6f, + 0x61, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/client/cli/tx.go b/client/cli/tx.go index e1ce43b..7a24d7c 100644 --- a/client/cli/tx.go +++ b/client/cli/tx.go @@ -45,7 +45,7 @@ func NewTxCmd(ac address.Codec) *cobra.Command { func NewSetPowerCmd(ac address.Codec) *cobra.Command { cmd := &cobra.Command{ - Use: "set-power [validator] [power]", + Use: "set-power [validator] [power] [--unsafe]", Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) @@ -64,10 +64,16 @@ func NewSetPowerCmd(ac address.Codec) *cobra.Command { return fmt.Errorf("strconv.ParseUint failed: %w", err) } + unsafeAction, err := cmd.Flags().GetBool("unsafe") + if err != nil { + return fmt.Errorf("get unsafe flag failed: %w", err) + } + msg := &poa.MsgSetPower{ FromAddress: clientCtx.GetFromAddress().String(), ValidatorAddress: validator, Power: power, + Unsafe: unsafeAction, } if err := msg.Validate(ac); err != nil { @@ -79,6 +85,7 @@ func NewSetPowerCmd(ac address.Codec) *cobra.Command { } flags.AddTxFlagsToCmd(cmd) + cmd.Flags().Bool("unsafe", false, "set power without checking if validator is in the validator set") return cmd } diff --git a/keeper/msg_server.go b/keeper/msg_server.go index e1127c9..a414d74 100644 --- a/keeper/msg_server.go +++ b/keeper/msg_server.go @@ -9,6 +9,7 @@ import ( cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/strangelove-ventures/poa" @@ -33,6 +34,10 @@ func (ms msgServer) SetPower(ctx context.Context, msg *poa.MsgSetPower) (*poa.Ms return nil, fmt.Errorf("not an authority") } + if err := msg.Validate(ms.k.validatorAddressCodec); err != nil { + return nil, err + } + isPending, err := ms.k.IsValidatorPending(ctx, msg.ValidatorAddress) if err != nil { return nil, err @@ -55,6 +60,18 @@ func (ms msgServer) SetPower(ctx context.Context, msg *poa.MsgSetPower) (*poa.Ms return nil, fmt.Errorf("GetValidator failed: %w", err) } + // if msg.Unsafe is true, we don't check the total power and set it. + if !msg.Unsafe { + totalPower, err := ms.getTotalChainPower(ctx) + if err != nil { + return nil, err + } + + if msg.Power > totalPower.Mul(math.NewInt(30)).Quo(math.NewInt(100)).Uint64() { + return nil, fmt.Errorf("unsafe: msg.Power is >30%% of total power, set unsafe=true to override") + } + } + // clean delegations up delegations, err := ms.k.stakingKeeper.GetValidatorDelegations(ctx, valAddr) if err != nil { @@ -72,8 +89,6 @@ func (ms msgServer) SetPower(ctx context.Context, msg *poa.MsgSetPower) (*poa.Ms Shares: math.LegacyNewDec(int64(msg.Power)), } - // TODO: Do not allow setting lower than 1_000_000 ? - // TODO: does this cause any invariance issues? val.DelegatorShares = delegation.Shares val.Tokens = math.NewIntFromUint64(msg.Power) val.Status = stakingtypes.Bonded @@ -85,6 +100,7 @@ func (ms msgServer) SetPower(ctx context.Context, msg *poa.MsgSetPower) (*poa.Ms if err := ms.k.stakingKeeper.SetValidator(ctx, val); err != nil { return nil, err } + ms.k.stakingKeeper.SetLastValidatorPower(ctx, valAddr, int64(msg.Power)) delegations, err = ms.k.stakingKeeper.GetValidatorDelegations(ctx, valAddr) if err != nil { @@ -95,6 +111,13 @@ func (ms msgServer) SetPower(ctx context.Context, msg *poa.MsgSetPower) (*poa.Ms return nil, fmt.Errorf("delegation error, expected 1, got %d", len(delegations)) } + // Update total power + totalPower, err := ms.getTotalChainPower(ctx) + if err != nil { + return nil, err + } + ms.k.stakingKeeper.SetLastTotalPower(ctx, totalPower) + return &poa.MsgSetPowerResponse{}, nil } @@ -110,6 +133,15 @@ func (ms msgServer) RemoveValidator(ctx context.Context, msg *poa.MsgRemoveValid return nil, fmt.Errorf("ValAddressFromBech32 failed: %w", err) } + // Ensure we do not remove the last validator in the set. + allValidators, err := ms.k.stakingKeeper.GetAllValidators(ctx) + if err != nil { + return nil, fmt.Errorf("GetAllValidators failed: %w", err) + } + if len(allValidators) == 1 { + return nil, fmt.Errorf("cannot remove the last validator") + } + if err := ms.clearValidator(ctx, valAddr); err != nil { return nil, fmt.Errorf("clearValidator failed: %w", err) } @@ -195,7 +227,7 @@ func (ms msgServer) CreateValidator(ctx context.Context, msg *poa.MsgCreateValid return nil, err } - validator.MinSelfDelegation = msg.MinSelfDelegation + validator.MinSelfDelegation = math.NewInt(1) // the validator is now pending approval to be let into the set. // Until then, they are not apart of the set. @@ -206,6 +238,16 @@ func (ms msgServer) CreateValidator(ctx context.Context, msg *poa.MsgCreateValid return &poa.MsgCreateValidatorResponse{}, nil } +func (ms msgServer) UpdateParams(ctx context.Context, msg *poa.MsgUpdateParams) (*poa.MsgUpdateParamsResponse, error) { + if ok, err := ms.isAdmin(ctx, msg.FromAddress); err != nil { + return nil, err + } else if !ok { + return nil, fmt.Errorf("not an authority") + } + + return &poa.MsgUpdateParamsResponse{}, ms.k.SetParams(ctx, msg.Params) +} + // takes in a validator address & sees if they are pending approval. // if so, we create them now. // TODO: use stakingtypes.Validator in GetPendingValidator? @@ -240,6 +282,23 @@ func (ms msgServer) acceptNewValidator(ctx context.Context, operatingAddress str return err } + cons, err := val.GetConsAddr() + if err != nil { + return err + } + + err = ms.k.slashKeeper.SetValidatorSigningInfo(ctx, sdk.ConsAddress(cons), slashingtypes.ValidatorSigningInfo{ + Address: sdk.ConsAddress(cons).String(), + StartHeight: sdkCtx.BlockHeight(), + IndexOffset: 0, + JailedUntil: sdkCtx.BlockHeader().Time, + Tombstoned: false, + MissedBlocksCounter: 0, + }) + if err != nil { + return err + } + // call the after-creation hook if err := ms.k.stakingKeeper.Hooks().AfterValidatorCreated(ctx, valAddr); err != nil { return err @@ -260,14 +319,18 @@ func (ms msgServer) acceptNewValidator(ctx context.Context, operatingAddress str return nil } -func (ms msgServer) UpdateParams(ctx context.Context, msg *poa.MsgUpdateParams) (*poa.MsgUpdateParamsResponse, error) { - if ok, err := ms.isAdmin(ctx, msg.FromAddress); err != nil { - return nil, err - } else if !ok { - return nil, fmt.Errorf("not an authority") +func (ms msgServer) getTotalChainPower(ctx context.Context) (math.Int, error) { + delSum := math.ZeroInt() + allDelegations, err := ms.k.stakingKeeper.GetAllDelegations(ctx) + if err != nil { + return math.ZeroInt(), err } - return &poa.MsgUpdateParamsResponse{}, ms.k.SetParams(ctx, msg.Params) + for _, del := range allDelegations { + delSum = delSum.Add(del.Shares.TruncateInt()) + } + + return delSum, nil } func (ms msgServer) clearValidator(ctx context.Context, valAddr sdk.ValAddress) error { @@ -294,12 +357,33 @@ func (ms msgServer) clearValidator(ctx context.Context, valAddr sdk.ValAddress) return fmt.Errorf("SetValidator failed: %w", err) } + if err := ms.k.stakingKeeper.DeleteLastValidatorPower(ctx, valAddr); err != nil { + return fmt.Errorf("DeleteLastValidatorPower failed: %w", err) + } + // Do we handle? or does the sdk do this (may need to wait until the next block?) // validator record not found for address: 67AE8730FE9C4A8E67FB699F61EEA7F90627B34F\n // if err := ms.k.stakingKeeper.RemoveValidator(ctx, valAddr); err != nil { // return fmt.Errorf("removevalidator failed: %w", err) // } + // remove from slashing keeper store? + cons, err := val.GetConsAddr() + if err != nil { + return fmt.Errorf("GetConsAddr failed: %w", err) + } + if err := ms.k.slashKeeper.DeleteMissedBlockBitmap(ctx, sdk.ConsAddress(cons)); err != nil { + return fmt.Errorf("DeleteMissedBlockBitmap failed: %w", err) + } + + if err := ms.k.slashKeeper.SetValidatorSigningInfo(ctx, sdk.ConsAddress(cons), slashingtypes.ValidatorSigningInfo{}); err != nil { + return fmt.Errorf("SetValidatorSigningInfo failed: %w", err) + } + + if err := ms.k.stakingKeeper.Jail(ctx, sdk.ConsAddress(cons)); err != nil { + return fmt.Errorf("jail failed: %w", err) + } + return nil } diff --git a/proto/strangelove_ventures/poa/v1/tx.proto b/proto/strangelove_ventures/poa/v1/tx.proto index ff4fefe..9958329 100644 --- a/proto/strangelove_ventures/poa/v1/tx.proto +++ b/proto/strangelove_ventures/poa/v1/tx.proto @@ -41,7 +41,8 @@ message MsgSetPower { string from_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - uint64 power = 3; + uint64 power = 3; + bool unsafe = 4; } // MsgSetPowerResponse message MsgSetPowerResponse {} diff --git a/simapp/test_node.sh b/simapp/test_node.sh index be0c040..d220695 100644 --- a/simapp/test_node.sh +++ b/simapp/test_node.sh @@ -4,7 +4,8 @@ # cd simapp # BINARY="poad" CHAIN_ID="poa-1" HOME_DIR="$HOME/.poad" TIMEOUT_COMMIT="500ms" CLEAN=true sh test_node.sh # -# poad tx poa set-power $(poad q staking validators --output=json | jq .validators[0].operator_address -r) 1230000 --home=$HOME_DIR --yes --from=acc1 +# this is actually safe since its only 12 validator +# poad tx poa set-power $(poad q staking validators --output=json | jq .validators[0].operator_address -r) 111222333444 --home=$HOME_DIR --yes --from=acc1 --unsafe # poad q staking validators # poad tx poa remove $(poad q staking validators --output=json | jq .validators[0].operator_address -r) --home=$HOME_DIR --yes --from=acc1 # @@ -14,7 +15,8 @@ # Create a validator # poad tx poa create-validator simapp/validator_file.json --from acc3 --yes --home=$HOME_DIR # no genesis amount # poad q poa pending-validators --output json -# poad tx poa set-power $(poad q poa pending-validators --output=json | jq .pending[0].operator_address -r) 123 --home=$HOME_DIR --yes --from=acc1 +# poad tx poa set-power $(poad q poa pending-validators --output=json | jq .pending[0].operator_address -r) 1000000 --home=$HOME_DIR --yes --from=acc1 +# poad q slashing signing-infos # poad tx poa remove $(poad q staking validators --output=json | jq .validators[1].operator_address -r) --home=$HOME_DIR --yes --from=acc1 export KEY="acc1" # validator @@ -95,7 +97,7 @@ from_scratch () { # Allocate genesis accounts # stake should ONLY be as much as they gentx with. No more. - BINARY genesis add-genesis-account $KEY 1000000stake,1000utest --keyring-backend $KEYRING + BINARY genesis add-genesis-account $KEY 100000000000000stake,1000utest --keyring-backend $KEYRING BINARY genesis add-genesis-account $KEY2 1000000stake,1000utest --keyring-backend $KEYRING # 1 power (these rates will be overwriten) diff --git a/tx.pb.go b/tx.pb.go index eae1dad..d8d96df 100644 --- a/tx.pb.go +++ b/tx.pb.go @@ -39,6 +39,7 @@ type MsgSetPower struct { FromAddress string `protobuf:"bytes,1,opt,name=from_address,json=fromAddress,proto3" json:"from_address,omitempty"` ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` Power uint64 `protobuf:"varint,3,opt,name=power,proto3" json:"power,omitempty"` + Unsafe bool `protobuf:"varint,4,opt,name=unsafe,proto3" json:"unsafe,omitempty"` } func (m *MsgSetPower) Reset() { *m = MsgSetPower{} } @@ -382,57 +383,58 @@ func init() { } var fileDescriptor_9035304c91ee78c4 = []byte{ - // 794 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x55, 0xc1, 0x4e, 0xdb, 0x4a, - 0x14, 0x8d, 0x5f, 0x42, 0xf4, 0x98, 0x20, 0x85, 0x98, 0xf0, 0x08, 0x7e, 0xef, 0x25, 0x34, 0x74, - 0x11, 0x51, 0x62, 0x13, 0x8a, 0x54, 0x35, 0x55, 0x17, 0x04, 0xda, 0x0a, 0x55, 0xa9, 0x90, 0x11, - 0x54, 0xea, 0x26, 0x9d, 0x24, 0x13, 0x63, 0x11, 0x7b, 0x2c, 0xcf, 0x24, 0x6d, 0xc4, 0xa6, 0xea, - 0xaa, 0xea, 0xaa, 0x9f, 0xc0, 0xa2, 0x8b, 0x2e, 0x59, 0xf0, 0x05, 0x5d, 0xa1, 0x2e, 0x2a, 0xc4, - 0xa2, 0xaa, 0xba, 0x40, 0x55, 0x58, 0xd0, 0xcf, 0xa8, 0x6c, 0x8f, 0x8d, 0x71, 0xc0, 0x29, 0xea, - 0xa6, 0x9b, 0x28, 0x33, 0x73, 0xee, 0xb9, 0xe7, 0xcc, 0xdc, 0x7b, 0x0d, 0x6e, 0x12, 0x6a, 0x42, - 0x5d, 0x41, 0x6d, 0xdc, 0x45, 0xb5, 0x2e, 0xd2, 0x69, 0xc7, 0x44, 0x44, 0x32, 0x30, 0x94, 0xba, - 0x25, 0x89, 0xbe, 0x14, 0x0d, 0x13, 0x53, 0xcc, 0xff, 0x7b, 0x19, 0x4a, 0x34, 0x30, 0x14, 0xbb, - 0x25, 0x21, 0xdb, 0xc0, 0x44, 0xc3, 0x44, 0xaa, 0x43, 0x82, 0xa4, 0x6e, 0xa9, 0x8e, 0x28, 0x2c, - 0x49, 0x0d, 0xac, 0xea, 0x4e, 0xb0, 0x70, 0x2b, 0x2c, 0x45, 0x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x14, 0xcd, 0x0f, - 0x23, 0xf2, 0xa3, 0x85, 0xa5, 0xeb, 0xa0, 0xdd, 0x9c, 0xc2, 0xc8, 0x2b, 0xab, 0x63, 0x2a, 0xf7, - 0x0f, 0xfb, 0x59, 0xee, 0xa8, 0x9f, 0xe5, 0xbe, 0xf7, 0xb3, 0xdc, 0xbb, 0xd3, 0x6c, 0xe4, 0xe8, - 0x34, 0x1b, 0xf9, 0x7a, 0x9a, 0x8d, 0x3c, 0x9b, 0x55, 0x54, 0xba, 0xdd, 0xa9, 0x8b, 0x0d, 0xac, - 0x49, 0xbe, 0x04, 0x45, 0xff, 0xf7, 0xba, 0x1e, 0xb7, 0x8b, 0xf5, 0xf6, 0xcf, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x42, 0x94, 0xb5, 0xe3, 0x62, 0x08, 0x00, 0x00, + // 807 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x55, 0x4f, 0x4f, 0x13, 0x4f, + 0x18, 0xee, 0xfe, 0x5a, 0x1a, 0x98, 0x92, 0x94, 0x2e, 0x05, 0xca, 0xfe, 0xb4, 0xc5, 0xe2, 0xa1, + 0x41, 0xba, 0x4b, 0x91, 0xc4, 0x58, 0xe3, 0x81, 0x82, 0x1a, 0x62, 0x6a, 0xc8, 0x12, 0x30, 0xf1, + 0x52, 0xa7, 0xed, 0x74, 0xd9, 0xd0, 0xdd, 0xd9, 0xec, 0x4c, 0xab, 0x0d, 0x17, 0xe3, 0xc9, 0x78, + 0xf2, 0x23, 0x70, 0xf0, 0xe0, 0x91, 0x03, 0x9f, 0xc0, 0x13, 0xf1, 0x60, 0x08, 0x27, 0xe3, 0x81, + 0x98, 0x72, 0xc0, 0x93, 0x9f, 0xc1, 0xec, 0xee, 0xec, 0xb2, 0x6c, 0xa1, 0x95, 0x78, 0xf1, 0xd2, + 0x74, 0x66, 0xde, 0xf7, 0x79, 0x9f, 0xe7, 0xfd, 0xb7, 0xe0, 0x36, 0xa1, 0x26, 0xd4, 0x15, 0xd4, + 0xc4, 0x6d, 0x54, 0x69, 0x23, 0x9d, 0xb6, 0x4c, 0x44, 0x24, 0x03, 0x43, 0xa9, 0x5d, 0x90, 0xe8, + 0x6b, 0xd1, 0x30, 0x31, 0xc5, 0xfc, 0xff, 0x97, 0x59, 0x89, 0x06, 0x86, 0x62, 0xbb, 0x20, 0xa4, + 0x6b, 0x98, 0x68, 0x98, 0x48, 0x55, 0x48, 0x90, 0xd4, 0x2e, 0x54, 0x11, 0x85, 0x05, 0xa9, 0x86, + 0x55, 0xdd, 0x71, 0x16, 0xee, 0xf4, 0x0b, 0xd1, 0x86, 0x4d, 0xb5, 0x0e, 0x29, 0x36, 0x99, 0x71, + 0xae, 0x9f, 0xb1, 0x01, 0x4d, 0xa8, 0x11, 0x66, 0x39, 0xed, 0x84, 0xad, 0xd8, 0x27, 0xc9, 0x39, + 0xb8, 0x4f, 0x0a, 0xc6, 0x4a, 0x13, 0x49, 0xf6, 0xa9, 0xda, 0x6a, 0x48, 0x50, 0xef, 0xb0, 0xa7, + 0xa4, 0x82, 0x15, 0xec, 0xb8, 0x58, 0xff, 0xd8, 0xed, 0x14, 0x93, 0xa0, 0x11, 0xc5, 0x8a, 0xa3, + 0x11, 0x85, 0x3d, 0x24, 0xa0, 0xa6, 0xea, 0x58, 0xb2, 0x7f, 0x9d, 0xab, 0xec, 0x2f, 0x0e, 0xc4, + 0xca, 0x44, 0xd9, 0x40, 0x74, 0x1d, 0xbf, 0x42, 0x26, 0xff, 0x00, 0x8c, 0x36, 0x4c, 0xac, 0x55, + 0x60, 0xbd, 0x6e, 0x22, 0x42, 0x52, 0xdc, 0x0c, 0x97, 0x1b, 0x29, 0xa5, 0x8e, 0x0f, 0xf2, 0x49, + 0x46, 0x6a, 0xd9, 0x79, 0xd9, 0xa0, 0xa6, 0xaa, 0x2b, 0x72, 0xcc, 0xb2, 0x66, 0x57, 0xfc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d, 0xbc, 0xef, + 0x9f, 0x8f, 0x5e, 0x8a, 0xfe, 0x21, 0x09, 0x74, 0x0b, 0x1b, 0x92, 0xc0, 0xad, 0xdb, 0x62, 0x8b, + 0xdd, 0x30, 0x08, 0x97, 0x89, 0xc2, 0xef, 0x82, 0x78, 0xb0, 0xcd, 0xa4, 0xbe, 0xb5, 0xef, 0xc5, + 0x14, 0xee, 0x5d, 0xd3, 0xc1, 0x25, 0xc1, 0x37, 0xc0, 0xb0, 0xb7, 0x9c, 0x73, 0x83, 0x40, 0x5c, + 0x4b, 0x61, 0xe1, 0x4f, 0x2d, 0xbd, 0x38, 0xbb, 0x20, 0x1e, 0x5c, 0x7e, 0x03, 0x45, 0x06, 0x1c, + 0x06, 0x8b, 0xbc, 0x62, 0x1d, 0xf1, 0x26, 0x18, 0xbd, 0xb0, 0x8a, 0xe6, 0x07, 0x01, 0xf9, 0xad, + 0x85, 0xa5, 0xeb, 0x58, 0xbb, 0x31, 0x85, 0xa1, 0x37, 0xd6, 0xc4, 0x94, 0x1e, 0x1e, 0x76, 0xd3, + 0xdc, 0x51, 0x37, 0xcd, 0xfd, 0xe8, 0xa6, 0xb9, 0x0f, 0xa7, 0xe9, 0xd0, 0xd1, 0x69, 0x3a, 0xf4, + 0xed, 0x34, 0x1d, 0x7a, 0x31, 0xab, 0xa8, 0x74, 0xbb, 0x55, 0x15, 0x6b, 0x58, 0x93, 0x7c, 0x01, + 0xf2, 0xfe, 0xef, 0x78, 0x35, 0x6a, 0x37, 0xeb, 0xdd, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x57, + 0xb8, 0x38, 0xef, 0x7a, 0x08, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -653,6 +655,16 @@ func (m *MsgSetPower) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Unsafe { + i-- + if m.Unsafe { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } if m.Power != 0 { i = encodeVarintTx(dAtA, i, uint64(m.Power)) i-- @@ -951,6 +963,9 @@ func (m *MsgSetPower) Size() (n int) { if m.Power != 0 { n += 1 + sovTx(uint64(m.Power)) } + if m.Unsafe { + n += 2 + } return n } @@ -1167,6 +1182,26 @@ func (m *MsgSetPower) Unmarshal(dAtA []byte) error { break } } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Unsafe", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Unsafe = bool(v != 0) default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:])