Replies: 3 comments 9 replies
-
|
Re-reading this, we might be able to combine |
Beta Was this translation helpful? Give feedback.
-
|
Now the question remains is, if there is sufficient information in protobuf to map to |
Beta Was this translation helpful? Give feedback.
-
|
Would the intention to be to replace the version header we have in place today? AFAICT the functionality in this discussion would be a superset of capability provided by the version header. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
#1040
Context
We do not control the users client version, which might be either outdated or patched, and hence not comply ot whatever node version the server might be running.
Incompatibilities
There are
34 ways of incompatible changesprostforprotobuftypes - we can technically handle theseprostdoes not change, this is not part of the problem scopeAPI in-compatibility detection
My current idea is, to provide an endpoint index at a fixed endpoint. The client can then optionally check it's own implementation against the node's provided API version.
The alternative is to use the transport and provide, i.e. for http additional version information on connection. This becomes brittle if we use connection termination or proxies.
Common API version
We can give the API a dedicated version, independently of any crate versions, and use
semverto deduct compatibility.Per endpoint
We could technically do so for each individual endpoint as well. For endpoints having digests might be a better idea, since there seems little room for compatibility, but the common case is works or does not work between version
AandB.Tools
cargo-semver-checkdoes check the entire public crate API against a defined past version of itself and yields compatibility errors. It might be possible to generate these compatibility objects at compile time. We could look for i.e. types that implement i.e.StoreApiand derive compatibility by just those. It's powered bytrustfallwhich allows queries, and hence we could just scope the queries to our needs. This should be feasible assuming the promises of https://predr.ag/blog/speeding-up-rust-semver-checking-by-over-2000x/ hold up.Write a proc-macro to deduct the type information from the APIs and write the format out to a API version, the downside is that it percolates through all nested types deeply, and is a rather large effortParity did this, the effort was ginormeous and took ~1aUse an external tool like
bufthat provides compatibility checks on the.protolevel.Derived from that, we can have dedicated API version. Any type using derive
[derive(prost::Message)]will hence not be covered see implementation details of the derive proc-macroBeta Was this translation helpful? Give feedback.
All reactions