apache / incubator-teaclave

Apache Teaclave (incubating) is an open source universal secure computing platform, making computation on privacy-sensitive data safe and simple.
https://teaclave.apache.org
Apache License 2.0
761 stars 158 forks source link

Support grpc #668

Closed GeminiCarrie closed 1 year ago

GeminiCarrie commented 1 year ago

Motivation & problem statement

The rpc used by Teaclave is not universal and does not support async.

Proposed solution

Replace current rpc with grpc (e.g. Tonic).

I noticed that there is an example based on tonic and tokio in rust-sgx-sdk.

https://github.com/apache/incubator-teaclave-sgx-sdk/tree/v2.0.0-preview/samplecode/rpc

Tonic supports async/await and has a high performance.

To do mutual attestation, we can establish trusted gRPC channel through attested TLS.

Grpc based on tonic, rustls and tokio is easier to maintain, and has better compatibility and performance.