From a5471950ae3ac993e102bfc094265c9014f887d9 Mon Sep 17 00:00:00 2001 From: Ernesto Ocampo Date: Mon, 25 Mar 2024 15:53:29 -0300 Subject: [PATCH] Revert "Add micro_rpc method_id option to service protos. (#4948)" This reverts commit 62b11da983051ddbfbacc704f6232aeb929bbf68. --- micro_rpc_tests/build.rs | 5 +--- micro_rpc_tests/proto/test_schema.proto | 25 ++++------------ proto/oak_functions/BUILD | 1 - .../sdk/oak_functions_wasm.proto | 25 ++++------------ .../oak_functions/service/oak_functions.proto | 29 +++++-------------- proto/oak_functions/testing.proto | 10 ++----- testing/oak_echo_service/proto/oak_echo.proto | 9 ++---- 7 files changed, 24 insertions(+), 80 deletions(-) diff --git a/micro_rpc_tests/build.rs b/micro_rpc_tests/build.rs index 8a3f51c87e..6a842f4ee2 100644 --- a/micro_rpc_tests/build.rs +++ b/micro_rpc_tests/build.rs @@ -18,10 +18,7 @@ fn main() { println!("cargo:rerun-if-env-changed=WORKSPACE_ROOT"); micro_rpc_build::compile( &[format!("{}micro_rpc_tests/proto/test_schema.proto", env!("WORKSPACE_ROOT"))], - &[ - format!("{}micro_rpc_tests/proto", env!("WORKSPACE_ROOT")), - env!("WORKSPACE_ROOT").to_string(), - ], + &[format!("{}micro_rpc_tests/proto", env!("WORKSPACE_ROOT"))], Default::default(), ); } diff --git a/micro_rpc_tests/proto/test_schema.proto b/micro_rpc_tests/proto/test_schema.proto index 3c7c368614..f6f0dbb50a 100644 --- a/micro_rpc_tests/proto/test_schema.proto +++ b/micro_rpc_tests/proto/test_schema.proto @@ -22,7 +22,6 @@ import "google/protobuf/empty.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; import "google/protobuf/any.proto"; -import "proto/micro_rpc/options.proto"; message LookupDataRequest { bytes key = 1; @@ -38,27 +37,15 @@ message LogResponse {} service TestService { // method_id: 15 - rpc LookupData(LookupDataRequest) returns (LookupDataResponse) { - option (.oak.micro_rpc.method_id) = 15; - } + rpc LookupData(LookupDataRequest) returns (LookupDataResponse); // method_id: 16 - rpc Log(LogRequest) returns (LogResponse) { - option (.oak.micro_rpc.method_id) = 16; - } + rpc Log(LogRequest) returns (LogResponse); // method_id: 17 - rpc Empty(google.protobuf.Empty) returns (google.protobuf.Empty) { - option (.oak.micro_rpc.method_id) = 17; - } + rpc Empty(google.protobuf.Empty) returns (google.protobuf.Empty); // method_id: 18 - rpc Duration(google.protobuf.Duration) returns (google.protobuf.Duration) { - option (.oak.micro_rpc.method_id) = 18; - } + rpc Duration(google.protobuf.Duration) returns (google.protobuf.Duration); // method_id: 19 - rpc Timestamp(google.protobuf.Timestamp) returns (google.protobuf.Timestamp) { - option (.oak.micro_rpc.method_id) = 19; - } + rpc Timestamp(google.protobuf.Timestamp) returns (google.protobuf.Timestamp); // method_id: 20 - rpc Any(google.protobuf.Any) returns (google.protobuf.Any) { - option (.oak.micro_rpc.method_id) = 20; - } + rpc Any(google.protobuf.Any) returns (google.protobuf.Any); } diff --git a/proto/oak_functions/BUILD b/proto/oak_functions/BUILD index dda9e6fb44..e95489fc74 100644 --- a/proto/oak_functions/BUILD +++ b/proto/oak_functions/BUILD @@ -42,7 +42,6 @@ proto_library( proto_library( name = "testing_proto", srcs = ["testing.proto"], - deps = ["//proto/micro_rpc:options_proto"], ) build_test( diff --git a/proto/oak_functions/sdk/oak_functions_wasm.proto b/proto/oak_functions/sdk/oak_functions_wasm.proto index d85561831b..f8ba90ef13 100644 --- a/proto/oak_functions/sdk/oak_functions_wasm.proto +++ b/proto/oak_functions/sdk/oak_functions_wasm.proto @@ -19,7 +19,6 @@ syntax = "proto3"; package oak.functions.wasm.v1; import "google/protobuf/wrappers.proto"; -import "proto/micro_rpc/options.proto"; // The standard API for Oak Functions, which is exposed to Wasm modules via micro RPC, and wrapped // by the Oak Functions SDK. @@ -31,9 +30,7 @@ service StdWasmApi { // This method is idempotent: multiple calls result in the same response. // // method_id: 0 - rpc ReadRequest(ReadRequestRequest) returns (ReadRequestResponse) { - option (.oak.micro_rpc.method_id) = 0; - } + rpc ReadRequest(ReadRequestRequest) returns (ReadRequestResponse) {} // Write a response for the client. // @@ -42,9 +39,7 @@ service StdWasmApi { // runtime sends an empty response to the client. // // method_id: 1 - rpc WriteResponse(WriteResponseRequest) returns (WriteResponseResponse) { - option (.oak.micro_rpc.method_id) = 1; - } + rpc WriteResponse(WriteResponseRequest) returns (WriteResponseResponse) {} // Writes a debug log message. // @@ -52,30 +47,22 @@ service StdWasmApi { // in debug mode. // // method_id: 2 - rpc Log(LogRequest) returns (LogResponse) { - option (.oak.micro_rpc.method_id) = 2; - } + rpc Log(LogRequest) returns (LogResponse) {} // Looks up an item from the in-memory key/value lookup store. // // method_id: 3 - rpc LookupData(LookupDataRequest) returns (LookupDataResponse) { - option (.oak.micro_rpc.method_id) = 3; - } + rpc LookupData(LookupDataRequest) returns (LookupDataResponse) {} // Looks up multiple items from the in-memory key/value lookup store. // // method_id: 4 - rpc LookupDataMulti(LookupDataMultiRequest) returns (LookupDataMultiResponse) { - option (.oak.micro_rpc.method_id) = 4; - } + rpc LookupDataMulti(LookupDataMultiRequest) returns (LookupDataMultiResponse) {} // Test method only. // // method_id: 128 - rpc Test(TestRequest) returns (TestResponse) { - option (.oak.micro_rpc.method_id) = 128; - } + rpc Test(TestRequest) returns (TestResponse) {} } message ReadRequestRequest {} diff --git a/proto/oak_functions/service/oak_functions.proto b/proto/oak_functions/service/oak_functions.proto index e574981dc2..812d752f50 100644 --- a/proto/oak_functions/service/oak_functions.proto +++ b/proto/oak_functions/service/oak_functions.proto @@ -20,22 +20,17 @@ package oak.functions; import "proto/crypto/crypto.proto"; import "proto/attestation/evidence.proto"; -import "proto/micro_rpc/options.proto"; service OakFunctions { // Initializes the service and remote attestation keys. // // method_id: 0 - rpc Initialize(InitializeRequest) returns (InitializeResponse) { - option (.oak.micro_rpc.method_id) = 0; - } + rpc Initialize(InitializeRequest) returns (InitializeResponse); // Handles an invocation coming from a client. // // method_id: 1 - rpc HandleUserRequest(InvokeRequest) returns (InvokeResponse) { - option (.oak.micro_rpc.method_id) = 1; - } + rpc HandleUserRequest(InvokeRequest) returns (InvokeResponse); // Extends the next lookup data by the given chunk of lookup data. Only // after the sender calls finishes building the next lookup data, the receiver replaces the @@ -43,33 +38,25 @@ service OakFunctions { // lookups. // // method_id: 2 - rpc ExtendNextLookupData(ExtendNextLookupDataRequest) returns (ExtendNextLookupDataResponse) { - option (.oak.micro_rpc.method_id) = 2; - } + rpc ExtendNextLookupData(ExtendNextLookupDataRequest) returns (ExtendNextLookupDataResponse); // Finishes building the next lookup data with the given chunk of lookup data. The receiver // replaces the current lookup data and the next lookup data will be served in lookups. // // method_id: 3 - rpc FinishNextLookupData(FinishNextLookupDataRequest) returns (FinishNextLookupDataResponse) { - option (.oak.micro_rpc.method_id) = 3; - } + rpc FinishNextLookupData(FinishNextLookupDataRequest) returns (FinishNextLookupDataResponse); // Aborts building the next lookup data.option // // method_id: 4 - rpc AbortNextLookupData(Empty) returns (AbortNextLookupDataResponse) { - option (.oak.micro_rpc.method_id) = 4; - } + rpc AbortNextLookupData(Empty) returns (AbortNextLookupDataResponse); // Streaming version combining `ExtendNextLookupData` and `FinishNextLookupData`. // // This is mainly for use with gRPC, as microRPC doesn't support streaming. // // method_id: 5 - rpc StreamLookupData(stream LookupDataChunk) returns (FinishNextLookupDataResponse) { - option (.oak.micro_rpc.method_id) = 5; - } + rpc StreamLookupData(stream LookupDataChunk) returns (FinishNextLookupDataResponse); // Reserves additional capacity for entries in the lookup table. // @@ -77,9 +64,7 @@ service OakFunctions { // number of memory allocations, but it's not mandatory to call this RPC. // // method_id: 6 - rpc Reserve(ReserveRequest) returns (ReserveResponse) { - option (.oak.micro_rpc.method_id) = 6; - } + rpc Reserve(ReserveRequest) returns (ReserveResponse); } message InitializeRequest { diff --git a/proto/oak_functions/testing.proto b/proto/oak_functions/testing.proto index 5b12fdf66e..cbde883fdf 100644 --- a/proto/oak_functions/testing.proto +++ b/proto/oak_functions/testing.proto @@ -18,17 +18,11 @@ syntax = "proto3"; package oak.functions.testing; -import "proto/micro_rpc/options.proto"; - service TestModule { // method_id: 0 - rpc Lookup(LookupRequest) returns (LookupResponse) { - option (.oak.micro_rpc.method_id) = 0; - } + rpc Lookup(LookupRequest) returns (LookupResponse) {} // method_id: 1 - rpc EchoAndPanic(EchoAndPanicRequest) returns (EchoAndPanicResponse) { - option (.oak.micro_rpc.method_id) = 1; - } + rpc EchoAndPanic(EchoAndPanicRequest) returns (EchoAndPanicResponse) {} } message LookupRequest { diff --git a/testing/oak_echo_service/proto/oak_echo.proto b/testing/oak_echo_service/proto/oak_echo.proto index cabfedb870..6c33aa879b 100644 --- a/testing/oak_echo_service/proto/oak_echo.proto +++ b/testing/oak_echo_service/proto/oak_echo.proto @@ -20,7 +20,6 @@ package oak.echo; import "google/protobuf/empty.proto"; import "proto/attestation/evidence.proto"; -import "proto/micro_rpc/options.proto"; message EchoRequest { bytes body = 1; @@ -36,12 +35,8 @@ message GetEvidenceResponse { service Echo { // method_id: 1988 - rpc Echo(EchoRequest) returns (EchoResponse) { - option (.oak.micro_rpc.method_id) = 1988; - } + rpc Echo(EchoRequest) returns (EchoResponse); // method_id: 1771 - rpc GetEvidence(google.protobuf.Empty) returns (GetEvidenceResponse) { - option (.oak.micro_rpc.method_id) = 1771; - } + rpc GetEvidence(google.protobuf.Empty) returns (GetEvidenceResponse); }