Radish alpha
h
rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5
Radicle Heartwood Protocol & Stack
Radicle
Git
radicle: introduce identity document version
Merged fintohaps opened 1 year ago

This change introduces versioning to the identity document format.

The Version type is introduced to captured this. Importantly, it is very restricted in its construction and API. Since we primarily only care about serializing and deserializing documents, the Version is constructed via Deserialize. The only other ways to get a Version is to use the IDENTITY_VERSION constant or by using Version::default.

The Deserialize implementation ensures that the version is within the accepted bounds, i.e. that it is not 0 and that it is not a version that may not have been released yet – the user may be running a previous client. If it does encounter a future version, it will provide a helpful error message to check version compatabilities, and possibly upgrade their binaries.

Note that changing the Doc means that the hashes for tests change. This requires updating a few of the library tests and many of the CLI tests. One important note is the introduction of the advance_timestamp helper in cob::identity::test, which allows us to manipulate the timestamp so that we keep a stable order for the timeline tests and get the correct series of events.

fintohaps opened with revision 52f287f5 on base 97965d41 +1160 -866 1 year ago

This change introduces versioning to the identity document format.

The Version type is introduced to captured this. Importantly, it is very restricted in its construction and API. Since we primarily only care about serializing and deserializing documents, the Version is constructed via Deserialize. The only other ways to get a Version is to use the IDENTITY_VERSION constant or by using Version::default.

The Deserialize implementation ensures that the version is within the accepted bounds, i.e. that it is not 0 and that it is not a version that may not have been released yet – the user may be running a previous client. If it does encounter a future version, it will provide a helpful error message to check version compatabilities, and possibly upgrade their binaries.

Note that changing the Doc means that the hashes for tests change. This requires updating a few of the library tests and many of the CLI tests. One important note is the introduction of the advance_timestamp helper in cob::identity::test, which allows us to manipulate the timestamp so that we keep a stable order for the timeline tests and get the correct series of events.

fintohaps pushed revision 2 a3267808 on base 7ff426a2 +1174 -871 1 year ago

Changes:

  • Rebased on f6b2c5110741b776655eca8228ec66de40b7243d
  • Added docs to Version
  • Moved radicle_cob::git::STABLE_TIME to this patch
fintohaps pushed revision 3 3510a957 on base 0c9a7419 +1188 -871 1 year ago

Changes:

  • Use function for setting default value of document version
  • Update docs for with_timestamp
fintohaps pushed revision 4 2fa9325b on base 0c9a7419 +1210 -870 1 year ago

Changes:

  • Simplify version check by removing the ACCEPTED_VERSIONS static and using a range check instead.
  • Introduced Version::new and Version::try_from to help with construction of a Version, along with VersionError for error cases.
fintohaps pushed revision 5 dacecd35 on base 0c9a7419 +347 -12 1 year ago

Changes:

  • Skip serializing Doc::version when the version <= 1
fintohaps pushed revision 6 fafbd302 on base 0c9a7419 +357 -13 1 year ago

Changes:

  • Use NonZeroU32 since we do not allow the version 0
fintohaps pushed revision 7 0252b66b on base 0c9a7419 +308 -13 1 year ago

Changes:

  • Simplify deserialize of version
fintohaps pushed revision 8 02951489 on base 0c9a7419 +241 -2 1 year ago

Changes:

  • Clean up typos and comments
  • More concise error message for unknown versions
  • Renamed FutureVersion to UnkownVersion
  • Rename deserialize_default_version to missing_version
  • Add RawDoc::version and Doc::version getters
  • VersionError::verbose for more verbose version of the error
did:key:z6MksFqX...wzpT pushed revision 9 8b0aa236 on base ccc0297b +241 -2 1 year ago

Rebase.

did:key:z6MksFqX...wzpT merged revision 8b0aa236 at 08833985 1 year ago