package version
- Alphabetic
- By Inheritance
- version
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- sealed trait CantonVersion extends Ordered[CantonVersion] with PrettyPrinting
Trait that represents how a version in Canton is modelled.
- sealed trait CompanionTrait extends AnyRef
- final case class DomainProtocolVersion(version: ProtocolVersion) extends Product with Serializable
Wrapper around a ProtocolVersion so we can verify during configuration loading that domain operators only configure a ProtocolVersion which is supported by the corresponding sequencer release.
- sealed trait HandshakeError extends AnyRef
- trait HasMemoizedVersionedMessageCompanion[ValueClass <: HasVersionedWrapper[VersionedMessage[ValueClass]]] extends AnyRef
- trait HasMemoizedVersionedMessageWithContextCompanion[ValueClass, Ctx] extends AnyRef
- trait HasProtoV0[ProtoClass <: GeneratedMessage] extends AnyRef
Trait for classes that have a corresponding Protobuf definition but **don't** need the ability to be directly serialized into a ByteString or ByteArray.
Trait for classes that have a corresponding Protobuf definition but **don't** need the ability to be directly serialized into a ByteString or ByteArray. Commonly, this interface should be used when the corresponding Protobuf message is only used in other Protobuf messages or for gRPC calls and responses, but never sent around or stored as a bytestring. E.g. an
Envelope
is always embedded in aBatch
, and therefore doesn't need a serialization method itself because it will be indirectly serialized when the enclosing Batch is serialized. - trait HasProtoV0WithVersion[ProtoClass <: GeneratedMessage] extends AnyRef
Same as HasProtoV0 but
toProtoV0
takes a version argument.This trait generally only be used in rare cases when a Protobuf message contains a nestedUntypedVersionedMessage
wrapper - see e.g.Same as HasProtoV0 but
toProtoV0
takes a version argument.This trait generally only be used in rare cases when a Protobuf message contains a nestedUntypedVersionedMessage
wrapper - see e.g. Batch and Envelope - trait HasVersionedMessageCompanion[ValueClass <: HasVersionedWrapper[VersionedMessage[ValueClass]]] extends AnyRef
Traits for the companion objects of classes that implement HasVersionedWrapper.
Traits for the companion objects of classes that implement HasVersionedWrapper. Provide default methods.
We provide two traits:
- HasVersionedMessageCompanion for the "standard" case
- HasMemoizedVersionedMessageCompanion for cases where memoization is done.
- trait HasVersionedMessageWithContextCompanion[ValueClass, Ctx] extends AnyRef
Traits for the companion objects of classes that implement HasVersionedWrapper.
Traits for the companion objects of classes that implement HasVersionedWrapper. They provide default methods. Unlike HasVersionedMessageCompanion these traits allow to pass additional context to the conversion methods (see, e.g., com.digitalasset.canton.data.TransferInViewTree.fromProtoVersioned which takes a
HashOps
parameter).We provide two traits:
- HasVersionedMessageWithContextCompanion for the "standard" case
- HasMemoizedVersionedMessageWithContextCompanion for cases where memoization is done.
- trait HasVersionedToByteString extends AnyRef
Trait for classes that can be serialized to a com.google.protobuf.ByteString.
Trait for classes that can be serialized to a com.google.protobuf.ByteString. Typical use cases of toByteString include:
- saving data in the database in serialized form (e.g. as in SequencedEvent)
- encrypting data (e.g. as in Encryption.scala) *
In some exceptional cases, we also convert an object to a ByteString before including it in a Proto message (e.g. ViewCommonData or Envelope)
Classes that use Protobuf for serialization should implement HasVersionedWrapper instead. See "CONTRIBUTING.md" for our guidelines on serialization.
- trait HasVersionedWrapper[+ProtoClass <: GeneratedMessage] extends HasVersionedToByteString
Trait for classes that can be serialized by using ProtoBuf.
Trait for classes that can be serialized by using ProtoBuf. See "CONTRIBUTING.md" for our guidelines on serialization.
The underlying ProtoClass is com.digitalasset.canton.version.UntypedVersionedMessage but we often specify the typed alias com.digitalasset.canton.version.VersionedMessage instead.
- final case class MinProtocolError(server: ProtocolVersion, clientMinimumProtocolVersion: Option[ProtocolVersion], clientSupportsRequiredVersion: Boolean) extends HandshakeError with Product with Serializable
- final case class ParticipantProtocolVersion(version: ProtocolVersion) extends Product with Serializable
Wrapper around a ProtocolVersion so we can verify during configuration loading that participant operators only configure a minimum ProtocolVersion in com.digitalasset.canton.participant.config.LocalParticipantConfig which is supported by the corresponding participant release.
- final case class ProtocolVersion(major: Int, minor: Int, patch: Int, optSuffix: Option[String] = None) extends CantonVersion with Product with Serializable
A Canton protocol version is a snapshot of how the Canton protocols, that nodes use to communicate, function at a certain point in time (e.g., this ‘snapshot’ contains the information what exactly a
SubmissionRequest
to the sequencer looks like and how exactly a Sequencer handles a call of theSendAsync
RPC).A Canton protocol version is a snapshot of how the Canton protocols, that nodes use to communicate, function at a certain point in time (e.g., this ‘snapshot’ contains the information what exactly a
SubmissionRequest
to the sequencer looks like and how exactly a Sequencer handles a call of theSendAsync
RPC). It is supposed to capture everything that is involved in two different Canton nodes interacting with each other.The protocol version is important for ensuring we meet our compatibility guarantees such that we can
- update systems running older Canton versions
- migrate data from older versions in the database
- communicate with Canton nodes of different releases
We identify protocol versions through a major, minor and patch digit. Technically, each functional change to a protocol version is a breaking change in the sense of semantic versioning and thus should lead to a major version according to SemVer. To communicate in a more practical, still semantic-versioning-adjacent manner, which protocol versions a certain Canton node supports, each Canton node documents the highest protocol it supports and also supports all previous protocol versions (of the same major version). For example, if the latest protocol version is 1.2.0, and the previous protocol versions are 1.0.0, 1.1.0, and 1.1.1, then a Canton component that exposes protocol version 1.2.0 as highest protocol version also supports 1.0.0, 1.1.0, and 1.1.1.
We say that two protocol versions are compatible if they share the same major version (e.g. 1.3 and 1.7 are compatible, 1.3 and 2.2 are not). If two Canton nodes have a protocol version which is compatible, they can transact and interact with each-other (using one of the protocol versions they share). Two Canton nodes coming from the same release are always guaranteed to be compatible in such a way.
For more details, please refer to the versioning documentation in the user manual.
- final case class ReleaseVersion(major: Int, minor: Int, patch: Int, optSuffix: Option[String] = None) extends CantonVersion with Product with Serializable
This class represent a release version.
This class represent a release version. Please refer to the versioning documentation in the user manual for details.
- final case class UntypedVersionedMessage(wrapper: Wrapper, version: Int) extends GeneratedMessage with Updatable[UntypedVersionedMessage] with Product with Serializable
UntypedVersionedMessage
is the generic wrapper for versioned messages The version is included in theversion
integer and the serialized message is contained indata
.UntypedVersionedMessage
is the generic wrapper for versioned messages The version is included in theversion
integer and the serialized message is contained indata
.Internally, we use the typed alias
VersionedMessage[ValueClass]
to avoid the risk of confusion between different proto versioned messaged (see, e.g., the return type of theHasVersionedWrapper.toProtoVersioned
method).The
oneof
prevents the serialized message to be empty ifdata
is empty andversion
is 0 (the default value for an integer). Such an empty message cannot be deserialized using previous version of our parsing method.- Annotations
- @SerialVersionUID()
- final case class VersionNotSupportedError(server: ProtocolVersion, clientSupportedVersions: Seq[ProtocolVersion]) extends HandshakeError with Product with Serializable
- type VersionedMessage[+M] = version.VersionedMessageImpl.VersionedMessage[M]
- sealed abstract class VersionedMessageImpl extends AnyRef
Value Members
- object CantonVersion
- object DomainProtocolVersion extends Serializable
- object ParticipantProtocolVersion extends Serializable
- object ProtocolVersion extends CompanionTrait with Serializable
- object ReleaseVersion extends CompanionTrait with Serializable
- object UntypedVersionedMessage extends GeneratedMessageCompanion[UntypedVersionedMessage]
- object UntypedVersionedMessageProto extends GeneratedFileObject
- object VersionedMessage
- object VersionedMessageImpl