From b882d914e2613ea374cd04b2050bd7426e1c8173 Mon Sep 17 00:00:00 2001 From: hunshenshi <289517357@qq.com> Date: Fri, 12 Jul 2024 21:42:02 +0800 Subject: [PATCH] feat(hermes): add bucket reward --- api/api_hermes.graphql.go | 178 ++++++- api/api_hermes.pb.go | 877 +++++++++++++++++++++++------------ api/api_hermes.pb.gw.go | 81 ++++ api/api_hermes_grpc.pb.go | 42 +- apiservice/hermes.go | 28 ++ apiservice/hermes_service.go | 124 +++++ common/rewards/hermes.go | 91 ++++ proto/api_hermes.proto | 31 ++ 8 files changed, 1151 insertions(+), 301 deletions(-) diff --git a/api/api_hermes.graphql.go b/api/api_hermes.graphql.go index 545d15a..3672e2d 100644 --- a/api/api_hermes.graphql.go +++ b/api/api_hermes.graphql.go @@ -27,9 +27,12 @@ var ( gql__type_HermesByDelegateResponse *graphql.Object // message HermesByDelegateResponse in api_hermes.proto gql__type_HermesByDelegateRequest *graphql.Object // message HermesByDelegateRequest in api_hermes.proto gql__type_HermesByDelegateDistributionRatio *graphql.Object // message HermesByDelegateDistributionRatio in api_hermes.proto + gql__type_HermesBucketResponse *graphql.Object // message HermesBucketResponse in api_hermes.proto + gql__type_HermesBucketDistribution *graphql.Object // message HermesBucketDistribution in api_hermes.proto gql__type_HermesAverageStatsResponse_AveragePerEpoch *graphql.Object // message HermesAverageStatsResponse.AveragePerEpoch in api_hermes.proto gql__type_HermesAverageStatsResponse *graphql.Object // message HermesAverageStatsResponse in api_hermes.proto gql__type_HermesAverageStatsRequest *graphql.Object // message HermesAverageStatsRequest in api_hermes.proto + gql__type_BucketRewardDistribution *graphql.Object // message BucketRewardDistribution in api_hermes.proto gql__input_RewardDistribution *graphql.InputObject // message RewardDistribution in api_hermes.proto gql__input_HermesResponse *graphql.InputObject // message HermesResponse in api_hermes.proto gql__input_HermesRequest *graphql.InputObject // message HermesRequest in api_hermes.proto @@ -45,9 +48,12 @@ var ( gql__input_HermesByDelegateResponse *graphql.InputObject // message HermesByDelegateResponse in api_hermes.proto gql__input_HermesByDelegateRequest *graphql.InputObject // message HermesByDelegateRequest in api_hermes.proto gql__input_HermesByDelegateDistributionRatio *graphql.InputObject // message HermesByDelegateDistributionRatio in api_hermes.proto + gql__input_HermesBucketResponse *graphql.InputObject // message HermesBucketResponse in api_hermes.proto + gql__input_HermesBucketDistribution *graphql.InputObject // message HermesBucketDistribution in api_hermes.proto gql__input_HermesAverageStatsResponse_AveragePerEpoch *graphql.InputObject // message HermesAverageStatsResponse.AveragePerEpoch in api_hermes.proto gql__input_HermesAverageStatsResponse *graphql.InputObject // message HermesAverageStatsResponse in api_hermes.proto gql__input_HermesAverageStatsRequest *graphql.InputObject // message HermesAverageStatsRequest in api_hermes.proto + gql__input_BucketRewardDistribution *graphql.InputObject // message BucketRewardDistribution in api_hermes.proto ) func Gql__type_RewardDistribution() *graphql.Object { @@ -392,6 +398,49 @@ func Gql__type_HermesByDelegateDistributionRatio() *graphql.Object { return gql__type_HermesByDelegateDistributionRatio } +func Gql__type_HermesBucketResponse() *graphql.Object { + if gql__type_HermesBucketResponse == nil { + gql__type_HermesBucketResponse = graphql.NewObject(graphql.ObjectConfig{ + Name: "Api_Type_HermesBucketResponse", + Fields: graphql.Fields{ + "hermesBucketDistribution": &graphql.Field{ + Type: graphql.NewList(Gql__type_HermesBucketDistribution()), + }, + }, + }) + } + return gql__type_HermesBucketResponse +} + +func Gql__type_HermesBucketDistribution() *graphql.Object { + if gql__type_HermesBucketDistribution == nil { + gql__type_HermesBucketDistribution = graphql.NewObject(graphql.ObjectConfig{ + Name: "Api_Type_HermesBucketDistribution", + Fields: graphql.Fields{ + "delegateName": &graphql.Field{ + Type: graphql.String, + }, + "bucketRewardDistribution": &graphql.Field{ + Type: graphql.NewList(Gql__type_BucketRewardDistribution()), + }, + "stakingIotexAddress": &graphql.Field{ + Type: graphql.String, + }, + "voterCount": &graphql.Field{ + Type: graphql.Int, + }, + "waiveServiceFee": &graphql.Field{ + Type: graphql.Boolean, + }, + "refund": &graphql.Field{ + Type: graphql.String, + }, + }, + }) + } + return gql__type_HermesBucketDistribution +} + func Gql__type_HermesAverageStatsResponse_AveragePerEpoch() *graphql.Object { if gql__type_HermesAverageStatsResponse_AveragePerEpoch == nil { gql__type_HermesAverageStatsResponse_AveragePerEpoch = graphql.NewObject(graphql.ObjectConfig{ @@ -449,6 +498,29 @@ func Gql__type_HermesAverageStatsRequest() *graphql.Object { return gql__type_HermesAverageStatsRequest } +func Gql__type_BucketRewardDistribution() *graphql.Object { + if gql__type_BucketRewardDistribution == nil { + gql__type_BucketRewardDistribution = graphql.NewObject(graphql.ObjectConfig{ + Name: "Api_Type_BucketRewardDistribution", + Fields: graphql.Fields{ + "voterEthAddress": &graphql.Field{ + Type: graphql.String, + }, + "voterIotexAddress": &graphql.Field{ + Type: graphql.String, + }, + "bucketID": &graphql.Field{ + Type: graphql.Int, + }, + "amount": &graphql.Field{ + Type: graphql.String, + }, + }, + }) + } + return gql__type_BucketRewardDistribution +} + func Gql__input_RewardDistribution() *graphql.InputObject { if gql__input_RewardDistribution == nil { gql__input_RewardDistribution = graphql.NewInputObject(graphql.InputObjectConfig{ @@ -791,6 +863,49 @@ func Gql__input_HermesByDelegateDistributionRatio() *graphql.InputObject { return gql__input_HermesByDelegateDistributionRatio } +func Gql__input_HermesBucketResponse() *graphql.InputObject { + if gql__input_HermesBucketResponse == nil { + gql__input_HermesBucketResponse = graphql.NewInputObject(graphql.InputObjectConfig{ + Name: "Api_Input_HermesBucketResponse", + Fields: graphql.InputObjectConfigFieldMap{ + "hermesBucketDistribution": &graphql.InputObjectFieldConfig{ + Type: graphql.NewList(Gql__input_HermesBucketDistribution()), + }, + }, + }) + } + return gql__input_HermesBucketResponse +} + +func Gql__input_HermesBucketDistribution() *graphql.InputObject { + if gql__input_HermesBucketDistribution == nil { + gql__input_HermesBucketDistribution = graphql.NewInputObject(graphql.InputObjectConfig{ + Name: "Api_Input_HermesBucketDistribution", + Fields: graphql.InputObjectConfigFieldMap{ + "delegateName": &graphql.InputObjectFieldConfig{ + Type: graphql.String, + }, + "bucketRewardDistribution": &graphql.InputObjectFieldConfig{ + Type: graphql.NewList(Gql__input_BucketRewardDistribution()), + }, + "stakingIotexAddress": &graphql.InputObjectFieldConfig{ + Type: graphql.String, + }, + "voterCount": &graphql.InputObjectFieldConfig{ + Type: graphql.Int, + }, + "waiveServiceFee": &graphql.InputObjectFieldConfig{ + Type: graphql.Boolean, + }, + "refund": &graphql.InputObjectFieldConfig{ + Type: graphql.String, + }, + }, + }) + } + return gql__input_HermesBucketDistribution +} + func Gql__input_HermesAverageStatsResponse_AveragePerEpoch() *graphql.InputObject { if gql__input_HermesAverageStatsResponse_AveragePerEpoch == nil { gql__input_HermesAverageStatsResponse_AveragePerEpoch = graphql.NewInputObject(graphql.InputObjectConfig{ @@ -848,6 +963,29 @@ func Gql__input_HermesAverageStatsRequest() *graphql.InputObject { return gql__input_HermesAverageStatsRequest } +func Gql__input_BucketRewardDistribution() *graphql.InputObject { + if gql__input_BucketRewardDistribution == nil { + gql__input_BucketRewardDistribution = graphql.NewInputObject(graphql.InputObjectConfig{ + Name: "Api_Input_BucketRewardDistribution", + Fields: graphql.InputObjectConfigFieldMap{ + "voterEthAddress": &graphql.InputObjectFieldConfig{ + Type: graphql.String, + }, + "voterIotexAddress": &graphql.InputObjectFieldConfig{ + Type: graphql.String, + }, + "bucketID": &graphql.InputObjectFieldConfig{ + Type: graphql.Int, + }, + "amount": &graphql.InputObjectFieldConfig{ + Type: graphql.String, + }, + }, + }) + } + return gql__input_BucketRewardDistribution +} + // graphql__resolver_HermesService is a struct for making query, mutation and resolve fields. // This struct must be implemented runtime.SchemaBuilder interface. type graphql__resolver_HermesService struct { @@ -916,6 +1054,32 @@ func (x *graphql__resolver_HermesService) GetQueries(conn *grpc.ClientConn) grap return resp, nil }, }, + "HermesBucket": &graphql.Field{ + Type: Gql__type_HermesBucketResponse(), + Args: graphql.FieldConfigArgument{ + "startEpoch": &graphql.ArgumentConfig{ + Type: graphql.Int, + }, + "epochCount": &graphql.ArgumentConfig{ + Type: graphql.Int, + }, + "rewardAddress": &graphql.ArgumentConfig{ + Type: graphql.NewList(graphql.String), + }, + }, + Resolve: func(p graphql.ResolveParams) (interface{}, error) { + var req HermesRequest + if err := runtime.MarshalRequest(p.Args, &req, false); err != nil { + return nil, errors.Wrap(err, "Failed to marshal request for HermesBucket") + } + client := NewHermesServiceClient(conn) + resp, err := client.HermesBucket(p.Context, &req) + if err != nil { + return nil, errors.Wrap(err, "Failed to call RPC HermesBucket") + } + return resp, nil + }, + }, "HermesByVoter": &graphql.Field{ Type: Gql__type_HermesByVoterResponse(), Args: graphql.FieldConfigArgument{ @@ -1044,14 +1208,14 @@ func RegisterHermesServiceGraphql(mux *runtime.ServeMux) error { // You need to close it maunally when application will terminate. // Otherwise, you can specify automatic opening connection with ServiceOption directive: // -// service HermesService { -// option (graphql.service) = { -// host: "host:port" -// insecure: true or false -// }; +// service HermesService { +// option (graphql.service) = { +// host: "host:port" +// insecure: true or false +// }; // -// ...with RPC definitions -// } +// ...with RPC definitions +// } func RegisterHermesServiceGraphqlHandler(mux *runtime.ServeMux, conn *grpc.ClientConn) error { return mux.AddHandler(new_graphql_resolver_HermesService(conn)) } diff --git a/api/api_hermes.pb.go b/api/api_hermes.pb.go index 707cd20..a0835da 100644 --- a/api/api_hermes.pb.go +++ b/api/api_hermes.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.32.0 -// protoc v3.17.3 +// protoc-gen-go v1.26.0 +// protoc v5.27.0 // source: api_hermes.proto package api @@ -283,6 +283,211 @@ func (x *HermesResponse) GetHermesDistribution() []*HermesDistribution { return nil } +type BucketRewardDistribution struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + VoterEthAddress string `protobuf:"bytes,1,opt,name=voterEthAddress,proto3" json:"voterEthAddress,omitempty"` // voter’s ERC20 address + VoterIotexAddress string `protobuf:"bytes,2,opt,name=voterIotexAddress,proto3" json:"voterIotexAddress,omitempty"` // voter’s IoTeX address + BucketID uint64 `protobuf:"varint,3,opt,name=bucketID,proto3" json:"bucketID,omitempty"` // voter's bucketID + Amount string `protobuf:"bytes,4,opt,name=amount,proto3" json:"amount,omitempty"` // amount of reward distribution +} + +func (x *BucketRewardDistribution) Reset() { + *x = BucketRewardDistribution{} + if protoimpl.UnsafeEnabled { + mi := &file_api_hermes_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BucketRewardDistribution) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BucketRewardDistribution) ProtoMessage() {} + +func (x *BucketRewardDistribution) ProtoReflect() protoreflect.Message { + mi := &file_api_hermes_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BucketRewardDistribution.ProtoReflect.Descriptor instead. +func (*BucketRewardDistribution) Descriptor() ([]byte, []int) { + return file_api_hermes_proto_rawDescGZIP(), []int{4} +} + +func (x *BucketRewardDistribution) GetVoterEthAddress() string { + if x != nil { + return x.VoterEthAddress + } + return "" +} + +func (x *BucketRewardDistribution) GetVoterIotexAddress() string { + if x != nil { + return x.VoterIotexAddress + } + return "" +} + +func (x *BucketRewardDistribution) GetBucketID() uint64 { + if x != nil { + return x.BucketID + } + return 0 +} + +func (x *BucketRewardDistribution) GetAmount() string { + if x != nil { + return x.Amount + } + return "" +} + +type HermesBucketDistribution struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DelegateName string `protobuf:"bytes,1,opt,name=delegateName,proto3" json:"delegateName,omitempty"` // delegate name + BucketRewardDistribution []*BucketRewardDistribution `protobuf:"bytes,2,rep,name=bucketRewardDistribution,proto3" json:"bucketRewardDistribution,omitempty"` + StakingIotexAddress string `protobuf:"bytes,3,opt,name=stakingIotexAddress,proto3" json:"stakingIotexAddress,omitempty"` // delegate IoTeX staking address + VoterCount uint64 `protobuf:"varint,4,opt,name=voterCount,proto3" json:"voterCount,omitempty"` // number of voters + WaiveServiceFee bool `protobuf:"varint,5,opt,name=waiveServiceFee,proto3" json:"waiveServiceFee,omitempty"` // whether the delegate is qualified for waiving the service fee + Refund string `protobuf:"bytes,6,opt,name=refund,proto3" json:"refund,omitempty"` // amount of refund +} + +func (x *HermesBucketDistribution) Reset() { + *x = HermesBucketDistribution{} + if protoimpl.UnsafeEnabled { + mi := &file_api_hermes_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HermesBucketDistribution) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HermesBucketDistribution) ProtoMessage() {} + +func (x *HermesBucketDistribution) ProtoReflect() protoreflect.Message { + mi := &file_api_hermes_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HermesBucketDistribution.ProtoReflect.Descriptor instead. +func (*HermesBucketDistribution) Descriptor() ([]byte, []int) { + return file_api_hermes_proto_rawDescGZIP(), []int{5} +} + +func (x *HermesBucketDistribution) GetDelegateName() string { + if x != nil { + return x.DelegateName + } + return "" +} + +func (x *HermesBucketDistribution) GetBucketRewardDistribution() []*BucketRewardDistribution { + if x != nil { + return x.BucketRewardDistribution + } + return nil +} + +func (x *HermesBucketDistribution) GetStakingIotexAddress() string { + if x != nil { + return x.StakingIotexAddress + } + return "" +} + +func (x *HermesBucketDistribution) GetVoterCount() uint64 { + if x != nil { + return x.VoterCount + } + return 0 +} + +func (x *HermesBucketDistribution) GetWaiveServiceFee() bool { + if x != nil { + return x.WaiveServiceFee + } + return false +} + +func (x *HermesBucketDistribution) GetRefund() string { + if x != nil { + return x.Refund + } + return "" +} + +type HermesBucketResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HermesBucketDistribution []*HermesBucketDistribution `protobuf:"bytes,1,rep,name=hermesBucketDistribution,proto3" json:"hermesBucketDistribution,omitempty"` +} + +func (x *HermesBucketResponse) Reset() { + *x = HermesBucketResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_api_hermes_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HermesBucketResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HermesBucketResponse) ProtoMessage() {} + +func (x *HermesBucketResponse) ProtoReflect() protoreflect.Message { + mi := &file_api_hermes_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HermesBucketResponse.ProtoReflect.Descriptor instead. +func (*HermesBucketResponse) Descriptor() ([]byte, []int) { + return file_api_hermes_proto_rawDescGZIP(), []int{6} +} + +func (x *HermesBucketResponse) GetHermesBucketDistribution() []*HermesBucketDistribution { + if x != nil { + return x.HermesBucketDistribution + } + return nil +} + type HermesByVoterRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -297,7 +502,7 @@ type HermesByVoterRequest struct { func (x *HermesByVoterRequest) Reset() { *x = HermesByVoterRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_hermes_proto_msgTypes[4] + mi := &file_api_hermes_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -310,7 +515,7 @@ func (x *HermesByVoterRequest) String() string { func (*HermesByVoterRequest) ProtoMessage() {} func (x *HermesByVoterRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_hermes_proto_msgTypes[4] + mi := &file_api_hermes_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -323,7 +528,7 @@ func (x *HermesByVoterRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use HermesByVoterRequest.ProtoReflect.Descriptor instead. func (*HermesByVoterRequest) Descriptor() ([]byte, []int) { - return file_api_hermes_proto_rawDescGZIP(), []int{4} + return file_api_hermes_proto_rawDescGZIP(), []int{7} } func (x *HermesByVoterRequest) GetStartEpoch() uint64 { @@ -368,7 +573,7 @@ type HermesByVoterResponse struct { func (x *HermesByVoterResponse) Reset() { *x = HermesByVoterResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_hermes_proto_msgTypes[5] + mi := &file_api_hermes_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -381,7 +586,7 @@ func (x *HermesByVoterResponse) String() string { func (*HermesByVoterResponse) ProtoMessage() {} func (x *HermesByVoterResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_hermes_proto_msgTypes[5] + mi := &file_api_hermes_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -394,7 +599,7 @@ func (x *HermesByVoterResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use HermesByVoterResponse.ProtoReflect.Descriptor instead. func (*HermesByVoterResponse) Descriptor() ([]byte, []int) { - return file_api_hermes_proto_rawDescGZIP(), []int{5} + return file_api_hermes_proto_rawDescGZIP(), []int{8} } func (x *HermesByVoterResponse) GetExist() bool { @@ -439,7 +644,7 @@ type HermesByDelegateRequest struct { func (x *HermesByDelegateRequest) Reset() { *x = HermesByDelegateRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_hermes_proto_msgTypes[6] + mi := &file_api_hermes_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -452,7 +657,7 @@ func (x *HermesByDelegateRequest) String() string { func (*HermesByDelegateRequest) ProtoMessage() {} func (x *HermesByDelegateRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_hermes_proto_msgTypes[6] + mi := &file_api_hermes_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -465,7 +670,7 @@ func (x *HermesByDelegateRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use HermesByDelegateRequest.ProtoReflect.Descriptor instead. func (*HermesByDelegateRequest) Descriptor() ([]byte, []int) { - return file_api_hermes_proto_rawDescGZIP(), []int{6} + return file_api_hermes_proto_rawDescGZIP(), []int{9} } func (x *HermesByDelegateRequest) GetStartEpoch() uint64 { @@ -512,7 +717,7 @@ type HermesByDelegateVoterInfo struct { func (x *HermesByDelegateVoterInfo) Reset() { *x = HermesByDelegateVoterInfo{} if protoimpl.UnsafeEnabled { - mi := &file_api_hermes_proto_msgTypes[7] + mi := &file_api_hermes_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -525,7 +730,7 @@ func (x *HermesByDelegateVoterInfo) String() string { func (*HermesByDelegateVoterInfo) ProtoMessage() {} func (x *HermesByDelegateVoterInfo) ProtoReflect() protoreflect.Message { - mi := &file_api_hermes_proto_msgTypes[7] + mi := &file_api_hermes_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -538,7 +743,7 @@ func (x *HermesByDelegateVoterInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use HermesByDelegateVoterInfo.ProtoReflect.Descriptor instead. func (*HermesByDelegateVoterInfo) Descriptor() ([]byte, []int) { - return file_api_hermes_proto_rawDescGZIP(), []int{7} + return file_api_hermes_proto_rawDescGZIP(), []int{10} } func (x *HermesByDelegateVoterInfo) GetVoterAddress() string { @@ -597,7 +802,7 @@ type HermesByDelegateDistributionRatio struct { func (x *HermesByDelegateDistributionRatio) Reset() { *x = HermesByDelegateDistributionRatio{} if protoimpl.UnsafeEnabled { - mi := &file_api_hermes_proto_msgTypes[8] + mi := &file_api_hermes_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -610,7 +815,7 @@ func (x *HermesByDelegateDistributionRatio) String() string { func (*HermesByDelegateDistributionRatio) ProtoMessage() {} func (x *HermesByDelegateDistributionRatio) ProtoReflect() protoreflect.Message { - mi := &file_api_hermes_proto_msgTypes[8] + mi := &file_api_hermes_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -623,7 +828,7 @@ func (x *HermesByDelegateDistributionRatio) ProtoReflect() protoreflect.Message // Deprecated: Use HermesByDelegateDistributionRatio.ProtoReflect.Descriptor instead. func (*HermesByDelegateDistributionRatio) Descriptor() ([]byte, []int) { - return file_api_hermes_proto_rawDescGZIP(), []int{8} + return file_api_hermes_proto_rawDescGZIP(), []int{11} } func (x *HermesByDelegateDistributionRatio) GetEpochNumber() uint64 { @@ -669,7 +874,7 @@ type HermesByDelegateResponse struct { func (x *HermesByDelegateResponse) Reset() { *x = HermesByDelegateResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_hermes_proto_msgTypes[9] + mi := &file_api_hermes_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -682,7 +887,7 @@ func (x *HermesByDelegateResponse) String() string { func (*HermesByDelegateResponse) ProtoMessage() {} func (x *HermesByDelegateResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_hermes_proto_msgTypes[9] + mi := &file_api_hermes_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -695,7 +900,7 @@ func (x *HermesByDelegateResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use HermesByDelegateResponse.ProtoReflect.Descriptor instead. func (*HermesByDelegateResponse) Descriptor() ([]byte, []int) { - return file_api_hermes_proto_rawDescGZIP(), []int{9} + return file_api_hermes_proto_rawDescGZIP(), []int{12} } func (x *HermesByDelegateResponse) GetExist() bool { @@ -745,7 +950,7 @@ type HermesMetaRequest struct { func (x *HermesMetaRequest) Reset() { *x = HermesMetaRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_hermes_proto_msgTypes[10] + mi := &file_api_hermes_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -758,7 +963,7 @@ func (x *HermesMetaRequest) String() string { func (*HermesMetaRequest) ProtoMessage() {} func (x *HermesMetaRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_hermes_proto_msgTypes[10] + mi := &file_api_hermes_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -771,7 +976,7 @@ func (x *HermesMetaRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use HermesMetaRequest.ProtoReflect.Descriptor instead. func (*HermesMetaRequest) Descriptor() ([]byte, []int) { - return file_api_hermes_proto_rawDescGZIP(), []int{10} + return file_api_hermes_proto_rawDescGZIP(), []int{13} } func (x *HermesMetaRequest) GetStartEpoch() uint64 { @@ -802,7 +1007,7 @@ type HermesMetaResponse struct { func (x *HermesMetaResponse) Reset() { *x = HermesMetaResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_hermes_proto_msgTypes[11] + mi := &file_api_hermes_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -815,7 +1020,7 @@ func (x *HermesMetaResponse) String() string { func (*HermesMetaResponse) ProtoMessage() {} func (x *HermesMetaResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_hermes_proto_msgTypes[11] + mi := &file_api_hermes_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -828,7 +1033,7 @@ func (x *HermesMetaResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use HermesMetaResponse.ProtoReflect.Descriptor instead. func (*HermesMetaResponse) Descriptor() ([]byte, []int) { - return file_api_hermes_proto_rawDescGZIP(), []int{11} + return file_api_hermes_proto_rawDescGZIP(), []int{14} } func (x *HermesMetaResponse) GetExist() bool { @@ -872,7 +1077,7 @@ type HermesAverageStatsRequest struct { func (x *HermesAverageStatsRequest) Reset() { *x = HermesAverageStatsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_hermes_proto_msgTypes[12] + mi := &file_api_hermes_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -885,7 +1090,7 @@ func (x *HermesAverageStatsRequest) String() string { func (*HermesAverageStatsRequest) ProtoMessage() {} func (x *HermesAverageStatsRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_hermes_proto_msgTypes[12] + mi := &file_api_hermes_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -898,7 +1103,7 @@ func (x *HermesAverageStatsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use HermesAverageStatsRequest.ProtoReflect.Descriptor instead. func (*HermesAverageStatsRequest) Descriptor() ([]byte, []int) { - return file_api_hermes_proto_rawDescGZIP(), []int{12} + return file_api_hermes_proto_rawDescGZIP(), []int{15} } func (x *HermesAverageStatsRequest) GetStartEpoch() uint64 { @@ -934,7 +1139,7 @@ type HermesAverageStatsResponse struct { func (x *HermesAverageStatsResponse) Reset() { *x = HermesAverageStatsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_hermes_proto_msgTypes[13] + mi := &file_api_hermes_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -947,7 +1152,7 @@ func (x *HermesAverageStatsResponse) String() string { func (*HermesAverageStatsResponse) ProtoMessage() {} func (x *HermesAverageStatsResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_hermes_proto_msgTypes[13] + mi := &file_api_hermes_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -960,7 +1165,7 @@ func (x *HermesAverageStatsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use HermesAverageStatsResponse.ProtoReflect.Descriptor instead. func (*HermesAverageStatsResponse) Descriptor() ([]byte, []int) { - return file_api_hermes_proto_rawDescGZIP(), []int{13} + return file_api_hermes_proto_rawDescGZIP(), []int{16} } func (x *HermesAverageStatsResponse) GetExist() bool { @@ -993,7 +1198,7 @@ type HermesDropRecordsRequest struct { func (x *HermesDropRecordsRequest) Reset() { *x = HermesDropRecordsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_hermes_proto_msgTypes[14] + mi := &file_api_hermes_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1006,7 +1211,7 @@ func (x *HermesDropRecordsRequest) String() string { func (*HermesDropRecordsRequest) ProtoMessage() {} func (x *HermesDropRecordsRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_hermes_proto_msgTypes[14] + mi := &file_api_hermes_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1019,7 +1224,7 @@ func (x *HermesDropRecordsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use HermesDropRecordsRequest.ProtoReflect.Descriptor instead. func (*HermesDropRecordsRequest) Descriptor() ([]byte, []int) { - return file_api_hermes_proto_rawDescGZIP(), []int{14} + return file_api_hermes_proto_rawDescGZIP(), []int{17} } func (x *HermesDropRecordsRequest) GetEpochNumber() uint64 { @@ -1075,7 +1280,7 @@ type HermesDropRecordsResponse struct { func (x *HermesDropRecordsResponse) Reset() { *x = HermesDropRecordsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_hermes_proto_msgTypes[15] + mi := &file_api_hermes_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1088,7 +1293,7 @@ func (x *HermesDropRecordsResponse) String() string { func (*HermesDropRecordsResponse) ProtoMessage() {} func (x *HermesDropRecordsResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_hermes_proto_msgTypes[15] + mi := &file_api_hermes_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1101,7 +1306,7 @@ func (x *HermesDropRecordsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use HermesDropRecordsResponse.ProtoReflect.Descriptor instead. func (*HermesDropRecordsResponse) Descriptor() ([]byte, []int) { - return file_api_hermes_proto_rawDescGZIP(), []int{15} + return file_api_hermes_proto_rawDescGZIP(), []int{18} } func (x *HermesDropRecordsResponse) GetSuccess() bool { @@ -1127,7 +1332,7 @@ type HermesByVoterResponse_Delegate struct { func (x *HermesByVoterResponse_Delegate) Reset() { *x = HermesByVoterResponse_Delegate{} if protoimpl.UnsafeEnabled { - mi := &file_api_hermes_proto_msgTypes[16] + mi := &file_api_hermes_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1140,7 +1345,7 @@ func (x *HermesByVoterResponse_Delegate) String() string { func (*HermesByVoterResponse_Delegate) ProtoMessage() {} func (x *HermesByVoterResponse_Delegate) ProtoReflect() protoreflect.Message { - mi := &file_api_hermes_proto_msgTypes[16] + mi := &file_api_hermes_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1153,7 +1358,7 @@ func (x *HermesByVoterResponse_Delegate) ProtoReflect() protoreflect.Message { // Deprecated: Use HermesByVoterResponse_Delegate.ProtoReflect.Descriptor instead. func (*HermesByVoterResponse_Delegate) Descriptor() ([]byte, []int) { - return file_api_hermes_proto_rawDescGZIP(), []int{5, 0} + return file_api_hermes_proto_rawDescGZIP(), []int{8, 0} } func (x *HermesByVoterResponse_Delegate) GetDelegateName() string { @@ -1211,7 +1416,7 @@ type HermesAverageStatsResponse_AveragePerEpoch struct { func (x *HermesAverageStatsResponse_AveragePerEpoch) Reset() { *x = HermesAverageStatsResponse_AveragePerEpoch{} if protoimpl.UnsafeEnabled { - mi := &file_api_hermes_proto_msgTypes[17] + mi := &file_api_hermes_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1224,7 +1429,7 @@ func (x *HermesAverageStatsResponse_AveragePerEpoch) String() string { func (*HermesAverageStatsResponse_AveragePerEpoch) ProtoMessage() {} func (x *HermesAverageStatsResponse_AveragePerEpoch) ProtoReflect() protoreflect.Message { - mi := &file_api_hermes_proto_msgTypes[17] + mi := &file_api_hermes_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1237,7 +1442,7 @@ func (x *HermesAverageStatsResponse_AveragePerEpoch) ProtoReflect() protoreflect // Deprecated: Use HermesAverageStatsResponse_AveragePerEpoch.ProtoReflect.Descriptor instead. func (*HermesAverageStatsResponse_AveragePerEpoch) Descriptor() ([]byte, []int) { - return file_api_hermes_proto_rawDescGZIP(), []int{13, 0} + return file_api_hermes_proto_rawDescGZIP(), []int{16, 0} } func (x *HermesAverageStatsResponse_AveragePerEpoch) GetDelegateName() string { @@ -1309,210 +1514,255 @@ var file_api_hermes_proto_rawDesc = []byte{ 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x12, 0x68, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x44, 0x69, 0x73, 0x74, 0x72, - 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xb2, 0x01, 0x0a, 0x14, 0x48, 0x65, 0x72, 0x6d, - 0x65, 0x73, 0x42, 0x79, 0x56, 0x6f, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, - 0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x43, 0x6f, 0x75, 0x6e, 0x74, - 0x12, 0x22, 0x0a, 0x0c, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x41, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x12, 0x36, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x61, 0x67, 0x69, 0x6e, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xf1, 0x02, 0x0a, - 0x15, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x42, 0x79, 0x56, 0x6f, 0x74, 0x65, 0x72, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x78, 0x69, 0x73, 0x74, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x65, 0x78, 0x69, 0x73, 0x74, 0x12, 0x41, 0x0a, 0x09, - 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x23, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x42, 0x79, 0x56, 0x6f, - 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x44, 0x65, 0x6c, 0x65, - 0x67, 0x61, 0x74, 0x65, 0x52, 0x09, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x73, 0x12, - 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x30, 0x0a, 0x13, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, - 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x13, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, - 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x1a, 0xb6, 0x01, 0x0a, 0x08, 0x44, 0x65, 0x6c, 0x65, - 0x67, 0x61, 0x74, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, - 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x65, 0x6c, 0x65, - 0x67, 0x61, 0x74, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x72, 0x6f, 0x6d, - 0x45, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x66, 0x72, 0x6f, - 0x6d, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x6f, 0x45, 0x70, 0x6f, 0x63, - 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x74, 0x6f, 0x45, 0x70, 0x6f, 0x63, 0x68, - 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x63, 0x74, 0x48, - 0x61, 0x73, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x63, 0x74, 0x48, 0x61, - 0x73, 0x68, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x22, 0xb5, 0x01, 0x0a, 0x17, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x42, 0x79, 0x44, 0x65, 0x6c, - 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, + 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xa6, 0x01, 0x0a, 0x18, 0x42, 0x75, 0x63, 0x6b, + 0x65, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x0a, 0x0f, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x45, 0x74, 0x68, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x76, + 0x6f, 0x74, 0x65, 0x72, 0x45, 0x74, 0x68, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x2c, + 0x0a, 0x11, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x49, 0x6f, 0x74, 0x65, 0x78, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x76, 0x6f, 0x74, 0x65, 0x72, + 0x49, 0x6f, 0x74, 0x65, 0x78, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1a, 0x0a, 0x08, + 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, + 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x44, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, + 0x22, 0xad, 0x02, 0x0a, 0x18, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x42, 0x75, 0x63, 0x6b, 0x65, + 0x74, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x0a, + 0x0c, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x4e, 0x61, 0x6d, + 0x65, 0x12, 0x59, 0x0a, 0x18, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, + 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x18, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x30, 0x0a, 0x13, + 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x49, 0x6f, 0x74, 0x65, 0x78, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x73, 0x74, 0x61, 0x6b, 0x69, + 0x6e, 0x67, 0x49, 0x6f, 0x74, 0x65, 0x78, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1e, + 0x0a, 0x0a, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x0a, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x28, + 0x0a, 0x0f, 0x77, 0x61, 0x69, 0x76, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x46, 0x65, + 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x77, 0x61, 0x69, 0x76, 0x65, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x46, 0x65, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x66, 0x75, + 0x6e, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x66, 0x75, 0x6e, 0x64, + 0x22, 0x71, 0x0a, 0x14, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x59, 0x0a, 0x18, 0x68, 0x65, 0x72, 0x6d, + 0x65, 0x73, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x44, 0x69, 0x73, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x18, 0x68, 0x65, 0x72, 0x6d, 0x65, + 0x73, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x22, 0xb2, 0x01, 0x0a, 0x14, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x42, 0x79, + 0x56, 0x6f, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x22, 0x0a, 0x0c, - 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0c, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x4e, 0x61, 0x6d, 0x65, + 0x76, 0x6f, 0x74, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0c, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x36, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x70, 0x61, - 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xc7, 0x01, 0x0a, 0x19, 0x48, 0x65, 0x72, - 0x6d, 0x65, 0x73, 0x42, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x56, 0x6f, 0x74, - 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x22, 0x0a, 0x0c, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x41, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x76, 0x6f, - 0x74, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x72, - 0x6f, 0x6d, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x66, - 0x72, 0x6f, 0x6d, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x6f, 0x45, 0x70, - 0x6f, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x74, 0x6f, 0x45, 0x70, 0x6f, - 0x63, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x63, - 0x74, 0x48, 0x61, 0x73, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x63, 0x74, - 0x48, 0x61, 0x73, 0x68, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x22, 0xd1, 0x01, 0x0a, 0x21, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x42, 0x79, 0x44, - 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x12, 0x20, 0x0a, 0x0b, 0x65, 0x70, 0x6f, 0x63, - 0x68, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x65, - 0x70, 0x6f, 0x63, 0x68, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x2a, 0x0a, 0x10, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x01, 0x52, 0x10, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x77, 0x61, 0x72, - 0x64, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x12, 0x2a, 0x0a, 0x10, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x52, - 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, - 0x52, 0x10, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x61, 0x74, - 0x69, 0x6f, 0x12, 0x32, 0x0a, 0x14, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x42, 0x6f, 0x6e, 0x75, 0x73, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, - 0x52, 0x14, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x6f, 0x6e, 0x75, - 0x73, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x22, 0x9c, 0x02, 0x0a, 0x18, 0x48, 0x65, 0x72, 0x6d, 0x65, - 0x73, 0x42, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x78, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x05, 0x65, 0x78, 0x69, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, - 0x44, 0x0a, 0x0d, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x48, 0x65, 0x72, - 0x6d, 0x65, 0x73, 0x42, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x56, 0x6f, 0x74, - 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0d, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x66, - 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x17, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, - 0x77, 0x61, 0x72, 0x64, 0x73, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x17, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x77, - 0x61, 0x72, 0x64, 0x73, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x12, - 0x54, 0x0a, 0x11, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x61, 0x74, 0x69, 0x6f, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x42, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, - 0x65, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x74, - 0x69, 0x6f, 0x52, 0x11, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x61, 0x74, 0x69, 0x6f, 0x22, 0x53, 0x0a, 0x11, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x4d, - 0x65, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x74, - 0x61, 0x72, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, - 0x73, 0x74, 0x61, 0x72, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x70, - 0x6f, 0x63, 0x68, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, - 0x65, 0x70, 0x6f, 0x63, 0x68, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xc0, 0x01, 0x0a, 0x12, 0x48, - 0x65, 0x72, 0x6d, 0x65, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x78, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x05, 0x65, 0x78, 0x69, 0x73, 0x74, 0x12, 0x2c, 0x0a, 0x11, 0x6e, 0x75, 0x6d, 0x62, 0x65, - 0x72, 0x4f, 0x66, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x11, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x4f, 0x66, 0x44, 0x65, 0x6c, 0x65, - 0x67, 0x61, 0x74, 0x65, 0x73, 0x12, 0x2e, 0x0a, 0x12, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x4f, - 0x66, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x12, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x4f, 0x66, 0x52, 0x65, 0x63, 0x69, 0x70, - 0x69, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x36, 0x0a, 0x16, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, - 0x77, 0x61, 0x72, 0x64, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x16, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x77, 0x61, - 0x72, 0x64, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x22, 0x81, 0x01, - 0x0a, 0x19, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x41, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x53, - 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x73, - 0x74, 0x61, 0x72, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1e, 0x0a, 0x0a, 0x65, - 0x70, 0x6f, 0x63, 0x68, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x0a, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x72, - 0x65, 0x77, 0x61, 0x72, 0x64, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0d, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x22, 0xa5, 0x02, 0x0a, 0x1a, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x41, 0x76, 0x65, 0x72, - 0x61, 0x67, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x14, 0x0a, 0x05, 0x65, 0x78, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x05, 0x65, 0x78, 0x69, 0x73, 0x74, 0x12, 0x59, 0x0a, 0x0f, 0x61, 0x76, 0x65, 0x72, 0x61, 0x67, - 0x65, 0x50, 0x65, 0x72, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x2f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x41, 0x76, 0x65, 0x72, - 0x61, 0x67, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x2e, 0x41, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x50, 0x65, 0x72, 0x45, 0x70, 0x6f, 0x63, 0x68, - 0x52, 0x0f, 0x61, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x50, 0x65, 0x72, 0x45, 0x70, 0x6f, 0x63, - 0x68, 0x1a, 0x95, 0x01, 0x0a, 0x0f, 0x41, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x50, 0x65, 0x72, - 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x22, 0x0a, 0x0c, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, - 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x65, 0x6c, - 0x65, 0x67, 0x61, 0x74, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2e, 0x0a, 0x12, 0x72, 0x65, 0x77, - 0x61, 0x72, 0x64, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x44, 0x69, 0x73, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2e, 0x0a, 0x12, 0x74, 0x6f, 0x74, - 0x61, 0x6c, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x57, 0x65, 0x69, 0x67, - 0x68, 0x74, 0x65, 0x64, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x22, 0xd2, 0x01, 0x0a, 0x18, 0x48, 0x65, + 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xf1, 0x02, 0x0a, 0x15, 0x48, 0x65, 0x72, + 0x6d, 0x65, 0x73, 0x42, 0x79, 0x56, 0x6f, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x78, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x05, 0x65, 0x78, 0x69, 0x73, 0x74, 0x12, 0x41, 0x0a, 0x09, 0x64, 0x65, 0x6c, 0x65, + 0x67, 0x61, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x42, 0x79, 0x56, 0x6f, 0x74, 0x65, 0x72, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, + 0x52, 0x09, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x12, 0x30, 0x0a, 0x13, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, + 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x63, 0x65, 0x69, + 0x76, 0x65, 0x64, 0x1a, 0xb6, 0x01, 0x0a, 0x08, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, + 0x12, 0x22, 0x0a, 0x0c, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x4e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x72, 0x6f, 0x6d, 0x45, 0x70, 0x6f, 0x63, + 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x66, 0x72, 0x6f, 0x6d, 0x45, 0x70, 0x6f, + 0x63, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x6f, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x07, 0x74, 0x6f, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x16, 0x0a, 0x06, + 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x6d, + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1c, + 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0xb5, 0x01, 0x0a, + 0x17, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x42, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, + 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x73, 0x74, + 0x61, 0x72, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x70, 0x6f, 0x63, + 0x68, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x65, 0x70, + 0x6f, 0x63, 0x68, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x64, 0x65, 0x6c, 0x65, + 0x67, 0x61, 0x74, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, + 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x36, 0x0a, 0x0a, + 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x16, 0x2e, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x61, + 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xc7, 0x01, 0x0a, 0x19, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x42, + 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x56, 0x6f, 0x74, 0x65, 0x72, 0x49, 0x6e, + 0x66, 0x6f, 0x12, 0x22, 0x0a, 0x0c, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x72, 0x6f, 0x6d, 0x45, 0x70, + 0x6f, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x66, 0x72, 0x6f, 0x6d, 0x45, + 0x70, 0x6f, 0x63, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x6f, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x74, 0x6f, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x16, + 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x63, 0x74, 0x48, 0x61, 0x73, + 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, + 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0xd1, + 0x01, 0x0a, 0x21, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x42, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, + 0x61, 0x74, 0x65, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x61, 0x74, 0x69, 0x6f, 0x12, 0x20, 0x0a, 0x0b, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x4e, 0x75, 0x6d, + 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x65, 0x70, 0x6f, 0x63, 0x68, + 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x2a, 0x0a, 0x10, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x52, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, + 0x52, 0x10, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x61, 0x74, + 0x69, 0x6f, 0x12, 0x2a, 0x0a, 0x10, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x10, 0x65, 0x70, + 0x6f, 0x63, 0x68, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x12, 0x32, + 0x0a, 0x14, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x6f, 0x6e, 0x75, + 0x73, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x14, 0x66, 0x6f, + 0x75, 0x6e, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x6f, 0x6e, 0x75, 0x73, 0x52, 0x61, 0x74, + 0x69, 0x6f, 0x22, 0x9c, 0x02, 0x0a, 0x18, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x42, 0x79, 0x44, + 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x14, 0x0a, 0x05, 0x65, 0x78, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, + 0x65, 0x78, 0x69, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x44, 0x0a, 0x0d, 0x76, + 0x6f, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x42, + 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x56, 0x6f, 0x74, 0x65, 0x72, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x0d, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, + 0x74, 0x12, 0x38, 0x0a, 0x17, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x73, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x17, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, + 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x12, 0x54, 0x0a, 0x11, 0x64, + 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x74, 0x69, 0x6f, + 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x48, 0x65, 0x72, + 0x6d, 0x65, 0x73, 0x42, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x44, 0x69, 0x73, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x52, 0x11, + 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x74, 0x69, + 0x6f, 0x22, 0x53, 0x0a, 0x11, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x45, + 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x72, + 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x65, 0x70, 0x6f, 0x63, + 0x68, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xc0, 0x01, 0x0a, 0x12, 0x48, 0x65, 0x72, 0x6d, 0x65, + 0x73, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, + 0x05, 0x65, 0x78, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x65, 0x78, + 0x69, 0x73, 0x74, 0x12, 0x2c, 0x0a, 0x11, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x4f, 0x66, 0x44, + 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x11, + 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x4f, 0x66, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, + 0x73, 0x12, 0x2e, 0x0a, 0x12, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x4f, 0x66, 0x52, 0x65, 0x63, + 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x12, 0x6e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x4f, 0x66, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, + 0x73, 0x12, 0x36, 0x0a, 0x16, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x16, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x44, 0x69, + 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x22, 0x81, 0x01, 0x0a, 0x19, 0x48, 0x65, + 0x72, 0x6d, 0x65, 0x73, 0x41, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, + 0x45, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x70, 0x6f, 0x63, 0x68, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x65, 0x70, 0x6f, + 0x63, 0x68, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x72, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xa5, 0x02, + 0x0a, 0x1a, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x41, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x53, + 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, + 0x65, 0x78, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x65, 0x78, 0x69, + 0x73, 0x74, 0x12, 0x59, 0x0a, 0x0f, 0x61, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x50, 0x65, 0x72, + 0x45, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x41, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x53, + 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x41, 0x76, 0x65, + 0x72, 0x61, 0x67, 0x65, 0x50, 0x65, 0x72, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x0f, 0x61, 0x76, + 0x65, 0x72, 0x61, 0x67, 0x65, 0x50, 0x65, 0x72, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x1a, 0x95, 0x01, + 0x0a, 0x0f, 0x41, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x50, 0x65, 0x72, 0x45, 0x70, 0x6f, 0x63, + 0x68, 0x12, 0x22, 0x0a, 0x0c, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x4e, 0x61, 0x6d, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, + 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2e, 0x0a, 0x12, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x44, + 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x12, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2e, 0x0a, 0x12, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x57, 0x65, + 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x12, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, + 0x56, 0x6f, 0x74, 0x65, 0x73, 0x22, 0xd2, 0x01, 0x0a, 0x18, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, + 0x44, 0x72, 0x6f, 0x70, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x4e, 0x75, 0x6d, 0x62, 0x65, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x4e, 0x75, + 0x6d, 0x62, 0x65, 0x72, 0x12, 0x22, 0x0a, 0x0c, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, + 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x65, 0x6c, 0x65, + 0x67, 0x61, 0x74, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x76, 0x6f, 0x74, 0x65, + 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, + 0x76, 0x6f, 0x74, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, + 0x61, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, + 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, + 0x49, 0x44, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, + 0x49, 0x44, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x35, 0x0a, 0x19, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x44, 0x72, 0x6f, 0x70, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x4e, - 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x65, 0x70, 0x6f, - 0x63, 0x68, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x22, 0x0a, 0x0c, 0x64, 0x65, 0x6c, 0x65, - 0x67, 0x61, 0x74, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, - 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x0c, - 0x76, 0x6f, 0x74, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0c, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x12, 0x18, 0x0a, 0x07, 0x61, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x61, 0x63, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x75, - 0x63, 0x6b, 0x65, 0x74, 0x49, 0x44, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x62, 0x75, - 0x63, 0x6b, 0x65, 0x74, 0x49, 0x44, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x35, - 0x0a, 0x19, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x44, 0x72, 0x6f, 0x70, 0x52, 0x65, 0x63, 0x6f, - 0x72, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, - 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, - 0x63, 0x63, 0x65, 0x73, 0x73, 0x32, 0xb1, 0x06, 0x0a, 0x0d, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x62, 0x0a, 0x06, 0x48, 0x65, 0x72, 0x6d, 0x65, - 0x73, 0x12, 0x12, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x48, 0x65, 0x72, 0x6d, - 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0xba, 0x43, 0x08, 0x12, - 0x06, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x3a, 0x01, 0x2a, - 0x22, 0x19, 0x2f, 0x61, 0x70, 0x69, 0x2e, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x2e, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x12, 0x85, 0x01, 0x0a, 0x0d, - 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x42, 0x79, 0x56, 0x6f, 0x74, 0x65, 0x72, 0x12, 0x19, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x42, 0x79, 0x56, 0x6f, 0x74, 0x65, - 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x48, - 0x65, 0x72, 0x6d, 0x65, 0x73, 0x42, 0x79, 0x56, 0x6f, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3d, 0xba, 0x43, 0x0f, 0x12, 0x0d, 0x48, 0x65, 0x72, 0x6d, 0x65, - 0x73, 0x42, 0x79, 0x56, 0x6f, 0x74, 0x65, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x3a, 0x01, - 0x2a, 0x22, 0x20, 0x2f, 0x61, 0x70, 0x69, 0x2e, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x42, 0x79, 0x56, 0x6f, - 0x74, 0x65, 0x72, 0x12, 0x94, 0x01, 0x0a, 0x10, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x42, 0x79, - 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x48, - 0x65, 0x72, 0x6d, 0x65, 0x73, 0x42, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x48, 0x65, 0x72, - 0x6d, 0x65, 0x73, 0x42, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x43, 0xba, 0x43, 0x12, 0x12, 0x10, 0x48, 0x65, 0x72, 0x6d, - 0x65, 0x73, 0x42, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x28, 0x3a, 0x01, 0x2a, 0x22, 0x23, 0x2f, 0x61, 0x70, 0x69, 0x2e, 0x48, 0x65, 0x72, 0x6d, - 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, - 0x42, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x76, 0x0a, 0x0a, 0x48, 0x65, - 0x72, 0x6d, 0x65, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x48, - 0x65, 0x72, 0x6d, 0x65, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x4d, 0x65, 0x74, - 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x37, 0xba, 0x43, 0x0c, 0x12, 0x0a, - 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, - 0x3a, 0x01, 0x2a, 0x22, 0x1d, 0x2f, 0x61, 0x70, 0x69, 0x2e, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x4d, 0x65, - 0x74, 0x61, 0x12, 0x9e, 0x01, 0x0a, 0x12, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x41, 0x76, 0x65, - 0x72, 0x61, 0x67, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x41, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x53, 0x74, 0x61, - 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x41, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x53, 0x74, 0x61, - 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x47, 0xba, 0x43, 0x14, 0x12, - 0x12, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x41, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x53, 0x74, - 0x61, 0x74, 0x73, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2a, 0x3a, 0x01, 0x2a, 0x22, 0x25, 0x2f, 0x61, - 0x70, 0x69, 0x2e, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x2e, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x41, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x53, 0x74, - 0x61, 0x74, 0x73, 0x12, 0x83, 0x01, 0x0a, 0x11, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x44, 0x72, - 0x6f, 0x70, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x12, 0x1d, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x32, 0xad, 0x07, 0x0a, 0x0d, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x62, 0x0a, 0x06, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x12, 0x12, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0xba, 0x43, 0x08, 0x12, 0x06, 0x48, 0x65, 0x72, + 0x6d, 0x65, 0x73, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x22, 0x19, 0x2f, 0x61, 0x70, 0x69, 0x2e, + 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x48, 0x65, + 0x72, 0x6d, 0x65, 0x73, 0x3a, 0x01, 0x2a, 0x12, 0x7a, 0x0a, 0x0c, 0x48, 0x65, 0x72, 0x6d, 0x65, + 0x73, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x12, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x48, 0x65, + 0x72, 0x6d, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3b, 0xba, 0x43, 0x0e, 0x12, 0x0c, 0x48, 0x65, 0x72, + 0x6d, 0x65, 0x73, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x24, 0x22, + 0x1f, 0x2f, 0x61, 0x70, 0x69, 0x2e, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, + 0x3a, 0x01, 0x2a, 0x12, 0x85, 0x01, 0x0a, 0x0d, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x42, 0x79, + 0x56, 0x6f, 0x74, 0x65, 0x72, 0x12, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x48, 0x65, 0x72, 0x6d, + 0x65, 0x73, 0x42, 0x79, 0x56, 0x6f, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x42, 0x79, 0x56, + 0x6f, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3d, 0xba, 0x43, + 0x0f, 0x12, 0x0d, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x42, 0x79, 0x56, 0x6f, 0x74, 0x65, 0x72, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x22, 0x20, 0x2f, 0x61, 0x70, 0x69, 0x2e, 0x48, 0x65, 0x72, + 0x6d, 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x48, 0x65, 0x72, 0x6d, 0x65, + 0x73, 0x42, 0x79, 0x56, 0x6f, 0x74, 0x65, 0x72, 0x3a, 0x01, 0x2a, 0x12, 0x94, 0x01, 0x0a, 0x10, + 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x42, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, + 0x12, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x42, 0x79, 0x44, + 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x42, 0x79, 0x44, 0x65, 0x6c, + 0x65, 0x67, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x43, 0xba, + 0x43, 0x12, 0x12, 0x10, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x42, 0x79, 0x44, 0x65, 0x6c, 0x65, + 0x67, 0x61, 0x74, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x22, 0x23, 0x2f, 0x61, 0x70, 0x69, + 0x2e, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x48, + 0x65, 0x72, 0x6d, 0x65, 0x73, 0x42, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x3a, + 0x01, 0x2a, 0x12, 0x76, 0x0a, 0x0a, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x4d, 0x65, 0x74, 0x61, + 0x12, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x4d, 0x65, 0x74, + 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x48, + 0x65, 0x72, 0x6d, 0x65, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x37, 0xba, 0x43, 0x0c, 0x12, 0x0a, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x4d, 0x65, + 0x74, 0x61, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x22, 0x1d, 0x2f, 0x61, 0x70, 0x69, 0x2e, 0x48, + 0x65, 0x72, 0x6d, 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x48, 0x65, 0x72, + 0x6d, 0x65, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x3a, 0x01, 0x2a, 0x12, 0x9e, 0x01, 0x0a, 0x12, 0x48, + 0x65, 0x72, 0x6d, 0x65, 0x73, 0x41, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x53, 0x74, 0x61, 0x74, + 0x73, 0x12, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x41, 0x76, + 0x65, 0x72, 0x61, 0x67, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x41, 0x76, + 0x65, 0x72, 0x61, 0x67, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x47, 0xba, 0x43, 0x14, 0x12, 0x12, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x41, + 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x2a, 0x22, 0x25, 0x2f, 0x61, 0x70, 0x69, 0x2e, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x41, 0x76, 0x65, 0x72, + 0x61, 0x67, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x3a, 0x01, 0x2a, 0x12, 0x83, 0x01, 0x0a, 0x11, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x44, 0x72, 0x6f, 0x70, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x48, - 0x65, 0x72, 0x6d, 0x65, 0x73, 0x44, 0x72, 0x6f, 0x70, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, - 0x3a, 0x01, 0x2a, 0x22, 0x24, 0x2f, 0x61, 0x70, 0x69, 0x2e, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x44, 0x72, - 0x6f, 0x70, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x42, 0x07, 0x5a, 0x05, 0x2e, 0x2f, 0x61, - 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x12, 0x1d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x44, 0x72, + 0x6f, 0x70, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x73, 0x44, 0x72, 0x6f, + 0x70, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x2f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x22, 0x24, 0x2f, 0x61, 0x70, 0x69, 0x2e, 0x48, + 0x65, 0x72, 0x6d, 0x65, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x48, 0x65, 0x72, + 0x6d, 0x65, 0x73, 0x44, 0x72, 0x6f, 0x70, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x3a, 0x01, + 0x2a, 0x42, 0x07, 0x5a, 0x05, 0x2e, 0x2f, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -1527,54 +1777,61 @@ func file_api_hermes_proto_rawDescGZIP() []byte { return file_api_hermes_proto_rawDescData } -var file_api_hermes_proto_msgTypes = make([]protoimpl.MessageInfo, 18) +var file_api_hermes_proto_msgTypes = make([]protoimpl.MessageInfo, 21) var file_api_hermes_proto_goTypes = []interface{}{ (*HermesRequest)(nil), // 0: api.HermesRequest (*RewardDistribution)(nil), // 1: api.RewardDistribution (*HermesDistribution)(nil), // 2: api.HermesDistribution (*HermesResponse)(nil), // 3: api.HermesResponse - (*HermesByVoterRequest)(nil), // 4: api.HermesByVoterRequest - (*HermesByVoterResponse)(nil), // 5: api.HermesByVoterResponse - (*HermesByDelegateRequest)(nil), // 6: api.HermesByDelegateRequest - (*HermesByDelegateVoterInfo)(nil), // 7: api.HermesByDelegateVoterInfo - (*HermesByDelegateDistributionRatio)(nil), // 8: api.HermesByDelegateDistributionRatio - (*HermesByDelegateResponse)(nil), // 9: api.HermesByDelegateResponse - (*HermesMetaRequest)(nil), // 10: api.HermesMetaRequest - (*HermesMetaResponse)(nil), // 11: api.HermesMetaResponse - (*HermesAverageStatsRequest)(nil), // 12: api.HermesAverageStatsRequest - (*HermesAverageStatsResponse)(nil), // 13: api.HermesAverageStatsResponse - (*HermesDropRecordsRequest)(nil), // 14: api.HermesDropRecordsRequest - (*HermesDropRecordsResponse)(nil), // 15: api.HermesDropRecordsResponse - (*HermesByVoterResponse_Delegate)(nil), // 16: api.HermesByVoterResponse.Delegate - (*HermesAverageStatsResponse_AveragePerEpoch)(nil), // 17: api.HermesAverageStatsResponse.AveragePerEpoch - (*pagination.Pagination)(nil), // 18: pagination.Pagination + (*BucketRewardDistribution)(nil), // 4: api.BucketRewardDistribution + (*HermesBucketDistribution)(nil), // 5: api.HermesBucketDistribution + (*HermesBucketResponse)(nil), // 6: api.HermesBucketResponse + (*HermesByVoterRequest)(nil), // 7: api.HermesByVoterRequest + (*HermesByVoterResponse)(nil), // 8: api.HermesByVoterResponse + (*HermesByDelegateRequest)(nil), // 9: api.HermesByDelegateRequest + (*HermesByDelegateVoterInfo)(nil), // 10: api.HermesByDelegateVoterInfo + (*HermesByDelegateDistributionRatio)(nil), // 11: api.HermesByDelegateDistributionRatio + (*HermesByDelegateResponse)(nil), // 12: api.HermesByDelegateResponse + (*HermesMetaRequest)(nil), // 13: api.HermesMetaRequest + (*HermesMetaResponse)(nil), // 14: api.HermesMetaResponse + (*HermesAverageStatsRequest)(nil), // 15: api.HermesAverageStatsRequest + (*HermesAverageStatsResponse)(nil), // 16: api.HermesAverageStatsResponse + (*HermesDropRecordsRequest)(nil), // 17: api.HermesDropRecordsRequest + (*HermesDropRecordsResponse)(nil), // 18: api.HermesDropRecordsResponse + (*HermesByVoterResponse_Delegate)(nil), // 19: api.HermesByVoterResponse.Delegate + (*HermesAverageStatsResponse_AveragePerEpoch)(nil), // 20: api.HermesAverageStatsResponse.AveragePerEpoch + (*pagination.Pagination)(nil), // 21: pagination.Pagination } var file_api_hermes_proto_depIdxs = []int32{ 1, // 0: api.HermesDistribution.rewardDistribution:type_name -> api.RewardDistribution 2, // 1: api.HermesResponse.hermesDistribution:type_name -> api.HermesDistribution - 18, // 2: api.HermesByVoterRequest.pagination:type_name -> pagination.Pagination - 16, // 3: api.HermesByVoterResponse.delegates:type_name -> api.HermesByVoterResponse.Delegate - 18, // 4: api.HermesByDelegateRequest.pagination:type_name -> pagination.Pagination - 7, // 5: api.HermesByDelegateResponse.voterInfoList:type_name -> api.HermesByDelegateVoterInfo - 8, // 6: api.HermesByDelegateResponse.distributionRatio:type_name -> api.HermesByDelegateDistributionRatio - 17, // 7: api.HermesAverageStatsResponse.averagePerEpoch:type_name -> api.HermesAverageStatsResponse.AveragePerEpoch - 0, // 8: api.HermesService.Hermes:input_type -> api.HermesRequest - 4, // 9: api.HermesService.HermesByVoter:input_type -> api.HermesByVoterRequest - 6, // 10: api.HermesService.HermesByDelegate:input_type -> api.HermesByDelegateRequest - 10, // 11: api.HermesService.HermesMeta:input_type -> api.HermesMetaRequest - 12, // 12: api.HermesService.HermesAverageStats:input_type -> api.HermesAverageStatsRequest - 14, // 13: api.HermesService.HermesDropRecords:input_type -> api.HermesDropRecordsRequest - 3, // 14: api.HermesService.Hermes:output_type -> api.HermesResponse - 5, // 15: api.HermesService.HermesByVoter:output_type -> api.HermesByVoterResponse - 9, // 16: api.HermesService.HermesByDelegate:output_type -> api.HermesByDelegateResponse - 11, // 17: api.HermesService.HermesMeta:output_type -> api.HermesMetaResponse - 13, // 18: api.HermesService.HermesAverageStats:output_type -> api.HermesAverageStatsResponse - 15, // 19: api.HermesService.HermesDropRecords:output_type -> api.HermesDropRecordsResponse - 14, // [14:20] is the sub-list for method output_type - 8, // [8:14] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name + 4, // 2: api.HermesBucketDistribution.bucketRewardDistribution:type_name -> api.BucketRewardDistribution + 5, // 3: api.HermesBucketResponse.hermesBucketDistribution:type_name -> api.HermesBucketDistribution + 21, // 4: api.HermesByVoterRequest.pagination:type_name -> pagination.Pagination + 19, // 5: api.HermesByVoterResponse.delegates:type_name -> api.HermesByVoterResponse.Delegate + 21, // 6: api.HermesByDelegateRequest.pagination:type_name -> pagination.Pagination + 10, // 7: api.HermesByDelegateResponse.voterInfoList:type_name -> api.HermesByDelegateVoterInfo + 11, // 8: api.HermesByDelegateResponse.distributionRatio:type_name -> api.HermesByDelegateDistributionRatio + 20, // 9: api.HermesAverageStatsResponse.averagePerEpoch:type_name -> api.HermesAverageStatsResponse.AveragePerEpoch + 0, // 10: api.HermesService.Hermes:input_type -> api.HermesRequest + 0, // 11: api.HermesService.HermesBucket:input_type -> api.HermesRequest + 7, // 12: api.HermesService.HermesByVoter:input_type -> api.HermesByVoterRequest + 9, // 13: api.HermesService.HermesByDelegate:input_type -> api.HermesByDelegateRequest + 13, // 14: api.HermesService.HermesMeta:input_type -> api.HermesMetaRequest + 15, // 15: api.HermesService.HermesAverageStats:input_type -> api.HermesAverageStatsRequest + 17, // 16: api.HermesService.HermesDropRecords:input_type -> api.HermesDropRecordsRequest + 3, // 17: api.HermesService.Hermes:output_type -> api.HermesResponse + 6, // 18: api.HermesService.HermesBucket:output_type -> api.HermesBucketResponse + 8, // 19: api.HermesService.HermesByVoter:output_type -> api.HermesByVoterResponse + 12, // 20: api.HermesService.HermesByDelegate:output_type -> api.HermesByDelegateResponse + 14, // 21: api.HermesService.HermesMeta:output_type -> api.HermesMetaResponse + 16, // 22: api.HermesService.HermesAverageStats:output_type -> api.HermesAverageStatsResponse + 18, // 23: api.HermesService.HermesDropRecords:output_type -> api.HermesDropRecordsResponse + 17, // [17:24] is the sub-list for method output_type + 10, // [10:17] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name } func init() { file_api_hermes_proto_init() } @@ -1632,7 +1889,7 @@ func file_api_hermes_proto_init() { } } file_api_hermes_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HermesByVoterRequest); i { + switch v := v.(*BucketRewardDistribution); i { case 0: return &v.state case 1: @@ -1644,7 +1901,7 @@ func file_api_hermes_proto_init() { } } file_api_hermes_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HermesByVoterResponse); i { + switch v := v.(*HermesBucketDistribution); i { case 0: return &v.state case 1: @@ -1656,7 +1913,7 @@ func file_api_hermes_proto_init() { } } file_api_hermes_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HermesByDelegateRequest); i { + switch v := v.(*HermesBucketResponse); i { case 0: return &v.state case 1: @@ -1668,7 +1925,7 @@ func file_api_hermes_proto_init() { } } file_api_hermes_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HermesByDelegateVoterInfo); i { + switch v := v.(*HermesByVoterRequest); i { case 0: return &v.state case 1: @@ -1680,7 +1937,7 @@ func file_api_hermes_proto_init() { } } file_api_hermes_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HermesByDelegateDistributionRatio); i { + switch v := v.(*HermesByVoterResponse); i { case 0: return &v.state case 1: @@ -1692,7 +1949,7 @@ func file_api_hermes_proto_init() { } } file_api_hermes_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HermesByDelegateResponse); i { + switch v := v.(*HermesByDelegateRequest); i { case 0: return &v.state case 1: @@ -1704,7 +1961,7 @@ func file_api_hermes_proto_init() { } } file_api_hermes_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HermesMetaRequest); i { + switch v := v.(*HermesByDelegateVoterInfo); i { case 0: return &v.state case 1: @@ -1716,7 +1973,7 @@ func file_api_hermes_proto_init() { } } file_api_hermes_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HermesMetaResponse); i { + switch v := v.(*HermesByDelegateDistributionRatio); i { case 0: return &v.state case 1: @@ -1728,7 +1985,7 @@ func file_api_hermes_proto_init() { } } file_api_hermes_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HermesAverageStatsRequest); i { + switch v := v.(*HermesByDelegateResponse); i { case 0: return &v.state case 1: @@ -1740,7 +1997,7 @@ func file_api_hermes_proto_init() { } } file_api_hermes_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HermesAverageStatsResponse); i { + switch v := v.(*HermesMetaRequest); i { case 0: return &v.state case 1: @@ -1752,7 +2009,7 @@ func file_api_hermes_proto_init() { } } file_api_hermes_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HermesDropRecordsRequest); i { + switch v := v.(*HermesMetaResponse); i { case 0: return &v.state case 1: @@ -1764,7 +2021,7 @@ func file_api_hermes_proto_init() { } } file_api_hermes_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HermesDropRecordsResponse); i { + switch v := v.(*HermesAverageStatsRequest); i { case 0: return &v.state case 1: @@ -1776,7 +2033,7 @@ func file_api_hermes_proto_init() { } } file_api_hermes_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HermesByVoterResponse_Delegate); i { + switch v := v.(*HermesAverageStatsResponse); i { case 0: return &v.state case 1: @@ -1788,6 +2045,42 @@ func file_api_hermes_proto_init() { } } file_api_hermes_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HermesDropRecordsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_hermes_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HermesDropRecordsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_hermes_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HermesByVoterResponse_Delegate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_hermes_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*HermesAverageStatsResponse_AveragePerEpoch); i { case 0: return &v.state @@ -1806,7 +2099,7 @@ func file_api_hermes_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_api_hermes_proto_rawDesc, NumEnums: 0, - NumMessages: 18, + NumMessages: 21, NumExtensions: 0, NumServices: 1, }, diff --git a/api/api_hermes.pb.gw.go b/api/api_hermes.pb.gw.go index 857eed8..e556e7d 100644 --- a/api/api_hermes.pb.gw.go +++ b/api/api_hermes.pb.gw.go @@ -65,6 +65,40 @@ func local_request_HermesService_Hermes_0(ctx context.Context, marshaler runtime } +func request_HermesService_HermesBucket_0(ctx context.Context, marshaler runtime.Marshaler, client HermesServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq HermesRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.HermesBucket(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_HermesService_HermesBucket_0(ctx context.Context, marshaler runtime.Marshaler, server HermesServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq HermesRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.HermesBucket(ctx, &protoReq) + return msg, metadata, err + +} + func request_HermesService_HermesByVoter_0(ctx context.Context, marshaler runtime.Marshaler, client HermesServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq HermesByVoterRequest var metadata runtime.ServerMetadata @@ -264,6 +298,29 @@ func RegisterHermesServiceHandlerServer(ctx context.Context, mux *runtime.ServeM }) + mux.Handle("POST", pattern_HermesService_HermesBucket_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/api.HermesService/HermesBucket") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_HermesService_HermesBucket_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_HermesService_HermesBucket_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("POST", pattern_HermesService_HermesByVoter_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -440,6 +497,26 @@ func RegisterHermesServiceHandlerClient(ctx context.Context, mux *runtime.ServeM }) + mux.Handle("POST", pattern_HermesService_HermesBucket_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/api.HermesService/HermesBucket") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_HermesService_HermesBucket_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_HermesService_HermesBucket_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("POST", pattern_HermesService_HermesByVoter_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -546,6 +623,8 @@ func RegisterHermesServiceHandlerClient(ctx context.Context, mux *runtime.ServeM var ( pattern_HermesService_Hermes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"api.HermesService.Hermes"}, "")) + pattern_HermesService_HermesBucket_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"api.HermesService.HermesBucket"}, "")) + pattern_HermesService_HermesByVoter_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"api.HermesService.HermesByVoter"}, "")) pattern_HermesService_HermesByDelegate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"api.HermesService.HermesByDelegate"}, "")) @@ -560,6 +639,8 @@ var ( var ( forward_HermesService_Hermes_0 = runtime.ForwardResponseMessage + forward_HermesService_HermesBucket_0 = runtime.ForwardResponseMessage + forward_HermesService_HermesByVoter_0 = runtime.ForwardResponseMessage forward_HermesService_HermesByDelegate_0 = runtime.ForwardResponseMessage diff --git a/api/api_hermes_grpc.pb.go b/api/api_hermes_grpc.pb.go index 7245240..ca9c4ae 100644 --- a/api/api_hermes_grpc.pb.go +++ b/api/api_hermes_grpc.pb.go @@ -20,7 +20,9 @@ const _ = grpc.SupportPackageIsVersion7 type HermesServiceClient interface { // Hermes gives delegates who register the service of automatic reward distribution an overview of the reward distributions to their voters within a range of epochs Hermes(ctx context.Context, in *HermesRequest, opts ...grpc.CallOption) (*HermesResponse, error) - //HermesByVoter returns Hermes voters' receiving history + // Hermes gives delegates who register the service of automatic reward distribution an overview of the reward distributions to their voters within a range of epochs + HermesBucket(ctx context.Context, in *HermesRequest, opts ...grpc.CallOption) (*HermesBucketResponse, error) + // HermesByVoter returns Hermes voters' receiving history HermesByVoter(ctx context.Context, in *HermesByVoterRequest, opts ...grpc.CallOption) (*HermesByVoterResponse, error) // HermesByDelegate returns Hermes delegates' distribution history HermesByDelegate(ctx context.Context, in *HermesByDelegateRequest, opts ...grpc.CallOption) (*HermesByDelegateResponse, error) @@ -49,6 +51,15 @@ func (c *hermesServiceClient) Hermes(ctx context.Context, in *HermesRequest, opt return out, nil } +func (c *hermesServiceClient) HermesBucket(ctx context.Context, in *HermesRequest, opts ...grpc.CallOption) (*HermesBucketResponse, error) { + out := new(HermesBucketResponse) + err := c.cc.Invoke(ctx, "/api.HermesService/HermesBucket", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *hermesServiceClient) HermesByVoter(ctx context.Context, in *HermesByVoterRequest, opts ...grpc.CallOption) (*HermesByVoterResponse, error) { out := new(HermesByVoterResponse) err := c.cc.Invoke(ctx, "/api.HermesService/HermesByVoter", in, out, opts...) @@ -100,7 +111,9 @@ func (c *hermesServiceClient) HermesDropRecords(ctx context.Context, in *HermesD type HermesServiceServer interface { // Hermes gives delegates who register the service of automatic reward distribution an overview of the reward distributions to their voters within a range of epochs Hermes(context.Context, *HermesRequest) (*HermesResponse, error) - //HermesByVoter returns Hermes voters' receiving history + // Hermes gives delegates who register the service of automatic reward distribution an overview of the reward distributions to their voters within a range of epochs + HermesBucket(context.Context, *HermesRequest) (*HermesBucketResponse, error) + // HermesByVoter returns Hermes voters' receiving history HermesByVoter(context.Context, *HermesByVoterRequest) (*HermesByVoterResponse, error) // HermesByDelegate returns Hermes delegates' distribution history HermesByDelegate(context.Context, *HermesByDelegateRequest) (*HermesByDelegateResponse, error) @@ -120,6 +133,9 @@ type UnimplementedHermesServiceServer struct { func (UnimplementedHermesServiceServer) Hermes(context.Context, *HermesRequest) (*HermesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Hermes not implemented") } +func (UnimplementedHermesServiceServer) HermesBucket(context.Context, *HermesRequest) (*HermesBucketResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method HermesBucket not implemented") +} func (UnimplementedHermesServiceServer) HermesByVoter(context.Context, *HermesByVoterRequest) (*HermesByVoterResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method HermesByVoter not implemented") } @@ -166,6 +182,24 @@ func _HermesService_Hermes_Handler(srv interface{}, ctx context.Context, dec fun return interceptor(ctx, in, info, handler) } +func _HermesService_HermesBucket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(HermesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HermesServiceServer).HermesBucket(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.HermesService/HermesBucket", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HermesServiceServer).HermesBucket(ctx, req.(*HermesRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _HermesService_HermesByVoter_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(HermesByVoterRequest) if err := dec(in); err != nil { @@ -267,6 +301,10 @@ var HermesService_ServiceDesc = grpc.ServiceDesc{ MethodName: "Hermes", Handler: _HermesService_Hermes_Handler, }, + { + MethodName: "HermesBucket", + Handler: _HermesService_HermesBucket_Handler, + }, { MethodName: "HermesByVoter", Handler: _HermesService_HermesByVoter_Handler, diff --git a/apiservice/hermes.go b/apiservice/hermes.go index 45207eb..9adaad4 100644 --- a/apiservice/hermes.go +++ b/apiservice/hermes.go @@ -50,6 +50,17 @@ type DelegateHermesDistribution struct { Refund string } +type BucketRewardDistribution api.BucketRewardDistribution + +type DelegateHermesBucketDistribution struct { + DelegateName string + Distributions []*BucketRewardDistribution + StakingIotexAddress string + VoterCount uint64 + WaiveServiceFee bool + Refund string +} + type AccountReward struct { ID uint64 BlockHeight uint64 @@ -205,3 +216,20 @@ func convertVoterDistributionMapToList(voterAddrToReward map[string]*big.Int) ([ } return rewardDistribution, nil } + +// convertVoterDistributionMapToList converts voter reward distribution map to list +func convertVoterBucketDistributionMapToList(voterAddrToReward map[string]map[uint64]*big.Int) ([]*BucketRewardDistribution, error) { + bucketRewardDistribution := make([]*BucketRewardDistribution, 0) + for ioAddress, bucketMap := range voterAddrToReward { + voterAddr, _ := address.FromString(ioAddress) + for bucketID, rewardAmount := range bucketMap { + bucketRewardDistribution = append(bucketRewardDistribution, &BucketRewardDistribution{ + VoterEthAddress: voterAddr.Hex(), + VoterIotexAddress: ioAddress, + BucketID: bucketID, + Amount: rewardAmount.String(), + }) + } + } + return bucketRewardDistribution, nil +} \ No newline at end of file diff --git a/apiservice/hermes_service.go b/apiservice/hermes_service.go index 21a1991..40eb1ac 100644 --- a/apiservice/hermes_service.go +++ b/apiservice/hermes_service.go @@ -162,6 +162,130 @@ func (s *HermesService) Hermes(ctx context.Context, req *api.HermesRequest) (*ap return resp, nil } +// grpcurl -plaintext -d '{"startEpoch": 22416, "epochCount": 1, "rewardAddress": "io12mgttmfa2ffn9uqvn0yn37f4nz43d248l2ga85"}' 127.0.0.1:8888 api.AccountService.HermesBucket +func (s *HermesService) HermesBucket(ctx context.Context, req *api.HermesRequest) (*api.HermesBucketResponse, error) { + resp := &api.HermesBucketResponse{} + startEpoch := req.GetStartEpoch() + epochCount := req.GetEpochCount() + rewardAddress := req.GetRewardAddress() + endEpoch := startEpoch + epochCount - 1 + waiverThreshold := 100 + + distributePlanMap, err := distributionPlanByRewardAddress(startEpoch, endEpoch, rewardAddress) + if err != nil { + return nil, errors.Wrap(err, "failed to get reward distribution plan") + } + + delegateMap := make(map[uint64][]string) + for delegateName, planMap := range distributePlanMap { + for epochNumber := range planMap { + if _, ok := delegateMap[epochNumber]; !ok { + delegateMap[epochNumber] = make([]string, 0) + } + delegateMap[epochNumber] = append(delegateMap[epochNumber], delegateName) + } + } + + accountRewardsMap, err := accountRewards(delegateMap) + if err != nil { + return nil, errors.Wrap(err, "failed to get account rewards") + } + + voterVotesMap, err := rewards.BucketIDWeightedVotesBySearchPairs(delegateMap) + if err != nil { + return nil, errors.Wrap(err, "failed to get voter votes") + } + hermesBucketDistributions := make([]*DelegateHermesBucketDistribution, 0, len(accountRewardsMap)) + for delegate, rewardsMap := range accountRewardsMap { + planMap := distributePlanMap[delegate] + epochVoterMap := voterVotesMap[delegate] + + voterAddrToReward := make(map[string]map[uint64]*big.Int) + balanceAfterDistribution := big.NewInt(0) + voterCountMap := make(map[string]bool) + feeWaiver := true + var stakingAddress string + + for epoch, rewards := range rewardsMap { + distributePlan := planMap[epoch] + voterMap := epochVoterMap[epoch] + + if stakingAddress == "" { + stakingAddress = distributePlan.StakingAddress + } + + totalRewards := new(big.Int).Set(rewards.BlockReward) + totalRewards.Add(totalRewards, rewards.EpochReward).Add(totalRewards, rewards.FoundationBonus) + balanceAfterDistribution.Add(balanceAfterDistribution, totalRewards) + waiverThresholdF := float64(waiverThreshold) + if distributePlan.BlockRewardPercentage < waiverThresholdF || distributePlan.EpochRewardPercentage < waiverThresholdF || distributePlan.FoundationBonusPercentage < waiverThresholdF { + feeWaiver = false + } + distrReward, err := calculatedDistributedReward(distributePlan, rewards) + if err != nil { + return nil, errors.Wrap(err, "failed to calculate distributed reward") + } + + for voterAddr, bucketMap := range voterMap { + if _, ok := voterAddrToReward[voterAddr]; !ok { + voterAddrToReward[voterAddr] = make(map[uint64]*big.Int) + } + bucketToReward := voterAddrToReward[voterAddr] + + for bucketID, weightedVotes := range bucketMap { + amount := new(big.Int).Set(distrReward) + amount = amount.Mul(amount, weightedVotes).Div(amount, distributePlan.TotalWeightedVotes) + if _, ok := bucketToReward[bucketID]; !ok { + bucketToReward[bucketID] = big.NewInt(0) + } + bucketToReward[bucketID].Add(bucketToReward[bucketID], amount) + balanceAfterDistribution.Sub(balanceAfterDistribution, amount) + } + voterCountMap[voterAddr] = true + } + } + bucketRewardDistribution, err := convertVoterBucketDistributionMapToList(voterAddrToReward) + if err != nil { + return nil, errors.Wrap(err, "failed to convert voter distribution map to list") + } + hermesBucketDistributions = append(hermesBucketDistributions, &DelegateHermesBucketDistribution{ + DelegateName: delegate, + Distributions: bucketRewardDistribution, + StakingIotexAddress: stakingAddress, + VoterCount: uint64(len(voterCountMap)), + WaiveServiceFee: feeWaiver, + Refund: balanceAfterDistribution.String(), + }) + } + + hermesBucketDistribution := make([]*api.HermesBucketDistribution, 0, len(hermesBucketDistributions)) + for _, ret := range hermesBucketDistributions { + rds := make([]*api.BucketRewardDistribution, 0) + for _, distribution := range ret.Distributions { + v := &api.BucketRewardDistribution{ + VoterEthAddress: distribution.VoterEthAddress, + VoterIotexAddress: distribution.VoterIotexAddress, + BucketID: distribution.BucketID, + Amount: distribution.Amount, + } + rds = append(rds, v) + } + sort.Slice(rds, func(i, j int) bool { return rds[i].VoterEthAddress < rds[j].VoterEthAddress }) + + hermesBucketDistribution = append(hermesBucketDistribution, &api.HermesBucketDistribution{ + DelegateName: ret.DelegateName, + BucketRewardDistribution: rds, + StakingIotexAddress: ret.StakingIotexAddress, + VoterCount: ret.VoterCount, + WaiveServiceFee: ret.WaiveServiceFee, + Refund: ret.Refund, + }) + } + sort.Slice(hermesBucketDistribution, func(i, j int) bool { return hermesBucketDistribution[i].DelegateName < hermesBucketDistribution[j].DelegateName }) + resp.HermesBucketDistribution = hermesBucketDistribution + return resp, nil +} + // HermesByVoter returns Hermes voters' receiving history func (s *HermesService) HermesByVoter(ctx context.Context, req *api.HermesByVoterRequest) (*api.HermesByVoterResponse, error) { resp := &api.HermesByVoterResponse{} diff --git a/common/rewards/hermes.go b/common/rewards/hermes.go index b97da15..bfdb4b6 100644 --- a/common/rewards/hermes.go +++ b/common/rewards/hermes.go @@ -31,6 +31,15 @@ type AggregateVoting struct { AggregateVotes string } +type BucketVoting struct { + EpochNumber uint64 + CandidateName string + VoterAddress string + NativeFlag bool + BucketID uint64 + Votes string +} + type EpochFoundationReward struct { EpochNumber uint64 EpochReward string @@ -243,6 +252,88 @@ func WeightedVotesBySearchPairs(delegateMap map[uint64][]string) (map[string]map return voterVotesMap, nil } +func BucketIDWeightedVotesBySearchPairs(delegateMap map[uint64][]string) (map[string]map[uint64]map[string]map[uint64]*big.Int, error) { + db := db.DB() + g := errgroup.Group{} + g.GOMAXPROCS(8) + var minEpoch, maxEpoch uint64 + minEpoch = math.MaxUint64 + maxEpoch = 0 + for k := range delegateMap { + if k >= maxEpoch { + maxEpoch = k + } + if k <= minEpoch { + minEpoch = k + } + } + f := func(ctx context.Context, epochNum uint64) ([]BucketVoting, error) { + var votes []BucketVoting + if err := db.Table("hermes_bucket_votings").Select("candidate_name,voter_address,bucket_id,votes").Where("epoch_number = ?", epochNum).Scan(&votes).Error; err != nil { + return nil, errors.WithStack(err) + } + return votes, nil + } + var epochMap sync.Map + for epoch := minEpoch; epoch <= maxEpoch; epoch++ { + epoch := epoch + g.Go(func(ctx context.Context) error { + voters, err := f(ctx, epoch) + if err != nil { + return err + } + epochMap.Store(epoch, voters) + return nil + }) + } + if err := g.Wait(); err != nil { + return nil, err + } + voterVotesMap := make(map[string]map[uint64]map[string]map[uint64]*big.Int) //map[candidateName][epoch][voterAddr][bucketId]weightedVotes + epochMap.Range(func(key, value interface{}) bool { + epoch := key.(uint64) + voters := value.([]BucketVoting) + for _, row := range voters { + exist := false + for _, v := range delegateMap[epoch] { + if row.CandidateName == v { + exist = true + break + } + } + if !exist { + continue + } + if _, ok := voterVotesMap[row.CandidateName]; !ok { + voterVotesMap[row.CandidateName] = make(map[uint64]map[string]map[uint64]*big.Int) + } + epochVoterMap := voterVotesMap[row.CandidateName] + if _, ok := epochVoterMap[epoch]; !ok { + epochVoterMap[epoch] = make(map[string]map[uint64]*big.Int) + } + voterMap := epochVoterMap[epoch] + + if _, ok := voterMap[row.VoterAddress]; !ok { + voterMap[row.VoterAddress] = make(map[uint64]*big.Int) + } + bucketIDMap := voterMap[row.VoterAddress] + + weightedVotesInt, ok := new(big.Int).SetString(row.Votes, 10) + if !ok { + return false + } + // TODO QA voter address is bucket owner? + if val, ok := bucketIDMap[row.BucketID]; !ok { + bucketIDMap[row.BucketID] = weightedVotesInt + } else { + bucketIDMap[row.BucketID] = new(big.Int).Add(val, weightedVotesInt) + } + } + return true + }) + return voterVotesMap, nil +} + type HermesVoteInfo struct { Recipient string StartEpoch uint64 diff --git a/proto/api_hermes.proto b/proto/api_hermes.proto index 5f360b6..a8d49f2 100644 --- a/proto/api_hermes.proto +++ b/proto/api_hermes.proto @@ -31,6 +31,26 @@ message HermesResponse { repeated HermesDistribution hermesDistribution = 1; } +message BucketRewardDistribution { + string voterEthAddress = 1; // voter’s ERC20 address + string voterIotexAddress = 2; // voter’s IoTeX address + uint64 bucketID = 3; // voter's bucketID + string amount = 4; // amount of reward distribution +} + +message HermesBucketDistribution { + string delegateName = 1; // delegate name + repeated BucketRewardDistribution bucketRewardDistribution = 2; + string stakingIotexAddress = 3; // delegate IoTeX staking address + uint64 voterCount = 4; // number of voters + bool waiveServiceFee = 5; // whether the delegate is qualified for waiving the service fee + string refund = 6; // amount of refund +} + +message HermesBucketResponse { + repeated HermesBucketDistribution hermesBucketDistribution = 1; +} + message HermesByVoterRequest { uint64 startEpoch = 1; // Start epoch number uint64 epochCount = 2; // Number of epochs to query @@ -132,6 +152,17 @@ service HermesService { body: "*" }; }; + // Hermes gives delegates who register the service of automatic reward distribution an overview of the bucket reward distributions to their voters within a range of epochs + rpc HermesBucket(HermesRequest) returns (HermesBucketResponse) { + option (graphql.schema) = { + type: QUERY + name: "HermesBucket" + }; + option (google.api.http) = { + post: "/api.HermesService.HermesBucket" + body: "*" + }; + }; //HermesByVoter returns Hermes voters' receiving history rpc HermesByVoter(HermesByVoterRequest) returns (HermesByVoterResponse) { option (graphql.schema) = {