Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime: Remove obsolete feature rpc_peer_id #5867

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .changelog/5867.internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
runtime: Remove obsolete feature rpc_peer_id
2 changes: 0 additions & 2 deletions go/runtime/host/protocol/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,6 @@ type Features struct {
// KeyManagerStatusUpdates is a feature specifying that the runtime supports updating
// key manager's status.
KeyManagerStatusUpdates bool `json:"key_manager_status_updates,omitempty"`
// RPCPeerID is a feature specifying that the runtime supports RPC peer IDs.
RPCPeerID bool `json:"rpc_peer_id,omitempty"`
// EndorsedCapabilityTEE is a feature specifying that the runtime supports endorsed TEE
// capabilities.
EndorsedCapabilityTEE bool `json:"endorsed_capability_tee,omitempty"`
Expand Down
13 changes: 1 addition & 12 deletions go/worker/keymanager/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,25 +180,14 @@ func (w *Worker) CallEnclave(ctx context.Context, data []byte, kind enclaverpc.K
RuntimeRPCCallRequest: &protocol.RuntimeRPCCallRequest{
Request: data,
Kind: kind,
PeerID: []byte(peerID),
},
}

rt := w.GetHostedRuntime()
if rt == nil {
return nil, fmt.Errorf("not initialized")
}
rtInfo, err := rt.GetInfo(ctx)
if err != nil {
w.logger.Error("failed to fetch runtime features",
"err", err,
)
return nil, fmt.Errorf("not initialized")
}

// Only include PeerIDs if the runtime supports it.
if rtInfo.Features.RPCPeerID {
req.RuntimeRPCCallRequest.PeerID = []byte(peerID)
}

response, err := rt.Call(ctx, req)
if err != nil {
Expand Down
4 changes: 0 additions & 4 deletions runtime/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,9 +377,6 @@ pub struct Features {
/// A feature specifying that the runtime supports updating key manager's status.
#[cbor(optional)]
pub key_manager_status_updates: bool,
/// A feature specifying that the runtime supports RPC peer IDs.
#[cbor(optional)]
pub rpc_peer_id: bool,
/// A feature specifying that the runtime supports endorsed TEE capabilities.
#[cbor(optional)]
pub endorsed_capability_tee: bool,
Expand All @@ -391,7 +388,6 @@ impl Default for Features {
schedule_control: None,
key_manager_quote_policy_updates: true,
key_manager_status_updates: true,
rpc_peer_id: true,
endorsed_capability_tee: true,
}
}
Expand Down
Loading