Packages

package sequencing

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. sequencing
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Package Members

  1. package authentication
  2. package channel
  3. package client
  4. package handlers
  5. package protocol
  6. package traffic

Type Members

  1. trait ApplicationHandler[-Box[+_ <: Envelope[_]], -Env <: Envelope[_]] extends (BoxedEnvelope[Box, Env]) => HandlerResult

    An application handler processes boxed envelopes and returns a HandlerResult

  2. class ApplicationHandlerPekko[F[+_], Context] extends NamedLogging

    Converts an com.digitalasset.canton.sequencing.ApplicationHandler into a Pekko flow.

  3. final case class AsyncResult[T](unwrap: FutureUnlessShutdown[T]) extends Product with Serializable

    The asynchronous part of processing an event (or of a stage of its processing).

    The asynchronous part of processing an event (or of a stage of its processing).

    Annotations
    @DoNotDiscardLikeFuture()
  4. type BoxedEnvelope[+Box[+_ <: Envelope[_]], +Env <: Envelope[_]] = Box[Env]

    It is convenient to consider the envelopes and all the structure around the envelopes (the box).

    It is convenient to consider the envelopes and all the structure around the envelopes (the box). EnvelopeBox defines type class operations to manipulate

  5. class ConnectionValidationLimiter extends AutoCloseable with NamedLogging

    Small state machine to handle potential bursts of validations caused by rapidly flipping states of the underlying connection.

    Small state machine to handle potential bursts of validations caused by rapidly flipping states of the underlying connection. If a validation is requested while one is being run, we schedule a new validation to start when the current one completes. Extra requests are collapsed into this single scheduling.

                     request                       request
    ┌───────────┐   validation   ┌───────────┐    validation    ┌───────────┐
    │   IDLE    ├────────────────►VALIDATING ├──────────────────►VALIDATION ├────┐
    ├───────────┤                ├───────────┤                  │  PENDING  │    │ request
    │           │                │ on entry/ │                  ├───────────┤    │validation
    │           │                │   start   │                  │           │    │
    │           ◄────────────────┤validation ◄──────────────────┤           ◄────┘
    └───────────┘   validation   └───────────┘    validation    └───────────┘
                     complete                      complete
  6. trait ConnectionX extends FlagCloseable with NamedLogging

    A generic connection.

    A generic connection. This trait attempts to be independent of the underlying transport.

    NOTE: We currently make only a minimal effort to keep transport independence, and there are obvious leaks. This will be extended when we need it.

  7. class DelayLogger extends AnyRef

    Wrapper for a sequencer subscription event handler that will log warnings if the timestamps of received messages appear significantly behind this consumer's clock.

  8. trait EnvelopeBox[Box[+_ <: Envelope[_]]] extends AnyRef

    Type class to manipulate envelopes inside their box.

    Type class to manipulate envelopes inside their box. Specializes cats.Traverse to protocol.Envelope arguments.

  9. final case class GrpcConnectionX(config: ConnectionXConfig, timeouts: ProcessingTimeout, loggerFactory: NamedLoggerFactory)(implicit ec: ExecutionContextExecutor) extends ConnectionX with PrettyPrinting with Product with Serializable

    Connection specialized for gRPC transport.

  10. class GrpcInternalSequencerConnectionX extends InternalSequencerConnectionX with PrettyPrinting with GrpcClientTransportHelpers

    Sequencer connection specialized for gRPC transport.

  11. class GrpcInternalSequencerConnectionXFactory extends InternalSequencerConnectionXFactory
  12. final case class GrpcSequencerConnection(endpoints: NonEmpty[Seq[Endpoint]], transportSecurity: Boolean, customTrustCertificates: Option[ByteString], sequencerAlias: SequencerAlias) extends SequencerConnection with Product with Serializable
  13. class GrpcSequencerConnectionX extends SequencerConnectionX with PrettyPrinting with GrpcClientTransportHelpers

    Sequencer connection specialized for gRPC transport.

  14. class GrpcSequencerConnectionXStub extends SequencerConnectionXStub

    Stub to interact with a sequencer, specialized for gRPC transport.

  15. class GrpcUserSequencerConnectionXStub extends UserSequencerConnectionXStub

    Stub for user interactions with a sequencer, specialized for gRPC transport.

  16. type HandlerResult = FutureUnlessShutdown[AsyncResult[Unit]]

    A handler processes an event synchronously in the scala.concurrent.Future and returns an AsyncResult that may be computed asynchronously by the contained future.

    A handler processes an event synchronously in the scala.concurrent.Future and returns an AsyncResult that may be computed asynchronously by the contained future. Asynchronous processing may run concurrently with later events' synchronous processing and with asynchronous processing of other events.

  17. trait InternalSequencerConnectionX extends FlagCloseable with NamedLogging

    A generic connection to a sequencer.

    A generic connection to a sequencer. This trait attempts to be independent of the underlying transport.

    This is an internal class used by the connection pool. Other components are expected to interact with the sequencer using the higher-level SequencerConnectionX.

    NOTE: We currently make only a minimal effort to keep transport independence, and there are obvious leaks. This will be extended when we need it.

  18. trait InternalSequencerConnectionXFactory extends AnyRef
  19. type OrdinaryApplicationHandler[-E <: Envelope[_]] = ApplicationHandler[OrdinaryEnvelopeBox, E]
  20. type OrdinaryEnvelopeBox[+E <: Envelope[_]] = Traced[Seq[OrdinarySequencedEvent[E]]]

    Default box for signed batches of events The outer Traced contains a trace context for the entire batch.

  21. type OrdinaryEventHandler[Err] = (OrdinarySerializedEvent) => FutureUnlessShutdown[Either[Err, Unit]]

    Default type for handlers on serialized events with error reporting

  22. type OrdinaryEventOrError = Either[SequencedEventError, OrdinarySerializedEvent]
  23. type OrdinaryEventOrErrorHandler[Err] = (OrdinaryEventOrError) => FutureUnlessShutdown[Either[Err, Unit]]
  24. type OrdinaryProtocolEvent = OrdinarySequencedEvent[DefaultOpenEnvelope]
  25. type OrdinarySerializedEvent = OrdinarySequencedEvent[ClosedEnvelope]
  26. type PossiblyIgnoredApplicationHandler[-E <: Envelope[_]] = ApplicationHandler[PossiblyIgnoredEnvelopeBox, E]
  27. type PossiblyIgnoredEnvelopeBox[+E <: Envelope[_]] = Traced[Seq[PossiblyIgnoredSequencedEvent[E]]]

    Default box for PossiblyIgnoredProtocolEvents.

    Default box for PossiblyIgnoredProtocolEvents. The outer Traced contains a trace context for the entire batch.

  28. type PossiblyIgnoredProtocolEvent = PossiblyIgnoredSequencedEvent[DefaultOpenEnvelope]

    Deserialized event with optional payload.

  29. type PossiblyIgnoredSerializedEvent = PossiblyIgnoredSequencedEvent[ClosedEnvelope]
  30. type ProcessingSerializedEvent = ProcessingSequencedEvent[ClosedEnvelope]

    Default type for serialized events.

    Default type for serialized events. Contains trace context and signature.

  31. type RawProtocolEvent = SequencedEvent[DefaultOpenEnvelope]

    Default type for deserialized events.

    Default type for deserialized events. The term "raw" indicates that the trace context is missing. Try to use TracedProtocolEvent instead.

  32. type RawSignedContentEnvelopeBox[+Env <: Envelope[_]] = SignedContent[SequencedEvent[Env]]

    Just a signature around the com.digitalasset.canton.sequencing.protocol.SequencedEvent The term "raw" indicates that the trace context is missing.

    Just a signature around the com.digitalasset.canton.sequencing.protocol.SequencedEvent The term "raw" indicates that the trace context is missing. Try to use the box OrdinarySerializedEvent instead.

  33. sealed trait ResubscriptionStart extends SubscriptionStart

    The subscription is a resubscription.

    The subscription is a resubscription. The application handler may have previously been called with an event.

  34. type SequencedApplicationHandler[-E <: Envelope[_]] = ApplicationHandler[SequencedEnvelopeBox, E]
  35. type SequencedEnvelopeBox[+E <: Envelope[_]] = Traced[Seq[SequencedEventWithTraceContext[E]]]
  36. type SequencedEventHandler[Err] = (SequencedSerializedEvent) => FutureUnlessShutdown[Either[Err, Unit]]
  37. class SequencedEventMonotonicityChecker extends NamedLogging

    Checks that the sequenced events' stream is gap-free:

    Checks that the sequenced events' stream is gap-free:

    • We expect event timestamps to be monotonically increasing
    • The sequence should start with previousTimestamp = None.
    • For each subsequent event, we expect previousTimestamp to be set to the timestamp of the previous event.
    • When a violation is detected, an error is logged and the processing is aborted.

    This is normally ensured by the com.digitalasset.canton.sequencing.client.SequencedEventValidator for individual sequencer subscriptions. However, due to aggregating multiple subscriptions from several sequencers up to a threshold, the stream of events emitted by the aggregation may violate monotonicity. This additional monotonicity check ensures that we catch such violations before we pass the events downstream.

  38. type SequencedEventOrError = Either[SequencedEventError, SequencedSerializedEvent]
  39. type SequencedEventOrErrorHandler[Err] = (SequencedEventOrError) => FutureUnlessShutdown[Either[Err, Unit]]
  40. type SequencedProtocolEvent = SequencedEventWithTraceContext[DefaultOpenEnvelope]

    Default type for deserialized events.

    Default type for deserialized events. Includes a signature and a trace context.

  41. type SequencedSerializedEvent = SequencedEventWithTraceContext[ClosedEnvelope]
  42. class SequencerAggregator extends NamedLogging with FlagCloseable
  43. class SequencerAggregatorPekko extends NamedLogging

    Aggregates sequenced events from a dynamically configurable set of com.digitalasset.canton.sequencing.client.SequencerSubscriptionPekkos until a configurable threshold is reached.

  44. class SequencerClientRecorder extends FlagCloseable with NamedLogging

    Record interactions that the Sequencer client has with its synchronizer.

    Record interactions that the Sequencer client has with its synchronizer. If enabled will record sends to the Sequencer and events received from the Sequencer subscription. Callers must call start with a path for recording before recording sequencer interactions.

  45. sealed trait SequencerConnection extends PrettyPrinting

    Our com.digitalasset.canton.config.ClientConfig provides the static configuration of API connections between console and nodes, and between synchronizer members via the config files.

    Our com.digitalasset.canton.config.ClientConfig provides the static configuration of API connections between console and nodes, and between synchronizer members via the config files. Participants however can connect to multiple synchronizers and sequencers, and the configuration of these connections is more dynamic. The structures below are used to represent the dynamic configuration of how a participant connects to a sequencer.

  46. sealed trait SequencerConnectionValidation extends AnyRef
  47. trait SequencerConnectionX extends FlagCloseable with NamedLogging

    A connection to a sequencer.

    A connection to a sequencer. This trait attempts to be independent of the underlying transport.

    NOTE: We currently make only a minimal effort to keep transport independence, and there are obvious leaks. This will be extended when we need it.

  48. trait SequencerConnectionXPool extends FlagCloseable with NamedLogging

    Pool of sequencer connections.

    Pool of sequencer connections.

    The pool is initialized with a configuration describing the individual connections information (endpoint, TLS, etc.) and a trust threshold.

    The connections information can combine connections to different logical sequencers (sequencer ID) as well as multiple endpoints for the same logical sequencer, which allows for high-availability for a given sequencer. The contents of the pool then distinguishes between the number of logical sequencers represented nbSequencers and the number of individual connections nbConnections.

    The trust threshold has the following functions:

    • It represents the number of connections (to different logical sequencers) that must be validated (see com.digitalasset.canton.sequencing.InternalSequencerConnectionX.SequencerConnectionXState.Validated) and agree on bootstrap information (synchronizer ID, static parameters) before the pool is initialized and starts serving connections.
    • It is the threshold determining the pool's health. After initialization and during the life of the pool, connections will be removed as they fail and added as they recover. The pool is then considered healthy if the number of connections (to different logical sequencers) is >= the threshold, degraded if it is below, and failing if it reaches 0.

    The configuration can also optionally define an expected com.digitalasset.canton.topology.SynchronizerId. If defined, any connection that does not report connecting to that synchronizer will be rejected. If undefined, the synchronizer ID will be determined by consensus once trust-threshold-many connections (to different logical sequencers) report the same synchronizer.

  49. class SequencerConnectionXPoolImpl extends SequencerConnectionXPool
  50. trait SequencerConnectionXStub extends AnyRef

    A generic stub to interact with a sequencer.

    A generic stub to interact with a sequencer. This trait attempts to be independent of the underlying transport.

    NOTE: We currently make only a minimal effort to keep transport independence, and there are obvious leaks. This will be extended when we need it.

  51. trait SequencerConnectionXStubFactory extends AnyRef
  52. final case class SequencerConnections extends HasVersionedWrapper[SequencerConnections] with PrettyPrinting with Product with Serializable
  53. trait SequencerSubscriptionPool extends FlagCloseable with NamedLogging

    Pool of sequencer subscriptions.

    Pool of sequencer subscriptions.

    The purpose of this pool is to obtain sequencer connections and start subscriptions on them, trying to maintain a number of live subscriptions sufficient to satisfy the trust requirements.

    More precisely, it strives to maintain at least as many subscriptions as the trust threshold. In order to ensure liveness and not run under the trust threshold as soon as a subscription fails, it maintains a few extra subscriptions, defined as the liveness margin. On the other end, it does not maintain as many subscriptions as possible (i.e. all available connections) in order to limit the network traffic.

    This pool's health is determined as follows:

    • it is healthy if the number of subscriptions is at least the trust threshold + the liveness margin;
    • it is degraded if the number of subscriptions is at least the trust threshold, but there are fewer extra subscriptions than the liveness margin;
    • it is failing if the number of subscriptions is below the trust threshold.
  54. final class SequencerSubscriptionPoolImpl extends SequencerSubscriptionPool
  55. final case class SubmissionRequestAmplification(factor: PositiveInt, patience: NonNegativeFiniteDuration) extends PrettyPrinting with Product with Serializable

    Configures the submission request amplification.

    Configures the submission request amplification. Amplification makes sequencer clients send eligible submission requests to multiple sequencers to overcome message loss in faulty sequencers.

    factor

    The maximum number of times the submission request shall be sent.

    patience

    How long the sequencer client should wait after an acknowledged submission to a sequencer to observe the receipt or error before it attempts to send the submission request again (possibly to a different sequencer).

  56. sealed trait SubscriptionStart extends Product with Serializable with PrettyPrinting

    Information passed by the com.digitalasset.canton.sequencing.client.SequencerClient to the ApplicationHandler where the subscription (= processing of events) starts.

    Information passed by the com.digitalasset.canton.sequencing.client.SequencerClient to the ApplicationHandler where the subscription (= processing of events) starts. The ApplicationHandler can then initialize itself appropriately.

  57. type TracedProtocolEvent = WithCounter[Traced[RawProtocolEvent]]

    Deserialized event with a trace context.

    Deserialized event with a trace context. Use this when you are really sure that a signature will never be needed.

  58. final case class TrafficControlParameters(maxBaseTrafficAmount: NonNegativeLong = DefaultBaseTrafficAmount, readVsWriteScalingFactor: PositiveInt = DefaultReadVsWriteScalingFactor, maxBaseTrafficAccumulationDuration: PositiveFiniteDuration = DefaultMaxBaseTrafficAccumulationDuration, setBalanceRequestSubmissionWindowSize: PositiveFiniteDuration = DefaultSetBalanceRequestSubmissionWindowSize, enforceRateLimiting: Boolean = DefaultEnforceRateLimiting, baseEventCost: NonNegativeLong = DefaultBaseEventCost) extends PrettyPrinting with Product with Serializable

    Traffic control configuration values - stored as dynamic synchronizer parameters

    Traffic control configuration values - stored as dynamic synchronizer parameters

    maxBaseTrafficAmount

    maximum amount of bytes per maxBaseTrafficAccumulationDuration acquired as "free" traffic per member

    readVsWriteScalingFactor

    multiplier used to compute cost of an event. In per ten-mil (1 / 10 000). Defaults to 200 (=2%). A multiplier of 2% means the base cost will be increased by 2% to produce the effective cost.

    maxBaseTrafficAccumulationDuration

    maximum amount of time the base rate traffic will accumulate before being capped The minimum granularity is one microsecond. Values below will be rounded up to one microsecond.

    setBalanceRequestSubmissionWindowSize

    time window used to compute the max sequencing time set for balance update requests The max sequencing time chosen will be the upper bound of the time window at which the request is submitted

  59. type UnsignedApplicationHandler[-E <: Envelope[_]] = ApplicationHandler[UnsignedEnvelopeBox, E]
  60. type UnsignedEnvelopeBox[+E <: Envelope[_]] = Traced[Seq[WithCounter[Traced[SequencedEvent[E]]]]]

    A batch of traced protocol events (without a signature) with the assigned counter.

    A batch of traced protocol events (without a signature) with the assigned counter. The outer Traced contains a trace context for the entire batch.

  61. type UnsignedProtocolEventHandler = ApplicationHandler[UnsignedEnvelopeBox, DefaultOpenEnvelope]
  62. trait UserSequencerConnectionXStub extends AnyRef

    A generic stub for user interactions with a sequencer.

    A generic stub for user interactions with a sequencer. This trait attempts to be independent of the underlying transport.

    NOTE: We currently make only a minimal effort to keep transport independence, and there are obvious leaks. This will be extended when we need it.

  63. final case class WithCounter[+WrappedElement](counter: SequencerCounter, element: WrappedElement) extends Product with Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped