Skip to content

Conversation

@YutaoMa
Copy link
Collaborator

@YutaoMa YutaoMa commented Dec 10, 2025

Motivation

As explained previously #2459 , we are upstreaming an implementation of xDS client in Rust, in order to support xDS based routing and load balancing in tonic / gRPC Rust eventually. This PR is a continuation of the effort, by exposing all the expected public APIs (traits, types, function signatures) first to lay out the design.

Solution

Here is an overview of all the public APIs we are adding in this PR:

File Public Types
error.rs Error, Result
resource.rs Resource trait
transport.rs Transport, TransportStream, DiscoveryRequest, DiscoveryResponse
runtime.rs Runtime trait
config.rs ClientConfig
watcher.rs ResourceWatcher<T>, ResourceEvent<T>
client.rs XdsClient, XdsClientBuilder

In case the reviewer is curious if the provided APIs could support the expected functionality of an xDS client, I have a working proof of concept that implements these APIs in my fork: https://github.com/YutaoMa/tonic/tree/yutaoma/xds-client-poc, it showcases the APIs working together with an implementation based on the tonic stack (tonic, tokio, prost).

@LucioFranco
Copy link
Member

@YutaoMa CI is failing because we have a job that checks that we don't expose certain APIs publically so this should be addressed https://github.com/hyperium/tonic/actions/runs/20112284748/job/57712601774?pr=2464#step:7:69 ideally, we should not expose things publically that we don't own to avoid potential breaking changes in the future.

@YutaoMa
Copy link
Collaborator Author

YutaoMa commented Dec 15, 2025

@LucioFranco as suggested I've removed the dependency on the pre-1.0 futures crate and added bytes to metadata allowlist similar to other tonic crates.

Copy link
Collaborator

@gu0keno0 gu0keno0 left a comment

Choose a reason for hiding this comment

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

Some general questions, LGTM overall

Copy link
Member

@LucioFranco LucioFranco left a comment

Choose a reason for hiding this comment

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

LGTM! Feel free to address things in follow ups, nice to see the start here!

@YutaoMa YutaoMa requested a review from dfawley December 19, 2025 00:18
Copy link
Collaborator

@dfawley dfawley left a comment

Choose a reason for hiding this comment

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

Sorry for the late review. In general this looks great, thanks! I have a few changes to suggest, and feel free to punt on some of them until later.

@YutaoMa YutaoMa merged commit d112d09 into hyperium:master Jan 5, 2026
20 checks passed
YutaoMa added a commit that referenced this pull request Jan 8, 2026
## Motivation

Ref: #2444 

The transport layer in xDS client is responsible for sending
`DiscoveryRequest` to xDS management server, and receiving
`DiscoveryResponse` back.

## Solution

This PR implements tonic-based transport and prost-based codec. As
discussed in #2464, the transport layer sends and receives bytes and
leaves (de)serialization to the worker with the help of codegen-specific
codecs.
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.

5 participants