Description
We use three different versions in Parsec:
- The wire protocol version
- The Parsec service version
- The provider version
The wire protocol version
It describes the version of the wire protocol itself: what are the different fields of requests and responses. It is needed to parse request and response headers.
The wire protocol might change in the future.
The Ping
operation returns the highest wire protocol version supported by the service.
Clients need to perform a bootstrapping sequence if they want to switch to a higher wire protocol version:
- Client send
Ping
using wire protocol version1.0
- Service answer with highest wire protocol version available
x.y
- Client now knows that it can use wire protocol version
x.y
for further request.
The response are made by the service using the same wire protocol version than the request it was sent so that client can parse them.
The four first fields of the wire protocol: magic number, header size, version major and version minor will never change for requests and responses.
If a client sends a request with a wire protocol version strictly higher than the highest one supported by the service, a response status VersionTooBig
will be sent back as an error.
Actions to take
- Make sure that the wire protocol version system is documented properly and is consistent across all of our documentation
- Add in the client library guide explanation about how the bootstrapping sequence should be performed.
- Modify the front-end handler to first parse the first four fields, check if the version sent is lower than the highest supported (send back
VersionTooBig
otherwise) and pass the rest to the appropriate wire protocol version deserializer. We should add the reverse logic on the return journey to serialize the response using the same wire protocol version than the request.
The Parsec service version
This version is returned by the ListProviders
operation in the ProviderInfoProto
structure of the Core Provider. It represents the implementation version of the whole Parsec service. Everytime something is changed on the Parsec service, this number should be modified using the semantic versioning rules the best way possible. It is a way for clients to check if the Parsec version they are using contains the bug/security vulnerabilities fixes that they need or contains the new features that they want.
To make it easy, this version should be the same as the version
field in the Cargo.toml
file of the parsec
crate.
Actions to take
- Document this in the ListProviders section.
- Should probably add a CHANGELOG page in the documentation describing the changes that each version brings so clients are aware.
- Add the logic in the Core Provider to directly fetch its version from the
Cargo.toml
file.
The Provider version
Each provider (other than the Core provider) also returns a version as part of the ListProviders operation. This version represents the implementation version of the provider. It is needed if the provider is implemented as a co-server for example as there would be no way then to link the Parsec service version to the provider version.
Actions to take
- Document this in the ListProviders section.
- I propose that for the providers that are statically linked with the Parsec service, their version should be the same as the Parsec service version, that is the same as the Core Provider. It makes sense as they share the same dependencies than the Parsec service.