From 1e1a2f60113fd56bfab0390ddba1b0e7cc4f24a6 Mon Sep 17 00:00:00 2001 From: Peter Nose Date: Sat, 28 Sep 2024 03:19:59 +0200 Subject: [PATCH] go/runtime/registry/host: Always send node in RPC call response --- go/runtime/host/protocol/types.go | 4 ++-- go/runtime/registry/host.go | 8 +------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/go/runtime/host/protocol/types.go b/go/runtime/host/protocol/types.go index 9736f465fc3..f83f17d888b 100644 --- a/go/runtime/host/protocol/types.go +++ b/go/runtime/host/protocol/types.go @@ -480,7 +480,7 @@ type HostRPCCallRequest struct { // Nodes are optional node identities in case the request should be forwarded to specific // node instances and not to randomly chosen ones as selected by the host. - Nodes []signature.PublicKey `json:"nodes,omitempty"` + Nodes []signature.PublicKey `json:"nodes"` // PeerFeedback contains optional peer feedback for the last RPC call under the given endpoint. // // This enables the runtime to notify the node whether the given peer should continue to be used @@ -495,7 +495,7 @@ type HostRPCCallResponse struct { // Response is a response to a HostRPCCallRequest. Response []byte `json:"response"` // Node is the identifier of the node that handled the request. - Node *signature.PublicKey `json:"node,omitempty"` + Node signature.PublicKey `json:"node"` } // HostStorageEndpoint is the host storage endpoint. diff --git a/go/runtime/registry/host.go b/go/runtime/registry/host.go index 1026702a3b1..55f280356bf 100644 --- a/go/runtime/registry/host.go +++ b/go/runtime/registry/host.go @@ -250,15 +250,9 @@ func (h *runtimeHostHandler) handleHostRPCCall( if err != nil { return nil, err } - // Don't send node identity if the runtime doesn't support explicit key manager RPC calls. - if rq.Nodes == nil { - return &protocol.HostRPCCallResponse{ - Response: res, - }, nil - } return &protocol.HostRPCCallResponse{ Response: res, - Node: &node, + Node: node, }, nil default: return nil, fmt.Errorf("endpoint not supported")