Skip to content

Commit

Permalink
go/runtime/registry/host: Always send node in RPC call response
Browse files Browse the repository at this point in the history
  • Loading branch information
peternose committed Sep 30, 2024
1 parent 033e535 commit 1e1a2f6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
4 changes: 2 additions & 2 deletions go/runtime/host/protocol/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down
8 changes: 1 addition & 7 deletions go/runtime/registry/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 1e1a2f6

Please sign in to comment.