Skip to content

Commit

Permalink
Merge pull request #5867 from oasisprotocol/peternose/internal/remove…
Browse files Browse the repository at this point in the history
…-feature-rpc-peer-id

runtime: Remove obsolete feature rpc_peer_id
  • Loading branch information
peternose authored Sep 25, 2024
2 parents 6c5af61 + 7510442 commit 7bf2296
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 18 deletions.
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

0 comments on commit 7bf2296

Please sign in to comment.