|
| 1 | +# Namada versioning scheme |
| 2 | + |
| 3 | +Namada versioning scheme follows the Cargo built-in SemVer rules (<https://semver.org>), with an addition of using the `MAJOR` to also denote consensus breaking changes. |
| 4 | + |
| 5 | +We combine `CONSENSUS` version with `MAJOR` version, using a constant `OFFSET = 100`: |
| 6 | + |
| 7 | +> `{CONSENSUS * OFFSET + MAJOR}.{MINOR}.{PATCH}` |
| 8 | +
|
| 9 | +This makes it possible to rely on the Cargo built-in logic for auto-updating dependencies (i.e. `CONSENSUS` and `MAJOR` updates are non-compatible, `MINOR` and `PATCH` are compatible and can be updated automatically without additional intervention). |
| 10 | + |
| 11 | +Note that `CONSENSUS` may change without `MAJOR` API changes and, vice-versa, `MAJOR` API change can occur without a change in `CONSENSUS`. |
| 12 | + |
| 13 | +The total order of version strings is preserved. E.g. changes in: |
| 14 | + |
| 15 | +- `CONSENSUS` version: `v101.0.0` < `v201.0.0` |
| 16 | +- `MAJOR`: `v101.0.0` < `v102.0.0` |
| 17 | +- `MINOR`: `v101.0.0` < `v101.1.0` |
| 18 | +- `PATCH`: `v101.0.0` < `v101.0.1` |
| 19 | + |
| 20 | +This versioning scheme applies since version the release of apps v1.1.0 and libs v0.47.0. The `CONSENSUS` version in these versions is considered to be `0`. |
| 21 | + |
| 22 | +## `CONSENSUS` and `MAJOR` version resetting |
| 23 | + |
| 24 | +In SemVer, when `MAJOR` is bumped, `MINOR` and `PATCH` are reset to `0` and when `MINOR` is bumped `PATCH` is reset to `0`. Note that however on `CONSENSUS` changes we DO NOT reset `MAJOR` version to preserve continuity of API evolution - as mentioned earlier a `CONSENSUS` change may not necessitate `MAJOR` API changes. `MINOR` and `PATCH` versions are still reset to `0` on `CONSENSUS` change. |
| 25 | + |
| 26 | +- As an example of `CONSENSUS` change **without** a `MAJOR` API change: `v101.2.3` -> `v201.0.0` |
| 27 | +- `CONSENSUS` change **with** a `MAJOR` API change: `v101.2.3` -> `v202.0.0` |
| 28 | +- And `MAJOR` API change **without** a `CONSENSUS` change: `v101.2.3` -> `v102.0.0` |
| 29 | + |
| 30 | +## Libs versioning |
| 31 | + |
| 32 | +Currently the libs are versioned separately (unstable v0.x) from apps (stable v1.x). Both use the same `CONSENSUS` version when compatible. |
| 33 | + |
| 34 | +Before we stabilize the libs API (i.e. before libs v1), the versioning is as follows: |
| 35 | + |
| 36 | +> `0.{CONSENSUS * OFFSET + MAJOR}.{MINOR}` |
| 37 | +
|
| 38 | +After we stabilize libs API we will bring this up to match apps version. |
| 39 | + |
| 40 | +## Apps versioning |
| 41 | + |
| 42 | +Other types of apps breaking changes may include e.g. changing the config format in non-compatible way, changing the DB format, wallet file format or other changes which may prevent from resuming node with a state written by a previous version. Such changes are considered non-consensus breaking for as long as two nodes with previous version and new version will always agree on blocks execution. Non-reverse compatible changes should increment `MAJOR` version, fully compatible changes are considered `MINOR`. |
0 commit comments