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.
- 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.
- final case class EthereumContractVersion(major: Int, minor: Int, patch: Int, optSuffix: Option[String] = None) extends Product with Serializable
This class represents a revision of the Sequencer.sol contract.
- sealed trait HandshakeError extends AnyRef
Trait for errors that are returned to clients when handshake fails.
- type HasMemoizedProtocolVersionedWithContextCompanion[ValueClass <: HasRepresentativeProtocolVersion, Context] = HasMemoizedProtocolVersionedWithContextCompanion2[ValueClass, ValueClass, Context]
- trait HasMemoizedProtocolVersionedWithContextCompanion2[ValueClass <: HasRepresentativeProtocolVersion, DeserializedValueClass, Context] extends HasProtocolVersionedWrapperCompanion[ValueClass, DeserializedValueClass]
Trait for companion objects of serializable classes with memoization and a (de)serialization context.
Trait for companion objects of serializable classes with memoization and a (de)serialization context. Use this class if deserialization produces a different type than where serialization starts. For example, if a container can serialize its elements, but the container's deserializer does not deserialize the elements and instead leaves them as Bytestring.
Use HasMemoizedProtocolVersionedWithContextCompanion if the type distinction between serialization and deseserialization is not needed.
- type HasMemoizedProtocolVersionedWrapperCompanion[ValueClass <: HasRepresentativeProtocolVersion] = HasMemoizedProtocolVersionedWrapperCompanion2[ValueClass, ValueClass]
- trait HasMemoizedProtocolVersionedWrapperCompanion2[ValueClass <: HasRepresentativeProtocolVersion, DeserializedValueClass] extends HasProtocolVersionedWrapperWithoutContextCompanion[ValueClass, DeserializedValueClass]
Trait for companion objects of serializable classes with memoization.
Trait for companion objects of serializable classes with memoization. Use this class if deserialization produces a different type than where serialization starts. For example, if a container can serialize its elements, but the container's deserializer does not deserialize the elements and instead leaves them as Bytestring.
Use HasMemoizedProtocolVersionedWrapperCompanion if the type distinction between serialization and deseserialization is not needed.
- type HasProtocolVersionedCompanion[ValueClass <: HasRepresentativeProtocolVersion] = HasProtocolVersionedCompanion2[ValueClass, ValueClass]
- trait HasProtocolVersionedCompanion2[ValueClass <: HasRepresentativeProtocolVersion, DeserializedValueClass] extends HasProtocolVersionedWrapperWithoutContextCompanion[ValueClass, DeserializedValueClass]
Trait for companion objects of serializable classes without memoization.
Trait for companion objects of serializable classes without memoization. Use this class if deserialization produces a different type than where serialization starts. For example, if a container can serialize its elements, but the container's deserializer does not deserialize the elements and instead leaves them as Bytestring.
Use HasProtocolVersionedCompanion if the type distinction between serialization and deseserialization is not needed.
- trait HasProtocolVersionedWithContextCompanion[ValueClass <: HasRepresentativeProtocolVersion, Context] extends HasProtocolVersionedWrapperCompanion[ValueClass, ValueClass]
- trait HasProtocolVersionedWrapper[ValueClass <: HasRepresentativeProtocolVersion] extends HasRepresentativeProtocolVersion
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.
This wrapper is to be used when every instance can be tied to a single protocol version. Consequently, some attributes of the class may depend on the protocol version (e.g., the signature). The protocol version is then bundled with the instance and does not need to be passed to the toProtoVersioned, toByteString and getCryptographicEvidence methods.
The underlying ProtoClass is com.digitalasset.canton.version.UntypedVersionedMessage but we often specify the typed alias com.digitalasset.canton.version.VersionedMessage instead.
- trait HasProtocolVersionedWrapperCompanion[ValueClass <: HasRepresentativeProtocolVersion, DeserializedValueClass] extends HasSupportedProtoVersions[ValueClass] with Serializable
- trait HasProtocolVersionedWrapperWithoutContextCompanion[ValueClass <: HasRepresentativeProtocolVersion, DeserializedValueClass] extends HasProtocolVersionedWrapperCompanion[ValueClass, DeserializedValueClass]
- trait HasRepresentativeProtocolVersion extends AnyRef
- trait HasSupportedProtoVersions[ValueClass] extends AnyRef
This trait has the logic to store proto (de)serializers and retrieve them by protocol version.
- trait HasVersionedMessageCompanion[ValueClass] extends HasVersionedMessageCompanionCommon[ValueClass]
Traits for the companion objects of classes that implement HasVersionedWrapper.
Traits for the companion objects of classes that implement HasVersionedWrapper. Provide default methods.
- trait HasVersionedMessageCompanionCommon[ValueClass] extends AnyRef
- trait HasVersionedMessageCompanionDbHelpers[ValueClass <: HasVersionedWrapper[ValueClass]] extends AnyRef
- trait HasVersionedMessageWithContextCompanion[ValueClass, Ctx] extends HasVersionedMessageCompanionCommon[ValueClass]
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). - 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[ValueClass] 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.
This wrapper is to be used if a single instance needs to be serialized to different proto versions.
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 ProtoVersion(v: Int) extends AnyVal with Product with Serializable
- sealed case class ProtocolVersion extends Ordered[ProtocolVersion] with PrettyPrinting 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
Two Canton nodes can interact if they can speak the same protocol version.
For more details, please refer to the versioning documentation in the user manual.
How to add a new protocol version
N
:- Define a new constant
v<N>
in the ProtocolVersion$ object via
lazy val v<N>: ProtocolVersionWithStatus[Unstable] = ProtocolVersion.unstable(<N>)
- The new protocol version should be declared as unstable until it is released: Define it with type argument com.digitalasset.canton.version.ProtocolVersion.Unstable and add it to the list in com.digitalasset.canton.version.ProtocolVersion.unstable.
- Add a new test job for the protocol version
N
to the canton_build workflow. Make a sensible decision how often it should run. If sensible, consider to reduce the frequency some of the other protocol version test jobs are running, e.g., by moving them to the canton_nightly job.
How to release a protocol version
N
:- Switch the type parameter of the protocol version constant
v<N>
from com.digitalasset.canton.version.ProtocolVersion.Unstable to com.digitalasset.canton.version.ProtocolVersion.Stable As a result, you may have to modify a couple of protobuf definitions and mark them as stable as well. - Remove
v<N>
from com.digitalasset.canton.version.ProtocolVersion.unstable and add it to com.digitalasset.canton.buildinfo.BuildInfo.protocolVersions. - Check the test jobs for protocol versions:
Likely
N
will become the default protocol version used by thetest
job, namely com.digitalasset.canton.version.ProtocolVersion.latest. So the separate test job forN
is no longer needed. Conversely, we now need a new job for the previous default protocol version. Usually, it is enough to run the previous version only in canton_nightly.
- trait ProtocolVersionedCompanionDbHelpers[ValueClass <: HasProtocolVersionedWrapper[ValueClass]] extends AnyRef
- final case class ReleaseProtocolVersion(v: ProtocolVersion) extends AnyVal with Product with Serializable
- 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.
- sealed abstract case class RepresentativeProtocolVersion[ValueCompanion] extends PrettyPrinting with Product with Serializable
See com.digitalasset.canton.version.HasProtocolVersionedWrapper.representativeProtocolVersion for more context
- trait StableProtoVersion extends Stable with Unstable
Marker trait for Protobuf messages generated by scalapb that are used in some stable protocol versions
Marker trait for Protobuf messages generated by scalapb that are used in some stable protocol versions
Implements both com.digitalasset.canton.version.ProtocolVersion.Stable and com.digitalasset.canton.version.ProtocolVersion.Unstable means that StableProtoVersion messages can be used in stable and unstable protocol versions.
- trait StorageProtoVersion extends AnyRef
Marker trait for Protobuf messages generated by scalapb that are used only to persist data in node storage.
Marker trait for Protobuf messages generated by scalapb that are used only to persist data in node storage. These messages are never exchanged as part of a protocol.
- trait UnstableProtoVersion extends Unstable
Marker trait for Protobuf messages generated by scalapb that are used only in unstable protocol versions
- 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 DamlLfVersionToProtocolVersions
- object DomainProtocolVersion extends Serializable
- object EthereumContractVersion extends Serializable
- object HandshakeErrors extends HandshakeErrorGroup
- object ParticipantProtocolVersion extends Serializable
- object ProtoVersion extends Serializable
- object ProtocolVersion extends Serializable
- object ProtocolVersionCompatibility
- object ReleaseProtocolVersion extends Serializable
- object ReleaseVersion extends Serializable
- object ReleaseVersionToProtocolVersions
- object ReleaseVersions
- object RepresentativeProtocolVersion extends Serializable
- object Transfer
- object UntypedVersionedMessage extends GeneratedMessageCompanion[UntypedVersionedMessage]
- object UntypedVersionedMessageProto extends GeneratedFileObject
- object VersionedMessage
- object VersionedMessageImpl