diff --git a/api/gateway/BUILD.bazel b/api/gateway/BUILD.bazel index 9b9643d95..c3b933b8f 100644 --- a/api/gateway/BUILD.bazel +++ b/api/gateway/BUILD.bazel @@ -5,6 +5,7 @@ go_library( srcs = [ "gateway.go", "log.go", + "modifiers.go", "options.go", ], importpath = "github.com/prysmaticlabs/prysm/api/gateway", @@ -23,6 +24,7 @@ go_library( "@org_golang_google_grpc//:go_default_library", "@org_golang_google_grpc//connectivity:go_default_library", "@org_golang_google_grpc//credentials:go_default_library", + "@org_golang_google_protobuf//proto:go_default_library", ], ) diff --git a/api/gateway/apimiddleware/BUILD.bazel b/api/gateway/apimiddleware/BUILD.bazel index cf15b05a7..c97079006 100644 --- a/api/gateway/apimiddleware/BUILD.bazel +++ b/api/gateway/apimiddleware/BUILD.bazel @@ -15,6 +15,7 @@ go_library( deps = [ "//api/grpc:go_default_library", "//encoding/bytesutil:go_default_library", + "@com_github_ethereum_go_ethereum//common:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", "@com_github_gorilla_mux//:go_default_library", "@com_github_pkg_errors//:go_default_library", diff --git a/api/gateway/apimiddleware/api_middleware.go b/api/gateway/apimiddleware/api_middleware.go index f5dc5ef8d..e04b1f325 100644 --- a/api/gateway/apimiddleware/api_middleware.go +++ b/api/gateway/apimiddleware/api_middleware.go @@ -111,7 +111,7 @@ func (m *ApiProxyMiddleware) WithMiddleware(path string) http.HandlerFunc { } } - if req.Method == "DELETE" { + if req.Method == "DELETE" && req.Body != http.NoBody { if errJson := handleDeleteRequestForEndpoint(endpoint, req); errJson != nil { WriteError(w, errJson, nil) return diff --git a/api/gateway/apimiddleware/process_field.go b/api/gateway/apimiddleware/process_field.go index efc05c22a..d364fdd5c 100644 --- a/api/gateway/apimiddleware/process_field.go +++ b/api/gateway/apimiddleware/process_field.go @@ -9,6 +9,7 @@ import ( "strings" "time" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/pkg/errors" "github.com/wealdtech/go-bytesutil" @@ -100,6 +101,20 @@ func base64ToHexProcessor(v reflect.Value) error { return nil } +func base64ToChecksumAddressProcessor(v reflect.Value) error { + if v.String() == "" { + // Empty hex values are represented as "0x". + v.SetString("0x") + return nil + } + b, err := base64.StdEncoding.DecodeString(v.String()) + if err != nil { + return err + } + v.SetString(common.BytesToAddress(b).Hex()) + return nil +} + func base64ToUint256Processor(v reflect.Value) error { if v.String() == "" { return nil diff --git a/api/gateway/apimiddleware/process_request.go b/api/gateway/apimiddleware/process_request.go index a1b0f5d26..f2d6751f3 100644 --- a/api/gateway/apimiddleware/process_request.go +++ b/api/gateway/apimiddleware/process_request.go @@ -149,6 +149,10 @@ func ProcessMiddlewareResponseFields(responseContainer interface{}) ErrorJson { tag: "hex", f: base64ToHexProcessor, }, + { + tag: "address", + f: base64ToChecksumAddressProcessor, + }, { tag: "enum", f: enumToLowercaseProcessor, diff --git a/api/gateway/apimiddleware/process_request_test.go b/api/gateway/apimiddleware/process_request_test.go index 1d9c9561b..6c97f3c4c 100644 --- a/api/gateway/apimiddleware/process_request_test.go +++ b/api/gateway/apimiddleware/process_request_test.go @@ -31,21 +31,25 @@ func defaultRequestContainer() *testRequestContainer { } type testResponseContainer struct { - TestString string - TestHex string `hex:"true"` - TestEmptyHex string `hex:"true"` - TestUint256 string `uint256:"true"` - TestEnum string `enum:"true"` - TestTime string `time:"true"` + TestString string + TestHex string `hex:"true"` + TestEmptyHex string `hex:"true"` + TestAddress string `address:"true"` + TestEmptyAddress string `address:"true"` + TestUint256 string `uint256:"true"` + TestEnum string `enum:"true"` + TestTime string `time:"true"` } func defaultResponseContainer() *testResponseContainer { return &testResponseContainer{ - TestString: "test string", - TestHex: "Zm9v", // base64 encoding of "foo" - TestEmptyHex: "", - TestEnum: "Test Enum", - TestTime: "2006-01-02T15:04:05Z", + TestString: "test string", + TestHex: "Zm9v", // base64 encoding of "foo" + TestEmptyHex: "", + TestAddress: "Zm9v", + TestEmptyAddress: "", + TestEnum: "Test Enum", + TestTime: "2006-01-02T15:04:05Z", // base64 encoding of 4196 in little-endian TestUint256: "ZBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=", @@ -247,6 +251,8 @@ func TestProcessMiddlewareResponseFields(t *testing.T) { require.Equal(t, true, errJson == nil) assert.Equal(t, "0x666f6f", container.TestHex) assert.Equal(t, "0x", container.TestEmptyHex) + assert.Equal(t, "0x0000000000000000000000000000000000666F6f", container.TestAddress) + assert.Equal(t, "0x", container.TestEmptyAddress) assert.Equal(t, "4196", container.TestUint256) assert.Equal(t, "test enum", container.TestEnum) assert.Equal(t, "1136214245", container.TestTime) @@ -292,7 +298,7 @@ func TestWriteMiddlewareResponseHeadersAndBody(t *testing.T) { v, ok = writer.Header()["Content-Length"] require.Equal(t, true, ok, "header not found") require.Equal(t, 1, len(v), "wrong number of header values") - assert.Equal(t, "181", v[0]) + assert.Equal(t, "224", v[0]) assert.Equal(t, 204, writer.Code) assert.DeepEqual(t, responseJson, writer.Body.Bytes()) }) diff --git a/api/gateway/modifiers.go b/api/gateway/modifiers.go new file mode 100644 index 000000000..ac036fb0c --- /dev/null +++ b/api/gateway/modifiers.go @@ -0,0 +1,30 @@ +package gateway + +import ( + "context" + "net/http" + "strconv" + + gwruntime "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "google.golang.org/protobuf/proto" +) + +func HttpResponseModifier(ctx context.Context, w http.ResponseWriter, resp proto.Message) error { + md, ok := gwruntime.ServerMetadataFromContext(ctx) + if !ok { + return nil + } + // set http status code + if vals := md.HeaderMD.Get("x-http-code"); len(vals) > 0 { + code, err := strconv.Atoi(vals[0]) + if err != nil { + return err + } + // delete the headers to not expose any grpc-metadata in http response + delete(md.HeaderMD, "x-http-code") + delete(w.Header(), "Grpc-Metadata-X-Http-Code") + w.WriteHeader(code) + } + + return nil +} diff --git a/config/validator/service/BUILD.bazel b/config/validator/service/BUILD.bazel index aa7dc2f17..30b854a77 100644 --- a/config/validator/service/BUILD.bazel +++ b/config/validator/service/BUILD.bazel @@ -7,6 +7,7 @@ go_library( visibility = ["//visibility:public"], deps = [ "//config/fieldparams:go_default_library", + "//config/params:go_default_library", "@com_github_ethereum_go_ethereum//common:go_default_library", ], ) diff --git a/config/validator/service/proposer-settings.go b/config/validator/service/proposer-settings.go index 67500e1e9..be19b6f8b 100644 --- a/config/validator/service/proposer-settings.go +++ b/config/validator/service/proposer-settings.go @@ -3,6 +3,7 @@ package validator_service_config import ( "github.com/ethereum/go-ethereum/common" field_params "github.com/prysmaticlabs/prysm/config/fieldparams" + "github.com/prysmaticlabs/prysm/config/params" ) // ProposerSettingsPayload is the struct representation of the JSON or YAML payload set in the validator through the CLI. @@ -33,3 +34,11 @@ type ProposerOption struct { FeeRecipient common.Address GasLimit uint64 } + +// DefaultProposerOption returns a Proposer Option with defaults filled +func DefaultProposerOption() ProposerOption { + return ProposerOption{ + FeeRecipient: params.BeaconConfig().DefaultFeeRecipient, + GasLimit: params.BeaconConfig().DefaultBuilderGasLimit, + } +} diff --git a/hack/keymanager-api/keymanager-api.postman_collection.json b/hack/keymanager-api/keymanager-api.postman_collection.json index 8a9beaac7..9c415dd25 100644 --- a/hack/keymanager-api/keymanager-api.postman_collection.json +++ b/hack/keymanager-api/keymanager-api.postman_collection.json @@ -120,6 +120,118 @@ } }, "response": [] + }, + { + "name": "get fee recipient", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.e30.ck3J6tcvHcI74IiFjyJqcBH-MmNAq-fMr0ncyZkGvFM", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "default" + } + ], + "url": { + "raw": "localhost:7500/eth/v1/validator/0xaf2e7ba294e03438ea819bd4033c6c1bf6b04320ee2075b77273c08d02f8a61bcc303c2c06bd3713cb442072ae591494/feerecipient", + "host": [ + "localhost" + ], + "port": "7500", + "path": [ + "eth", + "v1", + "validator", + "0xaf2e7ba294e03438ea819bd4033c6c1bf6b04320ee2075b77273c08d02f8a61bcc303c2c06bd3713cb442072ae591494", + "feerecipient" + ] + } + }, + "response": [] + }, + { + "name": "set fee recipient", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.e30.ck3J6tcvHcI74IiFjyJqcBH-MmNAq-fMr0ncyZkGvFM", + "type": "string" + } + ] + }, + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"ethaddress\":\"0x046FB65722E7b2455012bfebF6177F4d2e9738D9\"\n}\n" + }, + "url": { + "raw": "localhost:7500/eth/v1/validator/0xaf2e7ba294e03438ea819bd4033c6c1bf6b04320ee2075b77273c08d02f8a61bcc303c2c06bd3713cb442072ae591494/feerecipient", + "host": [ + "localhost" + ], + "port": "7500", + "path": [ + "eth", + "v1", + "validator", + "0xaf2e7ba294e03438ea819bd4033c6c1bf6b04320ee2075b77273c08d02f8a61bcc303c2c06bd3713cb442072ae591494", + "feerecipient" + ] + } + }, + "response": [] + }, + { + "name": "delete fee recipient", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.e30.ck3J6tcvHcI74IiFjyJqcBH-MmNAq-fMr0ncyZkGvFM", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "default" + } + ], + "url": { + "raw": "localhost:7500/eth/v1/validator/0xaf2e7ba294e03438ea819bd4033c6c1bf6b04320ee2075b77273c08d02f8a61bcc303c2c06bd3713cb442072ae591494/feerecipient", + "host": [ + "localhost" + ], + "port": "7500", + "path": [ + "eth", + "v1", + "validator", + "0xaf2e7ba294e03438ea819bd4033c6c1bf6b04320ee2075b77273c08d02f8a61bcc303c2c06bd3713cb442072ae591494", + "feerecipient" + ] + } + }, + "response": [] } ] } \ No newline at end of file diff --git a/proto/eth/service/key_management.pb.go b/proto/eth/service/key_management.pb.go index d0f5d235c..2c52fa78e 100755 --- a/proto/eth/service/key_management.pb.go +++ b/proto/eth/service/key_management.pb.go @@ -944,6 +944,155 @@ func (x *DeletedRemoteKeysStatus) GetMessage() string { return "" } +type PubkeyRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Pubkey []byte `protobuf:"bytes,1,opt,name=pubkey,proto3" json:"pubkey,omitempty"` +} + +func (x *PubkeyRequest) Reset() { + *x = PubkeyRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_eth_service_key_management_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PubkeyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PubkeyRequest) ProtoMessage() {} + +func (x *PubkeyRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_eth_service_key_management_proto_msgTypes[14] + 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 PubkeyRequest.ProtoReflect.Descriptor instead. +func (*PubkeyRequest) Descriptor() ([]byte, []int) { + return file_proto_eth_service_key_management_proto_rawDescGZIP(), []int{14} +} + +func (x *PubkeyRequest) GetPubkey() []byte { + if x != nil { + return x.Pubkey + } + return nil +} + +type GetFeeRecipientByPubkeyResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Data *GetFeeRecipientByPubkeyResponse_FeeRecipient `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` +} + +func (x *GetFeeRecipientByPubkeyResponse) Reset() { + *x = GetFeeRecipientByPubkeyResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_eth_service_key_management_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetFeeRecipientByPubkeyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetFeeRecipientByPubkeyResponse) ProtoMessage() {} + +func (x *GetFeeRecipientByPubkeyResponse) ProtoReflect() protoreflect.Message { + mi := &file_proto_eth_service_key_management_proto_msgTypes[15] + 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 GetFeeRecipientByPubkeyResponse.ProtoReflect.Descriptor instead. +func (*GetFeeRecipientByPubkeyResponse) Descriptor() ([]byte, []int) { + return file_proto_eth_service_key_management_proto_rawDescGZIP(), []int{15} +} + +func (x *GetFeeRecipientByPubkeyResponse) GetData() *GetFeeRecipientByPubkeyResponse_FeeRecipient { + if x != nil { + return x.Data + } + return nil +} + +type SetFeeRecipientByPubkeyRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Pubkey []byte `protobuf:"bytes,1,opt,name=pubkey,proto3" json:"pubkey,omitempty"` + Ethaddress []byte `protobuf:"bytes,2,opt,name=ethaddress,proto3" json:"ethaddress,omitempty"` +} + +func (x *SetFeeRecipientByPubkeyRequest) Reset() { + *x = SetFeeRecipientByPubkeyRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_eth_service_key_management_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetFeeRecipientByPubkeyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetFeeRecipientByPubkeyRequest) ProtoMessage() {} + +func (x *SetFeeRecipientByPubkeyRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_eth_service_key_management_proto_msgTypes[16] + 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 SetFeeRecipientByPubkeyRequest.ProtoReflect.Descriptor instead. +func (*SetFeeRecipientByPubkeyRequest) Descriptor() ([]byte, []int) { + return file_proto_eth_service_key_management_proto_rawDescGZIP(), []int{16} +} + +func (x *SetFeeRecipientByPubkeyRequest) GetPubkey() []byte { + if x != nil { + return x.Pubkey + } + return nil +} + +func (x *SetFeeRecipientByPubkeyRequest) GetEthaddress() []byte { + if x != nil { + return x.Ethaddress + } + return nil +} + type ListKeystoresResponse_Keystore struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -956,7 +1105,7 @@ type ListKeystoresResponse_Keystore struct { func (x *ListKeystoresResponse_Keystore) Reset() { *x = ListKeystoresResponse_Keystore{} if protoimpl.UnsafeEnabled { - mi := &file_proto_eth_service_key_management_proto_msgTypes[14] + mi := &file_proto_eth_service_key_management_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -969,7 +1118,7 @@ func (x *ListKeystoresResponse_Keystore) String() string { func (*ListKeystoresResponse_Keystore) ProtoMessage() {} func (x *ListKeystoresResponse_Keystore) ProtoReflect() protoreflect.Message { - mi := &file_proto_eth_service_key_management_proto_msgTypes[14] + mi := &file_proto_eth_service_key_management_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1012,7 +1161,7 @@ type ListRemoteKeysResponse_Keystore struct { func (x *ListRemoteKeysResponse_Keystore) Reset() { *x = ListRemoteKeysResponse_Keystore{} if protoimpl.UnsafeEnabled { - mi := &file_proto_eth_service_key_management_proto_msgTypes[15] + mi := &file_proto_eth_service_key_management_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1025,7 +1174,7 @@ func (x *ListRemoteKeysResponse_Keystore) String() string { func (*ListRemoteKeysResponse_Keystore) ProtoMessage() {} func (x *ListRemoteKeysResponse_Keystore) ProtoReflect() protoreflect.Message { - mi := &file_proto_eth_service_key_management_proto_msgTypes[15] + mi := &file_proto_eth_service_key_management_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1074,7 +1223,7 @@ type ImportRemoteKeysRequest_Keystore struct { func (x *ImportRemoteKeysRequest_Keystore) Reset() { *x = ImportRemoteKeysRequest_Keystore{} if protoimpl.UnsafeEnabled { - mi := &file_proto_eth_service_key_management_proto_msgTypes[16] + mi := &file_proto_eth_service_key_management_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1087,7 +1236,7 @@ func (x *ImportRemoteKeysRequest_Keystore) String() string { func (*ImportRemoteKeysRequest_Keystore) ProtoMessage() {} func (x *ImportRemoteKeysRequest_Keystore) ProtoReflect() protoreflect.Message { - mi := &file_proto_eth_service_key_management_proto_msgTypes[16] + mi := &file_proto_eth_service_key_management_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1117,6 +1266,61 @@ func (x *ImportRemoteKeysRequest_Keystore) GetUrl() string { return "" } +type GetFeeRecipientByPubkeyResponse_FeeRecipient struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Pubkey []byte `protobuf:"bytes,1,opt,name=pubkey,proto3" json:"pubkey,omitempty"` + Ethaddress []byte `protobuf:"bytes,2,opt,name=ethaddress,proto3" json:"ethaddress,omitempty"` +} + +func (x *GetFeeRecipientByPubkeyResponse_FeeRecipient) Reset() { + *x = GetFeeRecipientByPubkeyResponse_FeeRecipient{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_eth_service_key_management_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetFeeRecipientByPubkeyResponse_FeeRecipient) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetFeeRecipientByPubkeyResponse_FeeRecipient) ProtoMessage() {} + +func (x *GetFeeRecipientByPubkeyResponse_FeeRecipient) ProtoReflect() protoreflect.Message { + mi := &file_proto_eth_service_key_management_proto_msgTypes[20] + 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 GetFeeRecipientByPubkeyResponse_FeeRecipient.ProtoReflect.Descriptor instead. +func (*GetFeeRecipientByPubkeyResponse_FeeRecipient) Descriptor() ([]byte, []int) { + return file_proto_eth_service_key_management_proto_rawDescGZIP(), []int{15, 0} +} + +func (x *GetFeeRecipientByPubkeyResponse_FeeRecipient) GetPubkey() []byte { + if x != nil { + return x.Pubkey + } + return nil +} + +func (x *GetFeeRecipientByPubkeyResponse_FeeRecipient) GetEthaddress() []byte { + if x != nil { + return x.Ethaddress + } + return nil +} + var File_proto_eth_service_key_management_proto protoreflect.FileDescriptor var file_proto_eth_service_key_management_proto_rawDesc = []byte{ @@ -1252,73 +1456,124 @@ var file_proto_eth_service_key_management_proto_rawDesc = []byte{ 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x2f, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0d, 0x0a, 0x09, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, - 0x44, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x03, 0x32, 0xee, - 0x06, 0x0a, 0x0d, 0x4b, 0x65, 0x79, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x12, 0x78, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x4b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, - 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x44, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x03, 0x22, 0x27, + 0x0a, 0x0d, 0x50, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x16, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x22, 0xc1, 0x01, 0x0a, 0x1f, 0x47, 0x65, 0x74, 0x46, + 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x42, 0x79, 0x50, 0x75, 0x62, + 0x6b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x04, 0x64, + 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x42, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x22, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, - 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, - 0x2f, 0x6b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x12, 0x95, 0x01, 0x0a, 0x0f, 0x49, - 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x12, 0x2c, - 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4b, 0x65, 0x79, 0x73, - 0x74, 0x6f, 0x72, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4b, 0x65, 0x79, 0x73, 0x74, 0x6f, - 0x72, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x1f, 0x22, 0x1a, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x65, - 0x74, 0x68, 0x2f, 0x76, 0x31, 0x2f, 0x6b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x3a, - 0x01, 0x2a, 0x12, 0x95, 0x01, 0x0a, 0x0f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4b, 0x65, 0x79, - 0x73, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x12, 0x2c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, - 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x2a, 0x1a, 0x2f, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x2f, 0x6b, 0x65, - 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x3a, 0x01, 0x2a, 0x12, 0x7b, 0x0a, 0x0e, 0x4c, 0x69, - 0x73, 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x16, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, - 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x2c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, - 0x65, 0x74, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x6d, - 0x6f, 0x74, 0x65, 0x6b, 0x65, 0x79, 0x73, 0x12, 0x99, 0x01, 0x0a, 0x10, 0x49, 0x6d, 0x70, 0x6f, - 0x72, 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x2d, 0x2e, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, - 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x65, 0x74, + 0x2e, 0x47, 0x65, 0x74, 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, + 0x42, 0x79, 0x50, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x2e, 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x04, 0x64, + 0x61, 0x74, 0x61, 0x1a, 0x46, 0x0a, 0x0c, 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, + 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x65, + 0x74, 0x68, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x0a, 0x65, 0x74, 0x68, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x58, 0x0a, 0x1e, 0x53, + 0x65, 0x74, 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x42, 0x79, + 0x50, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, + 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x70, + 0x75, 0x62, 0x6b, 0x65, 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x74, 0x68, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x65, 0x74, 0x68, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x32, 0xe1, 0x0a, 0x0a, 0x0d, 0x4b, 0x65, 0x79, 0x4d, 0x61, 0x6e, + 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x78, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x4b, + 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x1a, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4b, 0x65, 0x79, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x22, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, + 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x2f, 0x6b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, + 0x73, 0x12, 0x95, 0x01, 0x0a, 0x0f, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4b, 0x65, 0x79, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x73, 0x12, 0x2c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x49, 0x6d, 0x70, + 0x6f, 0x72, 0x74, 0x4b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, + 0x74, 0x4b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x22, 0x1a, 0x2f, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x2f, 0x6b, 0x65, 0x79, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x3a, 0x01, 0x2a, 0x12, 0x95, 0x01, 0x0a, 0x0f, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x12, 0x2c, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x74, + 0x6f, 0x72, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x4b, - 0x65, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x20, 0x22, 0x1b, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x65, - 0x74, 0x68, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x6b, 0x65, 0x79, 0x73, - 0x3a, 0x01, 0x2a, 0x12, 0x99, 0x01, 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, - 0x6d, 0x6f, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, + 0x63, 0x65, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x1f, 0x2a, 0x1a, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x65, 0x74, + 0x68, 0x2f, 0x76, 0x31, 0x2f, 0x6b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x3a, 0x01, + 0x2a, 0x12, 0x7b, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x4b, + 0x65, 0x79, 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x2c, 0x2e, 0x65, 0x74, + 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x4b, 0x65, 0x79, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x1d, 0x12, 0x1b, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x65, 0x74, 0x68, + 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x6b, 0x65, 0x79, 0x73, 0x12, 0x99, + 0x01, 0x0a, 0x10, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x4b, + 0x65, 0x79, 0x73, 0x12, 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, + 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, + 0x68, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, + 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x22, 0x1b, 0x2f, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x6d, + 0x6f, 0x74, 0x65, 0x6b, 0x65, 0x79, 0x73, 0x3a, 0x01, 0x2a, 0x12, 0x99, 0x01, 0x0a, 0x10, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x12, + 0x2d, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x6d, + 0x6f, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, + 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x6d, 0x6f, + 0x74, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x2a, 0x1b, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, + 0x6c, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x6b, + 0x65, 0x79, 0x73, 0x3a, 0x01, 0x2a, 0x12, 0xb0, 0x01, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x46, + 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x42, 0x79, 0x50, 0x75, 0x62, + 0x6b, 0x65, 0x79, 0x12, 0x23, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x50, 0x75, 0x62, 0x6b, 0x65, + 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, - 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x2a, - 0x1b, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, - 0x31, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x6b, 0x65, 0x79, 0x73, 0x3a, 0x01, 0x2a, 0x42, - 0x97, 0x01, 0x0a, 0x18, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, - 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x42, 0x19, 0x4b, 0x65, - 0x79, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, - 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, - 0x65, 0x74, 0x68, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0xaa, 0x02, 0x14, 0x45, 0x74, - 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0xca, 0x02, 0x14, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, - 0x68, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x47, 0x65, 0x74, 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x42, + 0x79, 0x50, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x38, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x32, 0x12, 0x30, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, + 0x61, 0x6c, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x2f, 0x7b, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x7d, 0x2f, 0x66, 0x65, 0x65, + 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0xa4, 0x01, 0x0a, 0x17, 0x53, 0x65, + 0x74, 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x42, 0x79, 0x50, + 0x75, 0x62, 0x6b, 0x65, 0x79, 0x12, 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x65, 0x74, + 0x46, 0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x42, 0x79, 0x50, 0x75, + 0x62, 0x6b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x22, 0x3b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x35, 0x22, 0x30, 0x2f, 0x69, 0x6e, + 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x2f, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x7b, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x7d, + 0x2f, 0x66, 0x65, 0x65, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x3a, 0x01, 0x2a, + 0x12, 0x96, 0x01, 0x0a, 0x1a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x46, 0x65, 0x65, 0x52, 0x65, + 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x42, 0x79, 0x50, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x12, + 0x23, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x50, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x3b, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x35, 0x2a, 0x30, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, + 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x2f, 0x7b, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x7d, 0x2f, 0x66, 0x65, 0x65, 0x72, 0x65, 0x63, + 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x3a, 0x01, 0x2a, 0x42, 0x97, 0x01, 0x0a, 0x18, 0x6f, 0x72, + 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x42, 0x19, 0x4b, 0x65, 0x79, 0x4d, 0x61, 0x6e, 0x61, 0x67, + 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, + 0x79, 0x73, 0x6d, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0xaa, 0x02, 0x14, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0xca, 0x02, 0x14, 0x45, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1334,60 +1589,71 @@ func file_proto_eth_service_key_management_proto_rawDescGZIP() []byte { } var file_proto_eth_service_key_management_proto_enumTypes = make([]protoimpl.EnumInfo, 4) -var file_proto_eth_service_key_management_proto_msgTypes = make([]protoimpl.MessageInfo, 17) +var file_proto_eth_service_key_management_proto_msgTypes = make([]protoimpl.MessageInfo, 21) var file_proto_eth_service_key_management_proto_goTypes = []interface{}{ - (ImportedKeystoreStatus_Status)(0), // 0: ethereum.eth.service.ImportedKeystoreStatus.Status - (DeletedKeystoreStatus_Status)(0), // 1: ethereum.eth.service.DeletedKeystoreStatus.Status - (ImportedRemoteKeysStatus_Status)(0), // 2: ethereum.eth.service.ImportedRemoteKeysStatus.Status - (DeletedRemoteKeysStatus_Status)(0), // 3: ethereum.eth.service.DeletedRemoteKeysStatus.Status - (*ListKeystoresResponse)(nil), // 4: ethereum.eth.service.ListKeystoresResponse - (*ImportKeystoresRequest)(nil), // 5: ethereum.eth.service.ImportKeystoresRequest - (*ImportKeystoresResponse)(nil), // 6: ethereum.eth.service.ImportKeystoresResponse - (*DeleteKeystoresRequest)(nil), // 7: ethereum.eth.service.DeleteKeystoresRequest - (*DeleteKeystoresResponse)(nil), // 8: ethereum.eth.service.DeleteKeystoresResponse - (*ImportedKeystoreStatus)(nil), // 9: ethereum.eth.service.ImportedKeystoreStatus - (*DeletedKeystoreStatus)(nil), // 10: ethereum.eth.service.DeletedKeystoreStatus - (*ListRemoteKeysResponse)(nil), // 11: ethereum.eth.service.ListRemoteKeysResponse - (*ImportRemoteKeysRequest)(nil), // 12: ethereum.eth.service.ImportRemoteKeysRequest - (*ImportRemoteKeysResponse)(nil), // 13: ethereum.eth.service.ImportRemoteKeysResponse - (*DeleteRemoteKeysRequest)(nil), // 14: ethereum.eth.service.DeleteRemoteKeysRequest - (*DeleteRemoteKeysResponse)(nil), // 15: ethereum.eth.service.DeleteRemoteKeysResponse - (*ImportedRemoteKeysStatus)(nil), // 16: ethereum.eth.service.ImportedRemoteKeysStatus - (*DeletedRemoteKeysStatus)(nil), // 17: ethereum.eth.service.DeletedRemoteKeysStatus - (*ListKeystoresResponse_Keystore)(nil), // 18: ethereum.eth.service.ListKeystoresResponse.Keystore - (*ListRemoteKeysResponse_Keystore)(nil), // 19: ethereum.eth.service.ListRemoteKeysResponse.Keystore - (*ImportRemoteKeysRequest_Keystore)(nil), // 20: ethereum.eth.service.ImportRemoteKeysRequest.Keystore - (*empty.Empty)(nil), // 21: google.protobuf.Empty + (ImportedKeystoreStatus_Status)(0), // 0: ethereum.eth.service.ImportedKeystoreStatus.Status + (DeletedKeystoreStatus_Status)(0), // 1: ethereum.eth.service.DeletedKeystoreStatus.Status + (ImportedRemoteKeysStatus_Status)(0), // 2: ethereum.eth.service.ImportedRemoteKeysStatus.Status + (DeletedRemoteKeysStatus_Status)(0), // 3: ethereum.eth.service.DeletedRemoteKeysStatus.Status + (*ListKeystoresResponse)(nil), // 4: ethereum.eth.service.ListKeystoresResponse + (*ImportKeystoresRequest)(nil), // 5: ethereum.eth.service.ImportKeystoresRequest + (*ImportKeystoresResponse)(nil), // 6: ethereum.eth.service.ImportKeystoresResponse + (*DeleteKeystoresRequest)(nil), // 7: ethereum.eth.service.DeleteKeystoresRequest + (*DeleteKeystoresResponse)(nil), // 8: ethereum.eth.service.DeleteKeystoresResponse + (*ImportedKeystoreStatus)(nil), // 9: ethereum.eth.service.ImportedKeystoreStatus + (*DeletedKeystoreStatus)(nil), // 10: ethereum.eth.service.DeletedKeystoreStatus + (*ListRemoteKeysResponse)(nil), // 11: ethereum.eth.service.ListRemoteKeysResponse + (*ImportRemoteKeysRequest)(nil), // 12: ethereum.eth.service.ImportRemoteKeysRequest + (*ImportRemoteKeysResponse)(nil), // 13: ethereum.eth.service.ImportRemoteKeysResponse + (*DeleteRemoteKeysRequest)(nil), // 14: ethereum.eth.service.DeleteRemoteKeysRequest + (*DeleteRemoteKeysResponse)(nil), // 15: ethereum.eth.service.DeleteRemoteKeysResponse + (*ImportedRemoteKeysStatus)(nil), // 16: ethereum.eth.service.ImportedRemoteKeysStatus + (*DeletedRemoteKeysStatus)(nil), // 17: ethereum.eth.service.DeletedRemoteKeysStatus + (*PubkeyRequest)(nil), // 18: ethereum.eth.service.PubkeyRequest + (*GetFeeRecipientByPubkeyResponse)(nil), // 19: ethereum.eth.service.GetFeeRecipientByPubkeyResponse + (*SetFeeRecipientByPubkeyRequest)(nil), // 20: ethereum.eth.service.SetFeeRecipientByPubkeyRequest + (*ListKeystoresResponse_Keystore)(nil), // 21: ethereum.eth.service.ListKeystoresResponse.Keystore + (*ListRemoteKeysResponse_Keystore)(nil), // 22: ethereum.eth.service.ListRemoteKeysResponse.Keystore + (*ImportRemoteKeysRequest_Keystore)(nil), // 23: ethereum.eth.service.ImportRemoteKeysRequest.Keystore + (*GetFeeRecipientByPubkeyResponse_FeeRecipient)(nil), // 24: ethereum.eth.service.GetFeeRecipientByPubkeyResponse.FeeRecipient + (*empty.Empty)(nil), // 25: google.protobuf.Empty } var file_proto_eth_service_key_management_proto_depIdxs = []int32{ - 18, // 0: ethereum.eth.service.ListKeystoresResponse.data:type_name -> ethereum.eth.service.ListKeystoresResponse.Keystore + 21, // 0: ethereum.eth.service.ListKeystoresResponse.data:type_name -> ethereum.eth.service.ListKeystoresResponse.Keystore 9, // 1: ethereum.eth.service.ImportKeystoresResponse.data:type_name -> ethereum.eth.service.ImportedKeystoreStatus 10, // 2: ethereum.eth.service.DeleteKeystoresResponse.data:type_name -> ethereum.eth.service.DeletedKeystoreStatus 0, // 3: ethereum.eth.service.ImportedKeystoreStatus.status:type_name -> ethereum.eth.service.ImportedKeystoreStatus.Status 1, // 4: ethereum.eth.service.DeletedKeystoreStatus.status:type_name -> ethereum.eth.service.DeletedKeystoreStatus.Status - 19, // 5: ethereum.eth.service.ListRemoteKeysResponse.data:type_name -> ethereum.eth.service.ListRemoteKeysResponse.Keystore - 20, // 6: ethereum.eth.service.ImportRemoteKeysRequest.remote_keys:type_name -> ethereum.eth.service.ImportRemoteKeysRequest.Keystore + 22, // 5: ethereum.eth.service.ListRemoteKeysResponse.data:type_name -> ethereum.eth.service.ListRemoteKeysResponse.Keystore + 23, // 6: ethereum.eth.service.ImportRemoteKeysRequest.remote_keys:type_name -> ethereum.eth.service.ImportRemoteKeysRequest.Keystore 16, // 7: ethereum.eth.service.ImportRemoteKeysResponse.data:type_name -> ethereum.eth.service.ImportedRemoteKeysStatus 17, // 8: ethereum.eth.service.DeleteRemoteKeysResponse.data:type_name -> ethereum.eth.service.DeletedRemoteKeysStatus 2, // 9: ethereum.eth.service.ImportedRemoteKeysStatus.status:type_name -> ethereum.eth.service.ImportedRemoteKeysStatus.Status 3, // 10: ethereum.eth.service.DeletedRemoteKeysStatus.status:type_name -> ethereum.eth.service.DeletedRemoteKeysStatus.Status - 21, // 11: ethereum.eth.service.KeyManagement.ListKeystores:input_type -> google.protobuf.Empty - 5, // 12: ethereum.eth.service.KeyManagement.ImportKeystores:input_type -> ethereum.eth.service.ImportKeystoresRequest - 7, // 13: ethereum.eth.service.KeyManagement.DeleteKeystores:input_type -> ethereum.eth.service.DeleteKeystoresRequest - 21, // 14: ethereum.eth.service.KeyManagement.ListRemoteKeys:input_type -> google.protobuf.Empty - 12, // 15: ethereum.eth.service.KeyManagement.ImportRemoteKeys:input_type -> ethereum.eth.service.ImportRemoteKeysRequest - 14, // 16: ethereum.eth.service.KeyManagement.DeleteRemoteKeys:input_type -> ethereum.eth.service.DeleteRemoteKeysRequest - 4, // 17: ethereum.eth.service.KeyManagement.ListKeystores:output_type -> ethereum.eth.service.ListKeystoresResponse - 6, // 18: ethereum.eth.service.KeyManagement.ImportKeystores:output_type -> ethereum.eth.service.ImportKeystoresResponse - 8, // 19: ethereum.eth.service.KeyManagement.DeleteKeystores:output_type -> ethereum.eth.service.DeleteKeystoresResponse - 11, // 20: ethereum.eth.service.KeyManagement.ListRemoteKeys:output_type -> ethereum.eth.service.ListRemoteKeysResponse - 13, // 21: ethereum.eth.service.KeyManagement.ImportRemoteKeys:output_type -> ethereum.eth.service.ImportRemoteKeysResponse - 15, // 22: ethereum.eth.service.KeyManagement.DeleteRemoteKeys:output_type -> ethereum.eth.service.DeleteRemoteKeysResponse - 17, // [17:23] is the sub-list for method output_type - 11, // [11:17] is the sub-list for method input_type - 11, // [11:11] is the sub-list for extension type_name - 11, // [11:11] is the sub-list for extension extendee - 0, // [0:11] is the sub-list for field type_name + 24, // 11: ethereum.eth.service.GetFeeRecipientByPubkeyResponse.data:type_name -> ethereum.eth.service.GetFeeRecipientByPubkeyResponse.FeeRecipient + 25, // 12: ethereum.eth.service.KeyManagement.ListKeystores:input_type -> google.protobuf.Empty + 5, // 13: ethereum.eth.service.KeyManagement.ImportKeystores:input_type -> ethereum.eth.service.ImportKeystoresRequest + 7, // 14: ethereum.eth.service.KeyManagement.DeleteKeystores:input_type -> ethereum.eth.service.DeleteKeystoresRequest + 25, // 15: ethereum.eth.service.KeyManagement.ListRemoteKeys:input_type -> google.protobuf.Empty + 12, // 16: ethereum.eth.service.KeyManagement.ImportRemoteKeys:input_type -> ethereum.eth.service.ImportRemoteKeysRequest + 14, // 17: ethereum.eth.service.KeyManagement.DeleteRemoteKeys:input_type -> ethereum.eth.service.DeleteRemoteKeysRequest + 18, // 18: ethereum.eth.service.KeyManagement.ListFeeRecipientByPubkey:input_type -> ethereum.eth.service.PubkeyRequest + 20, // 19: ethereum.eth.service.KeyManagement.SetFeeRecipientByPubkey:input_type -> ethereum.eth.service.SetFeeRecipientByPubkeyRequest + 18, // 20: ethereum.eth.service.KeyManagement.DeleteFeeRecipientByPubkey:input_type -> ethereum.eth.service.PubkeyRequest + 4, // 21: ethereum.eth.service.KeyManagement.ListKeystores:output_type -> ethereum.eth.service.ListKeystoresResponse + 6, // 22: ethereum.eth.service.KeyManagement.ImportKeystores:output_type -> ethereum.eth.service.ImportKeystoresResponse + 8, // 23: ethereum.eth.service.KeyManagement.DeleteKeystores:output_type -> ethereum.eth.service.DeleteKeystoresResponse + 11, // 24: ethereum.eth.service.KeyManagement.ListRemoteKeys:output_type -> ethereum.eth.service.ListRemoteKeysResponse + 13, // 25: ethereum.eth.service.KeyManagement.ImportRemoteKeys:output_type -> ethereum.eth.service.ImportRemoteKeysResponse + 15, // 26: ethereum.eth.service.KeyManagement.DeleteRemoteKeys:output_type -> ethereum.eth.service.DeleteRemoteKeysResponse + 19, // 27: ethereum.eth.service.KeyManagement.ListFeeRecipientByPubkey:output_type -> ethereum.eth.service.GetFeeRecipientByPubkeyResponse + 25, // 28: ethereum.eth.service.KeyManagement.SetFeeRecipientByPubkey:output_type -> google.protobuf.Empty + 25, // 29: ethereum.eth.service.KeyManagement.DeleteFeeRecipientByPubkey:output_type -> google.protobuf.Empty + 21, // [21:30] is the sub-list for method output_type + 12, // [12:21] is the sub-list for method input_type + 12, // [12:12] is the sub-list for extension type_name + 12, // [12:12] is the sub-list for extension extendee + 0, // [0:12] is the sub-list for field type_name } func init() { file_proto_eth_service_key_management_proto_init() } @@ -1565,7 +1831,7 @@ func file_proto_eth_service_key_management_proto_init() { } } file_proto_eth_service_key_management_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListKeystoresResponse_Keystore); i { + switch v := v.(*PubkeyRequest); i { case 0: return &v.state case 1: @@ -1577,7 +1843,7 @@ func file_proto_eth_service_key_management_proto_init() { } } file_proto_eth_service_key_management_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListRemoteKeysResponse_Keystore); i { + switch v := v.(*GetFeeRecipientByPubkeyResponse); i { case 0: return &v.state case 1: @@ -1589,6 +1855,42 @@ func file_proto_eth_service_key_management_proto_init() { } } file_proto_eth_service_key_management_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SetFeeRecipientByPubkeyRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_eth_service_key_management_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListKeystoresResponse_Keystore); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_eth_service_key_management_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRemoteKeysResponse_Keystore); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_eth_service_key_management_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ImportRemoteKeysRequest_Keystore); i { case 0: return &v.state @@ -1600,6 +1902,18 @@ func file_proto_eth_service_key_management_proto_init() { return nil } } + file_proto_eth_service_key_management_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetFeeRecipientByPubkeyResponse_FeeRecipient); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -1607,7 +1921,7 @@ func file_proto_eth_service_key_management_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_proto_eth_service_key_management_proto_rawDesc, NumEnums: 4, - NumMessages: 17, + NumMessages: 21, NumExtensions: 0, NumServices: 1, }, @@ -1640,6 +1954,9 @@ type KeyManagementClient interface { ListRemoteKeys(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ListRemoteKeysResponse, error) ImportRemoteKeys(ctx context.Context, in *ImportRemoteKeysRequest, opts ...grpc.CallOption) (*ImportRemoteKeysResponse, error) DeleteRemoteKeys(ctx context.Context, in *DeleteRemoteKeysRequest, opts ...grpc.CallOption) (*DeleteRemoteKeysResponse, error) + ListFeeRecipientByPubkey(ctx context.Context, in *PubkeyRequest, opts ...grpc.CallOption) (*GetFeeRecipientByPubkeyResponse, error) + SetFeeRecipientByPubkey(ctx context.Context, in *SetFeeRecipientByPubkeyRequest, opts ...grpc.CallOption) (*empty.Empty, error) + DeleteFeeRecipientByPubkey(ctx context.Context, in *PubkeyRequest, opts ...grpc.CallOption) (*empty.Empty, error) } type keyManagementClient struct { @@ -1704,6 +2021,33 @@ func (c *keyManagementClient) DeleteRemoteKeys(ctx context.Context, in *DeleteRe return out, nil } +func (c *keyManagementClient) ListFeeRecipientByPubkey(ctx context.Context, in *PubkeyRequest, opts ...grpc.CallOption) (*GetFeeRecipientByPubkeyResponse, error) { + out := new(GetFeeRecipientByPubkeyResponse) + err := c.cc.Invoke(ctx, "/ethereum.eth.service.KeyManagement/ListFeeRecipientByPubkey", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *keyManagementClient) SetFeeRecipientByPubkey(ctx context.Context, in *SetFeeRecipientByPubkeyRequest, opts ...grpc.CallOption) (*empty.Empty, error) { + out := new(empty.Empty) + err := c.cc.Invoke(ctx, "/ethereum.eth.service.KeyManagement/SetFeeRecipientByPubkey", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *keyManagementClient) DeleteFeeRecipientByPubkey(ctx context.Context, in *PubkeyRequest, opts ...grpc.CallOption) (*empty.Empty, error) { + out := new(empty.Empty) + err := c.cc.Invoke(ctx, "/ethereum.eth.service.KeyManagement/DeleteFeeRecipientByPubkey", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // KeyManagementServer is the server API for KeyManagement service. type KeyManagementServer interface { ListKeystores(context.Context, *empty.Empty) (*ListKeystoresResponse, error) @@ -1712,6 +2056,9 @@ type KeyManagementServer interface { ListRemoteKeys(context.Context, *empty.Empty) (*ListRemoteKeysResponse, error) ImportRemoteKeys(context.Context, *ImportRemoteKeysRequest) (*ImportRemoteKeysResponse, error) DeleteRemoteKeys(context.Context, *DeleteRemoteKeysRequest) (*DeleteRemoteKeysResponse, error) + ListFeeRecipientByPubkey(context.Context, *PubkeyRequest) (*GetFeeRecipientByPubkeyResponse, error) + SetFeeRecipientByPubkey(context.Context, *SetFeeRecipientByPubkeyRequest) (*empty.Empty, error) + DeleteFeeRecipientByPubkey(context.Context, *PubkeyRequest) (*empty.Empty, error) } // UnimplementedKeyManagementServer can be embedded to have forward compatible implementations. @@ -1736,6 +2083,15 @@ func (*UnimplementedKeyManagementServer) ImportRemoteKeys(context.Context, *Impo func (*UnimplementedKeyManagementServer) DeleteRemoteKeys(context.Context, *DeleteRemoteKeysRequest) (*DeleteRemoteKeysResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteRemoteKeys not implemented") } +func (*UnimplementedKeyManagementServer) ListFeeRecipientByPubkey(context.Context, *PubkeyRequest) (*GetFeeRecipientByPubkeyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListFeeRecipientByPubkey not implemented") +} +func (*UnimplementedKeyManagementServer) SetFeeRecipientByPubkey(context.Context, *SetFeeRecipientByPubkeyRequest) (*empty.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetFeeRecipientByPubkey not implemented") +} +func (*UnimplementedKeyManagementServer) DeleteFeeRecipientByPubkey(context.Context, *PubkeyRequest) (*empty.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteFeeRecipientByPubkey not implemented") +} func RegisterKeyManagementServer(s *grpc.Server, srv KeyManagementServer) { s.RegisterService(&_KeyManagement_serviceDesc, srv) @@ -1849,6 +2205,60 @@ func _KeyManagement_DeleteRemoteKeys_Handler(srv interface{}, ctx context.Contex return interceptor(ctx, in, info, handler) } +func _KeyManagement_ListFeeRecipientByPubkey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PubkeyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KeyManagementServer).ListFeeRecipientByPubkey(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ethereum.eth.service.KeyManagement/ListFeeRecipientByPubkey", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KeyManagementServer).ListFeeRecipientByPubkey(ctx, req.(*PubkeyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _KeyManagement_SetFeeRecipientByPubkey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetFeeRecipientByPubkeyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KeyManagementServer).SetFeeRecipientByPubkey(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ethereum.eth.service.KeyManagement/SetFeeRecipientByPubkey", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KeyManagementServer).SetFeeRecipientByPubkey(ctx, req.(*SetFeeRecipientByPubkeyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _KeyManagement_DeleteFeeRecipientByPubkey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PubkeyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KeyManagementServer).DeleteFeeRecipientByPubkey(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ethereum.eth.service.KeyManagement/DeleteFeeRecipientByPubkey", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KeyManagementServer).DeleteFeeRecipientByPubkey(ctx, req.(*PubkeyRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _KeyManagement_serviceDesc = grpc.ServiceDesc{ ServiceName: "ethereum.eth.service.KeyManagement", HandlerType: (*KeyManagementServer)(nil), @@ -1877,6 +2287,18 @@ var _KeyManagement_serviceDesc = grpc.ServiceDesc{ MethodName: "DeleteRemoteKeys", Handler: _KeyManagement_DeleteRemoteKeys_Handler, }, + { + MethodName: "ListFeeRecipientByPubkey", + Handler: _KeyManagement_ListFeeRecipientByPubkey_Handler, + }, + { + MethodName: "SetFeeRecipientByPubkey", + Handler: _KeyManagement_SetFeeRecipientByPubkey_Handler, + }, + { + MethodName: "DeleteFeeRecipientByPubkey", + Handler: _KeyManagement_DeleteFeeRecipientByPubkey_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "proto/eth/service/key_management.proto", diff --git a/proto/eth/service/key_management.pb.gw.go b/proto/eth/service/key_management.pb.gw.go index f0bde6c98..7b4bf157a 100755 --- a/proto/eth/service/key_management.pb.gw.go +++ b/proto/eth/service/key_management.pb.gw.go @@ -209,6 +209,200 @@ func local_request_KeyManagement_DeleteRemoteKeys_0(ctx context.Context, marshal } +func request_KeyManagement_ListFeeRecipientByPubkey_0(ctx context.Context, marshaler runtime.Marshaler, client KeyManagementClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq PubkeyRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["pubkey"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "pubkey") + } + + pubkey, err := runtime.Bytes(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pubkey", err) + } + protoReq.Pubkey = (pubkey) + + msg, err := client.ListFeeRecipientByPubkey(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_KeyManagement_ListFeeRecipientByPubkey_0(ctx context.Context, marshaler runtime.Marshaler, server KeyManagementServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq PubkeyRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["pubkey"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "pubkey") + } + + pubkey, err := runtime.Bytes(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pubkey", err) + } + protoReq.Pubkey = (pubkey) + + msg, err := server.ListFeeRecipientByPubkey(ctx, &protoReq) + return msg, metadata, err + +} + +func request_KeyManagement_SetFeeRecipientByPubkey_0(ctx context.Context, marshaler runtime.Marshaler, client KeyManagementClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SetFeeRecipientByPubkeyRequest + 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) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["pubkey"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "pubkey") + } + + pubkey, err := runtime.Bytes(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pubkey", err) + } + protoReq.Pubkey = (pubkey) + + msg, err := client.SetFeeRecipientByPubkey(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_KeyManagement_SetFeeRecipientByPubkey_0(ctx context.Context, marshaler runtime.Marshaler, server KeyManagementServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SetFeeRecipientByPubkeyRequest + 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) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["pubkey"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "pubkey") + } + + pubkey, err := runtime.Bytes(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pubkey", err) + } + protoReq.Pubkey = (pubkey) + + msg, err := server.SetFeeRecipientByPubkey(ctx, &protoReq) + return msg, metadata, err + +} + +func request_KeyManagement_DeleteFeeRecipientByPubkey_0(ctx context.Context, marshaler runtime.Marshaler, client KeyManagementClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq PubkeyRequest + 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) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["pubkey"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "pubkey") + } + + pubkey, err := runtime.Bytes(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pubkey", err) + } + protoReq.Pubkey = (pubkey) + + msg, err := client.DeleteFeeRecipientByPubkey(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_KeyManagement_DeleteFeeRecipientByPubkey_0(ctx context.Context, marshaler runtime.Marshaler, server KeyManagementServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq PubkeyRequest + 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) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["pubkey"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "pubkey") + } + + pubkey, err := runtime.Bytes(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pubkey", err) + } + protoReq.Pubkey = (pubkey) + + msg, err := server.DeleteFeeRecipientByPubkey(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterKeyManagementHandlerServer registers the http handlers for service KeyManagement to "mux". // UnaryRPC :call KeyManagementServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -353,6 +547,75 @@ func RegisterKeyManagementHandlerServer(ctx context.Context, mux *runtime.ServeM }) + mux.Handle("GET", pattern_KeyManagement_ListFeeRecipientByPubkey_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, "/ethereum.eth.service.KeyManagement/ListFeeRecipientByPubkey") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_KeyManagement_ListFeeRecipientByPubkey_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_KeyManagement_ListFeeRecipientByPubkey_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_KeyManagement_SetFeeRecipientByPubkey_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, "/ethereum.eth.service.KeyManagement/SetFeeRecipientByPubkey") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_KeyManagement_SetFeeRecipientByPubkey_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_KeyManagement_SetFeeRecipientByPubkey_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_KeyManagement_DeleteFeeRecipientByPubkey_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, "/ethereum.eth.service.KeyManagement/DeleteFeeRecipientByPubkey") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_KeyManagement_DeleteFeeRecipientByPubkey_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_KeyManagement_DeleteFeeRecipientByPubkey_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -514,6 +777,66 @@ func RegisterKeyManagementHandlerClient(ctx context.Context, mux *runtime.ServeM }) + mux.Handle("GET", pattern_KeyManagement_ListFeeRecipientByPubkey_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, "/ethereum.eth.service.KeyManagement/ListFeeRecipientByPubkey") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_KeyManagement_ListFeeRecipientByPubkey_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_KeyManagement_ListFeeRecipientByPubkey_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_KeyManagement_SetFeeRecipientByPubkey_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, "/ethereum.eth.service.KeyManagement/SetFeeRecipientByPubkey") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_KeyManagement_SetFeeRecipientByPubkey_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_KeyManagement_SetFeeRecipientByPubkey_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_KeyManagement_DeleteFeeRecipientByPubkey_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, "/ethereum.eth.service.KeyManagement/DeleteFeeRecipientByPubkey") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_KeyManagement_DeleteFeeRecipientByPubkey_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_KeyManagement_DeleteFeeRecipientByPubkey_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -529,6 +852,12 @@ var ( pattern_KeyManagement_ImportRemoteKeys_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"internal", "eth", "v1", "remotekeys"}, "")) pattern_KeyManagement_DeleteRemoteKeys_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"internal", "eth", "v1", "remotekeys"}, "")) + + pattern_KeyManagement_ListFeeRecipientByPubkey_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"internal", "eth", "v1", "validator", "pubkey", "feerecipient"}, "")) + + pattern_KeyManagement_SetFeeRecipientByPubkey_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"internal", "eth", "v1", "validator", "pubkey", "feerecipient"}, "")) + + pattern_KeyManagement_DeleteFeeRecipientByPubkey_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"internal", "eth", "v1", "validator", "pubkey", "feerecipient"}, "")) ) var ( @@ -543,4 +872,10 @@ var ( forward_KeyManagement_ImportRemoteKeys_0 = runtime.ForwardResponseMessage forward_KeyManagement_DeleteRemoteKeys_0 = runtime.ForwardResponseMessage + + forward_KeyManagement_ListFeeRecipientByPubkey_0 = runtime.ForwardResponseMessage + + forward_KeyManagement_SetFeeRecipientByPubkey_0 = runtime.ForwardResponseMessage + + forward_KeyManagement_DeleteFeeRecipientByPubkey_0 = runtime.ForwardResponseMessage ) diff --git a/proto/eth/service/key_management.proto b/proto/eth/service/key_management.proto index 091261ce0..65d81a05d 100644 --- a/proto/eth/service/key_management.proto +++ b/proto/eth/service/key_management.proto @@ -85,13 +85,26 @@ service KeyManagement { }; } - + // ListRemoteKeys for all web3signer public validator keys known to the keymanager. + // + // HTTP response status codes: + // - 200: Successful response + // - 401: Unauthorized + // - 403: Forbidden from accessing the resource + // - 500: Validator internal error rpc ListRemoteKeys(google.protobuf.Empty) returns (ListRemoteKeysResponse) { option (google.api.http) = { get: "/internal/eth/v1/remotekeys" }; } + // ImportRemoteKeys imports and sets web3signer public validator keys in the keymanager. + // + // HTTP response status codes: + // - 200: Successful response + // - 401: Unauthorized + // - 403: Forbidden from accessing the resource + // - 500: Validator internal error rpc ImportRemoteKeys(ImportRemoteKeysRequest) returns (ImportRemoteKeysResponse) { option (google.api.http) = { post: "/internal/eth/v1/remotekeys", @@ -99,12 +112,61 @@ service KeyManagement { }; } + + // DeleteRemoteKeys removes web3signer public validator keys in the keymanager. + // + // HTTP response status codes: + // - 200: Successful response + // - 401: Unauthorized + // - 403: Forbidden from accessing the resource + // - 500: Validator internal error rpc DeleteRemoteKeys(DeleteRemoteKeysRequest) returns (DeleteRemoteKeysResponse) { option (google.api.http) = { delete: "/internal/eth/v1/remotekeys", body: "*" }; } + + // ListFeeRecipientByPubkey returns the hex encoded fee recipient address for the given pubkey. + // + // HTTP response status codes: + // - 200: Successful response + // - 401: Unauthorized + // - 403: Forbidden from accessing the resource + // - 500: Validator internal error + rpc ListFeeRecipientByPubkey(PubkeyRequest) returns (GetFeeRecipientByPubkeyResponse) { + option (google.api.http) = { + get: "/internal/eth/v1/validator/{pubkey}/feerecipient" + }; + } + + // SetFeeRecipientByPubkey sets the fee recipient for the specific public key, overrides the existing one. + // + // HTTP response status codes: + // - 202: Successful response + // - 401: Unauthorized + // - 403: Forbidden from accessing the resource + // - 500: Validator internal error + rpc SetFeeRecipientByPubkey(SetFeeRecipientByPubkeyRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/internal/eth/v1/validator/{pubkey}/feerecipient", + body: "*" + }; + } + + // DeleteFeeRecipientByPubkey deletes the current settings on the fee recipient and replaces with the default fallback fee recipient. + // + // HTTP response status codes: + // - 204: No Content + // - 401: Unauthorized + // - 403: Forbidden from accessing the resource + // - 500: Validator internal error + rpc DeleteFeeRecipientByPubkey(PubkeyRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/internal/eth/v1/validator/{pubkey}/feerecipient", + body: "*" + }; + } } message ListKeystoresResponse { @@ -206,3 +268,20 @@ message DeletedRemoteKeysStatus { string message = 2; } + +message PubkeyRequest { + bytes pubkey = 1; +} + +message GetFeeRecipientByPubkeyResponse { + message FeeRecipient { + bytes pubkey = 1; + bytes ethaddress = 2; + } + FeeRecipient data = 1; +} + +message SetFeeRecipientByPubkeyRequest { + bytes pubkey = 1; + bytes ethaddress = 2; +} diff --git a/validator/client/service.go b/validator/client/service.go index d15fe705d..8301aefbe 100644 --- a/validator/client/service.go +++ b/validator/client/service.go @@ -70,7 +70,7 @@ type ValidatorService struct { grpcHeaders []string graffiti []byte Web3SignerConfig *remote_web3signer.SetupConfig - proposerSettings *validator_service_config.ProposerSettings + ProposerSettings *validator_service_config.ProposerSettings } // Config for the validator service. @@ -123,7 +123,7 @@ func NewValidatorService(ctx context.Context, cfg *Config) (*ValidatorService, e graffitiStruct: cfg.GraffitiStruct, logDutyCountDown: cfg.LogDutyCountDown, Web3SignerConfig: cfg.Web3SignerConfig, - proposerSettings: cfg.ProposerSettings, + ProposerSettings: cfg.ProposerSettings, } dialOpts := ConstructDialOptions( @@ -206,7 +206,7 @@ func (v *ValidatorService) Start() { eipImportBlacklistedPublicKeys: slashablePublicKeys, logDutyCountDown: v.logDutyCountDown, Web3SignerConfig: v.Web3SignerConfig, - ProposerSettings: v.proposerSettings, + ProposerSettings: v.ProposerSettings, walletIntializedChannel: make(chan *wallet.Wallet, 1), } // To resolve a race condition at startup due to the interface diff --git a/validator/node/node.go b/validator/node/node.go index 7e721b15a..33e05aa3c 100644 --- a/validator/node/node.go +++ b/validator/node/node.go @@ -678,6 +678,7 @@ func (c *ValidatorClient) registerRPCGatewayService(cliCtx *cli.Context) error { gwruntime.WithMarshalerOption( "text/event-stream", &gwruntime.EventSourceJSONPb{}, ), + gwruntime.WithForwardResponseOption(gateway.HttpResponseModifier), ) muxHandler := func(apiMware *apimiddleware.ApiProxyMiddleware, h http.HandlerFunc, w http.ResponseWriter, req *http.Request) { // The validator gateway handler requires this special logic as it serves two kinds of APIs, namely diff --git a/validator/rpc/BUILD.bazel b/validator/rpc/BUILD.bazel index 9fb32052d..b74cb901c 100644 --- a/validator/rpc/BUILD.bazel +++ b/validator/rpc/BUILD.bazel @@ -26,6 +26,8 @@ go_library( "//cmd:go_default_library", "//config/features:go_default_library", "//config/fieldparams:go_default_library", + "//config/params:go_default_library", + "//config/validator/service:go_default_library", "//crypto/bls:go_default_library", "//crypto/rand:go_default_library", "//encoding/bytesutil:go_default_library", @@ -47,6 +49,8 @@ go_library( "//validator/keymanager/local:go_default_library", "//validator/slashing-protection-history:go_default_library", "//validator/slashing-protection-history/format:go_default_library", + "@com_github_ethereum_go_ethereum//common:go_default_library", + "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", "@com_github_fsnotify_fsnotify//:go_default_library", "@com_github_golang_jwt_jwt_v4//:go_default_library", "@com_github_grpc_ecosystem_go_grpc_middleware//:go_default_library", @@ -90,6 +94,8 @@ go_test( "//cmd/validator/flags:go_default_library", "//config/features:go_default_library", "//config/fieldparams:go_default_library", + "//config/params:go_default_library", + "//config/validator/service:go_default_library", "//crypto/bls:go_default_library", "//crypto/rand:go_default_library", "//encoding/bytesutil:go_default_library", @@ -112,10 +118,12 @@ go_test( "//validator/keymanager/remote-web3signer:go_default_library", "//validator/slashing-protection-history/format:go_default_library", "//validator/testing:go_default_library", + "@com_github_ethereum_go_ethereum//common:go_default_library", "@com_github_ethereum_go_ethereum//common/hexutil:go_default_library", "@com_github_golang_jwt_jwt_v4//:go_default_library", "@com_github_golang_mock//gomock:go_default_library", "@com_github_google_uuid//:go_default_library", + "@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_tyler_smith_go_bip39//:go_default_library", "@com_github_wealdtech_go_eth2_wallet_encryptor_keystorev4//:go_default_library", diff --git a/validator/rpc/apimiddleware/endpoint_factory.go b/validator/rpc/apimiddleware/endpoint_factory.go index 7ec1f8196..1e82ae1f6 100644 --- a/validator/rpc/apimiddleware/endpoint_factory.go +++ b/validator/rpc/apimiddleware/endpoint_factory.go @@ -18,6 +18,7 @@ func (*ValidatorEndpointFactory) Paths() []string { return []string{ "/eth/v1/keystores", "/eth/v1/remotekeys", + "/eth/v1/validator/{pubkey}/feerecipient", } } @@ -37,6 +38,9 @@ func (*ValidatorEndpointFactory) Create(path string) (*apimiddleware.Endpoint, e endpoint.PostResponse = &importRemoteKeysResponseJson{} endpoint.DeleteRequest = &deleteRemoteKeysRequestJson{} endpoint.DeleteResponse = &deleteRemoteKeysResponseJson{} + case "/eth/v1/validator/{pubkey}/feerecipient": + endpoint.GetResponse = &getFeeRecipientByPubkeyResponseJson{} + endpoint.PostRequest = &setFeeRecipientByPubkeyRequestJson{} default: return nil, errors.New("invalid path") } diff --git a/validator/rpc/apimiddleware/structs.go b/validator/rpc/apimiddleware/structs.go index 98f0ea7b5..122226e22 100644 --- a/validator/rpc/apimiddleware/structs.go +++ b/validator/rpc/apimiddleware/structs.go @@ -66,3 +66,16 @@ type deleteRemoteKeysRequestJson struct { type deleteRemoteKeysResponseJson struct { Statuses []*statusJson `json:"data"` } + +type feeRecipientJson struct { + Pubkey string `json:"pubkey" hex:"true"` + Ethaddress string `json:"ethaddress" address:"true"` +} + +type getFeeRecipientByPubkeyResponseJson struct { + Data *feeRecipientJson `json:"data"` +} + +type setFeeRecipientByPubkeyRequestJson struct { + Ethaddress string `json:"ethaddress" hex:"true"` +} diff --git a/validator/rpc/standard_api.go b/validator/rpc/standard_api.go index 61088da6c..6af27819c 100644 --- a/validator/rpc/standard_api.go +++ b/validator/rpc/standard_api.go @@ -6,15 +6,21 @@ import ( "encoding/json" "fmt" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" "github.com/golang/protobuf/ptypes/empty" fieldparams "github.com/prysmaticlabs/prysm/config/fieldparams" + "github.com/prysmaticlabs/prysm/config/params" + validatorServiceConfig "github.com/prysmaticlabs/prysm/config/validator/service" "github.com/prysmaticlabs/prysm/encoding/bytesutil" ethpbservice "github.com/prysmaticlabs/prysm/proto/eth/service" "github.com/prysmaticlabs/prysm/validator/keymanager" "github.com/prysmaticlabs/prysm/validator/keymanager/derived" slashingprotection "github.com/prysmaticlabs/prysm/validator/slashing-protection-history" "github.com/prysmaticlabs/prysm/validator/slashing-protection-history/format" + "google.golang.org/grpc" "google.golang.org/grpc/codes" + "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" ) @@ -382,3 +388,121 @@ func groupDeleteRemoteKeysErrors(req *ethpbservice.DeleteRemoteKeysRequest, erro } return statuses } + +// ListFeeRecipientByPubkey returns the public key to eth address mapping object to the end user. +func (s *Server) ListFeeRecipientByPubkey(ctx context.Context, req *ethpbservice.PubkeyRequest) (*ethpbservice.GetFeeRecipientByPubkeyResponse, error) { + if s.validatorService == nil { + return nil, status.Error(codes.FailedPrecondition, "Validator service not ready") + } + validatorKey := req.Pubkey + if err := validatePublicKey(validatorKey); err != nil { + return nil, status.Error(codes.FailedPrecondition, err.Error()) + } + defaultFeeRecipient := params.BeaconConfig().DefaultFeeRecipient.Bytes() + if s.validatorService.ProposerSettings == nil { + return ðpbservice.GetFeeRecipientByPubkeyResponse{ + Data: ðpbservice.GetFeeRecipientByPubkeyResponse_FeeRecipient{ + Pubkey: validatorKey, + Ethaddress: defaultFeeRecipient, + }, + }, nil + } + if s.validatorService.ProposerSettings.ProposeConfig != nil { + proposerOption, found := s.validatorService.ProposerSettings.ProposeConfig[bytesutil.ToBytes48(validatorKey)] + if found { + return ðpbservice.GetFeeRecipientByPubkeyResponse{ + Data: ðpbservice.GetFeeRecipientByPubkeyResponse_FeeRecipient{ + Pubkey: validatorKey, + Ethaddress: proposerOption.FeeRecipient.Bytes(), + }, + }, nil + } + } + if s.validatorService.ProposerSettings.DefaultConfig != nil { + defaultFeeRecipient = s.validatorService.ProposerSettings.DefaultConfig.FeeRecipient.Bytes() + } + return ðpbservice.GetFeeRecipientByPubkeyResponse{ + Data: ðpbservice.GetFeeRecipientByPubkeyResponse_FeeRecipient{ + Pubkey: validatorKey, + Ethaddress: defaultFeeRecipient, + }, + }, nil +} + +// SetFeeRecipientByPubkey updates the eth address mapped to the public key. +func (s *Server) SetFeeRecipientByPubkey(ctx context.Context, req *ethpbservice.SetFeeRecipientByPubkeyRequest) (*empty.Empty, error) { + if s.validatorService == nil { + return nil, status.Error(codes.FailedPrecondition, "Validator service not ready") + } + validatorKey := req.Pubkey + if err := validatePublicKey(validatorKey); err != nil { + return nil, status.Error(codes.FailedPrecondition, err.Error()) + } + defaultOption := validatorServiceConfig.DefaultProposerOption() + encoded := hexutil.Encode(req.Ethaddress) + if !common.IsHexAddress(encoded) { + return nil, status.Error( + codes.InvalidArgument, "Fee recipient is not a valid Ethereum address") + } + pOption := validatorServiceConfig.DefaultProposerOption() + pOption.FeeRecipient = common.BytesToAddress(req.Ethaddress) + switch { + case s.validatorService.ProposerSettings == nil: + s.validatorService.ProposerSettings = &validatorServiceConfig.ProposerSettings{ + ProposeConfig: map[[fieldparams.BLSPubkeyLength]byte]*validatorServiceConfig.ProposerOption{ + bytesutil.ToBytes48(validatorKey): &pOption, + }, + DefaultConfig: &defaultOption, + } + case s.validatorService.ProposerSettings.ProposeConfig == nil: + s.validatorService.ProposerSettings.ProposeConfig = map[[fieldparams.BLSPubkeyLength]byte]*validatorServiceConfig.ProposerOption{ + bytesutil.ToBytes48(validatorKey): &pOption, + } + default: + proposerOption, found := s.validatorService.ProposerSettings.ProposeConfig[bytesutil.ToBytes48(validatorKey)] + if found { + proposerOption.FeeRecipient = common.BytesToAddress(req.Ethaddress) + } else { + s.validatorService.ProposerSettings.ProposeConfig[bytesutil.ToBytes48(validatorKey)] = &pOption + } + } + // override the 200 success with 202 according to the specs + if err := grpc.SetHeader(ctx, metadata.Pairs("x-http-code", "202")); err != nil { + return &empty.Empty{}, status.Errorf(codes.Internal, "Could not set custom success code header: %v", err) + } + return &empty.Empty{}, nil +} + +// DeleteFeeRecipientByPubkey updates the eth address mapped to the public key to the default fee recipient listed +func (s *Server) DeleteFeeRecipientByPubkey(ctx context.Context, req *ethpbservice.PubkeyRequest) (*empty.Empty, error) { + if s.validatorService == nil { + return nil, status.Error(codes.FailedPrecondition, "Validator service not ready") + } + validatorKey := req.Pubkey + if err := validatePublicKey(validatorKey); err != nil { + return nil, status.Error(codes.FailedPrecondition, err.Error()) + } + defaultFeeRecipient := params.BeaconConfig().DefaultFeeRecipient + if s.validatorService.ProposerSettings != nil && s.validatorService.ProposerSettings.DefaultConfig != nil { + defaultFeeRecipient = s.validatorService.ProposerSettings.DefaultConfig.FeeRecipient + } + if s.validatorService.ProposerSettings != nil && s.validatorService.ProposerSettings.ProposeConfig != nil { + proposerOption, found := s.validatorService.ProposerSettings.ProposeConfig[bytesutil.ToBytes48(validatorKey)] + if found { + proposerOption.FeeRecipient = defaultFeeRecipient + } + } + // override the 200 success with 204 according to the specs + if err := grpc.SetHeader(ctx, metadata.Pairs("x-http-code", "204")); err != nil { + return &empty.Empty{}, status.Errorf(codes.Internal, "Could not set custom success code header: %v", err) + } + return &empty.Empty{}, nil +} + +func validatePublicKey(pubkey []byte) error { + if len(pubkey) != fieldparams.BLSPubkeyLength { + return status.Errorf( + codes.InvalidArgument, "Provided public key in path is not byte length %d and not a valid bls public key", fieldparams.BLSPubkeyLength) + } + return nil +} diff --git a/validator/rpc/standard_api_test.go b/validator/rpc/standard_api_test.go index 0d44eadc4..67fde0cd9 100644 --- a/validator/rpc/standard_api_test.go +++ b/validator/rpc/standard_api_test.go @@ -7,14 +7,19 @@ import ( "fmt" "testing" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/golang/protobuf/ptypes/empty" "github.com/google/uuid" + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" fieldparams "github.com/prysmaticlabs/prysm/config/fieldparams" + "github.com/prysmaticlabs/prysm/config/params" + validator_service_config "github.com/prysmaticlabs/prysm/config/validator/service" "github.com/prysmaticlabs/prysm/crypto/bls" "github.com/prysmaticlabs/prysm/encoding/bytesutil" ethpbservice "github.com/prysmaticlabs/prysm/proto/eth/service" validatorpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1/validator-client" + "github.com/prysmaticlabs/prysm/testing/assert" "github.com/prysmaticlabs/prysm/testing/require" "github.com/prysmaticlabs/prysm/validator/accounts" "github.com/prysmaticlabs/prysm/validator/accounts/iface" @@ -28,6 +33,7 @@ import ( "github.com/prysmaticlabs/prysm/validator/slashing-protection-history/format" mocks "github.com/prysmaticlabs/prysm/validator/testing" keystorev4 "github.com/wealdtech/go-eth2-wallet-encryptor-keystorev4" + "google.golang.org/grpc" ) func TestServer_ListKeystores(t *testing.T) { @@ -680,3 +686,148 @@ func TestServer_DeleteRemoteKeys(t *testing.T) { require.Equal(t, 0, len(expectedKeys)) }) } + +func TestServer_ListFeeRecipientByPubkey(t *testing.T) { + ctx := context.Background() + byteval, err := hexutil.Decode("0xaf2e7ba294e03438ea819bd4033c6c1bf6b04320ee2075b77273c08d02f8a61bcc303c2c06bd3713cb442072ae591493") + require.NoError(t, err) + + type want struct { + EthAddress string + } + + tests := []struct { + name string + args *validator_service_config.ProposerSettings + want *want + wantErr bool + }{ + { + name: "Happy Path Test", + args: &validator_service_config.ProposerSettings{ + ProposeConfig: map[[48]byte]*validator_service_config.ProposerOption{ + bytesutil.ToBytes48(byteval): { + FeeRecipient: common.HexToAddress("0x046Fb65722E7b2455012BFEBf6177F1D2e9738D9"), + }, + }, + DefaultConfig: &validator_service_config.ProposerOption{ + FeeRecipient: common.HexToAddress("0x046Fb65722E7b2455012BFEBf6177F1D2e9738D9"), + }, + }, + want: &want{ + EthAddress: "0x046Fb65722E7b2455012BFEBf6177F1D2e9738D9", + }, + wantErr: false, + }, + { + name: "empty settings", + args: nil, + want: &want{ + EthAddress: params.BeaconConfig().DefaultFeeRecipient.Hex(), + }, + wantErr: false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + vs, err := client.NewValidatorService(ctx, &client.Config{ + Validator: &mock.MockValidator{}, + ProposerSettings: tt.args, + }) + require.NoError(t, err) + s := &Server{ + validatorService: vs, + } + got, err := s.ListFeeRecipientByPubkey(ctx, ðpbservice.PubkeyRequest{Pubkey: byteval}) + require.NoError(t, err) + assert.Equal(t, tt.want.EthAddress, common.BytesToAddress(got.Data.Ethaddress).Hex()) + }) + } +} +func TestServer_SetFeeRecipientByPubkey(t *testing.T) { + ctx := grpc.NewContextWithServerTransportStream(context.Background(), &runtime.ServerTransportStream{}) + byteval, err := hexutil.Decode("0xaf2e7ba294e03438ea819bd4033c6c1bf6b04320ee2075b77273c08d02f8a61bcc303c2c06bd3713cb442072ae591493") + require.NoError(t, err) + type want struct { + EthAddress string + } + tests := []struct { + name string + args string + proposerSettings *validator_service_config.ProposerSettings + want *want + wantErr bool + }{ + { + name: "Happy Path Test", + args: "0x046Fb65722E7b2455012BFEBf6177F1D2e9738D9", + want: &want{ + EthAddress: "0x046Fb65722E7b2455012BFEBf6177F1D2e9738D9", + }, + wantErr: false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + vs, err := client.NewValidatorService(ctx, &client.Config{ + Validator: &mock.MockValidator{}, + ProposerSettings: tt.proposerSettings, + }) + require.NoError(t, err) + s := &Server{ + validatorService: vs, + } + _, err = s.SetFeeRecipientByPubkey(ctx, ðpbservice.SetFeeRecipientByPubkeyRequest{Pubkey: byteval, Ethaddress: common.HexToAddress(tt.args).Bytes()}) + require.NoError(t, err) + assert.Equal(t, tt.want.EthAddress, s.validatorService.ProposerSettings.ProposeConfig[bytesutil.ToBytes48(byteval)].FeeRecipient.Hex()) + }) + } +} + +func TestServer_DeleteFeeRecipientByPubkey(t *testing.T) { + ctx := grpc.NewContextWithServerTransportStream(context.Background(), &runtime.ServerTransportStream{}) + byteval, err := hexutil.Decode("0xaf2e7ba294e03438ea819bd4033c6c1bf6b04320ee2075b77273c08d02f8a61bcc303c2c06bd3713cb442072ae591493") + require.NoError(t, err) + type want struct { + EthAddress string + } + tests := []struct { + name string + proposerSettings *validator_service_config.ProposerSettings + want *want + wantErr bool + }{ + { + name: "Happy Path Test", + proposerSettings: &validator_service_config.ProposerSettings{ + ProposeConfig: map[[48]byte]*validator_service_config.ProposerOption{ + bytesutil.ToBytes48(byteval): { + FeeRecipient: common.HexToAddress("0x055Fb65722E7b2455012BFEBf6177F1D2e9738D5"), + }, + }, + DefaultConfig: &validator_service_config.ProposerOption{ + FeeRecipient: common.HexToAddress("0x046Fb65722E7b2455012BFEBf6177F1D2e9738D9"), + }, + }, + want: &want{ + EthAddress: common.HexToAddress("0x046Fb65722E7b2455012BFEBf6177F1D2e9738D9").Hex(), + }, + wantErr: false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + vs, err := client.NewValidatorService(ctx, &client.Config{ + Validator: &mock.MockValidator{}, + ProposerSettings: tt.proposerSettings, + }) + require.NoError(t, err) + s := &Server{ + validatorService: vs, + } + _, err = s.DeleteFeeRecipientByPubkey(ctx, ðpbservice.PubkeyRequest{Pubkey: byteval}) + require.NoError(t, err) + assert.Equal(t, tt.want.EthAddress, s.validatorService.ProposerSettings.ProposeConfig[bytesutil.ToBytes48(byteval)].FeeRecipient.Hex()) + }) + } +}