package version
- Alphabetic
- By Inheritance
- version
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- trait AlphaProtoVersion extends Alpha
Marker trait for Protobuf messages generated by scalapb that are used only alpha protocol versions
- trait BaseVersioningCompanion[ValueClass <: HasRepresentativeProtocolVersion, Context, DeserializedValueClass <: HasRepresentativeProtocolVersion, Dependency] extends AnyRef
This trait has the logic to store proto (de)serializers and retrieve them by protocol version.
This trait has the logic to store proto (de)serializers and retrieve them by protocol version.
Parameters and concepts are explained in contributing guide
- sealed trait CantonVersion extends Ordered[CantonVersion] with PrettyPrinting
Trait that represents how a version in Canton is modelled.
- type DataByteString = ByteString
- final case class DefaultValueFromInclusive[ValueClass, Comp, T](attribute: (ValueClass) => T, attributeName: String, startInclusive: RepresentativeProtocolVersion[Comp], defaultValue: T)(implicit evidence$1: ClassTag[Comp]) extends DefaultValue[ValueClass, Comp, T] with Product with Serializable
- final case class DefaultValueUntilExclusive[ValueClass, Comp, T](attribute: (ValueClass) => T, attributeName: String, untilExclusive: RepresentativeProtocolVersion[Comp], defaultValue: T)(implicit evidence$2: ClassTag[Comp]) extends DefaultValue[ValueClass, Comp, T] with Product with Serializable
- final case class EmptyOptionExactlyUntilExclusive[ValueClass, Comp, T](attribute: (ValueClass) => Option[T], attributeName: String, untilExclusive: RepresentativeProtocolVersion[Comp]) extends DefaultValue[ValueClass, Comp, Option[T]] with Product with Serializable
- sealed trait HandshakeError extends AnyRef
Trait for errors that are returned to clients when handshake fails.
- trait HasProtocolVersionedWrapper[ValueClass <: HasRepresentativeProtocolVersion] extends HasRepresentativeProtocolVersion with HasToByteString
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.v1.UntypedVersionedMessage but we often specify the typed alias com.digitalasset.canton.version.VersionedMessage instead.
- Annotations
- @SuppressWarnings()
- trait HasRepresentativeProtocolVersion extends AnyRef
- trait HasToByteString 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.
Typically, these classes also implement the HasProtocolVersionedWrapper trait. Such classes embed logic together with a representative protocol version that determines the ProtoBuf serialization and deserialization. Hence, HasToByteString.toByteString does not take any arguments. In contrast, HasVersionedToByteString is tailored towards another ProtoBuf serialization/deserialization tooling.
See "README.md" for our guidelines on the (de-)serialization tooling.
- 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.
- 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.v1.UntypedVersionedMessage but we often specify the typed alias com.digitalasset.canton.version.VersionedMessage instead.
- Annotations
- @SuppressWarnings()
- sealed abstract class HashingSchemeVersion extends AnyRef
- trait Invariant[ValueClass, Comp] extends AnyRef
Invariants that an instance of
ValueClass
should respect.Invariants that an instance of
ValueClass
should respect.- ValueClass
Type of the instance
- Comp
Companion object
- final case class MinProtocolError(server: ProtocolVersion, clientMinimumProtocolVersion: Option[ProtocolVersion], clientSupportsRequiredVersion: Boolean) extends HandshakeError with Product with Serializable
- type OriginalByteString = ByteString
- final case class ParticipantProtocolVersion(version: ProtocolVersion) extends UniformCantonConfigValidation with 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.ParticipantNodeConfig which is supported by the corresponding participant release.
- sealed trait ProtoCodec[ValueClass, Context, DeserializedValueClass, Comp, Dependency] extends PrettyPrinting
Base class for (de)serializing from/to protobuf of ValueClass from a specific PV
- 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[Alpha] = ProtocolVersion.alpha(<N>)
- The new protocol version should be declared as alpha until it is released: Define it with type argument com.digitalasset.canton.version.ProtocolVersionAnnotation.Alpha and add it to the list in com.digitalasset.canton.version.ProtocolVersion.alpha.
- 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.ProtocolVersionAnnotation.Alpha to com.digitalasset.canton.version.ProtocolVersionAnnotation.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.alpha and add it to com.digitalasset.canton.buildinfo.BuildInfo.stableProtocolVersions.
How to release a protocol version
N
as Beta:- Switch the type parameter of the protocol version constant
v<N>
from com.digitalasset.canton.version.ProtocolVersionAnnotation.Alpha to com.digitalasset.canton.version.ProtocolVersionAnnotation.Beta - Remove
v<N>
from com.digitalasset.canton.version.ProtocolVersion.alpha and add it to com.digitalasset.canton.buildinfo.BuildInfo.betaProtocolVersions. - 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.
- sealed trait ProtocolVersionValidation extends Product with Serializable
Represents the synchronizer protocol version for the deserialization validation such that cases where no protocol version is defined can be clearly expressed with ProtocolVersionValidation.NoValidation.
- trait ProtocolVersionedCompanionDbHelpers[ValueClass <: HasProtocolVersionedWrapper[ValueClass]] extends AnyRef
Trait to be mixed in to have the set parameters defined in terms of the
.toByteString
- 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 Alpha
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.ProtocolVersionAnnotation.Stable and com.digitalasset.canton.version.ProtocolVersionAnnotation.Alpha means that StableProtoVersion messages can be used in stable and alpha 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.
- final case class SupportedProtoVersions[ValueClass, Context, DeserializedValueClass, Comp, Dependency] extends Product with Serializable
- final case class SynchronizerProtocolVersion(version: ProtocolVersion) extends Product with Serializable
Wrapper around a ProtocolVersion so we can verify during configuration loading that synchronizer operators only configure a ProtocolVersion which is supported by the corresponding sequencer release.
- final case class UnsupportedProtoCodec[ValueClass, Context, DeserializedValueClass, Comp] extends ProtoCodec[ValueClass, Context, DeserializedValueClass, Comp, Unit] with PrettyPrinting with Product with Serializable
- 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
- class VersionedProtoCodec[ValueClass, Context, DeserializedValueClass, Comp, Dependency] extends ProtoCodec[ValueClass, Context, DeserializedValueClass, Comp, Dependency]
Supported Proto version
- type VersioningCompanion[ValueClass <: HasRepresentativeProtocolVersion] = VersioningCompanion2[ValueClass, ValueClass]
- trait VersioningCompanion2[ValueClass <: HasRepresentativeProtocolVersion, DeserializedValueClass <: HasRepresentativeProtocolVersion] extends BaseVersioningCompanion[ValueClass, Unit, DeserializedValueClass, Unit]
- type VersioningCompanionContext[ValueClass <: HasRepresentativeProtocolVersion, Context] = VersioningCompanionContext2[ValueClass, ValueClass, Context]
- trait VersioningCompanionContext2[ValueClass <: HasRepresentativeProtocolVersion, DeserializedValueClass <: HasRepresentativeProtocolVersion, Context] extends BaseVersioningCompanion[ValueClass, Context, DeserializedValueClass, Unit]
- type VersioningCompanionContextMemoization[ValueClass <: HasRepresentativeProtocolVersion, Context] = VersioningCompanionContextMemoization2[ValueClass, Context, ValueClass, Unit]
- trait VersioningCompanionContextMemoization2[ValueClass <: HasRepresentativeProtocolVersion, Context, DeserializedValueClass <: HasRepresentativeProtocolVersion, Dependency] extends BaseVersioningCompanion[ValueClass, Context, DeserializedValueClass, Dependency]
- type VersioningCompanionContextMemoizationWithDependency[ValueClass <: HasRepresentativeProtocolVersion, Context, Dependency] = VersioningCompanionContextMemoization2[ValueClass, Context, ValueClass, Dependency]
- trait VersioningCompanionContextPVValidation2[ValueClass <: HasRepresentativeProtocolVersion, RawContext] extends VersioningCompanionContext2[ValueClass, ValueClass, (RawContext, ProtocolVersion)]
For readability, replaces the deserialization methods for value classes that require the protocol version for the deserialization validation to be passed in as part of the deserialization context.
For readability, replaces the deserialization methods for value classes that require the protocol version for the deserialization validation to be passed in as part of the deserialization context.
Replaces
.fromByteString(protocolVersion)((context, protocolVersion))(bytes)
with.fromByteString(context, protocolVersion)(bytes)
. - trait VersioningCompanionContextTaggedPVValidation2[ValueClass <: HasRepresentativeProtocolVersion, T[X] <: ReassignmentTag[X], RawContext] extends VersioningCompanionContext2[ValueClass, ValueClass, (RawContext, T[ProtocolVersion])]
Similar to VersioningCompanionContextPVValidation2 but the deserialization context contains a Source or Target of com.digitalasset.canton.version.ProtocolVersion for validation.
- type VersioningCompanionMemoization[ValueClass <: HasRepresentativeProtocolVersion] = VersioningCompanionMemoization2[ValueClass, ValueClass]
- trait VersioningCompanionMemoization2[ValueClass <: HasRepresentativeProtocolVersion, DeserializedValueClass <: HasRepresentativeProtocolVersion] extends BaseVersioningCompanion[ValueClass, Unit, DeserializedValueClass, Unit]
Value Members
- object DamlLfVersionToProtocolVersions
- object HandshakeErrors extends HandshakeErrorGroup
- object HashingSchemeVersion
- object ParticipantProtocolVersion extends Serializable
- object ProtoVersion extends Serializable
- object ProtocolVersion extends Serializable
- object ProtocolVersionAnnotation
- object ProtocolVersionCompatibility
- object ProtocolVersionValidation extends Serializable
- object ReleaseProtocolVersion extends Serializable
- object ReleaseVersion extends Serializable
- object ReleaseVersionToProtocolVersions
- object ReleaseVersions
- object RepresentativeProtocolVersion extends Serializable
- object SupportedProtoVersions extends Serializable
- object SynchronizerProtocolVersion extends Serializable
- object UnsupportedProtoCodec extends Serializable
- object VersionedMessage
- object VersionedMessageImpl
- object VersionedProtoCodec
- Annotations
- @SuppressWarnings()