8000 Use prost for grpc generated types by nick-mobilecoin · Pull Request #4032 · mobilecoinfoundation/mobilecoin · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Use prost for grpc generated types #4032

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

Open
wants to merge 13 commits into
base: nick/prost-11
Choose a base branch
from

Conversation

nick-mobilecoin
Copy link
Collaborator

No description provided.

@nick-mobilecoin
Copy link
Collaborator Author

This will need some discussion as to whether or not it's worth the cost/benefit of doing

The reasons to consider moving over to prost for the gRPC generated types is:

  1. Protobuf version 2 is an older version that isn't actively maintained for features:
    a. There is a current vulnerability for version 2, https://rustsec.org/advisories/RUSTSEC-2024-0437.html
    b. There is a protobuf version 3, but the repo currently says it's looking for a maintainer
  2. prost works in a 'no_std'.
    a. We currently have protobuf/prost types generated at compile time and some defined in the enclave using prost derives.
    b. Using prost everywhere may allow us to generate the prost types for use in the enclave and re-use them in untrusted instead of defining types twice.
  3. A desire to move form grpc-rs to Tonic.
    a. Tonic works with rust's native async, while grpc-rs has it's own asynchronous behavior
    b. Currently our slowest build step is grpc-rs
    c. grpc-rs hasn't had a release in 18 months and hasn't seen a change in 8 months. It could just be a solid and stable project not needing any change.

@nick-mobilecoin nick-mobilecoin marked this pull request as draft April 27, 2025 22:58
@eranrund
Copy link
Contributor

This will need some discussion as to whether or not it's worth the cost/benefit of doing

The reasons to consider moving over to prost for the gRPC generated types is:

1. Protobuf version 2 is an older version that isn't actively maintained for features:
   a. There is a current vulnerability for version 2, https://rustsec.org/advisories/RUSTSEC-2024-0437.html
   b. There is a protobuf version 3, but the repo currently says it's looking for a maintainer

2. prost works in a 'no_std'.
   a. We currently have protobuf/prost types generated at compile time and some defined in the enclave using prost derives.
   b. Using prost everywhere may allow us to generate the prost types for use in the enclave and re-use them in untrusted instead of defining types twice.

3. A desire to move form grpc-rs to Tonic.
   a. Tonic works with rust's native async, while grpc-rs has it's own asynchronous behavior
   b. Currently our slowest build step is grpc-rs
   c. grpc-rs hasn't had a release in 18 months and hasn't seen a change in 8 months. It could just be a solid and stable project not needing any change.

Thanks!
These are all good reasons!

@nick-mobilecoin
Copy link
Collaborator Author

@nick-mobilecoin nick-mobilecoin marked this pull request as ready for review May 6, 2025 19:52
Copy link
Contributor
@eranrund eranrund left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What a beast of a PR... thanks for toiling on that!
I think it's pretty close to being good to go - I had some minor nits (that can also be ignored) and more interestingly some questions around handling casting of enum values and the behavior around unknown variants.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0