Skip to content

Add /version endpoint#99

Open
tankyleo wants to merge 2 commits intolightningdevkit:mainfrom
tankyleo:2026-05-health-check
Open

Add /version endpoint#99
tankyleo wants to merge 2 commits intolightningdevkit:mainfrom
tankyleo:2026-05-health-check

Conversation

@tankyleo
Copy link
Copy Markdown
Contributor

@tankyleo tankyleo commented May 6, 2026

This endpoint allows clients to check the version of the VSS API that the server is serving.

It also serves as a health check.

tankyleo added 2 commits May 6, 2026 01:10
We now read `vss.proto` from the local repository instead of dowloading
it from a previous commit on github.

We also update the checked-in `types.rs` file to match the one generated
with the `genproto` flag, and now skip any formatting of this
auto-generated file.
This endpoint allows clients to check the version of the VSS API that
the server is serving.

It also serves as a health check.
@ldk-reviews-bot
Copy link
Copy Markdown

ldk-reviews-bot commented May 6, 2026

👋 Thanks for assigning @tnull as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@tankyleo tankyleo requested a review from tnull May 6, 2026 01:25
Comment thread rust/api/src/lib.rs
pub mod kv_store;

/// Contains request/response types generated from the API definition of VSS.
#[rustfmt::skip]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why skip rather than formatting post-generation?

Comment thread rust/api/build.rs
#[cfg(genproto)]
fn generate_protos() {
download_file(
"https://raw.githubusercontent.com/lightningdevkit/vss-server/7f492fcac0c561b212f49ca40f7d16075822440f/app/src/main/proto/vss.proto",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

AFAIU, the original intention here was to pin the protocol version to a specific commit. But you're right that we probably should do that via the new protocol versioning, and proper vss-server tags/releases.

Comment thread rust/api/Cargo.toml

[target.'cfg(genproto)'.build-dependencies]
prost-build = { version = "0.11.3" }
reqwest = { version = "0.11.13", default-features = false, features = ["rustls-tls", "blocking"] }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎉

let prefix_stripped_path = path.strip_prefix(BASE_PATH_PREFIX).unwrap_or_default();

match prefix_stripped_path {
"/version" => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Adding this endpoint is great, but shouldn't we also add a (I guess optional, for backwards compat) protocol_version field to all other messages? Otherwise, if we require the client to always manually first call this endpoint and wait on the response a) it's error prone b) it would require another full RTT on startup which is not great. So maybe we make version negotiation implicit and only fail the flow on mismatch? Thoughts?

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.

3 participants