diff --git a/api/poktroll/application/application.pulsar.go b/api/poktroll/application/application.pulsar.go index 04b8048c5..71e0126ee 100644 --- a/api/poktroll/application/application.pulsar.go +++ b/api/poktroll/application/application.pulsar.go @@ -1589,7 +1589,7 @@ type Application struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // The Bech32 address of the application using cosmos' ScalarDescriptor to ensure deterministic encoding + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // The Bech32 address of the application. Stake *v1beta1.Coin `protobuf:"bytes,2,opt,name=stake,proto3" json:"stake,omitempty"` // The total amount of uPOKT the application has staked ServiceConfigs []*shared.ApplicationServiceConfig `protobuf:"bytes,3,rep,name=service_configs,json=serviceConfigs,proto3" json:"service_configs,omitempty"` // The list of services this appliccation is configured to request service for // TODO_BETA: Rename `delegatee_gateway_addresses` to `gateway_addresses_delegated_to`. diff --git a/api/poktroll/application/event.pulsar.go b/api/poktroll/application/event.pulsar.go index 6f5701306..49421e4b7 100644 --- a/api/poktroll/application/event.pulsar.go +++ b/api/poktroll/application/event.pulsar.go @@ -518,8 +518,8 @@ type EventRedelegation struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - AppAddress string `protobuf:"bytes,1,opt,name=app_address,json=appAddress,proto3" json:"app_address,omitempty"` // The Bech32 address of the application, using cosmos' ScalarDescriptor to ensure deterministic encoding - GatewayAddress string `protobuf:"bytes,2,opt,name=gateway_address,json=gatewayAddress,proto3" json:"gateway_address,omitempty"` // The Bech32 address of the gateway the application has changed their delegation of, using cosmos' ScalarDescriptor to ensure deterministic encoding + AppAddress string `protobuf:"bytes,1,opt,name=app_address,json=appAddress,proto3" json:"app_address,omitempty"` // The Bech32 address of the application. + GatewayAddress string `protobuf:"bytes,2,opt,name=gateway_address,json=gatewayAddress,proto3" json:"gateway_address,omitempty"` // The Bech32 address of the gateway the application has changed their delegation of. } func (x *EventRedelegation) Reset() { diff --git a/api/poktroll/application/tx.pulsar.go b/api/poktroll/application/tx.pulsar.go index 001bc03ec..957934846 100644 --- a/api/poktroll/application/tx.pulsar.go +++ b/api/poktroll/application/tx.pulsar.go @@ -4415,7 +4415,7 @@ type MsgStakeApplication struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // The Bech32 address of the application using cosmos' ScalarDescriptor to ensure deterministic encoding + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // The Bech32 address of the application. Stake *v1beta1.Coin `protobuf:"bytes,2,opt,name=stake,proto3" json:"stake,omitempty"` // The total amount of uPOKT the application has staked. Must be ≥ to the current amount that the application has staked (if any) Services []*shared.ApplicationServiceConfig `protobuf:"bytes,3,rep,name=services,proto3" json:"services,omitempty"` // The list of services this application is staked to request service for } @@ -4553,8 +4553,8 @@ type MsgDelegateToGateway struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - AppAddress string `protobuf:"bytes,1,opt,name=app_address,json=appAddress,proto3" json:"app_address,omitempty"` // The Bech32 address of the application using cosmos' ScalarDescriptor to ensure deterministic deterministic encoding using cosmos' ScalarDescriptor to ensure deterministic deterministic encoding - GatewayAddress string `protobuf:"bytes,2,opt,name=gateway_address,json=gatewayAddress,proto3" json:"gateway_address,omitempty"` // The Bech32 address of the gateway the application wants to delegate to using cosmos' ScalarDescriptor to ensure deterministic deterministic encoding using cosmos' ScalarDescriptor to ensure deterministic deterministic encoding + AppAddress string `protobuf:"bytes,1,opt,name=app_address,json=appAddress,proto3" json:"app_address,omitempty"` // The Bech32 address of the application. + GatewayAddress string `protobuf:"bytes,2,opt,name=gateway_address,json=gatewayAddress,proto3" json:"gateway_address,omitempty"` // The Bech32 address of the gateway the application wants to delegate to. } func (x *MsgDelegateToGateway) Reset() { @@ -4622,8 +4622,8 @@ type MsgUndelegateFromGateway struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - AppAddress string `protobuf:"bytes,1,opt,name=app_address,json=appAddress,proto3" json:"app_address,omitempty"` // The Bech32 address of the application using cosmos' ScalarDescriptor to ensure deterministic deterministic encoding using cosmos' ScalarDescriptor to ensure deterministic deterministic encoding - GatewayAddress string `protobuf:"bytes,2,opt,name=gateway_address,json=gatewayAddress,proto3" json:"gateway_address,omitempty"` // The Bech32 address of the gateway the application wants to undelegate from using cosmos' ScalarDescriptor to ensure deterministic deterministic encoding using cosmos' ScalarDescriptor to ensure deterministic deterministic encoding + AppAddress string `protobuf:"bytes,1,opt,name=app_address,json=appAddress,proto3" json:"app_address,omitempty"` // The Bech32 address of the application. + GatewayAddress string `protobuf:"bytes,2,opt,name=gateway_address,json=gatewayAddress,proto3" json:"gateway_address,omitempty"` // The Bech32 address of the gateway the application wants to undelegate from. } func (x *MsgUndelegateFromGateway) Reset() { diff --git a/api/poktroll/gateway/event.pulsar.go b/api/poktroll/gateway/event.pulsar.go index 37846aee9..2eef09840 100644 --- a/api/poktroll/gateway/event.pulsar.go +++ b/api/poktroll/gateway/event.pulsar.go @@ -452,7 +452,7 @@ type EventGatewayUnstaked struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // The Bech32 address of the gateway the application has changed their delegation of, using cosmos' ScalarDescriptor to ensure deterministic encoding + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // The Bech32 address of the gateway the application has changed their delegation of. } func (x *EventGatewayUnstaked) Reset() { diff --git a/api/poktroll/service/relay.pulsar.go b/api/poktroll/service/relay.pulsar.go index c8a3d78da..19b2cb531 100644 --- a/api/poktroll/service/relay.pulsar.go +++ b/api/poktroll/service/relay.pulsar.go @@ -2672,7 +2672,7 @@ type RelayRequestMetadata struct { // // The supplier address the relay is sent to. It is being used on the RelayMiner to // route to the correct supplier. - SupplierAddress string `protobuf:"bytes,3,opt,name=supplier_address,json=supplierAddress,proto3" json:"supplier_address,omitempty"` // The Bech32 address of the application, using cosmos' ScalarDescriptor to ensure deterministic encoding + SupplierAddress string `protobuf:"bytes,3,opt,name=supplier_address,json=supplierAddress,proto3" json:"supplier_address,omitempty"` // The Bech32 address of the application. } func (x *RelayRequestMetadata) Reset() { diff --git a/api/poktroll/service/tx.pulsar.go b/api/poktroll/service/tx.pulsar.go index bbce384f9..e082fb32b 100644 --- a/api/poktroll/service/tx.pulsar.go +++ b/api/poktroll/service/tx.pulsar.go @@ -1824,7 +1824,7 @@ type MsgAddService struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - OwnerAddress string `protobuf:"bytes,1,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty"` // The Bech32 address of the service owner using cosmos' ScalarDescriptor + OwnerAddress string `protobuf:"bytes,1,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty"` // The Bech32 address of the service owner. Service *shared.Service `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty"` // The Service being added to the network } diff --git a/api/poktroll/session/query.pulsar.go b/api/poktroll/session/query.pulsar.go index dc8b2cf41..95db86dc5 100644 --- a/api/poktroll/session/query.pulsar.go +++ b/api/poktroll/session/query.pulsar.go @@ -1873,7 +1873,7 @@ type QueryGetSessionRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ApplicationAddress string `protobuf:"bytes,1,opt,name=application_address,json=applicationAddress,proto3" json:"application_address,omitempty"` // The Bech32 address of the application using cosmos' ScalarDescriptor to ensure deterministic encoding + ApplicationAddress string `protobuf:"bytes,1,opt,name=application_address,json=applicationAddress,proto3" json:"application_address,omitempty"` // The Bech32 address of the application. Service *shared.Service `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty"` // The service to query the session for BlockHeight int64 `protobuf:"varint,3,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` // The block height to query the session for } diff --git a/api/poktroll/session/session.pulsar.go b/api/poktroll/session/session.pulsar.go index b4fad060b..1178c0f5a 100644 --- a/api/poktroll/session/session.pulsar.go +++ b/api/poktroll/session/session.pulsar.go @@ -1506,7 +1506,7 @@ type SessionHeader struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ApplicationAddress string `protobuf:"bytes,1,opt,name=application_address,json=applicationAddress,proto3" json:"application_address,omitempty"` // The Bech32 address of the application using cosmos' ScalarDescriptor to ensure deterministic encoding + ApplicationAddress string `protobuf:"bytes,1,opt,name=application_address,json=applicationAddress,proto3" json:"application_address,omitempty"` // The Bech32 address of the application. Service *shared.Service `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty"` // The service this session is for // NOTE: session_id can be derived from the above values using on-chain but is included in the header for convenience SessionId string `protobuf:"bytes,3,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` // A unique pseudoranom ID for this session diff --git a/api/poktroll/shared/supplier.pulsar.go b/api/poktroll/shared/supplier.pulsar.go index 051b3504f..5037ddf52 100644 --- a/api/poktroll/shared/supplier.pulsar.go +++ b/api/poktroll/shared/supplier.pulsar.go @@ -15,71 +15,71 @@ import ( sync "sync" ) -var _ protoreflect.List = (*_Supplier_3_list)(nil) +var _ protoreflect.List = (*_Supplier_4_list)(nil) -type _Supplier_3_list struct { +type _Supplier_4_list struct { list *[]*SupplierServiceConfig } -func (x *_Supplier_3_list) Len() int { +func (x *_Supplier_4_list) Len() int { if x.list == nil { return 0 } return len(*x.list) } -func (x *_Supplier_3_list) Get(i int) protoreflect.Value { +func (x *_Supplier_4_list) Get(i int) protoreflect.Value { return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) } -func (x *_Supplier_3_list) Set(i int, value protoreflect.Value) { +func (x *_Supplier_4_list) Set(i int, value protoreflect.Value) { valueUnwrapped := value.Message() concreteValue := valueUnwrapped.Interface().(*SupplierServiceConfig) (*x.list)[i] = concreteValue } -func (x *_Supplier_3_list) Append(value protoreflect.Value) { +func (x *_Supplier_4_list) Append(value protoreflect.Value) { valueUnwrapped := value.Message() concreteValue := valueUnwrapped.Interface().(*SupplierServiceConfig) *x.list = append(*x.list, concreteValue) } -func (x *_Supplier_3_list) AppendMutable() protoreflect.Value { +func (x *_Supplier_4_list) AppendMutable() protoreflect.Value { v := new(SupplierServiceConfig) *x.list = append(*x.list, v) return protoreflect.ValueOfMessage(v.ProtoReflect()) } -func (x *_Supplier_3_list) Truncate(n int) { +func (x *_Supplier_4_list) Truncate(n int) { for i := n; i < len(*x.list); i++ { (*x.list)[i] = nil } *x.list = (*x.list)[:n] } -func (x *_Supplier_3_list) NewElement() protoreflect.Value { +func (x *_Supplier_4_list) NewElement() protoreflect.Value { v := new(SupplierServiceConfig) return protoreflect.ValueOfMessage(v.ProtoReflect()) } -func (x *_Supplier_3_list) IsValid() bool { +func (x *_Supplier_4_list) IsValid() bool { return x.list != nil } -var _ protoreflect.Map = (*_Supplier_5_map)(nil) +var _ protoreflect.Map = (*_Supplier_6_map)(nil) -type _Supplier_5_map struct { +type _Supplier_6_map struct { m *map[string]uint64 } -func (x *_Supplier_5_map) Len() int { +func (x *_Supplier_6_map) Len() int { if x.m == nil { return 0 } return len(*x.m) } -func (x *_Supplier_5_map) Range(f func(protoreflect.MapKey, protoreflect.Value) bool) { +func (x *_Supplier_6_map) Range(f func(protoreflect.MapKey, protoreflect.Value) bool) { if x.m == nil { return } @@ -92,7 +92,7 @@ func (x *_Supplier_5_map) Range(f func(protoreflect.MapKey, protoreflect.Value) } } -func (x *_Supplier_5_map) Has(key protoreflect.MapKey) bool { +func (x *_Supplier_6_map) Has(key protoreflect.MapKey) bool { if x.m == nil { return false } @@ -102,7 +102,7 @@ func (x *_Supplier_5_map) Has(key protoreflect.MapKey) bool { return ok } -func (x *_Supplier_5_map) Clear(key protoreflect.MapKey) { +func (x *_Supplier_6_map) Clear(key protoreflect.MapKey) { if x.m == nil { return } @@ -111,7 +111,7 @@ func (x *_Supplier_5_map) Clear(key protoreflect.MapKey) { delete(*x.m, concreteKey) } -func (x *_Supplier_5_map) Get(key protoreflect.MapKey) protoreflect.Value { +func (x *_Supplier_6_map) Get(key protoreflect.MapKey) protoreflect.Value { if x.m == nil { return protoreflect.Value{} } @@ -124,7 +124,7 @@ func (x *_Supplier_5_map) Get(key protoreflect.MapKey) protoreflect.Value { return protoreflect.ValueOfUint64(v) } -func (x *_Supplier_5_map) Set(key protoreflect.MapKey, value protoreflect.Value) { +func (x *_Supplier_6_map) Set(key protoreflect.MapKey, value protoreflect.Value) { if !key.IsValid() || !value.IsValid() { panic("invalid key or value provided") } @@ -135,21 +135,22 @@ func (x *_Supplier_5_map) Set(key protoreflect.MapKey, value protoreflect.Value) (*x.m)[concreteKey] = concreteValue } -func (x *_Supplier_5_map) Mutable(key protoreflect.MapKey) protoreflect.Value { +func (x *_Supplier_6_map) Mutable(key protoreflect.MapKey) protoreflect.Value { panic("should not call Mutable on protoreflect.Map whose value is not of type protoreflect.Message") } -func (x *_Supplier_5_map) NewValue() protoreflect.Value { +func (x *_Supplier_6_map) NewValue() protoreflect.Value { v := uint64(0) return protoreflect.ValueOfUint64(v) } -func (x *_Supplier_5_map) IsValid() bool { +func (x *_Supplier_6_map) IsValid() bool { return x.m != nil } var ( md_Supplier protoreflect.MessageDescriptor + fd_Supplier_owner_address protoreflect.FieldDescriptor fd_Supplier_address protoreflect.FieldDescriptor fd_Supplier_stake protoreflect.FieldDescriptor fd_Supplier_services protoreflect.FieldDescriptor @@ -160,6 +161,7 @@ var ( func init() { file_poktroll_shared_supplier_proto_init() md_Supplier = File_poktroll_shared_supplier_proto.Messages().ByName("Supplier") + fd_Supplier_owner_address = md_Supplier.Fields().ByName("owner_address") fd_Supplier_address = md_Supplier.Fields().ByName("address") fd_Supplier_stake = md_Supplier.Fields().ByName("stake") fd_Supplier_services = md_Supplier.Fields().ByName("services") @@ -232,6 +234,12 @@ func (x *fastReflection_Supplier) Interface() protoreflect.ProtoMessage { // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_Supplier) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.OwnerAddress != "" { + value := protoreflect.ValueOfString(x.OwnerAddress) + if !f(fd_Supplier_owner_address, value) { + return + } + } if x.Address != "" { value := protoreflect.ValueOfString(x.Address) if !f(fd_Supplier_address, value) { @@ -245,7 +253,7 @@ func (x *fastReflection_Supplier) Range(f func(protoreflect.FieldDescriptor, pro } } if len(x.Services) != 0 { - value := protoreflect.ValueOfList(&_Supplier_3_list{list: &x.Services}) + value := protoreflect.ValueOfList(&_Supplier_4_list{list: &x.Services}) if !f(fd_Supplier_services, value) { return } @@ -257,7 +265,7 @@ func (x *fastReflection_Supplier) Range(f func(protoreflect.FieldDescriptor, pro } } if len(x.ServicesActivationHeightsMap) != 0 { - value := protoreflect.ValueOfMap(&_Supplier_5_map{m: &x.ServicesActivationHeightsMap}) + value := protoreflect.ValueOfMap(&_Supplier_6_map{m: &x.ServicesActivationHeightsMap}) if !f(fd_Supplier_services_activation_heights_map, value) { return } @@ -277,6 +285,8 @@ func (x *fastReflection_Supplier) Range(f func(protoreflect.FieldDescriptor, pro // a repeated field is populated if it is non-empty. func (x *fastReflection_Supplier) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { + case "poktroll.shared.Supplier.owner_address": + return x.OwnerAddress != "" case "poktroll.shared.Supplier.address": return x.Address != "" case "poktroll.shared.Supplier.stake": @@ -303,6 +313,8 @@ func (x *fastReflection_Supplier) Has(fd protoreflect.FieldDescriptor) bool { // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Supplier) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { + case "poktroll.shared.Supplier.owner_address": + x.OwnerAddress = "" case "poktroll.shared.Supplier.address": x.Address = "" case "poktroll.shared.Supplier.stake": @@ -329,6 +341,9 @@ func (x *fastReflection_Supplier) Clear(fd protoreflect.FieldDescriptor) { // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_Supplier) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { + case "poktroll.shared.Supplier.owner_address": + value := x.OwnerAddress + return protoreflect.ValueOfString(value) case "poktroll.shared.Supplier.address": value := x.Address return protoreflect.ValueOfString(value) @@ -337,18 +352,18 @@ func (x *fastReflection_Supplier) Get(descriptor protoreflect.FieldDescriptor) p return protoreflect.ValueOfMessage(value.ProtoReflect()) case "poktroll.shared.Supplier.services": if len(x.Services) == 0 { - return protoreflect.ValueOfList(&_Supplier_3_list{}) + return protoreflect.ValueOfList(&_Supplier_4_list{}) } - listValue := &_Supplier_3_list{list: &x.Services} + listValue := &_Supplier_4_list{list: &x.Services} return protoreflect.ValueOfList(listValue) case "poktroll.shared.Supplier.unstake_session_end_height": value := x.UnstakeSessionEndHeight return protoreflect.ValueOfUint64(value) case "poktroll.shared.Supplier.services_activation_heights_map": if len(x.ServicesActivationHeightsMap) == 0 { - return protoreflect.ValueOfMap(&_Supplier_5_map{}) + return protoreflect.ValueOfMap(&_Supplier_6_map{}) } - mapValue := &_Supplier_5_map{m: &x.ServicesActivationHeightsMap} + mapValue := &_Supplier_6_map{m: &x.ServicesActivationHeightsMap} return protoreflect.ValueOfMap(mapValue) default: if descriptor.IsExtension() { @@ -370,19 +385,21 @@ func (x *fastReflection_Supplier) Get(descriptor protoreflect.FieldDescriptor) p // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Supplier) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { + case "poktroll.shared.Supplier.owner_address": + x.OwnerAddress = value.Interface().(string) case "poktroll.shared.Supplier.address": x.Address = value.Interface().(string) case "poktroll.shared.Supplier.stake": x.Stake = value.Message().Interface().(*v1beta1.Coin) case "poktroll.shared.Supplier.services": lv := value.List() - clv := lv.(*_Supplier_3_list) + clv := lv.(*_Supplier_4_list) x.Services = *clv.list case "poktroll.shared.Supplier.unstake_session_end_height": x.UnstakeSessionEndHeight = value.Uint() case "poktroll.shared.Supplier.services_activation_heights_map": mv := value.Map() - cmv := mv.(*_Supplier_5_map) + cmv := mv.(*_Supplier_6_map) x.ServicesActivationHeightsMap = *cmv.m default: if fd.IsExtension() { @@ -413,14 +430,16 @@ func (x *fastReflection_Supplier) Mutable(fd protoreflect.FieldDescriptor) proto if x.Services == nil { x.Services = []*SupplierServiceConfig{} } - value := &_Supplier_3_list{list: &x.Services} + value := &_Supplier_4_list{list: &x.Services} return protoreflect.ValueOfList(value) case "poktroll.shared.Supplier.services_activation_heights_map": if x.ServicesActivationHeightsMap == nil { x.ServicesActivationHeightsMap = make(map[string]uint64) } - value := &_Supplier_5_map{m: &x.ServicesActivationHeightsMap} + value := &_Supplier_6_map{m: &x.ServicesActivationHeightsMap} return protoreflect.ValueOfMap(value) + case "poktroll.shared.Supplier.owner_address": + panic(fmt.Errorf("field owner_address of message poktroll.shared.Supplier is not mutable")) case "poktroll.shared.Supplier.address": panic(fmt.Errorf("field address of message poktroll.shared.Supplier is not mutable")) case "poktroll.shared.Supplier.unstake_session_end_height": @@ -438,6 +457,8 @@ func (x *fastReflection_Supplier) Mutable(fd protoreflect.FieldDescriptor) proto // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_Supplier) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "poktroll.shared.Supplier.owner_address": + return protoreflect.ValueOfString("") case "poktroll.shared.Supplier.address": return protoreflect.ValueOfString("") case "poktroll.shared.Supplier.stake": @@ -445,12 +466,12 @@ func (x *fastReflection_Supplier) NewField(fd protoreflect.FieldDescriptor) prot return protoreflect.ValueOfMessage(m.ProtoReflect()) case "poktroll.shared.Supplier.services": list := []*SupplierServiceConfig{} - return protoreflect.ValueOfList(&_Supplier_3_list{list: &list}) + return protoreflect.ValueOfList(&_Supplier_4_list{list: &list}) case "poktroll.shared.Supplier.unstake_session_end_height": return protoreflect.ValueOfUint64(uint64(0)) case "poktroll.shared.Supplier.services_activation_heights_map": m := make(map[string]uint64) - return protoreflect.ValueOfMap(&_Supplier_5_map{m: &m}) + return protoreflect.ValueOfMap(&_Supplier_6_map{m: &m}) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.Supplier")) @@ -520,6 +541,10 @@ func (x *fastReflection_Supplier) ProtoMethods() *protoiface.Methods { var n int var l int _ = l + l = len(x.OwnerAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } l = len(x.Address) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) @@ -600,7 +625,7 @@ func (x *fastReflection_Supplier) ProtoMethods() *protoiface.Methods { dAtA[i] = 0xa i = runtime.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- - dAtA[i] = 0x2a + dAtA[i] = 0x32 return protoiface.MarshalOutput{}, nil } if options.Deterministic { @@ -631,7 +656,7 @@ func (x *fastReflection_Supplier) ProtoMethods() *protoiface.Methods { if x.UnstakeSessionEndHeight != 0 { i = runtime.EncodeVarint(dAtA, i, uint64(x.UnstakeSessionEndHeight)) i-- - dAtA[i] = 0x20 + dAtA[i] = 0x28 } if len(x.Services) > 0 { for iNdEx := len(x.Services) - 1; iNdEx >= 0; iNdEx-- { @@ -646,7 +671,7 @@ func (x *fastReflection_Supplier) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x22 } } if x.Stake != nil { @@ -661,13 +686,20 @@ func (x *fastReflection_Supplier) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a } if len(x.Address) > 0 { i -= len(x.Address) copy(dAtA[i:], x.Address) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) i-- + dAtA[i] = 0x12 + } + if len(x.OwnerAddress) > 0 { + i -= len(x.OwnerAddress) + copy(dAtA[i:], x.OwnerAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.OwnerAddress))) + i-- dAtA[i] = 0xa } if input.Buf != nil { @@ -720,6 +752,38 @@ func (x *fastReflection_Supplier) ProtoMethods() *protoiface.Methods { } switch fieldNum { case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field OwnerAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.OwnerAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) } @@ -751,7 +815,7 @@ func (x *fastReflection_Supplier) ProtoMethods() *protoiface.Methods { } x.Address = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 3: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Stake", wireType) } @@ -787,7 +851,7 @@ func (x *fastReflection_Supplier) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 3: + case 4: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Services", wireType) } @@ -821,7 +885,7 @@ func (x *fastReflection_Supplier) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 4: + case 5: if wireType != 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field UnstakeSessionEndHeight", wireType) } @@ -840,7 +904,7 @@ func (x *fastReflection_Supplier) ProtoMethods() *protoiface.Methods { break } } - case 5: + case 6: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ServicesActivationHeightsMap", wireType) } @@ -1007,16 +1071,26 @@ type Supplier struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // The Bech32 address of the supplier using cosmos' ScalarDescriptor to ensure deterministic encoding - Stake *v1beta1.Coin `protobuf:"bytes,2,opt,name=stake,proto3" json:"stake,omitempty"` // The total amount of uPOKT the supplier has staked - Services []*SupplierServiceConfig `protobuf:"bytes,3,rep,name=services,proto3" json:"services,omitempty"` // The service configs this supplier can support + // The address of the owner (i.e. staker, custodial) that owns the funds for staking. + // By default, this address is the one that receives all the rewards unless owtherwise specified. + // This property cannot be updated by the operator. + OwnerAddress string `protobuf:"bytes,1,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty"` // Bech32 cosmos address + // The address of the supplier operator (i.e. the one managing the off-chain server). + // The operator address can update the supplier's configurations excluding the owner address. + // This property does not change over the supplier's lifespan, the supplier must be unstaked + // and re-staked to effectively update this value. + // TODO(#722): Rename this to `operator_address` including all downstream + // variables, comments, docs, tests, etc... + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` // Bech32 cosmos address + Stake *v1beta1.Coin `protobuf:"bytes,3,opt,name=stake,proto3" json:"stake,omitempty"` // The total amount of uPOKT the supplier has staked + Services []*SupplierServiceConfig `protobuf:"bytes,4,rep,name=services,proto3" json:"services,omitempty"` // The service configs this supplier can support // The session end height at which an actively unbonding supplier unbonds its stake. // If the supplier did not unstake, this value will be 0. - UnstakeSessionEndHeight uint64 `protobuf:"varint,4,opt,name=unstake_session_end_height,json=unstakeSessionEndHeight,proto3" json:"unstake_session_end_height,omitempty"` + UnstakeSessionEndHeight uint64 `protobuf:"varint,5,opt,name=unstake_session_end_height,json=unstakeSessionEndHeight,proto3" json:"unstake_session_end_height,omitempty"` // services_activation_heights_map is a map of serviceIds to the height at // which the staked supplier will become active for that service. // Activation heights are session start heights. - ServicesActivationHeightsMap map[string]uint64 `protobuf:"bytes,5,rep,name=services_activation_heights_map,json=servicesActivationHeightsMap,proto3" json:"services_activation_heights_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + ServicesActivationHeightsMap map[string]uint64 `protobuf:"bytes,6,rep,name=services_activation_heights_map,json=servicesActivationHeightsMap,proto3" json:"services_activation_heights_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` } func (x *Supplier) Reset() { @@ -1039,6 +1113,13 @@ func (*Supplier) Descriptor() ([]byte, []int) { return file_poktroll_shared_supplier_proto_rawDescGZIP(), []int{0} } +func (x *Supplier) GetOwnerAddress() string { + if x != nil { + return x.OwnerAddress + } + return "" +} + func (x *Supplier) GetAddress() string { if x != nil { return x.Address @@ -1085,47 +1166,51 @@ var file_poktroll_shared_supplier_proto_rawDesc = []byte{ 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, 0x1a, 0x1d, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2f, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc6, 0x03, 0x0a, 0x08, - 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x07, 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, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x2f, 0x0a, 0x05, - 0x73, 0x74, 0x61, 0x6b, 0x65, 0x18, 0x02, 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, 0x52, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x42, 0x0a, - 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x26, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, - 0x64, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x12, 0x3b, 0x0a, 0x1a, 0x75, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x5f, 0x73, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x17, 0x75, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x64, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x82, - 0x01, 0x0a, 0x1f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x5f, 0x61, 0x63, 0x74, 0x69, - 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x5f, 0x6d, - 0x61, 0x70, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, - 0x69, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x41, 0x63, 0x74, 0x69, - 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x4d, 0x61, 0x70, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x1c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x41, - 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, - 0x4d, 0x61, 0x70, 0x1a, 0x4f, 0x0a, 0x21, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x41, - 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, - 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x3a, 0x02, 0x38, 0x01, 0x42, 0xa3, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x42, 0x0d, 0x53, 0x75, - 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x20, 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, 0x68, 0x61, 0x72, 0x65, 0x64, 0xa2, - 0x02, 0x03, 0x50, 0x53, 0x58, 0xaa, 0x02, 0x0f, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x2e, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0xca, 0x02, 0x0f, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x5c, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0xe2, 0x02, 0x1b, 0x50, 0x6f, 0x6b, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0x5c, 0x47, 0x50, 0x42, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x3a, 0x3a, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x85, 0x04, 0x0a, 0x08, + 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 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, 0x32, 0x0a, 0x07, 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, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x2f, 0x0a, 0x05, 0x73, + 0x74, 0x61, 0x6b, 0x65, 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, 0x52, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x42, 0x0a, 0x08, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, + 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, + 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, + 0x12, 0x3b, 0x0a, 0x1a, 0x75, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x5f, 0x73, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x17, 0x75, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x64, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x82, 0x01, + 0x0a, 0x1f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x5f, 0x6d, 0x61, + 0x70, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, + 0x65, 0x72, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x41, 0x63, 0x74, 0x69, 0x76, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x4d, 0x61, 0x70, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x52, 0x1c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x41, 0x63, + 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x4d, + 0x61, 0x70, 0x1a, 0x4f, 0x0a, 0x21, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x41, 0x63, + 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x4d, + 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x42, 0xa3, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x42, 0x0d, 0x53, 0x75, 0x70, + 0x70, 0x6c, 0x69, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x20, 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, 0x68, 0x61, 0x72, 0x65, 0x64, 0xa2, 0x02, + 0x03, 0x50, 0x53, 0x58, 0xaa, 0x02, 0x0f, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, + 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0xca, 0x02, 0x0f, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x5c, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0xe2, 0x02, 0x1b, 0x50, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x3a, 0x3a, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( diff --git a/api/poktroll/supplier/tx.pulsar.go b/api/poktroll/supplier/tx.pulsar.go index d35e3f491..8c74573e5 100644 --- a/api/poktroll/supplier/tx.pulsar.go +++ b/api/poktroll/supplier/tx.pulsar.go @@ -873,67 +873,71 @@ func (x *fastReflection_MsgUpdateParamsResponse) ProtoMethods() *protoiface.Meth } } -var _ protoreflect.List = (*_MsgStakeSupplier_3_list)(nil) +var _ protoreflect.List = (*_MsgStakeSupplier_5_list)(nil) -type _MsgStakeSupplier_3_list struct { +type _MsgStakeSupplier_5_list struct { list *[]*shared.SupplierServiceConfig } -func (x *_MsgStakeSupplier_3_list) Len() int { +func (x *_MsgStakeSupplier_5_list) Len() int { if x.list == nil { return 0 } return len(*x.list) } -func (x *_MsgStakeSupplier_3_list) Get(i int) protoreflect.Value { +func (x *_MsgStakeSupplier_5_list) Get(i int) protoreflect.Value { return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) } -func (x *_MsgStakeSupplier_3_list) Set(i int, value protoreflect.Value) { +func (x *_MsgStakeSupplier_5_list) Set(i int, value protoreflect.Value) { valueUnwrapped := value.Message() concreteValue := valueUnwrapped.Interface().(*shared.SupplierServiceConfig) (*x.list)[i] = concreteValue } -func (x *_MsgStakeSupplier_3_list) Append(value protoreflect.Value) { +func (x *_MsgStakeSupplier_5_list) Append(value protoreflect.Value) { valueUnwrapped := value.Message() concreteValue := valueUnwrapped.Interface().(*shared.SupplierServiceConfig) *x.list = append(*x.list, concreteValue) } -func (x *_MsgStakeSupplier_3_list) AppendMutable() protoreflect.Value { +func (x *_MsgStakeSupplier_5_list) AppendMutable() protoreflect.Value { v := new(shared.SupplierServiceConfig) *x.list = append(*x.list, v) return protoreflect.ValueOfMessage(v.ProtoReflect()) } -func (x *_MsgStakeSupplier_3_list) Truncate(n int) { +func (x *_MsgStakeSupplier_5_list) Truncate(n int) { for i := n; i < len(*x.list); i++ { (*x.list)[i] = nil } *x.list = (*x.list)[:n] } -func (x *_MsgStakeSupplier_3_list) NewElement() protoreflect.Value { +func (x *_MsgStakeSupplier_5_list) NewElement() protoreflect.Value { v := new(shared.SupplierServiceConfig) return protoreflect.ValueOfMessage(v.ProtoReflect()) } -func (x *_MsgStakeSupplier_3_list) IsValid() bool { +func (x *_MsgStakeSupplier_5_list) IsValid() bool { return x.list != nil } var ( - md_MsgStakeSupplier protoreflect.MessageDescriptor - fd_MsgStakeSupplier_address protoreflect.FieldDescriptor - fd_MsgStakeSupplier_stake protoreflect.FieldDescriptor - fd_MsgStakeSupplier_services protoreflect.FieldDescriptor + md_MsgStakeSupplier protoreflect.MessageDescriptor + fd_MsgStakeSupplier_signer protoreflect.FieldDescriptor + fd_MsgStakeSupplier_owner_address protoreflect.FieldDescriptor + fd_MsgStakeSupplier_address protoreflect.FieldDescriptor + fd_MsgStakeSupplier_stake protoreflect.FieldDescriptor + fd_MsgStakeSupplier_services protoreflect.FieldDescriptor ) func init() { file_poktroll_supplier_tx_proto_init() md_MsgStakeSupplier = File_poktroll_supplier_tx_proto.Messages().ByName("MsgStakeSupplier") + fd_MsgStakeSupplier_signer = md_MsgStakeSupplier.Fields().ByName("signer") + fd_MsgStakeSupplier_owner_address = md_MsgStakeSupplier.Fields().ByName("owner_address") fd_MsgStakeSupplier_address = md_MsgStakeSupplier.Fields().ByName("address") fd_MsgStakeSupplier_stake = md_MsgStakeSupplier.Fields().ByName("stake") fd_MsgStakeSupplier_services = md_MsgStakeSupplier.Fields().ByName("services") @@ -1004,6 +1008,18 @@ func (x *fastReflection_MsgStakeSupplier) Interface() protoreflect.ProtoMessage // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_MsgStakeSupplier) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Signer != "" { + value := protoreflect.ValueOfString(x.Signer) + if !f(fd_MsgStakeSupplier_signer, value) { + return + } + } + if x.OwnerAddress != "" { + value := protoreflect.ValueOfString(x.OwnerAddress) + if !f(fd_MsgStakeSupplier_owner_address, value) { + return + } + } if x.Address != "" { value := protoreflect.ValueOfString(x.Address) if !f(fd_MsgStakeSupplier_address, value) { @@ -1017,7 +1033,7 @@ func (x *fastReflection_MsgStakeSupplier) Range(f func(protoreflect.FieldDescrip } } if len(x.Services) != 0 { - value := protoreflect.ValueOfList(&_MsgStakeSupplier_3_list{list: &x.Services}) + value := protoreflect.ValueOfList(&_MsgStakeSupplier_5_list{list: &x.Services}) if !f(fd_MsgStakeSupplier_services, value) { return } @@ -1037,6 +1053,10 @@ func (x *fastReflection_MsgStakeSupplier) Range(f func(protoreflect.FieldDescrip // a repeated field is populated if it is non-empty. func (x *fastReflection_MsgStakeSupplier) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { + case "poktroll.supplier.MsgStakeSupplier.signer": + return x.Signer != "" + case "poktroll.supplier.MsgStakeSupplier.owner_address": + return x.OwnerAddress != "" case "poktroll.supplier.MsgStakeSupplier.address": return x.Address != "" case "poktroll.supplier.MsgStakeSupplier.stake": @@ -1059,6 +1079,10 @@ func (x *fastReflection_MsgStakeSupplier) Has(fd protoreflect.FieldDescriptor) b // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgStakeSupplier) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { + case "poktroll.supplier.MsgStakeSupplier.signer": + x.Signer = "" + case "poktroll.supplier.MsgStakeSupplier.owner_address": + x.OwnerAddress = "" case "poktroll.supplier.MsgStakeSupplier.address": x.Address = "" case "poktroll.supplier.MsgStakeSupplier.stake": @@ -1081,6 +1105,12 @@ func (x *fastReflection_MsgStakeSupplier) Clear(fd protoreflect.FieldDescriptor) // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_MsgStakeSupplier) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { + case "poktroll.supplier.MsgStakeSupplier.signer": + value := x.Signer + return protoreflect.ValueOfString(value) + case "poktroll.supplier.MsgStakeSupplier.owner_address": + value := x.OwnerAddress + return protoreflect.ValueOfString(value) case "poktroll.supplier.MsgStakeSupplier.address": value := x.Address return protoreflect.ValueOfString(value) @@ -1089,9 +1119,9 @@ func (x *fastReflection_MsgStakeSupplier) Get(descriptor protoreflect.FieldDescr return protoreflect.ValueOfMessage(value.ProtoReflect()) case "poktroll.supplier.MsgStakeSupplier.services": if len(x.Services) == 0 { - return protoreflect.ValueOfList(&_MsgStakeSupplier_3_list{}) + return protoreflect.ValueOfList(&_MsgStakeSupplier_5_list{}) } - listValue := &_MsgStakeSupplier_3_list{list: &x.Services} + listValue := &_MsgStakeSupplier_5_list{list: &x.Services} return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { @@ -1113,13 +1143,17 @@ func (x *fastReflection_MsgStakeSupplier) Get(descriptor protoreflect.FieldDescr // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgStakeSupplier) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { + case "poktroll.supplier.MsgStakeSupplier.signer": + x.Signer = value.Interface().(string) + case "poktroll.supplier.MsgStakeSupplier.owner_address": + x.OwnerAddress = value.Interface().(string) case "poktroll.supplier.MsgStakeSupplier.address": x.Address = value.Interface().(string) case "poktroll.supplier.MsgStakeSupplier.stake": x.Stake = value.Message().Interface().(*v1beta1.Coin) case "poktroll.supplier.MsgStakeSupplier.services": lv := value.List() - clv := lv.(*_MsgStakeSupplier_3_list) + clv := lv.(*_MsgStakeSupplier_5_list) x.Services = *clv.list default: if fd.IsExtension() { @@ -1150,8 +1184,12 @@ func (x *fastReflection_MsgStakeSupplier) Mutable(fd protoreflect.FieldDescripto if x.Services == nil { x.Services = []*shared.SupplierServiceConfig{} } - value := &_MsgStakeSupplier_3_list{list: &x.Services} + value := &_MsgStakeSupplier_5_list{list: &x.Services} return protoreflect.ValueOfList(value) + case "poktroll.supplier.MsgStakeSupplier.signer": + panic(fmt.Errorf("field signer of message poktroll.supplier.MsgStakeSupplier is not mutable")) + case "poktroll.supplier.MsgStakeSupplier.owner_address": + panic(fmt.Errorf("field owner_address of message poktroll.supplier.MsgStakeSupplier is not mutable")) case "poktroll.supplier.MsgStakeSupplier.address": panic(fmt.Errorf("field address of message poktroll.supplier.MsgStakeSupplier is not mutable")) default: @@ -1167,6 +1205,10 @@ func (x *fastReflection_MsgStakeSupplier) Mutable(fd protoreflect.FieldDescripto // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_MsgStakeSupplier) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "poktroll.supplier.MsgStakeSupplier.signer": + return protoreflect.ValueOfString("") + case "poktroll.supplier.MsgStakeSupplier.owner_address": + return protoreflect.ValueOfString("") case "poktroll.supplier.MsgStakeSupplier.address": return protoreflect.ValueOfString("") case "poktroll.supplier.MsgStakeSupplier.stake": @@ -1174,7 +1216,7 @@ func (x *fastReflection_MsgStakeSupplier) NewField(fd protoreflect.FieldDescript return protoreflect.ValueOfMessage(m.ProtoReflect()) case "poktroll.supplier.MsgStakeSupplier.services": list := []*shared.SupplierServiceConfig{} - return protoreflect.ValueOfList(&_MsgStakeSupplier_3_list{list: &list}) + return protoreflect.ValueOfList(&_MsgStakeSupplier_5_list{list: &list}) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgStakeSupplier")) @@ -1244,6 +1286,14 @@ func (x *fastReflection_MsgStakeSupplier) ProtoMethods() *protoiface.Methods { var n int var l int _ = l + l = len(x.Signer) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.OwnerAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } l = len(x.Address) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) @@ -1300,7 +1350,7 @@ func (x *fastReflection_MsgStakeSupplier) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x2a } } if x.Stake != nil { @@ -1315,13 +1365,27 @@ func (x *fastReflection_MsgStakeSupplier) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x22 } if len(x.Address) > 0 { i -= len(x.Address) copy(dAtA[i:], x.Address) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) i-- + dAtA[i] = 0x1a + } + if len(x.OwnerAddress) > 0 { + i -= len(x.OwnerAddress) + copy(dAtA[i:], x.OwnerAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.OwnerAddress))) + i-- + dAtA[i] = 0x12 + } + if len(x.Signer) > 0 { + i -= len(x.Signer) + copy(dAtA[i:], x.Signer) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Signer))) + i-- dAtA[i] = 0xa } if input.Buf != nil { @@ -1374,6 +1438,70 @@ func (x *fastReflection_MsgStakeSupplier) ProtoMethods() *protoiface.Methods { } switch fieldNum { case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field OwnerAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.OwnerAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) } @@ -1405,7 +1533,7 @@ func (x *fastReflection_MsgStakeSupplier) ProtoMethods() *protoiface.Methods { } x.Address = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 4: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Stake", wireType) } @@ -1441,7 +1569,7 @@ func (x *fastReflection_MsgStakeSupplier) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 3: + case 5: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Services", wireType) } @@ -1868,12 +1996,14 @@ func (x *fastReflection_MsgStakeSupplierResponse) ProtoMethods() *protoiface.Met var ( md_MsgUnstakeSupplier protoreflect.MessageDescriptor + fd_MsgUnstakeSupplier_signer protoreflect.FieldDescriptor fd_MsgUnstakeSupplier_address protoreflect.FieldDescriptor ) func init() { file_poktroll_supplier_tx_proto_init() md_MsgUnstakeSupplier = File_poktroll_supplier_tx_proto.Messages().ByName("MsgUnstakeSupplier") + fd_MsgUnstakeSupplier_signer = md_MsgUnstakeSupplier.Fields().ByName("signer") fd_MsgUnstakeSupplier_address = md_MsgUnstakeSupplier.Fields().ByName("address") } @@ -1942,6 +2072,12 @@ func (x *fastReflection_MsgUnstakeSupplier) Interface() protoreflect.ProtoMessag // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_MsgUnstakeSupplier) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Signer != "" { + value := protoreflect.ValueOfString(x.Signer) + if !f(fd_MsgUnstakeSupplier_signer, value) { + return + } + } if x.Address != "" { value := protoreflect.ValueOfString(x.Address) if !f(fd_MsgUnstakeSupplier_address, value) { @@ -1963,6 +2099,8 @@ func (x *fastReflection_MsgUnstakeSupplier) Range(f func(protoreflect.FieldDescr // a repeated field is populated if it is non-empty. func (x *fastReflection_MsgUnstakeSupplier) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { + case "poktroll.supplier.MsgUnstakeSupplier.signer": + return x.Signer != "" case "poktroll.supplier.MsgUnstakeSupplier.address": return x.Address != "" default: @@ -1981,6 +2119,8 @@ func (x *fastReflection_MsgUnstakeSupplier) Has(fd protoreflect.FieldDescriptor) // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgUnstakeSupplier) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { + case "poktroll.supplier.MsgUnstakeSupplier.signer": + x.Signer = "" case "poktroll.supplier.MsgUnstakeSupplier.address": x.Address = "" default: @@ -1999,6 +2139,9 @@ func (x *fastReflection_MsgUnstakeSupplier) Clear(fd protoreflect.FieldDescripto // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_MsgUnstakeSupplier) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { + case "poktroll.supplier.MsgUnstakeSupplier.signer": + value := x.Signer + return protoreflect.ValueOfString(value) case "poktroll.supplier.MsgUnstakeSupplier.address": value := x.Address return protoreflect.ValueOfString(value) @@ -2022,6 +2165,8 @@ func (x *fastReflection_MsgUnstakeSupplier) Get(descriptor protoreflect.FieldDes // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgUnstakeSupplier) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { + case "poktroll.supplier.MsgUnstakeSupplier.signer": + x.Signer = value.Interface().(string) case "poktroll.supplier.MsgUnstakeSupplier.address": x.Address = value.Interface().(string) default: @@ -2044,6 +2189,8 @@ func (x *fastReflection_MsgUnstakeSupplier) Set(fd protoreflect.FieldDescriptor, // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgUnstakeSupplier) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "poktroll.supplier.MsgUnstakeSupplier.signer": + panic(fmt.Errorf("field signer of message poktroll.supplier.MsgUnstakeSupplier is not mutable")) case "poktroll.supplier.MsgUnstakeSupplier.address": panic(fmt.Errorf("field address of message poktroll.supplier.MsgUnstakeSupplier is not mutable")) default: @@ -2059,6 +2206,8 @@ func (x *fastReflection_MsgUnstakeSupplier) Mutable(fd protoreflect.FieldDescrip // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_MsgUnstakeSupplier) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "poktroll.supplier.MsgUnstakeSupplier.signer": + return protoreflect.ValueOfString("") case "poktroll.supplier.MsgUnstakeSupplier.address": return protoreflect.ValueOfString("") default: @@ -2130,6 +2279,10 @@ func (x *fastReflection_MsgUnstakeSupplier) ProtoMethods() *protoiface.Methods { var n int var l int _ = l + l = len(x.Signer) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } l = len(x.Address) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) @@ -2168,6 +2321,13 @@ func (x *fastReflection_MsgUnstakeSupplier) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], x.Address) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) i-- + dAtA[i] = 0x1a + } + if len(x.Signer) > 0 { + i -= len(x.Signer) + copy(dAtA[i:], x.Signer) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Signer))) + i-- dAtA[i] = 0xa } if input.Buf != nil { @@ -2220,6 +2380,38 @@ func (x *fastReflection_MsgUnstakeSupplier) ProtoMethods() *protoiface.Methods { } switch fieldNum { case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) } @@ -2735,9 +2927,11 @@ type MsgStakeSupplier struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // The Bech32 address of the supplier using cosmos' ScalarDescriptor to ensure deterministic deterministic encoding using cosmos' ScalarDescriptor to ensure deterministic deterministic encoding - Stake *v1beta1.Coin `protobuf:"bytes,2,opt,name=stake,proto3" json:"stake,omitempty"` // The total amount of uPOKT the supplier has staked. Must be ≥ to the current amount that the supplier has staked (if any) - Services []*shared.SupplierServiceConfig `protobuf:"bytes,3,rep,name=services,proto3" json:"services,omitempty"` // The list of services this supplier is staked to provide service for + Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` // The Bech32 address of the message signer (i.e. owner or operator) + OwnerAddress string `protobuf:"bytes,2,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty"` // The Bech32 address of the owner (i.e. custodial, staker) + Address string `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"` // The Bech32 address of the operator (i.e. provider, non-custodial) + Stake *v1beta1.Coin `protobuf:"bytes,4,opt,name=stake,proto3" json:"stake,omitempty"` // The total amount of uPOKT the supplier has staked. Must be ≥ to the current amount that the supplier has staked (if any) + Services []*shared.SupplierServiceConfig `protobuf:"bytes,5,rep,name=services,proto3" json:"services,omitempty"` // The list of services this supplier is staked to provide service for } func (x *MsgStakeSupplier) Reset() { @@ -2760,6 +2954,20 @@ func (*MsgStakeSupplier) Descriptor() ([]byte, []int) { return file_poktroll_supplier_tx_proto_rawDescGZIP(), []int{2} } +func (x *MsgStakeSupplier) GetSigner() string { + if x != nil { + return x.Signer + } + return "" +} + +func (x *MsgStakeSupplier) GetOwnerAddress() string { + if x != nil { + return x.OwnerAddress + } + return "" +} + func (x *MsgStakeSupplier) GetAddress() string { if x != nil { return x.Address @@ -2812,7 +3020,8 @@ type MsgUnstakeSupplier struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // The Bech32 address of the supplier using cosmos' ScalarDescriptor to ensure deterministic deterministic encoding using cosmos' ScalarDescriptor to ensure deterministic deterministic encoding + Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` // The Bech32 address of the message signer (i.e. owner or operator) + Address string `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"` // The Bech32 address of the operator (i.e. provider, non-custodial) } func (x *MsgUnstakeSupplier) Reset() { @@ -2835,6 +3044,13 @@ func (*MsgUnstakeSupplier) Descriptor() ([]byte, []int) { return file_poktroll_supplier_tx_proto_rawDescGZIP(), []int{4} } +func (x *MsgUnstakeSupplier) GetSigner() string { + if x != nil { + return x.Signer + } + return "" +} + func (x *MsgUnstakeSupplier) GetAddress() string { if x != nil { return x.Address @@ -2899,60 +3115,70 @@ var file_poktroll_supplier_tx_proto_rawDesc = []byte{ 0x6c, 0x6c, 0x2f, 0x78, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 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, 0xc9, 0x01, 0x0a, 0x10, 0x4d, 0x73, 0x67, - 0x53, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, 0x32, 0x0a, - 0x07, 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, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x12, 0x2f, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x18, 0x02, 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, 0x52, 0x05, 0x73, 0x74, 0x61, - 0x6b, 0x65, 0x12, 0x42, 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x03, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, - 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x08, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x3a, 0x0c, 0x82, 0xe7, 0xb0, 0x2a, 0x07, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x22, 0x1a, 0x0a, 0x18, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x6b, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xb9, 0x02, 0x0a, 0x10, 0x4d, 0x73, 0x67, + 0x53, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, 0x30, 0x0a, + 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, + 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, + 0x3d, 0x0a, 0x0d, 0x6f, 0x77, 0x6e, 0x65, 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, 0x0c, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x32, + 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x12, 0x2f, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x18, 0x04, 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, 0x52, 0x05, 0x73, 0x74, + 0x61, 0x6b, 0x65, 0x12, 0x42, 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, + 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x08, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x3a, 0x0b, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x69, + 0x67, 0x6e, 0x65, 0x72, 0x22, 0x1a, 0x0a, 0x18, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x56, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, - 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, + 0x22, 0x87, 0x01, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x53, + 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, 0x30, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x0c, 0x82, 0xe7, 0xb0, 0x2a, - 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x1c, 0x0a, 0x1a, 0x4d, 0x73, 0x67, 0x55, - 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xb8, 0x02, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x5e, - 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x22, - 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, - 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x1a, 0x2a, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, - 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 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, 0x61, - 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, - 0x23, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, - 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, - 0x6c, 0x69, 0x65, 0x72, 0x1a, 0x2b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, - 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x6b, - 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x67, 0x0a, 0x0f, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, - 0x6c, 0x69, 0x65, 0x72, 0x12, 0x25, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, - 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x73, 0x74, - 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x1a, 0x2d, 0x2e, 0x70, 0x6f, - 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, - 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, - 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, - 0x01, 0x42, 0xa9, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, 0x07, 0x54, 0x78, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 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, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xa2, 0x02, 0x03, 0x50, 0x53, 0x58, - 0xaa, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x53, 0x75, 0x70, 0x70, - 0x6c, 0x69, 0x65, 0x72, 0xca, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, - 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xe2, 0x02, 0x1d, 0x50, 0x6f, 0x6b, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5c, 0x47, 0x50, 0x42, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x67, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x07, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x0b, 0x82, + 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x22, 0x1c, 0x0a, 0x1a, 0x4d, 0x73, + 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xb8, 0x02, 0x0a, 0x03, 0x4d, 0x73, 0x67, + 0x12, 0x5e, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x12, 0x22, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, + 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2a, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, + 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 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, 0x61, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, + 0x72, 0x12, 0x23, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, + 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, + 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x1a, 0x2b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x74, + 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x67, 0x0a, 0x0f, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, + 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, 0x25, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, + 0x73, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x1a, 0x2d, 0x2e, + 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, + 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, + 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, + 0xb0, 0x2a, 0x01, 0x42, 0xa9, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, 0x07, 0x54, + 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 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, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xa2, 0x02, 0x03, 0x50, + 0x53, 0x58, 0xaa, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x53, 0x75, + 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xca, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xe2, 0x02, 0x1d, 0x50, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x50, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/load-testing/tests/relays_stress_helpers_test.go b/load-testing/tests/relays_stress_helpers_test.go index c03b8f47a..37f2e5254 100644 --- a/load-testing/tests/relays_stress_helpers_test.go +++ b/load-testing/tests/relays_stress_helpers_test.go @@ -785,6 +785,8 @@ func (s *relaysSuite) addActor(actorAddress string, actorStakeAmount sdk.Coin) * // messages in a single supplier transaction. func (s *relaysSuite) addPendingStakeSupplierMsg(supplier *accountInfo) { supplier.addPendingMsg(suppliertypes.NewMsgStakeSupplier( + supplier.address, + supplier.address, supplier.address, supplier.amountToStake, []*sharedtypes.SupplierServiceConfig{ diff --git a/proto/poktroll/application/application.proto b/proto/poktroll/application/application.proto index 013d3080e..3d99314d9 100644 --- a/proto/poktroll/application/application.proto +++ b/proto/poktroll/application/application.proto @@ -11,7 +11,7 @@ import "poktroll/shared/service.proto"; // Application defines the type used to store an on-chain definition and state for an application message Application { - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the application using cosmos' ScalarDescriptor to ensure deterministic encoding + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the application. cosmos.base.v1beta1.Coin stake = 2; // The total amount of uPOKT the application has staked repeated poktroll.shared.ApplicationServiceConfig service_configs = 3; // The list of services this appliccation is configured to request service for // TODO_BETA: Rename `delegatee_gateway_addresses` to `gateway_addresses_delegated_to`. diff --git a/proto/poktroll/application/event.proto b/proto/poktroll/application/event.proto index 16d70a795..84e714619 100644 --- a/proto/poktroll/application/event.proto +++ b/proto/poktroll/application/event.proto @@ -9,6 +9,6 @@ import "cosmos_proto/cosmos.proto"; // delegatee gateways on chain. This is in response to both a DelegateToGateway // and UndelegateFromGateway message. message EventRedelegation { - string app_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the application, using cosmos' ScalarDescriptor to ensure deterministic encoding - string gateway_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the gateway the application has changed their delegation of, using cosmos' ScalarDescriptor to ensure deterministic encoding + string app_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the application. + string gateway_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the gateway the application has changed their delegation of. } \ No newline at end of file diff --git a/proto/poktroll/application/tx.proto b/proto/poktroll/application/tx.proto index f76eaa8af..1108eb21f 100644 --- a/proto/poktroll/application/tx.proto +++ b/proto/poktroll/application/tx.proto @@ -49,7 +49,7 @@ message MsgUpdateParamsResponse {} message MsgStakeApplication { option (cosmos.msg.v1.signer) = "address"; - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the application using cosmos' ScalarDescriptor to ensure deterministic encoding + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the application. cosmos.base.v1beta1.Coin stake = 2; // The total amount of uPOKT the application has staked. Must be ≥ to the current amount that the application has staked (if any) repeated poktroll.shared.ApplicationServiceConfig services = 3; // The list of services this application is staked to request service for } @@ -65,8 +65,8 @@ message MsgUnstakeApplicationResponse {} message MsgDelegateToGateway { option (cosmos.msg.v1.signer) = "app_address"; // https://docs.cosmos.network/main/build/building-modules/messages-and-queries - string app_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the application using cosmos' ScalarDescriptor to ensure deterministic deterministic encoding using cosmos' ScalarDescriptor to ensure deterministic deterministic encoding - string gateway_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the gateway the application wants to delegate to using cosmos' ScalarDescriptor to ensure deterministic deterministic encoding using cosmos' ScalarDescriptor to ensure deterministic deterministic encoding + string app_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the application. + string gateway_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the gateway the application wants to delegate to. } @@ -74,8 +74,8 @@ message MsgDelegateToGatewayResponse {} message MsgUndelegateFromGateway { option (cosmos.msg.v1.signer) = "app_address"; // https://docs.cosmos.network/main/build/building-modules/messages-and-queries - string app_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the application using cosmos' ScalarDescriptor to ensure deterministic deterministic encoding using cosmos' ScalarDescriptor to ensure deterministic deterministic encoding - string gateway_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the gateway the application wants to undelegate from using cosmos' ScalarDescriptor to ensure deterministic deterministic encoding using cosmos' ScalarDescriptor to ensure deterministic deterministic encoding + string app_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the application. + string gateway_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the gateway the application wants to undelegate from. } message MsgUndelegateFromGatewayResponse {} diff --git a/proto/poktroll/gateway/event.proto b/proto/poktroll/gateway/event.proto index fe6d59312..18737bdc3 100644 --- a/proto/poktroll/gateway/event.proto +++ b/proto/poktroll/gateway/event.proto @@ -7,5 +7,5 @@ import "cosmos_proto/cosmos.proto"; // GatewayStaked defines the event emitted when a gateway has been unstaked. message EventGatewayUnstaked { - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the gateway the application has changed their delegation of, using cosmos' ScalarDescriptor to ensure deterministic encoding + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the gateway the application has changed their delegation of. } \ No newline at end of file diff --git a/proto/poktroll/service/relay.proto b/proto/poktroll/service/relay.proto index cffd71ae3..6874a3f61 100644 --- a/proto/poktroll/service/relay.proto +++ b/proto/poktroll/service/relay.proto @@ -26,10 +26,10 @@ message RelayRequestMetadata { // TODO_MAINNET: make sure we're checking/verifying this address on-chain (if needed). // Relevant conversation: https://github.com/pokt-network/poktroll/pull/567#discussion_r1628722168 - // + // // The supplier address the relay is sent to. It is being used on the RelayMiner to // route to the correct supplier. - string supplier_address = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the application, using cosmos' ScalarDescriptor to ensure deterministic encoding + string supplier_address = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the application. } // RelayRequest holds the request details for a relay. diff --git a/proto/poktroll/service/tx.proto b/proto/poktroll/service/tx.proto index 77f638d58..e9ef6634c 100644 --- a/proto/poktroll/service/tx.proto +++ b/proto/poktroll/service/tx.proto @@ -45,7 +45,7 @@ message MsgUpdateParamsResponse {} // TODO_BETA: Add Champions / Sources once its fully defined. message MsgAddService { option (cosmos.msg.v1.signer) = "owner_address"; // https://docs.cosmos.network/main/build/building-modules/messages-and-queries - string owner_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the service owner using cosmos' ScalarDescriptor + string owner_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the service owner. poktroll.shared.Service service = 2 [(gogoproto.nullable) = false]; // The Service being added to the network } diff --git a/proto/poktroll/session/query.proto b/proto/poktroll/session/query.proto index f695a5fc6..0e7b6141b 100644 --- a/proto/poktroll/session/query.proto +++ b/proto/poktroll/session/query.proto @@ -36,7 +36,7 @@ message QueryParamsResponse { } message QueryGetSessionRequest { - string application_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the application using cosmos' ScalarDescriptor to ensure deterministic encoding + string application_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the application. poktroll.shared.Service service = 2; // The service to query the session for int64 block_height = 3; // The block height to query the session for } diff --git a/proto/poktroll/session/session.proto b/proto/poktroll/session/session.proto index 4049fb72c..c75cb713a 100644 --- a/proto/poktroll/session/session.proto +++ b/proto/poktroll/session/session.proto @@ -14,7 +14,7 @@ import "poktroll/shared/supplier.proto"; // SessionHeader is a lightweight header for a session that can be passed around. // It is the minimal amount of data required to hydrate & retrieve all data relevant to the session. message SessionHeader { - string application_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the application using cosmos' ScalarDescriptor to ensure deterministic encoding + string application_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the application. poktroll.shared.Service service = 2; // The service this session is for // NOTE: session_id can be derived from the above values using on-chain but is included in the header for convenience string session_id = 3; // A unique pseudoranom ID for this session diff --git a/proto/poktroll/shared/supplier.proto b/proto/poktroll/shared/supplier.proto index 0d99fe87a..919f49efd 100644 --- a/proto/poktroll/shared/supplier.proto +++ b/proto/poktroll/shared/supplier.proto @@ -10,15 +10,24 @@ import "poktroll/shared/service.proto"; // Supplier is the type defining the actor in Pocket Network that provides RPC services. message Supplier { - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the supplier using cosmos' ScalarDescriptor to ensure deterministic encoding - cosmos.base.v1beta1.Coin stake = 2; // The total amount of uPOKT the supplier has staked - repeated SupplierServiceConfig services = 3; // The service configs this supplier can support + // The address of the owner (i.e. staker, custodial) that owns the funds for staking. + // By default, this address is the one that receives all the rewards unless owtherwise specified. + // This property cannot be updated by the operator. + string owner_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // Bech32 cosmos address + // The address of the supplier operator (i.e. the one managing the off-chain server). + // The operator address can update the supplier's configurations excluding the owner address. + // This property does not change over the supplier's lifespan, the supplier must be unstaked + // and re-staked to effectively update this value. + // TODO(#722): Rename this to `operator_address` including all downstream + // variables, comments, docs, tests, etc... + string address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // Bech32 cosmos address + cosmos.base.v1beta1.Coin stake = 3; // The total amount of uPOKT the supplier has staked + repeated SupplierServiceConfig services = 4; // The service configs this supplier can support // The session end height at which an actively unbonding supplier unbonds its stake. // If the supplier did not unstake, this value will be 0. - uint64 unstake_session_end_height = 4; + uint64 unstake_session_end_height = 5; // services_activation_heights_map is a map of serviceIds to the height at // which the staked supplier will become active for that service. // Activation heights are session start heights. - map services_activation_heights_map = 5; + map services_activation_heights_map = 6; } - diff --git a/proto/poktroll/supplier/tx.proto b/proto/poktroll/supplier/tx.proto index ef75baa2f..ee44679b2 100644 --- a/proto/poktroll/supplier/tx.proto +++ b/proto/poktroll/supplier/tx.proto @@ -45,17 +45,22 @@ message MsgUpdateParams { message MsgUpdateParamsResponse {} message MsgStakeSupplier { - option (cosmos.msg.v1.signer) = "address"; // https://docs.cosmos.network/main/build/building-modules/messages-and-queries - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the supplier using cosmos' ScalarDescriptor to ensure deterministic deterministic encoding using cosmos' ScalarDescriptor to ensure deterministic deterministic encoding - cosmos.base.v1beta1.Coin stake = 2; // The total amount of uPOKT the supplier has staked. Must be ≥ to the current amount that the supplier has staked (if any) - repeated poktroll.shared.SupplierServiceConfig services = 3; // The list of services this supplier is staked to provide service for + option (cosmos.msg.v1.signer) = "signer"; // https://docs.cosmos.network/main/build/building-modules/messages-and-queries + + string signer = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the message signer (i.e. owner or operator) + string owner_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the owner (i.e. custodial, staker) + string address = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the operator (i.e. provider, non-custodial) + cosmos.base.v1beta1.Coin stake = 4; // The total amount of uPOKT the supplier has staked. Must be ≥ to the current amount that the supplier has staked (if any) + repeated poktroll.shared.SupplierServiceConfig services = 5; // The list of services this supplier is staked to provide service for } message MsgStakeSupplierResponse {} message MsgUnstakeSupplier { - option (cosmos.msg.v1.signer) = "address"; - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the supplier using cosmos' ScalarDescriptor to ensure deterministic deterministic encoding using cosmos' ScalarDescriptor to ensure deterministic deterministic encoding + option (cosmos.msg.v1.signer) = "signer"; + + string signer = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the message signer (i.e. owner or operator) + string address = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the operator (i.e. provider, non-custodial) } message MsgUnstakeSupplierResponse {} diff --git a/testutil/integration/app.go b/testutil/integration/app.go index e83e56233..999949d9a 100644 --- a/testutil/integration/app.go +++ b/testutil/integration/app.go @@ -422,6 +422,7 @@ func NewCompleteIntegrationApp(t *testing.T) *App { tokenomicsKeeper, accountKeeper, bankKeeper, + supplierKeeper, ) // Prepare the message & query routers diff --git a/x/shared/types/errors.go b/x/shared/types/errors.go index df55eb100..c4e129a1c 100644 --- a/x/shared/types/errors.go +++ b/x/shared/types/errors.go @@ -8,9 +8,10 @@ import ( // x/shared module sentinel errors var ( - ErrSharedInvalidSigner = sdkerrors.Register(ModuleName, 1100, "expected gov account as only signer for proposal message") - ErrSharedInvalidAddress = sdkerrors.Register(ModuleName, 1101, "invalid address") - ErrSharedParamNameInvalid = sdkerrors.Register(ModuleName, 1102, "the provided param name is invalid") - ErrSharedParamInvalid = sdkerrors.Register(ModuleName, 1103, "the provided param is invalid") - ErrSharedEmitEvent = sdkerrors.Register(ModuleName, 1104, "failed to emit event") + ErrSharedInvalidSigner = sdkerrors.Register(ModuleName, 1100, "expected gov account as only signer for proposal message") + ErrSharedInvalidAddress = sdkerrors.Register(ModuleName, 1101, "invalid address") + ErrSharedParamNameInvalid = sdkerrors.Register(ModuleName, 1102, "the provided param name is invalid") + ErrSharedParamInvalid = sdkerrors.Register(ModuleName, 1103, "the provided param is invalid") + ErrSharedEmitEvent = sdkerrors.Register(ModuleName, 1104, "failed to emit event") + ErrSharedUnauthorizedSupplierUpdate = sdkerrors.Register(ModuleName, 1105, "unauthorized supplier update") ) diff --git a/x/shared/types/supplier.go b/x/shared/types/supplier.go index 80fc9ee15..1632de314 100644 --- a/x/shared/types/supplier.go +++ b/x/shared/types/supplier.go @@ -31,3 +31,13 @@ func (s *Supplier) IsActive(queryHeight uint64, serviceId string) bool { return true } + +// HasOwner returns whether the given address is the supplier's owner address. +func (s *Supplier) HasOwner(address string) bool { + return s.OwnerAddress == address +} + +// HasOperator returns whether the given address is the supplier's operator address. +func (s *Supplier) HasOperator(address string) bool { + return s.Address == address +} diff --git a/x/shared/types/supplier.pb.go b/x/shared/types/supplier.pb.go index fc37098f9..868e01a6e 100644 --- a/x/shared/types/supplier.pb.go +++ b/x/shared/types/supplier.pb.go @@ -26,16 +26,26 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Supplier is the type defining the actor in Pocket Network that provides RPC services. type Supplier struct { - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - Stake *types.Coin `protobuf:"bytes,2,opt,name=stake,proto3" json:"stake,omitempty"` - Services []*SupplierServiceConfig `protobuf:"bytes,3,rep,name=services,proto3" json:"services,omitempty"` + // The address of the owner (i.e. staker, custodial) that owns the funds for staking. + // By default, this address is the one that receives all the rewards unless owtherwise specified. + // This property cannot be updated by the operator. + OwnerAddress string `protobuf:"bytes,1,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty"` + // The address of the supplier operator (i.e. the one managing the off-chain server). + // The operator address can update the supplier's configurations excluding the owner address. + // This property does not change over the supplier's lifespan, the supplier must be unstaked + // and re-staked to effectively update this value. + // TODO(#722): Rename this to `operator_address` including all downstream + // variables, comments, docs, tests, etc... + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` + Stake *types.Coin `protobuf:"bytes,3,opt,name=stake,proto3" json:"stake,omitempty"` + Services []*SupplierServiceConfig `protobuf:"bytes,4,rep,name=services,proto3" json:"services,omitempty"` // The session end height at which an actively unbonding supplier unbonds its stake. // If the supplier did not unstake, this value will be 0. - UnstakeSessionEndHeight uint64 `protobuf:"varint,4,opt,name=unstake_session_end_height,json=unstakeSessionEndHeight,proto3" json:"unstake_session_end_height,omitempty"` + UnstakeSessionEndHeight uint64 `protobuf:"varint,5,opt,name=unstake_session_end_height,json=unstakeSessionEndHeight,proto3" json:"unstake_session_end_height,omitempty"` // services_activation_heights_map is a map of serviceIds to the height at // which the staked supplier will become active for that service. // Activation heights are session start heights. - ServicesActivationHeightsMap map[string]uint64 `protobuf:"bytes,5,rep,name=services_activation_heights_map,json=servicesActivationHeightsMap,proto3" json:"services_activation_heights_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + ServicesActivationHeightsMap map[string]uint64 `protobuf:"bytes,6,rep,name=services_activation_heights_map,json=servicesActivationHeightsMap,proto3" json:"services_activation_heights_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` } func (m *Supplier) Reset() { *m = Supplier{} } @@ -71,6 +81,13 @@ func (m *Supplier) XXX_DiscardUnknown() { var xxx_messageInfo_Supplier proto.InternalMessageInfo +func (m *Supplier) GetOwnerAddress() string { + if m != nil { + return m.OwnerAddress + } + return "" +} + func (m *Supplier) GetAddress() string { if m != nil { return m.Address @@ -114,33 +131,35 @@ func init() { func init() { proto.RegisterFile("poktroll/shared/supplier.proto", fileDescriptor_4a189b52ba503cf2) } var fileDescriptor_4a189b52ba503cf2 = []byte{ - // 416 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0x31, 0x8f, 0xd3, 0x30, - 0x14, 0xc7, 0xeb, 0x6b, 0x0b, 0x87, 0x6f, 0x00, 0x59, 0x27, 0x91, 0xab, 0xc0, 0x14, 0x06, 0xd4, - 0xe5, 0x6c, 0x5d, 0x59, 0x10, 0x37, 0x5d, 0x4f, 0x27, 0xc1, 0x80, 0x90, 0xd2, 0x8d, 0x25, 0x72, - 0x13, 0xd3, 0x5a, 0x49, 0xed, 0xc8, 0xcf, 0x09, 0x74, 0xe5, 0x13, 0xf0, 0x61, 0xf8, 0x0c, 0x88, - 0xb1, 0x62, 0x62, 0x44, 0xed, 0x17, 0x41, 0x89, 0x9d, 0x0e, 0x20, 0xb8, 0x2d, 0x4f, 0xff, 0xdf, - 0xfb, 0xbf, 0xff, 0x8b, 0x1f, 0xa6, 0xa5, 0xc9, 0x9d, 0x35, 0x45, 0xc1, 0x61, 0x25, 0xac, 0xcc, - 0x38, 0x54, 0x65, 0x59, 0x28, 0x69, 0x59, 0x69, 0x8d, 0x33, 0xe4, 0x7e, 0xa7, 0x33, 0xaf, 0x8f, - 0xce, 0x52, 0x03, 0x6b, 0x03, 0x49, 0x2b, 0x73, 0x5f, 0x78, 0x76, 0x44, 0x7d, 0xc5, 0x17, 0x02, - 0x24, 0xaf, 0x2f, 0x16, 0xd2, 0x89, 0x0b, 0x9e, 0x1a, 0xa5, 0x83, 0xfe, 0xf8, 0xaf, 0x59, 0xd2, - 0xd6, 0x2a, 0x95, 0x5e, 0x7e, 0xf6, 0xad, 0x8f, 0x8f, 0xe7, 0x61, 0x3a, 0x99, 0xe2, 0xbb, 0x22, - 0xcb, 0xac, 0x04, 0x88, 0xd0, 0x18, 0x4d, 0xee, 0xcd, 0xa2, 0x1f, 0x5f, 0xcf, 0x4f, 0xc3, 0xb8, - 0x2b, 0xaf, 0xcc, 0x9d, 0x55, 0x7a, 0x19, 0x77, 0x20, 0xe1, 0x78, 0x08, 0x4e, 0xe4, 0x32, 0x3a, - 0x1a, 0xa3, 0xc9, 0xc9, 0xf4, 0x8c, 0x05, 0xbc, 0xc9, 0xc3, 0x42, 0x1e, 0x76, 0x6d, 0x94, 0x8e, - 0x3d, 0x47, 0x66, 0xf8, 0x38, 0x44, 0x80, 0xa8, 0x3f, 0xee, 0x4f, 0x4e, 0xa6, 0xcf, 0xd9, 0x1f, - 0xfb, 0xb2, 0x2e, 0xd1, 0xdc, 0x83, 0xd7, 0x46, 0x7f, 0x50, 0xcb, 0xf8, 0xd0, 0x47, 0x2e, 0xf1, - 0xa8, 0xd2, 0xad, 0x5d, 0x02, 0x12, 0x40, 0x19, 0x9d, 0x48, 0x9d, 0x25, 0x2b, 0xa9, 0x96, 0x2b, - 0x17, 0x0d, 0xc6, 0x68, 0x32, 0x88, 0x1f, 0x06, 0x62, 0xee, 0x81, 0x1b, 0x9d, 0xbd, 0x6e, 0x65, - 0xf2, 0x19, 0xe1, 0x27, 0x9d, 0x53, 0x22, 0x52, 0xa7, 0x6a, 0xe1, 0x1a, 0x07, 0xdf, 0x0d, 0xc9, - 0x5a, 0x94, 0xd1, 0xb0, 0x0d, 0x76, 0xf9, 0xcf, 0x60, 0x2c, 0x24, 0x83, 0xab, 0x43, 0xbf, 0x77, - 0x87, 0xb7, 0xa2, 0xbc, 0xd1, 0xce, 0x6e, 0xe2, 0x47, 0xf0, 0x1f, 0x64, 0xf4, 0x0e, 0x3f, 0xbd, - 0xd5, 0x82, 0x3c, 0xc0, 0xfd, 0x5c, 0x6e, 0xfc, 0x5b, 0xc4, 0xcd, 0x27, 0x39, 0xc5, 0xc3, 0x5a, - 0x14, 0x95, 0xff, 0xdb, 0x83, 0xd8, 0x17, 0xaf, 0x8e, 0x5e, 0xa2, 0xd9, 0x9b, 0xef, 0x3b, 0x8a, - 0xb6, 0x3b, 0x8a, 0x7e, 0xed, 0x28, 0xfa, 0xb2, 0xa7, 0xbd, 0xed, 0x9e, 0xf6, 0x7e, 0xee, 0x69, - 0xef, 0x3d, 0x5f, 0x2a, 0xb7, 0xaa, 0x16, 0x2c, 0x35, 0x6b, 0xde, 0xec, 0x73, 0xae, 0xa5, 0xfb, - 0x68, 0x6c, 0xce, 0x0f, 0x97, 0xf1, 0xa9, 0xbb, 0x0d, 0xb7, 0x29, 0x25, 0x2c, 0xee, 0xb4, 0xa7, - 0xf1, 0xe2, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe6, 0xdf, 0x9c, 0xa3, 0xa7, 0x02, 0x00, 0x00, + // 433 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x52, 0x3f, 0x6f, 0x13, 0x31, + 0x14, 0x8f, 0x9b, 0xa4, 0x14, 0x17, 0x04, 0xb2, 0x2a, 0x71, 0x8d, 0xc0, 0x04, 0x06, 0x94, 0xa5, + 0xb6, 0x1a, 0x16, 0x44, 0xc5, 0xd0, 0x54, 0x95, 0x60, 0x40, 0x48, 0x97, 0x8d, 0xe5, 0xe4, 0xdc, + 0x3d, 0x12, 0x2b, 0x89, 0x7d, 0xf2, 0x73, 0x52, 0xb2, 0x22, 0xb1, 0xf3, 0x61, 0xf8, 0x10, 0x8c, + 0x15, 0x13, 0x23, 0x4a, 0xbe, 0x08, 0xca, 0xd9, 0x97, 0x01, 0x44, 0xbb, 0xdd, 0xbb, 0xdf, 0x9f, + 0xf7, 0x7e, 0x7e, 0x8f, 0xf2, 0xd2, 0x4e, 0xbd, 0xb3, 0xb3, 0x99, 0xc4, 0x89, 0x72, 0x50, 0x48, + 0x5c, 0x94, 0xe5, 0x4c, 0x83, 0x13, 0xa5, 0xb3, 0xde, 0xb2, 0x07, 0x35, 0x2e, 0x02, 0xde, 0x39, + 0xce, 0x2d, 0xce, 0x2d, 0x66, 0x15, 0x2c, 0x43, 0x11, 0xb8, 0x1d, 0x1e, 0x2a, 0x39, 0x52, 0x08, + 0x72, 0x79, 0x3a, 0x02, 0xaf, 0x4e, 0x65, 0x6e, 0xb5, 0x89, 0xf8, 0x93, 0x7f, 0x7a, 0x81, 0x5b, + 0xea, 0x1c, 0x02, 0xfc, 0xfc, 0x6b, 0x8b, 0x1e, 0x0c, 0x63, 0x77, 0xf6, 0x86, 0xde, 0xb7, 0x57, + 0x06, 0x5c, 0xa6, 0x8a, 0xc2, 0x01, 0x62, 0x42, 0xba, 0xa4, 0x77, 0x77, 0x90, 0xfc, 0xfc, 0x7e, + 0x72, 0x14, 0x9b, 0x9e, 0x07, 0x64, 0xe8, 0x9d, 0x36, 0xe3, 0xf4, 0x5e, 0x45, 0x8f, 0xff, 0x58, + 0x9f, 0xde, 0xa9, 0x85, 0x7b, 0xb7, 0x08, 0x6b, 0x22, 0x93, 0xb4, 0x8d, 0x5e, 0x4d, 0x21, 0x69, + 0x76, 0x49, 0xef, 0xb0, 0x7f, 0x2c, 0x22, 0x7d, 0x1b, 0x47, 0xc4, 0x38, 0xe2, 0xc2, 0x6a, 0x93, + 0x06, 0x1e, 0x1b, 0xd0, 0x83, 0x98, 0x00, 0x93, 0x56, 0xb7, 0xd9, 0x3b, 0xec, 0xbf, 0x10, 0x7f, + 0x3d, 0x97, 0xa8, 0x03, 0x0d, 0x03, 0xf1, 0xc2, 0x9a, 0x4f, 0x7a, 0x9c, 0xee, 0x74, 0xec, 0x8c, + 0x76, 0x16, 0xa6, 0xb2, 0xcb, 0x10, 0x10, 0xb5, 0x35, 0x19, 0x98, 0x22, 0x9b, 0x80, 0x1e, 0x4f, + 0x7c, 0xd2, 0xee, 0x92, 0x5e, 0x2b, 0x7d, 0x14, 0x19, 0xc3, 0x40, 0xb8, 0x34, 0xc5, 0xdb, 0x0a, + 0x66, 0x5f, 0x08, 0x7d, 0x5a, 0x3b, 0x65, 0x2a, 0xf7, 0x7a, 0xa9, 0xfc, 0xd6, 0x21, 0xa8, 0x31, + 0x9b, 0xab, 0x32, 0xd9, 0xaf, 0x06, 0x3b, 0xfb, 0xef, 0x60, 0x22, 0x4e, 0x86, 0xe7, 0x3b, 0x7d, + 0x70, 0xc7, 0xf7, 0xaa, 0xbc, 0x34, 0xde, 0xad, 0xd2, 0xc7, 0x78, 0x03, 0xa5, 0xf3, 0x81, 0x3e, + 0xbb, 0xd5, 0x82, 0x3d, 0xa4, 0xcd, 0x29, 0xac, 0xc2, 0x12, 0xd3, 0xed, 0x27, 0x3b, 0xa2, 0xed, + 0xa5, 0x9a, 0x2d, 0xa0, 0xda, 0x4f, 0x2b, 0x0d, 0xc5, 0xeb, 0xbd, 0x57, 0x64, 0xf0, 0xee, 0xc7, + 0x9a, 0x93, 0xeb, 0x35, 0x27, 0xbf, 0xd7, 0x9c, 0x7c, 0xdb, 0xf0, 0xc6, 0xf5, 0x86, 0x37, 0x7e, + 0x6d, 0x78, 0xe3, 0xa3, 0x1c, 0x6b, 0x3f, 0x59, 0x8c, 0x44, 0x6e, 0xe7, 0x72, 0x9b, 0xe7, 0xc4, + 0x80, 0xbf, 0xb2, 0x6e, 0x2a, 0x77, 0x87, 0xf5, 0xb9, 0x3e, 0x2d, 0xbf, 0x2a, 0x01, 0x47, 0xfb, + 0xd5, 0x65, 0xbd, 0xfc, 0x13, 0x00, 0x00, 0xff, 0xff, 0xe7, 0x7c, 0x1e, 0xd1, 0xe6, 0x02, 0x00, + 0x00, } func (m *Supplier) Marshal() (dAtA []byte, err error) { @@ -177,13 +196,13 @@ func (m *Supplier) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0xa i = encodeVarintSupplier(dAtA, i, uint64(baseI-i)) i-- - dAtA[i] = 0x2a + dAtA[i] = 0x32 } } if m.UnstakeSessionEndHeight != 0 { i = encodeVarintSupplier(dAtA, i, uint64(m.UnstakeSessionEndHeight)) i-- - dAtA[i] = 0x20 + dAtA[i] = 0x28 } if len(m.Services) > 0 { for iNdEx := len(m.Services) - 1; iNdEx >= 0; iNdEx-- { @@ -196,7 +215,7 @@ func (m *Supplier) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintSupplier(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a + dAtA[i] = 0x22 } } if m.Stake != nil { @@ -209,13 +228,20 @@ func (m *Supplier) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintSupplier(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a } if len(m.Address) > 0 { i -= len(m.Address) copy(dAtA[i:], m.Address) i = encodeVarintSupplier(dAtA, i, uint64(len(m.Address))) i-- + dAtA[i] = 0x12 + } + if len(m.OwnerAddress) > 0 { + i -= len(m.OwnerAddress) + copy(dAtA[i:], m.OwnerAddress) + i = encodeVarintSupplier(dAtA, i, uint64(len(m.OwnerAddress))) + i-- dAtA[i] = 0xa } return len(dAtA) - i, nil @@ -238,6 +264,10 @@ func (m *Supplier) Size() (n int) { } var l int _ = l + l = len(m.OwnerAddress) + if l > 0 { + n += 1 + l + sovSupplier(uint64(l)) + } l = len(m.Address) if l > 0 { n += 1 + l + sovSupplier(uint64(l)) @@ -302,6 +332,38 @@ func (m *Supplier) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OwnerAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSupplier + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSupplier + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSupplier + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OwnerAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) } @@ -333,7 +395,7 @@ func (m *Supplier) Unmarshal(dAtA []byte) error { } m.Address = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Stake", wireType) } @@ -369,7 +431,7 @@ func (m *Supplier) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 3: + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Services", wireType) } @@ -403,7 +465,7 @@ func (m *Supplier) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 4: + case 5: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field UnstakeSessionEndHeight", wireType) } @@ -422,7 +484,7 @@ func (m *Supplier) Unmarshal(dAtA []byte) error { break } } - case 5: + case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ServicesActivationHeightsMap", wireType) } diff --git a/x/supplier/config/errors.go b/x/supplier/config/errors.go index 80be44969..23b486c2b 100644 --- a/x/supplier/config/errors.go +++ b/x/supplier/config/errors.go @@ -7,12 +7,14 @@ import ( ) var ( - ErrSupplierConfigUnmarshalYAML = sdkerrors.Register(types.ModuleName, 2100, "config reader cannot unmarshal yaml content") - ErrSupplierConfigInvalidServiceId = sdkerrors.Register(types.ModuleName, 2101, "invalid serviceId in supplier config") - ErrSupplierConfigNoEndpoints = sdkerrors.Register(types.ModuleName, 2102, "no endpoints defined for serviceId in supplier config") - ErrSupplierConfigInvalidEndpointConfig = sdkerrors.Register(types.ModuleName, 2103, "invalid endpoint config in supplier config") - ErrSupplierConfigInvalidRPCType = sdkerrors.Register(types.ModuleName, 2104, "invalid rpc type in supplier config") - ErrSupplierConfigInvalidURL = sdkerrors.Register(types.ModuleName, 2105, "invalid endpoint url in supplier config") - ErrSupplierConfigEmptyContent = sdkerrors.Register(types.ModuleName, 2106, "empty supplier config content") - ErrSupplierConfigInvalidStake = sdkerrors.Register(types.ModuleName, 2107, "invalid stake amount in supplier config") + ErrSupplierConfigUnmarshalYAML = sdkerrors.Register(types.ModuleName, 2100, "config reader cannot unmarshal yaml content") + ErrSupplierConfigInvalidServiceId = sdkerrors.Register(types.ModuleName, 2101, "invalid serviceId in supplier config") + ErrSupplierConfigNoEndpoints = sdkerrors.Register(types.ModuleName, 2102, "no endpoints defined for serviceId in supplier config") + ErrSupplierConfigInvalidEndpointConfig = sdkerrors.Register(types.ModuleName, 2103, "invalid endpoint config in supplier config") + ErrSupplierConfigInvalidRPCType = sdkerrors.Register(types.ModuleName, 2104, "invalid rpc type in supplier config") + ErrSupplierConfigInvalidURL = sdkerrors.Register(types.ModuleName, 2105, "invalid endpoint url in supplier config") + ErrSupplierConfigEmptyContent = sdkerrors.Register(types.ModuleName, 2106, "empty supplier config content") + ErrSupplierConfigInvalidStake = sdkerrors.Register(types.ModuleName, 2107, "invalid stake amount in supplier config") + ErrSupplierConfigInvalidOwnerAddress = sdkerrors.Register(types.ModuleName, 2108, "invalid owner address in supplier config") + ErrSupplierConfigInvalidOperatorAddress = sdkerrors.Register(types.ModuleName, 2109, "invalid operator address in supplier config") ) diff --git a/x/supplier/config/supplier_configs_reader.go b/x/supplier/config/supplier_configs_reader.go index 7275ed97d..7f18fb035 100644 --- a/x/supplier/config/supplier_configs_reader.go +++ b/x/supplier/config/supplier_configs_reader.go @@ -1,20 +1,25 @@ package config import ( + "context" "net/url" "strings" sdk "github.com/cosmos/cosmos-sdk/types" "gopkg.in/yaml.v2" + "github.com/pokt-network/poktroll/pkg/polylog" + _ "github.com/pokt-network/poktroll/pkg/polylog/polyzero" sharedhelpers "github.com/pokt-network/poktroll/x/shared/helpers" sharedtypes "github.com/pokt-network/poktroll/x/shared/types" ) // YAMLStakeConfig is the structure describing the supplier stake config file. type YAMLStakeConfig struct { - StakeAmount string `yaml:"stake_amount"` - Services []*YAMLStakeService `yaml:"services"` + OwnerAddress string `yaml:"owner_address"` + OperatorAddress string `yaml:"operator_address"` + StakeAmount string `yaml:"stake_amount"` + Services []*YAMLStakeService `yaml:"services"` } // YAMLStakeService is the structure describing a single service entry in the @@ -34,14 +39,18 @@ type YAMLServiceEndpoint struct { // SupplierStakeConfig is the structure describing the parsed supplier stake config. type SupplierStakeConfig struct { - StakeAmount sdk.Coin - Services []*sharedtypes.SupplierServiceConfig + OwnerAddress string + OperatorAddress string + StakeAmount sdk.Coin + Services []*sharedtypes.SupplierServiceConfig } // ParseSupplierServiceConfig parses the stake config file into a SupplierServiceConfig. -func ParseSupplierConfigs(configContent []byte) (*SupplierStakeConfig, error) { +func ParseSupplierConfigs(ctx context.Context, configContent []byte) (*SupplierStakeConfig, error) { var stakeConfig *YAMLStakeConfig + logger := polylog.Ctx(ctx) + if len(configContent) == 0 { return nil, ErrSupplierConfigEmptyContent } @@ -51,6 +60,22 @@ func ParseSupplierConfigs(configContent []byte) (*SupplierStakeConfig, error) { return nil, ErrSupplierConfigUnmarshalYAML.Wrapf("%s", err) } + // Validate required owner address. + if _, err := sdk.AccAddressFromBech32(stakeConfig.OwnerAddress); err != nil { + return nil, ErrSupplierConfigInvalidOwnerAddress.Wrap("invalid owner address") + } + + // If the operator address is not set, default it to the owner address. + if stakeConfig.OperatorAddress == "" { + stakeConfig.OperatorAddress = stakeConfig.OwnerAddress + logger.Info().Msg("operator address not set, defaulting to owner address") + } + + // Validate operator address. + if _, err := sdk.AccAddressFromBech32(stakeConfig.OperatorAddress); err != nil { + return nil, ErrSupplierConfigInvalidOperatorAddress.Wrap("invalid operator address") + } + // Validate the stake amount if len(stakeConfig.StakeAmount) == 0 { return nil, ErrSupplierConfigInvalidStake.Wrap("stake amount cannot be empty") @@ -113,8 +138,10 @@ func ParseSupplierConfigs(configContent []byte) (*SupplierStakeConfig, error) { } return &SupplierStakeConfig{ - StakeAmount: stakeAmount, - Services: supplierServiceConfig, + OwnerAddress: stakeConfig.OwnerAddress, + OperatorAddress: stakeConfig.OperatorAddress, + StakeAmount: stakeAmount, + Services: supplierServiceConfig, }, nil } diff --git a/x/supplier/config/supplier_configs_reader_test.go b/x/supplier/config/supplier_configs_reader_test.go index 90ff18a03..a2a51d04d 100644 --- a/x/supplier/config/supplier_configs_reader_test.go +++ b/x/supplier/config/supplier_configs_reader_test.go @@ -1,6 +1,7 @@ package config_test import ( + "context" "testing" sdkerrors "cosmossdk.io/errors" @@ -365,10 +366,12 @@ func Test_ParseSupplierConfigs_Services(t *testing.T) { }, } + ctx := context.Background() + for _, tt := range tests { t.Run(tt.desc, func(t *testing.T) { normalizedConfig := yaml.NormalizeYAMLIndentation(tt.inputConfig) - supplierServiceConfig, err := config.ParseSupplierConfigs([]byte(normalizedConfig)) + supplierServiceConfig, err := config.ParseSupplierConfigs(ctx, []byte(normalizedConfig)) if tt.expectedError != nil { require.Error(t, err) diff --git a/x/supplier/keeper/msg_server_stake_supplier.go b/x/supplier/keeper/msg_server_stake_supplier.go index ff2bcdd43..31d0087b2 100644 --- a/x/supplier/keeper/msg_server_stake_supplier.go +++ b/x/supplier/keeper/msg_server_stake_supplier.go @@ -23,6 +23,7 @@ func (k msgServer) StakeSupplier(ctx context.Context, msg *types.MsgStakeSupplie logger := k.Logger().With("method", "StakeSupplier") logger.Info(fmt.Sprintf("About to stake supplier with msg: %v", msg)) + // ValidateBasic also validates that the msg signer is the owner or operator of the supplier if err := msg.ValidateBasic(); err != nil { logger.Error(fmt.Sprintf("invalid MsgStakeSupplier: %v", msg)) return nil, err @@ -44,9 +45,43 @@ func (k msgServer) StakeSupplier(ctx context.Context, msg *types.MsgStakeSupplie if !isSupplierFound { logger.Info(fmt.Sprintf("Supplier not found. Creating new supplier for address %q", msg.Address)) supplier = k.createSupplier(ctx, msg) + coinsToEscrow = *msg.Stake } else { logger.Info(fmt.Sprintf("Supplier found. About to try updating supplier with address %q", msg.Address)) + + // Ensure the signer is either the owner or the operator of the supplier. + if !msg.IsSigner(supplier.OwnerAddress) && !msg.IsSigner(supplier.Address) { + return nil, sharedtypes.ErrSharedUnauthorizedSupplierUpdate.Wrapf( + "signer address %s does not match owner address %s or supplier address %s", + msg.Signer, + msg.OwnerAddress, + msg.Address, + ) + } + + // Ensure that only the owner can change the OwnerAddress. + // (i.e. fail if owner address changed and the owner is not the msg signer) + if !supplier.HasOwner(msg.OwnerAddress) && !msg.IsSigner(supplier.OwnerAddress) { + logger.Error("only the supplier owner is allowed to update the owner address") + + return nil, sharedtypes.ErrSharedUnauthorizedSupplierUpdate.Wrapf( + "signer %q is not allowed to update the owner address %q", + msg.Signer, + supplier.OwnerAddress, + ) + } + + // Ensure that the operator addresses cannot be changed. This is because changing + // it mid-session invalidates the current session. + if !supplier.HasOperator(msg.Address) { + logger.Error("updating the supplier's operator address forbidden") + + return nil, sharedtypes.ErrSharedUnauthorizedSupplierUpdate.Wrap( + "updating the operator address is forbidden, unstake then re-stake with the updated operator address", + ) + } + currSupplierStake := *supplier.Stake if err = k.updateSupplier(ctx, &supplier, msg); err != nil { logger.Error(fmt.Sprintf("could not update supplier for address %q due to error %v", msg.Address, err)) @@ -64,24 +99,24 @@ func (k msgServer) StakeSupplier(ctx context.Context, msg *types.MsgStakeSupplie // Must always stake or upstake (> 0 delta) if coinsToEscrow.IsZero() { - logger.Warn(fmt.Sprintf("Supplier %q must escrow more than 0 additional coins", msg.Address)) - return nil, types.ErrSupplierInvalidStake.Wrapf("supplier %q must escrow more than 0 additional coins", msg.Address) + logger.Warn(fmt.Sprintf("Signer %q must escrow more than 0 additional coins", msg.Signer)) + return nil, types.ErrSupplierInvalidStake.Wrapf("Signer %q must escrow more than 0 additional coins", msg.Signer) } - // Retrieve the address of the supplier - supplierAddress, err := sdk.AccAddressFromBech32(msg.Address) + // Retrieve the account address of the message signer + msgSignerAddress, err := sdk.AccAddressFromBech32(msg.Signer) if err != nil { - logger.Error(fmt.Sprintf("could not parse address %q", msg.Address)) + logger.Error(fmt.Sprintf("could not parse address %q", msg.Signer)) return nil, err } - // Send the coins from the supplier to the staked supplier pool - err = k.bankKeeper.SendCoinsFromAccountToModule(ctx, supplierAddress, types.ModuleName, []sdk.Coin{coinsToEscrow}) + // Send the coins from the message signer account to the staked supplier pool + err = k.bankKeeper.SendCoinsFromAccountToModule(ctx, msgSignerAddress, types.ModuleName, []sdk.Coin{coinsToEscrow}) if err != nil { - logger.Error(fmt.Sprintf("could not send %v coins from %q to %q module account due to %v", coinsToEscrow, supplierAddress, types.ModuleName, err)) + logger.Error(fmt.Sprintf("could not send %v coins from %q to %q module account due to %v", coinsToEscrow, msgSignerAddress, types.ModuleName, err)) return nil, err } - logger.Info(fmt.Sprintf("Successfully escrowed %v coins from %q to %q module account", coinsToEscrow, supplierAddress, types.ModuleName)) + logger.Info(fmt.Sprintf("Successfully escrowed %v coins from %q to %q module account", coinsToEscrow, msgSignerAddress, types.ModuleName)) // Update the Supplier in the store k.SetSupplier(ctx, supplier) @@ -91,6 +126,7 @@ func (k msgServer) StakeSupplier(ctx context.Context, msg *types.MsgStakeSupplie return &types.MsgStakeSupplierResponse{}, nil } +// createSupplier creates a new supplier from the given message. func (k msgServer) createSupplier( ctx context.Context, msg *types.MsgStakeSupplier, @@ -108,6 +144,7 @@ func (k msgServer) createSupplier( } return sharedtypes.Supplier{ + OwnerAddress: msg.OwnerAddress, Address: msg.Address, Stake: msg.Stake, Services: msg.Services, @@ -115,26 +152,24 @@ func (k msgServer) createSupplier( } } +// updateSupplier updates the given supplier with the given message. func (k msgServer) updateSupplier( ctx context.Context, supplier *sharedtypes.Supplier, msg *types.MsgStakeSupplier, ) error { - // Checks if the the msg address is the same as the current owner - if msg.Address != supplier.Address { - return types.ErrSupplierUnauthorized.Wrapf("msg Address %q != supplier address %q", msg.Address, supplier.Address) - } - // Validate that the stake is not being lowered if msg.Stake == nil { return types.ErrSupplierInvalidStake.Wrapf("stake amount cannot be nil") } - if msg.Stake.IsLTE(*supplier.Stake) { + if msg.Stake.IsLTE(*supplier.Stake) { return types.ErrSupplierInvalidStake.Wrapf("stake amount %v must be higher than previous stake amount %v", msg.Stake, supplier.Stake) } supplier.Stake = msg.Stake + supplier.OwnerAddress = msg.OwnerAddress + // Validate that the service configs maintain at least one service. // Additional validation is done in `msg.ValidateBasic` above. if len(msg.Services) == 0 { diff --git a/x/supplier/keeper/msg_server_unstake_supplier.go b/x/supplier/keeper/msg_server_unstake_supplier.go index c11b1892b..0cdc0821c 100644 --- a/x/supplier/keeper/msg_server_unstake_supplier.go +++ b/x/supplier/keeper/msg_server_unstake_supplier.go @@ -8,6 +8,7 @@ import ( "github.com/pokt-network/poktroll/telemetry" "github.com/pokt-network/poktroll/x/shared" + sharedtypes "github.com/pokt-network/poktroll/x/shared/types" "github.com/pokt-network/poktroll/x/supplier/types" ) @@ -36,6 +37,17 @@ func (k msgServer) UnstakeSupplier( logger.Info(fmt.Sprintf("Supplier not found. Cannot unstake address %s", msg.Address)) return nil, types.ErrSupplierNotFound } + + // Ensure the singer address matches the owner address or the operator address. + if !supplier.HasOperator(msg.Signer) && !supplier.HasOwner(msg.Signer) { + logger.Error("only the supplier owner or operator is allowed to unstake the supplier") + return nil, sharedtypes.ErrSharedUnauthorizedSupplierUpdate.Wrapf( + "signer %q is not allowed to unstake supplier %v", + msg.Signer, + supplier, + ) + } + logger.Info(fmt.Sprintf("Supplier found. Unstaking supplier for address %s", msg.Address)) // Check if the supplier has already initiated the unstake action. diff --git a/x/supplier/keeper/unbond_suppliers.go b/x/supplier/keeper/unbond_suppliers.go index ec7c761c7..e606e4963 100644 --- a/x/supplier/keeper/unbond_suppliers.go +++ b/x/supplier/keeper/unbond_suppliers.go @@ -39,20 +39,27 @@ func (k Keeper) EndBlockerUnbondSuppliers(ctx context.Context) error { continue } + // Retrieve the owner address of the supplier. + ownerAddress, err := cosmostypes.AccAddressFromBech32(supplier.OwnerAddress) + if err != nil { + logger.Error(fmt.Sprintf("could not parse the owner address %s", supplier.OwnerAddress)) + return err + } + // Retrieve the address of the supplier. supplierAddress, err := cosmostypes.AccAddressFromBech32(supplier.Address) if err != nil { - logger.Error(fmt.Sprintf("could not parse address %s", supplier.Address)) + logger.Error(fmt.Sprintf("could not parse the operator address %s", supplier.Address)) return err } // Send the coins from the supplier pool back to the supplier. if err = k.bankKeeper.SendCoinsFromModuleToAccount( - ctx, types.ModuleName, supplierAddress, []cosmostypes.Coin{*supplier.Stake}, + ctx, types.ModuleName, ownerAddress, []cosmostypes.Coin{*supplier.Stake}, ); err != nil { logger.Error(fmt.Sprintf( "could not send %s coins from %s module to %s account due to %s", - supplier.Stake.String(), supplierAddress, types.ModuleName, err, + supplier.Stake.String(), ownerAddress, types.ModuleName, err, )) return err } diff --git a/x/supplier/module/tx_stake_supplier.go b/x/supplier/module/tx_stake_supplier.go index a9dd920cf..4628882ec 100644 --- a/x/supplier/module/tx_stake_supplier.go +++ b/x/supplier/module/tx_stake_supplier.go @@ -27,7 +27,7 @@ func CmdStakeSupplier() *cobra.Command { will stake the tokens and associate them with the supplier specified by the 'from' address. Example: -$ poktrolld tx supplier stake-supplier --config stake_config.yaml --keyring-backend test --from $(APP) --node $(POCKET_NODE) --home $(POKTROLLD_HOME)`, +$ poktrolld tx supplier stake-supplier --config stake_config.yaml --keyring-backend test --from $(OWNER_ADDRESS) --node $(POCKET_NODE) --home $(POKTROLLD_HOME)`, Args: cobra.ExactArgs(0), RunE: func(cmd *cobra.Command, _ []string) (err error) { @@ -36,11 +36,18 @@ $ poktrolld tx supplier stake-supplier --config stake_config.yaml --keyring-back return err } - supplierStakeConfigs, err := config.ParseSupplierConfigs(configContent) + supplierStakeConfigs, err := config.ParseSupplierConfigs(cmd.Context(), configContent) if err != nil { return err } + // Ensure the --from flag is set before getting the client context. + if cmd.Flag(flags.FlagFrom) == nil { + if err = cmd.Flags().Set(flags.FlagFrom, supplierStakeConfigs.OwnerAddress); err != nil { + return err + } + } + clientCtx, err := client.GetClientTxContext(cmd) if err != nil { return err @@ -48,6 +55,8 @@ $ poktrolld tx supplier stake-supplier --config stake_config.yaml --keyring-back msg := types.NewMsgStakeSupplier( clientCtx.GetFromAddress().String(), + supplierStakeConfigs.OwnerAddress, + supplierStakeConfigs.OperatorAddress, supplierStakeConfigs.StakeAmount, supplierStakeConfigs.Services, ) diff --git a/x/supplier/module/tx_unstake_supplier.go b/x/supplier/module/tx_unstake_supplier.go index 9c5fa8633..f104e05fc 100644 --- a/x/supplier/module/tx_unstake_supplier.go +++ b/x/supplier/module/tx_unstake_supplier.go @@ -12,13 +12,13 @@ import ( func CmdUnstakeSupplier() *cobra.Command { // fromAddress & signature is retrieved via `flags.FlagFrom` in the `clientCtx` cmd := &cobra.Command{ - Use: "unstake-supplier", + Use: "unstake-supplier ", Short: "Unstake a supplier", - Long: `Unstake an supplier with the provided parameters. This is a broadcast operation that will unstake the supplier specified by the 'from' address. + Long: `Unstake an supplier with the provided parameters. This is a broadcast operation that will unstake the supplier specified by the and owned by 'from' address. Example: -$ poktrolld --home=$(POKTROLLD_HOME) tx supplier unstake-supplier --keyring-backend test --from $(SUPPLIER) --node $(POCKET_NODE)`, - Args: cobra.ExactArgs(0), +$ poktrolld tx supplier unstake-supplier $(OPERATOR_ADDRESS) --keyring-backend test --from $(SIGNER_ADDRESS) --node $(POCKET_NODE) --home $(POKTROLLD_HOME)`, + Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) (err error) { clientCtx, err := client.GetClientTxContext(cmd) @@ -26,8 +26,14 @@ $ poktrolld --home=$(POKTROLLD_HOME) tx supplier unstake-supplier --keyring-back return err } + // address is the must be the owner or operator address of the supplier + address := args[0] + + signerAddress := clientCtx.GetFromAddress().String() + msg := types.NewMsgUnstakeSupplier( - clientCtx.GetFromAddress().String(), + signerAddress, + address, ) if err := msg.ValidateBasic(); err != nil { return err diff --git a/x/supplier/types/errors.go b/x/supplier/types/errors.go index ce2675285..622d7ed00 100644 --- a/x/supplier/types/errors.go +++ b/x/supplier/types/errors.go @@ -9,14 +9,13 @@ var ( ErrSupplierInvalidSigner = sdkerrors.Register(ModuleName, 1100, "expected gov account as only signer for proposal message") ErrSupplierInvalidStake = sdkerrors.Register(ModuleName, 1101, "invalid supplier stake") ErrSupplierInvalidAddress = sdkerrors.Register(ModuleName, 1102, "invalid address") - ErrSupplierUnauthorized = sdkerrors.Register(ModuleName, 1103, "unauthorized supplier signer") - ErrSupplierNotFound = sdkerrors.Register(ModuleName, 1104, "supplier not found") - ErrSupplierInvalidServiceConfig = sdkerrors.Register(ModuleName, 1105, "invalid service config") - ErrSupplierInvalidSessionStartHeight = sdkerrors.Register(ModuleName, 1106, "invalid session start height") - ErrSupplierInvalidSessionId = sdkerrors.Register(ModuleName, 1107, "invalid session ID") - ErrSupplierInvalidService = sdkerrors.Register(ModuleName, 1108, "invalid service in supplier") - ErrSupplierInvalidSessionEndHeight = sdkerrors.Register(ModuleName, 1109, "invalid session ending height") - ErrSupplierIsUnstaking = sdkerrors.Register(ModuleName, 1110, "supplier is in unbonding period") - ErrSupplierParamsInvalid = sdkerrors.Register(ModuleName, 1111, "invalid supplier params") - ErrSupplierServiceNotFound = sdkerrors.Register(ModuleName, 1112, "service not found") + ErrSupplierNotFound = sdkerrors.Register(ModuleName, 1103, "supplier not found") + ErrSupplierInvalidServiceConfig = sdkerrors.Register(ModuleName, 1104, "invalid service config") + ErrSupplierInvalidSessionStartHeight = sdkerrors.Register(ModuleName, 1105, "invalid session start height") + ErrSupplierInvalidSessionId = sdkerrors.Register(ModuleName, 1106, "invalid session ID") + ErrSupplierInvalidService = sdkerrors.Register(ModuleName, 1107, "invalid service in supplier") + ErrSupplierInvalidSessionEndHeight = sdkerrors.Register(ModuleName, 1108, "invalid session ending height") + ErrSupplierIsUnstaking = sdkerrors.Register(ModuleName, 1109, "supplier is in unbonding period") + ErrSupplierParamsInvalid = sdkerrors.Register(ModuleName, 1110, "invalid supplier params") + ErrSupplierServiceNotFound = sdkerrors.Register(ModuleName, 1111, "service not found") ) diff --git a/x/supplier/types/message_stake_supplier.go b/x/supplier/types/message_stake_supplier.go index 1c9ef498b..399799742 100644 --- a/x/supplier/types/message_stake_supplier.go +++ b/x/supplier/types/message_stake_supplier.go @@ -12,21 +12,35 @@ const TypeMsgStakeSupplier = "stake_supplier" var _ sdk.Msg = (*MsgStakeSupplier)(nil) func NewMsgStakeSupplier( - address string, + signerAddress string, + ownerAddress string, + supplierAddress string, stake sdk.Coin, services []*sharedtypes.SupplierServiceConfig, ) *MsgStakeSupplier { return &MsgStakeSupplier{ - Address: address, - Stake: &stake, - Services: services, + Signer: signerAddress, + OwnerAddress: ownerAddress, + Address: supplierAddress, + Stake: &stake, + Services: services, } } func (msg *MsgStakeSupplier) ValidateBasic() error { + // Validate the owner address + if _, err := sdk.AccAddressFromBech32(msg.OwnerAddress); err != nil { + return ErrSupplierInvalidAddress.Wrapf("invalid owner address %s; (%v)", msg.OwnerAddress, err) + } + // Validate the address if _, err := sdk.AccAddressFromBech32(msg.Address); err != nil { - return ErrSupplierInvalidAddress.Wrapf("invalid supplier address %s; (%v)", msg.Address, err) + return ErrSupplierInvalidAddress.Wrapf("invalid operator address %s; (%v)", msg.Address, err) + } + + // Validate the signer address + if _, err := sdk.AccAddressFromBech32(msg.Signer); err != nil { + return ErrSupplierInvalidAddress.Wrapf("invalid signer address %s; (%v)", msg.Address, err) } // TODO_MAINNET: Centralize stake related verification and share across different @@ -56,3 +70,7 @@ func (msg *MsgStakeSupplier) ValidateBasic() error { return nil } + +func (msg *MsgStakeSupplier) IsSigner(address string) bool { + return address == msg.Signer +} diff --git a/x/supplier/types/message_unstake_supplier.go b/x/supplier/types/message_unstake_supplier.go index 245317ebf..b0e42dbed 100644 --- a/x/supplier/types/message_unstake_supplier.go +++ b/x/supplier/types/message_unstake_supplier.go @@ -6,15 +6,21 @@ const TypeMsgUnstakeSupplier = "unstake_supplier" var _ sdk.Msg = (*MsgUnstakeSupplier)(nil) -func NewMsgUnstakeSupplier(address string) *MsgUnstakeSupplier { +func NewMsgUnstakeSupplier(signerAddress, address string) *MsgUnstakeSupplier { return &MsgUnstakeSupplier{ + Signer: signerAddress, Address: address, } } func (msg *MsgUnstakeSupplier) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.Signer); err != nil { + return ErrSupplierInvalidAddress.Wrapf("invalid address address (%s)", err) + } + if _, err := sdk.AccAddressFromBech32(msg.Address); err != nil { return ErrSupplierInvalidAddress.Wrapf("invalid address address (%s)", err) } + return nil } diff --git a/x/supplier/types/tx.pb.go b/x/supplier/types/tx.pb.go index ce0018a0f..45cb59c25 100644 --- a/x/supplier/types/tx.pb.go +++ b/x/supplier/types/tx.pb.go @@ -128,9 +128,11 @@ func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo type MsgStakeSupplier struct { - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - Stake *types.Coin `protobuf:"bytes,2,opt,name=stake,proto3" json:"stake,omitempty"` - Services []*types1.SupplierServiceConfig `protobuf:"bytes,3,rep,name=services,proto3" json:"services,omitempty"` + Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` + OwnerAddress string `protobuf:"bytes,2,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty"` + Address string `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"` + Stake *types.Coin `protobuf:"bytes,4,opt,name=stake,proto3" json:"stake,omitempty"` + Services []*types1.SupplierServiceConfig `protobuf:"bytes,5,rep,name=services,proto3" json:"services,omitempty"` } func (m *MsgStakeSupplier) Reset() { *m = MsgStakeSupplier{} } @@ -166,6 +168,20 @@ func (m *MsgStakeSupplier) XXX_DiscardUnknown() { var xxx_messageInfo_MsgStakeSupplier proto.InternalMessageInfo +func (m *MsgStakeSupplier) GetSigner() string { + if m != nil { + return m.Signer + } + return "" +} + +func (m *MsgStakeSupplier) GetOwnerAddress() string { + if m != nil { + return m.OwnerAddress + } + return "" +} + func (m *MsgStakeSupplier) GetAddress() string { if m != nil { return m.Address @@ -224,7 +240,8 @@ func (m *MsgStakeSupplierResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgStakeSupplierResponse proto.InternalMessageInfo type MsgUnstakeSupplier struct { - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` + Address string `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"` } func (m *MsgUnstakeSupplier) Reset() { *m = MsgUnstakeSupplier{} } @@ -260,6 +277,13 @@ func (m *MsgUnstakeSupplier) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUnstakeSupplier proto.InternalMessageInfo +func (m *MsgUnstakeSupplier) GetSigner() string { + if m != nil { + return m.Signer + } + return "" +} + func (m *MsgUnstakeSupplier) GetAddress() string { if m != nil { return m.Address @@ -315,41 +339,43 @@ func init() { func init() { proto.RegisterFile("poktroll/supplier/tx.proto", fileDescriptor_63b974929807ef57) } var fileDescriptor_63b974929807ef57 = []byte{ - // 538 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x53, 0xb1, 0x6f, 0xd3, 0x4e, - 0x18, 0x8d, 0x1b, 0xb5, 0xbf, 0x5f, 0xae, 0x45, 0xa5, 0x56, 0xa5, 0x3a, 0x16, 0x98, 0xc8, 0x15, - 0x28, 0x0a, 0x8a, 0x4f, 0x09, 0x52, 0x87, 0x8a, 0x85, 0x74, 0x44, 0x91, 0x90, 0x23, 0x18, 0x18, - 0x40, 0x97, 0xe4, 0xb8, 0x58, 0x89, 0x7d, 0xd6, 0xdd, 0x25, 0xb4, 0x1b, 0x62, 0x64, 0xe2, 0xcf, - 0x60, 0xcc, 0xc0, 0xc0, 0xc6, 0x5a, 0xb6, 0x8a, 0x89, 0x09, 0xa1, 0x64, 0xc8, 0xbf, 0x81, 0xec, - 0xbb, 0x73, 0x88, 0x13, 0xd4, 0x4a, 0x2c, 0x89, 0x7d, 0xef, 0x7d, 0xdf, 0x7b, 0xef, 0xfb, 0x7c, - 0xc0, 0x8e, 0xe9, 0x50, 0x30, 0x3a, 0x1a, 0x41, 0x3e, 0x8e, 0xe3, 0x51, 0x80, 0x19, 0x14, 0xe7, - 0x5e, 0xcc, 0xa8, 0xa0, 0xe6, 0x81, 0xc6, 0x3c, 0x8d, 0xd9, 0x07, 0x28, 0x0c, 0x22, 0x0a, 0xd3, - 0x5f, 0xc9, 0xb2, 0x8f, 0x7a, 0x94, 0x87, 0x94, 0xc3, 0x90, 0x13, 0x38, 0x69, 0x24, 0x7f, 0x0a, - 0x28, 0x4b, 0xe0, 0x75, 0xfa, 0x06, 0xe5, 0x8b, 0x82, 0x0e, 0x09, 0x25, 0x54, 0x9e, 0x27, 0x4f, - 0xea, 0xd4, 0x51, 0x9d, 0xba, 0x88, 0x63, 0x38, 0x69, 0x74, 0xb1, 0x40, 0x0d, 0xd8, 0xa3, 0x41, - 0xa4, 0xf1, 0x75, 0xaf, 0x31, 0x62, 0x28, 0xd4, 0x5d, 0xef, 0x2e, 0xf1, 0x01, 0x62, 0xb8, 0x0f, - 0x39, 0x66, 0x93, 0xa0, 0x87, 0x25, 0xec, 0x7e, 0x35, 0xc0, 0x7e, 0x9b, 0x93, 0xe7, 0x71, 0x1f, - 0x09, 0xfc, 0x2c, 0x2d, 0x34, 0x4f, 0x40, 0x09, 0x8d, 0xc5, 0x80, 0xb2, 0x40, 0x5c, 0x58, 0x46, - 0xc5, 0xa8, 0x96, 0x5a, 0xd6, 0xf7, 0xcf, 0xf5, 0x43, 0xe5, 0xf6, 0x49, 0xbf, 0xcf, 0x30, 0xe7, - 0x1d, 0xc1, 0x82, 0x88, 0xf8, 0x4b, 0xaa, 0xf9, 0x18, 0xec, 0x48, 0x69, 0x6b, 0xab, 0x62, 0x54, - 0x77, 0x9b, 0x65, 0x6f, 0x6d, 0x56, 0x9e, 0x94, 0x68, 0x95, 0x2e, 0x7f, 0xde, 0x2b, 0x7c, 0x5a, - 0x4c, 0x6b, 0x86, 0xaf, 0x6a, 0x4e, 0x4f, 0xde, 0x2f, 0xa6, 0xb5, 0x65, 0xb7, 0x0f, 0x8b, 0x69, - 0xed, 0x38, 0xf3, 0x7e, 0xbe, 0x4c, 0x97, 0x73, 0xeb, 0x96, 0xc1, 0x51, 0xee, 0xc8, 0xc7, 0x3c, - 0xa6, 0x11, 0xc7, 0xee, 0x37, 0x03, 0xdc, 0x6e, 0x73, 0xd2, 0x11, 0x68, 0x88, 0x3b, 0xaa, 0xde, - 0x6c, 0x82, 0xff, 0x90, 0x4c, 0x70, 0x6d, 0x36, 0x4d, 0x34, 0x21, 0xd8, 0xe6, 0x49, 0x93, 0x2c, - 0x98, 0xa2, 0x27, 0x4b, 0xf1, 0xd4, 0x52, 0xbc, 0x33, 0x1a, 0x44, 0xbe, 0xe4, 0x99, 0x2d, 0xf0, - 0xbf, 0x9a, 0x33, 0xb7, 0x8a, 0x95, 0x62, 0x75, 0xb7, 0xf9, 0xe0, 0x8f, 0x61, 0xa4, 0x8b, 0xf0, - 0xb4, 0xa3, 0x8e, 0x24, 0x9e, 0xd1, 0xe8, 0x4d, 0x40, 0xfc, 0xac, 0xee, 0x74, 0x2f, 0x19, 0x88, - 0xb6, 0xe0, 0xda, 0xc0, 0xca, 0x47, 0xc9, 0x72, 0xbe, 0x00, 0x66, 0x32, 0x82, 0x88, 0xff, 0x6b, - 0xd0, 0x9c, 0xe6, 0x1d, 0x60, 0xaf, 0xf7, 0xd5, 0xaa, 0xcd, 0x2f, 0x5b, 0xa0, 0xd8, 0xe6, 0xc4, - 0x7c, 0x05, 0xf6, 0x56, 0x3e, 0x1f, 0x77, 0xc3, 0xda, 0x73, 0x1b, 0xb2, 0x6b, 0xd7, 0x73, 0xb4, - 0x8e, 0x89, 0xc0, 0xad, 0xd5, 0x0d, 0x1e, 0x6f, 0x2e, 0x5e, 0x21, 0xd9, 0x0f, 0x6f, 0x40, 0xca, - 0x24, 0x08, 0xd8, 0xcf, 0x4f, 0xef, 0xfe, 0x5f, 0x1c, 0xae, 0xd2, 0xec, 0xfa, 0x8d, 0x68, 0x5a, - 0xc8, 0xde, 0x7e, 0x97, 0x7c, 0xf3, 0xad, 0xa7, 0x97, 0x33, 0xc7, 0xb8, 0x9a, 0x39, 0xc6, 0xaf, - 0x99, 0x63, 0x7c, 0x9c, 0x3b, 0x85, 0xab, 0xb9, 0x53, 0xf8, 0x31, 0x77, 0x0a, 0x2f, 0x1b, 0x24, - 0x10, 0x83, 0x71, 0xd7, 0xeb, 0xd1, 0x10, 0x26, 0x9d, 0xeb, 0x11, 0x16, 0x6f, 0x29, 0x1b, 0xc2, - 0x4d, 0x57, 0x41, 0x5c, 0xc4, 0x98, 0x77, 0x77, 0xd2, 0x9b, 0xfc, 0xe8, 0x77, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x5d, 0x53, 0x46, 0x3c, 0xb6, 0x04, 0x00, 0x00, + // 574 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xbf, 0x8f, 0x12, 0x41, + 0x18, 0x65, 0x41, 0x50, 0x86, 0xbb, 0x9c, 0x37, 0xb9, 0xe4, 0x96, 0x8d, 0xae, 0x84, 0x8b, 0x86, + 0x60, 0xd8, 0x11, 0x4c, 0xae, 0xb8, 0x68, 0x21, 0x57, 0x1a, 0x12, 0x03, 0xb1, 0xb1, 0xf0, 0x32, + 0xc0, 0x38, 0x6c, 0x80, 0x9d, 0xcd, 0xcc, 0xc0, 0xdd, 0x75, 0xc6, 0xc6, 0xc4, 0xca, 0x3f, 0xc3, + 0x92, 0xc2, 0x42, 0x2b, 0xdb, 0x2b, 0x2f, 0x56, 0x56, 0xc6, 0x40, 0xc1, 0xbf, 0x61, 0x76, 0x77, + 0x06, 0xe4, 0x87, 0x72, 0xf1, 0x1a, 0x60, 0xe7, 0xbd, 0xf7, 0x7d, 0xef, 0x7b, 0xf3, 0x2d, 0xc0, + 0xf2, 0x59, 0x57, 0x72, 0xd6, 0xeb, 0x21, 0x31, 0xf0, 0xfd, 0x9e, 0x4b, 0x38, 0x92, 0x67, 0x8e, + 0xcf, 0x99, 0x64, 0x70, 0x57, 0x63, 0x8e, 0xc6, 0xac, 0x5d, 0xdc, 0x77, 0x3d, 0x86, 0xc2, 0xcf, + 0x88, 0x65, 0xed, 0xb7, 0x98, 0xe8, 0x33, 0x81, 0xfa, 0x82, 0xa2, 0x61, 0x39, 0xf8, 0x52, 0x40, + 0x36, 0x02, 0x4e, 0xc2, 0x27, 0x14, 0x3d, 0x28, 0x68, 0x8f, 0x32, 0xca, 0xa2, 0xf3, 0xe0, 0x97, + 0x3a, 0xb5, 0x55, 0xa5, 0x26, 0x16, 0x04, 0x0d, 0xcb, 0x4d, 0x22, 0x71, 0x19, 0xb5, 0x98, 0xeb, + 0x69, 0x7c, 0xd5, 0xab, 0x8f, 0x39, 0xee, 0xeb, 0xaa, 0x77, 0xe7, 0x78, 0x07, 0x73, 0xd2, 0x46, + 0x82, 0xf0, 0xa1, 0xdb, 0x22, 0x11, 0x9c, 0xff, 0x66, 0x80, 0x9d, 0x9a, 0xa0, 0x2f, 0xfd, 0x36, + 0x96, 0xe4, 0x45, 0x28, 0x84, 0x87, 0x20, 0x8d, 0x07, 0xb2, 0xc3, 0xb8, 0x2b, 0xcf, 0x4d, 0x23, + 0x67, 0x14, 0xd2, 0x55, 0xf3, 0xfb, 0xe7, 0xd2, 0x9e, 0x72, 0xfb, 0xac, 0xdd, 0xe6, 0x44, 0x88, + 0x86, 0xe4, 0xae, 0x47, 0xeb, 0x73, 0x2a, 0x7c, 0x02, 0x52, 0x51, 0x6b, 0x33, 0x9e, 0x33, 0x0a, + 0x99, 0x4a, 0xd6, 0x59, 0xc9, 0xca, 0x89, 0x5a, 0x54, 0xd3, 0x17, 0x3f, 0xef, 0xc5, 0x3e, 0x4d, + 0x47, 0x45, 0xa3, 0xae, 0x34, 0x47, 0x87, 0xef, 0xa6, 0xa3, 0xe2, 0xbc, 0xda, 0x87, 0xe9, 0xa8, + 0x78, 0x30, 0xf3, 0x7e, 0x36, 0x9f, 0x6e, 0xc9, 0x6d, 0x3e, 0x0b, 0xf6, 0x97, 0x8e, 0xea, 0x44, + 0xf8, 0xcc, 0x13, 0x24, 0xff, 0x35, 0x0e, 0x6e, 0xd7, 0x04, 0x6d, 0x48, 0xdc, 0x25, 0x0d, 0xa5, + 0x87, 0x8f, 0x40, 0x4a, 0xb8, 0xd4, 0x23, 0x7c, 0xe3, 0x68, 0x8a, 0x07, 0x9f, 0x82, 0x6d, 0x76, + 0xea, 0x11, 0x7e, 0x82, 0x23, 0x38, 0x1c, 0xef, 0x5f, 0xc2, 0xad, 0x90, 0xae, 0xce, 0x60, 0x05, + 0xdc, 0xd4, 0xc2, 0xc4, 0x06, 0xa1, 0x26, 0x42, 0x04, 0x92, 0x22, 0x70, 0x6d, 0xde, 0x50, 0x49, + 0x2a, 0x7a, 0xb0, 0x05, 0x8e, 0xda, 0x02, 0xe7, 0x98, 0xb9, 0x5e, 0x3d, 0xe2, 0xc1, 0x2a, 0xb8, + 0xa5, 0x2e, 0x56, 0x98, 0xc9, 0x5c, 0xa2, 0x90, 0xa9, 0x3c, 0xf8, 0x23, 0xfd, 0xf0, 0xe6, 0x1d, + 0x1d, 0x41, 0x23, 0x22, 0x1e, 0x33, 0xef, 0x8d, 0x4b, 0xeb, 0x33, 0xdd, 0x51, 0x26, 0xb8, 0x01, + 0x35, 0x74, 0xde, 0x02, 0xe6, 0x72, 0x74, 0xb3, 0x5c, 0xdf, 0x1b, 0x00, 0x06, 0x99, 0x7b, 0xe2, + 0x9a, 0xc9, 0xfe, 0x47, 0x34, 0x8b, 0x2e, 0xef, 0x00, 0x6b, 0xd5, 0x88, 0xf6, 0x59, 0xf9, 0x12, + 0x07, 0x89, 0x9a, 0xa0, 0xf0, 0x35, 0xd8, 0x5a, 0x58, 0xf0, 0xfc, 0x9a, 0xc5, 0x5c, 0xda, 0x21, + 0xab, 0xb8, 0x99, 0xa3, 0xfb, 0x40, 0x0c, 0xb6, 0x17, 0x77, 0xec, 0x60, 0xbd, 0x78, 0x81, 0x64, + 0x3d, 0xbc, 0x02, 0x69, 0xd6, 0x82, 0x82, 0x9d, 0xe5, 0xb8, 0xef, 0xff, 0xc5, 0xe1, 0x22, 0xcd, + 0x2a, 0x5d, 0x89, 0xa6, 0x1b, 0x59, 0xc9, 0xb7, 0xc1, 0x5b, 0x59, 0x7d, 0x7e, 0x31, 0xb6, 0x8d, + 0xcb, 0xb1, 0x6d, 0xfc, 0x1a, 0xdb, 0xc6, 0xc7, 0x89, 0x1d, 0xbb, 0x9c, 0xd8, 0xb1, 0x1f, 0x13, + 0x3b, 0xf6, 0xaa, 0x4c, 0x5d, 0xd9, 0x19, 0x34, 0x9d, 0x16, 0xeb, 0xa3, 0xa0, 0x72, 0xc9, 0x23, + 0xf2, 0x94, 0xf1, 0x2e, 0x5a, 0xf7, 0xb2, 0xca, 0x73, 0x9f, 0x88, 0x66, 0x2a, 0xfc, 0xaf, 0x79, + 0xfc, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x5c, 0x81, 0xd3, 0xc0, 0x58, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -602,7 +628,7 @@ func (m *MsgStakeSupplier) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintTx(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a + dAtA[i] = 0x2a } } if m.Stake != nil { @@ -615,13 +641,27 @@ func (m *MsgStakeSupplier) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintTx(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 + dAtA[i] = 0x22 } if len(m.Address) > 0 { i -= len(m.Address) copy(dAtA[i:], m.Address) i = encodeVarintTx(dAtA, i, uint64(len(m.Address))) i-- + dAtA[i] = 0x1a + } + if len(m.OwnerAddress) > 0 { + i -= len(m.OwnerAddress) + copy(dAtA[i:], m.OwnerAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.OwnerAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- dAtA[i] = 0xa } return len(dAtA) - i, nil @@ -675,6 +715,13 @@ func (m *MsgUnstakeSupplier) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.Address) i = encodeVarintTx(dAtA, i, uint64(len(m.Address))) i-- + dAtA[i] = 0x1a + } + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- dAtA[i] = 0xa } return len(dAtA) - i, nil @@ -744,6 +791,14 @@ func (m *MsgStakeSupplier) Size() (n int) { } var l int _ = l + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.OwnerAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } l = len(m.Address) if l > 0 { n += 1 + l + sovTx(uint64(l)) @@ -776,6 +831,10 @@ func (m *MsgUnstakeSupplier) Size() (n int) { } var l int _ = l + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } l = len(m.Address) if l > 0 { n += 1 + l + sovTx(uint64(l)) @@ -993,6 +1052,70 @@ func (m *MsgStakeSupplier) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OwnerAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OwnerAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) } @@ -1024,7 +1147,7 @@ func (m *MsgStakeSupplier) Unmarshal(dAtA []byte) error { } m.Address = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Stake", wireType) } @@ -1060,7 +1183,7 @@ func (m *MsgStakeSupplier) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 3: + case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Services", wireType) } @@ -1195,6 +1318,38 @@ func (m *MsgUnstakeSupplier) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) } diff --git a/x/tokenomics/keeper/token_logic_modules.go b/x/tokenomics/keeper/token_logic_modules.go index c0a10ebbe..25794f7f4 100644 --- a/x/tokenomics/keeper/token_logic_modules.go +++ b/x/tokenomics/keeper/token_logic_modules.go @@ -252,7 +252,7 @@ func (k Keeper) TokenLogicModuleRelayBurnEqualsMint( ) error { logger := k.Logger().With("method", "TokenLogicModuleRelayBurnEqualsMint") - supplierAddr, err := cosmostypes.AccAddressFromBech32(supplier.Address) + ownerAddr, err := cosmostypes.AccAddressFromBech32(supplier.OwnerAddress) if err != nil { return err } @@ -278,7 +278,7 @@ func (k Keeper) TokenLogicModuleRelayBurnEqualsMint( // Send the newley minted uPOKT from the supplier module account // to the supplier's account. if err = k.bankKeeper.SendCoinsFromModuleToAccount( - ctx, suppliertypes.ModuleName, supplierAddr, sdk.NewCoins(settlementCoins), + ctx, suppliertypes.ModuleName, ownerAddr, sdk.NewCoins(settlementCoins), ); err != nil { return tokenomicstypes.ErrTokenomicsSupplierModuleSendFailed.Wrapf( "sending (%s) to supplier with address %s: %v", @@ -357,7 +357,7 @@ func (k Keeper) TokenLogicModuleGlobalMint( logger.Debug(fmt.Sprintf("sent (%v) newley minted coins from the tokenomics module to the application with address %q", appCoins, application.Address)) // Send a portion of the rewards to the supplier - supplierCoins, err := k.sendRewardsToAccount(ctx, supplier.Address, newMintAmtFloat, MintAllocationSupplier) + supplierCoins, err := k.sendRewardsToAccount(ctx, supplier.OwnerAddress, newMintAmtFloat, MintAllocationSupplier) if err != nil { return tokenomictypes.ErrTokenomicsSendingMindRewards.Wrapf("sending rewards to supplier: %v", err) } diff --git a/x/tokenomics/module/module.go b/x/tokenomics/module/module.go index e6ef6c7b5..d6c79ce91 100644 --- a/x/tokenomics/module/module.go +++ b/x/tokenomics/module/module.go @@ -97,6 +97,7 @@ type AppModule struct { tokenomicsKeeper keeper.Keeper accountKeeper types.AccountKeeper bankKeeper types.BankKeeper + supplierKeeper types.SupplierKeeper } func NewAppModule( @@ -104,12 +105,14 @@ func NewAppModule( tokenomicsKeeper keeper.Keeper, accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, + supplierKeeper types.SupplierKeeper, ) AppModule { return AppModule{ AppModuleBasic: NewAppModuleBasic(cdc), tokenomicsKeeper: tokenomicsKeeper, accountKeeper: accountKeeper, bankKeeper: bankKeeper, + supplierKeeper: supplierKeeper, } } @@ -220,6 +223,7 @@ func ProvideModule(in ModuleInputs) ModuleOutputs { k, in.AccountKeeper, in.BankKeeper, + in.SupplierKeeper, ) return ModuleOutputs{TokenomicsKeeper: k, Module: m} diff --git a/x/tokenomics/types/errors.go b/x/tokenomics/types/errors.go index 4f02c5d44..5538516aa 100644 --- a/x/tokenomics/types/errors.go +++ b/x/tokenomics/types/errors.go @@ -30,4 +30,5 @@ var ( ErrTokenomicsModuleMintFailed = sdkerrors.Register(ModuleName, 1121, "failed to mint uPOKT to tokenomics module account") ErrTokenomicsSendingMindRewards = sdkerrors.Register(ModuleName, 1122, "failed to send minted rewards") ErrTokenomicsSupplierModuleMintFailed = sdkerrors.Register(ModuleName, 1123, "failed to mint uPOKT to supplier module account") + ErrTokenomicsSupplierOwnerAddressInvalid = sdkerrors.Register(ModuleName, 1124, "the supplier owner address in the claim is not a valid bech32 address") ) diff --git a/x/tokenomics/types/tx.pb.go b/x/tokenomics/types/tx.pb.go index 03eea41a6..6a9db5288 100644 --- a/x/tokenomics/types/tx.pb.go +++ b/x/tokenomics/types/tx.pb.go @@ -130,9 +130,10 @@ type MsgUpdateParam struct { // authority is the address that controls the module (defaults to x/gov unless overwritten). Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` // The (name, as_type) tuple must match the corresponding name and type as - // specified in the `Params`` message in `proof/params.proto.` + // specified in the `Params“ message in `proof/params.proto.` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // Types that are valid to be assigned to AsType: + // // *MsgUpdateParam_AsString // *MsgUpdateParam_AsInt64 // *MsgUpdateParam_AsBytes