package canton
- Alphabetic
- By Inheritance
- canton
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Package Members
- package admin
- package buildinfo
- package caching
- package cli
- package common
- package concurrent
- package config
- package console
General
console
utilities - package crypto
- package data
- package demo
- package domain
- package environment
- package error
- package examples
- package external
- package health
- package ledger
- package lifecycle
- package logging
- package metrics
- package microbench
- package networking
- package participant
- package platform
Type aliases used throughout the package
- package protobuf
- package protocol
Provides shorthands for general purpose types.
Provides shorthands for general purpose types.
Most notably, it provides a facade for Daml-LF transactions and nodes. By default, code should access Daml-LF transaction and nodes types through this facade.
- package pruning
- package replica
- package resource
- package scheduler
- package sequencing
- package serialization
- package store
- package telemetry
- package time
- package topology
- package tracing
- package traffic
- package util
- package v0
- package version
Type Members
- final case class ApplicationId(id: LedgerApplicationId) extends PrettyPrinting with Product with Serializable
Application identifier for identifying customer applications in the ledger api
Application identifier for identifying customer applications in the ledger api
- id
ledger string representing application
- abstract class CantonAppDriver[E <: Environment] extends App with NamedLogging with NoTracing
The Canton main application.
The Canton main application.
Starts a set of domains and participant nodes.
- sealed trait CantonScript extends AnyRef
- final case class CantonScriptFromFile(scriptPath: File) extends CantonScript with Product with Serializable
- final case class CommandId(id: LfLedgerString) extends PrettyPrinting with Product with Serializable
Command identifier for tracking ledger commands
Command identifier for tracking ledger commands
- id
ledger string representing command
- class ConsoleInteractiveRunner[E <: Environment] extends Runner[E]
- class ConsoleScriptRunner[E <: Environment] extends Runner[E]
- implicit final class DiscardOps[A] extends AnyVal
Evaluate the expression and discard the result.
- final class DoNotDiscardLikeFuture extends Annotation with StaticAnnotation
Annotated type constructors will be treated like a scala.concurrent.Future when looking for discarded futures.
- final class DoNotTraverseLikeFuture extends Annotation with StaticAnnotation
Annotated type constructors will be treated like a scala.concurrent.Future when looking for traverse-like calls with such an applicative instance.
- final case class DomainAlias(str: String255) extends LengthLimitedStringWrapper with PrettyPrinting with Product with Serializable
Participant local identifier used to refer to a Domain without the need to fetch identifying information from a domain.
Participant local identifier used to refer to a Domain without the need to fetch identifying information from a domain. This does not need to be globally unique. Only unique for the participant using it.
- str
String with given alias
- final case class FutureTransformer(transformedTypeArgumentPosition: Int) extends Annotation with StaticAnnotation with Product with Serializable
Annotation for computation transformer type constructors (e.g., a monad transformer) so that if it will be treated future-like when applied to a future-like computation type.
Annotation for computation transformer type constructors (e.g., a monad transformer) so that if it will be treated future-like when applied to a future-like computation type.
- transformedTypeArgumentPosition
The type argument position for the computation type that is transformed
- type LedgerApplicationId = daml.lf.data.IdString.ApplicationId
- type LedgerCommandId = LedgerString
- type LedgerConfiguration = Configuration
- type LedgerParticipantId = ParticipantId
- type LedgerSubmissionId = LedgerString
- type LedgerTransactionId = LedgerString
- type LfChoiceName = Name
- type LfCommand = ReplayCommand
- type LfCreateCommand = Create
- type LfExerciseByKeyCommand = ExerciseByKey
- type LfExerciseCommand = Exercise
- type LfFetchByKeyCommand = FetchByKey
- type LfFetchCommand = Fetch
- type LfInterfaceId = Identifier
- type LfKeyResolver = Map[GlobalKey, KeyMapping]
- type LfLedgerString = LedgerString
- type LfLookupByKeyCommand = LookupByKey
- type LfPackageId = PackageId
- type LfPartyId = Party
- type LfTimestamp = Timestamp
- type LfValue = Value
- type LfVersioned[T] = Versioned[T]
- type LfWorkflowId = LedgerString
- sealed trait ProtoDeserializationError extends Product with Serializable
- type RequestCounter = Counter[RequestCounterDiscriminator]
- abstract type RequestCounterDiscriminator
The counter assigned by the transaction processor to confirmation and transfer requests.
- implicit final class RichRequestCounter extends AnyVal
- trait Runner[E <: Environment] extends NamedLogging
Result for exposing the process exit code.
Result for exposing the process exit code. All logging is expected to take place inside of the runner.
- final case class SequencerAlias extends LengthLimitedStringWrapper with PrettyPrinting with Product with Serializable
Class representing a SequencerAlias.
Class representing a SequencerAlias.
A SequencerAlias serves as a shorthand, or 'nickname', for a particular sequencer or group of Highly Available (HA) replicas of a sequencer within a specific node.
Note: - SequencerAlias is a node-local concept. This means that two different participants may assign different aliases to the same sequencer or group of HA sequencer replicas.
- The uniqueness of a SequencerAlias is only enforced within a given domain ID. This means a node can use the same sequencer alias for different sequencers as long as these sequencers belong to different domains.
- type SequencerCounter = Counter[SequencerCounterDiscriminator]
- abstract type SequencerCounterDiscriminator
The counter assigned by the sequencer to messages sent to the participant.
The counter assigned by the sequencer to messages sent to the participant. The counter is specific to every participant.
- class ServerRunner[E <: Environment] extends Runner[E] with NoTracing
- type TransferCounter = Counter[TransferCounterDiscriminator]
- abstract type TransferCounterDiscriminator
The counter assigned to a contract to count the number of its transfers
- type TransferCounterO = Option[TransferCounter]
A transfer counter if available.
A transfer counter if available. Transfer counters are defined from protocol version com.digitalasset.canton.version.ProtocolVersion.dev on
- final case class WorkflowId(id: LfWorkflowId) extends PrettyPrinting with Product with Serializable
Workflow identifier for identifying customer workflows, i.e.
Workflow identifier for identifying customer workflows, i.e. individual requests, in the ledger api
- id
ledger string representing workflow
Value Members
- val LedgerApplicationId: daml.lf.data.Ref.ApplicationId.type
- val LedgerCommandId: daml.lf.data.Ref.CommandId.type
- val LedgerConfiguration: Configuration.type
- val LedgerParticipantId: ParticipantId.type
- val LedgerSubmissionId: SubmissionId.type
- val LedgerTransactionId: TransactionId.type
- val LfChoiceName: ChoiceName.type
- val LfCommand: ReplayCommand.type
- val LfCreateCommand: Create.type
- val LfExerciseByKeyCommand: ExerciseByKey.type
- val LfExerciseCommand: Exercise.type
- val LfFetchByKeyCommand: FetchByKey.type
- val LfFetchCommand: Fetch.type
- val LfInterfaceId: TypeConName.type
- val LfLedgerString: LedgerString.type
- val LfLookupByKeyCommand: LookupByKey.type
- val LfPackageId: PackageId.type
- val LfPartyId: Party.type
- val LfTimestamp: Timestamp.type
- val LfValue: Value.type
- val LfVersioned: Versioned.type
- val LfWorkflowId: daml.lf.data.Ref.WorkflowId.type
- val SequencerCounter: CounterCompanion[SequencerCounterDiscriminator]
- def checked[A](x: => A): A
Wrap a method call with this method to document that the caller is sure that the callee's preconditions are met.
- implicit val lfPartyOrdering: Ordering[LfPartyId]
- object ApplicationId extends Serializable
- object CantonCommunityApp extends CantonAppDriver[CommunityEnvironment]
- object CantonEnterpriseApp extends CantonAppDriver[EnterpriseEnvironment]
- object CantonResearchApp extends CantonAppDriver[ResearchEnvironment]
- object CommandId extends Serializable
- object ConsoleScriptRunner extends NoTracing
- object DiscardedFuture extends WartTraverser
Flags statements that return a scala.concurrent.Future.
Flags statements that return a scala.concurrent.Future. Typically, we should not discard scala.concurrent.Future because exceptions inside the future may not get logged. Use
FutureUtil.doNotAwait
to log exceptions and discard the future where necessary.Also detects discarded cats.data.EitherT
[
scala.concurrent.Future, ..., ...]
and cats.data.OptionT[
scala.concurrent.Future, ...]
and arbitrary nestings of those. Custom type constructors can be registered to take the same role as scala.concurrent.Future by annotating the type definition with DoNotDiscardLikeFuture.Also flags usages of scala.collection.IterableOnceOps.foreach and scala.collection.IterableOnceOps.tapEach where the function returns a future-like type.
This wart is a special case of the warts
NonUnitStatements
and NonUnitForEach and scalac's-Wnonunit-statement
flag, in that it warns only if the return type is future-like. Additionally, this wart uses a different set of exceptions when no warning is issued. We keep this specialized wart for two reasons: 1. It is not practically feasible to use-Wnonunit-statement
and NonUnitForEach in scalatest because it would flag many of the assertions of the formx should be >= y
in statement positions. Yet, it is important to check for discarded futures in tests because a discarded future may hide an exception. 2. In some production code, it is convenient to suppress the warnings coming from-Wnonunit-statement
and NonUnitForEach, just due to how the code is written. In such places, we still want to benefit from the explicit checks against discarded futures.This wart does not look at futures that are discarded at the end of a unit-type expression. These cases are caught by
-Ywarn-value-discard
. We do not implement a specialized version for future-like values because we do not expect to suppress the warnings coming from-Ywarn-value-discard
. - object DomainAlias extends LengthLimitedStringWrapperCompanion[String255, DomainAlias] with Serializable
- object FutureLikeTester
- object FutureTraverse extends WartTraverser
Cats' traverse and sequence methods do not specify the evaluation behaviour and this behaviour has changed between minor versions (e.g., 2.6 and 2.7).
Cats' traverse and sequence methods do not specify the evaluation behaviour and this behaviour has changed between minor versions (e.g., 2.6 and 2.7). When we traverse over containers, we should therefore be explicit whether the traversal is parallel or sequential. This wart flags all usages of Cats' syntax extensions for future-like applicatives, except when used with the singleton containers scala.Option and scala.Either.
Limitations: - It does not flag traverse calls whose applicative instance is more general and can be instantiated with a future-like instance.
- object GlobalExecutionContext extends WartTraverser
The global execution context scala.concurrent.ExecutionContext.global should be avoided because it is integrated with neither of the following: - Canton's error reporting - execution context supervision - thread count configuration - the workarounds for the bugs in the ForkJoinPool Moreover, if it is used in tests, the tests may interfere in unexpected ways.
The global execution context scala.concurrent.ExecutionContext.global should be avoided because it is integrated with neither of the following: - Canton's error reporting - execution context supervision - thread count configuration - the workarounds for the bugs in the ForkJoinPool Moreover, if it is used in tests, the tests may interfere in unexpected ways.
For unit tests, mix in the traits
com.daml.resources.HasExecutionContext
orcom.digitalasset.canton.HasExecutorService
, which provide a suitably configured scala.concurrent.ExecutionContext. For integration tests, an execution context should already be in scope. In production code, properly pass the right scala.concurrent.ExecutionContext into where it is needed. Create a new one usingcom.digitalasset.canton.concurrent.Threading
if absolutely necessary.For similar reasons, the scala.concurrent.ExecutionContext.parasitic should not be used. Use
com.digitalasset.canton.concurrent.DirectExecutionContext
instead.scala.concurrent.ExecutionContext.opportunistic should be avoided as well, but given that scala.concurrent.ExecutionContext.opportunistic is private to the scala package, this wart does not check for it.
- object NonUnitForEach extends WartTraverser
This wart warns when methods scala.collection.IterableOnceOps.foreach and scala.collection.IterableOnceOps.tapEach are used with non-unit valued functions.
This wart warns when methods scala.collection.IterableOnceOps.foreach and scala.collection.IterableOnceOps.tapEach are used with non-unit valued functions. This is needed because these methods' signature accepts any-valued functions. So
-Ywarn-value-discard
does not warn about such discarded values.scala.collection.IterableOnceOps.foreach is also used in
for
loops without yield and therefore also covers cases such asfor { x <- 1 to 10 } { x + 5 }
.Builder operations such as
b += ...
are identified by their return typethis.type
and ignored when checking for non-unit return values. This allows common usages such asfor { x <- 1 to 10 } { b += x }
andfor { x <- 1 to 10 } { if (x % 2 == 0) b += x }
. This does not work for all usages though; you can force aUnit
type by specifying the type argument of scala.collection.IterableOnceOps.foreach and scala.collection.IterableOnceOps.tapEach as in(1 to 10).foreach[Unit] { ... }
, or by ascribingUnit
as in(1 to 10).foreach { x => f(x): Unit }
, or by explicitly discarding the result:(1 to 10).foreach { x => f(x).discard }
. - object ProtoDeserializationError extends ProtoDeserializationErrorGroup with Serializable
- object RequestCounter extends CounterCompanion[RequestCounterDiscriminator]
- object RequireBlocking extends WartTraverser
All blocking method calls should be wrapped in scala.concurrent.blocking so that the execution context knows that it may have to spawn a new process.
All blocking method calls should be wrapped in scala.concurrent.blocking so that the execution context knows that it may have to spawn a new process.
This wart checks that all @{code synchronized} calls are surrounded immediately by a scala.concurrent.blocking call. It also complains about calls to java.lang.Thread
.sleep
asThreading.sleep
should be used instead.The logic can currently be fooled by renaming
synchronized
andsleep
. - object SequencerAlias extends LengthLimitedStringWrapperCompanion[String255, SequencerAlias] with Serializable
- object SlickString extends WartTraverser
The DB may truncate strings of unbounded length.
The DB may truncate strings of unbounded length. Therefore, this wart flags the following:
- Calls to slick.jdbc.PositionedParameters.setString
- Calls to slick.jdbc.PositionedParameters.setStringOption
- References to slick.jdbc.SetParameter.SetString
- References to slick.jdbc.SetParameter.SetStringOption
This includes references generated by the string interpolators
sql
andsqlu
- object TransferCounter extends CounterCompanion[TransferCounterDiscriminator]
- object WorkflowId extends Serializable