Skip to content

Version the sprockets protocol#86

Merged
labbott merged 1 commit into
mainfrom
version_protocol
Sep 8, 2025
Merged

Version the sprockets protocol#86
labbott merged 1 commit into
mainfrom
version_protocol

Conversation

@labbott

@labbott labbott commented Aug 13, 2025

Copy link
Copy Markdown
Contributor

We will need to make changes the the protocol as we add more features (e.g. SPDM from the host). Introduce a basic versioning mechanism to allow this.

@labbott
labbott requested review from andrewjstone and flihp August 13, 2025 20:11
@labbott

labbott commented Aug 13, 2025

Copy link
Copy Markdown
Contributor Author

This is a little hard to get in a unit test but manual testing shows that server and client will give errors if the version isn't what is expected.

I'm guessing the expected path if we get a Very Old client/server is the mupdate recovery path which does not rely on sprockets?

We will need to make changes the the protocol as we add more features
(e.g. SPDM from the host). Introduce a basic versioning mechanism
to allow this.

@andrewjstone andrewjstone left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks @labbott. This looks good for now. I'm sure we'll refine it over time, but it's great to have the version negotation now before we get into live update on production systems.

Comment thread tls/src/lib.rs

// Response from the server, either the same version back, version - 1
// or an error if there is no way the server can support this request
type ProtocolResult = Result<u32, ()>;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think it would be nice to return a proper error here, or at least the incompatible version. We expect success with the current and previous versions, and we'd probably like to know what version the system is actually on when debugging a failure.

Comment thread tls/src/server.rs
// get version from the client
let version_bytes = recv_msg(&mut stream).await?;
let version =
u32::from_le_bytes(version_bytes[..4].try_into().unwrap());

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Just to confirm: We don't have to worry about backwards compatibility here because we only use sprockets in RSS and we are currently only doing mupdates, right?

If we needed backwards compatibility we might have to add something like a magic number header to avoid ambiguity. That would suck though.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We don't currently have this deployed anywhere so I think the risk is pretty low. I don't think adding a magic number would be terrible if we're concerned about compatibility.

@labbott
labbott merged commit b3b15d9 into main Sep 8, 2025
10 checks passed
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