informalsystems / tendermint-rs

Client libraries for Tendermint/CometBFT in Rust!
Apache License 2.0
615 stars 225 forks source link

meta: Semantic versioning #1128

Open thanethomson opened 2 years ago

thanethomson commented 2 years ago

After discussing with @hdevalence, it seems like it might be better to move toward a semantic versioning strategy for tendermint-rs.

The current versioning strategy involves allowing for breaking changes in minor and patch releases, which shifts the burden of version management to consumers. Switching directly to a semantic versioning strategy using the current crate names will unfortunately not work, as this restricts us to only being able to make breaking client API changes (e.g. sync to async, or domain type changes) when a new version of Tendermint Core is released, which doesn't make sense.

The alternative strategy is as follows:

thanethomson commented 2 years ago

An alternative approach here as suggested by @soareschen is to support multiple versions of Tendermint Core from within a single codebase. In other words, Tendermint Core version-specific code would live behind versioned modules (e.g. tendermint::v034 and tendermint::v035) and common code would live in a ::common module.

It looks as though this may end up being the best approach going forward if we want to be able to ensure the ability to connect networks running different versions of Tendermint Core through IBC.

The nice thing about this approach is that we won't need complex VCS strategies to manage it, and we can easily support semver, but then the complexity will live in the codebase itself.

xla commented 2 years ago

To assess this meaningfully it would be helpful to understand which types/interfaces actually differ between the versions.

thanethomson commented 2 years ago

To assess this meaningfully it would be helpful to understand which types/interfaces actually differ between the versions.

This depends on the specific versions, whereas we need a somewhat generic versioning strategy for the codebase that can cope with breaking changes across all of the publicly accessible interfaces Tendermint provides:

  1. the RPC
  2. ABCI
  3. potentially the P2P layer

Changes in these data structures necessarily require changes to our domain types and possibly serialization strategies. Of course, minimizing data structure duplication is of high priority here, but sometimes it can't be helped.

For specifics we can consult the Tendermint upgrading guide.

As an example of a specific breaking change, Tendermint will be deprecating the WebSocket interface entirely in v0.37 in favor of a long polling interface (which will be available from v0.36). See the ADR. If we wanted to fully support v0.35 and v0.36/v0.37 simultaneously, this will require different client implementations to handle the two different subscription protocols.