package client
- Alphabetic
- By Inheritance
- client
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Package Members
- package grpc
- package transports
Type Members
- abstract class CheckedSubscriptionErrorRetryPolicy[SE <: SubscriptionError] extends SubscriptionErrorRetryPolicy
Allows implementors to only specify policy for an error hierarchy they've defined.
Allows implementors to only specify policy for an error hierarchy they've defined. Avoids adding type parameters to all sequencer client components. TODO(11067): work out if type parameters are really required and if so are they that bad
- trait DelaySequencedEvent extends AnyRef
- final case class DelayedSequencerClient(domain: DomainId, member: Member) extends DelaySequencedEvent with Product with Serializable
- final case class Fatal(msg: String) extends SequencerSubscriptionCreationError with Product with Serializable
When a fatal error occurs on the creation of a sequencer subscription, the com.digitalasset.canton.sequencing.client.ResilientSequencerSubscription will not retry the subscription creation.
When a fatal error occurs on the creation of a sequencer subscription, the com.digitalasset.canton.sequencing.client.ResilientSequencerSubscription will not retry the subscription creation. Instead, the subscription will fail.
- sealed trait GrpcSequencerAuthenticationSupport extends AnyRef
- class PeriodicAcknowledgements extends NamedLogging with FlagCloseable with HasFlushFuture
Periodically pull the latest clean timestamp and if it has changed acknowledge it with the sequencer.
Periodically pull the latest clean timestamp and if it has changed acknowledge it with the sequencer. This indicates that we have successfully processed all events up to and including this event. We always acknowledge the current clean timestamp on startup if available to indicate to the sequencer that we are running. The periodic interval is based on the host clock not in sequencer time, however any drift is likely insignificant for the purpose of the sequencer acknowledgements (pruning hourly/daily). Errors are logged at error level - periodic failures are likely not problematic however continuous errors could eventually be problematic for the sequencer operator.
- final case class RecordingConfig(directory: Path, filename: Option[String] = None) extends Product with Serializable
Configuration for where to record sequencer sends and events to.
Configuration for where to record sequencer sends and events to.
- directory
Root directory for holding all recording files
- filename
Filename that is initially empty and updated to a name based on the member-id at runtime. Use setFilename to ensure this can only be set once.
- sealed trait ReplayAction extends AnyRef
- final case class ReplayConfig(recordingConfig: RecordingConfig, action: ReplayAction) extends Product with Serializable
Configuration for setting up a sequencer client to replay requests or received events.
Configuration for setting up a sequencer client to replay requests or received events.
- recordingConfig
The path to where all recorded content is stored
- action
What type of replay we'll be performing
- trait RequestSigner extends AnyRef
- class ResilientSequencerSubscriberPekko[E] extends FlagCloseable with NamedLogging
Attempts to create a resilient SequencerSubscriptionPekko for the SequencerClient by creating underlying subscriptions using the SequencerSubscriptionFactoryPekko and then recreating them if they fail with a reason that is deemed retryable.
Attempts to create a resilient SequencerSubscriptionPekko for the SequencerClient by creating underlying subscriptions using the SequencerSubscriptionFactoryPekko and then recreating them if they fail with a reason that is deemed retryable. If a subscription is closed or fails with a reason that is not retryable the failure will be passed downstream from this subscription. We determine whether an error is retryable by calling the SubscriptionErrorRetryPolicy of the supplied SequencerSubscriptionFactoryPekko. We also will delay recreating subscriptions by an interval determined by the com.digitalasset.canton.sequencing.client.SubscriptionRetryDelayRule. The recreated subscription starts at the last event received, or at the starting counter that was given initially if no event was received at all.
The emitted events stutter whenever the subscription is recreated.
- class ResilientSequencerSubscription[HandlerError] extends SequencerSubscription[HandlerError] with NamedLogging with CloseableAtomicHealthComponent with FlagCloseableAsync
Attempts to create a resilient SequencerSubscription for the SequencerClient by creating underlying subscriptions using the com.digitalasset.canton.sequencing.client.transports.SequencerClientTransport and then recreating them if they fail with a reason that is deemed retryable.
Attempts to create a resilient SequencerSubscription for the SequencerClient by creating underlying subscriptions using the com.digitalasset.canton.sequencing.client.transports.SequencerClientTransport and then recreating them if they fail with a reason that is deemed retryable. If a subscription is closed or fails with a reason that is not retryable the failure will be passed upstream from this subscription. We determine whether an error is retryable by calling the supplied SubscriptionErrorRetryPolicy. We also will delay recreating subscriptions by an interval determined by the com.digitalasset.canton.sequencing.client.SubscriptionRetryDelayRule. As we have to know where to restart a subscription from when it is recreated we use a com.digitalasset.canton.sequencing.handlers.CounterCapture handler wrapper to keep track of the last event that was successfully provided by the provided handler, and use this value to restart new subscriptions from. For this subscription ResilientSequencerSubscription.start must be called for the underlying subscriptions to begin.
- sealed trait SendAsyncClientError extends Product with Serializable with PrettyPrinting
Errors returned from the AsyncSend where we are sure the request has not potentially been accepted by the server so may be retried using a new message id (as a tracked message id for the failed request may remain in the pending send set).
Errors returned from the AsyncSend where we are sure the request has not potentially been accepted by the server so may be retried using a new message id (as a tracked message id for the failed request may remain in the pending send set). If a technical error is encountered by the sequencer client where there is a chance that the send will be sequenced it should not be returned to the caller through this error.
- type SendCallback = (UnlessShutdown[SendResult]) => Unit
Signature for callbacks provided to the send operation to take advantage of the SendTracker to provide tracking of the eventual send result.
Signature for callbacks provided to the send operation to take advantage of the SendTracker to provide tracking of the eventual send result. Callback is ephemeral and will be lost if the SequencerClient is recreated or the process exits.
- See also
- sealed trait SendResult extends Product with Serializable
Possible outcomes for a send operation can be observed by a SequencerClient
- class SendTracker extends NamedLogging with FlagCloseableAsync with AutoCloseable
When a we make a send request to the sequencer it will not be sequenced until some point in the future and may not be sequenced at all.
When a we make a send request to the sequencer it will not be sequenced until some point in the future and may not be sequenced at all. To track a request call
send
with the messageId and max-sequencing-time of the request, the tracker then observes sequenced events and will notify the provided handler whether the send times out. - sealed trait SendType extends AnyRef
What type of message is being sent.
What type of message is being sent. Used by the domain and surrounding infrastructure for prioritizing send requests.
- sealed trait SequencedEventValidationError[+E] extends Product with Serializable with PrettyPrinting
- trait SequencedEventValidator extends AutoCloseable
Validate whether a received event is valid for processing.
- trait SequencedEventValidatorFactory extends AnyRef
- class SequencedEventValidatorImpl extends SequencedEventValidator with FlagCloseable with HasCloseContext with NamedLogging
Validate whether a received event is valid for processing.
- trait SequencerClient extends SequencerClientSend with FlagCloseable
- final case class SequencerClientConfig(eventInboxSize: PositiveInt = PositiveInt.tryCreate(100), startupConnectionRetryDelay: NonNegativeFiniteDuration = NonNegativeFiniteDuration.ofSeconds(1), initialConnectionRetryDelay: NonNegativeFiniteDuration = NonNegativeFiniteDuration.ofMillis(50), warnDisconnectDelay: NonNegativeFiniteDuration = NonNegativeFiniteDuration.ofSeconds(5), maxConnectionRetryDelay: NonNegativeFiniteDuration = NonNegativeFiniteDuration.ofSeconds(30), handshakeRetryAttempts: NonNegativeInt = NonNegativeInt.tryCreate(50), handshakeRetryDelay: NonNegativeFiniteDuration = NonNegativeFiniteDuration.ofSeconds(5), defaultMaxSequencingTimeOffset: NonNegativeFiniteDuration = NonNegativeFiniteDuration.ofMinutes(5), acknowledgementInterval: NonNegativeFiniteDuration = NonNegativeFiniteDuration.ofMinutes(1), keepAliveClient: Option[KeepAliveClientConfig] = Some(KeepAliveClientConfig()), authToken: AuthenticationTokenManagerConfig = AuthenticationTokenManagerConfig(), optimisticSequencedEventValidation: Boolean = true, skipSequencedEventValidation: Boolean = false, overrideMaxRequestSize: Option[NonNegativeInt] = None, maximumInFlightEventBatches: PositiveInt = PositiveInt.tryCreate(20)) extends Product with Serializable
Client configured options for how to connect to a sequencer
Client configured options for how to connect to a sequencer
- eventInboxSize
The size of the inbox queue used to store received events. Must be at least one. Events in the inbox are processed in parallel. A larger inbox may result in higher throughput at the price of higher memory consumption, larger database queries, and longer crash recovery.
- startupConnectionRetryDelay
Initial delay before we attempt to establish an initial connection
- initialConnectionRetryDelay
Initial delay before a reconnect attempt
- warnDisconnectDelay
Consider sequencer to be degraded after delay
- maxConnectionRetryDelay
Maximum delay before a reconnect attempt
- handshakeRetryAttempts
How many attempts should we make to get a handshake response
- handshakeRetryDelay
How long to delay between attempts to fetch a handshake response
- defaultMaxSequencingTimeOffset
if no max-sequencing-time is supplied to send, our current time will be offset by this amount
- acknowledgementInterval
Controls how frequently the client acknowledges how far it has successfully processed to the sequencer which allows the sequencer to remove this data when pruning.
- authToken
configuration settings for the authentication token manager
- optimisticSequencedEventValidation
if true, sequenced event signatures will be validated first optimistically and only strict if the optimistic evaluation failed. this means that for a split second, we might still accept an event signed with a key that has just been revoked.
- skipSequencedEventValidation
if true, sequenced event validation will be skipped. the default setting is false. this option should only be enabled if a defective validation is blocking processing. therefore, unless you know what you are doing, you shouldn't touch this setting.
- overrideMaxRequestSize
overrides the maxRequestSize configured in the dynamic domain parameters. If overrideMaxRequestSize, is set, modifying the maxRequestSize won't have any effect.
- maximumInFlightEventBatches
The maximum number of event batches that the system will process concurrently. Setting the
maximumInFlightEventBatches
parameter limits the number of event batches that the system will process simultaneously, preventing overload and ensuring that the system can handle the workload effectively. A higher value ofmaximumInFlightEventBatches
can lead to increased throughput, but at the cost of higher memory consumption and longer processing times for each batch. A lower value ofmaximumInFlightEventBatches
may limit throughput, but can result in more stable and predictable system behavior.
- trait SequencerClientFactory extends AnyRef
- class SequencerClientImpl extends SequencerClient with FlagCloseableAsync with NamedLogging with HasFlushFuture with Spanning with HasCloseContext
The sequencer client facilitates access to the individual domain sequencer.
The sequencer client facilitates access to the individual domain sequencer. A client centralizes the message signing operations, as well as the handling and storage of message receipts and delivery proofs, such that this functionality does not have to be duplicated throughout the participant node.
- trait SequencerClientSend extends AnyRef
- sealed trait SequencerClientSubscriptionError extends Product with Serializable
- final case class SequencerClientSubscriptionException(error: SequencerClientSubscriptionError) extends RuntimeException with Product with Serializable
- Annotations
- @SuppressWarnings()
- trait SequencerClientTransportFactory extends AnyRef
- trait SequencerSubscription[HandlerError] extends FlagCloseableAsync with NamedLogging
A running subscription to a sequencer.
A running subscription to a sequencer. Can be closed by the consumer or the producer. Once closed the closeReason value will be fulfilled with the reason the subscription was closed. Implementations are expected to immediately start their subscription unless otherwise stated. If close is called while the handler is running closeReason should not be completed until the handler has completed.
- sealed trait SequencerSubscriptionCreationError extends SubscriptionError
Errors that may occur on the creation of a sequencer subscription
- trait SequencerSubscriptionFactory[HandlerError] extends AnyRef
- trait SequencerSubscriptionFactoryPekko[E] extends AnyRef
- final case class SequencerSubscriptionPekko[+E](source: Source[WithKillSwitch[Either[E, OrdinarySerializedEvent]], (KillSwitch, Future[Done])], health: HealthComponent) extends Product with Serializable
Wrapper for an Pekko source delivering the stream of sequenced events.
Wrapper for an Pekko source delivering the stream of sequenced events. The org.apache.pekko.stream.KillSwitch can be used to terminate the stream. The materialized scala.concurrent.Future completes after the internal processing in the source has finished after having been closed through the org.apache.pekko.stream.KillSwitch.
- final case class SequencerTransportState(transport: SequencerTransportContainer, subscription: Option[Subscription] = None) extends Product with Serializable
- class SequencersTransportState extends NamedLogging with FlagCloseable
- sealed trait SubscriptionCloseReason[+E] extends AnyRef
Why did the sequencer subscription terminate
- trait SubscriptionErrorRetryPolicy extends AnyRef
Policy for what errors are considered retryable.
Policy for what errors are considered retryable. Each transports.SequencerClientTransport is expected to supply their own policy which can consider error types they have defined.
- trait SubscriptionErrorRetryPolicyPekko[-E] extends AnyRef
Policy for what errors are considered retryable.
Policy for what errors are considered retryable. Each transports.SequencerClientTransport is expected to supply their own policy which can consider error types they have defined.
- trait SubscriptionRetryDelayRule extends AnyRef
Calculator for how to select the next retry duration and specifies what duration is enough to log a warning.
Value Members
- object DelayedSequencerClient extends Serializable
- object GrpcSequencerAuthenticationSupport
- case object NoDelay extends DelaySequencedEvent with Product with Serializable
- object PeriodicAcknowledgements
- object ReplayAction
- object ReplayConfig extends Serializable
- object RequestSigner
- object ResilientSequencerSubscriberPekko
- object ResilientSequencerSubscription extends SequencerSubscriptionErrorGroup
- object SendAsyncClientError extends Serializable
- object SendCallback
Utilities for a SendCallback passed to the send method of the SequencerClient
- object SendResult extends Serializable
- object SendType
- object SequencedEventValidationError extends Serializable
- object SequencedEventValidator extends HasLoggerName
- object SequencedEventValidatorFactory
- object SequencedEventValidatorImpl
- object SequencerClient
- object SequencerClientFactory
- object SequencerClientSubscriptionError extends Serializable
- object SequencerClientTransportFactory
- object SequencerSubscriptionError extends SequencerSubscriptionErrorGroup
- object SequencerSubscriptionFactoryPekko
- object SequencerTransportState extends Serializable
- object SubscriptionCloseReason
- object SubscriptionErrorRetryPolicy
- object SubscriptionErrorRetryPolicyPekko
- object SubscriptionRetryDelayRule